Просмотр исходного кода

Merge branch 'dev-1.6.3' of depot-qinghai/depot-qualitycheck-qinghai into dev

hanqingsong 1 год назад
Родитель
Сommit
b4510fcbb9

+ 24 - 21
src/main/java/com/chinaitop/depot/qualityControl/service/impl/QualityInspectionServiceImpl.java

@@ -52,28 +52,8 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
52 52
     @Transactional(rollbackFor = Exception.class)
53 53
     @Override
54 54
     public int save(BusinessQcQualityInspection saveParam) {
55
-        // 查询最后一个顺序号
56
-        Map<String, Object> map = new HashMap<>();
57
-        map.put("orgId", saveParam.getOrgId());
58
-        map.put("basicStorehouseId", saveParam.getBasicStorehouseId());
59
-        map.put("warehouseId", saveParam.getWarehouseId());
60
-        String xh = qualityInspectionMapper.selectOnly(map);
61
-        // 初始化
62
-        int num = 1;
63
-        if (!StringUtils.isEmpty(xh)) {
64
-            String substring = xh.substring(xh.length() - 4);
65
-            int i = Integer.parseInt(substring);
66
-            if (i < 9999)
67
-                num += i;
68
-        }
69 55
         // 生成质检报告单(检验类别+检验日期(yyyyMMdd)+4位顺序号组成)
70
-        saveParam.setZjbgdh(
71
-                String.format(
72
-                        "%s%s%s", saveParam.getJylb(),
73
-                        DateUtil.getYMD(saveParam.getJysj()),
74
-                        GenerateNumberUtil.integerToString(4, num)
75
-                )
76
-        );
56
+        saveParam.setZjbgdh(this.GetZjbgdh(saveParam));
77 57
         Date date = new Date();
78 58
         saveParam.setCreatedate(date);
79 59
         saveParam.setUpdatedate(date);
@@ -98,6 +78,29 @@ public class QualityInspectionServiceImpl implements QualityInspectionService {
98 78
         return insert;
99 79
     }
100 80
 
81
+    // // 生成质检报告单(检验类别+检验日期(yyyyMMdd)+4位顺序号组成)
82
+    private synchronized String GetZjbgdh(BusinessQcQualityInspection saveParam) {
83
+        // 查询最后一个顺序号
84
+        Map<String, Object> map = new HashMap<>();
85
+        map.put("orgId", saveParam.getOrgId());
86
+        map.put("basicStorehouseId", saveParam.getBasicStorehouseId());
87
+        map.put("warehouseId", saveParam.getWarehouseId());
88
+        String xh = qualityInspectionMapper.selectOnly(map);
89
+        // 初始化
90
+        int num = 1;
91
+        if (!StringUtils.isEmpty(xh)) {
92
+            String substring = xh.substring(xh.length() - 4);
93
+            int i = Integer.parseInt(substring);
94
+            if (i < 9999)
95
+                num += i;
96
+        }
97
+        return String.format(
98
+                "%s%s%s", saveParam.getJylb(),
99
+                DateUtil.getYMD(saveParam.getJysj()),
100
+                GenerateNumberUtil.integerToString(4, num)
101
+        );
102
+    }
103
+
101 104
     @Override
102 105
     public PageInfo<BusinessQcQualityInspection> getPageList(BusinessQcQualityInspectionPage pageParam) {
103 106
         PageHelper.startPage(pageParam.getPageNum(), pageParam.getPageSize());