Commit 804b58a8 by fudahua

Merge branch 'developer' into 'master'

Developer

See merge request !115
parents b74ffef5 9b626c3d
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Created 2021/8/2.
*
* @author hua
*/
public class AlertMessageDTO implements Serializable {
private String wxEnterpriseId;
private String enterpriseId;
private Integer alertType;
/**
* 用来判断唯一性 同步的
*/
private String key;
private String traceId;
private String alertTitle;
private Map<String, Object> contentMap;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public Integer getAlertType() {
return alertType;
}
public void setAlertType(Integer alertType) {
this.alertType = alertType;
}
public String getTraceId() {
return traceId;
}
public void setTraceId(String traceId) {
this.traceId = traceId;
}
public String getAlertTitle() {
return alertTitle;
}
public void setAlertTitle(String alertTitle) {
this.alertTitle = alertTitle;
}
public Map<String, Object> getContentMap() {
return contentMap;
}
public void setContentMap(Map<String, Object> contentMap) {
this.contentMap = contentMap;
}
}
...@@ -7,9 +7,45 @@ public class ExternalClerkRelatedShortInfoDTO implements Serializable { ...@@ -7,9 +7,45 @@ public class ExternalClerkRelatedShortInfoDTO implements Serializable {
private String wxUserId; private String wxUserId;
private String enterpriseId;
private String wxEnterpriseId;
private String storeId;
private String clerkId;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getExternalUserId() { public String getExternalUserId() {
return externalUserId; return externalUserId;
} }
......
...@@ -3,8 +3,9 @@ package com.gic.haoban.manage.api.dto; ...@@ -3,8 +3,9 @@ package com.gic.haoban.manage.api.dto;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
public class StaffClerkInfoDTO implements Serializable{ public class StaffClerkInfoDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String staffClerkRelationId; private String staffClerkRelationId;
...@@ -16,6 +17,8 @@ public class StaffClerkInfoDTO implements Serializable{ ...@@ -16,6 +17,8 @@ public class StaffClerkInfoDTO implements Serializable{
private String enterpriseId; private String enterpriseId;
private String BrandName;
private String enterpriseName; private String enterpriseName;
private String storeId; private String storeId;
...@@ -48,8 +51,6 @@ public class StaffClerkInfoDTO implements Serializable{ ...@@ -48,8 +51,6 @@ public class StaffClerkInfoDTO implements Serializable{
this.mainStoreFlag = mainStoreFlag; this.mainStoreFlag = mainStoreFlag;
} }
private static final long serialVersionUID = 1L;
public String getEnterpriseName() { public String getEnterpriseName() {
return enterpriseName; return enterpriseName;
} }
...@@ -122,6 +123,14 @@ public class StaffClerkInfoDTO implements Serializable{ ...@@ -122,6 +123,14 @@ public class StaffClerkInfoDTO implements Serializable{
this.enterpriseId = enterpriseId == null ? null : enterpriseId.trim(); this.enterpriseId = enterpriseId == null ? null : enterpriseId.trim();
} }
public String getBrandName() {
return BrandName;
}
public void setBrandName(String brandName) {
BrandName = brandName;
}
public String getStoreId() { public String getStoreId() {
return storeId; return storeId;
} }
......
...@@ -3,8 +3,9 @@ package com.gic.haoban.manage.api.dto; ...@@ -3,8 +3,9 @@ package com.gic.haoban.manage.api.dto;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
public class StaffClerkRelationDTO implements Serializable{ public class StaffClerkRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String staffClerkRelationId; private String staffClerkRelationId;
...@@ -28,7 +29,8 @@ public class StaffClerkRelationDTO implements Serializable{ ...@@ -28,7 +29,8 @@ public class StaffClerkRelationDTO implements Serializable{
private Date updateTime; private Date updateTime;
private static final long serialVersionUID = 1L; private String storeName;
private String staffName;
public String getStaffClerkRelationId() { public String getStaffClerkRelationId() {
return staffClerkRelationId; return staffClerkRelationId;
...@@ -118,4 +120,19 @@ public class StaffClerkRelationDTO implements Serializable{ ...@@ -118,4 +120,19 @@ public class StaffClerkRelationDTO implements Serializable{
this.updateTime = updateTime; this.updateTime = updateTime;
} }
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
} }
package com.gic.haoban.manage.api.enums;
/**
* Created by hua on 2021/8/2.
*/
public enum AlertTypeEnum {
QYWX_TAG_SYNC(1, "企微标签同步", null),
QUNFA_MESSAGE(2, "企微群发", null),
FRIEND_ADD(3, "企微好友添加", null),;
private Integer type;
private String name;
private String dingUrl;
AlertTypeEnum(Integer type, String name, String dingUrl) {
this.type = type;
this.name = name;
this.dingUrl = dingUrl;
}
public String getDingUrl() {
return dingUrl;
}
public void setDingUrl(String dingUrl) {
this.dingUrl = dingUrl;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static AlertTypeEnum getEnum(int type) {
AlertTypeEnum[] values = AlertTypeEnum.values();
for (AlertTypeEnum value : values) {
if (value.getType() == type) {
return value;
}
}
return null;
}
}
...@@ -35,16 +35,20 @@ public enum AppPageType { ...@@ -35,16 +35,20 @@ public enum AppPageType {
//完善标签 //完善标签
PERFECT_TAG(15, "hbapp_customer_edit_tag"), PERFECT_TAG(15, "hbapp_customer_edit_tag"),
//销售线索任务列表 //销售线索任务列表
MARKET_CLUE_TASK(16, "hbapp_sales_lead_main"); MARKET_CLUE_TASK(16, "hbapp_sales_lead_main"),
//话务任务逾期提醒
TEL_WITHIN_TIME_LIMIT(17, "hbapp_marketing_task_list"),
;
AppPageType(int type, String desc){ AppPageType(int type, String desc) {
this.code = type; this.code = type;
this.desc = desc; this.desc = desc;
} }
private int code; private int code;
private String desc; private String desc;
public static String getDescByCode(int type) { public static String getDescByCode(int type) {
for (AppPageType c : AppPageType.values()) { for (AppPageType c : AppPageType.values()) {
if (c.getCode() == type) { if (c.getCode() == type) {
......
...@@ -9,7 +9,12 @@ public enum QuartzEnum { ...@@ -9,7 +9,12 @@ public enum QuartzEnum {
/** /**
* 企业微信 * 企业微信
*/ */
HANDOVER_QYWX("handover", "com.gic.haoban.manage.api.service.HandoverOperationApiService", "batchQywxHandoverTimeTask", "0 0 0 * * *", "-1"); HANDOVER_QYWX("handover", "com.gic.haoban.manage.api.service.HandoverOperationApiService", "batchQywxHandoverTimeTask", "0 0 0 * * *", "-1"),
TAG_QYWX("qywxTagCheck", "com.gic.haoban.manage.api.service.QywxTagApiService", "checkQywxSync", "0 30 10 * * *", "-1"),
/**
* 话务任务逾期提醒
*/
TEL_TASK_LATE_REMIND("telTaskLateRemind", "com.gic.haoban.task.manage.api.service.ITelTaskCallApiService", "telTaskLateRemind", "0 0 8 * * *", "-1");
private String key; private String key;
private String serviceName; private String serviceName;
private String method; private String method;
......
package com.gic.haoban.manage.api.enums;
/**
* Created by hua on 2021/7/27.
*/
public enum QywxTagRelationSyncFlagEnum {
DEL(0, "删除"),
PRE(1, "预处理"),
SUCCESS(2, "成功"),
FAIL(3, "失败");
private int type;
private String name;
QywxTagRelationSyncFlagEnum(int type, String name) {
this.type = type;
this.name = name;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
...@@ -30,4 +30,11 @@ public interface CheckQywxSettingApiService { ...@@ -30,4 +30,11 @@ public interface CheckQywxSettingApiService {
* @param dto * @param dto
*/ */
public void saveFriendCallback(String wxEnterpriseId, ExternalUserDTO externalUserDTO, MemberUnionidRelatedDTO dto); public void saveFriendCallback(String wxEnterpriseId, ExternalUserDTO externalUserDTO, MemberUnionidRelatedDTO dto);
/**
* 告警 异步回调
*
* @param params
*/
public void alertCallback(String params);
} }
...@@ -2,7 +2,6 @@ package com.gic.haoban.manage.api.service; ...@@ -2,7 +2,6 @@ package com.gic.haoban.manage.api.service;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.PreDealLogInfoDTO; import com.gic.haoban.manage.api.dto.PreDealLogInfoDTO;
import com.gic.haoban.manage.api.dto.SyncCheckDTO; import com.gic.haoban.manage.api.dto.SyncCheckDTO;
import com.gic.haoban.manage.api.dto.SyncSingleDealDTO; import com.gic.haoban.manage.api.dto.SyncSingleDealDTO;
...@@ -19,10 +18,11 @@ public interface DealSyncOperationApiService { ...@@ -19,10 +18,11 @@ public interface DealSyncOperationApiService {
/** /**
* 部门同步处理 * 部门同步处理
* "routerName": "departmentSyncDealMq"
* *
* @param params * @param params
*/ */
public void departmentDealMq(String params); void departmentDealMq(String params);
/** /**
* 处理前端数据 * 处理前端数据
...@@ -30,14 +30,14 @@ public interface DealSyncOperationApiService { ...@@ -30,14 +30,14 @@ public interface DealSyncOperationApiService {
* @param addList * @param addList
* @param editList * @param editList
*/ */
public void dealDepartment(String taskId, String wxEnterpriseId, List<SyncSingleDealDTO> addList, List<SyncSingleDealDTO> editList); void dealDepartment(String taskId, String wxEnterpriseId, List<SyncSingleDealDTO> addList, List<SyncSingleDealDTO> editList);
/** /**
* 重新执行任务 * 重新执行任务
* *
* @param taskId * @param taskId
*/ */
public void reDealDepartment(String taskId, int dataType); void reDealDepartment(String taskId, int dataType);
/** /**
* 创建任务 * 创建任务
...@@ -46,7 +46,7 @@ public interface DealSyncOperationApiService { ...@@ -46,7 +46,7 @@ public interface DealSyncOperationApiService {
* @param userId * @param userId
* @param desc * @param desc
*/ */
public String createTask(String wxEnterpriseId, String taskName, String userId, String desc); String createTask(String wxEnterpriseId, String taskName, String userId, String desc);
/** /**
* 创建任务 * 创建任务
...@@ -55,7 +55,7 @@ public interface DealSyncOperationApiService { ...@@ -55,7 +55,7 @@ public interface DealSyncOperationApiService {
* @param userId * @param userId
* @param desc * @param desc
*/ */
public String createQywxTask(String wxEnterpriseId, String taskName, String userId, String desc); String createQywxTask(String wxEnterpriseId, String taskName, String userId, String desc);
/** /**
* 关闭任务 * 关闭任务
...@@ -63,7 +63,7 @@ public interface DealSyncOperationApiService { ...@@ -63,7 +63,7 @@ public interface DealSyncOperationApiService {
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
public boolean closeTask(String wxEnterpriseId); boolean closeTask(String wxEnterpriseId);
/** /**
...@@ -71,7 +71,7 @@ public interface DealSyncOperationApiService { ...@@ -71,7 +71,7 @@ public interface DealSyncOperationApiService {
* *
* @param taskId * @param taskId
*/ */
public void unlockTask(String taskId); void unlockTask(String taskId);
/** /**
* 校验是否锁 * 校验是否锁
...@@ -79,7 +79,7 @@ public interface DealSyncOperationApiService { ...@@ -79,7 +79,7 @@ public interface DealSyncOperationApiService {
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
public String getTaskLock(String wxEnterpriseId); String getTaskLock(String wxEnterpriseId);
/** /**
* 校验同步状态 * 校验同步状态
...@@ -87,7 +87,7 @@ public interface DealSyncOperationApiService { ...@@ -87,7 +87,7 @@ public interface DealSyncOperationApiService {
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
public SyncCheckDTO getTaskCheck(String wxEnterpriseId); SyncCheckDTO getTaskCheck(String wxEnterpriseId);
/** /**
* 同步日志 * 同步日志
...@@ -95,7 +95,7 @@ public interface DealSyncOperationApiService { ...@@ -95,7 +95,7 @@ public interface DealSyncOperationApiService {
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
public Page<SyncTaskDTO> listSyncTask(String wxEnterpriseId, BasePageInfo pageInfo); Page<SyncTaskDTO> listSyncTask(String wxEnterpriseId, BasePageInfo pageInfo);
/** /**
* 同步日志 * 同步日志
...@@ -103,52 +103,60 @@ public interface DealSyncOperationApiService { ...@@ -103,52 +103,60 @@ public interface DealSyncOperationApiService {
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
public Page<PreDealLogInfoDTO> listSyncTaskDetail(String wxEnterpriseId, String taskId, BasePageInfo pageInfo); Page<PreDealLogInfoDTO> listSyncTaskDetail(String wxEnterpriseId, String taskId, BasePageInfo pageInfo);
/** /**
* 处理同步 * 处理同步
*/ */
public String dealQywxDepartment(String taskId, String wxEnterpriseId); String dealQywxDepartment(String taskId, String wxEnterpriseId);
/** /**
* 清理不存在的数据 * 清理不存在的数据
*
* @param wxEnterpriseId * @param wxEnterpriseId
* @param taskId * @param taskId
*/ */
public void cleanDiffrence(String wxEnterpriseId,String taskId); void cleanDiffrence(String wxEnterpriseId, String taskId);
/** /**
* 创建企业微信好友刷新任务 * 创建企业微信好友刷新任务
*
* @param wxEnterpriseId * @param wxEnterpriseId
* @param taskName * @param taskName
* @param staffId * @param staffId
* @param desc * @param desc
* @return * @return
*/ */
public String createWxFriendTask(String wxEnterpriseId, String taskName, String staffId, String desc); String createWxFriendTask(String wxEnterpriseId, String taskName, String staffId, String desc);
/** /**
* 处理需要处理的导购 * 处理需要处理的导购
*
* @param taskId * @param taskId
* @param wxEnterpriseId * @param wxEnterpriseId
*/ */
public void dealWxFriendClerk(String taskId, String wxEnterpriseId); void dealWxFriendClerk(String taskId, String wxEnterpriseId);
/** /**
* 创建企业微信好友刷新任务 * 创建企业微信好友刷新任务
*
* @param wxEnterpriseId * @param wxEnterpriseId
* @param taskName * @param taskName
* @param staffId * @param staffId
* @return * @return
*/ */
public String createWxFriendTaskSingle(String wxEnterpriseId, String taskName, String staffId, String staffName, int syncTaskType); String createWxFriendTaskSingle(String wxEnterpriseId, String taskName, String staffId, String staffName, int syncTaskType);
/** /**
* 单个导购刷新 * 单个导购刷新
*
* @param taskId * @param taskId
* @param wxUserId * @param wxUserId
* @param staffId * @param staffId
* @param wxEnterpriseId * @param wxEnterpriseId
*/ */
public void dealWxFriendClerkSingle(String taskId, String wxUserId, String staffId,String wxEnterpriseId); void dealWxFriendClerkSingle(String taskId, String wxUserId, String staffId, String wxEnterpriseId);
/** /**
* 单个导购刷新 * 单个导购刷新
...@@ -156,14 +164,15 @@ public interface DealSyncOperationApiService { ...@@ -156,14 +164,15 @@ public interface DealSyncOperationApiService {
* @param taskId * @param taskId
* @param wxEnterpriseId * @param wxEnterpriseId
*/ */
public void dealWxFriendStore(String taskId, String storeId, String wxEnterpriseId); void dealWxFriendStore(String taskId, String storeId, String wxEnterpriseId);
/** /**
* 定时 * 定时
*
* @param res * @param res
*/ */
@Deprecated @Deprecated
public void quartWxFriendClerk(String res); void quartWxFriendClerk(String res);
void test(String wxEnterpriseId, String taskId); void test(String wxEnterpriseId, String taskId);
...@@ -174,7 +183,7 @@ public interface DealSyncOperationApiService { ...@@ -174,7 +183,7 @@ public interface DealSyncOperationApiService {
* @param staffId * @param staffId
* @return true 刷新中 false 没刷新或刷新完成 * @return true 刷新中 false 没刷新或刷新完成
*/ */
public boolean getFreshFriendSyncTask(String wxEnterpriseId, String staffId); boolean getFreshFriendSyncTask(String wxEnterpriseId, String staffId);
/** /**
* 创建标签任务 * 创建标签任务
...@@ -182,7 +191,7 @@ public interface DealSyncOperationApiService { ...@@ -182,7 +191,7 @@ public interface DealSyncOperationApiService {
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
public String createTagTask(String wxEnterpriseId, String addUser, String memberTagId); String createTagTask(String wxEnterpriseId, String addUser, String memberTagId);
/** /**
* 执行任务 * 执行任务
...@@ -192,5 +201,5 @@ public interface DealSyncOperationApiService { ...@@ -192,5 +201,5 @@ public interface DealSyncOperationApiService {
* @param tagIds * @param tagIds
* @param taskId * @param taskId
*/ */
public void dealTagTask(String wxEnterpriseId, String enterpriseId, List<String> tagIds, String taskId); void dealTagTask(String wxEnterpriseId, String enterpriseId, List<String> tagIds, String taskId);
} }
...@@ -106,6 +106,21 @@ public interface ExternalClerkRelatedApiService { ...@@ -106,6 +106,21 @@ public interface ExternalClerkRelatedApiService {
*/ */
Page<String> pageExternalByEnterpriseId(String wxEnterpriseId, String enterpriseId, BasePageInfo pageInfo); Page<String> pageExternalByEnterpriseId(String wxEnterpriseId, String enterpriseId, BasePageInfo pageInfo);
/**
* 查询导购好友关联
*
* @param wxEnterpriseId : 微信企业id
* @return : 返回好友关联
*/
Page<String> pageExternalByEnterpriseId(String wxEnterpriseId, String enterpriseId, int pageNum, int pageSize);
/**
* 获取企业下的关联关系的 memberIds
*
* @return
*/
List<String> listExternalClerkMemberIdsByMemberIds(String wxEnterpriseId, List<String> memberIds);
/** /**
* 获取企业下的关联关系列表 * 获取企业下的关联关系列表
......
...@@ -35,6 +35,7 @@ public interface MemberUnionidRelatedApiService { ...@@ -35,6 +35,7 @@ public interface MemberUnionidRelatedApiService {
/** /**
* 处理外部联系人异步 * 处理外部联系人异步
* "routerName": "dealQywxExternalUserMq"
* *
* @param params * @param params
*/ */
...@@ -44,15 +45,23 @@ public interface MemberUnionidRelatedApiService { ...@@ -44,15 +45,23 @@ public interface MemberUnionidRelatedApiService {
List<MemberUnionidRelatedDTO> getByWxUserIdAndWxEnterpriseId(String wxUserId, String wxEnterpriseId); List<MemberUnionidRelatedDTO> getByWxUserIdAndWxEnterpriseId(String wxUserId, String wxEnterpriseId);
List<MemberUnionidRelatedDTO> listByEnterpriseIdAndDate(String enterpriseId,Date date); List<MemberUnionidRelatedDTO> listByEnterpriseIdAndDate(String enterpriseId, Date date);
List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId); /**
* 查看是否可以跳转会员详情的会员列表
*
* @param externalUserid
* @param wxUserId
* @param storeId
* @return
*/
List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId, String storeId);
String add(String wxEnterpriseId, String selfExternalUserId, String userId1,String storeId); String add(String wxEnterpriseId, String selfExternalUserId, String userId1, String storeId);
void freshWxFrend(String wxEnterpriseId, String wxUserId,String storeId); void freshWxFrend(String wxEnterpriseId, String wxUserId, String storeId);
public void cleanByCid(String cid); void cleanByCid(String cid);
Page<MemberUnionidRelatedDTO> pageMemberUnionByParams(List<String> userIdList, List<String> sendMemberIds, Page<MemberUnionidRelatedDTO> pageMemberUnionByParams(List<String> userIdList, List<String> sendMemberIds,
String enterpriseId, BasePageInfo pageInfo); String enterpriseId, BasePageInfo pageInfo);
......
...@@ -7,22 +7,34 @@ import com.gic.haoban.manage.api.dto.QywxCallBackDTO; ...@@ -7,22 +7,34 @@ import com.gic.haoban.manage.api.dto.QywxCallBackDTO;
* Created by tgs on 2020/2/20. * Created by tgs on 2020/2/20.
*/ */
public interface MessageApiService { public interface MessageApiService {
/**接收企业微信的推送消息*/ /**
* 接收企业微信的推送消息
*
* @param gicMessageDTO
*/
@Deprecated
void gicMessageReceive(GicMessageDTO gicMessageDTO); void gicMessageReceive(GicMessageDTO gicMessageDTO);
/**接收企业微信的推送消息*/ /**
* 接收企业微信的推送消息
*
* @param qywxCallBackDTO
*/
void wxMessageReceive(QywxCallBackDTO qywxCallBackDTO); void wxMessageReceive(QywxCallBackDTO qywxCallBackDTO);
/** /**
* 队列消费gic推送数据 * 队列消费gic推送数据
*
* @param param * @param param
*/ */
@Deprecated
void dealGicMessage(String param); void dealGicMessage(String param);
/** /**
* 队列消费企业微信推送数据 * 队列消费企业微信推送数据
* @param param * @param param
*/ */
@Deprecated
void dealWxMessage(String param); void dealWxMessage(String param);
/** /**
* 发送消费消息 * 发送消费消息
...@@ -33,9 +45,11 @@ public interface MessageApiService { ...@@ -33,9 +45,11 @@ public interface MessageApiService {
* @param storeId * @param storeId
* @return * @return
*/ */
Boolean sendFaceMessage(String clerkId,String memberId, String memberName, String arrivalTime,String storeId); Boolean sendFaceMessage(String clerkId, String memberId, String memberName, String arrivalTime, String storeId);
/** /**
* 发送完善标签信息 * 发送完善标签信息
*
* @param clerkId * @param clerkId
* @param clerkId * @param clerkId
* @param memberName * @param memberName
...@@ -43,5 +57,16 @@ public interface MessageApiService { ...@@ -43,5 +57,16 @@ public interface MessageApiService {
* @param orderId * @param orderId
* @param storeId * @param storeId
*/ */
Boolean sendPerfectRemarkMessage(String clerkId, String memberId,String memberName, String customerTime, String orderId,String storeId); Boolean sendPerfectRemarkMessage(String clerkId, String memberId, String memberName, String customerTime, String orderId, String storeId);
/**
* 通用发送企业微信消息
*
* @param param 参数
* @author xuwenqian
* @date 2021-07-16 10:09:00
*/
void sendWxMessage(String param);
} }
package com.gic.haoban.manage.api.service; package com.gic.haoban.manage.api.service;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.QywxTagCallbackDTO; import com.gic.haoban.manage.api.dto.QywxTagCallbackDTO;
import com.gic.haoban.manage.api.dto.QywxTagInfoDTO; import com.gic.haoban.manage.api.dto.QywxTagInfoDTO;
import com.gic.haoban.manage.api.dto.QywxTagItemDTO; import com.gic.haoban.manage.api.dto.QywxTagItemDTO;
...@@ -26,15 +27,23 @@ public interface QywxTagApiService { ...@@ -26,15 +27,23 @@ public interface QywxTagApiService {
* @param infoDTO 标签 * @param infoDTO 标签
* @param items 标签项 * @param items 标签项
*/ */
public void syncTagToQywx(String wxEnterpriseId, String enterpriseId, QywxTagInfoDTO infoDTO, List<QywxTagItemDTO> items); public ServiceResponse syncTagToQywx(String wxEnterpriseId, String enterpriseId, QywxTagInfoDTO infoDTO, List<QywxTagItemDTO> items);
/** /**
* 关闭同步 * 关闭同步
* *
* @param wxEnterpriseId * @param wxEnterpriseId
* @param tagRelationId * @param memberTagId
*/ */
public void closeSync(String wxEnterpriseId, String tagRelationId); public ServiceResponse closeSync(String wxEnterpriseId, String memberTagId);
/**
* 删除gic标签项导致 并删除企业微信的数据
*
* @param wxEnterpriseId
* @param tagItemId
*/
public ServiceResponse delGicTagItem(String wxEnterpriseId, String tagItemId);
/** /**
* 查询所有同步的标签 * 查询所有同步的标签
...@@ -72,6 +81,85 @@ public interface QywxTagApiService { ...@@ -72,6 +81,85 @@ public interface QywxTagApiService {
* @param enterpriseId * @param enterpriseId
* @param externalUserId * @param externalUserId
*/ */
public void syncFriendTagToQywxByExternalUserId(String wxEnterpriseId, String enterpriseId, String externalUserId, String tagItemId); public ServiceResponse syncFriendTagToQywxByExternalUserId(String wxEnterpriseId, String enterpriseId, String externalUserId, List<String> tagItemIds);
/**
* 同步企业微信导入gic的会员标签
*
* @param wxEnterpriseId
* @param externalUserId
* @return
*/
public ServiceResponse syncQywxTagToGicByExternalUserId(String wxEnterpriseId, String externalUserId, String wxUserId);
/**
* 更改状态
*
* @param memberTagId
* @param wxEnterpriseId
* @param status
*/
public void changeQywxTagStatus(String memberTagId, String wxEnterpriseId, int status);
/**
* 同步标签
*
* @param wxEnterpriseId
* @param enterpriseId
* @param memberTagIds
* @return
*/
public boolean saveRelation(String wxEnterpriseId, String enterpriseId, List<String> memberTagIds);
/**
* 更新qywx的标签或者标签组名称
*
* @param wxEnterpriseId
* @param id (企业微信的对应的id)
* @param name
* @param type
* @return
*/
public ServiceResponse renameQywxTag(String wxEnterpriseId, String id, String name, Integer type);
/**
* 根据会员标签id 拉取列表
*
* @param wxEnterpriseId
* @param memberTagId
* @return
*/
public List<QywxTagRelationDTO> listQywxTagRelationByMemberTagId(String wxEnterpriseId, String memberTagId);
/**
* 根据会员标签关联id 查询关联信息
*
* @param relationId
* @return
*/
public QywxTagRelationDTO getQywxTagRelationByRelationId(String relationId);
/**
* 根据会员标签关联id 查询关联信息
*
* @param qywxTagId
* @return
*/
public QywxTagInfoDTO getQywxTagByQywxTagId(String qywxTagId);
/**
* 更新标签项 未同步状态 为同步状态
*
* @param tagItemId
* @return
*/
public void updateQywxTagRelationSyncStatusByTagItemId(String wxEnterpriseId, String tagItemId);
/**
* 校验企业微信标签同步
*/
public void checkQywxSync(String params);
} }
package com.gic.haoban.manage.api.service; package com.gic.haoban.manage.api.service;
import java.util.List;
import java.util.Set;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
...@@ -10,12 +7,16 @@ import com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO; ...@@ -10,12 +7,16 @@ import com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO;
import com.gic.haoban.manage.api.dto.StaffClerkInfoDTO; import com.gic.haoban.manage.api.dto.StaffClerkInfoDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO; import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import java.util.List;
import java.util.Set;
public interface StaffClerkRelationApiService { public interface StaffClerkRelationApiService {
/** /**
* 绑定日志 * 绑定日志
*
* @param params * @param params
*/ */
public void bindLogMq(String params); void bindLogMq(String params);
List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList); List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList);
...@@ -30,9 +31,10 @@ public interface StaffClerkRelationApiService { ...@@ -30,9 +31,10 @@ public interface StaffClerkRelationApiService {
/** /**
* 绑定 * 绑定
*
* @return * @return
*/ */
public ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO,String optStaffId,int chanelCode); ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO, String optStaffId, int chanelCode);
StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId); StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId);
...@@ -96,40 +98,49 @@ public interface StaffClerkRelationApiService { ...@@ -96,40 +98,49 @@ public interface StaffClerkRelationApiService {
/** /**
* 搜索查询列表 * 搜索查询列表
*
* @param wxEnterpriseId * @param wxEnterpriseId
* @param search * @param search
* @param enterpriseId * @param enterpriseId
* @param optType * @param optType
* @return * @return
*/ */
public Page<StaffClerkBindLogDetailDTO> pageStaffClerkBindLog(String wxEnterpriseId, String search, String enterpriseId, int optType, BasePageInfo pageInfo); Page<StaffClerkBindLogDetailDTO> pageStaffClerkBindLog(String wxEnterpriseId, String search, String enterpriseId, int optType, BasePageInfo pageInfo);
/** /**
* 追加到绑定日志 * 追加到绑定日志
*
* @param staffId * @param staffId
* @param optStaffId * @param optStaffId
* @param optType * @param optType
* @param channelCode * @param channelCode
* @param relationId * @param relationId
*/ */
public void pushToBindLog(String staffId,String optStaffId,int optType,int channelCode,String relationId); void pushToBindLog(String staffId, String optStaffId, int optType, int channelCode, String relationId);
/** /**
* 获取config * 获取config
*
* @param clerkId * @param clerkId
* @param memberId * @param memberId
* @return * @return
*/ */
ServiceResponse<String> getClerkMemberChatConfig(String clerkId); ServiceResponse<String> getClerkMemberChatConfig(String clerkId);
/** /**
*
* @Description 方法描述:
* @return 返回值类型: <pre> * @return 返回值类型: <pre>
* @author 作者: WQ <pre> * @author 作者: WQ <pre>
* @date 时间: 2020年12月24日 上午11:21:38 <pre> * @date 时间: 2020年12月24日 上午11:21:38 <pre>
* @param wxEnterpriseId: <pre> * @param wxEnterpriseId: <pre>
* @param pageInfo: <pre> * @param pageInfo: <pre>
* @Description 方法描述:
*/
Page<StaffClerkRelationDTO> pageByWxEnterpriseId(String wxEnterpriseId, BasePageInfo pageInfo);
/**
* 查询状态正常导购
* @return
*/ */
public Page<StaffClerkRelationDTO> pageByWxEnterpriseId(String wxEnterpriseId, BasePageInfo pageInfo); List<StaffClerkRelationDTO> listAll();
} }
...@@ -5,6 +5,7 @@ import java.util.Map; ...@@ -5,6 +5,7 @@ import java.util.Map;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO; import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
public interface StaffDepartmentRelatedApiService { public interface StaffDepartmentRelatedApiService {
List<StaffDepartmentRelatedDTO> listByDepartmentId(String departmentId); List<StaffDepartmentRelatedDTO> listByDepartmentId(String departmentId);
......
...@@ -133,6 +133,7 @@ public class TestDataImportController extends WebBaseController { ...@@ -133,6 +133,7 @@ public class TestDataImportController extends WebBaseController {
} }
BasePageInfo basePageInfo = new BasePageInfo(); BasePageInfo basePageInfo = new BasePageInfo();
basePageInfo.setPageSize(2000); basePageInfo.setPageSize(2000);
int num = 1;
Page<MarketClueTaskDTO> page = iMarketClueTaskApiService.pageMarketClueTaskDTO(ecmId, enterpriseId, basePageInfo); Page<MarketClueTaskDTO> page = iMarketClueTaskApiService.pageMarketClueTaskDTO(ecmId, enterpriseId, basePageInfo);
while (CollectionUtils.isNotEmpty(page.getResult())) { while (CollectionUtils.isNotEmpty(page.getResult())) {
page.getResult().forEach(dto -> { page.getResult().forEach(dto -> {
...@@ -143,6 +144,8 @@ public class TestDataImportController extends WebBaseController { ...@@ -143,6 +144,8 @@ public class TestDataImportController extends WebBaseController {
iMarketTaskMemberApiService.detailsRefresh(enterpriseId, dto.getTaskId(), true); iMarketTaskMemberApiService.detailsRefresh(enterpriseId, dto.getTaskId(), true);
} }
}); });
num++;
basePageInfo.setPageNum(num);
page = iMarketClueTaskApiService.pageMarketClueTaskDTO(ecmId, enterpriseId, basePageInfo); page = iMarketClueTaskApiService.pageMarketClueTaskDTO(ecmId, enterpriseId, basePageInfo);
} }
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
......
...@@ -67,4 +67,22 @@ public interface QywxTagItemMapper { ...@@ -67,4 +67,22 @@ public interface QywxTagItemMapper {
* @return * @return
*/ */
TabQywxTagItem getByQywxTagKey(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagKey") String qywxTagKey); TabQywxTagItem getByQywxTagKey(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagKey") String qywxTagKey);
/**
* 根据id 获取标签项信息
*
* @param wxEnterpriseId
* @param ids
* @return
*/
List<TabQywxTagItem> listByQywxTagItemsIds(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("ids") List<String> ids);
/**
* 根据id 获取标签项信息
*
* @param wxEnterpriseId
* @param qywxTagKeys
* @return
*/
List<TabQywxTagItem> listByQywxTagItemsKeys(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagKeys") List<String> qywxTagKeys);
} }
\ No newline at end of file
...@@ -49,6 +49,16 @@ public interface QywxTagRelationMapper { ...@@ -49,6 +49,16 @@ public interface QywxTagRelationMapper {
*/ */
List<TabQywxTagRelation> listByMemberTagId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("memberTagId") String memberTagId); List<TabQywxTagRelation> listByMemberTagId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("memberTagId") String memberTagId);
/**
* 查询企业下所有同步的 根据tagItemId
*
* @param wxEnterpriseId
* @param tagItemId
* @return
*/
TabQywxTagRelation getQywxTagRelationByTagItemId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("tagItemId") String tagItemId);
/** /**
* 删除同步信息 * 删除同步信息
* *
...@@ -85,4 +95,13 @@ public interface QywxTagRelationMapper { ...@@ -85,4 +95,13 @@ public interface QywxTagRelationMapper {
* @return * @return
*/ */
TabQywxTagRelation getQywxTagByQywxTagItemId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagItemId") String qywxTagItemId); TabQywxTagRelation getQywxTagByQywxTagItemId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("qywxTagItemId") String qywxTagItemId);
/**
* 更新标签同步状态
*
* @param wxEnterpriseId
* @param memberTagId
* @return
*/
int changeRelationSyncFlag(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("memberTagId") String memberTagId, @Param("syncFlag") Integer syncFlag);
} }
\ No newline at end of file
...@@ -161,11 +161,21 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -161,11 +161,21 @@ public interface TabHaobanExternalClerkRelatedMapper {
/** /**
* 查询会员在企业下的好友关系 根据会员ids * 查询会员在企业下的好友关系 根据会员ids
* *
* @param memberId * @param memberIds
* @param wxEnterpriseId
* @return
*/
List<TabHaobanExternalClerkRelated> listByMemberIds(@Param("memberIds") List<String> memberIds,
@Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 查询会员在企业下的好友关系memberIds 根据会员ids
*
* @param memberIds
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
List<TabHaobanExternalClerkRelated> listByMemberIds(@Param("memberIds") List<String> memberId, List<String> listMemberIdsByMemberIds(@Param("memberIds") List<String> memberIds,
@Param("wxEnterpriseId") String wxEnterpriseId); @Param("wxEnterpriseId") String wxEnterpriseId);
/** /**
...@@ -175,4 +185,12 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -175,4 +185,12 @@ public interface TabHaobanExternalClerkRelatedMapper {
* @return * @return
*/ */
List<TabHaobanExternalClerkRelated> listByMemberId(@Param("memberId") String memberId); List<TabHaobanExternalClerkRelated> listByMemberId(@Param("memberId") String memberId);
/**
* 查询会员在企业下的好友关系 根据会员id
*
* @param wxEnterpriseId
* @return
*/
List<TabHaobanExternalClerkRelated> listByExternalUserId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("externalUserId") String externalUserId);
} }
\ No newline at end of file
package com.gic.haoban.manage.service.dao.mapper; package com.gic.haoban.manage.service.dao.mapper;
import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO; import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation; import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
public interface TabHaobanStaffClerkRelationMapper { public interface TabHaobanStaffClerkRelationMapper {
int deleteByPrimaryKey(String staffClerkRelationId); int deleteByPrimaryKey(String staffClerkRelationId);
...@@ -25,14 +24,16 @@ public interface TabHaobanStaffClerkRelationMapper { ...@@ -25,14 +24,16 @@ public interface TabHaobanStaffClerkRelationMapper {
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); TabHaobanStaffClerkRelation getOneByClerkId(@Param("clerkId") String clerkId);
/** /**
* 改变状态 格局clerkId * 改变状态 格局clerkId
*
* @param clerkId * @param clerkId
* @param status * @param status
* @return * @return
*/ */
public int changeStatusByClerkId(@Param("clerkId") String clerkId,@Param("status") Integer status); int changeStatusByClerkId(@Param("clerkId") String clerkId, @Param("status") Integer status);
/** /**
* 更新信息 * 更新信息
...@@ -117,7 +118,18 @@ public interface TabHaobanStaffClerkRelationMapper { ...@@ -117,7 +118,18 @@ public interface TabHaobanStaffClerkRelationMapper {
/** /**
* 已使用的门店id列表 * 已使用的门店id列表
*
* @param enterpriseId * @param enterpriseId
*/ */
List<TabHaobanStaffClerkRelation> listBindStoreIdByEnterpriseId(String enterpriseId); List<TabHaobanStaffClerkRelation> listBindStoreIdByEnterpriseId(String enterpriseId);
/**
* 列出所有
*
* @return {@link List<TabHaobanStaffClerkRelation> }
* @author xuwenqian
* @date 2021-07-15 16:24:27
*/
List<StaffClerkRelationDTO> listAll();
} }
\ No newline at end of file
...@@ -80,4 +80,12 @@ public interface TabHaobanStoreRelationMapper { ...@@ -80,4 +80,12 @@ public interface TabHaobanStoreRelationMapper {
* @return * @return
*/ */
List<String> listStoreIdByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("enterpriseId") String enterpriseId); List<String> listStoreIdByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("enterpriseId") String enterpriseId);
/**
* 更新门店名称
*
* @param enterpriseId
* @return
*/
public int updateStoreName(@Param("enterpriseId") String enterpriseId, @Param("storeId") String storeId, @Param("storeName") String storeName);
} }
\ No newline at end of file
package com.gic.haoban.manage.service.pojo;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Created 2021/7/28.
*
* @author hua
*/
public class QywxSyncTagFormatPojo implements Serializable {
/**
* 企业微信与gic标签项对应map
*/
private Map<String, String> qywxToGicTagItemIdMap;
/**
* gic与企业微信标签项对应map
*/
private Map<String, String> gicToQywxTagItemIdMap;
/**
* 商户对应的企业微信标签列表
*/
private Map<String, Set<String>> entQywxTagKeysMap;
/**
* 商户对应的gic标签列表
*/
private Map<String, Set<String>> entGicTagItemIdMap;
public Map<String, String> getQywxToGicTagItemIdMap() {
return qywxToGicTagItemIdMap;
}
public void setQywxToGicTagItemIdMap(Map<String, String> qywxToGicTagItemIdMap) {
this.qywxToGicTagItemIdMap = qywxToGicTagItemIdMap;
}
public Map<String, String> getGicToQywxTagItemIdMap() {
return gicToQywxTagItemIdMap;
}
public void setGicToQywxTagItemIdMap(Map<String, String> gicToQywxTagItemIdMap) {
this.gicToQywxTagItemIdMap = gicToQywxTagItemIdMap;
}
public Map<String, Set<String>> getEntQywxTagKeysMap() {
return entQywxTagKeysMap;
}
public void setEntQywxTagKeysMap(Map<String, Set<String>> entQywxTagKeysMap) {
this.entQywxTagKeysMap = entQywxTagKeysMap;
}
public Map<String, Set<String>> getEntGicTagItemIdMap() {
return entGicTagItemIdMap;
}
public void setEntGicTagItemIdMap(Map<String, Set<String>> entGicTagItemIdMap) {
this.entGicTagItemIdMap = entGicTagItemIdMap;
}
}
package com.gic.haoban.manage.service.pojo;
import java.io.Serializable;
import java.util.List;
/**
* Created 2021/7/19.
*
* @author hua
*/
public class QywxTagSyncInfoPojo implements Serializable {
/**
* 任务id
*/
private String taskId;
/**
* 任务类型 0标签同步 1会员标签同步
* #taskTypeEnum
*/
private int taskType;
/**
* 数据id 对应memberId
*/
private String dataId;
/**
* 同步类型
*/
private int syncType;
private Integer times = 0;
/**
* 批量导入时
*/
private List<String> memberIds;
/**
* 非必传
*/
private String wxEnterpriseId;
/**
* 非必传
*/
private String enterpriseId;
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public List<String> getMemberIds() {
return memberIds;
}
public void setMemberIds(List<String> memberIds) {
this.memberIds = memberIds;
}
public int getSyncType() {
return syncType;
}
public void setSyncType(int syncType) {
this.syncType = syncType;
}
/**
* 同步的id
*/
private Integer syncLogId;
public Integer getTimes() {
return times;
}
public void setTimes(Integer times) {
this.times = times;
}
public Integer getSyncLogId() {
return syncLogId;
}
public void setSyncLogId(Integer syncLogId) {
this.syncLogId = syncLogId;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public int getTaskType() {
return taskType;
}
public void setTaskType(int taskType) {
this.taskType = taskType;
}
public String getDataId() {
return dataId;
}
public void setDataId(String dataId) {
this.dataId = dataId;
}
}
...@@ -23,10 +23,31 @@ public class StoreSyncPojo extends BinlogBasePojo { ...@@ -23,10 +23,31 @@ public class StoreSyncPojo extends BinlogBasePojo {
@JSONField(name = "enterprise_id") @JSONField(name = "enterprise_id")
private String enterpriseId; private String enterpriseId;
@JSONField(name = "store_name")
private String storeName;
private String oldStoreName;
private Integer status; private Integer status;
private Integer oldStatus; private Integer oldStatus;
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getOldStoreName() {
return oldStoreName;
}
public void setOldStoreName(String oldStoreName) {
this.oldStoreName = oldStoreName;
}
public String getOldStoreGroupId() { public String getOldStoreGroupId() {
return oldStoreGroupId; return oldStoreGroupId;
} }
......
...@@ -49,4 +49,13 @@ public interface ExternalClerkRelatedService { ...@@ -49,4 +49,13 @@ public interface ExternalClerkRelatedService {
*/ */
List<TabHaobanExternalClerkRelated> listExternalByUnionId(String enterpriseId, String unionId); List<TabHaobanExternalClerkRelated> listExternalByUnionId(String enterpriseId, String unionId);
/**
* 根据externalUserid获取外部联系人的绑定导购
*
* @param wxEnterpriseId
* @param externalUserid
* @return
*/
List<TabHaobanExternalClerkRelated> listExternalByExternalUserid(String wxEnterpriseId, String externalUserid);
} }
...@@ -112,6 +112,14 @@ public interface QywxTagService { ...@@ -112,6 +112,14 @@ public interface QywxTagService {
public List<TabQywxTagRelation> listQywxTagRelationByMemberTagId(String wxEnterpriseId, String memberTagId); public List<TabQywxTagRelation> listQywxTagRelationByMemberTagId(String wxEnterpriseId, String memberTagId);
/** /**
* 根据tagItemId 查询
*
* @param tagItemId
* @return
*/
public TabQywxTagRelation getQywxTagRelationByTagItemId(String wxEnterpriseId, String tagItemId);
/**
* 根据qywxTagId查询 * 根据qywxTagId查询
* *
* @param qywxTagId * @param qywxTagId
...@@ -156,6 +164,62 @@ public interface QywxTagService { ...@@ -156,6 +164,62 @@ public interface QywxTagService {
*/ */
public TabQywxTagRelation getQywxTagRelationByQywxKey(String wxEnterpriseId, String key, Integer qywxTagRelationType); public TabQywxTagRelation getQywxTagRelationByQywxKey(String wxEnterpriseId, String key, Integer qywxTagRelationType);
/**
* 根据企业微信的标签项获取 标签项列表
*
* @param wxEnterpriseId
* @param ids
* @return
*/
public List<TabQywxTagItem> listQywxTagItemByIds(String wxEnterpriseId, List<String> ids);
/**
* 根据企业微信的标签项获取 标签项列表
*
* @param wxEnterpriseId
* @param keys
* @return
*/
public List<TabQywxTagItem> listQywxTagItemByKeys(String wxEnterpriseId, List<String> keys);
/**
* 变更状态
*
* @param id
* @param status
*/
public void changeTagRelationStatus(String id, int status);
/**
* 根据企业微信的标签项获取 标签项
*
* @param wxEnterpriseId
* @param id
* @return
*/
public TabQywxTagItem getQywxTagItemById(String wxEnterpriseId, String id);
/**
* 更新名称
*
* @return
*/
public boolean saveQywxTagOrTagItemName(String id, String name, Integer relationType);
/**
* 更新名称
*
* @return
*/
public boolean changeRelationSyncFlagByMemberTagId(String wxEnterpriseId, String memberTagId, Integer syncFlag);
/**
* 更新状态
*
* @return
*/
public boolean changeRelationSyncFlagByTagItemId(String wxEnterpriseId, String tagItemId, Integer syncFlag);
} }
package com.gic.haoban.manage.service.service; package com.gic.haoban.manage.service.service;
import java.util.List;
import java.util.Set;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO; import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.service.entity.MemberClerkChatConfig; import com.gic.haoban.manage.service.entity.MemberClerkChatConfig;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation; import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import org.apache.ibatis.annotations.Param; import java.util.List;
import java.util.Set;
public interface StaffClerkRelationService { public interface StaffClerkRelationService {
...@@ -20,10 +17,11 @@ public interface StaffClerkRelationService { ...@@ -20,10 +17,11 @@ public interface StaffClerkRelationService {
/** /**
* 删除绑定 * 删除绑定
*
* @param clerkId * @param clerkId
* @return * @return
*/ */
public boolean delBind(String clerkId,String optStaffId,int chanelCode); boolean delBind(String clerkId, String optStaffId, int chanelCode);
/** /**
* 删除绑定 * 删除绑定
...@@ -32,7 +30,7 @@ public interface StaffClerkRelationService { ...@@ -32,7 +30,7 @@ public interface StaffClerkRelationService {
* @param storeIds * @param storeIds
* @return * @return
*/ */
public boolean delBindByStoreIds(String wxEnterpriseId, Set<String> storeIds, String optStaffId, int chanelCode); boolean delBindByStoreIds(String wxEnterpriseId, Set<String> storeIds, String optStaffId, int chanelCode);
/** /**
* 删除绑定 * 删除绑定
...@@ -42,35 +40,37 @@ public interface StaffClerkRelationService { ...@@ -42,35 +40,37 @@ public interface StaffClerkRelationService {
* @param storeIds 解除除了这些门店之外的绑定的门店 * @param storeIds 解除除了这些门店之外的绑定的门店
* @return * @return
*/ */
public boolean delBindNotInStoreIds(String wxEnterpriseId, String enterpriseId, Set<String> storeIds, String optStaffId, int chanelCode); boolean delBindNotInStoreIds(String wxEnterpriseId, String enterpriseId, Set<String> storeIds, String optStaffId, int chanelCode);
/** /**
* 绑定 * 绑定
*
* @param dto * @param dto
* @return * @return
*/ */
public String bind(StaffClerkRelationDTO dto,String optStaffId,int chanelCode); String bind(StaffClerkRelationDTO dto, String optStaffId, int chanelCode);
/** /**
* 根据clerkId 更新数据 * 根据clerkId 更新数据
* @param dto * @param dto
* @return * @return
*/ */
public boolean updateByClerkId(StaffClerkRelationDTO dto); boolean updateByClerkId(StaffClerkRelationDTO dto);
/** /**
* 查询绑定根据clerkId * 查询绑定根据clerkId
*
* @param clerkId * @param clerkId
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
public StaffClerkRelationDTO getBindByClerkId(String clerkId,String wxEnterpriseId); StaffClerkRelationDTO getBindByClerkId(String clerkId, String wxEnterpriseId);
StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId); StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId);
String insert(StaffClerkRelationDTO staffClerkRelation); String insert(StaffClerkRelationDTO staffClerkRelation);
public int cleanStaffClerk( String wxEnterpriseId, List<String> staffIds); int cleanStaffClerk(String wxEnterpriseId, List<String> staffIds);
StaffClerkRelationDTO getOneBindCodeNoStatus(String enterpriseId, String clerkCode); StaffClerkRelationDTO getOneBindCodeNoStatus(String enterpriseId, String clerkCode);
...@@ -86,15 +86,15 @@ public interface StaffClerkRelationService { ...@@ -86,15 +86,15 @@ public interface StaffClerkRelationService {
* 保存 * 保存
* @param memberClerkChatConfig * @param memberClerkChatConfig
*/ */
public void saveChatConfig(MemberClerkChatConfig memberClerkChatConfig); void saveChatConfig(MemberClerkChatConfig memberClerkChatConfig);
/** /**
*
* @param staffId * @param staffId
* @param memberId * @param memberId
* @return * @return
*/ */
public MemberClerkChatConfig getChatConfig(String staffId,String memberId); MemberClerkChatConfig getChatConfig(String staffId, String memberId);
/** /**
* 根据企业查询 * 根据企业查询
* @param wxEnterpriseId * @param wxEnterpriseId
...@@ -121,5 +121,14 @@ public interface StaffClerkRelationService { ...@@ -121,5 +121,14 @@ public interface StaffClerkRelationService {
*/ */
List<StaffClerkRelationDTO> listBindStoreIdByEnterpriseId(String enterpriseId); List<StaffClerkRelationDTO> listBindStoreIdByEnterpriseId(String enterpriseId);
/**
* 查询所有正常导购
*
* @return {@link List<StaffClerkRelationDTO> }
* @author xuwenqian
* @date 2021-07-15 16:26:17
*/
List<StaffClerkRelationDTO> listAll();
} }
...@@ -96,5 +96,13 @@ public interface StoreRangeService { ...@@ -96,5 +96,13 @@ public interface StoreRangeService {
*/ */
public List<String> listStoreIdByWxEnterpriseId(String wxEnterpriseId, String enterpriseId); public List<String> listStoreIdByWxEnterpriseId(String wxEnterpriseId, String enterpriseId);
/**
* 更新门店名称
*
* @param enterpriseId
* @param storeId
* @param storeName
*/
public void updatwStoreName(String enterpriseId, String storeId, String storeName);
} }
...@@ -3,6 +3,8 @@ package com.gic.haoban.manage.service.service; ...@@ -3,6 +3,8 @@ package com.gic.haoban.manage.service.service;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import java.util.List;
public interface WxEnterpriseService { public interface WxEnterpriseService {
String add(WxEnterpriseDTO wxDTO); String add(WxEnterpriseDTO wxDTO);
...@@ -30,4 +32,11 @@ public interface WxEnterpriseService { ...@@ -30,4 +32,11 @@ public interface WxEnterpriseService {
int unbind(String wxEnterpriseId); int unbind(String wxEnterpriseId);
TabHaobanWxEnterprise getEnterpriseBycorpIdNoStatus(String corpid); TabHaobanWxEnterprise getEnterpriseBycorpIdNoStatus(String corpid);
/**
* 所有企业微信
*
* @return
*/
List<TabHaobanWxEnterprise> listAll();
} }
...@@ -105,4 +105,9 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ ...@@ -105,4 +105,9 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ
public List<TabHaobanExternalClerkRelated> listExternalByUnionId(String enterpriseId, String unionId) { public List<TabHaobanExternalClerkRelated> listExternalByUnionId(String enterpriseId, String unionId) {
return mapper.listExternalByUnionId(enterpriseId, unionId); return mapper.listExternalByUnionId(enterpriseId, unionId);
} }
@Override
public List<TabHaobanExternalClerkRelated> listExternalByExternalUserid(String wxEnterpriseId, String externalUserid) {
return mapper.listByExternalUserId(wxEnterpriseId, externalUserid);
}
} }
...@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.impl; ...@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.impl;
import com.gic.commons.util.ToolUtil; import com.gic.commons.util.ToolUtil;
import com.gic.haoban.manage.api.dto.QywxTagInfoDTO; import com.gic.haoban.manage.api.dto.QywxTagInfoDTO;
import com.gic.haoban.manage.api.dto.QywxTagItemDTO; import com.gic.haoban.manage.api.dto.QywxTagItemDTO;
import com.gic.haoban.manage.api.enums.QywxTagRelationSyncFlagEnum;
import com.gic.haoban.manage.api.enums.QywxTagRelationTypeEnum; import com.gic.haoban.manage.api.enums.QywxTagRelationTypeEnum;
import com.gic.haoban.manage.service.dao.mapper.QywxTagItemMapper; import com.gic.haoban.manage.service.dao.mapper.QywxTagItemMapper;
import com.gic.haoban.manage.service.dao.mapper.QywxTagMapper; import com.gic.haoban.manage.service.dao.mapper.QywxTagMapper;
...@@ -11,6 +12,7 @@ import com.gic.haoban.manage.service.entity.TabQywxTag; ...@@ -11,6 +12,7 @@ import com.gic.haoban.manage.service.entity.TabQywxTag;
import com.gic.haoban.manage.service.entity.TabQywxTagItem; import com.gic.haoban.manage.service.entity.TabQywxTagItem;
import com.gic.haoban.manage.service.entity.TabQywxTagRelation; import com.gic.haoban.manage.service.entity.TabQywxTagRelation;
import com.gic.haoban.manage.service.service.QywxTagService; import com.gic.haoban.manage.service.service.QywxTagService;
import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.QywxTagDTO; import com.gic.wechat.api.dto.qywx.QywxTagDTO;
import com.gic.wechat.api.dto.qywx.QywxTagGroupDTO; import com.gic.wechat.api.dto.qywx.QywxTagGroupDTO;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
...@@ -60,6 +62,8 @@ public class QywxTagServiceImpl implements QywxTagService { ...@@ -60,6 +62,8 @@ public class QywxTagServiceImpl implements QywxTagService {
@Override @Override
public Pair<TabQywxTag, List<TabQywxTagItem>> saveQywxTagByQywxGroupKey(String wxEnterpriseId, QywxTagGroupDTO groupDTO) { public Pair<TabQywxTag, List<TabQywxTagItem>> saveQywxTagByQywxGroupKey(String wxEnterpriseId, QywxTagGroupDTO groupDTO) {
String lockKey = "group-add-" + groupDTO.getGroupId();
RedisUtil.lock(lockKey, 3L);
//判断保存 分组 //判断保存 分组
TabQywxTag qywxTag = this.getQywxTagByQywxGroupKey(wxEnterpriseId, groupDTO.getGroupId()); TabQywxTag qywxTag = this.getQywxTagByQywxGroupKey(wxEnterpriseId, groupDTO.getGroupId());
if (null == qywxTag) { if (null == qywxTag) {
...@@ -115,6 +119,7 @@ public class QywxTagServiceImpl implements QywxTagService { ...@@ -115,6 +119,7 @@ public class QywxTagServiceImpl implements QywxTagService {
} }
items.add(qywxTagItem); items.add(qywxTagItem);
} }
RedisUtil.unlock(lockKey);
return Pair.of(qywxTag, items); return Pair.of(qywxTag, items);
} }
...@@ -169,6 +174,11 @@ public class QywxTagServiceImpl implements QywxTagService { ...@@ -169,6 +174,11 @@ public class QywxTagServiceImpl implements QywxTagService {
} }
@Override @Override
public TabQywxTagRelation getQywxTagRelationByTagItemId(String wxEnterpriseId, String tagItemId) {
return qywxTagRelationMapper.getQywxTagRelationByTagItemId(wxEnterpriseId, tagItemId);
}
@Override
public List<TabQywxTagRelation> listQywxTagRelationByQywxTagId(String wxEnterpriseId, String qywxTagId) { public List<TabQywxTagRelation> listQywxTagRelationByQywxTagId(String wxEnterpriseId, String qywxTagId) {
List<TabQywxTagRelation> ret = qywxTagRelationMapper.listByQywxTagId(wxEnterpriseId, qywxTagId); List<TabQywxTagRelation> ret = qywxTagRelationMapper.listByQywxTagId(wxEnterpriseId, qywxTagId);
return ret; return ret;
...@@ -205,4 +215,68 @@ public class QywxTagServiceImpl implements QywxTagService { ...@@ -205,4 +215,68 @@ public class QywxTagServiceImpl implements QywxTagService {
return qywxTagRelationMapper.getQywxTagByQywxTagItemId(wxEnterpriseId, qywxTagItem.getQywxTagItemId()); return qywxTagRelationMapper.getQywxTagByQywxTagItemId(wxEnterpriseId, qywxTagItem.getQywxTagItemId());
} }
} }
@Override
public List<TabQywxTagItem> listQywxTagItemByIds(String wxEnterpriseId, List<String> ids) {
return qywxTagItemMapper.listByQywxTagItemsIds(wxEnterpriseId, ids);
}
@Override
public List<TabQywxTagItem> listQywxTagItemByKeys(String wxEnterpriseId, List<String> keys) {
return qywxTagItemMapper.listByQywxTagItemsKeys(wxEnterpriseId, keys);
}
@Override
public void changeTagRelationStatus(String id, int status) {
TabQywxTagRelation tabQywxTagRelation = new TabQywxTagRelation();
tabQywxTagRelation.setQywxTagRelationId(id);
tabQywxTagRelation.setStatusFlag(status);
tabQywxTagRelation.setUpdateTime(new Date());
qywxTagRelationMapper.updateByPrimaryKeySelective(tabQywxTagRelation);
}
@Override
public TabQywxTagItem getQywxTagItemById(String wxEnterpriseId, String id) {
return qywxTagItemMapper.selectByPrimaryKey(id);
}
@Override
public boolean saveQywxTagOrTagItemName(String id, String name, Integer relationType) {
if (relationType == QywxTagRelationTypeEnum.TAG_GROUP.getType()) {
TabQywxTag tabQywxTag = new TabQywxTag();
tabQywxTag.setQywxTagId(id);
tabQywxTag.setQywxGroupName(name);
tabQywxTag.setUpdateTime(new Date());
qywxTagMapper.updateByPrimaryKeySelective(tabQywxTag);
} else if (relationType == QywxTagRelationTypeEnum.TAG_ITEM.getType()) {
TabQywxTagItem tabQywxTagItem = new TabQywxTagItem();
tabQywxTagItem.setQywxTagItemId(id);
tabQywxTagItem.setQywxTagName(name);
tabQywxTagItem.setUpdateTime(new Date());
qywxTagItemMapper.updateByPrimaryKeySelective(tabQywxTagItem);
}
return true;
}
@Override
public boolean changeRelationSyncFlagByMemberTagId(String wxEnterpriseId, String memberTagId, Integer syncFlag) {
if (syncFlag == QywxTagRelationSyncFlagEnum.DEL.getType() || syncFlag == QywxTagRelationSyncFlagEnum.FAIL.getType()) {
this.closeSync(wxEnterpriseId, memberTagId);
return true;
}
qywxTagRelationMapper.changeRelationSyncFlag(wxEnterpriseId, memberTagId, syncFlag);
return true;
}
@Override
public boolean changeRelationSyncFlagByTagItemId(String wxEnterpriseId, String tagItemId, Integer syncFlag) {
TabQywxTagRelation qywxTagRelation = qywxTagRelationMapper.getQywxTagRelationByTagItemId(wxEnterpriseId, tagItemId);
if (null == qywxTagRelation) {
return true;
}
qywxTagRelation.setSyncFlag(syncFlag);
qywxTagRelation.setUpdateTime(new Date());
qywxTagRelationMapper.updateByPrimaryKeySelective(qywxTagRelation);
return true;
}
} }
package com.gic.haoban.manage.service.service.impl; package com.gic.haoban.manage.service.service.impl;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.ToolUtil; import com.gic.commons.util.ToolUtil;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse; 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.enums.BindTypeEnum; import com.gic.haoban.manage.api.enums.BindTypeEnum;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum; import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanMemberClerkChatConfigMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanMemberClerkChatConfigMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.entity.MemberClerkChatConfig; import com.gic.haoban.manage.service.entity.MemberClerkChatConfig;
import com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation; import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService; import com.gic.haoban.manage.service.service.*;
import com.gic.haoban.manage.service.service.ExternalClerkRelatedService;
import com.gic.haoban.manage.service.service.StaffClerkBindLogService;
import com.gic.haoban.manage.service.service.StaffService;
import com.gic.wechat.api.dto.qywx.QywxExternalcontactDTO;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import javafx.scene.control.Tab;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -31,14 +24,8 @@ import org.slf4j.LoggerFactory; ...@@ -31,14 +24,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.gic.api.base.commons.Page; import java.util.*;
import com.gic.commons.util.EntityUtil; import java.util.stream.Collectors;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.service.StaffClerkRelationService;
@Service @Service
public class StaffClerkRelationServiceImpl implements StaffClerkRelationService { public class StaffClerkRelationServiceImpl implements StaffClerkRelationService {
...@@ -293,4 +280,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -293,4 +280,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
} }
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class, clerkRelations); return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class, clerkRelations);
} }
@Override
public List<StaffClerkRelationDTO> listAll() {
return mapper.listAll();
}
} }
...@@ -262,4 +262,9 @@ public class StoreRangeServiceImpl implements StoreRangeService { ...@@ -262,4 +262,9 @@ public class StoreRangeServiceImpl implements StoreRangeService {
public List<String> listStoreIdByWxEnterpriseId(String wxEnterpriseId, String enterpriseId) { public List<String> listStoreIdByWxEnterpriseId(String wxEnterpriseId, String enterpriseId) {
return tabHaobanStoreRelationMapper.listStoreIdByWxEnterpriseId(wxEnterpriseId, enterpriseId); return tabHaobanStoreRelationMapper.listStoreIdByWxEnterpriseId(wxEnterpriseId, enterpriseId);
} }
@Override
public void updatwStoreName(String enterpriseId, String storeId, String storeName) {
tabHaobanStoreRelationMapper.updateStoreName(enterpriseId, storeId, storeName);
}
} }
...@@ -89,4 +89,9 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService { ...@@ -89,4 +89,9 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
return null; return null;
} }
@Override
public List<TabHaobanWxEnterprise> listAll() {
List<TabHaobanWxEnterprise> ret = mapper.listAll();
return ret;
}
} }
...@@ -173,6 +173,10 @@ public class AuditApiServiceImpl implements AuditApiService{ ...@@ -173,6 +173,10 @@ public class AuditApiServiceImpl implements AuditApiService{
String oldValue = tab.getOldValue(); String oldValue = tab.getOldValue();
String newValue = tab.getNewValue(); String newValue = tab.getNewValue();
String changeField = tab.getChangeField(); String changeField = tab.getChangeField();
StoreDTO store = storeService.getStore(storeId);
if (store != null) {
return "门店不存在";
}
this.editStoreInfo(storeId, changeField, oldValue, newValue); this.editStoreInfo(storeId, changeField, oldValue, newValue);
//发送消息 //发送消息
String title = "门店信息修改通知"; String title = "门店信息修改通知";
......
...@@ -3,13 +3,14 @@ package com.gic.haoban.manage.service.service.out.impl; ...@@ -3,13 +3,14 @@ package com.gic.haoban.manage.service.service.out.impl;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.dubbo.entity.ProviderLocalTag; import com.gic.dubbo.entity.ProviderLocalTag;
import com.gic.haoban.manage.api.dto.CheckFriendSettingDTO; import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.haoban.manage.api.dto.ExternalUserDTO; import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.enums.AlertTypeEnum;
import com.gic.haoban.manage.api.service.CheckQywxSettingApiService; import com.gic.haoban.manage.api.service.CheckQywxSettingApiService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RBucket; import org.redisson.api.RBucket;
import org.redisson.api.RMap; import org.redisson.api.RMap;
...@@ -18,9 +19,7 @@ import org.slf4j.Logger; ...@@ -18,9 +19,7 @@ import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap; import java.util.*;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static org.slf4j.LoggerFactory.getLogger; import static org.slf4j.LoggerFactory.getLogger;
...@@ -47,6 +46,9 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic ...@@ -47,6 +46,9 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic
@Autowired @Autowired
private WxEnterpriseService wxEnterpriseService; private WxEnterpriseService wxEnterpriseService;
@Autowired
private EnterpriseService enterpriseService;
@Override @Override
public void setFriendSetting(String wxEnterpriseId, String name) { public void setFriendSetting(String wxEnterpriseId, String name) {
CheckFriendSettingDTO checkFriendSettingDTO = new CheckFriendSettingDTO(); CheckFriendSettingDTO checkFriendSettingDTO = new CheckFriendSettingDTO();
...@@ -124,4 +126,68 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic ...@@ -124,4 +126,68 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic
String post = HttpUtil.post(ALERT_URL, JSONObject.toJSONString(map)); String post = HttpUtil.post(ALERT_URL, JSONObject.toJSONString(map));
logger.info("alert:{}", post); logger.info("alert:{}", post);
} }
@Override
public void alertCallback(String params) {
logger.info("告警:{}", params);
AlertMessageDTO messageDTO = JSONObject.parseObject(params, AlertMessageDTO.class);
if (null == messageDTO) {
return;
}
//告警是否拦截重复告警 防止批量触发
if (StringUtils.isNotBlank(messageDTO.getKey())) {
RBucket<Object> bucket = RedisUtil.getRedisClient().getBucket(messageDTO.getKey());
boolean b = bucket.trySet(1, 60L, TimeUnit.SECONDS);
if (!b) {
return;
}
}
Map<String, Object> dingMap = new HashMap<>();
Map<String, Object> markdownMap = new HashMap<>();
dingMap.put("msgtype", "markdown");
dingMap.put("markdown", markdownMap);
String text = "";
String dingUrl = ALERT_URL;
AlertTypeEnum anEnum = AlertTypeEnum.getEnum(messageDTO.getAlertType());
if (anEnum != null) {
markdownMap.put("title", anEnum.getName() + "-" + messageDTO.getAlertTitle());
text += "标题:" + anEnum.getName() + "-" + messageDTO.getAlertTitle() + "\n\r";
if (anEnum.getDingUrl() != null) {
dingUrl = anEnum.getDingUrl();
}
} else {
markdownMap.put("title", messageDTO.getAlertTitle());
text += "标题:" + messageDTO.getAlertTitle() + "\n\r";
}
//企业信息
if (StringUtils.isNotBlank(messageDTO.getWxEnterpriseId())) {
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(messageDTO.getWxEnterpriseId());
text += "企业:" + wxEnterpriseDTO.getCorpName() + "\n\r";
}
// 商户信息
if (StringUtils.isNotBlank(messageDTO.getEnterpriseId())) {
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(messageDTO.getEnterpriseId());
text += "商户:" + enterpriseDTO.getEnterpriseName() + "(" + enterpriseDTO.getBrandName() + ")\n\r";
}
Map<String, Object> contentMap = messageDTO.getContentMap();
if (MapUtils.isNotEmpty(contentMap)) {
Set<String> keySet = contentMap.keySet();
for (String k : keySet) {
Object o = contentMap.get(k);
text += k + ":" + o + "\n\r";
}
}
if (StringUtils.isNotBlank(messageDTO.getTraceId())) {
String traceUrl = "http://10.105.8.172:8780/damo-stats/mongodb/getLogMessagesView?trace_id=" + messageDTO.getTraceId();
text += "链路:[" + messageDTO.getTraceId() + "](" + traceUrl + ")";
}
markdownMap.put("text", text);
String post = HttpUtil.post(dingUrl, JSONObject.toJSONString(dingMap));
logger.info("alert:{}", post);
}
} }
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.app.customer.enums.GicQywxSyncTypeEnum;
import com.gic.haoban.app.customer.enums.QywxSyncTaskTypeEnum;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
...@@ -13,6 +17,8 @@ import com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper; ...@@ -13,6 +17,8 @@ import com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper;
import com.gic.haoban.manage.service.entity.MemberUnionidRelated; import com.gic.haoban.manage.service.entity.MemberUnionidRelated;
import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated; import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated;
import com.gic.haoban.manage.service.pojo.QywxTagSyncInfoPojo;
import com.gic.mq.sdk.GicMQClient;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -133,9 +139,35 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA ...@@ -133,9 +139,35 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
memberUnionidRelatedMapper.updateByPrimaryKeySelective(memberUnionidRelated); memberUnionidRelatedMapper.updateByPrimaryKeySelective(memberUnionidRelated);
resp.setResult(EntityUtil.changeEntityNew(ExternalClerkRelatedDTO.class, externalClerkRelated)); resp.setResult(EntityUtil.changeEntityNew(ExternalClerkRelatedDTO.class, externalClerkRelated));
pushTagSync(memberId, externalClerkRelated.getWxEnterpriseId(), enterpriseId);
return resp; return resp;
} }
/**
* 刷新标签信息
*
* @param memberId
* @param wxEnterpriseId
* @param enterpriseId
*/
private void pushTagSync(String memberId, String wxEnterpriseId, String enterpriseId) {
QywxTagSyncInfoPojo pojo = new QywxTagSyncInfoPojo();
pojo.setDataId(memberId);
pojo.setTaskId("-1");
pojo.setTaskType(QywxSyncTaskTypeEnum.MEMBER_SYNC.getType());
//单个会员同步
pojo.setSyncType(GicQywxSyncTypeEnum.SINGLE_WXENT_MEMNER_SYNC.getType());
pojo.setWxEnterpriseId(wxEnterpriseId);
pojo.setEnterpriseId(enterpriseId);
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
clientInstance.sendMessage("qywxTagSyncDeal", JSONObject.toJSONString(pojo));
} catch (Exception e) {
e.printStackTrace();
log.info("异常:{}", e);
}
}
@Override @Override
public ExternalClerkRelatedDTO getClerkFriendByUnionid(String enterpriseId, String clerkId, String unionid) { public ExternalClerkRelatedDTO getClerkFriendByUnionid(String enterpriseId, String clerkId, String unionid) {
TabHaobanExternalClerkRelated externalClerkRelated = tabHaobanExternalClerkRelatedMapper.getClerkExternalByUnionId(enterpriseId, clerkId, unionid); TabHaobanExternalClerkRelated externalClerkRelated = tabHaobanExternalClerkRelatedMapper.getClerkExternalByUnionId(enterpriseId, clerkId, unionid);
...@@ -163,6 +195,18 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA ...@@ -163,6 +195,18 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
} }
@Override @Override
public Page<String> pageExternalByEnterpriseId(String wxEnterpriseId, String enterpriseId, int pageNum, int pageSize) {
PageHelper.startPage(pageNum, pageSize);
List<String> memberIDs = tabHaobanExternalClerkRelatedMapper.listMemberIdByEnterpriseId(wxEnterpriseId, enterpriseId);
return PageUtil.changePageHelperToCurrentPage(new PageInfo<>(memberIDs));
}
@Override
public List<String> listExternalClerkMemberIdsByMemberIds(String wxEnterpriseId, List<String> memberIds) {
return tabHaobanExternalClerkRelatedMapper.listMemberIdsByMemberIds(memberIds, wxEnterpriseId);
}
@Override
public List<ExternalClerkRelatedShortInfoDTO> listExternalClerkByMemberIds(String wxEnterpriseId, List<String> memberIds) { public List<ExternalClerkRelatedShortInfoDTO> listExternalClerkByMemberIds(String wxEnterpriseId, List<String> memberIds) {
List<TabHaobanExternalClerkRelated> list = tabHaobanExternalClerkRelatedMapper.listByMemberIds(memberIds, wxEnterpriseId); List<TabHaobanExternalClerkRelated> list = tabHaobanExternalClerkRelatedMapper.listByMemberIds(memberIds, wxEnterpriseId);
return EntityUtil.changeEntityListNew(ExternalClerkRelatedShortInfoDTO.class, list); return EntityUtil.changeEntityListNew(ExternalClerkRelatedShortInfoDTO.class, list);
......
...@@ -22,16 +22,15 @@ import com.gic.haoban.app.customer.dto.ChildDTO; ...@@ -22,16 +22,15 @@ import com.gic.haoban.app.customer.dto.ChildDTO;
import com.gic.haoban.app.customer.dto.CustomerDTO; import com.gic.haoban.app.customer.dto.CustomerDTO;
import com.gic.haoban.app.customer.dto.FilterListDTO; import com.gic.haoban.app.customer.dto.FilterListDTO;
import com.gic.haoban.app.customer.dto.MemberInfoListParamsDTO; import com.gic.haoban.app.customer.dto.MemberInfoListParamsDTO;
import com.gic.haoban.app.customer.enums.GicQywxSyncTypeEnum;
import com.gic.haoban.app.customer.enums.QywxSyncTaskTypeEnum;
import com.gic.haoban.app.customer.service.api.service.CustomerApiService; import com.gic.haoban.app.customer.service.api.service.CustomerApiService;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.*; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.SecretTypeEnum; import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.CheckQywxSettingApiService; import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.MaterialApiService;
import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper; import com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanWelcomeMapper;
...@@ -39,6 +38,7 @@ import com.gic.haoban.manage.service.entity.*; ...@@ -39,6 +38,7 @@ import com.gic.haoban.manage.service.entity.*;
import com.gic.haoban.manage.service.exception.WxApiLimitException; import com.gic.haoban.manage.service.exception.WxApiLimitException;
import com.gic.haoban.manage.service.pojo.DealQywxExternalUserPojo; import com.gic.haoban.manage.service.pojo.DealQywxExternalUserPojo;
import com.gic.haoban.manage.service.pojo.ExternalUserPojo; import com.gic.haoban.manage.service.pojo.ExternalUserPojo;
import com.gic.haoban.manage.service.pojo.QywxTagSyncInfoPojo;
import com.gic.haoban.manage.service.service.*; import com.gic.haoban.manage.service.service.*;
import com.gic.haoban.manage.service.util.EmojiFilterUtil; import com.gic.haoban.manage.service.util.EmojiFilterUtil;
import com.gic.member.api.dto.MemberDTO; import com.gic.member.api.dto.MemberDTO;
...@@ -138,6 +138,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -138,6 +138,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
@Autowired @Autowired
private CustomerApiService customerApiService; private CustomerApiService customerApiService;
@Autowired
private QywxTagApiService qywxTagApiService;
@Override @Override
public void dealQywxExternalUser(String params) { public void dealQywxExternalUser(String params) {
log.info("回调:{}", params); log.info("回调:{}", params);
...@@ -146,12 +149,14 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -146,12 +149,14 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
this.delMemberUnionidRelatedProcess(externalUserPojo.getData()); this.delMemberUnionidRelatedProcess(externalUserPojo.getData());
} else if (externalUserPojo.getType() == DealQywxExternalUserPojo.DealType.add.getType()) { } else if (externalUserPojo.getType() == DealQywxExternalUserPojo.DealType.add.getType()) {
this.addMemberUnionidRelatedNew(externalUserPojo.getData()); this.addMemberUnionidRelatedNew(externalUserPojo.getData());
} else if (externalUserPojo.getType() == DealQywxExternalUserPojo.DealType.edit.getType()) {
this.editMemberUnionidRelatedProcess(externalUserPojo.getData());
} }
} }
@Override @Override
public List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId) { public List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId, String storeId) {
List<TabHaobanExternalClerkRelated> list = externalClerkRelatedService.listByExTernalUseridAndWxUserId(externalUserid, wxUserId); List<TabHaobanExternalClerkRelated> list = externalClerkRelatedService.listByExTernalUseridAndWxUserId(externalUserid, wxUserId);
List<MemberStoreDTO> result = new ArrayList<>(); List<MemberStoreDTO> result = new ArrayList<>();
if (CollectionUtil.isEmpty(list)) { if (CollectionUtil.isEmpty(list)) {
...@@ -168,23 +173,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -168,23 +173,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
log.info("staff关联门店不存在1"); log.info("staff关联门店不存在1");
return null; return null;
} }
// Map<String, StaffClerkRelationDTO> storeMap = clerkRelationDTOS.stream().collect(Collectors.toMap(mid -> mid.getStoreId(), dto -> dto, (o, n) -> n));
// //1、查该staff的门店id
// List<TabHaobanStaffDepartmentRelated> relatedIds = staffDepartmentRelatedService.listByWxUserId(wxUserId);
// if(CollectionUtil.isEmpty(relatedIds)){
// log.info("staff关联部门不存在1");
// return null;
// }
// List<String> departmentIds = relatedIds.stream().map(s->s.getDepartmentId()).collect(Collectors.toList());
// if(CollectionUtil.isEmpty(departmentIds)){
// log.info("staff部门不存在1");
// return null;
// }
// List<DepartmentDTO> stores = departmentApiService.listByDepartmentIds(departmentIds, 1);
// if(CollectionUtil.isEmpty(stores)){
// log.info("staff关联门店不存在1");
// return null;
// }
List<String> storeIds = clerkRelationDTOS.stream().filter(s -> (s.getStoreId() != null || "".equals(s.getStoreId()))).map(s -> s.getStoreId()).collect(Collectors.toList()); List<String> storeIds = clerkRelationDTOS.stream().filter(s -> (s.getStoreId() != null || "".equals(s.getStoreId()))).map(s -> s.getStoreId()).collect(Collectors.toList());
if (CollectionUtil.isEmpty(storeIds)) { if (CollectionUtil.isEmpty(storeIds)) {
log.info("staff关联门店不存在2"); log.info("staff关联门店不存在2");
...@@ -192,6 +180,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -192,6 +180,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
} }
//2、获取member的storeId //2、获取member的storeId
for (TabHaobanExternalClerkRelated tab : list) { for (TabHaobanExternalClerkRelated tab : list) {
if (StringUtils.isNotBlank(storeId) && (!storeId.equals(tab.getStoreId()))) {
continue;
}
String memberId = tab.getMemberId(); String memberId = tab.getMemberId();
if (StringUtils.isEmpty(memberId)) { if (StringUtils.isEmpty(memberId)) {
continue; continue;
...@@ -539,8 +530,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -539,8 +530,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
exsitDTO.setStatusFlag(1); exsitDTO.setStatusFlag(1);
externalClerkRelatedService.update(exsitDTO); externalClerkRelatedService.update(exsitDTO);
} }
sendWelcome(dto, staffClerkRelationDTO, false); sendWelcome(dto, staffClerkRelationDTO, false);
//同步好友标签
pushTagSync(member.getMemberId(), wxEnterpriseId, staffClerkRelationDTO.getEnterpriseId());
} }
} }
...@@ -996,8 +988,20 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -996,8 +988,20 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
* @param dto * @param dto
*/ */
private void editMemberUnionidRelatedProcess(MemberUnionidRelatedDTO dto) { private void editMemberUnionidRelatedProcess(MemberUnionidRelatedDTO dto) {
//todo 修改主要是修改标签 同步所有标签
log.info("修改标签/会员信息回调:{}", JSONObject.toJSONString(dto)); log.info("修改标签/会员信息回调:{}", JSONObject.toJSONString(dto));
TabHaobanWxEnterprise wxEnterprise = wxEnterpriseService.getEnterpriseBycorpId(dto.getCorpid());
if (null == wxEnterprise) {
return;
}
if (dto.getSuiteid().equals(SELF_APP)) {
log.info("self不执行");
return;
}
pushTagSync(dto.getExternalUserid(), dto.getWxUserId()
, GicQywxSyncTypeEnum.FRIEND_TAG_SYNC.getType(), QywxSyncTaskTypeEnum.MEMBER_SYNC.getType(), wxEnterprise.getWxEnterpriseId(), null);
// qywxTagApiService.syncQywxTagToGicByExternalUserId(wxEnterprise.getWxEnterpriseId(), dto.getExternalUserid(), dto.getWxUserId());
} }
@Override @Override
...@@ -1561,9 +1565,47 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -1561,9 +1565,47 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
external.setStatusFlag(1); external.setStatusFlag(1);
externalClerkRelatedService.update(external); externalClerkRelatedService.update(external);
} }
//同步标签
pushTagSync(memberId, wxEnterpriseId, enterpriseId);
return ""; return "";
} }
/**
* 同步
*
* @param wxEnterpriseId
* @param enterpriseId
*/
private void pushTagSync(String dataId, String taskId, int syncType, int taskType, String wxEnterpriseId, String enterpriseId) {
QywxTagSyncInfoPojo pojo = new QywxTagSyncInfoPojo();
pojo.setDataId(dataId);
pojo.setTaskId(taskId);
pojo.setTaskType(taskType);
//单个会员同步
pojo.setSyncType(syncType);
pojo.setWxEnterpriseId(wxEnterpriseId);
pojo.setEnterpriseId(enterpriseId);
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
clientInstance.sendMessage("qywxTagSyncDeal", JSONObject.toJSONString(pojo));
} catch (Exception e) {
e.printStackTrace();
log.info("异常:{}", e);
}
}
/**
* 同步
*
* @param memberId
* @param wxEnterpriseId
* @param enterpriseId
*/
private void pushTagSync(String memberId, String wxEnterpriseId, String enterpriseId) {
this.pushTagSync(memberId, "-1", GicQywxSyncTypeEnum.SINGLE_WXENT_MEMNER_SYNC.getType(), QywxSyncTaskTypeEnum.MEMBER_SYNC.getType(), wxEnterpriseId,enterpriseId);
}
@Override @Override
public String addFriendExternal(ExternalUserDTO dto) { public String addFriendExternal(ExternalUserDTO dto) {
String wxUserId = dto.getWxUserId(); String wxUserId = dto.getWxUserId();
......
...@@ -1314,7 +1314,6 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1314,7 +1314,6 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
@Override @Override
@RedisCache(value = "qrcode-${clerkCode}-${storeId}", timeOut = 1, timeunit = TimeUnit.DAYS)
public ServiceResponse<String> getStaffQrcode(String clerkCode, String storeId) { public ServiceResponse<String> getStaffQrcode(String clerkCode, String storeId) {
ServiceResponse<String> resp = new ServiceResponse<>(); ServiceResponse<String> resp = new ServiceResponse<>();
List<String> clerkCodes=new ArrayList<>(); List<String> clerkCodes=new ArrayList<>();
...@@ -1331,7 +1330,12 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1331,7 +1330,12 @@ public class StaffApiServiceImpl implements StaffApiService {
logger.info("成员没有关联:{}",clerkCode); logger.info("成员没有关联:{}",clerkCode);
return null; return null;
} }
String key = "qrcode-" + relationDTO.getStaffId();
Object url = RedisUtil.getCache(key);
if (null != url) {
resp.setResult((String) url);
return resp;
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(relationDTO.getWxEnterpriseId()); WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(relationDTO.getWxEnterpriseId());
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseDTO.getWxEnterpriseId(), SecretTypeEnum.HAOBAN_HELP.getVal()); SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseDTO.getWxEnterpriseId(), SecretTypeEnum.HAOBAN_HELP.getVal());
if (null == secretSetting||secretSetting.getCheckFlag()==0) { if (null == secretSetting||secretSetting.getCheckFlag()==0) {
...@@ -1340,6 +1344,7 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1340,6 +1344,7 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
UserDTO user = qywxUserApiService.getSelfWorkWxUser(wxEnterpriseDTO.getCorpid(), secretSetting.getSecretVal(), relationDTO.getWxUserId()); UserDTO user = qywxUserApiService.getSelfWorkWxUser(wxEnterpriseDTO.getCorpid(), secretSetting.getSecretVal(), relationDTO.getWxUserId());
if (user != null) { if (user != null) {
RedisUtil.setCache(key, user.getQr_code(), 2L, TimeUnit.DAYS);
resp.setResult(user.getQr_code()); resp.setResult(user.getQr_code());
return resp; return resp;
} }
......
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import java.net.URLEncoder;
import java.util.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.utils.URLEncodedUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.clerk.api.dto.ClerkDTO; import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.api.dto.MessageDTO;
import com.gic.haoban.manage.api.dto.ApplicationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO; import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.enums.AppPageType; import com.gic.haoban.manage.api.enums.AppPageType;
import com.gic.haoban.manage.api.service.ApplicationApiService;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService; import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper; import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper; import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper; import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper;
import com.gic.haoban.manage.service.entity.TabHaobanApplication;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation; import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated; import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
import com.gic.haoban.manage.service.service.ApplicationService;
import com.gic.haoban.manage.service.service.DepartmentService; import com.gic.haoban.manage.service.service.DepartmentService;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService; import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.wechat.api.dto.qywx.ItemDTO; import com.gic.wechat.api.dto.qywx.ItemDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO; import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
@Service @Service
public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRelatedApiService { public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRelatedApiService {
private static Logger logger= LoggerFactory.getLogger(StaffDepartmentRelatedApiServiceImpl.class); private static Logger logger= LoggerFactory.getLogger(StaffDepartmentRelatedApiServiceImpl.class);
...@@ -455,15 +445,20 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -455,15 +445,20 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
String baseUrl = "/pages/route/index"; String baseUrl = "/pages/route/index";
String addurl = AppPageType.getDescByCode(type); String addurl = AppPageType.getDescByCode(type);
String url = ""; String url = "";
if(type == AppPageType.INDEX.getCode()){ if (type == AppPageType.INDEX.getCode()) {
//工作台 //工作台
url = baseUrl+"?pageType="+addurl; url = baseUrl + "?pageType=" + addurl;
}else{ } else {
url = baseUrl+"?pageType="+addurl; url = baseUrl + "?pageType=" + addurl;
} }
url = url+"&data="; url = url + "&data=";
String encodeData = URLEncoder.encode(data); String encodeData = null;
url = url+encodeData; try {
encodeData = URLEncoder.encode(data, StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
logger.error(e.getMessage());
}
url = url + encodeData;
return url; return url;
} }
......
...@@ -207,6 +207,10 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor ...@@ -207,6 +207,10 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
&& recordType.equals(GicRecordType.UPDATE) && recordType.equals(GicRecordType.UPDATE)
&& !mid.containsKey("oldStoreGroupId")) { && !mid.containsKey("oldStoreGroupId")) {
mid.put("oldStoreGroupId", gicField.getValue()); mid.put("oldStoreGroupId", gicField.getValue());
} else if (gicField.getName().equals("store_name")
&& recordType.equals(GicRecordType.UPDATE)
&& !mid.containsKey("oldStoreName")) {
mid.put("oldStoreName", gicField.getValue());
}else { }else {
mid.put(gicField.getName(), gicField.getValue()); mid.put(gicField.getName(), gicField.getValue());
} }
...@@ -223,6 +227,13 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor ...@@ -223,6 +227,13 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
* @param syncPojo * @param syncPojo
*/ */
private void dealStore(StoreSyncPojo syncPojo) { private void dealStore(StoreSyncPojo syncPojo) {
if (syncPojo.getRecordType() == GicRecordType.UPDATE.value()
&& (!syncPojo.getStoreName().equals(syncPojo.getOldStoreName()))) {
logger.info("门店名称变更:{}", JSONObject.toJSONString(syncPojo));
storeRangeService.updatwStoreName(syncPojo.getEnterpriseId(), syncPojo.getStoreId(), syncPojo.getStoreName());
}
//门店状态变更 包括删除 //门店状态变更 包括删除
if (syncPojo.getRecordType() == GicRecordType.UPDATE.value() if (syncPojo.getRecordType() == GicRecordType.UPDATE.value()
&& (!syncPojo.getStatus().equals(syncPojo.getOldStatus()))) { && (!syncPojo.getStatus().equals(syncPojo.getOldStatus()))) {
......
...@@ -26,14 +26,15 @@ import com.gic.member.api.dto.MemberDTO; ...@@ -26,14 +26,15 @@ import com.gic.member.api.dto.MemberDTO;
import com.gic.member.api.service.MemberOpenCardBusinessService; import com.gic.member.api.service.MemberOpenCardBusinessService;
import com.gic.mq.sdk.GicMQClient; import com.gic.mq.sdk.GicMQClient;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -217,7 +218,7 @@ public class FriendSyncNewOperation implements BaseSyncOperation { ...@@ -217,7 +218,7 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
return "导购码不存在:" + clerkCode; return "导购码不存在:" + clerkCode;
} }
MemberDTO member = null; MemberDTO member = null;
if (clerk != null && StringUtils.isNotBlank(qrcodeParam) && StringUtils.isNotBlank(externalUserDTO.getUnionId())) { if (StringUtils.isNotBlank(qrcodeParam) && StringUtils.isNotBlank(externalUserDTO.getUnionId())) {
member = memberOpenCardBusinessService.getMemberByQywxChannelParam(staffClerkRelationDTO.getEnterpriseId(), member = memberOpenCardBusinessService.getMemberByQywxChannelParam(staffClerkRelationDTO.getEnterpriseId(),
externalUserDTO.getUnionId(), "", externalUserDTO.getName(), externalUserDTO.getAvatar(), qrcodeParam); externalUserDTO.getUnionId(), "", externalUserDTO.getName(), externalUserDTO.getAvatar(), qrcodeParam);
} }
......
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
<dubbo:service interface="com.gic.haoban.manage.api.service.StaffClerkRelationApiService" ref="staffClerkRelationApiServiceImpl" timeout="10000"/> <dubbo:service interface="com.gic.haoban.manage.api.service.StaffClerkRelationApiService" ref="staffClerkRelationApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.DealSyncOperationApiService" <dubbo:service interface="com.gic.haoban.manage.api.service.DealSyncOperationApiService"
ref="dealSyncOperationApiServiceImpl" timeout="10000"/> ref="dealSyncOperationApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.CheckQywxSettingApiService"
ref="checkQywxSettingApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.HandoverOperationApiService" <dubbo:service interface="com.gic.haoban.manage.api.service.HandoverOperationApiService"
ref="handoverOperationApiServiceImpl" timeout="10000"/> ref="handoverOperationApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.QywxTagApiService" ref="qywxTagApiServiceImpl" <dubbo:service interface="com.gic.haoban.manage.api.service.QywxTagApiService" ref="qywxTagApiServiceImpl"
...@@ -80,11 +81,16 @@ ...@@ -80,11 +81,16 @@
interface="com.gic.haoban.app.customer.service.api.service.CustomerApiService" timeout="10000" interface="com.gic.haoban.app.customer.service.api.service.CustomerApiService" timeout="10000"
retries="0" check="false"/> retries="0" check="false"/>
<dubbo:reference id="qywxTagSyncApiService"
interface="com.gic.haoban.app.customer.service.api.service.QywxTagSyncApiService" timeout="10000"
retries="0" check="false"/>
<dubbo:reference id="enterpriseService" interface="com.gic.enterprise.api.service.EnterpriseService" timeout="10000" retries="0" check="false" /> <dubbo:reference id="enterpriseService" interface="com.gic.enterprise.api.service.EnterpriseService" timeout="10000" retries="0" check="false" />
<dubbo:reference interface="com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi" id="syncHaobanToGicServiceApi"/> <dubbo:reference interface="com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi" id="syncHaobanToGicServiceApi"/>
<dubbo:reference interface="com.gic.member.api.service.MemberTagService" id="memberTagService"/> <dubbo:reference interface="com.gic.member.api.service.MemberTagService" id="memberTagService"/>
<dubbo:reference interface="com.gic.member.tag.api.service.MemberTagApiService" id="memberTagApiService"/> <dubbo:reference interface="com.gic.member.tag.api.service.MemberTagApiService" id="memberTagApiService"/>
<dubbo:reference interface="com.gic.member.tag.api.service.MemberTagItemApiService" id="memberTagItemApiService"/>
<dubbo:reference interface="com.gic.clerk.api.service.PowerService" id="powerService"/> <dubbo:reference interface="com.gic.clerk.api.service.PowerService" id="powerService"/>
<dubbo:reference interface="com.gic.enterprise.api.service.AuthorizeService" id="authorizeService"/> <dubbo:reference interface="com.gic.enterprise.api.service.AuthorizeService" id="authorizeService"/>
......
...@@ -187,4 +187,28 @@ ...@@ -187,4 +187,28 @@
and status_flag=1 and status_flag=1
and wx_enterprise_id=#{wxEnterpriseId} and wx_enterprise_id=#{wxEnterpriseId}
</select> </select>
<select id="listByQywxTagItemsIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_qywx_tag_item
where qywx_tag_item_id in
<foreach collection="ids" open="(" close=")" separator="," item="item">
#{item}
</foreach>
and status_flag=1
and wx_enterprise_id=#{wxEnterpriseId}
</select>
<select id="listByQywxTagItemsKeys" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_qywx_tag_item
where qywx_tag_key in
<foreach collection="qywxTagKeys" open="(" close=")" separator="," item="item">
#{item}
</foreach>
and status_flag=1
and wx_enterprise_id=#{wxEnterpriseId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -192,7 +192,6 @@ ...@@ -192,7 +192,6 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_qywx_tag_relation from tab_haoban_qywx_tag_relation
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and sync_flag=1
and status_flag=1 and status_flag=1
</select> </select>
...@@ -200,11 +199,23 @@ ...@@ -200,11 +199,23 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_qywx_tag_relation from tab_haoban_qywx_tag_relation
where
member_tag_id = #{memberTagId,jdbcType=VARCHAR}
<if test="wxEnterpriseId!=null">
and wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
</if>
and status_flag=1
</select>
<select id="getQywxTagRelationByTagItemId" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_qywx_tag_relation
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and member_tag_id = #{memberTagId,jdbcType=VARCHAR} and tag_item_id = #{tagItemId,jdbcType=VARCHAR}
and status_flag=1 and status_flag=1
and sync_flag=1
</select> </select>
<update id="delByMemberTagId"> <update id="delByMemberTagId">
update tab_haoban_qywx_tag_relation update tab_haoban_qywx_tag_relation
set set
...@@ -222,7 +233,6 @@ ...@@ -222,7 +233,6 @@
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and qywx_tag_id = #{qywxTagId,jdbcType=VARCHAR} and qywx_tag_id = #{qywxTagId,jdbcType=VARCHAR}
and status_flag=1 and status_flag=1
and sync_flag=1
</select> </select>
<select id="getQywxGroupByQywxTagId" resultMap="BaseResultMap"> <select id="getQywxGroupByQywxTagId" resultMap="BaseResultMap">
...@@ -233,7 +243,6 @@ ...@@ -233,7 +243,6 @@
and qywx_tag_id = #{qywxTagId,jdbcType=VARCHAR} and qywx_tag_id = #{qywxTagId,jdbcType=VARCHAR}
and relation_type=0 and relation_type=0
and status_flag=1 and status_flag=1
and sync_flag=1
</select> </select>
<select id="getQywxTagByQywxTagItemId" resultMap="BaseResultMap"> <select id="getQywxTagByQywxTagItemId" resultMap="BaseResultMap">
...@@ -241,9 +250,19 @@ ...@@ -241,9 +250,19 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_qywx_tag_relation from tab_haoban_qywx_tag_relation
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and qywx_tag_item_id = #{qywxTagId,jdbcType=VARCHAR} and qywx_tag_item_id = #{qywxTagItemId,jdbcType=VARCHAR}
and relation_type=1 and relation_type=1
and status_flag=1 and status_flag=1
and sync_flag=1
</select> </select>
<update id="changeRelationSyncFlag">
UPDATE tab_haoban_qywx_tag_relation
SET
sync_flag=#{syncFlag},
update_time=now()
where
wx_enterprise_id = #{wxEnterpriseId}
and member_tag_id = #{memberTagId,jdbcType=VARCHAR}
and status_flag=1
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -528,6 +528,7 @@ ...@@ -528,6 +528,7 @@
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and enterprise_id=#{enterpriseId} and enterprise_id=#{enterpriseId}
and status_flag in(1,3,4) and status_flag in(1,3,4)
order by create_time
</select> </select>
<select id="listByMemberIds" resultMap="BaseResultMap"> <select id="listByMemberIds" resultMap="BaseResultMap">
...@@ -543,6 +544,18 @@ ...@@ -543,6 +544,18 @@
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="listMemberIdsByMemberIds" resultType="String">
select
member_id
from tab_haoban_external_clerk_related
where wx_enterprise_id = #{wxEnterpriseId}
and member_id in
<foreach collection="memberIds" open="(" separator="," close=")" item="item">
#{item}
</foreach>
and status_flag = 1
</select>
<select id="listByMemberId" resultMap="BaseResultMap"> <select id="listByMemberId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
...@@ -550,4 +563,13 @@ ...@@ -550,4 +563,13 @@
where member_id = #{memberId} where member_id = #{memberId}
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="listByExternalUserId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_external_clerk_related
where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
and external_user_id = #{externalUserId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -233,12 +233,11 @@ ...@@ -233,12 +233,11 @@
<update id="delByStoreIdAndCode" > <update id="delByStoreIdAndCode" >
update tab_haoban_staff_clerk_relation update tab_haoban_staff_clerk_relation
set set status_flag = 0,
status_flag = 0,
update_time = now() update_time = now()
where clerk_code = #{clerkCode,jdbcType=VARCHAR} where clerk_code = #{clerkCode,jdbcType=VARCHAR}
and store_id = #{storeId,jdbcType=VARCHAR} and store_id = #{storeId,jdbcType=VARCHAR}
and status_flag =1 and status_flag = 1
</update> </update>
<select id="listByClerkIds" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="listByClerkIds" resultMap="BaseResultMap" parameterType="java.lang.String" >
...@@ -426,13 +425,24 @@ ...@@ -426,13 +425,24 @@
</update> </update>
<select id="listBindStoreIdByEnterpriseId" resultMap="BaseResultMap"> <select id="listBindStoreIdByEnterpriseId" resultMap="BaseResultMap">
select select store_id,
store_id,
wx_enterprise_id wx_enterprise_id
from tab_haoban_staff_clerk_relation from tab_haoban_staff_clerk_relation
where where enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} and status_flag = 1
and status_flag =1
group by store_id group by store_id
</select> </select>
<select id="listAll" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
SELECT a.store_id storeId,
a.wx_enterprise_id wxEnterpriseId,
a.wx_user_id wxUserId,
a.staff_id staffId,
a.clerk_id clerkId,
b.staff_name staffName
FROM tab_haoban_staff_clerk_relation a
LEFT JOIN tab_haoban_staff b ON b.staff_id = a.staff_id
WHERE a.status_flag = 1
GROUP BY a.staff_id
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -208,4 +208,14 @@ ...@@ -208,4 +208,14 @@
</foreach> </foreach>
and status_flag=1 and status_flag=1
</update> </update>
<update id="updateStoreName">
update tab_haoban_store_relation
set
store_name = #{storeName},
update_time = now()
where enterprise_id=#{enterpriseId}
and store_id=#{storeId}
and status_flag=1
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -12,7 +12,10 @@ import com.gic.haoban.manage.api.service.StaffClerkRelationApiService; ...@@ -12,7 +12,10 @@ import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.service.service.StaffService; import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.TestService; import com.gic.haoban.manage.service.service.TestService;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.DepartmentDTO;
import com.gic.wechat.api.dto.qywx.QywxExternalcontactDTO; import com.gic.wechat.api.dto.qywx.QywxExternalcontactDTO;
import com.gic.wechat.api.dto.qywx.UserDTO;
import com.gic.wechat.api.service.qywx.QywxDepartmentApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -51,6 +54,9 @@ public class DealSyncTest { ...@@ -51,6 +54,9 @@ public class DealSyncTest {
private QywxUserApiService qywxUserApiService; private QywxUserApiService qywxUserApiService;
@Autowired @Autowired
private QywxDepartmentApiService qywxDepartmentApiService;
@Autowired
private TestService testService; private TestService testService;
@Autowired @Autowired
...@@ -94,4 +100,17 @@ public class DealSyncTest { ...@@ -94,4 +100,17 @@ public class DealSyncTest {
// countDownLatch.countDown(); // countDownLatch.countDown();
} }
@Test
public void test3() {
List<DepartmentDTO> department = qywxDepartmentApiService.listSelfDepartment("wweac4ef962720aa12", "GFu4FwkfcGFPue-qinB7ThEU4wR2SadbBH1yT5sLDzs", null);
System.out.println(JSONObject.toJSONString(department));
}
@Test
public void test4() {
UserDTO workWxUser = qywxUserApiService.getSelfWorkWxUser("wweac4ef962720aa12", "GFu4FwkfcGFPue-qinB7ThEU4wR2SadbBH1yT5sLDzs", "WuXiangHong");
System.out.println(JSONObject.toJSONString(workWxUser));
}
} }
...@@ -2,7 +2,10 @@ import com.alibaba.fastjson.JSONObject; ...@@ -2,7 +2,10 @@ import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.commons.util.GICMQClientUtil; import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.AlertMessageDTO;
import com.gic.haoban.manage.api.dto.HandoverExternalDTO; import com.gic.haoban.manage.api.dto.HandoverExternalDTO;
import com.gic.haoban.manage.api.enums.AlertTypeEnum;
import com.gic.haoban.manage.api.service.CheckQywxSettingApiService;
import com.gic.haoban.manage.api.service.HandoverOperationApiService; import com.gic.haoban.manage.api.service.HandoverOperationApiService;
import com.gic.haoban.manage.api.service.QywxTagApiService; import com.gic.haoban.manage.api.service.QywxTagApiService;
import com.gic.mq.sdk.GicMQClient; import com.gic.mq.sdk.GicMQClient;
...@@ -15,7 +18,9 @@ import org.springframework.test.context.ContextConfiguration; ...@@ -15,7 +18,9 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext-conf.xml"}) @ContextConfiguration(locations = {"classpath:applicationContext-conf.xml"})
...@@ -26,6 +31,9 @@ public class QywxTagTest { ...@@ -26,6 +31,9 @@ public class QywxTagTest {
@Autowired @Autowired
private QywxTagApiService qywxTagApiService; private QywxTagApiService qywxTagApiService;
@Autowired
private CheckQywxSettingApiService checkQywxSettingApiService;
@Test @Test
public void test() { public void test() {
...@@ -33,4 +41,24 @@ public class QywxTagTest { ...@@ -33,4 +41,24 @@ public class QywxTagTest {
qywxTagApiService.pullQywxTag(wxEnterpriseId); qywxTagApiService.pullQywxTag(wxEnterpriseId);
} }
@Test
public void test2() {
AlertMessageDTO messageDTO = new AlertMessageDTO();
messageDTO.setTraceId("111");
messageDTO.setEnterpriseId("");
messageDTO.setWxEnterpriseId("ca66a01b79474c40b3e7c7f93daf1a3b");
messageDTO.setAlertTitle("测试标题");
messageDTO.setAlertType(AlertTypeEnum.QYWX_TAG_SYNC.getType());
Map<String, Object> map = new HashMap<>();
map.put("测试", "test");
messageDTO.setContentMap(map);
checkQywxSettingApiService.alertCallback(JSONObject.toJSONString(messageDTO));
}
@Test
public void test3() {
qywxTagApiService.checkQywxSync("-1");
}
} }
...@@ -130,15 +130,14 @@ public class ClerkController extends WebBaseController{ ...@@ -130,15 +130,14 @@ public class ClerkController extends WebBaseController{
if(StringUtils.isNotBlank(oldClerkCode)){ if(StringUtils.isNotBlank(oldClerkCode)){
//发送消息 //发送消息
ClerkDTO leader = clerkService.getClerkLeaderByStoreId(storeId); ClerkDTO leader = clerkService.getClerkLeaderByStoreId(storeId);
if(leader == null){ if (leader == null) {
leader = new ClerkDTO(); leader = new ClerkDTO();
} }
String clerkId = leader.getClerkId(); String clerkId = leader.getClerkId();
String storeName = departmentDTO.getDepartmentName(); String storeName = departmentDTO.getDepartmentName();
String staffName = staffDTO.getStaffName(); String staffName = staffDTO.getStaffName();
String leaderName = leader.getClerkName(); String leaderName = leader.getClerkName();
String clerkCode = oldClerkCode; String content = "【" + leaderName + "】:【" + storeName + "】" + staffName + "导购code:" + oldClerkCode + "已解绑,请重新分配会员!";
String content = "【"+leaderName+"】:【"+storeName+"】"+staffName+"导购code:"+clerkCode+"已解绑,请重新分配会员!";
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", storeId); jsonObject.put("storeId", storeId);
String data = jsonObject.toJSONString(); String data = jsonObject.toJSONString();
......
...@@ -52,6 +52,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -52,6 +52,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@RestController @RestController
public class StaffController extends WebBaseController{ public class StaffController extends WebBaseController{
private static Logger logger = LoggerFactory.getLogger(StaffController.class); private static Logger logger = LoggerFactory.getLogger(StaffController.class);
...@@ -135,7 +136,7 @@ public class StaffController extends WebBaseController{ ...@@ -135,7 +136,7 @@ public class StaffController extends WebBaseController{
List<String> departmentIds = sonDepartmentList.stream().map(DepartmentDTO::getDepartmentId).collect(Collectors.toList()); List<String> departmentIds = sonDepartmentList.stream().map(DepartmentDTO::getDepartmentId).collect(Collectors.toList());
Page<StaffDTO> page = staffApiService.pageStaff(departmentIds,activeFlag,keyWord,pageInfo); Page<StaffDTO> page = staffApiService.pageStaff(departmentIds,activeFlag,keyWord,pageInfo);
List<StaffDTO> list = page.getResult(); List<StaffDTO> list = page.getResult();
logger.info("pages={},totalPage={}",page.getCurrentPage(),page.getTotalPage());
PageResult<StaffDTO> pageVo = new PageResult<>(); PageResult<StaffDTO> pageVo = new PageResult<>();
pageVo.setList(list); pageVo.setList(list);
pageVo.setPageNum(page.getCurrentPage()); pageVo.setPageNum(page.getCurrentPage());
...@@ -245,6 +246,7 @@ public class StaffController extends WebBaseController{ ...@@ -245,6 +246,7 @@ public class StaffController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
@RequestMapping("get-clerk-info") @RequestMapping("get-clerk-info")
public HaobanResponse getClerkInfo(String clerkId){ public HaobanResponse getClerkInfo(String clerkId){
StaffVO staffVO = new StaffVO(); StaffVO staffVO = new StaffVO();
...@@ -262,7 +264,6 @@ public class StaffController extends WebBaseController{ ...@@ -262,7 +264,6 @@ public class StaffController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1,staffVO); return resultResponse(HaoBanErrCode.ERR_1,staffVO);
} }
@RequestMapping("get-staff-info") @RequestMapping("get-staff-info")
public HaobanResponse getStaffInfo(String staffId){ public HaobanResponse getStaffInfo(String staffId){
StaffVO staffVO = new StaffVO(); StaffVO staffVO = new StaffVO();
......
...@@ -155,6 +155,21 @@ public class ClerkController extends WebBaseController{ ...@@ -155,6 +155,21 @@ public class ClerkController extends WebBaseController{
} }
//门店成员列表
@RequestMapping("/clerk-edit-flag")
public HaobanResponse clerkEditFlag(String wxEnterpriseId, String storeId) {
if (StringUtils.isAnyBlank(storeId)) {
return resultResponse(HaoBanErrCode.ERR_2);
}
StoreDTO storeDTO = storeService.getStore(storeId);
if (storeDTO == null) {
return resultResponse(HaoBanErrCode.ERR_10009);
}
WxEnterpriseRelationDetailDTO enterpriseBindInfo = wxEnterpriseRelatedApiService.getEnterpriseBindInfo(wxEnterpriseId, storeDTO.getEnterpriseId());
return resultResponse(HaoBanErrCode.ERR_1, enterpriseBindInfo.getClerkEditFlag());
}
//获取后台认证配置 //获取后台认证配置
@RequestMapping("/get-audit-setting") @RequestMapping("/get-audit-setting")
...@@ -452,7 +467,7 @@ public class ClerkController extends WebBaseController{ ...@@ -452,7 +467,7 @@ public class ClerkController extends WebBaseController{
RedisUtil.setCache(key, true, 31 * 24 * 60 * 60L); RedisUtil.setCache(key, true, 31 * 24 * 60 * 60L);
clerkMainStoreRelatedApiService.setMainStore(staffId,storeId,wxEnterpriseId); clerkMainStoreRelatedApiService.setMainStore(staffId,storeId,wxEnterpriseId);
}else{ }else{
return resultResponse(HaoBanErrCode.ERR_10007); return resultResponse(HaoBanErrCode.ERR_10031);
} }
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
...@@ -505,11 +520,29 @@ public class ClerkController extends WebBaseController{ ...@@ -505,11 +520,29 @@ public class ClerkController extends WebBaseController{
*/ */
@HttpLimit @HttpLimit
@RequestMapping("/check-fresh-friend") @RequestMapping("/check-fresh-friend")
public HaobanResponse checkFreshFriend(String staffId, String storeId, String wxEnterpriseId) { public HaobanResponse checkFreshFriend(String staffId, String storeId, String wxEnterpriseId, String version) {
boolean freshFriendSyncTask = dealSyncOperationApiService.getFreshFriendSyncTask(wxEnterpriseId, staffId); boolean freshFriendSyncTask = dealSyncOperationApiService.getFreshFriendSyncTask(wxEnterpriseId, staffId);
return resultResponse(HaoBanErrCode.ERR_1, freshFriendSyncTask); return resultResponse(HaoBanErrCode.ERR_1, freshFriendSyncTask);
} }
/**
* 刷新好友状态
*
* @param staffId
* @param storeId
* @param wxEnterpriseId
* @return
*/
@HttpLimit
@RequestMapping("/fresh-friend-count")
public HaobanResponse checkFreshFriend(String staffId, String storeId, String wxEnterpriseId) {
String yyyyMM = DateUtil.dateToStr(new Date(), "yyyyMM");
String key = "haoban_fresh_wx_friend" + yyyyMM + staffId;
Integer count = RedisUtil.getCache(key) == null ? 0 : (Integer) RedisUtil.getCache(key);
int ret = count == null ? 4 : 4 - count;
return resultResponse(HaoBanErrCode.ERR_1, ret);
}
//获取门店详情 //获取门店详情
public boolean isEnterpriseOver(String eid) { public boolean isEnterpriseOver(String eid) {
......
...@@ -139,29 +139,19 @@ public class InfoController extends WebBaseController{ ...@@ -139,29 +139,19 @@ public class InfoController extends WebBaseController{
staffDTOS.addAll(userDtos); staffDTOS.addAll(userDtos);
} }
if (CollectionUtils.isNotEmpty(staffDTOS)) { if (CollectionUtils.isNotEmpty(staffDTOS)) {
loginStaff = staffDTOS.get(0);
if (staffDTOS.size() > 1) { if (staffDTOS.size() > 1) {
String dictName = loginUserId.getDictName(); String dictName = loginUserId.getDictName();
String[] split = dictName.split("-");
if (split.length > 1) {
String weiCorpId = split[1];
WxEnterpriseDTO weiWxEnterpriseDTO = wxEnterpriseApiService.getEnterpriseBycorpId(weiCorpId);
if (null != weiWxEnterpriseDTO) {
loginStaff = staffDTOS.stream().filter(staffDTO -> { loginStaff = staffDTOS.stream().filter(staffDTO -> {
if (weiWxEnterpriseDTO.getWxEnterpriseId().equals(staffDTO.getWxEnterpriseId())) { if (dictName.indexOf(staffDTO.getWxEnterpriseId()) > 0) {
return true; return true;
} else { } else {
return false; return false;
} }
}).findFirst().orElse(staffDTOS.get(0)); }).findFirst().orElse(loginStaff);
} } else {
} loginStaff = staffDTOS.get(0);
} }
} }
// StaffDTO staffDTO = staffApiService.selectByNationcodeAndPhoneNumber(enterprise.getWxEnterpriseId(), "86", midPhone);
// if (null !=staffDTO) {
// loginStaff=staffDTO;
// }
} }
} }
...@@ -295,7 +285,7 @@ public class InfoController extends WebBaseController{ ...@@ -295,7 +285,7 @@ public class InfoController extends WebBaseController{
private MemberLoginQo getUserByCode(WxEnterpriseDTO enterpriseDTO, String code, String enterpriseId) { private MemberLoginQo getUserByCode(WxEnterpriseDTO enterpriseDTO, String code, String enterpriseId) {
SecretSettingDTO secretSetting = wxEnterpriseApiService.getSecretSetting(enterpriseDTO.getWxEnterpriseId(), SecretTypeEnum.MEMBER_WAPP.getVal(), enterpriseId); SecretSettingDTO secretSetting = wxEnterpriseApiService.getSecretSetting(enterpriseDTO.getWxEnterpriseId(), SecretTypeEnum.MEMBER_WAPP.getVal(), enterpriseId);
if (null == secretSetting || StringUtils.isBlank(secretSetting.getSecretVal())) { if (null == secretSetting || StringUtils.isBlank(secretSetting.getSecretVal())) {
logger.info("MEMBER_WAPPsecret配置没有配置"); logger.info("MEMBER_WAPPsecret配置没1ss有配置");
return null; return null;
} }
String userDTOJson = qywxUserApiService.getUserByCode(enterpriseDTO.getCorpid(), secretSetting.getSecretVal(), code); String userDTOJson = qywxUserApiService.getUserByCode(enterpriseDTO.getCorpid(), secretSetting.getSecretVal(), code);
...@@ -315,11 +305,11 @@ public class InfoController extends WebBaseController{ ...@@ -315,11 +305,11 @@ public class InfoController extends WebBaseController{
} }
@RequestMapping("get-member-store") @RequestMapping("get-member-store")
public HaobanResponse getMemberStore(String externalUserid,String wxUserId) { public HaobanResponse getMemberStore(String externalUserid, String wxUserId, String storeId) {
if (StringUtils.isAnyBlank(externalUserid,wxUserId)) { if (StringUtils.isAnyBlank(externalUserid,wxUserId)) {
return resultResponse(HaoBanErrCode.ERR_2); return resultResponse(HaoBanErrCode.ERR_2);
} }
List<MemberStoreDTO> result = memberUnionidRelatedApiService.listByExTernalUseridAndWxUserId(externalUserid, wxUserId); List<MemberStoreDTO> result = memberUnionidRelatedApiService.listByExTernalUseridAndWxUserId(externalUserid, wxUserId, storeId);
return resultResponse(HaoBanErrCode.ERR_1,result); return resultResponse(HaoBanErrCode.ERR_1,result);
} }
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.gic.haoban.manage.api.dto.*;
import org.apache.commons.lang3.StringUtils;
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.RestController;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.dubbo.common.utils.CollectionUtils; import com.alibaba.dubbo.common.utils.CollectionUtils;
import com.gic.clerk.api.dto.ClerkDTO; import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
...@@ -37,20 +18,23 @@ import com.gic.enterprise.api.service.StoreService; ...@@ -37,20 +18,23 @@ import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.data.api.dto.HaobanDataDTO; import com.gic.haoban.data.api.dto.HaobanDataDTO;
import com.gic.haoban.data.api.service.HaobanDataApiService; import com.gic.haoban.data.api.service.HaobanDataApiService;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.StoreFieldEnum; import com.gic.haoban.manage.api.enums.StoreFieldEnum;
import com.gic.haoban.manage.api.service.AuditApiService; import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.api.service.AuditSettingApiService;
import com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService;
import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.web.anno.IgnoreLogin; import com.gic.haoban.manage.web.anno.IgnoreLogin;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.vo.StaffStoreVO; import com.gic.haoban.manage.web.vo.StaffStoreVO;
import com.gic.haoban.manage.web.vo.StoreDetailVO; import com.gic.haoban.manage.web.vo.StoreDetailVO;
import com.gic.haoban.manage.web.vo.StoreVO; import org.apache.commons.lang3.StringUtils;
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.RestController;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@RestController @RestController
public class StoreController extends WebBaseController{ public class StoreController extends WebBaseController{
...@@ -59,10 +43,6 @@ public class StoreController extends WebBaseController{ ...@@ -59,10 +43,6 @@ public class StoreController extends WebBaseController{
@Autowired @Autowired
private ClerkService clerkService; private ClerkService clerkService;
@Autowired @Autowired
private StaffApiService staffApiService;
@Autowired
private DepartmentApiService departmentApiService;
@Autowired
private StaffDepartmentRelatedApiService staffDepartmentRelatedApiService; private StaffDepartmentRelatedApiService staffDepartmentRelatedApiService;
@Autowired @Autowired
private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService; private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService;
...@@ -78,9 +58,9 @@ public class StoreController extends WebBaseController{ ...@@ -78,9 +58,9 @@ public class StoreController extends WebBaseController{
private ClerkMainStoreRelatedApiService clerkMainStoreRelatedApiService; private ClerkMainStoreRelatedApiService clerkMainStoreRelatedApiService;
@Autowired @Autowired
private StaffClerkRelationApiService staffClerkRelationApiService; private StaffClerkRelationApiService staffClerkRelationApiService;
@Autowired @Autowired
private EnterpriseService enterpriseService; private EnterpriseService enterpriseService;
//门店列表 //门店列表
@RequestMapping("/store-list") @RequestMapping("/store-list")
public HaobanResponse storeList(String staffId,String wxEnterpriseId,String version) { public HaobanResponse storeList(String staffId,String wxEnterpriseId,String version) {
...@@ -112,23 +92,22 @@ public class StoreController extends WebBaseController{ ...@@ -112,23 +92,22 @@ public class StoreController extends WebBaseController{
continue; continue;
} }
ClerkDTO clerk = clerkService.getClerkByClerkCode(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getClerkCode()); ClerkDTO clerk = clerkService.getClerkByClerkCode(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getClerkCode());
if (clerk != null) { if (clerk == null) {
continue;
}
StoreDTO store = storeService.getStore(clerk.getStoreId()); StoreDTO store = storeService.getStore(clerk.getStoreId());
if (store == null) { if (store == null) {
continue; continue;
} }
//主门店标志 //主门店标志
int mainStoreFlag = 0; int mainStoreFlag = 0;
if (StringUtils.isEmpty(storeId)) { if (storeId.equals(store.getStoreId())) {
mainStoreFlag = 0;
} else if (storeId.equals(store.getStoreId())) {
mainStoreFlag = 1; mainStoreFlag = 1;
} }
EnterpriseDetailDTO enterpriseDetailDTO = enterpriseTypeMap.get(clerk.getEnterpriseId()); EnterpriseDetailDTO enterpriseDetailDTO = enterpriseTypeMap.get(clerk.getEnterpriseId());
staffDepartmentRelatedApiService.listByStaffId(staffId); staffDepartmentRelatedApiService.listByStaffId(staffId);
StaffStoreVO vo = new StaffStoreVO(); StaffStoreVO vo = new StaffStoreVO();
vo.setClerkCode(clerk.getClerkCode()); vo.setClerkCode(clerk.getClerkCode());
vo.setWxEnterpriseType(enterpriseDetailDTO != null ? enterpriseDetailDTO.getWxEnterpriseType() : null); vo.setWxEnterpriseType(enterpriseDetailDTO != null ? enterpriseDetailDTO.getWxEnterpriseType() : null);
vo.setMemberOpenCardFlag(enterpriseDetailDTO != null ? enterpriseDetailDTO.getMemberOpenCardFlag() : null); vo.setMemberOpenCardFlag(enterpriseDetailDTO != null ? enterpriseDetailDTO.getMemberOpenCardFlag() : null);
vo.setClerkId(clerk.getClerkId()); vo.setClerkId(clerk.getClerkId());
...@@ -145,7 +124,6 @@ public class StoreController extends WebBaseController{ ...@@ -145,7 +124,6 @@ public class StoreController extends WebBaseController{
vo.setBindFlag(1); vo.setBindFlag(1);
list.add(vo); list.add(vo);
} }
}
return resultResponse(HaoBanErrCode.ERR_1, list); return resultResponse(HaoBanErrCode.ERR_1, list);
} }
...@@ -325,23 +303,22 @@ public class StoreController extends WebBaseController{ ...@@ -325,23 +303,22 @@ public class StoreController extends WebBaseController{
//获取门店详情 //获取门店详情
public boolean isEnterpriseOver(String storeId) { public boolean isEnterpriseOver(String storeId) {
StoreDTO store = storeService.getStore(storeId); StoreDTO store = storeService.getStore(storeId);
if(store == null){ if (store == null) {
return true; return true;
} }
EnterpriseDTO enterprise = enterpriseService.getEnterpriseByEid(store.getEnterpriseId()); EnterpriseDTO enterprise = enterpriseService.getEnterpriseById(store.getEnterpriseId());
if (enterprise == null || enterprise.getStatus() != 1) { if (enterprise == null || enterprise.getStatus() != 1) {
return true; return true;
} }
if (enterprise.getExpireTime() == null) { if (enterprise.getExpireTime() == null) {
if (enterprise.getEnabledState() == null) { if (enterprise.getEnabledState() == null) {
return false; return false;
} else if (enterprise.getEnabledState() == 1) { } else {
return false; return enterprise.getEnabledState() != 1;
} }
} else if (enterprise.getExpireTime().getTime() > System.currentTimeMillis() && enterprise.getEnabledState() == 1) { } else {
return false; return enterprise.getExpireTime().getTime() <= System.currentTimeMillis() || enterprise.getEnabledState() != 1;
} }
return true;
} }
......
...@@ -193,7 +193,8 @@ public enum HaoBanErrCode { ...@@ -193,7 +193,8 @@ public enum HaoBanErrCode {
ERR_10004(10004,"成员名称不能为空"), ERR_10004(10004,"成员名称不能为空"),
ERR_10005(10005,"成员已存在"), ERR_10005(10005,"成员已存在"),
ERR_10006(10006,"成员不存在"), ERR_10006(10006,"成员不存在"),
ERR_10007(10007,"本月已经设置过主导购"), ERR_10007(10007, "本月已经设置过主导购"),
ERR_10031(10031, "本月已经设置过主门店"),
ERR_10009(10009,"门店不存在"), ERR_10009(10009,"门店不存在"),
ERR_10010(10010,"gic新增失败"), ERR_10010(10010,"gic新增失败"),
......
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