| | |
| | | private String useFlowName; |
| | | private String allocationFlowName; |
| | | |
| | | private String communityId; |
| | | |
| | | private String allowPurchase; |
| | | |
| | | private String allowUse; |
| | | |
| | | public String getShDesc() { |
| | | return shDesc; |
| | | } |
| | |
| | | public void setAllocationFlowId(String allocationFlowId) { |
| | | this.allocationFlowId = allocationFlowId; |
| | | } |
| | | |
| | | public String getCommunityId() { |
| | | return communityId; |
| | | } |
| | | |
| | | public void setCommunityId(String communityId) { |
| | | this.communityId = communityId; |
| | | } |
| | | |
| | | public String getAllowPurchase() { |
| | | return allowPurchase; |
| | | } |
| | | |
| | | public void setAllowPurchase(String allowPurchase) { |
| | | this.allowPurchase = allowPurchase; |
| | | } |
| | | |
| | | public String getAllowUse() { |
| | | return allowUse; |
| | | } |
| | | |
| | | public void setAllowUse(String allowUse) { |
| | | this.allowUse = allowUse; |
| | | } |
| | | } |
| | |
| | | private String allocationSwitch; |
| | | private String allocationRafId; |
| | | |
| | | private String communityId; |
| | | |
| | | private String allowPurchase; |
| | | |
| | | private String allowUse; |
| | | |
| | | |
| | | public String getShDesc() { |
| | | return shDesc; |
| | | } |
| | |
| | | public void setAllocationRafId(String allocationRafId) { |
| | | this.allocationRafId = allocationRafId; |
| | | } |
| | | |
| | | public String getCommunityId() { |
| | | return communityId; |
| | | } |
| | | |
| | | public void setCommunityId(String communityId) { |
| | | this.communityId = communityId; |
| | | } |
| | | |
| | | public String getAllowPurchase() { |
| | | return allowPurchase; |
| | | } |
| | | |
| | | public void setAllowPurchase(String allowPurchase) { |
| | | this.allowPurchase = allowPurchase; |
| | | } |
| | | |
| | | public String getAllowUse() { |
| | | return allowUse; |
| | | } |
| | | |
| | | public void setAllowUse(String allowUse) { |
| | | this.allowUse = allowUse; |
| | | } |
| | | } |
| | |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{storeId} |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="flowId !=null and flowId != ''"> |
| | | and t.flow_id= #{flowId} |
| | |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{storeId} |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | |
| | | </update> |
| | |
| | | and t.audit_type= #{auditType} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{storeId} |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | |
| | | |
| | |
| | | t.purchase_raf_id purchaseRafId,t.use_switch useSwitch,t.use_raf_id useRafId, |
| | | t.allocation_switch allocationSwitch,t.allocation_raf_id allocationRafId,raf.flow_name purchaseFlowName, |
| | | raf.flow_id purchaseFlowId,raf1.flow_id useFlowId,raf2.flow_id allocationFlowId, |
| | | raf1.flow_name useFlowName,raf2.flow_name allocationFlowName |
| | | raf1.flow_name useFlowName,raf2.flow_name allocationFlowName,t.community_id communityId, |
| | | t.allow_purchase allowPurchase,t.allow_use allowUse |
| | | from storehouse t |
| | | left join resource_audit_flow raf on t.purchase_raf_id = raf.raf_id and raf.status_cd = '0' |
| | | left join resource_audit_flow raf1 on t.use_raf_id = raf1.raf_id and raf1.status_cd = '0' |
| | |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="allowPurchase !=null and allowPurchase != ''"> |
| | | and t.allow_purchase= #{allowPurchase} |
| | | </if> |
| | | <if test="allowUse !=null and allowUse != ''"> |
| | | and t.allow_use= #{allowUse} |
| | | </if> |
| | | <if test="isShow !=null and isShow != ''"> |
| | | and t.is_show= #{isShow} |
| | |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="allowPurchase !=null and allowPurchase != ''"> |
| | | and t.allow_purchase= #{allowPurchase} |
| | | </if> |
| | | <if test="allowUse !=null and allowUse != ''"> |
| | | and t.allow_use= #{allowUse} |
| | | </if> |
| | | <if test="isShow !=null and isShow != ''"> |
| | | and t.is_show= #{isShow} |
| | | </if> |
| | |
| | | <insert id="saveStorehouseInfo" parameterType="Map"> |
| | | insert into storehouse( |
| | | sh_desc,sh_id,sh_name,store_id,is_show,purchase_switch,purchase_raf_id, |
| | | use_switch,use_raf_id,allocation_switch,allocation_raf_id |
| | | use_switch,use_raf_id,allocation_switch,allocation_raf_id,community_id,allow_purchase,allow_use |
| | | ) values ( |
| | | #{shDesc},#{shId},#{shName},#{storeId},#{isShow} |
| | | ,#{purchaseSwitch},#{purchaseRafId},#{useSwitch},#{useRafId},#{allocationSwitch},#{allocationRafId} |
| | | ,#{purchaseSwitch},#{purchaseRafId},#{useSwitch},#{useRafId},#{allocationSwitch},#{allocationRafId}, |
| | | #{communityId},#{allowPurchase},#{allowUse} |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | t.allocation_switch allocationSwitch,t.allocation_raf_id allocationRafId, |
| | | raf.flow_name purchaseFlowName, |
| | | raf.flow_id purchaseFlowId,raf1.flow_id useFlowId,raf2.flow_id allocationFlowId, |
| | | raf1.flow_name useFlowName,raf2.flow_name allocationFlowName |
| | | raf1.flow_name useFlowName,raf2.flow_name allocationFlowName,t.community_id communityId, |
| | | t.allow_purchase allowPurchase,t.allow_use allowUse |
| | | from storehouse t |
| | | left join resource_audit_flow raf on t.purchase_raf_id = raf.raf_id and raf.status_cd = '0' |
| | | left join resource_audit_flow raf1 on t.use_raf_id = raf1.raf_id and raf1.status_cd = '0' |
| | |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="allowPurchase !=null and allowPurchase != ''"> |
| | | and t.allow_purchase= #{allowPurchase} |
| | | </if> |
| | | <if test="allowUse !=null and allowUse != ''"> |
| | | and t.allow_use= #{allowUse} |
| | | </if> |
| | | <if test="isShow !=null and isShow != ''"> |
| | | and t.is_show= #{isShow} |
| | |
| | | <if test="shName !=null and shName != ''"> |
| | | , t.sh_name= #{shName} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | , t.store_id= #{storeId} |
| | | </if> |
| | | |
| | | <if test="isShow !=null and isShow != ''"> |
| | | , t.is_show= #{isShow} |
| | | </if> |
| | | |
| | | <if test="allowPurchase !=null and allowPurchase != ''"> |
| | | , t.allow_purchase= #{allowPurchase} |
| | | </if> |
| | | <if test="allowUse !=null and allowUse != ''"> |
| | | , t.allow_use= #{allowUse} |
| | | </if> |
| | | where 1=1 |
| | | <if test="shId !=null and shId != ''"> |
| | | and t.sh_id= #{shId} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | |
| | | </update> |
| | |
| | | <if test="isShow !=null and isShow != ''"> |
| | | and t.is_show= #{isShow} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="allowPurchase !=null and allowPurchase != ''"> |
| | | and t.allow_purchase= #{allowPurchase} |
| | | </if> |
| | | <if test="allowUse !=null and allowUse != ''"> |
| | | and t.allow_use= #{allowUse} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | |
| | | List<StorehouseDto> storehouseDtos = storehouseV1InnerServiceSMOImpl.queryStorehouses(storehouseDto); |
| | | Assert.listOnlyOne(storehouseDtos, "仓库不存在"); |
| | | |
| | | //todo 不允许采购 |
| | | if (!"ON".equals(storehouseDtos.get(0).getAllowPurchase())) { |
| | | throw new CmdException(storehouseDtos.get(0).getShName() + "不允许采购"); |
| | | } |
| | | |
| | | if (!StorehouseDto.SWITCH_ON.equals(storehouseDtos.get(0).getPurchaseSwitch())) { |
| | | return; |
| | | } |
| | |
| | | import com.java110.dto.purchase.AllocationStorehouseApplyDto; |
| | | import com.java110.dto.purchase.PurchaseApplyDto; |
| | | import com.java110.dto.resource.ResourceStoreDto; |
| | | import com.java110.dto.store.StorehouseDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.store.*; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | |
| | | @Autowired |
| | | private IResourceStoreTimesV1InnerServiceSMO resourceStoreTimesV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IStorehouseV1InnerServiceSMO storehouseV1InnerServiceSMOImpl; |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | Assert.hasKeyAndValue(reqJson, "resourceStores", "必填,请填写申请采购的物资"); |
| | | Assert.hasKeyAndValue(reqJson, "description", "必填,请填写采购申请说明"); |
| | | Assert.hasKeyAndValue(reqJson, "resOrderType", "必填,请填写申请类型"); |
| | | Assert.hasKeyAndValue(reqJson, "shId", "必填,请填写仓库"); |
| | | JSONArray resourceStores = reqJson.getJSONArray("resourceStores"); |
| | | |
| | | if (resourceStores == null || resourceStores.size() < 1) { |
| | | throw new CmdException("未包含采购物品"); |
| | | } |
| | | |
| | | //todo 查询仓库是否存在 |
| | | StorehouseDto storehouseDto = new StorehouseDto(); |
| | | storehouseDto.setShId(reqJson.getString("shId")); |
| | | List<StorehouseDto> storehouseDtos = storehouseV1InnerServiceSMOImpl.queryStorehouses(storehouseDto); |
| | | Assert.listOnlyOne(storehouseDtos, "仓库不存在"); |
| | | |
| | | //todo 不允许采购 |
| | | if (!"ON".equals(storehouseDtos.get(0).getAllowPurchase())) { |
| | | throw new CmdException(storehouseDtos.get(0).getShName() + "不允许采购"); |
| | | } |
| | | } |
| | | |
| | | /** |