Commit c3ed75be by 徐高华

Merge branch 'master_xgh_我的客户迭代' into 'master'

Master xgh 我的客户迭代

See merge request !455
parents db3e0508 9631eca4
package com.gic.haoban.manage.api.dto; package com.gic.haoban.manage.api.dto;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* desc:员工导购id与导购wxUserId实体 * desc:员工导购id与导购wxUserId实体
...@@ -23,13 +24,24 @@ public class ClerkStaffWxUserDTO implements Serializable { ...@@ -23,13 +24,24 @@ public class ClerkStaffWxUserDTO implements Serializable {
*/ */
private String staffClerkId; private String staffClerkId;
private Date addFriendTime ;
public Date getAddFriendTime() {
return addFriendTime;
}
public void setAddFriendTime(Date addFriendTime) {
this.addFriendTime = addFriendTime;
}
public ClerkStaffWxUserDTO() { public ClerkStaffWxUserDTO() {
} }
public ClerkStaffWxUserDTO(String staffId, String staffClerkId, String memberExternalUserId) { public ClerkStaffWxUserDTO(String staffId, String staffClerkId, String memberExternalUserId , Date addFriendTime) {
this.memberExternalUserId = memberExternalUserId; this.memberExternalUserId = memberExternalUserId;
this.staffId = staffId; this.staffId = staffId;
this.staffClerkId = staffClerkId; this.staffClerkId = staffClerkId;
this.addFriendTime = addFriendTime ;
} }
public String getMemberExternalUserId() { public String getMemberExternalUserId() {
......
...@@ -193,6 +193,10 @@ public interface ExternalClerkRelatedApiService { ...@@ -193,6 +193,10 @@ public interface ExternalClerkRelatedApiService {
*/ */
boolean isFriends(String memberId, String clerkId, String enterpriseId); boolean isFriends(String memberId, String clerkId, String enterpriseId);
com.gic.api.base.commons.ServiceResponse<Boolean> isQwFriend(String enterpriseId, String staffId, String memberId) ;
com.gic.api.base.commons.ServiceResponse<String> getExternalUseridForWxa(String enterpriseId, String staffId, String memberId) ;
List<String> listMemberAndClerk(List<String> memberIdList , List<String> clerkIdList , String enterpriseId) ; List<String> listMemberAndClerk(List<String> memberIdList , List<String> clerkIdList , String enterpriseId) ;
/** /**
......
...@@ -279,6 +279,17 @@ public interface StaffApiService { ...@@ -279,6 +279,17 @@ public interface StaffApiService {
*/ */
boolean isManager(String clerkId); boolean isManager(String clerkId);
/**
*
* @Title: isEnterpriseManager
* @Description: 是否是区经
* @author xugh
* @param clerkId
* @return
* @throws
*/
com.gic.api.base.commons.ServiceResponse<Boolean> isEnterpriseManager(String clerkId) ;
/** /**
* 绑定的员工列表 * 绑定的员工列表
......
...@@ -56,7 +56,7 @@ public interface StaffClerkRelationApiService { ...@@ -56,7 +56,7 @@ public interface StaffClerkRelationApiService {
* @param channelCode * @param channelCode
* @return * @return
*/ */
boolean unbindByStaffAndClerkId(String staffId, String clerkId, int channelCode); boolean unbindByStaffAndClerkId(String staffId, String clerkId, int channelCode,String wxEnterpriseId);
/** /**
* 解绑门店 * 解绑门店
...@@ -82,8 +82,6 @@ public interface StaffClerkRelationApiService { ...@@ -82,8 +82,6 @@ public interface StaffClerkRelationApiService {
*/ */
List<StaffClerkRelationDTO> listByStoreId(String storeId); List<StaffClerkRelationDTO> listByStoreId(String storeId);
List<StaffClerkRelationDTO> listByStoreIds(List<String> storeIds);
/** /**
* 查询导购信息 * 查询导购信息
* @param storeId * @param storeId
......
...@@ -10,8 +10,6 @@ public interface StaffDepartmentRelatedApiService { ...@@ -10,8 +10,6 @@ public interface StaffDepartmentRelatedApiService {
List<StaffDepartmentRelatedDTO> listByDepartmentId(String departmentId); List<StaffDepartmentRelatedDTO> listByDepartmentId(String departmentId);
List<StaffDepartmentRelatedDTO> listByDepartmentIds(List<String> departmentIds);
List<StaffDepartmentRelatedDTO> listByStaffId(String staffId); List<StaffDepartmentRelatedDTO> listByStaffId(String staffId);
void updateById(StaffDepartmentRelatedDTO dto); void updateById(StaffDepartmentRelatedDTO dto);
...@@ -25,12 +23,6 @@ public interface StaffDepartmentRelatedApiService { ...@@ -25,12 +23,6 @@ public interface StaffDepartmentRelatedApiService {
*/ */
StaffDepartmentRelatedDTO getByStaffDepartmentRelatedId(String staffDepartmentRelatedId); StaffDepartmentRelatedDTO getByStaffDepartmentRelatedId(String staffDepartmentRelatedId);
void deleteCode(StaffDepartmentRelatedDTO dto);
StaffDepartmentRelatedDTO getOneByClerkCodeAndDepartmentId(String clerkCode, String departmentId);
StaffDepartmentRelatedDTO getOneByStaffIdAndDepartmentId(String staffId, String departmentId);
Map<String, String> getWxUserIdByClerkId(String clerkId); Map<String, String> getWxUserIdByClerkId(String clerkId);
String getPageUrl(int type, String data); String getPageUrl(int type, String data);
......
...@@ -70,14 +70,6 @@ public interface WxEnterpriseApiService { ...@@ -70,14 +70,6 @@ public interface WxEnterpriseApiService {
List<YwWxEnterpriseDTO> listByIds(Set<String> enterpriseIds); List<YwWxEnterpriseDTO> listByIds(Set<String> enterpriseIds);
/** /**
* 企业是否过期 true是
*
* @param enterpriseId
* @return
*/
boolean enterpriseIsOver(String enterpriseId);
/**
* 获取配置 * 获取配置
* *
* @param wxEnterpriseId * @param wxEnterpriseId
......
package com.gic.haoban.manage.api.service.out;
import com.gic.haoban.manage.api.dto.ErrorLogDTO;
/**
* desc:好办错误日志服务接口
*
* @author: YongEn
* @date: 2022/1/18
**/
public interface ErrorLogApiService {
/**
* desc: 保存
*
* @param dto
* @return :
* @author : YongEn
* @date : 2022/1/18
*/
void save(ErrorLogDTO dto);
}
...@@ -17,8 +17,6 @@ public interface StaffDepartmentRelatedMapper { ...@@ -17,8 +17,6 @@ public interface StaffDepartmentRelatedMapper {
List<TabHaobanStaffDepartmentRelated> listByDepartmentId(String departmentId); List<TabHaobanStaffDepartmentRelated> listByDepartmentId(String departmentId);
void deleteCode(TabHaobanStaffDepartmentRelated dto);
List<TabHaobanStaffDepartmentRelated> listStaffDepartmentByStaffId(String staffId); List<TabHaobanStaffDepartmentRelated> listStaffDepartmentByStaffId(String staffId);
TabHaobanStaffDepartmentRelated getById(String staffDepartmentRelatedId); TabHaobanStaffDepartmentRelated getById(String staffDepartmentRelatedId);
......
package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.service.entity.TabHaobanErrorLog;
public interface TabHaobanErrorLogMapper {
int deleteByPrimaryKey(Long id);
int insert(TabHaobanErrorLog record);
int insertSelective(TabHaobanErrorLog record);
TabHaobanErrorLog selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(TabHaobanErrorLog record);
int updateByPrimaryKey(TabHaobanErrorLog record);
}
\ No newline at end of file
package com.gic.haoban.manage.service.entity.ext; package com.gic.haoban.manage.service.entity.ext;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* desc:会员导购关系扩展实体类 * desc:会员导购关系扩展实体类
...@@ -24,6 +25,16 @@ public class MemberStaffRelExtDO implements Serializable { ...@@ -24,6 +25,16 @@ public class MemberStaffRelExtDO implements Serializable {
*/ */
private String staffClerkId; private String staffClerkId;
private Date addFriendTime ;
public Date getAddFriendTime() {
return addFriendTime;
}
public void setAddFriendTime(Date addFriendTime) {
this.addFriendTime = addFriendTime;
}
public String getMemberId() { public String getMemberId() {
return memberId; return memberId;
} }
......
package com.gic.haoban.manage.service.service;
import com.gic.haoban.manage.service.entity.TabHaobanErrorLog;
/**
* desc:好办错误日志服务
*
* @author: YongEn
* @date: 2022/1/18
**/
public interface ErrorLogService {
/**
* desc: 保存错误日志
*
* @param errorLog
* @return :
* @author : YongEn
* @date : 2022/1/18
*/
void save(TabHaobanErrorLog errorLog);
}
...@@ -14,7 +14,7 @@ public interface StaffClerkRelationService { ...@@ -14,7 +14,7 @@ public interface StaffClerkRelationService {
List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId); List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId);
boolean delBind(String clerkId, String optStaffId, int channelCode , String newClerkId); boolean delBind(String clerkId, String optStaffId, int channelCode , String newClerkId , String wxEnterpriseId);
/** /**
* 解绑-删除绑定(门店级别) * 解绑-删除绑定(门店级别)
......
package com.gic.haoban.manage.service.service.impl;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanErrorLogMapper;
import com.gic.haoban.manage.service.entity.TabHaobanErrorLog;
import com.gic.haoban.manage.service.service.ErrorLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* desc:
*
* @author: YongEn
* @date: 2022/1/18
**/
@Service
public class ErrorLogServiceImpl implements ErrorLogService {
@Autowired
private TabHaobanErrorLogMapper tabHaobanErrorLogMapper;
@Override
public void save(TabHaobanErrorLog errorLog) {
errorLog.setId(UniqueIdUtils.uniqueLong());
errorLog.setCreateTime(new Date());
errorLog.setUpdateTime(new Date());
tabHaobanErrorLogMapper.insert(errorLog);
}
}
...@@ -72,17 +72,21 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -72,17 +72,21 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override @Override
public List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId, String enterpriseId, Set<String> clerkCodeList) { public List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId, String enterpriseId, Set<String> clerkCodeList) {
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, mapper.listBindCode(wxEnterpriseId, enterpriseId, clerkCodeList)); return mapper.listBindCode(wxEnterpriseId, enterpriseId, clerkCodeList);
} }
@Override @Override
public List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId) { public List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId) {
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, mapper.listBindCodeByStaffId(enterpriseIdList, staffId)); return mapper.listBindCodeByStaffId(enterpriseIdList, staffId);
} }
@Override @Override
public boolean delBind(String oldClerkId, String optStaffId, int channelCode, String newClerkId) { public boolean delBind(String oldClerkId, String optStaffId, int channelCode, String newClerkId, String wxEnterpriseId) {
TabHaobanStaffClerkRelation clerkRelation = mapper.getByClerkId(oldClerkId, null); TabHaobanStaff staff = this.staffService.selectById(optStaffId) ;
if(null != staff) {
wxEnterpriseId = staff.getWxEnterpriseId() ;
}
StaffClerkRelationDTO clerkRelation = mapper.getOneByClerkId(oldClerkId, wxEnterpriseId);
if (null == clerkRelation) { if (null == clerkRelation) {
logger.info("老的绑定关联不存在,clerkId={}", oldClerkId); logger.info("老的绑定关联不存在,clerkId={}", oldClerkId);
return true; return true;
...@@ -126,13 +130,15 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -126,13 +130,15 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
logger.info("没有传门店列表:{}", wxEnterpriseId); logger.info("没有传门店列表:{}", wxEnterpriseId);
return true; return true;
} }
List<TabHaobanStaffClerkRelation> needUnbind = mapper.listBindByStoreIds(wxEnterpriseId, storeIds); List<String> storeIdList = new ArrayList<>();
storeIdList.addAll(storeIds) ;
List<StaffClerkRelationDTO> needUnbind = mapper.listByStoreIds(wxEnterpriseId, storeIdList);
if (CollectionUtils.isEmpty(needUnbind)) { if (CollectionUtils.isEmpty(needUnbind)) {
logger.info("没有门店绑定了需要解绑的:{}", wxEnterpriseId); logger.info("没有门店绑定了需要解绑的:{}", wxEnterpriseId);
return true; return true;
} }
for (TabHaobanStaffClerkRelation staffClerkRelation : needUnbind) { for (StaffClerkRelationDTO staffClerkRelation : needUnbind) {
String enterpriseId = staffClerkRelation.getEnterpriseId(); String enterpriseId = staffClerkRelation.getEnterpriseId();
//删除好友通知会员 //删除好友通知会员
List<String> memberIds = externalClerkRelatedService.getByStoreIdAndStaffId(staffClerkRelation.getStoreId(), staffClerkRelation.getStaffId()); List<String> memberIds = externalClerkRelatedService.getByStoreIdAndStaffId(staffClerkRelation.getStoreId(), staffClerkRelation.getStaffId());
...@@ -146,7 +152,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -146,7 +152,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
clerkMainStoreRelatedService.delMainStoreByStoreIds(storeIds); clerkMainStoreRelatedService.delMainStoreByStoreIds(storeIds);
//放入队列 //放入队列
staffClerkBindLogService.pushToMqBatch(optStaffId, BindTypeEnum.UNBIND.getVal(), channelCode, need); staffClerkBindLogService.pushToMqBatch(optStaffId, BindTypeEnum.UNBIND.getVal(), channelCode, need);
for (TabHaobanStaffClerkRelation clerkRelation : needUnbind) { for (StaffClerkRelationDTO clerkRelation : needUnbind) {
//废弃活码 //废弃活码
String enterpriseId = clerkRelation.getEnterpriseId(); String enterpriseId = clerkRelation.getEnterpriseId();
hmClerkRelationApiService.delByClerkId(clerkRelation.getClerkId(), enterpriseId, wxEnterpriseId, channelCode); hmClerkRelationApiService.delByClerkId(clerkRelation.getClerkId(), enterpriseId, wxEnterpriseId, channelCode);
...@@ -212,13 +218,12 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -212,13 +218,12 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override @Override
public StaffClerkRelationDTO getBindByClerkId(String clerkId, String wxEnterpriseId) { public StaffClerkRelationDTO getBindByClerkId(String clerkId, String wxEnterpriseId) {
TabHaobanStaffClerkRelation relation = mapper.getBindByClerkId(clerkId, wxEnterpriseId); return mapper.getOneByClerkId(clerkId, wxEnterpriseId);
return EntityUtil.changeEntityByJSON(StaffClerkRelationDTO.class, relation);
} }
@Override @Override
public StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId) { public StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId) {
return EntityUtil.changeEntityByJSON(StaffClerkRelationDTO.class, mapper.getByCodeAndEnterpriseId(clerkCode, enterpriseId)); return mapper.getByCodeAndEnterpriseId(clerkCode, enterpriseId);
} }
...@@ -254,17 +259,17 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -254,17 +259,17 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override @Override
public StaffClerkRelationDTO getOneBindByStoreId(String staffId, String storeId) { public StaffClerkRelationDTO getOneBindByStoreId(String staffId, String storeId) {
return EntityUtil.changeEntityByJSON(StaffClerkRelationDTO.class, mapper.getOneBindStoreId(staffId, storeId)); return mapper.getOneByStoreIdAndStaffId(storeId,staffId);
} }
@Override @Override
public StaffClerkRelationDTO getByClerkId(String clerkId) { public StaffClerkRelationDTO getByClerkId(String clerkId) {
return EntityUtil.changeEntityByJSON(StaffClerkRelationDTO.class, mapper.getByClerkId(clerkId, null)); return mapper.getOneByClerkId(clerkId, null);
} }
@Override @Override
public StaffClerkRelationDTO getByClerkId(String clerkId, String wxEnterpriseId) { public StaffClerkRelationDTO getByClerkId(String clerkId, String wxEnterpriseId) {
TabHaobanStaffClerkRelation staffClerkRelation = mapper.getByClerkId(clerkId, wxEnterpriseId); StaffClerkRelationDTO staffClerkRelation = mapper.getOneByClerkId(clerkId, wxEnterpriseId);
return EntityUtil.changeEntityNew(StaffClerkRelationDTO.class, staffClerkRelation); return EntityUtil.changeEntityNew(StaffClerkRelationDTO.class, staffClerkRelation);
} }
...@@ -308,19 +313,19 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -308,19 +313,19 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override @Override
public Page<StaffClerkRelationDTO> pageByWxEnterpriseId(String wxEnterpriseId, BasePageInfo pageInfo) { public Page<StaffClerkRelationDTO> pageByWxEnterpriseId(String wxEnterpriseId, BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo); PageHelper.startPage(pageInfo);
List<TabHaobanStaffClerkRelation> clerkBindList = mapper.pageByWxEnterpriseId(wxEnterpriseId); List<StaffClerkRelationDTO> clerkBindList = mapper.pageByWxEnterpriseId(wxEnterpriseId);
Page<StaffClerkRelationDTO> retPage = PageUtil.changePageHelperToCurrentPage(new PageInfo<>(clerkBindList), StaffClerkRelationDTO.class); Page<StaffClerkRelationDTO> retPage = PageUtil.changePageHelperToCurrentPage(new PageInfo<>(clerkBindList), StaffClerkRelationDTO.class);
return retPage; return retPage;
} }
@Override @Override
public List<StaffClerkRelationDTO> listBindByStoreId(String wxEnterpriseId, String storeId) { public List<StaffClerkRelationDTO> listBindByStoreId(String wxEnterpriseId, String storeId) {
return mapper.listBindByStoreId(wxEnterpriseId, storeId); return mapper.listByStoreIds(wxEnterpriseId, Arrays.asList(storeId));
} }
@Override @Override
public List<StaffClerkRelationDTO> listBindStoreIdByEnterpriseId(String enterpriseId) { public List<StaffClerkRelationDTO> listBindStoreIdByEnterpriseId(String enterpriseId) {
List<TabHaobanStaffClerkRelation> clerkRelations = mapper.listBindStoreIdByEnterpriseId(enterpriseId); List<StaffClerkRelationDTO> clerkRelations = mapper.listBindStoreIdByEnterpriseId(enterpriseId);
if (CollectionUtils.isEmpty(clerkRelations)) { if (CollectionUtils.isEmpty(clerkRelations)) {
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -339,9 +344,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -339,9 +344,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
} }
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId); WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
if (qwDTO.needOpenUserId3th()) { if (qwDTO.needOpenUserId3th()) {
return mapper.listWxOpenUserIdByClerkIds(clerkList, wxEnterpriseId); return mapper.listWxUserIdByClerkIds(clerkList, wxEnterpriseId,2);
} }
return mapper.listWxUserIdByClerkIds(clerkList, wxEnterpriseId); return mapper.listWxUserIdByClerkIds(clerkList, wxEnterpriseId,1);
} }
@Override @Override
...@@ -351,9 +356,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -351,9 +356,9 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
} }
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId); WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
if (qwDTO.needOpenUserId3th()) { if (qwDTO.needOpenUserId3th()) {
return mapper.listIdsByWxOpenUserIds(wxUserIds, wxEnterpriseId, enterpriseId); return mapper.listIdsByWxUserIds(wxUserIds, wxEnterpriseId, enterpriseId,2);
} }
return mapper.listIdsByWxUserIds(wxUserIds, wxEnterpriseId, enterpriseId); return mapper.listIdsByWxUserIds(wxUserIds, wxEnterpriseId, enterpriseId,1);
} }
@Override @Override
...@@ -385,6 +390,6 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -385,6 +390,6 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override @Override
public List<StaffClerkRelationDTO> listManageBindByStaffId(String staffId) { public List<StaffClerkRelationDTO> listManageBindByStaffId(String staffId) {
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class, mapper.listManageBindByStaffId(staffId)); return mapper.listManageBindByStaffId(staffId);
} }
} }
...@@ -216,7 +216,7 @@ public class AuditApiServiceImpl implements AuditApiService { ...@@ -216,7 +216,7 @@ public class AuditApiServiceImpl implements AuditApiService {
if (StringUtils.isNotBlank(batchId)) { if (StringUtils.isNotBlank(batchId)) {
insertBatchLog(batchId, AuditRsultType.success.getCode(), tab); insertBatchLog(batchId, AuditRsultType.success.getCode(), tab);
} }
staffClerkRelationApiService.unbindByStaffAndClerkId(optStaffId, obj.getClerkId(), ChannelCodeEnum.AUDIT_UNBIND.getCode()); staffClerkRelationApiService.unbindByStaffAndClerkId(optStaffId, obj.getClerkId(), ChannelCodeEnum.AUDIT_UNBIND.getCode(),obj.getWxEnterpriseId());
staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(), tab.getCommitStoreId(), 1, ""); staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(), tab.getCommitStoreId(), 1, "");
} else if (auditType == AuditType.CLERK_UNBIND.getCode()) { } else if (auditType == AuditType.CLERK_UNBIND.getCode()) {
//解绑申请,无需审核,直接通过 //解绑申请,无需审核,直接通过
......
package com.gic.haoban.manage.service.service.out.impl;
import com.gic.commons.util.EntityUtil;
import com.gic.haoban.manage.api.dto.ErrorLogDTO;
import com.gic.haoban.manage.api.service.out.ErrorLogApiService;
import com.gic.haoban.manage.service.entity.TabHaobanErrorLog;
import com.gic.haoban.manage.service.service.ErrorLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* desc:好办错误日志服务实现
*
* @author: YongEn
* @date: 2022/1/18
**/
@Service
public class ErrorLogApiServiceImpl implements ErrorLogApiService {
@Autowired
private ErrorLogService errorLogService;
@Override
public void save(ErrorLogDTO dto) {
TabHaobanErrorLog errorLog = EntityUtil.changeEntityNew(TabHaobanErrorLog.class, dto);
errorLogService.save(errorLog);
}
}
...@@ -26,7 +26,6 @@ import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService; ...@@ -26,7 +26,6 @@ import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService; import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.*; import com.gic.haoban.manage.service.dao.mapper.*;
import com.gic.haoban.manage.service.entity.MemberUnionidRelated;
import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated; import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation; import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
...@@ -55,7 +54,6 @@ import org.redisson.api.RateType; ...@@ -55,7 +54,6 @@ import org.redisson.api.RateType;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -68,8 +66,6 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA ...@@ -68,8 +66,6 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
@Autowired @Autowired
private TabHaobanExternalClerkRelatedMapper tabHaobanExternalClerkRelatedMapper; private TabHaobanExternalClerkRelatedMapper tabHaobanExternalClerkRelatedMapper;
@Autowired @Autowired
private MemberUnionidRelatedMapper memberUnionidRelatedMapper;
@Autowired
private TabHaobanStaffClerkRelationMapper staffClerkRelationMapper; private TabHaobanStaffClerkRelationMapper staffClerkRelationMapper;
@Autowired @Autowired
private WxEnterpriseMapper wxEnterriseMapper; private WxEnterpriseMapper wxEnterriseMapper;
...@@ -443,17 +439,32 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA ...@@ -443,17 +439,32 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
@Override @Override
public boolean isFriends(String memberId, String clerkId, String enterpriseId) { public boolean isFriends(String memberId, String clerkId, String enterpriseId) {
TabHaobanStaffClerkRelation staffClerkRelation = staffClerkRelationMapper.getByClerkId(clerkId,null); StaffClerkRelationDTO staffClerkRelation = staffClerkRelationMapper.getOneByClerkId(clerkId,null);
if (staffClerkRelation == null) { if (staffClerkRelation == null) {
return false; return false;
} }
String staffId = staffClerkRelation.getStaffId(); String staffId = staffClerkRelation.getStaffId();
log.info("【查询会员】clerkId = {},staffId={},memberId={}", clerkId, staffId, memberId); return this.isQwFriend(enterpriseId, staffId, memberId).getResult() ;
}
@Override
public com.gic.api.base.commons.ServiceResponse<Boolean> isQwFriend(String enterpriseId, String staffId, String memberId) {
log.info("查询是否好友enterpriseId={},staffId={},memberId={}",enterpriseId, staffId, memberId);
TabHaobanExternalClerkRelated externalClerkRelated = tabHaobanExternalClerkRelatedMapper.getByMemberIdAndStaffId(staffId, enterpriseId, memberId); TabHaobanExternalClerkRelated externalClerkRelated = tabHaobanExternalClerkRelatedMapper.getByMemberIdAndStaffId(staffId, enterpriseId, memberId);
if (externalClerkRelated == null) { if (externalClerkRelated == null) {
return false; return com.gic.api.base.commons.ServiceResponse.success(Boolean.FALSE);
}
return com.gic.api.base.commons.ServiceResponse.success(externalClerkRelated.getStatusFlag() == 1);
}
@Override
public com.gic.api.base.commons.ServiceResponse<String> getExternalUseridForWxa(String enterpriseId, String staffId,
String memberId) {
TabHaobanExternalClerkRelated externalClerkRelated = tabHaobanExternalClerkRelatedMapper.getByMemberIdAndStaffId(staffId, enterpriseId, memberId);
if(null != externalClerkRelated) {
return com.gic.api.base.commons.ServiceResponse.success(externalClerkRelated.getExternalClerkRelatedId());
} }
return externalClerkRelated.getStatusFlag() == 1; return com.gic.api.base.commons.ServiceResponse.failure("9999", "无好友关系") ;
} }
@Override @Override
...@@ -480,7 +491,7 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA ...@@ -480,7 +491,7 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
// key-memberId // key-memberId
MemberStaffRelExtDO::getMemberId, MemberStaffRelExtDO::getMemberId,
// value-list // value-list
e -> new ArrayList<>(Collections.singletonList(new ClerkStaffWxUserDTO(e.getStaffId(), e.getStaffClerkId(), e.getMemberExternalUserId()))), e -> new ArrayList<>(Collections.singletonList(new ClerkStaffWxUserDTO(e.getStaffId(), e.getStaffClerkId(), e.getMemberExternalUserId(),e.getAddFriendTime()))),
// 重复key的value添加到集合 // 重复key的value添加到集合
(List<ClerkStaffWxUserDTO> oldList, List<ClerkStaffWxUserDTO> newList) -> { (List<ClerkStaffWxUserDTO> oldList, List<ClerkStaffWxUserDTO> newList) -> {
oldList.addAll(newList); oldList.addAll(newList);
......
...@@ -341,7 +341,7 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -341,7 +341,7 @@ public class MessageApiServiceImpl implements MessageApiService {
List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationApiService.listByStaffId(wxEnterpriseId, staffId); List<StaffClerkRelationDTO> staffClerkRelationDTOS = staffClerkRelationApiService.listByStaffId(wxEnterpriseId, staffId);
if (CollectionUtils.isNotEmpty(staffClerkRelationDTOS)) { if (CollectionUtils.isNotEmpty(staffClerkRelationDTOS)) {
for (StaffClerkRelationDTO staffClerkRelationDTO : staffClerkRelationDTOS) { for (StaffClerkRelationDTO staffClerkRelationDTO : staffClerkRelationDTOS) {
staffClerkRelationApiService.unbindByStaffAndClerkId(staffId, staffClerkRelationDTO.getClerkId(), ChannelCodeEnum.ADMIN_UNBIND.getCode()); staffClerkRelationApiService.unbindByStaffAndClerkId(staffId, staffClerkRelationDTO.getClerkId(), ChannelCodeEnum.ADMIN_UNBIND.getCode(),wxEnterpriseId);
} }
} }
} }
......
...@@ -39,7 +39,7 @@ import com.gic.wechat.api.service.qywx.QywxExternalUserService; ...@@ -39,7 +39,7 @@ import com.gic.wechat.api.service.qywx.QywxExternalUserService;
public class QwFriendApiServiceImpl implements QwFriendApiService { public class QwFriendApiServiceImpl implements QwFriendApiService {
private static final Logger log = LogManager.getLogger(QwFriendApiService.class); private static final Logger log = LogManager.getLogger(QwFriendApiService.class);
private static final int subjectType = 0 ; private int subjectType = 0 ;
@Autowired @Autowired
private EnterpriseUseForbidService enterpriseUseForbidService; private EnterpriseUseForbidService enterpriseUseForbidService;
...@@ -73,6 +73,9 @@ public class QwFriendApiServiceImpl implements QwFriendApiService { ...@@ -73,6 +73,9 @@ public class QwFriendApiServiceImpl implements QwFriendApiService {
public ServiceResponse<Map<String, String>> pendingIdCheck(String enterpriseId, String unionid, String openid, public ServiceResponse<Map<String, String>> pendingIdCheck(String enterpriseId, String unionid, String openid,
String wxaUnionid, String wxaOpenid , boolean setCheckFlag) { String wxaUnionid, String wxaOpenid , boolean setCheckFlag) {
if("ff8080815dacd3a2015dacd3ef5c0000".equals(enterpriseId)) {
subjectType = 1 ;
}
ServiceResponse<WxEnterpriseQwDTO> corpidResp = this.checkAndGetCorpid(enterpriseId,setCheckFlag); ServiceResponse<WxEnterpriseQwDTO> corpidResp = this.checkAndGetCorpid(enterpriseId,setCheckFlag);
if (!corpidResp.isSuccess()) { if (!corpidResp.isSuccess()) {
return ServiceResponse.failure(corpidResp.getCode(), corpidResp.getMessage()); return ServiceResponse.failure(corpidResp.getCode(), corpidResp.getMessage());
...@@ -128,6 +131,9 @@ public class QwFriendApiServiceImpl implements QwFriendApiService { ...@@ -128,6 +131,9 @@ public class QwFriendApiServiceImpl implements QwFriendApiService {
if (!corpidResp.isSuccess()) { if (!corpidResp.isSuccess()) {
return ServiceResponse.failure(corpidResp.getCode(), corpidResp.getMessage()); return ServiceResponse.failure(corpidResp.getCode(), corpidResp.getMessage());
} }
if("ff8080815dacd3a2015dacd3ef5c0000".equals(enterpriseId)) {
subjectType = 1 ;
}
String suiteid = config.getWxSuiteid(); String suiteid = config.getWxSuiteid();
WxEnterpriseQwDTO qwDTO = corpidResp.getResult(); WxEnterpriseQwDTO qwDTO = corpidResp.getResult();
String wxEnterpriseId = qwDTO.getWxEnterpriseId(); String wxEnterpriseId = qwDTO.getWxEnterpriseId();
......
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import cn.hutool.core.collection.CollectionUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
...@@ -28,6 +27,7 @@ import com.gic.commons.util.GlobalInfo; ...@@ -28,6 +27,7 @@ import com.gic.commons.util.GlobalInfo;
import com.gic.commons.util.GlobalVar; import com.gic.commons.util.GlobalVar;
import com.gic.commons.util.ImageUtil; import com.gic.commons.util.ImageUtil;
import com.gic.enterprise.api.dto.EnterpriseSettingDTO; import com.gic.enterprise.api.dto.EnterpriseSettingDTO;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.dto.StoreGroupDTO; import com.gic.enterprise.api.dto.StoreGroupDTO;
import com.gic.enterprise.api.dto.StoreWidgetDTO; import com.gic.enterprise.api.dto.StoreWidgetDTO;
import com.gic.enterprise.api.service.EnterpriseService; import com.gic.enterprise.api.service.EnterpriseService;
...@@ -38,7 +38,16 @@ import com.gic.haoban.base.api.common.ServiceResponse; ...@@ -38,7 +38,16 @@ import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.RolesListUtils; import com.gic.haoban.common.utils.RolesListUtils;
import com.gic.haoban.common.utils.UuidUtil; import com.gic.haoban.common.utils.UuidUtil;
import com.gic.haoban.manage.api.dto.*; import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.SecretSettingDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.dto.StaffPrivacyUseLogDTO;
import com.gic.haoban.manage.api.dto.StaffQrCodeDTO;
import com.gic.haoban.manage.api.dto.UserLoginLogDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.role.StoreRoleDTO; import com.gic.haoban.manage.api.dto.role.StoreRoleDTO;
import com.gic.haoban.manage.api.enums.SecretTypeEnum; import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
...@@ -69,6 +78,8 @@ import com.gic.wechat.api.service.qywx.QywxUserApiService; ...@@ -69,6 +78,8 @@ import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import cn.hutool.core.collection.CollectionUtil;
@Service @Service
public class StaffApiServiceImpl implements StaffApiService { public class StaffApiServiceImpl implements StaffApiService {
...@@ -803,24 +814,24 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -803,24 +814,24 @@ public class StaffApiServiceImpl implements StaffApiService {
Object cache = RedisUtil.getCache(cacheKey); Object cache = RedisUtil.getCache(cacheKey);
if (cache != null) { if (cache != null) {
List<String> storeList = (List<String>) cache; List<String> storeList = (List<String>) cache;
logger.info("从缓存中获取通道={},数量:{}", cacheKey, storeList.size()); logger.info("从缓存中获取key={},store数量:{}", cacheKey, storeList.size());
return storeList; return storeList;
} }
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId); ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO == null) { if (clerkDTO == null) {
logger.info("导购不存在:clerkId:{}", clerkId); logger.info("导购不存在:clerkId:{},无门店", clerkId);
return Collections.emptyList(); return Collections.emptyList();
} }
String enterpriseId = clerkDTO.getEnterpriseId(); String enterpriseId = clerkDTO.getEnterpriseId();
List<String> enterpriseIdStoreIds = storeRangeService.listStoreIdByWxEnterpriseId(wxEnterpriseId, enterpriseId); List<String> enterpriseIdStoreIds = storeRangeService.listStoreIdByWxEnterpriseId(wxEnterpriseId, enterpriseId);
if (CollectionUtils.isEmpty(enterpriseIdStoreIds)) { if (CollectionUtils.isEmpty(enterpriseIdStoreIds)) {
logger.info("好办门店空,eid={}", enterpriseId); logger.info("无好办门店,eid={}", enterpriseId);
return Collections.emptyList(); return Collections.emptyList();
} }
logger.info("好办门店id数量:{}", enterpriseIdStoreIds.size()); logger.info("好办门店数量={}", enterpriseIdStoreIds.size());
List<String> gicStoreIds = getStoreIdList(clerkDTO); List<String> gicStoreIds = getStoreIdList(clerkDTO);
if (CollectionUtils.isEmpty(gicStoreIds)) { if (CollectionUtils.isEmpty(gicStoreIds)) {
logger.info("gic门店为空"); logger.info("gic门店为空");
return Collections.emptyList(); return Collections.emptyList();
} }
if (gicStoreIds.contains("-1")) { if (gicStoreIds.contains("-1")) {
...@@ -840,10 +851,10 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -840,10 +851,10 @@ public class StaffApiServiceImpl implements StaffApiService {
RedisUtil.setCache(cacheKey, enterpriseIdStoreIds, 10L, TimeUnit.MINUTES); RedisUtil.setCache(cacheKey, enterpriseIdStoreIds, 10L, TimeUnit.MINUTES);
return enterpriseIdStoreIds; return enterpriseIdStoreIds;
} }
logger.info("gic门店数量{}", gicStoreIds.size()); logger.info("gic门店数量={}", gicStoreIds.size());
//取交集 //取交集
List<String> storeList = RolesListUtils.mergeList(enterpriseIdStoreIds, gicStoreIds); List<String> storeList = RolesListUtils.mergeList(enterpriseIdStoreIds, gicStoreIds);
logger.info("该导购权限:clerkId:{},门店数量:{}", clerkId, storeList.size()); logger.info("clerkId={},门店交集数量={}", clerkId, storeList.size());
RedisUtil.setCache(cacheKey, storeList, 10L, TimeUnit.MINUTES); RedisUtil.setCache(cacheKey, storeList, 10L, TimeUnit.MINUTES);
return storeList; return storeList;
} }
...@@ -893,14 +904,25 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -893,14 +904,25 @@ public class StaffApiServiceImpl implements StaffApiService {
return storeRoleDTO; return storeRoleDTO;
} }
if (storeIds.contains("-1")) { if (storeIds.contains("-1")) {
logger.info("该导购为超管"); logger.info("该导购为所有门店,clerkId={}",clerkId);
int gicStoreCount = storeWidgetService.getClerkWidgetStore(clerkId); String storeWidgetId = this.powerService.getStoreWidgetId(new Date(), clerkId);
storeRoleDTO.setStoreCount(gicStoreCount); int storeCount = 0 ;
String storeId = null ;
if(null != storeWidgetId) {
Page<Object> pageParam = new Page<Object>();
pageParam.setCurrentPage(1);
pageParam.setPageSize(1);
Page<StoreDTO> page = storeWidgetService.getStoreWidgetStore(storeWidgetId, null, clerkDTO.getEnterpriseId(), pageParam, null,null);
storeId = page.getResult().get(0).getStoreId();
storeCount = page.getTotalCount();
storeRoleDTO.setStoreId(storeId);
storeRoleDTO.setStoreCount(storeCount);
}
return storeRoleDTO; return storeRoleDTO;
} }
int size = storeIds.size(); int size = storeIds.size();
storeRoleDTO.setStoreCount(size); storeRoleDTO.setStoreCount(size);
if (size == 1) { if (size >= 1) {
storeRoleDTO.setStoreId(storeIds.get(0)); storeRoleDTO.setStoreId(storeIds.get(0));
} }
return storeRoleDTO; return storeRoleDTO;
...@@ -914,7 +936,6 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -914,7 +936,6 @@ public class StaffApiServiceImpl implements StaffApiService {
Integer superAdmin = clerkDTO.getSuperAdmin(); Integer superAdmin = clerkDTO.getSuperAdmin();
if (superAdmin != null && superAdmin == 1) { if (superAdmin != null && superAdmin == 1) {
logger.info("gic超管,clerkId:{}", clerkId); logger.info("gic超管,clerkId:{}", clerkId);
//gic超管
return Collections.singletonList("-1"); return Collections.singletonList("-1");
} }
String enterpriseId = clerkDTO.getEnterpriseId(); String enterpriseId = clerkDTO.getEnterpriseId();
...@@ -922,23 +943,22 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -922,23 +943,22 @@ public class StaffApiServiceImpl implements StaffApiService {
if (enterpriseSetting.getEnableAccessControl() != null && enterpriseSetting.getEnableAccessControl() == 1) { if (enterpriseSetting.getEnableAccessControl() != null && enterpriseSetting.getEnableAccessControl() == 1) {
String storeWidgetId = this.powerService.getStoreWidgetId(new Date(), clerkId); String storeWidgetId = this.powerService.getStoreWidgetId(new Date(), clerkId);
if (StringUtils.isBlank(storeWidgetId)) { if (StringUtils.isBlank(storeWidgetId)) {
logger.info("导购权限不存在"); logger.info("导购无门店权限,门店组件id is null");
return Collections.emptyList(); return Collections.emptyList();
} }
StoreWidgetDTO storeWidgetDTO = this.storeWidgetService.getStoreWidgetBykey(storeWidgetId); StoreWidgetDTO storeWidgetDTO = this.storeWidgetService.getStoreWidgetBykey(storeWidgetId);
if (storeWidgetDTO == null) { if (storeWidgetDTO == null) {
logger.info("导购权限不存在"); logger.info("导购门店权限查不到,storeWidgetId={}",storeWidgetId);
return Collections.emptyList(); return Collections.emptyList();
} }
Integer selectType = storeWidgetDTO.getSelectType(); Integer selectType = storeWidgetDTO.getSelectType();
if (selectType != null && selectType == 0) { if (selectType != null && selectType == 0) {
//gic超管 logger.info("gic超管所有门店,clerkId:{}", clerkId);
logger.info("gic超管,clerkId:{}", clerkId);
return Collections.singletonList("-1"); return Collections.singletonList("-1");
} }
return getStoreWidgetIdStoreIds(storeWidgetId, enterpriseId); return getStoreWidgetIdStoreIds(storeWidgetId, enterpriseId);
} else { } else {
//未开启分权 logger.info("无开启权限 ,所有门店,clerkId={}", clerkId);
return Collections.singletonList("-1"); return Collections.singletonList("-1");
} }
} }
...@@ -948,7 +968,7 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -948,7 +968,7 @@ public class StaffApiServiceImpl implements StaffApiService {
*/ */
private List<String> getStoreWidgetIdStoreIds(String storeWidgetId, String enterpriseId) { private List<String> getStoreWidgetIdStoreIds(String storeWidgetId, String enterpriseId) {
// 门店id列表 // 门店id列表
List<String> storeIdList = storeWidgetService.getStoreWidgetStore(storeWidgetId, enterpriseId, null, null, 2); List<String> storeIdList = storeWidgetService.getStoreWidgetStore(storeWidgetId, enterpriseId, null, null, 0);
if (CollectionUtils.isEmpty(storeIdList)) { if (CollectionUtils.isEmpty(storeIdList)) {
return Collections.emptyList(); return Collections.emptyList();
} }
...@@ -970,6 +990,18 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -970,6 +990,18 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
@Override @Override
public com.gic.api.base.commons.ServiceResponse<Boolean> isEnterpriseManager(String clerkId) {
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO != null) {
Integer clerkType = clerkDTO.getClerkType();
if (clerkType == 2) {
return com.gic.api.base.commons.ServiceResponse.success(true);
}
}
return com.gic.api.base.commons.ServiceResponse.success(false);
}
@Override
public List<StaffDTO> listBindStoreIds(List<String> storeIds, String wxEnterpriseId) { public List<StaffDTO> listBindStoreIds(List<String> storeIds, String wxEnterpriseId) {
return staffMapper.listBindStoreIds(storeIds,wxEnterpriseId); return staffMapper.listBindStoreIds(storeIds,wxEnterpriseId);
} }
......
...@@ -246,30 +246,17 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -246,30 +246,17 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override @Override
public List<StaffClerkRelationDTO> listByStoreId(String storeId) { public List<StaffClerkRelationDTO> listByStoreId(String storeId) {
List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByStoreId(storeId); return tabHaobanStaffClerkRelationMapper.listByStoreIds(null,Arrays.asList(storeId));
if (CollectionUtil.isEmpty(list)) {
return new ArrayList<>();
}
List<StaffClerkRelationDTO> result = EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, list);
return result;
}
@Override
public List<StaffClerkRelationDTO> listByStoreIds(List<String> storeIds) {
List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByStoreIds(storeIds);
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class, list);
} }
@Override @Override
public boolean unbindByStaffAndClerkId(String staffId, String clerkId, int channelCode) { public boolean unbindByStaffAndClerkId(String staffId, String clerkId, int channelCode,String wxEnterpriseId) {
return staffClerkRelationService.delBind(clerkId, staffId, channelCode, null); return staffClerkRelationService.delBind(clerkId, staffId, channelCode, null,wxEnterpriseId);
} }
@Override @Override
public StaffClerkRelationDTO getOneByClerkId(String clerkId) { public StaffClerkRelationDTO getOneByClerkId(String clerkId) {
TabHaobanStaffClerkRelation tab = tabHaobanStaffClerkRelationMapper.getOneByClerkId(clerkId); return tabHaobanStaffClerkRelationMapper.getOneByClerkId(clerkId,null);
StaffClerkRelationDTO result = EntityUtil.changeEntityByJSON(StaffClerkRelationDTO.class, tab);
return result;
} }
@Override @Override
...@@ -284,13 +271,12 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -284,13 +271,12 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
@Override @Override
public StaffClerkRelationDTO getOneByStoreIdAndStaffId(String storeId, public StaffClerkRelationDTO getOneByStoreIdAndStaffId(String storeId,String staffId) {
String staffId) { StaffClerkRelationDTO tab = tabHaobanStaffClerkRelationMapper.getOneByStoreIdAndStaffId(storeId, staffId);
TabHaobanStaffClerkRelation tab = tabHaobanStaffClerkRelationMapper.getOneByStoreIdAndStaffId(storeId, staffId);
if (tab == null) { if (tab == null) {
return null; return null;
} }
return EntityUtil.changeEntity(StaffClerkRelationDTO.class, tab); return tab;
} }
@Override @Override
...@@ -338,8 +324,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -338,8 +324,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override @Override
public List<StaffClerkRelationDTO> listByEnterpriseIdAndStaffid(String enterpriseId, String staffid) { public List<StaffClerkRelationDTO> listByEnterpriseIdAndStaffid(String enterpriseId, String staffid) {
List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByEnterpriseIdAndStaffid(enterpriseId, staffid); return tabHaobanStaffClerkRelationMapper.listByEnterpriseIdAndStaffid(enterpriseId, staffid);
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, list);
} }
@Override @Override
...@@ -497,7 +482,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -497,7 +482,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
Integer status = clerkDTO.getStatus(); Integer status = clerkDTO.getStatus();
logger.info("导购删除,clerkId:{},status:{}", clerkId, status); logger.info("导购删除,clerkId:{},status:{}", clerkId, status);
if (!status.equals(1)) { if (!status.equals(1)) {
staffClerkRelationService.delBind(clerkId, "-1", ChannelCodeEnum.GIC_CLERK_DEL_UNBIND.getCode(), null); staffClerkRelationService.delBind(clerkId, "-1", ChannelCodeEnum.GIC_CLERK_DEL_UNBIND.getCode(), null,null);
} }
} else if (type == 2) { } else if (type == 2) {
logger.info("导购门店转移,新的导购和门店,clerkId={},storeId={}", clerkId, clerkSyncQDTO.getStoreId()); logger.info("导购门店转移,新的导购和门店,clerkId={},storeId={}", clerkId, clerkSyncQDTO.getStoreId());
...@@ -539,7 +524,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -539,7 +524,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} else if (clerkType == 2) { } else if (clerkType == 2) {
logger.info("区经变更为导购,解绑:{}", clerkId); logger.info("区经变更为导购,解绑:{}", clerkId);
//解绑 //解绑
staffClerkRelationService.delBind(clerkId, "-1", ChannelCodeEnum.GIC_CLERK_DEL_UNBIND.getCode(), null); staffClerkRelationService.delBind(clerkId, "-1", ChannelCodeEnum.GIC_CLERK_DEL_UNBIND.getCode(), null,null);
} }
} }
} }
...@@ -552,7 +537,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -552,7 +537,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
if (flag) { if (flag) {
String oldClerkId = oldRelationDTO.getClerkId(); String oldClerkId = oldRelationDTO.getClerkId();
this.staffClerkRelationService.delBind(oldClerkId, "-1", ChannelCodeEnum.SYNC_UNBIND.getCode(), clerkSyncQDTO.getClerkId()); this.staffClerkRelationService.delBind(oldClerkId, "-1", ChannelCodeEnum.SYNC_UNBIND.getCode(), clerkSyncQDTO.getClerkId(),oldRelationDTO.getWxEnterpriseId());
// 设置新的ID // 设置新的ID
oldRelationDTO.setClerkId(clerkSyncQDTO.getClerkId()); oldRelationDTO.setClerkId(clerkSyncQDTO.getClerkId());
oldRelationDTO.setStoreId(clerkSyncQDTO.getStoreId()); oldRelationDTO.setStoreId(clerkSyncQDTO.getStoreId());
...@@ -563,7 +548,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -563,7 +548,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
} else { } else {
String oldClerkId = oldRelationDTO.getClerkId(); String oldClerkId = oldRelationDTO.getClerkId();
this.staffClerkRelationService.delBind(oldClerkId, "-1", ChannelCodeEnum.SYNC_UNBIND.getCode(), null); this.staffClerkRelationService.delBind(oldClerkId, "-1", ChannelCodeEnum.SYNC_UNBIND.getCode(), null,null);
// 设置新的ID // 设置新的ID
oldRelationDTO.setClerkId(clerkSyncQDTO.getClerkId()); oldRelationDTO.setClerkId(clerkSyncQDTO.getClerkId());
oldRelationDTO.setStoreId(clerkSyncQDTO.getStoreId()); oldRelationDTO.setStoreId(clerkSyncQDTO.getStoreId());
......
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import cn.hutool.core.collection.CollectionUtil; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.clerk.api.dto.ClerkDTO; import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO; import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
...@@ -16,24 +33,14 @@ import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil; ...@@ -16,24 +33,14 @@ import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper; import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated; import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService; import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.wechat.api.dto.qywx.ItemDTO; import com.gic.wechat.api.dto.qywx.ItemDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO; import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.io.UnsupportedEncodingException; import cn.hutool.core.collection.CollectionUtil;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
@Service @Service
public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRelatedApiService { public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRelatedApiService {
...@@ -64,24 +71,12 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -64,24 +71,12 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
} }
@Override @Override
public List<StaffDepartmentRelatedDTO> listByDepartmentIds(List<String> departmentIds) {
List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedMapper.listByDepartmentIds(departmentIds);
List<StaffDepartmentRelatedDTO> resultList = EntityUtil.changeEntityListByJSON(StaffDepartmentRelatedDTO.class, list);
return resultList;
}
@Override
public void updateById(StaffDepartmentRelatedDTO dto) { public void updateById(StaffDepartmentRelatedDTO dto) {
TabHaobanStaffDepartmentRelated tab = EntityUtil.changeEntityByJSON(TabHaobanStaffDepartmentRelated.class, dto); TabHaobanStaffDepartmentRelated tab = EntityUtil.changeEntityByJSON(TabHaobanStaffDepartmentRelated.class, dto);
staffDepartmentRelatedMapper.updateByPrimaryKeySelective(tab); staffDepartmentRelatedMapper.updateByPrimaryKeySelective(tab);
} }
@Override @Override
public void deleteCode(StaffDepartmentRelatedDTO dto) {
staffDepartmentRelatedMapper.deleteCode(EntityUtil.changeEntityByJSON(TabHaobanStaffDepartmentRelated.class, dto));
}
@Override
public StaffDepartmentRelatedDTO getByStaffDepartmentRelatedId(String staffDepartmentRelatedId) { public StaffDepartmentRelatedDTO getByStaffDepartmentRelatedId(String staffDepartmentRelatedId) {
TabHaobanStaffDepartmentRelated tab = staffDepartmentRelatedMapper.getById(staffDepartmentRelatedId); TabHaobanStaffDepartmentRelated tab = staffDepartmentRelatedMapper.getById(staffDepartmentRelatedId);
if (Objects.isNull(tab)) { if (Objects.isNull(tab)) {
...@@ -112,30 +107,10 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -112,30 +107,10 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
} }
@Override @Override
public StaffDepartmentRelatedDTO getOneByClerkCodeAndDepartmentId(String clerkCode, String departmentId) {
TabHaobanStaffDepartmentRelated tab = staffDepartmentRelatedMapper.getDepartmentIdAndCode(departmentId, clerkCode);
if (tab == null) {
return null;
}
StaffDepartmentRelatedDTO dto = EntityUtil.changeEntity(StaffDepartmentRelatedDTO.class, tab);
return dto;
}
@Override
public StaffDepartmentRelatedDTO getOneByStaffIdAndDepartmentId(String staffId, String departmentId) {
TabHaobanStaffDepartmentRelated tab = staffDepartmentRelatedMapper.getDepartmentIdAndStaffId(departmentId, staffId);
if (tab == null) {
return null;
}
StaffDepartmentRelatedDTO dto = EntityUtil.changeEntity(StaffDepartmentRelatedDTO.class, tab);
return dto;
}
@Override
public Map<String, String> getWxUserIdByClerkId(String clerkId) { public Map<String, String> getWxUserIdByClerkId(String clerkId) {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
TabHaobanStaffClerkRelation relation = tabHaobanStaffClerkRelationMapper.getOneByClerkId(clerkId); StaffClerkRelationDTO relation = tabHaobanStaffClerkRelationMapper.getOneByClerkId(clerkId,null);
if (relation == null) { if (relation == null) {
return map; return map;
} }
...@@ -267,7 +242,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -267,7 +242,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
logger.info("店长不存在,发送消息失败{}", storeId); logger.info("店长不存在,发送消息失败{}", storeId);
return; return;
} }
TabHaobanStaffClerkRelation tab = tabHaobanStaffClerkRelationMapper.getOneByClerkId(gicClerk.getClerkId()); StaffClerkRelationDTO tab = tabHaobanStaffClerkRelationMapper.getOneByClerkId(gicClerk.getClerkId(),null);
if (tab == null) { if (tab == null) {
logger.info("店长未绑定clerkId={}", gicClerk.getClerkId()); logger.info("店长未绑定clerkId={}", gicClerk.getClerkId());
return; return;
...@@ -298,7 +273,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -298,7 +273,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
logger.info("店长不存在,发送消息失败{}", storeId); logger.info("店长不存在,发送消息失败{}", storeId);
return; return;
} }
TabHaobanStaffClerkRelation tab = tabHaobanStaffClerkRelationMapper.getOneByClerkId(gicClerk.getClerkId()); StaffClerkRelationDTO tab = tabHaobanStaffClerkRelationMapper.getOneByClerkId(gicClerk.getClerkId(),null);
if (tab == null) { if (tab == null) {
logger.info("店长未绑定clerkId={}", gicClerk.getClerkId()); logger.info("店长未绑定clerkId={}", gicClerk.getClerkId());
return; return;
......
...@@ -302,12 +302,6 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -302,12 +302,6 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
wxEnterpriseService.update(enterpriseDTO); wxEnterpriseService.update(enterpriseDTO);
} }
// 返回true说明已过期
@Override
public boolean enterpriseIsOver(String enterpriseId) {
return haobanIsStop(enterpriseId) ;
}
@Override @Override
public SecretSettingDTO getSecretSetting(String wxEnterpriseId, int secretType, String enterpriseId) { public SecretSettingDTO getSecretSetting(String wxEnterpriseId, int secretType, String enterpriseId) {
if (secretType == SecretTypeEnum.MEMBER_WAPP.getVal()) { if (secretType == SecretTypeEnum.MEMBER_WAPP.getVal()) {
......
package com.gic.haoban.manage.service.util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
@Component
public class ClerkUtils {
private static ClerkService clerkService;
@Autowired
public void setClerkService(ClerkService clerkService) {
ClerkUtils.clerkService = clerkService;
}
public String getClerkStore(ClerkDTO clerk, String clerkId) {
if (null == clerk) {
clerk = clerkService.getclerkById(clerkId);
}
if (null == clerk) {
return null;
}
if (clerk.getClerkType() != 0 && clerk.getClerkType() != 1) {
return null;
}
return clerk.getStoreId();
}
}
...@@ -97,9 +97,6 @@ ...@@ -97,9 +97,6 @@
<dubbo:service interface="com.gic.haoban.manage.api.service.out.SecretSettingApiService" <dubbo:service interface="com.gic.haoban.manage.api.service.out.SecretSettingApiService"
ref="secretSettingApiServiceImpl" timeout="10000"/> ref="secretSettingApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.out.ErrorLogApiService"
ref="errorLogApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.out.WelcomeApiService" <dubbo:service interface="com.gic.haoban.manage.api.service.out.WelcomeApiService"
ref="welcomeApiServiceImpl" timeout="10000"/> ref="welcomeApiServiceImpl" timeout="10000"/>
......
...@@ -91,13 +91,6 @@ ...@@ -91,13 +91,6 @@
</select> </select>
<update id="deleteCode" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated">
update tab_haoban_staff_department_related
set clerk_code = '',
update_time = #{updateTime,jdbcType=TIMESTAMP}
where staff_department_related_id = #{staffDepartmentRelatedId,jdbcType=VARCHAR}
</update>
<select id="listStaffDepartmentByStaffId" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="listStaffDepartmentByStaffId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.TabHaobanErrorLogMapper">
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanErrorLog">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="enterprise_id" jdbcType="VARCHAR" property="enterpriseId" />
<result column="module_desc" jdbcType="VARCHAR" property="moduleDesc" />
<result column="error_desc" jdbcType="VARCHAR" property="errorDesc" />
<result column="error_flag_id" jdbcType="VARCHAR" property="errorFlagId" />
<result column="error_param" jdbcType="VARCHAR" property="errorParam" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, enterprise_id, module_desc, error_desc, error_flag_id, error_param, remark, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_haoban_error_log
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from tab_haoban_error_log
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.gic.haoban.manage.service.entity.TabHaobanErrorLog" useGeneratedKeys="true">
insert into tab_haoban_error_log (id,enterprise_id, module_desc, error_desc,
error_flag_id, error_param, remark,
create_time, update_time)
values (#{id,jdbcType=BIGINT}, #{enterpriseId,jdbcType=VARCHAR}, #{moduleDesc,jdbcType=VARCHAR}, #{errorDesc,jdbcType=VARCHAR},
#{errorFlagId,jdbcType=VARCHAR}, #{errorParam,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.gic.haoban.manage.service.entity.TabHaobanErrorLog" useGeneratedKeys="true">
insert into tab_haoban_error_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="moduleDesc != null">
module_desc,
</if>
<if test="errorDesc != null">
error_desc,
</if>
<if test="errorFlagId != null">
error_flag_id,
</if>
<if test="errorParam != null">
error_param,
</if>
<if test="remark != null">
remark,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=VARCHAR},
</if>
<if test="moduleDesc != null">
#{moduleDesc,jdbcType=VARCHAR},
</if>
<if test="errorDesc != null">
#{errorDesc,jdbcType=VARCHAR},
</if>
<if test="errorFlagId != null">
#{errorFlagId,jdbcType=VARCHAR},
</if>
<if test="errorParam != null">
#{errorParam,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanErrorLog">
update tab_haoban_error_log
<set>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if>
<if test="moduleDesc != null">
module_desc = #{moduleDesc,jdbcType=VARCHAR},
</if>
<if test="errorDesc != null">
error_desc = #{errorDesc,jdbcType=VARCHAR},
</if>
<if test="errorFlagId != null">
error_flag_id = #{errorFlagId,jdbcType=VARCHAR},
</if>
<if test="errorParam != null">
error_param = #{errorParam,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanErrorLog">
update tab_haoban_error_log
set enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
module_desc = #{moduleDesc,jdbcType=VARCHAR},
error_desc = #{errorDesc,jdbcType=VARCHAR},
error_flag_id = #{errorFlagId,jdbcType=VARCHAR},
error_param = #{errorParam,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
...@@ -445,7 +445,8 @@ ...@@ -445,7 +445,8 @@
<sql id="canAddClerkSql"> <sql id="canAddClerkSql">
tab_haoban_staff_clerk_relation a LEFT JOIN tab_haoban_hm_qrcode b ON a.clerk_id = b.clerk_id and b.hm_type = 1 and b.status_flag in (1,3) tab_haoban_staff_clerk_relation a LEFT JOIN tab_haoban_hm_qrcode b ON a.clerk_id = b.clerk_id and b.hm_type = 1 and b.status_flag in (1,3)
WHERE a.enterprise_id = #{enterpriseId} AND a.status_flag = 1 AND a.open_concat_flag = 1 left join tab_haoban_staff c on a.staff_id = c.staff_id
WHERE a.enterprise_id = #{enterpriseId} AND a.status_flag = 1 AND a.open_concat_flag = 1 and c.status_flag = 1
<if test="null != storeIdList"> <if test="null != storeIdList">
and a.store_id in and a.store_id in
<foreach collection="storeIdList" item="id" index="index" open="(" close=")" separator=","> <foreach collection="storeIdList" item="id" index="index" open="(" close=")" separator=",">
......
import com.gic.haoban.manage.service.entity.TabHaobanErrorLog;
import com.gic.haoban.manage.service.service.ErrorLogService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* desc:
*
* @author: YongEn
* @date: 2022/1/18
**/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext-conf.xml"})
public class ErrorLogTest {
@Autowired
private ErrorLogService errorLogService;
@Test
public void testSave() {
TabHaobanErrorLog errorLog = new TabHaobanErrorLog();
errorLog.setEnterpriseId("123123");
errorLog.setModuleDesc("haoban-manage3-service");
errorLog.setErrorDesc("测试错误");
errorLog.setErrorFlagId("123123");
errorLog.setErrorParam("{123,123}");
errorLog.setRemark("123123");
errorLogService.save(errorLog);
}
}
...@@ -19,12 +19,11 @@ import com.gic.haoban.manage.web.vo.ClerkVo; ...@@ -19,12 +19,11 @@ import com.gic.haoban.manage.web.vo.ClerkVo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@RestController @Deprecated
public class ClerkController extends WebBaseController{ public class ClerkController extends WebBaseController{
@Autowired @Autowired
private ClerkService clerkService; private ClerkService clerkService;
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
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.RestController;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
...@@ -12,15 +24,7 @@ import com.gic.haoban.manage.api.dto.MaterialCategoryDTO; ...@@ -12,15 +24,7 @@ import com.gic.haoban.manage.api.dto.MaterialCategoryDTO;
import com.gic.haoban.manage.api.dto.MaterialDTO; import com.gic.haoban.manage.api.dto.MaterialDTO;
import com.gic.haoban.manage.api.service.MaterialApiService; import com.gic.haoban.manage.api.service.MaterialApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import org.apache.commons.lang3.StringUtils; import com.gic.haoban.manage.web.utils.EmojiFilterUtil;
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.RestController;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
@RestController @RestController
public class MaterialController extends WebBaseController { public class MaterialController extends WebBaseController {
...@@ -126,6 +130,10 @@ public class MaterialController extends WebBaseController { ...@@ -126,6 +130,10 @@ public class MaterialController extends WebBaseController {
materialDTO.setStaffId(login.getClerkId()); materialDTO.setStaffId(login.getClerkId());
materialDTO.setStaffName(login.getClerkName()); materialDTO.setStaffName(login.getClerkName());
String msg = this.checkEmoji(materialDTO.getMaterialContent()) ;
if(null != msg) {
return this.fail(msg) ;
}
String materialTitle = materialDTO.getMaterialTitle(); String materialTitle = materialDTO.getMaterialTitle();
String categoryId = materialDTO.getCategoryId(); String categoryId = materialDTO.getCategoryId();
Integer categoryType = materialDTO.getMaterialType(); Integer categoryType = materialDTO.getMaterialType();
...@@ -185,6 +193,10 @@ public class MaterialController extends WebBaseController { ...@@ -185,6 +193,10 @@ public class MaterialController extends WebBaseController {
materialDTO.setStaffId(login.getClerkId()); materialDTO.setStaffId(login.getClerkId());
materialDTO.setStaffName(login.getClerkName()); materialDTO.setStaffName(login.getClerkName());
String materialId = materialDTO.getMaterialId(); String materialId = materialDTO.getMaterialId();
String msg = this.checkEmoji(materialDTO.getMaterialContent()) ;
if(null != msg) {
return this.fail(msg) ;
}
MaterialDTO dto = materialApiService.selectMaterialById(materialId); MaterialDTO dto = materialApiService.selectMaterialById(materialId);
if (dto == null) { if (dto == null) {
return resultResponse(HaoBanErrCode.ERR_2); return resultResponse(HaoBanErrCode.ERR_2);
...@@ -263,4 +275,18 @@ public class MaterialController extends WebBaseController { ...@@ -263,4 +275,18 @@ public class MaterialController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
public static String checkEmoji(String msg) {
if(StringUtils.isBlank(msg)) {
return null ;
}
String s = EmojiFilterUtil.filterEmoji(msg) ;
if(!msg.equals(s)) {
return "保存失败,不支持特殊表情字符" ;
}
return null ;
}
public static void main(String[] args) {
System.out.println(EmojiFilterUtil.filterEmoji("!@#~!@#¥%……&*&)()——+——+{}“”:?》") );;
}
} }
...@@ -313,7 +313,7 @@ public class StaffController extends WebBaseController { ...@@ -313,7 +313,7 @@ public class StaffController extends WebBaseController {
@RequestMapping("del-clerk-relation") @RequestMapping("del-clerk-relation")
public HaobanResponse delStaffClerkList(String clerkId) { public HaobanResponse delStaffClerkList(String clerkId) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser(); WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
boolean b = staffClerkRelationApiService.unbindByStaffAndClerkId(login.getClerkId(), clerkId, ChannelCodeEnum.ADMIN_UNBIND.getCode()); boolean b = staffClerkRelationApiService.unbindByStaffAndClerkId(login.getClerkId(), clerkId, ChannelCodeEnum.ADMIN_UNBIND.getCode(),login.getWxEnterpriseId());
return resultResponse(HaoBanErrCode.ERR_1, b); return resultResponse(HaoBanErrCode.ERR_1, b);
} }
...@@ -336,7 +336,7 @@ public class StaffController extends WebBaseController { ...@@ -336,7 +336,7 @@ public class StaffController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_10010); return resultResponse(HaoBanErrCode.ERR_10010);
} }
List<String> enterpriseIds = list.stream().filter(dto -> { List<String> enterpriseIds = list.stream().filter(dto -> {
boolean over = wxEnterpriseApiService.enterpriseIsOver(dto.getEnterpriseId()); boolean over = wxEnterpriseApiService.haobanIsStop(dto.getEnterpriseId());
return !over; return !over;
}).map(EnterpriseDetailDTO::getEnterpriseId).collect(Collectors.toList()); }).map(EnterpriseDetailDTO::getEnterpriseId).collect(Collectors.toList());
......
package com.gic.haoban.manage.web.utils;
public class EmojiFilterUtil {
/**
* 是否包含表情
*/
private static boolean isEmojiCharacter(char codePoint) {
return !((codePoint == 0x0) || (codePoint == 0x9) || (codePoint == 0xA) || (codePoint == 0xD)
|| ((codePoint >= 0x20) && (codePoint <= 0xD7FF)) || ((codePoint >= 0xE000) && (codePoint <= 0xFFFD))
|| ((codePoint >= 0x10000) && (codePoint <= 0x10FFFF)));
}
public static String filterEmoji(String source) {
StringBuilder buf = null;
int len = source.length();
for (int i = 0; i < len; i++) {
char codePoint = source.charAt(i);
if (!isEmojiCharacter(codePoint)) {// 如果不包含 则将字符append
if (buf == null) {
buf = new StringBuilder(source.length());
}
buf.append(codePoint);
} else {
}
}
if (buf == null) {
return source;// 如果没有找到 emoji表情,则返回源字符串
} else {
if (buf.length() == len) {// 这里的意义在于尽可能少的toString,因为会重新生成字符串
buf = null;
return source;
} else {
return buf.toString();
}
}
}
}
...@@ -179,7 +179,46 @@ ...@@ -179,7 +179,46 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-ecm-api</artifactId>
<version>${gic-ecm-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-marketing-api</artifactId>
<version>${gic-marketing-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-marketing-pro-api</artifactId>
<version>${gic-marketing-pro-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-enterprise-operation-api</artifactId>
<version>${gic-enterprise-operation-api}</version>
<exclusions>
<exclusion>
<artifactId>hibernate-validator</artifactId>
<groupId>org.hibernate.validator</groupId>
</exclusion>
<exclusion>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-game-api</artifactId>
<version>${gic-game-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-integral-mall-api</artifactId>
<version>${gic-integral-mall-api}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -36,4 +36,16 @@ public class WebBaseController { ...@@ -36,4 +36,16 @@ public class WebBaseController {
response.setErrorCode(errCode.getCode()); response.setErrorCode(errCode.getCode());
return response; return response;
} }
public HaobanResponse success(Object obj) {
return resultResponse(HaoBanErrCode.ERR_1, obj, null);
}
public HaobanResponse fail(String message) {
HaobanResponse response = new HaobanResponse();
response.setMessage(message);
response.setErrorCode(HaoBanErrCode.ERR_OTHER.getCode());
response.setDetailError(message);
return response;
}
} }
...@@ -18,10 +18,8 @@ import com.gic.haoban.app.customer.service.api.service.CustomerApiService; ...@@ -18,10 +18,8 @@ import com.gic.haoban.app.customer.service.api.service.CustomerApiService;
import com.gic.haoban.app.customer.service.api.service.StaffMemberRelationApiService; import com.gic.haoban.app.customer.service.api.service.StaffMemberRelationApiService;
import com.gic.haoban.common.anno.HttpLimit; import com.gic.haoban.common.anno.HttpLimit;
import com.gic.haoban.common.anno.IgnoreLogin; import com.gic.haoban.common.anno.IgnoreLogin;
import com.gic.haoban.common.utils.AuthRequestWellDoneUtil;
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.HaobanResponse;
import com.gic.haoban.common.utils.JwtUtil;
import com.gic.haoban.manage.api.dto.*; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.SecretTypeEnum; import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.*; import com.gic.haoban.manage.api.service.*;
......
package com.gic.haoban.manage.web.controller.member;
import org.springframework.web.bind.annotation.RestController;
import com.gic.haoban.manage.web.controller.WebBaseController;
@RestController
public class MemberController extends WebBaseController {
}
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
import java.util.Date;
/**
* @Author guojx
* @Date 2022/3/17 15:23
*/
public class AiMemberLogListVO implements Serializable {
private Long aiLogId;
/**
* 拨打时间 (触达时间)
*/
private Date aiTime;
/**
* 活动名称
*/
private String planName;
/**
* 活动场景
*/
private String activityScene;
/**
* 话术名称(模板名称)
*/
private String aiTemplateName;
public Long getAiLogId() {
return aiLogId;
}
public AiMemberLogListVO setAiLogId(Long aiLogId) {
this.aiLogId = aiLogId;
return this;
}
public Date getAiTime() {
return aiTime;
}
public AiMemberLogListVO setAiTime(Date aiTime) {
this.aiTime = aiTime;
return this;
}
public String getPlanName() {
return planName;
}
public AiMemberLogListVO setPlanName(String planName) {
this.planName = planName;
return this;
}
public String getActivityScene() {
return activityScene;
}
public AiMemberLogListVO setActivityScene(String activityScene) {
this.activityScene = activityScene;
return this;
}
public String getAiTemplateName() {
return aiTemplateName;
}
public AiMemberLogListVO setAiTemplateName(String aiTemplateName) {
this.aiTemplateName = aiTemplateName;
return this;
}
@Override
public String toString() {
return "AiMemberLogListVO{" +
"aiLogId=" + aiLogId +
", aiTime=" + aiTime +
", planName='" + planName + '\'' +
", activityScene='" + activityScene + '\'' +
", aiTemplateName='" + aiTemplateName + '\'' +
'}';
}
}
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
public class ClerkListVO implements Serializable {
/**
* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
*/
private static final long serialVersionUID = -4120100748397513224L;
private String clerkId;
private String clerkName;
private String clerkCode;
public String getClerkId() {
return clerkId;
}
public String getClerkName() {
return clerkName;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public void setClerkName(String clerkName) {
this.clerkName = clerkName;
}
public String getClerkCode() {
return clerkCode;
}
public void setClerkCode(String clerkCode) {
this.clerkCode = clerkCode;
}
}
package com.gic.haoban.manage.web.vo;
import java.io.Serializable;
public class StoreListVO implements Serializable{
private String storeId ;
private String storeName ;
public String getStoreId() {
return storeId;
}
public String getStoreName() {
return storeName;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
}
...@@ -8,11 +8,24 @@ ...@@ -8,11 +8,24 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/context/spring-context.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<context:component-scan base-package="com.gic.haoban"/> <context:component-scan base-package="com.gic.haoban"/>
<!-- 应用名称 --> <!-- 应用名称 -->
<dubbo:application name="haoban-manage3-wx"/> <dubbo:application name="haoban-manage3-wx"/>
<dubbo:protocol name="dubbo" port="30010"/> <dubbo:protocol name="dubbo" port="30010"/>
<dubbo:reference interface="com.gic.member.api.service.GradeService" id="gradeService" />
<dubbo:reference interface="com.gic.ecm.api.service.EcmPlanService" id="ecmPlanService" />
<dubbo:reference interface="com.gic.marketing.api.service.CardExportService" id="cardExportService" />
<dubbo:reference interface="com.gic.marketing.api.service.SmsService" id="smsService" />
<dubbo:reference interface="com.gic.marketing.api.service.WechatMarketingService" id="wechatMarketingService" />
<dubbo:reference interface="com.gic.marketing.pro.api.service.ai.AiMemberLogApiService" id="aiMemberLogApiService" />
<dubbo:reference interface="com.gic.marketing.api.service.CouponCardService" id="couponCardService" />
<dubbo:reference interface="com.gic.game.api.service.GameService" id="gameService" />
<dubbo:reference interface="com.gic.enterprise.service.CustomSettingApiService" id="customSettingApiService" />
<dubbo:reference interface="com.gic.marketing.pro.api.service.game.GameApiService" id="gameApiService" />
<dubbo:reference interface="com.gic.member.api.service.AchievementService" id="achievementService" />
<dubbo:reference interface="com.gic.clerk.api.service.PowerService" id="powerService" />
<dubbo:reference interface="com.gic.integralmall.api.service.IntegralmallService" id="integralmallService" />
<dubbo:reference interface="com.gic.enterprise.api.service.EnterpriseUseForbidService" id="enterpriseUseForbidService"/> <dubbo:reference interface="com.gic.enterprise.api.service.EnterpriseUseForbidService" id="enterpriseUseForbidService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService" <dubbo:reference interface="com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService"
id="staffDepartmentRelatedApiService"/> id="staffDepartmentRelatedApiService"/>
......
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