Sfoglia il codice sorgente

更换发送时的签名;调整联采项目手机提醒

ximinghao 4 settimane fa
parent
commit
7dfa14a14f

+ 1 - 2
src/main/java/com/skyversation/xjcy/controller/OtherController.java

@@ -139,8 +139,7 @@ public class OtherController {
             for (int i = 0; i < types.length; i++) {
                 readAbleTypes[i] = Lcxm.ServiceCategory.getById(Integer.parseInt(types[i])).getName();
             }
-            type = String.join(",", readAbleTypes);
-            messageService.noticeLcxm(type,map.get("c_phone"),map.get("c_name"));
+            messageService.noticeLcxm(readAbleTypes,map.get("c_phone"),map.get("c_name"));
             return MessageManage.successWithNoData("成功");
         }else {
             return MessageManage.error(-1,"未知错误");

+ 7 - 4
src/main/java/com/skyversation/xjcy/service/MessageService.java

@@ -9,7 +9,6 @@ import org.springframework.stereotype.Service;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.List;
-import java.util.stream.Collectors;
 
 @Service
 public class MessageService {
@@ -37,21 +36,25 @@ public class MessageService {
         sendMessage(message);
 
     }
-    public void noticeLcxm(String type,String phone,String name){
+    public void noticeLcxm(String[] type, String phone, String name){
         List<MessageTarget> messageTarget = dMSService.query(authService.getTokenOfServiceAccount(), DMSQuery.MESSAGE_TARGET, MessageTarget.class, LocalDate.now());
         messageTarget.stream()
                 .filter(MessageTarget::getCOpen)
                 .filter(m->"lcxm".equals(m.getCGroup()))
                 .forEach(m->{
                     if (m.getCPhone()!=null&&!m.getCPhone().isEmpty()){
-                        phoneMessageSendService.sendNotice(m.getCPhone(),type);
+                        if (type.length<=2){
+                            phoneMessageSendService.sendNotice(m.getCPhone(),String.join(",",type));
+                        }else {
+                            phoneMessageSendService.sendNotice(m.getCPhone(),type[0]+","+type[1]+"……");
+                        }
                     }
                     if (m.getCUsername()!=null&&!m.getCUsername().isEmpty()){
                         Message message = new Message();
                         message.setCReaded(false);
                         message.setCUserName(m.getCUsername());
                         message.setCTitle("业务诉求");
-                        message.setCContent(String.format("新业务诉求提交:姓名%s,手机号%s,业务类型:%s,需及时跟进处理",name,phone,type));
+                        message.setCContent(String.format("新业务诉求提交:姓名%s,手机号%s,业务类型:%s,需及时跟进处理",name,phone,String.join(",",type)));
                         message.setCTime(LocalDate.now());
                         sendMessage(message);
                     }

+ 2 - 2
src/main/resources/application.yml

@@ -40,10 +40,10 @@ app:
     message:
       endpoint: ${ALIBABA_CLOUD_MESSAGE_ENDPOINT:dysmsapi.aliyuncs.com}
       code:
-        sign: ${XJCY_ALIBABA_SIGN:上海元以数智科技}
+        sign: ${XJCY_ALIBABA_SIGN:数智科技}
         template-code: ${XJCY_ALIBABA_CODE_TEMPLATE:SMS_496690245}
       notice:
-        sign: ${XJCY_ALIBABA_SIGN:上海元以数智科技}
+        sign: ${XJCY_ALIBABA_SIGN:数智科技}
         template-code: ${XJCY_ALIBABA_NOTICE_TEMPLATE:SMS_500695141}
     ocr:
       endpoint: ${ALIBABA_CLOUD_OCR_ENDPOINT:ocr-api.cn-hangzhou.aliyuncs.com}