|
|
@@ -5,6 +5,7 @@ import java.util.*;
|
|
5
|
5
|
|
|
6
|
6
|
import javax.annotation.Resource;
|
|
7
|
7
|
|
|
|
8
|
+import com.alibaba.fastjson.JSONArray;
|
|
8
|
9
|
import com.chinaitop.depot.storage.mapper.StorageQualitycheckMapper;
|
|
9
|
10
|
import com.chinaitop.depot.storage.model.StorageQualitycheck;
|
|
10
|
11
|
import com.chinaitop.depot.storage.model.StorageQualitycheckExample;
|
|
|
@@ -19,8 +20,8 @@ import com.chinaitop.depot.unissoft.model.ResponseEntity;
|
|
19
|
20
|
|
|
20
|
21
|
@Service
|
|
21
|
22
|
public class PushcheckServiceImpl implements PushscheckService {
|
|
22
|
|
-
|
|
23
|
|
- final static Logger logger = LoggerFactory.getLogger(PushcheckServiceImpl.class );
|
|
|
23
|
+
|
|
|
24
|
+ final static Logger logger = LoggerFactory.getLogger(PushcheckServiceImpl.class );
|
|
24
|
25
|
|
|
25
|
26
|
|
|
26
|
27
|
@Resource
|
|
|
@@ -28,23 +29,38 @@ public class PushcheckServiceImpl implements PushscheckService {
|
|
28
|
29
|
|
|
29
|
30
|
@Transactional(rollbackFor = Exception.class)
|
|
30
|
31
|
@Override
|
|
31
|
|
- public String downFcInfo(String orgId,String cfId,String hwId) {
|
|
32
|
|
- StorageQualitycheck check = new StorageQualitycheck();
|
|
33
|
|
- check.setOrgId(Integer.valueOf(orgId));
|
|
34
|
|
- check.setHouseId(Integer.valueOf(cfId));
|
|
35
|
|
- check.setWarehouseId(Integer.valueOf(hwId));
|
|
36
|
|
- List<StorageQualitycheck> checkList =qualitycheckMapper.selectfc(check);
|
|
37
|
|
- SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
38
|
|
- String datetime = date.format(checkList.get(0).getSealDate());
|
|
39
|
|
- String fcNumber = checkList.get(0).getNumber();
|
|
|
32
|
+ public String downFcInfo(String orgId,String cfId,String hwId) {//
|
|
40
|
33
|
Map<String,Object> mapData = new HashMap<String, Object>();
|
|
41
|
|
- mapData.put("success", "true");
|
|
42
|
|
- mapData.put("fctime", datetime);
|
|
43
|
|
- mapData.put("fcNumber", fcNumber);
|
|
44
|
|
- return JSON.toJSONString(ResponseEntity.ok(mapData));
|
|
|
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
|
+
|
|
45
|
62
|
|
|
46
|
|
-//提交
|
|
47
|
63
|
}
|
|
48
|
64
|
|
|
49
|
65
|
|
|
50
|
|
-}
|
|
|
66
|
+}
|