业务备注

This commit is contained in:
shuo.wang
2025-05-27 15:22:52 +08:00
parent c8504734f3
commit 9025ee6446
8 changed files with 309 additions and 28 deletions

View File

@@ -0,0 +1,75 @@
package com.cool.store.dao;
import com.cool.store.entity.ShopStageRemarkInfoDO;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.mapper.ShopStageRemarkInfoMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
import java.util.Objects;
/**
* @Author: WangShuo
* @Date: 2025/05/27/14:22
* @Version 1.0
* @注释:
*/
@Repository
public class ShopStageRemarkInfoDAO {
@Autowired
private ShopStageRemarkInfoMapper shopStageRemarkInfoMapper;
public Integer insertOrUpdate(ShopStageRemarkInfoDO shopStageRemarkInfoDO) {
if (shopStageRemarkInfoDO.getId() != null) {
return shopStageRemarkInfoMapper.updateByPrimaryKeySelective(shopStageRemarkInfoDO);
} else {
return shopStageRemarkInfoMapper.insertSelective(shopStageRemarkInfoDO);
}
}
public ShopStageRemarkInfoDO getByShopIdAndStage(Long shopId, Integer shopSubStageStatus) {
if (Objects.isNull(shopId) || Objects.isNull(shopSubStageStatus)){
return null;
}
Example example = new Example(ShopStageRemarkInfoDO.class);
example.createCriteria().andEqualTo("shopId", shopId).andEqualTo("shopSubStageStatus", shopSubStageStatus);
ShopStageRemarkInfoDO shopStageRemarkInfoDO = shopStageRemarkInfoMapper.selectOneByExample(example);
if (Objects.isNull(shopStageRemarkInfoDO)){
return new ShopStageRemarkInfoDO();
}
return shopStageRemarkInfoDO;
}
public ShopStageRemarkInfoDO getByLineIdAndStage(Long lineId, Integer workflowSubStageStatus) {
if (Objects.isNull(lineId) || Objects.isNull(workflowSubStageStatus)){
return null;
}
Example example = new Example(ShopStageRemarkInfoDO.class);
example.createCriteria().andEqualTo("lineId", lineId).andEqualTo("workflowSubStageStatus", workflowSubStageStatus);
ShopStageRemarkInfoDO shopStageRemarkInfoDO = shopStageRemarkInfoMapper.selectOneByExample(example);
if (Objects.isNull(shopStageRemarkInfoDO)){
return new ShopStageRemarkInfoDO();
}
return shopStageRemarkInfoDO;
}
public List<ShopStageRemarkInfoDO> getByShopIdsAndStage(List<Long> shopIds, List<Integer> shopSubStageStatusList) {
if (CollectionUtils.isEmpty(shopIds) || CollectionUtils.isEmpty(shopSubStageStatusList)){
return null;
}
Example example = new Example(ShopStageRemarkInfoDO.class);
example.createCriteria().andIn("shopId", shopIds).andIn("shopSubStageStatus", shopSubStageStatusList);
return shopStageRemarkInfoMapper.selectByExample(example);
}
public List<ShopStageRemarkInfoDO> getByLineIdsAndStage(List<Long> lineIds, List<Integer> workflowSubStageStatusList) {
if (CollectionUtils.isEmpty(lineIds) || CollectionUtils.isEmpty(workflowSubStageStatusList)){
return null;
}
Example example = new Example(ShopStageRemarkInfoDO.class);
example.createCriteria().andIn("lineId", lineIds).andIn("workflowSubStageStatus", workflowSubStageStatusList);
return shopStageRemarkInfoMapper.selectByExample(example);
}
}

View File

@@ -0,0 +1,14 @@
package com.cool.store.mapper;
import com.cool.store.entity.ShopStageRemarkInfoDO;
import tk.mybatis.mapper.common.Mapper;
/**
* @Author: WangShuo
* @Date: 2025/05/27/14:19
* @Version 1.0
* @注释:
*/
public interface ShopStageRemarkInfoMapper extends Mapper<ShopStageRemarkInfoDO> {
}

View File

@@ -0,0 +1,21 @@
<?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">
<!--mybatis-3-mapper.dtd:约束文件的名称限制和检查在当前文件中出现的标签和属性符合mybatis的要求-->
<!--namespace命名空间要有唯一的值要求使用dao接口的权限定名称一个dao接口对应一个mappernamespace指明对应哪个dao接口-->
<mapper namespace="com.cool.store.mapper.ShopStageRemarkInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopStageRemarkInfoDO">
<result column="id" property="id" jdbcType="BIGINT" />
<result column="shop_id" property="shopId" jdbcType="BIGINT" />
<result column="shop_sub_stage" property="shopSubStage" jdbcType="INTEGER" />
<result column="shop_sub_stage_status" property="shopSubStageStatus" jdbcType="INTEGER" />
<result column="line_id" property="lineId" jdbcType="BIGINT" />
<result column="workflow_sub_stage" property="workflowSubStage" jdbcType="INTEGER" />
<result column="workflow_sub_stage_status" property="workflowSubStageStatus" jdbcType="INTEGER" />
<result column="remark" property="remark" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="create_user_id" property="createUserId" jdbcType="VARCHAR" />
<result column="update_user_id" property="updateUserId" jdbcType="VARCHAR" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,52 @@
package com.cool.store.entity;
import lombok.Data;
import javax.persistence.*;
import java.util.Date;
/**
* 阶段注释表
*/
@Data
@Entity
@Table(name = "xfsg_shop_stage_remark_info")
public class ShopStageRemarkInfoDO {
@Id
@Column(name = "id")
private Long id;
@Column(name = "shop_id")
private Long shopId;
@Column(name = "shop_sub_stage")
private Integer shopSubStage;
@Column(name = "shop_sub_stage_status")
private Integer shopSubStageStatus;
@Column(name = "line_id")
private Long lineId;
@Column(name = "workflow_sub_stage")
private Integer workflowSubStage;
@Column(name = "workflow_sub_stage_status")
private Integer workflowSubStageStatus;
@Column(name = "remark")
private String remark;
@Column(name = "create_time")
private Date createTime;
@Column(name = "update_time")
private Date updateTime;
@Column(name = "create_user_id")
private String createUserId;
@Column(name = "update_user_id")
private String updateUserId;
}

View File

@@ -0,0 +1,28 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: WangShuo
* @Date: 2025/05/27/15:02
* @Version 1.0
* @注释:
*/
@Data
public class BusinessRemarkRequest {
@ApiModelProperty("使用-资质审核,意向金,意向协议")
private Long lineId;
@ApiModelProperty("使用-资质审核,意向金,意向协议:流程子阶段")
private Integer workflowSubStage;
@ApiModelProperty("使用-资质审核,意向金,意向协议:流程子阶段状态")
private Integer workflowSubStageStatus;
@ApiModelProperty("使用-除了资质审核意向金意向协议店铺id")
private Long shopId;
@ApiModelProperty("使用-除了资质审核,意向金,意向协议:子阶段")
private Integer subStage;
@ApiModelProperty("使用-除了资质审核,意向金,意向协议:阶段状态")
private Integer subStageStatus;
@ApiModelProperty("业务备注")
private String businessRemark;
}

View File

@@ -5,6 +5,7 @@ import com.cool.store.dto.InvestmentCountDTO;
import com.cool.store.dto.PendingCountDTO;
import com.cool.store.entity.HyPartnerLabelDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.request.BusinessRemarkRequest;
import com.cool.store.vo.BaseInfoVO;
import com.cool.store.vo.desk.*;
import com.github.pagehelper.PageInfo;
@@ -189,15 +190,17 @@ public interface DeskService {
/**
* 营业执照
*/
PageInfo<PreparationCommonPendingVO> businessLicensePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
PageInfo<PreparationCommonPendingVO> businessLicensePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user,String keyword);
/**
* 食品安全许可证
*/
PageInfo<PreparationCommonPendingVO> foodLicensePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
PageInfo<PreparationCommonPendingVO> foodLicensePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user,String keyword);
/**
* 京东外卖
*/
PageInfo<PreparationCommonPendingVO> JingDongPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user);
PageInfo<PreparationCommonPendingVO> JingDongPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user,String keyword);
Integer submitBusinessRemark(BusinessRemarkRequest request, LoginUserInfo user);
}

View File

@@ -8,14 +8,17 @@ import com.cool.store.dto.InvestmentCountDTO;
import com.cool.store.dto.PendingCountDTO;
import com.cool.store.dto.openPreparation.PlanLineDTO;
import com.cool.store.entity.*;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.UserRoleEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.point.PayBusinessTypeEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.EnterpriseUserRoleMapper;
import com.cool.store.mapper.IntentAgreementMapper;
import com.cool.store.mapper.TrainingExperienceMapper;
import com.cool.store.request.BusinessRemarkRequest;
import com.cool.store.service.DeskService;
import com.cool.store.service.RegionService;
import com.cool.store.service.SysRoleService;
@@ -40,6 +43,7 @@ import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import static com.cool.store.enums.WorkflowSubStageStatusEnum.INTENT_5;
import static com.cool.store.enums.point.ShopSubStageStatusEnum.*;
import static com.cool.store.utils.poi.DateUtils.SPECIAL_DATE_START;
import static com.cool.store.utils.poi.DateUtils.YYYY_MM_DD_HH_MM_SS;
@@ -92,15 +96,20 @@ public class DeskServiceImpl implements DeskService {
private AcceptanceInfoDAO acceptanceInfoDAO;
@Autowired
private PointInfoDAO pointInfoDAO;
@Autowired
private ShopStageRemarkInfoDAO shopStageRemarkInfoDAO;
@Override
public PageInfo<IntendPendingVO> intendPendingList(Integer pageNum, Integer pageSize, String userId,String keyword) {
PageHelper.startPage(pageNum, pageSize);
List<LineInfoDO> lineInfoDOS = lineInfoDAO.listByInvestmentManager(userId, Arrays.asList(WorkflowSubStageStatusEnum.INTENT_5.getCode()),keyword);
List<LineInfoDO> lineInfoDOS = lineInfoDAO.listByInvestmentManager(userId, Arrays.asList(INTENT_5.getCode()),keyword);
PageInfo page = new PageInfo(lineInfoDOS);
Map<Long, HyPartnerLabelDO> userPortraitMap = this.getUserPortraitMap(lineInfoDOS);
List<Long> wantShopAreaIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
Map<Long, String> wantShopAreaMap = hyOpenAreaInfoDAO.selectNameMapByIds(wantShopAreaIds);
List<Long> lineIds = lineInfoDOS.stream().map(LineInfoDO::getId).collect(Collectors.toList());
List<ShopStageRemarkInfoDO> remarkInfoDOList = shopStageRemarkInfoDAO.getByLineIdsAndStage(lineIds, Arrays.asList(INTENT_5.getCode()));
Map<Long, ShopStageRemarkInfoDO> remarkInfoMap = remarkInfoDOList.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getLineId, Function.identity()));
List<IntendPendingVO> list = new ArrayList<>();
lineInfoDOS.forEach(x -> {
BaseInfoVO baseInfoVO = convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
@@ -108,6 +117,7 @@ public class DeskServiceImpl implements DeskService {
intendPendingVO.setJoinTime(new Date());
intendPendingVO.setJoinMode(x.getJoinMode());
intendPendingVO.setUpdateTime(x.getUpdateTime());
intendPendingVO.setBusinessRemark(remarkInfoMap.getOrDefault(x.getId(), new ShopStageRemarkInfoDO()).getRemark());
list.add(intendPendingVO);
});
@@ -127,6 +137,9 @@ public class DeskServiceImpl implements DeskService {
List<Long> lineIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getId() != null).map(LineInfoDO::getId).collect(Collectors.toList());
Map<Long, LinePayDO> payMap = linePayDAO.getLinePayByLineIds(lineIds, PayBusinessTypeEnum.INTENT_MONEY.getCode());
List<PayStagePendingVO> list = new ArrayList<>();
List<ShopStageRemarkInfoDO> remarkInfoDOList = shopStageRemarkInfoDAO.getByLineIdsAndStage(lineIds, Arrays.asList(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode()));
Map<Long, ShopStageRemarkInfoDO> remarkInfoMap = remarkInfoDOList.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getLineId, Function.identity()));
lineInfoDOS.forEach(x -> {
BaseInfoVO baseInfoVO = convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
PayStagePendingVO payStagePendingVO = new PayStagePendingVO(baseInfoVO);
@@ -135,7 +148,7 @@ public class DeskServiceImpl implements DeskService {
payStagePendingVO.setPayTime(DateUtils.parseDateToStr(SPECIAL_DATE_START, linePayDO.getPayTime()));
}
payStagePendingVO.setUpdateTime(x.getUpdateTime());
payStagePendingVO.setBusinessRemark(remarkInfoMap.getOrDefault(x.getId(), new ShopStageRemarkInfoDO()).getRemark());
list.add(payStagePendingVO);
});
page.setList(list);
@@ -154,6 +167,8 @@ public class DeskServiceImpl implements DeskService {
List<Long> lineIds = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getId() != null).map(LineInfoDO::getId).collect(Collectors.toList());
List<SigningBaseInfoDO> signingBaseInfoDOS = intentAgreementMapper.selectByLineIds(lineIds);
Map<Long, Date> dateMap = signingBaseInfoDOS.stream().collect(Collectors.toMap(SigningBaseInfoDO::getLineId, SigningBaseInfoDO::getCreateTime));
List<ShopStageRemarkInfoDO> remarkInfoDOList = shopStageRemarkInfoDAO.getByLineIdsAndStage(lineIds, Arrays.asList(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_70.getCode()));
Map<Long, ShopStageRemarkInfoDO> remarkInfoMap = remarkInfoDOList.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getLineId, Function.identity()));
List<SigningPendingVO> list = new ArrayList<>();
lineInfoDOS.forEach(x -> {
BaseInfoVO baseInfoVO = convertToBaseInfoVO(x, userPortraitMap, wantShopAreaMap);
@@ -163,6 +178,7 @@ public class DeskServiceImpl implements DeskService {
signingPendingVO.setSubmitTime(DateUtils.parseDateToStr(SPECIAL_DATE_START, date));
}
signingPendingVO.setUpdateTime(x.getUpdateTime());
signingPendingVO.setBusinessRemark(remarkInfoMap.getOrDefault(x.getId(), new ShopStageRemarkInfoDO()).getRemark());
list.add(signingPendingVO);
});
page.setList(list);
@@ -247,7 +263,7 @@ public class DeskServiceImpl implements DeskService {
//督导代填
if (userRoleIds.contains(UserRoleEnum.QW_SUPERVISION.getCode()) || userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())) {
pageInfo = commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_7,
Arrays.asList(SHOP_SUB_STAGE_STATUS_71.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_74.getShopSubStageStatus()), Boolean.FALSE);
Arrays.asList(SHOP_SUB_STAGE_STATUS_71.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_74.getShopSubStageStatus()), Boolean.FALSE,keyword);
} else {
if (userRoleIds.contains(UserRoleEnum.JOIN_OFFICE.getCode()) || userRoleIds.contains(UserRoleEnum.REGION_OFFICE.getCode())) {
subStageStatusList.add(SHOP_SUB_STAGE_STATUS_70.getShopSubStageStatus());
@@ -257,7 +273,7 @@ public class DeskServiceImpl implements DeskService {
}
if (!subStageStatusList.isEmpty()) {
pageInfo = commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_7,
subStageStatusList, Boolean.TRUE);
subStageStatusList, Boolean.TRUE,keyword);
}
}
}
@@ -377,17 +393,44 @@ public class DeskServiceImpl implements DeskService {
//只有设计组长 查询 指定当前用户和阶段为 900 待分配设计师
if (userRoleIds.contains(UserRoleEnum.HEAD_OF_DESIGN.getCode()) && !userRoleIds.contains(UserRoleEnum.DESIGN_CUSTOMER.getCode())) {
PageHelper.startPage(pageNum, pageSize);
return decorationMeasureDAO.getShopIdListByDesignUserIdAndShopStage(user.getUserId(),keyword);
List<PreparationCommonPendingVO> resultList = decorationMeasureDAO.getShopIdListByDesignUserIdAndShopStage(user.getUserId(), keyword);
List<Long> shopIds = resultList.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
List<ShopStageRemarkInfoDO> remarkInfoDOList = shopStageRemarkInfoDAO.getByShopIdsAndStage(shopIds, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90.getShopSubStageStatus()));
Map<Long, List<ShopStageRemarkInfoDO>> remarkInfoMap = remarkInfoDOList.stream().collect(Collectors.groupingBy(ShopStageRemarkInfoDO::getShopId));
for (PreparationCommonPendingVO preparationCommonPendingVO : resultList){
List<ShopStageRemarkInfoDO> remarkInfoList = remarkInfoMap.getOrDefault(preparationCommonPendingVO.getShopId(), new ArrayList<>());
Map<Integer, String> remarkMapByShopSubStageStatus = remarkInfoList.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getShopSubStageStatus, ShopStageRemarkInfoDO::getRemark));
preparationCommonPendingVO.setBusinessRemark(remarkMapByShopSubStageStatus.getOrDefault(preparationCommonPendingVO.getSubStageStatus(), ""));
}
return resultList;
}
//只有设计师 查询 指定当前用户和阶段为 901 设计中
//只有设计师 查询 指定当前用户和阶段为 901
if (userRoleIds.contains(UserRoleEnum.DESIGN_CUSTOMER.getCode()) && !userRoleIds.contains(UserRoleEnum.HEAD_OF_DESIGN.getCode())) {
PageHelper.startPage(pageNum, pageSize);
return decorationDesignInfoDAO.getByDesignUserIdAndShopStage(user.getUserId(),keyword);
List<PreparationCommonPendingVO> resultList = decorationDesignInfoDAO.getByDesignUserIdAndShopStage(user.getUserId(),keyword);
List<Long> shopIds = resultList.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
List<ShopStageRemarkInfoDO> remarkInfoDOList = shopStageRemarkInfoDAO.getByShopIdsAndStage(shopIds, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_901.getShopSubStageStatus()));
Map<Long, List<ShopStageRemarkInfoDO>> remarkInfoMap = remarkInfoDOList.stream().collect(Collectors.groupingBy(ShopStageRemarkInfoDO::getShopId));
for (PreparationCommonPendingVO preparationCommonPendingVO : resultList){
List<ShopStageRemarkInfoDO> remarkInfoList = remarkInfoMap.getOrDefault(preparationCommonPendingVO.getShopId(), new ArrayList<>());
Map<Integer, String> remarkMapByShopSubStageStatus = remarkInfoList.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getShopSubStageStatus, ShopStageRemarkInfoDO::getRemark));
preparationCommonPendingVO.setBusinessRemark(remarkMapByShopSubStageStatus.getOrDefault(preparationCommonPendingVO.getSubStageStatus(), ""));
}
return resultList;
}
//有 设计组长 和 设计师 查询 指定当前用户和 阶段为 900 待分配设计师 阶段为 901 设计中
if (userRoleIds.contains(UserRoleEnum.DESIGN_CUSTOMER.getCode()) && userRoleIds.contains(UserRoleEnum.HEAD_OF_DESIGN.getCode())) {
PageHelper.startPage(pageNum, pageSize);
return decorationMeasureDAO.getShopIdListByDesignUserIdOrQuotationAndShopStage(user.getUserId(),keyword);
List<PreparationCommonPendingVO> resultList = decorationMeasureDAO.getShopIdListByDesignUserIdOrQuotationAndShopStage(user.getUserId(),keyword);
List<Long> shopIds = resultList.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
List<ShopStageRemarkInfoDO> remarkInfoDOList = shopStageRemarkInfoDAO.getByShopIdsAndStage(shopIds, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_901.getShopSubStageStatus(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90.getShopSubStageStatus()));
Map<Long, List<ShopStageRemarkInfoDO>> remarkInfoMap = remarkInfoDOList.stream().collect(Collectors.groupingBy(ShopStageRemarkInfoDO::getShopId));
for (PreparationCommonPendingVO preparationCommonPendingVO : resultList){
List<ShopStageRemarkInfoDO> remarkInfoList = remarkInfoMap.getOrDefault(preparationCommonPendingVO.getShopId(), new ArrayList<>());
Map<Integer, String> remarkMapByShopSubStageStatus = remarkInfoList.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getShopSubStageStatus, ShopStageRemarkInfoDO::getRemark));
preparationCommonPendingVO.setBusinessRemark(remarkMapByShopSubStageStatus.getOrDefault(preparationCommonPendingVO.getSubStageStatus(), ""));
}
return resultList;
}
return null;
}
@@ -437,7 +480,7 @@ public class DeskServiceImpl implements DeskService {
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
if (userRoleIds.contains(UserRoleEnum.QW_SUPERVISION.getCode()) || userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())) {
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_15,
Collections.singletonList(SHOP_SUB_STAGE_STATUS_150.getShopSubStageStatus()), Boolean.FALSE );
Collections.singletonList(SHOP_SUB_STAGE_STATUS_150.getShopSubStageStatus()), Boolean.FALSE,keyword );
}
//如果不是财务角色或者即是财务又是自有店财务 则不需要标识
Boolean ownShopFlag = null;
@@ -507,12 +550,15 @@ public class DeskServiceImpl implements DeskService {
Set<String> investmentManagerIds = list.stream().map(PreparationCommonPendingVO::getInvestmentManager).collect(Collectors.toSet());
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(new ArrayList<>(investmentManagerIds));
List<ShopStageRemarkInfoDO> remarkInfoDOList = shopStageRemarkInfoDAO.getByShopIdsAndStage(shopIds, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_862.getShopSubStageStatus()));
Map<Long, ShopStageRemarkInfoDO> remarkInfoMap = remarkInfoDOList.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getShopId, Function.identity()));
for (PreparationCommonPendingVO preparationCommonPendingVO : list) {
LineInfoDO lineInfoDO = lineMap.get(preparationCommonPendingVO.getLineId());
if (lineInfoDO == null) {
continue;
}
preparationCommonPendingVO.setBusinessRemark(remarkInfoMap.getOrDefault(preparationCommonPendingVO.getShopId(), new ShopStageRemarkInfoDO()).getRemark());
preparationCommonPendingVO.setSignType(signTypeMap.getOrDefault(preparationCommonPendingVO.getShopId(), new SignFranchiseDO()).getSignType());
preparationCommonPendingVO.setPartnerName(lineInfoDO.getUsername());
preparationCommonPendingVO.setPartnerPhone(lineInfoDO.getMobile());
@@ -525,22 +571,52 @@ public class DeskServiceImpl implements DeskService {
}
@Override
public PageInfo<PreparationCommonPendingVO> businessLicensePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
public PageInfo<PreparationCommonPendingVO> businessLicensePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user,String keyword) {
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_3,
Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30.getShopSubStageStatus()), Boolean.FALSE );
Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30.getShopSubStageStatus()), Boolean.FALSE ,keyword);
}
@Override
public PageInfo<PreparationCommonPendingVO> foodLicensePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
public PageInfo<PreparationCommonPendingVO> foodLicensePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user,String keyword) {
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_4,
Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_40.getShopSubStageStatus()), Boolean.FALSE );
Collections.singletonList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_40.getShopSubStageStatus()), Boolean.FALSE,keyword );
}
@Override
public PageInfo<PreparationCommonPendingVO> JingDongPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
return commonPlatformBuild(pageNum, pageSize, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_251.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_253.getShopSubStageStatus()));
public PageInfo<PreparationCommonPendingVO> JingDongPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user,String keyword) {
return commonPlatformBuild(pageNum, pageSize, user, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_251.getShopSubStageStatus(), SHOP_SUB_STAGE_STATUS_253.getShopSubStageStatus()),keyword);
}
@Override
public Integer submitBusinessRemark(BusinessRemarkRequest request, LoginUserInfo user){
if ((request.getShopId() == null&&request.getSubStage()==null&&request.getSubStageStatus()==null)
||(request.getLineId()==null&&request.getWorkflowSubStage()==null&&request.getWorkflowSubStageStatus()==null)){
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
ShopStageRemarkInfoDO remarkInfoDO = new ShopStageRemarkInfoDO();
if (request.getShopId() != null){
remarkInfoDO = shopStageRemarkInfoDAO.getByShopIdAndStage(request.getShopId(),request.getSubStageStatus());
remarkInfoDO.setShopId(request.getShopId());
remarkInfoDO.setShopSubStage(request.getSubStage());
remarkInfoDO.setShopSubStageStatus(request.getSubStageStatus());
}else if (request.getLineId() != null){
remarkInfoDO = shopStageRemarkInfoDAO.getByLineIdAndStage(request.getLineId(),request.getWorkflowSubStageStatus());
remarkInfoDO.setLineId(request.getLineId());
remarkInfoDO.setWorkflowSubStage(request.getWorkflowSubStage());
remarkInfoDO.setWorkflowSubStageStatus(request.getWorkflowSubStageStatus());
}
remarkInfoDO.setRemark(request.getBusinessRemark());
if(remarkInfoDO.getCreateTime()==null){
remarkInfoDO.setCreateTime(new Date());
}
if (StringUtil.isBlank(remarkInfoDO.getCreateUserId())){
remarkInfoDO.setCreateUserId(user.getUserId());
}
remarkInfoDO.setUpdateTime(new Date());
remarkInfoDO.setUpdateUserId(user.getUserId());
return shopStageRemarkInfoDAO.insertOrUpdate(remarkInfoDO);
}
/**
* 通用查询
@@ -598,10 +674,15 @@ public class DeskServiceImpl implements DeskService {
List<String> developmentManagers = shopInfoList.stream().filter(x -> StringUtil.isNotEmpty(x.getShopManagerUserId())).map(ShopInfoDO::getShopManagerUserId).distinct().collect(Collectors.toList());
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
List<ShopStageRemarkInfoDO> remarkInfoDOList = shopStageRemarkInfoDAO.getByShopIdsAndStage(shopIds, subStageStatusList);
Map<Long, List<ShopStageRemarkInfoDO>> remarkInfoMap = remarkInfoDOList.stream().collect(Collectors.groupingBy(ShopStageRemarkInfoDO::getShopId));
List<PreparationCommonPendingVO> list = new ArrayList<>();
specialShopStageInfo.forEach(x -> {
PreparationCommonPendingVO preparationCommonPendingVO = new PreparationCommonPendingVO();
List<ShopStageRemarkInfoDO> remarkInfoMapOrDefault = remarkInfoMap.getOrDefault(x.getShopId(), new ArrayList<>());
Map<Integer, ShopStageRemarkInfoDO> remarkInfoMapByStageStatus = remarkInfoMapOrDefault.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getShopSubStageStatus, Function.identity()));
preparationCommonPendingVO.setBusinessRemark(remarkInfoMapByStageStatus.getOrDefault(x.getShopSubStageStatus(), new ShopStageRemarkInfoDO()).getRemark());
preparationCommonPendingVO.setLineId(x.getLineId());
preparationCommonPendingVO.setShopId(x.getShopId());
ShopInfoDO shopInfoDO = shopInfoMap.getOrDefault(x.getShopId(), new ShopInfoDO());
@@ -686,10 +767,13 @@ public class DeskServiceImpl implements DeskService {
List<String> developmentManagers = shopInfoList.stream().filter(x -> StringUtil.isNotEmpty(x.getShopManagerUserId())).map(ShopInfoDO::getShopManagerUserId).distinct().collect(Collectors.toList());
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
List<ShopStageRemarkInfoDO> remarkInfoDOList = shopStageRemarkInfoDAO.getByShopIdsAndStage(shopIds, subStageStatusList);
Map<Long, ShopStageRemarkInfoDO> remarkInfoMap = remarkInfoDOList.stream().collect(Collectors.toMap(ShopStageRemarkInfoDO::getShopId, Function.identity()));
List<PreparationCommonPendingVO> list = new ArrayList<>();
operationLogDOList.forEach(x -> {
PreparationCommonPendingVO preparationCommonPendingVO = new PreparationCommonPendingVO();
preparationCommonPendingVO.setBusinessRemark(remarkInfoMap.getOrDefault(x.getShopId(), new ShopStageRemarkInfoDO()).getRemark());
ShopInfoDO shopInfoDO = shopInfoMap.getOrDefault(x.getShopId(), new ShopInfoDO());
preparationCommonPendingVO.setStoreType(shopInfoDO.getStoreType());
preparationCommonPendingVO.setJoinMode(shopInfoDO.getJoinMode());

View File

@@ -4,16 +4,14 @@ import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dto.InvestmentCountDTO;
import com.cool.store.dto.PendingCountDTO;
import com.cool.store.request.BusinessRemarkRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.DeskService;
import com.cool.store.vo.desk.*;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -230,23 +228,29 @@ public class DeskController {
@ApiOperation("待处理-营业执照")
@GetMapping("/businessLicensePendingList")
public ResponseResult<PageInfo<PreparationCommonPendingVO>> businessLicensePendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize,@RequestParam(value = "keyword") String keyword){
LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.businessLicensePendingList(pageNumber,pageSize,userInfo));
return ResponseResult.success(deskService.businessLicensePendingList(pageNumber,pageSize,userInfo,keyword));
}
@ApiOperation("待处理-食品许可证")
@GetMapping("/foodLicensePendingList")
public ResponseResult<PageInfo<PreparationCommonPendingVO>> foodLicensePendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize,@RequestParam(value = "keyword") String keyword) {
LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.foodLicensePendingList(pageNumber,pageSize,userInfo));
return ResponseResult.success(deskService.foodLicensePendingList(pageNumber,pageSize,userInfo,keyword));
}
@ApiOperation("待处理-京东外卖")
@GetMapping("/JingDongPendingList")
public ResponseResult<PageInfo<PreparationCommonPendingVO>> JingDongPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize,@RequestParam(value = "keyword") String keyword) {
LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.JingDongPendingList(pageNumber,pageSize,userInfo));
return ResponseResult.success(deskService.JingDongPendingList(pageNumber,pageSize,userInfo,keyword));
}
@ApiOperation("提交业务备注")
@PostMapping("/submitBusinessRemark")
public ResponseResult<Integer> submitBusinessRemark(@RequestBody BusinessRemarkRequest request) {
LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.submitBusinessRemark(request,userInfo));
}
}