Commit c57b62fe by guojx

Merge remote-tracking branch 'origin/developer' into developer

# Conflicts:
#	haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmQrcodeController.java
parents d0a49c24 b5cb7b86
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
public class CommonMQDTO implements Serializable {
/**
* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
*/
private static final long serialVersionUID = -5681421708810402425L;
private int type ;
private String params ;
public int getType() {
return type;
}
public String getParams() {
return params;
}
public void setType(int type) {
this.type = type;
}
public void setParams(String params) {
this.params = params;
}
}
......@@ -97,7 +97,8 @@ public class StaffDTO implements Serializable {
private String wxOpenId;
private String qrCode;
private String clerkName;
private String defaultGicEid ;
private String defaultGicEid;
private Integer addNum;
public String getDefaultGicEid() {
return defaultGicEid;
......@@ -157,7 +158,6 @@ public class StaffDTO implements Serializable {
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
......@@ -365,4 +365,12 @@ public class StaffDTO implements Serializable {
public void setClerkName(String clerkName) {
this.clerkName = clerkName;
}
public Integer getAddNum() {
return addNum;
}
public void setAddNum(Integer addNum) {
this.addNum = addNum;
}
}
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
public class WxEnterpriseQwDTO implements Serializable {
private static final long serialVersionUID = 1L;
private int wxSecurityType ;
private String wxEnterpriseId;
// 企业表中的id(正常同第三方)
private String corpid;
// 好办 助手
private String dkCorpid;
// 会员小程序dk
private String memberCorpid;
// 第三方
private String thirdCorpid;
// 自建
private String selfCorpid;
public int getWxSecurityType() {
return wxSecurityType;
}
public void setWxSecurityType(int wxSecurityType) {
this.wxSecurityType = wxSecurityType;
}
public String getSelfCorpid() {
return selfCorpid;
}
public void setSelfCorpid(String selfCorpid) {
this.selfCorpid = selfCorpid;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public String getCorpid() {
return corpid;
}
public String getDkCorpid() {
return dkCorpid;
}
public String getMemberCorpid() {
return memberCorpid;
}
public String getThirdCorpid() {
return thirdCorpid;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public void setCorpid(String corpid) {
this.corpid = corpid;
}
public void setDkCorpid(String dkCorpid) {
this.dkCorpid = dkCorpid;
}
public void setMemberCorpid(String memberCorpid) {
this.memberCorpid = memberCorpid;
}
public void setThirdCorpid(String thirdCorpid) {
this.thirdCorpid = thirdCorpid;
}
}
......@@ -19,6 +19,8 @@ public class HmLinkWxaDTO implements Serializable {
private Long pageId ;
private Long hmId ;
private String wxEnterpriseId ;
private String enterpriseId ;
private HmPageDTO page;
// 二维码
private String hmQrcode;
......@@ -33,6 +35,22 @@ public class HmLinkWxaDTO implements Serializable {
// 说明
private Map<String,String> remarkMap ;
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public Long getHmId() {
return hmId;
}
......
......@@ -25,6 +25,7 @@ public class HmQrcodeListDTO implements Serializable {
private String enterpriseId;
private String name;
private String hmName;
private String creatorId;
......@@ -79,6 +80,7 @@ public class HmQrcodeListDTO implements Serializable {
* 活码分组
*/
private Long hmGroupId;
private String hmGroupName;
/**
* 新增总人数
*/
......@@ -319,4 +321,20 @@ public class HmQrcodeListDTO implements Serializable {
public void setStoreList(List<HmStoreDTO> storeList) {
this.storeList = storeList;
}
public String getHmGroupName() {
return hmGroupName;
}
public void setHmGroupName(String hmGroupName) {
this.hmGroupName = hmGroupName;
}
public String getHmName() {
return hmName;
}
public void setHmName(String hmName) {
this.hmName = hmName;
}
}
......@@ -97,9 +97,9 @@ public class HmQrcodeQDTO implements Serializable {
private String staffId;
private String staffName;
/**
* 调用类型,1:手动调用;2:系统调用;3:批量调用
* 调用类型来源 0:不记录,1:来源为后台操作 其他查看枚举 HbBindEnum
*/
private Integer invokingType;
private Integer invokingType = 0;
public Long getHmId() {
......
package com.gic.haoban.manage.api.dto.qdto.hm;
import com.gic.api.base.commons.BasePageInfo;
import java.io.Serializable;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gic.api.base.commons.BasePageInfo;
public class WxUserAddLogSearchQDTO extends BasePageInfo implements Serializable {
/**
......@@ -17,10 +20,27 @@ public class WxUserAddLogSearchQDTO extends BasePageInfo implements Serializable
private Long linkId;
private Long hmId;
private String clerkId;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
private Integer addChannel;
private String createTimeOrder = "create_time desc";
// 1添加 2流失
private int statusFlag = 1 ;
private String createTimeOrder = "desc";
public int getStatusFlag() {
if(0==statusFlag) {
return 1 ;
}
return statusFlag;
}
public void setStatusFlag(int statusFlag) {
this.statusFlag = statusFlag;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
......
......@@ -4,18 +4,22 @@ package com.gic.haoban.manage.api.enums;
* Created by hua on 2020/6/24.
*/
public enum ChannelCodeEnum {
/**
* 好办绑定 解绑类型
*/
ADMIN_BIND(1001,"后台管理员绑定"),
SELF_BIND(1002,"好办客户端绑定"),
AUDIT_BIND(1003,"审核绑定"),
SELF_BIND(1002,"好办小程序绑定"),
AUDIT_BIND(1003,"后台审核绑定"),
SYNC_BIND(1004,"GIC同步绑定"),
ADMIN_UNBIND(2001,"后台管理员解绑"),
SELF_UNBIND(2002,"好办客户端解绑"),
SELF_UNBIND(2002,"好办小程序解绑"),
SYNC_UNBIND(2003,"GIC同步解绑"),
WEIXIN_DEL(2004,"微信删除解绑"),
AUDIT_UNBIND(2005,"审核解绑"),
RIGHT_CHANGE_UNBIND(2006, "权限变更解绑"),
STORE_CHANGE_UNBIND(2007, "门店变更解绑"),
// CHANGR_RIGHT_UNBIND(2005,"审核解绑"),
WEIXIN_DEL(2004,"员工离职解绑"),
AUDIT_UNBIND(2005,"后台审核解绑"),
RIGHT_CHANGE_UNBIND(2006, "好办门店权限变更解绑"),
STORE_CHANGE_UNBIND(2007, "GIC门店变更解绑"),
GIC_CLERK_DEL_UNBIND(2008, "GIC导购删除解绑"),
;
private int code;
private String name;
......@@ -41,6 +45,7 @@ public enum ChannelCodeEnum {
this.name = name;
}
public static String getNameByCode(int code) {
ChannelCodeEnum[] values = ChannelCodeEnum.values();
for (ChannelCodeEnum channelCodeEnum : values) {
......
package com.gic.haoban.manage.api.service;
import com.gic.haoban.manage.api.dto.CommonMQDTO;
/**
*
* @ClassName: HaobanCommonMQApiService
* @Description: 好办通用MQ
* @author xugh
* @date 2022年7月25日 下午2:27:06
*
*/
public interface HaobanCommonMQApiService {
public void commonHandler(CommonMQDTO dto) ;
}
......@@ -73,22 +73,25 @@ public interface HmQrcodeApiService {
* 作废
*
* @param hmId hm id
* @return boolean
* @param invokingType 调用类型
* @return {@link ServiceResponse }
* @author mozhu
* @date 2022-07-06 13:40:27
* @date 2022-07-22 15:10:42
*/
ServiceResponse delById(Long hmId);
ServiceResponse delById(Long hmId,Integer invokingType);
/**
* 导购解绑作废
*
* @param clerkId
* @param enterpriseId 企业标识
* @return boolean
* @param wxEnterpriseId wx企业标识
* @param invokingType 调用类型
* @return {@link ServiceResponse }
* @author mozhu
* @date 2022-07-06 15:39:01
* @date 2022-07-22 15:14:51
*/
ServiceResponse delByClerkId(String clerkId,String enterpriseId,String wxEnterpriseId);
ServiceResponse delByClerkId(String clerkId,String enterpriseId,String wxEnterpriseId,Integer invokingType);
/**
......@@ -141,7 +144,7 @@ public interface HmQrcodeApiService {
* @author mozhu
* @date 2022-07-08 15:07:15
*/
List<HmQrcodeStoreDTO> getHmStoreByEnterpriseId(String enterpriseId);
List<HmQrcodeStoreDTO> getHmStoreByEnterpriseId(String wxEnterpriseId , String enterpriseId);
/**
*
......@@ -152,7 +155,7 @@ public interface HmQrcodeApiService {
* @return
* @throws
*/
List<String> getHmStoreForWxa(String enterpriseId) ;
List<String> getHmStoreForWxa(String wxEnterpriseId ,String enterpriseId) ;
/**
* 根据导购信息获取hmid
......
......@@ -186,4 +186,23 @@ public interface StaffMapper {
int updateWxUserIdsByWxOpenUserId(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("wxOpenUseId") String wxOpenUseId,
@Param("wxUserId") String wxUserId);
/**
* 更新添加num通过id
*
* @param staffId 员工id
* @return int
* @author mozhu
* @date 2022-07-25 16:33:30
*/
int updateAddNumById(@Param("staffId") String staffId);
/**
* 重置添加num
*
* @return int
* @author mozhu
* @date 2022-07-25 16:36:07
*/
int resetAddNum();
}
\ No newline at end of file
package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.service.entity.TabHaobanWxApplication;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.service.entity.TabHaobanWxApplication;
public interface WxApplicationMapper {
int insertSelective(TabHaobanWxApplication record);
......@@ -37,4 +40,6 @@ public interface WxApplicationMapper {
* @date 2022-06-30 19:19:19
*/
int updateCorpidById(@Param("wxApplicationId") String wxApplicationId, @Param("corpid") String corpid);
List<TabHaobanWxApplication> listApplication(@Param("wxEnterpriseId")String wxEnterpriseId) ;
}
\ No newline at end of file
......@@ -140,5 +140,17 @@ public interface TabHaobanHmClerkRelationMapper {
* @date 2022-07-21 16:32:43
*/
int updateStatusById(@Param("status") Integer status, @Param("relationId") Long relationId);
/**
* 查询需要删除的数据
*
* @param hmId hm id
* @param clerkIds 职员id
* @return {@link List }<{@link TabHaobanHmClerkRelation }>
* @author mozhu
* @date 2022-07-26 15:42:07
*/
List<TabHaobanHmClerkRelation> queryByHmIdNotInClerkIds(@Param("hmId") Long hmId,
@Param("clerkIds") List<String> clerkIds);
}
......@@ -157,7 +157,7 @@ public interface TabHaobanHmQrcodeMapper {
* @author mozhu
* @date 2022-07-08 15:10:57
*/
List<TabHaobanHmQrcode> getHmStoreByEnterpriseId(@Param("enterpriseId") String enterpriseId);
List<TabHaobanHmQrcode> getHmStoreByEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId") String enterpriseId);
/**
* 根据分组id获取活码数量
......@@ -203,7 +203,7 @@ public interface TabHaobanHmQrcodeMapper {
List<HmQrcodeClerkBO> listCanAddClerk(@Param("wxEnterpriseId")String wxEnterpriseId , @Param("enterpriseId")String enterpriseId , @Param("storeIdList")List<String> storeIdList);
List<String> getHmStoreForWxa(@Param("enterpriseId") String enterpriseId);
List<String> getHmStoreForWxa(@Param("wxEnterpriseId")String wxEnterpriseId , @Param("enterpriseId") String enterpriseId);
List<String> listHmIdForIndex(HmQrcodeListQDTO qdto);
......
......@@ -48,6 +48,7 @@ public class TabHaobanStaff implements Serializable {
private String wxOpenId;
private String qrCode;
private Integer addNum;
@Transient
private String departmentIds;
......@@ -227,4 +228,12 @@ public class TabHaobanStaff implements Serializable {
public void setDepartmentIds(String departmentIds) {
this.departmentIds = departmentIds;
}
public Integer getAddNum() {
return addNum;
}
public void setAddNum(Integer addNum) {
this.addNum = addNum;
}
}
\ No newline at end of file
......@@ -87,6 +87,15 @@ public class TabHaobanWxEnterprise implements Serializable {
*/
private Integer externalFlag;
private Integer useridFlag;
private Integer wxSecurityType ;
public Integer getWxSecurityType() {
return wxSecurityType;
}
public void setWxSecurityType(Integer wxSecurityType) {
this.wxSecurityType = wxSecurityType;
}
public String getMemberSecret() {
return memberSecret;
......
package com.gic.haoban.manage.service.pojo.bo.hm;
public class HmQrcodeClerkBO {
import java.io.Serializable;
public class HmQrcodeClerkBO implements Serializable {
private static final long serialVersionUID = 6292988639958194870L;
private String clerkId;
private String storeId;
......
......@@ -11,6 +11,15 @@ public class KeyDataLinkBO implements Serializable{
private String unionid;
private Long hmId;
private Long linkId;
private String mobile ;
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getUnionid() {
return unionid;
......
......@@ -144,5 +144,22 @@ public interface StaffService {
int updateUserIdByUserId(String wxEnterpriseId, String newWxUserId, String oldWxUserId);
/**
* 更新添加num通过id
*
* @param staffId 员工id
* @return int
* @author mozhu
* @date 2022-07-25 16:36:38
*/
int updateAddNumById(String staffId);
/**
* 重置添加num
*
* @return int
* @author mozhu
* @date 2022-07-25 16:36:53
*/
int resetAddNum();
}
package com.gic.haoban.manage.service.service;
import java.util.List;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import java.util.List;
public interface WxEnterpriseService {
String add(WxEnterpriseDTO wxDTO);
......@@ -12,20 +13,23 @@ public interface WxEnterpriseService {
WxEnterpriseDTO selectById(String wxEnterpriseId);
/**
* 通过微信企业ID查询好办企业ID
* @param corpId
*
* @Title: getQwInfo
* @Description: 获取商户企微信息
* @author xugh
* @param wxEnterpriseId
* @return
* @throws
*/
TabHaobanWxEnterprise getEnterpriseBycorpId(String corpId);
WxEnterpriseQwDTO getQwInfo(String wxEnterpriseId);
/**
* 通过微信企业ID查询删除状态好办企业ID
*
* 通过微信企业ID查询好办企业ID
* @param corpId
* @return
*/
@Deprecated
TabHaobanWxEnterprise getDelEnterpriseBycorpId(String corpId);
TabHaobanWxEnterprise getEnterpriseBycorpId(String corpId);
void update(WxEnterpriseDTO enterpriseDTO);
......
......@@ -159,4 +159,15 @@ public interface HmClerkRelationService {
*/
int updateStatusById(Integer status, Long relationId);
/**
* 查询需要删除的数据
*
* @param hmId hm id
* @param clerkIds 职员id
* @return {@link List }<{@link HmClerkRelationBO }>
* @author mozhu
* @date 2022-07-26 15:38:33
*/
List<HmClerkRelationBO> queryByHmIdNotInClerkIds(Long hmId, List<String> clerkIds);
}
......@@ -146,7 +146,7 @@ public interface HmQrcodeService {
* @author mozhu
* @date 2022-07-08 15:09:50
*/
List<HmQrcodeBO> getHmStoreByEnterpriseId(String enterpriseId);
List<HmQrcodeBO> getHmStoreByEnterpriseId(String wxEnterpriseId , String enterpriseId);
/**
......@@ -183,7 +183,7 @@ public interface HmQrcodeService {
List<HmQrcodeClerkBO> listCanAddClerk(String wxEnterpriseId , String enterpriseId , String clerkId) ;
List<String> getHmStoreForWxa(String enterpriseId);
List<String> getHmStoreForWxa(String wxEnterpriseId ,String enterpriseId);
List<String> listHmIdForIndex(HmQrcodeListQDTO qdto);
......
......@@ -111,4 +111,9 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService {
public int updateStatusById(Integer status, Long relationId) {
return tabHaobanHmClerkRelationMapper.updateStatusById(status,relationId);
}
@Override
public List<HmClerkRelationBO> queryByHmIdNotInClerkIds(Long hmId, List<String> clerkIds) {
return EntityUtil.changeEntityListByOrika(HmClerkRelationBO.class,tabHaobanHmClerkRelationMapper.queryByHmIdNotInClerkIds(hmId,clerkIds));
}
}
......@@ -117,9 +117,9 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
}
@Override
public List<HmQrcodeBO> getHmStoreByEnterpriseId(String enterpriseId) {
public List<HmQrcodeBO> getHmStoreByEnterpriseId(String wxEnterpriseId,String enterpriseId) {
return EntityUtil.changeEntityListNew(HmQrcodeBO.class,
tabHaobanHmQrcodeMapper.getHmStoreByEnterpriseId(enterpriseId));
tabHaobanHmQrcodeMapper.getHmStoreByEnterpriseId(wxEnterpriseId ,enterpriseId));
}
@Override
......@@ -171,8 +171,8 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
}
@Override
public List<String> getHmStoreForWxa(String enterpriseId) {
return tabHaobanHmQrcodeMapper.getHmStoreForWxa(enterpriseId) ;
public List<String> getHmStoreForWxa(String wxEnterpriseId ,String enterpriseId) {
return tabHaobanHmQrcodeMapper.getHmStoreForWxa(wxEnterpriseId , enterpriseId) ;
}
@Override
......
......@@ -82,7 +82,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
staffClerkBindLogService.pushToMq(clerkRelation.getStaffId(), optStaffId, BindTypeEnum.UNBIND.getVal(), chanelCode, clerkRelation.getStaffClerkRelationId());
//废弃活码
hmQrcodeApiService.delByClerkId(clerkId, clerkRelation.getEnterpriseId(),clerkRelation.getWxEnterpriseId());
hmQrcodeApiService.delByClerkId(clerkId, clerkRelation.getEnterpriseId(),clerkRelation.getWxEnterpriseId(),chanelCode);
}
return b;
}
......@@ -155,6 +155,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
hmQrcodeQDTO.setPassFlag(1);
hmQrcodeQDTO.setStoreId(dto.getStoreId());
hmQrcodeQDTO.setClerkIdList(Collections.singletonList(dto.getClerkId()));
hmQrcodeQDTO.setInvokingType(chanelCode);
hmQrcodeApiService.add(hmQrcodeQDTO);
}
return s;
......
......@@ -64,6 +64,7 @@ public class StaffServiceImpl implements StaffService {
tab.setStaffId(StringUtil.randomUUID());
}
tab.setStatusFlag(1);
tab.setAddNum(0);
mapper.insertSelective(tab);
return tab.getStaffId();
}
......@@ -180,4 +181,14 @@ public class StaffServiceImpl implements StaffService {
public int updateUserIdByUserId(String wxEnterpriseId, String newWxUserId, String oldWxUserId) {
return mapper.updateUserIdByUserId(wxEnterpriseId, newWxUserId, oldWxUserId);
}
@Override
public int updateAddNumById(String staffId) {
return mapper.updateAddNumById(staffId);
}
@Override
public int resetAddNum() {
return mapper.resetAddNum();
}
}
......@@ -17,8 +17,11 @@ import com.gic.commons.util.EntityUtil;
import com.gic.haoban.common.utils.DingUtils;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.service.dao.mapper.WxApplicationMapper;
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.service.WxEnterpriseService;
......@@ -31,9 +34,12 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
private WxEnterpriseMapper mapper;
@Autowired
private WxEnterpriseRelatedMapper wxEnterpriseRelatedMapper ;
@Autowired
private WxApplicationMapper wxApplicationMapper ;
@Override
public String add(WxEnterpriseDTO wxDTO) {
logger.info("新增wx_enterprise,dto={}",JSON.toJSONString(wxDTO));
Date now = new Date();
wxDTO.setWxEnterpriseId(StringUtil.randomUUID());
wxDTO.setCreateTime(now);
......@@ -54,6 +60,34 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
}
@Override
public WxEnterpriseQwDTO getQwInfo(String wxEnterpriseId) {
TabHaobanWxEnterprise wxEnterprise = this.mapper.selectByPrimaryKey(wxEnterpriseId) ;
WxEnterpriseQwDTO qw = new WxEnterpriseQwDTO();
qw.setCorpid(wxEnterprise.getCorpid());
qw.setWxEnterpriseId(wxEnterpriseId);
if(null != wxEnterprise.getWxSecurityType()) {
qw.setWxSecurityType(wxEnterprise.getWxSecurityType());
}
List<TabHaobanWxApplication> applictionList = this.wxApplicationMapper.listApplication(wxEnterpriseId) ;
if(CollectionUtils.isNotEmpty(applictionList)) {
applictionList.forEach(app->{
Integer appType = app.getApplicationType() ;
if(appType==2) {
qw.setThirdCorpid(app.getCorpid());
}else if(appType.equals(3)) {
qw.setDkCorpid(app.getCorpid());
}else if(appType.equals(4)) {
qw.setMemberCorpid(app.getCorpid());
}
});
}
qw.setSelfCorpid(wxEnterprise.getCorpid());
logger.info("企微所有corpid信息={}",JSON.toJSON(qw));
return qw;
}
@Override
public TabHaobanWxEnterprise getEnterpriseBycorpId(String corpId) {
if (StringUtils.isBlank(corpId)) {
return null;
......@@ -62,11 +96,6 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
}
@Override
public TabHaobanWxEnterprise getDelEnterpriseBycorpId(String corpId) {
return mapper.getEnterpriseBycorpId(corpId, 0);
}
@Override
public void update(WxEnterpriseDTO enterpriseDTO) {
enterpriseDTO.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(TabHaobanWxEnterprise.class, enterpriseDTO));
......
package com.gic.haoban.manage.service.service.out.impl;
import org.springframework.stereotype.Service;
import com.gic.haoban.manage.api.dto.CommonMQDTO;
import com.gic.haoban.manage.api.service.HaobanCommonMQApiService;
@Service("haobanCommonMQApiService")
public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
@Override
public void commonHandler(CommonMQDTO dto) {
}
}
......@@ -65,13 +65,13 @@ import com.gic.haoban.manage.service.util.EmojiFilterUtil;
import com.gic.member.api.dto.MemberDTO;
import com.gic.member.api.service.MemberApiService;
import com.gic.member.api.service.MemberOpenCardBusinessService;
import com.gic.member.api.service.MemberService;
import com.gic.member.api.service.MemberStoreService;
import com.gic.member.tag.api.dto.outapi.MemberTagSingleDTO;
import com.gic.member.tag.api.service.MemberTagOpenApiService;
import com.gic.mq.sdk.GicMQClient;
import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.*;
import com.gic.wechat.api.dto.qywx.response.QywxResponseDTO;
import com.gic.wechat.api.dto.qywx.welcome.*;
import com.gic.wechat.api.enums.QywxMediaTypeEnum;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
......@@ -168,6 +168,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
private MemberTagOpenApiService memberTagOpenApiService;
@Autowired
private HmLinkService hmLinkService;
@Autowired
private MemberService memberService;
@Override
public void dealQywxExternalUser(String params) {
......@@ -320,6 +322,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String unionid = dto.getUnionid();
String state = dto.getState();
boolean isHmUnionid = false;
String mobile = "";
log.info("新增外部联系人,wxEnterpriseId:{}", wxEnterpriseId);
if (StringUtils.isAnyBlank(wxUserId, wxEnterpriseId, name, createTime, externalUserId)) {
log.error("新增外部联系人,缺少必须字段:wxUserId:{},wxEnterpriseId:{},name:{},createTime:{},externalUserId:{}", wxUserId, wxEnterpriseId, name, createTime, externalUserId);
......@@ -347,17 +350,18 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String memberLabelId = "";
if (StringUtils.isNotBlank(state)) {
String id = state.substring(2);
Long hmId = null;
HmQrcodeDTO hmQrcodeDTO = null;
if (state.contains(Manage3Constants.HM)) {
Long hmId = Convert.toLong(id);
hmId = Convert.toLong(id);
log.info("普通活码={}", hmId);
HmQrcodeDTO hmQrcodeDTO = hmQrcodeApiService.getSimpleById(hmId);
hmQrcodeDTO = hmQrcodeApiService.getSimpleById(hmId);
if (hmQrcodeDTO == null) {
log.error("活码为空:{}", hmId);
return;
}
memberLabelId = hmQrcodeDTO.getMemberLabelId();
wxUserAddLogQDTO.setHmId(hmId);
hmQrcodeApiService.updateAddNumById(hmId, hmQrcodeDTO.getClerkId());
//处理活码导购
if (hmQrcodeDTO.getHmType() == 1) {
staffClerkRelationDTO = staffClerkRelationService.getBindByClerkId(hmQrcodeDTO.getClerkId(), wxEnterpriseId);
......@@ -382,13 +386,14 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
} else if (state.contains(Manage3Constants.DT)) {
KeyDataLinkBO dataForHmLink = keyDataService.getDataForHmLink(id);
Long linkId = dataForHmLink.getLinkId();
Long hmId = dataForHmLink.getHmId();
hmId = dataForHmLink.getHmId();
mobile = dataForHmLink.getMobile();
unionid = dataForHmLink.getUnionid();
log.info("动态活码hmId={},linkId={},unionid={}", hmId, linkId, unionid);
isHmUnionid = true;
wxUserAddLogQDTO.setLinkId(linkId);
wxUserAddLogQDTO.setHmId(hmId);
HmQrcodeDTO hmQrcodeDTO = hmQrcodeApiService.getSimpleById(hmId);
hmQrcodeDTO = hmQrcodeApiService.getSimpleById(hmId);
if (hmQrcodeDTO == null) {
log.error("活码动态为空,hmId:{}", hmId);
return;
......@@ -399,6 +404,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
memberLabelId = hmLinkBO.getMemberLabelId();
}
}
if (hmId != null && hmQrcodeDTO != null) {
log.info("计算活码的上限和加好友数量:{}", hmId);
hmQrcodeApiService.updateAddNumById(hmId, hmQrcodeDTO.getClerkId());
}
} else {
TabHaobanClerkMainStoreRelated mainStoreRelated = clerkMainStoreRelatedService.getMainStoreByStaffId(staffId, wxEnterpriseId);
if (mainStoreRelated == null) {
......@@ -424,7 +433,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
if (StringUtils.isNotBlank(unionid)) {
log.info("有unionid处理:wxEnterpriseId:{},unionid:{}", wxEnterpriseId, unionid);
dto.setUnionid(unionid);
memberId = addExternalClerkRelated(dto, staffId, staffClerkRelationDTO, wxEnterpriseRelated, isHmUnionid);
memberId = addExternalClerkRelated(dto, staffId, staffClerkRelationDTO, wxEnterpriseRelated, isHmUnionid, mobile);
} else {
log.info("发送欢迎语逻辑:wxEnterpriseId:{}", wxEnterpriseId);
addFriendByWelcome(dto, staffClerkRelationDTO);
......@@ -435,6 +444,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
setMemberTag(staffClerkRelationDTO, memberLabelId, memberId);
}
//加好友增加数量
staffService.updateAddNumById(staffId);
log.info("插入加好友日志");
wxUserAddLogQDTO.setWxEnterpriseId(wxEnterpriseId);
wxUserAddLogQDTO.setEnterpriseId(enterpriseId);
......@@ -456,7 +467,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
* @param memberId
*/
private void setMemberTag(StaffClerkRelationDTO staffClerkRelationDTO, String memberLabelId, String memberId) {
log.info("会员打标签,memberLabelId:{},memberId:{}",memberLabelId,memberId);
log.info("会员打标签,memberLabelId:{},memberId:{}", memberLabelId, memberId);
if (StringUtils.isNotBlank(memberLabelId)) {
MemberTagSingleDTO tagSingleDTO = new MemberTagSingleDTO();
tagSingleDTO.setEnterpriseId(staffClerkRelationDTO.getEnterpriseId());
......@@ -475,7 +486,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
* @param staffClerkRelationDTO
* @param wxEnterpriseRelated
*/
private String addExternalClerkRelated(MemberUnionidRelatedDTO dto, String staffId, StaffClerkRelationDTO staffClerkRelationDTO, TabHaobanWxEnterpriseRelated wxEnterpriseRelated, boolean isHmUnionid) {
private String addExternalClerkRelated(MemberUnionidRelatedDTO dto, String staffId, StaffClerkRelationDTO staffClerkRelationDTO,
TabHaobanWxEnterpriseRelated wxEnterpriseRelated, boolean isHmUnionid, String mobile) {
String wxUserId = dto.getWxUserId();
String wxEnterpriseId = dto.getWxEnterpriseId();
String name = dto.getExternalName();
......@@ -516,12 +528,25 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
log.info("不能生产导购二维码:{}", JSONObject.toJSONString(clerk));
return "";
}
MemberDTO member = null;
if (isHmUnionid) {
log.info("根据手机号查询会员:{},{}", enterpriseId, mobile);
if (StringUtils.isNotBlank(mobile)) {
member = memberService.getMemberByPhone(enterpriseId, mobile);
}
}
if (member == null) {
log.info("【新增外部联系人会员】enterpriseId={},unionId={},name={},avatar={},QrcodeParam={}", enterpriseId, unionId, name, avatar, qrcodeParam);
MemberDTO member = memberOpenCardBusinessService.getMemberByQywxChannelParam(enterpriseId, unionId, "", name, avatar, qrcodeParam);
member = memberOpenCardBusinessService.getMemberByQywxChannelParam(enterpriseId, unionId, "", name, avatar, qrcodeParam);
}
if (member == null) {
log.info("生产会员memnerid失败:{}", unionId);
log.info("生产会员memberid失败:{}", unionId);
return "";
}
String memberId = member.getMemberId();
List<TabHaobanExternalClerkRelated> externalClerkRelateds = externalClerkRelatedService.listByExTernalUseridAndWxUserIdAllStatus(wxEnterpriseId, externalUserid, dto.getWxUserId());
String relationKey = SecureUtil.md5(staffId + externalUserid);
......@@ -658,10 +683,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
log.info("特殊欢迎语 state:{}", state);
WelcomeReferBO welcomeReferBo = getWelcomeReferBo(state);
welcomeDetailBO = welcomeService.getMatchWelcomeWithReferId(staffId, wxEnterpriseId, welcomeReferBo);
//结束临时会话模式
log.info("结束临时会话模式:userid:{},externalUserid:{}", dto.getWxUserId(), dto.getExternalUserid());
QywxResponseDTO qywxResponseDTO = qywxUserApiService.closeTempChat(corpid, config.getWxSuiteid(), dto.getWxUserId(), dto.getExternalUserid());
log.info("结束临时会话返回结果:{}", JSON.toJSONString(qywxResponseDTO));
} else {
welcomeDetailBO = welcomeService.getMatchWelcome(staffId, wxEnterpriseId);
}
......
......@@ -317,19 +317,19 @@ public class StaffApiServiceImpl implements StaffApiService {
res.setCode(4);
return res;
}
String staffThirdWxEnterpriseId = config.getStaffThirdWxEnterpriseId();
UserDTO user = null;
if (staffThirdWxEnterpriseId.contains(corpid)) {
WxEnterpriseQwDTO wxInfo = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ;
if(wxInfo.getWxSecurityType()==4) {
user = qywxUserApiService.getWorkWxUser(corpid, config.getWxSuiteid(), userId);
UserDTO userSelf = qywxUserApiService.getSelfWorkWxUser(corpid, secretSetting.getSecretVal(), user.getOpen_userid());
logger.info("成员详情(第三方)={}",JSON.toJSONString(user)) ;
UserDTO userSelf = qywxUserApiService.getSelfWorkWxUser(wxInfo.getDkCorpid(), secretSetting.getSecretVal(), user.getOpen_userid());
if (user != null && userSelf != null) {
user.setName(userSelf.getName());
}
} else {
user = qywxUserApiService.getSelfWorkWxUser(corpid, secretSetting.getSecretVal(), userId);
logger.info("成员详情(代开)={}",JSON.toJSONString(user)) ;
}
if (null == user) {
logger.info("企业微信用户不存在:{}:{}", wxEnterpriseId, userId);
res.setMessage("企业微信用户不存在");
......
......@@ -238,7 +238,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
//删除绑定关系
tabHaobanStaffClerkRelationMapper.delByStoreIdAndCode(storeId, clerkCode);
//删除主门店
delSetMainStore(staffClerkRelation);
delSetMainStore(staffClerkRelation,ChannelCodeEnum.SELF_UNBIND.getCode());
}
@Override
......@@ -305,7 +305,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
public void delByClerkId(String clerkId) {
TabHaobanStaffClerkRelation staffClerkRelation = tabHaobanStaffClerkRelationMapper.getOneByClerkId(clerkId);
tabHaobanStaffClerkRelationMapper.delByClerkId(clerkId);
delSetMainStore(staffClerkRelation);
delSetMainStore(staffClerkRelation,ChannelCodeEnum.AUDIT_UNBIND.getCode());
}
@Override
......@@ -387,7 +387,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
staffClerkBindLogService.pushToMq(staffId, optStaffId, optType, channelCode, relationId);
}
private void delSetMainStore(TabHaobanStaffClerkRelation staffClerkRelation) {
private void delSetMainStore(TabHaobanStaffClerkRelation staffClerkRelation,Integer channelCode) {
if (staffClerkRelation == null) {
logger.info("staffClerkRelation为空");
return;
......@@ -399,7 +399,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
//删除主门店
clerkMainStoreRelatedService.delMainStore(staffId, staffClerkRelation.getStoreId(), wxEnterpriseId);
//废弃活码
hmQrcodeApiService.delByClerkId(clerkId,staffClerkRelation.getEnterpriseId(),wxEnterpriseId);
hmQrcodeApiService.delByClerkId(clerkId,staffClerkRelation.getEnterpriseId(),wxEnterpriseId,channelCode);
}
@Override
......@@ -495,7 +495,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
//导购删除解绑
if (!clerkDTO.getStatus().equals(1)) {
//解绑
staffClerkRelationService.delBind(clerkId, "-1", ChannelCodeEnum.SYNC_UNBIND.getCode());
staffClerkRelationService.delBind(clerkId, "-1", ChannelCodeEnum.GIC_CLERK_DEL_UNBIND.getCode());
}
} else if (type == 2) {
//门店转移、重新绑定
......
......@@ -34,7 +34,6 @@ 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.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.StaffApiService;
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;
......@@ -60,8 +59,6 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Autowired
private StaffApiService staffApiService;
@Autowired
private WxEnterpriseMapper wxEnterpriseMapper;
@Autowired
private WxApplicationService wxApplicationService;
......@@ -92,7 +89,6 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
String agentName = dto.getAgentName();
String permanentCode = dto.getPermanentCode();
String applicationName = dto.getName();
String userId = dto.getUserid();
Integer isCustomizedApp = dto.getIsCustomizedApp();
String qywxMemberSuite = config.getQywxMemberSuite();
WxEnterpriseDTO wxDTO = EntityUtil.changeEntityByJSON(WxEnterpriseDTO.class, dto);
......@@ -101,6 +97,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
// 获取授权好办小程序
wxEnterprise = this.wxEnterpriseService.getEnterpriseBycorpId(corpid);
if (wxEnterprise == null) {
log.info("通过corpid={}未查到记录",corpid);
wxEnterprise = this.wxEnterpriseService.getEnterpriseByCorpName(corpName);
}
......@@ -110,16 +107,19 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
wxEnterpriseDTO.setWxEnterpriseId(wxEnterpriseId);
wxEnterpriseDTO.setStatusFlag(1);
wxEnterpriseDTO.setBindFlag(1);
wxEnterpriseService.update(wxDTO);
// 如果corpid为空且是好办小程序,写入corpid
wxEnterpriseService.update(wxEnterpriseDTO);
} else {
// 如果不是好办,不需要写入corpid
wxEnterpriseId = wxEnterpriseService.add(wxDTO);
}
if (StringUtils.isNotBlank(userId)) {
/*if (StringUtils.isNotBlank(userId)) {
staffApiService.wxGetAdd(userId, wxEnterpriseId);
}
}*/
TabHaobanWxApplication haobanWxApplication = wxApplicationService.selectBySiteIdAndWxEnterpriseId(siteId,
wxEnterpriseId);
if (haobanWxApplication == null) {
log.info("新增应用,suiteid={}",siteId);
haobanWxApplication = new TabHaobanWxApplication();
haobanWxApplication.setAgentId(agentId);
haobanWxApplication.setCorpid(corpid);
......
package com.gic.haoban.manage.service.task;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.EntityUtil;
......@@ -9,28 +19,25 @@ import com.gic.haoban.manage.api.dto.DealParamMqDTO;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.SecretSettingDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.enums.PreDealStatusEnum;
import com.gic.haoban.manage.api.enums.PreDealTypeEnum;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.enums.SyncTaskStatusEnum;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.gic.haoban.manage.service.entity.TabHaobanPreDealLog;
import com.gic.haoban.manage.service.entity.TabHaobanSyncTask;
import com.gic.haoban.manage.service.service.*;
import com.gic.haoban.manage.service.service.DepartmentService;
import com.gic.haoban.manage.service.service.PreDealService;
import com.gic.haoban.manage.service.service.SecretSettingService;
import com.gic.haoban.manage.service.service.SyncTaskService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.util.EmojiFilterUtil;
import com.gic.mq.sdk.GicMQClient;
import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.UserDTO;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 同步通讯录部门
......@@ -44,24 +51,20 @@ public class QywxDeptSyncOperation implements BaseSyncOperation {
@Autowired
private DepartmentService departmentService;
@Autowired
private PreDealService preDealService;
@Autowired
private SyncTaskService syncTaskService;
@Autowired
private QywxUserApiService qywxUserApiService;
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Autowired
private QywxStaffSyncOperation qywxClerkSyncOperation;
@Autowired
private SecretSettingService secretSettingService;
@Autowired
private Config config;
@Override
public void dealSingleByMq(DealParamMqDTO dealParamMqDTO, TabHaobanPreDealLog dataPre) {
......@@ -168,12 +171,20 @@ public class QywxDeptSyncOperation implements BaseSyncOperation {
String pDataId = preData.getpDataId();
if ("0".equals(pDataId)) {
//根级部门
List<UserDTO> list = this.qywxUserApiService.listSelfDepartmentUser(wxEnterpriseDTO.getCorpid(), secretSetting.getSecretVal(), dataId, 1);
List<UserDTO> list = null ;
WxEnterpriseQwDTO wxInfo = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ;
if(wxInfo.getWxSecurityType()==4) {
list = this.qywxUserApiService.listDepartmentUser(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid(), dataId, 1) ;
logger.info("通讯录(第三方)={}",JSON.toJSONString(list)) ;
}else {
list = this.qywxUserApiService.listSelfDepartmentUser(wxEnterpriseDTO.getCorpid(), secretSetting.getSecretVal(), dataId, 1);
logger.info("通讯录(代开)={}",JSON.toJSONString(list)) ;
}
if (null == list) {
logger.info("微信获取部门成员异常:{},{}", taskId, dataId);
return;
}
logger.info("是否已经进来了,进来");
logger.info("获取部门列表");
//预处理门店 写入预处理表
if (CollectionUtils.isNotEmpty(list)) {
List<String> dataList = preDealService.listDataIdByTaskIdAndDataType(taskId, PreDealTypeEnum.clerk.getVal());
......
......@@ -57,11 +57,7 @@ public class QywxStaffSyncOperation implements BaseSyncOperation {
@Autowired
private WxEnterpriseApiService wxEnterpriseApiService;
@Autowired
private WxApplicationMapper wxApplicationMapper;
@Autowired
private Config config;
@Autowired
private SecretSettingService secretSettingService;
@Override
public void dealSingleByMq(DealParamMqDTO dealParamMqDTO, TabHaobanPreDealLog dataPre) {
......
......@@ -22,6 +22,7 @@
<constructor-arg index="0" value="haoban-manage-service"/>
</bean>
<dubbo:service interface="com.gic.haoban.manage.api.service.HaobanCommonMQApiService" ref="haobanCommonMQApiService" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService" ref="wxUserAddLogApiService" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.KeyDataApiService" ref="keyDataApiService" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.hm.HmLinkApiService" ref="hmLinkApiService" timeout="10000"/>
......
......@@ -23,14 +23,14 @@
<result column="wx_open_user_id" property="wxOpenUseId" jdbcType="VARCHAR"/>
<result column="wx_open_id" property="wxOpenId" jdbcType="VARCHAR"/>
<result column="qr_code" property="qrCode" jdbcType="VARCHAR"/>
<result column="add_num" property="addNum" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
staff_id
, wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion,
active_flag, extend_postion, status_flag, create_time, update_time,wx_enterprise_id,head_img,
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code,add_num
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
......@@ -120,6 +120,9 @@
<if test="qrCode != null">
qr_code,
</if>
<if test="addNum != null">
add_num,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="staffId != null">
......@@ -183,7 +186,10 @@
#{wxOpenId},
</if>
<if test="qrCode != null">
#{qrCode}
#{qrCode},
</if>
<if test="addNum != null">
#{addNum}
</if>
</trim>
</insert>
......@@ -250,6 +256,9 @@
<if test="qrCode != null">
qr_code = #{qrCode}
</if>
<if test="addNum != null">
add_num = #{addNum}
</if>
</set>
where staff_id = #{staffId,jdbcType=VARCHAR}
</update>
......@@ -532,4 +541,20 @@
and wx_open_user_id = #{wxOpenUseId}
</update>
<update id="updateAddNumById" parameterType="java.lang.String">
update tab_haoban_staff
set add_num = add_num +1,
update_time = now()
where staff_id = #{staffId}
</update>
<update id="resetAddNum">
update tab_haoban_staff
<set>
add_num = 0,update_time = now()
</set>
</update>
</mapper>
\ No newline at end of file
......@@ -198,4 +198,9 @@
and status_flag = 1
</update>
<select id="listApplication" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from
tab_haoban_wx_application where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1
</select>
</mapper>
\ No newline at end of file
......@@ -40,6 +40,7 @@
<result column="agree_external_userid_time" property="agreeExternalUseridTime" jdbcType="TIMESTAMP"/>
<result column="external_flag" property="externalFlag" jdbcType="INTEGER"/>
<result column="userid_flag" property="useridFlag" jdbcType="INTEGER"/>
<result column="wx_security_type" property="wxSecurityType"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -47,7 +48,7 @@
corp_user_max, corp_full_name, subject_type, verified_end_time, corp_wxqrcode, corp_scale,
corp_industry, corp_sub_industry, location, auth_info, agent, agentid, appid, name,
square_logo_url, round_logo_url, level, bind_flag, status_flag, create_time, update_time,contact_flag,wx_secret_key,wx_secret_key_last_time,member_secret_last_time,contact_secret_last_time
,member_secret,contact_secret,agree_external_userid_flag,agree_external_userid_time,external_flag,userid_flag
,member_secret,contact_secret,agree_external_userid_flag,agree_external_userid_time,external_flag,userid_flag ,wx_security_type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
......
......@@ -126,7 +126,7 @@
<if test="null != linkType">
and link_type = #{linkType}
</if>
and status_flag = 1
and status_flag = 1 order by create_time desc
limit 20
</select>
......@@ -144,7 +144,7 @@
<if test="null != linkType">
and link_type = #{linkType}
</if>
and status_flag = 1
and status_flag = 1 order by create_time desc
</select>
<select id="queryPageRelationList" resultMap="result-map-tabHaobanHmLink">
......
......@@ -131,7 +131,7 @@
select <include refid="Base_Column_List"></include>
from tab_haoban_hm_clerk_relation
where clerk_id = #{clerkId}
and hm_id = #{hmId}
and hm_id = #{hmId} and status = 1
limit 1
</select>
......@@ -166,7 +166,7 @@
<select id="getNumByHmId" resultType="string">
select clerk_id
from tab_haoban_hm_clerk_relation
where hm_id = #{hmId}
where hm_id = #{hmId} and status = 1
</select>
......@@ -190,5 +190,15 @@
where relation_id = #{relationId}
</update>
<select id="queryByHmIdNotInClerkIds" resultMap="TabHaobanHmClerkRelationMap">
select <include refid="Base_Column_List"></include>
from tab_haoban_hm_clerk_relation
where hm_id = #{hmId} and status = 1
and clerk_id not in
<foreach item="id" index="index" collection="clerkIds" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>
......@@ -315,7 +315,11 @@
select store_id storeId,
MIN(over_flag) overFlag
from tab_haoban_hm_qrcode
where enterprise_id = #{enterpriseId} and status_flag = 1
where 1
<if test="null != wxEnterpriseId">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
and enterprise_id = #{enterpriseId} and status_flag = 1
and store_id is not null
GROUP BY store_id
</select>
......@@ -323,7 +327,11 @@
<select id="getHmStoreForWxa" resultType="String">
select distinct(store_id)
from tab_haoban_hm_qrcode
where enterprise_id = #{enterpriseId} and status_flag = 1 and over_flag = 0 and store_id is not null
where 1
<if test="null != wxEnterpriseId">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
and enterprise_id = #{enterpriseId} and status_flag = 1 and over_flag = 0 and store_id is not null
</select>
<select id="listHmIdForIndex" resultType="String" parameterType="com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO">
......@@ -334,7 +342,7 @@
and a.wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="null != hmSelect and '' != hmSelect ">
and (a.hm_code=#{hmSelect} or a.name like '%${hmSelect}%' or a.creator_name like '%${hmSelect}%' )
and (a.hm_id=#{hmSelect} or a.hm_code=#{hmSelect} or a.name like '%${hmSelect}%' or a.creator_name like '%${hmSelect}%' )
</if>
<if test="null != clerkSelect and '' != clerkSelect">
and ( a.clerk_id = #{clerkSelect} or b.clerk_id = #{clerkSelect} )
......@@ -425,7 +433,10 @@
</select>
<select id="listCanAddClerk" resultType="com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeClerkBO">
select a.clerk_id , a.store_id , a.staff_id from
select a.clerk_id clerkId,
a.store_id storeId,
a.staff_id staffId
from
<include refid="canAddClerkSql" />
</select>
......
......@@ -208,6 +208,6 @@
<if test="null != addChannel">
and add_channel = #{addChannel}
</if>
and status_flag != 0 order by #{createTimeOrder}
and status_flag = #{statusFlag} order by create_time ${createTimeOrder}
</select>
</mapper>
\ No newline at end of file
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;
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.*;
import com.gic.haoban.manage.api.service.*;
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.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.web.config.Config;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
......@@ -15,28 +49,9 @@ import com.gic.redis.data.util.GicRateLimiter;
import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.QywxNewUseridDTO;
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.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* Created 2020/4/9.
......@@ -54,19 +69,14 @@ public class TestController extends WebBaseController {
@Autowired
private QywxSuiteApiService qywxSuiteApiService;
@Autowired
private MemberUnionidRelatedApiService memberUnionidRelatedApiService;
@Autowired
private TestApiService testApiService;
@Autowired
private MaidianLogApiService maidianLogApiService;
@Autowired
private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService;
@Autowired
private WxEnterpriseApiService wxEnterpriseApiService;
@Autowired
......@@ -79,6 +89,10 @@ public class TestController extends WebBaseController {
private Config config;
@Autowired
private HmQrcodeApiService hmQrcodeApiService;
@Autowired
private QywxCorpApiService qywxCorpApiService;
@RequestMapping("/send-message-test")
public HaobanResponse testSendMessage(QywxXcxSendMessageQo qo) {
......@@ -326,4 +340,91 @@ public class TestController extends WebBaseController {
hmQrcodeApiService.checkStaffOpenContactByWxEnterpriseId(wxEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_1);
}
@RequestMapping("test-qw-post-fws")
public HaobanResponse testQwPost(String url , String corpid , String json) {
if(isProd()) {
return null ;
}
String token = qywxCorpApiService.getProviderAccessToken(corpid) ;
logger.info("toekn={},corpId={} , url={} , json={}",token, corpid ,(url + token) , json);
Map<String, Object> map = HttpClient.getWinxinResByJson(url + token ,json);
return resultResponse(HaoBanErrCode.ERR_0, map) ;
}
@RequestMapping("test-qw-get-fws")
public HaobanResponse testQwGet(String url , String corpId) {
if(isProd()) {
return null ;
}
String token =qywxCorpApiService.getProviderAccessToken(corpId) ;
logger.info("toekn={},appid={} , url={} , json={}",token,corpId ,(url + token));
Map<String, Object> map = HttpClient.getHttpByGet(url + token);
return resultResponse(HaoBanErrCode.ERR_0, map) ;
}
@RequestMapping("test-qw-post-3")
public HaobanResponse testQwPost3(String url , String corpid , String json) {
if(isProd()) {
return null ;
}
String token = qywxCorpApiService.getCorpAccessToken(corpid,config.getWxSuiteid()) ;
logger.info("toekn={},corpId={} , url={} , json={}",token, corpid ,(url + token) , json);
Map<String, Object> map = HttpClient.getWinxinResByJson(url + token ,json);
return resultResponse(HaoBanErrCode.ERR_0, map) ;
}
@RequestMapping("test-qw-token")
public HaobanResponse testQwPost3(String corpid , String secret) {
if(StringUtils.isBlank(secret)) {
String token = qywxCorpApiService.getCorpAccessToken(corpid,config.getWxSuiteid()) ;
return resultResponse(HaoBanErrCode.ERR_0, token) ;
}else {
String token = qywxCorpApiService.getToken(corpid, secret) ;
return resultResponse(HaoBanErrCode.ERR_0, token) ;
}
}
@RequestMapping("test-qw-get-3")
public HaobanResponse testQwGet3(String url , String corpid) {
if(isProd()) {
return null ;
}
String token = qywxCorpApiService.getCorpAccessToken(corpid,config.getWxSuiteid()) ;
logger.info("toekn={},appid={} , url={} , json={}",token,corpid ,(url + token));
Map<String, Object> map = HttpClient.getHttpByGet(url + token);
return resultResponse(HaoBanErrCode.ERR_0, map) ;
}
@RequestMapping("test-qw-post-dk")
public HaobanResponse testQwPostdk(String url , String corpid , String secret, String json) {
if(isProd()) {
return null ;
}
String token = qywxCorpApiService.getToken(corpid, secret) ;
logger.info("toekn={},corpId={} , url={} , json={}",token, corpid ,(url + token) , json);
Map<String, Object> map = HttpClient.getWinxinResByJson(url + token ,json);
return resultResponse(HaoBanErrCode.ERR_0, map) ;
}
@RequestMapping("test-qw-get-dk")
public HaobanResponse testQwGetdk(String url , String corpid , String secret) {
if(isProd()) {
return null ;
}
String token = qywxCorpApiService.getToken(corpid, secret) ;
logger.info("toekn={},appid={} , url={} , json={}",token,corpid ,(url + token));
Map<String, Object> map = HttpClient.getHttpByGet(url + token);
return resultResponse(HaoBanErrCode.ERR_0, map) ;
}
private boolean isProd() {
com.ctrip.framework.apollo.Config config = ConfigService.getConfig("COMMON.gic-properties");
String env = config.getProperty("environment.value", "");
boolean isProd = "prod".equals(env);
return isProd ;
}
}
......@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
......@@ -24,18 +25,14 @@ import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.constants.StatisticsApolloKeyConstant;
import com.gic.haoban.manage.api.dto.hm.HmClerkDTO;
import com.gic.haoban.manage.api.dto.hm.HmClerkRelationDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeListDTO;
import com.gic.haoban.manage.api.dto.hm.HmStoreDTO;
import com.gic.haoban.manage.api.dto.hm.WxUserAddLogDTO;
import com.gic.haoban.manage.api.dto.hm.*;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogSearchQDTO;
import com.gic.haoban.manage.api.dto.statistics.StatisticsDTO;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.hm.HmGroupApiService;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService;
import com.gic.haoban.manage.api.util.DataHttpUtil;
......@@ -48,8 +45,17 @@ import com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO;
import com.gic.haoban.manage.web.qo.hm.data.HmTrendQO;
import com.gic.haoban.manage.web.vo.hm.HmDetailClerkListVO;
import com.gic.haoban.manage.web.vo.hm.HmTrendVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import cn.hutool.core.convert.Convert;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 活码(TabHaobanHmQrcode)表控制层
......@@ -71,6 +77,8 @@ public class HmQrcodeController {
private WxUserAddLogApiService wxUserAddLogApiService;
@Autowired
private StaffClerkRelationApiService staffClerkRelationApiService;
@Autowired
private HmGroupApiService hmGroupApiService;
/**
* 新增
......@@ -87,6 +95,7 @@ public class HmQrcodeController {
hmQrcodeQDTO.setModifierName(loginUser.getClerkName());
hmQrcodeQDTO.setWxEnterpriseId(loginUser.getWxEnterpriseId());
hmQrcodeQDTO.setEnterpriseId(loginUser.getEnterpriseId());
hmQrcodeQDTO.setInvokingType(1);
ServiceResponse serviceResponse = this.hmQrcodeApiService.add(hmQrcodeQDTO);
if (!"0000".equals(serviceResponse.getCode())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_DEFINE.getCode()), serviceResponse.getMessage());
......@@ -123,6 +132,7 @@ public class HmQrcodeController {
hmQrcodeQDTO.setModifierName(loginUser.getClerkName());
hmQrcodeQDTO.setWxEnterpriseId(loginUser.getWxEnterpriseId());
hmQrcodeQDTO.setEnterpriseId(loginUser.getEnterpriseId());
hmQrcodeQDTO.setInvokingType(1);
ServiceResponse serviceResponse = this.hmQrcodeApiService.update(hmQrcodeQDTO);
if (!"0000".equals(serviceResponse.getCode())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_DEFINE.getCode()), serviceResponse.getMessage());
......@@ -145,12 +155,16 @@ public class HmQrcodeController {
if (CollectionUtils.isEmpty(storeList)) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_100007.getCode()), HaoBanErrCode.ERR_100007.getMsg());
}
if (!storeList.contains("-1")) {
StringBuffer stringBuffer = new StringBuffer();
storeList.forEach(c -> stringBuffer.append(c).append(","));
hmQrcodeListQO.getInFields().setStoreId(stringBuffer.toString());
}
Long hmGroupId = hmQrcodeListQO.getInFields().getHmGroupId();
//-1 代表全部分组
if (hmGroupId == -1) {
hmQrcodeListQO.getInFields().setHmGroupId(null);
}
HmQrcodeListQDTO qdto = EntityUtil.changeEntityByJSON(HmQrcodeListQDTO.class, hmQrcodeListQO.getInFields());
if (!storeList.contains("-1")) {
qdto.setStoreId(storeList);
......@@ -166,10 +180,10 @@ public class HmQrcodeController {
hmQrcodeListQO.getInFields().setHmId(stringBuffer.toString());
StatisticsDTO statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_list, hmQrcodeListQO);
List<HmQrcodeListDTO> data = JSON.parseArray(JSON.toJSONString(statisticsDTO.getData()), HmQrcodeListDTO.class);
List<HmStoreDTO> storeDTOList = new ArrayList<>();
List<HmClerkDTO> clerkDTOList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(data)) {
for (HmQrcodeListDTO hmQrcodeListDTO : data) {
List<HmStoreDTO> storeDTOList = new ArrayList<>();
List<HmClerkDTO> clerkDTOList = new ArrayList<>();
Long hmId = hmQrcodeListDTO.getHmId();
Integer hmType = hmQrcodeListDTO.getHmType();
if (hmType == 1) {
......@@ -178,6 +192,7 @@ public class HmQrcodeController {
clerkDTO.setClerkId(hmQrcodeListDTO.getClerkId());
clerkDTO.setClerkCode(hmQrcodeListDTO.getClerkCode());
clerkDTOList.add(clerkDTO);
HmStoreDTO storeDTO = new HmStoreDTO();
storeDTO.setStoreId(hmQrcodeListDTO.getStoreId());
storeDTO.setStoreName(hmQrcodeListDTO.getStoreName());
......@@ -186,7 +201,7 @@ public class HmQrcodeController {
} else if (hmType == 2) {
BasePageInfo basePageInfo = new BasePageInfo();
basePageInfo.setPageNum(1);
basePageInfo.setPageNum(1000);
basePageInfo.setPageSize(1000);
Page<HmClerkRelationDTO> hmClerkByHmId = hmQrcodeApiService.getHmClerkByHmId(basePageInfo, hmId);
List<HmClerkRelationDTO> hmClerkRelationDTOList = hmClerkByHmId.getResult();
if (CollectionUtils.isNotEmpty(hmClerkRelationDTOList)) {
......@@ -196,6 +211,7 @@ public class HmQrcodeController {
clerkDTO.setClerkId(hmClerkRelationDTO.getClerkId());
clerkDTO.setClerkCode(hmClerkRelationDTO.getClerkCode());
clerkDTOList.add(clerkDTO);
HmStoreDTO storeDTO = new HmStoreDTO();
storeDTO.setStoreId(hmClerkRelationDTO.getStoreId());
storeDTO.setStoreName(hmClerkRelationDTO.getStoreName());
......@@ -204,9 +220,21 @@ public class HmQrcodeController {
}
}
}
ServiceResponse<HmGroupDTO> hmGroupDTOServiceResponse = hmGroupApiService.queryGroupDetail(hmQrcodeListDTO.getHmGroupId());
HmGroupDTO hmGroupDTO = hmGroupDTOServiceResponse.getResult();
if (hmGroupDTO != null) {
hmQrcodeListDTO.setHmGroupName(hmGroupDTO.getGroupName());
}
//if (CollectionUtils.isNotEmpty(storeDTOList)) {
// //门店id去重
// storeDTOList = storeDTOList.stream()
// .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(HmStoreDTO::getStoreId))), ArrayList::new));
//}
hmQrcodeListDTO.setClerkList(clerkDTOList);
hmQrcodeListDTO.setStoreList(storeDTOList);
}
statisticsDTO.setData(data);
}
return RestResponse.successResult(statisticsDTO);
}
......@@ -231,7 +259,7 @@ public class HmQrcodeController {
*/
@RequestMapping(value = "del", method = RequestMethod.DELETE)
public RestResponse del(Long hmId) {
ServiceResponse serviceResponse = this.hmQrcodeApiService.delById(hmId);
ServiceResponse serviceResponse = this.hmQrcodeApiService.delById(hmId,1);
if (!"0000".equals(serviceResponse.getCode())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_DEFINE.getCode()), serviceResponse.getMessage());
}
......
......@@ -214,17 +214,20 @@ public class HmStoreController {
searchDTO.setSearchName(storeSearchParams);
// 企业ID
searchDTO.setEnterpriseId(enterpriseId);
List<HmQrcodeStoreDTO> hmStoreList = this.hmQrcodeApiService.getHmStoreByEnterpriseId(enterpriseId);
List<HmQrcodeStoreDTO> hmStoreList = this.hmQrcodeApiService.getHmStoreByEnterpriseId(wxEnterpriseId , enterpriseId);
if (CollectionUtils.isEmpty(hmStoreList)) {
return RestResponse.failure("-1", "无活码门店");
}
Map<String, Integer> map = hmStoreList.stream()
.collect(Collectors.toMap(HmQrcodeStoreDTO::getStoreId, HmQrcodeStoreDTO::getOverFlag, (k1, k2) -> k1));
List<String> hmStoreIdList = hmStoreList.stream().map(dto -> dto.getStoreId()).collect(Collectors.toList());
logger.info("活码门店={}",hmStoreIdList);
if(!authStoreIdList.contains("-1")) {
Sets.SetView<String> setView = Sets.intersection(Sets.newHashSet(authStoreIdList),
Sets.newHashSet(hmStoreIdList));
hmStoreIdList = setView.stream().collect(Collectors.toList());
if (CollectionUtils.isEmpty(hmStoreList)) {
}
if (CollectionUtils.isEmpty(hmStoreIdList)) {
return RestResponse.failure("-1", "无符合门店");
}
// 授权门店 且有活码的门店
......
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