Przeglądaj źródła

增加日志,修改信息发送

yousongbo 3 tygodni temu
rodzic
commit
899a38dae2

+ 0 - 2
suishenbang-admin/src/main/java/com/dgtly/web/controller/system/AlertConfigurationController.java

@@ -88,12 +88,10 @@ public class AlertConfigurationController extends BaseController
     @ResponseBody
     public AjaxResult addSave(AlertConfiguration alertConfiguration)
     {
-        log.info("11111111111{}", JSON.toJSON(alertConfiguration));
         //如果userType为空,则添加所有人通知
         if (StringUtils.isEmpty(alertConfiguration.getUserType())){
             alertConfiguration.setUserType("2");
         }
-        log.info("3333333333{}", JSON.toJSON(alertConfiguration));
         return toAjax(alertConfigurationService.insertAlertConfiguration(alertConfiguration));
     }
 

+ 6 - 1
suishenbang-system/src/main/java/com/dgtly/system/service/impl/AlertConfigurationServiceImpl.java

@@ -3,8 +3,10 @@ package com.dgtly.system.service.impl;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
+import com.alibaba.fastjson2.JSON;
 import com.dgtly.common.utils.DateUtils;
 import com.dgtly.common.utils.StringUtils;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.dgtly.system.mapper.AlertConfigurationMapper;
@@ -19,6 +21,7 @@ import com.dgtly.common.core.text.Convert;
  * @date 2023-06-13
  */
 @Service
+@Slf4j
 public class AlertConfigurationServiceImpl implements IAlertConfigurationService 
 {
     @Autowired
@@ -40,6 +43,8 @@ public class AlertConfigurationServiceImpl implements IAlertConfigurationService
     public AlertConfiguration selectAlertConfigurationByAlertStatus(List<String> userTypeList,String orgCode) {
         //查询有效弹窗
         List<AlertConfiguration> alertConfigurationList = alertConfigurationMapper.selectAlertConfigurationByAlertStatus();
+        log.info("查询弹框配置列表:{}", JSON.toJSON(alertConfigurationList));
+        log.info("用户类型:{}",userTypeList);
         if(alertConfigurationList !=null && alertConfigurationList.size()> 0 ){
             //判断弹框的组织 如果弹框有组织 对比该组织与员工的组织是否一致
             Iterator<AlertConfiguration> it = alertConfigurationList.iterator();
@@ -48,7 +53,7 @@ public class AlertConfigurationServiceImpl implements IAlertConfigurationService
                 //diy
                 if( alert.getOrgCode() ==null || ("null").equals(alert.getOrgCode())){
                     for (String userType:userTypeList){
-                        String [] userTypes = userType.split(",");
+                        String [] userTypes = alert.getUserType().split(",");
                         boolean exists = Arrays.stream(userTypes)
                                 .anyMatch(str -> str.equals(userType));
                         if (exists){

+ 6 - 1
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxAlertLogController.java

@@ -1,6 +1,7 @@
 package com.dgtly.wxportal.controller;
 
 
+import com.alibaba.fastjson2.JSON;
 import com.dgtly.common.annotation.ApiPassToken;
 import com.dgtly.common.core.controller.ApiBaseController;
 import com.dgtly.common.core.domain.AjaxResult;
@@ -9,6 +10,7 @@ import com.dgtly.common.utils.StringUtils;
 import com.dgtly.system.domain.*;
 import com.dgtly.system.service.*;
 import io.swagger.annotations.*;
+import lombok.extern.slf4j.Slf4j;
 import net.sf.jsqlparser.statement.select.Select;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -30,6 +32,7 @@ import java.util.*;
 @RestController
 @RequestMapping("/wxAlert")
 @ApiPassToken
+@Slf4j
 public class WxAlertLogController  extends ApiBaseController {
     @Autowired
     private IAlertLogService alertLogService;
@@ -57,7 +60,9 @@ public class WxAlertLogController  extends ApiBaseController {
         Set<String> userTypeSet = new HashSet<>();
         List<String> userTypeList = new ArrayList<>();
         SysUserExt sysUserExt = sysUserExtService.selectSysUserExtById(userId);
+        log.info("用户信息:{}", JSON.toJSON(sysUserExt));
         List<SysUserShopExt>  sysUserShopExt = sysUserShopExtService.selectSysUserShopExtById(obj.getString("userId"));
+        log.info("用户门店信息:{}", JSON.toJSON(sysUserShopExt));
         if (sysUserShopExt != null && sysUserShopExt.size() > 0) {
             for (SysUserShopExt shopExt : sysUserShopExt) {
                 userTypeSet.add(shopExt.getIsShopType());
@@ -83,7 +88,7 @@ public class WxAlertLogController  extends ApiBaseController {
             alertConfiguration1 = alertConfigurationService. selectAlertConfiguration(userTypeList);
         }
         //是否有启动弹窗
-
+        log.info("本次匹配的弹窗:{}",alertConfiguration1);
         if (alertConfiguration1 != null){
             //有启动
             alertConfiguration1.setIsClearCache(false);

+ 1 - 1
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxController.java

@@ -317,7 +317,7 @@ public class WxController extends ApiBaseController {
         String order = obj.getString("order");
         String message = "";
         if("123456789".equals(order)){
-            message = "出厂通知:您有订单<a href='https://suishenbangtest.nipponpaint.com.cn/order/onlineTracking/distributor?parType=customer_level&parValue=%s&status=6'>1701890984</a> 货物已出厂,可以进入<a href='https://suishenbangtest.nipponpaint.com.cn/order/onlineTracking/distributor?parType=customer_level&parValue=%s&status=6'>随身邦</a>查询详情。";
+            message = "出厂通知:您有订单<a href='https://suishenbangtest.nipponpaint.com.cn/order/onlineTracking/distributor?parType=customer_level&parValue=%s&status=6'>"+customerName+"</a> 货物已出厂,可以进入<a href='https://suishenbangtest.nipponpaint.com.cn/order/onlineTracking/distributor?parType=customer_level&parValue=%s&status=6'>随身邦</a>查询详情。";
            // message = "交货通知:您有订单6114600627 已于今天交货,可以进入<a href='https://suishenbangtest.nipponpaint.com.cn/order/onlineTracking/distributor?parType=customer_level&parValue=%s&status=4'>随身邦</a>查询详情。";
         }else {
             String temple = configService.selectConfigByKey("wx.notification.order.complete");