소스 검색

Merge branch 'dev' of http://101.36.160.140:21044/depot-qinghai/depot-qualitycheck-qinghai into dev

ZeroLiYi 1 년 전
부모
커밋
cd37602fdd

+ 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());

+ 2 - 2
src/main/java/com/chinaitop/depot/storage/mapper/StorageKcglJkqyqDefaultMapper.xml

@@ -320,8 +320,8 @@
320 320
 	a.ch,
321 321
 	a.hwh
322 322
 	FROM
323
-		crk_qh.data_kcgl_fcbgz_default a
324
-	LEFT JOIN crk_qh.data_kcgl_xckc_default b ON a.DataID = b.DataID
323
+		data_kcgl_fcbgz_default a
324
+	LEFT JOIN data_kcgl_xckc_default b ON a.DataID = b.DataID
325 325
 	LEFT JOIN depot_qh.business_delivery_storage_notice c ON b.tzdh = c.bill_number
326 326
 	LEFT JOIN depot_qh.business_plan d ON  c.plan_number = d.plan_number
327 327
 	<where>

+ 1 - 1
src/main/java/com/chinaitop/depot/storage/mapper/StorageStorehouseBusinessMapper.xml

@@ -370,7 +370,7 @@
370 370
         'OFF' nhlstatus,
371 371
         '1' remark
372 372
         from
373
-        crk_qh.data_kcgl_fcbgz_default fcbgz inner join basic_storehouse bs on fcbgz.ch = bs.storehouse_id
373
+        data_kcgl_fcbgz_default fcbgz inner join basic_storehouse bs on fcbgz.ch = bs.storehouse_id
374 374
         <if test="byId == 1">
375 375
           WHERE 1=1 AND NOT EXISTS(
376 376
               SELECT 1 FROM storage_storehouse_business ssb WHERE ssb.storehouse_id = fcbgz.ch AND ssb.warehouse_id = fcbgz.hwh