瀏覽代碼

手动模式

laoyao 3 年之前
父節點
當前提交
fbe27f4d8b

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

@@ -8,6 +8,8 @@ import com.github.zuihou.business.edgeLibrary.dto.StockInfoUpdateDTO;
 import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
 import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureMeterial;
 import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureTray;
+import com.github.zuihou.business.productionReadyCenter.entity.MToolClamp;
+import com.github.zuihou.business.productionReadyCenter.entity.Tray;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 
 import java.util.LinkedHashMap;
@@ -96,6 +98,24 @@ public interface StockInfoService extends SuperService<StockInfo> {
      */
     R<String> procedureTrayStockIn(BomProcedureTray bomProcedureTray, Long storgeId,String uniqueCode,String completeBatchNo);
 
+
+    /**
+     * 从系统外部(不是库存)入库
+     * @param tray
+     * @param storgeId
+     * @return
+     */
+    R<String> procedureTrayStockIn(Tray tray, Long storgeId);
+
+
+    /**
+     * 从系统外部(不是库存)入库
+     * @param clamp
+     * @param storgeId
+     * @return
+     */
+    R<String> procedureToolClampStockIn(MToolClamp clamp, Long storgeId);
+
     /**
      * 托盘出库
      * @param bomProcedureTray

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

@@ -407,6 +407,47 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         return R.success(uniqueCode);
     }
 
+    @Override
+    public R<String> procedureTrayStockIn(Tray tray, Long storgeId) {
+        StockInfo infoBean = new StockInfo();
+        infoBean.setStorgeId(storgeId);
+        infoBean.setLockStatus("1");
+        //Tray tray = trayService.getById(bomProcedureTray.getTrayId());
+        infoBean.setGoodsId(tray.getId());
+        infoBean.setGoodsType("2");
+        infoBean.setSpecId(tray.getId());
+        infoBean.setNum(1);
+//        if(StringUtil.isEmpty(uniqueCode)){
+//            //根据编码规则
+//            uniqueCode = codeRuleService.getBillCode(CodeRuleModule.CODE_RULE_UNIQUE);
+//        }
+        infoBean.setUniqueCode("");
+        infoBean.setCompleteBatchNo("");
+        save(infoBean);
+        //库存日志
+        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN);
+        return R.success("");
+    }
+
+
+    @Override
+    public R<String> procedureToolClampStockIn(MToolClamp clamp, Long storgeId) {
+        StockInfo infoBean = new StockInfo();
+        infoBean.setStorgeId(storgeId);
+        infoBean.setLockStatus("1");
+        //MToolMeterial meterial = toolMeterialService.getById(bomProcedureTray.getTrayId());
+        infoBean.setGoodsId(clamp.getId());
+        infoBean.setGoodsType("1");
+        infoBean.setSpecId(clamp.getId());
+        infoBean.setNum(1);
+        infoBean.setUniqueCode("");
+        infoBean.setCompleteBatchNo("");
+        save(infoBean);
+        //库存日志
+        stockLogService.saveLog(infoBean,BizConstant.STOCK_TYPE_IN);
+        return R.success("");
+    }
+
     @Override
     public R<String> meterialStockOut(BomProcedureMeterial bomProcedureMeterial, Long storgeId,String completeBatchNo) {
         Map map = new HashMap();

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

@@ -1599,26 +1599,22 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
 
         R<String> result = R.success("");
 
-//        for(ProductionresourcePosition p:list){
-//            String stockGoodsId = p.getGoodsId()==null?"":p.getGoodsId().toString();
-//            if(!goodsId.equals(stockGoodsId))
-//                continue;
-//
-//            if("1".equals(p.getCategory())||"2".equals(p.getCategory())){//托盘夹具
-//                BomProcedureTray tray = new BomProcedureTray();
-//                tray.setTrayId(p.getGoodsId());
-//                result = stockInfoService.procedureTrayStockIn(tray, list.get(0).getStorgeId(), "", "");
-//            }
-//
-//            if("4".equals(p.getCategory())){//原材料
-//                BomProcedureMeterial meterial = new BomProcedureMeterial();
-//                meterial.setMeterialId(p.getGoodsId());
-//                result = stockInfoService.meterialStockIn(meterial, list.get(0).getStorgeId(), "","");
-//            }
-//            if (!result.getIsSuccess()) {
-//                break;
-//            }
-//        }
+        for(ProductionresourcePosition p:list){
+
+            if("1".equals(category)){//托盘夹具
+                Tray tray = new Tray();
+                tray.setId(Long.parseLong(goodsId));
+                result = stockInfoService.procedureTrayStockIn(tray, list.get(0).getStorgeId());
+            }else if("2".equals(p.getCategory())){
+                MToolClamp clamp = new MToolClamp();
+                clamp.setId(Long.parseLong(goodsId));
+                result = stockInfoService.procedureToolClampStockIn(clamp, list.get(0).getStorgeId());
+            }
+
+            if (!result.getIsSuccess()) {
+                break;
+            }
+        }
         return result;
     }