Explorar el Código

优化 代码

java110 hace 5 años
padre
commit
f25c0c8ee3
Se han modificado 18 ficheros con 930 adiciones y 29 borrados
  1. 90 0
      java110-bean/src/main/java/com/java110/dto/storeMsg/StoreMsgDto.java
  2. 67 0
      java110-bean/src/main/java/com/java110/po/storeMsg/StoreMsgPo.java
  3. 124 0
      java110-db/src/main/resources/mapper/store/StoreMsgServiceDaoImplMapper.xml
  4. 20 27
      java110-generator/src/main/resources/newBack/template_1.json
  5. 53 0
      java110-interface/src/main/java/com/java110/intf/store/IStoreMsgInnerServiceSMO.java
  6. 8 2
      service-report/src/main/java/com/java110/report/smo/impl/GeneratorOweFeeInnerServiceSMOImpl.java
  7. 109 0
      service-store/src/main/java/com/java110/store/api/StoreMsgApi.java
  8. 17 0
      service-store/src/main/java/com/java110/store/bmo/storeMsg/IDeleteStoreMsgBMO.java
  9. 16 0
      service-store/src/main/java/com/java110/store/bmo/storeMsg/IGetStoreMsgBMO.java
  10. 17 0
      service-store/src/main/java/com/java110/store/bmo/storeMsg/ISaveStoreMsgBMO.java
  11. 17 0
      service-store/src/main/java/com/java110/store/bmo/storeMsg/IUpdateStoreMsgBMO.java
  12. 34 0
      service-store/src/main/java/com/java110/store/bmo/storeMsg/impl/DeleteStoreMsgBMOImpl.java
  13. 44 0
      service-store/src/main/java/com/java110/store/bmo/storeMsg/impl/GetStoreMsgBMOImpl.java
  14. 38 0
      service-store/src/main/java/com/java110/store/bmo/storeMsg/impl/SaveStoreMsgBMOImpl.java
  15. 34 0
      service-store/src/main/java/com/java110/store/bmo/storeMsg/impl/UpdateStoreMsgBMOImpl.java
  16. 61 0
      service-store/src/main/java/com/java110/store/dao/IStoreMsgServiceDao.java
  17. 98 0
      service-store/src/main/java/com/java110/store/dao/impl/StoreMsgServiceDaoImpl.java
  18. 83 0
      service-store/src/main/java/com/java110/store/smo/impl/StoreMsgInnerServiceSMOImpl.java

+ 90 - 0
java110-bean/src/main/java/com/java110/dto/storeMsg/StoreMsgDto.java

@@ -0,0 +1,90 @@
+package com.java110.dto.storeMsg;
+
+import com.java110.dto.PageDto;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 商户消息数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class StoreMsgDto extends PageDto implements Serializable {
+
+    private String msgType;
+private String viewId;
+private String msgId;
+private String shareId;
+private String title;
+private String msgFlag;
+private String content;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getMsgType() {
+        return msgType;
+    }
+public void setMsgType(String msgType) {
+        this.msgType = msgType;
+    }
+public String getViewId() {
+        return viewId;
+    }
+public void setViewId(String viewId) {
+        this.viewId = viewId;
+    }
+public String getMsgId() {
+        return msgId;
+    }
+public void setMsgId(String msgId) {
+        this.msgId = msgId;
+    }
+public String getShareId() {
+        return shareId;
+    }
+public void setShareId(String shareId) {
+        this.shareId = shareId;
+    }
+public String getTitle() {
+        return title;
+    }
+public void setTitle(String title) {
+        this.title = title;
+    }
+public String getMsgFlag() {
+        return msgFlag;
+    }
+public void setMsgFlag(String msgFlag) {
+        this.msgFlag = msgFlag;
+    }
+public String getContent() {
+        return content;
+    }
+public void setContent(String content) {
+        this.content = content;
+    }
+
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 67 - 0
java110-bean/src/main/java/com/java110/po/storeMsg/StoreMsgPo.java

@@ -0,0 +1,67 @@
+package com.java110.po.storeMsg;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class StoreMsgPo implements Serializable {
+
+    private String msgType;
+private String viewId;
+private String msgId;
+private String shareId;
+private String statusCd = "0";
+private String title;
+private String msgFlag;
+private String content;
+public String getMsgType() {
+        return msgType;
+    }
+public void setMsgType(String msgType) {
+        this.msgType = msgType;
+    }
+public String getViewId() {
+        return viewId;
+    }
+public void setViewId(String viewId) {
+        this.viewId = viewId;
+    }
+public String getMsgId() {
+        return msgId;
+    }
+public void setMsgId(String msgId) {
+        this.msgId = msgId;
+    }
+public String getShareId() {
+        return shareId;
+    }
+public void setShareId(String shareId) {
+        this.shareId = shareId;
+    }
+public String getStatusCd() {
+        return statusCd;
+    }
+public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+public String getTitle() {
+        return title;
+    }
+public void setTitle(String title) {
+        this.title = title;
+    }
+public String getMsgFlag() {
+        return msgFlag;
+    }
+public void setMsgFlag(String msgFlag) {
+        this.msgFlag = msgFlag;
+    }
+public String getContent() {
+        return content;
+    }
+public void setContent(String content) {
+        this.content = content;
+    }
+
+
+
+}

+ 124 - 0
java110-db/src/main/resources/mapper/store/StoreMsgServiceDaoImplMapper.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="storeMsgServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存商户消息信息 add by wuxw 2018-07-03 -->
+    <insert id="saveStoreMsgInfo" parameterType="Map">
+        insert into store_msg(
+msg_type,view_id,msg_id,share_id,title,msg_flag,content
+) values (
+#{msgType},#{viewId},#{msgId},#{shareId},#{title},#{msgFlag},#{content}
+)
+    </insert>
+
+
+
+    <!-- 查询商户消息信息 add by wuxw 2018-07-03 -->
+    <select id="getStoreMsgInfo" parameterType="Map" resultType="Map">
+        select  t.msg_type,t.msg_type msgType,t.view_id,t.view_id viewId,t.msg_id,t.msg_id msgId,t.share_id,t.share_id shareId,t.status_cd,t.status_cd statusCd,t.title,t.msg_flag,t.msg_flag msgFlag,t.content 
+from store_msg t 
+where 1 =1 
+<if test="msgType !=null and msgType != ''">
+   and t.msg_type= #{msgType}
+</if> 
+<if test="viewId !=null and viewId != ''">
+   and t.view_id= #{viewId}
+</if> 
+<if test="msgId !=null and msgId != ''">
+   and t.msg_id= #{msgId}
+</if> 
+<if test="shareId !=null and shareId != ''">
+   and t.share_id= #{shareId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="title !=null and title != ''">
+   and t.title= #{title}
+</if> 
+<if test="msgFlag !=null and msgFlag != ''">
+   and t.msg_flag= #{msgFlag}
+</if> 
+<if test="content !=null and content != ''">
+   and t.content= #{content}
+</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="updateStoreMsgInfo" parameterType="Map">
+        update  store_msg t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="msgType !=null and msgType != ''">
+, t.msg_type= #{msgType}
+</if> 
+<if test="viewId !=null and viewId != ''">
+, t.view_id= #{viewId}
+</if> 
+<if test="shareId !=null and shareId != ''">
+, t.share_id= #{shareId}
+</if> 
+<if test="title !=null and title != ''">
+, t.title= #{title}
+</if> 
+<if test="msgFlag !=null and msgFlag != ''">
+, t.msg_flag= #{msgFlag}
+</if> 
+<if test="content !=null and content != ''">
+, t.content= #{content}
+</if> 
+ where 1=1 <if test="msgId !=null and msgId != ''">
+and t.msg_id= #{msgId}
+</if> 
+
+    </update>
+
+    <!-- 查询商户消息数量 add by wuxw 2018-07-03 -->
+     <select id="queryStoreMsgsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from store_msg t 
+where 1 =1 
+<if test="msgType !=null and msgType != ''">
+   and t.msg_type= #{msgType}
+</if> 
+<if test="viewId !=null and viewId != ''">
+   and t.view_id= #{viewId}
+</if> 
+<if test="msgId !=null and msgId != ''">
+   and t.msg_id= #{msgId}
+</if> 
+<if test="shareId !=null and shareId != ''">
+   and t.share_id= #{shareId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="title !=null and title != ''">
+   and t.title= #{title}
+</if> 
+<if test="msgFlag !=null and msgFlag != ''">
+   and t.msg_flag= #{msgFlag}
+</if> 
+<if test="content !=null and content != ''">
+   and t.content= #{content}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 20 - 27
java110-generator/src/main/resources/newBack/template_1.json

@@ -1,41 +1,34 @@
 {
   "autoMove": true,
-  "id": "detailId",
-  "name": "feeCollectionDetail",
-  "desc": "催缴单",
-  "shareParam": "communityId",
-  "shareColumn": "community_id",
-  "shareName": "fee",
-  "tableName": "fee_collection_detail",
+  "id": "msgId",
+  "name": "storeMsg",
+  "desc": "商户消息",
+  "shareParam": "shareId",
+  "shareColumn": "share_id",
+  "shareName": "store",
+  "tableName": "store_msg",
   "param": {
-    "detailId": "detail_id",
-    "orderId": "order_id",
-    "collectionName": "collection_name",
-    "ownerId": "owner_id",
-    "ownerName": "owner_name",
-    "feeName": "fee_name",
-    "payerObjId": "payer_obj_id",
-    "payerObjName": "payer_obj_name",
-    "payerObjType": "payer_obj_type",
-    "communityId": "community_id",
-    "collectionWay": "collection_way",
-    "oweAmount": "owe_amount",
-    "state": "state",
-    "remarks": "remarks",
+    "msgId": "msg_id",
+    "msgType": "msg_type",
+    "title": "title",
+    "msgFlag": "msg_flag",
+    "content": "content",
+    "viewId": "view_id",
+    "shareId": "share_id",
     "statusCd": "status_cd"
   },
   "required": [
     {
-      "code": "communityId",
-      "msg": "小区不能为空"
+      "code": "shareId",
+      "msg": "分片不能为空"
     },
     {
-      "code": "collectionWay",
-      "msg": "催缴方式不能为空"
+      "code": "msgFlag",
+      "msg": "消息标识不能为空"
     },
     {
-      "code": "oweAmount",
-      "msg": "欠费金额不能为空"
+      "code": "title",
+      "msg": "标题不能为空"
     }
   ]
 }

+ 53 - 0
java110-interface/src/main/java/com/java110/intf/store/IStoreMsgInnerServiceSMO.java

@@ -0,0 +1,53 @@
+package com.java110.intf.store;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.storeMsg.StoreMsgDto;
+import com.java110.po.storeMsg.StoreMsgPo;
+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;
+
+/**
+ * @ClassName IStoreMsgInnerServiceSMO
+ * @Description 商户消息接口类
+ * @Author wuxw
+ * @Date 2019/4/24 9:04
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@FeignClient(name = "store-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/storeMsgApi")
+public interface IStoreMsgInnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveStoreMsg", method = RequestMethod.POST)
+    public int saveStoreMsg(@RequestBody StoreMsgPo storeMsgPo);
+
+    @RequestMapping(value = "/updateStoreMsg", method = RequestMethod.POST)
+    public int updateStoreMsg(@RequestBody  StoreMsgPo storeMsgPo);
+
+    @RequestMapping(value = "/deleteStoreMsg", method = RequestMethod.POST)
+    public int deleteStoreMsg(@RequestBody  StoreMsgPo storeMsgPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param storeMsgDto 数据对象分享
+     * @return StoreMsgDto 对象数据
+     */
+    @RequestMapping(value = "/queryStoreMsgs", method = RequestMethod.POST)
+    List<StoreMsgDto> queryStoreMsgs(@RequestBody StoreMsgDto storeMsgDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param storeMsgDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryStoreMsgsCount", method = RequestMethod.POST)
+    int queryStoreMsgsCount(@RequestBody StoreMsgDto storeMsgDto);
+}

+ 8 - 2
service-report/src/main/java/com/java110/report/smo/impl/GeneratorOweFeeInnerServiceSMOImpl.java

@@ -9,6 +9,7 @@ import com.java110.dto.fee.FeeDto;
 import com.java110.dto.logSystemError.LogSystemErrorDto;
 import com.java110.dto.report.ReportFeeDto;
 import com.java110.dto.reportOweFee.ReportOweFeeDto;
+import com.java110.intf.community.ICommunityInnerServiceSMO;
 import com.java110.intf.report.IGeneratorOweFeeInnerServiceSMO;
 import com.java110.intf.user.IOwnerCarInnerServiceSMO;
 import com.java110.po.logSystemError.LogSystemErrorPo;
@@ -77,13 +78,18 @@ public class GeneratorOweFeeInnerServiceSMOImpl implements IGeneratorOweFeeInner
     @Autowired
     private IReportOweFeeServiceDao reportOweFeeServiceDaoImpl;
 
+    @Autowired
+    private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
+
     @Override
     public int generatorOweData(@RequestBody ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo) {
 
         CommunityDto communityDto = new CommunityDto();
 
-        List<CommunityDto> communityDtos = BeanConvertUtil.covertBeanList(
-                reportCommunityServiceDaoImpl.getCommunitys(BeanConvertUtil.beanCovertMap(communityDto)), CommunityDto.class);
+//        List<CommunityDto> communityDtos = BeanConvertUtil.covertBeanList(
+//                reportCommunityServiceDaoImpl.getCommunitys(BeanConvertUtil.beanCovertMap(communityDto)), CommunityDto.class);
+
+        List<CommunityDto> communityDtos =communityInnerServiceSMOImpl.queryCommunitys(communityDto);
 
         for (CommunityDto tmpCommunityDto : communityDtos) {
             reportFeeMonthStatisticsPo.setCommunityId(tmpCommunityDto.getCommunityId());

+ 109 - 0
service-store/src/main/java/com/java110/store/api/StoreMsgApi.java

@@ -0,0 +1,109 @@
+package com.java110.store.api;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.storeMsg.StoreMsgDto;
+import com.java110.po.storeMsg.StoreMsgPo;
+import com.java110.store.bmo.storeMsg.IDeleteStoreMsgBMO;
+import com.java110.store.bmo.storeMsg.IGetStoreMsgBMO;
+import com.java110.store.bmo.storeMsg.ISaveStoreMsgBMO;
+import com.java110.store.bmo.storeMsg.IUpdateStoreMsgBMO;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+
+@RestController
+@RequestMapping(value = "/storeMsg")
+public class StoreMsgApi {
+
+    @Autowired
+    private ISaveStoreMsgBMO saveStoreMsgBMOImpl;
+    @Autowired
+    private IUpdateStoreMsgBMO updateStoreMsgBMOImpl;
+    @Autowired
+    private IDeleteStoreMsgBMO deleteStoreMsgBMOImpl;
+
+    @Autowired
+    private IGetStoreMsgBMO getStoreMsgBMOImpl;
+
+    /**
+     * 微信保存消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /storeMsg/saveStoreMsg
+     * @path /app/storeMsg/saveStoreMsg
+     */
+    @RequestMapping(value = "/saveStoreMsg", method = RequestMethod.POST)
+    public ResponseEntity<String> saveStoreMsg(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "shareId", "请求报文中未包含shareId");
+        Assert.hasKeyAndValue(reqJson, "msgFlag", "请求报文中未包含msgFlag");
+        Assert.hasKeyAndValue(reqJson, "title", "请求报文中未包含title");
+
+
+        StoreMsgPo storeMsgPo = BeanConvertUtil.covertBean(reqJson, StoreMsgPo.class);
+        return saveStoreMsgBMOImpl.save(storeMsgPo);
+    }
+
+    /**
+     * 微信修改消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /storeMsg/updateStoreMsg
+     * @path /app/storeMsg/updateStoreMsg
+     */
+    @RequestMapping(value = "/updateStoreMsg", method = RequestMethod.POST)
+    public ResponseEntity<String> updateStoreMsg(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "shareId", "请求报文中未包含shareId");
+        Assert.hasKeyAndValue(reqJson, "msgFlag", "请求报文中未包含msgFlag");
+        Assert.hasKeyAndValue(reqJson, "title", "请求报文中未包含title");
+        Assert.hasKeyAndValue(reqJson, "msgId", "msgId不能为空");
+
+
+        StoreMsgPo storeMsgPo = BeanConvertUtil.covertBean(reqJson, StoreMsgPo.class);
+        return updateStoreMsgBMOImpl.update(storeMsgPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /storeMsg/deleteStoreMsg
+     * @path /app/storeMsg/deleteStoreMsg
+     */
+    @RequestMapping(value = "/deleteStoreMsg", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteStoreMsg(@RequestBody JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
+
+        Assert.hasKeyAndValue(reqJson, "msgId", "msgId不能为空");
+
+
+        StoreMsgPo storeMsgPo = BeanConvertUtil.covertBean(reqJson, StoreMsgPo.class);
+        return deleteStoreMsgBMOImpl.delete(storeMsgPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param shareId  分片ID
+     * @return
+     * @serviceCode /storeMsg/queryStoreMsg
+     * @path /app/storeMsg/queryStoreMsg
+     */
+    @RequestMapping(value = "/queryStoreMsg", method = RequestMethod.GET)
+    public ResponseEntity<String> queryStoreMsg(@RequestParam(value = "shareId") String shareId,
+                                                @RequestParam(value = "page") int page,
+                                                @RequestParam(value = "row") int row) {
+        StoreMsgDto storeMsgDto = new StoreMsgDto();
+        storeMsgDto.setPage(page);
+        storeMsgDto.setRow(row);
+        storeMsgDto.setShareId(shareId);
+        return getStoreMsgBMOImpl.get(storeMsgDto);
+    }
+}

+ 17 - 0
service-store/src/main/java/com/java110/store/bmo/storeMsg/IDeleteStoreMsgBMO.java

@@ -0,0 +1,17 @@
+package com.java110.store.bmo.storeMsg;
+import com.java110.po.storeMsg.StoreMsgPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IDeleteStoreMsgBMO {
+
+
+    /**
+     * 修改商户消息
+     * add by wuxw
+     * @param storeMsgPo
+     * @return
+     */
+    ResponseEntity<String> delete(StoreMsgPo storeMsgPo);
+
+
+}

+ 16 - 0
service-store/src/main/java/com/java110/store/bmo/storeMsg/IGetStoreMsgBMO.java

@@ -0,0 +1,16 @@
+package com.java110.store.bmo.storeMsg;
+import com.java110.dto.storeMsg.StoreMsgDto;
+import org.springframework.http.ResponseEntity;
+public interface IGetStoreMsgBMO {
+
+
+    /**
+     * 查询商户消息
+     * add by wuxw
+     * @param  storeMsgDto
+     * @return
+     */
+    ResponseEntity<String> get(StoreMsgDto storeMsgDto);
+
+
+}

+ 17 - 0
service-store/src/main/java/com/java110/store/bmo/storeMsg/ISaveStoreMsgBMO.java

@@ -0,0 +1,17 @@
+package com.java110.store.bmo.storeMsg;
+
+import com.java110.po.storeMsg.StoreMsgPo;
+import org.springframework.http.ResponseEntity;
+public interface ISaveStoreMsgBMO {
+
+
+    /**
+     * 添加商户消息
+     * add by wuxw
+     * @param storeMsgPo
+     * @return
+     */
+    ResponseEntity<String> save(StoreMsgPo storeMsgPo);
+
+
+}

+ 17 - 0
service-store/src/main/java/com/java110/store/bmo/storeMsg/IUpdateStoreMsgBMO.java

@@ -0,0 +1,17 @@
+package com.java110.store.bmo.storeMsg;
+import com.java110.po.storeMsg.StoreMsgPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IUpdateStoreMsgBMO {
+
+
+    /**
+     * 修改商户消息
+     * add by wuxw
+     * @param storeMsgPo
+     * @return
+     */
+    ResponseEntity<String> update(StoreMsgPo storeMsgPo);
+
+
+}

+ 34 - 0
service-store/src/main/java/com/java110/store/bmo/storeMsg/impl/DeleteStoreMsgBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.store.bmo.storeMsg.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.intf.store.IStoreMsgInnerServiceSMO;
+import com.java110.po.storeMsg.StoreMsgPo;
+import com.java110.store.bmo.storeMsg.IDeleteStoreMsgBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("deleteStoreMsgBMOImpl")
+public class DeleteStoreMsgBMOImpl implements IDeleteStoreMsgBMO {
+
+    @Autowired
+    private IStoreMsgInnerServiceSMO storeMsgInnerServiceSMOImpl;
+
+    /**
+     * @param storeMsgPo 数据
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> delete(StoreMsgPo storeMsgPo) {
+
+        int flag = storeMsgInnerServiceSMOImpl.deleteStoreMsg(storeMsgPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 44 - 0
service-store/src/main/java/com/java110/store/bmo/storeMsg/impl/GetStoreMsgBMOImpl.java

@@ -0,0 +1,44 @@
+package com.java110.store.bmo.storeMsg.impl;
+
+import com.java110.dto.storeMsg.StoreMsgDto;
+import com.java110.intf.store.IStoreMsgInnerServiceSMO;
+import com.java110.store.bmo.storeMsg.IGetStoreMsgBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service("getStoreMsgBMOImpl")
+public class GetStoreMsgBMOImpl implements IGetStoreMsgBMO {
+
+    @Autowired
+    private IStoreMsgInnerServiceSMO storeMsgInnerServiceSMOImpl;
+
+    /**
+     * @param storeMsgDto
+     * @return 订单服务能够接受的报文
+     */
+    public ResponseEntity<String> get(StoreMsgDto storeMsgDto) {
+
+
+        int count = storeMsgInnerServiceSMOImpl.queryStoreMsgsCount(storeMsgDto);
+
+        List<StoreMsgDto> storeMsgDtos = null;
+        if (count > 0) {
+            storeMsgDtos = storeMsgInnerServiceSMOImpl.queryStoreMsgs(storeMsgDto);
+        } else {
+            storeMsgDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) storeMsgDto.getRow()), count, storeMsgDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
+
+}

+ 38 - 0
service-store/src/main/java/com/java110/store/bmo/storeMsg/impl/SaveStoreMsgBMOImpl.java

@@ -0,0 +1,38 @@
+package com.java110.store.bmo.storeMsg.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.store.IStoreMsgInnerServiceSMO;
+import com.java110.po.storeMsg.StoreMsgPo;
+import com.java110.store.bmo.storeMsg.ISaveStoreMsgBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("saveStoreMsgBMOImpl")
+public class SaveStoreMsgBMOImpl implements ISaveStoreMsgBMO {
+
+    @Autowired
+    private IStoreMsgInnerServiceSMO storeMsgInnerServiceSMOImpl;
+
+    /**
+     * 添加小区信息
+     *
+     * @param storeMsgPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> save(StoreMsgPo storeMsgPo) {
+
+        storeMsgPo.setMsgId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_msgId));
+        int flag = storeMsgInnerServiceSMOImpl.saveStoreMsg(storeMsgPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 34 - 0
service-store/src/main/java/com/java110/store/bmo/storeMsg/impl/UpdateStoreMsgBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.store.bmo.storeMsg.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.intf.store.IStoreMsgInnerServiceSMO;
+import com.java110.po.storeMsg.StoreMsgPo;
+import com.java110.store.bmo.storeMsg.IUpdateStoreMsgBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("updateStoreMsgBMOImpl")
+public class UpdateStoreMsgBMOImpl implements IUpdateStoreMsgBMO {
+
+    @Autowired
+    private IStoreMsgInnerServiceSMO storeMsgInnerServiceSMOImpl;
+
+    /**
+     * @param storeMsgPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> update(StoreMsgPo storeMsgPo) {
+
+        int flag = storeMsgInnerServiceSMOImpl.updateStoreMsg(storeMsgPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 61 - 0
service-store/src/main/java/com/java110/store/dao/IStoreMsgServiceDao.java

@@ -0,0 +1,61 @@
+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;
+
+/**
+ * 商户消息组件内部之间使用,没有给外围系统提供服务能力
+ * 商户消息服务接口类,要求全部以字符串传输,方便微服务化
+ * 新建客户,修改客户,删除客户,查询客户等功能
+ *
+ * Created by wuxw on 2016/12/27.
+ */
+public interface IStoreMsgServiceDao {
+
+
+    /**
+     * 保存 商户消息信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveStoreMsgInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询商户消息信息(instance过程)
+     * 根据bId 查询商户消息信息
+     * @param info bId 信息
+     * @return 商户消息信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getStoreMsgInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改商户消息信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateStoreMsgInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询商户消息总数
+     *
+     * @param info 商户消息信息
+     * @return 商户消息数量
+     */
+    int queryStoreMsgsCount(Map info);
+
+}

+ 98 - 0
service-store/src/main/java/com/java110/store/dao/impl/StoreMsgServiceDaoImpl.java

@@ -0,0 +1,98 @@
+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.IStoreMsgServiceDao;
+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;
+
+/**
+ * 商户消息服务 与数据库交互
+ * Created by wuxw on 2017/4/5.
+ */
+@Service("storeMsgServiceDaoImpl")
+//@Transactional
+public class StoreMsgServiceDaoImpl extends BaseServiceDao implements IStoreMsgServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(StoreMsgServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存商户消息信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveStoreMsgInfo(Map info) throws DAOException {
+        logger.debug("保存商户消息信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("storeMsgServiceDaoImpl.saveStoreMsgInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商户消息信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+
+    /**
+     * 查询商户消息信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getStoreMsgInfo(Map info) throws DAOException {
+        logger.debug("查询商户消息信息 入参 info : {}",info);
+
+        List<Map> businessStoreMsgInfos = sqlSessionTemplate.selectList("storeMsgServiceDaoImpl.getStoreMsgInfo",info);
+
+        return businessStoreMsgInfos;
+    }
+
+
+    /**
+     * 修改商户消息信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateStoreMsgInfo(Map info) throws DAOException {
+        logger.debug("修改商户消息信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("storeMsgServiceDaoImpl.updateStoreMsgInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改商户消息信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询商户消息数量
+     * @param info 商户消息信息
+     * @return 商户消息数量
+     */
+    @Override
+    public int queryStoreMsgsCount(Map info) {
+        logger.debug("查询商户消息数据 入参 info : {}",info);
+
+        List<Map> businessStoreMsgInfos = sqlSessionTemplate.selectList("storeMsgServiceDaoImpl.queryStoreMsgsCount", info);
+        if (businessStoreMsgInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessStoreMsgInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 83 - 0
service-store/src/main/java/com/java110/store/smo/impl/StoreMsgInnerServiceSMOImpl.java

@@ -0,0 +1,83 @@
+package com.java110.store.smo.impl;
+
+
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.storeMsg.StoreMsgDto;
+import com.java110.intf.store.IStoreMsgInnerServiceSMO;
+import com.java110.po.storeMsg.StoreMsgPo;
+import com.java110.store.dao.IStoreMsgServiceDao;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @ClassName FloorInnerServiceSMOImpl
+ * @Description 商户消息内部服务实现类
+ * @Author wuxw
+ * @Date 2019/4/24 9:20
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@RestController
+public class StoreMsgInnerServiceSMOImpl extends BaseServiceSMO implements IStoreMsgInnerServiceSMO {
+
+    @Autowired
+    private IStoreMsgServiceDao storeMsgServiceDaoImpl;
+
+
+    @Override
+    public int saveStoreMsg(@RequestBody StoreMsgPo storeMsgPo) {
+        int saveFlag = 1;
+        storeMsgServiceDaoImpl.saveStoreMsgInfo(BeanConvertUtil.beanCovertMap(storeMsgPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int updateStoreMsg(@RequestBody StoreMsgPo storeMsgPo) {
+        int saveFlag = 1;
+        storeMsgServiceDaoImpl.updateStoreMsgInfo(BeanConvertUtil.beanCovertMap(storeMsgPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int deleteStoreMsg(@RequestBody StoreMsgPo storeMsgPo) {
+        int saveFlag = 1;
+        storeMsgPo.setStatusCd("1");
+        storeMsgServiceDaoImpl.updateStoreMsgInfo(BeanConvertUtil.beanCovertMap(storeMsgPo));
+        return saveFlag;
+    }
+
+    @Override
+    public List<StoreMsgDto> queryStoreMsgs(@RequestBody StoreMsgDto storeMsgDto) {
+
+        //校验是否传了 分页信息
+
+        int page = storeMsgDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            storeMsgDto.setPage((page - 1) * storeMsgDto.getRow());
+        }
+
+        List<StoreMsgDto> storeMsgs = BeanConvertUtil.covertBeanList(storeMsgServiceDaoImpl.getStoreMsgInfo(BeanConvertUtil.beanCovertMap(storeMsgDto)), StoreMsgDto.class);
+
+        return storeMsgs;
+    }
+
+
+    @Override
+    public int queryStoreMsgsCount(@RequestBody StoreMsgDto storeMsgDto) {
+        return storeMsgServiceDaoImpl.queryStoreMsgsCount(BeanConvertUtil.beanCovertMap(storeMsgDto));
+    }
+
+    public IStoreMsgServiceDao getStoreMsgServiceDaoImpl() {
+        return storeMsgServiceDaoImpl;
+    }
+
+    public void setStoreMsgServiceDaoImpl(IStoreMsgServiceDao storeMsgServiceDaoImpl) {
+        this.storeMsgServiceDaoImpl = storeMsgServiceDaoImpl;
+    }
+}