ソースを参照

优化调拨问题

java110 2 年 前
コミット
b67898016d

+ 10 - 0
java110-bean/src/main/java/com/java110/dto/oaWorkflow/WorkflowStepStaffDto.java

@@ -29,6 +29,8 @@ public class WorkflowStepStaffDto extends PageDto implements Serializable {
 
     private String statusCd = "0";
 
+    private String processDefinitionKey;
+
 
     public String getWssId() {
         return wssId;
@@ -110,4 +112,12 @@ public class WorkflowStepStaffDto extends PageDto implements Serializable {
     public void setFlowTypes(String[] flowTypes) {
         this.flowTypes = flowTypes;
     }
+
+    public String getProcessDefinitionKey() {
+        return processDefinitionKey;
+    }
+
+    public void setProcessDefinitionKey(String processDefinitionKey) {
+        this.processDefinitionKey = processDefinitionKey;
+    }
 }

+ 20 - 0
java110-bean/src/main/java/com/java110/dto/purchase/AllocationStorehouseApplyDto.java

@@ -60,6 +60,10 @@ public class AllocationStorehouseApplyDto extends PageDto implements Serializabl
     //调拨源仓库
     private String shId;
 
+    private String storeManager;
+
+    private String processDefinitionKey;
+
     public String getApplyId() {
         return applyId;
     }
@@ -283,4 +287,20 @@ public class AllocationStorehouseApplyDto extends PageDto implements Serializabl
     public void setNextUserId(String nextUserId) {
         this.nextUserId = nextUserId;
     }
+
+    public String getStoreManager() {
+        return storeManager;
+    }
+
+    public void setStoreManager(String storeManager) {
+        this.storeManager = storeManager;
+    }
+
+    public String getProcessDefinitionKey() {
+        return processDefinitionKey;
+    }
+
+    public void setProcessDefinitionKey(String processDefinitionKey) {
+        this.processDefinitionKey = processDefinitionKey;
+    }
 }

+ 3 - 1
java110-db/src/main/resources/mapper/common/WorkflowStepStaffServiceDaoImplMapper.xml

@@ -81,8 +81,10 @@
     <select id="getWorkflowStepStaffInfo" parameterType="Map" resultType="Map">
         select t.wss_id,t.wss_id wssId,t.step_id,t.step_id stepId,t.staff_name,t.staff_name
         staffName,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id bId,t.community_id,t.community_id
-        communityId,t.staff_id,t.staff_id staffId,t.staff_role,t.staff_role staffRole,t.flow_type,t.flow_type flowType
+        communityId,t.staff_id,t.staff_id staffId,t.staff_role,t.staff_role staffRole,t.flow_type,t.flow_type flowType,w.process_definition_key processDefinitionKey
         from workflow_step_staff t
+        left JOIN workflow_step ws on t.step_id = ws.step_id and ws.status_cd = '0'
+        left join workflow w on ws.flow_id = w.flow_id and w.status_cd = '0'
         where 1 =1
         <if test="wssId !=null and wssId != ''">
             and t.wss_id= #{wssId}

+ 2 - 0
service-common/src/main/java/com/java110/common/smo/impl/AllocationStorehouseUserInnerServiceSMOImpl.java

@@ -167,6 +167,7 @@ public class AllocationStorehouseUserInnerServiceSMOImpl extends BaseServiceSMO
             String business_key = pi.getBusinessKey();
             appIyIds.add(business_key);
             taskBusinessKeyMap.put(business_key, task.getId());
+            taskBusinessKeyMap.put(business_key+"_ProcessDefinitionKey", pi.getProcessDefinitionKey());
         }
 
         if (appIyIds == null || appIyIds.size() == 0) {
@@ -180,6 +181,7 @@ public class AllocationStorehouseUserInnerServiceSMOImpl extends BaseServiceSMO
         List<AllocationStorehouseApplyDto> tmpAllocationStorehouseApplyDtos = allocationStorehouseApplyInnerServiceSMOImpl.queryAllocationStorehouseApplys(allocationStorehouseApplyDto);
         for (AllocationStorehouseApplyDto tmpAllocationStorehouseApplyDto : tmpAllocationStorehouseApplyDtos) {
             tmpAllocationStorehouseApplyDto.setTaskId(taskBusinessKeyMap.get(tmpAllocationStorehouseApplyDto.getApplyId()));
+            tmpAllocationStorehouseApplyDto.setProcessDefinitionKey(taskBusinessKeyMap.get(tmpAllocationStorehouseApplyDto.getApplyId()+"_ProcessDefinitionKey"));
         }
         return tmpAllocationStorehouseApplyDtos;
     }

+ 42 - 0
service-store/src/main/java/com/java110/store/cmd/resourceStore/ListAllocationStoreAuditOrdersCmd.java

@@ -5,9 +5,12 @@ import com.java110.core.annotation.Java110Cmd;
 import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.oaWorkflow.WorkflowDto;
+import com.java110.dto.oaWorkflow.WorkflowStepStaffDto;
 import com.java110.dto.purchase.AllocationStorehouseApplyDto;
 import com.java110.dto.audit.AuditUser;
 import com.java110.intf.common.IAllocationStorehouseUserInnerServiceSMO;
+import com.java110.intf.common.IWorkflowStepStaffInnerServiceSMO;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.vo.ResultVo;
@@ -24,6 +27,10 @@ public class ListAllocationStoreAuditOrdersCmd extends Cmd {
     @Autowired
     private IAllocationStorehouseUserInnerServiceSMO allocationStorehouseUserInnerServiceSMOImpl;
 
+
+    @Autowired
+    private IWorkflowStepStaffInnerServiceSMO workflowStepStaffInnerServiceSMOImpl;
+
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         Assert.hasKeyAndValue(reqJson, "storeId", "必填,请填写商户ID");
@@ -52,10 +59,45 @@ public class ListAllocationStoreAuditOrdersCmd extends Cmd {
             allocationStorehouseApplyDtos = new ArrayList<>();
         }
 
+        //todo 计算  仓库管理员
+        computeStoreManager(allocationStorehouseApplyDtos, auditUser);
+
         ResponseEntity responseEntity
                 = ResultVo.createResponseEntity((int) Math.ceil((double) count / (double) reqJson.getInteger("row")),
                 (int) count,
                 allocationStorehouseApplyDtos);
         context.setResponseEntity(responseEntity);
     }
+
+    /**
+     * 计算仓库管理员
+     * @param allocationStorehouseApplyDtos
+     * @param auditUser
+     */
+    private void computeStoreManager(List<AllocationStorehouseApplyDto> allocationStorehouseApplyDtos, AuditUser auditUser) {
+
+        if (allocationStorehouseApplyDtos == null || allocationStorehouseApplyDtos.size() < 1) {
+            return;
+        }
+
+        //todo 查询调拨 中是否为管理员
+        WorkflowStepStaffDto workflowStepStaffDto = new WorkflowStepStaffDto();
+        workflowStepStaffDto.setFlowType(WorkflowDto.FLOW_TYPE_ALLOCATION_STOREHOUSE);
+        workflowStepStaffDto.setStaffId(auditUser.getUserId());
+        List<WorkflowStepStaffDto> workflowStepStaffDtos = workflowStepStaffInnerServiceSMOImpl.queryWorkflowStepStaffs(workflowStepStaffDto);
+
+        if(workflowStepStaffDtos == null || workflowStepStaffDtos.size() < 1){
+            return;
+        }
+
+
+
+        for(AllocationStorehouseApplyDto allocationStorehouseApplyDto: allocationStorehouseApplyDtos){
+            for(WorkflowStepStaffDto tmpWorkflowStepStaffDto : workflowStepStaffDtos) {
+                if (allocationStorehouseApplyDto.getProcessDefinitionKey().equals(tmpWorkflowStepStaffDto.getProcessDefinitionKey())){
+                    allocationStorehouseApplyDto.setStoreManager("Y");
+                }
+            }
+        }
+    }
 }