|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+package com.chinaitop.depot.pushs.service.impl;
|
|
|
2
|
+
|
|
|
3
|
+import java.text.SimpleDateFormat;
|
|
|
4
|
+import java.util.*;
|
|
|
5
|
+
|
|
|
6
|
+import javax.annotation.Resource;
|
|
|
7
|
+
|
|
|
8
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
9
|
+import com.chinaitop.depot.storage.mapper.StorageQualitycheckMapper;
|
|
|
10
|
+import com.chinaitop.depot.storage.model.StorageQualitycheck;
|
|
|
11
|
+import com.chinaitop.depot.storage.model.StorageQualitycheckExample;
|
|
|
12
|
+import org.slf4j.Logger;
|
|
|
13
|
+import org.slf4j.LoggerFactory;
|
|
|
14
|
+import org.springframework.stereotype.Service;
|
|
|
15
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
16
|
+
|
|
|
17
|
+import com.alibaba.fastjson.JSON;
|
|
|
18
|
+import com.chinaitop.depot.pushs.service.PushscheckService;
|
|
|
19
|
+import com.chinaitop.depot.unissoft.model.ResponseEntity;
|
|
|
20
|
+
|
|
|
21
|
+@Service
|
|
|
22
|
+public class PushcheckServiceImpl implements PushscheckService {
|
|
|
23
|
+
|
|
|
24
|
+ final static Logger logger = LoggerFactory.getLogger(PushcheckServiceImpl.class );
|
|
|
25
|
+
|
|
|
26
|
+
|
|
|
27
|
+ @Resource
|
|
|
28
|
+ private StorageQualitycheckMapper qualitycheckMapper;
|
|
|
29
|
+
|
|
|
30
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
31
|
+ @Override
|
|
|
32
|
+ public String downFcInfo(String orgId,String cfId,String hwId) {//
|
|
|
33
|
+ Map<String,Object> mapData = new HashMap<String, Object>();
|
|
|
34
|
+ try{
|
|
|
35
|
+ StorageQualitycheck check = new StorageQualitycheck();
|
|
|
36
|
+ check.setOrgId(Integer.valueOf(orgId));
|
|
|
37
|
+ check.setHouseId(Integer.valueOf(cfId));
|
|
|
38
|
+ check.setWarehouseId(Integer.valueOf(hwId));
|
|
|
39
|
+ List<StorageQualitycheck> checkList =qualitycheckMapper.selectfc(check);
|
|
|
40
|
+ SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
41
|
+ String datetime = date.format(checkList.get(0).getSealDate());
|
|
|
42
|
+ String fcNumber = checkList.get(0).getNumber();
|
|
|
43
|
+ mapData.put("success", "true");
|
|
|
44
|
+ mapData.put("fctime", datetime);
|
|
|
45
|
+ mapData.put("fcNumber", fcNumber);
|
|
|
46
|
+ return JSON.toJSONString(ResponseEntity.ok(mapData));
|
|
|
47
|
+ }catch (NumberFormatException e) {
|
|
|
48
|
+ logger.info("未查询到结果");
|
|
|
49
|
+ e.printStackTrace();
|
|
|
50
|
+ mapData.put("success", "false");
|
|
|
51
|
+ mapData.put("msg", "根据该条件,未查询到结果");
|
|
|
52
|
+ } finally {
|
|
|
53
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
54
|
+ if (mapData.size()==0) {
|
|
|
55
|
+ mapData.put("success", "false");
|
|
|
56
|
+ mapData.put("msg", "根据该条件,未查询到结果");
|
|
|
57
|
+ }
|
|
|
58
|
+ jsonArray.add(mapData);
|
|
|
59
|
+ return jsonArray.toString();
|
|
|
60
|
+ }
|
|
|
61
|
+
|
|
|
62
|
+
|
|
|
63
|
+ }
|
|
|
64
|
+
|
|
|
65
|
+
|
|
|
66
|
+}
|