fix 测量阶段和设计阶段待办
This commit is contained in:
@@ -2,7 +2,9 @@ package com.cool.store.dao;
|
|||||||
|
|
||||||
import com.cool.store.entity.DecorationDesignInfoDO;
|
import com.cool.store.entity.DecorationDesignInfoDO;
|
||||||
import com.cool.store.mapper.DecorationDesignInfoMapper;
|
import com.cool.store.mapper.DecorationDesignInfoMapper;
|
||||||
|
import com.cool.store.vo.desk.PreparationCommonPendingVO;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
import tk.mybatis.mapper.entity.Example;
|
import tk.mybatis.mapper.entity.Example;
|
||||||
|
|
||||||
@@ -51,6 +53,13 @@ public class DecorationDesignInfoDAO {
|
|||||||
return decorationDesignInfoMapper.selectByShopId(shopId);
|
return decorationDesignInfoMapper.selectByShopId(shopId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据报价员人员id和店铺阶段 SHOP_SUB_STAGE_STATUS_901 查询店铺信息
|
||||||
|
public List<PreparationCommonPendingVO> getByQuotationUserIdAndShopStage(String userId){
|
||||||
|
if(userId == null){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return decorationDesignInfoMapper.getByQuotationUserIdAndShopStage(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.cool.store.dao;
|
|||||||
import com.cool.store.entity.DecorationDesignInfoDO;
|
import com.cool.store.entity.DecorationDesignInfoDO;
|
||||||
import com.cool.store.entity.DecorationMeasureDO;
|
import com.cool.store.entity.DecorationMeasureDO;
|
||||||
import com.cool.store.mapper.DecorationMeasureMapper;
|
import com.cool.store.mapper.DecorationMeasureMapper;
|
||||||
|
import com.cool.store.utils.StringUtil;
|
||||||
|
import com.cool.store.vo.desk.PreparationCommonPendingVO;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
import tk.mybatis.mapper.entity.Example;
|
import tk.mybatis.mapper.entity.Example;
|
||||||
@@ -59,4 +61,17 @@ public class DecorationMeasureDAO {
|
|||||||
return decorationMeasureMapper.selectByShopId(shopId);
|
return decorationMeasureMapper.selectByShopId(shopId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<PreparationCommonPendingVO> getByMeasureUserIdAndShopStage(String measureUserId){
|
||||||
|
if (StringUtil.isBlank(measureUserId)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return decorationMeasureMapper.selectByMeasureUserIdAndShopStage(measureUserId);
|
||||||
|
}
|
||||||
|
//根据设计师和阶段900 查询 店铺id
|
||||||
|
public List<PreparationCommonPendingVO> getShopIdListByDesignUserIdAndShopStage(String userId) {
|
||||||
|
if (StringUtil.isBlank(userId)){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return decorationMeasureMapper.getShopIdListByDesignUserIdAndShopStage(userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
package com.cool.store.mapper;
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
import com.cool.store.entity.DecorationDesignInfoDO;
|
import com.cool.store.entity.DecorationDesignInfoDO;
|
||||||
|
import com.cool.store.vo.desk.PreparationCommonPendingVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import tk.mybatis.mapper.common.Mapper;
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface DecorationDesignInfoMapper extends Mapper<DecorationDesignInfoDO> {
|
public interface DecorationDesignInfoMapper extends Mapper<DecorationDesignInfoDO> {
|
||||||
|
|
||||||
|
|
||||||
@@ -13,4 +17,6 @@ public interface DecorationDesignInfoMapper extends Mapper<DecorationDesignInfoD
|
|||||||
*/
|
*/
|
||||||
DecorationDesignInfoDO selectByShopId(Long shopId);
|
DecorationDesignInfoDO selectByShopId(Long shopId);
|
||||||
|
|
||||||
|
List<PreparationCommonPendingVO> getByQuotationUserIdAndShopStage(@Param("userId") String userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
package com.cool.store.mapper;
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
import com.cool.store.entity.DecorationMeasureDO;
|
import com.cool.store.entity.DecorationMeasureDO;
|
||||||
|
import com.cool.store.vo.desk.PreparationCommonPendingVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import tk.mybatis.mapper.common.Mapper;
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface DecorationMeasureMapper extends Mapper<DecorationMeasureDO> {
|
public interface DecorationMeasureMapper extends Mapper<DecorationMeasureDO> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,4 +17,7 @@ public interface DecorationMeasureMapper extends Mapper<DecorationMeasureDO> {
|
|||||||
*/
|
*/
|
||||||
DecorationMeasureDO selectByShopId(Long shopId);
|
DecorationMeasureDO selectByShopId(Long shopId);
|
||||||
|
|
||||||
|
List<PreparationCommonPendingVO> selectByMeasureUserIdAndShopStage(@Param("measureUserId") String measureUserId);
|
||||||
|
|
||||||
|
List<PreparationCommonPendingVO> getShopIdListByDesignUserIdAndShopStage(@Param("userId") String userId);
|
||||||
}
|
}
|
||||||
@@ -33,10 +33,29 @@
|
|||||||
*
|
*
|
||||||
from xfsg_decoration_design_info where shop_id = #{shopId} and deleted = 0
|
from xfsg_decoration_design_info where shop_id = #{shopId} and deleted = 0
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getByQuotationUserIdAndShopStage" resultType="com.cool.store.vo.desk.PreparationCommonPendingVO">
|
||||||
|
select
|
||||||
|
c.shop_name as storeName,
|
||||||
|
c.shop_code as ShopCode,
|
||||||
|
c.shop_address as shopAddress,
|
||||||
|
c.investment_manager as investmentManagerId,
|
||||||
|
c.id as shopId,
|
||||||
|
c.line_id as lineId,
|
||||||
|
c.region_id as regionId,
|
||||||
|
c.store_type as storeType,
|
||||||
|
b.shop_stage as stage,
|
||||||
|
b.shop_sub_stage as subStage,
|
||||||
|
b.shop_sub_stage_status as subStageStatus,
|
||||||
|
b.update_time as updateTime
|
||||||
|
|
||||||
|
from xfsg_decoration_design_info a
|
||||||
|
left join xfsg_shop_stage_info b on a.shop_id = b.shop_id
|
||||||
|
left join xfsg_shop_info c on a.shop_id = c.id
|
||||||
|
where a.quotation_user_id = #{userId}
|
||||||
|
and b.shop_sub_stage_status = 901
|
||||||
|
and c.deleted = 0
|
||||||
|
order by b.update_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,32 +1,80 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.cool.store.mapper.DecorationMeasureMapper">
|
<mapper namespace="com.cool.store.mapper.DecorationMeasureMapper">
|
||||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.DecorationMeasureDO">
|
<resultMap id="BaseResultMap" type="com.cool.store.entity.DecorationMeasureDO">
|
||||||
<!--
|
<!--
|
||||||
WARNING - @mbg.generated
|
WARNING - @mbg.generated
|
||||||
-->
|
-->
|
||||||
<id column="id" jdbcType="BIGINT" property="id" />
|
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||||
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
|
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
|
||||||
<result column="measure_user_id" jdbcType="VARCHAR" property="measureUserId" />
|
<result column="measure_user_id" jdbcType="VARCHAR" property="measureUserId"/>
|
||||||
<result column="design_user_id" jdbcType="VARCHAR" property="designUserId" />
|
<result column="design_user_id" jdbcType="VARCHAR" property="designUserId"/>
|
||||||
<result column="measure_date" jdbcType="TIMESTAMP" property="measureDate" />
|
<result column="measure_date" jdbcType="TIMESTAMP" property="measureDate"/>
|
||||||
<result column="diagram_date" jdbcType="TIMESTAMP" property="diagramDate" />
|
<result column="diagram_date" jdbcType="TIMESTAMP" property="diagramDate"/>
|
||||||
<result column="measure_url" jdbcType="VARCHAR" property="measureUrl" />
|
<result column="measure_url" jdbcType="VARCHAR" property="measureUrl"/>
|
||||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
||||||
<result column="submit_time" jdbcType="TIMESTAMP" property="submitTime" />
|
<result column="submit_time" jdbcType="TIMESTAMP" property="submitTime"/>
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
<result column="deleted" jdbcType="BIT" property="deleted"/>
|
||||||
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
|
||||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="selectByShopId" resultMap="BaseResultMap">
|
<select id="selectByShopId" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
id,shop_id,measure_user_id,design_user_id,measure_date,diagram_date,measure_url,remark,
|
id,shop_id,measure_user_id,design_user_id,measure_date,diagram_date,measure_url,remark,
|
||||||
submit_time,create_time,update_time,deleted,create_user_id,update_user_id
|
submit_time,create_time,update_time,deleted,create_user_id,update_user_id
|
||||||
from xfsg_decoration_measure where shop_id = #{shopId} and deleted = 0
|
from xfsg_decoration_measure where shop_id = #{shopId} and deleted = 0
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectByMeasureUserIdAndShopStage"
|
||||||
|
resultType="com.cool.store.vo.desk.PreparationCommonPendingVO">
|
||||||
|
|
||||||
|
select
|
||||||
|
c.shop_name as storeName,
|
||||||
|
c.shop_code as ShopCode,
|
||||||
|
c.shop_address as shopAddress,
|
||||||
|
c.investment_manager as investmentManagerId,
|
||||||
|
c.id as shopId,
|
||||||
|
c.line_id as lineId,
|
||||||
|
c.region_id as regionId,
|
||||||
|
c.store_type as storeType,
|
||||||
|
b.shop_stage as stage,
|
||||||
|
b.shop_sub_stage as subStage,
|
||||||
|
b.shop_sub_stage_status as subStageStatus,
|
||||||
|
b.update_time as updateTime
|
||||||
|
|
||||||
|
from xfsg_decoration_measure a
|
||||||
|
left join xfsg_shop_stage_info b on a.shop_id = b.shop_id
|
||||||
|
left join xfsg_shop_info c on a.shop_id = c.id
|
||||||
|
where a.measure_user_id = #{measureUserId}
|
||||||
|
and b.shop_sub_stage_status = 892
|
||||||
|
and c.deleted = 0
|
||||||
|
order by b.update_time desc
|
||||||
|
</select>
|
||||||
|
<select id="getShopIdListByDesignUserIdAndShopStage" resultType="com.cool.store.vo.desk.PreparationCommonPendingVO">
|
||||||
|
select
|
||||||
|
c.shop_name as storeName,
|
||||||
|
c.shop_code as ShopCode,
|
||||||
|
c.shop_address as shopAddress,
|
||||||
|
c.investment_manager as investmentManagerId,
|
||||||
|
c.id as shopId,
|
||||||
|
c.line_id as lineId,
|
||||||
|
c.region_id as regionId,
|
||||||
|
c.store_type as storeType,
|
||||||
|
b.shop_stage as stage,
|
||||||
|
b.shop_sub_stage as subStage,
|
||||||
|
b.shop_sub_stage_status as subStageStatus,
|
||||||
|
b.update_time as updateTime
|
||||||
|
|
||||||
|
from xfsg_decoration_measure a
|
||||||
|
left join xfsg_shop_stage_info b on a.shop_id = b.shop_id
|
||||||
|
left join xfsg_shop_info c on a.shop_id = c.id
|
||||||
|
where a.design_user_id = #{userId}
|
||||||
|
and b.shop_sub_stage_status = 900
|
||||||
|
and c.deleted = 0
|
||||||
|
order by b.update_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -3,6 +3,8 @@ package com.cool.store.vo.desk;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author suzhuhong
|
* @Author suzhuhong
|
||||||
* @Date 2024/5/7 10:48
|
* @Date 2024/5/7 10:48
|
||||||
@@ -21,6 +23,8 @@ public class PreparationCommonPendingVO {
|
|||||||
private String shopAddress;
|
private String shopAddress;
|
||||||
@ApiModelProperty("督导")
|
@ApiModelProperty("督导")
|
||||||
private String investmentManager;
|
private String investmentManager;
|
||||||
|
@ApiModelProperty("督导id")
|
||||||
|
private String investmentManagerId;
|
||||||
@ApiModelProperty("加盟商名称")
|
@ApiModelProperty("加盟商名称")
|
||||||
private String partnerName;
|
private String partnerName;
|
||||||
@ApiModelProperty("手机号")
|
@ApiModelProperty("手机号")
|
||||||
@@ -39,5 +43,9 @@ public class PreparationCommonPendingVO {
|
|||||||
private Long shopId;
|
private Long shopId;
|
||||||
@ApiModelProperty("提交时间")
|
@ApiModelProperty("提交时间")
|
||||||
private String submitTime;
|
private String submitTime;
|
||||||
|
@ApiModelProperty("门店类型")
|
||||||
|
private Integer storeType;
|
||||||
|
private Long regionId;
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ import static com.cool.store.utils.poi.DateUtils.YYYY_MM_DD_HH_MM_SS;
|
|||||||
@Service
|
@Service
|
||||||
public class DeskServiceImpl implements DeskService {
|
public class DeskServiceImpl implements DeskService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
DecorationMeasureDAO decorationMeasureDAO;
|
||||||
@Resource
|
@Resource
|
||||||
LineInfoDAO lineInfoDAO;
|
LineInfoDAO lineInfoDAO;
|
||||||
@Resource
|
@Resource
|
||||||
@@ -391,24 +393,55 @@ public class DeskServiceImpl implements DeskService {
|
|||||||
public PageInfo<PreparationCommonPendingVO> designPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
public PageInfo<PreparationCommonPendingVO> designPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||||
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
|
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
|
||||||
List<Integer> subStageStatusList = new ArrayList<>();
|
List<Integer> subStageStatusList = new ArrayList<>();
|
||||||
if (userRoleIds.contains(UserRoleEnum.HEAD_OF_DESIGN.getCode())) {
|
//报价员和管理员不指定人,看阶段符合的全部数据
|
||||||
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90.getShopSubStageStatus());
|
|
||||||
}
|
|
||||||
if (userRoleIds.contains(UserRoleEnum.DESIGN_CUSTOMER.getCode())) {
|
|
||||||
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_901.getShopSubStageStatus());
|
|
||||||
}
|
|
||||||
if (userRoleIds.contains(UserRoleEnum.QUOTATION_OFFICE.getCode())) {
|
|
||||||
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_902.getShopSubStageStatus());
|
|
||||||
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_903.getShopSubStageStatus());
|
|
||||||
}
|
|
||||||
Boolean isAdmin = sysRoleService.checkIsAdmin(user.getUserId());
|
Boolean isAdmin = sysRoleService.checkIsAdmin(user.getUserId());
|
||||||
if (isAdmin) {
|
if (userRoleIds.contains(UserRoleEnum.QUOTATION_OFFICE.getCode()) || isAdmin) {
|
||||||
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90.getShopSubStageStatus());
|
|
||||||
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_901.getShopSubStageStatus());
|
|
||||||
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_902.getShopSubStageStatus());
|
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_902.getShopSubStageStatus());
|
||||||
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_903.getShopSubStageStatus());
|
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_903.getShopSubStageStatus());
|
||||||
|
if (isAdmin) {
|
||||||
|
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90.getShopSubStageStatus());
|
||||||
|
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_901.getShopSubStageStatus());
|
||||||
|
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_902.getShopSubStageStatus());
|
||||||
|
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_903.getShopSubStageStatus());
|
||||||
|
}
|
||||||
|
return commonPendingVOPageInfo(pageNum, pageSize, isAdmin ? null : user, ShopSubStageEnum.SHOP_STAGE_9, subStageStatusList, isAdmin ? Boolean.FALSE : Boolean.TRUE);
|
||||||
|
} else {
|
||||||
|
List<PreparationCommonPendingVO> list = new ArrayList<>();
|
||||||
|
if (userRoleIds.contains(UserRoleEnum.HEAD_OF_DESIGN.getCode())) {
|
||||||
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
list = decorationMeasureDAO.getShopIdListByDesignUserIdAndShopStage(user.getUserId());
|
||||||
|
}
|
||||||
|
if (userRoleIds.contains(UserRoleEnum.DESIGN_CUSTOMER.getCode())) {
|
||||||
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
list = decorationDesignInfoDAO.getByQuotationUserIdAndShopStage(user.getUserId());
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return new PageInfo<>();
|
||||||
|
}
|
||||||
|
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||||
|
List<Long> lineIds = list.stream().map(PreparationCommonPendingVO::getLineId).collect(Collectors.toList());
|
||||||
|
List<LineInfoDO> lineInfoDOS = lineInfoDAO.getByLineIds(lineIds);
|
||||||
|
Map<Long, LineInfoDO> lineMap = lineInfoDOS.stream().collect(Collectors.toMap(LineInfoDO::getId, line -> line));
|
||||||
|
|
||||||
|
Set<Long> regionIdSet = list.stream().map(PreparationCommonPendingVO::getRegionId).collect(Collectors.toSet());
|
||||||
|
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(new ArrayList<>(regionIdSet));
|
||||||
|
|
||||||
|
Set<String> investmentManagerIds = list.stream().map(PreparationCommonPendingVO::getInvestmentManager).collect(Collectors.toSet());
|
||||||
|
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(new ArrayList<>(investmentManagerIds));
|
||||||
|
|
||||||
|
for (PreparationCommonPendingVO preparationCommonPendingVO : list) {
|
||||||
|
LineInfoDO lineInfoDO = lineMap.get(preparationCommonPendingVO.getLineId());
|
||||||
|
if (lineInfoDO == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
preparationCommonPendingVO.setPartnerName(lineInfoDO.getUsername());
|
||||||
|
preparationCommonPendingVO.setPartnerPhone(lineInfoDO.getMobile());
|
||||||
|
preparationCommonPendingVO.setRegionNodeName(regionNameMap.getOrDefault(preparationCommonPendingVO.getRegionId(), ""));
|
||||||
|
preparationCommonPendingVO.setInvestmentManager(userNameMap.getOrDefault(preparationCommonPendingVO.getInvestmentManager(), ""));
|
||||||
|
preparationCommonPendingVO.setSubmitTime(DateUtils.parseDateToStr(SPECIAL_DATE_START, preparationCommonPendingVO.getUpdateTime()));
|
||||||
|
}
|
||||||
|
return new PageInfo<>(list);
|
||||||
}
|
}
|
||||||
return commonPendingVOPageInfo(pageNum, pageSize, isAdmin ? null : user, ShopSubStageEnum.SHOP_STAGE_9, subStageStatusList, isAdmin ? Boolean.FALSE : Boolean.TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -535,18 +568,47 @@ public class DeskServiceImpl implements DeskService {
|
|||||||
public PageInfo<PreparationCommonPendingVO> measurePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
public PageInfo<PreparationCommonPendingVO> measurePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
|
||||||
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
|
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
|
||||||
List<Integer> subStageStatusList = new ArrayList<>();
|
List<Integer> subStageStatusList = new ArrayList<>();
|
||||||
if (userRoleIds.contains(UserRoleEnum.CONSTRUCTION_CUSTOMER.getCode())) {
|
Boolean isAdmin = sysRoleService.checkIsAdmin(user.getUserId());
|
||||||
|
if (userRoleIds.contains(UserRoleEnum.CONSTRUCTION_CUSTOMER.getCode()) || isAdmin) {
|
||||||
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_861.getShopSubStageStatus());
|
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_861.getShopSubStageStatus());
|
||||||
|
if (isAdmin) {
|
||||||
|
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_861.getShopSubStageStatus());
|
||||||
|
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_862.getShopSubStageStatus());
|
||||||
|
}
|
||||||
|
return commonPendingVOPageInfo(pageNum, pageSize, isAdmin ? null : user, ShopSubStageEnum.SHOP_STAGE_8_6, subStageStatusList, isAdmin ? Boolean.FALSE : Boolean.TRUE);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (userRoleIds.contains(UserRoleEnum.MEASURE_OFFICE.getCode())) {
|
if (userRoleIds.contains(UserRoleEnum.MEASURE_OFFICE.getCode())) {
|
||||||
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_862.getShopSubStageStatus());
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
List<PreparationCommonPendingVO> list = decorationMeasureDAO.getByMeasureUserIdAndShopStage(user.getUserId());
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return new PageInfo<>();
|
||||||
|
}
|
||||||
|
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||||
|
List<Long> lineIds = list.stream().map(PreparationCommonPendingVO::getLineId).collect(Collectors.toList());
|
||||||
|
List<LineInfoDO> lineInfoDOS = lineInfoDAO.getByLineIds(lineIds);
|
||||||
|
Map<Long, LineInfoDO> lineMap = lineInfoDOS.stream().collect(Collectors.toMap(LineInfoDO::getId, line -> line));
|
||||||
|
|
||||||
|
Set<Long> regionIdSet = list.stream().map(PreparationCommonPendingVO::getRegionId).collect(Collectors.toSet());
|
||||||
|
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(new ArrayList<>(regionIdSet));
|
||||||
|
|
||||||
|
Set<String> investmentManagerIds = list.stream().map(PreparationCommonPendingVO::getInvestmentManager).collect(Collectors.toSet());
|
||||||
|
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(new ArrayList<>(investmentManagerIds));
|
||||||
|
|
||||||
|
for (PreparationCommonPendingVO preparationCommonPendingVO : list) {
|
||||||
|
LineInfoDO lineInfoDO = lineMap.get(preparationCommonPendingVO.getLineId());
|
||||||
|
if (lineInfoDO == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
preparationCommonPendingVO.setPartnerName(lineInfoDO.getUsername());
|
||||||
|
preparationCommonPendingVO.setPartnerPhone(lineInfoDO.getMobile());
|
||||||
|
preparationCommonPendingVO.setRegionNodeName(regionNameMap.getOrDefault(preparationCommonPendingVO.getRegionId(), ""));
|
||||||
|
preparationCommonPendingVO.setInvestmentManager(userNameMap.getOrDefault(preparationCommonPendingVO.getInvestmentManager(), ""));
|
||||||
|
preparationCommonPendingVO.setSubmitTime(DateUtils.parseDateToStr(SPECIAL_DATE_START, preparationCommonPendingVO.getUpdateTime()));
|
||||||
|
}
|
||||||
|
return new PageInfo<>(list);
|
||||||
}
|
}
|
||||||
Boolean isAdmin = sysRoleService.checkIsAdmin(user.getUserId());
|
return new PageInfo<>();
|
||||||
if (isAdmin) {
|
|
||||||
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_861.getShopSubStageStatus());
|
|
||||||
subStageStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_862.getShopSubStageStatus());
|
|
||||||
}
|
|
||||||
return commonPendingVOPageInfo(pageNum, pageSize, isAdmin ? null : user, ShopSubStageEnum.SHOP_STAGE_8_6, subStageStatusList, isAdmin ? Boolean.FALSE : Boolean.TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user