Commit 2051c88c by guojx

Merge remote-tracking branch 'origin/developer' into developer

parents 3005aef1 2eb48fa4
...@@ -101,6 +101,8 @@ public class HmQrcodeQDTO implements Serializable { ...@@ -101,6 +101,8 @@ public class HmQrcodeQDTO implements Serializable {
*/ */
private Integer invokingType = 0; private Integer invokingType = 0;
private String addStaffName;
public Long getHmId() { public Long getHmId() {
return hmId; return hmId;
...@@ -365,5 +367,13 @@ public class HmQrcodeQDTO implements Serializable { ...@@ -365,5 +367,13 @@ public class HmQrcodeQDTO implements Serializable {
public void setInvokingType(Integer invokingType) { public void setInvokingType(Integer invokingType) {
this.invokingType = invokingType; this.invokingType = invokingType;
} }
public String getAddStaffName() {
return addStaffName;
}
public void setAddStaffName(String addStaffName) {
this.addStaffName = addStaffName;
}
} }
package com.gic.haoban.manage.service.dao.mapper.hm; package com.gic.haoban.manage.service.dao.mapper.hm;
import java.util.List;
import org.apache.ibatis.annotations.Param;
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.service.entity.hm.TabHaobanHmQrcode; import com.gic.haoban.manage.service.entity.hm.TabHaobanHmQrcode;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeClerkBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeClerkBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 活码(TabHaobanHmQrcode)表数据库访问层 * 活码(TabHaobanHmQrcode)表数据库访问层
...@@ -103,7 +102,8 @@ public interface TabHaobanHmQrcodeMapper { ...@@ -103,7 +102,8 @@ public interface TabHaobanHmQrcodeMapper {
List<TabHaobanHmQrcode> listByStoreId( List<TabHaobanHmQrcode> listByStoreId(
@Param("wxEnterpriseId") String wxEnterpriseId, @Param("wxEnterpriseId") String wxEnterpriseId,
@Param("storeId") String storeId, @Param("storeId") String storeId,
@Param("overFlag") Integer overFlag); @Param("overFlag") Integer overFlag,
@Param("hmType") Integer hmType);
/** /**
* 通过id添加num * 通过id添加num
...@@ -147,7 +147,8 @@ public interface TabHaobanHmQrcodeMapper { ...@@ -147,7 +147,8 @@ public interface TabHaobanHmQrcodeMapper {
*/ */
TabHaobanHmQrcode queryByClerkIdAndOverFlag(@Param("clerkId") String clerkId, TabHaobanHmQrcode queryByClerkIdAndOverFlag(@Param("clerkId") String clerkId,
@Param("wxEnterpriseId") String wxEnterpriseId, @Param("wxEnterpriseId") String wxEnterpriseId,
@Param("overFlag") Integer overFlag); @Param("overFlag") Integer overFlag,
@Param("hmType") Integer hmType);
/** /**
* 活码门店ids * 活码门店ids
......
...@@ -9,8 +9,6 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO; ...@@ -9,8 +9,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;
/** /**
* 活码(TabHaobanHmQrcode)表服务接口 * 活码(TabHaobanHmQrcode)表服务接口
...@@ -82,7 +80,7 @@ public interface HmQrcodeService { ...@@ -82,7 +80,7 @@ public interface HmQrcodeService {
* @author mozhu * @author mozhu
* @date 2022-07-07 17:19:08 * @date 2022-07-07 17:19:08
*/ */
List<HmQrcodeBO> listByStoreId(String wxEnterpriseId,String storeId, Integer overFlag); List<HmQrcodeBO> listByStoreId(String wxEnterpriseId, String storeId, Integer overFlag,Integer hmType);
/** /**
* 通过id添加num * 通过id添加num
...@@ -112,7 +110,7 @@ public interface HmQrcodeService { ...@@ -112,7 +110,7 @@ public interface HmQrcodeService {
* @author mozhu * @author mozhu
* @date 2022-07-07 17:19:02 * @date 2022-07-07 17:19:02
*/ */
HmQrcodeBO queryByClerkId(String clerkId,String wxEnterpriseId); HmQrcodeBO queryByClerkId(String clerkId, String wxEnterpriseId);
/** /**
* 查询职员id 有效 * 查询职员id 有效
...@@ -120,11 +118,12 @@ public interface HmQrcodeService { ...@@ -120,11 +118,12 @@ public interface HmQrcodeService {
* @param clerkId 职员id * @param clerkId 职员id
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
* @param overFlag 在国旗 * @param overFlag 在国旗
* @param hmType hm型
* @return {@link HmQrcodeBO } * @return {@link HmQrcodeBO }
* @author mozhu * @author mozhu
* @date 2022-07-07 17:24:57 * @date 2022-07-27 14:52:40
*/ */
HmQrcodeBO queryByClerkId(String clerkId,String wxEnterpriseId,Integer overFlag); HmQrcodeBO queryByClerkId(String clerkId, String wxEnterpriseId, Integer overFlag,Integer hmType);
/** /**
...@@ -136,27 +135,30 @@ public interface HmQrcodeService { ...@@ -136,27 +135,30 @@ public interface HmQrcodeService {
* @author mozhu * @author mozhu
* @date 2022-07-07 16:18:13 * @date 2022-07-07 16:18:13
*/ */
int updateStatusById(Long hmId,Integer statusFlag); int updateStatusById(Long hmId, Integer statusFlag);
/** /**
* 活码门店ids * 活码门店ids
* *
* @param enterpriseId 企业标识 * @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link HmQrcodeBO }> * @return {@link List }<{@link HmQrcodeBO }>
* @author mozhu * @author mozhu
* @date 2022-07-08 15:09:50 * @date 2022-07-27 14:52:03
*/ */
List<HmQrcodeBO> getHmStoreByEnterpriseId(String wxEnterpriseId , String enterpriseId); List<HmQrcodeBO> getHmStoreByEnterpriseId(String wxEnterpriseId, String enterpriseId);
/** /**
* 根据分组id获取活码数量 * 根据分组id获取活码数量
* *
* @param enterpriseId 企业标识 * @param wxEnterpriseId wx企业标识
* @param groupIds 组id * @param enterpriseId 企业标识
* @param groupIds 组id
* @param hmIds hm id
* @return {@link List }<{@link HmQrcodeGroupNumBO }> * @return {@link List }<{@link HmQrcodeGroupNumBO }>
* @author mozhu * @author mozhu
* @date 2022-07-12 17:38:43 * @date 2022-07-27 14:52:10
*/ */
List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String wxEnterpriseId, String enterpriseId, List<Long> groupIds, List<String> hmIds); List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String wxEnterpriseId, String enterpriseId, List<Long> groupIds, List<String> hmIds);
...@@ -172,20 +174,21 @@ public interface HmQrcodeService { ...@@ -172,20 +174,21 @@ public interface HmQrcodeService {
/** /**
* 批量修改活码分组 * 批量修改活码分组
*
* @param hmIds * @param hmIds
* @param groupId * @param groupId
* @return * @return
*/ */
int batchUpdateQrcodeGroup(List<Long> hmIds, Long groupId); int batchUpdateQrcodeGroup(List<Long> hmIds, Long groupId);
int getCanAddCount(String wxEnterpriseId , String enterpriseId , String clerkId) ;
int getCanAddCount(String wxEnterpriseId, String enterpriseId, String clerkId);
List<HmQrcodeClerkBO> listCanAddClerk(String wxEnterpriseId , String enterpriseId , String clerkId) ;
List<String> getHmStoreForWxa(String wxEnterpriseId ,String enterpriseId); List<HmQrcodeClerkBO> listCanAddClerk(String wxEnterpriseId, String enterpriseId, String clerkId);
List<String> getHmStoreForWxa(String wxEnterpriseId, String enterpriseId);
List<String> listHmIdForIndex(HmQrcodeListQDTO qdto); List<String> listHmIdForIndex(HmQrcodeListQDTO qdto);
List<String> listHasQrcodeClerk(String enterpriseId , List<String> clerkIdList) ; List<String> listHasQrcodeClerk(String enterpriseId, List<String> clerkIdList);
} }
...@@ -84,9 +84,9 @@ public class HmQrcodeServiceImpl implements HmQrcodeService { ...@@ -84,9 +84,9 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
} }
@Override @Override
public List<HmQrcodeBO> listByStoreId(String wxEnterpriseId, String storeId, Integer overFlag) { public List<HmQrcodeBO> listByStoreId(String wxEnterpriseId, String storeId, Integer overFlag,Integer hmType) {
return EntityUtil.changeEntityListNew(HmQrcodeBO.class, return EntityUtil.changeEntityListNew(HmQrcodeBO.class,
tabHaobanHmQrcodeMapper.listByStoreId(wxEnterpriseId, storeId, overFlag)); tabHaobanHmQrcodeMapper.listByStoreId(wxEnterpriseId, storeId, overFlag,hmType));
} }
@Override @Override
...@@ -106,9 +106,9 @@ public class HmQrcodeServiceImpl implements HmQrcodeService { ...@@ -106,9 +106,9 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
} }
@Override @Override
public HmQrcodeBO queryByClerkId(String clerkId, String wxEnterpriseId, Integer overFlag) { public HmQrcodeBO queryByClerkId(String clerkId, String wxEnterpriseId, Integer overFlag,Integer hmType) {
return EntityUtil.changeEntity(HmQrcodeBO.class, return EntityUtil.changeEntity(HmQrcodeBO.class,
tabHaobanHmQrcodeMapper.queryByClerkIdAndOverFlag(clerkId, wxEnterpriseId, overFlag)); tabHaobanHmQrcodeMapper.queryByClerkIdAndOverFlag(clerkId, wxEnterpriseId, overFlag,hmType));
} }
@Override @Override
......
...@@ -519,6 +519,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -519,6 +519,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
logger.error("任务重新分配问题发送消息队列出错",e); logger.error("任务重新分配问题发送消息队列出错",e);
} }
} }
} }
} }
......
package com.gic.haoban.manage.service.service.out.impl.hm; package com.gic.haoban.manage.service.service.out.impl.hm;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
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.redisson.api.RRateLimiter;
import org.redisson.api.RateIntervalUnit;
import org.redisson.api.RateType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.BasePageInfo; import com.gic.api.base.commons.BasePageInfo;
...@@ -30,11 +13,7 @@ import com.gic.enterprise.api.dto.StoreDTO; ...@@ -30,11 +13,7 @@ import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.StoreService; import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.common.utils.DingUtils; import com.gic.haoban.common.utils.DingUtils;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.hm.HmLinkDTO; import com.gic.haoban.manage.api.dto.hm.*;
import com.gic.haoban.manage.api.dto.hm.HmLinkStoreDTO;
import com.gic.haoban.manage.api.dto.hm.HmLinkStoreSettingDTO;
import com.gic.haoban.manage.api.dto.hm.HmLinkWxaDTO;
import com.gic.haoban.manage.api.dto.hm.HmPageDTO;
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.service.hm.HmLinkApiService; import com.gic.haoban.manage.api.service.hm.HmLinkApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
...@@ -49,11 +28,7 @@ import com.gic.haoban.manage.service.pojo.qo.HmQrcodeTempQO; ...@@ -49,11 +28,7 @@ import com.gic.haoban.manage.service.pojo.qo.HmQrcodeTempQO;
import com.gic.haoban.manage.service.service.KeyDataService; import com.gic.haoban.manage.service.service.KeyDataService;
import com.gic.haoban.manage.service.service.MemberQueryService; import com.gic.haoban.manage.service.service.MemberQueryService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.hm.HmLinkService; import com.gic.haoban.manage.service.service.hm.*;
import com.gic.haoban.manage.service.service.hm.HmLinkStoreService;
import com.gic.haoban.manage.service.service.hm.HmPageService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeTempService;
import com.gic.member.api.dto.MemberClerkDTO; import com.gic.member.api.dto.MemberClerkDTO;
import com.gic.member.api.dto.es.MemberDataDTO; import com.gic.member.api.dto.es.MemberDataDTO;
import com.gic.member.api.dto.es.MemberStoreClerkDataDTO; import com.gic.member.api.dto.es.MemberStoreClerkDataDTO;
...@@ -63,6 +38,17 @@ import com.gic.redis.data.util.RedisUtil; ...@@ -63,6 +38,17 @@ import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactDTO; import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactDTO;
import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactResultDTO; import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactResultDTO;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.redisson.api.RRateLimiter;
import org.redisson.api.RateIntervalUnit;
import org.redisson.api.RateType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service("hmLinkApiService") @Service("hmLinkApiService")
public class HmLinkApiServiceImpl implements HmLinkApiService { public class HmLinkApiServiceImpl implements HmLinkApiService {
...@@ -494,7 +480,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService { ...@@ -494,7 +480,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
if (StringUtils.isBlank(clerkId) || "-1".equals(clerkId)) { if (StringUtils.isBlank(clerkId) || "-1".equals(clerkId)) {
return null; return null;
} }
HmQrcodeBO hm = this.hmQrcodeService.queryByClerkId(clerkId, wxEnterpriseId, 0); HmQrcodeBO hm = this.hmQrcodeService.queryByClerkId(clerkId, wxEnterpriseId, 0,1);
return hm; return hm;
} }
...@@ -519,7 +505,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService { ...@@ -519,7 +505,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
// 店员需要过滤主导购、店长 // 店员需要过滤主导购、店长
log.info("过滤的导购={}",clerkIdList); log.info("过滤的导购={}",clerkIdList);
if (null == hm && dy == 1) { if (null == hm && dy == 1) {
List<HmQrcodeBO> list = this.hmQrcodeService.listByStoreId(wxEnterpriseId, inStoreId, 0); List<HmQrcodeBO> list = this.hmQrcodeService.listByStoreId(wxEnterpriseId, inStoreId, 0,1);
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
log.info("查询门店下有活码的导购数={}",list.size()); log.info("查询门店下有活码的导购数={}",list.size());
list = list.stream().filter(dto -> !clerkIdList.contains(dto.getClerkId())).collect(Collectors.toList()); list = list.stream().filter(dto -> !clerkIdList.contains(dto.getClerkId())).collect(Collectors.toList());
......
...@@ -293,6 +293,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -293,6 +293,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
} }
setLoggerContext(hmQrcodeQDTO.getEnterpriseId(), wxEnterpriseId, hmQrcodeQDTO.getModifierId(), hmQrcodeQDTO.getModifierName()); setLoggerContext(hmQrcodeQDTO.getEnterpriseId(), wxEnterpriseId, hmQrcodeQDTO.getModifierId(), hmQrcodeQDTO.getModifierName());
//操作日志
updateSystemLog(hmQrcodeQDTO, hmId); updateSystemLog(hmQrcodeQDTO, hmId);
int updateResult = hmQrcodeService.update(hmQrcodeQDTO); int updateResult = hmQrcodeService.update(hmQrcodeQDTO);
...@@ -329,11 +331,22 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -329,11 +331,22 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
logContent.append("活码分组「").append(hmGroupSettingBOOld.getGroupName()).append("」").append("变更为「").append(hmGroupSettingBO.getGroupName()).append("」"); logContent.append("活码分组「").append(hmGroupSettingBOOld.getGroupName()).append("」").append("变更为「").append(hmGroupSettingBO.getGroupName()).append("」");
} }
//员工变更 //员工变更
String staffId = hmQrcodeQDTO.getStaffId(); List<String> clerkIdList = hmQrcodeQDTO.getClerkIdList();
String staffIdOld = hmOld.getStaffId(); List<HmClerkRelationBO> hmClerkRelationBOS = hmClerkRelationService.queryByHmIdNotInClerkIds(hmId, clerkIdList);
if (!staffId.equals(staffIdOld)) { if (CollectionUtils.isNotEmpty(hmClerkRelationBOS)) {
logContent.append("新增使用成员「").append(hmQrcodeQDTO.getStaffName()).append("」").append("删除使用成员「").append(hmOld.getStaffName()).append("」"); //删除员工
StringBuffer staffNameBuffer = new StringBuffer();
for (HmClerkRelationBO hmClerkRelationBO : hmClerkRelationBOS) {
staffNameBuffer.append(hmClerkRelationBO.getStaffName()).append(" ");
}
logContent.append("删除使用成员「").append(staffNameBuffer.toString()).append("」");
}
//新增员工
String addStaffName = hmQrcodeQDTO.getAddStaffName();
if (StringUtils.isNotBlank(addStaffName)) {
logContent.append("新增使用成员「").append(addStaffName).append("」");
} }
Integer passFlag = hmQrcodeQDTO.getPassFlag(); Integer passFlag = hmQrcodeQDTO.getPassFlag();
Integer passFlagOld = hmOld.getPassFlag(); Integer passFlagOld = hmOld.getPassFlag();
if (!passFlag.equals(passFlagOld)) { if (!passFlag.equals(passFlagOld)) {
...@@ -423,44 +436,48 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -423,44 +436,48 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
return null; return null;
} }
String enterpriseId = hmQrcodeQDTO.getEnterpriseId(); String enterpriseId = hmQrcodeQDTO.getEnterpriseId();
//单人活码
String clerkId = clerkIdList.get(0); String clerkId = clerkIdList.get(0);
ClerkDTO clerkDTO = clerkService.getclerkById(clerkId);
if (clerkDTO != null) {
String name = hmQrcodeQDTO.getName();
if (StringUtils.isBlank(name)) {
hmQrcodeQDTO.setName(clerkDTO.getClerkName());
}
}
if (hmType == 2) { if (hmType == 2) {
//多人活码 //多人活码
insertHmClerkRelation(enterpriseId, wxEnterpriseId, hmId, clerkIdList, addFlag); insertHmClerkRelation(hmQrcodeQDTO,enterpriseId, wxEnterpriseId, hmId, clerkIdList, addFlag);
} else if (hmType == 1) { } else if (hmType == 1) {
//单人活码
HmQrcodeBO hmQrcodeBO = hmQrcodeService.queryByClerkId(clerkId, wxEnterpriseId); HmQrcodeBO hmQrcodeBO = hmQrcodeService.queryByClerkId(clerkId, wxEnterpriseId);
if (addFlag && hmQrcodeBO != null) { if (addFlag && hmQrcodeBO != null) {
logger.error("已经生成过活码,clerkId:{}", clerkId); logger.error("已经生成过活码,clerkId:{}", clerkId);
return null; return null;
} }
} hmQrcodeQDTO.setClerkId(clerkId);
if (clerkDTO != null) {
hmQrcodeQDTO.setClerkId(clerkId); hmQrcodeQDTO.setClerkName(clerkDTO.getClerkName());
ClerkDTO clerkDTO = clerkService.getclerkById(clerkId); hmQrcodeQDTO.setClerkCode(clerkDTO.getClerkCode());
if (clerkDTO != null) { String storeId = clerkDTO.getStoreId();
String name = hmQrcodeQDTO.getName(); hmQrcodeQDTO.setStoreId(storeId);
String clerkName = clerkDTO.getClerkName(); StoreDTO storeDTO = storeService.getStore(storeId);
if (StringUtils.isBlank(name)) { if (storeDTO != null) {
hmQrcodeQDTO.setName(clerkName); hmQrcodeQDTO.setStoreCode(storeDTO.getStoreCode());
} hmQrcodeQDTO.setStoreName(storeDTO.getStoreName());
hmQrcodeQDTO.setClerkName(clerkName); }
hmQrcodeQDTO.setClerkCode(clerkDTO.getClerkCode());
String storeId = clerkDTO.getStoreId();
hmQrcodeQDTO.setStoreId(storeId);
StoreDTO storeDTO = storeService.getStore(storeId);
if (storeDTO != null) {
hmQrcodeQDTO.setStoreCode(storeDTO.getStoreCode());
hmQrcodeQDTO.setStoreName(storeDTO.getStoreName());
} }
}
StaffClerkRelationDTO staffClerkRelationDTO = staffClerkRelationService.getByClerkId(clerkId); StaffClerkRelationDTO staffClerkRelationDTO = staffClerkRelationService.getByClerkId(clerkId);
if (staffClerkRelationDTO != null) { if (staffClerkRelationDTO != null) {
hmQrcodeQDTO.setStaffId(staffClerkRelationDTO.getStaffId()); hmQrcodeQDTO.setStaffId(staffClerkRelationDTO.getStaffId());
TabHaobanStaff tabHaobanStaff = staffService.selectById(staffClerkRelationDTO.getStaffId()); TabHaobanStaff tabHaobanStaff = staffService.selectById(staffClerkRelationDTO.getStaffId());
if (tabHaobanStaff != null) { if (tabHaobanStaff != null) {
hmQrcodeQDTO.setStaffName(tabHaobanStaff.getStaffName()); hmQrcodeQDTO.setStaffName(tabHaobanStaff.getStaffName());
hmQrcodeQDTO.setWxUserId(tabHaobanStaff.getWxUserId()); hmQrcodeQDTO.setWxUserId(tabHaobanStaff.getWxUserId());
}
} }
} }
return clerkIdList; return clerkIdList;
...@@ -474,7 +491,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -474,7 +491,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
* @param clerkIdList * @param clerkIdList
* @param addFlag * @param addFlag
*/ */
private void insertHmClerkRelation(String enterpriseId,String wxEnterpriseId, Long hmId, List<String> clerkIdList, Boolean addFlag) { private void insertHmClerkRelation(HmQrcodeQDTO hmQrcodeQDTO,String enterpriseId,String wxEnterpriseId, Long hmId, List<String> clerkIdList, Boolean addFlag) {
Date now = new Date(); Date now = new Date();
if (!addFlag) { if (!addFlag) {
//修改,删除其余无效导购 //修改,删除其余无效导购
...@@ -485,7 +502,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -485,7 +502,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
} }
} }
} }
StringBuffer addStaffName = new StringBuffer();
for (String clerkId : clerkIdList) { for (String clerkId : clerkIdList) {
HmClerkRelationBO hmClerkRelationBO = hmClerkRelationService.queryByHmIdAndClerkId(hmId, clerkId); HmClerkRelationBO hmClerkRelationBO = hmClerkRelationService.queryByHmIdAndClerkId(hmId, clerkId);
if (hmClerkRelationBO != null) { if (hmClerkRelationBO != null) {
...@@ -520,6 +537,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -520,6 +537,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
TabHaobanStaff tabHaobanStaff = staffService.selectById(staffClerkRelationDTO.getStaffId()); TabHaobanStaff tabHaobanStaff = staffService.selectById(staffClerkRelationDTO.getStaffId());
if (tabHaobanStaff != null) { if (tabHaobanStaff != null) {
hmClerkRelationQDTO.setStaffName(tabHaobanStaff.getStaffName()); hmClerkRelationQDTO.setStaffName(tabHaobanStaff.getStaffName());
addStaffName.append(tabHaobanStaff.getStaffName()).append(" ");
} }
} }
hmClerkRelationQDTO.setStatus(1); hmClerkRelationQDTO.setStatus(1);
...@@ -529,6 +547,10 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -529,6 +547,10 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
hmClerkRelationQDTO.setAddNum(0); hmClerkRelationQDTO.setAddNum(0);
hmClerkRelationService.insert(hmClerkRelationQDTO); hmClerkRelationService.insert(hmClerkRelationQDTO);
} }
if (addStaffName != null && addStaffName.length() > 0){
hmQrcodeQDTO.setAddStaffName(addStaffName.toString());
}
} }
......
...@@ -272,6 +272,9 @@ ...@@ -272,6 +272,9 @@
<if test="overFlag != null"> <if test="overFlag != null">
and over_flag = #{overFlag} and over_flag = #{overFlag}
</if> </if>
<if test="hmType != null">
and hm_type = #{hmType}
</if>
</select> </select>
<update id="updateAddNumById"> <update id="updateAddNumById">
...@@ -307,7 +310,12 @@ ...@@ -307,7 +310,12 @@
<include refid="Base_Column_List"></include> <include refid="Base_Column_List"></include>
from tab_haoban_hm_qrcode from tab_haoban_hm_qrcode
where clerk_id = #{clerkId} and status_flag = 1 where clerk_id = #{clerkId} and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId} and over_flag = #{overFlag} limit 1 and wx_enterprise_id = #{wxEnterpriseId}
and over_flag = #{overFlag}
<if test="hmType != null">
and hm_type = #{hmType}
</if>
limit 1
</select> </select>
......
package com.gic.haoban.manage.web.controller.hm; package com.gic.haoban.manage.web.controller.hm;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.gic.haoban.manage.web.utils.statistics.DateUtils;
import org.apache.commons.collections.CollectionUtils;
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 cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo; import com.gic.api.base.commons.BasePageInfo;
...@@ -43,9 +28,12 @@ import com.gic.haoban.manage.web.qo.hm.HmQrcodeUpdateQO; ...@@ -43,9 +28,12 @@ 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;
import com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO; import com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO;
import com.gic.haoban.manage.web.qo.hm.data.HmTrendQO; import com.gic.haoban.manage.web.qo.hm.data.HmTrendQO;
import com.gic.haoban.manage.web.utils.statistics.DataStatisticsParamUtils;
import com.gic.haoban.manage.web.utils.statistics.DateUtils;
import com.gic.haoban.manage.web.vo.hm.HmDetailClerkListVO; import com.gic.haoban.manage.web.vo.hm.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.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
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;
...@@ -53,9 +41,9 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -53,9 +41,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.text.ParseException;
import java.util.List; import java.util.*;
import java.util.Map; import java.util.stream.Collectors;
/** /**
* 活码(TabHaobanHmQrcode)表控制层 * 活码(TabHaobanHmQrcode)表控制层
...@@ -226,11 +214,11 @@ public class HmQrcodeController { ...@@ -226,11 +214,11 @@ public class HmQrcodeController {
if (hmGroupDTO != null) { if (hmGroupDTO != null) {
hmQrcodeListDTO.setHmGroupName(hmGroupDTO.getGroupName()); hmQrcodeListDTO.setHmGroupName(hmGroupDTO.getGroupName());
} }
//if (CollectionUtils.isNotEmpty(storeDTOList)) { if (CollectionUtils.isNotEmpty(storeDTOList)) {
// //门店id去重 //门店id去重
// storeDTOList = storeDTOList.stream() storeDTOList = storeDTOList.stream().filter(c-> StringUtils.isNotBlank(c.getStoreId()))
// .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(HmStoreDTO::getStoreId))), ArrayList::new)); .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(HmStoreDTO::getStoreId))), ArrayList::new));
//} }
hmQrcodeListDTO.setClerkList(clerkDTOList); hmQrcodeListDTO.setClerkList(clerkDTOList);
hmQrcodeListDTO.setStoreList(storeDTOList); hmQrcodeListDTO.setStoreList(storeDTOList);
} }
...@@ -370,7 +358,7 @@ public class HmQrcodeController { ...@@ -370,7 +358,7 @@ public class HmQrcodeController {
} else if (hmType == 2) { } else if (hmType == 2) {
statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_many_detail, hmDetailClerkListQO); statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_many_detail, hmDetailClerkListQO);
} }
return RestResponse.successResult(statisticsDTO); return DataStatisticsParamUtils.responsePage(statisticsDTO);
} }
......
...@@ -5,6 +5,7 @@ import com.gic.api.base.commons.BasePageInfo; ...@@ -5,6 +5,7 @@ import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.manage.api.dto.statistics.StatisticsDTO; import com.gic.haoban.manage.api.dto.statistics.StatisticsDTO;
import com.gic.haoban.manage.api.dto.statistics.StatisticsPage;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -74,10 +75,13 @@ public class DataStatisticsParamUtils { ...@@ -74,10 +75,13 @@ public class DataStatisticsParamUtils {
} }
Page page = new Page(); Page page = new Page();
page.setResult(statisticsDTO.getData()); page.setResult(statisticsDTO.getData());
page.setPageSize(statisticsDTO.getPage().getPageSize()); StatisticsPage statisticsPage = statisticsDTO.getPage();
page.setCurrentPage(statisticsDTO.getPage().getCurrentPage()); if (statisticsPage != null) {
page.setTotalPage(statisticsDTO.getPage().getTotalPage()); page.setPageSize(statisticsPage.getPageSize());
page.setTotalCount(statisticsDTO.getPage().getTotalCount()); page.setCurrentPage(statisticsPage.getCurrentPage());
page.setTotalPage(statisticsPage.getTotalPage());
page.setTotalCount(statisticsPage.getTotalCount());
}
return RestResponse.successResult(page); return RestResponse.successResult(page);
} }
......
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