Преглед на файлове

报修类型师傅处理完成

java110 преди 3 години
родител
ревизия
435dbe36aa
променени са 15 файла, в които са добавени 956 реда и са изтрити 244 реда
  1. 9 0
      java110-bean/src/main/java/com/java110/po/repair/RepairTypeUserPo.java
  2. 124 0
      java110-db/src/main/resources/mapper/community/RepairTypeUserV1ServiceDaoImplMapper.xml
  3. 67 0
      java110-interface/src/main/java/com/java110/intf/community/IRepairTypeUserV1InnerServiceSMO.java
  4. 0 50
      service-api/src/main/java/com/java110/api/listener/repair/DeleteRepairTypeUserListener.java
  5. 0 82
      service-api/src/main/java/com/java110/api/listener/repair/ListRepairTypeUsersListener.java
  6. 0 63
      service-api/src/main/java/com/java110/api/listener/repair/SaveRepairTypeUserListener.java
  7. 0 49
      service-api/src/main/java/com/java110/api/listener/repair/UpdateRepairTypeUserListener.java
  8. 71 0
      service-community/src/main/java/com/java110/community/cmd/repair/DeleteRepairTypeUserCmd.java
  9. 82 0
      service-community/src/main/java/com/java110/community/cmd/repair/ListRepairTypeUserCmd.java
  10. 90 0
      service-community/src/main/java/com/java110/community/cmd/repair/SaveRepairTypeUserCmd.java
  11. 77 0
      service-community/src/main/java/com/java110/community/cmd/repair/UpdateRepairTypeUserCmd.java
  12. 77 0
      service-community/src/main/java/com/java110/community/dao/IRepairTypeUserV1ServiceDao.java
  13. 112 0
      service-community/src/main/java/com/java110/community/dao/impl/RepairTypeUserV1ServiceDaoImpl.java
  14. 89 0
      service-community/src/main/java/com/java110/community/smo/impl/RepairTypeUserV1InnerServiceSMOImpl.java
  15. 158 0
      service-user/src/main/java/com/java110/user/cmd/user/UserStaffDeleteCmd.java

+ 9 - 0
java110-bean/src/main/java/com/java110/po/repair/RepairTypeUserPo.java

@@ -11,6 +11,7 @@ public class RepairTypeUserPo implements Serializable {
     private String staffName;
     private String communityId;
     private String staffId;
+    private String statusCd;
 
     public String getTypeUserId() {
         return typeUserId;
@@ -68,4 +69,12 @@ public class RepairTypeUserPo implements Serializable {
     public void setStaffId(String staffId) {
         this.staffId = staffId;
     }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
 }

+ 124 - 0
java110-db/src/main/resources/mapper/community/RepairTypeUserV1ServiceDaoImplMapper.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="repairTypeUserV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存报修师傅信息 add by wuxw 2018-07-03 -->
+    <insert id="saveRepairTypeUserInfo" parameterType="Map">
+        insert into r_repair_type_user(
+type_user_id,repair_type,staff_name,remark,state,community_id,staff_id
+) values (
+#{typeUserId},#{repairType},#{staffName},#{remark},#{state},#{communityId},#{staffId}
+)
+    </insert>
+
+
+
+    <!-- 查询报修师傅信息 add by wuxw 2018-07-03 -->
+    <select id="getRepairTypeUserInfo" parameterType="Map" resultType="Map">
+        select  t.type_user_id,t.type_user_id typeUserId,t.repair_type,t.repair_type repairType,t.staff_name,t.staff_name staffName,t.remark,t.status_cd,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.staff_id,t.staff_id staffId 
+from r_repair_type_user t 
+where 1 =1 
+<if test="typeUserId !=null and typeUserId != ''">
+   and t.type_user_id= #{typeUserId}
+</if> 
+<if test="repairType !=null and repairType != ''">
+   and t.repair_type= #{repairType}
+</if> 
+<if test="staffName !=null and staffName != ''">
+   and t.staff_name= #{staffName}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</if> 
+<if test="communityId !=null and communityId != ''">
+   and t.community_id= #{communityId}
+</if> 
+<if test="staffId !=null and staffId != ''">
+   and t.staff_id= #{staffId}
+</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="updateRepairTypeUserInfo" parameterType="Map">
+        update  r_repair_type_user t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="repairType !=null and repairType != ''">
+, t.repair_type= #{repairType}
+</if> 
+<if test="staffName !=null and staffName != ''">
+, t.staff_name= #{staffName}
+</if> 
+<if test="remark !=null and remark != ''">
+, t.remark= #{remark}
+</if> 
+<if test="state !=null and state != ''">
+, t.state= #{state}
+</if> 
+<if test="communityId !=null and communityId != ''">
+, t.community_id= #{communityId}
+</if> 
+<if test="staffId !=null and staffId != ''">
+, t.staff_id= #{staffId}
+</if> 
+ where 1=1 <if test="typeUserId !=null and typeUserId != ''">
+and t.type_user_id= #{typeUserId}
+</if> 
+
+    </update>
+
+    <!-- 查询报修师傅数量 add by wuxw 2018-07-03 -->
+     <select id="queryRepairTypeUsersCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from r_repair_type_user t 
+where 1 =1 
+<if test="typeUserId !=null and typeUserId != ''">
+   and t.type_user_id= #{typeUserId}
+</if> 
+<if test="repairType !=null and repairType != ''">
+   and t.repair_type= #{repairType}
+</if> 
+<if test="staffName !=null and staffName != ''">
+   and t.staff_name= #{staffName}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</if> 
+<if test="communityId !=null and communityId != ''">
+   and t.community_id= #{communityId}
+</if> 
+<if test="staffId !=null and staffId != ''">
+   and t.staff_id= #{staffId}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 67 - 0
java110-interface/src/main/java/com/java110/intf/community/IRepairTypeUserV1InnerServiceSMO.java

@@ -0,0 +1,67 @@
+/*
+ * 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.community;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.repair.RepairTypeUserDto;
+import com.java110.po.repair.RepairTypeUserPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2022-08-06 12:27:40 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 = "community-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/repairTypeUserV1Api")
+public interface IRepairTypeUserV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveRepairTypeUser", method = RequestMethod.POST)
+    public int saveRepairTypeUser(@RequestBody RepairTypeUserPo repairTypeUserPo);
+
+    @RequestMapping(value = "/updateRepairTypeUser", method = RequestMethod.POST)
+    public int updateRepairTypeUser(@RequestBody RepairTypeUserPo repairTypeUserPo);
+
+    @RequestMapping(value = "/deleteRepairTypeUser", method = RequestMethod.POST)
+    public int deleteRepairTypeUser(@RequestBody RepairTypeUserPo repairTypeUserPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     * @param repairTypeUserDto 数据对象分享
+     * @return RepairTypeUserDto 对象数据
+     */
+    @RequestMapping(value = "/queryRepairTypeUsers", method = RequestMethod.POST)
+    List<RepairTypeUserDto> queryRepairTypeUsers(@RequestBody RepairTypeUserDto repairTypeUserDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param repairTypeUserDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryRepairTypeUsersCount", method = RequestMethod.POST)
+    int queryRepairTypeUsersCount(@RequestBody RepairTypeUserDto repairTypeUserDto);
+}

+ 0 - 50
service-api/src/main/java/com/java110/api/listener/repair/DeleteRepairTypeUserListener.java

@@ -1,50 +0,0 @@
-package com.java110.api.listener.repair;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.repair.IRepairTypeUserBMO;
-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.ServiceCodeRepairTypeUserConstant;
-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("deleteRepairTypeUserListener")
-public class DeleteRepairTypeUserListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IRepairTypeUserBMO repairTypeUserBMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
-        Assert.hasKeyAndValue(reqJson, "typeUserId", "typeUserId不能为空");
-        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        repairTypeUserBMOImpl.deleteRepairTypeUser(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeRepairTypeUserConstant.DELETE_REPAIRTYPEUSER;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-}

+ 0 - 82
service-api/src/main/java/com/java110/api/listener/repair/ListRepairTypeUsersListener.java

@@ -1,82 +0,0 @@
-package com.java110.api.listener.repair;
-
-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.community.IRepairTypeUserInnerServiceSMO;
-import com.java110.dto.repair.RepairTypeUserDto;
-import com.java110.utils.constant.ServiceCodeRepairTypeUserConstant;
-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("listRepairTypeUsersListener")
-public class ListRepairTypeUsersListener extends AbstractServiceApiListener {
-
-    @Autowired
-    private IRepairTypeUserInnerServiceSMO repairTypeUserInnerServiceSMOImpl;
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeRepairTypeUserConstant.LIST_REPAIRTYPEUSERS;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.GET;
-    }
-
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-
-    public IRepairTypeUserInnerServiceSMO getRepairTypeUserInnerServiceSMOImpl() {
-        return repairTypeUserInnerServiceSMOImpl;
-    }
-
-    public void setRepairTypeUserInnerServiceSMOImpl(IRepairTypeUserInnerServiceSMO repairTypeUserInnerServiceSMOImpl) {
-        this.repairTypeUserInnerServiceSMOImpl = repairTypeUserInnerServiceSMOImpl;
-    }
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        super.validatePageInfo(reqJson);
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        RepairTypeUserDto repairTypeUserDto = BeanConvertUtil.covertBean(reqJson, RepairTypeUserDto.class);
-
-        int count = repairTypeUserInnerServiceSMOImpl.queryRepairTypeUsersCount(repairTypeUserDto);
-
-        List<RepairTypeUserDto> repairTypeUserDtos = null;
-
-        if (count > 0) {
-            repairTypeUserDtos = repairTypeUserInnerServiceSMOImpl.queryRepairTypeUsers(repairTypeUserDto);
-        } else {
-            repairTypeUserDtos = new ArrayList<>();
-        }
-
-        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, repairTypeUserDtos);
-
-        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
-
-        context.setResponseEntity(responseEntity);
-
-    }
-}

+ 0 - 63
service-api/src/main/java/com/java110/api/listener/repair/SaveRepairTypeUserListener.java

@@ -1,63 +0,0 @@
-package com.java110.api.listener.repair;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.repair.IRepairTypeUserBMO;
-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.repair.RepairTypeUserDto;
-import com.java110.intf.community.IRepairTypeUserInnerServiceSMO;
-import com.java110.utils.constant.ServiceCodeRepairTypeUserConstant;
-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("saveRepairTypeUserListener")
-public class SaveRepairTypeUserListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IRepairTypeUserBMO repairTypeUserBMOImpl;
-
-    @Autowired
-    private IRepairTypeUserInnerServiceSMO repairTypeUserInnerServiceSMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-        Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId");
-        Assert.hasKeyAndValue(reqJson, "staffName", "请求报文中未包含staffName");
-        Assert.hasKeyAndValue(reqJson, "repairType", "请求报文中未包含repairType");
-        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-        reqJson.put("state", RepairTypeUserDto.STATE_ONLINE);
-        RepairTypeUserDto repairTypeUserDto = new RepairTypeUserDto();
-        repairTypeUserDto.setRepairType(reqJson.getString("repairType"));
-        repairTypeUserDto.setStaffId(reqJson.getString("staffId"));
-        repairTypeUserDto.setCommunityId(reqJson.getString("communityId"));
-        List<RepairTypeUserDto> repairTypeUserDtos = repairTypeUserInnerServiceSMOImpl.queryRepairTypeUsers(repairTypeUserDto);
-        Assert.listIsNull(repairTypeUserDtos, "维修师傅已存在,不能重复添加!");
-        repairTypeUserBMOImpl.addRepairTypeUser(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeRepairTypeUserConstant.ADD_REPAIRTYPEUSER;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-}

+ 0 - 49
service-api/src/main/java/com/java110/api/listener/repair/UpdateRepairTypeUserListener.java

@@ -1,49 +0,0 @@
-package com.java110.api.listener.repair;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.repair.IRepairTypeUserBMO;
-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.ServiceCodeRepairTypeUserConstant;
-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("updateRepairTypeUserListener")
-public class UpdateRepairTypeUserListener extends AbstractServiceApiPlusListener {
-
-    @Autowired
-    private IRepairTypeUserBMO repairTypeUserBMOImpl;
-
-    @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-
-        Assert.hasKeyAndValue(reqJson, "typeUserId", "typeUserId不能为空");
-        Assert.hasKeyAndValue(reqJson, "state", "请求报文中未包含状态");
-        Assert.hasKeyAndValue(reqJson, "repairType", "请求报文中未包含repairType");
-        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
-
-    }
-
-    @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
-        repairTypeUserBMOImpl.updateRepairTypeUser(reqJson, context);
-    }
-
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeRepairTypeUserConstant.UPDATE_REPAIRTYPEUSER;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-}

+ 71 - 0
service-community/src/main/java/com/java110/community/cmd/repair/DeleteRepairTypeUserCmd.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.community.cmd.repair;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.community.IRepairTypeUserV1InnerServiceSMO;
+import com.java110.po.repair.RepairTypeUserPo;
+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;
+
+/**
+ * 类表述:删除
+ * 服务编码:repairTypeUser.deleteRepairTypeUser
+ * 请求路劲:/app/repairTypeUser.DeleteRepairTypeUser
+ * add by 吴学文 at 2022-08-06 12:27:40 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 = "repair.deleteRepairTypeUser")
+public class DeleteRepairTypeUserCmd extends Cmd {
+    private static Logger logger = LoggerFactory.getLogger(DeleteRepairTypeUserCmd.class);
+
+    @Autowired
+    private IRepairTypeUserV1InnerServiceSMO repairTypeUserV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "typeUserId", "typeUserId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        RepairTypeUserPo repairTypeUserPo = BeanConvertUtil.covertBean(reqJson, RepairTypeUserPo.class);
+        int flag = repairTypeUserV1InnerServiceSMOImpl.deleteRepairTypeUser(repairTypeUserPo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 82 - 0
service-community/src/main/java/com/java110/community/cmd/repair/ListRepairTypeUserCmd.java

@@ -0,0 +1,82 @@
+/*
+ * 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.community.cmd.repair;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.repair.RepairTypeUserDto;
+import com.java110.intf.community.IRepairTypeUserInnerServiceSMO;
+import com.java110.intf.community.IRepairTypeUserV1InnerServiceSMO;
+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;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 类表述:查询
+ * 服务编码:repairTypeUser.listRepairTypeUser
+ * 请求路劲:/app/repairTypeUser.ListRepairTypeUser
+ * add by 吴学文 at 2022-08-06 12:27:40 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 = "repair.listRepairTypeUsers")
+public class ListRepairTypeUserCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(ListRepairTypeUserCmd.class);
+    @Autowired
+    private IRepairTypeUserInnerServiceSMO repairTypeUserInnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+        RepairTypeUserDto repairTypeUserDto = BeanConvertUtil.covertBean(reqJson, RepairTypeUserDto.class);
+
+        int count = repairTypeUserInnerServiceSMOImpl.queryRepairTypeUsersCount(repairTypeUserDto);
+
+        List<RepairTypeUserDto> repairTypeUserDtos = null;
+
+        if (count > 0) {
+            repairTypeUserDtos = repairTypeUserInnerServiceSMOImpl.queryRepairTypeUsers(repairTypeUserDto);
+        } else {
+            repairTypeUserDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, repairTypeUserDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+    }
+}

+ 90 - 0
service-community/src/main/java/com/java110/community/cmd/repair/SaveRepairTypeUserCmd.java

@@ -0,0 +1,90 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community.cmd.repair;
+
+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.repair.RepairTypeUserDto;
+import com.java110.intf.community.IRepairTypeUserInnerServiceSMO;
+import com.java110.intf.community.IRepairTypeUserV1InnerServiceSMO;
+import com.java110.po.repair.RepairTypeUserPo;
+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;
+
+/**
+ * 类表述:保存
+ * 服务编码:repairTypeUser.saveRepairTypeUser
+ * 请求路劲:/app/repairTypeUser.SaveRepairTypeUser
+ * add by 吴学文 at 2022-08-06 12:27:40 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 = "repair.saveRepairTypeUser")
+public class SaveRepairTypeUserCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveRepairTypeUserCmd.class);
+
+    public static final String CODE_PREFIX_ID = "10";
+
+    @Autowired
+    private IRepairTypeUserV1InnerServiceSMO repairTypeUserV1InnerServiceSMOImpl;
+    @Autowired
+    private IRepairTypeUserInnerServiceSMO repairTypeUserInnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId");
+        Assert.hasKeyAndValue(reqJson, "staffName", "请求报文中未包含staffName");
+        Assert.hasKeyAndValue(reqJson, "repairType", "请求报文中未包含repairType");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+        RepairTypeUserDto repairTypeUserDto = new RepairTypeUserDto();
+        repairTypeUserDto.setRepairType(reqJson.getString("repairType"));
+        repairTypeUserDto.setStaffId(reqJson.getString("staffId"));
+        repairTypeUserDto.setCommunityId(reqJson.getString("communityId"));
+        List<RepairTypeUserDto> repairTypeUserDtos = repairTypeUserInnerServiceSMOImpl.queryRepairTypeUsers(repairTypeUserDto);
+        Assert.listIsNull(repairTypeUserDtos, "维修师傅已存在,不能重复添加!");
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+        reqJson.put("state", RepairTypeUserDto.STATE_ONLINE);
+        RepairTypeUserPo repairTypeUserPo = BeanConvertUtil.covertBean(reqJson, RepairTypeUserPo.class);
+        repairTypeUserPo.setTypeUserId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
+        int flag = repairTypeUserV1InnerServiceSMOImpl.saveRepairTypeUser(repairTypeUserPo);
+
+        if (flag < 1) {
+            throw new CmdException("保存数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-community/src/main/java/com/java110/community/cmd/repair/UpdateRepairTypeUserCmd.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.community.cmd.repair;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.community.IRepairTypeUserV1InnerServiceSMO;
+import com.java110.po.repair.RepairTypeUserPo;
+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;
+
+
+/**
+ * 类表述:更新
+ * 服务编码:repairTypeUser.updateRepairTypeUser
+ * 请求路劲:/app/repairTypeUser.UpdateRepairTypeUser
+ * add by 吴学文 at 2022-08-06 12:27:40 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 = "repair.updateRepairTypeUser")
+public class UpdateRepairTypeUserCmd extends Cmd {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateRepairTypeUserCmd.class);
+
+
+    @Autowired
+    private IRepairTypeUserV1InnerServiceSMO repairTypeUserV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "typeUserId", "typeUserId不能为空");
+        Assert.hasKeyAndValue(reqJson, "state", "请求报文中未包含状态");
+        Assert.hasKeyAndValue(reqJson, "repairType", "请求报文中未包含repairType");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        RepairTypeUserPo repairTypeUserPo = BeanConvertUtil.covertBean(reqJson, RepairTypeUserPo.class);
+        int flag = repairTypeUserV1InnerServiceSMOImpl.updateRepairTypeUser(repairTypeUserPo);
+
+        if (flag < 1) {
+            throw new CmdException("更新数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 77 - 0
service-community/src/main/java/com/java110/community/dao/IRepairTypeUserV1ServiceDao.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.community.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2022-08-06 12:27:40 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 IRepairTypeUserV1ServiceDao {
+
+
+    /**
+     * 保存 报修师傅信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveRepairTypeUserInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询报修师傅信息(instance过程)
+     * 根据bId 查询报修师傅信息
+     * @param info bId 信息
+     * @return 报修师傅信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getRepairTypeUserInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改报修师傅信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateRepairTypeUserInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询报修师傅总数
+     *
+     * @param info 报修师傅信息
+     * @return 报修师傅数量
+     */
+    int queryRepairTypeUsersCount(Map info);
+
+}

+ 112 - 0
service-community/src/main/java/com/java110/community/dao/impl/RepairTypeUserV1ServiceDaoImpl.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.community.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.community.dao.IRepairTypeUserV1ServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2022-08-06 12:27:40 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("repairTypeUserV1ServiceDaoImpl")
+public class RepairTypeUserV1ServiceDaoImpl extends BaseServiceDao implements IRepairTypeUserV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(RepairTypeUserV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存报修师傅信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveRepairTypeUserInfo(Map info) throws DAOException {
+        logger.debug("保存 saveRepairTypeUserInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("repairTypeUserV1ServiceDaoImpl.saveRepairTypeUserInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询报修师傅信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getRepairTypeUserInfo(Map info) throws DAOException {
+        logger.debug("查询 getRepairTypeUserInfo 入参 info : {}",info);
+
+        List<Map> businessRepairTypeUserInfos = sqlSessionTemplate.selectList("repairTypeUserV1ServiceDaoImpl.getRepairTypeUserInfo",info);
+
+        return businessRepairTypeUserInfos;
+    }
+
+
+    /**
+     * 修改报修师傅信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateRepairTypeUserInfo(Map info) throws DAOException {
+        logger.debug("修改 updateRepairTypeUserInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("repairTypeUserV1ServiceDaoImpl.updateRepairTypeUserInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询报修师傅数量
+     * @param info 报修师傅信息
+     * @return 报修师傅数量
+     */
+    @Override
+    public int queryRepairTypeUsersCount(Map info) {
+        logger.debug("查询 queryRepairTypeUsersCount 入参 info : {}",info);
+
+        List<Map> businessRepairTypeUserInfos = sqlSessionTemplate.selectList("repairTypeUserV1ServiceDaoImpl.queryRepairTypeUsersCount", info);
+        if (businessRepairTypeUserInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessRepairTypeUserInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
service-community/src/main/java/com/java110/community/smo/impl/RepairTypeUserV1InnerServiceSMOImpl.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.community.smo.impl;
+
+
+import com.java110.community.dao.IRepairTypeUserV1ServiceDao;
+import com.java110.dto.repair.RepairTypeUserDto;
+import com.java110.intf.community.IRepairTypeUserV1InnerServiceSMO;
+import com.java110.po.repair.RepairTypeUserPo;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2022-08-06 12:27:40 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 RepairTypeUserV1InnerServiceSMOImpl extends BaseServiceSMO implements IRepairTypeUserV1InnerServiceSMO {
+
+    @Autowired
+    private IRepairTypeUserV1ServiceDao repairTypeUserV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveRepairTypeUser(@RequestBody RepairTypeUserPo repairTypeUserPo) {
+        int saveFlag = repairTypeUserV1ServiceDaoImpl.saveRepairTypeUserInfo(BeanConvertUtil.beanCovertMap(repairTypeUserPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateRepairTypeUser(@RequestBody  RepairTypeUserPo repairTypeUserPo) {
+        int saveFlag = repairTypeUserV1ServiceDaoImpl.updateRepairTypeUserInfo(BeanConvertUtil.beanCovertMap(repairTypeUserPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteRepairTypeUser(@RequestBody  RepairTypeUserPo repairTypeUserPo) {
+       repairTypeUserPo.setStatusCd("1");
+       int saveFlag = repairTypeUserV1ServiceDaoImpl.updateRepairTypeUserInfo(BeanConvertUtil.beanCovertMap(repairTypeUserPo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<RepairTypeUserDto> queryRepairTypeUsers(@RequestBody  RepairTypeUserDto repairTypeUserDto) {
+
+        //校验是否传了 分页信息
+
+        int page = repairTypeUserDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            repairTypeUserDto.setPage((page - 1) * repairTypeUserDto.getRow());
+        }
+
+        List<RepairTypeUserDto> repairTypeUsers = BeanConvertUtil.covertBeanList(repairTypeUserV1ServiceDaoImpl.getRepairTypeUserInfo(BeanConvertUtil.beanCovertMap(repairTypeUserDto)), RepairTypeUserDto.class);
+
+        return repairTypeUsers;
+    }
+
+
+    @Override
+    public int queryRepairTypeUsersCount(@RequestBody RepairTypeUserDto repairTypeUserDto) {
+        return repairTypeUserV1ServiceDaoImpl.queryRepairTypeUsersCount(BeanConvertUtil.beanCovertMap(repairTypeUserDto));    }
+
+}

+ 158 - 0
service-user/src/main/java/com/java110/user/cmd/user/UserStaffDeleteCmd.java

@@ -0,0 +1,158 @@
+package com.java110.user.cmd.user;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.privilegeUser.PrivilegeUserDto;
+import com.java110.dto.repair.RepairTypeUserDto;
+import com.java110.intf.community.IRepairTypeUserInnerServiceSMO;
+import com.java110.intf.community.IRepairTypeUserV1InnerServiceSMO;
+import com.java110.intf.store.IStoreUserV1InnerServiceSMO;
+import com.java110.intf.user.IPrivilegeUserV1InnerServiceSMO;
+import com.java110.intf.user.IUserV1InnerServiceSMO;
+import com.java110.po.privilegeUser.PrivilegeUserPo;
+import com.java110.po.repair.RepairTypeUserPo;
+import com.java110.po.store.StoreUserPo;
+import com.java110.po.user.UserPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.text.ParseException;
+import java.util.List;
+
+@Java110Cmd(serviceCode = "user.staff.delete")
+public class UserStaffDeleteCmd extends Cmd {
+
+
+    @Autowired
+    private IRepairTypeUserInnerServiceSMO repairTypeUserInnerServiceSMOImpl;
+
+    @Autowired
+    private IStoreUserV1InnerServiceSMO storeUserV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IPrivilegeUserV1InnerServiceSMO privilegeUserV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IRepairTypeUserV1InnerServiceSMO repairTypeUserV1InnerServiceSMOImpl;
+
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
+        Assert.jsonObjectHaveKey(reqJson, "storeId", "请求参数中未包含storeId 节点,请确认");
+        Assert.jsonObjectHaveKey(reqJson, "userId", "请求参数中未包含userId 节点,请确认");
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+        deleteStaff(reqJson);
+
+        //删除用户
+        deleteUser(reqJson);
+
+        //删除报修设置
+        RepairTypeUserDto repairTypeUserDto = new RepairTypeUserDto();
+        repairTypeUserDto.setStaffId(reqJson.getString("userId"));
+        repairTypeUserDto.setStatusCd("0");
+        List<RepairTypeUserDto> repairTypeUserDtoList = repairTypeUserInnerServiceSMOImpl.queryRepairTypeUsers(repairTypeUserDto);
+        if (repairTypeUserDtoList != null && repairTypeUserDtoList.size() > 0) {
+            for (RepairTypeUserDto repairTypeUserDto1 : repairTypeUserDtoList) {
+                JSONObject typeUserJson1 = (JSONObject) JSONObject.toJSON(repairTypeUserDto1);
+                deleteRepairTypeUser(typeUserJson1);
+            }
+        }
+
+        //赋权
+        deleteUserPrivilege(reqJson);
+    }
+
+    /**
+     * 删除用户权限
+     *
+     * @param paramInJson
+     */
+    private void deleteUserPrivilege(JSONObject paramInJson) {
+
+        PrivilegeUserDto privilegeUserDto = new PrivilegeUserDto();
+        privilegeUserDto.setUserId(paramInJson.getString("userId"));
+        List<PrivilegeUserDto> privilegeUserDtos = privilegeUserV1InnerServiceSMOImpl.queryPrivilegeUsers(privilegeUserDto);
+
+        if (privilegeUserDtos == null || privilegeUserDtos.size() < 1) {
+            return;
+        }
+
+        for (PrivilegeUserDto tmpPrivilegeUserDto : privilegeUserDtos) {
+            PrivilegeUserPo privilegeUserPo = new PrivilegeUserPo();
+            privilegeUserPo.setPuId(tmpPrivilegeUserDto.getPuId());
+            int flag = privilegeUserV1InnerServiceSMOImpl.deletePrivilegeUser(privilegeUserPo);
+            if (flag < 1) {
+                throw new CmdException("删除员工失败");
+            }
+        }
+    }
+
+    /**
+     * 删除商户
+     *
+     * @param paramInJson
+     * @return
+     */
+    public void deleteStaff(JSONObject paramInJson) {
+
+        JSONObject businessStoreUser = new JSONObject();
+        businessStoreUser.put("storeId", paramInJson.getString("storeId"));
+        businessStoreUser.put("userId", paramInJson.getString("userId"));
+
+
+        StoreUserPo storeUserPo = BeanConvertUtil.covertBean(businessStoreUser, StoreUserPo.class);
+
+        int flag = storeUserV1InnerServiceSMOImpl.deleteStoreUser(storeUserPo);
+
+        if (flag < 1) {
+            throw new CmdException("删除员工失败");
+        }
+    }
+
+    /**
+     * 删除商户
+     *
+     * @param paramInJson
+     * @return
+     */
+    public void deleteUser(JSONObject paramInJson) {
+        //校验json 格式中是否包含 name,email,levelCd,tel
+        JSONObject businessStoreUser = new JSONObject();
+        businessStoreUser.put("userId", paramInJson.getString("userId"));
+
+        UserPo userPo = BeanConvertUtil.covertBean(businessStoreUser, UserPo.class);
+        int flag = userV1InnerServiceSMOImpl.deleteUser(userPo);
+
+        if (flag < 1) {
+            throw new CmdException("删除员工失败");
+        }
+    }
+
+    /**
+     * 添加小区信息
+     *
+     * @param paramInJson 接口调用放传入入参
+     * @return 订单服务能够接受的报文
+     */
+    public void deleteRepairTypeUser(JSONObject paramInJson) {
+
+        RepairTypeUserPo repairTypeUserPo = BeanConvertUtil.covertBean(paramInJson, RepairTypeUserPo.class);
+        //super.update(dataFlowContext, repairTypeUserPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_REPAIR_TYPE_USER);
+        int flag = repairTypeUserV1InnerServiceSMOImpl.deleteRepairTypeUser(repairTypeUserPo);
+        if (flag < 1) {
+            throw new CmdException("删除员工失败");
+        }
+    }
+}