|
@@ -1082,6 +1082,13 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
String bizCallBackData = bean.getBizCallBackData();
|
|
|
String uid = bean.getUid() == null ? "" : bean.getUid().toString();
|
|
|
|
|
|
+ String handModeFlag = bean.getHandModeFlag();
|
|
|
+ if("1".equals(handModeFlag)){//手动模式是特殊处理
|
|
|
+ return handModeStock(JSONObject.parseObject(bizCallBackData)).getData();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//验证是否重复回调
|
|
|
String cacheUid = msgUtil.redis_get(uid) == null ? "" : msgUtil.redis_get(uid).toString();
|
|
|
if (StringUtil.isNotEmpty(cacheUid)) {//排除掉重复回调
|
|
@@ -1381,4 +1388,51 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
return R.success("");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param callBackJson
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public R<String> handModeStock(JSONObject callBackJson) {
|
|
|
+ String srcStorgeId = callBackJson.getString("srcPosition");
|
|
|
+ String targetStorgeId = callBackJson.getString("targetPostion");
|
|
|
+ Map queryMap = new HashMap();
|
|
|
+ queryMap.put("pointId", srcStorgeId);
|
|
|
+ List<ProductionresourcePosition> list = productionresourcePositionMapper.getPPList(queryMap);
|
|
|
+
|
|
|
+ List<ProductionresourcePosition> targetlist = productionresourcePositionMapper.selectList(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getPointId, targetStorgeId));
|
|
|
+
|
|
|
+ R<String> result = null;
|
|
|
+
|
|
|
+ if(CollectionUtil.isEmpty(targetlist))
|
|
|
+ return result;
|
|
|
+
|
|
|
+
|
|
|
+ for(ProductionresourcePosition p:list){
|
|
|
+ if("1".equals(p.getCategory())||"2".equals(p.getCategory())){//托盘夹具
|
|
|
+ BomProcedureTray tray = new BomProcedureTray();
|
|
|
+ tray.setTrayId(p.getGoodsId());
|
|
|
+ result = stockInfoService.procedureTrayStockOut(tray, p.getStorgeId());
|
|
|
+ if (result.getIsSuccess()) {
|
|
|
+ result = stockInfoService.procedureTrayStockIn(tray, targetlist.get(0).getStorgeId(), result.getData(), "");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if("4".equals(p.getCategory())){//原材料
|
|
|
+ BomProcedureMeterial meterial = new BomProcedureMeterial();
|
|
|
+ meterial.setMeterialId(p.getGoodsId());
|
|
|
+ R<String> ckresult = stockInfoService.meterialStockOut(meterial, p.getStorgeId(), "");
|
|
|
+ R<String> rkresult = null;
|
|
|
+ if (ckresult.getIsSuccess()) {
|
|
|
+ rkresult = stockInfoService.meterialStockIn(meterial, targetlist.get(0).getStorgeId(), ckresult.getData(),"");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!result.getIsSuccess()) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
}
|