Ver código fonte

报修相关类修改

java110 3 anos atrás
pai
commit
2fecfd20d3

+ 178 - 0
java110-db/src/main/resources/mapper/community/RepairUserNewV1ServiceDaoImplMapper.xml

@@ -0,0 +1,178 @@
+<?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="repairUserNewV1ServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存费用明细信息 add by wuxw 2018-07-03 -->
+    <insert id="saveRepairUserNewInfo" parameterType="Map">
+        insert into r_repair_user(
+repair_event,pre_staff_name,repair_id,ru_id,pre_staff_id,context,staff_name,pre_ru_id,start_time,state,end_time,community_id,staff_id
+) values (
+#{repairEvent},#{preStaffName},#{repairId},#{ruId},#{preStaffId},#{context},#{staffName},#{preRuId},#{startTime},#{state},#{endTime},#{communityId},#{staffId}
+)
+    </insert>
+
+
+
+    <!-- 查询费用明细信息 add by wuxw 2018-07-03 -->
+    <select id="getRepairUserNewInfo" parameterType="Map" resultType="Map">
+        select  t.repair_event,t.repair_event repairEvent,t.pre_staff_name,t.pre_staff_name preStaffName,t.repair_id,t.repair_id repairId,t.status_cd,t.status_cd statusCd,t.ru_id,t.ru_id ruId,t.pre_staff_id,t.pre_staff_id preStaffId,t.context,t.staff_name,t.staff_name staffName,t.pre_ru_id,t.pre_ru_id preRuId,t.start_time,t.start_time startTime,t.state,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,t.staff_id,t.staff_id staffId 
+from r_repair_user t 
+where 1 =1 
+<if test="repairEvent !=null and repairEvent != ''">
+   and t.repair_event= #{repairEvent}
+</if> 
+<if test="preStaffName !=null and preStaffName != ''">
+   and t.pre_staff_name= #{preStaffName}
+</if> 
+<if test="repairId !=null and repairId != ''">
+   and t.repair_id= #{repairId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="ruId !=null and ruId != ''">
+   and t.ru_id= #{ruId}
+</if> 
+<if test="preStaffId !=null and preStaffId != ''">
+   and t.pre_staff_id= #{preStaffId}
+</if> 
+<if test="context !=null and context != ''">
+   and t.context= #{context}
+</if> 
+<if test="staffName !=null and staffName != ''">
+   and t.staff_name= #{staffName}
+</if> 
+<if test="preRuId !=null and preRuId != ''">
+   and t.pre_ru_id= #{preRuId}
+</if> 
+<if test="startTime !=null and startTime != ''">
+   and t.start_time= #{startTime}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</if> 
+<if test="endTime !=null and endTime != ''">
+   and t.end_time= #{endTime}
+</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="updateRepairUserNewInfo" parameterType="Map">
+        update  r_repair_user t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="repairEvent !=null and repairEvent != ''">
+, t.repair_event= #{repairEvent}
+</if> 
+<if test="preStaffName !=null and preStaffName != ''">
+, t.pre_staff_name= #{preStaffName}
+</if> 
+<if test="repairId !=null and repairId != ''">
+, t.repair_id= #{repairId}
+</if> 
+<if test="preStaffId !=null and preStaffId != ''">
+, t.pre_staff_id= #{preStaffId}
+</if> 
+<if test="context !=null and context != ''">
+, t.context= #{context}
+</if> 
+<if test="staffName !=null and staffName != ''">
+, t.staff_name= #{staffName}
+</if> 
+<if test="preRuId !=null and preRuId != ''">
+, t.pre_ru_id= #{preRuId}
+</if> 
+<if test="startTime !=null and startTime != ''">
+, t.start_time= #{startTime}
+</if> 
+<if test="state !=null and state != ''">
+, t.state= #{state}
+</if> 
+<if test="endTime !=null and endTime != ''">
+, t.end_time= #{endTime}
+</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="ruId !=null and ruId != ''">
+and t.ru_id= #{ruId}
+</if> 
+
+    </update>
+
+    <!-- 查询费用明细数量 add by wuxw 2018-07-03 -->
+     <select id="queryRepairUserNewsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from r_repair_user t 
+where 1 =1 
+<if test="repairEvent !=null and repairEvent != ''">
+   and t.repair_event= #{repairEvent}
+</if> 
+<if test="preStaffName !=null and preStaffName != ''">
+   and t.pre_staff_name= #{preStaffName}
+</if> 
+<if test="repairId !=null and repairId != ''">
+   and t.repair_id= #{repairId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="ruId !=null and ruId != ''">
+   and t.ru_id= #{ruId}
+</if> 
+<if test="preStaffId !=null and preStaffId != ''">
+   and t.pre_staff_id= #{preStaffId}
+</if> 
+<if test="context !=null and context != ''">
+   and t.context= #{context}
+</if> 
+<if test="staffName !=null and staffName != ''">
+   and t.staff_name= #{staffName}
+</if> 
+<if test="preRuId !=null and preRuId != ''">
+   and t.pre_ru_id= #{preRuId}
+</if> 
+<if test="startTime !=null and startTime != ''">
+   and t.start_time= #{startTime}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</if> 
+<if test="endTime !=null and endTime != ''">
+   and t.end_time= #{endTime}
+</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>

+ 4 - 4
java110-interface/src/main/java/com/java110/intf/fee/IRepairUserNewV1InnerServiceSMO.java

@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.java110.intf.fee;
+package com.java110.intf.community;
 
 import com.java110.config.feign.FeignConfiguration;
 import com.java110.dto.repair.RepairUserDto;
@@ -33,9 +33,9 @@ import java.util.List;
  * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
  * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
  */
-@FeignClient(name = "fee-service", configuration = {FeignConfiguration.class})
-@RequestMapping("/repairUserNewV1Api")
-public interface IRepairUserNewV1InnerServiceSMO {
+@FeignClient(name = "community-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/repairUserV1Api")
+public interface IRepairUserV1InnerServiceSMO {
 
 
     @RequestMapping(value = "/saveRepairUserNew", method = RequestMethod.POST)

+ 42 - 48
service-api/src/main/java/com/java110/api/listener/ownerRepair/AppraiseRepairListener.java

@@ -1,60 +1,57 @@
-package com.java110.api.listener.ownerRepair;
+package com.java110.community.cmd.ownerRepair;
 
 import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.ownerRepair.IOwnerRepairBMO;
-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.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
 import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.intf.community.IRepairInnerServiceSMO;
-import com.java110.intf.community.IRepairUserInnerServiceSMO;
 import com.java110.dto.repair.RepairDto;
 import com.java110.dto.repair.RepairUserDto;
+import com.java110.intf.community.IRepairInnerServiceSMO;
+import com.java110.intf.community.IRepairPoolV1InnerServiceSMO;
+import com.java110.intf.community.IRepairUserInnerServiceSMO;
+import com.java110.intf.community.IRepairUserV1InnerServiceSMO;
+import com.java110.po.owner.RepairPoolPo;
 import com.java110.po.owner.RepairUserPo;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ServiceCodeRepairDispatchStepConstant;
+import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.DateUtil;
 import com.java110.utils.util.StringUtil;
 import com.java110.vo.ResultVo;
-import org.slf4j.Logger;
-import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
 import org.springframework.http.ResponseEntity;
 
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 
-/**
- * 评价报修
- * add by wuxw 2019-06-30
- */
-@Java110Listener("appraiseRepairListener")
-public class AppraiseRepairListener extends AbstractServiceApiPlusListener {
+@Java110Cmd(serviceCode = "ownerRepair.appraiseRepair")
+public class AppraiseRepairCmd extends Cmd {
 
-    private static Logger logger = LoggerFactory.getLogger(AppraiseRepairListener.class);
+    @Autowired
+    private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl;
 
     @Autowired
-    private IOwnerRepairBMO ownerRepairBMOImpl;
+    private IRepairInnerServiceSMO repairInnerServiceSMOImpl;
 
     @Autowired
-    private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl;
+    private IRepairUserV1InnerServiceSMO repairUserV1InnerServiceSMOImpl;
 
     @Autowired
-    private IRepairInnerServiceSMO repairInnerServiceSMOImpl;
+    private IRepairPoolV1InnerServiceSMO repairPoolV1InnerServiceSMOImpl;
 
     @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         Assert.hasKeyAndValue(reqJson, "repairId", "未包含报修单信息");
         Assert.hasKeyAndValue(reqJson, "context", "未包含派单内容");
         Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息");
     }
 
     @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
         //获取报修渠道
         String repairChannel = reqJson.getString("repairChannel");
         //是否是公共区域
@@ -91,32 +88,29 @@ public class AppraiseRepairListener extends AbstractServiceApiPlusListener {
         repairUserPo.setPreStaffName(repairUserDtos.get(0).getStaffName());
         repairUserPo.setPreRuId(repairUserDtos.get(0).getRuId());
         repairUserPo.setRepairEvent("auditUser");
-        super.insert(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_REPAIR_USER);
-        ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_COMPLATE);
+        int flag = repairUserV1InnerServiceSMOImpl.saveRepairUserNew(repairUserPo);
+        if (flag < 1) {
+            throw new CmdException("保存失败");
+        }
+        modifyBusinessRepairDispatch(reqJson, RepairDto.STATE_COMPLATE);
         ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_OK, ResultVo.MSG_OK);
         context.setResponseEntity(responseEntity);
     }
 
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeRepairDispatchStepConstant.BINDING_APPRAISE_REPAIR;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-    public IRepairInnerServiceSMO getRepairInnerServiceSMOImpl() {
-        return repairInnerServiceSMOImpl;
-    }
-
-    public void setRepairInnerServiceSMOImpl(IRepairInnerServiceSMO repairInnerServiceSMOImpl) {
-        this.repairInnerServiceSMOImpl = repairInnerServiceSMOImpl;
+    public void modifyBusinessRepairDispatch(JSONObject paramInJson, String state) {
+        //查询报修单
+        RepairDto repairDto = new RepairDto();
+        repairDto.setRepairId(paramInJson.getString("repairId"));
+        List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto);
+        Assert.isOne(repairDtos, "查询到多条数据,repairId=" + repairDto.getRepairId());
+        JSONObject businessOwnerRepair = new JSONObject();
+        businessOwnerRepair.putAll(BeanConvertUtil.beanCovertMap(repairDtos.get(0)));
+        businessOwnerRepair.put("state", state);
+        //计算 应收金额
+        RepairPoolPo repairPoolPo = BeanConvertUtil.covertBean(businessOwnerRepair, RepairPoolPo.class);
+        int flag = repairPoolV1InnerServiceSMOImpl.updateRepairPoolNew(repairPoolPo);
+        if (flag < 1) {
+            throw new CmdException("保存失败");
+        }
     }
 }

+ 111 - 67
service-api/src/main/java/com/java110/api/listener/ownerRepair/RepairFinishListener.java

@@ -1,12 +1,11 @@
-package com.java110.api.listener.ownerRepair;
+package com.java110.community.cmd.ownerRepair;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.ownerRepair.IOwnerRepairBMO;
-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.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.fee.FeeAttrDto;
 import com.java110.dto.fee.FeeConfigDto;
@@ -19,11 +18,14 @@ import com.java110.dto.repair.RepairDto;
 import com.java110.dto.repair.RepairUserDto;
 import com.java110.dto.userStorehouse.UserStorehouseDto;
 import com.java110.intf.common.IFileInnerServiceSMO;
-import com.java110.intf.community.IRepairInnerServiceSMO;
-import com.java110.intf.community.IRepairUserInnerServiceSMO;
-import com.java110.intf.community.IResourceStoreServiceSMO;
+import com.java110.intf.common.IFileRelInnerServiceSMO;
+import com.java110.intf.community.*;
+import com.java110.intf.fee.IFeeAttrInnerServiceSMO;
 import com.java110.intf.fee.IFeeConfigInnerServiceSMO;
+import com.java110.intf.fee.IPayFeeV1InnerServiceSMO;
+import com.java110.intf.store.IResourceStoreUseRecordV1InnerServiceSMO;
 import com.java110.intf.store.IUserStorehouseInnerServiceSMO;
+import com.java110.intf.store.IUserStorehouseV1InnerServiceSMO;
 import com.java110.intf.user.IOwnerInnerServiceSMO;
 import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
 import com.java110.po.fee.FeeAttrPo;
@@ -34,37 +36,26 @@ import com.java110.po.owner.RepairUserPo;
 import com.java110.po.purchase.ResourceStorePo;
 import com.java110.po.resourceStoreUseRecord.ResourceStoreUseRecordPo;
 import com.java110.po.userStorehouse.UserStorehousePo;
-import com.java110.utils.constant.BusinessTypeConstant;
 import com.java110.utils.constant.FeeTypeConstant;
-import com.java110.utils.constant.ServiceCodeRepairDispatchStepConstant;
+import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.DateUtil;
 import com.java110.utils.util.StringUtil;
 import com.java110.vo.ResultVo;
 import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
 import org.springframework.http.ResponseEntity;
 
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
+import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.List;
 
-/**
- * 完成报修
- * add by wuxw 2019-06-30
- */
-@Java110Listener("repairFinishListener")
-public class RepairFinishListener extends AbstractServiceApiPlusListener {
+@Java110Cmd(serviceCode = "ownerRepair.repairFinish")
+public class RepairFinishCmd extends Cmd {
 
-    private static Logger logger = LoggerFactory.getLogger(RepairFinishListener.class);
-
-    @Autowired
-    private IOwnerRepairBMO ownerRepairBMOImpl;
 
     @Autowired
     private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl;
@@ -90,8 +81,29 @@ public class RepairFinishListener extends AbstractServiceApiPlusListener {
     @Autowired
     private IUserStorehouseInnerServiceSMO userStorehouseInnerServiceSMO;
 
+    @Autowired
+    private IUserStorehouseV1InnerServiceSMO userStorehouseV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IResourceStoreUseRecordV1InnerServiceSMO resourceStoreUseRecordV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IRepairUserV1InnerServiceSMO repairUserV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl;
+
+    @Autowired
+    private IRepairPoolV1InnerServiceSMO repairPoolV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IPayFeeV1InnerServiceSMO payFeeV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IFeeAttrInnerServiceSMO feeAttrInnerServiceSMOImpl;
+
     @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         Assert.hasKeyAndValue(reqJson, "repairId", "未包含报修单信息");
         Assert.hasKeyAndValue(reqJson, "context", "未包含派单内容");
         Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息");
@@ -100,10 +112,11 @@ public class RepairFinishListener extends AbstractServiceApiPlusListener {
     }
 
     @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-        String userId = reqJson.getString("userId");
-        String userName = reqJson.getString("userName");
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+        String userId = context.getReqHeaders().get("user-id");
+        String userName = context.getReqHeaders().get("user-name");
         String publicArea = reqJson.getString("publicArea");
+        int flag = 0;
         //获取报修渠道
         String repairChannel = reqJson.getString("repairChannel");
         //获取维修类型
@@ -283,7 +296,10 @@ public class RepairFinishListener extends AbstractServiceApiPlusListener {
                     userStorehousePo.setResId(resId);
                     userStorehousePo.setUserId(userId);
                     //更新库存
-                    super.update(context, userStorehousePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_USER_STOREHOUSE);
+                    flag = userStorehouseV1InnerServiceSMOImpl.updateUserStorehouse(userStorehousePo);
+                    if (flag < 1) {
+                        throw new CmdException("修改工单失败");
+                    }
                 }
                 //往物品使用记录表插入数据
                 ResourceStoreUseRecordPo resourceStoreUseRecordPo = new ResourceStoreUseRecordPo();
@@ -305,9 +321,15 @@ public class RepairFinishListener extends AbstractServiceApiPlusListener {
                 //有偿服务
                 if (maintenanceType.equals("1001")) {
                     resourceStoreUseRecordPo.setUnitPrice(paramIn.getString("price"));
-                    super.insert(context, resourceStoreUseRecordPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_RESOURCE_STORE_USE_RECORD);
+                    flag = resourceStoreUseRecordV1InnerServiceSMOImpl.saveResourceStoreUseRecord(resourceStoreUseRecordPo);
+                    if (flag < 1) {
+                        throw new CmdException("添加失败");
+                    }
                 } else if (maintenanceType.equals("1003")) {  //需要用料
-                    super.insert(context, resourceStoreUseRecordPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_RESOURCE_STORE_USE_RECORD);
+                    flag = resourceStoreUseRecordV1InnerServiceSMOImpl.saveResourceStoreUseRecord(resourceStoreUseRecordPo);
+                    if (flag < 1) {
+                        throw new CmdException("添加失败");
+                    }
                 }
                 if (!StringUtil.isEmpty(repairMaterials)) {
                     repairMaterial += repairMaterials + ";";
@@ -324,7 +346,10 @@ public class RepairFinishListener extends AbstractServiceApiPlusListener {
         repairUserPo.setState(RepairUserDto.STATE_CLOSE);
         repairUserPo.setContext(reqJson.getString("context"));
         repairUserPo.setCommunityId(reqJson.getString("communityId"));
-        super.update(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR_USER);
+        flag = repairUserV1InnerServiceSMOImpl.updateRepairUserNew(repairUserPo);
+        if (flag < 1) {
+            throw new CmdException("修改用户失败");
+        }
         if ((!StringUtil.isEmpty(repairChannel) && "Z".equals(repairChannel))
                 || (!StringUtil.isEmpty(maintenanceType) && "1001".equals(maintenanceType))) {  //如果是业主报修或者是有偿的就生成一条新状态,否则不变
             //2.0 给开始节点派支付单
@@ -393,7 +418,10 @@ public class RepairFinishListener extends AbstractServiceApiPlusListener {
             repairUserPo.setPreRuId(repairUserDtos.get(0).getRuId());
             repairUserPo.setRepairEvent(RepairUserDto.REPAIR_EVENT_PAY_USER);
             repairUserPo.setCommunityId(reqJson.getString("communityId"));
-            super.insert(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_REPAIR_USER);
+            flag = repairUserV1InnerServiceSMOImpl.saveRepairUserNew(repairUserPo);
+            if (flag < 1) {
+                throw new CmdException("修改用户失败");
+            }
         }
         //维修前图片处理
         if (reqJson.containsKey("beforeRepairPhotos") && !StringUtils.isEmpty(reqJson.getString("beforeRepairPhotos"))) {
@@ -416,7 +444,10 @@ public class RepairFinishListener extends AbstractServiceApiPlusListener {
                 businessUnit.put("fileRealName", fileName);
                 businessUnit.put("fileSaveName", fileName);
                 FileRelPo fileRelPo = BeanConvertUtil.covertBean(businessUnit, FileRelPo.class);
-                super.insert(context, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL);
+                flag = fileRelInnerServiceSMOImpl.saveFileRel(fileRelPo);
+                if (flag < 1) {
+                    throw new CmdException("保存图片失败");
+                }
             }
         }
         //维修后图片处理
@@ -440,7 +471,10 @@ public class RepairFinishListener extends AbstractServiceApiPlusListener {
                 businessUnit.put("fileRealName", fileName);
                 businessUnit.put("fileSaveName", fileName);
                 FileRelPo fileRelPo = BeanConvertUtil.covertBean(businessUnit, FileRelPo.class);
-                super.insert(context, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL);
+                flag = fileRelInnerServiceSMOImpl.saveFileRel(fileRelPo);
+                if (flag < 1) {
+                    throw new CmdException("保存图片失败");
+                }
             }
         }
         if ("F".equals(publicArea) && "1002".equals(reqJson.getString("maintenanceType"))) { //如果不是公共区域且是无偿的走下面
@@ -448,11 +482,14 @@ public class RepairFinishListener extends AbstractServiceApiPlusListener {
             RepairPoolPo repairPoolPo = new RepairPoolPo();
             repairPoolPo.setRepairId(reqJson.getString("repairId"));
             repairPoolPo.setMaintenanceType(reqJson.getString("maintenanceType"));
-            super.update(context, repairPoolPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR);
+            flag = repairPoolV1InnerServiceSMOImpl.updateRepairPoolNew(repairPoolPo);
+            if (flag < 1) {
+                throw new CmdException("修改失败");
+            }
             if ("Z".equals(repairChannel)) { //如果是电话报修和员工代客报修结单后状态变为待回访
-                ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_APPRAISE);
+                modifyBusinessRepairDispatch(reqJson, RepairDto.STATE_APPRAISE);
             } else { //如果是业主自主报修结单后状态变为待评价
-                ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_RETURN_VISIT);
+                modifyBusinessRepairDispatch(reqJson, RepairDto.STATE_RETURN_VISIT);
             }
         } else if ("F".equals(publicArea) && "1001".equals(reqJson.getString("maintenanceType"))) { //如果不是公共区域且是有偿的走下面
             //3.0 生成支付费用
@@ -492,14 +529,21 @@ public class RepairFinishListener extends AbstractServiceApiPlusListener {
             feePo.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
             feePo.setState(FeeDto.STATE_DOING);
             feePo.setUserId(userId);
-            super.insert(context, feePo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FEE_INFO);
+
+            flag = payFeeV1InnerServiceSMOImpl.savePayFee(feePo);
+            if (flag < 1) {
+                throw new CmdException("添加费用失败");
+            }
             FeeAttrPo feeAttrPo = new FeeAttrPo();
-            feeAttrPo.setAttrId("-1");
+            feeAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId));
             feeAttrPo.setFeeId(feePo.getFeeId());
             feeAttrPo.setSpecCd(FeeAttrDto.SPEC_CD_REPAIR);
             feeAttrPo.setCommunityId(reqJson.getString("communityId"));
             feeAttrPo.setValue(reqJson.getString("repairId"));
-            super.insert(context, feeAttrPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FEE_INFO);
+            flag = feeAttrInnerServiceSMOImpl.saveFeeAttr(feeAttrPo);
+            if (flag < 1) {
+                throw new CmdException("添加费用失败");
+            }
             //改变r_repair_pool表maintenance_type维修类型
             RepairPoolPo repairPoolPo = new RepairPoolPo();
             repairPoolPo.setRepairId(reqJson.getString("repairId"));
@@ -511,8 +555,11 @@ public class RepairFinishListener extends AbstractServiceApiPlusListener {
             repairPoolPo.setRepairFee(repairFee.substring(0, repairFee.length() - 1));
             //支付方式
             repairPoolPo.setPayType(reqJson.getString("payType"));
-            super.update(context, repairPoolPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR);
-            ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_PAY);
+            flag = repairPoolV1InnerServiceSMOImpl.updateRepairPoolNew(repairPoolPo);
+            if (flag < 1) {
+                throw new CmdException("修改失败");
+            }
+            modifyBusinessRepairDispatch(reqJson, RepairDto.STATE_PAY);
         } else if ("T".equals(publicArea)) {  //公共区域走这里
             //公共区域用料时修改维修类型和用料
             if ("1003".equals(maintenanceType)) {
@@ -523,39 +570,36 @@ public class RepairFinishListener extends AbstractServiceApiPlusListener {
                 repairPoolPo.setMaintenanceType(reqJson.getString("maintenanceType"));
                 //用料
                 repairPoolPo.setRepairMaterials(repairMaterial.substring(0, repairMaterial.length() - 1));
-                super.update(context, repairPoolPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR);
+                flag = repairPoolV1InnerServiceSMOImpl.updateRepairPoolNew(repairPoolPo);
+                if (flag < 1) {
+                    throw new CmdException("修改失败");
+                }
             }
 
             if ("Z".equals(repairChannel)) { //如果是电话报修和员工代客报修结单后状态变为待回访
-                ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_APPRAISE);
+                modifyBusinessRepairDispatch(reqJson, RepairDto.STATE_APPRAISE);
             } else { //如果是业主自主报修结单后状态变为待评价
-                ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_RETURN_VISIT);
+                modifyBusinessRepairDispatch(reqJson, RepairDto.STATE_RETURN_VISIT);
             }
         }
         ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_OK, ResultVo.MSG_OK);
         context.setResponseEntity(responseEntity);
     }
 
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeRepairDispatchStepConstant.BINDING_REPAIR_FINISH;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-    public IRepairInnerServiceSMO getRepairInnerServiceSMOImpl() {
-        return repairInnerServiceSMOImpl;
-    }
-
-    public void setRepairInnerServiceSMOImpl(IRepairInnerServiceSMO repairInnerServiceSMOImpl) {
-        this.repairInnerServiceSMOImpl = repairInnerServiceSMOImpl;
+    public void modifyBusinessRepairDispatch(JSONObject paramInJson, String state) {
+        //查询报修单
+        RepairDto repairDto = new RepairDto();
+        repairDto.setRepairId(paramInJson.getString("repairId"));
+        List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto);
+        Assert.isOne(repairDtos, "查询到多条数据,repairId=" + repairDto.getRepairId());
+        JSONObject businessOwnerRepair = new JSONObject();
+        businessOwnerRepair.putAll(BeanConvertUtil.beanCovertMap(repairDtos.get(0)));
+        businessOwnerRepair.put("state", state);
+        //计算 应收金额
+        RepairPoolPo repairPoolPo = BeanConvertUtil.covertBean(businessOwnerRepair, RepairPoolPo.class);
+        int flag = repairPoolV1InnerServiceSMOImpl.updateRepairPoolNew(repairPoolPo);
+        if (flag < 1) {
+            throw new CmdException("修改工单失败");
+        }
     }
 }

+ 49 - 48
service-api/src/main/java/com/java110/api/listener/ownerRepair/RepairForceFinishListener.java

@@ -1,44 +1,37 @@
-package com.java110.api.listener.ownerRepair;
+package com.java110.community.cmd.ownerRepair;
 
 import com.alibaba.fastjson.JSONObject;
-import com.java110.api.bmo.ownerRepair.IOwnerRepairBMO;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
+import com.java110.core.annotation.Java110Cmd;
 import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
 import com.java110.dto.repair.RepairDto;
 import com.java110.dto.repair.RepairUserDto;
 import com.java110.intf.common.IFileInnerServiceSMO;
 import com.java110.intf.community.IRepairInnerServiceSMO;
+import com.java110.intf.community.IRepairPoolV1InnerServiceSMO;
 import com.java110.intf.community.IRepairUserInnerServiceSMO;
+import com.java110.intf.community.IRepairUserV1InnerServiceSMO;
 import com.java110.intf.fee.IFeeConfigInnerServiceSMO;
 import com.java110.intf.user.IOwnerInnerServiceSMO;
 import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
+import com.java110.po.owner.RepairPoolPo;
 import com.java110.po.owner.RepairUserPo;
 import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ServiceCodeRepairDispatchStepConstant;
+import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.DateUtil;
 import com.java110.vo.ResultVo;
-import org.slf4j.Logger;
-import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
 import org.springframework.http.ResponseEntity;
 
+import java.text.ParseException;
 import java.util.List;
 
-/**
- * 强制回单
- * add by wuxw 2019-06-30
- */
-@Java110Listener("repairForceFinishListener")
-public class RepairForceFinishListener extends AbstractServiceApiPlusListener {
-
-    private static Logger logger = LoggerFactory.getLogger(RepairForceFinishListener.class);
-
-    @Autowired
-    private IOwnerRepairBMO ownerRepairBMOImpl;
+@Java110Cmd(serviceCode = "ownerRepair.repairForceFinish")
+public class RepairForceFinishCmd extends Cmd {
 
     @Autowired
     private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl;
@@ -58,17 +51,25 @@ public class RepairForceFinishListener extends AbstractServiceApiPlusListener {
     @Autowired
     private IOwnerInnerServiceSMO ownerInnerServiceSMO;
 
+    @Autowired
+    private IRepairPoolV1InnerServiceSMO repairPoolV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IRepairUserV1InnerServiceSMO repairUserV1InnerServiceSMOImpl;
+
     @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         Assert.hasKeyAndValue(reqJson, "repairId", "未包含报修单信息");
         Assert.hasKeyAndValue(reqJson, "context", "未包含派单内容");
         Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息");
     }
 
     @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-        String userId = reqJson.getString("userId");
-        String userName = reqJson.getString("userName");
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+        String userId = context.getReqHeaders().get("user-id");
+        String userName = context.getReqHeaders().get("user-name");
+
+        int flag = 0;
 
         RepairDto repairDto = new RepairDto();
         repairDto.setRepairId(reqJson.getString("repairId"));
@@ -96,7 +97,10 @@ public class RepairForceFinishListener extends AbstractServiceApiPlusListener {
             repairUserPo.setState(RepairUserDto.STATE_CLOSE);
             repairUserPo.setContext(userName + " 强制回单");
             repairUserPo.setCommunityId(reqJson.getString("communityId"));
-            super.update(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR_USER);
+            flag = repairUserV1InnerServiceSMOImpl.updateRepairUserNew(repairUserPo);
+            if(flag < 1){
+                throw new CmdException("修改工单失败");
+            }
 
             repairUserPo = new RepairUserPo();
             repairUserPo.setRuId("-1");
@@ -112,36 +116,33 @@ public class RepairForceFinishListener extends AbstractServiceApiPlusListener {
             repairUserPo.setRepairEvent(RepairUserDto.REPAIR_EVENT_AUDIT_USER);
             repairUserPo.setContext(reqJson.getString("context"));
             repairUserPo.setCommunityId(reqJson.getString("communityId"));
-            super.insert(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_REPAIR_USER);
+            flag = repairUserV1InnerServiceSMOImpl.saveRepairUserNew(repairUserPo);
+            if(flag < 1){
+                throw new CmdException("修改工单失败");
+            }
         }
 
         reqJson.put("state", RepairDto.STATE_RETURN_VISIT);
-        ownerRepairBMOImpl.modifyBusinessRepairDispatch(reqJson, context, RepairDto.STATE_RETURN_VISIT);
+        modifyBusinessRepairDispatch(reqJson, RepairDto.STATE_RETURN_VISIT);
 
         ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_OK, ResultVo.MSG_OK);
         context.setResponseEntity(responseEntity);
     }
 
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeRepairDispatchStepConstant.BINDING_REPAIR_FORCE_FINISH;
-    }
-
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
-
-    @Override
-    public int getOrder() {
-        return DEFAULT_ORDER;
-    }
-
-    public IRepairInnerServiceSMO getRepairInnerServiceSMOImpl() {
-        return repairInnerServiceSMOImpl;
-    }
-
-    public void setRepairInnerServiceSMOImpl(IRepairInnerServiceSMO repairInnerServiceSMOImpl) {
-        this.repairInnerServiceSMOImpl = repairInnerServiceSMOImpl;
+    public void modifyBusinessRepairDispatch(JSONObject paramInJson, String state) {
+        //查询报修单
+        RepairDto repairDto = new RepairDto();
+        repairDto.setRepairId(paramInJson.getString("repairId"));
+        List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto);
+        Assert.isOne(repairDtos, "查询到多条数据,repairId=" + repairDto.getRepairId());
+        JSONObject businessOwnerRepair = new JSONObject();
+        businessOwnerRepair.putAll(BeanConvertUtil.beanCovertMap(repairDtos.get(0)));
+        businessOwnerRepair.put("state", state);
+        //计算 应收金额
+        RepairPoolPo repairPoolPo = BeanConvertUtil.covertBean(businessOwnerRepair, RepairPoolPo.class);
+        int flag = repairPoolV1InnerServiceSMOImpl.updateRepairPoolNew(repairPoolPo);
+        if(flag < 1){
+            throw new CmdException("修改工单失败");
+        }
     }
 }

+ 26 - 27
service-api/src/main/java/com/java110/api/listener/ownerRepair/RepairStartListener.java

@@ -1,35 +1,31 @@
-package com.java110.api.listener.ownerRepair;
+package com.java110.community.cmd.ownerRepair;
 
 import com.alibaba.fastjson.JSONObject;
-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.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
 import com.java110.dto.repair.RepairDto;
 import com.java110.dto.repair.RepairUserDto;
 import com.java110.intf.community.IRepairInnerServiceSMO;
+import com.java110.intf.community.IRepairPoolV1InnerServiceSMO;
 import com.java110.intf.community.IRepairUserInnerServiceSMO;
+import com.java110.intf.community.IRepairUserV1InnerServiceSMO;
 import com.java110.po.owner.RepairPoolPo;
 import com.java110.po.owner.RepairUserPo;
 import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ServiceCodeRepairDispatchStepConstant;
+import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
 
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 
-/**
- * 启动报修单
- *
- * @author fqz
- * @date 2021-12-24
- */
-@Java110Listener("repairStartListener")
-public class RepairStartListener extends AbstractServiceApiPlusListener {
+@Java110Cmd(serviceCode = "ownerRepair.repairStart")
+public class RepairStartCmd extends Cmd {
 
     @Autowired
     private IRepairInnerServiceSMO repairInnerServiceSMOImpl;
@@ -37,35 +33,35 @@ public class RepairStartListener extends AbstractServiceApiPlusListener {
     @Autowired
     private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl;
 
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeRepairDispatchStepConstant.BINDING_REPAIR_START;
-    }
+    @Autowired
+    private IRepairPoolV1InnerServiceSMO repairPoolV1InnerServiceSMOImpl;
 
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
+    @Autowired
+    private IRepairUserV1InnerServiceSMO repairUserV1InnerServiceSMOImpl;
 
     @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         Assert.hasKeyAndValue(reqJson, "repairId", "未包含报修单信息");
         Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息");
     }
 
     @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
         RepairDto repairDto = new RepairDto();
         repairDto.setRepairId(reqJson.getString("repairId"));
         //查询报修信息
         List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto);
         Assert.listOnlyOne(repairDtos, "查询报修信息错误!");
         String state = repairDtos.get(0).getState();
+        int flag = 0;
         if (!StringUtil.isEmpty(state) && state.equals(RepairDto.STATE_STOP)) { //状态是暂停状态
             RepairPoolPo repairPoolPo = new RepairPoolPo();
             repairPoolPo.setRepairId(reqJson.getString("repairId"));
             repairPoolPo.setState(RepairDto.STATE_TAKING); //状态变为接单状态
-            super.update(context, repairPoolPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR);
+            flag = repairPoolV1InnerServiceSMOImpl.updateRepairPoolNew(repairPoolPo);
+            if(flag < 1){
+                throw new CmdException("修改工单失败");
+            }
             RepairUserDto repairUserDto = new RepairUserDto();
             repairUserDto.setRepairId(reqJson.getString("repairId"));
             repairUserDto.setState(RepairUserDto.STATE_STOP); //暂停状态
@@ -79,7 +75,10 @@ public class RepairStartListener extends AbstractServiceApiPlusListener {
                         repairUserPo.setRuId(repairUser.getRuId());
                         repairUserPo.setEndTime(simpleDateFormat.format(new Date()));
                         //修改暂停报修状态
-                        super.update(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR_USER);
+                        flag = repairUserV1InnerServiceSMOImpl.updateRepairUserNew(repairUserPo);
+                        if(flag < 1){
+                            throw new CmdException("修改工单失败");
+                        }
                     }
                 }
             } else {

+ 25 - 28
service-api/src/main/java/com/java110/api/listener/ownerRepair/RepairStopListener.java

@@ -1,38 +1,32 @@
-package com.java110.api.listener.ownerRepair;
+package com.java110.community.cmd.ownerRepair;
 
 import com.alibaba.fastjson.JSONObject;
-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.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.RepairDto;
 import com.java110.dto.repair.RepairUserDto;
 import com.java110.intf.community.IRepairInnerServiceSMO;
+import com.java110.intf.community.IRepairPoolV1InnerServiceSMO;
 import com.java110.intf.community.IRepairUserInnerServiceSMO;
+import com.java110.intf.community.IRepairUserV1InnerServiceSMO;
 import com.java110.po.owner.RepairPoolPo;
 import com.java110.po.owner.RepairUserPo;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ServiceCodeRepairDispatchStepConstant;
+import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 
-/**
- * 暂停报修单
- *
- * @author fqz
- * @date 2021-12-24
- */
-@Java110Listener("repairStopListener")
-public class RepairStopListener extends AbstractServiceApiPlusListener {
+@Java110Cmd(serviceCode = "ownerRepair.repairStop")
+public class RepairStopCmd extends Cmd {
 
     @Autowired
     private IRepairInnerServiceSMO repairInnerServiceSMOImpl;
@@ -40,36 +34,36 @@ public class RepairStopListener extends AbstractServiceApiPlusListener {
     @Autowired
     private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl;
 
-    @Override
-    public String getServiceCode() {
-        return ServiceCodeRepairDispatchStepConstant.BINDING_REPAIR_STOP;
-    }
+    @Autowired
+    private IRepairPoolV1InnerServiceSMO repairPoolV1InnerServiceSMOImpl;
 
-    @Override
-    public HttpMethod getHttpMethod() {
-        return HttpMethod.POST;
-    }
+    @Autowired
+    private IRepairUserV1InnerServiceSMO repairUserV1InnerServiceSMOImpl;
 
     @Override
-    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) throws ParseException {
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         Assert.hasKeyAndValue(reqJson, "repairId", "未包含报修单信息");
         Assert.hasKeyAndValue(reqJson, "remark", "未包含派单内容");
         Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区信息");
     }
 
     @Override
-    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) throws ParseException {
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
         RepairDto repairDto = new RepairDto();
         repairDto.setRepairId(reqJson.getString("repairId"));
         //查询报修信息
         List<RepairDto> repairDtos = repairInnerServiceSMOImpl.queryRepairs(repairDto);
         Assert.listOnlyOne(repairDtos, "查询报修单错误!");
         String state = repairDtos.get(0).getState();
+        int flag = 0;
         if (!StringUtil.isEmpty(state) && !state.equals(RepairDto.STATE_STOP)) { //报修单不是暂停状态
             RepairPoolPo repairPoolPo = BeanConvertUtil.covertBean(reqJson, RepairPoolPo.class);
             repairPoolPo.setState(RepairDto.STATE_STOP); //将报修状态变为暂停状态
             //更新报修状态
-            super.update(context, repairPoolPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR);
+            flag = repairPoolV1InnerServiceSMOImpl.updateRepairPoolNew(repairPoolPo);
+            if (flag < 1) {
+                throw new CmdException("修改工单失败");
+            }
             RepairUserPo repairUserPo = new RepairUserPo();
             repairUserPo.setRuId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ruId)); //报修派单id
             repairUserPo.setRepairId(reqJson.getString("repairId")); //报修派单
@@ -91,7 +85,10 @@ public class RepairStopListener extends AbstractServiceApiPlusListener {
             repairUserPo.setStartTime(simpleDateFormat.format(new Date())); //开始时间
             repairUserPo.setRepairEvent(RepairUserDto.REPAIR_EVENT_AUDIT_USER); //审核用户
             repairUserPo.setPreRuId(repairUserDtos.get(0).getRuId()); //上一节点处理id
-            super.insert(context, repairUserPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_REPAIR_USER);
+            flag = repairUserV1InnerServiceSMOImpl.saveRepairUserNew(repairUserPo);
+            if (flag < 1) {
+                throw new CmdException("添加工单失败");
+            }
         }
     }
 }

+ 72 - 0
service-community/src/main/java/com/java110/community/dao/IRepairUserNewV1ServiceDao.java

@@ -0,0 +1,72 @@
+/*
+ * 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 java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2021-12-06 22:33:06 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 IRepairUserNewV1ServiceDao {
+
+
+    /**
+     * 保存 费用明细信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveRepairUserNewInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询费用明细信息(instance过程)
+     * 根据bId 查询费用明细信息
+     * @param info bId 信息
+     * @return 费用明细信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getRepairUserNewInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改费用明细信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateRepairUserNewInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询费用明细总数
+     *
+     * @param info 费用明细信息
+     * @return 费用明细数量
+     */
+    int queryRepairUserNewsCount(Map info);
+
+}

+ 108 - 0
service-community/src/main/java/com/java110/community/dao/impl/RepairUserNewV1ServiceDaoImpl.java

@@ -0,0 +1,108 @@
+/*
+ * 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.java110.core.base.dao.BaseServiceDao;
+import com.java110.core.log.LoggerFactory;
+import com.java110.community.dao.IRepairUserNewV1ServiceDao;
+import com.java110.utils.exception.DAOException;
+import org.slf4j.Logger;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2021-12-06 22:33:06 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("repairUserNewV1ServiceDaoImpl")
+public class RepairUserNewV1ServiceDaoImpl extends BaseServiceDao implements IRepairUserNewV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(RepairUserNewV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存费用明细信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveRepairUserNewInfo(Map info) throws DAOException {
+        logger.debug("保存 saveRepairUserNewInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("repairUserNewV1ServiceDaoImpl.saveRepairUserNewInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询费用明细信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getRepairUserNewInfo(Map info) throws DAOException {
+        logger.debug("查询 getRepairUserNewInfo 入参 info : {}",info);
+
+        List<Map> businessRepairUserNewInfos = sqlSessionTemplate.selectList("repairUserNewV1ServiceDaoImpl.getRepairUserNewInfo",info);
+
+        return businessRepairUserNewInfos;
+    }
+
+
+    /**
+     * 修改费用明细信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateRepairUserNewInfo(Map info) throws DAOException {
+        logger.debug("修改 updateRepairUserNewInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("repairUserNewV1ServiceDaoImpl.updateRepairUserNewInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询费用明细数量
+     * @param info 费用明细信息
+     * @return 费用明细数量
+     */
+    @Override
+    public int queryRepairUserNewsCount(Map info) {
+        logger.debug("查询 queryRepairUserNewsCount 入参 info : {}",info);
+
+        List<Map> businessRepairUserNewInfos = sqlSessionTemplate.selectList("repairUserNewV1ServiceDaoImpl.queryRepairUserNewsCount", info);
+        if (businessRepairUserNewInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessRepairUserNewInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 4 - 6
service-fee/src/main/java/com/java110/fee/smo/impl/RepairUserNewV1InnerServiceSMOImpl.java

@@ -13,22 +13,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.java110.fee.smo.impl;
+package com.java110.community.smo.impl;
 
 
 import com.java110.dto.repair.RepairUserDto;
-import com.java110.fee.dao.IRepairUserNewV1ServiceDao;
-import com.java110.intf.fee.IRepairUserNewV1InnerServiceSMO;
+import com.java110.community.dao.IRepairUserNewV1ServiceDao;
+import com.java110.intf.community.IRepairUserV1InnerServiceSMO;
 import com.java110.po.owner.RepairUserPo;
 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;
 
 /**
@@ -40,7 +38,7 @@ import java.util.List;
  * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
  */
 @RestController
-public class RepairUserNewV1InnerServiceSMOImpl extends BaseServiceSMO implements IRepairUserNewV1InnerServiceSMO {
+public class RepairUserV1InnerServiceSMOImpl extends BaseServiceSMO implements IRepairUserV1InnerServiceSMO {
 
     @Autowired
     private IRepairUserNewV1ServiceDao repairUserNewV1ServiceDaoImpl;

+ 1 - 1
service-fee/src/main/java/com/java110/fee/cmd/fee/PayBatchFeeCmd.java

@@ -92,7 +92,7 @@ public class PayBatchFeeCmd extends Cmd {
     @Autowired
     private IRepairPoolV1InnerServiceSMO repairPoolNewV1InnerServiceSMOImpl;
     @Autowired
-    private IRepairUserNewV1InnerServiceSMO repairUserNewV1InnerServiceSMOImpl;
+    private IRepairUserV1InnerServiceSMO repairUserNewV1InnerServiceSMOImpl;
 
     @Autowired
     private IComputeFeeSMO computeFeeSMOImpl;

+ 1 - 1
service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeCmd.java

@@ -112,7 +112,7 @@ public class PayFeeCmd extends Cmd {
     private IRepairPoolV1InnerServiceSMO repairPoolNewV1InnerServiceSMOImpl;
 
     @Autowired
-    private IRepairUserNewV1InnerServiceSMO repairUserNewV1InnerServiceSMOImpl;
+    private IRepairUserV1InnerServiceSMO repairUserNewV1InnerServiceSMOImpl;
 
     @Autowired
     private ICouponUserV1InnerServiceSMO couponUserV1InnerServiceSMOImpl;

+ 2 - 5
service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeConfirmCmd.java

@@ -23,10 +23,7 @@ import com.java110.fee.bmo.fee.IFeeBMO;
 import com.java110.intf.acct.IAccountInnerServiceSMO;
 import com.java110.intf.acct.ICouponUserDetailV1InnerServiceSMO;
 import com.java110.intf.acct.ICouponUserV1InnerServiceSMO;
-import com.java110.intf.community.IParkingSpaceApplyV1InnerServiceSMO;
-import com.java110.intf.community.IRepairPoolV1InnerServiceSMO;
-import com.java110.intf.community.IRepairUserInnerServiceSMO;
-import com.java110.intf.community.IRoomInnerServiceSMO;
+import com.java110.intf.community.*;
 import com.java110.intf.fee.*;
 import com.java110.intf.user.IOwnerCarInnerServiceSMO;
 import com.java110.po.accountDetail.AccountDetailPo;
@@ -94,7 +91,7 @@ public class PayFeeConfirmCmd extends Cmd {
     @Autowired
     private IRepairPoolV1InnerServiceSMO repairPoolNewV1InnerServiceSMOImpl;
     @Autowired
-    private IRepairUserNewV1InnerServiceSMO repairUserNewV1InnerServiceSMOImpl;
+    private IRepairUserV1InnerServiceSMO repairUserNewV1InnerServiceSMOImpl;
     @Autowired
     private ICouponUserV1InnerServiceSMO couponUserV1InnerServiceSMOImpl;
     @Autowired