Your Name
2023-09-02 d5eabd4feba91505d8ffeb84dfb392e3b01020a7
service-store/src/main/java/com/java110/store/cmd/resourceStore/SaveAllocationStorehouseCmd.java
@@ -89,6 +89,9 @@
    @Autowired
    private IAllocationBMO allocationBMOImpl;
    @Autowired
    private IOaWorkflowActivitiInnerServiceSMO oaWorkflowUserInnerServiceSMOImpl;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        Assert.hasKeyAndValue(reqJson, "remark", "请求报文中未包含申请信息");
@@ -210,6 +213,8 @@
        //封装调拨对象
        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++) {
@@ -257,7 +262,7 @@
        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 提交审核
@@ -314,6 +319,28 @@
            //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);
    }
    /**
@@ -579,6 +606,10 @@
        if (flag < 1) {
            throw new CmdException("保存调拨物品失败");
        }
        int applyCount = Integer.parseInt(allocationStorehouseApplyPo.getApplyCount());
        applyCount += resObj.getIntValue("curStock");
        allocationStorehouseApplyPo.setApplyCount(applyCount + "");
    }
    /**