|
|
@@ -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);
|
|
|
@@ -98,6 +103,7 @@ public class WxAlertLogController extends ApiBaseController {
|
|
|
String[] split = alertConfiguration1.getUserType().split(",");
|
|
|
List<String> strings = Arrays.asList(split);
|
|
|
if (sysUserExt != null){
|
|
|
+ log.info("开始匹配用户:{}",JSON.toJSON(sysUserExt));
|
|
|
if ((strings.contains("1") || strings.contains("2")) && sysUserExt.getSalesLevel().equals("customer_level")){
|
|
|
//满足类型对应a
|
|
|
AlertLog alertLog = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId(),"0");
|
|
|
@@ -130,6 +136,7 @@ public class WxAlertLogController extends ApiBaseController {
|
|
|
}
|
|
|
//判断该用户是否为金牌店或仿石漆
|
|
|
if (sysUserShopExt != null){
|
|
|
+ log.info("开始匹配门店信息:{}",JSON.toJSON(sysUserShopExt));
|
|
|
if((strings.contains("3") || strings.contains("2")) && userTypeSet.contains("0")){
|
|
|
AlertLog alertLog = alertLogService.selectAlertLogByUserIdAndAlertId(userId, alertConfiguration1.getAlertId(),"0");
|
|
|
if (alertLog!=null){
|