Commit 4ee05958 by 墨竹

Merge branch 'developer' into feature-qywx-fee

# Conflicts:
#	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
#	haoban-manage3-service/src/main/resources/mapper/WxEnterpriseMapper.xml
parents c1801f2b a16078e8
......@@ -35,6 +35,8 @@ public class ExternalUserDTO implements Serializable{
*/
private Integer friendType;
private String state;
public Integer getFriendType() {
return friendType;
}
......@@ -146,8 +148,12 @@ public class ExternalUserDTO implements Serializable{
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
}
......@@ -105,6 +105,7 @@ public interface HmQrcodeApiService {
/**
* 检查员工开启联系我
* 定时任务
*
* @param param 参数
* @author mozhu
* @date 2022-07-07 14:25:54
......@@ -115,10 +116,11 @@ public interface HmQrcodeApiService {
* 检查员工开启联系我
*
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @author mozhu
* @date 2022-07-19 15:53:37
* @date 2022-08-08 22:01:43
*/
void checkStaffOpenContactByWxEnterpriseId(String wxEnterpriseId);
void checkStaffOpenContactByWxEnterpriseId(String wxEnterpriseId, String enterpriseId);
/**
......@@ -129,22 +131,22 @@ public interface HmQrcodeApiService {
* @author mozhu
* @date 2022-07-08 15:07:15
*/
List<HmQrcodeStoreDTO> getHmStoreByEnterpriseId(String wxEnterpriseId , String enterpriseId);
List<HmQrcodeStoreDTO> getHmStoreByEnterpriseId(String wxEnterpriseId, String enterpriseId);
/**
*
* @Title: getHmStoreForWxa
* @Description: 返回小程序有活码的门店列表
* @author xugh
* @param enterpriseId
* @return
* @throws
* @param enterpriseId
* @return
* @throws
* @Title: getHmStoreForWxa
* @Description: 返回小程序有活码的门店列表
* @author xugh
*/
List<String> getHmStoreForWxa(String wxEnterpriseId ,String enterpriseId) ;
List<String> getHmStoreForWxa(String wxEnterpriseId, String enterpriseId);
/**
* 批量修改活码分组
*
* @param hmIds
* @param groupId
* @return
......@@ -153,16 +155,15 @@ public interface HmQrcodeApiService {
/**
*
* @Title: listHmIdForIndex
* @Description: 返回活码id列表,用于首页列表查询
* @author xugh
* @param qdto
* @return
* @throws
* @param qdto
* @return
* @throws
* @Title: listHmIdForIndex
* @Description: 返回活码id列表, 用于首页列表查询
* @author xugh
*/
ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto) ;
ServiceResponse<List<String>> listHasQrcodeClerk(String enterpriseId , List<String> clerkIdList) ;
ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto);
ServiceResponse<List<String>> listHasQrcodeClerk(String enterpriseId, List<String> clerkIdList);
}
......@@ -18,9 +18,9 @@ public interface TabHaobanStaffClerkRelationMapper {
int updateByPrimaryKeySelective(TabHaobanStaffClerkRelation record);
List<TabHaobanStaffClerkRelation> listBindCode(@Param("enterpriseId")String enterpriseId, @Param("clerkCodeList")Set<String> clerkCodeList);
List<TabHaobanStaffClerkRelation> listBindCode(@Param("enterpriseId") String enterpriseId, @Param("clerkCodeList") Set<String> clerkCodeList);
List<TabHaobanStaffClerkRelation> listBindCodeByStaffId(@Param("enterpriseIdList")List<String> enterpriseIdList, @Param("staffId")String staffId);
List<TabHaobanStaffClerkRelation> listBindCodeByStaffId(@Param("enterpriseIdList") List<String> enterpriseIdList, @Param("staffId") String staffId);
TabHaobanStaffClerkRelation getOneByClerkId(@Param("clerkId") String clerkId);
......@@ -35,6 +35,7 @@ public interface TabHaobanStaffClerkRelationMapper {
/**
* 更新信息
*
* @param record
* @return
*/
......@@ -47,13 +48,14 @@ public interface TabHaobanStaffClerkRelationMapper {
* @param wxEnterpriseId
* @return
*/
TabHaobanStaffClerkRelation getBindByClerkId(@Param("clerkId") String clerkId,@Param("wxEnterpriseId") String wxEnterpriseId);
TabHaobanStaffClerkRelation getByCodeAndEnterpriseId(@Param("clerkCode")String clerkCode, @Param("enterpriseId")String enterpriseId);
TabHaobanStaffClerkRelation getBindByClerkId(@Param("clerkId") String clerkId, @Param("wxEnterpriseId") String wxEnterpriseId);
TabHaobanStaffClerkRelation getByCodeAndEnterpriseId(@Param("clerkCode") String clerkCode, @Param("enterpriseId") String enterpriseId);
/**
* 解绑
*/
void delByStoreIdAndCode( @Param("storeId")String storeId,@Param("clerkCode")String clerkCode);
void delByStoreIdAndCode(@Param("storeId") String storeId, @Param("clerkCode") String clerkCode);
/**
......@@ -66,36 +68,36 @@ public interface TabHaobanStaffClerkRelationMapper {
*/
List<StaffClerkRelationDTO> listByClerkIds(@Param("clerkIds") List<String> clerkIds);
List<TabHaobanStaffClerkRelation> listByStoreId(@Param("storeId")String storeId);
TabHaobanStaffClerkRelation getOneByStoreIdAndStaffId(@Param("storeId")String storeId,@Param("staffId")String staffId);
List<TabHaobanStaffClerkRelation> listByStoreId(@Param("storeId") String storeId);
TabHaobanStaffClerkRelation getOneByStoreIdAndStaffId(@Param("storeId") String storeId, @Param("staffId") String staffId);
/**
* 解绑
*/
int cleanStaffDepart( @Param("wxEnterpriseId")String wxEnterpriseId,@Param("staffIds")List<String> staffIds);
int cleanStaffDepart(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIds") List<String> staffIds);
TabHaobanStaffClerkRelation getOneBindCodeNoStatus(@Param("enterpriseId") String enterpriseId, @Param("clerkCode") String clerkCode);
TabHaobanStaffClerkRelation getOneBindStoreId(@Param("staffId") String staffId, @Param("storeId") String storeId);
TabHaobanStaffClerkRelation getOneBindCodeNoStatus(@Param("enterpriseId")String enterpriseId, @Param("clerkCode")String clerkCode);
TabHaobanStaffClerkRelation getByClerkId(@Param("clerkId") String clerkId);
TabHaobanStaffClerkRelation getOneBindStoreId(@Param("staffId")String staffId, @Param("storeId")String storeId);
TabHaobanStaffClerkRelation getByClerkIdNoStatus(@Param("clerkId") String clerkId);
TabHaobanStaffClerkRelation getByClerkId(@Param("clerkId")String clerkId);
int delByPrimaryKey(@Param("staffClerkRelationId") String staffClerkRelationId);
TabHaobanStaffClerkRelation getByClerkIdNoStatus(@Param("clerkId")String clerkId);
void delByClerkId(@Param("clerkId") String clerkId);
int delByPrimaryKey(@Param("staffClerkRelationId")String staffClerkRelationId);
void delByClerkId(@Param("clerkId")String clerkId);
List<TabHaobanStaffClerkRelation>listByEnterpriseIdAndWxUserId(@Param("enterpriseId")String enterpriseId,@Param("wxUserId")String wxUserId);
List<TabHaobanStaffClerkRelation> listByEnterpriseIdAndWxUserId(@Param("enterpriseId") String enterpriseId, @Param("wxUserId") String wxUserId);
List<TabHaobanStaffClerkRelation> lisByStaffId(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("staffId")String staffId , @Param("storeIdList") List<String> storeIdList);
List<TabHaobanStaffClerkRelation> lisByStaffId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffId") String staffId, @Param("storeIdList") List<String> storeIdList);
TabHaobanStaffClerkRelation getByCodeAndStoreId(@Param("clerkCode")String clerkCode, @Param("storeId")String storeId);
List<TabHaobanStaffClerkRelation> listByWxEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId);
TabHaobanStaffClerkRelation getByCodeAndStoreId(@Param("clerkCode") String clerkCode, @Param("storeId") String storeId);
List<TabHaobanStaffClerkRelation> pageByWxEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId);
List<TabHaobanStaffClerkRelation> listByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
List<TabHaobanStaffClerkRelation> pageByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
List<TabHaobanStaffClerkRelation> listBindByStoreId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("storeId") String storeId);
......@@ -145,8 +147,8 @@ public interface TabHaobanStaffClerkRelationMapper {
* 查询有关联的员工id列表
*
* @param staffIdList 员工id列表
* @author: YongEn
* @return {@link List<String>}
* @author: YongEn
*/
List<String> listRelationsStaffId(@Param("staffIdList") Set<String> staffIdList);
......@@ -154,7 +156,7 @@ public interface TabHaobanStaffClerkRelationMapper {
* 批量查询会员与导购关系并且返回关联信息
*
* @param memberIdList 会员id列表
* @param clerkIdList 导购id列表
* @param clerkIdList 导购id列表
* @param enterpriseId 企业id
* @return {@link MemberStaffRelExtDO}
*/
......@@ -202,18 +204,32 @@ public interface TabHaobanStaffClerkRelationMapper {
List<String> listWxUserIdByClerkIds(@Param("clerkIds") List<String> clerkIds,
@Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 根据导购查询wxopenuserid
*
* @param clerkIds 职员id
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link String }>
* @author mozhu
* @date 2022-08-09 00:42:31
*/
List<String> listWxOpenUserIdByClerkIds(@Param("clerkIds") List<String> clerkIds,
@Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 通过userId 查询id
*
* @param wxOpenUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link String }>
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-07-07 15:26:32
* @date 2022-08-08 21:51:22
*/
List<StaffClerkRelationDTO> listIdsByWxOpenUserIds(@Param("wxOpenUserIds") List<String> wxOpenUserIds,
@Param("wxEnterpriseId") String wxEnterpriseId);
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId);
/**
* 更新联系我状态
......@@ -231,11 +247,14 @@ public interface TabHaobanStaffClerkRelationMapper {
*
* @param wxOpenUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-07-07 16:12:05
* @date 2022-08-08 22:02:18
*/
List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(List<String> wxOpenUserIds, String wxEnterpriseId);
List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(@Param("wxOpenUserIds") List<String> wxOpenUserIds,
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId);
/**
* 通过职员id 查询职员id列表
......@@ -247,5 +266,5 @@ public interface TabHaobanStaffClerkRelationMapper {
* @date 2022-07-07 16:30:32
*/
List<StaffClerkRelationDTO> listClerkIdConcatFlagByClerkIds(@Param("clerkIds") List<String> clerkIds,
@Param("wxEnterpriseId") String wxEnterpriseId);
@Param("wxEnterpriseId") String wxEnterpriseId);
}
\ No newline at end of file
......@@ -86,11 +86,11 @@ public interface WxEnterpriseMapper {
int updateAutoActiveFlagById(@Param("autoActiveFlag") Integer autoActiveFlag, @Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 列出所有wx企业(与gic关联)
* 列出所有企业(与gic关联)
*
* @return {@link List }<{@link WxEnterpriseDTO }>
* @author mozhu
* @date 2022-08-08 13:45:30
*/
List<WxEnterpriseDTO> listAllWxEnterprise();
List<WxEnterpriseDTO> listAllEnterprise();
}
\ No newline at end of file
......@@ -22,6 +22,7 @@ public class ExternalUserPojo implements Serializable{
* 1表示该外部联系人是微信用户,2表示该外部联系人是企业微信用户
*/
private Integer friendType;
private String state;
public Integer getFriendType() {
return friendType;
......@@ -86,4 +87,12 @@ public class ExternalUserPojo implements Serializable{
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
}
......@@ -171,11 +171,12 @@ public interface StaffClerkRelationService {
*
* @param wxOpenUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link String }>
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-07-07 15:25:57
* @date 2022-08-08 22:01:59
*/
List<StaffClerkRelationDTO> listIdsByWxOpenUserIds(List<String> wxOpenUserIds,String wxEnterpriseId);
List<StaffClerkRelationDTO> listIdsByWxOpenUserIds(List<String> wxOpenUserIds,String wxEnterpriseId,String enterpriseId);
/**
......@@ -183,11 +184,12 @@ public interface StaffClerkRelationService {
*
* @param wxOpenUserIds wx开放用户id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link StaffClerkRelationDTO }>
* @author mozhu
* @date 2022-07-07 16:11:25
* @date 2022-08-08 21:51:52
*/
List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(List<String> wxOpenUserIds,String wxEnterpriseId);
List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(List<String> wxOpenUserIds,String wxEnterpriseId,String enterpriseId);
/**
......
......@@ -59,13 +59,13 @@ public interface WxEnterpriseService {
/**
* 列出所有wx企业(已关联gic企业)
* 列出所有企业(已关联gic企业)
*
* @return {@link List }<{@link WxEnterpriseDTO }>
* @author mozhu
* @date 2022-08-08 13:38:31
*/
List<WxEnterpriseDTO> listAllWxEnterprise();
List<WxEnterpriseDTO> listAllEnterprise();
/**
* 更新userid
......
......@@ -52,84 +52,92 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
@Override
public void save(WxUserAddLogQDTO qdto) {
log.info("保存用户信息-add={}", JSON.toJSON(qdto));
String externalUserid = qdto.getExternalUserid();
String wxUserId = qdto.getWxUserId();
TabWxUserAddLog entity = new TabWxUserAddLog();
entity.setLogId(UniqueIdUtils.uniqueLong());
entity.setWxEnterpriseId(qdto.getWxEnterpriseId());
entity.setEnterpriseId(qdto.getEnterpriseId());
entity.setExternalUserid(externalUserid);
entity.setAddChannel(0);
entity.setStatusFlag(1);
entity.setWxUserId(qdto.getWxUserId());
entity.setStaffId(qdto.getStaffId());
entity.setStaffName(qdto.getStaffName());
entity.setAllDelFlag(0);
if (qdto.isDelFlag()) {
TabWxUserAddLog log = this.wxUserAddLogMapper.selectNewLog(externalUserid, wxUserId);
entity = log;
try {
log.info("保存用户信息-add={}", JSON.toJSON(qdto));
String externalUserid = qdto.getExternalUserid();
String wxUserId = qdto.getWxUserId();
TabWxUserAddLog entity = new TabWxUserAddLog();
entity.setLogId(UniqueIdUtils.uniqueLong());
entity.setStatusFlag(2);
// 是否所有好友删除 1是0否
entity.setAllDelFlag(this.isAllDel(externalUserid));
}
// 新增好友
if (!qdto.isDelFlag()) {
String memberLabelId = null;
if (null != qdto.getHmId()) {
HmQrcodeBO hm = this.hmQrcodeService.queryById(qdto.getHmId());
entity.setAddChannel(2);
entity.setHmId(qdto.getHmId());
entity.setHmName(hm.getName());
Integer hmType = hm.getHmType();
if (hmType == 1) {
entity.setClerkId(hm.getClerkId());
entity.setClerkCode(hm.getClerkCode());
entity.setClerkName(hm.getClerkName());
entity.setStoreId(hm.getStoreId());
entity.setStoreCode(hm.getStoreCode());
entity.setStoreName(hm.getStoreName());
} else if (hmType == 2) {
HmClerkRelationBO hmClerkRelationBO = hmClerkRelationService.queryByHmIdAndClerkId(qdto.getHmId(), qdto.getClerkId());
if (hmClerkRelationBO != null) {
entity.setClerkId(hmClerkRelationBO.getClerkId());
entity.setClerkCode(hmClerkRelationBO.getClerkCode());
entity.setClerkName(hmClerkRelationBO.getClerkName());
entity.setStoreId(hmClerkRelationBO.getStoreId());
entity.setStoreCode(hmClerkRelationBO.getStoreCode());
entity.setStoreName(hmClerkRelationBO.getStoreName());
}
entity.setWxEnterpriseId(qdto.getWxEnterpriseId());
entity.setEnterpriseId(qdto.getEnterpriseId());
entity.setExternalUserid(externalUserid);
entity.setAddChannel(0);
entity.setStatusFlag(1);
entity.setWxUserId(qdto.getWxUserId());
entity.setStaffId(qdto.getStaffId());
entity.setStaffName(qdto.getStaffName());
entity.setAllDelFlag(0);
if (qdto.isDelFlag()) {
TabWxUserAddLog logUser = this.wxUserAddLogMapper.selectNewLog(externalUserid, wxUserId);
if(null == logUser) {
log.info("删除好友") ;
return ;
}
memberLabelId = hm.getMemberLabelId();
}
if (null != qdto.getLinkId()) {
HmLinkBO link = this.hmLinkService.getByLinkIdFormCache(qdto.getWxEnterpriseId(),
qdto.getEnterpriseId(), qdto.getLinkId());
entity.setAddChannel(1);
entity.setLinkId(qdto.getLinkId());
entity.setLinkName(link.getName());
memberLabelId = link.getMemberLabelId();
entity = logUser;
entity.setLogId(UniqueIdUtils.uniqueLong());
entity.setStatusFlag(2);
// 是否所有好友删除 1是0否
entity.setAllDelFlag(this.isAllDel(externalUserid));
}
// 新增好友
if (!qdto.isDelFlag()) {
String memberLabelId = null;
if (null != qdto.getHmId()) {
HmQrcodeBO hm = this.hmQrcodeService.queryById(qdto.getHmId());
entity.setAddChannel(2);
entity.setHmId(qdto.getHmId());
entity.setHmName(hm.getName());
Integer hmType = hm.getHmType();
if (hmType == 1) {
entity.setClerkId(hm.getClerkId());
entity.setClerkCode(hm.getClerkCode());
entity.setClerkName(hm.getClerkName());
entity.setStoreId(hm.getStoreId());
entity.setStoreCode(hm.getStoreCode());
entity.setStoreName(hm.getStoreName());
} else if (hmType == 2) {
HmClerkRelationBO hmClerkRelationBO = hmClerkRelationService.queryByHmIdAndClerkId(qdto.getHmId(), qdto.getClerkId());
if (hmClerkRelationBO != null) {
entity.setClerkId(hmClerkRelationBO.getClerkId());
entity.setClerkCode(hmClerkRelationBO.getClerkCode());
entity.setClerkName(hmClerkRelationBO.getClerkName());
entity.setStoreId(hmClerkRelationBO.getStoreId());
entity.setStoreCode(hmClerkRelationBO.getStoreCode());
entity.setStoreName(hmClerkRelationBO.getStoreName());
}
}
if (null != memberLabelId) {
entity.setMemberLabelId(memberLabelId);
MemberTagItemDTO dto = this.memberTagApiService.findMemberTagItem(memberLabelId);
if (null != dto) {
String tagId = dto.getTagId();
MemberTagDTO tag = this.memberTagApiService.getMemberTagById(tagId);
entity.setMemberLabelName(tag.getTagName() + "-" + dto.getTagItemName());
} else {
log.info("会员标签查询null,memberLabelId={}", memberLabelId);
memberLabelId = hm.getMemberLabelId();
}
if (null != qdto.getLinkId()) {
HmLinkBO link = this.hmLinkService.getByLinkIdFormCache(qdto.getWxEnterpriseId(),
qdto.getEnterpriseId(), qdto.getLinkId());
entity.setAddChannel(1);
entity.setLinkId(qdto.getLinkId());
entity.setLinkName(link.getName());
memberLabelId = link.getMemberLabelId();
}
if (null != memberLabelId) {
entity.setMemberLabelId(memberLabelId);
MemberTagItemDTO dto = this.memberTagApiService.findMemberTagItem(memberLabelId);
if (null != dto) {
String tagId = dto.getTagId();
MemberTagDTO tag = this.memberTagApiService.getMemberTagById(tagId);
entity.setMemberLabelName(tag.getTagName() + "-" + dto.getTagItemName());
} else {
log.info("会员标签查询null,memberLabelId={}", memberLabelId);
}
}
if (null != qdto.getMemberId()) {
entity.setMemberId(qdto.getMemberId());
entity = this.addMemberInfo(qdto.getEnterpriseId(), qdto.getMemberId(), entity);
}
}
if (null != qdto.getMemberId()) {
entity.setMemberId(qdto.getMemberId());
entity = this.addMemberInfo(qdto.getEnterpriseId(), qdto.getMemberId(), entity);
}
this.wxUserAddLogMapper.insert(entity);
}catch(Exception e) {
e.printStackTrace();
}
this.wxUserAddLogMapper.insert(entity);
}
@Override
......
......@@ -8,6 +8,7 @@ import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.enums.BindTypeEnum;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
......@@ -57,6 +58,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
private StaffService staffService;
@Autowired
private HmClerkRelationApiService hmClerkRelationApiService;
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Override
public List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList) {
......@@ -322,17 +325,22 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
if (CollectionUtils.isEmpty(clerkList)) {
return null;
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
String corpid = wxEnterpriseDTO.getCorpid();
if (corpid.length() > 20) {
return mapper.listWxOpenUserIdByClerkIds(clerkList, wxEnterpriseId);
}
return mapper.listWxUserIdByClerkIds(clerkList, wxEnterpriseId);
}
@Override
public List<StaffClerkRelationDTO> listIdsByWxOpenUserIds(List<String> wxOpenUserIds, String wxEnterpriseId) {
return mapper.listIdsByWxOpenUserIds(wxOpenUserIds, wxEnterpriseId);
public List<StaffClerkRelationDTO> listIdsByWxOpenUserIds(List<String> wxOpenUserIds, String wxEnterpriseId,String enterpriseId) {
return mapper.listIdsByWxOpenUserIds(wxOpenUserIds, wxEnterpriseId, enterpriseId);
}
@Override
public List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(List<String> wxOpenUserIds, String wxEnterpriseId) {
return mapper.listIdsByNotInWxOpenUserIds(wxOpenUserIds, wxEnterpriseId);
public List<StaffClerkRelationDTO> listIdsByNotInWxOpenUserIds(List<String> wxOpenUserIds, String wxEnterpriseId,String enterpriseId) {
return mapper.listIdsByNotInWxOpenUserIds(wxOpenUserIds, wxEnterpriseId,enterpriseId);
}
@Override
......
......@@ -133,8 +133,8 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
}
@Override
public List<WxEnterpriseDTO> listAllWxEnterprise() {
return mapper.listAllWxEnterprise();
public List<WxEnterpriseDTO> listAllEnterprise() {
return mapper.listAllEnterprise();
}
@Override
......
......@@ -985,6 +985,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String avatar = "";
String relaName = "";
String externalUserId = "";
String state = "";
if (StringUtils.isNotBlank(unionIdJson)) {
JSONObject jo = JSON.parseObject(unionIdJson);
String external_contact = jo.getString("external_contact");
......@@ -1006,6 +1007,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String followJson = JSON.toJSONString(object);
JSONObject follow = JSON.parseObject(followJson);
userId = follow.getString("userid");
state = follow.getString("state");
if (userId.equals(userId1)) {
createTime = follow.getString("createtime");
}
......@@ -1018,6 +1020,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
pojo.setUnionId(unionId);
pojo.setExternalUserId(externalUserId);
pojo.setWxEnterpriseId(wxEnterpriseId);
pojo.setState(state);
return pojo;
}
......@@ -1704,6 +1707,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String createTime = "";
String avatar = "";
Integer friendType = 1;
String state = "";
if (StringUtils.isNotBlank(uJ)) {
JSONObject jo = JSON.parseObject(uJ);
String external_contact = jo.getString("external_contact");
......@@ -1725,6 +1729,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String followJson = JSON.toJSONString(object);
JSONObject follow = JSON.parseObject(followJson);
uj_userId = follow.getString("userid");
state = follow.getString("state");
//第三方返回的是加密的,多做一层判断
if (uj_userId.equals(wxUserId) || uj_userId.equals(wxOpenUseId)) {
if (jt != null) {
......@@ -1743,6 +1748,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
pojo.setWxEnterpriseId(wxEnterpriseId);
pojo.setAvatar(avatar);
pojo.setFriendType(friendType);
pojo.setState(state);
return EntityUtil.changeEntityByJSON(ExternalUserDTO.class, pojo);
}
......
......@@ -296,10 +296,12 @@ public class MessageApiServiceImpl implements MessageApiService {
} else {
//部门没有修改
List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedService.listStaffDepartmentByStaffId(staff.getStaffId());
for (TabHaobanStaffDepartmentRelated tabHaobanStaffDepartmentRelated : list) {
departmentIds.append(tabHaobanStaffDepartmentRelated.getDepartmentId()).append(",");
if (CollectionUtils.isNotEmpty(list)) {
for (TabHaobanStaffDepartmentRelated tabHaobanStaffDepartmentRelated : list) {
departmentIds.append(tabHaobanStaffDepartmentRelated.getDepartmentId()).append(",");
}
departmentIds = new StringBuilder(departmentIds.substring(0, departmentIds.length() - 1));
}
departmentIds = new StringBuilder(departmentIds.substring(0, departmentIds.length() - 1));
}
StaffDTO staffDTO = EntityUtil.changeEntityByJSON(StaffDTO.class, staff);
staffApiService.staffEdit(staffDTO, departmentIds.toString());
......
package com.gic.haoban.manage.service.service.out.impl;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
......@@ -23,32 +7,27 @@ import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.MiniprogramSettingDTO;
import com.gic.haoban.manage.api.dto.QywxCorpInfoSimpleDTO;
import com.gic.haoban.manage.api.dto.SecretSettingDTO;
import com.gic.haoban.manage.api.dto.StaffPrivacyUseLogDTO;
import com.gic.haoban.manage.api.dto.WelcomeDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper;
import com.gic.haoban.manage.service.entity.TabHaobanWxApplication;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
import com.gic.haoban.manage.service.entity.TabMiniprogramSetting;
import com.gic.haoban.manage.service.entity.TabWelcome;
import com.gic.haoban.manage.service.entity.*;
import com.gic.haoban.manage.service.pojo.bo.StaffPrivacyUseLogBO;
import com.gic.haoban.manage.service.service.MiniprogramSettingService;
import com.gic.haoban.manage.service.service.SecretSettingService;
import com.gic.haoban.manage.service.service.StaffPrivacyUseLogService;
import com.gic.haoban.manage.service.service.WxApplicationService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.*;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@Service
public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
......@@ -241,7 +220,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
@Override
public ServiceResponse<Boolean> isStopHaoban(String corpId) {
TabHaobanWxEnterprise entity = this.wxEnterpriseService.getEnterpriseBycorpIdNoStatus(corpId);
TabHaobanWxEnterprise entity = this.wxEnterpriseService.getEnterpriseBycorpId(corpId);
if (null == entity) {
return ServiceResponse.failure("9999", "企微不存在");
}
......
......@@ -466,7 +466,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
private String limitIp(HmQrcodeBO hm) {
String ipKey = "hmadd:limit:ip";
int ipLimitCount = 200;
int ipLimitCount = 300;
RRateLimiter rateLimiter = RedisUtil.getRedisClient().getRateLimiter(ipKey);
rateLimiter.trySetRate(RateType.OVERALL, ipLimitCount, 1, RateIntervalUnit.SECONDS);
if (rateLimiter.tryAcquire()) {
......
......@@ -142,13 +142,14 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
qywxExternalcontactDTO.setRemark(hmQrcodeQDTO.getName());
qywxExternalcontactDTO.setSkipVerify(hmQrcodeQDTO.getPassFlag() == 1);
qywxExternalcontactDTO.setState("HM" + hmId);
String corpid = wxEnterpriseDTO.getCorpid();
List<String> userIds = staffClerkRelationService.listWxUserIdByClerkIds(clerkIdList, wxEnterpriseId);
if (CollectionUtils.isEmpty(userIds)) {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "导购未关联好办");
}
qywxExternalcontactDTO.setUser(userIds);
logger.info("新增活码参数:{}", JSON.toJSONString(qywxExternalcontactDTO));
QywxExternalcontactResultDTO qywxExternalcontactResultDTO = qywxUserApiService.addContactWay(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid(), qywxExternalcontactDTO);
QywxExternalcontactResultDTO qywxExternalcontactResultDTO = qywxUserApiService.addContactWay(corpid, config.getWxSuiteid(), qywxExternalcontactDTO);
if (qywxExternalcontactResultDTO.getErrcode() != 0) {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_0.getCode()), "创建活码失败:" + qywxExternalcontactResultDTO.getErrmsg());
}
......@@ -384,20 +385,34 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
//标签
String memberLabelId = hmQrcodeQDTO.getMemberLabelId();
String memberLabelIdOld = hmOld.getMemberLabelId();
if (!memberLabelId.equals(memberLabelIdOld)) {
if (StringUtils.isBlank(memberLabelId)&& StringUtils.isNotBlank(memberLabelIdOld)) {
logContent.append("活码标签变更为空");
}
if (StringUtils.isNotBlank(memberLabelId) && StringUtils.isBlank(memberLabelIdOld)) {
MemberTagItemDTO tagItem = memberTagApiService.findMemberTagItem(memberLabelId);
MemberTagItemDTO tagItemOld = memberTagApiService.findMemberTagItem(memberLabelIdOld);
String oldTagName = "";
String tagName = "";
if (tagItemOld != null) {
MemberTagDTO tag = this.memberTagApiService.getMemberTagById(tagItemOld.getTagId());
oldTagName = tag.getTagName() + "-" + tagItemOld.getTagItemName();
}
if (tagItem != null) {
MemberTagDTO tag = this.memberTagApiService.getMemberTagById(tagItem.getTagId());
tagName = tag.getTagName() + "-" + tagItem.getTagItemName();
}
logContent.append("活码标签「").append(oldTagName).append("」").append("变更为「").append(tagName).append("」");
logContent.append("活码标签变更为「").append(tagName).append("」");
}
if (StringUtils.isNotBlank(memberLabelId) && StringUtils.isNotBlank(memberLabelIdOld)) {
if (!memberLabelId.equals(memberLabelIdOld)) {
MemberTagItemDTO tagItem = memberTagApiService.findMemberTagItem(memberLabelId);
MemberTagItemDTO tagItemOld = memberTagApiService.findMemberTagItem(memberLabelIdOld);
String oldTagName = "";
String tagName = "";
if (tagItemOld != null) {
MemberTagDTO tag = this.memberTagApiService.getMemberTagById(tagItemOld.getTagId());
oldTagName = tag.getTagName() + "-" + tagItemOld.getTagItemName();
}
if (tagItem != null) {
MemberTagDTO tag = this.memberTagApiService.getMemberTagById(tagItem.getTagId());
tagName = tag.getTagName() + "-" + tagItem.getTagItemName();
}
logContent.append("活码标签「").append(oldTagName).append("」").append("变更为「").append(tagName).append("」");
}
}
//欢迎语
......@@ -716,19 +731,19 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
@Override
public void checkStaffOpenContact(String param) {
logger.info("检查员工是否开启联系我,定时任务,start");
List<WxEnterpriseDTO> tabHaobanWxEnterprises = wxEnterpriseService.listAllWxEnterprise();
List<WxEnterpriseDTO> tabHaobanWxEnterprises = wxEnterpriseService.listAllEnterprise();
for (WxEnterpriseDTO wxEnterpriseDTO : tabHaobanWxEnterprises) {
String enterpriseId = wxEnterpriseDTO.getEnterpriseId();
//查询出所有正常的导购
String wxEnterpriseId = wxEnterpriseDTO.getWxEnterpriseId();
boolean flag = rightService.hasRightForAdmin(enterpriseId, "hb_m0206");
if (!flag) {
logger.info("该企业未与gic关联,无需开启:enterpriseId:{},wxEnterpriseId:{}",enterpriseId,wxEnterpriseId);
logger.info("该企业未与gic关联,无需开启:enterpriseId:{},wxEnterpriseId:{}", enterpriseId, wxEnterpriseId);
continue;
}
//企微已经开启联系我
List<String> wxUserIdsList = qywxUserApiService.listCorpExternalUser(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid());
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationService.listIdsByWxOpenUserIds(wxUserIdsList, wxEnterpriseId);
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationService.listIdsByWxOpenUserIds(wxUserIdsList, wxEnterpriseId, enterpriseId);
if (CollectionUtils.isEmpty(staffClerkRelationDTOS)) {
logger.error("无导购关联数据");
continue;
......@@ -748,7 +763,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
add(hmQrcodeQDTO);
}
List<StaffClerkRelationDTO> relationDTOS = staffClerkRelationService.listIdsByNotInWxOpenUserIds(wxUserIdsList, wxEnterpriseId);
List<StaffClerkRelationDTO> relationDTOS = staffClerkRelationService.listIdsByNotInWxOpenUserIds(wxUserIdsList, wxEnterpriseId, enterpriseId);
if (CollectionUtils.isEmpty(relationDTOS)) {
logger.error("无导购不包含关联数据");
continue;
......@@ -769,12 +784,12 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
@Override
public void checkStaffOpenContactByWxEnterpriseId(String wxEnterpriseId) {
public void checkStaffOpenContactByWxEnterpriseId(String wxEnterpriseId, String enterpriseId) {
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
//查询出所有正常的导购
//企微已经开启联系我
List<String> wxUserIdsList = qywxUserApiService.listCorpExternalUser(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid());
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationService.listIdsByWxOpenUserIds(wxUserIdsList, wxEnterpriseId);
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationService.listIdsByWxOpenUserIds(wxUserIdsList, wxEnterpriseId, enterpriseId);
if (CollectionUtils.isEmpty(staffClerkRelationDTOS)) {
logger.error("无导购关联数据");
return;
......@@ -794,7 +809,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
add(hmQrcodeQDTO);
}
List<StaffClerkRelationDTO> relationDTOS = staffClerkRelationService.listIdsByNotInWxOpenUserIds(wxUserIdsList, wxEnterpriseId);
List<StaffClerkRelationDTO> relationDTOS = staffClerkRelationService.listIdsByNotInWxOpenUserIds(wxUserIdsList, wxEnterpriseId, enterpriseId);
if (CollectionUtils.isEmpty(relationDTOS)) {
logger.error("无导购不包含关联数据");
return;
......
......@@ -188,7 +188,5 @@
interface="com.gic.enterprise.api.service.StoreWidgetService" timeout="10000"
retries="0" check="false"/>
<dubbo:reference id="memberTagOpenApiService" interface="com.gic.member.tag.api.service.MemberTagOpenApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference id="memberClerkApiService" interface="com.gic.member.api.service.MemberClerkApiService" timeout="10000" retries="0" check="false"/>
</beans>
\ No newline at end of file
......@@ -254,7 +254,7 @@
wx_open_id = #{wxOpenId},
</if>
<if test="qrCode != null">
qr_code = #{qrCode}
qr_code = #{qrCode},
</if>
<if test="addNum != null">
add_num = #{addNum}
......
......@@ -466,8 +466,21 @@
<select id="listWxUserIdByClerkIds" resultType="string">
select
a.wx_user_id wxUserId
DISTINCT b.wx_user_id
from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on a.staff_id = b.staff_id
where a.status_flag=1 and a.wx_enterprise_id = #{wxEnterpriseId}
and a.clerk_id in
<foreach collection="clerkIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</select>
<select id="listWxOpenUserIdByClerkIds" resultType="string">
select
DISTINCT b.wx_open_user_id
from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on a.staff_id = b.staff_id
where a.status_flag=1 and a.wx_enterprise_id = #{wxEnterpriseId}
and a.clerk_id in
<foreach collection="clerkIds" item="id" index="index" open="(" close=")" separator=",">
......@@ -491,6 +504,7 @@
left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.status_flag=1 and b.status_flag = 1
and a.wx_enterprise_id = #{wxEnterpriseId}
and a.enterprise_id = #{enterpriseId}
and b.wx_open_user_id in
<foreach collection="wxOpenUserIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
......@@ -522,6 +536,7 @@
left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.status_flag=1 and b.status_flag = 1
and a.wx_enterprise_id = #{wxEnterpriseId}
and a.enterprise_id = #{enterpriseId}
and b.wx_open_user_id not in
<foreach collection="wxOpenUserIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
......
......@@ -499,16 +499,16 @@
where wx_enterprise_id = #{wxEnterpriseId}
</update>
<select id="listAllWxEnterprise" resultType="com.gic.haoban.manage.api.dto.WxEnterpriseDTO" >
<select id="listAllEnterprise" resultType="com.gic.haoban.manage.api.dto.WxEnterpriseDTO" >
select
a.wx_enterprise_id wxEnterpriseId,
a.corpid corpid,
a.corp_name corpName,
b.enterprise_id enterpriseId
from tab_haoban_wx_enterprise a
join tab_haoban_wx_enterprise_related b on a.wx_enterprise_id = b.wx_enterprise_id
b.wx_enterprise_id wxEnterpriseId,
b.corpid corpid,
b.corp_name corpName,
a.enterprise_id enterpriseId
from tab_haoban_wx_enterprise_related a
left join tab_haoban_wx_enterprise b on a.wx_enterprise_id = b.wx_enterprise_id
where a.status_flag = 1 and b.status_flag = 1
group by a.wx_enterprise_id
group by a.enterprise_id
</select>
</mapper>
\ No newline at end of file
......@@ -54,6 +54,6 @@ public class ServiceTest {
@Test
public void test2() {
hmQrcodeApiService.checkStaffOpenContactByWxEnterpriseId("5bd929fd3b2c49deaa1184bcb0d669b3");
hmQrcodeApiService.checkStaffOpenContactByWxEnterpriseId("5bd929fd3b2c49deaa1184bcb0d669b3","ff8080815dacd3a2015dacd3ef5c0000");
}
}
package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RRateLimiter;
import org.redisson.api.RateIntervalUnit;
import org.redisson.api.RateType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.RestController;
import com.alibaba.fastjson.JSON;
import com.ctrip.framework.apollo.ConfigService;
import com.gic.api.base.commons.Page;
......@@ -29,18 +7,8 @@ import com.gic.commons.util.HttpClient;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.MaidianLogDTO;
import com.gic.haoban.manage.api.dto.QywxCorpInfoSimpleDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.WxApplicationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.service.MaidianLogApiService;
import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.TestApiService;
import com.gic.haoban.manage.api.service.WxApplicationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.web.config.Config;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
......@@ -52,6 +20,23 @@ import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxCorpApiService;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RRateLimiter;
import org.redisson.api.RateIntervalUnit;
import org.redisson.api.RateType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.RestController;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* Created 2020/4/9.
......@@ -334,10 +319,25 @@ public class TestController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_1, list);
}
/**
* 生成活码
* @return
*/
@RequestMapping("/checkStaffOpenContact")
public HaobanResponse checkStaffOpenContact() {
hmQrcodeApiService.checkStaffOpenContact("-1");
return resultResponse(HaoBanErrCode.ERR_1);
}
/**
* 生成活码单企业
* @param wxEnterpriseId
* @param enterpriseId
* @return
*/
@RequestMapping("/checkStaffOpenContactByWxEnterpriseId")
public HaobanResponse checkStaffOpenContact(String wxEnterpriseId) {
hmQrcodeApiService.checkStaffOpenContactByWxEnterpriseId(wxEnterpriseId);
public HaobanResponse checkStaffOpenContactByWxEnterpriseId(String wxEnterpriseId,String enterpriseId) {
hmQrcodeApiService.checkStaffOpenContactByWxEnterpriseId(wxEnterpriseId,enterpriseId);
return resultResponse(HaoBanErrCode.ERR_1);
}
......@@ -424,7 +424,7 @@ public class TestController extends WebBaseController {
com.ctrip.framework.apollo.Config config = ConfigService.getConfig("COMMON.gic-properties");
String env = config.getProperty("environment.value", "");
boolean isProd = "prod".equals(env);
return isProd ;
return false ;
}
}
......@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.webapi.reponse.RestResponse;
......@@ -118,14 +117,6 @@ public class WxEnterpriseInfoController extends WebBaseController {
}
String userId = user.getUserid();
String corpId = user.getCorpid();
// 判断好办是否到期
ServiceResponse<Boolean> resp = this.wxEnterpriseApiService.isStopHaoban(corpId);
if (!resp.isSuccess()) {
HaobanResponse response = new HaobanResponse();
response.setErrorCode(-888);
response.setMessage(resp.getMessage());
return response;
}
WxEnterpriseDTO enterprise = wxEnterpriseApiService.getEnterpriseBycorpId(corpId);
StaffDTO loginStaff = null;
if (enterprise != null) {
......@@ -151,7 +142,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
loginUserDict = managerDictService.getSMSDict("app_login_phone_num", loginStaff.getWxOpenUseId());
}
logger.info("伪登录:{}userId:{},loginUser={}", loginStaff.getPhoneNumber(), loginStaff.getWxOpenUseId(), JSONObject.toJSONString(loginUserDict));
if (null != loginUserDict) {
if (null != loginUserDict && StringUtils.isNotEmpty(loginUserDict.getDictName()) && loginUserDict.getDictName().split(":").length==2) {
String dictValue = loginUserDict.getDictValue();
List<StaffDTO> staffDTOS = new ArrayList<>();
List<StaffDTO> phoneDtos = staffApiService.listByPhoneNumber(dictValue);
......
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