Commit a88f761e by 徐高华

Merge branch 'bugfix/2023-09-04' into 'master'

Bugfix/2023 09 04

See merge request !1420
parents 3a8770a1 68f061ac
...@@ -358,4 +358,5 @@ public interface StaffApiService { ...@@ -358,4 +358,5 @@ public interface StaffApiService {
com.gic.api.base.commons.ServiceResponse<StaffActiveAllocationDTO> staffActiveAllocation(String wxEnterpriseId,String staffIds); com.gic.api.base.commons.ServiceResponse<StaffActiveAllocationDTO> staffActiveAllocation(String wxEnterpriseId,String staffIds);
void updateStaffHead(String wxEnterpriseId ,String staffId, String headUrl);
} }
...@@ -207,6 +207,11 @@ ...@@ -207,6 +207,11 @@
<artifactId>gic-operating-api</artifactId> <artifactId>gic-operating-api</artifactId>
<version>${gic-operating-api}</version> <version>${gic-operating-api}</version>
</dependency> </dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-content-api</artifactId>
<version>${gic-content-api}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -15,6 +15,8 @@ public interface StaffMapper { ...@@ -15,6 +15,8 @@ public interface StaffMapper {
TabHaobanStaff selectByPrimaryKey(String staffId); TabHaobanStaff selectByPrimaryKey(String staffId);
TabHaobanStaff selectByPrimaryKeyNoStatus(String staffId);
int updateByPrimaryKeySelective(TabHaobanStaff record); int updateByPrimaryKeySelective(TabHaobanStaff record);
TabHaobanStaff selectByNationcodeAndPhoneNumber(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("nationCode") String nationcode, @Param("phoneNumber") String phoneNumber); TabHaobanStaff selectByNationcodeAndPhoneNumber(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("nationCode") String nationcode, @Param("phoneNumber") String phoneNumber);
...@@ -190,5 +192,6 @@ public interface StaffMapper { ...@@ -190,5 +192,6 @@ public interface StaffMapper {
TabHaobanStaff getNumByActiveCode(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("activeCode")String activeCode); TabHaobanStaff getNumByActiveCode(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("activeCode")String activeCode);
void updateOccupyFlagByStaffId(@Param("staffId") String staffId); void updateOccupyFlagByStaffId(@Param("staffId") String staffId);
void updateStaffHead(@Param("staffId")String staffId, @Param("headUrl")String headUrl);
} }
\ No newline at end of file
...@@ -10,6 +10,8 @@ public interface WxEnterpriseRelatedMapper { ...@@ -10,6 +10,8 @@ public interface WxEnterpriseRelatedMapper {
int deleteByEnterpriseId(String enterpriseId) ; int deleteByEnterpriseId(String enterpriseId) ;
int deleteById(String id) ;
int insertSelective(TabHaobanWxEnterpriseRelated record); int insertSelective(TabHaobanWxEnterpriseRelated record);
TabHaobanWxEnterpriseRelated selectByPrimaryKey(String wxEnterpriseRelatedId); TabHaobanWxEnterpriseRelated selectByPrimaryKey(String wxEnterpriseRelatedId);
......
...@@ -121,4 +121,6 @@ public interface HandoverService { ...@@ -121,4 +121,6 @@ public interface HandoverService {
*/ */
public List<HandoverStaffFriendCountDTO> listFriendCountByWxStaffIds(String wxEnterpriseId, List<String> staffIds); public List<HandoverStaffFriendCountDTO> listFriendCountByWxStaffIds(String wxEnterpriseId, List<String> staffIds);
Boolean filterHandoverStaff(String wxEnterpriseId, String wxUserId); Boolean filterHandoverStaff(String wxEnterpriseId, String wxUserId);
public void delHandoverStaff(String wxEnterpriseId, List<String> wxUserIds) ;
} }
...@@ -154,4 +154,6 @@ public interface StaffService { ...@@ -154,4 +154,6 @@ public interface StaffService {
* @return * @return
*/ */
List<String> queryStaffIdsWithEnterpriseId(List<String> wxEnterpriseIds); List<String> queryStaffIdsWithEnterpriseId(List<String> wxEnterpriseIds);
void updateStaffHead(String wxEnterpriseId ,String staffId, String headUrl);
} }
...@@ -85,7 +85,6 @@ public class HandoverServiceImpl implements HandoverService { ...@@ -85,7 +85,6 @@ public class HandoverServiceImpl implements HandoverService {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ; WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ;
if (CollectionUtils.isEmpty(infoList)) { if (CollectionUtils.isEmpty(infoList)) {
logger.info("没有要保存的数据,删除所有需要删除逇"); logger.info("没有要保存的数据,删除所有需要删除逇");
// delHandoverStaff(wxEnterpriseId, null);
return false; return false;
} }
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(qwDTO.getWxEnterpriseId(), SecretTypeEnum.CUSTOMIZED_APP.getVal()); SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(qwDTO.getWxEnterpriseId(), SecretTypeEnum.CUSTOMIZED_APP.getVal());
...@@ -127,20 +126,6 @@ public class HandoverServiceImpl implements HandoverService { ...@@ -127,20 +126,6 @@ public class HandoverServiceImpl implements HandoverService {
handoverExternalMapper.insertBatch(needAdd); handoverExternalMapper.insertBatch(needAdd);
} }
}); });
//删除不需要的staff数据
/*List<TabHandoverStaff> handoverStaffList = handoverStaffMapper.listByWxEnterpriseId(wxEnterpriseId);
if (CollectionUtils.isEmpty(handoverStaffList)) {
logger.info("没有新数据,无需删除");
return true;
}
Set<String> hasWxUserIds = handoverStaffList.stream().map(dto -> dto.getHandoverUserId()).collect(Collectors.toSet());
Sets.SetView<String> needDelUserIds = Sets.difference(hasWxUserIds, handoverUserMap.keySet());
if (CollectionUtils.isEmpty(needDelUserIds)) {
logger.info("没有新数据,无需删除2");
return true;
}
logger.info("删除数据");
delHandoverStaff(wxEnterpriseId, new ArrayList<>(needDelUserIds));*/
return false; return false;
} }
...@@ -158,7 +143,7 @@ public class HandoverServiceImpl implements HandoverService { ...@@ -158,7 +143,7 @@ public class HandoverServiceImpl implements HandoverService {
* @param wxEnterpriseId * @param wxEnterpriseId
* @param wxUserIds * @param wxUserIds
*/ */
private void delHandoverStaff(String wxEnterpriseId, List<String> wxUserIds) { public void delHandoverStaff(String wxEnterpriseId, List<String> wxUserIds) {
handoverStaffMapper.delByUserIds(wxEnterpriseId, wxUserIds); handoverStaffMapper.delByUserIds(wxEnterpriseId, wxUserIds);
handoverExternalMapper.delNoTransferExternal(wxUserIds, wxEnterpriseId); handoverExternalMapper.delNoTransferExternal(wxUserIds, wxEnterpriseId);
} }
......
...@@ -6,10 +6,13 @@ import com.alibaba.fastjson.JSON; ...@@ -6,10 +6,13 @@ import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.UniqueIdUtils; import com.gic.commons.util.UniqueIdUtils;
import com.gic.content.api.service.ContentProducerApiService;
import com.gic.haoban.common.utils.StringUtil; import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper; import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper; import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
...@@ -30,9 +33,8 @@ import org.apache.logging.log4j.Logger; ...@@ -30,9 +33,8 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collections; import java.util.*;
import java.util.Date; import java.util.stream.Collectors;
import java.util.List;
@Service @Service
public class StaffServiceImpl implements StaffService { public class StaffServiceImpl implements StaffService {
...@@ -50,6 +52,10 @@ public class StaffServiceImpl implements StaffService { ...@@ -50,6 +52,10 @@ public class StaffServiceImpl implements StaffService {
private HaobanQywxFeeAccountStaffService haobanQywxFeeAccountStaffService; private HaobanQywxFeeAccountStaffService haobanQywxFeeAccountStaffService;
@Autowired @Autowired
private QywxUserApiService qywxUserApiService ; private QywxUserApiService qywxUserApiService ;
@Autowired
private TabHaobanStaffClerkRelationMapper staffClerkRelationMapper ;
@Autowired
private ContentProducerApiService contentProducerApiService ;
@Override @Override
public TabHaobanStaff selectById(String id) { public TabHaobanStaff selectById(String id) {
...@@ -296,4 +302,20 @@ public class StaffServiceImpl implements StaffService { ...@@ -296,4 +302,20 @@ public class StaffServiceImpl implements StaffService {
} }
return this.mapper.queryStaffIdsWithEnterpriseId(wxEnterpriseIds); return this.mapper.queryStaffIdsWithEnterpriseId(wxEnterpriseIds);
} }
@Override
public void updateStaffHead(String wxEnterpriseId , String staffId, String headUrl) {
this.mapper.updateStaffHead(staffId,headUrl) ;
List<StaffClerkRelationDTO> list = this.staffClerkRelationMapper.lisByStaffId(wxEnterpriseId,staffId,null) ;
if(CollectionUtils.isNotEmpty(list)) {
Map<String,List<StaffClerkRelationDTO>> map = list.stream().collect(Collectors.groupingBy(StaffClerkRelationDTO::getEnterpriseId)) ;
Set<String> set = map.keySet() ;
Iterator<String> it = set.iterator() ;
while(it.hasNext()) {
String enterpriseId = it.next() ;
List<String> clerkIdList = map.get(enterpriseId).stream().map(o->o.getClerkId()).collect(Collectors.toList());
this.contentProducerApiService.updateClerkProducer(enterpriseId,clerkIdList,headUrl) ;
}
}
}
} }
...@@ -10,6 +10,8 @@ import com.gic.haoban.manage.api.dto.*; ...@@ -10,6 +10,8 @@ import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.service.HandoverOperationApiService; import com.gic.haoban.manage.api.service.HandoverOperationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService; import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.HandoverStaffMapper;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.entity.TabHandoverExternal; import com.gic.haoban.manage.service.entity.TabHandoverExternal;
import com.gic.haoban.manage.service.entity.TabHandoverStaff; import com.gic.haoban.manage.service.entity.TabHandoverStaff;
import com.gic.haoban.manage.service.entity.TabHandoverTransfer; import com.gic.haoban.manage.service.entity.TabHandoverTransfer;
...@@ -23,6 +25,7 @@ import com.gic.wechat.api.dto.qywx.QywxUnassignedInfoDTO; ...@@ -23,6 +25,7 @@ import com.gic.wechat.api.dto.qywx.QywxUnassignedInfoDTO;
import com.gic.wechat.api.dto.qywx.response.QywxGetUnassignedListDTO; import com.gic.wechat.api.dto.qywx.response.QywxGetUnassignedListDTO;
import com.gic.wechat.api.dto.qywx.response.QywxTransferCustomerDTO; import com.gic.wechat.api.dto.qywx.response.QywxTransferCustomerDTO;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
...@@ -53,11 +56,13 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ ...@@ -53,11 +56,13 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
@Autowired @Autowired
private WxEnterpriseService wxEnterpriseService; private WxEnterpriseService wxEnterpriseService;
@Autowired @Autowired
private Config config; private HandoverStaffMapper handoverStaffMapper;
@Autowired @Autowired
private WxEnterpriseApiService wxEnterpriseApiService; private WxEnterpriseApiService wxEnterpriseApiService;
@Autowired @Autowired
private StaffService staffService; private StaffService staffService;
@Autowired
private StaffMapper staffMapper ;
@Override @Override
...@@ -100,10 +105,11 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ ...@@ -100,10 +105,11 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
private List<QywxUnassignedInfoDTO> getAllQywxUnassigned(String wxEnterpriseId) { private List<QywxUnassignedInfoDTO> getAllQywxUnassigned(String wxEnterpriseId) {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId); WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
//这里改成LinkedList,避免使用ArrayList导致频繁扩容,从而减少内存的浪费 //这里改成LinkedList,避免使用ArrayList导致频繁扩容,从而减少内存的浪费
List<QywxUnassignedInfoDTO> ret = new LinkedList<>(); List<QywxUnassignedInfoDTO> retList = new LinkedList<>();
QywxGetUnassignedListDTO unassignedListDTO = null; QywxGetUnassignedListDTO unassignedListDTO = null;
String cursor = null; String cursor = null;
Map<String,Boolean> map = new HashMap<>() ; Map<String,Boolean> map = new HashMap<>() ;
Set<String> leaveStaffSet = new HashSet<>() ;
do { do {
//离职成员客户列表 //离职成员客户列表
unassignedListDTO = qywxUserApiService.getUnassignedList(qwDTO.getThirdCorpid(), qwDTO.getSelf3thSecret(), cursor , qwDTO.isSelf(),qwDTO.getUrlHost()); unassignedListDTO = qywxUserApiService.getUnassignedList(qwDTO.getThirdCorpid(), qwDTO.getSelf3thSecret(), cursor , qwDTO.isSelf(),qwDTO.getUrlHost());
...@@ -116,20 +122,34 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ ...@@ -116,20 +122,34 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
String handoverUserid = dto.getHandoverUserid(); String handoverUserid = dto.getHandoverUserid();
Boolean flag = map.get(handoverUserid) ; Boolean flag = map.get(handoverUserid) ;
if(null == flag) { if(null == flag) {
leaveStaffSet.add(handoverUserid) ;
flag = handoverService.filterHandoverStaff(wxEnterpriseId, handoverUserid) ; flag = handoverService.filterHandoverStaff(wxEnterpriseId, handoverUserid) ;
map.put(handoverUserid,flag) ; map.put(handoverUserid,flag) ;
} }
if (flag) { if (flag) {
ret.add(dto); retList.add(dto);
} }
} }
} }
} while (StringUtils.isNotBlank(cursor) && unassignedListDTO.getErrcode() == 0); } while (StringUtils.isNotBlank(cursor) && unassignedListDTO.getErrcode() == 0);
if (CollectionUtils.isEmpty(ret)) {
return ret; //删除不需要的staff数据
List<TabHandoverStaff> handoverStaffList = handoverStaffMapper.listByWxEnterpriseId(wxEnterpriseId);
if (CollectionUtils.isNotEmpty(handoverStaffList) && CollectionUtils.isNotEmpty(leaveStaffSet)) {
Set<String> hasWxUserIds = handoverStaffList.stream().map(dto -> dto.getHandoverUserId()).collect(Collectors.toSet());
Sets.SetView<String> needDelUserIds = Sets.difference(hasWxUserIds, leaveStaffSet);
if (CollectionUtils.isNotEmpty(needDelUserIds)) {
logger.info("需要删除的离职人={}",needDelUserIds);
this.handoverService.delHandoverStaff(wxEnterpriseId, new ArrayList<>(needDelUserIds));
}
}
if (CollectionUtils.isEmpty(retList)) {
logger.info("无待处理的离职继承数");
return retList;
} }
logger.info("无待处理的离职继承数={}",retList.size());
//去重 //去重
return ret.stream().collect( return retList.stream().collect(
Collectors.collectingAndThen( Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(dto -> { Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(dto -> {
return dto.getExternalUserid() + dto.getHandoverUserid(); return dto.getExternalUserid() + dto.getHandoverUserid();
...@@ -150,7 +170,7 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ ...@@ -150,7 +170,7 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
} }
transfers.forEach(dto -> { transfers.forEach(dto -> {
try { try {
TabHaobanStaff handover = staffService.selectById(dto.getHandoverStaffId()); TabHaobanStaff handover = staffMapper.selectByPrimaryKeyNoStatus(dto.getHandoverStaffId());
TabHaobanStaff takeover = staffService.selectById(dto.getTakeoverStaffId()); TabHaobanStaff takeover = staffService.selectById(dto.getTakeoverStaffId());
if(null == handover) { if(null == handover) {
logger.info("handover is null={}",dto.getHandoverStaffId()); logger.info("handover is null={}",dto.getHandoverStaffId());
......
...@@ -1388,4 +1388,9 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1388,4 +1388,9 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
return com.gic.api.base.commons.ServiceResponse.failure("-9999","成员不存在"); return com.gic.api.base.commons.ServiceResponse.failure("-9999","成员不存在");
} }
@Override
public void updateStaffHead(String wxEnterpriseId ,String staffId, String headUrl) {
this.staffService.updateStaffHead(wxEnterpriseId,staffId,headUrl) ;
}
} }
...@@ -22,6 +22,7 @@ import com.gic.haoban.common.utils.UuidUtil; ...@@ -22,6 +22,7 @@ import com.gic.haoban.common.utils.UuidUtil;
import com.gic.haoban.manage.api.dto.*; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum; import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService; import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper; import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper;
import com.gic.haoban.manage.service.entity.*; import com.gic.haoban.manage.service.entity.*;
import com.gic.haoban.manage.service.service.DepartmentService; import com.gic.haoban.manage.service.service.DepartmentService;
...@@ -54,6 +55,8 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi ...@@ -54,6 +55,8 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
@Autowired @Autowired
private WxEnterpriseRelatedMapper wxEnterpriseRelatedMapper; private WxEnterpriseRelatedMapper wxEnterpriseRelatedMapper;
@Autowired @Autowired
private WxEnterpriseMapper wxEnterpriseMapper ;
@Autowired
private WxEnterpriseRelatedService wxEnterpriseRelatedService; private WxEnterpriseRelatedService wxEnterpriseRelatedService;
@Autowired @Autowired
private StoreGroupService storeGroupService; private StoreGroupService storeGroupService;
...@@ -191,12 +194,26 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi ...@@ -191,12 +194,26 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
return details; return details;
} }
// @Override private String isBindMany(String enterpriseId , String wxEnterpriseId) {
// public List<EnterpriseDetailDTO> queryBindGicEnterpriseByTime(String seqTime) { List<TabHaobanWxEnterpriseRelated> list = this.wxEnterpriseRelatedMapper.listByEnterpriseId(enterpriseId) ;
// List<TabHaobanWxEnterpriseRelated> list = wxEnterpriseRelatedMapper.listEnterpriseByTime(seqTime); List<String> bindNameList = new ArrayList<>() ;
// List<EnterpriseDetailDTO> details = EntityUtil.changeEntityListByJSON(EnterpriseDetailDTO.class, list); if(CollectionUtils.isNotEmpty(list)) {
// return details; for(TabHaobanWxEnterpriseRelated item : list) {
// } TabHaobanWxEnterprise wxEnterprise = this.wxEnterpriseMapper.selectByPrimaryKey(item.getWxEnterpriseId()) ;
if(null == wxEnterprise || 0 == wxEnterprise.getStatusFlag()) {
this.wxEnterpriseRelatedMapper.deleteById(item.getWxEnterpriseRelatedId()) ;
} else {
if(!item.getWxEnterpriseId().equals(wxEnterpriseId)) {
bindNameList.add(wxEnterprise.getCorpName()) ;
}
}
}
if(CollectionUtils.isNotEmpty(bindNameList)) {
return bindNameList.stream().collect(Collectors.joining("、"));
}
}
return null ;
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
...@@ -220,6 +237,13 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi ...@@ -220,6 +237,13 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
String wxEnterpriseId = detailDTO.getWxEnterpriseId(); String wxEnterpriseId = detailDTO.getWxEnterpriseId();
//校验关联已经企业绑定 //校验关联已经企业绑定
TabHaobanWxEnterpriseRelated tab = wxEnterpriseRelatedMapper.findOneByEIdAndWxEid(enterpriseId, wxEnterpriseId); TabHaobanWxEnterpriseRelated tab = wxEnterpriseRelatedMapper.findOneByEIdAndWxEid(enterpriseId, wxEnterpriseId);
String bindMany = this.isBindMany(enterpriseId , wxEnterpriseId) ;
if(StringUtils.isNotBlank(bindMany)) {
logger.info("一GIC商户绑不能绑定多个");
resp.setCode(2);
resp.setMessage("商户不能绑多个企微("+bindMany+")");
return resp;
}
if (tab != null && (!tab.getWxEnterpriseRelatedId().equals(detailDTO.getWxEnterpriseRelatedId()))) { if (tab != null && (!tab.getWxEnterpriseRelatedId().equals(detailDTO.getWxEnterpriseRelatedId()))) {
logger.info("该企业已经被绑定过"); logger.info("该企业已经被绑定过");
resp.setCode(2); resp.setCode(2);
......
...@@ -232,5 +232,6 @@ ...@@ -232,5 +232,6 @@
<dubbo:service interface="com.gic.haoban.manage.api.service.content.task.CommissionTaskApiService" <dubbo:service interface="com.gic.haoban.manage.api.service.content.task.CommissionTaskApiService"
ref="commissionTaskApiService" timeout="10000" /> ref="commissionTaskApiService" timeout="10000" />
<dubbo:reference id="memberOrderReadApiService" interface="com.gic.order.api.service.member.MemberOrderReadApiService" timeout="10000" retries="0" check="false" /> <dubbo:reference id="memberOrderReadApiService" interface="com.gic.order.api.service.member.MemberOrderReadApiService" timeout="10000" retries="0" check="false" />
<dubbo:reference id="contentProducerApiService" interface="com.gic.content.api.service.ContentProducerApiService" timeout="10000" retries="0" check="false" />
</beans> </beans>
\ No newline at end of file
...@@ -45,6 +45,13 @@ ...@@ -45,6 +45,13 @@
where staff_id = #{staffId,jdbcType=VARCHAR} and status_flag = 1 where staff_id = #{staffId,jdbcType=VARCHAR} and status_flag = 1
</select> </select>
<select id="selectByPrimaryKeyNoStatus" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_staff
where staff_id = #{staffId,jdbcType=VARCHAR}
</select>
<update id="delOtherStaffByWxUserId"> <update id="delOtherStaffByWxUserId">
update tab_haoban_staff update tab_haoban_staff
...@@ -664,4 +671,9 @@ ...@@ -664,4 +671,9 @@
where staff_id= #{staffId} where staff_id= #{staffId}
</update> </update>
<update id="updateStaffHead">
update tab_haoban_staff set head_img = #{headUrl}, update_time= now()
where staff_id= #{staffId}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -31,7 +31,10 @@ ...@@ -31,7 +31,10 @@
<update id="deleteByEnterpriseId"> <update id="deleteByEnterpriseId">
update tab_haoban_wx_enterprise_related set status_flag = 0 , update_time=now() where enterprise_id=#{enterpriseId} and status_flag=1 update tab_haoban_wx_enterprise_related set status_flag = 0 , update_time=now() where enterprise_id=#{enterpriseId} and status_flag=1
</update> </update>
<update id="deleteById">
update tab_haoban_wx_enterprise_related set status_flag = 0 , update_time=now() where wx_enterprise_related_id=#{id} and status_flag=1
</update>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated"> <insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated">
insert into tab_haoban_wx_enterprise_related insert into tab_haoban_wx_enterprise_related
......
...@@ -5,6 +5,7 @@ import com.gic.haoban.manage.api.dto.chat.GroupChatPlanDTO; ...@@ -5,6 +5,7 @@ import com.gic.haoban.manage.api.dto.chat.GroupChatPlanDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.NoticeMessageQDTO; import com.gic.haoban.manage.api.dto.notify.qdto.NoticeMessageQDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO; import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum; import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.service.HandoverOperationApiService;
import com.gic.haoban.manage.api.service.QywxTagApiService; import com.gic.haoban.manage.api.service.QywxTagApiService;
import com.gic.haoban.manage.api.service.notify.NoticeMessageApiService; import com.gic.haoban.manage.api.service.notify.NoticeMessageApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
...@@ -33,19 +34,11 @@ public class ChatTest { ...@@ -33,19 +34,11 @@ public class ChatTest {
private static Logger logger = LoggerFactory.getLogger(ChatTest.class); private static Logger logger = LoggerFactory.getLogger(ChatTest.class);
@Autowired @Autowired
private GroupChatPlanService groupChatPlanService; private HandoverOperationApiService handoverOperationApiService;
@Test @Test
public void test() { public void test() {
String str = "{\"name\":\"测试\",\"remark\":\"测试\",\"expireDays\":\"2\",\"sendType\":1,\"sendTime\":\"\",\"chatContent\":\"[{\\\"img\\\":\\\"https://platform-1251519181.cos.ap-shanghai.myqcloud.com/image/jhdm/marketing_common-edc68cbf153846928c0ac28e2b2aa92f.jpg\\\",\\\"relation_id\\\":\\\"510923843246776342\\\",\\\"type\\\":2},{\\\"img\\\":\\\"https://platform-1251519181.cos.ap-shanghai.myqcloud.com/image/jhdm/marketing_common-3acc9bc9bbe8416e8aefe459b23eea5e.jpg\\\",\\\"relation_id\\\":\\\"510923843246776342\\\",\\\"type\\\":2},{\\\"content\\\":\\\"莎啦啦啦🐮\\\",\\\"relation_id\\\":\\\"510923843246776342\\\",\\\"type\\\":1}]\",\"staffIdList\":\"36067cdee7ba4ff6adc7551b34cc2005\",\"requestProject\":\"haoban-manage-web\"}"; this.handoverOperationApiService.dealQywxEnterpriseHandoverMq("ca66a01b79474c40b3e7c7f93daf1a3b") ;
GroupChatPlanDTO groupChatPlanDTO = JSONObject.parseObject(str, GroupChatPlanDTO.class);
groupChatPlanDTO.setWxEnterpriseId("ca66a01b79474c40b3e7c7f93daf1a3b");
groupChatPlanDTO.setEnterpriseId("ff8080815dacd3a2015dacd3ef5c0000");
groupChatPlanDTO.setCreatorId("fefd1c81641711e69d0818c58a146fd2");
groupChatPlanDTO.setCreatorName("达摩管理员");
groupChatPlanDTO.setMaterialFrom(2);
groupChatPlanService.save(groupChatPlanDTO);
} }
@Test @Test
......
...@@ -1906,4 +1906,13 @@ public class WxStaffController extends WebBaseController { ...@@ -1906,4 +1906,13 @@ public class WxStaffController extends WebBaseController {
} }
return RestResponse.successResult(vo); return RestResponse.successResult(vo);
} }
@RequestMapping("update-staff-head")
public RestResponse<Object> updateStaffHead(String wxEnterpriseId , String staffId , String headUrl){
if(StrUtil.isBlank(headUrl)){
return RestResponse.failure("-1", "参数不能为空!!!");
}
this.staffApiService.updateStaffHead(wxEnterpriseId,staffId,headUrl) ;
return RestResponse.successResult() ;
}
} }
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