Explorar el Código

开发完成投诉功能

wuxw hace 2 años
padre
commit
0ca2bbf103

+ 3 - 0
java110-bean/src/main/java/com/java110/dto/complaintType/ComplaintTypeDto.java

@@ -17,6 +17,9 @@ import java.util.List;
  **/
 public class ComplaintTypeDto extends PageDto implements Serializable {
 
+    public static final String NOTIFY_WAY_SMS = "SMS"; //短信
+    public static final String NOTIFY_WAY_WECHAT = "WECHAT"; //微信
+
     private String typeCd;
     private String typeName;
     private String notifyWay;

+ 23 - 1
service-job/src/main/java/com/java110/job/adapt/complaint/SendComplaintNotifyStaffAdapt.java

@@ -4,12 +4,15 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.log.LoggerFactory;
 import com.java110.dto.complaint.ComplaintDto;
+import com.java110.dto.complaintType.ComplaintTypeDto;
 import com.java110.dto.complaintTypeUser.ComplaintTypeUserDto;
 import com.java110.dto.system.Business;
 import com.java110.intf.store.IComplaintTypeUserV1InnerServiceSMO;
+import com.java110.intf.store.IComplaintTypeV1InnerServiceSMO;
 import com.java110.intf.store.IComplaintV1InnerServiceSMO;
 import com.java110.job.adapt.DatabusAdaptImpl;
 import com.java110.job.adapt.Repair.MachineReturnRepairAdapt;
+import com.java110.job.msgNotify.IMsgNotify;
 import com.java110.job.msgNotify.MsgNotifyFactory;
 import com.java110.po.owner.RepairUserPo;
 import com.java110.utils.cache.MappingCache;
@@ -35,6 +38,9 @@ public class SendComplaintNotifyStaffAdapt extends DatabusAdaptImpl {
     @Autowired
     private IComplaintV1InnerServiceSMO complaintV1InnerServiceSMOImpl;
 
+    @Autowired
+    private IComplaintTypeV1InnerServiceSMO complaintTypeV1InnerServiceSMOImpl;
+
     @Autowired
     private IComplaintTypeUserV1InnerServiceSMO complaintTypeUserV1InnerServiceSMOImpl;
 
@@ -58,6 +64,14 @@ public class SendComplaintNotifyStaffAdapt extends DatabusAdaptImpl {
             return;
         }
 
+        ComplaintTypeDto complaintTypeDto = new ComplaintTypeDto();
+        complaintTypeDto.setTypeCd(complaintDtos.get(0).getTypeCd());
+        List<ComplaintTypeDto> complaintTypeDtos = complaintTypeV1InnerServiceSMOImpl.queryComplaintTypes(complaintTypeDto);
+
+        if(ListUtil.isNull(complaintTypeDtos)){
+            return;
+        }
+
         ComplaintTypeUserDto complaintTypeUserDto = new ComplaintTypeUserDto();
         complaintTypeUserDto.setTypeCd(complaintDtos.get(0).getTypeCd());
         List<ComplaintTypeUserDto> complaintTypeUserDtos = complaintTypeUserV1InnerServiceSMOImpl.queryComplaintTypeUsers(complaintTypeUserDto);
@@ -72,9 +86,17 @@ public class SendComplaintNotifyStaffAdapt extends DatabusAdaptImpl {
 
         String wechatUrl = MappingCache.getValue(MappingConstant.URL_DOMAIN, "STAFF_WECHAT_URL");
         content.put("url", wechatUrl);
+        IMsgNotify msgNotify = null;
+        if(ComplaintTypeDto.NOTIFY_WAY_SMS.equals(complaintTypeDtos.get(0).getNotifyWay())) {
+            msgNotify = MsgNotifyFactory.getMsgNotify(MsgNotifyFactory.NOTIFY_WAY_ALI);
+        }else if(ComplaintTypeDto.NOTIFY_WAY_WECHAT.equals(complaintTypeDtos.get(0).getNotifyWay())){
+            msgNotify = MsgNotifyFactory.getMsgNotify(MsgNotifyFactory.NOTIFY_WAY_WECHAT);
+        }else{
+            return;
+        }
 
         for(ComplaintTypeUserDto tmpComplaintTypeUserDto:complaintTypeUserDtos) {
-            MsgNotifyFactory.sendComplaintMsg(tmpComplaintTypeUserDto.getCommunityId(), tmpComplaintTypeUserDto.getStaffId(), content);
+             msgNotify.sendComplaintMsg(tmpComplaintTypeUserDto.getCommunityId(), tmpComplaintTypeUserDto.getStaffId(), content);
         }
 
     }

+ 0 - 19
service-job/src/main/java/com/java110/job/msgNotify/MsgNotifyFactory.java

@@ -356,24 +356,5 @@ public class MsgNotifyFactory {
         return notify;
     }
 
-    /**
-     * 投诉通知消息
-     * @param communityId
-     * @param staffId
-     * @param content
-     */
-    public static ResultVo sendComplaintMsg(String communityId, String staffId, JSONObject content) {
 
-        ResultVo resultVo = null;
-        try {
-            IMsgNotify msgNotify = getMsgNotify();
-            resultVo = msgNotify.sendComplaintMsg(communityId, staffId, content);
-        } catch (Exception e) {
-            e.printStackTrace();
-            logger.error("通知 业主报修时 消息", e);
-            resultVo = new ResultVo(ResultVo.CODE_ERROR, e.getMessage());
-        }
-
-        return resultVo;
-    }
 }