java110 лет назад: 3
Родитель
Сommit
c8be8452b9
14 измененных файлов с 861 добавлено и 328 удалено
  1. 136 0
      java110-db/src/main/resources/mapper/store/WechatMenuV1ServiceDaoImplMapper.xml
  2. 68 0
      java110-interface/src/main/java/com/java110/intf/store/IWechatMenuV1InnerServiceSMO.java
  3. 0 49
      service-api/src/main/java/com/java110/api/listener/smallWeChat/DeleteWechatMenuListener.java
  4. 0 84
      service-api/src/main/java/com/java110/api/listener/smallWeChat/ListWechatMenusListener.java
  5. 0 91
      service-api/src/main/java/com/java110/api/listener/smallWeChat/SaveWechatMenuListener.java
  6. 0 69
      service-api/src/main/java/com/java110/api/listener/smallWeChat/UpdateWechatMenuListener.java
  7. 71 0
      service-store/src/main/java/com/java110/store/cmd/wechatMenu/DeleteWechatMenuCmd.java
  8. 80 0
      service-store/src/main/java/com/java110/store/cmd/wechatMenu/ListWechatMenusCmd.java
  9. 14 35
      service-api/src/main/java/com/java110/api/listener/smallWeChat/PublishWechatMenuListener.java
  10. 118 0
      service-store/src/main/java/com/java110/store/cmd/wechatMenu/SaveWechatMenuCmd.java
  11. 96 0
      service-store/src/main/java/com/java110/store/cmd/wechatMenu/UpdateWechatMenuCmd.java
  12. 77 0
      service-store/src/main/java/com/java110/store/dao/IWechatMenuV1ServiceDao.java
  13. 112 0
      service-store/src/main/java/com/java110/store/dao/impl/WechatMenuV1ServiceDaoImpl.java
  14. 89 0
      service-store/src/main/java/com/java110/store/smo/impl/WechatMenuV1InnerServiceSMOImpl.java

+ 136 - 0
java110-db/src/main/resources/mapper/store/WechatMenuV1ServiceDaoImplMapper.xml

@@ -0,0 +1,136 @@
+<?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="wechatMenuV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存微信菜单信息 add by wuxw 2018-07-03 -->
+    <insert id="saveWechatMenuInfo" parameterType="Map">
+        insert into wechat_menu(
+pagepath,parent_menu_id,app_id,menu_level,menu_name,menu_type,menu_value,seq,wechat_menu_id
+) values (
+#{pagepath},#{parentMenuId},#{appId},#{menuLevel},#{menuName},#{menuType},#{menuValue},#{seq},#{wechatMenuId}
+)
+    </insert>
+
+
+
+    <!-- 查询微信菜单信息 add by wuxw 2018-07-03 -->
+    <select id="getWechatMenuInfo" parameterType="Map" resultType="Map">
+        select  t.pagepath,t.parent_menu_id,t.parent_menu_id parentMenuId,t.app_id,t.app_id appId,t.menu_level,t.menu_level menuLevel,t.menu_name,t.menu_name menuName,t.menu_type,t.menu_type menuType,t.menu_value,t.menu_value menuValue,t.seq,t.wechat_menu_id,t.wechat_menu_id wechatMenuId 
+from wechat_menu t 
+where 1 =1 
+<if test="pagepath !=null and pagepath != ''">
+   and t.pagepath= #{pagepath}
+</if> 
+<if test="parentMenuId !=null and parentMenuId != ''">
+   and t.parent_menu_id= #{parentMenuId}
+</if> 
+<if test="appId !=null and appId != ''">
+   and t.app_id= #{appId}
+</if> 
+<if test="menuLevel !=null and menuLevel != ''">
+   and t.menu_level= #{menuLevel}
+</if> 
+<if test="menuName !=null and menuName != ''">
+   and t.menu_name= #{menuName}
+</if> 
+<if test="menuType !=null and menuType != ''">
+   and t.menu_type= #{menuType}
+</if> 
+<if test="menuValue !=null and menuValue != ''">
+   and t.menu_value= #{menuValue}
+</if> 
+<if test="seq !=null and seq != ''">
+   and t.seq= #{seq}
+</if> 
+<if test="wechatMenuId !=null and wechatMenuId != ''">
+   and t.wechat_menu_id= #{wechatMenuId}
+</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="updateWechatMenuInfo" parameterType="Map">
+        update  wechat_menu t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="pagepath !=null and pagepath != ''">
+, t.pagepath= #{pagepath}
+</if> 
+<if test="parentMenuId !=null and parentMenuId != ''">
+, t.parent_menu_id= #{parentMenuId}
+</if> 
+<if test="appId !=null and appId != ''">
+, t.app_id= #{appId}
+</if> 
+<if test="menuLevel !=null and menuLevel != ''">
+, t.menu_level= #{menuLevel}
+</if> 
+<if test="menuName !=null and menuName != ''">
+, t.menu_name= #{menuName}
+</if> 
+<if test="menuType !=null and menuType != ''">
+, t.menu_type= #{menuType}
+</if> 
+<if test="menuValue !=null and menuValue != ''">
+, t.menu_value= #{menuValue}
+</if> 
+<if test="seq !=null and seq != ''">
+, t.seq= #{seq}
+</if> 
+ where 1=1 <if test="wechatMenuId !=null and wechatMenuId != ''">
+and t.wechat_menu_id= #{wechatMenuId}
+</if> 
+
+    </update>
+
+    <!-- 查询微信菜单数量 add by wuxw 2018-07-03 -->
+     <select id="queryWechatMenusCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from wechat_menu t 
+where 1 =1 
+<if test="pagepath !=null and pagepath != ''">
+   and t.pagepath= #{pagepath}
+</if> 
+<if test="parentMenuId !=null and parentMenuId != ''">
+   and t.parent_menu_id= #{parentMenuId}
+</if> 
+<if test="appId !=null and appId != ''">
+   and t.app_id= #{appId}
+</if> 
+<if test="menuLevel !=null and menuLevel != ''">
+   and t.menu_level= #{menuLevel}
+</if> 
+<if test="menuName !=null and menuName != ''">
+   and t.menu_name= #{menuName}
+</if> 
+<if test="menuType !=null and menuType != ''">
+   and t.menu_type= #{menuType}
+</if> 
+<if test="menuValue !=null and menuValue != ''">
+   and t.menu_value= #{menuValue}
+</if> 
+<if test="seq !=null and seq != ''">
+   and t.seq= #{seq}
+</if> 
+<if test="wechatMenuId !=null and wechatMenuId != ''">
+   and t.wechat_menu_id= #{wechatMenuId}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/store/IWechatMenuV1InnerServiceSMO.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.wechatMenu.WechatMenuDto;
+import com.java110.po.wechatMenu.WechatMenuPo;
+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-07-29 11:48:22 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("/wechatMenuV1Api")
+public interface IWechatMenuV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveWechatMenu", method = RequestMethod.POST)
+    public int saveWechatMenu(@RequestBody  WechatMenuPo wechatMenuPo);
+
+    @RequestMapping(value = "/updateWechatMenu", method = RequestMethod.POST)
+    public int updateWechatMenu(@RequestBody  WechatMenuPo wechatMenuPo);
+
+    @RequestMapping(value = "/deleteWechatMenu", method = RequestMethod.POST)
+    public int deleteWechatMenu(@RequestBody  WechatMenuPo wechatMenuPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param wechatMenuDto 数据对象分享
+     * @return WechatMenuDto 对象数据
+     */
+    @RequestMapping(value = "/queryWechatMenus", method = RequestMethod.POST)
+    List<WechatMenuDto> queryWechatMenus(@RequestBody WechatMenuDto wechatMenuDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param wechatMenuDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryWechatMenusCount", method = RequestMethod.POST)
+    int queryWechatMenusCount(@RequestBody WechatMenuDto wechatMenuDto);
+}

+ 0 - 49
service-api/src/main/java/com/java110/api/listener/smallWeChat/DeleteWechatMenuListener.java

@@ -1,49 +0,0 @@
-package com.java110.api.listener.smallWeChat;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.smallWeChat.IWechatMenuBMO;
-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.ServiceCodeWechatMenuConstant;
-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("deleteWechatMenuListener")
-public class DeleteWechatMenuListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IWechatMenuBMO wechatMenuBMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
-        Assert.hasKeyAndValue(reqJson, "wechatMenuId", "wechatMenuId不能为空");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        wechatMenuBMOImpl.deleteWechatMenu(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeWechatMenuConstant.DELETE_WECHATMENU;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-}

+ 0 - 84
service-api/src/main/java/com/java110/api/listener/smallWeChat/ListWechatMenusListener.java

@@ -1,84 +0,0 @@
-package com.java110.api.listener.smallWeChat;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.intf.store.IWechatMenuInnerServiceSMO;
-import com.java110.dto.wechatMenu.WechatMenuDto;
-import com.java110.utils.constant.ServiceCodeWechatMenuConstant;
-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.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 查询小区侦听类
- */
-@Java110Listener("listWechatMenusListener")
-public class ListWechatMenusListener extends AbstractServiceApiListener {
-
-    @Autowired
-    private IWechatMenuInnerServiceSMO wechatMenuInnerServiceSMOImpl;
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeWechatMenuConstant.LIST_WECHATMENUS;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.GET;
-    }
-
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-
-    public IWechatMenuInnerServiceSMO getWechatMenuInnerServiceSMOImpl() {
-        return wechatMenuInnerServiceSMOImpl;
-    }
-
-    public void setWechatMenuInnerServiceSMOImpl(IWechatMenuInnerServiceSMO wechatMenuInnerServiceSMOImpl) {
-        this.wechatMenuInnerServiceSMOImpl = wechatMenuInnerServiceSMOImpl;
-    }
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        super.validatePageInfo(reqJson);
-        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区ID");
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        WechatMenuDto wechatMenuDto = BeanConvertUtil.covertBean(reqJson, WechatMenuDto.class);
-
-        int count = wechatMenuInnerServiceSMOImpl.queryWechatMenusCount(wechatMenuDto);
-
-        List<WechatMenuDto> wechatMenuDtos = null;
-
-        if (count > 0) {
-            wechatMenuDtos = wechatMenuInnerServiceSMOImpl.queryWechatMenus(wechatMenuDto);
-        } else {
-            wechatMenuDtos = new ArrayList<>();
-        }
-
-        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, wechatMenuDtos);
-
-        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
-
-        context.setResponseEntity(responseEntity);
-
-    }
-}

+ 0 - 91
service-api/src/main/java/com/java110/api/listener/smallWeChat/SaveWechatMenuListener.java

@@ -1,91 +0,0 @@
-package com.java110.api.listener.smallWeChat;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.smallWeChat.IWechatMenuBMO;
-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.store.IWechatMenuInnerServiceSMO;
-import com.java110.dto.wechatMenu.WechatMenuDto;
-import com.java110.utils.constant.ServiceCodeWechatMenuConstant;
-import com.java110.utils.util.Assert;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-
-import java.util.List;
-
-/**
- * 保存商户侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("saveWechatMenuListener")
-public class SaveWechatMenuListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IWechatMenuBMO wechatMenuBMOImpl;
-
-    @Autowired
-    private IWechatMenuInnerServiceSMO wechatMenuInnerServiceSMOImpl;
-
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
-        Assert.hasKeyAndValue(reqJson, "menuName", "请求报文中未包含menuName");
-        Assert.hasKeyAndValue(reqJson, "menuType", "请求报文中未包含menuType");
-        Assert.hasKeyAndValue(reqJson, "menuLevel", "请求报文中未包含menuLevel");
-        //Assert.hasKeyAndValue(reqJson, "menuValue", "请求报文中未包含menuValue");
-        Assert.hasKeyAndValue(reqJson, "seq", "请求报文中未包含顺序");
-        Assert.isInteger(reqJson.getString("seq"),"顺序不是有效数字");
-        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
-        String menuName = reqJson.getString("menuName");
-
-        if (WechatMenuDto.MENU_LEVEL_ONE.equals(reqJson.getString("menuLevel"))) {
-            // 名字不能超过
-            if (menuName.length() > 4 && menuName.length() < 1) {
-                throw new IllegalArgumentException("一级菜单必须1至4位");
-            }
-            //查询 一级菜单是否操作3个
-            WechatMenuDto wechatMenuDto = new WechatMenuDto();
-            wechatMenuDto.setCommunityId(reqJson.getString("communityId"));
-            wechatMenuDto.setMenuLevel(reqJson.getString("menuLevel"));
-            List<WechatMenuDto> wechatMenuDtos = wechatMenuInnerServiceSMOImpl.queryWechatMenus(wechatMenuDto);
-            if(wechatMenuDtos.size() > 2){
-                throw new IllegalArgumentException("一级菜单最多3个");
-            }
-        } else {
-            Assert.hasKeyAndValue(reqJson, "parentMenuId", "未包含一级菜单信息");
-            if (menuName.length() > 7 && menuName.length() < 1) {
-                throw new IllegalArgumentException("二级菜单必须1至7位");
-            }
-
-            WechatMenuDto wechatMenuDto = new WechatMenuDto();
-            wechatMenuDto.setCommunityId(reqJson.getString("communityId"));
-            wechatMenuDto.setMenuLevel(reqJson.getString("menuLevel"));
-            wechatMenuDto.setParentMenuId(reqJson.getString("parentMenuId"));
-            List<WechatMenuDto> wechatMenuDtos = wechatMenuInnerServiceSMOImpl.queryWechatMenus(wechatMenuDto);
-            if(wechatMenuDtos.size() > 4){
-                throw new IllegalArgumentException("二级菜单最多5个");
-            }
-        }
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-        wechatMenuBMOImpl.addWechatMenu(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeWechatMenuConstant.ADD_WECHATMENU;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-}

+ 0 - 69
service-api/src/main/java/com/java110/api/listener/smallWeChat/UpdateWechatMenuListener.java

@@ -1,69 +0,0 @@
-package com.java110.api.listener.smallWeChat;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.smallWeChat.IWechatMenuBMO;
-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.wechatMenu.WechatMenuDto;
-import com.java110.utils.constant.ServiceCodeWechatMenuConstant;
-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("updateWechatMenuListener")
-public class UpdateWechatMenuListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IWechatMenuBMO wechatMenuBMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-
-        Assert.hasKeyAndValue(reqJson, "wechatMenuId", "wechatMenuId不能为空");
-        Assert.hasKeyAndValue(reqJson, "menuName", "请求报文中未包含menuName");
-        Assert.hasKeyAndValue(reqJson, "menuType", "请求报文中未包含menuType");
-        Assert.hasKeyAndValue(reqJson, "menuLevel", "请求报文中未包含menuLevel");
-        Assert.hasKeyAndValue(reqJson, "seq", "请求报文中未包含顺序");
-        Assert.isInteger(reqJson.getString("seq"),"顺序不是有效数字");
-        //Assert.hasKeyAndValue(reqJson, "menuValue", "请求报文中未包含menuValue");
-        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
-
-        String menuName = reqJson.getString("menuName");
-
-        if (WechatMenuDto.MENU_LEVEL_ONE.equals(reqJson.getString("menuLevel"))) {
-            // 名字不能超过
-            if (menuName.length() > 4 && menuName.length() < 1) {
-                throw new IllegalArgumentException("一级菜单必须1至4位");
-            }
-        } else {
-            Assert.hasKeyAndValue(reqJson, "parentMenuId", "未包含一级菜单信息");
-            if (menuName.length() > 7 && menuName.length() < 1) {
-                throw new IllegalArgumentException("二级菜单必须1至7位");
-            }
-        }
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        wechatMenuBMOImpl.updateWechatMenu(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeWechatMenuConstant.UPDATE_WECHATMENU;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-}

+ 71 - 0
service-store/src/main/java/com/java110/store/cmd/wechatMenu/DeleteWechatMenuCmd.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.wechatMenu;
+
+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.IWechatMenuV1InnerServiceSMO;
+import com.java110.po.wechatMenu.WechatMenuPo;
+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;
+
+/**
+ * 类表述:删除
+ * 服务编码:wechatMenu.deleteWechatMenu
+ * 请求路劲:/app/wechatMenu.DeleteWechatMenu
+ * add by 吴学文 at 2022-07-29 11:48:22 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 = "smallWeChat.deleteWechatMenu")
+public class DeleteWechatMenuCmd extends Cmd {
+    private static Logger logger = LoggerFactory.getLogger(DeleteWechatMenuCmd.class);
+
+    @Autowired
+    private IWechatMenuV1InnerServiceSMO wechatMenuV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "wechatMenuId", "wechatMenuId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        WechatMenuPo wechatMenuPo = BeanConvertUtil.covertBean(reqJson, WechatMenuPo.class);
+        int flag = wechatMenuV1InnerServiceSMOImpl.deleteWechatMenu(wechatMenuPo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 80 - 0
service-store/src/main/java/com/java110/store/cmd/wechatMenu/ListWechatMenusCmd.java

@@ -0,0 +1,80 @@
+/*
+ * 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.wechatMenu;
+
+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.IWechatMenuV1InnerServiceSMO;
+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.wechatMenu.WechatMenuDto;
+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;
+
+
+/**
+ * 类表述:查询
+ * 服务编码:wechatMenu.listWechatMenu
+ * 请求路劲:/app/wechatMenu.ListWechatMenu
+ * add by 吴学文 at 2022-07-29 11:48:22 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 = "smallWeChat.listWechatMenus")
+public class ListWechatMenusCmd extends Cmd {
+
+  private static Logger logger = LoggerFactory.getLogger(ListWechatMenusCmd.class);
+    @Autowired
+    private IWechatMenuV1InnerServiceSMO wechatMenuV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+           WechatMenuDto wechatMenuDto = BeanConvertUtil.covertBean(reqJson, WechatMenuDto.class);
+
+           int count = wechatMenuV1InnerServiceSMOImpl.queryWechatMenusCount(wechatMenuDto);
+
+           List<WechatMenuDto> wechatMenuDtos = null;
+
+           if (count > 0) {
+               wechatMenuDtos = wechatMenuV1InnerServiceSMOImpl.queryWechatMenus(wechatMenuDto);
+           } else {
+               wechatMenuDtos = new ArrayList<>();
+           }
+
+           ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, wechatMenuDtos);
+
+           ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+           cmdDataFlowContext.setResponseEntity(responseEntity);
+    }
+}

+ 14 - 35
service-api/src/main/java/com/java110/api/listener/smallWeChat/PublishWechatMenuListener.java

@@ -1,38 +1,30 @@
-package com.java110.api.listener.smallWeChat;
+package com.java110.store.cmd.wechatMenu;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.smallWeChat.IWechatMenuBMO;
-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.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.WechatFactory;
-import com.java110.intf.store.ISmallWeChatInnerServiceSMO;
-import com.java110.intf.store.IWechatMenuInnerServiceSMO;
 import com.java110.dto.smallWeChat.SmallWeChatDto;
 import com.java110.dto.wechatMenu.WechatMenuDto;
-import com.java110.utils.constant.ServiceCodeWechatMenuConstant;
+import com.java110.intf.store.ISmallWeChatInnerServiceSMO;
+import com.java110.intf.store.IWechatMenuInnerServiceSMO;
 import com.java110.utils.constant.WechatConstant;
+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.springframework.http.HttpMethod;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.client.RestTemplate;
 
 import java.util.List;
 
-/**
- * 保存商户侦听
- * add by wuxw 2019-06-30
- */
-@Java110Listener("publishWechatMenuListener")
-public class PublishWechatMenuListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IWechatMenuBMO wechatMenuBMOImpl;
+@Java110Cmd(serviceCode = "smallWeChat.publicWechatMenu")
+public class PublishWechatMenuCmd extends Cmd {
 
     @Autowired
     private RestTemplate outRestTemplate;
@@ -43,13 +35,11 @@ public class PublishWechatMenuListener extends AbstractServiceApiPlusListener {
     @Autowired
     private ISmallWeChatInnerServiceSMO smallWeChatInnerServiceSMOImpl;
 
-
     @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
         Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
     }
-
     /**
      * {
      * "button":[
@@ -86,8 +76,8 @@ public class PublishWechatMenuListener extends AbstractServiceApiPlusListener {
      * @param reqJson 请求报文
      */
     @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-        //查询一级菜单
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+//查询一级菜单
         WechatMenuDto wechatMenuDto = BeanConvertUtil.covertBean(reqJson, WechatMenuDto.class);
         wechatMenuDto.setMenuLevel(WechatMenuDto.MENU_LEVEL_ONE);
         List<WechatMenuDto> wechatMenuDtos = wechatMenuInnerServiceSMOImpl.queryWechatMenus(wechatMenuDto);
@@ -157,15 +147,4 @@ public class PublishWechatMenuListener extends AbstractServiceApiPlusListener {
         }
         wechatMenuObj.put("sub_button", subButtons);
     }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeWechatMenuConstant.PUBLIC_WECHATMENU;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
 }

+ 118 - 0
service-store/src/main/java/com/java110/store/cmd/wechatMenu/SaveWechatMenuCmd.java

@@ -0,0 +1,118 @@
+/*
+ * 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.wechatMenu;
+
+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.wechatMenu.WechatMenuDto;
+import com.java110.intf.store.IWechatMenuInnerServiceSMO;
+import com.java110.intf.store.IWechatMenuV1InnerServiceSMO;
+import com.java110.po.wechatMenu.WechatMenuPo;
+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;
+
+import java.util.List;
+
+/**
+ * 类表述:保存
+ * 服务编码:wechatMenu.saveWechatMenu
+ * 请求路劲:/app/wechatMenu.SaveWechatMenu
+ * add by 吴学文 at 2022-07-29 11:48:22 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 = "smallWeChat.saveWechatMenu")
+public class SaveWechatMenuCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveWechatMenuCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private IWechatMenuV1InnerServiceSMO wechatMenuV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IWechatMenuInnerServiceSMO wechatMenuInnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "menuName", "请求报文中未包含menuName");
+        Assert.hasKeyAndValue(reqJson, "menuType", "请求报文中未包含menuType");
+        Assert.hasKeyAndValue(reqJson, "menuLevel", "请求报文中未包含menuLevel");
+        //Assert.hasKeyAndValue(reqJson, "menuValue", "请求报文中未包含menuValue");
+        Assert.hasKeyAndValue(reqJson, "seq", "请求报文中未包含顺序");
+        Assert.isInteger(reqJson.getString("seq"),"顺序不是有效数字");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+        String menuName = reqJson.getString("menuName");
+
+        if (WechatMenuDto.MENU_LEVEL_ONE.equals(reqJson.getString("menuLevel"))) {
+            // 名字不能超过
+            if (menuName.length() > 4 && menuName.length() < 1) {
+                throw new IllegalArgumentException("一级菜单必须1至4位");
+            }
+            //查询 一级菜单是否操作3个
+            WechatMenuDto wechatMenuDto = new WechatMenuDto();
+            wechatMenuDto.setCommunityId(reqJson.getString("communityId"));
+            wechatMenuDto.setMenuLevel(reqJson.getString("menuLevel"));
+            List<WechatMenuDto> wechatMenuDtos = wechatMenuInnerServiceSMOImpl.queryWechatMenus(wechatMenuDto);
+            if(wechatMenuDtos.size() > 2){
+                throw new IllegalArgumentException("一级菜单最多3个");
+            }
+        } else {
+            Assert.hasKeyAndValue(reqJson, "parentMenuId", "未包含一级菜单信息");
+            if (menuName.length() > 7 && menuName.length() < 1) {
+                throw new IllegalArgumentException("二级菜单必须1至7位");
+            }
+
+            WechatMenuDto wechatMenuDto = new WechatMenuDto();
+            wechatMenuDto.setCommunityId(reqJson.getString("communityId"));
+            wechatMenuDto.setMenuLevel(reqJson.getString("menuLevel"));
+            wechatMenuDto.setParentMenuId(reqJson.getString("parentMenuId"));
+            List<WechatMenuDto> wechatMenuDtos = wechatMenuInnerServiceSMOImpl.queryWechatMenus(wechatMenuDto);
+            if(wechatMenuDtos.size() > 4){
+                throw new IllegalArgumentException("二级菜单最多5个");
+            }
+        }
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        WechatMenuPo wechatMenuPo = BeanConvertUtil.covertBean(reqJson, WechatMenuPo.class);
+        wechatMenuPo.setWechatMenuId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+        int flag = wechatMenuV1InnerServiceSMOImpl.saveWechatMenu(wechatMenuPo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 96 - 0
service-store/src/main/java/com/java110/store/cmd/wechatMenu/UpdateWechatMenuCmd.java

@@ -0,0 +1,96 @@
+/*
+ * 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.wechatMenu;
+
+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.wechatMenu.WechatMenuDto;
+import com.java110.intf.store.IWechatMenuV1InnerServiceSMO;
+import com.java110.po.wechatMenu.WechatMenuPo;
+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;
+
+
+/**
+ * 类表述:更新
+ * 服务编码:wechatMenu.updateWechatMenu
+ * 请求路劲:/app/wechatMenu.UpdateWechatMenu
+ * add by 吴学文 at 2022-07-29 11:48:22 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 = "smallWeChat.updateWechatMenu")
+public class UpdateWechatMenuCmd extends Cmd {
+
+  private static Logger logger = LoggerFactory.getLogger(UpdateWechatMenuCmd.class);
+
+
+    @Autowired
+    private IWechatMenuV1InnerServiceSMO wechatMenuV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "wechatMenuId", "wechatMenuId不能为空");
+        Assert.hasKeyAndValue(reqJson, "menuName", "请求报文中未包含menuName");
+        Assert.hasKeyAndValue(reqJson, "menuType", "请求报文中未包含menuType");
+        Assert.hasKeyAndValue(reqJson, "menuLevel", "请求报文中未包含menuLevel");
+        Assert.hasKeyAndValue(reqJson, "seq", "请求报文中未包含顺序");
+        Assert.isInteger(reqJson.getString("seq"),"顺序不是有效数字");
+        //Assert.hasKeyAndValue(reqJson, "menuValue", "请求报文中未包含menuValue");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+
+        String menuName = reqJson.getString("menuName");
+
+        if (WechatMenuDto.MENU_LEVEL_ONE.equals(reqJson.getString("menuLevel"))) {
+            // 名字不能超过
+            if (menuName.length() > 4 && menuName.length() < 1) {
+                throw new IllegalArgumentException("一级菜单必须1至4位");
+            }
+        } else {
+            Assert.hasKeyAndValue(reqJson, "parentMenuId", "未包含一级菜单信息");
+            if (menuName.length() > 7 && menuName.length() < 1) {
+                throw new IllegalArgumentException("二级菜单必须1至7位");
+            }
+        }
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+       WechatMenuPo wechatMenuPo = BeanConvertUtil.covertBean(reqJson, WechatMenuPo.class);
+        int flag = wechatMenuV1InnerServiceSMOImpl.updateWechatMenu(wechatMenuPo);
+
+        if (flag < 1) {
+            throw new CmdException("更新数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-store/src/main/java/com/java110/store/dao/IWechatMenuV1ServiceDao.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-07-29 11:48:22 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 IWechatMenuV1ServiceDao {
+
+
+    /**
+     * 保存 微信菜单信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveWechatMenuInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询微信菜单信息(instance过程)
+     * 根据bId 查询微信菜单信息
+     * @param info bId 信息
+     * @return 微信菜单信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getWechatMenuInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改微信菜单信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateWechatMenuInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询微信菜单总数
+     *
+     * @param info 微信菜单信息
+     * @return 微信菜单数量
+     */
+    int queryWechatMenusCount(Map info);
+
+}

+ 112 - 0
service-store/src/main/java/com/java110/store/dao/impl/WechatMenuV1ServiceDaoImpl.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.IWechatMenuV1ServiceDao;
+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-07-29 11:48:22 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("wechatMenuV1ServiceDaoImpl")
+public class WechatMenuV1ServiceDaoImpl extends BaseServiceDao implements IWechatMenuV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(WechatMenuV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存微信菜单信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveWechatMenuInfo(Map info) throws DAOException {
+        logger.debug("保存 saveWechatMenuInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("wechatMenuV1ServiceDaoImpl.saveWechatMenuInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询微信菜单信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getWechatMenuInfo(Map info) throws DAOException {
+        logger.debug("查询 getWechatMenuInfo 入参 info : {}",info);
+
+        List<Map> businessWechatMenuInfos = sqlSessionTemplate.selectList("wechatMenuV1ServiceDaoImpl.getWechatMenuInfo",info);
+
+        return businessWechatMenuInfos;
+    }
+
+
+    /**
+     * 修改微信菜单信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateWechatMenuInfo(Map info) throws DAOException {
+        logger.debug("修改 updateWechatMenuInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("wechatMenuV1ServiceDaoImpl.updateWechatMenuInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询微信菜单数量
+     * @param info 微信菜单信息
+     * @return 微信菜单数量
+     */
+    @Override
+    public int queryWechatMenusCount(Map info) {
+        logger.debug("查询 queryWechatMenusCount 入参 info : {}",info);
+
+        List<Map> businessWechatMenuInfos = sqlSessionTemplate.selectList("wechatMenuV1ServiceDaoImpl.queryWechatMenusCount", info);
+        if (businessWechatMenuInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessWechatMenuInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-store/src/main/java/com/java110/store/smo/impl/WechatMenuV1InnerServiceSMOImpl.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.IWechatMenuV1ServiceDao;
+import com.java110.intf.store.IWechatMenuV1InnerServiceSMO;
+import com.java110.dto.wechatMenu.WechatMenuDto;
+import com.java110.po.wechatMenu.WechatMenuPo;
+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-07-29 11:48:22 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 WechatMenuV1InnerServiceSMOImpl extends BaseServiceSMO implements IWechatMenuV1InnerServiceSMO {
+
+    @Autowired
+    private IWechatMenuV1ServiceDao wechatMenuV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveWechatMenu(@RequestBody  WechatMenuPo wechatMenuPo) {
+        int saveFlag = wechatMenuV1ServiceDaoImpl.saveWechatMenuInfo(BeanConvertUtil.beanCovertMap(wechatMenuPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateWechatMenu(@RequestBody  WechatMenuPo wechatMenuPo) {
+        int saveFlag = wechatMenuV1ServiceDaoImpl.updateWechatMenuInfo(BeanConvertUtil.beanCovertMap(wechatMenuPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteWechatMenu(@RequestBody  WechatMenuPo wechatMenuPo) {
+       wechatMenuPo.setStatusCd("1");
+       int saveFlag = wechatMenuV1ServiceDaoImpl.updateWechatMenuInfo(BeanConvertUtil.beanCovertMap(wechatMenuPo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<WechatMenuDto> queryWechatMenus(@RequestBody  WechatMenuDto wechatMenuDto) {
+
+        //校验是否传了 分页信息
+
+        int page = wechatMenuDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            wechatMenuDto.setPage((page - 1) * wechatMenuDto.getRow());
+        }
+
+        List<WechatMenuDto> wechatMenus = BeanConvertUtil.covertBeanList(wechatMenuV1ServiceDaoImpl.getWechatMenuInfo(BeanConvertUtil.beanCovertMap(wechatMenuDto)), WechatMenuDto.class);
+
+        return wechatMenus;
+    }
+
+
+    @Override
+    public int queryWechatMenusCount(@RequestBody WechatMenuDto wechatMenuDto) {
+        return wechatMenuV1ServiceDaoImpl.queryWechatMenusCount(BeanConvertUtil.beanCovertMap(wechatMenuDto));    }
+
+}