Просмотр исходного кода

解决部分 采购相关代码为 cmd

java110 лет назад: 3
Родитель
Сommit
980797823c
17 измененных файлов с 883 добавлено и 348 удалено
  1. 10 0
      java110-bean/src/main/java/com/java110/po/storehouse/StorehousePo.java
  2. 124 0
      java110-db/src/main/resources/mapper/store/StorehouseV1ServiceDaoImplMapper.xml
  3. 68 0
      java110-interface/src/main/java/com/java110/intf/store/IStorehouseV1InnerServiceSMO.java
  4. 0 49
      service-api/src/main/java/com/java110/api/listener/resourceStore/DeleteAllocationStorehouseApplyListener.java
  5. 0 74
      service-api/src/main/java/com/java110/api/listener/resourceStore/DeleteAllocationStorehouseListener.java
  6. 0 49
      service-api/src/main/java/com/java110/api/listener/resourceStore/DeleteAllocationUserStorehouseListener.java
  7. 0 62
      service-api/src/main/java/com/java110/api/listener/resourceStore/DeleteStorehouseListener.java
  8. 0 64
      service-api/src/main/java/com/java110/api/listener/resourceStore/SaveStorehouseListener.java
  9. 0 49
      service-api/src/main/java/com/java110/api/listener/resourceStore/UpdateStorehouseListener.java
  10. 1 1
      service-store/src/main/java/com/java110/store/cmd/resourceStore/AuditAllocationStoreOrderCmd.java
  11. 144 0
      service-store/src/main/java/com/java110/store/cmd/resourceStore/DeleteAllocationStorehouseCmd.java
  12. 85 0
      service-store/src/main/java/com/java110/store/cmd/resourceStore/DeleteStorehouseCmd.java
  13. 97 0
      service-store/src/main/java/com/java110/store/cmd/resourceStore/SaveStorehouseCmd.java
  14. 76 0
      service-store/src/main/java/com/java110/store/cmd/resourceStore/UpdateStorehouseCmd.java
  15. 77 0
      service-store/src/main/java/com/java110/store/dao/IStorehouseV1ServiceDao.java
  16. 112 0
      service-store/src/main/java/com/java110/store/dao/impl/StorehouseV1ServiceDaoImpl.java
  17. 89 0
      service-store/src/main/java/com/java110/store/smo/impl/StorehouseV1InnerServiceSMOImpl.java

+ 10 - 0
java110-bean/src/main/java/com/java110/po/storehouse/StorehousePo.java

@@ -13,6 +13,8 @@ public class StorehousePo implements Serializable {
     private String storeId;
     private String isShow;
 
+    private String statusCd = "0";
+
     public String getShDesc() {
         return shDesc;
     }
@@ -68,4 +70,12 @@ public class StorehousePo implements Serializable {
     public void setIsShow(String isShow) {
         this.isShow = isShow;
     }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
 }

+ 124 - 0
java110-db/src/main/resources/mapper/store/StorehouseV1ServiceDaoImplMapper.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="storehouseV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存使用记录信息 add by wuxw 2018-07-03 -->
+    <insert id="saveStorehouseInfo" parameterType="Map">
+        insert into storehouse(
+sh_desc,sh_type,sh_obj_id,sh_id,sh_name,store_id,is_show
+) values (
+#{shDesc},#{shType},#{shObjId},#{shId},#{shName},#{storeId},#{isShow}
+)
+    </insert>
+
+
+
+    <!-- 查询使用记录信息 add by wuxw 2018-07-03 -->
+    <select id="getStorehouseInfo" parameterType="Map" resultType="Map">
+        select  t.sh_desc,t.sh_desc shDesc,t.sh_type,t.sh_type shType,t.sh_obj_id,t.sh_obj_id shObjId,t.sh_id,t.sh_id shId,t.status_cd,t.status_cd statusCd,t.sh_name,t.sh_name shName,t.store_id,t.store_id storeId,t.is_show,t.is_show isShow 
+from storehouse t 
+where 1 =1 
+<if test="shDesc !=null and shDesc != ''">
+   and t.sh_desc= #{shDesc}
+</if> 
+<if test="shType !=null and shType != ''">
+   and t.sh_type= #{shType}
+</if> 
+<if test="shObjId !=null and shObjId != ''">
+   and t.sh_obj_id= #{shObjId}
+</if> 
+<if test="shId !=null and shId != ''">
+   and t.sh_id= #{shId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="shName !=null and shName != ''">
+   and t.sh_name= #{shName}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+<if test="isShow !=null and isShow != ''">
+   and t.is_show= #{isShow}
+</if> 
+order by t.create_time desc
+<if test="page != -1 and page != null ">
+   limit #{page}, #{row}
+</if> 
+
+    </select>
+
+
+
+
+    <!-- 修改使用记录信息 add by wuxw 2018-07-03 -->
+    <update id="updateStorehouseInfo" parameterType="Map">
+        update  storehouse t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="shDesc !=null and shDesc != ''">
+, t.sh_desc= #{shDesc}
+</if> 
+<if test="shType !=null and shType != ''">
+, t.sh_type= #{shType}
+</if> 
+<if test="shObjId !=null and shObjId != ''">
+, t.sh_obj_id= #{shObjId}
+</if> 
+<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> 
+ where 1=1 <if test="shId !=null and shId != ''">
+and t.sh_id= #{shId}
+</if> 
+
+    </update>
+
+    <!-- 查询使用记录数量 add by wuxw 2018-07-03 -->
+     <select id="queryStorehousesCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from storehouse t 
+where 1 =1 
+<if test="shDesc !=null and shDesc != ''">
+   and t.sh_desc= #{shDesc}
+</if> 
+<if test="shType !=null and shType != ''">
+   and t.sh_type= #{shType}
+</if> 
+<if test="shObjId !=null and shObjId != ''">
+   and t.sh_obj_id= #{shObjId}
+</if> 
+<if test="shId !=null and shId != ''">
+   and t.sh_id= #{shId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="shName !=null and shName != ''">
+   and t.sh_name= #{shName}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+<if test="isShow !=null and isShow != ''">
+   and t.is_show= #{isShow}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/store/IStorehouseV1InnerServiceSMO.java

@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.intf.store;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.storehouse.StorehouseDto;
+import com.java110.po.storehouse.StorehousePo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2022-08-08 15:47:06 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@FeignClient(name = "store-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/storehouseV1Api")
+public interface IStorehouseV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveStorehouse", method = RequestMethod.POST)
+    public int saveStorehouse(@RequestBody  StorehousePo storehousePo);
+
+    @RequestMapping(value = "/updateStorehouse", method = RequestMethod.POST)
+    public int updateStorehouse(@RequestBody  StorehousePo storehousePo);
+
+    @RequestMapping(value = "/deleteStorehouse", method = RequestMethod.POST)
+    public int deleteStorehouse(@RequestBody  StorehousePo storehousePo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param storehouseDto 数据对象分享
+     * @return StorehouseDto 对象数据
+     */
+    @RequestMapping(value = "/queryStorehouses", method = RequestMethod.POST)
+    List<StorehouseDto> queryStorehouses(@RequestBody StorehouseDto storehouseDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param storehouseDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryStorehousesCount", method = RequestMethod.POST)
+    int queryStorehousesCount(@RequestBody StorehouseDto storehouseDto);
+}

+ 0 - 49
service-api/src/main/java/com/java110/api/listener/resourceStore/DeleteAllocationStorehouseApplyListener.java

@@ -1,49 +0,0 @@
-package com.java110.api.listener.resourceStore;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.allocationStorehouseApply.IAllocationStorehouseApplyBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeAllocationStorehouseApplyConstant;
-import com.java110.utils.util.Assert;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-
-/**
- * 保存小区侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("deleteAllocationStorehouseApplyListener")
-public class DeleteAllocationStorehouseApplyListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IAllocationStorehouseApplyBMO allocationStorehouseApplyBMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
-        Assert.hasKeyAndValue(reqJson, "applyId", "applyId不能为空");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        allocationStorehouseApplyBMOImpl.deleteAllocationStorehouseApply(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeAllocationStorehouseApplyConstant.DELETE_ALLOCATIONSTOREHOUSEAPPLY;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-}

+ 0 - 74
service-api/src/main/java/com/java110/api/listener/resourceStore/DeleteAllocationStorehouseListener.java

@@ -1,74 +0,0 @@
-package com.java110.api.listener.resourceStore;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.allocationStorehouse.IAllocationStorehouseBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.dto.allocationStorehouseApply.AllocationStorehouseApplyDto;
-import com.java110.intf.store.IAllocationStorehouseApplyInnerServiceSMO;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.ServiceCodeAllocationStorehouseConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.StringUtil;
-import com.java110.vo.ResultVo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.ResponseEntity;
-
-import java.util.List;
-
-/**
- * 保存小区侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("deleteAllocationStorehouseListener")
-public class DeleteAllocationStorehouseListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IAllocationStorehouseBMO allocationStorehouseBMOImpl;
-
-    @Autowired
-    private IAllocationStorehouseApplyInnerServiceSMO allocationStorehouseApplyInnerServiceSMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
-        Assert.hasKeyAndValue(reqJson, "applyId", "调拨编号不能为空");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-        //获取申请id
-        String applyId = reqJson.getString("applyId");
-        AllocationStorehouseApplyDto allocationStorehouseApplyDto = new AllocationStorehouseApplyDto();
-        allocationStorehouseApplyDto.setApplyId(applyId);
-        //查询调拨申请信息
-        List<AllocationStorehouseApplyDto> allocationStorehouseApplyDtos = allocationStorehouseApplyInnerServiceSMOImpl.queryAllocationStorehouseApplys(allocationStorehouseApplyDto);
-        Assert.listOnlyOne(allocationStorehouseApplyDtos, "查询调拨申请表错误!");
-        //获取状态
-        String state = allocationStorehouseApplyDtos.get(0).getState();
-        if (!StringUtil.isEmpty(state) && state.equals("1200")) { //1200表示调拨申请状态
-            allocationStorehouseBMOImpl.deleteAllocationStorehouse(reqJson, context);
-        } else {
-            ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_BUSINESS_VERIFICATION, "您的调拨订单已经状态已改变,无法进行取消操作!!");
-            context.setResponseEntity(responseEntity);
-            return;
-        }
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeAllocationStorehouseConstant.DELETE_ALLOCATIONSTOREHOUSE;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-}

+ 0 - 49
service-api/src/main/java/com/java110/api/listener/resourceStore/DeleteAllocationUserStorehouseListener.java

@@ -1,49 +0,0 @@
-package com.java110.api.listener.resourceStore;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.allocationUserStorehouse.IAllocationUserStorehouseBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeAllocationUserStorehouseConstant;
-import com.java110.utils.util.Assert;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.annotation.Java110Listener;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-
-/**
- * 保存小区侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("deleteAllocationUserStorehouseListener")
-public class DeleteAllocationUserStorehouseListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IAllocationUserStorehouseBMO allocationUserStorehouseBMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
-        Assert.hasKeyAndValue(reqJson, "ausId", "ausId不能为空");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        allocationUserStorehouseBMOImpl.deleteAllocationUserStorehouse(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeAllocationUserStorehouseConstant.DELETE_ALLOCATIONUSERSTOREHOUSE;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-}

+ 0 - 62
service-api/src/main/java/com/java110/api/listener/resourceStore/DeleteStorehouseListener.java

@@ -1,62 +0,0 @@
-package com.java110.api.listener.resourceStore;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.storehouse.IStorehouseBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.intf.community.IResourceStoreServiceSMO;
-import com.java110.po.purchase.ResourceStorePo;
-import com.java110.utils.constant.ServiceCodeStorehouseConstant;
-import com.java110.utils.util.Assert;
-import com.java110.vo.ResultVo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.ResponseEntity;
-
-/**
- * 保存小区侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("deleteStorehouseListener")
-public class DeleteStorehouseListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IStorehouseBMO storehouseBMOImpl;
-
-    @Autowired
-    private IResourceStoreServiceSMO resourceStoreServiceSMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-        Assert.hasKeyAndValue(reqJson, "shId", "shId不能为空");
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-        //获取仓库id
-        String shId = reqJson.getString("shId");
-        ResourceStorePo resourceStorePo = new ResourceStorePo();
-        resourceStorePo.setShId(shId);
-        int page = resourceStoreServiceSMOImpl.getResourceStoresCount(resourceStorePo);
-        if (page < 1) {
-            storehouseBMOImpl.deleteStorehouse(reqJson, context);
-        } else {
-            ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_BUSINESS_VERIFICATION, "该仓库包含物品,不能直接删除!");
-            context.setResponseEntity(responseEntity);
-            return;
-        }
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeStorehouseConstant.DELETE_STOREHOUSE;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-}

+ 0 - 64
service-api/src/main/java/com/java110/api/listener/resourceStore/SaveStorehouseListener.java

@@ -1,64 +0,0 @@
-package com.java110.api.listener.resourceStore;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.storehouse.IStorehouseBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.dto.storehouse.StorehouseDto;
-import com.java110.intf.store.IStorehouseInnerServiceSMO;
-import com.java110.utils.constant.ServiceCodeStorehouseConstant;
-import com.java110.utils.util.Assert;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-/**
- * 保存商户侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("saveStorehouseListener")
-public class SaveStorehouseListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IStorehouseBMO storehouseBMOImpl;
-
-    @Autowired
-    private IStorehouseInnerServiceSMO storehouseInnerServiceSMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
-        Assert.hasKeyAndValue(reqJson, "shName", "请求报文中未包含shName");
-        Assert.hasKeyAndValue(reqJson, "shType", "请求报文中未包含shType");
-        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
-
-        StorehouseDto storehouseDto = new StorehouseDto();
-        storehouseDto.setShName(reqJson.getString("shName"));
-        storehouseDto.setStoreId(reqJson.getString("storeId"));
-        storehouseDto.setShType(reqJson.getString("shType"));
-        int flag  =  storehouseInnerServiceSMOImpl.queryStorehousesCount(storehouseDto);
-
-        if(flag > 0){
-            throw new IllegalArgumentException("已存在仓库");
-        }
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        storehouseBMOImpl.addStorehouse(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeStorehouseConstant.ADD_STOREHOUSE;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-}

+ 0 - 49
service-api/src/main/java/com/java110/api/listener/resourceStore/UpdateStorehouseListener.java

@@ -1,49 +0,0 @@
-package com.java110.api.listener.resourceStore;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.storehouse.IStorehouseBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeStorehouseConstant;
-import com.java110.utils.util.Assert;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-/**
- * 保存仓库侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("updateStorehouseListener")
-public class UpdateStorehouseListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IStorehouseBMO storehouseBMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-
-        Assert.hasKeyAndValue(reqJson, "shId", "shId不能为空");
-        Assert.hasKeyAndValue(reqJson, "shName", "请求报文中未包含shName");
-        Assert.hasKeyAndValue(reqJson, "shType", "请求报文中未包含shType");
-        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        storehouseBMOImpl.updateStorehouse(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeStorehouseConstant.UPDATE_STOREHOUSE;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-}

+ 1 - 1
service-store/src/main/java/com/java110/store/cmd/resourceStore/AuditAllocationStoreOrderCmd.java

@@ -169,7 +169,7 @@ public class AuditAllocationStoreOrderCmd extends Cmd {
                         resourceStorePo.setMiniUnitCode(originalResourceStoreDtos.get(0).getMiniUnitCode());
                         resourceStorePo.setMiniUnitStock(originalResourceStoreDtos.get(0).getMiniUnitStock());
                     }
-                    resourceStoreV1InnerServiceSMOImpl.updateResourceStore(resourceStorePo);
+                    flag = resourceStoreV1InnerServiceSMOImpl.updateResourceStore(resourceStorePo);
                     if (flag < 1) {
                         throw new CmdException("修改失败");
                     }

+ 144 - 0
service-store/src/main/java/com/java110/store/cmd/resourceStore/DeleteAllocationStorehouseCmd.java

@@ -0,0 +1,144 @@
+package com.java110.store.cmd.resourceStore;
+
+import com.alibaba.fastjson.JSONObject;
+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.allocationStorehouse.AllocationStorehouseDto;
+import com.java110.dto.allocationStorehouseApply.AllocationStorehouseApplyDto;
+import com.java110.dto.purchaseApply.PurchaseApplyDto;
+import com.java110.intf.community.IResourceStoreServiceSMO;
+import com.java110.intf.store.*;
+import com.java110.po.allocationStorehouse.AllocationStorehousePo;
+import com.java110.po.allocationStorehouseApply.AllocationStorehouseApplyPo;
+import com.java110.po.purchase.ResourceStorePo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.StringUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.util.List;
+
+@Java110Cmd(serviceCode = "resourceStore.deleteAllocationStorehouse")
+public class DeleteAllocationStorehouseCmd extends Cmd {
+
+    @Autowired
+    private IAllocationStorehouseApplyInnerServiceSMO allocationStorehouseApplyInnerServiceSMOImpl;
+
+    @Autowired
+    private IAllocationStorehouseInnerServiceSMO allocationStorehouseInnerServiceSMOImpl;
+
+    @Autowired
+    private IAllocationStorehouseV1InnerServiceSMO allocationStorehouseV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IResourceStoreServiceSMO resourceStoreServiceSMOImpl;
+
+    @Autowired
+    private IResourceStoreV1InnerServiceSMO resourceStoreV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IPurchaseApplyInnerServiceSMO purchaseApplyInnerServiceSMOImpl;
+
+    @Autowired
+    private IAllocationStorehouseApplyV1InnerServiceSMO allocationStorehouseApplyV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+        Assert.hasKeyAndValue(reqJson, "applyId", "调拨编号不能为空");
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+        //获取申请id
+        String applyId = reqJson.getString("applyId");
+        AllocationStorehouseApplyDto allocationStorehouseApplyDto = new AllocationStorehouseApplyDto();
+        allocationStorehouseApplyDto.setApplyId(applyId);
+        //查询调拨申请信息
+        List<AllocationStorehouseApplyDto> allocationStorehouseApplyDtos = allocationStorehouseApplyInnerServiceSMOImpl.queryAllocationStorehouseApplys(allocationStorehouseApplyDto);
+        Assert.listOnlyOne(allocationStorehouseApplyDtos, "查询调拨申请表错误!");
+        //获取状态
+        String state = allocationStorehouseApplyDtos.get(0).getState();
+        if (!StringUtil.isEmpty(state) && state.equals("1200")) { //1200表示调拨申请状态
+            deleteAllocationStorehouse(reqJson);
+        } else {
+            ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_BUSINESS_VERIFICATION, "您的调拨订单已经状态已改变,无法进行取消操作!!");
+            context.setResponseEntity(responseEntity);
+            return;
+        }
+    }
+
+    public void deleteAllocationStorehouse(JSONObject paramInJson) {
+
+        AllocationStorehouseDto allocationStorehouseDto = new AllocationStorehouseDto();
+        allocationStorehouseDto.setApplyId(paramInJson.getString("applyId"));
+        allocationStorehouseDto.setStoreId(paramInJson.getString("storeId"));
+
+        List<AllocationStorehouseDto> allocationStorehouseDtos = allocationStorehouseInnerServiceSMOImpl.queryAllocationStorehouses(allocationStorehouseDto);
+        int flag = 0;
+        for (AllocationStorehouseDto tmpAllocationStorehouseDto : allocationStorehouseDtos) {
+            AllocationStorehousePo allocationStorehousePo = BeanConvertUtil.covertBean(tmpAllocationStorehouseDto, AllocationStorehousePo.class);
+            flag = allocationStorehouseV1InnerServiceSMOImpl.deleteAllocationStorehouse(allocationStorehousePo);
+
+            if (flag < 1) {
+                throw new CmdException("删除失败");
+            }
+            ResourceStorePo resourceStorePo = new ResourceStorePo();
+            resourceStorePo.setResId(allocationStorehousePo.getResId());
+            //查询资源物品表
+            List<ResourceStorePo> resourceStores = resourceStoreServiceSMOImpl.getResourceStores(resourceStorePo);
+            Assert.listOnlyOne(resourceStores, "资源物品信息错误");
+            //获取库存数量
+            BigDecimal resourceStoreStock = new BigDecimal(resourceStores.get(0).getStock());
+            //获取调拨的数量
+            BigDecimal storehouseStock = new BigDecimal(allocationStorehousePo.getStock());
+            //库存数量
+            BigDecimal stock = resourceStoreStock.add(storehouseStock);
+            resourceStorePo.setStock(String.valueOf(stock));
+            //计算最小计量总数
+            if (StringUtil.isEmpty(resourceStores.get(0).getMiniStock())) {
+                throw new IllegalArgumentException("最小计量总数不能为空!");
+            }
+            BigDecimal miniStock = new BigDecimal(resourceStores.get(0).getMiniStock()); //获取物品表的最小计量总数
+            if (StringUtil.isEmpty(resourceStores.get(0).getMiniUnitStock())) {
+                throw new IllegalArgumentException("最小计量单位数量不能为空!");
+            }
+            BigDecimal miniUnitStock = new BigDecimal(resourceStores.get(0).getMiniUnitStock()); //获取最小计量单位数量
+            BigDecimal stock2 = new BigDecimal(allocationStorehousePo.getStock()); //获取最小计量单位数量
+            BigDecimal nowMiniStock = stock2.multiply(miniUnitStock); //计算当前的最小计量总数
+            BigDecimal newMiniStock = miniStock.add(nowMiniStock);
+            resourceStorePo.setMiniStock(String.valueOf(newMiniStock));
+            flag = resourceStoreV1InnerServiceSMOImpl.updateResourceStore(resourceStorePo);
+            if (flag < 1) {
+                throw new CmdException("修改失败");
+            }
+            //取消流程审批
+            //查询任务
+            PurchaseApplyDto purchaseDto = new PurchaseApplyDto();
+            purchaseDto.setBusinessKey(tmpAllocationStorehouseDto.getApplyId());
+            List<PurchaseApplyDto> purchaseApplyDtoList = purchaseApplyInnerServiceSMOImpl.getActRuTaskId(purchaseDto);
+            if (purchaseApplyDtoList != null && purchaseApplyDtoList.size() > 0) {
+                PurchaseApplyDto purchaseDto1 = new PurchaseApplyDto();
+                purchaseDto1.setActRuTaskId(purchaseApplyDtoList.get(0).getActRuTaskId());
+                purchaseDto1.setAssigneeUser("999999");
+                purchaseApplyInnerServiceSMOImpl.updateActRuTaskById(purchaseDto1);
+            }
+        }
+
+        AllocationStorehouseApplyPo allocationStorehouseApplyPo = new AllocationStorehouseApplyPo();
+        allocationStorehouseApplyPo.setApplyId(allocationStorehouseDto.getApplyId());
+        allocationStorehouseApplyPo.setStoreId(allocationStorehouseDto.getStoreId());
+        flag = allocationStorehouseApplyV1InnerServiceSMOImpl.updateAllocationStorehouseApply(allocationStorehouseApplyPo);
+        if (flag < 1) {
+            throw new CmdException("修改失败");
+        }
+
+    }
+}

+ 85 - 0
service-store/src/main/java/com/java110/store/cmd/resourceStore/DeleteStorehouseCmd.java

@@ -0,0 +1,85 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.store.cmd.resourceStore;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.community.IResourceStoreServiceSMO;
+import com.java110.intf.store.IStorehouseV1InnerServiceSMO;
+import com.java110.po.purchase.ResourceStorePo;
+import com.java110.po.storehouse.StorehousePo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 类表述:删除
+ * 服务编码:storehouse.deleteStorehouse
+ * 请求路劲:/app/storehouse.DeleteStorehouse
+ * add by 吴学文 at 2022-08-08 15:47:06 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "resourceStore.deleteStorehouse")
+public class DeleteStorehouseCmd extends Cmd {
+  private static Logger logger = LoggerFactory.getLogger(DeleteStorehouseCmd.class);
+
+    @Autowired
+    private IStorehouseV1InnerServiceSMO storehouseV1InnerServiceSMOImpl;
+
+
+    @Autowired
+    private IResourceStoreServiceSMO resourceStoreServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "shId", "shId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+        //获取仓库id
+        String shId = reqJson.getString("shId");
+        ResourceStorePo resourceStorePo = new ResourceStorePo();
+        resourceStorePo.setShId(shId);
+        int page = resourceStoreServiceSMOImpl.getResourceStoresCount(resourceStorePo);
+        if (page < 1) {
+            StorehousePo storehousePo = BeanConvertUtil.covertBean(reqJson, StorehousePo.class);
+            int flag = storehouseV1InnerServiceSMOImpl.deleteStorehouse(storehousePo);
+            if (flag < 1) {
+                throw new CmdException("删除数据失败");
+            }
+        } else {
+            ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_BUSINESS_VERIFICATION, "该仓库包含物品,不能直接删除!");
+            context.setResponseEntity(responseEntity);
+            return;
+        }
+        context.setResponseEntity(ResultVo.success());
+    }
+}

+ 97 - 0
service-store/src/main/java/com/java110/store/cmd/resourceStore/SaveStorehouseCmd.java

@@ -0,0 +1,97 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.store.cmd.resourceStore;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.dto.storehouse.StorehouseDto;
+import com.java110.intf.store.IStorehouseInnerServiceSMO;
+import com.java110.intf.store.IStorehouseV1InnerServiceSMO;
+import com.java110.po.storehouse.StorehousePo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * 类表述:保存
+ * 服务编码:storehouse.saveStorehouse
+ * 请求路劲:/app/storehouse.SaveStorehouse
+ * add by 吴学文 at 2022-08-08 15:47:06 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "resourceStore.saveStorehouse")
+public class SaveStorehouseCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveStorehouseCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private IStorehouseV1InnerServiceSMO storehouseV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IStorehouseInnerServiceSMO storehouseInnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "shName", "请求报文中未包含shName");
+        Assert.hasKeyAndValue(reqJson, "shType", "请求报文中未包含shType");
+        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
+
+        StorehouseDto storehouseDto = new StorehouseDto();
+        storehouseDto.setShName(reqJson.getString("shName"));
+        storehouseDto.setStoreId(reqJson.getString("storeId"));
+        storehouseDto.setShType(reqJson.getString("shType"));
+        int flag  =  storehouseInnerServiceSMOImpl.queryStorehousesCount(storehouseDto);
+
+        if(flag > 0){
+            throw new IllegalArgumentException("已存在仓库");
+        }
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        StorehousePo storehousePo = BeanConvertUtil.covertBean(reqJson, StorehousePo.class);
+        storehousePo.setShId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+
+        if (StorehouseDto.SH_TYPE_GROUP.equals(storehousePo.getShType())) {
+            storehousePo.setShObjId(storehousePo.getStoreId());
+        } else {
+            storehousePo.setShObjId(reqJson.getString("communityId"));
+        }
+        int flag = storehouseV1InnerServiceSMOImpl.saveStorehouse(storehousePo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 76 - 0
service-store/src/main/java/com/java110/store/cmd/resourceStore/UpdateStorehouseCmd.java

@@ -0,0 +1,76 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.store.cmd.resourceStore;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.store.IStorehouseV1InnerServiceSMO;
+import com.java110.po.storehouse.StorehousePo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 类表述:更新
+ * 服务编码:storehouse.updateStorehouse
+ * 请求路劲:/app/storehouse.UpdateStorehouse
+ * add by 吴学文 at 2022-08-08 15:47:06 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "resourceStore.updateStorehouse")
+public class UpdateStorehouseCmd extends Cmd {
+
+  private static Logger logger = LoggerFactory.getLogger(UpdateStorehouseCmd.class);
+
+
+    @Autowired
+    private IStorehouseV1InnerServiceSMO storehouseV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "shId", "shId不能为空");
+        Assert.hasKeyAndValue(reqJson, "shName", "请求报文中未包含shName");
+        Assert.hasKeyAndValue(reqJson, "shType", "请求报文中未包含shType");
+        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+       StorehousePo storehousePo = BeanConvertUtil.covertBean(reqJson, StorehousePo.class);
+        int flag = storehouseV1InnerServiceSMOImpl.updateStorehouse(storehousePo);
+
+        if (flag < 1) {
+            throw new CmdException("更新数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-store/src/main/java/com/java110/store/dao/IStorehouseV1ServiceDao.java

@@ -0,0 +1,77 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.store.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2022-08-08 15:47:06 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+public interface IStorehouseV1ServiceDao {
+
+
+    /**
+     * 保存 使用记录信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveStorehouseInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询使用记录信息(instance过程)
+     * 根据bId 查询使用记录信息
+     * @param info bId 信息
+     * @return 使用记录信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getStorehouseInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改使用记录信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateStorehouseInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询使用记录总数
+     *
+     * @param info 使用记录信息
+     * @return 使用记录数量
+     */
+    int queryStorehousesCount(Map info);
+
+}

+ 112 - 0
service-store/src/main/java/com/java110/store/dao/impl/StorehouseV1ServiceDaoImpl.java

@@ -0,0 +1,112 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.store.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.store.dao.IStorehouseV1ServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2022-08-08 15:47:06 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Service("storehouseV1ServiceDaoImpl")
+public class StorehouseV1ServiceDaoImpl extends BaseServiceDao implements IStorehouseV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(StorehouseV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存使用记录信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveStorehouseInfo(Map info) throws DAOException {
+        logger.debug("保存 saveStorehouseInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("storehouseV1ServiceDaoImpl.saveStorehouseInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询使用记录信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getStorehouseInfo(Map info) throws DAOException {
+        logger.debug("查询 getStorehouseInfo 入参 info : {}",info);
+
+        List<Map> businessStorehouseInfos = sqlSessionTemplate.selectList("storehouseV1ServiceDaoImpl.getStorehouseInfo",info);
+
+        return businessStorehouseInfos;
+    }
+
+
+    /**
+     * 修改使用记录信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateStorehouseInfo(Map info) throws DAOException {
+        logger.debug("修改 updateStorehouseInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("storehouseV1ServiceDaoImpl.updateStorehouseInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询使用记录数量
+     * @param info 使用记录信息
+     * @return 使用记录数量
+     */
+    @Override
+    public int queryStorehousesCount(Map info) {
+        logger.debug("查询 queryStorehousesCount 入参 info : {}",info);
+
+        List<Map> businessStorehouseInfos = sqlSessionTemplate.selectList("storehouseV1ServiceDaoImpl.queryStorehousesCount", info);
+        if (businessStorehouseInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessStorehouseInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-store/src/main/java/com/java110/store/smo/impl/StorehouseV1InnerServiceSMOImpl.java

@@ -0,0 +1,89 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.store.smo.impl;
+
+
+import com.java110.store.dao.IStorehouseV1ServiceDao;
+import com.java110.intf.store.IStorehouseV1InnerServiceSMO;
+import com.java110.dto.storehouse.StorehouseDto;
+import com.java110.po.storehouse.StorehousePo;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2022-08-08 15:47:06 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@RestController
+public class StorehouseV1InnerServiceSMOImpl extends BaseServiceSMO implements IStorehouseV1InnerServiceSMO {
+
+    @Autowired
+    private IStorehouseV1ServiceDao storehouseV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveStorehouse(@RequestBody  StorehousePo storehousePo) {
+        int saveFlag = storehouseV1ServiceDaoImpl.saveStorehouseInfo(BeanConvertUtil.beanCovertMap(storehousePo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateStorehouse(@RequestBody  StorehousePo storehousePo) {
+        int saveFlag = storehouseV1ServiceDaoImpl.updateStorehouseInfo(BeanConvertUtil.beanCovertMap(storehousePo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteStorehouse(@RequestBody  StorehousePo storehousePo) {
+       storehousePo.setStatusCd("1");
+       int saveFlag = storehouseV1ServiceDaoImpl.updateStorehouseInfo(BeanConvertUtil.beanCovertMap(storehousePo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<StorehouseDto> queryStorehouses(@RequestBody  StorehouseDto storehouseDto) {
+
+        //校验是否传了 分页信息
+
+        int page = storehouseDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            storehouseDto.setPage((page - 1) * storehouseDto.getRow());
+        }
+
+        List<StorehouseDto> storehouses = BeanConvertUtil.covertBeanList(storehouseV1ServiceDaoImpl.getStorehouseInfo(BeanConvertUtil.beanCovertMap(storehouseDto)), StorehouseDto.class);
+
+        return storehouses;
+    }
+
+
+    @Override
+    public int queryStorehousesCount(@RequestBody StorehouseDto storehouseDto) {
+        return storehouseV1ServiceDaoImpl.queryStorehousesCount(BeanConvertUtil.beanCovertMap(storehouseDto));    }
+
+}