| | |
| | | @Autowired |
| | | private IAllocationBMO allocationBMOImpl; |
| | | |
| | | @Autowired |
| | | private IOaWorkflowActivitiInnerServiceSMO oaWorkflowUserInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | Assert.hasKeyAndValue(reqJson, "remark", "请求报文中未包含申请信息"); |
| | |
| | | |
| | | //封装调拨对象 |
| | | AllocationStorehouseApplyPo allocationStorehouseApplyPo = covertAllocationStorehouseApply(reqJson); |
| | | //todo 默认写0 后面 相加 |
| | | allocationStorehouseApplyPo.setApplyCount("0"); |
| | | JSONArray resourceStores = reqJson.getJSONArray("resourceStores"); |
| | | JSONObject resObj = null; |
| | | for (int resIndex = 0; resIndex < resourceStores.size(); resIndex++) { |
| | |
| | | |
| | | OaWorkflowDto oaWorkflowDto = new OaWorkflowDto(); |
| | | oaWorkflowDto.setStoreId(allocationStorehouseApplyPo.getStoreId()); |
| | | oaWorkflowDto.setFlowId(storehouseDto.getAllocationFlowId()); |
| | | oaWorkflowDto.setFlowId(storehouseDtos.get(0).getAllocationFlowId()); |
| | | List<OaWorkflowDto> oaWorkflowDtos = oaWorkflowInnerServiceSMOImpl.queryOaWorkflows(oaWorkflowDto); |
| | | |
| | | //todo 提交审核 |
| | |
| | | //todo 每条记录调拨 |
| | | allocationBMOImpl.doToAllocationStorehouse(tmpAllocationStorehouseDto, allocationStock); |
| | | } |
| | | |
| | | String applyId = allocationStorehouseApplyPo.getApplyId(); |
| | | AllocationStorehouseApplyPo tmpAllocationStorehouseApplyPo = new AllocationStorehouseApplyPo(); |
| | | tmpAllocationStorehouseApplyPo.setApplyId(applyId); |
| | | //todo 如果包含taskId 流程提交下去 |
| | | if (reqJson.containsKey("taskId")) { |
| | | reqJson.put("auditCode", "1100"); |
| | | reqJson.put("auditMessage", "入库成功"); |
| | | reqJson.put("id", reqJson.getString("applyId")); |
| | | reqJson.put("storeId", reqJson.getString("storeId")); |
| | | reqJson.put("nextUserId", reqJson.getString("staffId")); |
| | | boolean isLastTask = oaWorkflowUserInnerServiceSMOImpl.completeTask(reqJson); |
| | | if (isLastTask) { |
| | | tmpAllocationStorehouseApplyPo.setState(AllocationStorehouseApplyDto.STATE_END); |
| | | } else { |
| | | tmpAllocationStorehouseApplyPo.setState(AllocationStorehouseApplyDto.STATE_DEALING); |
| | | } |
| | | } else { |
| | | tmpAllocationStorehouseApplyPo.setState(AllocationStorehouseApplyDto.STATE_DEALING); |
| | | } |
| | | tmpAllocationStorehouseApplyPo.setStatusCd("0"); |
| | | allocationStorehouseApplyV1InnerServiceSMOImpl.updateAllocationStorehouseApply(tmpAllocationStorehouseApplyPo); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (flag < 1) { |
| | | throw new CmdException("保存调拨物品失败"); |
| | | } |
| | | |
| | | int applyCount = Integer.parseInt(allocationStorehouseApplyPo.getApplyCount()); |
| | | applyCount += resObj.getIntValue("curStock"); |
| | | allocationStorehouseApplyPo.setApplyCount(applyCount + ""); |
| | | } |
| | | |
| | | /** |