|
@@ -490,6 +490,10 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
}
|
|
}
|
|
|
@Override
|
|
@Override
|
|
|
public R sendUserLogsInfoMsg(SendUserLogsInfoMsgParam param) {
|
|
public R sendUserLogsInfoMsg(SendUserLogsInfoMsgParam param) {
|
|
|
|
|
+ Long resolvedLiveId = resolveLiveIdFromParam(param);
|
|
|
|
|
+ if (resolvedLiveId != null) {
|
|
|
|
|
+ param.setLiveId(resolvedLiveId);
|
|
|
|
|
+ }
|
|
|
Boolean sendLiveMsg = Boolean.FALSE;
|
|
Boolean sendLiveMsg = Boolean.FALSE;
|
|
|
if(null != param.getLiveId()){
|
|
if(null != param.getLiveId()){
|
|
|
sendLiveMsg = Boolean.TRUE;
|
|
sendLiveMsg = Boolean.TRUE;
|
|
@@ -709,7 +713,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
//todo 发个人看课记录处理
|
|
//todo 发个人看课记录处理
|
|
|
try {
|
|
try {
|
|
|
if (vo != null && vo.getId() != null) {
|
|
if (vo != null && vo.getId() != null) {
|
|
|
- createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),vo.getId().toString(),Long.valueOf(st.getLiveId()),sysConfig.getAppId(),2, qwUser.getId().toString(),param.getCorpId());
|
|
|
|
|
|
|
+ createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),vo.getId().toString(),Long.valueOf(st.getLiveId()),sysConfig.getAppId(),2, qwUser.getId().toString(),param.getCorpId(), vo.getFsUserId());
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("群聊创建直播看课记录失败!", e);
|
|
log.error("群聊创建直播看课记录失败!", e);
|
|
@@ -815,7 +819,9 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
sysConfigLive.getAppId(),
|
|
sysConfigLive.getAppId(),
|
|
|
2,
|
|
2,
|
|
|
String.valueOf(qwUser.getId()),
|
|
String.valueOf(qwUser.getId()),
|
|
|
- param.getCorpId());
|
|
|
|
|
|
|
+ param.getCorpId(),
|
|
|
|
|
+ StringUtils.isNotEmpty(groupUser.getFsUserId())
|
|
|
|
|
+ ? Long.valueOf(groupUser.getFsUserId()) : null);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("APP直播模板解析失败:" + e);
|
|
log.error("APP直播模板解析失败:" + e);
|
|
|
}
|
|
}
|
|
@@ -825,10 +831,11 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
if (vo == null || vo.getId() == null || StringUtil.strIsNullOrEmpty(st.getLiveId())) {
|
|
if (vo == null || vo.getId() == null || StringUtil.strIsNullOrEmpty(st.getLiveId())) {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ sopLogs.setSendType(20);
|
|
|
String appLiveLink = createAppLiveShortLink(st, param.getCorpId(), qwUser.getId(),
|
|
String appLiveLink = createAppLiveShortLink(st, param.getCorpId(), qwUser.getId(),
|
|
|
companyUserId, companyId, vo.getId(), createTime);
|
|
companyUserId, companyId, vo.getId(), createTime);
|
|
|
st.setMiniprogramPage(appLiveLink);
|
|
st.setMiniprogramPage(appLiveLink);
|
|
|
- fillAppLiveSetting(st, param.getCorpId(), qwUser, vo.getId());
|
|
|
|
|
|
|
+ fillAppLiveSetting(st, param.getCorpId(), qwUser, vo.getId(), vo.getFsUserId());
|
|
|
if ("25".equals(st.getContentType())) {
|
|
if ("25".equals(st.getContentType())) {
|
|
|
st.setAppLinkUrl(appLiveLink);
|
|
st.setAppLinkUrl(appLiveLink);
|
|
|
sopLogs.setIsHaveApp(1);
|
|
sopLogs.setIsHaveApp(1);
|
|
@@ -992,7 +999,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
Map<String, GroupUserExternalVo> userMap = PubFun.listToMapByGroupObject(e.getUserList(), GroupUserExternalVo::getUserId);
|
|
Map<String, GroupUserExternalVo> userMap = PubFun.listToMapByGroupObject(e.getUserList(), GroupUserExternalVo::getUserId);
|
|
|
GroupUserExternalVo vo = userMap.get(groupChat.getOwner());
|
|
GroupUserExternalVo vo = userMap.get(groupChat.getOwner());
|
|
|
if (vo != null && vo.getId() != null) {
|
|
if (vo != null && vo.getId() != null) {
|
|
|
- createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),vo.getId().toString(),Long.valueOf(st.getLiveId()),sysConfig.getAppId(),2, qwUser.getId().toString(),param.getCorpId());
|
|
|
|
|
|
|
+ createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),vo.getId().toString(),Long.valueOf(st.getLiveId()),sysConfig.getAppId(),2, qwUser.getId().toString(),param.getCorpId(), vo.getFsUserId());
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
@@ -1123,7 +1130,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
sopLogs.setReceivingStatus(0L);
|
|
sopLogs.setReceivingStatus(0L);
|
|
|
sopLogs.setSopId(param.getSopId());
|
|
sopLogs.setSopId(param.getSopId());
|
|
|
sopLogs.setCorpId(item.getCorpId());
|
|
sopLogs.setCorpId(item.getCorpId());
|
|
|
- sopLogs.setFsUserId(item.getFsUserId());
|
|
|
|
|
|
|
+ sopLogs.setFsUserId(resolveFsUserIdForLiveWatch(item.getExternalId(), item.getFsUserId()));
|
|
|
sopLogs.setSort(30000000);
|
|
sopLogs.setSort(30000000);
|
|
|
sopLogs.setSendType(5);
|
|
sopLogs.setSendType(5);
|
|
|
sopLogs.setExternalUserName(item.getExternalUserName());
|
|
sopLogs.setExternalUserName(item.getExternalUserName());
|
|
@@ -1270,7 +1277,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
FSSysConfig sysConfig= JSON.parseObject(js,FSSysConfig.class);
|
|
FSSysConfig sysConfig= JSON.parseObject(js,FSSysConfig.class);
|
|
|
//发个人看课记录处理
|
|
//发个人看课记录处理
|
|
|
try {
|
|
try {
|
|
|
- createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),item.getExternalId().toString(),Long.valueOf(st.getLiveId()),sysConfig.getAppId(),2, qwUserId,param.getCorpId());
|
|
|
|
|
|
|
+ createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),item.getExternalId().toString(),Long.valueOf(st.getLiveId()),sysConfig.getAppId(),2, qwUserId,param.getCorpId(), item.getFsUserId());
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("群聊创建直播看课记录失败!", e);
|
|
log.error("群聊创建直播看课记录失败!", e);
|
|
@@ -1443,21 +1450,23 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
if (StringUtil.strIsNullOrEmpty(st.getLiveId())) {
|
|
if (StringUtil.strIsNullOrEmpty(st.getLiveId())) {
|
|
|
throw new BaseException("APP直播短链配置缺少直播间");
|
|
throw new BaseException("APP直播短链配置缺少直播间");
|
|
|
}
|
|
}
|
|
|
|
|
+ sopLogs.setSendType(20);
|
|
|
String appLiveLink = createAppLiveShortLink(st, param.getCorpId(), qwUser.getId(),
|
|
String appLiveLink = createAppLiveShortLink(st, param.getCorpId(), qwUser.getId(),
|
|
|
companyUserId, companyId, item.getExternalId(), createTime);
|
|
companyUserId, companyId, item.getExternalId(), createTime);
|
|
|
st.setMiniprogramPage(appLiveLink);
|
|
st.setMiniprogramPage(appLiveLink);
|
|
|
- fillAppLiveSetting(st, param.getCorpId(), qwUser, item.getExternalId());
|
|
|
|
|
|
|
+ fillAppLiveSetting(st, param.getCorpId(), qwUser, item);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
case "25": {
|
|
case "25": {
|
|
|
if (StringUtil.strIsNullOrEmpty(st.getLiveId())) {
|
|
if (StringUtil.strIsNullOrEmpty(st.getLiveId())) {
|
|
|
throw new BaseException("APP直播卡片配置缺少直播间");
|
|
throw new BaseException("APP直播卡片配置缺少直播间");
|
|
|
}
|
|
}
|
|
|
|
|
+ sopLogs.setSendType(20);
|
|
|
String appLiveLink = createAppLiveShortLink(st, param.getCorpId(), qwUser.getId(),
|
|
String appLiveLink = createAppLiveShortLink(st, param.getCorpId(), qwUser.getId(),
|
|
|
companyUserId, companyId, item.getExternalId(), createTime);
|
|
companyUserId, companyId, item.getExternalId(), createTime);
|
|
|
st.setMiniprogramPage(appLiveLink);
|
|
st.setMiniprogramPage(appLiveLink);
|
|
|
st.setAppLinkUrl(appLiveLink);
|
|
st.setAppLinkUrl(appLiveLink);
|
|
|
- fillAppLiveSetting(st, param.getCorpId(), qwUser, item.getExternalId());
|
|
|
|
|
|
|
+ fillAppLiveSetting(st, param.getCorpId(), qwUser, item);
|
|
|
sopLogs.setIsHaveApp(1);
|
|
sopLogs.setIsHaveApp(1);
|
|
|
sopLogs.setAppSendStatus(0);
|
|
sopLogs.setAppSendStatus(0);
|
|
|
break;
|
|
break;
|
|
@@ -1540,6 +1549,10 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public R sendUserLogsInfoMsgSop(SendUserLogsInfoMsgParam param) {
|
|
public R sendUserLogsInfoMsgSop(SendUserLogsInfoMsgParam param) {
|
|
|
|
|
+ Long resolvedLiveId = resolveLiveIdFromParam(param);
|
|
|
|
|
+ if (resolvedLiveId != null) {
|
|
|
|
|
+ param.setLiveId(resolvedLiveId);
|
|
|
|
|
+ }
|
|
|
List<String> sopUserLogsIds = sopUserLogsMapper.getSopUserLogsIds(param);
|
|
List<String> sopUserLogsIds = sopUserLogsMapper.getSopUserLogsIds(param);
|
|
|
if(sopUserLogsIds == null || sopUserLogsIds.isEmpty()){
|
|
if(sopUserLogsIds == null || sopUserLogsIds.isEmpty()){
|
|
|
throw new BaseException("SOP没有可发送的营期数据");
|
|
throw new BaseException("SOP没有可发送的营期数据");
|
|
@@ -1634,8 +1647,10 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
|
|
|
|
|
// 遍历分组
|
|
// 遍历分组
|
|
|
int finalSort = sort;
|
|
int finalSort = sort;
|
|
|
- if(null != param.getLiveId()){
|
|
|
|
|
|
|
+ Long resolvedLiveId = resolveLiveIdFromParam(param);
|
|
|
|
|
+ if (resolvedLiveId != null) {
|
|
|
sendType = 20;
|
|
sendType = 20;
|
|
|
|
|
+ param.setLiveId(resolvedLiveId);
|
|
|
}
|
|
}
|
|
|
int finalSendType = sendType;
|
|
int finalSendType = sendType;
|
|
|
groupedLogs.forEach((key, logs) -> {
|
|
groupedLogs.forEach((key, logs) -> {
|
|
@@ -1713,7 +1728,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
sopLogs.setReceivingStatus(0L);
|
|
sopLogs.setReceivingStatus(0L);
|
|
|
sopLogs.setSopId(item.getSopId());
|
|
sopLogs.setSopId(item.getSopId());
|
|
|
sopLogs.setCorpId(item.getCorpId());
|
|
sopLogs.setCorpId(item.getCorpId());
|
|
|
- sopLogs.setFsUserId(item.getFsUserId());
|
|
|
|
|
|
|
+ sopLogs.setFsUserId(resolveFsUserIdForLiveWatch(item.getExternalId(), item.getFsUserId()));
|
|
|
|
|
|
|
|
sopLogs.setSort(finalSort);
|
|
sopLogs.setSort(finalSort);
|
|
|
sopLogs.setSendType(finalSendType);
|
|
sopLogs.setSendType(finalSendType);
|
|
@@ -1952,7 +1967,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
FSSysConfig sysConfig= JSON.parseObject(json,FSSysConfig.class);
|
|
FSSysConfig sysConfig= JSON.parseObject(json,FSSysConfig.class);
|
|
|
//todo 发个人看课记录处理
|
|
//todo 发个人看课记录处理
|
|
|
try {
|
|
try {
|
|
|
- createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),item.getExternalId().toString(),Long.valueOf(st.getLiveId()),sysConfig.getAppId(),2, String.valueOf(qwUser.getId()),param.getCorpId());
|
|
|
|
|
|
|
+ createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),item.getExternalId().toString(),Long.valueOf(st.getLiveId()),sysConfig.getAppId(),2, String.valueOf(qwUser.getId()),param.getCorpId(), item.getFsUserId());
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("群聊创建直播看课记录失败!", e);
|
|
log.error("群聊创建直播看课记录失败!", e);
|
|
|
}
|
|
}
|
|
@@ -2131,6 +2146,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
if (StringUtil.strIsNullOrEmpty(st.getLiveId())) {
|
|
if (StringUtil.strIsNullOrEmpty(st.getLiveId())) {
|
|
|
throw new BaseException("APP直播短链配置缺少直播间");
|
|
throw new BaseException("APP直播短链配置缺少直播间");
|
|
|
}
|
|
}
|
|
|
|
|
+ sopLogs.setSendType(20);
|
|
|
String appLiveLink = createAppLiveShortLink(st, param.getCorpId(), qwUser.getId(),
|
|
String appLiveLink = createAppLiveShortLink(st, param.getCorpId(), qwUser.getId(),
|
|
|
companyUserId, companyId, item.getExternalId(), dataTime);
|
|
companyUserId, companyId, item.getExternalId(), dataTime);
|
|
|
st.setMiniprogramPage(appLiveLink);
|
|
st.setMiniprogramPage(appLiveLink);
|
|
@@ -2141,6 +2157,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
if (StringUtil.strIsNullOrEmpty(st.getLiveId())) {
|
|
if (StringUtil.strIsNullOrEmpty(st.getLiveId())) {
|
|
|
throw new BaseException("APP直播卡片配置缺少直播间");
|
|
throw new BaseException("APP直播卡片配置缺少直播间");
|
|
|
}
|
|
}
|
|
|
|
|
+ sopLogs.setSendType(20);
|
|
|
String appLiveLink = createAppLiveShortLink(st, param.getCorpId(), qwUser.getId(),
|
|
String appLiveLink = createAppLiveShortLink(st, param.getCorpId(), qwUser.getId(),
|
|
|
companyUserId, companyId, item.getExternalId(), dataTime);
|
|
companyUserId, companyId, item.getExternalId(), dataTime);
|
|
|
st.setMiniprogramPage(appLiveLink);
|
|
st.setMiniprogramPage(appLiveLink);
|
|
@@ -2421,11 +2438,18 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
|
|
|
|
|
private void fillAppLiveSetting(QwSopCourseFinishTempSetting.Setting st, String corpId, QwUser qwUser,
|
|
private void fillAppLiveSetting(QwSopCourseFinishTempSetting.Setting st, String corpId, QwUser qwUser,
|
|
|
SopUserLogsInfo item) {
|
|
SopUserLogsInfo item) {
|
|
|
- fillAppLiveSetting(st, corpId, qwUser, item != null ? item.getExternalId() : null);
|
|
|
|
|
|
|
+ fillAppLiveSetting(st, corpId, qwUser,
|
|
|
|
|
+ item != null ? item.getExternalId() : null,
|
|
|
|
|
+ item != null ? item.getFsUserId() : null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void fillAppLiveSetting(QwSopCourseFinishTempSetting.Setting st, String corpId, QwUser qwUser,
|
|
private void fillAppLiveSetting(QwSopCourseFinishTempSetting.Setting st, String corpId, QwUser qwUser,
|
|
|
Long externalId) {
|
|
Long externalId) {
|
|
|
|
|
+ fillAppLiveSetting(st, corpId, qwUser, externalId, null);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void fillAppLiveSetting(QwSopCourseFinishTempSetting.Setting st, String corpId, QwUser qwUser,
|
|
|
|
|
+ Long externalId, Long fsUserId) {
|
|
|
String liveConfigJson = configService.selectConfigByKey("his.config");
|
|
String liveConfigJson = configService.selectConfigByKey("his.config");
|
|
|
FSSysConfig liveSysConfig = JSON.parseObject(liveConfigJson, FSSysConfig.class);
|
|
FSSysConfig liveSysConfig = JSON.parseObject(liveConfigJson, FSSysConfig.class);
|
|
|
if (liveSysConfig != null && !StringUtil.strIsNullOrEmpty(liveSysConfig.getAppId())) {
|
|
if (liveSysConfig != null && !StringUtil.strIsNullOrEmpty(liveSysConfig.getAppId())) {
|
|
@@ -2441,7 +2465,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
try {
|
|
try {
|
|
|
createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),
|
|
createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),
|
|
|
externalId.toString(), Long.valueOf(st.getLiveId()), liveSysConfig.getAppId(), 2,
|
|
externalId.toString(), Long.valueOf(st.getLiveId()), liveSysConfig.getAppId(), 2,
|
|
|
- String.valueOf(qwUser.getId()), corpId);
|
|
|
|
|
|
|
+ String.valueOf(qwUser.getId()), corpId, fsUserId);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("APP直播一键群发创建看课记录失败", e);
|
|
log.error("APP直播一键群发创建看课记录失败", e);
|
|
|
}
|
|
}
|
|
@@ -2451,6 +2475,38 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
: st.getMiniprogramPicUrl());
|
|
: st.getMiniprogramPicUrl());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 从请求参数或规则配置中解析直播间ID
|
|
|
|
|
+ */
|
|
|
|
|
+ private Long resolveLiveIdFromParam(SendUserLogsInfoMsgParam param) {
|
|
|
|
|
+ if (param.getLiveId() != null) {
|
|
|
|
|
+ return param.getLiveId();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtil.strIsNullOrEmpty(param.getSetting())) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ List<QwSopCourseFinishTempSetting.Setting> list = JSONArray.parseArray(
|
|
|
|
|
+ param.getSetting(), QwSopCourseFinishTempSetting.Setting.class);
|
|
|
|
|
+ if (list == null) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ for (QwSopCourseFinishTempSetting.Setting st : list) {
|
|
|
|
|
+ if (st.getContentType() == null || StringUtil.strIsNullOrEmpty(st.getLiveId())) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ String contentType = st.getContentType();
|
|
|
|
|
+ if ("12".equals(contentType) || "18".equals(contentType) || "19".equals(contentType)
|
|
|
|
|
+ || "24".equals(contentType) || "25".equals(contentType)) {
|
|
|
|
|
+ return Long.valueOf(st.getLiveId());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("解析直播间ID失败", e);
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private String createAppLiveShortLink(QwSopCourseFinishTempSetting.Setting st, String corpId, Long qwUserId,
|
|
private String createAppLiveShortLink(QwSopCourseFinishTempSetting.Setting st, String corpId, Long qwUserId,
|
|
|
String companyUserId, String companyId, Long externalId, Date sendTime) {
|
|
String companyUserId, String companyId, Long externalId, Date sendTime) {
|
|
|
FsCourseLink link = new FsCourseLink();
|
|
FsCourseLink link = new FsCourseLink();
|
|
@@ -2541,7 +2597,12 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
* @param corpId
|
|
* @param corpId
|
|
|
*/
|
|
*/
|
|
|
public void createLiveWatchLogAndInsert(String companyId,String companyUserId,String externalId,Long liveId,String appId,Integer logSource,String qwUserId,String corpId){
|
|
public void createLiveWatchLogAndInsert(String companyId,String companyUserId,String externalId,Long liveId,String appId,Integer logSource,String qwUserId,String corpId){
|
|
|
|
|
+ createLiveWatchLogAndInsert(companyId, companyUserId, externalId, liveId, appId, logSource, qwUserId, corpId, null);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void createLiveWatchLogAndInsert(String companyId,String companyUserId,String externalId,Long liveId,String appId,Integer logSource,String qwUserId,String corpId, Long fsUserId){
|
|
|
try{
|
|
try{
|
|
|
|
|
+ Long resolvedUserId = resolveFsUserIdForLiveWatch(Long.valueOf(externalId), fsUserId);
|
|
|
// 写入对应数据源的记录表
|
|
// 写入对应数据源的记录表
|
|
|
LiveWatchLog itemLiveWatchLog = new LiveWatchLog();
|
|
LiveWatchLog itemLiveWatchLog = new LiveWatchLog();
|
|
|
itemLiveWatchLog.setLiveId(liveId);
|
|
itemLiveWatchLog.setLiveId(liveId);
|
|
@@ -2554,6 +2615,9 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
itemLiveWatchLog.setQwUserId(qwUserId);
|
|
itemLiveWatchLog.setQwUserId(qwUserId);
|
|
|
itemLiveWatchLog.setExternalContactId(Long.valueOf(externalId));
|
|
itemLiveWatchLog.setExternalContactId(Long.valueOf(externalId));
|
|
|
itemLiveWatchLog.setCorpId(corpId);
|
|
itemLiveWatchLog.setCorpId(corpId);
|
|
|
|
|
+ if (resolvedUserId != null) {
|
|
|
|
|
+ itemLiveWatchLog.setUserId(resolvedUserId);
|
|
|
|
|
+ }
|
|
|
if(liveWatchLogMapper.updateLiveWatchLogCondition(itemLiveWatchLog) > 0){
|
|
if(liveWatchLogMapper.updateLiveWatchLogCondition(itemLiveWatchLog) > 0){
|
|
|
|
|
|
|
|
}else{
|
|
}else{
|
|
@@ -2568,6 +2632,23 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 优先使用营期 fsUserId,为空时从 qw_external_contact.fs_user_id 回填
|
|
|
|
|
+ */
|
|
|
|
|
+ private Long resolveFsUserIdForLiveWatch(Long externalId, Long fsUserId) {
|
|
|
|
|
+ if (fsUserId != null && fsUserId > 0) {
|
|
|
|
|
+ return fsUserId;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (externalId == null) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ QwExternalContact contact = qwExternalContactMapper.selectQwExternalContactById(externalId);
|
|
|
|
|
+ if (contact != null && contact.getFsUserId() != null && contact.getFsUserId() > 0) {
|
|
|
|
|
+ return contact.getFsUserId();
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 构建福袋记录对象
|
|
* 构建福袋记录对象
|
|
|
*/
|
|
*/
|