Commit 9da8cd9d by fudahua

Merge remote-tracking branch 'origin/master'

parents c73a354d 6e0afeae
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-pom-base</artifactId> <artifactId>gic-pom-base</artifactId>
<version>3.0-SNAPSHOT</version> <version>3.0-SNAPSHOT</version>
<relativePath/>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -6,7 +6,8 @@ package com.gic.haoban.manage.api.enums; ...@@ -6,7 +6,8 @@ package com.gic.haoban.manage.api.enums;
public enum AlertTypeEnum { public enum AlertTypeEnum {
QYWX_TAG_SYNC(1, "企微标签同步", null), QYWX_TAG_SYNC(1, "企微标签同步", null),
QUNFA_MESSAGE(2, "企微群发", null), QUNFA_MESSAGE(2, "企微群发", null),
FRIEND_ADD(3, "企微好友添加", null),; FRIEND_ADD(3, "企微好友添加", null),
CLOUD_STORE_CHANGE(4, "观云台门店进回收站", null),;
private Integer type; private Integer type;
private String name; private String name;
private String dingUrl; private String dingUrl;
......
...@@ -11,19 +11,19 @@ public enum AppPageType { ...@@ -11,19 +11,19 @@ public enum AppPageType {
//任务详情(会话、话务、不良评价) //任务详情(会话、话务、不良评价)
TASK_DETAIL(3, "hbapp_task_detail"), TASK_DETAIL(3, "hbapp_task_detail"),
//日报详情 //日报详情
DAILY_DETAIL(4, "hbapp_task_daily_report_detail"), DAILY_DETAIL(4, "hbapp_task_daily_report_detail"),
//指标管理详情 //指标管理详情
PERFORMANCE_DETAIL(5, "hbapp_task_kpi_detail"), PERFORMANCE_DETAIL(5, "hbapp_task_kpi_detail"),
//顾客详情 //顾客详情
CUSTOMER_DETAIL(6, "hbapp_customer_detail"), CUSTOMER_DETAIL(6, "hbapp_customer_detail"),
//会员列表 //会员列表
MEMBER_LIST(7, "hbapp_customer_list"), MEMBER_LIST(7, "hbapp_customer_list"),
//分配会员 //分配会员
DISTRIBUTE_MEMBER(8, "hbapp_customer_distribute"), DISTRIBUTE_MEMBER(8, "hbapp_customer_distribute"),
//任务列表 //任务列表
TASK_LIST(9, "hbapp_task_list"), TASK_LIST(9, "hbapp_task_list_new"),
//商品详情 //商品详情
GOOD_DETAIL(10, "hbapp_commodity_detail"), GOOD_DETAIL(10, "hbapp_commodity_detail"),
//我的关联记录 //我的关联记录
MY_RELATED_RECORD(11, "store_relate_my_record_list"), MY_RELATED_RECORD(11, "store_relate_my_record_list"),
//门店关联记录 //门店关联记录
...@@ -34,9 +34,9 @@ public enum AppPageType { ...@@ -34,9 +34,9 @@ public enum AppPageType {
FACE_ARRIVAL(14, "hbapp_customer_bind_faceId"), FACE_ARRIVAL(14, "hbapp_customer_bind_faceId"),
//完善标签 //完善标签
PERFECT_TAG(15, "hbapp_customer_edit_tag"), PERFECT_TAG(15, "hbapp_customer_edit_tag"),
//销售线索任务列表 //销售线索任务列表(hbapp_sales_lead_main废弃,改为新的hbapp_marketing_task_list)
MARKET_CLUE_TASK(16, "hbapp_sales_lead_main"), MARKET_CLUE_TASK(16, "hbapp_marketing_task_list"),
//话务任务逾期提醒 //话务任务
TEL_WITHIN_TIME_LIMIT(17, "hbapp_marketing_task_list"), TEL_WITHIN_TIME_LIMIT(17, "hbapp_marketing_task_list"),
; ;
......
package com.gic.haoban.manage.api.service; package com.gic.haoban.manage.api.service;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
public interface StaffDepartmentRelatedApiService { public interface StaffDepartmentRelatedApiService {
...@@ -25,41 +25,49 @@ public interface StaffDepartmentRelatedApiService { ...@@ -25,41 +25,49 @@ public interface StaffDepartmentRelatedApiService {
*/ */
StaffDepartmentRelatedDTO getByStaffDepartmentRelatedId(String staffDepartmentRelatedId); StaffDepartmentRelatedDTO getByStaffDepartmentRelatedId(String staffDepartmentRelatedId);
void deleteCode(StaffDepartmentRelatedDTO dto); void deleteCode(StaffDepartmentRelatedDTO dto);
StaffDepartmentRelatedDTO getOneByClerkCodeAndDepartmentId(String clerkCode, String departmentId); StaffDepartmentRelatedDTO getOneByClerkCodeAndDepartmentId(String clerkCode, String departmentId);
StaffDepartmentRelatedDTO getOneByStaffIdAndDepartmentId(String staffId, String departmentId); StaffDepartmentRelatedDTO getOneByStaffIdAndDepartmentId(String staffId, String departmentId);
Map<String,String> getWxUserIdByClerkId(String clerkId); Map<String, String> getWxUserIdByClerkId(String clerkId);
String getPageUrl(int type,String data); String getPageUrl(int type, String data);
//发送消息,单人发送 /**
boolean sendSingleMessage(String clerkId,String title,String content,String pageUrl); * 发送消息,单人发送
*
* @param clerkId
* @param title
* @param content
* @param pageUrl
* @return
*/
boolean sendSingleMessage(String clerkId, String title, String content, String pageUrl);
/** /**
* 单人消息发送通用方法 * 单人消息发送通用方法
* *
* @param clerkId : 接收人id * @param clerkId : 接收人id
* @param title : 通知标题 * @param title : 通知标题
* @param contentMap : 时间集合, key 为类型, value : 内容(例如 接收事件 : 事件内容) * @param contentMap : 时间集合, key 为类型, value : 内容(例如 接收事件 : 事件内容)
* @param pageUrl : 跳转地址 * @param pageUrl : 跳转地址
* @return : 返回是否发送成功 * @return : 返回是否发送成功
*/ */
Boolean sendSingleMessage(String clerkId, String title, Map<String, String> contentMap, String pageUrl); Boolean sendSingleMessage(String clerkId, String title, Map<String, String> contentMap, String pageUrl);
//发送消息,带审核理由 //发送消息,带审核理由
public boolean sendAuditMessage(String clerkId, String title,String content, String pageUrl,int auditStatus, String auditReason); boolean sendAuditMessage(String clerkId, String title, String content, String pageUrl, int auditStatus, String auditReason);
List<StaffDepartmentRelatedDTO> listByStaffIds(List<String> staffIds); List<StaffDepartmentRelatedDTO> listByStaffIds(List<String> staffIds);
public void sendClerkBind(String staffId,String clerkCode,String storeId,int auditStatus,String auditReason);
public void sendStaffBind(String staffId,String clerkCode,String storeId,int auditStatus,String auditReason);
public void sendClerkAdd (String clerkName,String clerkCode,String storeId,int auditStatus,String auditReason); void sendClerkBind(String staffId, String clerkCode, String storeId, int auditStatus, String auditReason);
void sendStaffBind(String staffId, String clerkCode, String storeId, int auditStatus, String auditReason);
void sendClerkAdd(String clerkName, String clerkCode, String storeId, int auditStatus, String auditReason);
public void sendClerkDel (String clerkName,String clerkCode,String storeId,int auditStatus,String auditReason); void sendClerkDel(String clerkName, String clerkCode, String storeId, int auditStatus, String auditReason);
} }
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-pom-base</artifactId> <artifactId>gic-pom-base</artifactId>
<version>3.0-SNAPSHOT</version> <version>3.0-SNAPSHOT</version>
<relativePath/>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
...@@ -14,8 +15,6 @@ ...@@ -14,8 +15,6 @@
<packaging>war</packaging> <packaging>war</packaging>
<name>haoban-manage3-operation-web Maven Webapp</name> <name>haoban-manage3-operation-web Maven Webapp</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......
...@@ -2,30 +2,28 @@ package com.gic.haoban.manage.web.controller.test; ...@@ -2,30 +2,28 @@ package com.gic.haoban.manage.web.controller.test;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.commons.util.GICMQClientUtil;
import com.gic.commons.util.EntityUtil;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.CheckContainUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.TestDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.enums.QuartzEnum; import com.gic.haoban.manage.api.enums.QuartzEnum;
import com.gic.haoban.manage.api.enums.SyncTaskTypeEnum;
import com.gic.haoban.manage.api.service.DealSyncOperationApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.TestApiService; import com.gic.haoban.manage.api.service.TestApiService;
import com.gic.haoban.manage.api.service.TestService;
import com.gic.haoban.manage.web.controller.WebBaseController; import com.gic.haoban.manage.web.controller.WebBaseController;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.TestQo; import com.gic.haoban.manage.web.qo.QywxTagSyncInfoQo;
import com.gic.haoban.manage.web.vo.TestVo; import com.gic.mq.sdk.GicMQClient;
import com.gic.sharing.core.service.api.service.MqApiService; import com.gic.sharing.core.service.api.service.MqApiService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.stream.Collectors;
import static org.slf4j.LoggerFactory.getLogger; import static org.slf4j.LoggerFactory.getLogger;
...@@ -44,6 +42,12 @@ public class TestController extends WebBaseController { ...@@ -44,6 +42,12 @@ public class TestController extends WebBaseController {
@Autowired @Autowired
private MqApiService mqApiService; private MqApiService mqApiService;
@Autowired
private StaffApiService staffApiService;
@Autowired
private DealSyncOperationApiService dealSyncOperationApiService;
// //
// @RequestMapping("/testList") // @RequestMapping("/testList")
// @ResponseBody // @ResponseBody
...@@ -135,4 +139,56 @@ public class TestController extends WebBaseController { ...@@ -135,4 +139,56 @@ public class TestController extends WebBaseController {
} }
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
/**
* 刷新好友
*
* @return
*/
@RequestMapping("/flush-friend-batch")
@ResponseBody
public HaobanResponse flushFriend(String key) {
if (StringUtils.isBlank(key)) {
return resultResponse(HaoBanErrCode.ERR_0);
}
String[] split = key.split(",");
for (String staffId : split) {
StaffDTO staff = staffApiService.selectById(staffId);
if (null == staff) {
continue;
}
String wxEnterpriseId = staff.getWxEnterpriseId();
String wxUserId = staff.getWxUserId();
String taskName = "刷新企业微信好友(" + staff.getStaffName() + ")";
String taskId = dealSyncOperationApiService.createWxFriendTaskSingle(staff.getWxEnterpriseId(), taskName, staffId, staff.getStaffName(), SyncTaskTypeEnum.FRIEND_SINGLE.getType());
if (StringUtils.isNotBlank(taskId)) {
dealSyncOperationApiService.dealWxFriendClerkSingle(taskId, wxUserId, staffId, wxEnterpriseId);
}
}
return resultResponse(HaoBanErrCode.ERR_1);
}
/**
* 刷新单个标签同步到队列
*
* @return
*/
@RequestMapping("/qywx-tag-mq")
@ResponseBody
public HaobanResponse qywxTagMq(String key) {
if (StringUtils.isBlank(key)) {
return resultResponse(HaoBanErrCode.ERR_0);
}
JSONArray jsonArray = JSONArray.parseArray(key);
List<String> mqList = jsonArray.stream().map(qo -> JSONObject.toJSONString(qo)).collect(Collectors.toList());
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
clientInstance.sendBatchMessages("qywxTagSyncDeal", mqList);
} catch (Exception e) {
e.printStackTrace();
logger.info("批量异常:{}", e);
}
return resultResponse(HaoBanErrCode.ERR_1);
}
} }
package com.gic.haoban.manage.web.qo;
import java.io.Serializable;
import java.util.List;
/**
* Created 2021/7/19.
*
* @author hua
*/
public class QywxTagSyncInfoQo 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;
}
}
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
<dubbo:reference interface="com.gic.haoban.manage.api.service.HandoverOperationApiService" <dubbo:reference interface="com.gic.haoban.manage.api.service.HandoverOperationApiService"
id="handoverOperationApiService"/> id="handoverOperationApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.DealSyncOperationApiService"
id="dealSyncOperationApiService"/>
<dubbo:reference interface="com.gic.sharing.core.service.api.service.MqApiService" <dubbo:reference interface="com.gic.sharing.core.service.api.service.MqApiService"
id="mqApiService"/> id="mqApiService"/>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-pom-base</artifactId> <artifactId>gic-pom-base</artifactId>
<version>3.0-SNAPSHOT</version> <version>3.0-SNAPSHOT</version>
<relativePath/>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -51,6 +51,6 @@ public interface StaffClerkBindLogMapper { ...@@ -51,6 +51,6 @@ public interface StaffClerkBindLogMapper {
public List<TabHaobanStaffClerkBindLog> listStaffClerkBindLog(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("clerkIds") List<String> clerkIds public List<TabHaobanStaffClerkBindLog> listStaffClerkBindLog(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("clerkIds") List<String> clerkIds
, @Param("staffIds") List<String> staffIds, @Param("enterpriseIds") List<String> enterpriseIds, @Param("optType") int optType, @Param("search") String search); , @Param("staffIds") List<String> staffIds, @Param("enterpriseIds") List<String> enterpriseIds, @Param("optType") int optType, @Param("search") String search);
public List<TabHaobanStaffClerkBindLog> StaffClerkUnBindLog(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("clerkId") String clerkIds public List<TabHaobanStaffClerkBindLog> staffClerkUnBindLog(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("clerkId") String clerkIds
, @Param("enterpriseId") String enterpriseIds, @Param("optType") int optType); , @Param("enterpriseId") String enterpriseIds, @Param("optType") int optType);
} }
\ No newline at end of file
...@@ -193,4 +193,12 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -193,4 +193,12 @@ public interface TabHaobanExternalClerkRelatedMapper {
* @return * @return
*/ */
List<TabHaobanExternalClerkRelated> listByExternalUserId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("externalUserId") String externalUserId); List<TabHaobanExternalClerkRelated> listByExternalUserId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("externalUserId") String externalUserId);
/**
* 根据会员id更新新老会员id
*
* @param memberId
* @return
*/
int updateMemberIdByMemberId(@Param("memberId") String memberId, @Param("oldMemberId") String oldMemberId);
} }
\ No newline at end of file
...@@ -58,4 +58,13 @@ public interface ExternalClerkRelatedService { ...@@ -58,4 +58,13 @@ public interface ExternalClerkRelatedService {
*/ */
List<TabHaobanExternalClerkRelated> listExternalByExternalUserid(String wxEnterpriseId, String externalUserid); List<TabHaobanExternalClerkRelated> listExternalByExternalUserid(String wxEnterpriseId, String externalUserid);
/**
* 校验会员id与unionid的对应 主要修复会员合并是没有更新会老的情况
*
* @param memberId
* @param unionId
* @return
*/
String checkAndUpdateMemberByUnonId(String enterpriseId, String memberId, String unionId);
} }
...@@ -5,6 +5,14 @@ import java.util.Date; ...@@ -5,6 +5,14 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import com.alibaba.fastjson.JSONObject;
import com.gic.member.api.dto.MemberDTO;
import com.gic.member.api.service.MemberService;
import com.gic.search.engine.api.dto.ESResponseQuerySingle;
import com.gic.search.engine.api.dto.dynamic.DynamicSearchDTO;
import com.gic.search.engine.api.service.dynamic.ESDataDynamicOperationApiService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import com.alibaba.dubbo.config.annotation.Service; import com.alibaba.dubbo.config.annotation.Service;
...@@ -16,12 +24,22 @@ import com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMap ...@@ -16,12 +24,22 @@ import com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMap
import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated; import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated;
import com.gic.haoban.manage.service.service.ExternalClerkRelatedService; import com.gic.haoban.manage.service.service.ExternalClerkRelatedService;
import static org.slf4j.LoggerFactory.getLogger;
@Service @Service
public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedService { public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedService {
private static final Logger logger = getLogger(ExternalClerkRelatedServiceImpl.class);
@Autowired @Autowired
private TabHaobanExternalClerkRelatedMapper mapper; private TabHaobanExternalClerkRelatedMapper mapper;
@Autowired
private ESDataDynamicOperationApiService esDataDynamicOperationApiService;
@Autowired
private MemberService memberService;
@Override @Override
public void insert(TabHaobanExternalClerkRelated related) { public void insert(TabHaobanExternalClerkRelated related) {
String clerkId = related.getClerkId(); String clerkId = related.getClerkId();
...@@ -110,4 +128,38 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ ...@@ -110,4 +128,38 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ
public List<TabHaobanExternalClerkRelated> listExternalByExternalUserid(String wxEnterpriseId, String externalUserid) { public List<TabHaobanExternalClerkRelated> listExternalByExternalUserid(String wxEnterpriseId, String externalUserid) {
return mapper.listByExternalUserId(wxEnterpriseId, externalUserid); return mapper.listByExternalUserId(wxEnterpriseId, externalUserid);
} }
@Override
public String checkAndUpdateMemberByUnonId(String enterpriseId, String memberId, String unionId) {
String returnFields = "id";
try {
JSONObject searchJson = new JSONObject();
searchJson.put("id", memberId);
DynamicSearchDTO search = new DynamicSearchDTO();
search.setSearchJson(searchJson);
search.setEnterpriseId(enterpriseId);
search.setColumnCategoryCode("member");
if (StringUtils.isNotBlank(returnFields)) {
search.setReturnFileds(returnFields);
}
ESResponseQuerySingle single = esDataDynamicOperationApiService.queryDataSingle(search);
JSONObject res = single.getRes();
logger.info("返回数据:{}", JSONObject.toJSONString(res));
if (res != null && res.size() > 0) {
return memberId;
}
MemberDTO memberDTO = memberService.getMemberByUnionid(unionId, enterpriseId);
if (null == memberDTO || memberDTO.getMemberId() == null) {
logger.info("会员不存在:{}", unionId);
return null;
}
//更新会员id
mapper.updateMemberIdByMemberId(memberDTO.getMemberId(), memberId);
return memberDTO.getMemberId();
} catch (Exception e) {
logger.info("异常:{}", e);
logger.info("从搜索引擎中搜索会员数据异常, memberId : {}", memberId);
}
return null;
}
} }
...@@ -95,7 +95,7 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService { ...@@ -95,7 +95,7 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService {
@Override @Override
public Page<StaffClerkBindLogDetailDTO> pageUnBindLog(String wxEnterpriseId, String clerkId, String enterpriseId, int optType, BasePageInfo pageInfo) { public Page<StaffClerkBindLogDetailDTO> pageUnBindLog(String wxEnterpriseId, String clerkId, String enterpriseId, int optType, BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo); PageHelper.startPage(pageInfo);
List<TabHaobanStaffClerkBindLog> clerkBindLogList = staffClerkBindLogMapper.StaffClerkUnBindLog(wxEnterpriseId, clerkId, enterpriseId, optType); List<TabHaobanStaffClerkBindLog> clerkBindLogList = staffClerkBindLogMapper.staffClerkUnBindLog(wxEnterpriseId, clerkId, enterpriseId, optType);
Page<StaffClerkBindLogDetailDTO> retPage = PageUtil.changePageHelperToCurrentPage(new PageInfo<>(clerkBindLogList), StaffClerkBindLogDetailDTO.class); Page<StaffClerkBindLogDetailDTO> retPage = PageUtil.changePageHelperToCurrentPage(new PageInfo<>(clerkBindLogList), StaffClerkBindLogDetailDTO.class);
return retPage; return retPage;
} }
......
...@@ -136,7 +136,8 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic ...@@ -136,7 +136,8 @@ public class CheckQywxSettingApiServiceImpl implements CheckQywxSettingApiServic
} }
//告警是否拦截重复告警 防止批量触发 //告警是否拦截重复告警 防止批量触发
if (StringUtils.isNotBlank(messageDTO.getKey())) { if (StringUtils.isNotBlank(messageDTO.getKey())) {
RBucket<Object> bucket = RedisUtil.getRedisClient().getBucket(messageDTO.getKey()); String key = messageDTO.getKey() + messageDTO.getAlertType();
RBucket<Object> bucket = RedisUtil.getRedisClient().getBucket(key);
boolean b = bucket.trySet(1, 60L, TimeUnit.SECONDS); boolean b = bucket.trySet(1, 60L, TimeUnit.SECONDS);
if (!b) { if (!b) {
return; return;
......
...@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,8 @@ 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.commons.util.GICMQClientUtil;
import com.gic.haoban.app.customer.dto.SearchComputeDTO;
import com.gic.haoban.app.customer.dto.SearchDataDTO;
import com.gic.haoban.app.customer.enums.GicQywxSyncTypeEnum; import com.gic.haoban.app.customer.enums.GicQywxSyncTypeEnum;
import com.gic.haoban.app.customer.enums.QywxSyncTaskTypeEnum; import com.gic.haoban.app.customer.enums.QywxSyncTaskTypeEnum;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
...@@ -18,14 +20,26 @@ import com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMap ...@@ -18,14 +20,26 @@ import com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMap
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.haoban.manage.service.pojo.QywxTagSyncInfoPojo;
import com.gic.member.api.dto.MemberDTO;
import com.gic.member.api.service.MemberApiService;
import com.gic.member.api.service.MemberService;
import com.gic.mq.sdk.GicMQClient; import com.gic.mq.sdk.GicMQClient;
import com.gic.search.engine.api.constant.MemberDataEnum;
import com.gic.search.engine.api.constant.OperateEnum;
import com.gic.search.engine.api.dto.ESResponseQueryBatch;
import com.gic.search.engine.api.dto.ESResponseQuerySingle;
import com.gic.search.engine.api.dto.dynamic.DynamicSearchDTO;
import com.gic.search.engine.api.service.dynamic.ESDataDynamicOperationApiService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -217,4 +231,5 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA ...@@ -217,4 +231,5 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
List<TabHaobanExternalClerkRelated> list = tabHaobanExternalClerkRelatedMapper.listByMemberId(memberId); List<TabHaobanExternalClerkRelated> list = tabHaobanExternalClerkRelatedMapper.listByMemberId(memberId);
return EntityUtil.changeEntityListNew(ExternalClerkRelatedShortInfoDTO.class, list); return EntityUtil.changeEntityListNew(ExternalClerkRelatedShortInfoDTO.class, list);
} }
} }
...@@ -677,9 +677,13 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -677,9 +677,13 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger.info("该企业下没有配置需要同步的:{},{}", externalUserId, clerkRelated.getEnterpriseId()); logger.info("该企业下没有配置需要同步的:{},{}", externalUserId, clerkRelated.getEnterpriseId());
continue; continue;
} }
String memberId = externalClerkRelatedService.checkAndUpdateMemberByUnonId(clerkRelated.getEnterpriseId(), clerkRelated.getMemberId(), clerkRelated.getUnionid());
if (null == memberId) {
logger.info("会员不存在:{}", externalUserId);
continue;
}
//该会员打的标签 //该会员打的标签
List<MemberTagDTO> gicItems = memberTagService.listMemberTag(clerkRelated.getEnterpriseId(), clerkRelated.getMemberId()); List<MemberTagDTO> gicItems = memberTagService.listMemberTag(clerkRelated.getEnterpriseId(), memberId);
Set<String> noSyncTagItemIds = new HashSet<>(); Set<String> noSyncTagItemIds = new HashSet<>();
if (!CollectionUtils.isEmpty(gicItems)) { if (!CollectionUtils.isEmpty(gicItems)) {
noSyncTagItemIds = gicItems.stream().filter(item -> !entQywxSyncTagItemIds.contains(item.getTagsId())).map(dto -> dto.getTagsId()).collect(Collectors.toSet()); noSyncTagItemIds = gicItems.stream().filter(item -> !entQywxSyncTagItemIds.contains(item.getTagsId())).map(dto -> dto.getTagsId()).collect(Collectors.toSet());
...@@ -692,9 +696,9 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -692,9 +696,9 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger.info("该企业会员需要打的标签:{}", JSONObject.toJSONString(entMemberNeedSetQywxKeys)); logger.info("该企业会员需要打的标签:{}", JSONObject.toJSONString(entMemberNeedSetQywxKeys));
//更新标签 会自动同步 //更新标签 会自动同步
if (CollectionUtils.isEmpty(saveTagIds)) { if (CollectionUtils.isEmpty(saveTagIds)) {
saveMemberTags(new HashSet<>(), clerkRelated.getEnterpriseId(), clerkRelated.getMemberId(), clerkRelated.getClerkId()); saveMemberTags(new HashSet<>(), clerkRelated.getEnterpriseId(), memberId, clerkRelated.getClerkId());
} else { } else {
saveMemberTags(saveTagIds, clerkRelated.getEnterpriseId(), clerkRelated.getMemberId(), clerkRelated.getClerkId()); saveMemberTags(saveTagIds, clerkRelated.getEnterpriseId(), memberId, clerkRelated.getClerkId());
} }
// hasSaveMemberId.add(clerkRelated.getMemberId()); // hasSaveMemberId.add(clerkRelated.getMemberId());
// //同步企业的标签到企业微信 // //同步企业的标签到企业微信
......
...@@ -14,11 +14,9 @@ import com.gic.haoban.manage.service.config.Config; ...@@ -14,11 +14,9 @@ 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.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.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;
...@@ -37,7 +35,7 @@ import java.util.*; ...@@ -37,7 +35,7 @@ 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 final Logger logger = LoggerFactory.getLogger(StaffDepartmentRelatedApiServiceImpl.class);
@Autowired @Autowired
private StaffDepartmentRelatedService staffDepartmentRelatedService; private StaffDepartmentRelatedService staffDepartmentRelatedService;
...@@ -50,10 +48,6 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -50,10 +48,6 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
@Autowired @Autowired
private WxEnterpriseMapper wxEnterpriseMapper; private WxEnterpriseMapper wxEnterpriseMapper;
@Autowired @Autowired
private WxEnterpriseRelatedMapper wxEnterpriseRelatedMapper;
@Autowired
private DepartmentService departmentService;
@Autowired
private Config config; private Config config;
@Autowired @Autowired
private TabHaobanStaffClerkRelationMapper tabHaobanStaffClerkRelationMapper; private TabHaobanStaffClerkRelationMapper tabHaobanStaffClerkRelationMapper;
...@@ -61,20 +55,19 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -61,20 +55,19 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
private StaffApiService staffApiService; private StaffApiService staffApiService;
@Override @Override
public List<StaffDepartmentRelatedDTO> listByDepartmentId( public List<StaffDepartmentRelatedDTO> listByDepartmentId(String departmentId) {
String departmentId) {
List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedService.listByDepartmentId(departmentId); List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedService.listByDepartmentId(departmentId);
List<StaffDepartmentRelatedDTO> resultList = EntityUtil.changeEntityListByJSON(StaffDepartmentRelatedDTO.class, list); List<StaffDepartmentRelatedDTO> resultList = EntityUtil.changeEntityListByJSON(StaffDepartmentRelatedDTO.class, list);
return resultList; return resultList;
} }
@Override @Override
public List<StaffDepartmentRelatedDTO> listByDepartmentIds( public List<StaffDepartmentRelatedDTO> listByDepartmentIds(List<String> departmentIds) {
List<String> departmentIds) {
List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedMapper.listByDepartmentIds(departmentIds); List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedMapper.listByDepartmentIds(departmentIds);
List<StaffDepartmentRelatedDTO> resultList = EntityUtil.changeEntityListByJSON(StaffDepartmentRelatedDTO.class, list); List<StaffDepartmentRelatedDTO> resultList = EntityUtil.changeEntityListByJSON(StaffDepartmentRelatedDTO.class, list);
return resultList; return resultList;
} }
@Override @Override
public void updateById(StaffDepartmentRelatedDTO dto) { public void updateById(StaffDepartmentRelatedDTO dto) {
TabHaobanStaffDepartmentRelated tab = EntityUtil.changeEntityByJSON(TabHaobanStaffDepartmentRelated.class, dto); TabHaobanStaffDepartmentRelated tab = EntityUtil.changeEntityByJSON(TabHaobanStaffDepartmentRelated.class, dto);
...@@ -187,13 +180,13 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -187,13 +180,13 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
String wxUserId = staffDTO.getWxUserId(); String wxUserId = staffDTO.getWxUserId();
String corpId = tabHaobanWxEnterprise.getCorpid(); String corpId = tabHaobanWxEnterprise.getCorpid();
String name = staffDTO.getStaffName(); String name = staffDTO.getStaffName();
if(content.length()>30){ if (content.length() > 30) {
content = content.substring(0, 26); content = content.substring(0, 26);
content = content+"..."; content = content + "...";
} }
//先发送下,试试 //先发送下,试试
QywxXcxSendMessageDTO messageDTO = new QywxXcxSendMessageDTO(); QywxXcxSendMessageDTO messageDTO = new QywxXcxSendMessageDTO();
List<ItemDTO> items = new ArrayList();; List<ItemDTO> items = new ArrayList();
ItemDTO dto1 = new ItemDTO(); ItemDTO dto1 = new ItemDTO();
ItemDTO dto2 = new ItemDTO(); ItemDTO dto2 = new ItemDTO();
ItemDTO dto3 = new ItemDTO(); ItemDTO dto3 = new ItemDTO();
...@@ -269,17 +262,18 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -269,17 +262,18 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
} }
//导购删除,,审核记录,,消息发送 //导购删除,,审核记录,,消息发送
public void sendClerkDel (String clerkName,String clerkCode,String storeId,int auditStatus,String auditReason){ @Override
//TODO huang 发送店长,门店关联记录列表 public void sendClerkDel(String clerkName, String clerkCode, String storeId, int auditStatus, String auditReason) {
String messageTitle = "门店导购变更"; //TODO huang 发送店长,门店关联记录列表
String messageContent ="删除导购:"+ clerkName+"("+clerkCode+")"; String messageTitle = "门店导购变更";
String messageContent = "删除导购:" + clerkName + "(" + 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();
ClerkDTO gicClerk = clerkService.getClerkLeaderByStoreId(storeId); ClerkDTO gicClerk = clerkService.getClerkLeaderByStoreId(storeId);
if(gicClerk == null){ if (gicClerk == null) {
logger.info("店长不存在,发送消息失败{}",storeId); logger.info("店长不存在,发送消息失败{}", storeId);
return ; return;
} }
TabHaobanStaffClerkRelation tab = tabHaobanStaffClerkRelationMapper.getOneByClerkId(gicClerk.getClerkId()); TabHaobanStaffClerkRelation tab = tabHaobanStaffClerkRelationMapper.getOneByClerkId(gicClerk.getClerkId());
if(tab == null){ if(tab == null){
...@@ -301,17 +295,17 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -301,17 +295,17 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
String corpId = map.get("corpId"); String corpId = map.get("corpId");
String name = map.get("clerkName"); String name = map.get("clerkName");
if(jodd.util.StringUtil.isEmpty(wxUserId)){ if (jodd.util.StringUtil.isEmpty(wxUserId)) {
logger.info("wxUserId不存在============clerkId={}",clerkId); logger.info("wxUserId不存在============clerkId={}", clerkId);
return false; return false;
} }
if(content.length()>30){ if (content.length() > 30) {
content = content.substring(0, 26); content = content.substring(0, 26);
content = content+"..."; content = content + "...";
} }
//先发送下,试试 //先发送下,试试
QywxXcxSendMessageDTO messageDTO = new QywxXcxSendMessageDTO(); QywxXcxSendMessageDTO messageDTO = new QywxXcxSendMessageDTO();
List<ItemDTO> items = new ArrayList();; List<ItemDTO> items = new ArrayList();
ItemDTO dto1 = new ItemDTO(); ItemDTO dto1 = new ItemDTO();
ItemDTO dto2 = new ItemDTO(); ItemDTO dto2 = new ItemDTO();
dto1.setKey("接收人"); dto1.setKey("接收人");
...@@ -320,8 +314,8 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -320,8 +314,8 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
dto2.setValue(content); dto2.setValue(content);
items.add(dto1); items.add(dto1);
items.add(dto2); items.add(dto2);
ArrayList<String> list = new ArrayList<>(); ArrayList<String> list = new ArrayList<>();
list.add(wxUserId); list.add(wxUserId);
messageDTO.setAppid(config.getAppid()); messageDTO.setAppid(config.getAppid());
messageDTO.setUserIds(list); messageDTO.setUserIds(list);
messageDTO.setPage(pageUrl); messageDTO.setPage(pageUrl);
...@@ -391,22 +385,22 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -391,22 +385,22 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
@Override @Override
public boolean sendAuditMessage(String staffId, String title, public boolean sendAuditMessage(String staffId, String title,
String content, String pageUrl,int auditStatus, String auditReason) { String content, String pageUrl,int auditStatus, String auditReason) {
Map<String,String> map = getWxUserIdByStaffId(staffId); Map<String, String> map = getWxUserIdByStaffId(staffId);
String wxUserId = map.get("wxUserId"); String wxUserId = map.get("wxUserId");
String corpId = map.get("corpId"); String corpId = map.get("corpId");
String name = map.get("staffName"); String name = map.get("staffName");
if(jodd.util.StringUtil.isEmpty(wxUserId)){ if (StringUtils.isEmpty(wxUserId)) {
logger.info("wxUserId不存在============clerkId={}",staffId); logger.info("wxUserId不存在============clerkId={}", staffId);
return false; return false;
} }
if(content.length()>30){ if (content.length() > 30) {
content = content.substring(0, 26); content = content.substring(0, 26);
content = content+"..."; content = content + "...";
} }
//先发送下,试试 //先发送下,试试
QywxXcxSendMessageDTO messageDTO = new QywxXcxSendMessageDTO(); QywxXcxSendMessageDTO messageDTO = new QywxXcxSendMessageDTO();
List<ItemDTO> items = new ArrayList();; List<ItemDTO> items = new ArrayList();
ItemDTO dto1 = new ItemDTO(); ItemDTO dto1 = new ItemDTO();
ItemDTO dto2 = new ItemDTO(); ItemDTO dto2 = new ItemDTO();
ItemDTO dto3 = new ItemDTO(); ItemDTO dto3 = new ItemDTO();
...@@ -440,6 +434,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -440,6 +434,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
logger.info("发送===============》{}",b); logger.info("发送===============》{}",b);
return b; return b;
} }
@Override @Override
public String getPageUrl(int type, String data) { public String getPageUrl(int type, String data) {
String baseUrl = "/pages/route/index"; String baseUrl = "/pages/route/index";
......
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
</if> </if>
order by create_time desc order by create_time desc
</select> </select>
<select id="StaffClerkUnBindLog" resultMap="BaseResultMap"> <select id="staffClerkUnBindLog" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_staff_clerk_bind_log from tab_haoban_staff_clerk_bind_log
......
...@@ -437,7 +437,11 @@ ...@@ -437,7 +437,11 @@
and audit_type = 3 and audit_type = 3
and audit_status = 0 and audit_status = 0
and enterprise_id = #{enterpriseId,jdbcType=VARCHAR} and enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and (related_Id = #{clerkCode} or old_value like concat ('%',#{phoneNumber},'%')) and (related_Id = #{clerkCode}
<if test="phoneNumber != null and phoneNumber != ''">
or old_value like concat ('%',#{phoneNumber},'%')
</if>
)
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -573,4 +573,15 @@ ...@@ -573,4 +573,15 @@
and status_flag = 1 and status_flag = 1
and external_user_id = #{externalUserId} and external_user_id = #{externalUserId}
</select> </select>
<update id="updateMemberIdByMemberId">
UPDATE
tab_haoban_external_clerk_related
SET
member_id=#{memberId},
update_time = now()
where
member_id = #{oldMemberId}
and status_flag = 1
</update>
</mapper> </mapper>
\ No newline at end of file
import com.gic.haoban.common.utils.UuidUtil; import com.gic.haoban.common.utils.UuidUtil;
import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanOperationSettingMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanOperationSettingMapper;
import com.gic.haoban.manage.service.entity.TabHaobanOperationSetting; import com.gic.haoban.manage.service.entity.TabHaobanOperationSetting;
import com.gic.haoban.manage.service.service.ExternalClerkRelatedService;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -22,14 +24,13 @@ public class TestOperDatabase { ...@@ -22,14 +24,13 @@ public class TestOperDatabase {
@Autowired @Autowired
private TabHaobanOperationSettingMapper tabHaobanOperationSettingMapper; private TabHaobanOperationSettingMapper tabHaobanOperationSettingMapper;
@Autowired
private ExternalClerkRelatedService externalClerkRelatedService;
@Test @Test
public void testOperSetting() { public void testOperSetting() {
TabHaobanOperationSetting setting = new TabHaobanOperationSetting(); String s = externalClerkRelatedService.checkAndUpdateMemberByUnonId("ff8080815dacd3a2015dacd3ef5c0000", "ff8080817b95cd7e017b95f2c0ec009d", "orXl9t9_320bmRutZoL8YEpPAc00");
setting.setClerkPhoneFlag(1); System.out.println(s);
setting.setCreateTime(new Date());
setting.setSettingId(UuidUtil.randomUUID());
setting.setWxEnterpriseId("123123");
tabHaobanOperationSettingMapper.insert(setting);
} }
} }
...@@ -6,17 +6,14 @@ ...@@ -6,17 +6,14 @@
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-pom-base</artifactId> <artifactId>gic-pom-base</artifactId>
<version>3.0-SNAPSHOT</version> <version>3.0-SNAPSHOT</version>
<relativePath/>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>haoban-manage3-web</artifactId> <artifactId>haoban-manage3-web</artifactId>
<version>${libraryVersion}</version> <version>${libraryVersion}</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>haoban-manage3-web Maven Webapp</name> <name>haoban-manage3-web Maven Webapp</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<haobanService>1.0-SNAPSHOT</haobanService> <haobanService>1.0-SNAPSHOT</haobanService>
......
...@@ -5,6 +5,7 @@ import com.gic.haoban.manage.api.dto.OperationSettingDTO; ...@@ -5,6 +5,7 @@ import com.gic.haoban.manage.api.dto.OperationSettingDTO;
import com.gic.haoban.manage.api.service.OperationSettingApiService; import com.gic.haoban.manage.api.service.OperationSettingApiService;
import com.gic.haoban.manage.web.anno.HttpLimit; import com.gic.haoban.manage.web.anno.HttpLimit;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -30,7 +31,7 @@ public class SettingController extends WebBaseController { ...@@ -30,7 +31,7 @@ public class SettingController extends WebBaseController {
private HaobanResponse operationSettingSaveOrUpdate(OperationSettingDTO dto) { private HaobanResponse operationSettingSaveOrUpdate(OperationSettingDTO dto) {
// 保存或更新操作设置 // 保存或更新操作设置
if (Objects.isNull(dto) if (Objects.isNull(dto)
|| Objects.isNull(dto.getWxEnterpriseId())) { || StringUtils.isEmpty(dto.getWxEnterpriseId())) {
return resultResponse(HaoBanErrCode.ERR_2); return resultResponse(HaoBanErrCode.ERR_2);
} }
operationSettingApiService.saveOrUpdate(dto); operationSettingApiService.saveOrUpdate(dto);
......
...@@ -9,27 +9,30 @@ ...@@ -9,27 +9,30 @@
http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/context/spring-context.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<context:component-scan base-package="com.gic.haoban" /> <context:component-scan base-package="com.gic.haoban"/>
<!-- 应用名称 --> <!-- 应用名称 -->
<dubbo:application name="haoban-manage3-web"/> <dubbo:application name="haoban-manage3-web"/>
<dubbo:protocol name="dubbo" port="30009"/> <dubbo:protocol name="dubbo" port="30009"/>
<!-- 使用zookeeper注册中心暴露服务地址 --> <!-- 使用zookeeper注册中心暴露服务地址 -->
<!-- <dubbo:registry address="zookeeper://192.168.1.118:2181" protocol="dubbo" id="localAdd"/> --> <!-- <dubbo:registry address="zookeeper://192.168.1.118:2181" protocol="dubbo" id="localAdd"/> -->
<!--<dubbo:registry address="zookeeper://115.159.182.172:2199" protocol="dubbo" id="remoteAdd"/>--> <!--<dubbo:registry address="zookeeper://115.159.182.172:2199" protocol="dubbo" id="remoteAdd"/>-->
<!--<dubbo:registry address="zookeeper://localhost:2181|zookeeper://115.159.182.172:2199" protocol="dubbo"/>--> <!--<dubbo:registry address="zookeeper://localhost:2181|zookeeper://115.159.182.172:2199" protocol="dubbo"/>-->
<dubbo:reference interface="com.gic.haoban.manage.api.service.StaffApiService" id="staffApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.StaffApiService" id="staffApiService"
<dubbo:reference interface="com.gic.haoban.manage.api.service.StaffClerkRelationApiService" id="staffClerkRelationApiService"/> timeout="15000"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService" id="wxEnterpriseRelatedApiService" /> <dubbo:reference interface="com.gic.haoban.manage.api.service.StaffClerkRelationApiService"
id="staffClerkRelationApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService"
id="wxEnterpriseRelatedApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.ApplicationApiService" id="applicationApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.ApplicationApiService" id="applicationApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.WxEnterpriseApiService" id="wxEnterpriseApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.WxEnterpriseApiService" id="wxEnterpriseApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService" <dubbo:reference interface="com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService"
id="clerkMainStoreRelatedApiService"/> id="clerkMainStoreRelatedApiService"/>
<dubbo:reference interface="com.gic.enterprise.api.service.EnterpriseService" id="enterpriseService"/> <dubbo:reference interface="com.gic.enterprise.api.service.EnterpriseService" id="enterpriseService"/>
<dubbo:reference interface="com.gic.enterprise.api.service.StoreService" id="storeService"/> <dubbo:reference interface="com.gic.enterprise.api.service.StoreService" id="storeService"/>
<dubbo:reference interface="com.gic.enterprise.api.service.DepartmentService" id="departmentService"/> <dubbo:reference interface="com.gic.enterprise.api.service.DepartmentService" id="departmentService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.DepartmentApiService" id="departmentApiService"> <dubbo:reference interface="com.gic.haoban.manage.api.service.DepartmentApiService" id="departmentApiService">
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-pom-base</artifactId> <artifactId>gic-pom-base</artifactId>
<version>3.0-SNAPSHOT</version> <version>3.0-SNAPSHOT</version>
<relativePath/>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -112,9 +112,11 @@ public class AuditController extends WebBaseController { ...@@ -112,9 +112,11 @@ public class AuditController extends WebBaseController {
List<StaffClerkBindLogDetailDTO> list = page.getResult(); List<StaffClerkBindLogDetailDTO> list = page.getResult();
List<StaffClerkBindLogDetailVO> voList = new ArrayList<StaffClerkBindLogDetailVO>(); List<StaffClerkBindLogDetailVO> voList = new ArrayList<StaffClerkBindLogDetailVO>();
for (StaffClerkBindLogDetailDTO staffClerkBindLogDetailDTO : list) { for (StaffClerkBindLogDetailDTO staffClerkBindLogDetailDTO : list) {
StaffClerkBindLogDetailVO vo = EntityUtil.changeEntityByJSON(StaffClerkBindLogDetailVO.class, staffClerkBindLogDetailDTO); if (staffClerkBindLogDetailDTO.getChannelCode() != ChannelCodeEnum.AUDIT_BIND.getCode()) {
vo.setUnbindReason(ChannelCodeEnum.getNameByCode(vo.getChannelCode())); StaffClerkBindLogDetailVO vo = EntityUtil.changeEntityByJSON(StaffClerkBindLogDetailVO.class, staffClerkBindLogDetailDTO);
voList.add(vo); vo.setUnbindReason(ChannelCodeEnum.getNameByCode(vo.getChannelCode()));
voList.add(vo);
}
} }
Page<StaffClerkBindLogDetailVO> pageVO = new Page<>(); Page<StaffClerkBindLogDetailVO> pageVO = new Page<>();
pageVO.setCurrentPage(page.getCurrentPage()); pageVO.setCurrentPage(page.getCurrentPage());
......
...@@ -225,7 +225,11 @@ public class ClerkController extends WebBaseController{ ...@@ -225,7 +225,11 @@ public class ClerkController extends WebBaseController{
// 查询操作配置 // 查询操作配置
OperationSettingDTO dto = operationSettingApiService.getByWxEnterpriseId(wxEnterpriseId); OperationSettingDTO dto = operationSettingApiService.getByWxEnterpriseId(wxEnterpriseId);
if (Objects.isNull(dto)) { if (Objects.isNull(dto)) {
return resultResponse(HaoBanErrCode.ERR_8); OperationSettingVO vo = new OperationSettingVO();
vo.setWxEnterpriseId(wxEnterpriseId);
// 为空情况初始默认不生效
vo.setEffectFlag(0);
return resultResponse(HaoBanErrCode.ERR_1, vo);
} }
OperationSettingVO vo = EntityUtil.changeEntity(OperationSettingVO.class, dto); OperationSettingVO vo = EntityUtil.changeEntity(OperationSettingVO.class, dto);
// 是否开启导购编辑,如果不开启,默认无效 // 是否开启导购编辑,如果不开启,默认无效
...@@ -249,12 +253,20 @@ public class ClerkController extends WebBaseController{ ...@@ -249,12 +253,20 @@ public class ClerkController extends WebBaseController{
String nationcode = staffDTO.getNationCode(); String nationcode = staffDTO.getNationCode();
String postion = staffDTO.getPostion(); String postion = staffDTO.getPostion();
Integer sex = staffDTO.getSex(); Integer sex = staffDTO.getSex();
if(StringUtils.isAnyBlank(staffName,phoneNumber,commitName)) { if(StringUtils.isAnyBlank(staffName, commitName)) {
return resultResponse(HaoBanErrCode.ERR_10004); return resultResponse(HaoBanErrCode.ERR_10004);
} }
if(!GooglePhoneNumberUtil.checkPhoneNumber(phoneNumber, nationcode)){ if (StringUtils.isEmpty(clerkCode)) {
return resultResponse(HaoBanErrCode.ERR_111116);
}
if(StringUtils.isNotEmpty(phoneNumber) &&
!GooglePhoneNumberUtil.checkPhoneNumber(phoneNumber, nationcode)){
return resultResponse(HaoBanErrCode.ERR_10012); return resultResponse(HaoBanErrCode.ERR_10012);
} }
// 导购code校验-字母和数字
if (!clerkCode.matches("[a-zA-Z0-9]+")) {
return resultResponse(HaoBanErrCode.ERR_10023);
}
if(version == null){ if(version == null){
StaffDTO staff = staffApiService.selectByNationcodeAndPhoneNumber(wxEnterpriseId,nationcode,phoneNumber); StaffDTO staff = staffApiService.selectByNationcodeAndPhoneNumber(wxEnterpriseId,nationcode,phoneNumber);
if(staff != null) { if(staff != null) {
...@@ -278,7 +290,12 @@ public class ClerkController extends WebBaseController{ ...@@ -278,7 +290,12 @@ public class ClerkController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_10013); return resultResponse(HaoBanErrCode.ERR_10013);
} }
AuditSettingDTO dto = auditSettingApiService.findSettingByWxEnterpriseId(wxEnterpriseId); AuditSettingDTO dto = auditSettingApiService.findSettingByWxEnterpriseId(wxEnterpriseId);
if(dto.getClerkChangeFlag() == 1){ // 企业绑定详情-导购编辑权限
WxEnterpriseRelationDetailDTO enterpriseBindInfo = wxEnterpriseRelatedApiService
.getEnterpriseBindInfo(wxEnterpriseId, enterpriseId);
if(dto.getAuditFlag() == 1
&& dto.getClerkChangeFlag() == 1
&& enterpriseBindInfo.getClerkEditFlag() == 1) {
AuditDTO auditDTO =auditApiService.findByBindRelatedIdAndAuditType(clerkCode, AuditType.CLERK_ADD.getCode()); AuditDTO auditDTO =auditApiService.findByBindRelatedIdAndAuditType(clerkCode, AuditType.CLERK_ADD.getCode());
if(auditDTO !=null){ if(auditDTO !=null){
logger.info("已经存在了审核记录,待审核{}",clerkCode); logger.info("已经存在了审核记录,待审核{}",clerkCode);
......
...@@ -218,6 +218,8 @@ public enum HaoBanErrCode { ...@@ -218,6 +218,8 @@ public enum HaoBanErrCode {
ERR_10022(10022, "已有刷新在执行中,请不要重复刷新"), ERR_10022(10022, "已有刷新在执行中,请不要重复刷新"),
ERR_10023(10023, "code格式不正确"),
ERR_11122(11122,"手机号已存在"), ERR_11122(11122,"手机号已存在"),
ERR_11123(11123, "请到好办端刷新企业微信好友"), ERR_11123(11123, "请到好办端刷新企业微信好友"),
......
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