|
|
@@ -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");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|