Commit ce4f4717 by 墨竹

fix:活码进行是否开启活码功能企业过滤

parent 50746122
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.clerk.api.service.RightService;
import com.gic.commons.util.EntityUtil;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
......@@ -66,6 +67,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
private MemberApiService memberApiService;
@Autowired
private ClerkService clerkService;
@Autowired
private RightService rightService;
@Override
public List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId, String enterpriseId, Set<String> clerkCodeList) {
......@@ -167,23 +170,28 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
if (StringUtils.isNotBlank(staffClerkRelationId)) {
String wxEnterpriseId = dto.getWxEnterpriseId();
Integer manageFlag = dto.getManageFlag();
String enterpriseId = dto.getEnterpriseId();
//导购和店长需要设置主门店
if (manageFlag != null && manageFlag == 1) {
//do nothing
} else {
logger.info("设置主门店并创建活码:manageFlag:{},staffId:{}", manageFlag, staffId);
clerkMainStoreRelatedService.getMainStoreByStaffId(staffId, wxEnterpriseId);
// 绑定自动创建活码
HmQrcodeQDTO hmQrcodeQDTO = new HmQrcodeQDTO();
hmQrcodeQDTO.setHmType(1);
hmQrcodeQDTO.setWxEnterpriseId(wxEnterpriseId);
hmQrcodeQDTO.setEnterpriseId(dto.getEnterpriseId());
hmQrcodeQDTO.setName(tabHaobanStaff.getStaffName());
hmQrcodeQDTO.setPassFlag(1);
hmQrcodeQDTO.setStoreId(dto.getStoreId());
hmQrcodeQDTO.setClerkIdList(Collections.singletonList(dto.getClerkId()));
hmQrcodeQDTO.setInvokingType(channelCode);
hmQrcodeApiService.add(hmQrcodeQDTO);
//有活码权限的企业
boolean flag = rightService.hasRightForAdmin(enterpriseId, "hb_m0206");
if (flag) {
// 绑定自动创建活码
HmQrcodeQDTO hmQrcodeQDTO = new HmQrcodeQDTO();
hmQrcodeQDTO.setHmType(1);
hmQrcodeQDTO.setWxEnterpriseId(wxEnterpriseId);
hmQrcodeQDTO.setEnterpriseId(enterpriseId);
hmQrcodeQDTO.setName(tabHaobanStaff.getStaffName());
hmQrcodeQDTO.setPassFlag(1);
hmQrcodeQDTO.setStoreId(dto.getStoreId());
hmQrcodeQDTO.setClerkIdList(Collections.singletonList(dto.getClerkId()));
hmQrcodeQDTO.setInvokingType(channelCode);
hmQrcodeApiService.add(hmQrcodeQDTO);
}
}
//推入日志
staffClerkBindLogService.pushToMq(staffId, optStaffId, BindTypeEnum.BIND.getVal(), channelCode, staffClerkRelationId);
......
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