Commit 9246cd6c by 徐高华

Merge branch 'developer' of http://git.gicdev.com/haoban3.0/haoban-manage3.0.git into developer

parents a7396b6d 8abe2367
......@@ -456,6 +456,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
* @param memberId
*/
private void setMemberTag(StaffClerkRelationDTO staffClerkRelationDTO, String memberLabelId, String memberId) {
log.info("会员打标签,memberLabelId:{},memberId:{}",memberLabelId,memberId);
if (StringUtils.isNotBlank(memberLabelId)) {
MemberTagSingleDTO tagSingleDTO = new MemberTagSingleDTO();
tagSingleDTO.setEnterpriseId(staffClerkRelationDTO.getEnterpriseId());
......
......@@ -130,7 +130,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
hmQrcodeQDTO.setHmGroupId(0L);
}
List<String> clerkIdList = setStoreClerk(hmQrcodeQDTO, wxEnterpriseId, hmId, hmType);
List<String> clerkIdList = setStoreClerk(hmQrcodeQDTO, wxEnterpriseId, hmId, hmType,true);
if (CollectionUtils.isEmpty(clerkIdList)) {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "该导购已经生成过活码或未关联过好办");
}
......@@ -236,7 +236,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "该活码不存在");
}
Integer hmType = hmQrcodeQDTO.getHmType();
List<String> clerkIdList = setStoreClerk(hmQrcodeQDTO, wxEnterpriseId, hmId, hmType);
List<String> clerkIdList = setStoreClerk(hmQrcodeQDTO, wxEnterpriseId, hmId, hmType,false);
if (CollectionUtils.isEmpty(clerkIdList)) {
return ServiceResponse.failure(Convert.toStr(HaoBanErrCodeCommon.ERR_8.getCode()), "该导购已经生成过活码或未关联过好办");
}
......@@ -376,14 +376,14 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
* @param hmType
* @return
*/
private List<String> setStoreClerk(HmQrcodeQDTO hmQrcodeQDTO, String wxEnterpriseId, Long hmId, Integer hmType) {
private List<String> setStoreClerk(HmQrcodeQDTO hmQrcodeQDTO, String wxEnterpriseId, Long hmId, Integer hmType,Boolean addFlag) {
List<String> clerkIdList = hmQrcodeQDTO.getClerkIdList();
if (CollectionUtils.isEmpty(clerkIdList)) {
return null;
}
if (hmType == 2) {
//多人活码
insertHmClerkRelation(hmQrcodeQDTO, wxEnterpriseId, hmId, clerkIdList);
insertHmClerkRelation(hmQrcodeQDTO, wxEnterpriseId, hmId, clerkIdList,addFlag);
}
//单人活码
String clerkId = clerkIdList.get(0);
......@@ -401,8 +401,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
}
}
HmQrcodeBO hmQrcodeBO = hmQrcodeService.queryByClerkId(clerkId, wxEnterpriseId);
if (hmQrcodeBO != null) {
logger.error("已经生成过活码,clerkId:{}",clerkId);
if (addFlag && hmQrcodeBO != null) {
logger.error("已经生成过活码,clerkId:{}", clerkId);
return null;
}
StaffClerkRelationDTO staffClerkRelationDTO = staffClerkRelationService.getByClerkId(clerkId);
......@@ -425,15 +425,16 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
* @param hmId
* @param clerkIdList
*/
private void insertHmClerkRelation(HmQrcodeQDTO hmQrcodeQDTO, String wxEnterpriseId, Long hmId, List<String> clerkIdList) {
private void insertHmClerkRelation(HmQrcodeQDTO hmQrcodeQDTO, String wxEnterpriseId, Long hmId, List<String> clerkIdList,Boolean addFlag) {
List<HmClerkRelationQDTO> clerkRelationQDTOS = new ArrayList<>();
Date now = new Date();
for (String clerkId : clerkIdList) {
HmClerkRelationBO hmClerkRelationBO = hmClerkRelationService.queryByHmIdAndClerkId(hmId, clerkId);
if (hmClerkRelationBO != null) {
logger.error("该导购已经在该多人活码中,clerkId:{}",clerkId);
if (addFlag && hmClerkRelationBO != null) {
logger.error("该导购已经在该多人活码中,clerkId:{}", clerkId);
continue;
}
StaffClerkRelationDTO clerkRelationDTO = staffClerkRelationService.getByClerkId(clerkId);
HmClerkRelationQDTO hmClerkRelationQDTO = new HmClerkRelationQDTO();
hmClerkRelationQDTO.setRelationId(UniqueIdUtils.uniqueLong());
......
......@@ -137,6 +137,7 @@ public class HmQrcodeController {
public RestResponse<StatisticsDTO> list(@RequestBody HmQrcodeListQO hmQrcodeListQO) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
hmQrcodeListQO.getInFields().setEnterpriseId(loginUser.getEnterpriseId());
hmQrcodeListQO.getInFields().setWxEnterpriseId(loginUser.getWxEnterpriseId());
List<String> storeList = staffApiService.getHaoBanStoreIdsRolesByClerkId(loginUser.getClerkId(), loginUser.getWxEnterpriseId());
if (CollectionUtils.isEmpty(storeList)) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_100007.getCode()), HaoBanErrCode.ERR_100007.getMsg());
......
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