Browse Source

优化 部分查询失败问题

java110 4 years ago
parent
commit
d5f038b1dc
27 changed files with 733 additions and 110 deletions
  1. 80 64
      java110-bean/src/main/java/com/java110/po/user/UserPo.java
  2. 165 0
      java110-db/src/main/resources/mapper/user/UserV1ServiceDaoImplMapper.xml
  3. 25 23
      java110-generator/src/main/resources/newBack/template_1.json
  4. 2 2
      java110-generator/src/main/resources/newTemplate/DeleteCmd.txt
  5. 1 1
      java110-generator/src/main/resources/newTemplate/IInnerServiceSMO.txt
  6. 2 2
      java110-generator/src/main/resources/newTemplate/ListCmd.txt
  7. 2 2
      java110-generator/src/main/resources/newTemplate/SaveCmd.txt
  8. 2 2
      java110-generator/src/main/resources/newTemplate/UpdateCmd.txt
  9. 68 0
      java110-interface/src/main/java/com/java110/intf/user/IUserV1InnerServiceSMO.java
  10. 2 1
      service-api/src/main/java/com/java110/api/components/activities/AddActivitiesViewComponent.java
  11. 1 1
      service-api/src/main/java/com/java110/api/components/community/AuditCommunityManageComponent.java
  12. 2 1
      service-api/src/main/java/com/java110/api/components/community/AuditEnterCommunityManageComponent.java
  13. 1 1
      service-api/src/main/java/com/java110/api/components/floor/BatchAddFloorComponent.java
  14. 2 1
      service-api/src/main/java/com/java110/api/components/machine/MachineRecordManageComponent.java
  15. 2 1
      service-api/src/main/java/com/java110/api/components/machine/MachineVistorPhotoManageComponent.java
  16. 2 1
      service-api/src/main/java/com/java110/api/components/notice/AddNoticeViewComponent.java
  17. 3 1
      service-api/src/main/java/com/java110/api/components/org/AddOrgComponent.java
  18. 3 1
      service-api/src/main/java/com/java110/api/components/org/EditOrgComponent.java
  19. 2 1
      service-api/src/main/java/com/java110/api/controller/app/AdminController.java
  20. 2 1
      service-api/src/main/java/com/java110/api/controller/app/ComplaintController.java
  21. 1 1
      service-api/src/main/java/com/java110/api/controller/app/PaymentController.java
  22. 12 2
      service-api/src/main/java/com/java110/api/smo/AppAbstractComponentSMO.java
  23. 18 0
      service-api/src/main/java/com/java110/api/smo/DefaultAbstractComponentSMO.java
  24. 55 0
      service-user/src/main/java/com/java110/user/cmd/register/UserRegisterServiceCmd.java
  25. 77 0
      service-user/src/main/java/com/java110/user/dao/IUserV1ServiceDao.java
  26. 112 0
      service-user/src/main/java/com/java110/user/dao/impl/UserV1ServiceDaoImpl.java
  27. 89 0
      service-user/src/main/java/com/java110/user/smo/impl/UserV1InnerServiceSMOImpl.java

+ 80 - 64
java110-bean/src/main/java/com/java110/po/user/UserPo.java

@@ -1,76 +1,84 @@
+/*
+ * 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.po.user;
 
 import java.io.Serializable;
 
 /**
- * @ClassName UserPo
- * @Description TODO
- * @Author wuxw
- * @Date 2020/5/30 13:03
- * @Version 1.0
- * add by wuxw 2020/5/30
- **/
+ * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
+ * add by 吴学文 at 2021-09-13 08:40:33 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 class UserPo implements Serializable {
-    private String id;
-    private String userId;
-    private String name;
-    private String email;
+
     private String address;
-    private String password;
-    private String locationCd;
-    private String age;
     private String sex;
-    private String tel;
-    private String levelCd;
     private String statusCd = "0";
+    private String userId;
+    private String levelCd;
+    private String locationCd;
     private String score;
+    private String password;
+    private String name;
+    private String tel;
+    private String email;
+    private String age;
+    private String bId;
 
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getUserId() {
-        return userId;
+    public String getAddress() {
+        return address;
     }
 
-    public void setUserId(String userId) {
-        this.userId = userId;
+    public void setAddress(String address) {
+        this.address = address;
     }
 
-    public String getName() {
-        return name;
+    public String getSex() {
+        return sex;
     }
 
-    public void setName(String name) {
-        this.name = name;
+    public void setSex(String sex) {
+        this.sex = sex;
     }
 
-    public String getEmail() {
-        return email;
+    public String getStatusCd() {
+        return statusCd;
     }
 
-    public void setEmail(String email) {
-        this.email = email;
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
     }
 
-    public String getAddress() {
-        return address;
+    public String getUserId() {
+        return userId;
     }
 
-    public void setAddress(String address) {
-        this.address = address;
+    public void setUserId(String userId) {
+        this.userId = userId;
     }
 
-    public String getPassword() {
-        return password;
+    public String getLevelCd() {
+        return levelCd;
     }
 
-    public void setPassword(String password) {
-        this.password = password;
+    public void setLevelCd(String levelCd) {
+        this.levelCd = levelCd;
     }
 
     public String getLocationCd() {
@@ -81,20 +89,28 @@ public class UserPo implements Serializable {
         this.locationCd = locationCd;
     }
 
-    public String getAge() {
-        return age;
+    public String getScore() {
+        return score;
     }
 
-    public void setAge(String age) {
-        this.age = age;
+    public void setScore(String score) {
+        this.score = score;
     }
 
-    public String getSex() {
-        return sex;
+    public String getPassword() {
+        return password;
     }
 
-    public void setSex(String sex) {
-        this.sex = sex;
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
     }
 
     public String getTel() {
@@ -105,27 +121,27 @@ public class UserPo implements Serializable {
         this.tel = tel;
     }
 
-    public String getLevelCd() {
-        return levelCd;
+    public String getEmail() {
+        return email;
     }
 
-    public void setLevelCd(String levelCd) {
-        this.levelCd = levelCd;
+    public void setEmail(String email) {
+        this.email = email;
     }
 
-    public String getStatusCd() {
-        return statusCd;
+    public String getAge() {
+        return age;
     }
 
-    public void setStatusCd(String statusCd) {
-        this.statusCd = statusCd;
+    public void setAge(String age) {
+        this.age = age;
     }
 
-    public String getScore() {
-        return score;
+    public String getbId() {
+        return bId;
     }
 
-    public void setScore(String score) {
-        this.score = score;
+    public void setbId(String bId) {
+        this.bId = bId;
     }
 }

+ 165 - 0
java110-db/src/main/resources/mapper/user/UserV1ServiceDaoImplMapper.xml

@@ -0,0 +1,165 @@
+<?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="userV1ServiceDaoImpl">
+
+
+    <!-- 保存用户信息 add by wuxw 2018-07-03 -->
+    <insert id="saveUserInfo" parameterType="Map">
+        insert into u_user(
+        address,sex,user_id,level_cd,location_cd,score,password,name,tel,b_id,email,age
+        ) values (
+        #{address},#{sex},#{userId},#{levelCd},#{locationCd},#{score},#{password},#{name},#{tel},#{bId},#{email},#{age}
+        )
+    </insert>
+
+
+    <!-- 查询用户信息 add by wuxw 2018-07-03 -->
+    <select id="getUserInfo" parameterType="Map" resultType="Map">
+        select t.address,t.sex,t.status_cd,t.status_cd statusCd,t.user_id,t.user_id userId,t.level_cd,t.level_cd
+        levelCd,t.location_cd,t.location_cd locationCd,t.score,t.password,t.name,t.tel,t.b_id,t.b_id bId,t.email,t.age
+        from u_user t
+        where 1 =1
+        <if test="address !=null and address != ''">
+            and t.address= #{address}
+        </if>
+        <if test="sex !=null and sex != ''">
+            and t.sex= #{sex}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </if>
+        <if test="levelCd !=null and levelCd != ''">
+            and t.level_cd= #{levelCd}
+        </if>
+        <if test="locationCd !=null and locationCd != ''">
+            and t.location_cd= #{locationCd}
+        </if>
+        <if test="score !=null and score != ''">
+            and t.score= #{score}
+        </if>
+        <if test="password !=null and password != ''">
+            and t.password= #{password}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="email !=null and email != ''">
+            and t.email= #{email}
+        </if>
+        <if test="age !=null and age != ''">
+            and t.age= #{age}
+        </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="updateUserInfo" parameterType="Map">
+        update u_user t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="address !=null and address != ''">
+            , t.address= #{address}
+        </if>
+        <if test="sex !=null and sex != ''">
+            , t.sex= #{sex}
+        </if>
+        <if test="levelCd !=null and levelCd != ''">
+            , t.level_cd= #{levelCd}
+        </if>
+        <if test="locationCd !=null and locationCd != ''">
+            , t.location_cd= #{locationCd}
+        </if>
+        <if test="score !=null and score != ''">
+            , t.score= #{score}
+        </if>
+        <if test="password !=null and password != ''">
+            , t.password= #{password}
+        </if>
+        <if test="name !=null and name != ''">
+            , t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            , t.tel= #{tel}
+        </if>
+        <if test="email !=null and email != ''">
+            , t.email= #{email}
+        </if>
+        <if test="age !=null and age != ''">
+            , t.age= #{age}
+        </if>
+        where 1=1
+        <if test="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+
+    </update>
+
+    <!-- 查询用户数量 add by wuxw 2018-07-03 -->
+    <select id="queryUsersCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from u_user t
+        where 1 =1
+        <if test="address !=null and address != ''">
+            and t.address= #{address}
+        </if>
+        <if test="sex !=null and sex != ''">
+            and t.sex= #{sex}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </if>
+        <if test="levelCd !=null and levelCd != ''">
+            and t.level_cd= #{levelCd}
+        </if>
+        <if test="locationCd !=null and locationCd != ''">
+            and t.location_cd= #{locationCd}
+        </if>
+        <if test="score !=null and score != ''">
+            and t.score= #{score}
+        </if>
+        <if test="password !=null and password != ''">
+            and t.password= #{password}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="email !=null and email != ''">
+            and t.email= #{email}
+        </if>
+        <if test="age !=null and age != ''">
+            and t.age= #{age}
+        </if>
+
+
+    </select>
+
+</mapper>

+ 25 - 23
java110-generator/src/main/resources/newBack/template_1.json

@@ -1,37 +1,39 @@
 {
   "autoMove": true,
-  "id": "hisId",
-  "name": "businessTableHis",
-  "desc": "订单轨迹",
-  "shareParam": "hisId",
-  "shareColumn": "his_id",
-  "shareName": "dev",
-  "tableName": "c_business_table_his",
+  "id": "userId",
+  "name": "user",
+  "desc": "用户",
+  "shareParam": "userId",
+  "shareColumn": "user_id",
+  "shareName": "user",
+  "tableName": "u_user",
   "param": {
-    "hisId": "his_id",
-    "action": "action",
-    "actionObj": "action_obj",
-    "actionObjHis": "action_obj_his",
-    "businessTypeCd": "business_type_cd",
-    "remark": "remark",
+    "userId": "user_id",
+    "name": "name",
+    "email": "email",
+    "address": "address",
+    "password": "password",
+    "locationCd": "location_cd",
+    "age": "age",
+    "sex": "sex",
+    "tel": "tel",
+    "levelCd": "level_cd",
+    "bId": "b_id",
+    "score": "score",
     "statusCd": "status_cd"
   },
   "required": [
     {
-      "code": "action",
-      "msg": "动作不能为空"
+      "code": "name",
+      "msg": "用户名称不能为空"
     },
     {
-      "code": "actionObj",
-      "msg": "动作对象不能为空"
+      "code": "password",
+      "msg": "密码不能为空"
     },
     {
-      "code": "actionObjHis",
-      "msg": "轨迹表不能为空"
-    },
-    {
-      "code": "businessTypeCd",
-      "msg": "业务编码"
+      "code": "tel",
+      "msg": "手机号不能为空"
     }
   ]
 }

+ 2 - 2
java110-generator/src/main/resources/newTemplate/DeleteCmd.txt

@@ -22,8 +22,8 @@ import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.AbstractServiceCmdListener;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.intf.dev.IBusinessTableHisV1InnerServiceSMO;
-import com.java110.po.businessTableHis.BusinessTableHisPo;
+import com.java110.intf.dev.I@@TemplateCode@@V1InnerServiceSMO;
+import com.java110.po.@@templateCode@@.@@TemplateCode@@Po;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;

+ 1 - 1
java110-generator/src/main/resources/newTemplate/IInnerServiceSMO.txt

@@ -34,7 +34,7 @@ import java.util.List;
  * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
  */
 @FeignClient(name = "@@shareName@@-service", configuration = {FeignConfiguration.class})
-@RequestMapping("/storeApi")
+@RequestMapping("/storeV1Api")
 public interface IStoreV1InnerServiceSMO {
 
 

+ 2 - 2
java110-generator/src/main/resources/newTemplate/ListCmd.txt

@@ -22,8 +22,8 @@ import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.AbstractServiceCmdListener;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.intf.dev.IBusinessTableHisV1InnerServiceSMO;
-import com.java110.po.businessTableHis.BusinessTableHisPo;
+import com.java110.intf.dev.I@@TemplateCode@@V1InnerServiceSMO;
+import com.java110.po.@@templateCode@@.@@TemplateCode@@Po;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;

+ 2 - 2
java110-generator/src/main/resources/newTemplate/SaveCmd.txt

@@ -22,8 +22,8 @@ import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.AbstractServiceCmdListener;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.intf.dev.IBusinessTableHisV1InnerServiceSMO;
-import com.java110.po.businessTableHis.BusinessTableHisPo;
+import com.java110.intf.dev.I@@TemplateCode@@V1InnerServiceSMO;
+import com.java110.po.@@templateCode@@.@@TemplateCode@@Po;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;

+ 2 - 2
java110-generator/src/main/resources/newTemplate/UpdateCmd.txt

@@ -22,8 +22,8 @@ import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.AbstractServiceCmdListener;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.intf.dev.IBusinessTableHisV1InnerServiceSMO;
-import com.java110.po.businessTableHis.BusinessTableHisPo;
+import com.java110.intf.dev.I@@TemplateCode@@V1InnerServiceSMO;
+import com.java110.po.@@templateCode@@.@@TemplateCode@@Po;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/user/IUserV1InnerServiceSMO.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.user;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.user.UserDto;
+import com.java110.po.user.UserPo;
+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 2021-09-13 08:40:33 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 = "user-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/userV1Api")
+public interface IUserV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveUser", method = RequestMethod.POST)
+    public int saveUser(@RequestBody  UserPo userPo);
+
+    @RequestMapping(value = "/updateUser", method = RequestMethod.POST)
+    public int updateUser(@RequestBody  UserPo userPo);
+
+    @RequestMapping(value = "/deleteUser", method = RequestMethod.POST)
+    public int deleteUser(@RequestBody  UserPo userPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param userDto 数据对象分享
+     * @return UserDto 对象数据
+     */
+    @RequestMapping(value = "/queryUsers", method = RequestMethod.POST)
+    List<UserDto> queryUsers(@RequestBody UserDto userDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param userDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryUsersCount", method = RequestMethod.POST)
+    int queryUsersCount(@RequestBody UserDto userDto);
+}

+ 2 - 1
service-api/src/main/java/com/java110/api/components/activities/AddActivitiesViewComponent.java

@@ -42,7 +42,8 @@ public class AddActivitiesViewComponent {
     public ResponseEntity<String> uploadImage(IPageData pd, MultipartFile uploadFile) throws Exception {
         JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
         paramIn.put("suffix", "jpeg");
-        IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(),pd.getToken(), paramIn.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId(),pd.getAppId());
+        IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(),pd.getToken(), paramIn.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "",
+                pd.getSessionId(),pd.getAppId(),pd.getHeaders());
         return addFileSMOImpl.saveFile(newPd, uploadFile);
     }
 

+ 1 - 1
service-api/src/main/java/com/java110/api/components/community/AuditCommunityManageComponent.java

@@ -40,7 +40,7 @@ public class AuditCommunityManageComponent {
         reqParam.put("state", StateConstant.NO_AUDIT);
 
         IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(), pd.getToken(),
-                reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId(),pd.getAppId());
+                reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId(),pd.getAppId(),pd.getHeaders());
 
         return listCommunitysSMOImpl.listCommunitys(newPd);
     }

+ 2 - 1
service-api/src/main/java/com/java110/api/components/community/AuditEnterCommunityManageComponent.java

@@ -39,7 +39,8 @@ public class AuditEnterCommunityManageComponent {
         //reqParam.put("auditStatusCd", StateConstant.NO_AUDIT);
 
         IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(), pd.getToken(),
-                reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId(),pd.getAppId());
+                reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(),
+                "", pd.getSessionId(),pd.getAppId(),pd.getHeaders());
 
         return listAuditEnterCommunitysSMOImpl.listAuditEnterCommunitys(newPd);
     }

+ 1 - 1
service-api/src/main/java/com/java110/api/components/floor/BatchAddFloorComponent.java

@@ -77,7 +77,7 @@ public class BatchAddFloorComponent {
                         pd.getToken(),
                         needReqParam.toJSONString(),
                         pd.getComponentCode(),
-                        pd.getComponentMethod(), "", pd.getSessionId(),pd.getAppId());
+                        pd.getComponentMethod(), "", pd.getSessionId(),pd.getAppId(),pd.getHeaders());
                 floorEntity = floorServiceSMOImpl.saveFloor(newPd);
 
                 if (floorEntity.getStatusCode() == HttpStatus.OK) {

+ 2 - 1
service-api/src/main/java/com/java110/api/components/machine/MachineRecordManageComponent.java

@@ -33,7 +33,8 @@ public class MachineRecordManageComponent {
         reqParam.put("recordTypeCd", "8888");
 
         IPageData newPd = PageData.newInstance().builder(pd.getUserId(),pd.getUserName(), pd.getToken(),
-                reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId(),pd.getAppId());
+                reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(),
+                "", pd.getSessionId(),pd.getAppId(),pd.getHeaders());
 
         return listMachineRecordsSMOImpl.listMachineRecords(newPd);
     }

+ 2 - 1
service-api/src/main/java/com/java110/api/components/machine/MachineVistorPhotoManageComponent.java

@@ -33,7 +33,8 @@ public class MachineVistorPhotoManageComponent {
         reqParam.put("recordTypeCd", "6666");
 
         IPageData newPd = PageData.newInstance().builder(pd.getUserId(),pd.getUserName(), pd.getToken(),
-                reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId(),pd.getAppId());
+                reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(),
+                "", pd.getSessionId(),pd.getAppId(),pd.getHeaders());
 
         return listMachineRecordsSMOImpl.listMachineRecords(newPd);
 

+ 2 - 1
service-api/src/main/java/com/java110/api/components/notice/AddNoticeViewComponent.java

@@ -41,7 +41,8 @@ public class AddNoticeViewComponent {
     public ResponseEntity<String> uploadImage(IPageData pd, MultipartFile uploadFile) throws Exception {
         JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
         paramIn.put("suffix", "jpeg");
-        IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(),pd.getToken(), paramIn.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId(),pd.getAppId());
+        IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(),pd.getToken(), paramIn.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(),
+                "", pd.getSessionId(),pd.getAppId(),pd.getHeaders());
         return addFileSMOImpl.saveFile(newPd, uploadFile);
     }
 

+ 3 - 1
service-api/src/main/java/com/java110/api/components/org/AddOrgComponent.java

@@ -48,7 +48,9 @@ public class AddOrgComponent {
                 pd.getUserName(), pd.getToken(),
                 paramIn.toJSONString(), pd.getComponentCode(),
                 pd.getComponentMethod(), "",
-                pd.getAppId());
+                pd.getSessionId(),
+                pd.getAppId(),
+                pd.getHeaders());
 
         return communityServiceSMOImpl.listMyCommunity(newPd);
 

+ 3 - 1
service-api/src/main/java/com/java110/api/components/org/EditOrgComponent.java

@@ -43,7 +43,9 @@ public class EditOrgComponent {
                 pd.getUserName(), pd.getToken(),
                 paramIn.toJSONString(), pd.getComponentCode(),
                 pd.getComponentMethod(), "",
-                pd.getAppId());
+                pd.getSessionId(),
+                pd.getAppId(),
+                pd.getHeaders());
 
         return communityServiceSMOImpl.listMyCommunity(newPd);
 

+ 2 - 1
service-api/src/main/java/com/java110/api/controller/app/AdminController.java

@@ -52,7 +52,8 @@ public class AdminController {
 
         IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(), pd.getToken(), pd.getReqData(),
                 "login", "", "", pd.getSessionId(),
-                pd.getAppId());
+                pd.getAppId(),
+                pd.getHeaders());
         ResponseEntity<String> responseEntity = adminLoginPropertyAccountServiceSMOImpl.doLogin(newPd);
         request.setAttribute(CommonConstant.CONTEXT_PAGE_DATA, newPd);
         return responseEntity;

+ 2 - 1
service-api/src/main/java/com/java110/api/controller/app/ComplaintController.java

@@ -63,7 +63,8 @@ public class ComplaintController extends BaseController {
         }
         IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(),pd.getToken(), postInfo,
                 "", "", "", pd.getSessionId(),
-                appId);
+                appId,
+                pd.getHeaders());
 
         return saveComplaintSMOImpl.save(newPd);
     }

+ 1 - 1
service-api/src/main/java/com/java110/api/controller/app/PaymentController.java

@@ -111,7 +111,7 @@ public class PaymentController extends BaseController {
 
         IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getUserName(), pd.getToken(), postInfo,
                 "", "", "", pd.getSessionId(),
-                appId);
+                appId,pd.getHeaders());
         return toPayOweFeeSMOImpl.toPay(newPd);
     }
 

+ 12 - 2
service-api/src/main/java/com/java110/api/smo/AppAbstractComponentSMO.java

@@ -69,8 +69,18 @@ public abstract class AppAbstractComponentSMO extends AbstractComponentSMO {
         if (!headers.containsKey(CommonConstant.HTTP_USER_ID)) {
             headers.put(CommonConstant.HTTP_USER_ID, StringUtil.isEmpty(pd.getUserId()) ? "-1" : pd.getUserId());
         }
-
-        headers.put(CommonConstant.USER_ID, StringUtil.isEmpty(pd.getUserId()) ? "-1" : pd.getUserId());
+        if (!headers.containsKey(CommonConstant.HTTP_APP_ID)) {
+            headers.put(CommonConstant.HTTP_APP_ID, pd.getAppId());
+        }
+        if (!headers.containsKey(CommonConstant.HTTP_TRANSACTION_ID)) {
+            headers.put(CommonConstant.HTTP_TRANSACTION_ID, pd.getTransactionId());
+        }
+        if (!headers.containsKey(CommonConstant.HTTP_REQ_TIME)) {
+            headers.put(CommonConstant.HTTP_REQ_TIME, pd.getRequestTime());
+        }
+        if (!headers.containsKey(CommonConstant.HTTP_SIGN)) {
+            headers.put(CommonConstant.HTTP_SIGN, "");
+        }
 
         if (url.indexOf("?") > -1) {
             url = url.substring(0, url.indexOf("?"));

+ 18 - 0
service-api/src/main/java/com/java110/api/smo/DefaultAbstractComponentSMO.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.java110.api.properties.WechatAuthProperties;
 import com.java110.core.component.AbstractComponentSMO;
 import com.java110.core.context.IPageData;
+import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.dto.basePrivilege.BasePrivilegeDto;
 import com.java110.entity.component.ComponentValidateResult;
 import com.java110.utils.cache.PrivilegeCache;
@@ -14,6 +15,7 @@ import com.java110.utils.constant.ServiceCodeConstant;
 import com.java110.utils.constant.ServiceConstant;
 import com.java110.utils.exception.SMOException;
 import com.java110.utils.util.Assert;
+import com.java110.utils.util.DateUtil;
 import com.java110.utils.util.StringUtil;
 import com.java110.utils.util.UrlParamToJsonUtil;
 import com.java110.vo.ResultVo;
@@ -83,6 +85,22 @@ public class DefaultAbstractComponentSMO extends AbstractComponentSMO {
 
         headers.put(CommonConstant.USER_ID, StringUtil.isEmpty(pd.getUserId()) ? "-1" : pd.getUserId());
 
+        if (!headers.containsKey(CommonConstant.HTTP_USER_ID)) {
+            headers.put(CommonConstant.HTTP_USER_ID, StringUtil.isEmpty(pd.getUserId()) ? "-1" : pd.getUserId());
+        }
+        if (!headers.containsKey(CommonConstant.HTTP_APP_ID)) {
+            headers.put(CommonConstant.HTTP_APP_ID, pd.getAppId());
+        }
+        if (!headers.containsKey(CommonConstant.HTTP_TRANSACTION_ID)) {
+            headers.put(CommonConstant.HTTP_TRANSACTION_ID, GenerateCodeFactory.getUUID());
+        }
+        if (!headers.containsKey(CommonConstant.HTTP_REQ_TIME)) {
+            headers.put(CommonConstant.HTTP_REQ_TIME, DateUtil.getNowDefault());
+        }
+        if (!headers.containsKey(CommonConstant.HTTP_SIGN)) {
+            headers.put(CommonConstant.HTTP_SIGN, "");
+        }
+
         if (url.indexOf("?") > -1) {
             url = url.substring(0, url.indexOf("?"));
         }

+ 55 - 0
service-user/src/main/java/com/java110/user/cmd/register/UserRegisterServiceCmd.java

@@ -0,0 +1,55 @@
+package com.java110.user.cmd.register;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.store.IStoreInnerServiceSMO;
+import com.java110.intf.user.IUserInnerServiceSMO;
+import com.java110.intf.user.IUserV1InnerServiceSMO;
+import com.java110.po.user.UserPo;
+import com.java110.utils.constant.UserLevelConstant;
+import com.java110.utils.exception.CmdException;
+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;
+
+/**
+ * 服务注册功能迁移
+ */
+@Java110Cmd(serviceCode = "user.service.register")
+public class UserRegisterServiceCmd extends AbstractServiceCmdListener {
+    private final static Logger logger = LoggerFactory.getLogger(UserRegisterServiceCmd.class);
+    @Autowired
+    private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IStoreInnerServiceSMO storeInnerServiceSMOImpl;
+
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
+    @Override
+    protected void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+
+    }
+
+    @Override
+    protected void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        reqJson.put("userId", "-1");
+        reqJson.put("levelCd", UserLevelConstant.USER_LEVEL_ADMIN);
+
+        UserPo userPo = BeanConvertUtil.covertBean(reqJson, UserPo.class);
+        userPo.setbId("-1");
+        int flag = userV1InnerServiceSMOImpl.saveUser(userPo);
+        if (flag < 1) {
+            throw new CmdException("注册失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-user/src/main/java/com/java110/user/dao/IUserV1ServiceDao.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.user.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 2021-09-13 08:40:33 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 IUserV1ServiceDao {
+
+
+    /**
+     * 保存 用户信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveUserInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询用户信息(instance过程)
+     * 根据bId 查询用户信息
+     * @param info bId 信息
+     * @return 用户信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getUserInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改用户信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateUserInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询用户总数
+     *
+     * @param info 用户信息
+     * @return 用户数量
+     */
+    int queryUsersCount(Map info);
+
+}

+ 112 - 0
service-user/src/main/java/com/java110/user/dao/impl/UserV1ServiceDaoImpl.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.user.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.user.dao.IUserV1ServiceDao;
+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 2021-09-13 08:40:33 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("userV1ServiceDaoImpl")
+public class UserV1ServiceDaoImpl extends BaseServiceDao implements IUserV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(UserV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存用户信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveUserInfo(Map info) throws DAOException {
+        logger.debug("保存 saveUserInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("userV1ServiceDaoImpl.saveUserInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询用户信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getUserInfo(Map info) throws DAOException {
+        logger.debug("查询 getUserInfo 入参 info : {}",info);
+
+        List<Map> businessUserInfos = sqlSessionTemplate.selectList("userV1ServiceDaoImpl.getUserInfo",info);
+
+        return businessUserInfos;
+    }
+
+
+    /**
+     * 修改用户信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateUserInfo(Map info) throws DAOException {
+        logger.debug("修改 updateUserInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("userV1ServiceDaoImpl.updateUserInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询用户数量
+     * @param info 用户信息
+     * @return 用户数量
+     */
+    @Override
+    public int queryUsersCount(Map info) {
+        logger.debug("查询 queryUsersCount 入参 info : {}",info);
+
+        List<Map> businessUserInfos = sqlSessionTemplate.selectList("userV1ServiceDaoImpl.queryUsersCount", info);
+        if (businessUserInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessUserInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-user/src/main/java/com/java110/user/smo/impl/UserV1InnerServiceSMOImpl.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.user.smo.impl;
+
+
+import com.java110.user.dao.IUserV1ServiceDao;
+import com.java110.intf.user.IUserV1InnerServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.po.user.UserPo;
+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 2021-09-13 08:40:33 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 UserV1InnerServiceSMOImpl extends BaseServiceSMO implements IUserV1InnerServiceSMO {
+
+    @Autowired
+    private IUserV1ServiceDao userV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveUser(@RequestBody  UserPo userPo) {
+        int saveFlag = userV1ServiceDaoImpl.saveUserInfo(BeanConvertUtil.beanCovertMap(userPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateUser(@RequestBody  UserPo userPo) {
+        int saveFlag = userV1ServiceDaoImpl.updateUserInfo(BeanConvertUtil.beanCovertMap(userPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteUser(@RequestBody  UserPo userPo) {
+       userPo.setStatusCd("1");
+       int saveFlag = userV1ServiceDaoImpl.updateUserInfo(BeanConvertUtil.beanCovertMap(userPo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<UserDto> queryUsers(@RequestBody  UserDto userDto) {
+
+        //校验是否传了 分页信息
+
+        int page = userDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            userDto.setPage((page - 1) * userDto.getRow());
+        }
+
+        List<UserDto> users = BeanConvertUtil.covertBeanList(userV1ServiceDaoImpl.getUserInfo(BeanConvertUtil.beanCovertMap(userDto)), UserDto.class);
+
+        return users;
+    }
+
+
+    @Override
+    public int queryUsersCount(@RequestBody UserDto userDto) {
+        return userV1ServiceDaoImpl.queryUsersCount(BeanConvertUtil.beanCovertMap(userDto));    }
+
+}