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

库存日志添加completeBatchNo

姚云青 3 лет назад
Родитель
Сommit
9c8a211949

+ 2 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/edgeLibrary/service/StockInfoService.java

@@ -137,14 +137,14 @@ public interface StockInfoService extends SuperService<StockInfo> {
      * @param storgeId
      * @return
      */
-    R<String> plateStockIn( Long storgeId,StockInfo stockInfo);
+    R<String> plateStockIn( Long storgeId,StockInfo stockInfo,String completeBatchNo);
 
     /**
      * 托板出库
      * @param storgeId
      * @return
      */
-    R<StockInfo> plateStockOut(Long storgeId);
+    R<StockInfo> plateStockOut(Long storgeId,String completeBatchNo);
 
     /**
      * 手抓出库

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/edgeLibrary/service/StockLogService.java

@@ -28,5 +28,5 @@ public interface StockLogService extends SuperService<StockLog> {
      */
     StockLog save(StockLogSaveDTO data);
 
-    StockLog saveLog(StockInfo infoBean,String type);
+    StockLog saveLog(StockInfo infoBean,String type,String completeBatchNo);
 }

+ 15 - 15
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/edgeLibrary/service/impl/StockInfoServiceImpl.java

@@ -397,7 +397,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         infoBean.setUniqueCode(uniqueCode);
         save(infoBean);
         //库存日志
-        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN);
+        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN,completeBatchNo);
         return R.success(uniqueCode);
     }
 
@@ -429,7 +429,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         infoBean.setCompleteBatchNo(completeBatchNo);
         save(infoBean);
         //库存日志
-        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN);
+        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN,completeBatchNo);
         return R.success(uniqueCode);
     }
 
@@ -445,7 +445,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         infoBean.setCompleteBatchNo("");
         save(infoBean);
         //库存日志
-        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN);
+        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN,"");
         return R.success();
     }
 
@@ -462,7 +462,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         infoBean.setCompleteBatchNo("");
         save(infoBean);
         //库存日志
-        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN);
+        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN,"");
         return R.success();
     }
 
@@ -476,7 +476,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         StockInfo stockInfo = list.get(0);
         baseMapper.deleteById(stockInfo.getId());
         //库存日志
-        stockLogService.saveLog(stockInfo,BizConstant.STOCK_TYPE_OUT);
+        stockLogService.saveLog(stockInfo,BizConstant.STOCK_TYPE_OUT,completeBatchNo);
         return R.success(stockInfo.getUniqueCode());
     }
 
@@ -491,7 +491,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         StockInfo stockInfo = list.get(0);
         baseMapper.deleteById(stockInfo.getId());
         //库存日志
-        stockLogService.saveLog(stockInfo,BizConstant.STOCK_TYPE_OUT);
+        stockLogService.saveLog(stockInfo,BizConstant.STOCK_TYPE_OUT,completeBatchNo);
         return R.success(stockInfo.getUniqueCode());
     }
 
@@ -510,7 +510,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         StockInfo stockInfo = list.get(0);
         baseMapper.deleteById(stockInfo.getId());
         //库存日志
-        stockLogService.saveLog(stockInfo,BizConstant.STOCK_TYPE_OUT);
+        stockLogService.saveLog(stockInfo,BizConstant.STOCK_TYPE_OUT,"");
         return R.success(stockInfo.getUniqueCode());
     }
 
@@ -520,7 +520,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
      * @return
      */
     @Override
-    public R<String> plateStockIn(Long storgeId,StockInfo stockInfo) {
+    public R<String> plateStockIn(Long storgeId,StockInfo stockInfo,String completeBatchNo) {
         StockInfo infoBean = new StockInfo();
         infoBean.setStorgeId(storgeId);
         infoBean.setLockStatus("1");
@@ -532,7 +532,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         infoBean.setUniqueCode(stockInfo.getUniqueCode());
         save(infoBean);
         //库存日志
-        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN);
+        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN,completeBatchNo);
         return R.success(infoBean.getUniqueCode());
     }
 
@@ -542,7 +542,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
      * @return
      */
     @Override
-    public R<StockInfo> plateStockOut(Long storgeId) {
+    public R<StockInfo> plateStockOut(Long storgeId,String completeBatchNo) {
         List<StockInfo>list = baseMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getStorgeId,storgeId));
         if(list==null||list.size()==0){
             return R.fail("没有此产品");
@@ -550,7 +550,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         StockInfo stockInfo = list.get(0);
         baseMapper.deleteById(stockInfo.getId());
         //库存日志
-        stockLogService.saveLog(stockInfo,BizConstant.STOCK_TYPE_OUT);
+        stockLogService.saveLog(stockInfo,BizConstant.STOCK_TYPE_OUT,completeBatchNo);
         return R.success(stockInfo);
     }
 
@@ -616,7 +616,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
                 stockInfo = stockInfoList.get(0);
                 baseMapper.deleteById(stockInfo.getId());
                 //库存日志
-                stockLogService.saveLog(stockInfo,BizConstant.STOCK_TYPE_OUT);
+                stockLogService.saveLog(stockInfo,BizConstant.STOCK_TYPE_OUT,"");
             }
         }
         return R.success(stockInfo.getUniqueCode());
@@ -642,7 +642,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
             infoBean.setCompleteBatchNo(completeBatchNo);
             save(infoBean);
             //库存日志
-            stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN);
+            stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN,completeBatchNo);
         }
         return R.success("");
     }
@@ -669,7 +669,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         StockInfo stockInfo = list.get(0);
         baseMapper.deleteById(stockInfo.getId());
         //库存日志
-        stockLogService.saveLog(stockInfo,BizConstant.STOCK_TYPE_OUT);
+        stockLogService.saveLog(stockInfo,BizConstant.STOCK_TYPE_OUT,"");
 
         return R.success();
     }
@@ -686,7 +686,7 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         infoBean.setCompleteBatchNo("");
         save(infoBean);
         //库存日志
-        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN);
+        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN,"");
         return R.success();
     }
 }

+ 2 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/edgeLibrary/service/impl/StockLogServiceImpl.java

@@ -77,7 +77,7 @@ public class StockLogServiceImpl extends SuperServiceImpl<StockLogMapper, StockL
     }
 
     @Override
-    public StockLog saveLog(StockInfo stockBean,String type) {
+    public StockLog saveLog(StockInfo stockBean,String type,String completeBatchNo) {
         StockLog logBean = new StockLog();
         String no = codeRuleService.getBillCode(CodeRuleModule.CODE_RULE_STOCKLOG);
         logBean.setNo(no);
@@ -88,6 +88,7 @@ public class StockLogServiceImpl extends SuperServiceImpl<StockLogMapper, StockL
         logBean.setGoodsType(stockBean.getGoodsType());
         logBean.setTurnTaskNo(stockBean.getTurnTaskNo());
         logBean.setOptType(type);
+        logBean.setCompleteBatchNo(completeBatchNo);
         logBean.setFeedTaskNo(stockBean.getFeedTaskNo());
         logBean.setSpecId(stockBean.getSpecId());
         save(logBean);

+ 7 - 7
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java

@@ -1656,7 +1656,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
             R<String> result = null;
             if (trayList != null && trayList.size() > 0) {
                 for (BomProcedureTray tray : trayList) {
-                    result = stockInfoService.procedureTrayStockOut(tray, Long.parseLong(srcStorgeId));
+                    result = stockInfoService.procedureTrayStockOut(tray, Long.parseLong(srcStorgeId),task.getCompleteBatchNo());
                     if (result.getIsSuccess()) {
                         result = stockInfoService.procedureTrayStockIn(tray, Long.parseLong(targetStorgeId), result.getData(), task.getCompleteBatchNo());
                     }
@@ -1673,7 +1673,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
             R<String> result = null;
             if (trayList != null && trayList.size() > 0) {
                 for (BomProcedureTray tray : trayList) {
-                    result = stockInfoService.procedureTrayStockOut(tray, Long.parseLong(srcStorgeId));
+                    result = stockInfoService.procedureTrayStockOut(tray, Long.parseLong(srcStorgeId),task.getCompleteBatchNo());
                     if (result.getIsSuccess()) {
                         result = stockInfoService.procedureTrayStockIn(tray, Long.parseLong(targetStorgeId), result.getData(), task.getCompleteBatchNo());
                     }
@@ -1681,10 +1681,10 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
             }
         } else if (DemoLineConstant.DEMOLINE_STOCK_TYPE_PLATE_CRK.equals(stockType)) {//托板出入库
             //WMS只要把原材料入库
-            R<StockInfo> ckresult = stockInfoService.plateStockOut(Long.parseLong(srcStorgeId));
+            R<StockInfo> ckresult = stockInfoService.plateStockOut(Long.parseLong(srcStorgeId),task.getCompleteBatchNo());
             R<String> rkresult = null;
             if (ckresult.getIsSuccess()) {
-                rkresult = stockInfoService.plateStockIn(Long.parseLong(targetStorgeId), ckresult.getData());
+                rkresult = stockInfoService.plateStockIn(Long.parseLong(targetStorgeId), ckresult.getData(),task.getCompleteBatchNo());
                 return rkresult;
             }
             return R.success("");
@@ -1699,17 +1699,17 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
             R<String> result = null;
             if (trayList != null && trayList.size() > 0) {
                 for (BomProcedureTray tray : trayList) {
-                    result = stockInfoService.procedureTrayStockOut(tray, Long.parseLong(srcStorgeId));
+                    result = stockInfoService.procedureTrayStockOut(tray, Long.parseLong(srcStorgeId),task.getCompleteBatchNo());
                     if (result.getIsSuccess()) {
                         result = stockInfoService.procedureTrayStockIn(tray, Long.parseLong(targetStorgeId), result.getData(), task.getCompleteBatchNo());
                     }
                 }
             }
 
-            R<StockInfo> ckresultStock = stockInfoService.plateStockOut(Long.parseLong(srcStorgeId));
+            R<StockInfo> ckresultStock = stockInfoService.plateStockOut(Long.parseLong(srcStorgeId),task.getCompleteBatchNo());
             R<String> rkresultStock = null;
             if (ckresultStock.getIsSuccess()) {
-                rkresultStock = stockInfoService.plateStockIn(Long.parseLong(targetStorgeId), ckresultStock.getData());
+                rkresultStock = stockInfoService.plateStockIn(Long.parseLong(targetStorgeId), ckresultStock.getData(),task.getCompleteBatchNo());
                 return rkresultStock;
             }
             return R.success("");

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskServiceImpl.java

@@ -1207,7 +1207,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
             clamStockInfo.setUniqueCode(String.valueOf(uniqueCode));
             clamStockInfo.setCompleteBatchNo(tTask.getCompleteBatchNo());
             stockInfoMapper.insert(clamStockInfo);
-            stockLogService.saveLog(clamStockInfo,BizConstant.STOCK_TYPE_IN);
+            stockLogService.saveLog(clamStockInfo,BizConstant.STOCK_TYPE_IN,tTask.getCompleteBatchNo());
         }
         return R.success();
     }

+ 6 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/edgeLibrary/entity/StockLog.java

@@ -139,6 +139,12 @@ public class StockLog extends Entity<Long> {
     @Excel(name = "规格ID")
     private Long specId;
 
+    @ApiModelProperty(value = "完整产品加工批次号(一个bom的完整流程的批次号)")
+    @Length(max = 36, message = "完整产品加工批次号(一个bom的完整流程的批次号)长度不能超过36")
+    @TableField(value = "complete_batch_no", condition = LIKE)
+    @Excel(name = "任务批次号")
+    private String completeBatchNo;
+
     /**
      * 原因
      */