战区经理发送通知规则

This commit is contained in:
guohb
2024-05-21 11:03:26 +08:00
parent cca3d71b25
commit 90a94c03b8

View File

@@ -8,7 +8,6 @@ import com.cool.store.dao.RegionDao;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.entity.*;
import com.cool.store.enums.*;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.mapper.*;
import com.cool.store.request.LicenseListRequest;
@@ -19,7 +18,6 @@ import com.cool.store.response.SubmitLicenseResponse;
import com.cool.store.service.ApplyLicenseService;
import com.cool.store.service.CoolStoreStartFlowService;
import com.cool.store.service.PreparationService;
import com.cool.store.service.RegionService;
import com.cool.store.utils.StringUtil;
import com.cool.store.utils.poi.StringUtils;
import com.cool.store.utils.poi.constant.Constants;
@@ -49,9 +47,6 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
@Resource
private EnterpriseUserDAO userDAO;
@Resource
private RegionService regionService;
@Resource
private RegionDao regionDao;
@@ -76,9 +71,6 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
@Resource
EnterpriseUserRoleMapper enterpriseUserRoleMapper;
@Resource
UserRegionMappingMapper userRegionMappingMapper;
@Resource
UserAuthMappingMapper userAuthMappingMapper;
@@ -119,8 +111,24 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
requestMap.put("storeName", shopInfoDO.getShopName());
requestMap.put("partnerName,", lineInfoDO.getUsername());
requestMap.put("partnerMobile", lineInfoDO.getMobile());
log.info("submitLicense SMS requestMap:{}",JSONObject.toJSONString(requestMap));
commonService.sendMessage(Collections.singletonList(shopInfoDO.getSupervisorUserId()), MessageEnum.MESSAGE_17, requestMap);
log.info("submitLicense SMS requestMap:{}", JSONObject.toJSONString(requestMap));
List<String> sendUsers = new ArrayList<>();
//如果没有督导,则发送给管辖此区域的所有战区经理
if (StringUtil.isBlank(shopInfoDO.getSupervisorUserId())) {
Long regionId = shopInfoDO.getRegionId();
List<UserAuthMappingDO> userAuthByMappingIds = userAuthMappingMapper.getUserAuthByMappingIds(Collections.singletonList(String.valueOf(regionId)));
if (CollectionUtils.isNotEmpty(userAuthByMappingIds)) {
List<String> sendUserIds = userAuthByMappingIds.stream().map(UserAuthMappingDO::getUserId).collect(Collectors.toList());
sendUsers.addAll(sendUserIds);
}
} else {
sendUsers.add(shopInfoDO.getSupervisorUserId());
}
if (CollectionUtils.isEmpty(sendUsers)) {
log.info("未找到可发送工作通知的人员");
return true;
}
commonService.sendMessage(sendUsers, MessageEnum.MESSAGE_17, requestMap);
}
return true;
}
@@ -175,7 +183,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
public SubmitLicenseResponse.StoreDocument toStoreDocument(GetStoreInfoByCodeResponse.StoreDocument storeDocument) {
SubmitLicenseResponse.StoreDocument submitLicenseResponse = new SubmitLicenseResponse.StoreDocument();
boolean storeBusinessValidPeriod = storeDocument.getStoreBusinessValidPeriod().equals("9");
submitLicenseResponse.setLicenseType(LicenseTypeEnum.matchName(storeDocument.getStoreBusinessType()).getCode());
submitLicenseResponse.setLicenseType(Objects.requireNonNull(LicenseTypeEnum.matchName(storeDocument.getStoreBusinessType())).getCode());
submitLicenseResponse.setLicenseLegalPerson(storeDocument.getStoreDirector());
submitLicenseResponse.setIssueTime(DateUtil.parseDate(storeDocument.getStoreBusinessDate()));
submitLicenseResponse.setLicenseAddress(storeDocument.getStoreBusinessAdd());