|
|
@@ -1216,12 +1216,20 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
String code = bean.getCode();
|
|
|
String msg = bean.getMsg();
|
|
|
String taskNodeId = bean.getTaskNodeId() == null ? "" : bean.getTaskNodeId().toString();
|
|
|
+
|
|
|
+
|
|
|
+ String taskInfos = msgUtil.redis_get(taskNodeId).toString();
|
|
|
+
|
|
|
+ JSONObject taskInfosObject = JSONObject.parseObject(taskInfos);
|
|
|
+ ManualInfo manualInfo = JSONObject.parseObject(taskInfosObject.getString("taskInfo"),ManualInfo.class);
|
|
|
+
|
|
|
+
|
|
|
String taskId = bean.getTaskId() == null ? "" : bean.getTaskId().toString();
|
|
|
String bizCallBackData = bean.getBizCallBackData();
|
|
|
String uid = bean.getUid() == null ? "" : bean.getUid().toString();
|
|
|
|
|
|
String handModeFlag = bean.getHandModeFlag();
|
|
|
- if("1".equals(handModeFlag)){//手动模式是特殊处理
|
|
|
+ if(null != manualInfo && "1".equals(manualInfo.getHandModeFlag())){//手动模式是特殊处理
|
|
|
return handModeStock(bean);
|
|
|
}
|
|
|
|
|
|
@@ -1590,19 +1598,19 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
}else{
|
|
|
if(manualInfo.getNextTaskNodeIndex() > taskNodes.size() -1){
|
|
|
Map queryMap = new HashMap();
|
|
|
- queryMap.put("pointId", manualInfo.getStartoperation());
|
|
|
+ queryMap.put("pointId", manualInfo.getStartpointId());
|
|
|
queryMap.put("resourceId", manualInfo.getStartResourceId());
|
|
|
|
|
|
List<ProductionresourcePosition> sourceList = productionresourcePositionMapper.getStorgeIdByResource(queryMap);
|
|
|
|
|
|
queryMap.clear();
|
|
|
- queryMap.put("pointId", manualInfo.getEndoperation());
|
|
|
+ queryMap.put("pointId", manualInfo.getEndpointId());
|
|
|
queryMap.put("resourceId", manualInfo.getEndResourceId());
|
|
|
List<ProductionresourcePosition> targetList = productionresourcePositionMapper.getStorgeIdByResource(queryMap);
|
|
|
|
|
|
// 先将原库位上所有物料信息读取出来
|
|
|
- List<StockInfo> stockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getStorgeId, sourceList.get(0).getStorgeId()));
|
|
|
|
|
|
+ List<StockInfo> stockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getStorgeId, sourceList.get(0).getStorgeId()));
|
|
|
for(StockInfo stockInfo : stockInfos){
|
|
|
// 更新出库信息
|
|
|
saveStockLog(stockInfo,BizConstant.STOCK_TYPE_OUT);
|
|
|
@@ -1612,10 +1620,11 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
// 更新库位物料信息
|
|
|
stockInfoMapper.updateById(stockInfo);
|
|
|
}
|
|
|
+ msgUtil.redis_del(manualInfo.getManualId());
|
|
|
return R.success();
|
|
|
}else{
|
|
|
// 继续执行后续结点
|
|
|
- Map<String,Object> processInfo = ManualTaskOperatorUtil.judgeProcessInfo((LinkedList<String>) taskNodes,manualInfo);
|
|
|
+ Map<String,Object> processInfo = ManualTaskOperatorUtil.judgeProcessInfo((ArrayList<String>) taskNodes,manualInfo);
|
|
|
JSONObject returnDataObject = new JSONObject();
|
|
|
|
|
|
// 组装参数
|
|
|
@@ -1657,17 +1666,23 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
|
|
|
@Override
|
|
|
public R handModeStockOut(Map conMap) {
|
|
|
- String resourceId = conMap.get("resourceId").toString();
|
|
|
- String pointId = conMap.get("pointId").toString();
|
|
|
- String category = conMap.get("category").toString();
|
|
|
- String goodsId = conMap.get("goodsId").toString();
|
|
|
- Map queryMap = new HashMap();
|
|
|
- queryMap.put("pointId", pointId);
|
|
|
- queryMap.put("resourceId", resourceId);
|
|
|
- List<ProductionresourcePosition> list = productionresourcePositionMapper.getStorgeIdByResource(queryMap);
|
|
|
- R result = R.success();
|
|
|
- ProductionresourcePosition productionresourcePosition = list.get(0);
|
|
|
- return stockInfoService.manualStockOut(goodsId, productionresourcePosition.getStorgeId());
|
|
|
+ try{
|
|
|
+ String resourceId = conMap.get("resourceId").toString();
|
|
|
+ String pointId = conMap.get("pointId").toString();
|
|
|
+ String category = conMap.get("category").toString();
|
|
|
+ String goodsId = conMap.get("goodsId").toString();
|
|
|
+ Map queryMap = new HashMap();
|
|
|
+ queryMap.put("pointId", pointId);
|
|
|
+ queryMap.put("resourceId", resourceId);
|
|
|
+ List<ProductionresourcePosition> list = productionresourcePositionMapper.getStorgeIdByResource(queryMap);
|
|
|
+ R result = R.success();
|
|
|
+ ProductionresourcePosition productionresourcePosition = list.get(0);
|
|
|
+ return stockInfoService.manualStockOut(goodsId, productionresourcePosition.getStorgeId(),category);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return R.fail("删除子盘夹具发生异常");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1690,7 +1705,13 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
if("2".equals(category)){//托盘夹具
|
|
|
// 查询当前子盘使用的数量,根据出入库日志查询当前的子盘最大数量和库存数量进行比较进行累加
|
|
|
Tray tray = trayMapper.selectById(goodsId);
|
|
|
- int maxTrayNo = stockLogMapper.selectMaxNoByProductId(queryMap);
|
|
|
+ String maxTray = stockInfoMapper.selectMaxNoByProductId(queryMap);
|
|
|
+ int maxTrayNo = 0;
|
|
|
+ if(StringUtils.isBlank(maxTray)){
|
|
|
+ maxTrayNo = 0;
|
|
|
+ }else{
|
|
|
+ maxTrayNo = Integer.parseInt(maxTray);
|
|
|
+ }
|
|
|
int sumTray = stockInfoMapper.selectSumInStockByProductId(queryMap);
|
|
|
BigDecimal uniqueCode;
|
|
|
if(sumTray < tray.getNum()){
|
|
|
@@ -1699,10 +1720,18 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
return R.fail("当前托盘数量已用完");
|
|
|
}
|
|
|
result = stockInfoService.procedureTrayStockIn(uniqueCode, Long.valueOf(goodsId), list.get(0).getStorgeId());
|
|
|
- }else if("1".equals(p.getCategory())){
|
|
|
+ }else if("1".equals(category)){
|
|
|
+ // 判断创建夹具之前
|
|
|
+
|
|
|
// 查询当前夹具使用的数量,根据出入库日志查询当前的夹具最大数量和库存数量进行比较进行累加
|
|
|
MToolClamp mToolClamp = mToolClampMapper.selectById(goodsId);
|
|
|
- int maxMToolClampNo = stockLogMapper.selectMaxNoByProductId(queryMap);
|
|
|
+ String maxMToolClamp = stockInfoMapper.selectMaxNoByProductId(queryMap);
|
|
|
+ int maxMToolClampNo = 0;
|
|
|
+ if(StringUtils.isBlank(maxMToolClamp)){
|
|
|
+ maxMToolClampNo = 0;
|
|
|
+ }else{
|
|
|
+ maxMToolClampNo = Integer.parseInt(maxMToolClamp);
|
|
|
+ }
|
|
|
int sumMToolClamp = stockInfoMapper.selectSumInStockByProductId(queryMap);
|
|
|
BigDecimal uniqueCode;
|
|
|
if(sumMToolClamp < mToolClamp.getNum()){
|