Explorar el Código

Merge remote-tracking branch 'origin/bly_store' into bly_store

xgb hace 1 mes
padre
commit
f61b5eff44

+ 174 - 70
fs-service/src/main/java/com/fs/qw/service/impl/QwExternalContactServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONException;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.ad.enums.AdUploadType;
 import com.fs.ad.service.IAdHtmlClickLogService;
@@ -49,6 +50,7 @@ import com.fs.qwApi.domain.*;
 import com.fs.qwApi.domain.inner.*;
 import com.fs.qwApi.param.*;
 import com.fs.qwApi.service.QwApiService;
+import com.fs.repeat.vo.RepeatUploadVo;
 import com.fs.sop.domain.QwSop;
 import com.fs.sop.domain.SopUserLogs;
 import com.fs.sop.domain.SopUserLogsInfo;
@@ -202,6 +204,9 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
     @Autowired
     private ISysDictTypeService dictTypeService;
 
+    @Autowired
+    private AsyncQwAiChatSopService asyncQwAiChatSopService;
+
 
     Logger logger = LoggerFactory.getLogger(getClass());
 
@@ -2168,9 +2173,13 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
     @Override
     public QwUser getQwUserByRedisForId(String qwUserId) {
         String key =(String)redisCache.getCacheObject("qwUserRdById:"+qwUserId);
-        if (!StringUtil.strIsNullOrEmpty(key)){
+        if (ObjectUtils.isNotEmpty(key)&& !StringUtil.strIsNullOrEmpty(key)){
             return JSON.parseObject(key, QwUser.class);
         }
+        logger.error("qwUserId:{}",qwUserId);
+        if (ObjectUtils.isEmpty(qwUserId)||qwUserId.equals("null")){
+            return null;
+        }
         QwUser qwUser = qwUserMapper.selectQwUserById(Long.valueOf(qwUserId));
         if (qwUser==null){
             return null;
@@ -2183,6 +2192,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
     @Override
     public void insertQwExternalContactByExternalUserId(String externalUserID, String userID, Long companyId, String corpId, String state, String welcomeCode) throws ParseException {
 
+
+        String qwApiExternal=redisCache.getCacheObject("qwApiExternal:"+userID+":"+corpId+":"+externalUserID);
+        if (!StringUtil.strIsNullOrEmpty(qwApiExternal)){
+            return;
+        }else {
+            redisCache.setCacheObject("qwApiExternal:"+userID+":"+corpId+":"+externalUserID ,"1",10, TimeUnit.MINUTES);
+        }
+
         // 获取当前日期(只包含年月日)
         LocalDate currentDate = LocalDate.now();
         // 获取当前系统时间 (HH:mm)
@@ -2221,6 +2238,21 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
 //            logger.error("重粉提交mq失败", e);
 //        }
 //        iAdHtmlClickLogService.upload(state, AdUploadType.ADD_WX, e -> finalQwExternalContact.setUploadAddWxStatus(1));
+        //重粉问题
+        try {
+            new Thread(() -> {
+                try {
+                    Thread.sleep(3000);
+                } catch (InterruptedException e) {
+                    logger.error("添加等待时长错误", e);
+                }
+                rocketMQTemplate.syncSend("repeat-upload", JSON.toJSONString(RepeatUploadVo.builder().type(0).externalUserId(externalUserID).build()));
+            }).start();
+        }catch (Exception e){
+            logger.error("重粉提交mq失败", e);
+        }
+
+
 
         //先入一次库
         if (isNewQwExternalContact) {
@@ -2503,65 +2535,84 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                 String tagRemark = null;
                 //根据qwUser 匹配 分时段的标签
                 QwAutoTags qwAutoTags = qwAutoTagsMapper.selectQwAutoTagsByIdJSON(corpId, qwUser.getId());
-                if (qwAutoTags != null) {
+
+                // 渠道活码是否有标签
+                boolean isContactWay = isWay && wayId.getIsTag() == 1;
+                logger.info("渠道活码是否有标签,{}", isContactWay);
+
+                if (qwAutoTags != null || isContactWay) {
+                    boolean isMatch = false;
+                    //存符合条件的标签
+                    Set<String> combinedTagsItem = new HashSet<>();
                     //标签日志记录
-                    qwAutoTagsLogs.setAutoTagId(qwAutoTags.getId());
-                    qwAutoTagsLogs.setType(3L);
-                    qwAutoTagsLogs.setQwUserid(qwUser.getId());
-                    qwAutoTagsLogs.setExternalUserId(externalUserID);
-                        List<QwAutoTagsRulesTags> qwAutoTagsRulesTagsList = JSON.parseArray(qwAutoTags.getRulesTags(), QwAutoTagsRulesTags.class);
-                        boolean isMatch = false;
-                        //存分时段里符合条件的标签
-                        Set<String> combinedTagsItem = new HashSet<>();
-                        // 获取今天的星期数
-                        DayOfWeek today = LocalDate.now().getDayOfWeek();
-                        int todayIndex = today.getValue(); // 1: Monday, 2: Tuesday, ..., 7: Sunday
-                        // 获取当前时间
-                        LocalTime now = LocalTime.now();
-                        // 遍历所有规则
-                        for (QwAutoTagsRulesTags rulesTags : qwAutoTagsRulesTagsList) {
-                            List<String> tagsItem = rulesTags.getTags();
-                            List<Integer> week = rulesTags.getWeek();
-                            String startTime = rulesTags.getStartTime();
-                            String endTime = rulesTags.getEndTime();
-                            String remarks = rulesTags.getRemarks();
-
-                            // 检查今天是否在 week 集合中
-                            boolean isTodayInWeek = week.contains(todayIndex);
-                            // 转换时间字符串为 LocalTime
-                            LocalTime start = LocalTime.parse(startTime);
-                            LocalTime end = LocalTime.parse(endTime.equals("24:00") ? "23:59:59" : endTime);
-                            // 检查当前时间是否在 startTime 和 endTime 之间
-                            boolean isNowInTimeRange = !now.isBefore(start) && !now.isAfter(end);
-                            // 如果当前时间和日期匹配规则,将 tagsItem 添加到 combinedTagsSet 中
-                            if (isTodayInWeek && isNowInTimeRange) {
-
-                                combinedTagsSet.addAll(tagsItem);
-                                combinedTagsItem.addAll(tagsItem);
-                                isMatch = true;
-                                if (rulesTags.getIsDay()!=null&&rulesTags.getIsDay()==1){
-                                    String DayDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd"));
-                                    tagRemark=DayDate.substring(1);
-                                }
-                                //如果备注不为空
-                                if (rulesTags.getIsDay()!=null&&rulesTags.getIsDay()==1){
-                                    String DayDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd"));
-                                    tagRemark=DayDate.substring(1);
-                                }
-                                //如果备注不为空
-                                if (!StringUtil.strIsNullOrEmpty(remarks)){
-                                    tagRemark = (tagRemark==null?"":(tagRemark+ "-") ) +remarks;
+                    if(qwAutoTags != null) {
+                        qwAutoTagsLogs.setAutoTagId(qwAutoTags.getId());
+                        qwAutoTagsLogs.setType(3L);
+                        qwAutoTagsLogs.setQwUserid(qwUser.getId());
+                        qwAutoTagsLogs.setExternalUserId(externalUserID);
+                            List<QwAutoTagsRulesTags> qwAutoTagsRulesTagsList = JSON.parseArray(qwAutoTags.getRulesTags(), QwAutoTagsRulesTags.class);
+                            // 获取今天的星期数
+                            DayOfWeek today = LocalDate.now().getDayOfWeek();
+                            int todayIndex = today.getValue(); // 1: Monday, 2: Tuesday, ..., 7: Sunday
+                            // 获取当前时间
+                            LocalTime now = LocalTime.now();
+                            // 遍历所有规则
+                            for (QwAutoTagsRulesTags rulesTags : qwAutoTagsRulesTagsList) {
+                                List<String> tagsItem = rulesTags.getTags();
+                                List<Integer> week = rulesTags.getWeek();
+                                String startTime = rulesTags.getStartTime();
+                                String endTime = rulesTags.getEndTime();
+                                String remarks = rulesTags.getRemarks();
+
+                                // 检查今天是否在 week 集合中
+                                boolean isTodayInWeek = week.contains(todayIndex);
+                                // 转换时间字符串为 LocalTime
+                                LocalTime start = LocalTime.parse(startTime);
+                                LocalTime end = LocalTime.parse(endTime.equals("24:00") ? "23:59:59" : endTime);
+                                // 检查当前时间是否在 startTime 和 endTime 之间
+                                boolean isNowInTimeRange = !now.isBefore(start) && !now.isAfter(end);
+                                // 如果当前时间和日期匹配规则,将 tagsItem 添加到 combinedTagsSet 中
+                                if (isTodayInWeek && isNowInTimeRange) {
+
+                                    combinedTagsSet.addAll(tagsItem);
+                                    combinedTagsItem.addAll(tagsItem);
+                                    isMatch = true;
+                                    if (rulesTags.getIsDay()!=null&&rulesTags.getIsDay()==1){
+                                        String DayDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd"));
+                                        tagRemark=DayDate.substring(1);
+                                    }
+                                    //如果备注不为空
+                                    if (rulesTags.getIsDay()!=null&&rulesTags.getIsDay()==1){
+                                        String DayDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd"));
+                                        tagRemark=DayDate.substring(1);
+                                    }
+                                    //如果备注不为空
+                                    if (!StringUtil.strIsNullOrEmpty(remarks)){
+                                        tagRemark = (tagRemark==null?"":(tagRemark+ "-") ) +remarks;
+                                    }
                                 }
                             }
-                        }
+                    }
+
                         // 如果有匹配的规则,使用 combinedTagsList
-                        if (isMatch) {
+                        if (isMatch || isContactWay) {
                             // 转换一下分时段-符合 条件的 列表
                             List<String> combinedTags = new ArrayList<>(combinedTagsItem);
                             qwAutoTagsLogs.setEffectiveRules(JSON.toJSONString(combinedTags));
                             qwAutoTagsLogs.setAddTime(new Date());
                             qwAutoTagsLogs.setCompanyId(qwUser.getCompanyId());
                             qwAutoTagsLogs.setCorpId(qwUser.getCorpId());
+
+                            //有标签
+                            if (isWay && wayId.getIsTag() == 1) {
+                                //渠道活码的标签
+                                List<String> wayTags = JSON.parseArray(wayId.getTags(), String.class);
+                                //总添加标签
+//                                combinedTagsSet.addAll(wayTags);
+                                combinedTagsSet = new HashSet<>(wayTags);
+                                logger.info("渠道活码标签,{}===============,打的标签={}", wayTags,combinedTagsSet);
+                            }
+
                             //总标签 转换回列表
                             List<String> combinedTagsList = new ArrayList<>(combinedTagsSet);
                             // 设置标签
@@ -2592,7 +2643,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                             // 转换回列表
                             List<String> combinedTagsList = new ArrayList<>(combinedTagsSet);
 
-                            logger.info("不符合分时段条件2--看全部标签是否有符合的:"+combinedTagsList+"|"+externalUserID+"|"+userID+"|"+corpId);
+                            logger.info("不符合分时段条件2--看全部标签是否有符合的11111:"+combinedTagsList+"|"+externalUserID+"|"+userID+"|"+corpId);
 
                             try {
                                 //检查sop进营期
@@ -2608,7 +2659,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                         // 转换回列表
                         List<String> combinedTagsList = new ArrayList<>(combinedTagsSet);
 
-                        logger.error("不符合分时段条件2--看全部标签是否有符合的:"+combinedTagsList+"|"+externalUserID+"|"+userID+"|"+corpId);
+                        logger.error("不符合分时段条件2--看全部标签是否有符合的22222:"+combinedTagsList+"|"+externalUserID+"|"+userID+"|"+corpId);
 
                         try {
                             checkHaveQwSop(combinedTagsSet, qwUser, corpId,combinedTagsList, userID, externalUserID,
@@ -2624,27 +2675,28 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
 
                 //有渠道活码
                 if (isWay && (StringUtil.strIsNullOrEmpty(followUser.getRemark()) || StringUtils.equals(followUser.getRemark().trim(),externalContact.getName().trim()))) {
-
+                    logger.info("已进入有渠道活码的方法===============");
                     if (wayId.getIsDescription() == 1) {
                         qwExternalContact.setDescription(wayId.getDescription());
                     }
                     if (wayId.getIsRemark() == 1) {
                         if (wayId.getRemarkStatus() == 1) {
-                            if (!StringUtil.strIsNullOrEmpty(tagRemark)){
-                                qwExternalContact.setRemark(externalContact.getName() + "-" + wayId.getRemark()+"-"+tagRemark);
-                            }else {
+//                            if (!StringUtil.strIsNullOrEmpty(tagRemark)){
+//                                qwExternalContact.setRemark(externalContact.getName() + "-" + wayId.getRemark()+"-"+tagRemark);
+//                            }else {
                                 qwExternalContact.setRemark(externalContact.getName() + "-" + wayId.getRemark());
-                            }
+//                            }
 
                         } else {
-                            if (!StringUtil.strIsNullOrEmpty(tagRemark)){
-                                qwExternalContact.setRemark(tagRemark+"-"+wayId.getRemark() + "-" + externalContact.getName());
-                            }else {
+//                            if (!StringUtil.strIsNullOrEmpty(tagRemark)){
+//                                qwExternalContact.setRemark(tagRemark+"-"+wayId.getRemark() + "-" + externalContact.getName());
+//                            }else {
                                 qwExternalContact.setRemark(wayId.getRemark() + "-" + externalContact.getName());
-                            }
+//                            }
 
                         }
                     }
+                    logger.info("最终的备注:{}", qwExternalContact.getRemark());
                     if (wayId.getIsDescription() == 1 || wayId.getIsRemark() == 1) {
 
                         QwExternalContactRemarkParam param = new QwExternalContactRemarkParam();
@@ -2665,15 +2717,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                         logger.info("修改备注:{}", remarkResult);
 
                     }
-                    //有标签
-                    if (wayId.getIsTag() == 1) {
-                        //渠道活码的标签
-                        List<String> wayTags = JSON.parseArray(wayId.getTags(), String.class);
-                        //总添加标签
-                        combinedTagsSet.addAll(wayTags);
-                        //用户存标签
-                        qwExternalContact.setTagIds(wayId.getTags());
-                    }
+
                 }
                 else {
                     if (!StringUtil.strIsNullOrEmpty(tagRemark) && (StringUtil.strIsNullOrEmpty(followUser.getRemark()) || StringUtils.equals(followUser.getRemark().trim(),externalContact.getName().trim()))) {
@@ -2767,6 +2811,13 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                     //SOP规则
                     qwSopRuleTimeTools(qwSopRuleTimeVOS,userID,qwUser,corpId,externalUserID,externalContact.getName(),contact,currentDate,localTime,combinedTagsList);
                 }
+
+                //新客对话任务
+                Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
+                if (!sopAiChatByRedis){
+                    asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
+                            ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
+                }
                 //aiSop任务
 //                List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
 //                if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()){
@@ -3216,6 +3267,12 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                     //SOP规则
                     qwSopRuleTimeTools(qwSopRuleTimeVOS,contact.getUserId(),qwUser,contact.getCorpId(),contact.getExternalUserId(),contact.getName(),contact,currentDate,localTime,combinedTagsList);
                 }
+
+                Boolean sopAiChatByRedis = getSopAiChatByRedis(qwUser.getQwUserId(), qwUser.getCorpId(), contact.getExternalUserId());
+                if (!sopAiChatByRedis){
+                    asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,qwUser.getQwUserId(),qwUser, contact.getExternalUserId()
+                            ,contact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
+                }
 //                //aiSop任务
 //                List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
 //                if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()){
@@ -4976,6 +5033,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                                                 //SOP规则
                                                 qwSopRuleTimeTools(qwSopRuleTimeVOS, qwUserId, qwUser, corpId, ext, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
                                             }
+
+                                            //aiSop任务
+                                            Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
+                                            if (!sopAiChatByRedis){
+                                                asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
+                                                        ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
+                                            }
+
                                             //aiSop任务
 //                                            List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
 //                                            if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
@@ -5014,6 +5079,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                                                 //SOP规则
                                                 qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
                                             }
+
+                                            //aiSop任务
+                                            Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
+                                            if (!sopAiChatByRedis){
+                                                asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
+                                                        ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
+                                            }
+
 //                                            //aiSop任务
 //                                            logger.info("/n 传参:" + qwSopAutoByTags);
 //                                            List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
@@ -5048,6 +5121,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                                                 //SOP规则
                                                 qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
                                             }
+
+                                            //新客对话任务
+                                            Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
+                                            if (!sopAiChatByRedis){
+                                                asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
+                                                        ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
+                                            }
+
 //                                            //aiSop任务
 //                                            List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
 //                                            if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
@@ -5264,6 +5345,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                                                         //SOP规则
                                                         qwSopRuleTimeTools(qwSopRuleTimeVOS, qwUserId, qwUser, corpId, ext, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
                                                     }
+
+                                                    //aiSop任务
+                                                    Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
+                                                    if (!sopAiChatByRedis){
+                                                        asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
+                                                                ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
+                                                    }
+
                                                     //aiSop任务
 //                                                    List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
 //                                                    if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
@@ -5295,6 +5384,13 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                                                         //SOP规则
                                                         qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
                                                     }
+
+                                                    //aiSop任务
+                                                    Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
+                                                    if (!sopAiChatByRedis){
+                                                        asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
+                                                                ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
+                                                    }
                                                     //aiSop任务
 //                                                    List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
 //                                                    if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
@@ -5322,6 +5418,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                                                         //SOP规则
                                                         qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
                                                     }
+
+                                                    //aiSop任务
+                                                    Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
+                                                    if (!sopAiChatByRedis){
+                                                        asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
+                                                                ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
+                                                    }
+
                                                     //aiSop任务
 //                                                    List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
 //                                                    if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {

+ 29 - 30
fs-service/src/main/resources/mapper/hisStore/FsUserScrmMapper.xml

@@ -515,49 +515,48 @@
     <update id="updateFsUser" parameterType="FsUserScrm">
         update fs_user
         <trim prefix="SET" suffixOverrides=",">
-            <if test="username != null">username = #{username},</if>
-            <if test="password != null">password = #{password},</if>
-            <if test="realName != null">real_name = #{realName},</if>
-            <if test="birthday != null">birthday = #{birthday},</if>
-            <if test="idCard != null">id_card = #{idCard},</if>
-            <if test="remark != null">remark = #{remark},</if>
+            <if test="nickName != null">nick_name = #{nickName},</if>
             <if test="nickname != null">nickname = #{nickname},</if>
             <if test="avatar != null">avatar = #{avatar},</if>
             <if test="phone != null">phone = #{phone},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="lastIp != null">last_ip = #{lastIp},</if>
-            <if test="nowMoney != null">now_money = #{nowMoney},</if>
-            <if test="brokeragePrice != null">brokerage_price = #{brokeragePrice},</if>
             <if test="integral != null">integral = #{integral},</if>
             <if test="signNum != null">sign_num = #{signNum},</if>
             <if test="status != null">status = #{status},</if>
-            <if test="level != null">level = #{level},</if>
-            <if test="spreadUserId != null">spread_user_id = #{spreadUserId},</if>
-            <if test="spreadTime != null">spread_time = #{spreadTime},</if>
-            <if test="userType != null and userType != ''">user_type = #{userType},</if>
-            <if test="isPromoter != null">is_promoter = #{isPromoter},</if>
-            <if test="payCount != null">pay_count = #{payCount},</if>
-            <if test="spreadCount != null">spread_count = #{spreadCount},</if>
-            <if test="addres != null and addres != ''">addres = #{addres},</if>
+            <if test="tuiUserId != null">tui_user_id = #{tuiUserId},</if>
+            <if test="tuiTime != null">tui_time = #{tuiTime},</if>
+            <if test="tuiUserCount != null">tui_user_count = #{tuiUserCount},</if>
             <if test="maOpenId != null">ma_open_id = #{maOpenId},</if>
             <if test="mpOpenId != null">mp_open_id = #{mpOpenId},</if>
             <if test="unionId != null">union_id = #{unionId},</if>
             <if test="isDel != null">is_del = #{isDel},</if>
+            <if test="userCode != null">user_code = #{userCode},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="lastIp != null">last_ip = #{lastIp},</if>
+            <if test="balance != null">balance = #{balance},</if>
+            <if test="integralStatus != null">integral_status = #{integralStatus},</if>
+            <if test="isBuy != null">is_buy = #{isBuy},</if>
+            <if test="password != null">password = #{password},</if>
+            <if test="jpushId != null">jpush_id = #{jpushId},</if>
+            <if test="isVip != null">is_vip = #{isVip},</if>
+            <if test="vipStartDate != null">vip_start_date = #{vipStartDate},</if>
+            <if test="vipEndDate != null">vip_end_date = #{vipEndDate},</if>
+            <if test="vipLevel != null">vip_level = #{vipLevel},</if>
+            <if test="vipStatus != null">vip_status = #{vipStatus},</if>
+            <if test="sex != null">sex = #{sex},</if>
+            <if test="storeOpenId != null">store_open_id = #{storeOpenId},</if>
+            <if test="isPush != null">is_push = #{isPush},</if>
+            <if test="isIndividuationPush != null">is_individuation_push = #{isIndividuationPush},</if>
             <if test="isWeixinAuth != null">is_weixin_auth = #{isWeixinAuth},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
-            <if test="registerDate != null">register_date = #{registerDate},</if>
-            <if test="registerCode != null">register_code = #{registerCode},</if>
+            <if test="loginDevice != null">login_device = #{loginDevice},</if>
             <if test="source != null">source = #{source},</if>
-            <if test="userCode != null">user_code = #{userCode},</if>
-            <if test="isShow != null">is_show = #{isShow},</if>
-            <if test="qwExtId != null">qw_ext_id = #{qwExtId},</if>
             <if test="isAddQw != null">is_add_qw = #{isAddQw},</if>
-            <!--<if test="qwRepeat != null">qw_repeat = #{qwRepeat},</if>
-            <if test="userRepeat != null">user_repeat = #{userRepeat},</if>
-            <if test="payOrder != null">pay_order = #{payOrder},</if>
-            <if test="isBecomeMember != null">is_become_member = #{isBecomeMember},</if>-->
+            <if test="courseMaOpenId != null">course_ma_open_id = #{courseMaOpenId},</if>
+            <if test="parentId != null">parent_id = #{parentId},</if>
+            <if test="qwExtId != null">qw_ext_id = #{qwExtId},</if>
+            <if test="companyId != null">company_id = #{companyId},</if>
+            <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
         </trim>
         where user_id = #{userId}
     </update>