wuxw лет назад: 3
Родитель
Сommit
c42ca2bd66
17 измененных файлов с 1021 добавлено и 423 удалено
  1. 7 0
      java110-bean/src/main/java/com/java110/po/resourceSupplier/ResourceSupplierPo.java
  2. 160 0
      java110-db/src/main/resources/mapper/store/ResourceSupplierV1ServiceDaoImplMapper.xml
  3. 68 0
      java110-interface/src/main/java/com/java110/intf/store/IResourceSupplierV1InnerServiceSMO.java
  4. 0 49
      service-api/src/main/java/com/java110/api/listener/resourceSupplier/DeleteResourceSupplierListener.java
  5. 0 82
      service-api/src/main/java/com/java110/api/listener/resourceSupplier/ListResourceSuppliersListener.java
  6. 0 61
      service-api/src/main/java/com/java110/api/listener/resourceSupplier/SaveResourceSupplierListener.java
  7. 0 59
      service-api/src/main/java/com/java110/api/listener/resourceSupplier/UpdateResourceSupplierListener.java
  8. 0 106
      service-api/src/main/java/com/java110/api/listener/room/SellRoomListener.java
  9. 60 66
      service-api/src/main/java/com/java110/api/listener/room/SaveShopsListener.java
  10. 108 0
      service-community/src/main/java/com/java110/community/cmd/room/SellRoomCmd.java
  11. 71 0
      service-store/src/main/java/com/java110/store/cmd/resourceSupplier/DeleteResourceSupplierCmd.java
  12. 83 0
      service-store/src/main/java/com/java110/store/cmd/resourceSupplier/ListResourceSuppliersCmd.java
  13. 95 0
      service-store/src/main/java/com/java110/store/cmd/resourceSupplier/SaveResourceSupplierCmd.java
  14. 90 0
      service-store/src/main/java/com/java110/store/cmd/resourceSupplier/UpdateResourceSupplierCmd.java
  15. 77 0
      service-store/src/main/java/com/java110/store/dao/IResourceSupplierV1ServiceDao.java
  16. 113 0
      service-store/src/main/java/com/java110/store/dao/impl/ResourceSupplierV1ServiceDaoImpl.java
  17. 89 0
      service-store/src/main/java/com/java110/store/smo/impl/ResourceSupplierV1InnerServiceSMOImpl.java

+ 7 - 0
java110-bean/src/main/java/com/java110/po/resourceSupplier/ResourceSupplierPo.java

@@ -16,6 +16,7 @@ public class ResourceSupplierPo implements Serializable {
     private String accountBank;
     private String tel;
     private String bankAccountNumber;
+    private String statusCd = "0";
 
     public String getSupplierName() {
         return supplierName;
@@ -105,5 +106,11 @@ public class ResourceSupplierPo implements Serializable {
         this.bankAccountNumber = bankAccountNumber;
     }
 
+    public String getStatusCd() {
+        return statusCd;
+    }
 
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
 }

+ 160 - 0
java110-db/src/main/resources/mapper/store/ResourceSupplierV1ServiceDaoImplMapper.xml

@@ -0,0 +1,160 @@
+<?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="resourceSupplierV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存供应商信息 add by wuxw 2018-07-03 -->
+    <insert id="saveResourceSupplierInfo" parameterType="Map">
+        insert into resource_supplier(
+supplier_name,account_bank,create_user_id,address,contact_name,rs_id,tel,bank_account_number,create_user_name,remark,store_id
+) values (
+#{supplierName},#{accountBank},#{createUserId},#{address},#{contactName},#{rsId},#{tel},#{bankAccountNumber},#{createUserName},#{remark},#{storeId}
+)
+    </insert>
+
+
+
+    <!-- 查询供应商信息 add by wuxw 2018-07-03 -->
+    <select id="getResourceSupplierInfo" parameterType="Map" resultType="Map">
+        select  t.supplier_name,t.supplier_name supplierName,t.account_bank,t.account_bank accountBank,t.create_user_id,t.create_user_id createUserId,t.address,t.contact_name,t.contact_name contactName,t.rs_id,t.rs_id rsId,t.tel,t.bank_account_number,t.bank_account_number bankAccountNumber,t.status_cd,t.status_cd statusCd,t.create_user_name,t.create_user_name createUserName,t.remark,t.store_id,t.store_id storeId 
+from resource_supplier t 
+where 1 =1 
+<if test="supplierName !=null and supplierName != ''">
+   and t.supplier_name= #{supplierName}
+</if> 
+<if test="accountBank !=null and accountBank != ''">
+   and t.account_bank= #{accountBank}
+</if> 
+<if test="createUserId !=null and createUserId != ''">
+   and t.create_user_id= #{createUserId}
+</if> 
+<if test="address !=null and address != ''">
+   and t.address= #{address}
+</if> 
+<if test="contactName !=null and contactName != ''">
+   and t.contact_name= #{contactName}
+</if> 
+<if test="rsId !=null and rsId != ''">
+   and t.rs_id= #{rsId}
+</if> 
+<if test="tel !=null and tel != ''">
+   and t.tel= #{tel}
+</if> 
+<if test="bankAccountNumber !=null and bankAccountNumber != ''">
+   and t.bank_account_number= #{bankAccountNumber}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="createUserName !=null and createUserName != ''">
+   and t.create_user_name= #{createUserName}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</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="updateResourceSupplierInfo" parameterType="Map">
+        update  resource_supplier t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="supplierName !=null and supplierName != ''">
+, t.supplier_name= #{supplierName}
+</if> 
+<if test="accountBank !=null and accountBank != ''">
+, t.account_bank= #{accountBank}
+</if> 
+<if test="createUserId !=null and createUserId != ''">
+, t.create_user_id= #{createUserId}
+</if> 
+<if test="address !=null and address != ''">
+, t.address= #{address}
+</if> 
+<if test="contactName !=null and contactName != ''">
+, t.contact_name= #{contactName}
+</if> 
+<if test="tel !=null and tel != ''">
+, t.tel= #{tel}
+</if> 
+<if test="bankAccountNumber !=null and bankAccountNumber != ''">
+, t.bank_account_number= #{bankAccountNumber}
+</if> 
+<if test="createUserName !=null and createUserName != ''">
+, t.create_user_name= #{createUserName}
+</if> 
+<if test="remark !=null and remark != ''">
+, t.remark= #{remark}
+</if> 
+<if test="storeId !=null and storeId != ''">
+, t.store_id= #{storeId}
+</if> 
+ where 1=1 <if test="rsId !=null and rsId != ''">
+and t.rs_id= #{rsId}
+</if> 
+
+    </update>
+
+    <!-- 查询供应商数量 add by wuxw 2018-07-03 -->
+     <select id="queryResourceSuppliersCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from resource_supplier t 
+where 1 =1 
+<if test="supplierName !=null and supplierName != ''">
+   and t.supplier_name= #{supplierName}
+</if> 
+<if test="accountBank !=null and accountBank != ''">
+   and t.account_bank= #{accountBank}
+</if> 
+<if test="createUserId !=null and createUserId != ''">
+   and t.create_user_id= #{createUserId}
+</if> 
+<if test="address !=null and address != ''">
+   and t.address= #{address}
+</if> 
+<if test="contactName !=null and contactName != ''">
+   and t.contact_name= #{contactName}
+</if> 
+<if test="rsId !=null and rsId != ''">
+   and t.rs_id= #{rsId}
+</if> 
+<if test="tel !=null and tel != ''">
+   and t.tel= #{tel}
+</if> 
+<if test="bankAccountNumber !=null and bankAccountNumber != ''">
+   and t.bank_account_number= #{bankAccountNumber}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="createUserName !=null and createUserName != ''">
+   and t.create_user_name= #{createUserName}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/store/IResourceSupplierV1InnerServiceSMO.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.resourceSupplier.ResourceSupplierDto;
+import com.java110.po.resourceSupplier.ResourceSupplierPo;
+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-07 16:56:05 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("/resourceSupplierV1Api")
+public interface IResourceSupplierV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveResourceSupplier", method = RequestMethod.POST)
+    public int saveResourceSupplier(@RequestBody ResourceSupplierPo resourceSupplierPo);
+
+    @RequestMapping(value = "/updateResourceSupplier", method = RequestMethod.POST)
+    public int updateResourceSupplier(@RequestBody ResourceSupplierPo resourceSupplierPo);
+
+    @RequestMapping(value = "/deleteResourceSupplier", method = RequestMethod.POST)
+    public int deleteResourceSupplier(@RequestBody ResourceSupplierPo resourceSupplierPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param resourceSupplierDto 数据对象分享
+     * @return ResourceSupplierDto 对象数据
+     */
+    @RequestMapping(value = "/queryResourceSuppliers", method = RequestMethod.POST)
+    List<ResourceSupplierDto> queryResourceSuppliers(@RequestBody ResourceSupplierDto resourceSupplierDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param resourceSupplierDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryResourceSuppliersCount", method = RequestMethod.POST)
+    int queryResourceSuppliersCount(@RequestBody ResourceSupplierDto resourceSupplierDto);
+}

+ 0 - 49
service-api/src/main/java/com/java110/api/listener/resourceSupplier/DeleteResourceSupplierListener.java

@@ -1,49 +0,0 @@
-package com.java110.api.listener.resourceSupplier;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.resourceSupplier.IResourceSupplierBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeResourceSupplierConstant;
-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("deleteResourceSupplierListener")
-public class DeleteResourceSupplierListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IResourceSupplierBMO resourceSupplierBMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
-        Assert.hasKeyAndValue(reqJson, "rsId", "rsId不能为空");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        resourceSupplierBMOImpl.deleteResourceSupplier(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeResourceSupplierConstant.DELETE_RESOURCESUPPLIER;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-}

+ 0 - 82
service-api/src/main/java/com/java110/api/listener/resourceSupplier/ListResourceSuppliersListener.java

@@ -1,82 +0,0 @@
-package com.java110.api.listener.resourceSupplier;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiListener;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.dto.resourceSupplier.ResourceSupplierDto;
-import com.java110.intf.store.IResourceSupplierInnerServiceSMO;
-import com.java110.utils.constant.ServiceCodeResourceSupplierConstant;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.vo.ResultVo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 查询小区侦听类
- */
-@Java110Listener("listResourceSuppliersListener")
-public class ListResourceSuppliersListener extends AbstractServiceApiListener {
-
-    @Autowired
-    private IResourceSupplierInnerServiceSMO resourceSupplierInnerServiceSMOImpl;
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeResourceSupplierConstant.LIST_RESOURCESUPPLIERS;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.GET;
-    }
-
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-
-    public IResourceSupplierInnerServiceSMO getResourceSupplierInnerServiceSMOImpl() {
-        return resourceSupplierInnerServiceSMOImpl;
-    }
-
-    public void setResourceSupplierInnerServiceSMOImpl(IResourceSupplierInnerServiceSMO resourceSupplierInnerServiceSMOImpl) {
-        this.resourceSupplierInnerServiceSMOImpl = resourceSupplierInnerServiceSMOImpl;
-    }
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        super.validatePageInfo(reqJson);
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        ResourceSupplierDto resourceSupplierDto = BeanConvertUtil.covertBean(reqJson, ResourceSupplierDto.class);
-
-        int count = resourceSupplierInnerServiceSMOImpl.queryResourceSuppliersCount(resourceSupplierDto);
-
-        List<ResourceSupplierDto> resourceSupplierDtos = null;
-
-        if (count > 0) {
-            resourceSupplierDtos = resourceSupplierInnerServiceSMOImpl.queryResourceSuppliers(resourceSupplierDto);
-        } else {
-            resourceSupplierDtos = new ArrayList<>();
-        }
-
-        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, resourceSupplierDtos);
-
-        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
-
-        context.setResponseEntity(responseEntity);
-
-    }
-}

+ 0 - 61
service-api/src/main/java/com/java110/api/listener/resourceSupplier/SaveResourceSupplierListener.java

@@ -1,61 +0,0 @@
-package com.java110.api.listener.resourceSupplier;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.resourceSupplier.IResourceSupplierBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeResourceSupplierConstant;
-import com.java110.utils.util.Assert;
-import com.java110.core.context.DataFlowContext;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-import com.java110.core.annotation.Java110Listener;
-
-/**
- * 保存商户侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("saveResourceSupplierListener")
-public class SaveResourceSupplierListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IResourceSupplierBMO resourceSupplierBMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        Assert.hasKeyAndValue(reqJson, "supplierName", "请求报文中未包含supplierName");
-        Assert.hasKeyAndValue(reqJson, "address", "请求报文中未包含address");
-        Assert.hasKeyAndValue(reqJson, "tel", "请求报文中未包含tel");
-        if (!reqJson.containsKey("storeId")) {
-            String storeId = event.getDataFlowContext().getRequestCurrentHeaders().get("store-id");
-            reqJson.put("storeId", storeId);
-        }
-
-        if (!reqJson.containsKey("userId")) {
-            reqJson.put("userId", "-1");
-        }
-
-        if (!reqJson.containsKey("userName")) {
-            reqJson.put("userName", "未知");
-        }
-
-        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-        resourceSupplierBMOImpl.addResourceSupplier(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeResourceSupplierConstant.ADD_RESOURCESUPPLIER;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-}

+ 0 - 59
service-api/src/main/java/com/java110/api/listener/resourceSupplier/UpdateResourceSupplierListener.java

@@ -1,59 +0,0 @@
-package com.java110.api.listener.resourceSupplier;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.resourceSupplier.IResourceSupplierBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeResourceSupplierConstant;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-/**
- * 保存物品供应商侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("updateResourceSupplierListener")
-public class UpdateResourceSupplierListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IResourceSupplierBMO resourceSupplierBMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        Assert.hasKeyAndValue(reqJson, "rsId", "rsId不能为空");
-        Assert.hasKeyAndValue(reqJson, "supplierName", "请求报文中未包含supplierName");
-        Assert.hasKeyAndValue(reqJson, "address", "请求报文中未包含address");
-        Assert.hasKeyAndValue(reqJson, "tel", "请求报文中未包含tel");
-        if (!reqJson.containsKey("storeId")) {
-            String storeId = event.getDataFlowContext().getRequestCurrentHeaders().get("store-id");
-            reqJson.put("storeId", storeId);
-        }
-        if (!reqJson.containsKey("userId")) {
-            reqJson.put("userId", "-1");
-        }
-
-        if (!reqJson.containsKey("userName")) {
-            reqJson.put("userName", "未知");
-        }
-
-        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-        resourceSupplierBMOImpl.updateResourceSupplier(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeResourceSupplierConstant.UPDATE_RESOURCESUPPLIER;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-}

+ 0 - 106
service-api/src/main/java/com/java110/api/listener/room/SellRoomListener.java

@@ -1,106 +0,0 @@
-package com.java110.api.listener.room;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.room.IRoomBMO;
-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.ICommunityInnerServiceSMO;
-import com.java110.intf.community.IUnitInnerServiceSMO;
-import com.java110.utils.constant.ServiceCodeConstant;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.DateUtil;
-import org.slf4j.Logger;
-import com.java110.core.log.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-/**
- * @ClassName SaveUnitListener
- * @Description TODO 售卖房屋信息
- * @Author wuxw
- * @Date 2019/5/3 11:54
- * @Version 1.0
- * add by wuxw 2019/5/3
- **/
-@Java110Listener("sellRoomListener")
-public class SellRoomListener extends AbstractServiceApiPlusListener {
-    private static Logger logger = LoggerFactory.getLogger(SellRoomListener.class);
-
-    @Autowired
-    private IRoomBMO roomBMOImpl;
-
-    @Autowired
-    private IUnitInnerServiceSMO unitInnerServiceSMOImpl;
-
-    @Autowired
-    private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeConstant.SERVICE_CODE_SELL_ROOM;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        Assert.jsonObjectHaveKey(reqJson, "communityId", "请求报文中未包含communityId节点");
-        Assert.jsonObjectHaveKey(reqJson, "ownerId", "请求报文中未包含ownerId节点");
-        Assert.jsonObjectHaveKey(reqJson, "roomId", "请求报文中未包含roomId节点");
-        Assert.jsonObjectHaveKey(reqJson, "state", "请求报文中未包含state节点");
-        Assert.jsonObjectHaveKey(reqJson, "storeId", "请求报文中未包含storeId节点");
-
-        Assert.hasLength(reqJson.getString("communityId"), "小区ID不能为空");
-        Assert.hasLength(reqJson.getString("ownerId"), "ownerId不能为空");
-        Assert.hasLength(reqJson.getString("roomId"), "roomId不能为空");
-        Assert.hasLength(reqJson.getString("state"), "state不能为空");
-
-        //super.communityHasOwner(reqJson, communityInnerServiceSMOImpl);
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-        if (!reqJson.containsKey("startTime")) {
-            reqJson.put("startTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
-        }
-        if (!reqJson.containsKey("endTime")) {
-            reqJson.put("endTime", "2037-01-01 00:00:00");
-        }
-        //添加单元信息
-        roomBMOImpl.sellRoom(reqJson, context);
-
-        //更新房屋信息为售出
-        roomBMOImpl.updateShellRoom(reqJson, context);
-
-        //添加物业费用信息
-        //roomBMOImpl.addPropertyFee(reqJson, context);
-    }
-
-
-    public ICommunityInnerServiceSMO getCommunityInnerServiceSMOImpl() {
-        return communityInnerServiceSMOImpl;
-    }
-
-    public void setCommunityInnerServiceSMOImpl(ICommunityInnerServiceSMO communityInnerServiceSMOImpl) {
-        this.communityInnerServiceSMOImpl = communityInnerServiceSMOImpl;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-    public IUnitInnerServiceSMO getUnitInnerServiceSMOImpl() {
-        return unitInnerServiceSMOImpl;
-    }
-
-    public void setUnitInnerServiceSMOImpl(IUnitInnerServiceSMO unitInnerServiceSMOImpl) {
-        this.unitInnerServiceSMOImpl = unitInnerServiceSMOImpl;
-    }
-}

+ 60 - 66
service-api/src/main/java/com/java110/api/listener/room/SaveShopsListener.java

@@ -1,74 +1,44 @@
-/*
- * 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.api.listener.room;
+package com.java110.community.cmd.room;
 
 import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.room.IRoomBMO;
-import com.java110.api.bmo.unit.IUnitBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
+import com.java110.core.annotation.Java110Cmd;
 import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
+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.RoomDto;
 import com.java110.dto.UnitDto;
+import com.java110.intf.community.IRoomV1InnerServiceSMO;
 import com.java110.intf.community.IUnitInnerServiceSMO;
-import com.java110.utils.constant.ServiceCodeConstant;
+import com.java110.intf.community.IUnitV1InnerServiceSMO;
+import com.java110.po.room.RoomPo;
+import com.java110.po.unit.UnitPo;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.CommonConstant;
+import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
-import org.slf4j.Logger;
-import com.java110.core.log.LoggerFactory;
+import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
 
+import java.text.ParseException;
 import java.util.List;
 
-/**
- * @ClassName SaveShopsListener
- * @Description TODO 保存商铺信息
- * @Author wuxw
- * @Date 2019/5/3 11:54
- * @Version 1.0
- * add by wuxw 2019/5/3
- **/
-@Java110Listener("saveShopsListener")
-public class SaveShopsListener extends AbstractServiceApiPlusListener {
-    private static Logger logger = LoggerFactory.getLogger(SaveShopsListener.class);
-
-
-    @Autowired
-    private IRoomBMO roomBMOImpl;
+@Java110Cmd(serviceCode = "room.saveShops")
+public class SaveShopsCmd extends Cmd {
 
-    @Autowired
-    private IUnitBMO unitBMOImpl;
     @Autowired
     private IUnitInnerServiceSMO unitInnerServiceSMOImpl;
 
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeConstant.SERVICE_CODE_SAVE_SHOPS;
-    }
+    @Autowired
+    private IUnitV1InnerServiceSMO unitV1InnerServiceSMOImpl;
 
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
+    @Autowired
+    private IRoomV1InnerServiceSMO roomV1InnerServiceSMOImpl;
 
 
     @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         Assert.jsonObjectHaveKey(reqJson, "communityId", "请求报文中未包含communityId节点");
         Assert.jsonObjectHaveKey(reqJson, "floorId", "请求报文中未包含楼栋信息");
         Assert.jsonObjectHaveKey(reqJson, "roomNum", "请求报文中未包含roomNum节点");
@@ -90,12 +60,11 @@ public class SaveShopsListener extends AbstractServiceApiPlusListener {
         if (!reqJson.containsKey("roomArea")) {
             reqJson.put("roomRent", reqJson.getString("builtUpArea"));
         }
-
     }
 
     @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-        //判断 楼栋下是否存在 0单元 如果存在 不插入 不存在插入
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+
         UnitDto unitDto = new UnitDto();
         unitDto.setCommunityId(reqJson.getString("communityId"));
         unitDto.setFloorId(reqJson.getString("floorId"));
@@ -113,7 +82,7 @@ public class SaveShopsListener extends AbstractServiceApiPlusListener {
             unit.put("lift", "0");
             unit.put("remark", "系统创建");
             unit.put("unitArea", "1.00");
-            unitBMOImpl.addUnit(unit, context);
+            addUnit(unit);
         } else {
             unitId = units.get(0).getUnitId();
         }
@@ -122,20 +91,45 @@ public class SaveShopsListener extends AbstractServiceApiPlusListener {
         reqJson.put("apartment", "10101");
         reqJson.put("state", RoomDto.STATE_SHOP_FREE);
         reqJson.put("roomType", RoomDto.ROOM_TYPE_SHOPS);
-        roomBMOImpl.addRoom(reqJson, context);
+        addRoom(reqJson);
     }
 
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-    public IUnitInnerServiceSMO getUnitInnerServiceSMOImpl() {
-        return unitInnerServiceSMOImpl;
+    public void addUnit(JSONObject paramInJson) {
+
+        JSONObject businessUnit = new JSONObject();
+        businessUnit.put("floorId", paramInJson.getString("floorId"));
+        businessUnit.put("layerCount", paramInJson.getString("layerCount"));
+        businessUnit.put("unitId", !paramInJson.containsKey("unitId") ? GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_unitId)
+                : paramInJson.getString("unitId"));
+        businessUnit.put("unitNum", paramInJson.getString("unitNum"));
+        businessUnit.put("lift", paramInJson.getString("lift"));
+        businessUnit.put("remark", paramInJson.getString("remark"));
+        businessUnit.put("unitArea", paramInJson.getString("unitArea"));
+        businessUnit.put("userId", "-1");
+        UnitPo unitPo = BeanConvertUtil.covertBean(businessUnit, UnitPo.class);
+
+        int flag = unitV1InnerServiceSMOImpl.saveUnit(unitPo);
+        if (flag < 1) {
+            throw new CmdException("保存单元失败");
+        }
     }
 
-    public void setUnitInnerServiceSMOImpl(IUnitInnerServiceSMO unitInnerServiceSMOImpl) {
-        this.unitInnerServiceSMOImpl = unitInnerServiceSMOImpl;
+    /**
+     * 添加小区楼信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @return 订单服务能够接受的报文
+     */
+    public void addRoom(JSONObject paramInJson) {
+
+        JSONObject businessUnit = new JSONObject();
+        businessUnit.putAll(paramInJson);
+        businessUnit.put("roomId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_roomId));
+        businessUnit.put("userId", "-1");
+        RoomPo roomPo = BeanConvertUtil.covertBean(businessUnit, RoomPo.class);
+        int flag = roomV1InnerServiceSMOImpl.saveRoom(roomPo);
+        if (flag < 1) {
+            throw new CmdException("保存单元失败");
+        }
     }
 }

+ 108 - 0
service-community/src/main/java/com/java110/community/cmd/room/SellRoomCmd.java

@@ -0,0 +1,108 @@
+package com.java110.community.cmd.room;
+
+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.core.factory.GenerateCodeFactory;
+import com.java110.intf.community.ICommunityInnerServiceSMO;
+import com.java110.intf.community.IRoomV1InnerServiceSMO;
+import com.java110.intf.community.IUnitInnerServiceSMO;
+import com.java110.intf.user.IOwnerRoomRelV1InnerServiceSMO;
+import com.java110.po.owner.OwnerRoomRelPo;
+import com.java110.po.room.RoomPo;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.DateUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.text.ParseException;
+
+@Java110Cmd(serviceCode = "room.sellRoom")
+public class SellRoomCmd extends Cmd {
+
+    @Autowired
+    private IUnitInnerServiceSMO unitInnerServiceSMOImpl;
+
+    @Autowired
+    private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
+
+    @Autowired
+    private IOwnerRoomRelV1InnerServiceSMO ownerRoomRelV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IRoomV1InnerServiceSMO roomV1InnerServiceSMOImpl;
+
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+        Assert.jsonObjectHaveKey(reqJson, "communityId", "请求报文中未包含communityId节点");
+        Assert.jsonObjectHaveKey(reqJson, "ownerId", "请求报文中未包含ownerId节点");
+        Assert.jsonObjectHaveKey(reqJson, "roomId", "请求报文中未包含roomId节点");
+        Assert.jsonObjectHaveKey(reqJson, "state", "请求报文中未包含state节点");
+        Assert.jsonObjectHaveKey(reqJson, "storeId", "请求报文中未包含storeId节点");
+
+        Assert.hasLength(reqJson.getString("communityId"), "小区ID不能为空");
+        Assert.hasLength(reqJson.getString("ownerId"), "ownerId不能为空");
+        Assert.hasLength(reqJson.getString("roomId"), "roomId不能为空");
+        Assert.hasLength(reqJson.getString("state"), "state不能为空");
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+
+        if (!reqJson.containsKey("startTime")) {
+            reqJson.put("startTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
+        }
+        if (!reqJson.containsKey("endTime")) {
+            reqJson.put("endTime", "2037-01-01 00:00:00");
+        }
+        //添加单元信息
+        sellRoom(reqJson);
+
+        //更新房屋信息为售出
+        updateShellRoom(reqJson);
+    }
+
+    /**
+     * 售卖房屋信息
+     *
+     * @param paramInJson 接口调用放传入入参
+     * @return 订单服务能够接受的报文
+     */
+    public void sellRoom(JSONObject paramInJson) {
+
+        JSONObject businessUnit = new JSONObject();
+        businessUnit.putAll(paramInJson);
+        businessUnit.put("relId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_relId));
+        businessUnit.put("userId", "-1");
+        OwnerRoomRelPo ownerRoomRelPo = BeanConvertUtil.covertBean(businessUnit, OwnerRoomRelPo.class);
+        int flag = ownerRoomRelV1InnerServiceSMOImpl.saveOwnerRoomRel(ownerRoomRelPo);
+
+        if (flag < 1) {
+            throw new CmdException("添加业主房屋关系");
+        }
+
+    }
+
+    /**
+     * 修改小区楼信息
+     *
+     * @param paramInJson 接口调用放传入入参
+     * @return 订单服务能够接受的报文
+     */
+    public void updateShellRoom(JSONObject paramInJson) {
+        JSONObject businessUnit = new JSONObject();
+        businessUnit.putAll(paramInJson);
+        businessUnit.put("userId", "-1");
+        RoomPo roomPo = BeanConvertUtil.covertBean(businessUnit, RoomPo.class);
+
+        int flag = roomV1InnerServiceSMOImpl.updateRoom(roomPo);
+        if (flag < 1) {
+            throw new CmdException("添加业主房屋关系");
+        }
+    }
+}

+ 71 - 0
service-store/src/main/java/com/java110/store/cmd/resourceSupplier/DeleteResourceSupplierCmd.java

@@ -0,0 +1,71 @@
+/*
+ * 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.resourceSupplier;
+
+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.intf.store.IResourceSupplierV1InnerServiceSMO;
+import com.java110.po.resourceSupplier.ResourceSupplierPo;
+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;
+/**
+ * 类表述:删除
+ * 服务编码:resourceSupplier.deleteResourceSupplier
+ * 请求路劲:/app/resourceSupplier.DeleteResourceSupplier
+ * add by 吴学文 at 2022-08-07 16:56:05 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 = "resourceSupplier.deleteResourceSupplier")
+public class DeleteResourceSupplierCmd extends Cmd {
+  private static Logger logger = LoggerFactory.getLogger(DeleteResourceSupplierCmd.class);
+
+    @Autowired
+    private IResourceSupplierV1InnerServiceSMO resourceSupplierV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "rsId", "rsId不能为空");
+Assert.hasKeyAndValue(reqJson, "storeId", "storeId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+       ResourceSupplierPo resourceSupplierPo = BeanConvertUtil.covertBean(reqJson, ResourceSupplierPo.class);
+        int flag = resourceSupplierV1InnerServiceSMOImpl.deleteResourceSupplier(resourceSupplierPo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 83 - 0
service-store/src/main/java/com/java110/store/cmd/resourceSupplier/ListResourceSuppliersCmd.java

@@ -0,0 +1,83 @@
+/*
+ * 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.resourceSupplier;
+
+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.intf.store.IResourceSupplierInnerServiceSMO;
+import com.java110.intf.store.IResourceSupplierV1InnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.java110.dto.resourceSupplier.ResourceSupplierDto;
+import java.util.List;
+import java.util.ArrayList;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.HttpStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 类表述:查询
+ * 服务编码:resourceSupplier.listResourceSupplier
+ * 请求路劲:/app/resourceSupplier.ListResourceSupplier
+ * add by 吴学文 at 2022-08-07 16:56:05 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 = "resourceSupplier.listResourceSuppliers")
+public class ListResourceSuppliersCmd extends Cmd {
+
+  private static Logger logger = LoggerFactory.getLogger(ListResourceSuppliersCmd.class);
+    @Autowired
+    private IResourceSupplierV1InnerServiceSMO resourceSupplierV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IResourceSupplierInnerServiceSMO resourceSupplierInnerServiceSMOImpl;
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+        ResourceSupplierDto resourceSupplierDto = BeanConvertUtil.covertBean(reqJson, ResourceSupplierDto.class);
+
+        int count = resourceSupplierInnerServiceSMOImpl.queryResourceSuppliersCount(resourceSupplierDto);
+
+        List<ResourceSupplierDto> resourceSupplierDtos = null;
+
+        if (count > 0) {
+            resourceSupplierDtos = resourceSupplierInnerServiceSMOImpl.queryResourceSuppliers(resourceSupplierDto);
+        } else {
+            resourceSupplierDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, resourceSupplierDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+    }
+}

+ 95 - 0
service-store/src/main/java/com/java110/store/cmd/resourceSupplier/SaveResourceSupplierCmd.java

@@ -0,0 +1,95 @@
+/*
+ * 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.resourceSupplier;
+
+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.intf.store.IResourceSupplierV1InnerServiceSMO;
+import com.java110.po.resourceSupplier.ResourceSupplierPo;
+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;
+
+/**
+ * 类表述:保存
+ * 服务编码:resourceSupplier.saveResourceSupplier
+ * 请求路劲:/app/resourceSupplier.SaveResourceSupplier
+ * add by 吴学文 at 2022-08-07 16:56:05 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 = "resourceSupplier.saveResourceSupplier")
+public class SaveResourceSupplierCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveResourceSupplierCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private IResourceSupplierV1InnerServiceSMO resourceSupplierV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "supplierName", "请求报文中未包含supplierName");
+        Assert.hasKeyAndValue(reqJson, "address", "请求报文中未包含address");
+        Assert.hasKeyAndValue(reqJson, "tel", "请求报文中未包含tel");
+        if (!reqJson.containsKey("storeId")) {
+            String storeId =cmdDataFlowContext.getReqHeaders().get("store-id");
+            reqJson.put("storeId", storeId);
+        }
+
+        if (!reqJson.containsKey("userId")) {
+            reqJson.put("userId", "-1");
+        }
+
+        if (!reqJson.containsKey("userName")) {
+            reqJson.put("userName", "未知");
+        }
+
+        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+
+        reqJson.put("createUserId", reqJson.getString("userId"));
+        reqJson.put("createUserName", reqJson.getString("userName"));
+        ResourceSupplierPo resourceSupplierPo = BeanConvertUtil.covertBean(reqJson, ResourceSupplierPo.class);
+
+        resourceSupplierPo.setRsId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+        int flag = resourceSupplierV1InnerServiceSMOImpl.saveResourceSupplier(resourceSupplierPo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 90 - 0
service-store/src/main/java/com/java110/store/cmd/resourceSupplier/UpdateResourceSupplierCmd.java

@@ -0,0 +1,90 @@
+/*
+ * 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.resourceSupplier;
+
+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.intf.store.IResourceSupplierV1InnerServiceSMO;
+import com.java110.po.resourceSupplier.ResourceSupplierPo;
+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;
+
+
+/**
+ * 类表述:更新
+ * 服务编码:resourceSupplier.updateResourceSupplier
+ * 请求路劲:/app/resourceSupplier.UpdateResourceSupplier
+ * add by 吴学文 at 2022-08-07 16:56:05 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 = "resourceSupplier.updateResourceSupplier")
+public class UpdateResourceSupplierCmd extends Cmd {
+
+  private static Logger logger = LoggerFactory.getLogger(UpdateResourceSupplierCmd.class);
+
+
+    @Autowired
+    private IResourceSupplierV1InnerServiceSMO resourceSupplierV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "rsId", "rsId不能为空");
+        Assert.hasKeyAndValue(reqJson, "supplierName", "请求报文中未包含supplierName");
+        Assert.hasKeyAndValue(reqJson, "address", "请求报文中未包含address");
+        Assert.hasKeyAndValue(reqJson, "tel", "请求报文中未包含tel");
+        if (!reqJson.containsKey("storeId")) {
+            String storeId = cmdDataFlowContext.getReqHeaders().get("store-id");
+            reqJson.put("storeId", storeId);
+        }
+        if (!reqJson.containsKey("userId")) {
+            reqJson.put("userId", "-1");
+        }
+
+        if (!reqJson.containsKey("userName")) {
+            reqJson.put("userName", "未知");
+        }
+
+        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+       ResourceSupplierPo resourceSupplierPo = BeanConvertUtil.covertBean(reqJson, ResourceSupplierPo.class);
+        int flag = resourceSupplierV1InnerServiceSMOImpl.updateResourceSupplier(resourceSupplierPo);
+
+        if (flag < 1) {
+            throw new CmdException("更新数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-store/src/main/java/com/java110/store/dao/IResourceSupplierV1ServiceDao.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-07 16:56:05 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 IResourceSupplierV1ServiceDao {
+
+
+    /**
+     * 保存 供应商信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveResourceSupplierInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询供应商信息(instance过程)
+     * 根据bId 查询供应商信息
+     * @param info bId 信息
+     * @return 供应商信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getResourceSupplierInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改供应商信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateResourceSupplierInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询供应商总数
+     *
+     * @param info 供应商信息
+     * @return 供应商数量
+     */
+    int queryResourceSuppliersCount(Map info);
+
+}

+ 113 - 0
service-store/src/main/java/com/java110/store/dao/impl/ResourceSupplierV1ServiceDaoImpl.java

@@ -0,0 +1,113 @@
+/*
+ * 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.store.dao.IResourceSupplierV1ServiceDao;
+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 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-07 16:56:05 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("resourceSupplierV1ServiceDaoImpl")
+public class ResourceSupplierV1ServiceDaoImpl extends BaseServiceDao implements IResourceSupplierV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(ResourceSupplierV1ServiceDaoImpl.class);
+
+
+    /**
+     * 保存供应商信息 到 instance
+     *
+     * @param info bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveResourceSupplierInfo(Map info) throws DAOException {
+        logger.debug("保存 saveResourceSupplierInfo 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.insert("resourceSupplierV1ServiceDaoImpl.saveResourceSupplierInfo", info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询供应商信息(instance)
+     *
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getResourceSupplierInfo(Map info) throws DAOException {
+        logger.debug("查询 getResourceSupplierInfo 入参 info : {}", info);
+
+        List<Map> businessResourceSupplierInfos = sqlSessionTemplate.selectList("resourceSupplierV1ServiceDaoImpl.getResourceSupplierInfo", info);
+
+        return businessResourceSupplierInfos;
+    }
+
+
+    /**
+     * 修改供应商信息
+     *
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateResourceSupplierInfo(Map info) throws DAOException {
+        logger.debug("修改 updateResourceSupplierInfo 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.update("resourceSupplierV1ServiceDaoImpl.updateResourceSupplierInfo", info);
+
+        return saveFlag;
+    }
+
+    /**
+     * 查询供应商数量
+     *
+     * @param info 供应商信息
+     * @return 供应商数量
+     */
+    @Override
+    public int queryResourceSuppliersCount(Map info) {
+        logger.debug("查询 queryResourceSuppliersCount 入参 info : {}", info);
+
+        List<Map> businessResourceSupplierInfos = sqlSessionTemplate.selectList("resourceSupplierV1ServiceDaoImpl.queryResourceSuppliersCount", info);
+        if (businessResourceSupplierInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessResourceSupplierInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-store/src/main/java/com/java110/store/smo/impl/ResourceSupplierV1InnerServiceSMOImpl.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.dto.resourceSupplier.ResourceSupplierDto;
+import com.java110.intf.store.IResourceSupplierV1InnerServiceSMO;
+import com.java110.po.resourceSupplier.ResourceSupplierPo;
+import com.java110.store.dao.IResourceSupplierV1ServiceDao;
+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-07 16:56:05 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 ResourceSupplierV1InnerServiceSMOImpl extends BaseServiceSMO implements IResourceSupplierV1InnerServiceSMO {
+
+    @Autowired
+    private IResourceSupplierV1ServiceDao resourceSupplierV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveResourceSupplier(@RequestBody ResourceSupplierPo resourceSupplierPo) {
+        int saveFlag = resourceSupplierV1ServiceDaoImpl.saveResourceSupplierInfo(BeanConvertUtil.beanCovertMap(resourceSupplierPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int updateResourceSupplier(@RequestBody ResourceSupplierPo resourceSupplierPo) {
+        int saveFlag = resourceSupplierV1ServiceDaoImpl.updateResourceSupplierInfo(BeanConvertUtil.beanCovertMap(resourceSupplierPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int deleteResourceSupplier(@RequestBody ResourceSupplierPo resourceSupplierPo) {
+        resourceSupplierPo.setStatusCd("1");
+        int saveFlag = resourceSupplierV1ServiceDaoImpl.updateResourceSupplierInfo(BeanConvertUtil.beanCovertMap(resourceSupplierPo));
+        return saveFlag;
+    }
+
+    @Override
+    public List<ResourceSupplierDto> queryResourceSuppliers(@RequestBody ResourceSupplierDto resourceSupplierDto) {
+
+        //校验是否传了 分页信息
+
+        int page = resourceSupplierDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            resourceSupplierDto.setPage((page - 1) * resourceSupplierDto.getRow());
+        }
+
+        List<ResourceSupplierDto> resourceSuppliers = BeanConvertUtil.covertBeanList(resourceSupplierV1ServiceDaoImpl.getResourceSupplierInfo(BeanConvertUtil.beanCovertMap(resourceSupplierDto)), ResourceSupplierDto.class);
+
+        return resourceSuppliers;
+    }
+
+
+    @Override
+    public int queryResourceSuppliersCount(@RequestBody ResourceSupplierDto resourceSupplierDto) {
+        return resourceSupplierV1ServiceDaoImpl.queryResourceSuppliersCount(BeanConvertUtil.beanCovertMap(resourceSupplierDto));
+    }
+
+}