wuxw hace 2 años
padre
commit
be272a1222

+ 10 - 0
java110-bean/src/main/java/com/java110/dto/repair/RepairDto.java

@@ -129,6 +129,8 @@ public class RepairDto extends PageDto implements Serializable {
     private String startTime;
     private String startTime;
     private String endTime;
     private String endTime;
 
 
+    private String notifyWay;
+
 
 
     public String getRepairName() {
     public String getRepairName() {
         return repairName;
         return repairName;
@@ -570,4 +572,12 @@ public class RepairDto extends PageDto implements Serializable {
     public void setEndTime(String endTime) {
     public void setEndTime(String endTime) {
         this.endTime = endTime;
         this.endTime = endTime;
     }
     }
+
+    public String getNotifyWay() {
+        return notifyWay;
+    }
+
+    public void setNotifyWay(String notifyWay) {
+        this.notifyWay = notifyWay;
+    }
 }
 }

+ 13 - 0
java110-bean/src/main/java/com/java110/dto/repair/RepairSettingDto.java

@@ -14,6 +14,9 @@ import java.util.Date;
  * add by wuxw 2019/4/24
  * add by wuxw 2019/4/24
  **/
  **/
 public class RepairSettingDto extends PageDto implements Serializable {
 public class RepairSettingDto extends PageDto implements Serializable {
+
+    public static final String NOTIFY_WAY_SMS = "SMS"; //短信
+    public static final String NOTIFY_WAY_WECHAT = "WECHAT"; //微信
     private String repairTypeName;
     private String repairTypeName;
     private String repairType;
     private String repairType;
     private String remark;
     private String remark;
@@ -32,6 +35,8 @@ public class RepairSettingDto extends PageDto implements Serializable {
     private String statusCd = "0";
     private String statusCd = "0";
     private String isShow;
     private String isShow;
 
 
+    private String notifyWay;
+
     public String getRepairTypeName() {
     public String getRepairTypeName() {
         return repairTypeName;
         return repairTypeName;
     }
     }
@@ -167,4 +172,12 @@ public class RepairSettingDto extends PageDto implements Serializable {
     public void setIsShow(String isShow) {
     public void setIsShow(String isShow) {
         this.isShow = isShow;
         this.isShow = isShow;
     }
     }
+
+    public String getNotifyWay() {
+        return notifyWay;
+    }
+
+    public void setNotifyWay(String notifyWay) {
+        this.notifyWay = notifyWay;
+    }
 }
 }

+ 10 - 0
java110-bean/src/main/java/com/java110/po/repair/RepairSettingPo.java

@@ -17,6 +17,8 @@ public class RepairSettingPo implements Serializable {
     private String statusCd = "0";
     private String statusCd = "0";
     private String isShow;
     private String isShow;
 
 
+    private String notifyWay;
+
     public String getRepairTypeName() {
     public String getRepairTypeName() {
         return repairTypeName;
         return repairTypeName;
     }
     }
@@ -120,4 +122,12 @@ public class RepairSettingPo implements Serializable {
     public void setIsShow(String isShow) {
     public void setIsShow(String isShow) {
         this.isShow = isShow;
         this.isShow = isShow;
     }
     }
+
+    public String getNotifyWay() {
+        return notifyWay;
+    }
+
+    public void setNotifyWay(String notifyWay) {
+        this.notifyWay = notifyWay;
+    }
 }
 }

+ 2 - 2
java110-db/src/main/resources/mapper/community/RepairServiceDaoImplMapper.xml

@@ -132,14 +132,14 @@
     <select id="getRepairInfo" parameterType="Map" resultType="Map">
     <select id="getRepairInfo" parameterType="Map" resultType="Map">
         select t.repair_name,t.repair_name repairName,t.appointment_time,t.appointment_time
         select t.repair_name,t.repair_name repairName,t.appointment_time,t.appointment_time
         appointmentTime,t.repair_type,t.repair_type repairType,t.context,t.repair_id,t.repair_id
         appointmentTime,t.repair_type,t.repair_type repairType,t.context,t.repair_id,t.repair_id
-        repairId,t.tel,t.status_cd,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id
+        repairId,t.tel,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id
         bId, d.name stateName,t.maintenance_type maintenanceType,t.repair_channel repairChannel,
         bId, d.name stateName,t.maintenance_type maintenanceType,t.repair_channel repairChannel,
         t.repair_materials,t.repair_materials repairMaterials,t.repair_fee,t.repair_fee repairFee,
         t.repair_materials,t.repair_materials repairMaterials,t.repair_fee,t.repair_fee repairFee,
         rs.repair_type_name repairTypeName,rs.repair_way repairWay,rs.return_visit_flag returnVisitFlag,
         rs.repair_type_name repairTypeName,rs.repair_way repairWay,rs.return_visit_flag returnVisitFlag,
         t.repair_obj_type,t.repair_obj_id,t.repair_obj_name,t.repair_obj_type repairObjType,t.repair_obj_id repairObjId,
         t.repair_obj_type,t.repair_obj_id,t.repair_obj_name,t.repair_obj_type repairObjType,t.repair_obj_id repairObjId,
         t.repair_obj_name repairObjName,rrv.visit_type visitType,rrv.context visitContext,a.appraise_score
         t.repair_obj_name repairObjName,rrv.visit_type visitType,rrv.context visitContext,a.appraise_score
         appraiseScore, a.door_speed_score doorSpeedScore,a.repairman_service_score repairmanServiceScore,
         appraiseScore, a.door_speed_score doorSpeedScore,a.repairman_service_score repairmanServiceScore,
-        t.pay_type,t.pay_type payType,rs.repair_setting_type repairSettingType,d1.name repairSettingTypeName,t.create_time createTime
+        t.pay_type,t.pay_type payType,rs.repair_setting_type repairSettingType,rs.notify_way notifyWay,d1.name repairSettingTypeName,t.create_time createTime
         <if test="staffId != null and staffId != ''">
         <if test="staffId != null and staffId != ''">
             ,rru.state repairDispatchState,rru.context repairDispatchContext,td.name repairDispatchStateName
             ,rru.state repairDispatchState,rru.context repairDispatchContext,td.name repairDispatchStateName
         </if>
         </if>

+ 14 - 4
java110-db/src/main/resources/mapper/community/RepairSettingServiceDaoImplMapper.xml

@@ -103,7 +103,7 @@
         createTime,d.name repairWayName,d2.name repairSettingTypeName,
         createTime,d.name repairWayName,d2.name repairSettingTypeName,
         t.public_area,t.public_area publicArea,t.pay_fee_flag,t.pay_fee_flag payFeeFlag
         t.public_area,t.public_area publicArea,t.pay_fee_flag,t.pay_fee_flag payFeeFlag
         ,t.price_scope,t.price_scope priceScope,t.return_visit_flag,t.return_visit_flag returnVisitFlag,d1.name
         ,t.price_scope,t.price_scope priceScope,t.return_visit_flag,t.return_visit_flag returnVisitFlag,d1.name
-        returnVisitFlagName,t.is_show,t.is_show isShow
+        returnVisitFlagName,t.is_show,t.is_show isShow,t.notify_way notifyWay
         from r_repair_setting t
         from r_repair_setting t
         left join t_dict d on t.repair_way = d.status_cd and d.table_name = 'r_repair_setting' and d.table_columns
         left join t_dict d on t.repair_way = d.status_cd and d.table_name = 'r_repair_setting' and d.table_columns
         ='repair_way'
         ='repair_way'
@@ -118,6 +118,9 @@
         <if test="repairType !=null and repairType != ''">
         <if test="repairType !=null and repairType != ''">
             and t.repair_type= #{repairType}
             and t.repair_type= #{repairType}
         </if>
         </if>
+        <if test="notifyWay !=null and notifyWay != ''">
+            and t.notify_way= #{notifyWay}
+        </if>
         <if test="repairSettingType !=null and repairSettingType != ''">
         <if test="repairSettingType !=null and repairSettingType != ''">
             and t.repair_setting_type= #{repairSettingType}
             and t.repair_setting_type= #{repairSettingType}
         </if>
         </if>
@@ -175,9 +178,7 @@
         <if test="remark !=null and remark != ''">
         <if test="remark !=null and remark != ''">
             , t.remark= #{remark}
             , t.remark= #{remark}
         </if>
         </if>
-        <if test="communityId !=null and communityId != ''">
-            , t.community_id= #{communityId}
-        </if>
+
         <if test="repairWay !=null and repairWay != ''">
         <if test="repairWay !=null and repairWay != ''">
             , t.repair_way= #{repairWay}
             , t.repair_way= #{repairWay}
         </if>
         </if>
@@ -196,6 +197,9 @@
         <if test="isShow !=null and isShow != ''">
         <if test="isShow !=null and isShow != ''">
             , t.is_show= #{isShow}
             , t.is_show= #{isShow}
         </if>
         </if>
+        <if test="notifyWay !=null and notifyWay != ''">
+            , t.notify_way= #{notifyWay}
+        </if>
         where 1=1
         where 1=1
         <if test="bId !=null and bId != ''">
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
             and t.b_id= #{bId}
@@ -203,6 +207,9 @@
         <if test="settingId !=null and settingId != ''">
         <if test="settingId !=null and settingId != ''">
             and t.setting_id= #{settingId}
             and t.setting_id= #{settingId}
         </if>
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
     </update>
     </update>
 
 
     <!-- 查询报修设置数量 add by wuxw 2018-07-03 -->
     <!-- 查询报修设置数量 add by wuxw 2018-07-03 -->
@@ -251,5 +258,8 @@
         <if test="isShow !=null and isShow != ''">
         <if test="isShow !=null and isShow != ''">
             and t.is_show= #{isShow}
             and t.is_show= #{isShow}
         </if>
         </if>
+        <if test="notifyWay !=null and notifyWay != ''">
+            and t.notify_way= #{notifyWay}
+        </if>
     </select>
     </select>
 </mapper>
 </mapper>

+ 20 - 11
java110-db/src/main/resources/mapper/community/RepairSettingV1ServiceDaoImplMapper.xml

@@ -7,23 +7,25 @@
     <insert id="saveRepairSettingInfo" parameterType="Map">
     <insert id="saveRepairSettingInfo" parameterType="Map">
         insert into r_repair_setting(price_scope, pay_fee_flag, return_visit_flag, repair_type_name, repair_type,
         insert into r_repair_setting(price_scope, pay_fee_flag, return_visit_flag, repair_type_name, repair_type,
                                      remark, community_id, public_area, repair_way, repair_setting_type, setting_id,
                                      remark, community_id, public_area, repair_way, repair_setting_type, setting_id,
-                                     is_show)
+                                     is_show,notify_way)
         values (#{priceScope}, #{payFeeFlag}, #{returnVisitFlag}, #{repairTypeName}, #{repairType}, #{remark},
         values (#{priceScope}, #{payFeeFlag}, #{returnVisitFlag}, #{repairTypeName}, #{repairType}, #{remark},
-                #{communityId}, #{publicArea}, #{repairWay}, #{repairSettingType}, #{settingId}, #{isShow})
+                #{communityId}, #{publicArea}, #{repairWay}, #{repairSettingType}, #{settingId}, #{isShow},#{notifyWay})
     </insert>
     </insert>
     <!-- 查询报修设置信息 add by wuxw 2018-07-03 -->
     <!-- 查询报修设置信息 add by wuxw 2018-07-03 -->
     <select id="getRepairSettingInfo" parameterType="Map" resultType="Map">
     <select id="getRepairSettingInfo" parameterType="Map" resultType="Map">
-        select t.price_scope,t.price_scope priceScope,t.pay_fee_flag,t.pay_fee_flag
-        payFeeFlag,t.return_visit_flag,t.return_visit_flag returnVisitFlag,t.repair_type_name,t.repair_type_name
-        repairTypeName,t.repair_type,t.repair_type repairType,t.remark,t.status_cd,t.status_cd
-        statusCd,t.community_id,t.community_id communityId,t.public_area,t.public_area
-        publicArea,t.repair_way,t.repair_way repairWay,t.repair_setting_type,t.repair_setting_type
-        repairSettingType,t.setting_id,t.setting_id settingId,t.is_show,t.is_show isShow
+        select t.price_scope priceScope,t.pay_fee_flag
+        payFeeFlag,t.return_visit_flag returnVisitFlag,t.repair_type_name
+        repairTypeName,t.repair_type repairType,t.remark,t.status_cd
+        statusCd,t.community_id communityId,t.public_area publicArea,t.repair_way repairWay,t.repair_setting_type
+        repairSettingType,t.setting_id settingId,t.is_show isShow,t.notify_way notifyWay
         from r_repair_setting t
         from r_repair_setting t
         where 1 =1
         where 1 =1
         <if test="priceScope !=null and priceScope != ''">
         <if test="priceScope !=null and priceScope != ''">
             and t.price_scope= #{priceScope}
             and t.price_scope= #{priceScope}
         </if>
         </if>
+        <if test="notifyWay !=null and notifyWay != ''">
+            and t.notify_way= #{notifyWay}
+        </if>
         <if test="payFeeFlag !=null and payFeeFlag != ''">
         <if test="payFeeFlag !=null and payFeeFlag != ''">
             and t.pay_fee_flag= #{payFeeFlag}
             and t.pay_fee_flag= #{payFeeFlag}
         </if>
         </if>
@@ -90,9 +92,7 @@
         <if test="remark !=null and remark != ''">
         <if test="remark !=null and remark != ''">
             , t.remark= #{remark}
             , t.remark= #{remark}
         </if>
         </if>
-        <if test="communityId !=null and communityId != ''">
-            , t.community_id= #{communityId}
-        </if>
+
         <if test="publicArea !=null and publicArea != ''">
         <if test="publicArea !=null and publicArea != ''">
             , t.public_area= #{publicArea}
             , t.public_area= #{publicArea}
         </if>
         </if>
@@ -105,10 +105,16 @@
         <if test="isShow !=null and isShow != ''">
         <if test="isShow !=null and isShow != ''">
             , t.is_show= #{isShow}
             , t.is_show= #{isShow}
         </if>
         </if>
+        <if test="notifyWay !=null and notifyWay != ''">
+            , t.notify_way= #{notifyWay}
+        </if>
         where 1=1
         where 1=1
         <if test="settingId !=null and settingId != ''">
         <if test="settingId !=null and settingId != ''">
             and t.setting_id= #{settingId}
             and t.setting_id= #{settingId}
         </if>
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
     </update>
     </update>
 
 
     <!-- 查询报修设置数量 add by wuxw 2018-07-03 -->
     <!-- 查询报修设置数量 add by wuxw 2018-07-03 -->
@@ -155,5 +161,8 @@
         <if test="isShow !=null and isShow != ''">
         <if test="isShow !=null and isShow != ''">
             and t.is_show= #{isShow}
             and t.is_show= #{isShow}
         </if>
         </if>
+        <if test="notifyWay !=null and notifyWay != ''">
+            and t.notify_way= #{notifyWay}
+        </if>
     </select>
     </select>
 </mapper>
 </mapper>

+ 2 - 2
service-community/src/main/java/com/java110/community/dao/impl/RepairServiceDaoImpl.java

@@ -79,8 +79,8 @@ public class RepairServiceDaoImpl extends BaseServiceDao implements IRepairServi
     @Override
     @Override
     public List<Map> getRepairInfo(Map info) throws DAOException {
     public List<Map> getRepairInfo(Map info) throws DAOException {
         logger.debug("查询报修信息信息 入参 info : {}", info);
         logger.debug("查询报修信息信息 入参 info : {}", info);
-        List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getRepairInfo", info);
-        return businessRepairInfos;
+        List<Map> infos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getRepairInfo", info);
+        return infos;
     }
     }
 
 
     /**
     /**

+ 2 - 2
service-community/src/main/java/com/java110/community/dao/impl/RepairSettingServiceDaoImpl.java

@@ -89,9 +89,9 @@ public class RepairSettingServiceDaoImpl extends BaseServiceDao implements IRepa
     public List<Map> getRepairSettingInfo(Map info) throws DAOException {
     public List<Map> getRepairSettingInfo(Map info) throws DAOException {
         logger.debug("查询报修设置信息 入参 info : {}", info);
         logger.debug("查询报修设置信息 入参 info : {}", info);
 
 
-        List<Map> businessRepairSettingInfos = sqlSessionTemplate.selectList("repairSettingServiceDaoImpl.getRepairSettingInfo", info);
+        List<Map> infos = sqlSessionTemplate.selectList("repairSettingServiceDaoImpl.getRepairSettingInfo", info);
 
 
-        return businessRepairSettingInfos;
+        return infos;
     }
     }
 
 
 
 

+ 2 - 1
service-community/src/main/java/com/java110/community/smo/impl/RepairSettingInnerServiceSMOImpl.java

@@ -9,6 +9,7 @@ import com.java110.dto.user.UserDto;
 import com.java110.intf.community.IRepairSettingInnerServiceSMO;
 import com.java110.intf.community.IRepairSettingInnerServiceSMO;
 import com.java110.intf.user.IUserInnerServiceSMO;
 import com.java110.intf.user.IUserInnerServiceSMO;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.ListUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
@@ -46,7 +47,7 @@ public class RepairSettingInnerServiceSMOImpl extends BaseServiceSMO implements
 
 
         List<RepairSettingDto> repairSettings = BeanConvertUtil.covertBeanList(repairSettingServiceDaoImpl.getRepairSettingInfo(BeanConvertUtil.beanCovertMap(repairSettingDto)), RepairSettingDto.class);
         List<RepairSettingDto> repairSettings = BeanConvertUtil.covertBeanList(repairSettingServiceDaoImpl.getRepairSettingInfo(BeanConvertUtil.beanCovertMap(repairSettingDto)), RepairSettingDto.class);
 
 
-        if (repairSettings == null || repairSettings.size() == 0) {
+        if (ListUtil.isNull(repairSettings)) {
             return repairSettings;
             return repairSettings;
         }
         }
 
 

+ 14 - 3
service-job/src/main/java/com/java110/job/adapt/Repair/MachineAddOwnerRepairAdapt.java

@@ -5,9 +5,11 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.factory.WechatFactory;
 import com.java110.core.factory.WechatFactory;
 import com.java110.dto.community.CommunityMemberDto;
 import com.java110.dto.community.CommunityMemberDto;
+import com.java110.dto.complaintType.ComplaintTypeDto;
 import com.java110.dto.privilege.BasePrivilegeDto;
 import com.java110.dto.privilege.BasePrivilegeDto;
 import com.java110.dto.community.CommunityDto;
 import com.java110.dto.community.CommunityDto;
 import com.java110.dto.repair.RepairDto;
 import com.java110.dto.repair.RepairDto;
+import com.java110.dto.repair.RepairSettingDto;
 import com.java110.dto.wechat.SmallWeChatDto;
 import com.java110.dto.wechat.SmallWeChatDto;
 import com.java110.dto.wechat.SmallWechatAttrDto;
 import com.java110.dto.wechat.SmallWechatAttrDto;
 import com.java110.dto.user.StaffAppAuthDto;
 import com.java110.dto.user.StaffAppAuthDto;
@@ -23,6 +25,7 @@ import com.java110.intf.store.ISmallWeChatInnerServiceSMO;
 import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO;
 import com.java110.intf.store.ISmallWechatAttrInnerServiceSMO;
 import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
 import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
 import com.java110.job.adapt.DatabusAdaptImpl;
 import com.java110.job.adapt.DatabusAdaptImpl;
+import com.java110.job.msgNotify.IMsgNotify;
 import com.java110.job.msgNotify.MsgNotifyFactory;
 import com.java110.job.msgNotify.MsgNotifyFactory;
 import com.java110.po.owner.RepairPoolPo;
 import com.java110.po.owner.RepairPoolPo;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.cache.MappingCache;
@@ -115,7 +118,7 @@ public class MachineAddOwnerRepairAdapt extends DatabusAdaptImpl {
         paramIn.put("context", context);
         paramIn.put("context", context);
         paramIn.put("repairName", repairName);
         paramIn.put("repairName", repairName);
         paramIn.put("repairId", repairDtos.get(0).getRepairId());
         paramIn.put("repairId", repairDtos.get(0).getRepairId());
-        sendMessage(paramIn, communityDtos.get(0));
+        sendMessage(paramIn, communityDtos.get(0),repairDtos.get(0));
     }
     }
 
 
     /**
     /**
@@ -124,7 +127,7 @@ public class MachineAddOwnerRepairAdapt extends DatabusAdaptImpl {
      * @param paramIn
      * @param paramIn
      * @param communityDto
      * @param communityDto
      */
      */
-    private void sendMessage(JSONObject paramIn, CommunityDto communityDto) {
+    private void sendMessage(JSONObject paramIn, CommunityDto communityDto,RepairDto repairDto) {
 
 
         //查询小区物业公司
         //查询小区物业公司
         CommunityMemberDto communityMemberDto = new CommunityMemberDto();
         CommunityMemberDto communityMemberDto = new CommunityMemberDto();
@@ -140,6 +143,14 @@ public class MachineAddOwnerRepairAdapt extends DatabusAdaptImpl {
         basePrivilegeDto.setCommunityId(communityMemberDtos.get(0).getCommunityId());
         basePrivilegeDto.setCommunityId(communityMemberDtos.get(0).getCommunityId());
         List<UserDto> userDtos = privilegeInnerServiceSMO.queryPrivilegeUsers(basePrivilegeDto);
         List<UserDto> userDtos = privilegeInnerServiceSMO.queryPrivilegeUsers(basePrivilegeDto);
         List<String> userIds = new ArrayList<>();
         List<String> userIds = new ArrayList<>();
+        IMsgNotify msgNotify = null;
+        if(RepairSettingDto.NOTIFY_WAY_SMS.equals(repairDto.getNotifyWay())) {
+            msgNotify = MsgNotifyFactory.getMsgNotify(MsgNotifyFactory.NOTIFY_WAY_ALI);
+        }else if(RepairSettingDto.NOTIFY_WAY_WECHAT.equals(repairDto.getNotifyWay())){
+            msgNotify = MsgNotifyFactory.getMsgNotify(MsgNotifyFactory.NOTIFY_WAY_WECHAT);
+        }else{
+            return;
+        }
         for (UserDto userDto : userDtos) {
         for (UserDto userDto : userDtos) {
             if (userIds.contains(userDto.getUserId())) {
             if (userIds.contains(userDto.getUserId())) {
                 continue;
                 continue;
@@ -157,7 +168,7 @@ public class MachineAddOwnerRepairAdapt extends DatabusAdaptImpl {
             String wechatUrl = MappingCache.getValue(MappingConstant.URL_DOMAIN,"STAFF_WECHAT_URL");
             String wechatUrl = MappingCache.getValue(MappingConstant.URL_DOMAIN,"STAFF_WECHAT_URL");
             content.put("url",wechatUrl);
             content.put("url",wechatUrl);
 
 
-            MsgNotifyFactory.sendAddOwnerRepairMsg(communityDto.getCommunityId(),userDto.getUserId(),content);
+            msgNotify.sendAddOwnerRepairMsg(communityDto.getCommunityId(),userDto.getUserId(),content);
         }
         }
     }
     }
 }
 }