Commit e021a777 by 徐高华

Merge branch 'feature/五月需求迭代'

# Conflicts:
#	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
#	haoban-manage3-service/src/main/resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
#	haoban-manage3-service/src/test/java/GroupMessageServiceTest.java
#	haoban-manage3-service/src/test/java/NotityTest.java
parents f6f80118 583552f6
...@@ -13,8 +13,18 @@ public class MemberStoreDTO implements Serializable { ...@@ -13,8 +13,18 @@ public class MemberStoreDTO implements Serializable {
*/ */
private Integer hasRight; private Integer hasRight;
private static final long serialVersionUID = 1L; 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() { public Integer getHasRight() {
return hasRight; return hasRight;
} }
......
...@@ -127,6 +127,18 @@ public class StaffDTO implements Serializable { ...@@ -127,6 +127,18 @@ public class StaffDTO implements Serializable {
* 企微激活码 * 企微激活码
*/ */
private String activeCode; 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() { public String getActiveCode() {
return activeCode; 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; package com.gic.haoban.manage.api.dto;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
...@@ -93,7 +94,12 @@ public class TransferActiveCodeDTO implements Serializable { ...@@ -93,7 +94,12 @@ public class TransferActiveCodeDTO implements Serializable {
log.append("失败明细:"); log.append("失败明细:");
for (int i=1;i<=this.failedList.size();i++){ for (int i=1;i<=this.failedList.size();i++){
Map<String, String> stringMap = this.failedList.get(i - 1); Map<String, String> stringMap = this.failedList.get(i - 1);
log.append(i+".(转移成员:"+stringMap.get("handoverStaffName")+",接收成员:"+stringMap.get("takeoverStaffName")+",失败原因错误码:"+stringMap.get("errorCode")+");"); 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); String substring = log.substring(0, log.toString().length() - 1);
......
...@@ -64,12 +64,12 @@ public class WxEnterpriseQwDTO implements Serializable { ...@@ -64,12 +64,12 @@ public class WxEnterpriseQwDTO implements Serializable {
public void setSelfSecret(String selfSecret) { public void setSelfSecret(String selfSecret) {
this.selfSecret = selfSecret; this.selfSecret = selfSecret;
} }
// 好办小程序应用id // 好办小程序应用id
private String agentId; private String agentId;
// 好办小程序名称 // 好办小程序名称
private String agentName; private String agentName;
// 第三方使用的加密的userid // 第三方使用的加密的userid
public boolean needOpenUserId3th() { public boolean needOpenUserId3th() {
......
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.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 { ...@@ -13,7 +13,8 @@ public enum PreDealTypeEnum {
friend(8, "第三方好友"), friend(8, "第三方好友"),
friend_merge(9, "好友数据合并"), friend_merge(9, "好友数据合并"),
tag(10, "标签"), tag(10, "标签"),
tag_member(11, "会员标签"); tag_member(11, "会员标签"),
modify_hm(20,"批量修改活码") ;
private int val; private int val;
private String name; private String name;
......
...@@ -16,7 +16,9 @@ public enum SyncTaskStatusEnum { ...@@ -16,7 +16,9 @@ public enum SyncTaskStatusEnum {
friend_sync(9), friend_sync(9),
merge_friend_sync(10), merge_friend_sync(10),
tag(10), tag(10),
member_tag(10); member_tag(10) ,
modify_hm(21) ;
private int val; private int val;
......
...@@ -8,7 +8,8 @@ public enum SyncTaskTypeEnum { ...@@ -8,7 +8,8 @@ public enum SyncTaskTypeEnum {
FRIEND_SINGLE(4, "单个成员刷新好友"), FRIEND_SINGLE(4, "单个成员刷新好友"),
FRIEND_STORE(5, "刷新门店好友"), FRIEND_STORE(5, "刷新门店好友"),
MEMBER_TAG(6, "企业微信标签刷新"), MEMBER_TAG(6, "企业微信标签刷新"),
FRIEND_WX_ENTEPRISE(10, "企业好友初始化"); FRIEND_WX_ENTEPRISE(10, "企业好友初始化"),
BATCH_MODIFY_HM(20, "企微多人活码增加/剔除关联账号");
private int type; private int type;
private String taskName; private String taskName;
......
...@@ -53,11 +53,22 @@ public interface MemberUnionidRelatedApiService { ...@@ -53,11 +53,22 @@ public interface MemberUnionidRelatedApiService {
* 查看是否可以跳转会员详情的会员列表 * 查看是否可以跳转会员详情的会员列表
* *
* @param externalUserid * @param externalUserid
* @param wxUserId
* @param storeId * @param storeId
* @return * @return
*/ */
List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String staffId, String storeId); 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);
/** /**
* 创建企业群发, 支出素材批量发送 * 创建企业群发, 支出素材批量发送
...@@ -76,9 +87,6 @@ public interface MemberUnionidRelatedApiService { ...@@ -76,9 +87,6 @@ public interface MemberUnionidRelatedApiService {
* 创建企业群发, 支出素材批量发送 * 创建企业群发, 支出素材批量发送
* *
* @param wxEnterpriseId : 微信企业id * @param wxEnterpriseId : 微信企业id
* @param staffId : 用户id
* @param extendUserList : 发送的用户id
* @param materialIdList : 素材id列表
* @return : 返回群发执行结果 * @return : 返回群发执行结果
*/ */
JSONResponse share(String wxEnterpriseId, List<String> clerkIdList, String message , List<ContentMaterialDTO> imgList); JSONResponse share(String wxEnterpriseId, List<String> clerkIdList, String message , List<ContentMaterialDTO> imgList);
......
...@@ -19,9 +19,7 @@ public interface StaffApiService { ...@@ -19,9 +19,7 @@ public interface StaffApiService {
List<StaffDepartmentRelatedDTO> listStaffDepartmentByStaffId(String staffId); List<StaffDepartmentRelatedDTO> listStaffDepartmentByStaffId(String staffId);
Page<StaffDTO> pageStaff(List<String> departmentId, Integer activeFlag, Page<StaffDTO> pageStaff(StaffListDTO staffListDTO);
String keyword, BasePageInfo pageInfo, Integer relationFlag, String wxEnterpriseId , String permitState,
Integer occupy);
/** /**
* 保存微信成员 * 保存微信成员
...@@ -337,4 +335,11 @@ public interface StaffApiService { ...@@ -337,4 +335,11 @@ public interface StaffApiService {
* @return * @return
*/ */
com.gic.api.base.commons.ServiceResponse<Boolean> autoActivateCallBack(String params) ; 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 { ...@@ -65,4 +65,13 @@ public interface GroupChatPlanApiService {
public ServiceResponse<Void> del(String clerkId, String clerkName, Long planId); public ServiceResponse<Void> del(String clerkId, String clerkName, Long planId);
public ServiceResponse<Void> stop(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; package com.gic.haoban.manage.api.service.hm;
import java.util.List;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO; 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.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO; 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.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import java.util.List;
/** /**
* @author mozhu * @author mozhu
* @date 2022/7/5 09:33 * @date 2022/7/5 09:33
...@@ -55,6 +58,17 @@ public interface HmQrcodeApiService { ...@@ -55,6 +58,17 @@ public interface HmQrcodeApiService {
* @date 2022-07-05 10:59:06 * @date 2022-07-05 10:59:06
*/ */
ServiceResponse update(HmQrcodeQDTO hmQrcodeQDTO); ServiceResponse update(HmQrcodeQDTO hmQrcodeQDTO);
/**
*
* @Title: batchModifyHm
* @Description: 批量更新多人活码
* @author xugh
* @param qdto
* @return
* @throws
*/
public ServiceResponse batchUpdateHm(HmQrcodeQDTO qdto) ;
/** /**
* 查询详情 * 查询详情
...@@ -178,5 +192,9 @@ public interface HmQrcodeApiService { ...@@ -178,5 +192,9 @@ public interface HmQrcodeApiService {
ServiceResponse<List<String>> listHasQrcodeClerk(String enterpriseId, List<String> clerkIdList); ServiceResponse<List<String>> listHasQrcodeClerk(String enterpriseId, List<String> clerkIdList);
ServiceResponse<String> getClerkQrcode(String enterpriseId , String clerkId) ; ServiceResponse<String> getClerkQrcode(String enterpriseId , String clerkId) ;
ServiceResponse<List<HmBatchModifyResultDTO>> batchModify(HmBatchModifyQDTO qdto) ;
ServiceResponse<HmBatchCountDTO> getModifyResult(String wxEnterpriseId , String taskId) ;
} }
package com.gic.haoban.manage.service.dao.mapper; 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 com.gic.haoban.manage.service.entity.TabHaobanPreDealLog;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -115,6 +114,10 @@ public interface PreDealLogMapper { ...@@ -115,6 +114,10 @@ public interface PreDealLogMapper {
* @return * @return
*/ */
public List<TabHaobanPreDealLog> listRebuildDepartByTaskId(@Param("taskId") String taskId); 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; ...@@ -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.api.dto.StaffDTO;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.pojo.bo.StaffListBO;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -37,13 +38,7 @@ public interface StaffMapper { ...@@ -37,13 +38,7 @@ public interface StaffMapper {
List<TabHaobanStaff> listLikeName(@Param("staffName") String staffName, @Param("wxEnterpriseId") String wxEnterpriseId); List<TabHaobanStaff> listLikeName(@Param("staffName") String staffName, @Param("wxEnterpriseId") String wxEnterpriseId);
Page<TabHaobanStaff> pageStaff(@Param("staffIds") List<String> staffIds, Page<TabHaobanStaff> pageStaff(StaffListBO staffListBO);
@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);
List<TabHaobanStaff> listByPhoneNumber(@Param("phoneNumber") String phoneNumber); List<TabHaobanStaff> listByPhoneNumber(@Param("phoneNumber") String phoneNumber);
......
...@@ -37,4 +37,6 @@ public interface SyncTaskMapper { ...@@ -37,4 +37,6 @@ public interface SyncTaskMapper {
List<TabHaobanSyncTask> listPageByWxEid(String wxEnterpriseId); List<TabHaobanSyncTask> listPageByWxEid(String wxEnterpriseId);
List<TabHaobanSyncTask> listTaskByType(@Param("taskType")int taskType); 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 { ...@@ -121,4 +121,14 @@ public interface TabHaobanStaffClerkRelationMapper {
List<StaffClerkRelationDTO> listByStoreIds(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("storeIds") List<String> storeIds); List<StaffClerkRelationDTO> listByStoreIds(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("storeIds") List<String> storeIds);
List<String> listAllClerkIdsByEnterpriseId(@Param("enterpriseId") String enterpriseId); 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 { ...@@ -44,4 +44,13 @@ public interface GroupChatPlanOwnerLogMapper {
public List<GroupChatPlanOwnerLogDTO> listOwnerLogPageForWxa(GroupChatPlanSearchQDTO qdto); 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); 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
...@@ -86,6 +86,8 @@ public interface TabHaobanHmClerkRelationMapper { ...@@ -86,6 +86,8 @@ public interface TabHaobanHmClerkRelationMapper {
* @date 2022-07-13 17:04:38 * @date 2022-07-13 17:04:38
*/ */
List<TabHaobanHmClerkRelation> getHmClerkByHmId(@Param("hmId") Long hmId); List<TabHaobanHmClerkRelation> getHmClerkByHmId(@Param("hmId") Long hmId);
List<TabHaobanHmClerkRelation> listHmClerkByHmIdList(@Param("hmIdList") List<Long> hmIdList) ;
/** /**
* 根据hmid 获取导购信息 * 根据hmid 获取导购信息
......
...@@ -23,6 +23,10 @@ public interface TabHaobanHmQrcodeMapper { ...@@ -23,6 +23,10 @@ public interface TabHaobanHmQrcodeMapper {
* @return 实例对象 * @return 实例对象
*/ */
TabHaobanHmQrcode queryById(@Param("hmId") Long hmId); TabHaobanHmQrcode queryById(@Param("hmId") Long hmId);
List<TabHaobanHmQrcode> queryByIdList(@Param("hmIds") List<Long> hmIds);
/** /**
* 新增数据 * 新增数据
......
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;
}
}
...@@ -177,4 +177,19 @@ public interface StaffClerkRelationService { ...@@ -177,4 +177,19 @@ public interface StaffClerkRelationService {
* @return * @return
*/ */
List<String> listAllClerkIdsByEnterpriseId(String enterpriseId); 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; ...@@ -7,6 +7,7 @@ import java.util.List;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.pojo.bo.StaffListBO;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
public interface StaffService { public interface StaffService {
...@@ -17,9 +18,7 @@ public interface StaffService { ...@@ -17,9 +18,7 @@ public interface StaffService {
String add(TabHaobanStaff tab); String add(TabHaobanStaff tab);
Page<TabHaobanStaff> pageStaff(List<String> staffIds, Integer activeFlag, Page<TabHaobanStaff> pageStaff(StaffListBO staffListBO);
String keyword, List<String> departmentIds, String wxEnterpriseId, Integer relationFlag,String permitState,
Integer occupy);
void updateByPrimaryKey(TabHaobanStaff tab); void updateByPrimaryKey(TabHaobanStaff tab);
......
...@@ -36,6 +36,9 @@ public interface SyncTaskService { ...@@ -36,6 +36,9 @@ public interface SyncTaskService {
* @return * @return
*/ */
public TabHaobanSyncTask getSyncTask(String taskId); public TabHaobanSyncTask getSyncTask(String taskId);
public TabHaobanSyncTask getSyncNewestTask(String wxEnterpriseId , int taskType);
/** /**
* 获取任务列表 * 获取任务列表
......
...@@ -35,4 +35,13 @@ public interface GroupChatPlanOwnerLogService { ...@@ -35,4 +35,13 @@ public interface GroupChatPlanOwnerLogService {
public GroupChatPlanOwnerLogDTO getOwnerInfo(Long planId, String staffId, String clerkId, String wxEnterpriseId); 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
...@@ -255,4 +255,9 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe ...@@ -255,4 +255,9 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
return dto; return dto;
} }
@Override
public Integer getTotalCount(String enterpriseId, String clerkId, String storeId) {
return groupChatPlanOwnerLogMapper.getTotalCount(enterpriseId,clerkId,storeId);
}
} }
\ No newline at end of file
...@@ -2,6 +2,9 @@ package com.gic.haoban.manage.service.service.hm; ...@@ -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.BasePageInfo;
import com.gic.api.base.commons.Page; 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.api.dto.qdto.hm.HmClerkRelationQDTO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmClerkRelationBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmClerkRelationBO;
...@@ -142,5 +145,7 @@ public interface HmClerkRelationService { ...@@ -142,5 +145,7 @@ public interface HmClerkRelationService {
* @throws * @throws
*/ */
void updateByClerkChangeStore(String enterpriseId,String oldClerkId,String newClerkId) ; void updateByClerkChangeStore(String enterpriseId,String oldClerkId,String newClerkId) ;
ServiceResponse<List<HmBatchModifyResultDTO>> batchModify(HmBatchModifyQDTO qdto);
} }
package com.gic.haoban.manage.service.service.hm; 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.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
...@@ -9,7 +8,6 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO; ...@@ -9,7 +8,6 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
/** /**
......
...@@ -4,6 +4,7 @@ import java.util.Collections; ...@@ -4,6 +4,7 @@ import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.gic.haoban.manage.service.pojo.bo.StaffListBO;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -86,9 +87,18 @@ public class StaffServiceImpl implements StaffService { ...@@ -86,9 +87,18 @@ public class StaffServiceImpl implements StaffService {
} }
@Override @Override
public Page<TabHaobanStaff> pageStaff(List<String> staffIds, Integer activeFlag, String keyword,List<String> departmentIds,String wxEnterpriseId,Integer relationFlag,String permitState, public Page<TabHaobanStaff> pageStaff(StaffListBO staffListBO) {
Integer occupy) { if (null == staffListBO){
return mapper.pageStaff(staffIds, activeFlag, keyword,departmentIds,wxEnterpriseId,relationFlag,permitState,occupy); 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 @Override
......
...@@ -50,6 +50,11 @@ public class SyncTaskServiceImpl implements SyncTaskService { ...@@ -50,6 +50,11 @@ public class SyncTaskServiceImpl implements SyncTaskService {
public TabHaobanSyncTask getSyncTask(String taskId) { public TabHaobanSyncTask getSyncTask(String taskId) {
return syncTaskMapper.selectByPrimaryKey(taskId); return syncTaskMapper.selectByPrimaryKey(taskId);
} }
@Override
public TabHaobanSyncTask getSyncNewestTask(String wxEnterpriseId, int taskType) {
return syncTaskMapper.getSyncNewestTask(wxEnterpriseId,taskType);
}
@Override @Override
public Page<SyncTaskDTO> listTaskPage(String wxEnterpriseId, BasePageInfo pageInfo) { public Page<SyncTaskDTO> listTaskPage(String wxEnterpriseId, BasePageInfo pageInfo) {
......
...@@ -465,4 +465,4 @@ public class WelcomeSendServiceImpl implements WelcomeSendService { ...@@ -465,4 +465,4 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
} }
return null; return null;
} }
} }
...@@ -125,7 +125,10 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ ...@@ -125,7 +125,10 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
} else if (dataType.equals(PreDealTypeEnum.tag_member.getVal())) { } else if (dataType.equals(PreDealTypeEnum.tag_member.getVal())) {
logger.info("11 会员标签处理标签项:{}", params); logger.info("11 会员标签处理标签项:{}", params);
operationMap.get("friendMemberTagSyncOperation").dealSingleByMq(dealParamMqDTO, dataPre); 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); logger.info("不是正常数据类型:{}", params);
} }
} }
......
...@@ -34,6 +34,9 @@ import com.gic.haoban.manage.service.config.Config; ...@@ -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.StaffDepartmentRelatedMapper;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper; import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.entity.*; 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.*;
import com.gic.haoban.manage.service.service.chat.GroupChatService; import com.gic.haoban.manage.service.service.chat.GroupChatService;
import com.gic.haoban.manage.service.util.EmojiFilterUtil; import com.gic.haoban.manage.service.util.EmojiFilterUtil;
...@@ -107,6 +110,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -107,6 +110,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private QywxOrderApiService qywxOrderApiService; private QywxOrderApiService qywxOrderApiService;
@Autowired @Autowired
private GroupChatService groupChatService; private GroupChatService groupChatService;
@Autowired
private WxEnterpriseRelatedService wxEnterpriseRelatedService;
@Override @Override
public StaffDTO selectById(String staffId) { public StaffDTO selectById(String staffId) {
...@@ -137,25 +142,72 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -137,25 +142,72 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
@Override @Override
public Page<StaffDTO> pageStaff(List<String> departmentIds, Integer activeFlag, String keyword, BasePageInfo pageInfo, Integer relationFlag, String wxEnterpriseId,String permitState, public Page<StaffDTO> pageStaff(StaffListDTO staffListDTO) {
Integer occupy) { 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<>(); List<String> staffIds = new ArrayList<>();
if (relationFlag != null) { //查询所属品牌成员id
staffIds = staffClerkRelationService.listByWxEnterpriseId(wxEnterpriseId); if(StrUtil.isNotBlank(enterpriseIdParam)){
if (CollectionUtils.isEmpty(staffIds) && relationFlag == 1){ //-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<>(); 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()); 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(); List<StaffDTO> staffDTOList = page.getResult();
if (CollectionUtils.isEmpty(staffDTOList)) { if (CollectionUtils.isEmpty(staffDTOList)) {
return new Page<>(); return new Page<>();
} }
Set<String> staffIdList = staffDTOList.stream().map(dto -> dto.getStaffId()).collect(Collectors.toSet()); Set<String> staffIdList = staffDTOList.stream().map(dto -> dto.getStaffId()).collect(Collectors.toSet());
List<String> relationIdList = this.staffClerkRelationService.listRelationsStaffId(staffIdList); 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 -> { 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; return page;
} }
...@@ -1036,6 +1088,11 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1036,6 +1088,11 @@ public class StaffApiServiceImpl implements StaffApiService {
stringMap.put("handoverStaffName",handoverStaff.getStaffName()); stringMap.put("handoverStaffName",handoverStaff.getStaffName());
stringMap.put("takeoverStaffName",takeOverStaff.getStaffName()); stringMap.put("takeoverStaffName",takeOverStaff.getStaffName());
stringMap.put("errorCode",String.valueOf(dto.getErrcode())); 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); failedList.add(stringMap);
} }
} }
...@@ -1104,4 +1161,10 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1104,4 +1161,10 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
return com.gic.api.base.commons.ServiceResponse.success(true); 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));
}
} }
...@@ -148,6 +148,11 @@ public class GroupChatPlanApiServiceImpl implements GroupChatPlanApiService { ...@@ -148,6 +148,11 @@ public class GroupChatPlanApiServiceImpl implements GroupChatPlanApiService {
} }
@Override @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, public ServiceResponse<Page<GroupChatPlanOwnerLogDTO>> listOwnerLogPageForWxa(GroupChatPlanSearchQDTO qdto,
BasePageInfo basePageInfo) { BasePageInfo basePageInfo) {
Page<GroupChatPlanOwnerLogDTO> page = this.groupChatPlanOwnerLogService.listOwnerLogPageForWxa(qdto, Page<GroupChatPlanOwnerLogDTO> page = this.groupChatPlanOwnerLogService.listOwnerLogPageForWxa(qdto,
......
...@@ -4,6 +4,7 @@ import java.util.ArrayList; ...@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -17,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -17,6 +18,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.esotericsoftware.minlog.Log;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.dto.ClerkDTO; import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
...@@ -31,9 +33,12 @@ import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO; ...@@ -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.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO; 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.HmClerkDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO; 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.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.HmClerkRelationQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO; 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.HmQrcodeQDTO;
...@@ -42,7 +47,12 @@ import com.gic.haoban.manage.api.enums.WelcomeRelationStatusEnum; ...@@ -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.enums.hm.HmWelcomeReferType;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService; import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.service.config.Config; 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.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.HmClerkRelationBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmGroupSettingBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmGroupSettingBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
...@@ -51,6 +61,7 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO; ...@@ -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.pojo.bo.welcome.WelcomeDetailBO;
import com.gic.haoban.manage.service.service.StaffClerkRelationService; import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.StaffService; 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.WelcomeService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.hm.HmClerkRelationService; import com.gic.haoban.manage.service.service.hm.HmClerkRelationService;
...@@ -112,6 +123,12 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -112,6 +123,12 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
private WelcomeService welcomeService; private WelcomeService welcomeService;
@Autowired @Autowired
private RightService rightService; private RightService rightService;
@Autowired
private SyncTaskService syncTaskService;
@Autowired
private PreDealLogMapper preDealLogMapper ;
@Autowired
private TabHaobanHmQrcodeMapper hmQrcodeMapper;
@GicLogRecord(value = "新增员工活码-${#logContent}", @GicLogRecord(value = "新增员工活码-${#logContent}",
category = GicLogRecordCategoryEnum.HUOMA, category = GicLogRecordCategoryEnum.HUOMA,
...@@ -367,6 +384,42 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -367,6 +384,42 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
} }
return ServiceResponse.success(); 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();
}
/** /**
* 修改活码操作日志 * 修改活码操作日志
...@@ -908,4 +961,62 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -908,4 +961,62 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
public com.gic.api.base.commons.ServiceResponse<String> getClerkQrcode(String enterpriseId, String clerkId) { public com.gic.api.base.commons.ServiceResponse<String> getClerkQrcode(String enterpriseId, String clerkId) {
return ServiceResponse.success(hmQrcodeService.getClerkQrcode(enterpriseId, 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);
}
} }
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) {
}
}
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="pageStaff" resultMap="BaseResultMap"> <select id="pageStaff" parameterType="com.gic.haoban.manage.service.pojo.bo.StaffListBO" resultMap="BaseResultMap">
select select
a.* a.*
<if test="departmentIds != null and departmentIds.size() > 0"> <if test="departmentIds != null and departmentIds.size() > 0">
...@@ -302,8 +302,8 @@ ...@@ -302,8 +302,8 @@
<if test="occupy == null or 1!=occupy"> <if test="occupy == null or 1!=occupy">
and a.status_flag = 1 and a.status_flag = 1
</if> </if>
<if test="keyword != null and keyword != ''"> <if test="keyWord != null and keyWord != ''">
and (a.staff_name like CONCAT('%',#{keyword},'%') or a.phone_number like CONCAT('%',#{keyword},'%')) and (a.staff_name like CONCAT('%',#{keyWord},'%') or a.phone_number like CONCAT('%',#{keyWord},'%'))
</if> </if>
<if test="activeFlag != null"> <if test="activeFlag != null">
and a.active_flag = #{activeFlag} and a.active_flag = #{activeFlag}
...@@ -356,7 +356,7 @@ ...@@ -356,7 +356,7 @@
<if test="departmentIds != null and departmentIds.size() > 0"> <if test="departmentIds != null and departmentIds.size() > 0">
group by a.staff_id group by a.staff_id
</if> </if>
order by a.create_time desc order by ${sortField} ${sortType}
</select> </select>
<select id="listByIds" resultMap="BaseResultMap"> <select id="listByIds" resultMap="BaseResultMap">
select select
......
...@@ -21,6 +21,14 @@ ...@@ -21,6 +21,14 @@
from tab_haoban_sync_task from tab_haoban_sync_task
where task_id = #{taskId,jdbcType=VARCHAR} where task_id = #{taskId,jdbcType=VARCHAR}
</select> </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 id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from tab_haoban_sync_task delete from tab_haoban_sync_task
where task_id = #{taskId,jdbcType=VARCHAR} where task_id = #{taskId,jdbcType=VARCHAR}
......
...@@ -460,9 +460,9 @@ ...@@ -460,9 +460,9 @@
</foreach> </foreach>
and wx_enterprise_id = #{wxEnterpriseId} and wx_enterprise_id = #{wxEnterpriseId}
and enterprise_id = #{enterpriseId} and enterprise_id = #{enterpriseId}
and status_flag = 1 and external_status = 1 and status_flag = 1 and external_status = 1
and external_user_id is not null and external_user_id is not null
group by member_id group by member_id
</select> </select>
<select id="getLastByExTernalUseridAndWxUserIdNoStatus" resultMap="BaseResultMap"> <select id="getLastByExTernalUseridAndWxUserIdNoStatus" resultMap="BaseResultMap">
......
...@@ -453,4 +453,26 @@ ...@@ -453,4 +453,26 @@
where a.enterprise_id = #{enterpriseId} and a.status_flag=1 and b.status_flag = 1 where a.enterprise_id = #{enterpriseId} and a.status_flag=1 and b.status_flag = 1
</select> </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> </mapper>
\ No newline at end of file
...@@ -87,6 +87,16 @@ ...@@ -87,6 +87,16 @@
from tab_haoban_hm_clerk_relation from tab_haoban_hm_clerk_relation
where hm_id = #{hmId} and status = 1 where hm_id = #{hmId} and status = 1
</select> </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 id="getHmClerkByHmIdAndStaffId" resultMap="TabHaobanHmClerkRelationMap">
select <include refid="Base_Column_List"></include> select <include refid="Base_Column_List"></include>
......
...@@ -50,7 +50,16 @@ ...@@ -50,7 +50,16 @@
from tab_haoban_hm_qrcode from tab_haoban_hm_qrcode
where hm_id = #{hmId} where hm_id = #{hmId}
</select> </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"> <insert id="insert" keyProperty="hmId" useGeneratedKeys="true">
...@@ -304,8 +313,11 @@ ...@@ -304,8 +313,11 @@
</foreach> </foreach>
) )
</if> </if>
<if test="null != statusFlagInt"> <if test="null != statusFlagInt and statusFlagInt !=10">
and a.status_flag = #{statusFlagInt} and a.status_flag = #{statusFlagInt}
</if>
<if test="null != statusFlagInt and statusFlagInt ==10">
and a.status_flag in (1,3)
</if> </if>
<if test="null != hmTypeInt"> <if test="null != hmTypeInt">
and a.hm_type=#{hmTypeInt} and a.hm_type=#{hmTypeInt}
......
...@@ -2,6 +2,7 @@ import java.io.IOException; ...@@ -2,6 +2,7 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
...@@ -10,15 +11,19 @@ import org.springframework.test.context.ContextConfiguration; ...@@ -10,15 +11,19 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.BasePageInfo; 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.HmLinkDTO;
import com.gic.haoban.manage.api.dto.hm.HmLinkStoreDTO; 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.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.KeyDataApiService;
import com.gic.haoban.manage.api.service.hm.HmLinkApiService; 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.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.service.hm.HmLinkStoreService;
import com.gic.haoban.manage.service.util.QwFriendLimitCountUtil; import com.gic.haoban.manage.service.util.QwFriendLimitCountUtil;
...@@ -29,7 +34,7 @@ public class HmLinkTest { ...@@ -29,7 +34,7 @@ public class HmLinkTest {
private HmLinkApiService hmLinkApiService; private HmLinkApiService hmLinkApiService;
@Autowired @Autowired
private HmLinkVisitLogApiService hmLinkVisitLogApiService; private HmClerkRelationService hmClerkRelationService;
@Autowired @Autowired
private KeyDataApiService keyDataApiService; private KeyDataApiService keyDataApiService;
...@@ -38,21 +43,34 @@ public class HmLinkTest { ...@@ -38,21 +43,34 @@ public class HmLinkTest {
private HmLinkStoreService hmLinkStoreService; private HmLinkStoreService hmLinkStoreService;
@Autowired @Autowired
private QywxSendService qywxSendService ; private QywxSendService qywxSendService ;
@Autowired
private DealSyncOperationApiService dealSyncOperationApiService ;
volatile int x = 0 ; volatile int x = 0 ;
@Test @Test
public void test() throws IOException, InterruptedException { public void test() throws IOException, InterruptedException {
String taskId = "c7e319c16ba942eea8a3b91d6a763518" ;
List<ContentMaterialDTO> imageList = new ArrayList<>(); DealParamMqDTO dealParamMqDTO = new DealParamMqDTO();
ContentMaterialDTO d = new ContentMaterialDTO() ; dealParamMqDTO.setTaskId(taskId);
d.setImgUrl("https://p.qlogo.cn/bizmail/hxlMR3pdsfnslruRxMXebKiabKrgOOpdmJ7shD0jUFbcUMoOh9I7AXw/0"); dealParamMqDTO.setData(517064205447217236l+"");
d.setMaterialType(2); dealParamMqDTO.setType(SyncTaskStatusEnum.modify_hm.getVal());
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);
......
...@@ -6,13 +6,15 @@ import java.util.stream.Collectors; ...@@ -6,13 +6,15 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.gic.haoban.manage.api.dto.*; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.dto.qdto.TransferActiveCodeQDTO; import com.gic.haoban.manage.api.dto.qdto.TransferActiveCodeQDTO;
import com.gic.haoban.manage.api.service.*; import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.web.log.LogRecordUserServiceImpl; 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.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.anno.GicLogRecord;
import com.gic.log.record.util.GicLogRecordCategoryEnum; import com.gic.log.record.util.GicLogRecordCategoryEnum;
import com.gic.log.record.util.GicLogRecordEvaluationContext; import com.gic.log.record.util.GicLogRecordEvaluationContext;
...@@ -47,9 +49,6 @@ import com.gic.haoban.common.utils.PageUtil; ...@@ -47,9 +49,6 @@ import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum; import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.StaffEditJsonQO; 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.gic.wechat.api.service.qywx.QywxUserApiService;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
...@@ -119,36 +118,25 @@ public class StaffController extends WebBaseController { ...@@ -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") @RequestMapping("staff-list")
public HaobanResponse staffList(String departmentId, public HaobanResponse staffList(@RequestBody StaffListQO qo) {
Integer activeFlag, logger.info("通讯录列表查询参数:{}",JSONObject.toJSONString(qo));
Integer relationFlag,
String keyWord,
String permitState,
Integer occupy,
BasePageInfo pageInfo) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser(); WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId(); String wxEnterpriseId = login.getWxEnterpriseId();
List<String> departmentIds = new ArrayList<>(); List<String> departmentIds = new ArrayList<>();
DepartmentDTO departmentDTO = departmentApiService.selectById(departmentId); DepartmentDTO departmentDTO = departmentApiService.selectById(qo.getDepartmentId());
if (departmentDTO != null) { if (departmentDTO != null) {
String parentDepartmentId = departmentDTO.getParentDepartmentId(); String parentDepartmentId = departmentDTO.getParentDepartmentId();
if (!"0".equals(parentDepartmentId)) { 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()); logger.info("pages={},totalPage={}", page.getCurrentPage(), page.getTotalPage());
if(CollectionUtils.isNotEmpty(page.getResult())) { if(CollectionUtils.isNotEmpty(page.getResult())) {
...@@ -475,7 +463,9 @@ public class StaffController extends WebBaseController { ...@@ -475,7 +463,9 @@ public class StaffController extends WebBaseController {
* @Description 会员导出 * @Description 会员导出
*/ */
@RequestMapping("staff-export") @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(); WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId(); String wxEnterpriseId = login.getWxEnterpriseId();
if(StringUtils.isBlank(departmentId)){ if(StringUtils.isBlank(departmentId)){
...@@ -489,11 +479,23 @@ public class StaffController extends WebBaseController { ...@@ -489,11 +479,23 @@ public class StaffController extends WebBaseController {
List<String> departmentIds ; List<String> departmentIds ;
departmentIds = relationList.stream().map(DepartmentDTO::getDepartmentId).collect(Collectors.toList()); departmentIds = relationList.stream().map(DepartmentDTO::getDepartmentId).collect(Collectors.toList());
List<StaffDTO> staffAllList = Lists.newArrayListWithCapacity(5000); 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); pageInfo.setPageSize(Integer.MAX_VALUE);
int pageNum = 1; int pageNum = 1;
while (true) { while (true) {
pageInfo.setPageNum(pageNum); 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(); List<StaffDTO> list = page.getResult();
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
break; break;
...@@ -502,6 +504,12 @@ public class StaffController extends WebBaseController { ...@@ -502,6 +504,12 @@ public class StaffController extends WebBaseController {
pageNum++; pageNum++;
} }
List<StaffExportVO> voList = new ArrayList<>(); 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) { for (StaffDTO staffDTO : staffAllList) {
StaffExportVO vo = new StaffExportVO(); StaffExportVO vo = new StaffExportVO();
vo.setStaffId(staffDTO.getStaffId()); vo.setStaffId(staffDTO.getStaffId());
...@@ -510,6 +518,15 @@ public class StaffController extends WebBaseController { ...@@ -510,6 +518,15 @@ public class StaffController extends WebBaseController {
vo.setPosition(staffDTO.getPostion()); vo.setPosition(staffDTO.getPostion());
vo.setDepartmentName(departmentMap.get(staffDTO.getDepartmentIds()) == null ? null : departmentMap.get(staffDTO.getDepartmentIds()).getDepartmentName()); vo.setDepartmentName(departmentMap.get(staffDTO.getDepartmentIds()) == null ? null : departmentMap.get(staffDTO.getDepartmentIds()).getDepartmentName());
vo.setRelationFlag((Objects.isNull(staffDTO.getRelationFlag()) || staffDTO.getRelationFlag() == 0) ? "未关联" : "已关联"); 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); voList.add(vo);
} }
//拼接导购信息 //拼接导购信息
...@@ -520,8 +537,15 @@ public class StaffController extends WebBaseController { ...@@ -520,8 +537,15 @@ public class StaffController extends WebBaseController {
} }
mergeClerkInfo(voList, wxEnterpriseId); mergeClerkInfo(voList, wxEnterpriseId);
String fileName = wxEnterpriseName + "通讯录" + DateUtil.dateToStr(new Date(), DateUtil.FORMAT_DATE_8); String fileName = wxEnterpriseName + "通讯录" + DateUtil.dateToStr(new Date(), DateUtil.FORMAT_DATE_8);
List<String> titleList = Arrays.asList("姓名", "职务", "部门", "手机号", "关联状态", "关联导购"); List<String> titleList =new ArrayList<>();
List<String> fileList = Arrays.asList("staffName", "position", "departmentName", "phoneNumber", "relationFlag", "clerkName"); 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 { try {
ExcelUtils.xls(response, request, fileName, voList, fileList, titleList); ExcelUtils.xls(response, request, fileName, voList, fileList, titleList);
} catch (Exception e) { } catch (Exception e) {
...@@ -631,4 +655,20 @@ public class StaffController extends WebBaseController { ...@@ -631,4 +655,20 @@ public class StaffController extends WebBaseController {
return RestResponse.successResult(transferActiveCodeDTOServiceResponse); 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();
}
}
package com.gic.haoban.manage.web.controller.hm; 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.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo; import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
...@@ -10,7 +28,16 @@ import com.gic.commons.webapi.reponse.RestResponse; ...@@ -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.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil; import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.constants.StatisticsApolloKeyConstant; 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.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogSearchQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogSearchQDTO;
...@@ -24,6 +51,7 @@ import com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService; ...@@ -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.api.util.DataHttpUtil;
import com.gic.haoban.manage.web.dto.HmOverviewDTO; import com.gic.haoban.manage.web.dto.HmOverviewDTO;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; 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.HmQrcodeDetailQO;
import com.gic.haoban.manage.web.qo.hm.HmQrcodeUpdateQO; import com.gic.haoban.manage.web.qo.hm.HmQrcodeUpdateQO;
import com.gic.haoban.manage.web.qo.hm.data.HmDetailClerkListQO; import com.gic.haoban.manage.web.qo.hm.data.HmDetailClerkListQO;
...@@ -33,18 +61,8 @@ import com.gic.haoban.manage.web.utils.statistics.DataStatisticsParamUtils; ...@@ -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.utils.statistics.DateUtils;
import com.gic.haoban.manage.web.vo.hm.HmDetailClerkListVO; import com.gic.haoban.manage.web.vo.hm.HmDetailClerkListVO;
import com.gic.haoban.manage.web.vo.hm.HmTrendVO; 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 cn.hutool.core.convert.Convert;
import java.util.*;
import java.util.stream.Collectors;
/** /**
* 活码(TabHaobanHmQrcode)表控制层 * 活码(TabHaobanHmQrcode)表控制层
...@@ -238,6 +256,79 @@ public class HmQrcodeController { ...@@ -238,6 +256,79 @@ public class HmQrcodeController {
} }
return RestResponse.successResult(statisticsDTO); 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 { ...@@ -376,7 +467,13 @@ public class HmQrcodeController {
@RequestMapping(path = "/update/qrcode/group") @RequestMapping(path = "/update/qrcode/group")
public RestResponse<?> batchUpdateQrcodeGroup(@RequestBody HmQrcodeUpdateQO qrcodeUpdateQo) { 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()) { if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage()); 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;
}
}
package com.gic.haoban.manage.web.qo.hm; package com.gic.haoban.manage.web.qo.hm;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
/** import com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO.InFields;
* @Author MUSI
* @Date 2022/7/13 6:54 PM /**
* @Description * @Author MUSI
* @Version * @Date 2022/7/13 6:54 PM
**/ * @Description
public class HmQrcodeUpdateQO implements Serializable { * @Version
private static final long serialVersionUID = -1636719509633485056L; **/
public class HmQrcodeUpdateQO implements Serializable {
private List<Long> hmIds; private static final long serialVersionUID = -1636719509633485056L;
private Long groupId; private List<Long> hmIds;
public List<Long> getHmIds() { private Long groupId;
return hmIds;
} private InFields inFields;
public void setHmIds(List<Long> hmIds) { private int allFlag ;
this.hmIds = hmIds;
} public int getAllFlag() {
return allFlag;
public Long getGroupId() { }
return groupId;
} public void setAllFlag(int allFlag) {
this.allFlag = allFlag;
public void setGroupId(Long groupId) { }
this.groupId = groupId;
} public InFields getInFields() {
} return inFields;
}
public void setInFields(InFields inFields) {
this.inFields = inFields;
}
public List<Long> getHmIds() {
return hmIds;
}
public void setHmIds(List<Long> hmIds) {
this.hmIds = hmIds;
}
public Long getGroupId() {
return groupId;
}
public void setGroupId(Long groupId) {
this.groupId = groupId;
}
}
...@@ -27,6 +27,18 @@ public class StaffExportVO implements Serializable{ ...@@ -27,6 +27,18 @@ public class StaffExportVO implements Serializable{
* 关联状态为 员工是否关联某门店导购 * 关联状态为 员工是否关联某门店导购
*/ */
private String relationFlag; private String relationFlag;
/**
* gic品牌名称
*/
private String enterpriseName;
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
public String getActiveFlag() { public String getActiveFlag() {
return activeFlag; 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 { ...@@ -102,6 +102,7 @@ public class WxEnterpriseVO implements Serializable {
private Integer wxSecurityType ; private Integer wxSecurityType ;
private String wxCorpid ; private String wxCorpid ;
private String openCorpid ; private String openCorpid ;
private String wxaAppid ;
public Integer getWxSecurityType() { public Integer getWxSecurityType() {
return wxSecurityType; return wxSecurityType;
...@@ -466,4 +467,12 @@ public class WxEnterpriseVO implements Serializable { ...@@ -466,4 +467,12 @@ public class WxEnterpriseVO implements Serializable {
public void setEnterpriseId(String enterpriseId) { public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId; this.enterpriseId = enterpriseId;
} }
public String getWxaAppid() {
return wxaAppid;
}
public void setWxaAppid(String wxaAppid) {
this.wxaAppid = wxaAppid;
}
} }
...@@ -231,6 +231,21 @@ ...@@ -231,6 +231,21 @@
<artifactId>gic-evaluate-manage-api</artifactId> <artifactId>gic-evaluate-manage-api</artifactId>
<version>${gic-evaluate-manage-api}</version> <version>${gic-evaluate-manage-api}</version>
</dependency> </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> </dependencies>
<build> <build>
......
...@@ -2,24 +2,30 @@ package com.gic.haoban.manage.web.controller; ...@@ -2,24 +2,30 @@ package com.gic.haoban.manage.web.controller;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; 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.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.PageResult2; import com.gic.haoban.base.api.common.PageResult2;
import com.gic.haoban.common.utils.EntityUtil; 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.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.notify.dto.NoticeMessageInfoDTO; 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.dto.PendingTaskDetailDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.PendingListQDTO; 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.NoticeMessageCategoryTypeEnum;
import com.gic.haoban.manage.api.enums.PendingTaskTypeEnum; 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.NoticeMessageApiService;
import com.gic.haoban.manage.api.service.notify.PendingTaskApiService; import com.gic.haoban.manage.api.service.notify.PendingTaskApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.CommonQO; import com.gic.haoban.manage.web.qo.CommonQO;
import com.gic.haoban.manage.web.qo.PendingListQO; import com.gic.haoban.manage.web.qo.PendingListQO;
import com.gic.haoban.manage.web.qo.notify.MessageListQO; 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.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.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -39,12 +45,23 @@ import java.util.Map; ...@@ -39,12 +45,23 @@ import java.util.Map;
@RestController @RestController
public class NotifyController extends WebBaseController { public class NotifyController extends WebBaseController {
private static final Logger logger = LoggerFactory.getLogger(NotifyController.class);
@Autowired @Autowired
private PendingTaskApiService pendingTaskApiService; private PendingTaskApiService pendingTaskApiService;
@Autowired @Autowired
private NoticeMessageApiService noticeMessageService; 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 { ...@@ -58,7 +75,7 @@ public class NotifyController extends WebBaseController {
if (qo.getFilterStatus() == 1) { if (qo.getFilterStatus() == 1) {
pendingListQDTO.setOverdueFlag(1); pendingListQDTO.setOverdueFlag(1);
} }
if (qo.getShowSelf()==0) { if (qo.getShowSelf() == 0) {
pendingListQDTO.setClerkId(null); pendingListQDTO.setClerkId(null);
} }
ServiceResponse<Page<PendingTaskDetailDTO>> retPage = pendingTaskApiService.pagePendingTask(pendingListQDTO, qo.getBasePageInfo()); ServiceResponse<Page<PendingTaskDetailDTO>> retPage = pendingTaskApiService.pagePendingTask(pendingListQDTO, qo.getBasePageInfo());
...@@ -136,7 +153,7 @@ public class NotifyController extends WebBaseController { ...@@ -136,7 +153,7 @@ public class NotifyController extends WebBaseController {
@RequestMapping("/message/read") @RequestMapping("/message/read")
public RestResponse readSingle(Long noticeMessageId) { public RestResponse readSingle(Long noticeMessageId) {
if (noticeMessageId == null) { 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); noticeMessageService.updateReadFlagById(noticeMessageId);
return RestResponse.successResult(); return RestResponse.successResult();
...@@ -183,5 +200,56 @@ public class NotifyController extends WebBaseController { ...@@ -183,5 +200,56 @@ public class NotifyController extends WebBaseController {
return RestResponse.successResult(ret.getResult()); 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; ...@@ -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.StoreMemberVO;
import com.gic.haoban.manage.web.vo.WellDoneLoginInfoVO; import com.gic.haoban.manage.web.vo.WellDoneLoginInfoVO;
import com.gic.member.api.service.MemberOpenCardBusinessService; 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.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.UserDTO; import com.gic.wechat.api.dto.qywx.UserDTO;
import com.gic.wechat.api.service.qywx.QywxCorpApiService; import com.gic.wechat.api.service.qywx.QywxCorpApiService;
...@@ -134,6 +136,8 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -134,6 +136,8 @@ public class WxEnterpriseInfoController extends WebBaseController {
private CustomerApiService customerApiService; private CustomerApiService customerApiService;
@Autowired @Autowired
private AccountService accountService ; private AccountService accountService ;
@Autowired
MemberOutsideApiService memberOutsideApiService;
/** /**
...@@ -499,6 +503,19 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -499,6 +503,19 @@ public class WxEnterpriseInfoController extends WebBaseController {
List<MemberStoreDTO> result = memberUnionidRelatedApiService.listByExTernalUseridAndWxUserId(externalUserid, staffId, storeId); List<MemberStoreDTO> result = memberUnionidRelatedApiService.listByExTernalUseridAndWxUserId(externalUserid, staffId, storeId);
return resultResponse(HaoBanErrCode.ERR_1, result); 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 { ...@@ -700,6 +717,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
memberLog.setMemberId(memberId); memberLog.setMemberId(memberId);
if(StringUtils.isEmpty(memberId)) { if(StringUtils.isEmpty(memberId)) {
this.memberUnionidRelatedApiService.saveExternalMemberLog(memberLog) ; this.memberUnionidRelatedApiService.saveExternalMemberLog(memberLog) ;
this.save(enterpriseId, unionid, relationKey);
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
ExternalClerkRelatedDTO externalClerkRelatedDTO = externalClerkRelatedApiService.getExternalClerkByRelationKeyAndPre(relationKey); ExternalClerkRelatedDTO externalClerkRelatedDTO = externalClerkRelatedApiService.getExternalClerkByRelationKeyAndPre(relationKey);
...@@ -714,6 +732,16 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -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") @RequestMapping("check-storage-fee")
@ResponseBody @ResponseBody
public RestResponse<Object> checkStorageFee(String enterpriseId , String url) { public RestResponse<Object> checkStorageFee(String enterpriseId , String url) {
......
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;
}
}
...@@ -139,5 +139,9 @@ ...@@ -139,5 +139,9 @@
<dubbo:reference id="productStockApiService" interface="com.gic.store.goods.service.ProductStockApiService" timeout="100000" retries="0" check="false" /> <dubbo:reference id="productStockApiService" interface="com.gic.store.goods.service.ProductStockApiService" timeout="100000" retries="0" check="false" />
<dubbo:reference id="orderSettingApiService" interface="com.gic.business.order.service.setting.OrderSettingApiService" timeout="100000" retries="0" check="false" /> <dubbo:reference id="orderSettingApiService" interface="com.gic.business.order.service.setting.OrderSettingApiService" timeout="100000" retries="0" check="false" />
<dubbo:reference id="evaluateDataApiService" interface="com.gic.evaluate.manage.api.service.EvaluateDataApiService" timeout="100000" retries="0" check="false" /> <dubbo:reference id="evaluateDataApiService" interface="com.gic.evaluate.manage.api.service.EvaluateDataApiService" timeout="100000" retries="0" check="false" />
<dubbo:reference interface="com.gic.membersource.api.service.MemberOutsideApiService" id="memberOutsideApiService" timeout="10000" retries="0" check="false" />
<dubbo:reference interface="com.gic.haoban.task.manage.api.service.IMarketClueTaskApiService" id="iMarketClueTaskApiService" timeout="10000" retries="0" check="false" />
<dubbo:reference interface="com.gic.haoban.task.api.service.TelTaskApiService" id="telTaskApiService" timeout="10000" retries="0" check="false" />
</beans> </beans>
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