Commit 00bfe1b8 by 王祖波

Merge branch 'master' into feature-game2

# Conflicts:
#	haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/order/GicOrderController.java
parents 9e59d5d8 e021a777
......@@ -14,6 +14,16 @@ public class MemberStoreDTO implements Serializable {
private Integer hasRight;
private static final long serialVersionUID = 1L;
private String errmsg ;
public String getErrmsg() {
return errmsg;
}
public void setErrmsg(String errmsg) {
this.errmsg = errmsg;
}
public Integer getHasRight() {
return hasRight;
}
......
......@@ -127,6 +127,18 @@ public class StaffDTO implements Serializable {
* 企微激活码
*/
private String activeCode;
/**
* gic品牌名称
*/
private List<String> enterpriseNameList;
public List<String> getEnterpriseNameList() {
return enterpriseNameList;
}
public void setEnterpriseNameList(List<String> enterpriseNameList) {
this.enterpriseNameList = enterpriseNameList;
}
public String getActiveCode() {
return activeCode;
......
package com.gic.haoban.manage.api.dto;
import com.gic.haoban.base.api.common.BasePageInfo;
import java.io.Serializable;
import java.util.List;
/**
* @description: 列表查询VO
* @Author: wenhua
* @Date: 2023/5/17 10:45
*/
public class StaffListDTO implements Serializable {
/**
* 部门id
*/
private String departmentId;
/**
* 激活状态 - 后期删除
*/
private Integer activeFlag;
/**
* 关联状态
*/
private Integer relationFlag;
/**
* 关键字
*/
private String keyWord;
/**
* 许可状态 0 未激活,1 正常有效,2 即将过期,3 已过期,可多传,按‘,’隔开
*/
private String permitState;
/**
* 其他占用许可页面标志,传1返回该页面数据
*/
private Integer occupy;
/**
* 排序字段 不传默认create_time
*/
private String sortField = "create_time";
/**
* 排序类型 不传默认desc
*/
private String sortType = "desc";
/**
* 所属商户id
*/
private String enterpriseIdParam;
/**
* 分页参数
*/
private BasePageInfo pageInfo;
/**
* 企业微信id
*/
private String WxEnterpriseId;
/**
* 部门id数组
*/
private List<String> departmentIds;
public List<String> getDepartmentIds() {
return departmentIds;
}
public void setDepartmentIds(List<String> departmentIds) {
this.departmentIds = departmentIds;
}
public String getWxEnterpriseId() {
return WxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
WxEnterpriseId = wxEnterpriseId;
}
public String getDepartmentId() {
return departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public Integer getActiveFlag() {
return activeFlag;
}
public void setActiveFlag(Integer activeFlag) {
this.activeFlag = activeFlag;
}
public Integer getRelationFlag() {
return relationFlag;
}
public void setRelationFlag(Integer relationFlag) {
this.relationFlag = relationFlag;
}
public String getKeyWord() {
return keyWord;
}
public void setKeyWord(String keyWord) {
this.keyWord = keyWord;
}
public String getPermitState() {
return permitState;
}
public void setPermitState(String permitState) {
this.permitState = permitState;
}
public Integer getOccupy() {
return occupy;
}
public void setOccupy(Integer occupy) {
this.occupy = occupy;
}
public String getSortField() {
return sortField;
}
public void setSortField(String sortField) {
this.sortField = sortField;
}
public String getSortType() {
return sortType;
}
public void setSortType(String sortType) {
this.sortType = sortType;
}
public String getEnterpriseIdParam() {
return enterpriseIdParam;
}
public void setEnterpriseIdParam(String enterpriseIdParam) {
this.enterpriseIdParam = enterpriseIdParam;
}
public BasePageInfo getPageInfo() {
return pageInfo;
}
public void setPageInfo(BasePageInfo pageInfo) {
this.pageInfo = pageInfo;
}
}
package com.gic.haoban.manage.api.dto;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import java.io.Serializable;
import java.util.List;
......@@ -93,8 +94,13 @@ public class TransferActiveCodeDTO implements Serializable {
log.append("失败明细:");
for (int i=1;i<=this.failedList.size();i++){
Map<String, String> stringMap = this.failedList.get(i - 1);
String errorMessage = stringMap.get("errorMessage");
if (StrUtil.isNotBlank(errorMessage)){
log.append(i+".(转移成员:"+stringMap.get("handoverStaffName")+",接收成员:"+stringMap.get("takeoverStaffName")+",失败原因:"+errorMessage+");");
}else {
log.append(i+".(转移成员:"+stringMap.get("handoverStaffName")+",接收成员:"+stringMap.get("takeoverStaffName")+",失败原因错误码:"+stringMap.get("errorCode")+");");
}
}
//去掉末尾分号
String substring = log.substring(0, log.toString().length() - 1);
return substring;
......
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
public class WxEnterpriseRelatedDTO implements Serializable {
private String wxEnterpriseRelatedId;
private String wxEnterpriseId;
private String enterpriseId;
private String enterpriseName;
private String version;
private Integer statusFlag;
private Date createTime;
private Date updateTime;
private String staffId;
private String staffName;
private Integer wxEnterpriseType;
private Integer memberOpenCardFlag;
private Integer rangeType;
private Integer clerkEditFlag;
public Integer getClerkEditFlag() {
return clerkEditFlag;
}
public void setClerkEditFlag(Integer clerkEditFlag) {
this.clerkEditFlag = clerkEditFlag;
}
private static final long serialVersionUID = 1L;
public Integer getRangeType() {
return rangeType;
}
public void setRangeType(Integer rangeType) {
this.rangeType = rangeType;
}
public Integer getWxEnterpriseType() {
return wxEnterpriseType;
}
public void setWxEnterpriseType(Integer wxEnterpriseType) {
this.wxEnterpriseType = wxEnterpriseType;
}
public Integer getMemberOpenCardFlag() {
return memberOpenCardFlag;
}
public void setMemberOpenCardFlag(Integer memberOpenCardFlag) {
this.memberOpenCardFlag = memberOpenCardFlag;
}
public String getWxEnterpriseRelatedId() {
return wxEnterpriseRelatedId;
}
public void setWxEnterpriseRelatedId(String wxEnterpriseRelatedId) {
this.wxEnterpriseRelatedId = wxEnterpriseRelatedId == null ? null : wxEnterpriseRelatedId.trim();
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId == null ? null : wxEnterpriseId.trim();
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId == null ? null : enterpriseId.trim();
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version == null ? null : version.trim();
}
public Integer getStatusFlag() {
return statusFlag;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
}
\ No newline at end of file
package com.gic.haoban.manage.api.dto.hm;
import java.io.Serializable;
import java.util.List;
public class HmBatchCountDTO implements Serializable{
/**
* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
*/
private static final long serialVersionUID = 4873701412965622239L;
private int taskStatus ;
private String taskId ;
private int totalCount ;
private int successCount ;
private int failount ;
private List<HmBatchModifyResultDTO> failList ;
public int getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(int taskStatus) {
this.taskStatus = taskStatus;
}
public String getTaskId() {
return taskId;
}
public int getTotalCount() {
return totalCount;
}
public int getSuccessCount() {
return successCount;
}
public int getFailount() {
return failount;
}
public List<HmBatchModifyResultDTO> getFailList() {
return failList;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public void setSuccessCount(int successCount) {
this.successCount = successCount;
}
public void setFailount(int failount) {
this.failount = failount;
}
public void setFailList(List<HmBatchModifyResultDTO> failList) {
this.failList = failList;
}
}
\ No newline at end of file
package com.gic.haoban.manage.api.dto.hm;
import java.io.Serializable;
public class HmBatchModifyResultDTO implements Serializable{
/**
* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
*/
private static final long serialVersionUID = 5984478063344522210L;
private Long hmid;
private String hmCode ;
private String hmName;
private int errcode;
private String message;
public HmBatchModifyResultDTO(Long hmid, int errcode, String message) {
super();
this.hmid = hmid;
this.errcode = errcode;
this.message = message;
}
public String getHmCode() {
return hmCode;
}
public void setHmCode(String hmCode) {
this.hmCode = hmCode;
}
public Long getHmid() {
return hmid;
}
public String getHmName() {
return hmName;
}
public int getErrcode() {
return errcode;
}
public String getMessage() {
return message;
}
public void setHmid(Long hmid) {
this.hmid = hmid;
}
public void setHmName(String hmName) {
this.hmName = hmName;
}
public void setErrcode(int errcode) {
this.errcode = errcode;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.gic.haoban.manage.api.dto.qdto;
import java.io.Serializable;
import java.util.Date;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
* 好办消息通知
*
* @author fdh
*/
public class NoticeMessageQDTO implements Serializable {
/**
*
*/
private Long noticeMessageId;
/**
* 企业id
*/
private String enterpriseId;
/**
* 门店id
*/
private String storeId;
/**
* 导购id
*/
private String clerkId;
/**
* 类别 0客户相关、1任务相关、2活动相关、3其他
*/
private Integer categoryType;
/**
* 消息类型
*/
private Integer messageType;
private String templateCode;
/**
* 标题
*/
private String title;
/**
* 描述
*/
private String description;
/**
* 关联的具体业务消息id
*/
private String relationId;
/**
* 消息带的参数信息
*/
private String messageContent;
/**
* 0 未读 1已读
*/
private Integer readFlag;
/**
* 状态 0删除 1正常
*/
private Integer deleteFlag;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
*/
private static final long serialVersionUID = 1L;
public String getTemplateCode() {
return templateCode;
}
public void setTemplateCode(String templateCode) {
this.templateCode = templateCode;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.notice_message_id
*
* @return the value of tab_haoban_notice_message.notice_message_id
*/
public Long getNoticeMessageId() {
return noticeMessageId;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.notice_message_id
*
* @param noticeMessageId the value for tab_haoban_notice_message.notice_message_id
*/
public void setNoticeMessageId(Long noticeMessageId) {
this.noticeMessageId = noticeMessageId;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.enterprise_id
*
* @return the value of tab_haoban_notice_message.enterprise_id
*/
public String getEnterpriseId() {
return enterpriseId;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.enterprise_id
*
* @param enterpriseId the value for tab_haoban_notice_message.enterprise_id
*/
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.store_id
*
* @return the value of tab_haoban_notice_message.store_id
*/
public String getStoreId() {
return storeId;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.store_id
*
* @param storeId the value for tab_haoban_notice_message.store_id
*/
public void setStoreId(String storeId) {
this.storeId = storeId;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.clerk_id
*
* @return the value of tab_haoban_notice_message.clerk_id
*/
public String getClerkId() {
return clerkId;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.clerk_id
*
* @param clerkId the value for tab_haoban_notice_message.clerk_id
*/
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.category_type
*
* @return the value of tab_haoban_notice_message.category_type
*/
public Integer getCategoryType() {
return categoryType;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.category_type
*
* @param categoryType the value for tab_haoban_notice_message.category_type
*/
public void setCategoryType(Integer categoryType) {
this.categoryType = categoryType;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.message_type
*
* @return the value of tab_haoban_notice_message.message_type
*/
public Integer getMessageType() {
return messageType;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.message_type
*
* @param messageType the value for tab_haoban_notice_message.message_type
*/
public void setMessageType(Integer messageType) {
this.messageType = messageType;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.title
*
* @return the value of tab_haoban_notice_message.title
*/
public String getTitle() {
return title;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.title
*
* @param title the value for tab_haoban_notice_message.title
*/
public void setTitle(String title) {
this.title = title;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.description
*
* @return the value of tab_haoban_notice_message.description
*/
public String getDescription() {
return description;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.description
*
* @param description the value for tab_haoban_notice_message.description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.relation_id
*
* @return the value of tab_haoban_notice_message.relation_id
*/
public String getRelationId() {
return relationId;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.relation_id
*
* @param relationId the value for tab_haoban_notice_message.relation_id
*/
public void setRelationId(String relationId) {
this.relationId = relationId;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.message_content
*
* @return the value of tab_haoban_notice_message.message_content
*/
public String getMessageContent() {
return messageContent;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.message_content
*
* @param messageContent the value for tab_haoban_notice_message.message_content
*/
public void setMessageContent(String messageContent) {
this.messageContent = messageContent;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.read_flag
*
* @return the value of tab_haoban_notice_message.read_flag
*/
public Integer getReadFlag() {
return readFlag;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.read_flag
*
* @param readFlag the value for tab_haoban_notice_message.read_flag
*/
public void setReadFlag(Integer readFlag) {
this.readFlag = readFlag;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.delete_flag
*
* @return the value of tab_haoban_notice_message.delete_flag
*/
public Integer getDeleteFlag() {
return deleteFlag;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.delete_flag
*
* @param deleteFlag the value for tab_haoban_notice_message.delete_flag
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.create_time
*
* @return the value of tab_haoban_notice_message.create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.create_time
*
* @param createTime the value for tab_haoban_notice_message.create_time
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method returns the value of the database column tab_haoban_notice_message.update_time
*
* @return the value of tab_haoban_notice_message.update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method sets the value of the database column tab_haoban_notice_message.update_time
*
* @param updateTime the value for tab_haoban_notice_message.update_time
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.gic.haoban.manage.api.dto.qdto.hm;
import java.io.Serializable;
import java.util.List;
/**
*
* @ClassName: HmBatchModifyQO
* @Description: 活码批量修改成员
* @author xugh
* @date 2023年5月15日 上午10:25:42
*
*/
public class HmBatchModifyQDTO implements Serializable {
/**
* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
*/
private static final long serialVersionUID = 551906331625487555L;
private String wxEnterpriseId;
private String enterpriseId ;
private String optClerkId;
private String optName;
private List<Long> hmIdList;
// 1新增 2删除
private int optType;
private List<String> clerkIdList;
// 1 继续执行更新 2不废弃活码
private int updateType;
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public int getUpdateType() {
return updateType;
}
public void setUpdateType(int updateType) {
this.updateType = updateType;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public String getOptName() {
return optName;
}
public List<Long> getHmIdList() {
return hmIdList;
}
public int getOptType() {
return optType;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public void setOptName(String optName) {
this.optName = optName;
}
public void setHmIdList(List<Long> hmIdList) {
this.hmIdList = hmIdList;
}
public void setOptType(int optType) {
this.optType = optType;
}
public List<String> getClerkIdList() {
return clerkIdList;
}
public void setClerkIdList(List<String> clerkIdList) {
this.clerkIdList = clerkIdList;
}
public String getOptClerkId() {
return optClerkId;
}
public void setOptClerkId(String optClerkId) {
this.optClerkId = optClerkId;
}
}
......@@ -13,7 +13,8 @@ public enum PreDealTypeEnum {
friend(8, "第三方好友"),
friend_merge(9, "好友数据合并"),
tag(10, "标签"),
tag_member(11, "会员标签");
tag_member(11, "会员标签"),
modify_hm(20,"批量修改活码") ;
private int val;
private String name;
......
......@@ -16,7 +16,9 @@ public enum SyncTaskStatusEnum {
friend_sync(9),
merge_friend_sync(10),
tag(10),
member_tag(10);
member_tag(10) ,
modify_hm(21) ;
private int val;
......
......@@ -8,7 +8,8 @@ public enum SyncTaskTypeEnum {
FRIEND_SINGLE(4, "单个成员刷新好友"),
FRIEND_STORE(5, "刷新门店好友"),
MEMBER_TAG(6, "企业微信标签刷新"),
FRIEND_WX_ENTEPRISE(10, "企业好友初始化");
FRIEND_WX_ENTEPRISE(10, "企业好友初始化"),
BATCH_MODIFY_HM(20, "企微多人活码增加/剔除关联账号");
private int type;
private String taskName;
......
......@@ -53,13 +53,24 @@ public interface MemberUnionidRelatedApiService {
* 查看是否可以跳转会员详情的会员列表
*
* @param externalUserid
* @param wxUserId
* @param storeId
* @return
*/
List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String staffId, String storeId);
/**
*
* @Title: getMemberIdForDetail
* @Description: 好办打开会员详情-返回memberId
* @author xugh
* @param externalUserid
* @param staffId
* @return
* @throws
*/
com.gic.api.base.commons.ServiceResponse<MemberStoreDTO> getMemberIdForDetail(String externalUserid, String staffId, String enterpriseId);
/**
* 创建企业群发, 支出素材批量发送
*
* @param wxEnterpriseId : 微信企业id
......@@ -76,9 +87,6 @@ public interface MemberUnionidRelatedApiService {
* 创建企业群发, 支出素材批量发送
*
* @param wxEnterpriseId : 微信企业id
* @param staffId : 用户id
* @param extendUserList : 发送的用户id
* @param materialIdList : 素材id列表
* @return : 返回群发执行结果
*/
JSONResponse share(String wxEnterpriseId, List<String> clerkIdList, String message , List<ContentMaterialDTO> imgList);
......
......@@ -19,9 +19,7 @@ public interface StaffApiService {
List<StaffDepartmentRelatedDTO> listStaffDepartmentByStaffId(String staffId);
Page<StaffDTO> pageStaff(List<String> departmentId, Integer activeFlag,
String keyword, BasePageInfo pageInfo, Integer relationFlag, String wxEnterpriseId , String permitState,
Integer occupy);
Page<StaffDTO> pageStaff(StaffListDTO staffListDTO);
/**
* 保存微信成员
......@@ -337,4 +335,11 @@ public interface StaffApiService {
* @return
*/
com.gic.api.base.commons.ServiceResponse<Boolean> autoActivateCallBack(String params) ;
/**
* 查询企业微信对应的所有商户品牌信息
* @param wxEnterpriseId 企业微信id
* @return
*/
com.gic.api.base.commons.ServiceResponse<List<WxEnterpriseRelatedDTO>> getWxEnterpriseRelatedList(String wxEnterpriseId);
}
......@@ -65,4 +65,13 @@ public interface GroupChatPlanApiService {
public ServiceResponse<Void> del(String clerkId, String clerkName, Long planId);
public ServiceResponse<Void> stop(String clerkId, String clerkName, Long planId);
/**
* 查询社群群发待发送总数
* @param enterpriseId gic企业id
* @param clerkId 导购id
* @param storeId 门店id
* @return
*/
public ServiceResponse<Integer> getTotalCount(String enterpriseId,String clerkId,String storeId);
}
package com.gic.haoban.manage.api.service.hm;
import java.util.List;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.manage.api.dto.hm.HmBatchCountDTO;
import com.gic.haoban.manage.api.dto.hm.HmBatchModifyResultDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmBatchModifyQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import java.util.List;
/**
* @author mozhu
* @date 2022/7/5 09:33
......@@ -57,6 +60,17 @@ public interface HmQrcodeApiService {
ServiceResponse update(HmQrcodeQDTO hmQrcodeQDTO);
/**
*
* @Title: batchModifyHm
* @Description: 批量更新多人活码
* @author xugh
* @param qdto
* @return
* @throws
*/
public ServiceResponse batchUpdateHm(HmQrcodeQDTO qdto) ;
/**
* 查询详情
*
* @param hmId hb id
......@@ -179,4 +193,8 @@ public interface HmQrcodeApiService {
ServiceResponse<String> getClerkQrcode(String enterpriseId , String clerkId) ;
ServiceResponse<List<HmBatchModifyResultDTO>> batchModify(HmBatchModifyQDTO qdto) ;
ServiceResponse<HmBatchCountDTO> getModifyResult(String wxEnterpriseId , String taskId) ;
}
......@@ -5,6 +5,7 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.notify.dto.NoticeMessageInfoDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO;
import com.gic.haoban.manage.api.dto.qdto.NoticeMessageQDTO;
import java.util.List;
......@@ -82,4 +83,12 @@ public interface NoticeMessageApiService {
*/
public ServiceResponse<Boolean> updateWriteFlagByClerkId(String enterpriseId, String clerkId, int categoryType);
/**
* 新增好办内部通知
*
* @param qdto
* @return
*/
public ServiceResponse<Boolean> addOrCreateNoticeMessage(List<NoticeMessageQDTO> qdto);
}
\ No newline at end of file
......@@ -196,6 +196,12 @@
<artifactId>gic-order-api</artifactId>
<version>${gic-order-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-message-center-api</artifactId>
<version>${gic-message-center-api}</version>
</dependency>
</dependencies>
<build>
......
package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.api.dto.SyncCheckDTO;
import com.gic.haoban.manage.service.entity.TabHaobanPreDealLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -116,6 +115,10 @@ public interface PreDealLogMapper {
*/
public List<TabHaobanPreDealLog> listRebuildDepartByTaskId(@Param("taskId") String taskId);
public List<TabHaobanPreDealLog> listAllByTaskId(@Param("taskId") String taskId);
/**
* 统计重试任务数量
*
......
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.pojo.bo.StaffListBO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
......@@ -37,13 +38,7 @@ public interface StaffMapper {
List<TabHaobanStaff> listLikeName(@Param("staffName") String staffName, @Param("wxEnterpriseId") String wxEnterpriseId);
Page<TabHaobanStaff> pageStaff(@Param("staffIds") List<String> staffIds,
@Param("activeFlag") Integer activeFlag,
@Param("keyword") String keyword,
@Param("departmentIds") List<String> departmentIds,
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("relationFlag") Integer relationFlag,@Param("permitState")String permitState,
@Param("occupy")Integer occupy);
Page<TabHaobanStaff> pageStaff(StaffListBO staffListBO);
List<TabHaobanStaff> listByPhoneNumber(@Param("phoneNumber") String phoneNumber);
......
......@@ -37,4 +37,6 @@ public interface SyncTaskMapper {
List<TabHaobanSyncTask> listPageByWxEid(String wxEnterpriseId);
List<TabHaobanSyncTask> listTaskByType(@Param("taskType")int taskType);
TabHaobanSyncTask getSyncNewestTask(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("taskType")int taskType);
}
\ No newline at end of file
......@@ -121,4 +121,14 @@ public interface TabHaobanStaffClerkRelationMapper {
List<StaffClerkRelationDTO> listByStoreIds(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("storeIds") List<String> storeIds);
List<String> listAllClerkIdsByEnterpriseId(@Param("enterpriseId") String enterpriseId);
/**
* 根据staffId查询gic品牌id
* @param wxEnterpriseId 企业微信id
* @param staffIdList 成员id数组
* @return
*/
List<StaffClerkRelationDTO> listByWxEnterpriseIdAndStaffId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIdList") Set<String> staffIdList);
List<String> listAllStaffIdByEnterpriseId(@Param("enterpriseId") String enterpriseId,@Param("wxEnterpriseId") String wxEnterpriseId);
}
\ No newline at end of file
......@@ -44,4 +44,13 @@ public interface GroupChatPlanOwnerLogMapper {
public List<GroupChatPlanOwnerLogDTO> listOwnerLogPageForWxa(GroupChatPlanSearchQDTO qdto);
public GroupChatPlanOwnerLogDTO getOwnerInfo(@Param("planId")Long planId, @Param("staffId")String staffId, @Param("clerkId")String clerkId, @Param("wxEnterpriseId")String wxEnterpriseId);
/**
* 查询社群群发待发送总数
* @param enterpriseId gic企业id
* @param clerkId 导购id
* @param storeId 门店id
* @return
*/
Integer getTotalCount(@Param("enterpriseId")String enterpriseId,@Param("clerkId")String clerkId,@Param("storeId")String storeId);
}
\ No newline at end of file
......@@ -87,6 +87,8 @@ public interface TabHaobanHmClerkRelationMapper {
*/
List<TabHaobanHmClerkRelation> getHmClerkByHmId(@Param("hmId") Long hmId);
List<TabHaobanHmClerkRelation> listHmClerkByHmIdList(@Param("hmIdList") List<Long> hmIdList) ;
/**
* 根据hmid 获取导购信息
* @param hmId
......
......@@ -24,6 +24,10 @@ public interface TabHaobanHmQrcodeMapper {
*/
TabHaobanHmQrcode queryById(@Param("hmId") Long hmId);
List<TabHaobanHmQrcode> queryByIdList(@Param("hmIds") List<Long> hmIds);
/**
* 新增数据
*
......
......@@ -109,7 +109,7 @@ public interface TabHaobanLicenceOrderMapper {
* @param qywxOrderId
* @return
*/
Integer saveQywxOrderId(@Param("orderId") Long orderId, @Param("qywxOrderId") String qywxOrderId);
Integer saveQywxOrderId(@Param("orderId") Long orderId, @Param("qywxOrderId") String qywxOrderId,@Param("qywxExpireTime") Date qywxExpireTime);
List<String> getTransactionIdList(@Param("orderNumber") String orderNumber, @Param("wxEnterpriseId") String wxEnterpriseId);
......
package com.gic.haoban.manage.service.errorcode;
/**
* Created by fudh on 2018/3/4.
*/
public enum QywxErrCode {
ERR_701017("701017","帐号30天内迁移过"),
;
private String code;
private String msg;
QywxErrCode(String code, String msg) {
this.code = code;
this.msg = msg;
}
public static QywxErrCode getValue(String code) {
for (QywxErrCode sec : QywxErrCode.values()) {
if (code.equals(sec.getCode())) {
return sec;
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
package com.gic.haoban.manage.service.pojo.bo;
import com.gic.haoban.base.api.common.BasePageInfo;
import java.io.Serializable;
import java.util.List;
/**
* @description: 列表查询VO
* @Author: wenhua
* @Date: 2023/5/17 10:45
*/
public class StaffListBO implements Serializable {
/**
* 部门id
*/
private String departmentId;
/**
* 激活状态 - 后期删除
*/
private Integer activeFlag;
/**
* 关联状态
*/
private Integer relationFlag;
/**
* 关键字
*/
private String keyWord;
/**
* 许可状态 0 未激活,1 正常有效,2 即将过期,3 已过期,可多传,按‘,’隔开
*/
private String permitState;
/**
* 其他占用许可页面标志,传1返回该页面数据
*/
private Integer occupy;
/**
* 排序字段 不传默认create_time
*/
private String sortField = "create_time";
/**
* 排序类型 不传默认desc
*/
private String sortType = "desc";
/**
* 所属商户id
*/
private String enterpriseIdParam;
/**
* 分页参数
*/
private BasePageInfo pageInfo;
/**
* 企业微信id
*/
private String WxEnterpriseId;
/**
* 部门id数组
*/
private List<String> departmentIds;
/**
* 关联成员id数组
*/
private List<String> staffIds;
public List<String> getStaffIds() {
return staffIds;
}
public void setStaffIds(List<String> staffIds) {
this.staffIds = staffIds;
}
public List<String> getDepartmentIds() {
return departmentIds;
}
public void setDepartmentIds(List<String> departmentIds) {
this.departmentIds = departmentIds;
}
public String getWxEnterpriseId() {
return WxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
WxEnterpriseId = wxEnterpriseId;
}
public String getDepartmentId() {
return departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public Integer getActiveFlag() {
return activeFlag;
}
public void setActiveFlag(Integer activeFlag) {
this.activeFlag = activeFlag;
}
public Integer getRelationFlag() {
return relationFlag;
}
public void setRelationFlag(Integer relationFlag) {
this.relationFlag = relationFlag;
}
public String getKeyWord() {
return keyWord;
}
public void setKeyWord(String keyWord) {
this.keyWord = keyWord;
}
public String getPermitState() {
return permitState;
}
public void setPermitState(String permitState) {
this.permitState = permitState;
}
public Integer getOccupy() {
return occupy;
}
public void setOccupy(Integer occupy) {
this.occupy = occupy;
}
public String getSortField() {
return sortField;
}
public void setSortField(String sortField) {
this.sortField = sortField;
}
public String getSortType() {
return sortType;
}
public void setSortType(String sortType) {
this.sortType = sortType;
}
public String getEnterpriseIdParam() {
return enterpriseIdParam;
}
public void setEnterpriseIdParam(String enterpriseIdParam) {
this.enterpriseIdParam = enterpriseIdParam;
}
public BasePageInfo getPageInfo() {
return pageInfo;
}
public void setPageInfo(BasePageInfo pageInfo) {
this.pageInfo = pageInfo;
}
}
package com.gic.haoban.manage.service.pojo.bo.content.binlog;
import com.alibaba.fastjson.annotation.JSONField;
import com.gic.haoban.manage.service.pojo.BinlogBasePojo;
/**
* @Author MUSI
* @Date 2023/5/10 9:43 AM
* @Description
* @Version
**/
public class MaterialMemberUnionIdPoJo extends BinlogBasePojo {
/**
* 会员unionId
*
*/
@JSONField(name = "third_unionid")
private String unionId;
/**
* memberId
*/
@JSONField(name = "member_id")
private String memberId;
public String getUnionId() {
return unionId;
}
public void setUnionId(String unionId) {
this.unionId = unionId;
}
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
}
......@@ -2,8 +2,10 @@ package com.gic.haoban.manage.service.pojo.bo.content.context;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.enums.content.MaterialReportType;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO;
......@@ -13,11 +15,11 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import static com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY;
/**
* @Author MUSI
......@@ -106,16 +108,22 @@ public class MaterialReportContext {
log.info("成员{}为区经角色, 不发送小程序消息通知 ", this.staffId);
return Collections.emptyList();
}
final NoticeMessageTypeEnum noticeMessageTypeEnum = MaterialReportType.WEEK.getCode().equals(this.getReportType()) ? NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_WEEK : NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_MONTH;
if (ObjectUtil.isNull(noticeMessageTypeEnum)){
return new ArrayList<>();
}
return this.staffClerkRelations
.stream()
.map(item -> {
NoticeMessageBO noticeMessageBO = new NoticeMessageBO();
noticeMessageBO.setCategoryType(MATERIAL_REPORT_NOTIFY.getCategory());
noticeMessageBO.setMessageType(MATERIAL_REPORT_NOTIFY.getType());
noticeMessageBO.setCategoryType(noticeMessageTypeEnum.getCategory());
noticeMessageBO.setMessageType(noticeMessageTypeEnum.getType());
noticeMessageBO.setClerkId(StringUtils.isNotBlank(item.getClerkId()) ? item.getClerkId() : "-1");
noticeMessageBO.setStoreId(StringUtils.isNotBlank(item.getStoreId()) ? item.getStoreId() : "-1");
noticeMessageBO.setTitle(this.getMessageTitle());
noticeMessageBO.setTemplateCode(MATERIAL_REPORT_NOTIFY.getTemplateCode());
noticeMessageBO.setTemplateCode(noticeMessageTypeEnum.getTemplateCode());
noticeMessageBO.setDescription(this.getMessageDesc());
noticeMessageBO.setEnterpriseId(this.enterpriseId);
noticeMessageBO.setRelationId(this.clerkId);
......
......@@ -177,4 +177,19 @@ public interface StaffClerkRelationService {
* @return
*/
List<String> listAllClerkIdsByEnterpriseId(String enterpriseId);
/**
* 根据staffId查询gic品牌id
* @param wxEnterpriseId 企业微信id
* @param staffIdList 成员id数组
* @return
*/
List<StaffClerkRelationDTO> listByWxEnterpriseIdAndStaffId(String wxEnterpriseId, Set<String> staffIdList);
/**
* 获取企业下所有关联成员id
* @param enterpriseId
* @return
*/
List<String> listAllStaffIdByEnterpriseId(String enterpriseId,String wxEnterpriseId);
}
......@@ -7,6 +7,7 @@ import java.util.List;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.pojo.bo.StaffListBO;
import com.github.pagehelper.Page;
public interface StaffService {
......@@ -17,9 +18,7 @@ public interface StaffService {
String add(TabHaobanStaff tab);
Page<TabHaobanStaff> pageStaff(List<String> staffIds, Integer activeFlag,
String keyword, List<String> departmentIds, String wxEnterpriseId, Integer relationFlag,String permitState,
Integer occupy);
Page<TabHaobanStaff> pageStaff(StaffListBO staffListBO);
void updateByPrimaryKey(TabHaobanStaff tab);
......
......@@ -37,6 +37,9 @@ public interface SyncTaskService {
*/
public TabHaobanSyncTask getSyncTask(String taskId);
public TabHaobanSyncTask getSyncNewestTask(String wxEnterpriseId , int taskType);
/**
* 获取任务列表
*
......
......@@ -35,4 +35,13 @@ public interface GroupChatPlanOwnerLogService {
public GroupChatPlanOwnerLogDTO getOwnerInfo(Long planId, String staffId, String clerkId, String wxEnterpriseId);
/**
* 查询社群群发待发送总数
* @param enterpriseId gic企业id
* @param clerkId 导购id
* @param storeId 门店id
* @return
*/
Integer getTotalCount(String enterpriseId,String clerkId,String storeId);
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -213,9 +214,9 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId);
return;
}
if (CollectionUtils.isNotEmpty(qwChatIdList)) {
// 处理要踢的
for (String wxChatId : qwChatIdList) {
List<String> bakQwChatIdList = EntityUtil.changeEntityListByJSON(String.class, qwChatIdList);
for (String wxChatId : bakQwChatIdList) {
TabGroupChat chat = this.groupChatMapper.selectByWxChatIdDk(wxEnterpriseId, wxChatId);
if (null == chat) {
continue;
......@@ -233,15 +234,29 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
}
}
}
boolean flag = false ;
if (null != cid) {
logger.info("hm={},群={},要删={}", wxChatId, qwChatIdList, cid.getWxChatId());
qwChatIdList.remove(cid.getWxChatIdDk());
Iterator<String> it = qwChatIdList.iterator() ;
while(it.hasNext()) {
if(it.next().equals(cid.getWxChatIdDk())) {
it.remove();
flag = true ;
break ;
}
}
}
if(flag) {
break ;
}
}
logger.info("处理后群活码应有的群={}", qwChatIdList);
// 保存活码
List<TabGroupChat> list = this.groupChatMapper.listByWxWxChatIdListDk(wxEnterpriseId,
qwChatIdList);
if (CollectionUtils.isEmpty(list)) {
if (CollectionUtils.isEmpty(list) || list.size() != qwChatIdList.size()) {
this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId);
logger.info("查询群列表空,dkList={}", qwChatIdList);
logger.info("查询群列表空,或数量不一致,dkList={}", qwChatIdList);
return;
}
List<Long> groupChatIdList = list.stream().map(dto -> dto.getGroupChatId())
......@@ -252,9 +267,6 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
}
}
}
}
}
}
@Override
public ServiceResponse<GroupChatHmDTO> saveHm(GroupChatHmDTO dto) {
......
......@@ -255,4 +255,9 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
return dto;
}
@Override
public Integer getTotalCount(String enterpriseId, String clerkId, String storeId) {
return groupChatPlanOwnerLogMapper.getTotalCount(enterpriseId,clerkId,storeId);
}
}
\ No newline at end of file
package com.gic.haoban.manage.service.service.content.adaptor;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
......@@ -22,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
......@@ -198,7 +200,9 @@ public class MaterialReportBuilder {
articleInfo.setTitle(context.getMessageTitle());
articleInfo.setDescription(context.getMessageDesc());
String extendParams = StringUtils.isNotBlank(context.getMainStoreId()) ? context.getMainStoreId() : context.getEnterpriseId();
articleInfo.setPagepath(NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY, context.extendParams(extendParams)));
final NoticeMessageTypeEnum noticeMessageTypeEnum = MaterialReportType.WEEK.getCode().equals(context.getReportType()) ? NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_WEEK : NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_MONTH;
articleInfo.setPagepath(NoticeMessageUtil.buildMiniAppUrl(noticeMessageTypeEnum, context.extendParams(extendParams)));
articleInfo.setPicurl(context.getMaterialReportUrl());
newsSendMessage.setArticleMessages(Collections.singletonList(articleInfo));
return newsSendMessage;
......
package com.gic.haoban.manage.service.service.content.adaptor;
import com.alibaba.fastjson.JSON;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
......@@ -15,7 +16,10 @@ import com.gic.haoban.manage.service.pojo.bo.content.context.PotentialCustomerNo
import com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService;
import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.message.NoticeMessageHandler;
import com.gic.haoban.manage.service.service.notify.NoticeMessageService;
import com.gic.haoban.manage.service.util.ApolloUtils;
import com.gic.message.center.api.subscribe.model.NoticeMessageForm;
import com.gic.wechat.api.dto.qywx.ItemDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
......@@ -28,6 +32,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -60,6 +65,8 @@ public class PotentialCustomerNotifyBuilder {
private Config config;
@Autowired
private StaffApiService staffApiService;
@Autowired
private NoticeMessageHandler noticeMessageHandler;
/**
* 获取企业下所有导购id
......@@ -189,10 +196,29 @@ public class PotentialCustomerNotifyBuilder {
log.info("企业信息不存在 {}", staffClerkRelation.getWxEnterpriseId());
continue;
}
if (!ApolloUtils.useMessageCenter()){
log.info("消息中心-走老版消息通知");
/* 消息中心修改此处*/
QywxXcxSendMessageDTO messageDTO = this.buildApplicationMessage(staffClerkRelation, wxEnterpriseQwDTO,
customerStaticsBOMap.get(staffClerkRelation.getClerkId()).getNum(), context.buildExtendParams(staffClerkRelation.getStoreId(), staffClerkRelation.getClerkId()));
boolean sendMessage = qywxSuiteApiService.sendMessage(wxEnterpriseQwDTO.getThirdCorpid(), wxEnterpriseQwDTO.getSelf3thSecret(), messageDTO,wxEnterpriseQwDTO.isSelf(),wxEnterpriseQwDTO.getUrlHost());
log.info("发送销售线索应用消息结果 {}", sendMessage);
} else {
Map<String, String> variableMap = new HashMap<>();
variableMap.put("memberNum", customerStaticsBOMap.get(staffClerkRelation.getClerkId()).getNum().toString());
variableMap.put("page", NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.POTENTIAL_CUSTOMER_NOTIFY, context.buildExtendParams(staffClerkRelation.getStoreId(), staffClerkRelation.getClerkId())));
noticeMessageHandler.sendMessage(NoticeMessageForm.builder()
.messageCode(NoticeMessageTypeEnum.POTENTIAL_CUSTOMER_NOTIFY.getMessageCode())
.mqRouterCode(NoticeMessageTypeEnum.POTENTIAL_CUSTOMER_NOTIFY.getRouterCode())
.businessId("-1")
.createTime(new Date())
.enterpriseId(context.getEnterpriseId())
.uniqueKey(UniqueIdUtils.uniqueLongHex())
.userIdList(Collections.singletonList(staffClerkRelation.getClerkId()))
.variableMap(variableMap).build());
}
}
}
......
package com.gic.haoban.manage.service.service.content.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.enums.content.MaterialReportType;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO;
......@@ -12,7 +18,11 @@ import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.content.MaterialReportService;
import com.gic.haoban.manage.service.service.content.adaptor.MaterialReportBuilder;
import com.gic.haoban.manage.service.service.message.NoticeMessageHandler;
import com.gic.haoban.manage.service.service.notify.NoticeMessageService;
import com.gic.haoban.manage.service.util.ApolloUtils;
import com.gic.message.center.api.subscribe.model.NoticeMessageForm;
import com.gic.wechat.api.dto.qywx.QywxNewsArticleMessageDTO;
import com.gic.wechat.api.dto.qywx.QywxNewsSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import lombok.extern.slf4j.Slf4j;
......@@ -21,7 +31,12 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author MUSI
......@@ -49,6 +64,9 @@ public class MaterialReportServiceImpl implements MaterialReportService {
@Autowired
private Config config;
@Autowired
private NoticeMessageHandler noticeMessageHandler;
/**
* 素材周报/月报
......@@ -87,13 +105,24 @@ public class MaterialReportServiceImpl implements MaterialReportService {
materialReportBuilder.buildMaterialReportData(context);
// 保存小程序消息
List<NoticeMessageBO> noticeMessageBos = context.buildNotifyMessageBos();
if (!ApolloUtils.useMessageCenter()){
log.info("消息中心-走老版消息通知");
/*消息中心修改此处*/
if (CollectionUtils.isNotEmpty(noticeMessageBos)) {
noticeMessageService.addNoticeMessageBatch(noticeMessageBos);
}
}
if (StringUtils.isBlank(context.getClerkId())) {
log.info("成员{}在企业{}中不存在主门店, 不推送企微应用消息", staffId, enterpriseId);
if (ApolloUtils.useMessageCenter()) {
noticeMessageService.addNoticeMessageBatch(noticeMessageBos);
}
return;
}
// 发送企微消息
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(staffInfo.getWxEnterpriseId());
QywxNewsSendMessageDTO newsSendMessageDTO = materialReportBuilder.buildQywxNewsMessage(context, qwDTO);
......@@ -102,7 +131,46 @@ public class MaterialReportServiceImpl implements MaterialReportService {
return;
}
log.info("发送企业图文消息参数{}", JSON.toJSONString(newsSendMessageDTO));
if (!ApolloUtils.useMessageCenter()){
log.info("消息中心-走老版消息通知");
/*消息中心修改此处*/
boolean result = qywxSuiteApiService.sendMessage(qwDTO.getThirdCorpid(), qwDTO.getSelf3thSecret(), newsSendMessageDTO,qwDTO.isSelf(),qwDTO.getUrlHost());
log.info("成员{}发送素材企微使用报告结果 {}", staffId, result);
return;
} else {
Map<String, String> variableMap = new HashMap<>();
QywxNewsArticleMessageDTO qywxNewsArticleMessageDTO = newsSendMessageDTO.getArticleMessages().get(0);
variableMap.put("image", qywxNewsArticleMessageDTO.getPicurl());
variableMap.put("page", qywxNewsArticleMessageDTO.getPagepath());
variableMap.put("templateTitle", qywxNewsArticleMessageDTO.getTitle());
variableMap.put("templateDescription", qywxNewsArticleMessageDTO.getDescription());
variableMap.put("haobanNoticeMessageList", JSONObject.toJSONString(noticeMessageBos));
NoticeMessageTypeEnum noticeMessageTypeEnum = null;
if (MaterialReportType.WEEK.getCode().equals(context.getReportType())) {
noticeMessageTypeEnum = NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_WEEK;
} else if (MaterialReportType.MONTH.getCode().equals(context.getReportType())) {
noticeMessageTypeEnum = NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_MONTH;
}
if (ObjectUtil.isNull(noticeMessageTypeEnum)){
log.info("枚举不存在 context:{}", JSONObject.toJSONString(context));
return;
}
noticeMessageHandler.sendMessage(NoticeMessageForm.builder()
.messageCode(noticeMessageTypeEnum.getMessageCode())
.mqRouterCode(noticeMessageTypeEnum.getRouterCode())
.businessId("-1")
.createTime(new Date())
.enterpriseId(context.getEnterpriseId())
.uniqueKey(UniqueIdUtils.uniqueLongHex())
.userIdList(context.getClerkId() == null ? new ArrayList<>() : Collections.singletonList(context.getClerkId()))
.variableMap(variableMap).build());
}
/*boolean result = qywxSuiteApiService.sendMessage(qwDTO.getThirdCorpid(), qwDTO.getSelf3thSecret(), newsSendMessageDTO,qwDTO.isSelf(),qwDTO.getUrlHost());
log.info("成员{}发送素材企微使用报告结果 {}", staffId, result);*/
}
}
......@@ -21,6 +21,7 @@ import com.gic.haoban.manage.service.service.content.InteractRecordService;
import com.gic.haoban.manage.service.service.content.PotentialCustomerService;
import com.gic.haoban.manage.service.service.content.adaptor.InteractRecordMessageBuilder;
import com.gic.haoban.manage.service.service.content.adaptor.PotentialCustomerNotifyBuilder;
import com.gic.haoban.manage.service.util.ApolloUtils;
import com.gic.member.api.dto.es.MemberDataDTO;
import com.gic.member.api.service.MemberOutApiService;
import com.gic.search.engine.api.constant.MemberDataEnum;
......@@ -263,7 +264,13 @@ public class PotentialCustomerServiceImpl implements PotentialCustomerService {
// 区经 忽略
potentialCustomerNotifyBuilder.filterAreaManage(context);
// 构建应用内消息
/*消息中心修改此处*/
if (!ApolloUtils.useMessageCenter()){
log.info("消息中心-走老版消息通知");
/*消息中心修改此处*/
potentialCustomerNotifyBuilder.sendHaoBanNotifyMessage(context);
}
// 如果该导购id是成员在主门店时的导购id 发送应用消息
// 如果本批数据中无成员主门店数据 则不发送
potentialCustomerNotifyBuilder.sendApplicationMessage(context);
......
......@@ -2,6 +2,9 @@ package com.gic.haoban.manage.service.service.hm;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.hm.HmBatchModifyResultDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmBatchModifyQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmClerkRelationQDTO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmClerkRelationBO;
......@@ -143,4 +146,6 @@ public interface HmClerkRelationService {
*/
void updateByClerkChangeStore(String enterpriseId,String oldClerkId,String newClerkId) ;
ServiceResponse<List<HmBatchModifyResultDTO>> batchModify(HmBatchModifyQDTO qdto);
}
package com.gic.haoban.manage.service.service.hm;
import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
......@@ -9,7 +8,6 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO;
import java.util.List;
import org.apache.ibatis.annotations.Param;
/**
......
......@@ -130,11 +130,11 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ
}
} else {
//删除后 每次回调会员
for (TabHaobanExternalClerkRelated externalClerkRelated : deleteRelatedList) {
/*for (TabHaobanExternalClerkRelated externalClerkRelated : deleteRelatedList) {
String memberId = externalClerkRelated.getMemberId();
logger.info("通知会员 删除会员后更新为非企微好友时间 memberId:{}", memberId);
memberApiService.updateMemberQywxEveryOccasion(enterpriseId, memberId, 1, new Date());
}
}*/
}
//添加日志
WxUserAddLogQDTO wxUserAddLogQDTO = new WxUserAddLogQDTO();
......
......@@ -227,8 +227,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
memberApiService.updateMemberQywxEveryOccasion(enterpriseId, memberId, 0, new Date());
continue;
}
logger.info("通知会员 删除企微好友 每次调用更新为非企微好友时间 memberId:{}", memberId);
memberApiService.updateMemberQywxEveryOccasion(enterpriseId, memberId, 1, new Date());
//logger.info("通知会员 删除企微好友 每次调用更新为非企微好友时间 memberId:{}", memberId);
//memberApiService.updateMemberQywxEveryOccasion(enterpriseId, memberId, 1, new Date());
}
}
......@@ -296,9 +296,6 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
this.clerkMainStoreRelatedService.reflushExternal(wxEnterpriseId, staffId);
}
//有活码权限的企业
boolean flag = rightService.hasRightForAdmin(enterpriseId, "hb_m0206");
if (flag) {
// 绑定自动创建活码
HmQrcodeQDTO hmQrcodeQDTO = new HmQrcodeQDTO();
hmQrcodeQDTO.setHmType(1);
hmQrcodeQDTO.setWxEnterpriseId(wxEnterpriseId);
......@@ -310,7 +307,6 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
hmQrcodeQDTO.setInvokingType(channelCode);
hmQrcodeApiService.add(hmQrcodeQDTO);
}
}
//推入日志
staffClerkBindLogService.pushToMq(staffId, optStaffId, BindTypeEnum.BIND.getVal(), channelCode, staffClerkRelationId);
}
......@@ -556,4 +552,14 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
public List<String> listAllClerkIdsByEnterpriseId(String enterpriseId) {
return this.mapper.listAllClerkIdsByEnterpriseId(enterpriseId);
}
@Override
public List<StaffClerkRelationDTO>listByWxEnterpriseIdAndStaffId(String wxEnterpriseId, Set<String> staffIdList) {
return this.mapper.listByWxEnterpriseIdAndStaffId(wxEnterpriseId,staffIdList);
}
@Override
public List<String> listAllStaffIdByEnterpriseId(String enterpriseId, String wxEnterpriseId) {
return this.mapper.listAllStaffIdByEnterpriseId(enterpriseId,wxEnterpriseId);
}
}
......@@ -4,6 +4,7 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
import com.gic.haoban.manage.service.pojo.bo.StaffListBO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -86,9 +87,18 @@ public class StaffServiceImpl implements StaffService {
}
@Override
public Page<TabHaobanStaff> pageStaff(List<String> staffIds, Integer activeFlag, String keyword,List<String> departmentIds,String wxEnterpriseId,Integer relationFlag,String permitState,
Integer occupy) {
return mapper.pageStaff(staffIds, activeFlag, keyword,departmentIds,wxEnterpriseId,relationFlag,permitState,occupy);
public Page<TabHaobanStaff> pageStaff(StaffListBO staffListBO) {
if (null == staffListBO){
return new Page<>();
}
String sortField = "a."+staffListBO.getSortField();
staffListBO.setSortField(sortField);
//业务需求:许可激活时间和过期时间增加升序和降序排序,时间为空的数据无论升序还是降序排序均排在最后
if("asc".equals(staffListBO.getSortType()) || "ASC".equals(staffListBO.getSortType())){
String s = "ISNULL("+sortField+"),"+sortField;
staffListBO.setSortField(s);
}
return mapper.pageStaff(staffListBO);
}
@Override
......
......@@ -52,6 +52,11 @@ public class SyncTaskServiceImpl implements SyncTaskService {
}
@Override
public TabHaobanSyncTask getSyncNewestTask(String wxEnterpriseId, int taskType) {
return syncTaskMapper.getSyncNewestTask(wxEnterpriseId,taskType);
}
@Override
public Page<SyncTaskDTO> listTaskPage(String wxEnterpriseId, BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo);
List<TabHaobanSyncTask> list = syncTaskMapper.listPageByWxEid(wxEnterpriseId);
......
......@@ -112,7 +112,7 @@ public interface LicenceOrderService {
* @param qywxOrderId
* @return
*/
Integer saveQywxOrderId(Long orderId, String qywxOrderId);
Integer saveQywxOrderId(Long orderId, String qywxOrderId,Date qywxExpireTime);
/**
* 查询订单编号id
......
......@@ -247,8 +247,8 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
}
@Override
public Integer saveQywxOrderId(Long orderId, String qywxOrderId) {
return tabHaobanLicenceOrderMapper.saveQywxOrderId(orderId,qywxOrderId);
public Integer saveQywxOrderId(Long orderId, String qywxOrderId,Date qywxExpireTime) {
return tabHaobanLicenceOrderMapper.saveQywxOrderId(orderId,qywxOrderId,qywxExpireTime);
}
@Override
......
package com.gic.haoban.manage.service.service.message;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.manage.service.service.notify.out.NoticeMessageApiServiceImpl;
import com.gic.message.center.api.subscribe.model.NoticeMessageForm;
import com.gic.mq.sdk.GicMQClient;
import org.slf4j.Logger;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import static org.slf4j.LoggerFactory.getLogger;
/**
* @description: 企业微信通知消息发送处理类
* @author: 巴弗
* @createDate: 2023/4/21 14:03
*/
@Service
public class NoticeMessageHandler {
private static final Logger logger = getLogger(NoticeMessageHandler.class);
/**
* 发送小程序消息
*/
public void sendMessage(NoticeMessageForm noticeMessageForm){
logger.info("消息中心发送消息实体:{}", JSONObject.toJSONString(noticeMessageForm));
if (ObjectUtil.isEmpty(noticeMessageForm.getMessageCode()) || ObjectUtil.isEmpty(noticeMessageForm.getMqRouterCode())) {
logger.info("消息中心发送消息实体 messageCode 或 mqRouterCode 不存在");
}
GicMQClient client = GICMQClientUtil.getClientInstance();
try {
client.sendMessage(noticeMessageForm.getMqRouterCode(), JSONObject.toJSONString(noticeMessageForm));
} catch (Exception e) {
logger.error("消息中心发送消息实体发送异常 ", e);
}
}
}
......@@ -125,7 +125,10 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
} else if (dataType.equals(PreDealTypeEnum.tag_member.getVal())) {
logger.info("11 会员标签处理标签项:{}", params);
operationMap.get("friendMemberTagSyncOperation").dealSingleByMq(dealParamMqDTO, dataPre);
} else {
} else if(dataType.equals(PreDealTypeEnum.modify_hm.getVal())) {
logger.info("20 活码批量修改");
operationMap.get("qwHmOperation").dealSingleByMq(dealParamMqDTO, dataPre);
}else {
logger.info("不是正常数据类型:{}", params);
}
}
......
......@@ -266,6 +266,66 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
@Override
public com.gic.api.base.commons.ServiceResponse<MemberStoreDTO> getMemberIdForDetail(String externalUserid,
String staffId, String enterpriseId) {
MemberStoreDTO dto = new MemberStoreDTO();
log.info("好办顾客详情={},staffId={}",externalUserid,staffId);
List<TabHaobanExternalClerkRelated> list = externalClerkRelatedService.listByExternalUseridAndWxUserId(externalUserid, staffId);
if (CollectionUtil.isEmpty(list)) {
log.info("好友记录查不到");
dto.setErrmsg("客户不存在");
return com.gic.api.base.commons.ServiceResponse.success(dto) ;
}
TabHaobanExternalClerkRelated tab = list.get(0) ;
String memberId = tab.getMemberId();
if (StringUtils.isEmpty(memberId)) {
log.info("memberId为空");
dto.setErrmsg("客户不存在");
return com.gic.api.base.commons.ServiceResponse.success(dto) ;
}
if(!enterpriseId.equals(tab.getEnterpriseId())) {
log.info("客户在当前商户下不存在");
dto.setErrmsg("客户在当前商户下不存在");
return com.gic.api.base.commons.ServiceResponse.success(dto) ;
}
CustomerDTO params = new CustomerDTO();
params.setClerkType("0");
params.setStoreId(tab.getStoreId());
params.setClerkId(tab.getClerkId());
params.setEnterpriseId(tab.getEnterpriseId());
MemberInfoListParamsDTO memberInfoListParamsDTO = new MemberInfoListParamsDTO();
memberInfoListParamsDTO.setMemberId(memberId);
FilterListDTO filterListDTO = new FilterListDTO();
filterListDTO.setFilterType("4");
ChildDTO childDTO = new ChildDTO();
childDTO.setId("");
filterListDTO.setChild(childDTO);
List<FilterListDTO> filterList = new ArrayList<>();
filterList.add(filterListDTO);
memberInfoListParamsDTO.setFilterList(filterList);
List<StaffClerkRelationDTO> clerkRelationDTOS = staffClerkRelationService.listBindCodeByStaffId(null, staffId);
Set<String> enterpriseIdList = clerkRelationDTOS.stream().map(o -> o.getEnterpriseId()).collect(Collectors.toSet());
log.info("成员关联商户数={}",enterpriseIdList.size());
boolean flag = true ;
if (enterpriseIdList.size() > 1) {
flag = customerApiService.checkMemberRangeByMemberId(params, memberInfoListParamsDTO);
}
dto.setMemberId(tab.getMemberId());
dto.setStoreId(tab.getStoreId());
if (flag) {
dto.setHasRight(1);
} else {
dto.setHasRight(0);
}
return com.gic.api.base.commons.ServiceResponse.success(dto) ;
}
// 全部提审后废弃
@Override
@Deprecated
public List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String staffId, String storeId) {
List<TabHaobanExternalClerkRelated> list = externalClerkRelatedService.listByExternalUseridAndWxUserId(externalUserid, staffId);
List<MemberStoreDTO> result = new ArrayList<>();
......@@ -675,6 +735,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
//回调给会员,更新是否为企微好友
log.info("通知会员 合并会员后更新为企微好友,memberId:{}", memberId);
this.memberApiService.updateMemberQywxFlag(enterpriseId, memberId, 1);
this.memberApiService.updateMemberQywxEveryOccasion(enterpriseId, memberId, 1, new Date());
//定制事件订阅
addDelFriendEvent(unionId, clerkId, wxEnterpriseId, enterpriseId, memberId, storeId, 1);
return memberId;
......
......@@ -574,6 +574,7 @@ public class MessageApiServiceImpl implements MessageApiService {
}
@Override
@Deprecated
public com.gic.api.base.commons.ServiceResponse<Void> sendPreMessage(String enterpriseId, String storeId,
String message) {
log.info("线下预约通知,storeId={}", storeId);
......@@ -680,7 +681,11 @@ public class MessageApiServiceImpl implements MessageApiService {
Map<String, String> map = new HashMap<>();
if (CollectionUtils.isNotEmpty(valueList)) {
for (int i = 0; i < valueList.size(); i++) {
map.put("" + (i + 1), valueList.get(i));
String key = "" + (i + 1);
map.put(key, valueList.get(i));
if (key.equals("1")) {
map.put("goodsName", valueList.get(i));
}
}
}
MemberDataDTO member = this.findMember(enterpriseId,memberId);
......
......@@ -34,6 +34,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.StaffMapper;
import com.gic.haoban.manage.service.entity.*;
import com.gic.haoban.manage.service.errorcode.HaoBanErrCode;
import com.gic.haoban.manage.service.errorcode.QywxErrCode;
import com.gic.haoban.manage.service.pojo.bo.StaffListBO;
import com.gic.haoban.manage.service.service.*;
import com.gic.haoban.manage.service.service.chat.GroupChatService;
import com.gic.haoban.manage.service.util.EmojiFilterUtil;
......@@ -107,6 +110,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private QywxOrderApiService qywxOrderApiService;
@Autowired
private GroupChatService groupChatService;
@Autowired
private WxEnterpriseRelatedService wxEnterpriseRelatedService;
@Override
public StaffDTO selectById(String staffId) {
......@@ -137,25 +142,72 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public Page<StaffDTO> pageStaff(List<String> departmentIds, Integer activeFlag, String keyword, BasePageInfo pageInfo, Integer relationFlag, String wxEnterpriseId,String permitState,
Integer occupy) {
public Page<StaffDTO> pageStaff(StaffListDTO staffListDTO) {
if (null == staffListDTO){
return new Page<>();
}
logger.info("通讯录列表查询参数:{}",JSONObject.toJSONString(staffListDTO));
Integer relationFlag = staffListDTO.getRelationFlag();
String wxEnterpriseId = staffListDTO.getWxEnterpriseId();
BasePageInfo pageInfo = staffListDTO.getPageInfo();
String enterpriseIdParam = staffListDTO.getEnterpriseIdParam();
List<String> staffIds = new ArrayList<>();
//查询所属品牌成员id
if(StrUtil.isNotBlank(enterpriseIdParam)){
//-1表示查询成员所属商户是无归属的
if ("-1".equals(enterpriseIdParam)){
staffIds = staffClerkRelationService.listByWxEnterpriseId(wxEnterpriseId);
relationFlag = 0;
}else {
staffIds = staffClerkRelationService.listAllStaffIdByEnterpriseId(enterpriseIdParam, wxEnterpriseId);
relationFlag = 1;
}
if (CollectionUtils.isEmpty(staffIds)){
return new Page<>();
}
}else {
if (relationFlag != null) {
staffIds = staffClerkRelationService.listByWxEnterpriseId(wxEnterpriseId);
if (CollectionUtils.isEmpty(staffIds) && relationFlag == 1){
return new Page<>();
}
}
}
StaffListBO staffListBO = EntityUtil.changeEntityByJSON(StaffListBO.class, staffListDTO);
staffListBO.setStaffIds(staffIds);
staffListBO.setRelationFlag(relationFlag);
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
Page<StaffDTO> page = PageUtil.changePageHelperToCurrentPage(staffService.pageStaff(staffIds, activeFlag, keyword, departmentIds, wxEnterpriseId, relationFlag,permitState,occupy), StaffDTO.class);
Page<StaffDTO> page = PageUtil.changePageHelperToCurrentPage(staffService.pageStaff(staffListBO), StaffDTO.class);
List<StaffDTO> staffDTOList = page.getResult();
if (CollectionUtils.isEmpty(staffDTOList)) {
return new Page<>();
}
Set<String> staffIdList = staffDTOList.stream().map(dto -> dto.getStaffId()).collect(Collectors.toSet());
List<String> relationIdList = this.staffClerkRelationService.listRelationsStaffId(staffIdList);
//已关联的成员需要查询关联的品牌名称
List<TabHaobanWxEnterpriseRelated> list = wxEnterpriseRelatedService.getByWxEnterpriseId(wxEnterpriseId);
//解决空指针异常问题
Map<String, String> map = list.stream().collect(HashMap::new,(k, v) -> k.put(v.getEnterpriseId(), v.getEnterpriseName()), HashMap::putAll);
List<StaffClerkRelationDTO> relationDTOList = staffClerkRelationService.listByWxEnterpriseIdAndStaffId(wxEnterpriseId, staffIdList);
staffDTOList.forEach(one -> {
one.setRelationFlag(relationIdList.contains(one.getStaffId()) ? 1 : 0);
if(relationIdList.contains(one.getStaffId())){
one.setRelationFlag(1);
//查询导购关联关系表,找到对应的商户名称
List<String> enterpriseNameList = new ArrayList<>(8);
for (StaffClerkRelationDTO dto : relationDTOList){
if (dto.getStaffId().equals(one.getStaffId())){
enterpriseNameList.add(map.get(dto.getEnterpriseId()));
}
}
if (CollUtil.isNotEmpty(enterpriseNameList)){
//对商户名称去重
enterpriseNameList = enterpriseNameList.stream().distinct().collect(Collectors.toList());
one.setEnterpriseNameList(enterpriseNameList);
}
}else {
one.setRelationFlag(0);
}
});
return page;
}
......@@ -1036,6 +1088,11 @@ public class StaffApiServiceImpl implements StaffApiService {
stringMap.put("handoverStaffName",handoverStaff.getStaffName());
stringMap.put("takeoverStaffName",takeOverStaff.getStaffName());
stringMap.put("errorCode",String.valueOf(dto.getErrcode()));
QywxErrCode code = QywxErrCode.getValue(String.valueOf(dto.getErrcode()));
logger.info("错误code码:{}",JSON.toJSONString(code));
if (null != code){
stringMap.put("errorMessage",code.getMsg());
}
failedList.add(stringMap);
}
}
......@@ -1104,4 +1161,10 @@ public class StaffApiServiceImpl implements StaffApiService {
}
return com.gic.api.base.commons.ServiceResponse.success(true);
}
@Override
public com.gic.api.base.commons.ServiceResponse<List<WxEnterpriseRelatedDTO>> getWxEnterpriseRelatedList(String wxEnterpriseId) {
List<TabHaobanWxEnterpriseRelated> list = wxEnterpriseRelatedService.getByWxEnterpriseId(wxEnterpriseId);
return com.gic.api.base.commons.ServiceResponse.success(com.gic.haoban.common.utils.EntityUtil.changeEntityListByJSON(WxEnterpriseRelatedDTO.class, list));
}
}
......@@ -213,7 +213,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
, NoticeMessageTypeEnum.CLERK_DEL_AGREE.getType(), null, params, jsonObject);
} else {
NoticeMessageUtil.sendNoticeMessage(tab.getEnterpriseId(), tab.getClerkId()
, NoticeMessageTypeEnum.CLERK_DEL_AGREE.getType(), null, params, jsonObject);
, NoticeMessageTypeEnum.CLERK_DEL_REFUSE.getType(), null, params, jsonObject);
}
}
......
......@@ -148,6 +148,11 @@ public class GroupChatPlanApiServiceImpl implements GroupChatPlanApiService {
}
@Override
public ServiceResponse<Integer> getTotalCount(String enterpriseId, String clerkId, String storeId) {
return ServiceResponse.success(groupChatPlanOwnerLogService.getTotalCount(enterpriseId,clerkId,storeId));
}
@Override
public ServiceResponse<Page<GroupChatPlanOwnerLogDTO>> listOwnerLogPageForWxa(GroupChatPlanSearchQDTO qdto,
BasePageInfo basePageInfo) {
Page<GroupChatPlanOwnerLogDTO> page = this.groupChatPlanOwnerLogService.listOwnerLogPageForWxa(qdto,
......
......@@ -105,7 +105,7 @@ public class InteractRecordApiServiceImpl implements InteractRecordApiService {
// 会员授权事件
// 根据unionId 刷新 memberId 并写入销售线索
interactRecordService.memberAuthorized(memberAttrChangeBO.getMemberId(), memberAttrChangeBO.getUnionId());
// interactRecordService.memberAuthorized(memberAttrChangeBO.getMemberId(), memberAttrChangeBO.getUnionId());
}
if (MemberAttrChangeBO.MemberChangeOpt.MEMBER_MERGE.getCode().equals(memberAttrChangeBO.getOpt())) {
......
......@@ -25,7 +25,6 @@ import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.constants.Manage3Constants;
import com.gic.haoban.manage.api.dto.AlertMessageDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeAccountInterceptLogDTO;
import com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO;
import com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDetailDTO;
......@@ -90,15 +89,23 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
@Override
public void run(String param) {
GicMQClient instance = GICMQClientUtil.getClientInstance();
if("-1".equals(param)) {
List<TabHaobanWxEnterprise> tabHaobanWxEnterprises = wxEnterpriseService.listAll();
for (TabHaobanWxEnterprise wxEnterprise : tabHaobanWxEnterprises) {
GicMQClient instance = GICMQClientUtil.getClientInstance();
try {
instance.sendMessage("qywxAddFeeMq", wxEnterprise.getWxEnterpriseId());
} catch (Exception e) {
logger.info("发送消息处理异常:{}", e.getMessage(), e);
}
}
}else {
try {
instance.sendMessage("qywxAddFeeMq", param);
} catch (Exception e) {
logger.info("发送消息处理异常:{}", e.getMessage(), e);
}
}
}
private List<String> listOrderId(String corpid) {
......@@ -162,8 +169,8 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
}
String serviceCorpid = config.getCorpid();
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
if (wxEnterpriseDTO.getWxSecurityType() <= 0) {
logger.info("WxSecurityType=0,wxEnterpriseId={}", wxEnterpriseId);
if (wxEnterpriseDTO.getWxSecurityType() <= 0 || wxEnterpriseDTO.getWxSecurityType() == 5) {
logger.info("WxSecurityType=0/5,wxEnterpriseId={}", wxEnterpriseId);
return;
}
String corpid = wxEnterpriseDTO.getOpenCorpid();
......@@ -227,11 +234,7 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
// 成员的激活码信息
this.staffService.activedAccountTimer(wxEnterpriseId);
// 更新企业的激活数量统计
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ;
if(!qwDTO.isSelf()) {
this.wxEnterpriseActiveDataService.saveOrUpdate(wxEnterpriseId);
}
// 统计 haobanQywxFeeDetailDTO 30天内最新过期的时间和人数
HaobanQywxFeeDetailDTO haobanQywxFeeDetailDTO = haobanQywxFeeAccountStaffService.feeIntercept(wxEnterpriseId);
......@@ -254,8 +257,9 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
tabHaobanQywxFee.setInterceptFlag(0);
haobanQywxFeeService.insert(tabHaobanQywxFee);
// 判断今天是否是本月最后一天
if (DateUtil.isSameDay(DateUtil.endOfMonth(new Date()), new Date()) || "ca66a01b79474c40b3e7c7f93daf1a3b".equals(wxEnterpriseId)) {
int monthWillInterceptNum = haobanQywxFeeDetailDTO.getInterceptUserNum() ;
if (DateUtil.isSameDay(DateUtil.endOfMonth(new Date()), new Date())
|| "ca66a01b79474c40b3e7c7f93daf1a3b".equals(wxEnterpriseId)) {
int monthWillInterceptNum = haobanQywxFeeDetailDTO.getInterceptUserNum();
String content = "30天将有" + monthWillInterceptNum + "个接口许可证即将过期,您总共还剩余" + permissionUserNum
+ "个可用的接口许可证,请保证数量充足,如需增加请及时联系相关人员续费,避免影响使用";
messageAlert(wxEnterpriseId, corpName, corpid, AlertTypeEnum.FEE_ALARM.getName(), content);
......@@ -300,13 +304,13 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
TabHaobanQywxFeeOrderAccount activeAccount = new TabHaobanQywxFeeOrderAccount();
// 查询激活码的详情
List<List<String>> list = Lists.partition(codeList, 1000);
for (int i = 0; i < list.size(); i++) {
List<String> subCodeList = list.get(i);
List<ActiveInfoCodeResponseDTO> respList = qywxUserApiService.getActiveInfoByCodeList(corpid, serviceCorpid,
codeList);
subCodeList);
if (CollectionUtils.isNotEmpty(respList)) {
List<List<ActiveInfoCodeResponseDTO>> list = Lists.partition(respList, 800);
for (int i = 0; i < list.size(); i++) {
List<ActiveInfoCodeResponseDTO> subList = list.get(i);
for (ActiveInfoCodeResponseDTO activeDetail : subList) {
for (ActiveInfoCodeResponseDTO activeDetail : respList) {
String userid = activeDetail.getUserid();
String activeCode = activeDetail.getActiveCode();
activeAccount.setWxUserId(userid);
......
......@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
......@@ -17,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.esotericsoftware.minlog.Log;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
......@@ -31,9 +33,12 @@ import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.hm.HmBatchCountDTO;
import com.gic.haoban.manage.api.dto.hm.HmBatchModifyResultDTO;
import com.gic.haoban.manage.api.dto.hm.HmClerkDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmBatchModifyQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmClerkRelationQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
......@@ -42,7 +47,12 @@ import com.gic.haoban.manage.api.enums.WelcomeRelationStatusEnum;
import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.PreDealLogMapper;
import com.gic.haoban.manage.service.dao.mapper.hm.TabHaobanHmQrcodeMapper;
import com.gic.haoban.manage.service.entity.TabHaobanPreDealLog;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanSyncTask;
import com.gic.haoban.manage.service.entity.hm.TabHaobanHmQrcode;
import com.gic.haoban.manage.service.pojo.bo.hm.HmClerkRelationBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmGroupSettingBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
......@@ -51,6 +61,7 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO;
import com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO;
import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.SyncTaskService;
import com.gic.haoban.manage.service.service.WelcomeService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.hm.HmClerkRelationService;
......@@ -112,6 +123,12 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
private WelcomeService welcomeService;
@Autowired
private RightService rightService;
@Autowired
private SyncTaskService syncTaskService;
@Autowired
private PreDealLogMapper preDealLogMapper ;
@Autowired
private TabHaobanHmQrcodeMapper hmQrcodeMapper;
@GicLogRecord(value = "新增员工活码-${#logContent}",
category = GicLogRecordCategoryEnum.HUOMA,
......@@ -368,6 +385,42 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
return ServiceResponse.success();
}
@Override
public ServiceResponse batchUpdateHm(HmQrcodeQDTO qdto) {
String wxEnterpriseId = qdto.getWxEnterpriseId();
Long hmId = qdto.getHmId();
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
List<String> inClerkIdList = qdto.getClerkIdList() ;
List<String> userIds = staffClerkRelationService.listWxUserIdByClerkIds(inClerkIdList, wxEnterpriseId);
if (CollectionUtils.isEmpty(userIds)) {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "导购未关联好办");
}
qdto.setClerkIdList(inClerkIdList);
HmQrcodeBO hm = hmQrcodeService.queryById(hmId);
List<String> clerkIdList = this.setStoreClerk(qdto, wxEnterpriseId, hmId, hm.getHmType(), false);
if (CollectionUtils.isEmpty(clerkIdList)) {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "该导购已经生成过活码或未关联过好办");
}
userIds = staffClerkRelationService.listWxUserIdByClerkIds(inClerkIdList, wxEnterpriseId);
//更新活码
QywxExternalcontactDTO qywxExternalcontactDTO = new QywxExternalcontactDTO();
qywxExternalcontactDTO.setType(hm.getHmType());
qywxExternalcontactDTO.setRemark(hm.getName());
qywxExternalcontactDTO.setSkipVerify(hm.getPassFlag() == 1);
qywxExternalcontactDTO.setState("HM" + hmId);
qywxExternalcontactDTO.setConfigId(hm.getWxConfigId());
qywxExternalcontactDTO.setUser(userIds);
QywxResponseDTO qywxResponseDTO = qywxUserApiService.updateContactWay(qwDTO.getThirdCorpid(), qwDTO.getSelf3thSecret(), qywxExternalcontactDTO,qwDTO.isSelf(),qwDTO.getUrlHost());
if (qywxResponseDTO.getErrcode() != 0) {
logger.error("更新企微活码失败");
GicLogRecordEvaluationContext.noWriteLog();
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_0.getCode()), qywxResponseDTO.getErrmsg());
}
return ServiceResponse.success();
}
/**
* 修改活码操作日志
*
......@@ -787,11 +840,6 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
String enterpriseId = wxEnterpriseDTO.getEnterpriseId();
//查询出所有正常的导购
String wxEnterpriseId = wxEnterpriseDTO.getWxEnterpriseId();
boolean flag = rightService.hasRightForAdmin(enterpriseId, "hb_m0206");
if (!flag) {
logger.info("该企业未与gic关联,无需开启:enterpriseId:{},wxEnterpriseId:{}", enterpriseId, wxEnterpriseId);
continue;
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("wxEnterpriseId", wxEnterpriseId);
jsonObject.put("enterpriseId", enterpriseId);
......@@ -913,4 +961,62 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
public com.gic.api.base.commons.ServiceResponse<String> getClerkQrcode(String enterpriseId, String clerkId) {
return ServiceResponse.success(hmQrcodeService.getClerkQrcode(enterpriseId, clerkId));
}
@Override
public ServiceResponse<List<HmBatchModifyResultDTO>> batchModify(HmBatchModifyQDTO qdto) {
logger.info("批量修改活码={}",JSON.toJSONString(qdto));
ServiceResponse<List<HmBatchModifyResultDTO>> resp = this.hmClerkRelationService.batchModify(qdto) ;
return resp;
}
@Override
public ServiceResponse<HmBatchCountDTO> getModifyResult(String wxEnterpriseId, String taskId) {
TabHaobanSyncTask task = null ;
if(StringUtils.isNotEmpty(taskId)) {
task = syncTaskService.getSyncTask(taskId);
}else {
task = this.syncTaskService.getSyncNewestTask(wxEnterpriseId, 20) ;
}
if(null == task) {
Log.info("无批量活码处理数据");
HmBatchCountDTO dto= new HmBatchCountDTO();
dto.setTaskStatus(4);
return ServiceResponse.success(dto);
}
taskId = task.getTaskId() ;
HmBatchCountDTO dto = new HmBatchCountDTO() ;
dto.setTaskStatus(task.getStatusFlag());
dto.setTaskId(task.getTaskId());
if(task.getStatusFlag() != 4) {
return ServiceResponse.success(dto) ;
}
List<TabHaobanPreDealLog> list = this.preDealLogMapper.listAllByTaskId(taskId) ;
dto.setTotalCount(list.size());
int successCount = 0 , failCount = 0 ;
List<HmBatchModifyResultDTO> failList = new ArrayList<>();
for(TabHaobanPreDealLog o : list) {
if(o.getStatusFlag()==2) {
successCount = successCount + 1 ;
}else {
failCount = failCount +1 ;
HmBatchModifyResultDTO err = new HmBatchModifyResultDTO(Long.valueOf(o.getDataId()), 3, o.getReason()) ;
failList.add(err) ;
}
}
dto.setSuccessCount(successCount);
dto.setFailount(failCount);
if(CollectionUtils.isNotEmpty(failList)) {
List<Long> hmidList = failList.stream().map(o->o.getHmid()).collect(Collectors.toList()) ;
List<TabHaobanHmQrcode> qrcodeList = this.hmQrcodeMapper.queryByIdList(hmidList) ;
Map<Long,TabHaobanHmQrcode> qrcodeMap = qrcodeList.stream().collect(Collectors.toMap(TabHaobanHmQrcode::getHmId, o->o)) ;
failList.forEach(o->{
if(null != qrcodeMap.get(o.getHmid())) {
o.setHmCode(qrcodeMap.get(o.getHmid()).getHmCode());
o.setHmName(qrcodeMap.get(o.getHmid()).getName());
}
});
}
dto.setFailList(failList);
return ServiceResponse.success(dto);
}
}
......@@ -225,11 +225,11 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
//企业微信订单有效,无需重复创建
return ServiceResponse.success(order.getQywxOrderId());
}
if (null != dto && null != dto.getOrder() && dto.getOrder().getOrderStatus() == 3){
/* if (null != dto && null != dto.getOrder() && dto.getOrder().getOrderStatus() == 3){
//订单失效,记录企业微信订单状态
licenceOrderService.updateLicenceOrderType(order.getOrderId(), 3, order.getEnterpriseId(),
order.getWxEnterpriseId(), "系统", 0);
}
}*/
}
//创建企业微信订单
CreateOrderQDTO orderQDTO = new CreateOrderQDTO();
......@@ -250,8 +250,9 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
CreateOrderResponseDTO result = newOrder.getResult();
licenceOrderService.updateLicenceOrderType(order.getOrderId(), 0, order.getEnterpriseId(),
order.getWxEnterpriseId(), "系统", 0);
licenceOrderService.saveQywxOrderId(order.getOrderId(), result.getOrderId());
//企业微信订单过期时间更新,默认10天有效
Date qywxExpireTime = DateUtil.addDay(new Date(), 10);
licenceOrderService.saveQywxOrderId(order.getOrderId(), result.getOrderId(),qywxExpireTime);
return ServiceResponse.success(result.getOrderId());
}
return ServiceResponse.failure(newOrder.getCode(), newOrder.getMessage());
......
......@@ -16,7 +16,9 @@ import com.gic.haoban.manage.service.pojo.GroupSyncPojo;
import com.gic.haoban.manage.service.pojo.bo.content.binlog.MaterialMemberEOrderPojo;
import com.gic.haoban.manage.service.pojo.StoreSyncPojo;
import com.gic.haoban.manage.service.pojo.bo.content.binlog.MaterialMemberGicOrderPojo;
import com.gic.haoban.manage.service.pojo.bo.content.binlog.MaterialMemberUnionIdPoJo;
import com.gic.haoban.manage.service.service.StoreRangeService;
import com.gic.haoban.manage.service.service.content.InteractRecordService;
import com.gic.haoban.manage.service.service.content.PotentialCustomerService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeService;
import org.apache.commons.lang3.StringUtils;
......@@ -49,6 +51,8 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
private final String tab_gic_eorder = "tab_gic_eorder";
private final String tab_gic_order = "tab_gic_order";
private final String tab_gic_member = "tab_gic_member";
@Autowired
private StoreRangeService storeRangeService;
......@@ -59,6 +63,8 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
private HmQrcodeService hmQrcodeService;
@Autowired
PotentialCustomerService potentialCustomerService;
@Autowired
private InteractRecordService interactRecordService;
@Override
public void onMessage(ConsumerRecord<String, GicRecord> record) {
......@@ -95,6 +101,9 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
else if (StringUtils.startsWith(record.value().getTableName(), tab_gic_order)) {
// 处理会员订单新增事件
dealMemberGicOrder((MaterialMemberGicOrderPojo) pojo);
}else if (StringUtils.startsWith(record.value().getTableName(), tab_gic_member)) {
// 会员unionId新增事件
dealMemberUnionIdChange((MaterialMemberUnionIdPoJo) pojo);
}
}
......@@ -119,6 +128,36 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
mid.put(gicField.getName(), gicField.getValue());
}
return JSON.parseObject(JSON.toJSONString(mid), MaterialMemberGicOrderPojo.class);
} else if (StringUtils.startsWith(record.getTableName(), tab_gic_member)) {
GicRecordType recordType = record.getRecordType();
if (GicRecordType.INSERT.equals(recordType)) {
Map<String, String> mid = new HashMap<>();
for (GicField gicField : record.getFieldList()) {
mid.put(gicField.getName(), gicField.getValue());
}
return JSON.parseObject(JSON.toJSONString(mid), MaterialMemberUnionIdPoJo.class);
}
if (GicRecordType.UPDATE.equals(recordType)) {
Map<String, String> old = new HashMap<>();
Map<String, String> newMap = new HashMap<>();
for (int i = 0; i < record.getFieldList().size(); i++) {
GicField gicField = record.getFieldList().get(i);
if (i % 2 == 0){
old.put(gicField.getName(), gicField.getValue());
}else {
newMap.put(gicField.getName(), gicField.getValue());
}
}
MaterialMemberUnionIdPoJo oldMember = JSON.parseObject(JSON.toJSONString(old), MaterialMemberUnionIdPoJo.class);
MaterialMemberUnionIdPoJo newMemberInfo = JSON.parseObject(JSON.toJSONString(newMap), MaterialMemberUnionIdPoJo.class);
if (oldMember == null || StringUtils.isNotBlank(oldMember.getUnionId())) {
logger.info("会员原本存在unionId, old:{}, new:{}", JSON.toJSONString(oldMember), JSON.toJSONString(newMemberInfo));
return null;
}
return newMemberInfo;
}
return null;
}
return null;
}
......@@ -235,5 +274,17 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
potentialCustomerService.updateMemberDealFlag(memberOrderPojo.getEnterpriseId(), memberOrderPojo.getMemberId());
}
/**
*
* @param materialMemberUnionIdPoJo
*/
private void dealMemberUnionIdChange(MaterialMemberUnionIdPoJo materialMemberUnionIdPoJo) {
logger.info("处理会员unionId新增事件 >> {}", JSON.toJSONString(materialMemberUnionIdPoJo));
if (StringUtils.isBlank(materialMemberUnionIdPoJo.getUnionId()) || StringUtils.equalsIgnoreCase("null", materialMemberUnionIdPoJo.getUnionId())) {
logger.info("处理会员unionId事件异常,会员unionId为空 {}", JSON.toJSONString(materialMemberUnionIdPoJo));
return;
}
interactRecordService.memberAuthorized(materialMemberUnionIdPoJo.getMemberId(), materialMemberUnionIdPoJo.getUnionId());
}
}
package com.gic.haoban.manage.service.task.hm;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.DealParamMqDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.enums.PreDealTypeEnum;
import com.gic.haoban.manage.api.enums.SyncTaskStatusEnum;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.service.entity.TabHaobanPreDealLog;
import com.gic.haoban.manage.service.entity.TabHaobanSyncTask;
import com.gic.haoban.manage.service.service.PreDealService;
import com.gic.haoban.manage.service.service.SyncTaskService;
import com.gic.haoban.manage.service.task.BaseSyncOperation;
import com.gic.redis.data.util.RedisUtil;
@Service
public class QwHmOperation implements BaseSyncOperation {
private static final Logger logger = LoggerFactory.getLogger(QwHmOperation.class);
public static final String hmCachKey = "hm:batch:key" ;
@Autowired
private HmQrcodeApiService hmQrcodeApiService;
@Autowired
private PreDealService preDealService;
@Autowired
private SyncTaskService syncTaskService;
@Override
public void dealSingleByMq(DealParamMqDTO dealParamMqDTO, TabHaobanPreDealLog dataPre) {
String taskId = dealParamMqDTO.getTaskId();
String wxEnterpriseId = dataPre.getWxEnterpriseId();
String enterpriseId = dataPre.getEnterpriseId();
Long hmId = Long.valueOf(dataPre.getDataId());
try {
logger.info("开始处理活码={},{}",taskId,hmId);
String clerkIds = dataPre.getDataContent();
List<String> clerkIdList = JSONArray.parseArray(clerkIds, String.class);
// 删除
ServiceResponse resp = null ;
if (clerkIdList.size() == 0) {
resp = this.hmQrcodeApiService.delById(hmId, 1, null);
} else {
HmQrcodeQDTO qdto = new HmQrcodeQDTO();
qdto.setWxEnterpriseId(wxEnterpriseId);
qdto.setHmId(hmId);
qdto.setEnterpriseId(enterpriseId);
qdto.setClerkIdList(clerkIdList);
resp = this.hmQrcodeApiService.batchUpdateHm(qdto);
}
logger.info("批量修改活码={},{}",hmId,JSON.toJSONString(resp));
if(resp.isSuccess()) {
this.preDealService.updateStatusByDataId(taskId, dataPre.getDataId(), 2, null);
}else {
this.preDealService.updateStatusByDataId(taskId, dataPre.getDataId(), 3, resp.getMessage());
}
}catch(Exception e) {
logger.info("活码处理异常={},{}",hmId,e.getMessage());
this.preDealService.updateStatusByDataId(taskId, dataPre.getDataId(), 3, "执行异常");
}finally{
this.dealSuccess(taskId, dataPre.getDataId(), enterpriseId, wxEnterpriseId);
}
}
@Override
public void dealException(String taskId, String dataId, String enterpriseId, String reason) {
}
@Override
public void dealSuccess(String taskId, String dataId, String enterpriseId, String wxEnterpriseId) {
boolean b = preDealService.checkFriendTask(taskId, PreDealTypeEnum.modify_hm.getVal());
if (!b) {
return;
}
logger.info("批量修改活码完成={}", taskId);
TabHaobanSyncTask syncTask = syncTaskService.getSyncTask(taskId);
if (syncTask.getStatusFlag() == SyncTaskStatusEnum.compute.getVal()) {
RedisUtil.delCache(hmCachKey+wxEnterpriseId+enterpriseId) ;
return;
}
logger.info("批量修改活码完成,status={}", taskId);
RedisUtil.delCache(hmCachKey+wxEnterpriseId+enterpriseId) ;
this.syncTaskService.updateTaskStatus(taskId, SyncTaskStatusEnum.compute.getVal());
}
@Override
public void checkDepartmentTask(String taskId) {
}
}
package com.gic.haoban.manage.service.util;
import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigService;
public class ApolloUtils {
/**
* 旧的调用发送,是否采用新的消息中心开关1:是 0:否
* @return
*/
public static boolean useMessageCenter() {
Config config = ConfigService.getConfig("COMMON.gic-properties");
String messageCenterSwitch = config.getProperty("messageCenterSwitch", "0");
return "1".equals(messageCenterSwitch);
}
}
......@@ -41,6 +41,7 @@
<value>haoban_gic_store_group</value>
<value>tab_haoban_member_order_event_prod</value>
<value>haoban_gic_order</value>
<value>content_member_unionId_notice</value>
</list>
</constructor-arg>
<property name="messageListener" ref="kafkaConsumerService"/>
......
......@@ -114,14 +114,14 @@
<insert id="insertSelectiveBatch">
insert into tab_haoban_pre_deal_log ( wx_enterprise_id,enterprise_id, data_id,data_content,
p_data_id, task_id, data_type,
status_flag, create_time, update_time
status_flag, create_time, update_time,reason
)
values
<foreach collection="list" separator="," item="item" index="index">
(#{item.wxEnterpriseId,jdbcType=VARCHAR},#{item.enterpriseId,jdbcType=VARCHAR},
#{item.dataId,jdbcType=VARCHAR},#{item.dataContent},
#{item.pDataId,jdbcType=VARCHAR}, #{item.taskId,jdbcType=VARCHAR}, #{item.dataType,jdbcType=INTEGER},
#{item.statusFlag,jdbcType=INTEGER}, now(), now()
#{item.statusFlag,jdbcType=INTEGER}, now(), now(),#{item.reason}
)
</foreach>
</insert>
......@@ -279,6 +279,12 @@
)
</select>
<select id="listAllByTaskId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_pre_deal_log
where task_id = #{taskId}
</select>
<select id="listRebuildByTaskId" resultMap="BaseResultMap">
select
......
......@@ -288,7 +288,7 @@
and status_flag = 1
</select>
<select id="pageStaff" resultMap="BaseResultMap">
<select id="pageStaff" parameterType="com.gic.haoban.manage.service.pojo.bo.StaffListBO" resultMap="BaseResultMap">
select
a.*
<if test="departmentIds != null and departmentIds.size() > 0">
......@@ -302,8 +302,8 @@
<if test="occupy == null or 1!=occupy">
and a.status_flag = 1
</if>
<if test="keyword != null and keyword != ''">
and (a.staff_name like CONCAT('%',#{keyword},'%') or a.phone_number like CONCAT('%',#{keyword},'%'))
<if test="keyWord != null and keyWord != ''">
and (a.staff_name like CONCAT('%',#{keyWord},'%') or a.phone_number like CONCAT('%',#{keyWord},'%'))
</if>
<if test="activeFlag != null">
and a.active_flag = #{activeFlag}
......@@ -356,7 +356,7 @@
<if test="departmentIds != null and departmentIds.size() > 0">
group by a.staff_id
</if>
order by a.create_time desc
order by ${sortField} ${sortType}
</select>
<select id="listByIds" resultMap="BaseResultMap">
select
......
......@@ -21,6 +21,14 @@
from tab_haoban_sync_task
where task_id = #{taskId,jdbcType=VARCHAR}
</select>
<select id="getSyncNewestTask" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_sync_task
where wx_enterprise_id = #{wxEnterpriseId} and task_type = #{taskType} order by create_time desc limit 1
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from tab_haoban_sync_task
where task_id = #{taskId,jdbcType=VARCHAR}
......
......@@ -460,7 +460,9 @@
</foreach>
and wx_enterprise_id = #{wxEnterpriseId}
and enterprise_id = #{enterpriseId}
and status_flag = 1 and external_status = 1 group by member_id
and status_flag = 1 and external_status = 1
and external_user_id is not null
group by member_id
</select>
<select id="getLastByExTernalUseridAndWxUserIdNoStatus" resultMap="BaseResultMap">
......
......@@ -453,4 +453,26 @@
where a.enterprise_id = #{enterpriseId} and a.status_flag=1 and b.status_flag = 1
</select>
<select id="listByWxEnterpriseIdAndStaffId" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
select
staff_id staffId,
enterprise_id enterpriseId
from tab_haoban_staff_clerk_relation
WHERE
wx_enterprise_id = #{wxEnterpriseId}
AND status_flag = 1
AND staff_id in
<foreach collection="staffIdList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<select id="listAllStaffIdByEnterpriseId" resultType="java.lang.String">
select a.staff_id
from tab_haoban_staff_clerk_relation a left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.enterprise_id = #{enterpriseId} and a.status_flag=1 and b.status_flag = 1 and a.wx_enterprise_id = #{wxEnterpriseId}
GROUP BY
a.staff_id
</select>
</mapper>
\ No newline at end of file
......@@ -170,9 +170,10 @@
<if test="null != searchParams">
and b.name like #{searchParams}
</if>
and b.end_time > now()
group by b.plan_id
order by a.create_time desc , a.owner_log_id
having notSendCount
order by b.end_time desc , a.create_time desc
</select>
<select id="listOwnerLogPageForWxa" parameterType="com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO" resultType="com.gic.haoban.manage.api.dto.chat.GroupChatPlanOwnerLogDTO">
......@@ -231,5 +232,27 @@
</select>
<select id="getTotalCount" resultType="java.lang.Integer">
SELECT
count(*)
FROM
tab_haoban_group_chat_plan_owner_log a
left join tab_haoban_group_chat_plan b on a.plan_id = b.plan_id
WHERE
a.enterprise_id = #{enterpriseId}
<if test="null != storeId">
AND a.store_id = #{storeId}
</if>
<if test="null != clerkId">
AND a.clerk_id = #{clerkId}
</if>
AND a.send_status = 1
AND a.delete_flag = 0
AND b.delete_flag = 0
AND b.status_flag = 1
AND b.end_time >= now()
</select>
</mapper>
\ No newline at end of file
......@@ -88,6 +88,16 @@
where hm_id = #{hmId} and status = 1
</select>
<select id="listHmClerkByHmIdList" resultMap="TabHaobanHmClerkRelationMap">
select <include refid="Base_Column_List" />
from tab_haoban_hm_clerk_relation
where hm_id in
<foreach item="id" index="index" collection="hmIdList" open="(" separator="," close=")">
#{id}
</foreach>
and status = 1
</select>
<select id="getHmClerkByHmIdAndStaffId" resultMap="TabHaobanHmClerkRelationMap">
select <include refid="Base_Column_List"></include>
from tab_haoban_hm_clerk_relation
......
......@@ -51,6 +51,15 @@
where hm_id = #{hmId}
</select>
<select id="queryByIdList" resultMap="TabHaobanHmQrcodeMap">
select
<include refid="Base_Column_List"></include>
from tab_haoban_hm_qrcode
where hm_id in
<foreach collection="hmIds" open="(" close=")" separator="," item="hmId">
#{hmId}
</foreach>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="hmId" useGeneratedKeys="true">
......@@ -304,9 +313,12 @@
</foreach>
)
</if>
<if test="null != statusFlagInt">
<if test="null != statusFlagInt and statusFlagInt !=10">
and a.status_flag = #{statusFlagInt}
</if>
<if test="null != statusFlagInt and statusFlagInt ==10">
and a.status_flag in (1,3)
</if>
<if test="null != hmTypeInt">
and a.hm_type=#{hmTypeInt}
</if>
......
......@@ -290,7 +290,7 @@
<update id="saveQywxOrderId">
UPDATE tab_haoban_licence_order
SET qywx_order_id = #{qywxOrderId} ,update_time = now()
SET qywx_order_id = #{qywxOrderId} ,update_time = now() ,qywx_expire_time= #{qywxExpireTime}
WHERE order_id = #{orderId}
and delete_flag = 0
</update>
......
......@@ -116,8 +116,8 @@ public class GroupMessageServiceTest {
qywxMomentInfoQDTO.setEndTime(1681906519L);
qywxMomentInfoQDTO.setCreatorId("wo59NLDQAAbjSBA575NouC1pUYQgCOtw");
qywxMomentInfoQDTO.setPageSize(20);
ServiceResponse<QywxMomentRespDTO> serviceResponse = qywxSuiteApiService.queryQywxMomentList(qywxMomentInfoQDTO);
System.out.println(JSON.toJSONString(serviceResponse));
//ServiceResponse<QywxMomentRespDTO> serviceResponse = qywxSuiteApiService.queryQywxMomentList(qywxMomentInfoQDTO);
//System.out.println(JSON.toJSONString(serviceResponse));
}
@Test
......
......@@ -2,6 +2,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -10,15 +11,19 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.haoban.manage.api.dto.ContentMaterialDTO;
import com.gic.haoban.manage.api.dto.DealParamMqDTO;
import com.gic.haoban.manage.api.dto.hm.HmLinkDTO;
import com.gic.haoban.manage.api.dto.hm.HmLinkStoreDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmBatchModifyQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmLinkSearchQDTO;
import com.gic.haoban.manage.api.enums.SyncTaskStatusEnum;
import com.gic.haoban.manage.api.service.DealSyncOperationApiService;
import com.gic.haoban.manage.api.service.KeyDataApiService;
import com.gic.haoban.manage.api.service.hm.HmLinkApiService;
import com.gic.haoban.manage.api.service.hm.HmLinkVisitLogApiService;
import com.gic.haoban.manage.service.service.QywxSendService;
import com.gic.haoban.manage.service.service.hm.HmClerkRelationService;
import com.gic.haoban.manage.service.service.hm.HmLinkStoreService;
import com.gic.haoban.manage.service.util.QwFriendLimitCountUtil;
......@@ -29,7 +34,7 @@ public class HmLinkTest {
private HmLinkApiService hmLinkApiService;
@Autowired
private HmLinkVisitLogApiService hmLinkVisitLogApiService;
private HmClerkRelationService hmClerkRelationService;
@Autowired
private KeyDataApiService keyDataApiService;
......@@ -39,20 +44,33 @@ public class HmLinkTest {
@Autowired
private QywxSendService qywxSendService ;
@Autowired
private DealSyncOperationApiService dealSyncOperationApiService ;
volatile int x = 0 ;
@Test
public void test() throws IOException, InterruptedException {
String taskId = "c7e319c16ba942eea8a3b91d6a763518" ;
DealParamMqDTO dealParamMqDTO = new DealParamMqDTO();
dealParamMqDTO.setTaskId(taskId);
dealParamMqDTO.setData(517064205447217236l+"");
dealParamMqDTO.setType(SyncTaskStatusEnum.modify_hm.getVal());
List<ContentMaterialDTO> imageList = new ArrayList<>();
ContentMaterialDTO d = new ContentMaterialDTO() ;
d.setImgUrl("https://p.qlogo.cn/bizmail/hxlMR3pdsfnslruRxMXebKiabKrgOOpdmJ7shD0jUFbcUMoOh9I7AXw/0");
d.setMaterialType(2);
imageList.add(d) ;
this.qywxSendService.share("ca66a01b79474c40b3e7c7f93daf1a3b", Arrays.asList("c6420c17febe426a9fb197dbd90bdc7b","4f2ae2fbfe594ad2a8ccdf9ab7b28713","fce45ed485e94d619b0124f2daf4b083"), "test", imageList);
this.dealSyncOperationApiService.departmentDealMq(JSON.toJSONString(dealParamMqDTO)) ;
if(true) {
return ;
}
HmBatchModifyQDTO qdto = new HmBatchModifyQDTO();
qdto.setHmIdList(Arrays.asList(517064205447217236L,457922550308036636L));
qdto.setWxEnterpriseId("ca66a01b79474c40b3e7c7f93daf1a3b");
qdto.setOptStaffId("fefd1c81641711e69d0818c58a146fd2");
qdto.setOptName("达摩管理员");
qdto.setOptType(1);
qdto.setClerkIdList(Arrays.asList("4a566818111a45bbae9f962580df82c0"));
this.hmClerkRelationService.batchModify(qdto);
......
......@@ -103,7 +103,7 @@ public class MaterialReportServiceTest {
// params.put("t", 1);
// params.put("d", "04");
String s = params.toJSONString();
String s1 = NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY, s);
String s1 = NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_MONTH, s);
System.out.println("/pages/route/index?pageType=hbapp_material_report&data=".length());
System.out.println(s1);
System.out.println(s1.length());
......
......@@ -124,8 +124,8 @@ public class NotityTest {
articleInfo.setPicurl("https://platform-1251519181.cos.ap-shanghai.myqcloud.com/image/newdmwltest/enterprise_common-e1e8b3d46fdb4486ad545aae6cba67a1.png");
messageDTO.setArticleMessages(Arrays.asList(articleInfo));
boolean b = qywxSuiteApiService.sendMessage(corpid, config.getWxSuiteid(), messageDTO);
System.out.println(b);
/*boolean b = qywxSuiteApiService.sendMessage(corpid, config.getWxSuiteid(), messageDTO);
System.out.println(b);*/
}
@Test
......@@ -138,7 +138,7 @@ public class NotityTest {
search.setSuiteid(config.getWxSuiteid());
search.setChatType("single");
Date date = DateUtils.addDays(new Date(), -1);
ServiceResponse<QywxGroupMsgResp> serviceResponse = qywxSuiteApiService.queryQywxGroupMessageList(search);
//ServiceResponse<QywxGroupMsgResp> serviceResponse = qywxSuiteApiService.queryQywxGroupMessageList(search);
}
......
......@@ -69,7 +69,7 @@ public class test {
// params.put("t", 1);
// params.put("d", "04");
String s = params.toJSONString();
String s1 = NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY, s);
String s1 = NoticeMessageUtil.buildMiniAppUrl(NoticeMessageTypeEnum.MATERIAL_REPORT_NOTIFY_MONTH, s);
System.out.println("/pages/route/index?pageType=hbapp_material_report&data=".length());
System.out.println(s1);
System.out.println(s1.length());
......
......@@ -6,13 +6,15 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONArray;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.dto.qdto.TransferActiveCodeQDTO;
import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.web.log.LogRecordUserServiceImpl;
import com.gic.haoban.manage.web.qo.StaffListQO;
import com.gic.haoban.manage.web.qo.TransferActiveCodeQO;
import com.gic.haoban.manage.web.vo.StaffActiveDataVO;
import com.gic.haoban.manage.web.vo.*;
import com.gic.log.record.anno.GicLogRecord;
import com.gic.log.record.util.GicLogRecordCategoryEnum;
import com.gic.log.record.util.GicLogRecordEvaluationContext;
......@@ -47,9 +49,6 @@ import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.StaffEditJsonQO;
import com.gic.haoban.manage.web.vo.ClerkInfoVo;
import com.gic.haoban.manage.web.vo.StaffExportVO;
import com.gic.haoban.manage.web.vo.StaffVO;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.google.common.collect.Lists;
......@@ -119,36 +118,25 @@ public class StaffController extends WebBaseController {
/**
* 分页查询员工列表
*
* @param departmentId 部门id
* @param activeFlag 激活状态 - 后期删除
* @param keyWord 关键字
* @param relationFlag 关联状态
* @param permitState 许可状态 0 未激活,1 正常有效,2 即将过期,3 已过期,可多传,按‘,’隔开
* @param occupy 其他占用许可页面标志,传1返回该页面数据
* @param pageInfo 分页参数
* @return res
*/
@RequestMapping("staff-list")
public HaobanResponse staffList(String departmentId,
Integer activeFlag,
Integer relationFlag,
String keyWord,
String permitState,
Integer occupy,
BasePageInfo pageInfo) {
public HaobanResponse staffList(@RequestBody StaffListQO qo) {
logger.info("通讯录列表查询参数:{}",JSONObject.toJSONString(qo));
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
List<String> departmentIds = new ArrayList<>();
DepartmentDTO departmentDTO = departmentApiService.selectById(departmentId);
DepartmentDTO departmentDTO = departmentApiService.selectById(qo.getDepartmentId());
if (departmentDTO != null) {
String parentDepartmentId = departmentDTO.getParentDepartmentId();
if (!"0".equals(parentDepartmentId)) {
departmentIds = departmentApiService.listSonDeptIdsByDepartmentId(departmentId, wxEnterpriseId);
departmentIds = departmentApiService.listSonDeptIdsByDepartmentId(qo.getDepartmentId(), wxEnterpriseId);
}
}
//员工
Page<StaffDTO> page = staffApiService.pageStaff(departmentIds, activeFlag, keyWord, pageInfo, relationFlag, wxEnterpriseId,permitState,occupy);
StaffListDTO dto = EntityUtil.changeEntityByJSON(StaffListDTO.class, qo);
dto.setWxEnterpriseId(wxEnterpriseId);
dto.setDepartmentIds(departmentIds);
Page<StaffDTO> page = staffApiService.pageStaff(dto);
logger.info("pages={},totalPage={}", page.getCurrentPage(), page.getTotalPage());
if(CollectionUtils.isNotEmpty(page.getResult())) {
......@@ -475,7 +463,9 @@ public class StaffController extends WebBaseController {
* @Description 会员导出
*/
@RequestMapping("staff-export")
public HaobanResponse staffExport(HttpServletRequest request, HttpServletResponse response, String departmentId, Integer activeFlag, Integer relationFlag, String keyWord, String permitState,BasePageInfo pageInfo) {
public HaobanResponse staffExport(HttpServletRequest request, HttpServletResponse response,String departmentId, Integer activeFlag, Integer relationFlag,
String keyWord, String permitState,BasePageInfo pageInfo,@RequestParam(defaultValue = "create_time") String sortField,
@RequestParam(defaultValue = "desc") String sortType,String enterpriseIdParam) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
if(StringUtils.isBlank(departmentId)){
......@@ -489,11 +479,23 @@ public class StaffController extends WebBaseController {
List<String> departmentIds ;
departmentIds = relationList.stream().map(DepartmentDTO::getDepartmentId).collect(Collectors.toList());
List<StaffDTO> staffAllList = Lists.newArrayListWithCapacity(5000);
StaffListDTO dto = new StaffListDTO();
dto.setWxEnterpriseId(wxEnterpriseId);
dto.setDepartmentIds(departmentIds);
dto.setDepartmentId(departmentId);
dto.setActiveFlag(activeFlag);
dto.setRelationFlag(relationFlag);
dto.setKeyWord(keyWord);
dto.setPermitState(permitState);
dto.setSortField(sortField);
dto.setSortType(sortType);
dto.setEnterpriseIdParam(enterpriseIdParam);
pageInfo.setPageSize(Integer.MAX_VALUE);
int pageNum = 1;
while (true) {
pageInfo.setPageNum(pageNum);
Page<StaffDTO> page = staffApiService.pageStaff(departmentIds, activeFlag, keyWord, pageInfo, relationFlag, wxEnterpriseId,permitState,null);
dto.setPageInfo(pageInfo);
Page<StaffDTO> page = staffApiService.pageStaff(dto);
List<StaffDTO> list = page.getResult();
if (CollectionUtils.isEmpty(list)) {
break;
......@@ -502,6 +504,12 @@ public class StaffController extends WebBaseController {
pageNum++;
}
List<StaffExportVO> voList = new ArrayList<>();
//针对多个商户使用一个企微时,导出所属商户名称
Boolean flag=false;
List<WxEnterpriseRelatedDTO> result = staffApiService.getWxEnterpriseRelatedList(wxEnterpriseId).getResult();
if (CollUtil.isNotEmpty(result) && result.size()>1){
flag = true;
}
for (StaffDTO staffDTO : staffAllList) {
StaffExportVO vo = new StaffExportVO();
vo.setStaffId(staffDTO.getStaffId());
......@@ -510,6 +518,15 @@ public class StaffController extends WebBaseController {
vo.setPosition(staffDTO.getPostion());
vo.setDepartmentName(departmentMap.get(staffDTO.getDepartmentIds()) == null ? null : departmentMap.get(staffDTO.getDepartmentIds()).getDepartmentName());
vo.setRelationFlag((Objects.isNull(staffDTO.getRelationFlag()) || staffDTO.getRelationFlag() == 0) ? "未关联" : "已关联");
if (flag){
List<String> enterpriseNameList = staffDTO.getEnterpriseNameList();
if (CollUtil.isNotEmpty(enterpriseNameList)){
String enterpriseName = String.join(",", enterpriseNameList);
vo.setEnterpriseName(enterpriseName);
}else {
vo.setEnterpriseName("无归属");
}
}
voList.add(vo);
}
//拼接导购信息
......@@ -520,8 +537,15 @@ public class StaffController extends WebBaseController {
}
mergeClerkInfo(voList, wxEnterpriseId);
String fileName = wxEnterpriseName + "通讯录" + DateUtil.dateToStr(new Date(), DateUtil.FORMAT_DATE_8);
List<String> titleList = Arrays.asList("姓名", "职务", "部门", "手机号", "关联状态", "关联导购");
List<String> fileList = Arrays.asList("staffName", "position", "departmentName", "phoneNumber", "relationFlag", "clerkName");
List<String> titleList =new ArrayList<>();
List<String> fileList = new ArrayList<>();
if (flag){
titleList = Arrays.asList("姓名", "职务", "部门", "手机号", "关联状态", "关联导购","所属商户");
fileList = Arrays.asList("staffName", "position", "departmentName", "phoneNumber", "relationFlag", "clerkName","enterpriseName");
}else {
titleList = Arrays.asList("姓名", "职务", "部门", "手机号", "关联状态", "关联导购");
fileList = Arrays.asList("staffName", "position", "departmentName", "phoneNumber", "relationFlag", "clerkName");
}
try {
ExcelUtils.xls(response, request, fileName, voList, fileList, titleList);
} catch (Exception e) {
......@@ -631,4 +655,20 @@ public class StaffController extends WebBaseController {
return RestResponse.successResult(transferActiveCodeDTOServiceResponse);
}
/**
* 查询企业微信对应的所有商户品牌信息
*
*/
@RequestMapping("get-wxEnterprise-related-list")
public RestResponse<List<WxEnterpriseRelatedVO>> getWxEnterpriseRelatedList() {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
ServiceResponse<List<WxEnterpriseRelatedDTO>> response = staffApiService.getWxEnterpriseRelatedList(wxEnterpriseId);
List<WxEnterpriseRelatedVO> vo = JSONArray.parseArray(JSONObject.toJSONString(response.getResult()), WxEnterpriseRelatedVO.class);
if (CollUtil.isEmpty(vo)){
return RestResponse.successResult(new ArrayList<>());
}
return RestResponse.successResult(vo);
}
}
package com.gic.haoban.manage.web.controller;
import com.alibaba.fastjson.JSON;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.common.anno.IgnoreLogin;
import com.gic.log.record.bean.WebErrorLogReport;
import com.gic.log.record.util.LogWebErrorLogReportUtil;
import org.apache.logging.log4j.LogManager;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
* @description:
* @Author: wenhua
* @Date: 2023/5/11 21:50
*/
@RestController
public class TabHaobanAppLogController {
private static org.apache.logging.log4j.Logger logger = LogManager.getLogger(TabHaobanAppLogController.class);
@RequestMapping("/insert_log")
@ResponseBody
@IgnoreLogin
@com.gic.web.common.ano.IgnoreLogin
public RestResponse<Boolean> insertLog(@RequestBody WebErrorLogReport qo) {
logger.info("插入日志的参数:{}", JSON.toJSONString(qo));
qo.setCreateTime(new Date());
LogWebErrorLogReportUtil.pushWebErrorLogReport(qo);
return RestResponse.successResult();
}
}
......@@ -164,7 +164,7 @@ public class WxEnterpriseController extends WebBaseController {
}
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseApiService.getQwInfo(wxEnterpriseId) ;
if(qwDTO.isSelf()) {
return this.fail("自建应用不能刷新");
return this.fail("已刷新");
}
QywxCorpInfoDTO dto = qywxTokenManageService.getCorpInfo(qwDTO.getThirdCorpid(), config.getWxSuiteid());
if (dto == null) {
......
package com.gic.haoban.manage.web.controller.hm;
import cn.hutool.core.convert.Convert;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
......@@ -10,7 +28,16 @@ import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.constants.StatisticsApolloKeyConstant;
import com.gic.haoban.manage.api.dto.hm.*;
import com.gic.haoban.manage.api.dto.hm.HmBatchCountDTO;
import com.gic.haoban.manage.api.dto.hm.HmBatchModifyResultDTO;
import com.gic.haoban.manage.api.dto.hm.HmClerkDTO;
import com.gic.haoban.manage.api.dto.hm.HmClerkRelationDTO;
import com.gic.haoban.manage.api.dto.hm.HmGroupDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeListDTO;
import com.gic.haoban.manage.api.dto.hm.HmStoreDTO;
import com.gic.haoban.manage.api.dto.hm.WxUserAddLogDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmBatchModifyQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogSearchQDTO;
......@@ -24,6 +51,7 @@ import com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService;
import com.gic.haoban.manage.api.util.DataHttpUtil;
import com.gic.haoban.manage.web.dto.HmOverviewDTO;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.hm.HmBatchModifyQO;
import com.gic.haoban.manage.web.qo.hm.HmQrcodeDetailQO;
import com.gic.haoban.manage.web.qo.hm.HmQrcodeUpdateQO;
import com.gic.haoban.manage.web.qo.hm.data.HmDetailClerkListQO;
......@@ -33,18 +61,8 @@ import com.gic.haoban.manage.web.utils.statistics.DataStatisticsParamUtils;
import com.gic.haoban.manage.web.utils.statistics.DateUtils;
import com.gic.haoban.manage.web.vo.hm.HmDetailClerkListVO;
import com.gic.haoban.manage.web.vo.hm.HmTrendVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
import cn.hutool.core.convert.Convert;
/**
* 活码(TabHaobanHmQrcode)表控制层
......@@ -239,6 +257,79 @@ public class HmQrcodeController {
return RestResponse.successResult(statisticsDTO);
}
@RequestMapping(value = "get-hm-for-batch", method = RequestMethod.POST)
public RestResponse<Object> getHmFormBatch(@RequestBody HmQrcodeListQO qo) {
// 查询有效的
if(qo.getInFields().getHmTypeInt() !=null && qo.getInFields().getHmTypeInt()==1) {
return RestResponse.failure("9999", "不能只选择单人活码") ;
}
qo.getInFields().setStatusFlagInt(10);
qo.getInFields().setHmTypeInt(2);
List<String> list = this.getHmCount(qo) ;
if(list.size() > 1000) {
return RestResponse.failure("9999", "最多支持1000条数据") ;
}
return RestResponse.successResult(list);
}
@RequestMapping(value = "batch-modify-hm", method = RequestMethod.POST)
public RestResponse<Object> batchModify(@RequestBody HmBatchModifyQO qo) {
HmBatchModifyQDTO qdto = EntityUtil.changeEntityByJSON(HmBatchModifyQDTO.class, qo) ;
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
qdto.setWxEnterpriseId(loginUser.getWxEnterpriseId());
qdto.setOptClerkId(loginUser.getClerkId());
qdto.setOptName(loginUser.getClerkName());
qdto.setEnterpriseId(loginUser.getEnterpriseId());
ServiceResponse<List<HmBatchModifyResultDTO>> resp = this.hmQrcodeApiService.batchModify(qdto) ;
if(resp.isSuccess()) {
RestResponse successResult = RestResponse.successResult() ;
successResult.setMessage(resp.getMessage());
successResult.setResult(resp.getResult());
return successResult ;
}
return RestResponse.failure("9999", resp.getMessage()) ;
}
@RequestMapping("hm-sync-check")
public RestResponse<Object> synchmSuccess(String taskId) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId();
ServiceResponse<HmBatchCountDTO> resp = this.hmQrcodeApiService.getModifyResult(wxEnterpriseId,taskId);
return RestResponse.successResult(resp.getResult()) ;
}
private List<String> getHmCount(HmQrcodeListQO hmQrcodeListQO) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
hmQrcodeListQO.getInFields().setEnterpriseId(loginUser.getEnterpriseId());
hmQrcodeListQO.getInFields().setWxEnterpriseId(loginUser.getWxEnterpriseId());
List<String> storeList = staffApiService.getHaoBanStoreIdsRolesByClerkId(loginUser.getClerkId(), loginUser.getWxEnterpriseId());
if (CollectionUtils.isEmpty(storeList)) {
return Collections.EMPTY_LIST ;
}
if (!storeList.contains("-1")) {
StringBuffer stringBuffer = new StringBuffer();
storeList.forEach(c -> stringBuffer.append(c).append(","));
hmQrcodeListQO.getInFields().setStoreId(stringBuffer.toString());
}
Long hmGroupId = hmQrcodeListQO.getInFields().getHmGroupId();
//-1 代表全部分组
if (hmGroupId == -1) {
hmQrcodeListQO.getInFields().setHmGroupId(null);
}
HmQrcodeListQDTO qdto = EntityUtil.changeEntityByJSON(HmQrcodeListQDTO.class, hmQrcodeListQO.getInFields());
if (!storeList.contains("-1")) {
qdto.setStoreId(storeList);
}
ServiceResponse<List<String>> listResp = this.hmQrcodeApiService.listHmIdForIndex(qdto);
logger.info("HMid列表={}", JSON.toJSONString(listResp));
List<String> hmIds = listResp.getResult();
if(CollectionUtils.isEmpty(hmIds)) {
return Collections.EMPTY_LIST ;
}
return hmIds ;
}
/**
* 详情
*
......@@ -376,7 +467,13 @@ public class HmQrcodeController {
@RequestMapping(path = "/update/qrcode/group")
public RestResponse<?> batchUpdateQrcodeGroup(@RequestBody HmQrcodeUpdateQO qrcodeUpdateQo) {
ServiceResponse<Boolean> serviceResponse = hmQrcodeApiService.batchUpdateHmQrcodeGroup(qrcodeUpdateQo.getHmIds(), qrcodeUpdateQo.getGroupId());
List<Long> idlist = qrcodeUpdateQo.getHmIds() ;
if(qrcodeUpdateQo.getAllFlag()==1) {
HmQrcodeListQO qo = new HmQrcodeListQO() ;
qo.setInFields(qrcodeUpdateQo.getInFields());
idlist = this.getHmCount(qo).stream().map(o->Long.valueOf(o)).collect(Collectors.toList()) ;
}
ServiceResponse<Boolean> serviceResponse = hmQrcodeApiService.batchUpdateHmQrcodeGroup(idlist, qrcodeUpdateQo.getGroupId());
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
......
package com.gic.haoban.manage.web.qo;
import com.gic.haoban.base.api.common.BasePageInfo;
import java.io.Serializable;
/**
* @description: 列表查询VO
* @Author: wenhua
* @Date: 2023/5/17 10:45
*/
public class StaffListQO implements Serializable {
/**
* 部门id
*/
private String departmentId;
/**
* 激活状态 - 后期删除
*/
private Integer activeFlag;
/**
* 关联状态
*/
private Integer relationFlag;
/**
* 关键字
*/
private String keyWord;
/**
* 许可状态 0 未激活,1 正常有效,2 即将过期,3 已过期,可多传,按‘,’隔开
*/
private String permitState;
/**
* 其他占用许可页面标志,传1返回该页面数据
*/
private Integer occupy;
/**
* 排序字段 不传默认create_time
*/
private String sortField = "create_time";
/**
* 排序类型 不传默认desc
*/
private String sortType = "desc";
/**
* 所属商户id
*/
private String enterpriseIdParam;
/**
* 分页参数
*/
private BasePageInfo pageInfo;
public String getDepartmentId() {
return departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
public Integer getActiveFlag() {
return activeFlag;
}
public void setActiveFlag(Integer activeFlag) {
this.activeFlag = activeFlag;
}
public Integer getRelationFlag() {
return relationFlag;
}
public void setRelationFlag(Integer relationFlag) {
this.relationFlag = relationFlag;
}
public String getKeyWord() {
return keyWord;
}
public void setKeyWord(String keyWord) {
this.keyWord = keyWord;
}
public String getPermitState() {
return permitState;
}
public void setPermitState(String permitState) {
this.permitState = permitState;
}
public Integer getOccupy() {
return occupy;
}
public void setOccupy(Integer occupy) {
this.occupy = occupy;
}
public String getSortField() {
return sortField;
}
public void setSortField(String sortField) {
this.sortField = sortField;
}
public String getSortType() {
return sortType;
}
public void setSortType(String sortType) {
this.sortType = sortType;
}
public String getEnterpriseIdParam() {
return enterpriseIdParam;
}
public void setEnterpriseIdParam(String enterpriseIdParam) {
this.enterpriseIdParam = enterpriseIdParam;
}
public BasePageInfo getPageInfo() {
return pageInfo;
}
public void setPageInfo(BasePageInfo pageInfo) {
this.pageInfo = pageInfo;
}
}
package com.gic.haoban.manage.web.qo.hm;
import java.io.Serializable;
import java.util.List;
/**
*
* @ClassName: HmBatchModifyQO
* @Description: 活码批量修改成员
* @author xugh
* @date 2023年5月15日 上午10:25:42
*
*/
public class HmBatchModifyQO implements Serializable {
/**
* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
*/
private static final long serialVersionUID = 551906331625487555L;
private List<String> hmIdList;
// 1新增 2删除
private int optType;
private List<String> clerkIdList;
// 1 继续执行更新 2不废弃活码
private int updateType;
public List<String> getHmIdList() {
return hmIdList;
}
public int getOptType() {
return optType;
}
public void setHmIdList(List<String> hmIdList) {
this.hmIdList = hmIdList;
}
public void setOptType(int optType) {
this.optType = optType;
}
public List<String> getClerkIdList() {
return clerkIdList;
}
public int getUpdateType() {
return updateType;
}
public void setClerkIdList(List<String> clerkIdList) {
this.clerkIdList = clerkIdList;
}
public void setUpdateType(int updateType) {
this.updateType = updateType;
}
}
......@@ -3,6 +3,8 @@ package com.gic.haoban.manage.web.qo.hm;
import java.io.Serializable;
import java.util.List;
import com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO.InFields;
/**
* @Author MUSI
* @Date 2022/7/13 6:54 PM
......@@ -16,6 +18,26 @@ public class HmQrcodeUpdateQO implements Serializable {
private Long groupId;
private InFields inFields;
private int allFlag ;
public int getAllFlag() {
return allFlag;
}
public void setAllFlag(int allFlag) {
this.allFlag = allFlag;
}
public InFields getInFields() {
return inFields;
}
public void setInFields(InFields inFields) {
this.inFields = inFields;
}
public List<Long> getHmIds() {
return hmIds;
}
......
......@@ -27,6 +27,18 @@ public class StaffExportVO implements Serializable{
* 关联状态为 员工是否关联某门店导购
*/
private String relationFlag;
/**
* gic品牌名称
*/
private String enterpriseName;
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
public String getActiveFlag() {
return activeFlag;
......
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
import java.util.Date;
public class WxEnterpriseRelatedVO implements Serializable {
private String wxEnterpriseRelatedId;
private String wxEnterpriseId;
private String enterpriseId;
private String enterpriseName;
private String version;
private Integer statusFlag;
private Date createTime;
private Date updateTime;
private String staffId;
private String staffName;
private Integer wxEnterpriseType;
private Integer memberOpenCardFlag;
private Integer rangeType;
private Integer clerkEditFlag;
public Integer getClerkEditFlag() {
return clerkEditFlag;
}
public void setClerkEditFlag(Integer clerkEditFlag) {
this.clerkEditFlag = clerkEditFlag;
}
private static final long serialVersionUID = 1L;
public Integer getRangeType() {
return rangeType;
}
public void setRangeType(Integer rangeType) {
this.rangeType = rangeType;
}
public Integer getWxEnterpriseType() {
return wxEnterpriseType;
}
public void setWxEnterpriseType(Integer wxEnterpriseType) {
this.wxEnterpriseType = wxEnterpriseType;
}
public Integer getMemberOpenCardFlag() {
return memberOpenCardFlag;
}
public void setMemberOpenCardFlag(Integer memberOpenCardFlag) {
this.memberOpenCardFlag = memberOpenCardFlag;
}
public String getWxEnterpriseRelatedId() {
return wxEnterpriseRelatedId;
}
public void setWxEnterpriseRelatedId(String wxEnterpriseRelatedId) {
this.wxEnterpriseRelatedId = wxEnterpriseRelatedId == null ? null : wxEnterpriseRelatedId.trim();
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId == null ? null : wxEnterpriseId.trim();
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId == null ? null : enterpriseId.trim();
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version == null ? null : version.trim();
}
public Integer getStatusFlag() {
return statusFlag;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
}
\ No newline at end of file
......@@ -102,6 +102,7 @@ public class WxEnterpriseVO implements Serializable {
private Integer wxSecurityType ;
private String wxCorpid ;
private String openCorpid ;
private String wxaAppid ;
public Integer getWxSecurityType() {
return wxSecurityType;
......@@ -466,4 +467,12 @@ public class WxEnterpriseVO implements Serializable {
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getWxaAppid() {
return wxaAppid;
}
public void setWxaAppid(String wxaAppid) {
this.wxaAppid = wxaAppid;
}
}
......@@ -231,6 +231,21 @@
<artifactId>gic-evaluate-manage-api</artifactId>
<version>${gic-evaluate-manage-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-member-source-api</artifactId>
<version>${gic-member-source-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-task-manage-api</artifactId>
<version>${haoban-task-manage-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-task-api</artifactId>
<version>${haoban-task-api}</version>
</dependency>
</dependencies>
<build>
......
......@@ -2,24 +2,30 @@ package com.gic.haoban.manage.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.web.qo.PageQo;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.PageResult2;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.notify.dto.NoticeMessageInfoDTO;
import com.gic.haoban.manage.api.dto.notify.dto.PendingTaskDetailDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.PendingListQDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageCategoryTypeEnum;
import com.gic.haoban.manage.api.enums.PendingTaskTypeEnum;
import com.gic.haoban.manage.api.service.chat.GroupChatPlanApiService;
import com.gic.haoban.manage.api.service.notify.NoticeMessageApiService;
import com.gic.haoban.manage.api.service.notify.PendingTaskApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.CommonQO;
import com.gic.haoban.manage.web.qo.PendingListQO;
import com.gic.haoban.manage.web.qo.notify.MessageListQO;
import com.gic.haoban.manage.web.vo.MarketingCountVO;
import com.gic.haoban.manage.web.vo.notify.PairValVO;
import com.gic.haoban.task.api.service.TelTaskApiService;
import com.gic.haoban.task.manage.api.service.IMarketClueTaskApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -39,12 +45,23 @@ import java.util.Map;
@RestController
public class NotifyController extends WebBaseController {
private static final Logger logger = LoggerFactory.getLogger(NotifyController.class);
@Autowired
private PendingTaskApiService pendingTaskApiService;
@Autowired
private NoticeMessageApiService noticeMessageService;
@Autowired
private GroupChatPlanApiService groupChatPlanApiService;
@Autowired
private ClerkService clerkService;
@Autowired
private IMarketClueTaskApiService iMarketClueTaskApiService;
@Autowired
private TelTaskApiService telTaskApiService;
/**
* 待办列表
*
......@@ -58,7 +75,7 @@ public class NotifyController extends WebBaseController {
if (qo.getFilterStatus() == 1) {
pendingListQDTO.setOverdueFlag(1);
}
if (qo.getShowSelf()==0) {
if (qo.getShowSelf() == 0) {
pendingListQDTO.setClerkId(null);
}
ServiceResponse<Page<PendingTaskDetailDTO>> retPage = pendingTaskApiService.pagePendingTask(pendingListQDTO, qo.getBasePageInfo());
......@@ -136,7 +153,7 @@ public class NotifyController extends WebBaseController {
@RequestMapping("/message/read")
public RestResponse readSingle(Long noticeMessageId) {
if (noticeMessageId == null) {
return RestResponse.failure(HaoBanErrCode.ERR_2.getCode()+"",HaoBanErrCode.ERR_2.getMsg());
return RestResponse.failure(HaoBanErrCode.ERR_2.getCode() + "", HaoBanErrCode.ERR_2.getMsg());
}
noticeMessageService.updateReadFlagById(noticeMessageId);
return RestResponse.successResult();
......@@ -183,5 +200,56 @@ public class NotifyController extends WebBaseController {
return RestResponse.successResult(ret.getResult());
}
/**
* 查询营销模块未完成任务数量
*
* @param qo
* @return
*/
@RequestMapping("/marketing/count")
public RestResponse<MarketingCountVO> marketingCount(@RequestBody @Valid CommonQO qo) {
String clerkId = qo.getClerkId();
String enterpriseId = qo.getEnterpriseId();
String storeId = qo.getStoreId();
MarketingCountVO marketingCountVO = new MarketingCountVO();
logger.info("查询是否店长:{}", clerkId);
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO != null) {
Integer groupChatCount, telTaskCount, groupMessageCount, total = 0;
Integer clerkType = clerkDTO.getClerkType();
if (clerkType == 1 || clerkType == 2) {
//店长维度
//社群群发
logger.info("店长维度查询社群群发");
groupChatCount = groupChatPlanApiService.getTotalCount(enterpriseId, null, storeId).getResult();
//话务群发
logger.info("店长维度查询话务群发");
telTaskCount = telTaskApiService.getTotalCount(enterpriseId, null, storeId).getResult();
//群发
logger.info("店长维度查询群发");
groupMessageCount = iMarketClueTaskApiService.getTotalCount(enterpriseId, null, storeId).getResult();
total = groupChatCount + telTaskCount + groupMessageCount;
} else {
//导购维度
//社群群发
logger.info("导购维度查询社群群发");
groupChatCount = groupChatPlanApiService.getTotalCount(enterpriseId, clerkId, storeId).getResult();
//话务群发
logger.info("导购维度查询话务群发");
telTaskCount = telTaskApiService.getTotalCount(enterpriseId, clerkId, storeId).getResult();
//群发
logger.info("导购维度查询群发");
groupMessageCount = iMarketClueTaskApiService.getTotalCount(enterpriseId, clerkId, storeId).getResult();
total = groupChatCount + telTaskCount + groupMessageCount;
}
marketingCountVO.setGroupChatCount(groupChatCount);
marketingCountVO.setGroupMessageCount(groupMessageCount);
marketingCountVO.setTelTaskCount(telTaskCount);
marketingCountVO.setTotal(total);
}
return RestResponse.successResult(marketingCountVO);
}
}
......@@ -82,6 +82,8 @@ import com.gic.haoban.manage.web.vo.MemberSendMessageVo;
import com.gic.haoban.manage.web.vo.StoreMemberVO;
import com.gic.haoban.manage.web.vo.WellDoneLoginInfoVO;
import com.gic.member.api.service.MemberOpenCardBusinessService;
import com.gic.membersource.api.dto.output.BusinessRefInfoDTO;
import com.gic.membersource.api.service.MemberOutsideApiService;
import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.UserDTO;
import com.gic.wechat.api.service.qywx.QywxCorpApiService;
......@@ -134,6 +136,8 @@ public class WxEnterpriseInfoController extends WebBaseController {
private CustomerApiService customerApiService;
@Autowired
private AccountService accountService ;
@Autowired
MemberOutsideApiService memberOutsideApiService;
/**
......@@ -500,6 +504,19 @@ public class WxEnterpriseInfoController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_1, result);
}
@RequestMapping("get-externaluser-memberid")
public RestResponse<Object> getMemberDetail(String externalUserid, String staffId, String enterpriseId) {
logger.info("获取外部联系人memberid={},{}",externalUserid,staffId);
if (StringUtils.isAnyBlank(externalUserid, staffId,enterpriseId)) {
return RestResponse.failure("9999",HaoBanErrCode.ERR_2.getMsg());
}
ServiceResponse<MemberStoreDTO> resp = memberUnionidRelatedApiService.getMemberIdForDetail(externalUserid, staffId, enterpriseId);
if(resp.isSuccess()) {
return RestResponse.successResult(resp.getResult());
}
return RestResponse.failure("9999",resp.getMessage());
}
/**
* 是否能打开客户详情权限
*
......@@ -700,6 +717,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
memberLog.setMemberId(memberId);
if(StringUtils.isEmpty(memberId)) {
this.memberUnionidRelatedApiService.saveExternalMemberLog(memberLog) ;
this.save(enterpriseId, unionid, relationKey);
return resultResponse(HaoBanErrCode.ERR_1);
}
ExternalClerkRelatedDTO externalClerkRelatedDTO = externalClerkRelatedApiService.getExternalClerkByRelationKeyAndPre(relationKey);
......@@ -714,6 +732,16 @@ public class WxEnterpriseInfoController extends WebBaseController {
}
private void save(String enterpriseId , String unionid , String relationKey) {
BusinessRefInfoDTO businessRefInfoDTO=new BusinessRefInfoDTO();
businessRefInfoDTO.setKeyType(1);
businessRefInfoDTO.setEnterpriseId(enterpriseId);
businessRefInfoDTO.setKey(unionid);
businessRefInfoDTO.setType(4);
businessRefInfoDTO.setValue(relationKey);
memberOutsideApiService.addBusinessRefInfo(businessRefInfoDTO);
}
@RequestMapping("check-storage-fee")
@ResponseBody
public RestResponse<Object> checkStorageFee(String enterpriseId , String url) {
......
......@@ -106,6 +106,7 @@ public class MaterialDataStaticsController {
.unUseMaterialClerkNum(temp.getUnusedMatlClerkNum())
.conversionAmount(Optional.ofNullable(temp.getConvSalesAmt()).orElse(BigDecimal.ZERO))
.storeManagerNum(totalManagerStoreNum)
.clickUserNum(temp.getClickUserNum())
.build();
return RestResponse.successResult(indexDataVO);
}
......
......@@ -493,10 +493,10 @@ public class GicOrderController {
response.setErrorCode(checkVO.getCode());
response.setResult(checkVO.getId());
response.setDetailError("");
return RestResponse.successResult(checkVO);
return RestResponse.failure("9999", checkVO.getMessage());
}
return RestResponse.successResult(checkVO) ;
}
return null;
}
// 核销数量
......
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
/**
* @description: 营销任务待发送数量VO
* @Author: wenhua
* @Date: 2023/5/15 16:36
*/
public class MarketingCountVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 社群群发待发送数量
*/
private Integer groupChatCount;
/**
* 群发待发送数量
*/
private Integer groupMessageCount;
/**
* 话务群发待发送数量
*/
private Integer telTaskCount;
/**
* 营销任务待发送总量
*/
private Integer total;
public Integer getGroupChatCount() {
return groupChatCount;
}
public void setGroupChatCount(Integer groupChatCount) {
this.groupChatCount = groupChatCount;
}
public Integer getGroupMessageCount() {
return groupMessageCount;
}
public void setGroupMessageCount(Integer groupMessageCount) {
this.groupMessageCount = groupMessageCount;
}
public Integer getTelTaskCount() {
return telTaskCount;
}
public void setTelTaskCount(Integer telTaskCount) {
this.telTaskCount = telTaskCount;
}
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
}
......@@ -47,4 +47,9 @@ public class MaterialIndexDataVO implements Serializable {
* 管辖门店数量
*/
private Integer storeManagerNum;
/**
* 转化用户数
*/
private Integer clickUserNum;
}
......@@ -25,7 +25,7 @@ public class MaterialTodayDataBO implements Serializable {
private Integer unusedMatlClerkNum;
/**
* 转化用户数
* 点击客户数
*/
private Integer clickUserNum;
......
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