wuxw лет назад: 2
Родитель
Сommit
a93dc51a84

+ 3 - 0
java110-bean/src/main/java/com/java110/dto/repair/RepairUserDto.java

@@ -33,6 +33,9 @@ public class RepairUserDto extends PageDto implements Serializable {
     public static final String STATE_FINISH = "10007";//评价完成
     public static final String STATE_FINISH_VISIT = "10008";//已回访
     public static final String STATE_PAY_FEE = "10009";//待支付
+    public static final String STATE_REPLY_APPRAISE = "10010";//评价回复
+
+
     public static final String STATE_EVALUATE = "11000";//待评价
     public static final String STATE_FINISH_PAY_FEE = "12000";//已支付
     public static final String STATE_STOP = "12001";//暂停

+ 82 - 86
java110-db/src/main/resources/mapper/user/OwnerCarOpenUserV1ServiceDaoImplMapper.xml

@@ -5,111 +5,107 @@
 <mapper namespace="ownerCarOpenUserV1ServiceDaoImpl">
 
 
-
-
-
     <!-- 保存车辆微信关系信息 add by wuxw 2018-07-03 -->
     <insert id="saveOwnerCarOpenUserInfo" parameterType="Map">
         insert into owner_car_open_user(
-open_id,nickname,headimgurl,car_num,open_user_id,open_type
-) values (
-#{openId},#{nickname},#{headimgurl},#{carNum},#{openUserId},#{openType}
-)
+        open_id,nickname,headimgurl,car_num,open_user_id,open_type
+        ) values (
+        #{openId},#{nickname},#{headimgurl},#{carNum},#{openUserId},#{openType}
+        )
     </insert>
 
 
-
     <!-- 查询车辆微信关系信息 add by wuxw 2018-07-03 -->
     <select id="getOwnerCarOpenUserInfo" parameterType="Map" resultType="Map">
-        select  t.open_id,t.open_id openId,t.nickname,t.headimgurl,t.car_num,t.car_num carNum,t.status_cd,t.status_cd statusCd,t.open_user_id,t.open_user_id openUserId,t.open_type,t.open_type openType 
-from owner_car_open_user t 
-where 1 =1 
-<if test="openId !=null and openId != ''">
-   and t.open_id= #{openId}
-</if> 
-<if test="nickname !=null and nickname != ''">
-   and t.nickname= #{nickname}
-</if> 
-<if test="headimgurl !=null and headimgurl != ''">
-   and t.headimgurl= #{headimgurl}
-</if> 
-<if test="carNum !=null and carNum != ''">
-   and t.car_num= #{carNum}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="openUserId !=null and openUserId != ''">
-   and t.open_user_id= #{openUserId}
-</if> 
-<if test="openType !=null and openType != ''">
-   and t.open_type= #{openType}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.open_id,t.open_id openId,t.nickname,t.headimgurl,t.car_num,t.car_num carNum,t.status_cd,t.status_cd
+        statusCd,t.open_user_id,t.open_user_id openUserId,t.open_type,t.open_type openType
+        from owner_car_open_user t
+        where 1 =1
+        <if test="openId !=null and openId != ''">
+            and t.open_id= #{openId}
+        </if>
+        <if test="nickname !=null and nickname != ''">
+            and t.nickname= #{nickname}
+        </if>
+        <if test="headimgurl !=null and headimgurl != ''">
+            and t.headimgurl= #{headimgurl}
+        </if>
+        <if test="carNum !=null and carNum != ''">
+            and t.car_num= #{carNum}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="openUserId !=null and openUserId != ''">
+            and t.open_user_id= #{openUserId}
+        </if>
+        <if test="openType !=null and openType != ''">
+            and t.open_type= #{openType}
+        </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="updateOwnerCarOpenUserInfo" parameterType="Map">
-        update  owner_car_open_user t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="openId !=null and openId != ''">
-, t.open_id= #{openId}
-</if> 
-<if test="nickname !=null and nickname != ''">
-, t.nickname= #{nickname}
-</if> 
-<if test="headimgurl !=null and headimgurl != ''">
-, t.headimgurl= #{headimgurl}
-</if> 
-<if test="carNum !=null and carNum != ''">
-, t.car_num= #{carNum}
-</if> 
-<if test="openType !=null and openType != ''">
-, t.open_type= #{openType}
-</if> 
- where 1=1 <if test="openUserId !=null and openUserId != ''">
-and t.open_user_id= #{openUserId}
-</if> 
+        update owner_car_open_user t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="openId !=null and openId != ''">
+            , t.open_id= #{openId}
+        </if>
+        <if test="nickname !=null and nickname != ''">
+            , t.nickname= #{nickname}
+        </if>
+        <if test="headimgurl !=null and headimgurl != ''">
+            , t.headimgurl= #{headimgurl}
+        </if>
+        <if test="carNum !=null and carNum != ''">
+            , t.car_num= #{carNum}
+        </if>
+        <if test="openType !=null and openType != ''">
+            , t.open_type= #{openType}
+        </if>
+        where 1=1
+        <if test="openUserId !=null and openUserId != ''">
+            and t.open_user_id= #{openUserId}
+        </if>
 
     </update>
 
     <!-- 查询车辆微信关系数量 add by wuxw 2018-07-03 -->
-     <select id="queryOwnerCarOpenUsersCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from owner_car_open_user t 
-where 1 =1 
-<if test="openId !=null and openId != ''">
-   and t.open_id= #{openId}
-</if> 
-<if test="nickname !=null and nickname != ''">
-   and t.nickname= #{nickname}
-</if> 
-<if test="headimgurl !=null and headimgurl != ''">
-   and t.headimgurl= #{headimgurl}
-</if> 
-<if test="carNum !=null and carNum != ''">
-   and t.car_num= #{carNum}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="openUserId !=null and openUserId != ''">
-   and t.open_user_id= #{openUserId}
-</if> 
-<if test="openType !=null and openType != ''">
-   and t.open_type= #{openType}
-</if> 
+    <select id="queryOwnerCarOpenUsersCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from owner_car_open_user t
+        where 1 =1
+        <if test="openId !=null and openId != ''">
+            and t.open_id= #{openId}
+        </if>
+        <if test="nickname !=null and nickname != ''">
+            and t.nickname= #{nickname}
+        </if>
+        <if test="headimgurl !=null and headimgurl != ''">
+            and t.headimgurl= #{headimgurl}
+        </if>
+        <if test="carNum !=null and carNum != ''">
+            and t.car_num= #{carNum}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="openUserId !=null and openUserId != ''">
+            and t.open_user_id= #{openUserId}
+        </if>
+        <if test="openType !=null and openType != ''">
+            and t.open_type= #{openType}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>

+ 77 - 0
service-community/src/main/java/com/java110/community/cmd/repair/ReplyRepairAppraiseCmd.java

@@ -0,0 +1,77 @@
+package com.java110.community.cmd.repair;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.CmdContextUtils;
+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.RepairUserDto;
+import com.java110.dto.user.UserDto;
+import com.java110.intf.community.IRepairUserV1InnerServiceSMO;
+import com.java110.intf.user.IUserV1InnerServiceSMO;
+import com.java110.po.owner.RepairUserPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.DateUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.text.ParseException;
+import java.util.List;
+
+/**
+ * 报修评论回复
+ */
+@Java110Cmd(serviceCode = "repair.replyRepairAppraise")
+public class ReplyRepairAppraiseCmd extends Cmd {
+
+    @Autowired
+    private IRepairUserV1InnerServiceSMO repairUserV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl;
+
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区ID");
+        Assert.hasKeyAndValue(reqJson, "replyContext", "未包含回复内容");
+        Assert.hasKeyAndValue(reqJson, "ruId", "未包含评论ID");
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+
+        String userId = CmdContextUtils.getUserId(context);
+
+        UserDto userDto = new UserDto();
+        userDto.setUserId(userId);
+        List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto);
+
+        Assert.listOnlyOne(userDtos, "用户未登录");
+
+        RepairUserDto repairUserDto = new RepairUserDto();
+        repairUserDto.setRuId(reqJson.getString("ruId"));
+        List<RepairUserDto> repairUserDtos = repairUserV1InnerServiceSMOImpl.queryRepairUserNews(repairUserDto);
+
+        Assert.listOnlyOne(repairUserDtos, "评论不存在");
+
+        RepairUserPo repairUserPo = new RepairUserPo();
+        repairUserPo.setRuId(GenerateCodeFactory.getGeneratorId("11"));
+        repairUserPo.setRepairId(repairUserDtos.get(0).getRepairId());
+        repairUserPo.setUserId(userDtos.get(0).getUserId());
+        repairUserPo.setCommunityId(repairUserDtos.get(0).getCommunityId());
+        repairUserPo.setState(RepairUserDto.STATE_REPLY_APPRAISE);
+        repairUserPo.setContext("回复" + repairUserDtos.get(0).getStaffName() + ":" + reqJson.getString("replyContext"));
+        repairUserPo.setStaffId(userId);
+        repairUserPo.setStaffName(userDtos.get(0).getName());
+        repairUserPo.setPreStaffId(repairUserDtos.get(0).getStaffId());
+        repairUserPo.setPreStaffName(repairUserDtos.get(0).getStaffName());
+        repairUserPo.setStartTime(DateUtil.getFormatTimeStringA(repairUserDtos.get(0).getEndTime()));
+        repairUserPo.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
+        repairUserPo.setRepairEvent(repairUserDtos.get(0).getRepairEvent());
+        repairUserPo.setPreRuId(reqJson.getString("ruId"));
+        repairUserV1InnerServiceSMOImpl.saveRepairUserNew(repairUserPo);
+    }
+}