Browse Source

换绑会员时修改用户信息采集用户id

wjj 4 days ago
parent
commit
0529889a78

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsUserInformationCollectionMapper.java

@@ -23,6 +23,8 @@ public interface FsUserInformationCollectionMapper extends BaseMapper<FsUserInfo
      */
     FsUserInformationCollection selectFsUserInformationCollectionById(Long id);
 
+    FsUserInformationCollection selectFsUserInformationCollectionByUserId(Long userId);
+
     /**
      * 查询用户信息采集列表
      * 

+ 15 - 0
fs-service/src/main/java/com/fs/qw/service/impl/QwExternalContactServiceImpl.java

@@ -28,6 +28,8 @@ import com.fs.crm.mapper.CrmCustomerMapper;
 import com.fs.his.domain.FsUser;
 import com.fs.his.mapper.FsUserMapper;
 import com.fs.his.utils.PhoneUtil;
+import com.fs.hisStore.domain.FsUserInformationCollection;
+import com.fs.hisStore.mapper.FsUserInformationCollectionMapper;
 import com.fs.qw.domain.*;
 import com.fs.qw.mapper.*;
 import com.fs.qw.param.*;
@@ -202,6 +204,9 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
     @Autowired
     private ISysDictTypeService dictTypeService;
 
+    @Autowired
+    private FsUserInformationCollectionMapper fsUserInformationCollectionMapper;
+
 
     Logger logger = LoggerFactory.getLogger(getClass());
 
@@ -4745,6 +4750,16 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
         c.setId(qwExternalContact.getId());
         c.setFsUserId(qwExternalContact.getFsUserId());
 //        adHtmlClickLogService.upload(c.getState(), AdUploadType.REGISTERED, e -> c.setUploadRegisterStatus(1));
+        if (qwExternalContact.getFsUserId() != null) {
+            FsUserInformationCollection collection = fsUserInformationCollectionMapper.selectFsUserInformationCollectionByUserId(qwExternalContact.getFsUserId());
+            if (collection != null) {
+                FsUserInformationCollection map = new FsUserInformationCollection();
+                map.setId(collection.getId());
+                map.setUserId(qwExternalContact.getFsUserId());
+                fsUserInformationCollectionMapper.updateFsUserInformationCollection(map);
+            }
+        }
+
         qwExternalContactMapper.updateQwExternalContact(c);
 
         //换绑营期中的

+ 5 - 0
fs-service/src/main/resources/mapper/hisStore/FsUserInformationCollectionMapper.xml

@@ -44,6 +44,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </select>
 
+    <select id="selectFsUserInformationCollectionByUserId" parameterType="Long" resultMap="FsUserInformationCollectionResult">
+        <include refid="selectFsUserInformationCollectionVo"/>
+        where user_id = #{userId}
+    </select>
+
     <select id="selectByUserId" parameterType="Long" resultMap="FsUserInformationCollectionResult">
         <include refid="selectFsUserInformationCollectionVo"/>
         where user_id = #{userId}