Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -149,5 +149,7 @@ public class CommonConstants {
|
||||
|
||||
public static final Long LONG_ONE = 1L;
|
||||
|
||||
public static final String DEAULT_INVESTMENT_JOBNUMBER = "020125244825417786";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,13 @@ public class EnterpriseUserDAO {
|
||||
return enterpriseUserMapper.getUserInfoById( userId);
|
||||
}
|
||||
|
||||
public EnterpriseUserDO getUserInfoByJobnumber(String jobnumber){
|
||||
if(StringUtils.isAnyBlank(jobnumber)){
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserMapper.getUserInfoByJobnumber(jobnumber);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> getUserInfoByUserIds(List<String> userIdList){
|
||||
if(CollectionUtils.isEmpty(userIdList)){
|
||||
return Lists.newArrayList();
|
||||
|
||||
@@ -19,6 +19,9 @@ public interface EnterpriseUserMapper {
|
||||
*/
|
||||
EnterpriseUserDO getUserInfoById(@Param("userId") String userId);
|
||||
|
||||
EnterpriseUserDO getUserInfoByJobnumber(@Param("jobnumber") String jobnumber);
|
||||
|
||||
|
||||
/**
|
||||
* 批量获取用户信息
|
||||
* @param userIdList
|
||||
|
||||
@@ -41,6 +41,16 @@
|
||||
user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="getUserInfoByJobnumber" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from
|
||||
enterprise_user_${enterpriseId}
|
||||
where
|
||||
jobnumber = #{jobnumber}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getUserInfoByUserIds" resultMap="BaseResultMap">
|
||||
select
|
||||
|
||||
@@ -41,7 +41,7 @@ public class OpenAreaVO {
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
private String updateTime;
|
||||
|
||||
@ApiModelProperty("更新人")
|
||||
private String updateUserId;
|
||||
|
||||
@@ -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 目前写死为进入私海
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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)){
|
||||
|
||||
@@ -64,7 +64,7 @@ public class OpenAreaController {
|
||||
@PostMapping(path = "/changeOpenAreaStatus")
|
||||
@ApiOperation("变更开放区域状态")
|
||||
public ResponseResult<Boolean> changeOpenAreaStatus(@RequestBody OpenAreaRequest openAreaRequest){
|
||||
String userId = "";
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
return ResponseResult.success(openAreaService.batchUpdate( userId, openAreaRequest));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user