Commit 13eb76cb by xiongjiangtao

Merge branch 'master' into 202406_chat_data

parents fcef86f6 febd5e40
......@@ -749,7 +749,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
memberId = memberService.getMemberIdByPhoneNumber(mobile, enterpriseId);
}
if (null == memberId) {
memberId = this.getMeberId(enterpriseId,unionId, name, avatar, qrcodeParam, externalUserid, wxEnterpriseRelated.getWxEnterpriseType(), 2) ;
memberId = this.getMeberId(enterpriseId,unionId, name, avatar, qrcodeParam, externalUserid, wxEnterpriseRelated.getWxEnterpriseType(), 2 , dto.getAddCreateTime()) ;
}
if (memberId == null) {
log.info("新增外部联系人,创建member失败,unionid={},外部联系人id={},", unionId,externalUserid);
......@@ -1529,7 +1529,11 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
this.saveExternalClerk(memberId, staffId, unionDTO, staffClerkRelation, statusFlag);
if(StringUtils.isNotBlank(memberId)) {
this.pushTagSync(memberId, wxEnterpriseId, enterpriseId);
if(null == RedisUtil.getCache("zhuan_self")) {
this.pushTagSync(memberId, wxEnterpriseId, enterpriseId);
}else {
log.info("不同步标签");
}
log.info("通知会员 更新为企微好友 memberId:{}", memberId);
// memberApiService.updateMemberQywxFlag(enterpriseId, memberId, 1);
List<TabHaobanExternalClerkRelated> memberList = externalClerkRelatedService.getAddTimeByMemberId(memberId, enterpriseId,"1");
......@@ -1948,7 +1952,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
log.info("导购码不存在:" + clerkId);
qrcodeParam = "clerk_clerk_"+clerk.getClerkId() ;
}
String memberId = this.getMeberId(enterpriseId, externalUserDTO.getUnionId(), externalUserDTO.getName(), externalUserDTO.getAvatar(), qrcodeParam, externalUserDTO.getExternalUserId(), wxEnterpriseRelated.getWxEnterpriseType(), 1) ;
String memberId = this.getMeberId(enterpriseId, externalUserDTO.getUnionId(), externalUserDTO.getName(), externalUserDTO.getAvatar(), qrcodeParam, externalUserDTO.getExternalUserId(), wxEnterpriseRelated.getWxEnterpriseType(), 1 , externalUserDTO.getAddCreateTime()) ;
if (memberId == null) {
return "会员不存在:unionid:" + externalUserDTO.getUnionId();
}
......@@ -1956,7 +1960,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
return this.saveExternalUser(externalUserDTO);
}
private String getMeberId(String enterpriseId , String unionid , String name , String image ,String qrcodeParam , String externalUserId , int wxEnterpriseType , int sence) {
private String getMeberId(String enterpriseId , String unionid , String name , String image ,String qrcodeParam , String externalUserId , int wxEnterpriseType , int sence , String qwTime) {
QywxMemberQDTO qdto = new QywxMemberQDTO() ;
qdto.setEnterpriseId(enterpriseId);
qdto.setNick(name);
......@@ -1966,6 +1970,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
if(wxEnterpriseType==0) {
qdto.setUserId(externalUserId);
}
if(StringUtils.isNotBlank(qwTime)) {
Date time = new Date(Long.valueOf(qwTime)*1000l);
qdto.setAddTime(time);
}
qdto.setSence(sence);
String memberId = null;
com.gic.api.base.commons.ServiceResponse<MemberSimpleDetailDTO> resp = this.memberEntranceApiService.enterpriseWechatByFriendEntrance(qdto);
......
......@@ -632,18 +632,22 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
List<String> takeoverClerkIdList = new ArrayList<>() ;
if(CollectionUtils.isNotEmpty(staffIdList)) {
for(int i=0;i<staffIdList.size();i++) {
List<String> clerkIdList = null ;
String staffId = staffIdList.get(i) ;
TabHaobanStaff staff = this.staffMapper.selectByPrimaryKeyNoStatus(staffId) ;
if(null != staff && null!= staff.getDelTime()) {
Date delTime = DateUtil.addNumForMinute(staff.getDelTime(),-5);
List<String> clerkIdList = this.tabHaobanStaffClerkRelationMapper.taskoverClerkIdList(staffId,delTime) ;
if(CollectionUtils.isNotEmpty(clerkIdList)) {
takeoverClerkIdList.addAll(clerkIdList);
}
}else if(null != staff) {
List<TabHaobanStaffClerkRelation> list = this.tabHaobanStaffClerkRelationMapper.taskoverClerkIdListAll(staffId) ;
if(CollectionUtils.isNotEmpty(list)) {
takeoverClerkIdList.add(list.get(0).getClerkId()) ;
if(null != staff) {
if (null != staff.getDelTime()) {
Date delTime = DateUtil.addNumForMinute(staff.getDelTime(), -5);
clerkIdList = this.tabHaobanStaffClerkRelationMapper.taskoverClerkIdList(staffId, delTime);
if (CollectionUtils.isNotEmpty(clerkIdList)) {
takeoverClerkIdList.addAll(clerkIdList);
}
if (CollectionUtils.isEmpty(clerkIdList)) {
List<TabHaobanStaffClerkRelation> list = this.tabHaobanStaffClerkRelationMapper.taskoverClerkIdListAll(staffId);
if (CollectionUtils.isNotEmpty(list)) {
takeoverClerkIdList.add(list.get(0).getClerkId());
}
}
}
}
}
......
......@@ -63,6 +63,13 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation {
String staffId = dataPre.getpDataId() ;
String taskId = dealParamMqDTO.getTaskId();
String externalUserId = dataPre.getDataContent();
String qywxFlushLimitFlag = "qywxFlushLimitFlag" ;
Object o = RedisUtil.getCache(qywxFlushLimitFlag) ;
if(null != o && o.toString().equals(wxEnterpriseId)) {
logger.info("超接口限制,staffId={},{},{}", staffId,wxUserId,externalUserId);
dealException(taskId, dataPre.getDataId(), null, "超接口限制");
return ;
}
// 查询企微侧外部联系人详情
ExternalUserDTO externalUserDTO = memberUnionidRelatedApiService.getCorpSelfExternalUseridInfo(wxEnterpriseId, wxUserId, externalUserId);
if (externalUserDTO == null) {
......
......@@ -495,7 +495,7 @@
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and super_manager_flag is null
and (wx_user_id = #{wxUserId,jdbcType=VARCHAR} or wx_open_user_id = #{wxUserId,jdbcType=VARCHAR})
order by update_time desc,create_time desc limit 1
order by status_flag asc , update_time desc,create_time desc limit 1
</select>
<update id="updateOpenUserIdsByUserId" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff">
......
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.web.controller;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.AccountService;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.common.anno.IgnoreLogin;
import com.gic.haoban.common.utils.HaobanResponse;
......@@ -9,6 +10,7 @@ import com.gic.haoban.common.utils.UploadUtils;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.thirdparty.api.service.QQCloudPicService;
import com.gic.thirdparty.cloudfile.CloudFileUtil;
import com.gic.thirdparty.cloudfile.CmeUtil;
import com.gic.thirdparty.cloudfile.enums.CloudFileBusinessOptEnum;
import com.gic.thirdparty.cloudfile.enums.CloudFileTypeEnum;
import com.gic.thirdparty.cloudfile.pojo.CloudFileInfo;
......@@ -17,6 +19,8 @@ import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
......@@ -30,10 +34,57 @@ import java.util.*;
public class UploadController extends WebBaseController {
private static org.apache.logging.log4j.Logger logger = LogManager.getLogger(UploadController.class);
@Autowired
private QQCloudPicService qqCloudPicService;
private AccountService accountService;
@Autowired
private EnterpriseService enterpriseService ;
/**
* 获取桶名称
* @param fileType 文件后缀 mp4、jpg....
* @param fileFlag 视频类型 3为cme临时资源 - 此字段保持原来业务
* @param tempFlag 是否临时文件,1是0否
* @return
*/
@RequestMapping("get-bucket")
@ResponseBody
public RestResponse<CloudFileInfo> getBucket(String fileType,String enterpriseId, @RequestParam(required = false)Integer fileFlag , String businessType , @RequestParam(defaultValue = "0") int tempFlag) {
CloudFileBusinessOptEnum businessOptEnum = null ;
// 天
Long timeOut = null ;
if(StringUtils.isBlank(businessType)) {
businessType = "material_content" ;
}
// 内容中心
if("material_content".equals(businessType)) {
//存储空间余额校验
if (!accountService.storageFeeCheck(enterpriseId)){
return RestResponse.failure("-1", "存储余额不足,暂不支持图片/视频上传,请充值");
}
businessOptEnum = CloudFileBusinessOptEnum.MATERIAL_CONTENT ;
}else if("haoban".equals(businessType)) {
// 好办
if(tempFlag==0) {
businessOptEnum = CloudFileBusinessOptEnum.HAOBAN_COMMON ;
}else {
businessOptEnum = CloudFileBusinessOptEnum.COMMON ;
timeOut = 7L ;
}
}
CloudFileTypeEnum cloudFileTypeEnum = CloudFileTypeEnum.getFileTypeByExtension(fileType);
CloudFileInfo cloudFileInfo = null;
//cme上传视频走 temp存储桶只存一天有效期
if (fileFlag != null && fileFlag == 3) {
cloudFileInfo = CloudFileUtil.getPreUploadTempFileInfo(fileType, cloudFileTypeEnum, CmeUtil.CME_TEMP_COS, CloudFileBusinessOptEnum.MATERIAL_CONTENT, 1L);
}else {
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(enterpriseId);
cloudFileInfo = CloudFileUtil.getPreUploadTempFileInfo(fileType, cloudFileTypeEnum, enterpriseDTO.getFactoryCode(), businessOptEnum,timeOut);
}
if (cloudFileInfo == null){
return RestResponse.failure("-1", "获取桶名称失败");
}
return RestResponse.successResult(cloudFileInfo);
}
@RequestMapping("upload-img")
@IgnoreLogin
......@@ -120,7 +171,7 @@ public class UploadController extends WebBaseController {
if(name.contains(".")) {
name = name.substring(name.lastIndexOf(".")+1) ;
}
CloudFileInfo uploadInfo = CloudFileUtil.uploadTempFile(file, name, type, factoryCode , CloudFileBusinessOptEnum.COMMON, 7*24L) ;
CloudFileInfo uploadInfo = CloudFileUtil.uploadTempFile(file, name, type, factoryCode , CloudFileBusinessOptEnum.COMMON, 7L) ;
if (uploadInfo != null) {
map.put("qcloudImageUrl", uploadInfo.getOrgFileUrl());
map.put("imageFiledCode", "imageFiledCode");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment