Ver código fonte

调拨申请

java110 4 anos atrás
pai
commit
2b9db501b2

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/allocationStorehouseApply/AllocationStorehouseApplyDto.java

@@ -45,6 +45,7 @@ public class AllocationStorehouseApplyDto extends PageDto implements Serializabl
     private String startTime;
     private String endTime;
     private String communityId;
+    private String nextUserId;
 
     private Date createTime;
 
@@ -274,4 +275,12 @@ public class AllocationStorehouseApplyDto extends PageDto implements Serializabl
     public void setShId(String shId) {
         this.shId = shId;
     }
+
+    public String getNextUserId() {
+        return nextUserId;
+    }
+
+    public void setNextUserId(String nextUserId) {
+        this.nextUserId = nextUserId;
+    }
 }

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

@@ -109,7 +109,7 @@
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
         </if>
-        <if test="communityId !=null and communityId != '' and operationType==null ">
+        <if test="communityId != null and communityId != '' and operationType==null ">
             and t.community_id in (#{communityId},'9999')
         </if>
         <if test="storeId !=null and storeId != ''">

+ 1 - 1
service-common/src/main/java/com/java110/common/bmo/workflow/impl/QueryWorkFlowFirstStaffBMOImpl.java

@@ -97,7 +97,7 @@ public class QueryWorkFlowFirstStaffBMOImpl implements IQueryWorkFlowFirstStaffB
         List<Map> workflows = workflowServiceDaoImpl.getWorkflowInfo(BeanConvertUtil.beanCovertMap(workflowDto));
 
         if (workflows == null || workflows.size() < 1) {
-            return null;
+            return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "未查询到流程");
         }
 
         WorkflowDto tmpWorkflowDto = BeanConvertUtil.covertBean(workflows.get(0), WorkflowDto.class);

+ 4 - 6
service-common/src/main/java/com/java110/common/smo/impl/AllocationStorehouseUserInnerServiceSMOImpl.java

@@ -3,11 +3,9 @@ package com.java110.common.smo.impl;
 import com.java110.core.base.smo.BaseServiceSMO;
 import com.java110.dto.PageDto;
 import com.java110.dto.allocationStorehouseApply.AllocationStorehouseApplyDto;
-import com.java110.dto.area.AreaDto;
 import com.java110.dto.businessDatabus.CustomBusinessDatabusDto;
 import com.java110.dto.purchaseApply.PurchaseApplyDto;
 import com.java110.dto.storehouse.StorehouseDto;
-import com.java110.dto.userLogin.UserLoginDto;
 import com.java110.dto.workflow.WorkflowDto;
 import com.java110.entity.audit.AuditUser;
 import com.java110.intf.common.IAllocationStorehouseUserInnerServiceSMO;
@@ -16,7 +14,6 @@ import com.java110.intf.job.IDataBusInnerServiceSMO;
 import com.java110.intf.store.IAllocationStorehouseApplyInnerServiceSMO;
 import com.java110.intf.store.IPurchaseApplyInnerServiceSMO;
 import com.java110.intf.store.IStorehouseInnerServiceSMO;
-import com.java110.intf.user.IUserLoginInnerServiceSMO;
 import com.java110.po.machine.MachineRecordPo;
 import com.java110.utils.constant.BusinessTypeConstant;
 import com.java110.utils.util.Assert;
@@ -82,13 +79,14 @@ public class AllocationStorehouseUserInnerServiceSMOImpl extends BaseServiceSMO
         variables.put("allocationStorehouseApplyDto", allocationStorehouseApplyDto);
         variables.put("userId", allocationStorehouseApplyDto.getCurrentUserId());
         variables.put("startUserId", allocationStorehouseApplyDto.getCurrentUserId());
+        variables.put("nextUserId", allocationStorehouseApplyDto.getNextUserId());
         //查询调拨源仓库是集团仓库还是小区仓库,小区仓库走被调拨流程审批
         StorehouseDto storehouseDto = new StorehouseDto();
         storehouseDto.setShId(allocationStorehouseApplyDto.getShId());
         List<StorehouseDto> storehouseDtoList = iStorehouseInnerServiceSMO.queryStorehouses(storehouseDto);
         StorehouseDto storehouseDto1 = new StorehouseDto();
         String communityId = null;
-        if (storehouseDtoList != null && storehouseDtoList.size() == 1) {
+        if (storehouseDtoList != null && storehouseDtoList.size() > 0) {
             storehouseDto1 = storehouseDtoList.get(0);
         }
         if (SH_TYPE_GROUP.equals(storehouseDto1.getShType())) {//集团仓库
@@ -252,10 +250,10 @@ public class AllocationStorehouseUserInnerServiceSMOImpl extends BaseServiceSMO
         List<String> flowIdList = new ArrayList<String>();
         for (WorkflowDto workflowDto1 : workflowDtos) {
             if (StringUtil.isEmpty(workflowDto1.getProcessDefinitionKey()) && WorkflowDto.FLOW_TYPE_ALLOCATION_STOREHOUSE.equals(workflowDto1.getFlowType())) {
-                throw new IllegalArgumentException("小区编码="+workflowDto1.getCommunityId()+"的物品调拨流程还未部署");
+                throw new IllegalArgumentException("小区编码=" + workflowDto1.getCommunityId() + "的物品调拨流程还未部署");
             }
             if (StringUtil.isEmpty(workflowDto1.getProcessDefinitionKey()) && WorkflowDto.FLOW_TYPE_ALLOCATION_STOREHOUSE_GO.equals(workflowDto1.getFlowType())) {
-                throw new IllegalArgumentException("小区编码="+workflowDto1.getCommunityId()+"的物品被调拨还未部署");
+                throw new IllegalArgumentException("小区编码=" + workflowDto1.getCommunityId() + "的物品被调拨还未部署");
             }
             flowIdList.add(WorkflowDto.DEFAULT_PROCESS + workflowDto1.getFlowId());
         }

+ 2 - 2
service-store/src/main/java/com/java110/store/cmd/resourceStore/SaveAllocationStorehouseCmd.java

@@ -152,6 +152,7 @@ public class SaveAllocationStorehouseCmd extends AbstractServiceCmdListener {
         if (AllocationStorehouseApplyDto.STORE_TYPE_ALLOCATION.equals(applyType)) {
             AllocationStorehouseApplyDto allocationStorehouseDto = BeanConvertUtil.covertBean(allocationStorehouseApplyPo, AllocationStorehouseApplyDto.class);
             allocationStorehouseDto.setCurrentUserId(reqJson.getString("userId"));
+            allocationStorehouseDto.setNextUserId(reqJson.getString("staffId"));
             allocationStorehouseUserInnerServiceSMOImpl.startProcess(allocationStorehouseDto);
         }
 
@@ -159,7 +160,6 @@ public class SaveAllocationStorehouseCmd extends AbstractServiceCmdListener {
     }
 
     private void doDealResourceStore(JSONObject reqJson, String applyType, AllocationStorehouseApplyPo allocationStorehouseApplyPo, JSONArray resourceStores, JSONObject resObj) {
-        int flag;
         //保存调拨申请的物品调拨记录
         saveAllocationStorehouse(reqJson, applyType, allocationStorehouseApplyPo, resObj);
         if (AllocationStorehouseApplyDto.STORE_TYPE_ALLOCATION.equals(applyType)) { //调拨减去库存
@@ -345,7 +345,7 @@ public class SaveAllocationStorehouseCmd extends AbstractServiceCmdListener {
             resourceStorePo.setShId(resObj.getString("shId"));
             BigDecimal stockA = new BigDecimal(resObj.getString("stock"));//现有库存
             BigDecimal stockB = new BigDecimal(resObj.getString("curStock"));//调拨数量
-            if (stockA.compareTo(stockB) == -1) {
+            if (stockA.compareTo(stockB) < 0) {
                 throw new IllegalArgumentException("库存不足!");
             }
             resourceStorePo.setStock((stockA.subtract(stockB)).toString());