Commit 90c5135a by zhiwj

导购bug

parent f5a989c6
......@@ -108,15 +108,22 @@ public class ClerkApiServiceImpl implements ClerkApiService {
// 如果门店下没有导购是店长,将当前导购设置成店长
// 这里并发会出错 加个锁
TabClerk clerkLeader = clerkService.getClerkLeaderByStoreInfoId(clerkDTO.getEnterpriseId(), clerkDTO.getStoreInfoId());
if (clerkLeader != null && com.gic.store.constant.Constants.CLERK_LEADER_POSITION_ID.equals(clerkDTO.getPositionId())) {
clerkLeader.setPositionId(com.gic.store.constant.Constants.CLERK_POSITION_ID);
clerkLeader.setPositionName("导购");
clerkService.update(clerkLeader);
clerkDTO.setPositionId(com.gic.store.constant.Constants.CLERK_LEADER_POSITION_ID);
} else if (clerkLeader == null || clerkLeader.getClerkId().equals(clerkDTO.getClerkId())) {
if (clerkLeader != null) {
// 已经有了店长
if (com.gic.store.constant.Constants.CLERK_LEADER_POSITION_ID.equals(clerkDTO.getPositionId())) {
// 要把当前的导购改成店长
clerkLeader.setPositionId(com.gic.store.constant.Constants.CLERK_POSITION_ID);
clerkLeader.setPositionName("导购");
clerkService.update(clerkLeader);
clerkDTO.setPositionId(com.gic.store.constant.Constants.CLERK_LEADER_POSITION_ID);
} else if (clerkLeader.getClerkId().equals(clerkDTO.getClerkId()) && !com.gic.store.constant.Constants.CLERK_LEADER_POSITION_ID.equals(clerkDTO.getPositionId())) {
// 当前导购就是店长 要改成不是店长 不能改
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "门店下必须有一个店长");
}
} else if (clerkLeader == null) {
clerkDTO.setPositionId(com.gic.store.constant.Constants.CLERK_LEADER_POSITION_ID);
}
if (StringUtils.isNotBlank(clerkDTO.getPhoneNumber())) {
String nationcode = clerkDTO.getNationcode();
if (StringUtils.isBlank(nationcode)) {
......
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