修改时间问题统一时间戳

This commit is contained in:
shuo.wang
2024-05-22 13:33:11 +08:00
parent 407cb2ec3d
commit 82ad0602bb
14 changed files with 115 additions and 98 deletions

View File

@@ -5,11 +5,10 @@ import com.cool.store.dto.decoration.ConstructionScheduleDTO;
import com.cool.store.dto.decoration.DecorationModelDTO;
import com.cool.store.dto.decoration.ThreeAcceptanceDTO;
import com.cool.store.request.*;
import com.cool.store.response.FitmentResponse;
import com.cool.store.response.ThreeSignResponse;
import com.cool.store.vo.Fitment.DecorationStageVO;
import com.cool.store.vo.Fitment.DecorationModelVO;
import com.cool.store.vo.Fitment.DesignInfoVo;
import com.cool.store.vo.LinePayVO;
import com.cool.store.vo.PartnerUserInfoVO;
@@ -109,13 +108,13 @@ public interface DecorationService {
/**
* @Auther: wangshuo
* @Date: 2024/5/3
* @description:获取验收列表
* @description:获取三方验收列表
*/
PageInfo<fitmentCheckVO> getFitmentAcceptanceList(AcceptanceListRequest request, LoginUserInfo user);
/**
* @Auther: wangshuo
* @Date: 2024/5/11
* @description:获取验收列表详情
* @description:三方获取验收列表详情
*/
fitmentCheckVO getAcceptanceDetail(Long shopId, LoginUserInfo user);
}

View File

@@ -52,7 +52,13 @@ public interface UserAuthMappingService {
*/
EnterpriseUserDO getUserByRoleEnumAndRegionId(UserRoleEnum userRoleEnum, Long regionId);
/**
* 获取有区域权限和职位 所有人
* @param userRoleEnum
* @param regionId
* @return
*/
List<EnterpriseUserDO> getUserByRoleEnumAndRegionIdList(UserRoleEnum userRoleEnum, Long regionId);
/**
* 跟进角色和战区获取用户id
* @param roleIds

View File

@@ -18,7 +18,6 @@ import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.mapper.ShopInfoMapper;
import com.cool.store.request.*;
import com.cool.store.response.FitmentResponse;
import com.cool.store.response.ThreeSignResponse;
import com.cool.store.service.*;
@@ -26,7 +25,6 @@ import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.poi.StringUtils;
import com.cool.store.vo.AssessmentTemplateVO;
import com.cool.store.vo.Fitment.DecorationStageVO;
import com.cool.store.vo.Fitment.DecorationModelVO;
import com.cool.store.vo.Fitment.DesignInfoVo;
import com.cool.store.vo.LinePayVO;
import com.cool.store.vo.PartnerUserInfoVO;

View File

@@ -140,9 +140,9 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
List<PlanLineDTO> lineInfos = lineInfoDAO.getLines(lines);
Map<Long, PlanLineDTO> lineInfoMap = lineInfos.stream().collect(Collectors.toMap(PlanLineDTO::getLineId, dto -> dto));
for (OpenPlanShopInfoDTO openPlanShopInfoDTO : openPlanShopInfoDTOS) {
openPlanShopInfoDTO.setPartnerName(lineInfoMap.get(openPlanShopInfoDTO.getLineId()).getUsername());
openPlanShopInfoDTO.setMobile(lineInfoMap.get(openPlanShopInfoDTO.getLineId()).getMobile());
openPlanShopInfoDTO.setInvestmentManagerId(lineInfoMap.get(openPlanShopInfoDTO.getLineId()).getInvestmentManagerId());
openPlanShopInfoDTO.setPartnerName(lineInfoMap.getOrDefault(openPlanShopInfoDTO.getLineId(),new PlanLineDTO()).getUsername());
openPlanShopInfoDTO.setMobile(lineInfoMap.getOrDefault(openPlanShopInfoDTO.getLineId(),new PlanLineDTO()).getMobile());
openPlanShopInfoDTO.setInvestmentManagerId(lineInfoMap.getOrDefault(openPlanShopInfoDTO.getLineId(),new PlanLineDTO()).getInvestmentManagerId());
}
PageInfo pageInfo = new PageInfo<>(openPlanShopInfoDTOS);
//开店负责人id督导id,招商经理id //
@@ -177,7 +177,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
openingOperationPlanListVO.setInvestmentManagerName
(vonameMap.get(x.getInvestmentManagerId()));
openingOperationPlanListVO.setShopManagerName
(vonameMap.get(x.getInvestmentManagerId()));
(vonameMap.get(x.getShopManagerUserId()));
openingOperationPlanListVO.setSupervisorName(
vonameMap.get(x.getSupervisorUserId()));
openingOperationPlanListVO.setSubmissionTime(x.getSubmissionTime());

View File

@@ -29,6 +29,7 @@ import java.util.stream.Collectors;
/**
* describe:
*
* @author wxp
* @date 2020/11/11
*/
@@ -59,35 +60,35 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
@Override
public List<UserAuthMappingDO> listUserAuthMappingByUserId(String userId) {
if(StringUtils.isBlank(userId)){
if (StringUtils.isBlank(userId)) {
return Lists.newArrayList();
}
return userAuthMappingMapper.listUserAuthMappingByUserId(userId);
}
@Override
public List<String> getAuthRegionIdAndSubRegionIdByUserId(String userId){
public List<String> getAuthRegionIdAndSubRegionIdByUserId(String userId) {
List<UserAuthMappingDO> userAuthMapping = listUserAuthMappingByUserId(userId);
if(CollectionUtils.isEmpty(userAuthMapping)){
if (CollectionUtils.isEmpty(userAuthMapping)) {
return Lists.newArrayList();
}
List<String> regionIds = userAuthMapping.stream().map(UserAuthMappingDO::getMappingId).collect(Collectors.toList());
List<String> subRegionIds = regionMapper.getSubRegionIdsByRegionIds(regionIds);
if(CollectionUtils.isNotEmpty(subRegionIds)){
if (CollectionUtils.isNotEmpty(subRegionIds)) {
regionIds.addAll(subRegionIds);
}
return regionIds;
}
@Override
public List<String> getAuthStoreIdAndSubRegionIdByUserId(String userId){
public List<String> getAuthStoreIdAndSubRegionIdByUserId(String userId) {
List<UserAuthMappingDO> userAuthMapping = listUserAuthMappingByUserId(userId);
if(CollectionUtils.isEmpty(userAuthMapping)){
if (CollectionUtils.isEmpty(userAuthMapping)) {
return Lists.newArrayList();
}
List<String> regionIds = userAuthMapping.stream().map(UserAuthMappingDO::getMappingId).collect(Collectors.toList());
List<String> subRegionIds = regionMapper.getStoreIdsByRegionIds(regionIds);
if(CollectionUtils.isNotEmpty(subRegionIds)){
if (CollectionUtils.isNotEmpty(subRegionIds)) {
regionIds.addAll(subRegionIds);
}
return regionIds;
@@ -95,6 +96,7 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
/**
* 提供 根据职位 意向区域 查 对应人的接口 同时返回人名字
*
* @param userRoleEnum
* @param wantShopAreaId
* @return
@@ -102,31 +104,31 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
@Override
public EnterpriseUserDO getUserByRoleEnumAndWantShopAreaId(UserRoleEnum userRoleEnum, Long wantShopAreaId) {
log.info("getUserByRoleEnumAndAreaId{}wantShopAreaId{}", userRoleEnum, wantShopAreaId);
if(Objects.isNull(userRoleEnum) || Objects.isNull(wantShopAreaId)){
if (Objects.isNull(userRoleEnum) || Objects.isNull(wantShopAreaId)) {
return null;
}
String investmentManagerKey = redisConstantUtil.getInvestmentManagerKey(wantShopAreaId, userRoleEnum.getCode());
String suitableUserId = redisUtilPool.rpopStr(investmentManagerKey);
if(StringUtils.isNotBlank(suitableUserId)){
if (StringUtils.isNotBlank(suitableUserId)) {
EnterpriseUserDO userDO = enterpriseUserDAO.getUserInfoById(suitableUserId);
return userDO;
}
Long warRegionId = regionAreaConfigDao.getByWantShopAreaId(wantShopAreaId);
if(warRegionId == null){
if (warRegionId == null) {
return fillDefaultUser(userRoleEnum);
}
// 查找有战区权限的人
List<String> authWarRegionUserIdList = authWarRegionUser(warRegionId);
if(CollectionUtils.isEmpty(authWarRegionUserIdList)){
if (CollectionUtils.isEmpty(authWarRegionUserIdList)) {
return fillDefaultUser(userRoleEnum);
}
Long roleId = userRoleEnum.getCode();
List<String> hasRoleUserIdList = sysRoleMapper.getPositionUserIds(Collections.singletonList(String.valueOf(roleId)));
if(CollectionUtils.isEmpty(hasRoleUserIdList)){
if (CollectionUtils.isEmpty(hasRoleUserIdList)) {
return fillDefaultUser(userRoleEnum);
}
authWarRegionUserIdList.retainAll(hasRoleUserIdList);
if(CollectionUtils.isEmpty(authWarRegionUserIdList)){
if (CollectionUtils.isEmpty(authWarRegionUserIdList)) {
return fillDefaultUser(userRoleEnum);
}
authWarRegionUserIdList = authWarRegionUserIdList.stream()
@@ -140,6 +142,7 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
/**
* 获取有区域权限和职位 的人
*
* @param userRoleEnum
* @param regionId
* @return
@@ -148,37 +151,60 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
public EnterpriseUserDO getUserByRoleEnumAndRegionId(UserRoleEnum userRoleEnum, Long regionId) {
// 查找有区域权限的人
List<String> authRegionUserIdList = authWarRegionUser(regionId);
if(CollectionUtils.isEmpty(authRegionUserIdList)){
if (CollectionUtils.isEmpty(authRegionUserIdList)) {
return null;
}
Long roleId = userRoleEnum.getCode();
List<String> hasRoleUserIdList = sysRoleMapper.getPositionUserIds(Collections.singletonList(String.valueOf(roleId)));
if(CollectionUtils.isEmpty(hasRoleUserIdList)){
if (CollectionUtils.isEmpty(hasRoleUserIdList)) {
return null;
}
authRegionUserIdList.retainAll(hasRoleUserIdList);
if(CollectionUtils.isEmpty(authRegionUserIdList)){
if (CollectionUtils.isEmpty(authRegionUserIdList)) {
return null;
}
if(CollectionUtils.isNotEmpty(authRegionUserIdList)){
if (CollectionUtils.isNotEmpty(authRegionUserIdList)) {
EnterpriseUserDO userDO = enterpriseUserDAO.getUserInfoById(authRegionUserIdList.get(0));
return userDO;
}
return null;
}
@Override
public List<EnterpriseUserDO> getUserByRoleEnumAndRegionIdList(UserRoleEnum userRoleEnum, Long regionId) {
// 查找有区域权限的人
List<String> authRegionUserIdList = authWarRegionUser(regionId);
if (CollectionUtils.isEmpty(authRegionUserIdList)) {
return null;
}
Long roleId = userRoleEnum.getCode();
List<String> hasRoleUserIdList = sysRoleMapper.getPositionUserIds(Collections.singletonList(String.valueOf(roleId)));
if (CollectionUtils.isEmpty(hasRoleUserIdList)) {
return null;
}
authRegionUserIdList.retainAll(hasRoleUserIdList);
if (CollectionUtils.isEmpty(authRegionUserIdList)) {
return null;
}
if (CollectionUtils.isNotEmpty(authRegionUserIdList)) {
return enterpriseUserDAO.getUserInfoByUserIds(authRegionUserIdList);
}
return null;
}
private EnterpriseUserDO fillDefaultUser(UserRoleEnum userRoleEnum) {
// 如果找不到招商专员,则分配给默认的招商经理
if(UserRoleEnum.INVESTMENT_COMMISSIONER.equals(userRoleEnum)){
if (UserRoleEnum.INVESTMENT_COMMISSIONER.equals(userRoleEnum)) {
EnterpriseUserDO defaultUser = enterpriseUserDAO.getUserInfoByJobnumber(CommonConstants.DEAULT_INVESTMENT_JOBNUMBER);
if(defaultUser == null){
if (defaultUser == null) {
defaultUser = enterpriseUserDAO.getUserInfoById(CommonConstants.DEAULT_INVESTMENT_JOBNUMBER);
}
return defaultUser;
}else if(UserRoleEnum.SELECT_SITE_COMMISSIONER.equals(userRoleEnum)){
} else if (UserRoleEnum.SELECT_SITE_COMMISSIONER.equals(userRoleEnum)) {
// 如果找不到选址专员,则分配给默认的选址经理
EnterpriseUserDO defaultUser = enterpriseUserDAO.getUserInfoByJobnumber(CommonConstants.DEAULT_SELECT_SITE_MANAGER);
if(defaultUser == null){
if (defaultUser == null) {
defaultUser = enterpriseUserDAO.getUserInfoById(CommonConstants.DEAULT_SELECT_SITE_MANAGER);
}
return defaultUser;
@@ -188,27 +214,28 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
@Override
public Map<String, List<String>> getUserIdByRoleIdAndRegionId(List<String> roleIds, Long regionId) {
if(CollectionUtils.isEmpty(roleIds) || Objects.isNull(regionId)){
if (CollectionUtils.isEmpty(roleIds) || Objects.isNull(regionId)) {
return Maps.newHashMap();
}
RegionDO regionDO = regionMapper.getByRegionId(regionId);
if(regionDO == null){
if (regionDO == null) {
throw new ServiceException(ErrorCodeEnum.REGION_NOT_EXIST);
}
// 查找有区域权限的人
List<String> authRegionUserIdList = authWarRegionUser(regionId);
if(CollectionUtils.isEmpty(authRegionUserIdList)){
if (CollectionUtils.isEmpty(authRegionUserIdList)) {
return Maps.newHashMap();
}
List<Long> roleIdList = roleIds.stream().map(a -> Long.valueOf(a)).collect(Collectors.toList());
List<EnterpriseUserRole> enterpriseUserRoleList = sysRoleMapper.getUserIdListByRoleIdList(roleIdList);
enterpriseUserRoleList = ListUtils.emptyIfNull(enterpriseUserRoleList).stream().filter(o -> authRegionUserIdList.contains(o.getUserId())).collect(Collectors.toList());
Map<String, List<String>> enterpriseUserRoleMap = ListUtils.emptyIfNull(enterpriseUserRoleList).stream().collect(Collectors.groupingBy(EnterpriseUserRole::getRoleId, Collectors.mapping(k->k.getUserId(), Collectors.toList())));
Map<String, List<String>> enterpriseUserRoleMap = ListUtils.emptyIfNull(enterpriseUserRoleList).stream().collect(Collectors.groupingBy(EnterpriseUserRole::getRoleId, Collectors.mapping(k -> k.getUserId(), Collectors.toList())));
return enterpriseUserRoleMap;
}
/**
* 根据 人 查 这个人管辖区域 对应的意向区域省市code 团队线索
*
* @param userId
* @return
*/
@@ -241,22 +268,22 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
// 查找有战区权限的人
public List<String> authWarRegionUser(Long warRegionId) {
List<String> result = new ArrayList<>();
if(Objects.isNull(warRegionId)){
if (Objects.isNull(warRegionId)) {
return result;
}
RegionDO regionDO = regionMapper.getByRegionId(warRegionId);
if(regionDO == null){
if (regionDO == null) {
throw new ServiceException(ErrorCodeEnum.REGION_NOT_EXIST);
}
//将拥有管理员角色、角色属性为全企业数据的人查询出来
List<SysRoleVO> roleUserByRoleId = sysRoleMapper.getRoleUserByRoleEnum(Role.MASTER.getRoleEnum(), null);
List<SysRoleVO> roleUserByRoleAuth = sysRoleMapper.getRoleUserByRoleAuth(AuthRoleEnum.ALL.getCode(), null);
//组合出拥有所有门店信息的人
List<String> allWarRegionUserIdList = getAllWarRegionAuthUserIdList(roleUserByRoleId, roleUserByRoleAuth);
List<String> allWarRegionUserIdList = getAllWarRegionAuthUserIdList(roleUserByRoleId, roleUserByRoleAuth);
//查询出有门店权限配置的的人员
// 1.将门店区域切分出门店所属于的区域ID
// 2.将配置了区域的人 查询出来
List<String> fullAreaIdList = StrUtil.splitTrim(regionDO.getRegionPath(),"/");
List<String> fullAreaIdList = StrUtil.splitTrim(regionDO.getRegionPath(), "/");
List<String> lastAreaIdList = Collections.singletonList(String.valueOf(regionDO.getId()));
//除不包含子区域的可视化范围的区域配置。
List<UserAuthMappingDO> regionUserAuthMappingList =
@@ -264,13 +291,13 @@ public class UserAuthMappingServiceImpl implements UserAuthMappingService {
//不包含子区域的的直属连接门店的区域下的配置(会重复一些选择了上面数据)
List<UserAuthMappingDO> notIncludeRegionUserAuthMappingList =
userAuthMappingMapper.listUserAuthMappingByAuth(UserAuthMappingTypeEnum.REGION.getCode(), lastAreaIdList, null, null);
List<String> authWarRegionUserIdList = mapAuthStoreUserDTO(regionUserAuthMappingList, allWarRegionUserIdList, notIncludeRegionUserAuthMappingList);
List<String> authWarRegionUserIdList = mapAuthStoreUserDTO(regionUserAuthMappingList, allWarRegionUserIdList, notIncludeRegionUserAuthMappingList);
return authWarRegionUserIdList;
}
private List<String> getAllWarRegionAuthUserIdList(List<SysRoleVO> roleUserByRoleId, List<SysRoleVO> roleUserByRoleAuth) {
List<String> allUserIdList= new ArrayList<>();
List<String> allUserIdList = new ArrayList<>();
List<String> masterUserList = ListUtils.emptyIfNull(roleUserByRoleId).stream()
.map(SysRoleVO::getEnterpriseDOs)
.flatMap(Collection::stream)