Explorar el Código

Merge branch 'master' of crk-java-qinghai/armyfoodSrcQh into dev

TangSong hace 4 meses
padre
commit
ee7b8376c2
Se han modificado 42 ficheros con 581 adiciones y 144 borrados
  1. 0 18
      crk.iml
  2. 3 1
      src/main/java/com/unis/crk/basic/controller/UserInfoController.java
  3. 3 3
      src/main/java/com/unis/crk/business/qcck/service/impl/DataCrkywCkcmzDefaultServiceImpl.java
  4. 3 0
      src/main/java/com/unis/crk/business/qcck/service/impl/DataCrkywCkcpzDefaultServiceImpl.java
  5. 4 4
      src/main/java/com/unis/crk/business/qcrk/service/impl/DataCrkywCpzDefaultServiceImpl.java
  6. 4 4
      src/main/java/com/unis/crk/business/qcrk/service/impl/DataCrkywQyxxDefaultServiceImpl.java
  7. 11 7
      src/main/java/com/unis/crk/business/qcrk/service/impl/DataCrkywTzdxxDefaultServiceImpl.java
  8. 18 0
      src/main/java/com/unis/crk/common/controller/BillnonewController.java
  9. 27 0
      src/main/java/com/unis/crk/common/mapper/BizflowtrailMapper.java
  10. 8 0
      src/main/java/com/unis/crk/common/service/IBillnonewService.java
  11. 9 0
      src/main/java/com/unis/crk/common/service/IBizflowtrailService.java
  12. 11 0
      src/main/java/com/unis/crk/common/service/impl/BillnonewServiceImpl.java
  13. 61 0
      src/main/java/com/unis/crk/common/service/impl/BizflowtrailServiceImpl.java
  14. 17 0
      src/main/java/com/unis/crk/cplbusiness/controller/DataCrkywCplspDefaultController.java
  15. 24 0
      src/main/java/com/unis/crk/cplbusiness/entity/DataCrkywCplckFlt001.java
  16. 25 0
      src/main/java/com/unis/crk/cplbusiness/entity/DataCrkywCplrkFlt001.java
  17. 13 13
      src/main/java/com/unis/crk/cplbusiness/entity/DataCrkywCplspDefault.java
  18. 8 5
      src/main/java/com/unis/crk/cplbusiness/entity/result/BusinessPgGopsPlanDetailVO.java
  19. 15 5
      src/main/java/com/unis/crk/cplbusiness/entity/result/BusinessPgGopsPlanVO.java
  20. 6 0
      src/main/java/com/unis/crk/cplbusiness/entity/vo/DataCrkywCplspDefaultVo.java
  21. 4 0
      src/main/java/com/unis/crk/cplbusiness/entity/vo/DataKcglCplqckcDefaultVo.java
  22. 2 0
      src/main/java/com/unis/crk/cplbusiness/service/IDataCrkywCplspDefaultService.java
  23. 17 3
      src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCplckDefaultServiceImpl.java
  24. 2 3
      src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCplckFlt001ServiceImpl.java
  25. 7 3
      src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCplrkDefaultServiceImpl.java
  26. 3 3
      src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCplrkFlt001ServiceImpl.java
  27. 67 0
      src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCplspDefaultServiceImpl.java
  28. 4 2
      src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCpltzdxxDefaultServiceImpl.java
  29. 1 0
      src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCpltzdxxFlt001ServiceImpl.java
  30. 14 2
      src/main/java/com/unis/crk/cplbusiness/service/impl/DataKcglCplqckcDefaultServiceImpl.java
  31. 26 0
      src/main/resources/SqlMap/sql.xml
  32. 15 16
      src/main/resources/mapper/business/kcgl/DataKcglXckcDefaultMapper.xml
  33. 2 1
      src/main/resources/mapper/business/qcrk/DataCrkywJyxxDefaultMapper.xml
  34. 19 19
      src/main/resources/mapper/business/qcrk/DataCrkywTzdxxDefaultMapper.xml
  35. 74 0
      src/main/resources/mapper/common/BizflowtrailMapper.xml
  36. 4 0
      src/main/resources/mapper/cplbusiness/DataCrkywCplckFlt001Mapper.xml
  37. 4 0
      src/main/resources/mapper/cplbusiness/DataCrkywCplrkFlt001Mapper.xml
  38. 4 1
      src/main/resources/mapper/cplbusiness/DataCrkywCplspDefaultMapper.xml
  39. 5 3
      src/main/resources/mapper/cplbusiness/DataCrkywCpltzdxxDefaultMapper.xml
  40. 3 1
      src/main/resources/mapper/cplbusiness/DataKcglCplkcswDefaultMapper.xml
  41. 26 19
      src/main/resources/mapper/cplbusiness/DataKcglCplqckcDefaultMapper.xml
  42. 8 8
      src/main/resources/mapper/cplbusiness/DataKcglCplxckcDefaultMapper.xml

+ 0 - 18
crk.iml

@@ -1,18 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module version="4">
3
-  <component name="FacetManager">
4
-    <facet type="JRebel" name="JRebel">
5
-      <configuration>
6
-        <option name="ideModuleStorage">
7
-          <map>
8
-            <entry key="com.zeroturnaround.jrebel.FormatVersion" value="7.0.0" />
9
-            <entry key="com.zeroturnaround.jrebel.remoting.DeleteUnindexedFiles" value="false" />
10
-            <entry key="com.zeroturnaround.jrebel.remoting.ModuleRemoteServerSelection" value="off" />
11
-            <entry key="jrebelEnabled" value="true" />
12
-            <entry key="lastExternalPluginCheckTime" value="1715758938450" />
13
-          </map>
14
-        </option>
15
-      </configuration>
16
-    </facet>
17
-  </component>
18
-</module>

+ 3 - 1
src/main/java/com/unis/crk/basic/controller/UserInfoController.java

@@ -317,7 +317,9 @@ public class UserInfoController {
317 317
             List<String> roleNames = new ArrayList<>();
318 318
             for (UserRole userRole : userRoles) {
319 319
                 roleIds.add(userRole.getRoleId());
320
-                roleNames.add(roleInfoService.getById(userRole.getRoleId()).getRoleName());
320
+                RoleInfo roleInfo =  roleInfoService.getById(userRole.getRoleId());
321
+                if (roleInfo != null)
322
+                roleNames.add(roleInfo.getRoleName());
321 323
             }
322 324
             userInfoVo.setRoleIds(roleIds);
323 325
             userInfoVo.setRoleNames(roleNames);

+ 3 - 3
src/main/java/com/unis/crk/business/qcck/service/impl/DataCrkywCkcmzDefaultServiceImpl.java

@@ -121,7 +121,7 @@ public class DataCrkywCkcmzDefaultServiceImpl extends ServiceImpl<DataCrkywCkcmz
121 121
             return jsonObject;
122 122
         }
123 123
         //更新通知单
124
-        JSONObject jsonObject2 = dataCrkywTzdxxDefaultService.updateTzdDataQcRk(editZl, matherId,true);
124
+        JSONObject jsonObject2 = dataCrkywTzdxxDefaultService.updateTzdDataQcRkByDepot(editZl, matherId,true);
125 125
         if (!jsonObject2.getBool("success")) {
126 126
             jsonObject.set("msg", jsonObject2.getStr("msg"));
127 127
             throw new RuntimeException(jsonObject2.getStr("msg"));
@@ -185,7 +185,7 @@ public class DataCrkywCkcmzDefaultServiceImpl extends ServiceImpl<DataCrkywCkcmz
185 185
                     throw new RuntimeException("保存仓储数据失败");
186 186
                 }
187 187
                 //更新通知单
188
-                JSONObject jsonObject2 = dataCrkywTzdxxDefaultService.updateTzdDataQcRk(editZl, matherId,true);
188
+                JSONObject jsonObject2 = dataCrkywTzdxxDefaultService.updateTzdDataQcRkByDepot(editZl, matherId,true);
189 189
                 if (!jsonObject2.getBool("success")) {
190 190
                     jsonObject.set("msg", jsonObject2.getStr("msg"));
191 191
                     throw new RuntimeException(jsonObject2.getStr("msg"));
@@ -243,7 +243,7 @@ public class DataCrkywCkcmzDefaultServiceImpl extends ServiceImpl<DataCrkywCkcmz
243 243
                 throw new Exception(jsonObject1.get("msg").toString());
244 244
             }
245 245
             //更新登录通知单
246
-            jsonObject1 = dataCrkywTzdxxDefaultService.updateTzdDataQcRk(editZl,id,true);
246
+            jsonObject1 = dataCrkywTzdxxDefaultService.updateTzdDataQcRkByDepot(editZl,id,true);
247 247
             if (!jsonObject1.getBool("success")) {
248 248
                 jsonObject.set("msg", jsonObject1.getStr("msg"));
249 249
                 throw new RuntimeException(jsonObject1.getStr("msg"));

+ 3 - 0
src/main/java/com/unis/crk/business/qcck/service/impl/DataCrkywCkcpzDefaultServiceImpl.java

@@ -98,6 +98,9 @@ public class DataCrkywCkcpzDefaultServiceImpl extends ServiceImpl<DataCrkywCkcpz
98 98
             throw  new Exception("保存轨迹表失败");
99 99
 //            return  jsonObject;
100 100
         }
101
+        //进行 转圈粮判断
102
+        bizflowtrailService.circleBusinessInfo(entity.getBizNo(),2);
103
+
101 104
         jsonObject.set("success",true);
102 105
         jsonObject.set("msg","保存成功");
103 106
         return jsonObject;

+ 4 - 4
src/main/java/com/unis/crk/business/qcrk/service/impl/DataCrkywCpzDefaultServiceImpl.java

@@ -128,7 +128,7 @@ public class DataCrkywCpzDefaultServiceImpl extends ServiceImpl<DataCrkywCpzDefa
128 128
             return jsonObject;
129 129
         }
130 130
         //更新通知单
131
-        JSONObject jsonObject2 = dataCrkywTzdxxDefaultService.updateTzdDataQcRk(editZl, matherId);
131
+        JSONObject jsonObject2 = dataCrkywTzdxxDefaultService.updateTzdDataQcRkByDepot(editZl, matherId);
132 132
         if (!jsonObject2.getBool("success")) {
133 133
             jsonObject.set("msg", jsonObject2.getStr("msg"));
134 134
             throw new RuntimeException(jsonObject2.getStr("msg"));
@@ -191,7 +191,7 @@ public class DataCrkywCpzDefaultServiceImpl extends ServiceImpl<DataCrkywCpzDefa
191 191
                     throw new RuntimeException("保存仓储数据失败");
192 192
                 }
193 193
                 //更新通知单
194
-                JSONObject jsonObject2 = dataCrkywTzdxxDefaultService.updateTzdDataQcRk(editZl, matherId);
194
+                JSONObject jsonObject2 = dataCrkywTzdxxDefaultService.updateTzdDataQcRkByDepot(editZl, matherId);
195 195
                 if (!jsonObject2.getBool("success")) {
196 196
                     jsonObject.set("msg", jsonObject2.getStr("msg"));
197 197
                     throw new RuntimeException(jsonObject2.getStr("msg"));
@@ -246,8 +246,8 @@ public class DataCrkywCpzDefaultServiceImpl extends ServiceImpl<DataCrkywCpzDefa
246 246
                 jsonObject.set("msg", jsonObject1.get("msg").toString());
247 247
                 throw new Exception(jsonObject1.get("msg").toString());
248 248
             }
249
-            //更新登录通知单
250
-            jsonObject1 = dataCrkywTzdxxDefaultService.updateTzdDataQcRk(editZl,id);
249
+            //更新通知单
250
+            jsonObject1 = dataCrkywTzdxxDefaultService.updateTzdDataQcRkByDepot(editZl,id);
251 251
             if (!jsonObject1.getBool("success")) {
252 252
                 jsonObject.set("msg", jsonObject1.getStr("msg"));
253 253
                 throw new RuntimeException(jsonObject1.getStr("msg"));

+ 4 - 4
src/main/java/com/unis/crk/business/qcrk/service/impl/DataCrkywQyxxDefaultServiceImpl.java

@@ -68,7 +68,6 @@ public class DataCrkywQyxxDefaultServiceImpl extends ServiceImpl<DataCrkywQyxxDe
68 68
     @Transactional(rollbackFor = Exception.class)
69 69
     @SystemLog(module = "原粮入库新增签样", methods = "新增",uploadName = "yuliang.rk")
70 70
     public JSONObject save(Qcrk qcrk) throws  Exception{
71
-        {
72 71
             JSONObject jsonObject = new JSONObject();
73 72
             jsonObject.set("success",false);
74 73
             DataCrkywQyxxDefault entity = qcrk.getDataCrkywQyxxDefault();
@@ -94,12 +93,13 @@ public class DataCrkywQyxxDefaultServiceImpl extends ServiceImpl<DataCrkywQyxxDe
94 93
                 throw  new Exception("保存汽车扦样失败");
95 94
             }
96 95
             if (!saveBizflowtrailEnt(qcrk)) { //保存轨迹表
97
-            throw  new Exception("保存轨迹表失败,检测上一环节[入门登记是否保存]");
98
-        }
96
+             throw  new Exception("保存轨迹表失败,检测上一环节[入门登记是否保存]");
97
+            }
98
+            //进行 转圈粮判断
99
+            bizflowtrailService.circleBusinessInfo(entity.getBizNo(),1);
99 100
             jsonObject.set("success",true);
100 101
             jsonObject.set("msg","保存成功");
101 102
             return jsonObject;
102
-        }
103 103
     }
104 104
     /**
105 105
      *修改汽车入库-扦样表

+ 11 - 7
src/main/java/com/unis/crk/business/qcrk/service/impl/DataCrkywTzdxxDefaultServiceImpl.java

@@ -303,11 +303,12 @@ public class DataCrkywTzdxxDefaultServiceImpl extends ServiceImpl<DataCrkywTzdxx
303 303
     }
304 304
     @Override
305 305
     public List<Map<String,Object>> getTzdList(String unitId, Integer zylx){
306
-        String flowId = "A7B1FDB54DE7B32D6F8067FEFE2BF52F";
306
+        String flowId = "420801654D8F01A7D9FCE01B90A395E6";
307 307
         if (zylx == 2){ //粮油出库
308
-            flowId = "6FD0418CD28A2B3F3E7E9EC0D7429461";
308
+            flowId = "284344D15DCA72D90AA43C24BD4F9B47";
309 309
         }
310
-        return  dataCrkywTzdxxDefaultMapper.getTzdList(unitId,flowId);
310
+//        return  dataCrkywTzdxxDefaultMapper.getTzdList(unitId,flowId);
311
+        return  dataCrkywTzdxxDefaultMapper.getTzdListByDepot(unitId,flowId);
311 312
     }
312 313
     //第二次称重 新增,修改 时将 修改通知单表 剩余数量,如果 称重数据大于 剩余数量 则关闭通知单
313 314
     @Override
@@ -379,7 +380,7 @@ public class DataCrkywTzdxxDefaultServiceImpl extends ServiceImpl<DataCrkywTzdxx
379 380
             flt001UpdateWrapper.set("UPDATE_TIME",null);
380 381
             flt001UpdateWrapper.set("sysl",dir_sy);
381 382
             flt001UpdateWrapper.set("wcsl",dir_wc);
382
-            flt001UpdateWrapper.setSql("UPDATE_TIME=null,wcsl = wcsl-"+editZl+"+"+zl+", sysl = count-wcsl"); //
383
+            flt001UpdateWrapper.setSql("UPDATE_TIME=null,wcsl = wcsl-"+editZl+", sysl = count-wcsl"); //
383 384
             if (!dataCrkywTzdxxFlt001Service.update(flt001UpdateWrapper)) {
384 385
                 jsonObject.set("msg", "更新通知单从表剩余数量失败");
385 386
                 return jsonObject;
@@ -419,7 +420,7 @@ public class DataCrkywTzdxxDefaultServiceImpl extends ServiceImpl<DataCrkywTzdxx
419 420
             Double sl = new Double(list.get(0).get("sl") + ""); //通知单数量
420 421
             Double sysl = new Double(list.get(0).get("sysl") + ""); //通知单剩余数量
421 422
             Double wcsl = new Double(list.get(0).get("wcsl") + ""); //通知单完成数量
422
-            String dataId = list.get(0).getOrDefault("dataId","").toString(); //通知单数据Id
423
+             String dataId = list.get(0).getOrDefault("dataId","").toString(); //通知单数据Id
423 424
             String tzdcbid = list.get(0).getOrDefault("tzdcbid","").toString(); //从表通知单数据Id
424 425
             if (StrUtil.isBlank(dataId)){ //表示通知单已经不存在
425 426
                 jsonObject.set("msg", "通知单["+list.get(0).getOrDefault("tzdh","").toString()+"]不存在");
@@ -430,14 +431,17 @@ public class DataCrkywTzdxxDefaultServiceImpl extends ServiceImpl<DataCrkywTzdxx
430 431
             Double dir_sy = sl - dir_wc > 0.0 ? sl - dir_wc : 0.0;
431 432
 
432 433
             if(sysl-editZl<0){
433
-                jsonObject.set("msg", "卸重量大于通知单剩余数量");
434
+                jsonObject.set("msg", "卸重量大于通知单剩余数量");
434 435
                 return jsonObject;
435 436
             }
436 437
             //更新库级主从表完成数量与剩余数理
438
+        dir_sy = dir_sy/1000; //单位吨
439
+        dir_wc = dir_wc/1000; //单位吨
440
+        editZl = editZl/1000; //单位吨
437 441
         sql = " UPDATE BUSINESS_DELIVERY_STORAGE_NOTICE SET remain_quantity ='" + dir_sy + "',complete_quantity ='" + dir_wc + "' where id = '" + dataId + "'; ";
438 442
         //有从表Id,并且是汽车出入库
439 443
         if (StringUtils.isNotBlank(tzdcbid)) {
440
-            sql += "UPDATE BUSINESS_STORE_WARE_DETAIL SET complete_quantity = wcsl+"+editZl+"+"+zl+", remain_quantity = if(in_count >0,in_count,out_count)-complete_quantity where id  ='"+tzdcbid+"'";
444
+            sql += "UPDATE BUSINESS_STORE_WARE_DETAIL SET complete_quantity = IFNULL(complete_quantity,0)+"+editZl+", remain_quantity = (case when in_count > 0 then in_count ELSE out_count end)-complete_quantity where id  ='"+tzdcbid+"'";
441 445
         }
442 446
         billnonewgjjMapper.executeUpdate(sql);
443 447
 

+ 18 - 0
src/main/java/com/unis/crk/common/controller/BillnonewController.java

@@ -33,6 +33,24 @@ public class BillnonewController {
33 33
 
34 34
 
35 35
     /**
36
+     * 得到商品编号
37
+     * @param unitId 单位id
38
+     * @return
39
+     */
40
+    @ApiOperation(value="查询", notes="得到商品编号")
41
+    @GetMapping("getScbh/{unitId}")
42
+    public ResultUtil getScbh(@PathVariable("unitId") String unitId){
43
+        LOGGER.info("入参为:{}",unitId);
44
+        ResultUtil data = new ResultUtil();
45
+        if (StringUtils.isEmpty(unitId)){
46
+            data.failed("传入的单位id为空");
47
+            return data;
48
+        }
49
+        data.success(this.billnonewService.getScbh(unitId));
50
+        return data;
51
+    }
52
+
53
+    /**
36 54
      * 得到生产批号
37 55
      * @param unitId 单位id
38 56
      * @param spbh 商品编号

+ 27 - 0
src/main/java/com/unis/crk/common/mapper/BizflowtrailMapper.java

@@ -2,6 +2,10 @@ package com.unis.crk.common.mapper;
2 2
 
3 3
 import com.unis.crk.common.entity.Bizflowtrail;
4 4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Param;
6
+import org.springframework.security.core.parameters.P;
7
+
8
+import java.util.Map;
5 9
 
6 10
 /**
7 11
  * <p>
@@ -12,5 +16,28 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
12 16
  * @since 2021-09-28
13 17
  */
14 18
 public interface BizflowtrailMapper extends BaseMapper<Bizflowtrail> {
19
+    /**
20
+     * 根据方向查询单位,品种,车牌号及业务日期
21
+     * @param bizNo
22
+     * @param direction
23
+     * @return
24
+     */
25
+    Map<String,Object> getCrkPzInfo(@Param("bizNo") String bizNo, @Param("direction") Integer direction);
15 26
 
27
+    /**
28
+     * 得到转圈粮信息
29
+     * @param unitId
30
+     * @param lspz
31
+     * @param beginDay
32
+     * @param endDay
33
+     * @param cph
34
+     * @param direction
35
+     * @return
36
+     */
37
+    Map<String,Object> getCircleBusinessInfo(@Param("unitId")String unitId,
38
+                                             @Param("lspz")String lspz,
39
+                                             @Param("beginDay")String beginDay,
40
+                                             @Param("endDay")String endDay,
41
+                                             @Param("cph")String cph,
42
+                                             @Param("direction") Integer direction);
16 43
 }

+ 8 - 0
src/main/java/com/unis/crk/common/service/IBillnonewService.java

@@ -188,4 +188,12 @@ public interface IBillnonewService extends IService<Billnonew> {
188 188
     String getFjDh(String unitId);
189 189
 
190 190
     String getScpcbySp(String unitId, String spbh, String scrq,String scpc);
191
+
192
+    /**
193
+     *
194
+     * 得到商品编号
195
+     * @param unitId
196
+     * @return
197
+     */
198
+    String getScbh(String unitId);
191 199
 }

+ 9 - 0
src/main/java/com/unis/crk/common/service/IBizflowtrailService.java

@@ -1,5 +1,6 @@
1 1
 package com.unis.crk.common.service;
2 2
 
3
+import cn.hutool.json.JSONObject;
3 4
 import com.unis.crk.common.entity.Bizflowtrail;
4 5
 import com.baomidou.mybatisplus.extension.service.IService;
5 6
 
@@ -13,4 +14,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
13 14
  */
14 15
 public interface IBizflowtrailService extends IService<Bizflowtrail> {
15 16
 
17
+    /**
18
+     *查询转圈粮
19
+     * @param bizNo 单据号
20
+     * @param direction 方向:1;入库,2;出库
21
+     * @return
22
+     */
23
+    JSONObject circleBusinessInfo(String bizNo, int direction);
24
+
16 25
 }

+ 11 - 0
src/main/java/com/unis/crk/common/service/impl/BillnonewServiceImpl.java

@@ -254,6 +254,17 @@ public class BillnonewServiceImpl extends ServiceImpl<BillnonewMapper, Billnonew
254 254
         return spbh+date+"_"+gys;
255 255
     }
256 256
 
257
+    /**
258
+     * 得到商品编号
259
+     *
260
+     * @param unitId
261
+     * @return
262
+     */
263
+    @Override
264
+    public String getScbh(String unitId) {
265
+        return  createNewNo("SP_",unitId,"data_crkyw_cplsp_default","sjjlspmcbh",6);
266
+    }
267
+
257 268
     @Override
258 269
     public String getCpljsBizNo(String unitId) {
259 270
         return createNewNo("",unitId,"settlement_management","js",3);

+ 61 - 0
src/main/java/com/unis/crk/common/service/impl/BizflowtrailServiceImpl.java

@@ -1,11 +1,22 @@
1 1
 package com.unis.crk.common.service.impl;
2 2
 
3
+import cn.hutool.core.date.DateUtil;
4
+import cn.hutool.json.JSONObject;
3 5
 import com.unis.crk.common.entity.Bizflowtrail;
6
+import com.unis.crk.common.mapper.BillnonewgjjMapper;
4 7
 import com.unis.crk.common.mapper.BizflowtrailMapper;
5 8
 import com.unis.crk.common.service.IBizflowtrailService;
6 9
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
10
+import com.unis.crk.utils.SqpMapUtil;
11
+import lombok.experimental.var;
12
+import org.springframework.beans.factory.annotation.Autowired;
7 13
 import org.springframework.stereotype.Service;
8 14
 
15
+import javax.annotation.Resource;
16
+import java.util.Date;
17
+import java.util.Dictionary;
18
+import java.util.Map;
19
+
9 20
 /**
10 21
  * <p>
11 22
  * 数据流程节点轨迹记录表 服务实现类
@@ -17,5 +28,55 @@ import org.springframework.stereotype.Service;
17 28
 @Service
18 29
 public class BizflowtrailServiceImpl extends ServiceImpl<BizflowtrailMapper, Bizflowtrail> implements IBizflowtrailService {
19 30
 
31
+    @Resource
32
+    private BizflowtrailMapper bizflowtrailMapper;
33
+    @Resource
34
+    private BillnonewgjjMapper billnonewgjjMapper;
35
+
36
+    /**
37
+     * 查询转圈粮
38
+     *
39
+     * @param bizNo     单据号
40
+     * @param direction 方向:1;入库,2;出库
41
+     * @return
42
+     */
43
+    @Override
44
+    public JSONObject circleBusinessInfo(String bizNo, int direction) {
45
+        try {
20 46
 
47
+            //根据方向查询单位,品种,车牌号及业务日期
48
+            Map<String,Object> map = bizflowtrailMapper.getCrkPzInfo(bizNo,direction);
49
+            if (map != null){
50
+                String unitId = map.getOrDefault("unitId","").toString(); //单位id
51
+                String lspz = map.getOrDefault("lspz","").toString(); //品种id
52
+                String lspzName = map.getOrDefault("lspzName","").toString(); //品种id
53
+                String orgName = map.getOrDefault("orgName","").toString(); // 单位名称
54
+                String ywrq = map.getOrDefault("ywrq","").toString(); // 业务日期
55
+                String slr = map.getOrDefault("slr","").toString(); // 客户名称
56
+                String cph = map.getOrDefault("cph","").toString(); // 车牌号
57
+            //得到最近三天内出入库情况
58
+                int DayCount=3;//3天内
59
+                String dateFormat = "yyyy-MM-dd";
60
+                Date ywrq_ = DateUtil.parse(ywrq,dateFormat);
61
+                String beginDay=DateUtil.offsetDay(ywrq_,DayCount*-1).toString(dateFormat); //开始日期,前三天
62
+                String endDay=ywrq; //结束日期
63
+                Map<String,Object> map1 =bizflowtrailMapper.getCircleBusinessInfo(unitId,lspz,beginDay,endDay,cph,direction);
64
+                if (map1 != null){ //表示有转圈粮的可能性
65
+                    String ywrq_1 = map1.getOrDefault("ywrq","").toString(); // 业务日期
66
+                    String cfmc = map1.getOrDefault("cfmc","").toString(); // 仓库名称
67
+                    String sl = map1.getOrDefault("sl","").toString(); // 数量
68
+                    String lsdjName = map1.getOrDefault("lsdjName","").toString(); // 等级名称
69
+                    //写一条预警信息到库级的转圈粮预警信息表中
70
+                    String detail="注意:车牌号【"+cph+"】车辆,"+ywrq_1+"日存在“"+orgName+"”"+
71
+                            cfmc+((direction==1)?"出":"入")+"库记录,粮食品种:"+lspzName+"、粮食数量:"+sl+"kg、粮食等级:"+lsdjName+"。"+
72
+                            "系统自动判断疑为转圈粮!";
73
+                    String addSql = String.format(SqpMapUtil.getSql("INSERT_STORAGEPREVIOLATION"), slr,orgName,detail,unitId);
74
+                    billnonewgjjMapper.executeUpdate(addSql);
75
+                }
76
+            }
77
+        }catch (Exception e){
78
+            e.printStackTrace();
79
+        }
80
+        return null;
81
+    }
21 82
 }

+ 17 - 0
src/main/java/com/unis/crk/cplbusiness/controller/DataCrkywCplspDefaultController.java

@@ -207,5 +207,22 @@ public class DataCrkywCplspDefaultController {
207 207
         return data.success(datas);
208 208
 
209 209
     }
210
+
211
+
212
+    /**
213
+     * shine
214
+     * 生成商品编号
215
+     */
216
+    @ApiOperation(value="*生成商品编号", notes="生成商品编号 orgId+Sp_6位顺序号")
217
+    @GetMapping("getSpbhByOrgId/{orgId}")
218
+    public String getSpbhByOrgId(@PathVariable("orgId") String orgId){
219
+        LOGGER.info("入参为:{}",orgId);
220
+        ResultUtil<DataCrkywCplspDefault> data = new ResultUtil<>();
221
+        if (StringUtils.isEmpty(orgId)){
222
+            data.failed("传入的单位id为空");
223
+            return "0";
224
+        }
225
+        return this.dataCrkywCplspDefaultService.getSpbhByOrgId(orgId);
226
+    }
210 227
 }
211 228
 

+ 24 - 0
src/main/java/com/unis/crk/cplbusiness/entity/DataCrkywCplckFlt001.java

@@ -73,6 +73,18 @@ private static final long serialVersionUID=1L;
73 73
     @TableField("deptId")
74 74
     private String deptId;
75 75
 
76
+    @ApiModelProperty(value = "仓房id")
77
+    private String ch;
78
+
79
+    @ApiModelProperty(value = "货位id")
80
+    private String hwh;
81
+
82
+    @ApiModelProperty(value = "仓房名称")
83
+    private String chmc;
84
+
85
+    @ApiModelProperty(value = "货位名称")
86
+    private String hwmc;
87
+
76 88
     @ApiModelProperty(value = "实际军粮品种名称")
77 89
     private String sjjlpzmc;
78 90
 
@@ -144,4 +156,16 @@ private static final long serialVersionUID=1L;
144 156
 
145 157
     @ApiModelProperty(value = "税率")
146 158
     private Double taxrate;
159
+
160
+    @ApiModelProperty(value = "回显数量")
161
+    @TableField(exist = false)
162
+    private Double sl;
163
+
164
+    @ApiModelProperty(value = "回显件数")
165
+    @TableField(exist = false)
166
+    private Double tzdJs;
167
+
168
+    @ApiModelProperty(value = "回显剩余数量")
169
+    @TableField(exist = false)
170
+    private Double sysl;
147 171
 }

+ 25 - 0
src/main/java/com/unis/crk/cplbusiness/entity/DataCrkywCplrkFlt001.java

@@ -72,6 +72,19 @@ private static final long serialVersionUID=1L;
72 72
     @TableField("deptId")
73 73
     private String deptId;
74 74
 
75
+    @ApiModelProperty(value = "仓房id")
76
+    private String ch;
77
+
78
+    @ApiModelProperty(value = "货位id")
79
+    private String hwh;
80
+
81
+    @ApiModelProperty(value = "仓房名称")
82
+    private String chmc;
83
+
84
+    @ApiModelProperty(value = "货位名称")
85
+    private String hwmc;
86
+
87
+
75 88
     @ApiModelProperty(value = "实际军粮品种名称")
76 89
     private String sjjlpzmc;
77 90
 
@@ -148,4 +161,16 @@ private static final long serialVersionUID=1L;
148 161
 
149 162
     @ApiModelProperty(value = "税率")
150 163
     private Double taxrate;
164
+
165
+    @ApiModelProperty(value = "回显数量")
166
+    @TableField(exist = false)
167
+    private Double sl;
168
+
169
+    @ApiModelProperty(value = "回显件数")
170
+    @TableField(exist = false)
171
+    private Double tzdJs;
172
+
173
+    @ApiModelProperty(value = "回显剩余数量")
174
+    @TableField(exist = false)
175
+    private Double sysl;
151 176
 }

+ 13 - 13
src/main/java/com/unis/crk/cplbusiness/entity/DataCrkywCplspDefault.java

@@ -32,10 +32,10 @@ private static final long serialVersionUID=1L;
32 32
     @TableId(value = "dataId", type = IdType.UUID)
33 33
     private String dataId;
34 34
 
35
-    @ApiModelProperty(value = "单位ID")
35
+    @ApiModelProperty(value = "*单位ID")
36 36
     private String unitid;
37 37
 
38
-    @ApiModelProperty(value = "创建人")
38
+    @ApiModelProperty(value = "*创建人")
39 39
     private String builder;
40 40
 
41 41
 
@@ -58,38 +58,38 @@ private static final long serialVersionUID=1L;
58 58
     @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
59 59
     private Date scrq;
60 60
 
61
-    @ApiModelProperty(value = "保质期")
61
+    @ApiModelProperty(value = "*保质期")
62 62
     private String bzq;
63 63
 
64 64
     @ApiModelProperty(value = "部门id")
65 65
     @TableField("deptId")
66 66
     private String deptId;
67 67
 
68
-    @ApiModelProperty(value = "实际军粮品种名称")
68
+    @ApiModelProperty(value = "*实际军粮品种名称")
69 69
     private String sjjlpzmc;
70 70
 
71
-    @ApiModelProperty(value = "实际军粮品种编号")
71
+    @ApiModelProperty(value = "*实际军粮品种编号")
72 72
     private String sjjlpzbh;
73 73
 
74
-    @ApiModelProperty(value = "实际军粮品牌名称")
74
+    @ApiModelProperty(value = "*实际军粮品牌名称")
75 75
     private String sjjlppmc;
76 76
 
77
-    @ApiModelProperty(value = "实际军粮品牌编号")
77
+    @ApiModelProperty(value = "*实际军粮品牌编号")
78 78
     private String sjjlppbh;
79 79
 
80
-    @ApiModelProperty(value = "实际军粮商品名称")
80
+    @ApiModelProperty(value = "*实际军粮商品名称")
81 81
     private String sjjlspmc;
82 82
 
83
-    @ApiModelProperty(value = "实际军粮商品名称编号")
83
+    @ApiModelProperty(value = "*实际军粮商品名称编号")
84 84
     private String sjjlspmcbh;
85 85
 
86 86
     @ApiModelProperty(value = "生产批次")
87 87
     private String scpc;
88 88
 
89
-    @ApiModelProperty(value = "规格")
89
+    @ApiModelProperty(value = "*规格")
90 90
     private String gg;
91 91
 
92
-    @ApiModelProperty(value = "计量单位")
92
+    @ApiModelProperty(value = "*计量单位")
93 93
     private String jldw;
94 94
 
95 95
     @ApiModelProperty(value = "提前预警天数")
@@ -108,7 +108,7 @@ private static final long serialVersionUID=1L;
108 108
     private String sccsbh;
109 109
 
110 110
 
111
-    @ApiModelProperty(value = "等级")
111
+    @ApiModelProperty(value = "*等级")
112 112
     private String dj;
113 113
     @ApiModelProperty(value = "是否启用1启用2禁用")
114 114
     @TableField(value = "isenable")
@@ -119,7 +119,7 @@ private static final long serialVersionUID=1L;
119 119
     private String zgcs;
120 120
     @ApiModelProperty(value = "是否为统筹采购商品")
121 121
     private String tccg;
122
-    @ApiModelProperty(value = "备注")
122
+    @ApiModelProperty(value = "*备注")
123 123
     private String bz;
124 124
 
125 125
 }

+ 8 - 5
src/main/java/com/unis/crk/cplbusiness/entity/result/BusinessPgGopsPlanDetailVO.java

@@ -1,10 +1,11 @@
1 1
 package com.unis.crk.cplbusiness.entity.result;
2 2
 
3 3
 import com.fasterxml.jackson.annotation.JsonFormat;
4
+import io.swagger.annotations.ApiModel;
4 5
 import io.swagger.annotations.ApiModelProperty;
5
-import lombok.Getter;
6
-import lombok.Setter;
7
-
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
8 9
 import java.math.BigDecimal;
9 10
 import java.util.Date;
10 11
 
@@ -14,8 +15,10 @@ import java.util.Date;
14 15
  * @author TS
15 16
  * @date  2024/07/08 15:42
16 17
  **/
17
-@Getter
18
-@Setter
18
+@Data
19
+@EqualsAndHashCode(callSuper = false)
20
+@Accessors(chain = true)
21
+@ApiModel(value="BusinessPgGopsPlanDetailVO对象", description="成品粮监管-购销计划管理-明细表实体")
19 22
 public class BusinessPgGopsPlanDetailVO {
20 23
 
21 24
     /** 明细记录唯一标识符 */

+ 15 - 5
src/main/java/com/unis/crk/cplbusiness/entity/result/BusinessPgGopsPlanVO.java

@@ -1,9 +1,13 @@
1 1
 package com.unis.crk.cplbusiness.entity.result;
2 2
 
3 3
 import com.fasterxml.jackson.annotation.JsonFormat;
4
+import io.swagger.annotations.ApiModel;
4 5
 import io.swagger.annotations.ApiModelProperty;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
5 8
 import lombok.Getter;
6 9
 import lombok.Setter;
10
+import lombok.experimental.Accessors;
7 11
 
8 12
 import java.math.BigDecimal;
9 13
 import java.util.Date;
@@ -15,13 +19,15 @@ import java.util.List;
15 19
  * @author TS
16 20
  * @date  2024/07/08 15:41
17 21
  **/
18
-@Getter
19
-@Setter
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@ApiModel(value="BusinessPgGopsPlanVO对象", description="成品粮监管-购销计划管理表实体")
20 26
 public class BusinessPgGopsPlanVO {
21 27
 
22 28
     /** 主键ID */
23
-    @ApiModelProperty(value = "主键ID", position = 1)
24
-    private String DataID;
29
+    @ApiModelProperty(value = "计划id", position = 1)
30
+    private String ddid;
25 31
 
26 32
 
27 33
     /** 更新日期 */
@@ -35,7 +41,7 @@ public class BusinessPgGopsPlanVO {
35 41
 
36 42
     /** 计划编号 */
37 43
     @ApiModelProperty(value = "计划编号", position = 4)
38
-    private String tzdbm;
44
+    private String ddbh;
39 45
 
40 46
     /** 计划名称 */
41 47
     @ApiModelProperty(value = "计划名称", position = 5)
@@ -79,5 +85,9 @@ public class BusinessPgGopsPlanVO {
79 85
     @ApiModelProperty(value = "商品名称", position = 15)
80 86
     private String mxpzValue;
81 87
 
88
+    /** 品牌名称 */
89
+    @ApiModelProperty(value = "品牌名称", position = 16)
90
+    private String ppValue;
91
+
82 92
 
83 93
 }

+ 6 - 0
src/main/java/com/unis/crk/cplbusiness/entity/vo/DataCrkywCplspDefaultVo.java

@@ -27,4 +27,10 @@ public class DataCrkywCplspDefaultVo {
27 27
     @ApiModelProperty(value = "规格")
28 28
     String gg;
29 29
 
30
+    @ApiModelProperty(value = "实际军粮商品名称编号")
31
+    String sjjlspmcbh;
32
+
33
+    @ApiModelProperty(value = "业务时间")
34
+    String cjsj;
35
+
30 36
 }

+ 4 - 0
src/main/java/com/unis/crk/cplbusiness/entity/vo/DataKcglCplqckcDefaultVo.java

@@ -24,6 +24,10 @@ public class DataKcglCplqckcDefaultVo {
24 24
     String sjjlpzbh;
25 25
     @ApiModelProperty(value = "商品名称")
26 26
     String sjjlspmc;
27
+    @ApiModelProperty(value = "仓房名称")
28
+    String chmc;
29
+    @ApiModelProperty(value = "货位名称")
30
+    String hwmc;
27 31
     @ApiModelProperty(value = "规格")
28 32
     String gg;
29 33
     @ApiModelProperty(value = "业务时间开始")

+ 2 - 0
src/main/java/com/unis/crk/cplbusiness/service/IDataCrkywCplspDefaultService.java

@@ -65,4 +65,6 @@ public interface IDataCrkywCplspDefaultService extends IService<DataCrkywCplspDe
65 65
         List<DataCrkywCplspDefault> getBySpbhs(List<String> spbhs);
66 66
 
67 67
         List<Map<String,Object>> getCplSpListbydd(String ddId);
68
+
69
+        String getSpbhByOrgId(String orgId);
68 70
 }

+ 17 - 3
src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCplckDefaultServiceImpl.java

@@ -10,6 +10,7 @@ import com.unis.crk.business.kcgl.entity.DataKcglFcbgzDefault;
10 10
 import com.unis.crk.business.qcck.entity.DataCrkywCkcmzDefault;
11 11
 import com.unis.crk.business.qcck.entity.DataCrkywCkcpzDefault;
12 12
 import com.unis.crk.common.entity.Bizflowtrail;
13
+import com.unis.crk.common.service.IBillnonewService;
13 14
 import com.unis.crk.common.service.IDeleteDataRecordService;
14 15
 import com.unis.crk.cplbusiness.entity.*;
15 16
 import com.unis.crk.cplbusiness.mapper.DataCrkywCplckDefaultMapper;
@@ -66,7 +67,8 @@ public class DataCrkywCplckDefaultServiceImpl extends ServiceImpl<DataCrkywCplck
66 67
     private IDispatchEhicleManagementService dispatchEhicleManagementService;
67 68
     @Autowired
68 69
     private IDispatcPersonnelManagementService dispatcPersonnelManagementService;
69
-
70
+    @Autowired
71
+    private IBillnonewService billnonewService;
70 72
 
71 73
 
72 74
     /**
@@ -141,13 +143,16 @@ public class DataCrkywCplckDefaultServiceImpl extends ServiceImpl<DataCrkywCplck
141 143
             throw new Exception("保存成品粮出库失败");
142 144
         }
143 145
         String spmc = "";
144
-                    if("0".equals(param.getIsstaging())){ //
146
+       if("0".equals(param.getIsstaging())){ //
145 147
                 for (int i = 0; i < flt001s.size(); i++) {
146 148
                     //保存从表数据,有错误抛异常
147 149
                     DataCrkywCplckFlt001 flt001 = flt001s.get(i);
148 150
                     flt001.setMainDataId(dataId);// 设置主表ID
149 151
                     flt001.setUnitid(unitId);// 设置单位id
150 152
                     flt001.setIsstaging("0");//设置暂存
153
+                    //得到生产批次
154
+                    String scpc = billnonewService.getScpc(unitId,flt001.getSjjlspmcbh(),DateUtil.format(flt001.getScrq(),"yyyy-MM-dd"),"");
155
+                    flt001.setScpc(scpc);
151 156
                     dataCrkywCplckFlt001Service.save(flt001);
152 157
                     spmc +=flt001.getSjjlspmc()+",";
153 158
                 }
@@ -164,6 +169,9 @@ public class DataCrkywCplckDefaultServiceImpl extends ServiceImpl<DataCrkywCplck
164 169
                     flt001.setMainDataId(dataId);// 设置主表ID
165 170
                     flt001.setUnitid(unitId);// 设置单位id
166 171
                     flt001.setIsstaging("1");//设置保存
172
+                    //得到生产批次
173
+                    String scpc = billnonewService.getScpc(unitId,flt001.getSjjlspmcbh(),DateUtil.format(flt001.getScrq(),"yyyy-MM-dd"),"");
174
+                    flt001.setScpc(scpc);
167 175
                     dataCrkywCplckFlt001Service.saveFlt(flt001);
168 176
 
169 177
                     spmc +=flt001.getSjjlspmc()+",";
@@ -321,8 +329,11 @@ public class DataCrkywCplckDefaultServiceImpl extends ServiceImpl<DataCrkywCplck
321 329
                 flt001.setMainDataId(dataId);// 设置主表ID
322 330
                 flt001.setUnitid(unitId);// 设置单位id
323 331
                 flt001.setIsstaging("1");//设置保存
332
+                //得到生产批次
333
+                String scpc = billnonewService.getScpc(unitId,flt001.getSjjlspmcbh(),DateUtil.format(flt001.getScrq(),"yyyy-MM-dd"),"");
334
+                flt001.setScpc(scpc);
324 335
                 spmc +=flt001.getSjjlspmc()+",";
325
-                dataCrkywCplckFlt001Service.saveFlt(flt001);
336
+                dataCrkywCplckFlt001Service.save(flt001);
326 337
 
327 338
                 spmc +=flt001.getSjjlspmc()+",";
328 339
             }
@@ -343,6 +354,9 @@ public class DataCrkywCplckDefaultServiceImpl extends ServiceImpl<DataCrkywCplck
343 354
                         DataCrkywCplckFlt001 flt001 = insertFlt.get(j);
344 355
                         flt001.setMainDataId(param.getDataId());// 设置主表
345 356
                         flt001.setUnitid(param.getUnitid());//
357
+                        //得到生产批次
358
+                        String scpc = billnonewService.getScpc(unitId,flt001.getSjjlspmcbh(),DateUtil.format(flt001.getScrq(),"yyyy-MM-dd"),"");
359
+                        flt001.setScpc(scpc);
346 360
                         dataCrkywCplckFlt001Service.saveFlt(flt001);
347 361
                     }
348 362
                 }

+ 2 - 3
src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCplckFlt001ServiceImpl.java

@@ -330,14 +330,13 @@ public class DataCrkywCplckFlt001ServiceImpl extends ServiceImpl<DataCrkywCplckF
330 330
         JSONObject jsonObject = new JSONObject();
331 331
         jsonObject.set("success", false);
332 332
         DataCrkywCplckFlt001 flt001  = super.getById(dataId);
333
-        DataCrkywCplckDefault dataCrkywCplckDefault  = dataCrkywCplckDefaultService.getById(flt001.getMainDataId());
334 333
         String sjjlpzbh = flt001.getSjjlpzbh();//品种编号
335 334
         String sjjlppbh = flt001.getSjjlppbh();//品牌编号
336 335
         String sjjlspmcbh = flt001.getSjjlspmcbh();//商品名称编号
337 336
         String scpc = flt001.getScpc();//生产批次
338 337
         String xz = flt001.getXz();//性质
339
-        String ch = dataCrkywCplckDefault.getCh();//仓房
340
-        String hw = dataCrkywCplckDefault.getHwh();//货位
338
+        String ch = flt001.getCh();//仓房
339
+        String hw = flt001.getHwh();//货位
341 340
         String gg = flt001.getGg();//规格
342 341
         String jldw = flt001.getJldw();//计量单位
343 342
 

+ 7 - 3
src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCplrkDefaultServiceImpl.java

@@ -1,5 +1,6 @@
1 1
 package com.unis.crk.cplbusiness.service.impl;
2 2
 
3
+import cn.hutool.core.date.DateUtil;
3 4
 import cn.hutool.core.util.IdUtil;
4 5
 import cn.hutool.core.util.StrUtil;
5 6
 import cn.hutool.json.JSONObject;
@@ -113,6 +114,9 @@ public class DataCrkywCplrkDefaultServiceImpl extends ServiceImpl<DataCrkywCplrk
113 114
             DataCrkywCplrkFlt001 flt001 = flt001s.get(i);
114 115
             flt001.setMainDataId(dataId);// 设置主表ID
115 116
             flt001.setUnitid(unitId);// 设置单位id
117
+            //得到生产批次
118
+            String scpc = billnonewService.getScpc(unitId,flt001.getSjjlspmcbh(),DateUtil.format(flt001.getScrq(),"yyyy-MM-dd"),"");
119
+            flt001.setScpc(scpc);
116 120
             //青海无溯源业务
117 121
 //            SysParams byId = sysParamsService.getById("sy.url");
118 122
 //            String paramVal = byId.getParamVal();
@@ -123,7 +127,7 @@ public class DataCrkywCplrkDefaultServiceImpl extends ServiceImpl<DataCrkywCplrk
123 127
                 spmc += flt001.getSjjlspmc() + ",";
124 128
                 flt001.setIsstaging("1");
125 129
                 //有订单时,自动新增评分数据
126
-                if (StrUtil.isNotBlank(param.getDdbh())) {
130
+//                if (StrUtil.isNotBlank(param.getDdbh())) {
127 131
                     //青海无此业务
128 132
 //                    DataCrkywCplpfDefault dataCrkywCplpfDefault = new DataCrkywCplpfDefault();
129 133
 //                    dataCrkywCplpfDefault.setScpc(flt001.getScpc());
@@ -134,8 +138,8 @@ public class DataCrkywCplrkDefaultServiceImpl extends ServiceImpl<DataCrkywCplrk
134 138
 //                    dataCrkywCplpfDefault.setRkbh(param.getRkbh());
135 139
 //                    dataCrkywCplpfDefault.setRksj(param.getYwsj());
136 140
 //                    dataCrkywCplpfDefaultService.save(dataCrkywCplpfDefault);
137
-                    dataCrkywCplrkFlt001Service.saveFlt(flt001);
138
-                }
141
+//                }
142
+                dataCrkywCplrkFlt001Service.saveFlt(flt001);
139 143
             }else{ //暂存只保存数据,不涉及业务
140 144
                 flt001.setIsstaging("0");
141 145
                 dataCrkywCplrkFlt001Service.save(flt001);

+ 3 - 3
src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCplrkFlt001ServiceImpl.java

@@ -45,7 +45,7 @@ public class DataCrkywCplrkFlt001ServiceImpl extends ServiceImpl<DataCrkywCplrkF
45 45
     private IDataCrkywCpltzdxxDefaultService dataCrkywCpltzdxxDefaultService;
46 46
 
47 47
     @Override
48
-    @SystemLog(module = "成品通知单", methods = "修改",uploadName = "cpl.tzd")
48
+    @SystemLog(module = "成品入库", methods = "新增",uploadName = "cpl.rk")
49 49
     public JSONObject saveFlt(DataCrkywCplrkFlt001 flt001) throws Exception {
50 50
             JSONObject jsonObject = new JSONObject();
51 51
             jsonObject.set("success", false);
@@ -96,7 +96,7 @@ public class DataCrkywCplrkFlt001ServiceImpl extends ServiceImpl<DataCrkywCplrkF
96 96
     }
97 97
 
98 98
     @Override
99
-    @SystemLog(module = "成品通知单", methods = "修改",uploadName = "cpl.tzd")
99
+    @SystemLog(module = "成品入库", methods = "修改",uploadName = "cpl.rk")
100 100
     public JSONObject updateFlt(DataCrkywCplrkFlt001 flt001) throws Exception {
101 101
         //保存库存相关数据
102 102
         JSONObject jsonObject = new JSONObject();
@@ -162,7 +162,7 @@ public class DataCrkywCplrkFlt001ServiceImpl extends ServiceImpl<DataCrkywCplrkF
162 162
     }
163 163
 
164 164
     @Override
165
-    @SystemLog(module = "成品通知单", methods = "修改",uploadName = "cpl.tzd")
165
+    @SystemLog(module = "成品入库", methods = "删除",uploadName = "cpl.rk")
166 166
     public JSONObject deleteFlt(String id) throws Exception {
167 167
         JSONObject jsonObject = new JSONObject();
168 168
         jsonObject.set("success", false);

+ 67 - 0
src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCplspDefaultServiceImpl.java

@@ -111,6 +111,12 @@ public class DataCrkywCplspDefaultServiceImpl extends ServiceImpl<DataCrkywCplsp
111 111
         if (StringUtils.isNotBlank(pageQuery.getSjjlspmc())){
112 112
             queryWrapper.like("a.sjjlspmc", ResultUtil.getQueryWrapperformat(pageQuery.getSjjlspmc()));
113 113
         }
114
+        if (StringUtils.isNotBlank(pageQuery.getSjjlspmcbh())){
115
+            queryWrapper.eq("a.sjjlspmcbh", pageQuery.getSjjlspmcbh());
116
+        }
117
+        if (StringUtils.isNotBlank(pageQuery.getCjsj())){
118
+            queryWrapper.eq("a.cjsj", pageQuery.getCjsj());
119
+        }
114 120
         queryWrapper.orderByDesc("cjsj");
115 121
         //分页相关
116 122
         Page<DataCrkywCplspDefault> p =new Page<>(pageQuery.getPage(),pageQuery.getLimit());
@@ -169,5 +175,66 @@ public class DataCrkywCplspDefaultServiceImpl extends ServiceImpl<DataCrkywCplsp
169 175
         }
170 176
     }
171 177
 
178
+    @Override
179
+    public String getSpbhByOrgId(String orgId) {
180
+        QueryWrapper<DataCrkywCplspDefault> queryWrapper = new QueryWrapper<>();
181
+        queryWrapper.lambda().eq(DataCrkywCplspDefault::getUnitid,orgId);
182
+        queryWrapper.lambda().orderByDesc(DataCrkywCplspDefault::getSjjlspmcbh);
183
+        List<DataCrkywCplspDefault> list= this.list(queryWrapper);
184
+        if(list.size()>0){
185
+            return this.SpbhByOrgId(orgId+"SP_",6,list.get(0).getSjjlspmcbh());
186
+        }else{
187
+            return orgId+"SP_"+""+""+"000001";
188
+        }
189
+    }
190
+
191
+    /**
192
+     * 编号生成
193
+     * @param f 前缀
194
+     * @param length 位数必须大于0
195
+     * @param xh 字符串
196
+     * @return 尾数+1的编号
197
+     */
198
+    public  String SpbhByOrgId(String f, int length, String xh) {
199
+        // 初始化
200
+        int num = 1;
201
+        if (!com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(xh)) {
202
+            String substring = xh.substring(xh.length() - length);
203
+            int i = Integer.parseInt(substring);
204
+            if (i < maxNum(length)) {
205
+                num += i;
206
+            }
207
+        }
208
+        return f+""+integerToString(length, num);
209
+    }
210
+
211
+    /**
212
+     * 获取int位数的最大值:如6位->999999
213
+     * @param length int位数
214
+     * @return int
215
+     */
216
+    private  int maxNum(int length) {
217
+        if (0 < length) {
218
+            StringBuilder builder = new StringBuilder();
219
+            for (int i = 0; i < length; i++) {
220
+                builder.append(9);
221
+            }
222
+            return Integer.parseInt(builder.toString());
223
+        }
224
+        return 0;
225
+    }
226
+
227
+    /**
228
+     * int 定长拼接-后缀顺序号
229
+     *
230
+     * @param length 总长度
231
+     * @param param  参数
232
+     * @return 参数前补0
233
+     */
234
+    private  String integerToString(int length, int param) {
235
+        System.out.println(String.format("%0" + length + "d", param));
236
+        return String.format("%0" + length + "d", param);
237
+    }
238
+
172 239
 
173 240
 }

+ 4 - 2
src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCpltzdxxDefaultServiceImpl.java

@@ -311,11 +311,13 @@ public class DataCrkywCpltzdxxDefaultServiceImpl extends ServiceImpl<DataCrkywCp
311 311
                 throw new RuntimeException(spmc + ":数量大于购销计划数量");
312 312
 //                return jsonObject;
313 313
             }
314
-            wcsl = NumberUtil.add(wcsl,sjjlsl_); //计算完成数量
314
+            wcsl = NumberUtil.div(NumberUtil.add(wcsl,sjjlsl_),1000); //计算完成数量,单位吨
315 315
             dataCrkywCpltzdxxDefaultMapper.updatePgGopsPlanDetail(wcsl,byId.getDdcbid());
316 316
             //更新主表数量
317 317
             Integer mainDataId = byId.getPlanId();
318
-            dataCrkywCpltzdxxDefaultMapper.updatePgGopsPlan(wcsl,sjjlje_,mainDataId);
318
+            sjjlje_ = NumberUtil.div(sjjlje_,1000); //单位万元
319
+            sjjlsl_ = NumberUtil.div(sjjlsl_,1000); //单位吨
320
+            dataCrkywCpltzdxxDefaultMapper.updatePgGopsPlan(sjjlsl_,sjjlje_,mainDataId);
319 321
         }
320 322
         return true;
321 323
     }

+ 1 - 0
src/main/java/com/unis/crk/cplbusiness/service/impl/DataCrkywCpltzdxxFlt001ServiceImpl.java

@@ -1,5 +1,6 @@
1 1
 package com.unis.crk.cplbusiness.service.impl;
2 2
 
3
+import cn.hutool.core.date.DateUtil;
3 4
 import cn.hutool.json.JSONObject;
4 5
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 6
 import com.baomidou.mybatisplus.core.metadata.IPage;

+ 14 - 2
src/main/java/com/unis/crk/cplbusiness/service/impl/DataKcglCplqckcDefaultServiceImpl.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
6 6
 import com.unis.crk.aop.SystemLog;
7 7
 import com.unis.crk.business.kcgl.entity.DataKcglFcbgzDefault;
8 8
 import com.unis.crk.business.kcgl.entity.DataKcglQckcDefault;
9
+import com.unis.crk.common.service.IBillnonewService;
9 10
 import com.unis.crk.common.service.IDeleteDataRecordService;
10 11
 import com.unis.crk.cplbusiness.entity.DataKcglCplfcbgzDefault;
11 12
 import com.unis.crk.cplbusiness.entity.DataKcglCplqckcDefault;
@@ -50,6 +51,8 @@ public class DataKcglCplqckcDefaultServiceImpl extends ServiceImpl<DataKcglCplqc
50 51
     private IDataKcglCplfcbgzDefaultService dataKcglCplfcbgzDefaultService;
51 52
     @Autowired
52 53
     private IDeleteDataRecordService deleteDataRecordService;
54
+    @Autowired
55
+    private IBillnonewService billnonewService;
53 56
     /**
54 57
      *保存成品粮期初
55 58
      * @param qckc 成品粮期初业务数据
@@ -68,6 +71,9 @@ public class DataKcglCplqckcDefaultServiceImpl extends ServiceImpl<DataKcglCplqc
68 71
             if (StrUtil.isBlank(qckc.getXz())){
69 72
                 qckc.setXz("6871"); //默认值
70 73
             }
74
+            //得到生产批次
75
+            String scpc = billnonewService.getScpc(qckc.getUnitid(),qckc.getSjjlspmcbh(),DateUtil.format(qckc.getScrq(),"yyyy-MM-dd"),"");
76
+            qckc.setScpc(scpc);
71 77
             //保存数据
72 78
             if (!super.saveOrUpdate(qckc)){
73 79
                 throw new RuntimeException("保存成品粮期初库存失败");
@@ -174,11 +180,17 @@ public class DataKcglCplqckcDefaultServiceImpl extends ServiceImpl<DataKcglCplqc
174 180
         if(StringUtils.isNotBlank(pageQuery.getSjjlspmc())){
175 181
             queryWrapper.like("a.sjjlspmc", ResultUtil.getQueryWrapperformat(pageQuery.getSjjlspmc()));
176 182
         }
183
+        if(StringUtils.isNotBlank(pageQuery.getChmc())){
184
+            queryWrapper.like("st.storehouse_name", ResultUtil.getQueryWrapperformat(pageQuery.getChmc()));
185
+        }
186
+        if(StringUtils.isNotBlank(pageQuery.getHwmc())){
187
+            queryWrapper.like("wa.warehouse_name", ResultUtil.getQueryWrapperformat(pageQuery.getHwmc()));
188
+        }
177 189
         if (StringUtils.isNotBlank(pageQuery.getJysjStart()) && StringUtils.isNotBlank(pageQuery.getJysjEnd())){
178
-            queryWrapper.apply(" DATE_FORMAT(ifnull(a.rq,NOW()),'%Y-%m-%d') >=  '"+pageQuery.getJysjStart()+"' AND DATE_FORMAT(ifnull(a.rq,NOW()),'%Y-%m-%d') <= '"+pageQuery.getJysjEnd()+" 23:59:59'");
190
+            queryWrapper.apply(" DATE_FORMAT(ifnull(a.cjsj,NOW()),'%Y-%m-%d') >=  '"+pageQuery.getJysjStart()+"' AND DATE_FORMAT(ifnull(a.cjsj,NOW()),'%Y-%m-%d') <= '"+pageQuery.getJysjEnd()+" 23:59:59'");
179 191
 
180 192
         }
181
-        queryWrapper.orderByDesc("a.rq");
193
+        queryWrapper.orderByDesc("a.cjsj");
182 194
         //分页相关
183 195
         Page<DataKcglCplqckcDefault> p =new Page<>(pageQuery.getPage(),pageQuery.getLimit());
184 196
 

+ 26 - 0
src/main/resources/SqlMap/sql.xml

@@ -1,5 +1,31 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <root>
3
+	<sql id="INSERT_STORAGEPREVIOLATION">
4
+		<!--插入转圈粮预警信息-->
5
+		INSERT INTO storage_pre_violation (
6
+		publish_time,
7
+		offender,
8
+		library_point_name,
9
+		violation_type,
10
+		detail,
11
+		subject_type,
12
+		STATUS,
13
+		org_id,
14
+		create_time
15
+		)
16
+		VALUES
17
+		(
18
+		NOW(),
19
+		'%s',
20
+		'%s',
21
+		1,
22
+		'%s',
23
+		NULL,
24
+		0,
25
+		%s,
26
+		NOW()
27
+		);
28
+	</sql>
3 29
 	<!-- 插入入库月结单第一笔数据 -->
4 30
 	<sql id="ADD_YJD">
5 31
 		insert into data_kcgl_kcyjd_default (

+ 15 - 16
src/main/resources/mapper/business/kcgl/DataKcglXckcDefaultMapper.xml

@@ -193,26 +193,26 @@ INSERT INTO data_kcgl_xckc_default(
193 193
 			D.BIZNO,							-- 7、
194 194
 			D.SHOWORDER,								-- 8、
195 195
 			A.jhdbh,							-- 9、计划单号
196
-			B.htbh,							-- 10、合同编号
197
-			IFNULL(A.mxpz,B.mxpz),	-- 11、明细品种
196
+			a.htbh,							-- 10、合同编号
197
+			A.mxpz,	-- 11、明细品种
198 198
 			E.org_name,						-- 12、单位名称
199 199
 			A.cph,							-- 13、车牌号码
200 200
 			E.Org_Code,						-- 14 单位编码(组织机构码)
201 201
 			'',							-- 15、质检单号
202 202
 			'',								-- 16、存放设施类型
203
-			F.price,							-- 17、单价
204
-			F.price*D.klhjz,			-- 18、单价*卸载后净重
203
+			0,							-- 17、单价
204
+			0*D.klhjz,			-- 18、单价*卸载后净重
205 205
 			A.lspz,							-- 19、粮食品种
206 206
 			D.jmsj,						-- 20、
207 207
 			F.grain_producing_area,							-- 21、产地
208 208
 			D.sjckch,							-- 22、实际仓房
209 209
 			'',								-- 23、售粮人身份证号
210
-			F.grain_grade,							-- 24、粮食等级
210
+			a.lydj,							-- 24、粮食等级
211 211
 			D.klhjz,						-- 25、卸载后净重
212
-			IFNULL(A.lyxz,B.lsxz),	-- 26、货物性质
212
+			A.lyxz,	-- 26、货物性质
213 213
 			D.sjhwh,							-- 27、实际货位
214 214
 			'',									-- 28、联系地址
215
-			F.grain_annual,									-- 29、生产年份
215
+			scnf.enumId,									-- 29、生产年份
216 216
 			A.cyrdh,						-- 30、承运人电话
217 217
 			A.cyr,						-- 31、承运人姓名
218 218
 			A.cllx,							-- 32、车辆类型
@@ -223,15 +223,14 @@ INSERT INTO data_kcgl_xckc_default(
223 223
 			D.mz-cp.pz,						-- 37
224 224
 			D.DeptID
225 225
 		FROM data_crkyw_ckrmdj_default A 				-- 出库入门登记表
226
-			INNER JOIN data_crkyw_ckcmz_default D		-- 出库称毛重
227
-				ON A.BIZNO=D.BIZNO
228
-			INNER JOIN data_crkyw_ckcpz_default cp
229
-				ON D.BIZNO=cp.BIZNO
230
-			INNER JOIN org_info E
231
-				ON A.UnitID=E.org_id
232
-		  	INNER JOIN data_crkyw_tzdxx_flt_001 F on A.UnitID=F.UnitID AND A.tzdcbid=F.DataID
233
-		  LEFT JOIN data_crkyw_tzdxx_default B	-- 通知单信息
234
-				ON B.UnitID=F.UnitID and B.DataID=F.MainDataID
226
+		INNER JOIN data_crkyw_ckcmz_default D		-- 出库称毛重
227
+			ON A.BIZNO=D.BIZNO
228
+		INNER JOIN data_crkyw_ckcpz_default cp
229
+			ON D.BIZNO=cp.BIZNO
230
+		INNER JOIN org_info E
231
+			ON A.UnitID=E.org_id
232
+	  INNER JOIN business_store_ware_detail F on A.tzdcbid=F.id
233
+		LEFT JOIN basic_enum scnf ON scnf.parentId = 1004 and scnf.enumname = f.productive_year
235 234
 	WHERE D.DATAID=#{dataId} LIMIT 0,1;
236 235
 	</insert>
237 236
 	<insert id="addQckcStock">

+ 2 - 1
src/main/resources/mapper/business/qcrk/DataCrkywJyxxDefaultMapper.xml

@@ -149,13 +149,14 @@ ORDER BY
149 149
         b.IsAudited AS "IsAudited",
150 150
         b.jyjg AS "jyjg",
151 151
         b.lsdj AS "lsdj",
152
-        b.dj AS "dj",
152
+        IFNULL(b.dj,c.in_price/1000) AS "dj",
153 153
         b.jybz AS "jybz",
154 154
         b.DataID AS "DataID"
155 155
         FROM
156 156
         DATA_CRKYW_RMDJ_DEFAULT a
157 157
         LEFT JOIN DATA_CRKYW_JYXX_DEFAULT b ON a.BizNo = b.BizNo
158 158
         LEFT JOIN basic_enum mxpz_enum on mxpz_enum.enumId = a.mxpz
159
+        LEFT JOIN business_store_ware_detail c on a.tzdcbid = c.id
159 160
         <where>
160 161
             <if test='id != null and id != ""'>
161 162
                 and b.DataID = #{id}

+ 19 - 19
src/main/resources/mapper/business/qcrk/DataCrkywTzdxxDefaultMapper.xml

@@ -121,9 +121,9 @@
121 121
     <select id="queryQcInTzdInfByDepot" resultType="java.util.Map">
122 122
           SELECT
123 123
         ifnull(xzklhjz, 0.0) AS "zl",
124
-        ifnull(c.shiping_count, 0.0) AS "sl",
125
-        ifnull(c.remain_quantity, 0.0) AS "sysl",
126
-        ifnull(c.complete_quantity, 0.0) AS "wcsl",
124
+        ifnull(c.shiping_count*1000, 0.0) AS "sl",
125
+        ifnull(c.remain_quantity*1000, c.shiping_count*1000) AS "sysl",
126
+        ifnull(c.complete_quantity*1000, 0.0) AS "wcsl",
127 127
         ifnull(c.id, '') AS "dataId",
128 128
         ifnull(b.tzdcbid, '') AS "tzdcbid",
129 129
         ifnull(b.tzdbh, '') AS "tzdh"
@@ -153,9 +153,9 @@
153 153
     <select id="queryQCOutTzdInfByDepot" resultType="java.util.Map">
154 154
             SELECT
155 155
         ifnull(klhjz, 0.0) AS "zl",
156
-        ifnull(c.shiping_count, 0.0) AS "sl",
157
-        ifnull(c.remain_quantity, 0.0) AS "sysl",
158
-        ifnull(c.complete_quantity, 0.0) AS "wcsl",
156
+        ifnull(c.shiping_count*1000, 0.0) AS "sl",
157
+        ifnull(c.remain_quantity*1000, c.shiping_count*1000) AS "sysl",
158
+        ifnull(c.complete_quantity*1000, 0.0) AS "wcsl",
159 159
         ifnull(c.id, '') AS "dataId",
160 160
         ifnull(b.tzdcbid, '') AS "tzdcbid",
161 161
         ifnull(b.tzdbh, '') AS "tzdh"
@@ -227,15 +227,15 @@ LEFT JOIN basic_enum grain_kind_enum ON  grain_kind_enum.enumId = DATA_CRKYW_TZD
227 227
         notice.id AS "dataid",  -- 主表ID
228 228
         notice.id AS tzdID, -- 通知单id
229 229
         notice.bill_number AS tzdbh, -- 通知单编号,
230
-        shiping_count  as sl, -- 通知单数量
231
-        IF(detail.in_count > 0,in_count,out_count)-IFNULL(detail.complete_quantity,0) AS sysl, -- 剩余数量
232
-        IF(detail.in_count > 0,'A7B1FDB54DE7B32D6F8067FEFE2BF52F','6FD0418CD28A2B3F3E7E9EC0D7429461') as FLOWID, -- 流程Id
230
+        shiping_count*1000  as sl, -- 通知单数量
231
+        CASE WHEN notice.bill_type=1 THEN in_count*1000-IFNULL(detail.complete_quantity,0)*1000 ELSE out_count*1000-IFNULL(detail.complete_quantity,0)*1000 END AS sysl, -- 剩余数量
232
+        CASE WHEN notice.bill_type=1 THEN '420801654D8F01A7D9FCE01B90A395E6' ELSE '284344D15DCA72D90AA43C24BD4F9B47' END AS FLOWID, -- 流程Id
233 233
         DATE_FORMAT(detail.input_time,'%Y-%m-%d %T') AS rcsj -- 入仓时间
234 234
         ,notice.contract AS htbh -- 合同编号
235 235
         ,notice.contract_bid AS htId -- 合同id
236
-        ,plan.plan_number AS jhdbh -- 计划编号
236
+        ,notice.plan_number AS jhdbh -- 计划编号
237 237
         ,notice.plan_bid AS jhdId -- 计划id
238
-        ,enum.enumName  as jhfl -- 计划分类
238
+        ,plan.plan_type  as jhfl -- 计划分类
239 239
         ,customer.name as slr -- <!-- 客户名称 -->
240 240
         ,customer.address as slrdz, -- <!-- 地址 -->
241 241
         IFNULL(customer.social_credit_code,customer.identification) as slrsfzh,-- <!-- 企业信用代码或者身份证号 -->
@@ -262,7 +262,7 @@ LEFT JOIN basic_enum grain_kind_enum ON  grain_kind_enum.enumId = DATA_CRKYW_TZD
262 262
         detail.grain_producing_area AS "cd",
263 263
 
264 264
         tzscnf_enum.enumName AS "tzscnf_value", -- 生产年份名称
265
-        detail.grain_annual AS "scnf",
265
+        tzscnf_enum.enumId AS "scnf",
266 266
 
267 267
         detail.house_id as chID, -- 仓房id
268 268
         detail.warehouse_id as hwID, -- 货位id
@@ -272,23 +272,23 @@ LEFT JOIN basic_enum grain_kind_enum ON  grain_kind_enum.enumId = DATA_CRKYW_TZD
272 272
         business_delivery_storage_notice notice
273 273
         inner JOIN business_store_ware_detail detail on notice.id = detail.zid
274 274
         left join business_customer customer on customer.id=notice.customer_bid
275
-        left join business_plan plan on notice.plan_bid = plan.id
276
-        left join basic_enum enum on  plan.execute_type = enum.enumId
275
+        left join business_rp_report plan on notice.plan_bid = plan.id
276
+        -- left join basic_enum enum on  plan.execute_type = enum.enumId
277 277
 
278 278
         LEFT JOIN basic_enum lsxz_enum ON lsxz_enum.enumId = detail.grain_attribute
279
-        LEFT JOIN basic_enum tzscnf_enum ON tzscnf_enum.enumId = detail.grain_annual
279
+        LEFT JOIN basic_enum tzscnf_enum ON tzscnf_enum.parentId = 1004 and tzscnf_enum.enumname = detail.productive_year
280 280
         LEFT JOIN basic_enum cd_enum ON cd_enum.enumId = detail.grain_producing_area
281 281
 
282 282
         LEFT JOIN basic_enum grain_attribute_enum ON  grain_attribute_enum.enumId = detail.grain_attribute
283 283
         LEFT JOIN basic_enum grain_grade_enum ON grain_grade_enum.enumId = detail.grain_grade
284 284
         LEFT JOIN basic_enum grain_kind_enum ON  grain_kind_enum.enumId = detail.grain_kind
285 285
         LEFT JOIN basic_enum grain_detail_kind_enum ON grain_detail_kind_enum.enumId = detail.grain_detail_kind
286
-
287
-        WHERE ((notice.audit_state=2) or (notice.bill_type=2)) -- <!-- 审批通过的,中转通知单没有审批 -->
286
+        WHERE
287
+        notice.audit_state=2
288 288
         and notice.in_application = 1
289 289
         AND notice.house_id = #{unitId}   -- <!--用house_id 区分是哪个库的 house_id是代储库 orgId 是主库 -->
290
-        and IF(detail.in_count > 0,'A7B1FDB54DE7B32D6F8067FEFE2BF52F','6FD0418CD28A2B3F3E7E9EC0D7429461') = #{flowId}
291
-        AND IF(detail.in_count > 0,in_count,out_count)-IFNULL(detail.complete_quantity,0) >0
290
+        and  CASE WHEN notice.bill_type=1 THEN '420801654D8F01A7D9FCE01B90A395E6' ELSE '284344D15DCA72D90AA43C24BD4F9B47' END = #{flowId}
291
+        AND CASE WHEN notice.bill_type=1 THEN in_count-IFNULL(detail.complete_quantity,0) ELSE out_count-IFNULL(detail.complete_quantity,0) END >0
292 292
         ORDER BY notice.bill_number
293 293
     </select>
294 294
 </mapper>

+ 74 - 0
src/main/resources/mapper/common/BizflowtrailMapper.xml

@@ -22,5 +22,79 @@
22 22
         <result column="note" property="note" />
23 23
         <result column="UPDATE_TIME" property="updateTime" />
24 24
     </resultMap>
25
+    <select id="getCrkPzInfo" resultType="java.util.Map">
26
+        <choose>
27
+            <when test="direction==1">
28
+                SELECT
29
+                a.lspz,
30
+                e.enumname as lspzName,
31
+                a.unitid as unitId,
32
+                b.org_name AS orgName,
33
+                DATE_FORMAT(a.ywdjsj,'%Y-%m-%d') as ywrq,
34
+                a.slr,a.cph
35
+                FROM
36
+                data_crkyw_rmdj_default a
37
+                INNER JOIN data_crkyw_qyxx_default c on a.BizNo = c.BizNo
38
+                INNER JOIN org_info b ON a.UnitID = b.org_id
39
+                LEFT JOIN basic_enum e  on e.enumId = a.lspz
40
+                WHERE
41
+                a.bizno = #{bizNo}
42
+            </when>
43
+            <otherwise>
44
+                SELECT
45
+                a.lspz,
46
+                e.enumname as lspzName,
47
+                a.unitid as unitId,
48
+                b.org_name AS orgName,
49
+                DATE_FORMAT(a.rmsj,'%Y-%m-%d') as ywrq,
50
+                a.slr,a.cph
51
+                FROM
52
+                data_crkyw_ckrmdj_default a
53
+                INNER JOIN data_crkyw_ckcpz_default c on a.BizNo = c.BizNo
54
+                INNER JOIN org_info b ON a.UnitID = b.org_id
55
+                LEFT JOIN basic_enum e  on e.enumId = a.lspz
56
+                WHERE
57
+                a.bizno = #{bizNo}
58
+            </otherwise>
59
+        </choose>
60
+    </select>
61
+    <select id="getCircleBusinessInfo" resultType="java.util.Map">
62
+        <choose>
63
+            <when test="direction==1">
64
+                select
65
+                DATE_FORMAT(a.jmsj,'%Y-%m-%d') as "ywrq",
66
+                a.klhjz as "sl",
67
+                f.storehouse_name as "cfmc",
68
+                e.enumname as "lsdjName"
69
+
70
+                from data_crkyw_ckcmz_default a
71
+                INNER JOIN data_crkyw_ckrmdj_default c on a.UnitID=c.UnitID and a.BizNo=c.BizNo
72
+                LEFT JOIN basic_enum e on  c.lydj=e.enumId
73
+                LEFT JOIN basic_storehouse f on a.sjckch = f.storehouse_id
74
+                where
75
+                a.UnitID != #{unitId}
76
+                and c.lspz= #{lspz} and c.cph = #{cph}
77
+                and DATE_FORMAT(a.jmsj,'%Y-%m-%d') between #{beginDay} and  #{endDay}
78
+                order by a.jmsj desc limit 1
79
+            </when>
80
+            <otherwise>
81
+                select
82
+                DATE_FORMAT(a.cpzsj,'%Y-%m-%d') as "ywrq",
83
+                a.xzklhjz as "sl",
84
+                f.storehouse_name as "cfmc",
85
+                e.enumname as "lsdjName"
86
+                from data_crkyw_cpz_default a
87
+                INNER JOIN data_crkyw_jyxx_default b on a.UnitID=b.UnitID and a.BizNo=b.BizNo
88
+                INNER JOIN data_crkyw_rmdj_default c on a.UnitID=c.UnitID and a.BizNo=c.BizNo
89
+                LEFT JOIN basic_enum e on  b.lsdj=e.enumId
90
+                LEFT JOIN basic_storehouse f on a.sjchID = f.storehouse_id
91
+                where
92
+                a.UnitID != #{unitId}
93
+                and c.lspz= #{lspz} and c.cph = #{cph}
94
+                and DATE_FORMAT(a.cpzsj,'%Y-%m-%d') between #{beginDay} and  #{endDay}
95
+                order by a.cpzsj desc limit 1
96
+            </otherwise>
97
+        </choose>
98
+    </select>
25 99
 
26 100
 </mapper>

+ 4 - 0
src/main/resources/mapper/cplbusiness/DataCrkywCplckFlt001Mapper.xml

@@ -16,6 +16,10 @@
16 16
                     <result column="bzq" property="bzq" />
17 17
                     <result column="xz" property="xz" />
18 18
                     <result column="deptId" property="deptId" />
19
+                    <result column="ch" property="ch" />
20
+                    <result column="hwh" property="hwh" />
21
+                    <result column="chmc" property="chmc" />
22
+                    <result column="hwmc" property="hwmc" />
19 23
                     <result column="sjjlpzmc" property="sjjlpzmc" />
20 24
                     <result column="sjjlpzbh" property="sjjlpzbh" />
21 25
                     <result column="sjjlppmc" property="sjjlppmc" />

+ 4 - 0
src/main/resources/mapper/cplbusiness/DataCrkywCplrkFlt001Mapper.xml

@@ -16,6 +16,10 @@
16 16
                     <result column="bzq" property="bzq" />
17 17
                     <result column="xz" property="xz" />
18 18
                     <result column="deptId" property="deptId" />
19
+                    <result column="ch" property="ch" />
20
+                    <result column="hwh" property="hwh" />
21
+                    <result column="chmc" property="chmc" />
22
+                    <result column="hwmc" property="hwmc" />
19 23
                     <result column="sjjlpzmc" property="sjjlpzmc" />
20 24
                     <result column="sjjlpzbh" property="sjjlpzbh" />
21 25
                     <result column="sjjlppmc" property="sjjlppmc" />

+ 4 - 1
src/main/resources/mapper/cplbusiness/DataCrkywCplspDefaultMapper.xml

@@ -46,11 +46,14 @@
46 46
                 a.sjjlspmcbh as "sjjlspmcbh",
47 47
                 a.isEnable as "isEnable",
48 48
                a.scpc as "scpc",
49
-               a.sccs as "sccs"
49
+               a.sccs as "sccs",
50
+               a.cjsj as "cjsj",
51
+               e.enumName as "djmc"
50 52
         FROM  data_crkyw_cplsp_default a
51 53
         LEFT JOIN  basic_enum b on a.sjjlppbh = b.enumId
52 54
         LEFT JOIN  basic_enum c on a.sjjlpzbh = c.enumId
53 55
         LEFT JOIN  basic_enum d on a.jldw = d.enumId
56
+        LEFT JOIN  basic_enum e on a.dj = e.enumId
54 57
         <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
55 58
             where  ${ew.sqlSegment}
56 59
         </if>

+ 5 - 3
src/main/resources/mapper/cplbusiness/DataCrkywCpltzdxxDefaultMapper.xml

@@ -215,12 +215,13 @@
215 215
     </select>
216 216
     <select id="getPgGopsPlanList" resultType="com.unis.crk.cplbusiness.entity.result.BusinessPgGopsPlanVO">
217 217
         SELECT
218
-        a.id as "DataID",
218
+        a.id as "ddid",
219 219
         GROUP_CONCAT(c.sjjlspmc) as 'mxpzValue',
220
+        GROUP_CONCAT(d.enumname) as 'ppValue',
220 221
         '' as  "kfbh",
221 222
         a.org_id as "orgId",
222 223
         a.updatedate as "ModifyDate",
223
-        a.plan_code as "tzdbm",
224
+        a.plan_code as "ddbh",
224 225
         a.plan_name as "jhdmc",
225 226
         '' as  "htmc",
226 227
         a.plan_type "cazylx",
@@ -233,6 +234,7 @@
233 234
         FROM business_pg_gops_plan a
234 235
         LEFT JOIN business_pg_gops_plan_detail b on a.id = b.pg_gops_plan_id
235 236
         LEFT JOIN data_crkyw_cplsp_default c on b.crkyw_cplsp_default_id = c.dataId
237
+        LEFT JOIN basic_enum d on c.sjjlppbh = d.enumId
236 238
         WHERE
237 239
         a.org_id = #{unitId}
238 240
         <if test='planType != null and planType != ""'>
@@ -267,7 +269,7 @@
267 269
         (b.quantity*1000-b.complete_quantity*1000)/mxpz_enum.gg as syjs,
268 270
         '' as  ch,
269 271
         mxpz_enum.gg as gg,
270
-        mxpz_enum.bzq as bzg,
272
+        mxpz_enum.bzq as bzq,
271 273
         mxpz_enum.jldw as jldw,
272 274
         b.updatedate  as "ModifyDate",
273 275
         jldw_enum.enumName AS jldwmc,

+ 3 - 1
src/main/resources/mapper/cplbusiness/DataKcglCplkcswDefaultMapper.xml

@@ -277,6 +277,7 @@ ORDER BY a.hwh,a.scpc
277 277
 			a.scrq,    -- 11.生产日期
278 278
 			a.bzq,		 -- 11.保质期
279 279
 			a.xz,			 -- 12.性质
280
+			xz_enum.enumname as xzName,
280 281
 			a.bzq,
281 282
 			a.js,
282 283
 			a.kcsl,
@@ -302,7 +303,8 @@ ORDER BY a.hwh,a.scpc
302 303
 			LEFT JOIN data_crkyw_cplsp_default sjjlspmc_enum ON sjjlspmc_enum.sjjlspmcbh = a.sjjlspmcbh
303 304
 			and  sjjlspmc_enum.unitId = a.unitId
304 305
 			LEFT JOIN basic_enum sjjldjmc_enum ON sjjldjmc_enum.enumId = a.sjjldjbh
305
-		WHERE
306
+			LEFT JOIN basic_enum xz_enum on a.xz = xz_enum.enumId
307
+			where
306 308
 			 a.hwh = #{hwh}
307 309
 			and a.sjjlspmcbh = #{spbh}
308 310
 			and a.gg = #{gg}

+ 26 - 19
src/main/resources/mapper/cplbusiness/DataKcglCplqckcDefaultMapper.xml

@@ -47,30 +47,37 @@
47 47
         </resultMap>
48 48
 
49 49
     <select id="selectMyMapsPage" resultType="java.util.Map">
50
-        SELECT a.dataId,
51
-               a.qcbh,
52
-               a.rq,
53
-               a.scrq,
54
-               a.gg,
55
-               a.jldw,
56
-               a.kcsl,
57
-               a.scpc,
58
-               a.sjjlppbh,
59
-               sjjlppmc_enum.enumName as sjjlppmc,
60
-               a.sjjlpzbh,
61
-               sjjlpzmc_enum.enumName as sjjlpzmc,
62
-               a.sjjlspmcbh,
63
-               sjjlspmc_enum.sjjlspmc as sjjlspmc,
64
-               a.sjjldjbh,
65
-               sjjldjmc_enum.enumName as sjjldjmc,
66
-               jldwmc_enum.enumName as jldwmc
67
-               FROM  data_kcgl_cplqckc_default a
50
+        SELECT
51
+        a.dataId,
52
+        a.qcbh,
53
+        a.rq,
54
+        st.storehouse_name as chmc,
55
+        wa.warehouse_name as  hwmc,
56
+        a.cjsj,
57
+        a.scrq,
58
+        a.gg,
59
+        a.jldw,
60
+        a.kcsl,
61
+        a.scpc,
62
+        a.sjjlppbh,
63
+        sjjlppmc_enum.enumName AS sjjlppmc,
64
+        a.sjjlpzbh,
65
+        sjjlpzmc_enum.enumName AS sjjlpzmc,
66
+        a.sjjlspmcbh,
67
+        sjjlspmc_enum.sjjlspmc AS sjjlspmc,
68
+        a.sjjldjbh,
69
+        sjjldjmc_enum.enumName AS sjjldjmc,
70
+        jldwmc_enum.enumName AS jldwmc
71
+        FROM
72
+        data_kcgl_cplqckc_default a
68 73
         LEFT JOIN basic_enum sjjlppmc_enum ON sjjlppmc_enum.enumId = a.sjjlppbh
69 74
         LEFT JOIN basic_enum sjjlpzmc_enum ON sjjlpzmc_enum.enumId = a.sjjlpzbh
70 75
         LEFT JOIN data_crkyw_cplsp_default sjjlspmc_enum ON sjjlspmc_enum.sjjlspmcbh = a.sjjlspmcbh
71
-        and  sjjlspmc_enum.unitId = a.unitId
76
+        AND sjjlspmc_enum.unitId = a.unitId
72 77
         LEFT JOIN basic_enum sjjldjmc_enum ON sjjldjmc_enum.enumId = a.sjjldjbh
73 78
         LEFT JOIN basic_enum jldwmc_enum ON jldwmc_enum.enumId = a.jldw
79
+        LEFT JOIN basic_storehouse  st on a.ch = st.storehouse_id
80
+        LEFT JOIN basic_warehouse  wa on a.hwh = wa.warehouse_id
74 81
         <if test="ew.sqlSegment != null and ew.sqlSegment != ''">
75 82
             where  ${ew.sqlSegment}
76 83
         </if>

+ 8 - 8
src/main/resources/mapper/cplbusiness/DataKcglCplxckcDefaultMapper.xml

@@ -99,10 +99,10 @@ SELECT
99 99
 	a.unitid, -- 2、单位id
100 100
 	e.org_name,   -- 3.站点名称
101 101
 	e.org_code,		-- 4.站点编码
102
-	a.ch,			-- 5.仓房
103
-	a.hwh,		-- 6.货位
104
-	a.chmc,   -- 7.仓房名称
105
-	a.hwmc,		-- 8.货位名称
102
+	b.ch,			-- 5.仓房
103
+	b.hwh,		-- 6.货位
104
+	b.chmc,   -- 7.仓房名称
105
+	b.hwmc,		-- 8.货位名称
106 106
 	#{loginName}, -- 9、创建人
107 107
 	a.cjsj,    -- 10.创建时间
108 108
 	b.scrq,    -- 11.生产日期
@@ -184,10 +184,10 @@ SELECT
184 184
 	a.unitid, -- 2、单位id
185 185
 	e.org_name,   -- 3.站点名称
186 186
 	e.org_code,		-- 4.站点编码
187
-	a.ch,			-- 5.仓房
188
-	a.hwh,		-- 6.货位
189
-	a.chmc,   -- 7.仓房名称
190
-	a.hwmc,		-- 8.货位名称
187
+	b.ch,			-- 5.仓房
188
+	b.hwh,		-- 6.货位
189
+	b.chmc,   -- 7.仓房名称
190
+	b.hwmc,		-- 8.货位名称
191 191
   #{loginName}, -- 9、创建人
192 192
 	a.cjsj,    -- 10.创建时间
193 193
 	b.scrq,    -- 11.生产日期