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

This commit is contained in:
zhangchenbiao
2024-04-09 19:08:12 +08:00
10 changed files with 58 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.HyOpenAreaInfoDAO;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.dao.RegionAreaConfigDao;
@@ -20,6 +21,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.xml.bind.util.JAXBSource;
import java.util.Objects;
import static com.cool.store.enums.ErrorCodeEnum.LINE_ID_IS_NOT_EXIST;
@@ -55,6 +57,7 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
@Override
@Transactional(rollbackFor = Exception.class)
public boolean submit(JoinIntentionRequest request) {
log.info("submit request {}", JSONObject.toJSONString(request));
if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
@@ -66,8 +69,8 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
if (Objects.isNull(lineInfoParam)) {
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
}
if (Objects.nonNull(request.getWantShopArea())){
EnterpriseUserDO userByRoleNameAndAreaId = userAuthMappingService.getUserByRoleEnumAndAreaId(UserRoleEnum.INVESTMENT_MANAGER, Long.valueOf(request.getWantShopArea()));
if (Objects.nonNull(request.getAreaCode())){
EnterpriseUserDO userByRoleNameAndAreaId = userAuthMappingService.getUserByRoleEnumAndAreaId(UserRoleEnum.INVESTMENT_MANAGER, Long.valueOf(request.getAreaCode()));
lineInfoParam.setInvestmentManager(userByRoleNameAndAreaId.getUserId());
}
//todo 目前写死为进入私海

View File

@@ -1,5 +1,6 @@
package com.cool.store.service.impl;
import com.alibaba.excel.util.DateUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
@@ -175,6 +176,7 @@ public class OpenAreaServiceImpl implements OpenAreaService {
hyOpenAreaInfoDOList.stream().forEach(x->{
OpenAreaVO openAreaVO = convertDoToVo(x);
openAreaVO.setUpdateUserName(userMap.get(x.getUpdateUserId()));
openAreaVO.setUpdateTime(DateUtils.format(x.getUpdateTime(),DateUtils.DATE_FORMAT_19));
list.add(openAreaVO);
});
hyOpenAreaInfoDOPageInfo.setList(list);

View File

@@ -62,20 +62,21 @@ public class TrainingExperienceServiceImpl extends LineFlowService implements Tr
}
LeaseBaseInfoDO leaseBaseInfoDO = request.toLeaseBaseInfoDO();
Date currentDate = new Date();
LineInfoDO lineInfoDO = new LineInfoDO();
if (request.getExperienceStartTime().compareTo(request.getExperienceEndTime()) >= 0){
throw new ServiceException("结束时间不能早于开始时间");
}
if (currentDate.before(request.getExperienceStartTime())){
leaseBaseInfoDO.setExperienceStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_85.getCode());
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_85.getCode());
}else if (currentDate.after(request.getExperienceStartTime()) || currentDate.before(request.getExperienceEndTime())){
leaseBaseInfoDO.setExperienceStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_90.getCode());
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_90.getCode());
}else {
throw new ServiceException("时间");
}
trainingExperienceMapper.insert(leaseBaseInfoDO);
LineInfoDO lineInfoDO = new LineInfoDO();
lineInfoDO.setWorkflowSubStage(WorkflowSubStageEnum.STORE_EXPERIENCE.getCode());
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_85.getCode());
lineInfoDO.setId(request.getLineId());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
return true;
@@ -85,13 +86,18 @@ public class TrainingExperienceServiceImpl extends LineFlowService implements Tr
@Transactional(rollbackFor = Exception.class)
public void experienceStatusChange(Long lineId, Integer status, String abandonCause) {
trainingExperienceMapper.updateStatus(lineId,status,abandonCause);
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(lineId);
if (ExperienceStatusEnum.DONE.getExperienceStatus().equals(status)){
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(lineId);
if (Objects.isNull(lineInfoDO)){
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
}
lineInfoDO.setWorkflowSubStage(WorkflowSubStageEnum.SECOND_INTERVIEWS.getCode());
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_100.getCode());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
}else {
lineInfoDO.setWorkflowSubStage(WorkflowSubStageEnum.STORE_EXPERIENCE.getCode());
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_95.getCode());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
}
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.service.impl;
import cn.hutool.core.util.StrUtil;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.RegionAreaConfigDao;
import com.cool.store.entity.*;
@@ -86,19 +87,23 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
}
}
Long warRegionId = regionAreaConfigDao.getByWantShopAreaId(wantShopAreaId);
if(warRegionId == null){
return fillDefaultUser(userRoleEnum);
}
// 查找有战区权限的人
List<String> authWarRegionUserIdList = authWarRegionUser(warRegionId);
if(CollectionUtils.isEmpty(authWarRegionUserIdList)){
return null;
return fillDefaultUser(userRoleEnum);
}
Long roleId = userRoleEnum.getCode();
List<String> hasRoleUserIdList = sysRoleMapper.getPositionUserIds(Collections.singletonList(String.valueOf(roleId)));
if(UserRoleEnum.INVESTMENT_MANAGER.equals(userRoleEnum) && CollectionUtils.isEmpty(hasRoleUserIdList)){
// 找大区经理 找不到找战区经理,再找不到找大区经理?
roleId = UserRoleEnum.REGION_MANAGER.getCode();
hasRoleUserIdList = sysRoleMapper.getPositionUserIds(Collections.singletonList(String.valueOf(roleId)));
if(CollectionUtils.isEmpty(hasRoleUserIdList)){
return fillDefaultUser(userRoleEnum);
}
authWarRegionUserIdList.retainAll(hasRoleUserIdList);
if(CollectionUtils.isEmpty(authWarRegionUserIdList)){
return fillDefaultUser(userRoleEnum);
}
if(UserRoleEnum.INVESTMENT_MANAGER.equals(userRoleEnum)){
// 按工号排序后放入redis
redisUtilPool.listPushTail(investmentManagerKey, authWarRegionUserIdList.toArray(new String[authWarRegionUserIdList.size()]));
@@ -110,6 +115,14 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
return userDO;
}
private EnterpriseUserDO fillDefaultUser(UserRoleEnum userRoleEnum) {
if(UserRoleEnum.INVESTMENT_MANAGER.equals(userRoleEnum)){
EnterpriseUserDO defaultUser = enterpriseUserDAO.getUserInfoByJobnumber(CommonConstants.DEAULT_INVESTMENT_JOBNUMBER);
return defaultUser;
}
return null;
}
@Override
public Map<String, List<String>> getUserIdByRoleIdAndRegionId(List<String> roleIds, Long regionId) {
if(CollectionUtils.isEmpty(roleIds) || Objects.isNull(regionId)){