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

This commit is contained in:
苏竹红
2024-04-11 17:24:00 +08:00
45 changed files with 1192 additions and 75 deletions

View File

@@ -0,0 +1,39 @@
package com.cool.store.enums;
public enum AuditStageEnum {
ONE(1, "一审稽核"),
TWO(2, "二审稽核"),
;
private Integer code;
private String name;
AuditStageEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
public static AuditStageEnum getByCode(Integer code) {
for (AuditStageEnum auditStatusEnum : AuditStageEnum.values()) {
if (auditStatusEnum.getCode().equals(code)) {
return auditStatusEnum;
}
}
return null;
}
}

View File

@@ -144,6 +144,10 @@ public enum ErrorCodeEnum {
TIME_FALSE(109002, "结束时间不能早于开始时间",null), TIME_FALSE(109002, "结束时间不能早于开始时间",null),
BUSINESS_ID_NOT_EXIST(109003, "kdzBusinessId解析异常,请检查",null),
VERIFY_MD5_FALSE(109004, "验签失败,请检查",null),
; ;

View File

@@ -0,0 +1,43 @@
package com.cool.store.enums.point;
/**
* @author zhangchenbiao
* @FileName: ShopStageEnum
* @Description:店铺阶段
* @date 2024-04-10 17:34
*/
public enum ShopStageEnum {
//1选址 2筹建 3开业
SHOP_STAGE_1(1, "选址"),
SHOP_STAGE_2(2, "筹建"),
SHOP_STAGE_3(3, "开业"),
;
private Integer shopStage;
private String stageName;
ShopStageEnum(Integer shopStage, String stageName) {
this.shopStage = shopStage;
this.stageName = stageName;
}
public static ShopStageEnum getShopStageEnum(Integer shopStage) {
for (ShopStageEnum shopStageEnum : ShopStageEnum.values()) {
if (shopStageEnum.getShopStage().equals(shopStage)) {
return shopStageEnum;
}
}
return null;
}
public Integer getShopStage() {
return shopStage;
}
public String getStageName() {
return stageName;
}
}

View File

@@ -0,0 +1,97 @@
package com.cool.store.enums.point;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: ShopStageEnum
* @Description:店铺阶段
* @date 2024-04-10 17:34
*/
public enum ShopSubStageEnum {
SHOP_STAGE_1(ShopStageEnum.SHOP_STAGE_1, 10, "选址"),
SHOP_STAGE_2(ShopStageEnum.SHOP_STAGE_1, 20, "上传租赁合同"),
SHOP_STAGE_3(ShopStageEnum.SHOP_STAGE_2, 30, "系统建店"),
SHOP_STAGE_4(ShopStageEnum.SHOP_STAGE_2, 40, "证照办理"),
SHOP_STAGE_5(ShopStageEnum.SHOP_STAGE_2, 50, "员工招聘"),
SHOP_STAGE_6(ShopStageEnum.SHOP_STAGE_2, 60, "加盟商/员工培训"),
SHOP_STAGE_7(ShopStageEnum.SHOP_STAGE_2, 70, "缴纳加盟费/保证金"),
SHOP_STAGE_8(ShopStageEnum.SHOP_STAGE_2, 80, "加盟合同签约"),
SHOP_STAGE_9(ShopStageEnum.SHOP_STAGE_2, 90, "设计阶段"),
SHOP_STAGE_10(ShopStageEnum.SHOP_STAGE_2, 100, "施工阶段"),
SHOP_STAGE_11(ShopStageEnum.SHOP_STAGE_2, 110, "三方验收"),
;
//阶段
private ShopStageEnum shopStageEnum;
//子阶段
private Integer shopSubStage;
//子阶段名称
private String shopSubStageName;
ShopSubStageEnum(ShopStageEnum shopStageEnum, Integer shopSubStage, String shopSubStageName) {
this.shopStageEnum = shopStageEnum;
this.shopSubStage = shopSubStage;
this.shopSubStageName = shopSubStageName;
}
public static List<ShopSubStageEnum> getShopStageEnum(Integer shopStage) {
List<ShopSubStageEnum> resultList = new ArrayList<>();
for (ShopSubStageEnum shopStageEnum : ShopSubStageEnum.values()) {
if (shopStageEnum.getShopStageEnum().getShopStage().equals(shopStage)) {
resultList.add(shopStageEnum);
}
}
return resultList;
}
public ShopStageEnum getShopStageEnum() {
return shopStageEnum;
}
public Integer getShopSubStage() {
return shopSubStage;
}
public String getShopSubStageName() {
return shopSubStageName;
}
/**
* 获取各阶段的初始状态
* @return
*/
public ShopSubStageStatusEnum getInitStatus() {
switch (this){
case SHOP_STAGE_1:
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_0;
case SHOP_STAGE_2:
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_2;
case SHOP_STAGE_3:
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_6;
case SHOP_STAGE_4:
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_10;
case SHOP_STAGE_5:
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_14;
case SHOP_STAGE_6:
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_16;
case SHOP_STAGE_7:
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_18;
case SHOP_STAGE_8:
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21;
case SHOP_STAGE_9:
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_27;
case SHOP_STAGE_10:
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_32;
case SHOP_STAGE_11:
return ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_35;
default:
return null;
}
}
}

View File

@@ -0,0 +1,114 @@
package com.cool.store.enums.point;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: ShopStageStatusEnum
* @Description:店铺阶段状态
* @date 2024-04-10 17:34
*/
public enum ShopSubStageStatusEnum {
//选址
SHOP_SUB_STAGE_STATUS_0(ShopSubStageEnum.SHOP_STAGE_1, 100, "待选址"),
SHOP_SUB_STAGE_STATUS_1(ShopSubStageEnum.SHOP_STAGE_1, 110, "已选址"),
//上传租赁合同
SHOP_SUB_STAGE_STATUS_2(ShopSubStageEnum.SHOP_STAGE_2, 200, "待上传"),
SHOP_SUB_STAGE_STATUS_3(ShopSubStageEnum.SHOP_STAGE_2, 210, "已上传"),
SHOP_SUB_STAGE_STATUS_4(ShopSubStageEnum.SHOP_STAGE_2, 220, "审核未通过"),
SHOP_SUB_STAGE_STATUS_5(ShopSubStageEnum.SHOP_STAGE_2, 230, "审核通过"),
//系统建店
SHOP_SUB_STAGE_STATUS_6(ShopSubStageEnum.SHOP_STAGE_3, 300, "待建店"),
SHOP_SUB_STAGE_STATUS_7(ShopSubStageEnum.SHOP_STAGE_3, 310, "审核中"),
SHOP_SUB_STAGE_STATUS_8(ShopSubStageEnum.SHOP_STAGE_3, 320, "未通过"),
SHOP_SUB_STAGE_STATUS_9(ShopSubStageEnum.SHOP_STAGE_3, 330, "已通过"),
//证照办理
SHOP_SUB_STAGE_STATUS_10(ShopSubStageEnum.SHOP_STAGE_4, 400, "待提交"),
SHOP_SUB_STAGE_STATUS_11(ShopSubStageEnum.SHOP_STAGE_4, 410, "待审核"),
SHOP_SUB_STAGE_STATUS_12(ShopSubStageEnum.SHOP_STAGE_4, 420, "审核未通过"),
SHOP_SUB_STAGE_STATUS_13(ShopSubStageEnum.SHOP_STAGE_4, 430, "审核通过"),
//员工招聘
SHOP_SUB_STAGE_STATUS_14(ShopSubStageEnum.SHOP_STAGE_5, 500, "招聘中"),
SHOP_SUB_STAGE_STATUS_15(ShopSubStageEnum.SHOP_STAGE_5, 510, "已完成"),
//加盟商/员工培训
SHOP_SUB_STAGE_STATUS_16(ShopSubStageEnum.SHOP_STAGE_6, 600, "培训中"),
SHOP_SUB_STAGE_STATUS_17(ShopSubStageEnum.SHOP_STAGE_6, 610, "已完成"),
//缴纳加盟费/保证金
SHOP_SUB_STAGE_STATUS_18(ShopSubStageEnum.SHOP_STAGE_7, 700, "待缴费"),
SHOP_SUB_STAGE_STATUS_19(ShopSubStageEnum.SHOP_STAGE_7, 710, "已缴费"),
SHOP_SUB_STAGE_STATUS_20(ShopSubStageEnum.SHOP_STAGE_7, 720, "缴费失败"),
//加盟合同签约
SHOP_SUB_STAGE_STATUS_21(ShopSubStageEnum.SHOP_STAGE_8, 800, "待提交"),
SHOP_SUB_STAGE_STATUS_22(ShopSubStageEnum.SHOP_STAGE_8, 810, "信息核对"),
SHOP_SUB_STAGE_STATUS_23(ShopSubStageEnum.SHOP_STAGE_8, 820, "待加盟商签约"),
SHOP_SUB_STAGE_STATUS_24(ShopSubStageEnum.SHOP_STAGE_8, 830, "审核中"),
SHOP_SUB_STAGE_STATUS_25(ShopSubStageEnum.SHOP_STAGE_8, 840, "已签约"),
SHOP_SUB_STAGE_STATUS_26(ShopSubStageEnum.SHOP_STAGE_8, 850, "退回"),
//设计阶段
SHOP_SUB_STAGE_STATUS_27(ShopSubStageEnum.SHOP_STAGE_9, 900, "进行中"),
SHOP_SUB_STAGE_STATUS_28(ShopSubStageEnum.SHOP_STAGE_9, 910, "已完成"),
//施工阶段
SHOP_SUB_STAGE_STATUS_32(ShopSubStageEnum.SHOP_STAGE_10, 1000, "待施工"),
SHOP_SUB_STAGE_STATUS_33(ShopSubStageEnum.SHOP_STAGE_10, 1010, "施工中"),
SHOP_SUB_STAGE_STATUS_34(ShopSubStageEnum.SHOP_STAGE_10, 1020, "已完成"),
//三方验收
SHOP_SUB_STAGE_STATUS_35(ShopSubStageEnum.SHOP_STAGE_11, 1100, "待预约"),
SHOP_SUB_STAGE_STATUS_36(ShopSubStageEnum.SHOP_STAGE_11, 1110, "待确认"),
SHOP_SUB_STAGE_STATUS_37(ShopSubStageEnum.SHOP_STAGE_11, 1120, "待验收"),
SHOP_SUB_STAGE_STATUS_38(ShopSubStageEnum.SHOP_STAGE_11, 1130, "验收中"),
SHOP_SUB_STAGE_STATUS_39(ShopSubStageEnum.SHOP_STAGE_11, 1140, "已验收"),
;
private ShopSubStageEnum shopSubStageEnum;
private Integer shopSubStageStatus;
private String shopSubStageStatusName;
ShopSubStageStatusEnum(ShopSubStageEnum shopSubStageEnum, Integer shopSubStageStatus, String shopSubStageStatusName) {
this.shopSubStageEnum = shopSubStageEnum;
this.shopSubStageStatus = shopSubStageStatus;
this.shopSubStageStatusName = shopSubStageStatusName;
}
public static List<ShopSubStageStatusEnum> getShopSubStageStatusEnum(ShopSubStageEnum shopSubStage) {
List<ShopSubStageStatusEnum> resultList = new ArrayList<>();
for (ShopSubStageStatusEnum stageStatusEnum : ShopSubStageStatusEnum.values()) {
if (stageStatusEnum.getShopSubStageEnum().equals(shopSubStage)) {
resultList.add(stageStatusEnum);
}
}
return resultList;
}
public ShopSubStageEnum getShopSubStageEnum() {
return shopSubStageEnum;
}
public Integer getShopSubStageStatus() {
return shopSubStageStatus;
}
public String getShopSubStageStatusName() {
return shopSubStageStatusName;
}
public String getShopSubStageName() {
return shopSubStageEnum.getShopSubStageName();
}
}

View File

@@ -0,0 +1,34 @@
package com.cool.store.utils;
/**
* @author zhangchenbiao
* @FileName: NumberConverter
* @Description:
* @date 2024-04-10 17:07
*/
public class NumberConverter {
private static final char[] CN_NUMBERS = {'零', '一', '二', '三', '四', '五', '六', '七', '八', '九'};
private static final char[] CN_UNITS = {'个', '十', '百', '千', '万'};
public static String convertArabicToChinese(int number) {
String result = "";
// 将数字转换为字符串
String numStr = String.valueOf(number);
int len = numStr.length();
boolean lastIsZero = false;
for (int i = 0; i < len; i++) {
int n = numStr.charAt(i) - '0'; // 转换为数字
if (n != 0 || (!lastIsZero && i != len - 1)) {
result += CN_NUMBERS[n]; // 转换为中文数字
if (i != len - 1) {
// 不是最后一位数字,需要添加单位
result += CN_UNITS[(len - 1 - i)];
}
} else {
lastIsZero = true;
}
}
return result;
}
}

View File

@@ -1,8 +1,12 @@
package com.cool.store.dao; package com.cool.store.dao;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.entity.PointTodoInfoDO; import com.cool.store.entity.PointTodoInfoDO;
import com.cool.store.enums.NodeNoEnum; import com.cool.store.enums.NodeNoEnum;
import com.cool.store.mapper.PointTodoInfoMapper; import com.cool.store.mapper.PointTodoInfoMapper;
import com.cool.store.request.PointTodoPageRequest;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@@ -42,4 +46,9 @@ public class PointTodoInfoDAO {
} }
return pointTodoInfoMapper.getPointToDoByUserIdAndPointId(userId, pointId); return pointTodoInfoMapper.getPointToDoByUserIdAndPointId(userId, pointId);
} }
public Page<PointInfoDO> getUserTodoList(PointTodoPageRequest request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
return pointTodoInfoMapper.getUserTodoList(request);
}
} }

View File

@@ -1,10 +1,15 @@
package com.cool.store.dao; package com.cool.store.dao;
import com.cool.store.constants.CommonConstants;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.ShopInfoDO; import com.cool.store.entity.ShopInfoDO;
import com.cool.store.mapper.ShopInfoMapper; import com.cool.store.mapper.ShopInfoMapper;
import com.cool.store.utils.NumberConverter;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@@ -20,6 +25,14 @@ public class ShopInfoDAO {
@Resource @Resource
private ShopInfoMapper shopInfoMapper; private ShopInfoMapper shopInfoMapper;
public Integer batchAddShop(List<ShopInfoDO> shopInfoList){
if(CollectionUtils.isEmpty(shopInfoList)){
return CommonConstants.ZERO;
}
return shopInfoMapper.batchAddShop(shopInfoList);
}
/** /**
* 获取门店信息 * 获取门店信息
* @param shopId * @param shopId
@@ -34,6 +47,9 @@ public class ShopInfoDAO {
} }
public List<ShopInfoDO> getShopList(Long lineId){ public List<ShopInfoDO> getShopList(Long lineId){
if(Objects.isNull(lineId)){
return new ArrayList<>();
}
return shopInfoMapper.getShopList(lineId); return shopInfoMapper.getShopList(lineId);
} }

View File

@@ -0,0 +1,85 @@
package com.cool.store.dao;
import com.cool.store.constants.CommonConstants;
import com.cool.store.entity.ShopStageInfoDO;
import com.cool.store.enums.point.ShopStageEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.mapper.ShopStageInfoMapper;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: ShopStageInfoDAO
* @Description:
* @date 2024-04-10 17:33
*/
@Repository
public class ShopStageInfoDAO {
@Resource
private ShopStageInfoMapper shopStageInfoMapper;
/**
* 初始化店铺阶段信息
* @param lineId
* @param shopIds
* @param shopStageEnum
* @return
*/
public Integer initShopStageInfo(Long lineId, List<Long> shopIds, ShopStageEnum shopStageEnum) {
if(CollectionUtils.isEmpty(shopIds) || Objects.isNull(shopStageEnum)){
return CommonConstants.ZERO;
}
Integer shopStage = shopStageEnum.getShopStage();
List<ShopSubStageEnum> shopStageEnumList = ShopSubStageEnum.getShopStageEnum(shopStage);
List<ShopStageInfoDO> addShopStageList = new ArrayList<>();
for (Long shopId : shopIds) {
for (ShopSubStageEnum shopSubStageEnum : shopStageEnumList) {
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
shopStageInfo.setLineId(lineId);
shopStageInfo.setShopId(shopId);
shopStageInfo.setShopStage(shopStage);
shopStageInfo.setShopSubStage(shopSubStageEnum.getShopSubStage());
shopStageInfo.setShopSubStageStatus(shopSubStageEnum.getInitStatus().getShopSubStageStatus());
shopStageInfo.setRemark(shopSubStageEnum.getShopSubStageName() + CommonConstants.PATH_BAR +shopSubStageEnum.getInitStatus().getShopSubStageStatusName());
addShopStageList.add(shopStageInfo);
}
}
return shopStageInfoMapper.batchInsert(addShopStageList);
}
/**
* 获取店铺阶段信息
* @param shopId
* @return
*/
public List<ShopStageInfoDO> getShopStageInfo(Long shopId) {
if(Objects.isNull(shopId)){
return Lists.newArrayList();
}
return shopStageInfoMapper.getShopStageInfo(shopId);
}
/**
* 更新店铺阶段状态
* @param shopId
* @param shopStageInfo
* @return
*/
public Integer updateShopStageInfo(Long shopId, ShopSubStageStatusEnum shopStageInfo) {
if(Objects.isNull(shopId) || Objects.isNull(shopStageInfo)){
return CommonConstants.ZERO;
}
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR +shopStageInfo.getShopSubStageStatusName();
return shopStageInfoMapper.updateShopStageInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), remark);
}
}

View File

@@ -0,0 +1,9 @@
package com.cool.store.mapper;
import com.cool.store.entity.AuditStatusDO;
import tk.mybatis.mapper.common.Mapper;
@org.apache.ibatis.annotations.Mapper
public interface AuditStatusMapper extends Mapper<AuditStatusDO> {
}

View File

@@ -1,6 +1,9 @@
package com.cool.store.mapper; package com.cool.store.mapper;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.entity.PointTodoInfoDO; import com.cool.store.entity.PointTodoInfoDO;
import com.cool.store.request.PointTodoPageRequest;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.Mapper;
@@ -46,4 +49,11 @@ public interface PointTodoInfoMapper extends Mapper<PointTodoInfoDO> {
* @return * @return
*/ */
PointTodoInfoDO getPointToDoByUserIdAndPointId(String userId, Long pointId); PointTodoInfoDO getPointToDoByUserIdAndPointId(String userId, Long pointId);
/**
* 获取待办
* @param request
* @return
*/
Page<PointInfoDO> getUserTodoList(@Param("request") PointTodoPageRequest request);
} }

View File

@@ -8,6 +8,14 @@ import java.util.List;
public interface ShopInfoMapper extends Mapper<ShopInfoDO> { public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
/**
* 批量新增
* @param shopInfoList
* @return
*/
Integer batchAddShop(@Param("shopInfoList") List<ShopInfoDO> shopInfoList);
/** /**
* 获取加盟商的店铺列表 * 获取加盟商的店铺列表
* @param lineId * @param lineId

View File

@@ -0,0 +1,34 @@
package com.cool.store.mapper;
import com.cool.store.entity.ShopStageInfoDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
/**
* 批量插入店铺阶段信息
* @param addShopStageList
* @return
*/
Integer batchInsert(@Param("addShopStageList") List<ShopStageInfoDO> addShopStageList);
/**
* 获取店铺阶段信息
* @param shopId
* @return
*/
List<ShopStageInfoDO> getShopStageInfo(@Param("shopId") Long shopId);
/**
* 跟新店铺阶段信息
* @param shopId
* @param shopSubStage
* @param shopSubStageStatus
* @param remark
* @return
*/
Integer updateShopStageInfo(@Param("shopId") Long shopId, @Param("shopSubStage") Integer shopSubStage, @Param("shopSubStageStatus") Integer shopSubStageStatus, @Param("remark") String remark);
}

View File

@@ -0,0 +1,31 @@
<?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">
<mapper namespace="com.cool.store.mapper.AuditStatusMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.AuditStatusDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="line_id" jdbcType="BIGINT" property="lineId" />
<result column="interview_id" jdbcType="BIGINT" property="interviewId" />
<result column="audit_id" jdbcType="BIGINT" property="auditId" />
<result column="audit_status" jdbcType="TINYINT" property="auditStatus" />
<result column="audit_user_id" jdbcType="BIGINT" property="auditUserId" />
<result column="audit_user_name" jdbcType="VARCHAR" property="auditUserName" />
<result column="create_time" jdbcType="BIGINT" property="lineId" />
<result column="update_time" jdbcType="BIGINT" property="lineId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="audit_stage" jdbcType="TINYINT" property="auditStage" />
</resultMap>
<sql id="Base_Column_List">
id,
line_id,
interview_id,
audit_id,
audit_status,
audit_user_id,
audit_user_name,
create_time,
update_time,
audit_stage
</sql>
</mapper>

View File

@@ -26,7 +26,7 @@
</resultMap> </resultMap>
<sql id="allColumn"> <sql id="allColumn">
id, point_code, point_name, region_id, shop_id, line_id, point_area, longitude, latitude, address, development_manager, operate_user_id, development_time, point_status, point_score, select_status, submit_audit_count, is_line_upload id, point_code, point_name, region_id, shop_id, line_id, point_area, longitude, latitude, address, development_manager, operate_user_id, development_time, point_status, point_score, select_status, submit_audit_count, is_line_upload, deleted, create_time, update_time
</sql> </sql>
<select id="getMyPointData" resultType="com.cool.store.vo.point.PointHomePageDataVO"> <select id="getMyPointData" resultType="com.cool.store.vo.point.PointHomePageDataVO">
@@ -45,6 +45,7 @@
pi.id, pi.id,
pi.point_name, pi.point_name,
pi.point_code, pi.point_code,
pi.address,
pi.region_id, pi.region_id,
pi.point_status, pi.point_status,
pi.point_score, pi.point_score,
@@ -52,7 +53,9 @@
pi.development_manager, pi.development_manager,
pi.operate_user_id, pi.operate_user_id,
pi.development_time, pi.development_time,
pi.select_status pi.select_status,
pi.create_time,
pi.update_time
from xfsg_point_info pi from xfsg_point_info pi
where pi.deleted = 0 and pi.development_manager = #{request.developmentManager} where pi.deleted = 0 and pi.development_manager = #{request.developmentManager}
<if test="request.keyword != null and request.keyword != ''"> <if test="request.keyword != null and request.keyword != ''">
@@ -64,8 +67,11 @@
<if test="request.developmentEndTime != null and request.developmentEndTime != ''"> <if test="request.developmentEndTime != null and request.developmentEndTime != ''">
<![CDATA[and pi.development_time <= #{request.developmentEndTime}]]> <![CDATA[and pi.development_time <= #{request.developmentEndTime}]]>
</if> </if>
<if test="request.pointStatus != null and request.pointStatus != ''"> <if test="request.pointStatusList != null and request.pointStatusList.size() > 0">
and pi.point_status = #{request.pointStatus} and pi.point_status in
<foreach collection="request.pointStatusList" item="pointStatus" open="(" close=")" separator=",">
#{pointStatus}
</foreach>
</if> </if>
<if test="request.storageStatus != null and request.storageStatus == 1"> <if test="request.storageStatus != null and request.storageStatus == 1">
and pi.point_status in (4,5,6,7) and pi.point_status in (4,5,6,7)
@@ -102,8 +108,11 @@
<include refid="allColumn"/> <include refid="allColumn"/>
from xfsg_point_info from xfsg_point_info
where deleted = 0 and point_status in (4,5) and development_manager = #{request.developmentManager} where deleted = 0 and point_status in (4,5) and development_manager = #{request.developmentManager}
<if test="request.pointStatus != null and request.pointStatus != ''"> <if test="request.pointStatusList != null and request.pointStatusList.size() > 0">
and point_status = #{request.pointStatus} and point_status in
<foreach collection="request.pointStatusList" item="pointStatus" open="(" close=")">
#{pointStatus}
</foreach>
</if> </if>
</select> </select>

View File

@@ -68,4 +68,31 @@
<update id="updatePointTodoInfo"> <update id="updatePointTodoInfo">
update xfsg_point_todo_info set status = if(handler_user_id = #{handlerUserId}, 1, 2), update_time = now() where point_id = #{pointId} and node_no = #{nodeNo} and cycle_count = #{cycleCount} and deleted = 0 update xfsg_point_todo_info set status = if(handler_user_id = #{handlerUserId}, 1, 2), update_time = now() where point_id = #{pointId} and node_no = #{nodeNo} and cycle_count = #{cycleCount} and deleted = 0
</update> </update>
<select id="getUserTodoList" resultType="com.cool.store.entity.PointInfoDO">
select
b.id,
b.point_name,
b.point_code,
b.point_status,
b.point_score,
b.development_manager,
b.development_time,
b.point_area,
b.address,
b.latitude,
b.longitude,
b.region_id,
b.line_id,
b.shop_id,
b.select_status,
b.operate_user_id,
b.is_line_upload,
b.create_time,
b.update_time
from
xfsg_point_todo_info a inner join xfsg_point_info b on a.point_id = b.id
where
a.handler_user_id = #{request.developmentManager} and a.status = 0 and a.deleted = 0 and b.deleted = 0
</select>
</mapper> </mapper>

View File

@@ -25,6 +25,13 @@
id, region_id, line_id, partner_id, point_id, shop_name, shop_code, store_num, shop_manager_user_id, supervisor_user_id, plan_open_time, cur_progress, shop_type, shop_stage, deleted, create_time, update_time id, region_id, line_id, partner_id, point_id, shop_name, shop_code, store_num, shop_manager_user_id, supervisor_user_id, plan_open_time, cur_progress, shop_type, shop_stage, deleted, create_time, update_time
</sql> </sql>
<insert id="batchAddShop">
<foreach collection="shopInfoList" item="shop" separator=";">
insert into xfsg_shop_info(region_id, line_id, partner_id, shop_name, shop_code)
values(#{shop.regionId}, #{shop.lineId}, #{shop.partnerId}, #{shop.shopName}, #{shop.shopCode})
</foreach>
</insert>
<select id="getShopList" resultMap="BaseResultMap"> <select id="getShopList" resultMap="BaseResultMap">
select <include refid="allColumn"/> from xfsg_shop_info where line_id = #{lineId} and deleted= '0' select <include refid="allColumn"/> from xfsg_shop_info where line_id = #{lineId} and deleted= '0'
</select> </select>

View File

@@ -0,0 +1,41 @@
<?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">
<mapper namespace="com.cool.store.mapper.ShopStageInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopStageInfoDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="line_id" jdbcType="BIGINT" property="lineId" />
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
<result column="shop_stage" jdbcType="TINYINT" property="shopStage" />
<result column="shop_sub_stage" jdbcType="TINYINT" property="shopSubStage" />
<result column="shop_sub_stage_status" jdbcType="TINYINT" property="shopSubStageStatus" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="allColumn">
id, line_id, shop_id, shop_stage, shop_sub_stage, shop_sub_stage_status, remark, deleted, create_time, update_time
</sql>
<insert id="batchInsert">
<foreach collection="addShopStageList" separator=";" item="shop">
INSERT INTO xfsg_shop_stage_info(line_id, shop_id, shop_stage, shop_sub_stage, shop_sub_stage_status, remark)
VALUES(#{shop.lineId}, #{shop.shopId}, #{shop.shopStage}, #{shop.shopSubStage}, #{shop.shopSubStageStatus}, #{shop.remark})
</foreach>
</insert>
<select id="getShopStageInfo" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from
xfsg_shop_stage_info
where
shop_id = #{shopId} and deleted = 0
</select>
<update id="updateShopStageInfo">
update xfsg_shop_stage_info set shop_sub_stage_status = #{shopSubStageStatus}, remark = #{remark} where shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
</update>
</mapper>

View File

@@ -1,8 +1,8 @@
jdbc.driver = com.mysql.cj.jdbc.Driver jdbc.driver = com.mysql.cj.jdbc.Driver
jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_36?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_69?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
jdbc.user= coolstore jdbc.user= coolstore
jdbc.password = CSCErYcXniNYm7bT jdbc.password = CSCErYcXniNYm7bT
table.name = xfsg_point_deal_record table.name = xfsg_shop_stage_info
table.object.class = PointDealRecordDO table.object.class = ShopStageInfoDO
table.mapper = PointDealRecordMapper table.mapper = ShopStageInfoMapper

View File

@@ -0,0 +1,32 @@
package com.cool.store.entity;
import lombok.Data;
import javax.persistence.*;
import java.util.Date;
@Data
@Table(name = "xfsg_audit_status")
public class AuditStatusDO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "line_id")
private Long lineId;
@Column(name = "interview_id")
private Long interviewId;
@Column(name = "audit_id")
private Long auditId;
@Column(name = "audit_status")
private Integer auditStatus;
@Column(name = "audit_user_id")
private Integer auditUserId;
@Column(name = "audit_user_name")
private String auditUserName;
@Column(name = "create_time")
private Date createTime;
@Column(name = "update_time")
private Date updateTime;
@Column(name = "audit_stage")
private Integer auditStage;
}

View File

@@ -0,0 +1,64 @@
package com.cool.store.entity;
import lombok.Data;
import java.util.Date;
import javax.persistence.*;
@Data
@Table(name = "xfsg_shop_stage_info")
public class ShopStageInfoDO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "line_id")
private Long lineId;
/**
* 店铺id
*/
@Column(name = "shop_id")
private Long shopId;
/**
* 店铺阶段
*/
@Column(name = "shop_stage")
private Integer shopStage;
/**
* 店铺子阶段
*/
@Column(name = "shop_sub_stage")
private Integer shopSubStage;
/**
* 店铺子阶段状态
*/
@Column(name = "shop_sub_stage_status")
private Integer shopSubStageStatus;
/**
* 备注
*/
private String remark;
/**
* 删除标识
*/
private Boolean deleted;
/**
* 创建时间
*/
@Column(name = "create_time")
private Date createTime;
/**
* 更新时间
*/
@Column(name = "update_time")
private Date updateTime;
}

View File

@@ -1,12 +1,15 @@
package com.cool.store.request; package com.cool.store.request;
import com.cool.store.common.PageBasicInfo; import com.cool.store.common.PageBasicInfo;
import com.cool.store.enums.point.PointStatusEnum;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Max; import javax.validation.constraints.Max;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
/** /**
* @author zhangchenbiao * @author zhangchenbiao
@@ -32,7 +35,6 @@ public class PointPageRequest extends PageBasicInfo {
@ApiModelProperty(value = "拓展专员", hidden = true) @ApiModelProperty(value = "拓展专员", hidden = true)
private String developmentManager; private String developmentManager;
@NotNull
@Min(1)@Max(2) @Min(1)@Max(2)
@ApiModelProperty("必传参数:1已入库 2暂未入库") @ApiModelProperty("必传参数:1已入库 2暂未入库")
private Integer storageStatus; private Integer storageStatus;
@@ -40,4 +42,18 @@ public class PointPageRequest extends PageBasicInfo {
@ApiModelProperty("1.采集中、2.已评估、3.待审核、5.已审核、6.已签约、7.已失效") @ApiModelProperty("1.采集中、2.已评估、3.待审核、5.已审核、6.已签约、7.已失效")
private Integer pointStatus; private Integer pointStatus;
@ApiModelProperty(value = "铺位状态列表", hidden = true)
private List<Integer> pointStatusList;
public List<Integer> getPointStatusList() {
List<Integer> pointStatusList = new ArrayList<>();
if (pointStatus != null) {
pointStatusList.add(pointStatus);
}
if(PointStatusEnum.POINT_STATUS_3.getCode().equals(pointStatus)){
pointStatusList.add(PointStatusEnum.POINT_STATUS_4.getCode());
}
return pointStatusList;
}
} }

View File

@@ -0,0 +1,19 @@
package com.cool.store.request;
import com.cool.store.common.PageBasicInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: TodoPageRequest
* @Description:
* @date 2024-04-11 14:30
*/
@Data
public class PointTodoPageRequest extends PageBasicInfo {
@ApiModelProperty(value = "扩展经理", hidden = true)
private String developmentManager;
}

View File

@@ -1,9 +1,13 @@
package com.cool.store.request; package com.cool.store.request;
import com.cool.store.common.PageBasicInfo; import com.cool.store.common.PageBasicInfo;
import com.cool.store.enums.point.PointStatusEnum;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/** /**
* @author zhangchenbiao * @author zhangchenbiao
* @FileName: RecommendPointPageRequest * @FileName: RecommendPointPageRequest
@@ -19,4 +23,18 @@ public class RecommendPointPageRequest extends PageBasicInfo {
@ApiModelProperty(value = "拓展专员", hidden = true) @ApiModelProperty(value = "拓展专员", hidden = true)
private String developmentManager; private String developmentManager;
@ApiModelProperty(value = "铺位状态列表", hidden = true)
private List<Integer> pointStatusList;
public List<Integer> getPointStatusList() {
List<Integer> pointStatusList = new ArrayList<>();
if (pointStatus != null) {
pointStatusList.add(pointStatus);
}
if(PointStatusEnum.POINT_STATUS_3.getCode().equals(pointStatus)){
pointStatusList.add(PointStatusEnum.POINT_STATUS_4.getCode());
}
return pointStatusList;
}
} }

View File

@@ -2,6 +2,7 @@ package com.cool.store.vo.point;
import com.cool.store.entity.PointDetailInfoDO; import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.entity.PointInfoDO; import com.cool.store.entity.PointInfoDO;
import com.cool.store.enums.point.PointStatusEnum;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@@ -31,7 +32,7 @@ public class PointDetailVO {
@ApiModelProperty("详细地址") @ApiModelProperty("详细地址")
private String address; private String address;
@ApiModelProperty("铺位状态 1.采集中、2.已评估、3.待审核、4.待审核可推荐、5.已审核、6.已签约、7.已失效") @ApiModelProperty("铺位状态 1.采集中、2.已评估、3.待审核、5.已审核、6.已签约、7.已失效")
private Integer pointStatus; private Integer pointStatus;
@ApiModelProperty("铺位得分") @ApiModelProperty("铺位得分")
@@ -236,6 +237,9 @@ public class PointDetailVO {
result.setLatitude(pointInfo.getLatitude()); result.setLatitude(pointInfo.getLatitude());
result.setAddress(pointInfo.getAddress()); result.setAddress(pointInfo.getAddress());
result.setPointStatus(pointInfo.getPointStatus()); result.setPointStatus(pointInfo.getPointStatus());
if(PointStatusEnum.POINT_STATUS_4.getCode().equals(pointInfo.getPointStatus())){
result.setPointStatus(PointStatusEnum.POINT_STATUS_3.getCode());
}
result.setPointScore(pointInfo.getPointScore()); result.setPointScore(pointInfo.getPointScore());
result.setBussinessStatus(pointDetailInfo.getBussinessStatus()); result.setBussinessStatus(pointDetailInfo.getBussinessStatus());
result.setNineFlowRate(pointDetailInfo.getNineFlowRate()); result.setNineFlowRate(pointDetailInfo.getNineFlowRate());

View File

@@ -1,7 +1,7 @@
package com.cool.store.vo.point; package com.cool.store.vo.point;
import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.entity.PointInfoDO; import com.cool.store.entity.PointInfoDO;
import com.cool.store.enums.point.PointStatusEnum;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@@ -30,7 +30,7 @@ public class PointPageVO {
@ApiModelProperty("所属站区") @ApiModelProperty("所属站区")
private String regionNodeName; private String regionNodeName;
@ApiModelProperty("铺位状态 1.采集中、2.已评估、3.待审核、4.待审核可推荐、5.已审核、6.已签约、7.已失效") @ApiModelProperty("铺位状态 1.采集中、2.已评估、3.待审核、5.已审核、6.已签约、7.已失效")
private Integer pointStatus; private Integer pointStatus;
@ApiModelProperty("铺位得分") @ApiModelProperty("铺位得分")
@@ -48,6 +48,15 @@ public class PointPageVO {
@ApiModelProperty("选择状态0.未选择, 1.已被选择") @ApiModelProperty("选择状态0.未选择, 1.已被选择")
private Integer selectStatus; private Integer selectStatus;
@ApiModelProperty("铺位地址")
private String address;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
public static List<PointPageVO> convertVO(List<PointInfoDO> pointList, Map<String, String> usernameMap, Map<Long, String> regionNameMap) { public static List<PointPageVO> convertVO(List<PointInfoDO> pointList, Map<String, String> usernameMap, Map<Long, String> regionNameMap) {
@@ -63,11 +72,17 @@ public class PointPageVO {
pointPageVO.setRegionId(pointInfo.getRegionId()); pointPageVO.setRegionId(pointInfo.getRegionId());
pointPageVO.setRegionNodeName(regionNameMap.get(pointInfo.getRegionId())); pointPageVO.setRegionNodeName(regionNameMap.get(pointInfo.getRegionId()));
pointPageVO.setPointStatus(pointInfo.getPointStatus()); pointPageVO.setPointStatus(pointInfo.getPointStatus());
if(PointStatusEnum.POINT_STATUS_4.getCode().equals(pointInfo.getPointStatus())){
pointPageVO.setPointStatus(PointStatusEnum.POINT_STATUS_3.getCode());
}
pointPageVO.setPointScore(pointInfo.getPointScore()); pointPageVO.setPointScore(pointInfo.getPointScore());
pointPageVO.setPointArea(pointInfo.getPointArea()); pointPageVO.setPointArea(pointInfo.getPointArea());
pointPageVO.setDevelopmentManagerUsername(usernameMap.get(pointInfo.getDevelopmentManager())); pointPageVO.setDevelopmentManagerUsername(usernameMap.get(pointInfo.getDevelopmentManager()));
pointPageVO.setDevelopmentTime(pointInfo.getDevelopmentTime()); pointPageVO.setDevelopmentTime(pointInfo.getDevelopmentTime());
pointPageVO.setSelectStatus(pointInfo.getSelectStatus()); pointPageVO.setSelectStatus(pointInfo.getSelectStatus());
pointPageVO.setAddress(pointInfo.getAddress());
pointPageVO.setCreateTime(pointInfo.getCreateTime());
pointPageVO.setUpdateTime(pointInfo.getUpdateTime());
resultList.add(pointPageVO); resultList.add(pointPageVO);
} }
return resultList; return resultList;

View File

@@ -2,6 +2,7 @@ package com.cool.store.vo.point;
import com.cool.store.entity.PointInfoDO; import com.cool.store.entity.PointInfoDO;
import com.cool.store.entity.PointRecommendDO; import com.cool.store.entity.PointRecommendDO;
import com.cool.store.enums.point.PointStatusEnum;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@@ -35,7 +36,7 @@ public class PointRecommendPageVO {
@ApiModelProperty("所属站区") @ApiModelProperty("所属站区")
private String regionNodeName; private String regionNodeName;
@ApiModelProperty("铺位状态 1.采集中、2.已评估、3.待审核、4.待审核可推荐、5.已审核、6.已签约、7.已失效") @ApiModelProperty("铺位状态 1.采集中、2.已评估、3.待审核、5.已审核、6.已签约、7.已失效")
private Integer pointStatus; private Integer pointStatus;
@ApiModelProperty("铺位得分") @ApiModelProperty("铺位得分")
@@ -71,6 +72,9 @@ public class PointRecommendPageVO {
recommend.setRegionId(pointInfo.getRegionId()); recommend.setRegionId(pointInfo.getRegionId());
recommend.setRegionNodeName(regionNameMap.get(pointInfo.getRegionId())); recommend.setRegionNodeName(regionNameMap.get(pointInfo.getRegionId()));
recommend.setPointStatus(pointInfo.getPointStatus()); recommend.setPointStatus(pointInfo.getPointStatus());
if(PointStatusEnum.POINT_STATUS_4.getCode().equals(pointInfo.getPointStatus())){
recommend.setPointStatus(PointStatusEnum.POINT_STATUS_3.getCode());
}
recommend.setPointScore(pointInfo.getPointScore()); recommend.setPointScore(pointInfo.getPointScore());
recommend.setPointArea(pointInfo.getPointArea()); recommend.setPointArea(pointInfo.getPointArea());
recommend.setDevelopmentManagerUsername(usernameMap.get(pointInfo.getDevelopmentManager())); recommend.setDevelopmentManagerUsername(usernameMap.get(pointInfo.getDevelopmentManager()));

View File

@@ -0,0 +1,54 @@
package com.cool.store.vo.shop;
import com.cool.store.enums.point.ShopStageEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: ShopStageEnumVO
* @Description:
* @date 2024-04-11 11:13
*/
@Data
public class ShopStageVO {
@ApiModelProperty("大阶段")
private Integer shopStage;
@ApiModelProperty("阶段名称")
private String shopStageName;
@ApiModelProperty("子阶段")
private List<ShopSubStageVO> shopSubStageList;
public ShopStageVO(Integer shopStage, String shopStageName, List<ShopSubStageVO> shopSubStageList) {
this.shopStage = shopStage;
this.shopStageName = shopStageName;
this.shopSubStageList = shopSubStageList;
}
public static List<ShopStageVO> getShopStageList() {
List<ShopStageVO> shopStageList = new ArrayList<>();
for (ShopStageEnum shopStageEnum : ShopStageEnum.values()) {
List<ShopSubStageVO> shopSubStageList = new ArrayList<>();
List<ShopSubStageEnum> shopSubStageEnumList = ShopSubStageEnum.getShopStageEnum(shopStageEnum.getShopStage());
for (ShopSubStageEnum shopSubStageEnum : shopSubStageEnumList) {
List<ShopSubStageStatusVO> subStageStatusList = new ArrayList<>();
List<ShopSubStageStatusEnum> shopSubStageStatusEnum = ShopSubStageStatusEnum.getShopSubStageStatusEnum(shopSubStageEnum);
for (ShopSubStageStatusEnum subStageStatusEnum : shopSubStageStatusEnum) {
subStageStatusList.add(new ShopSubStageStatusVO(subStageStatusEnum.getShopSubStageStatus(), subStageStatusEnum.getShopSubStageStatusName()));
}
shopSubStageList.add(new ShopSubStageVO(shopSubStageEnum.getShopSubStage(), shopSubStageEnum.getShopSubStageName(), subStageStatusList));
}
shopStageList.add(new ShopStageVO(shopStageEnum.getShopStage(), shopStageEnum.getStageName(), shopSubStageList));
}
return shopStageList;
}
}

View File

@@ -0,0 +1,25 @@
package com.cool.store.vo.shop;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: ShopSubStageStatusVO
* @Description:
* @date 2024-04-11 11:16
*/
@Data
public class ShopSubStageStatusVO {
@ApiModelProperty("店铺子阶段状态code")
private Integer shopSubStageStatus;
@ApiModelProperty("店铺子阶段状态name")
private String shopSubStageStatusName;
public ShopSubStageStatusVO(Integer shopSubStageStatus, String shopSubStageStatusName) {
this.shopSubStageStatus = shopSubStageStatus;
this.shopSubStageStatusName = shopSubStageStatusName;
}
}

View File

@@ -0,0 +1,32 @@
package com.cool.store.vo.shop;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: ShopSubStageStatusVO
* @Description:
* @date 2024-04-11 11:12
*/
@Data
public class ShopSubStageVO {
@ApiModelProperty("子阶段code")
private Integer shopSubStage;
@ApiModelProperty("子阶段名称")
private String shopSubStageName;
@ApiModelProperty("子阶段状态")
private List<ShopSubStageStatusVO> subStageStatusList;
public ShopSubStageVO(Integer shopSubStage, String shopSubStageName, List<ShopSubStageStatusVO> subStageStatusList) {
this.shopSubStage = shopSubStage;
this.shopSubStageName = shopSubStageName;
this.subStageStatusList = subStageStatusList;
}
}

View File

@@ -0,0 +1,25 @@
package com.cool.store.service;
import com.cool.store.entity.AuditStatusDO;
import java.util.List;
public interface AuditStatusService {
List<AuditStatusDO> list();
/**
* 稽核
* @return
*/
Boolean audit();
/**
*插入数据
* @return
*/
int insert(Long lineId,
Long interviewId,
Long auditId,
Integer auditStage);
}

View File

@@ -13,7 +13,7 @@ import java.util.List;
* @Description: * @Description:
* @date 2024-03-29 15:25 * @date 2024-03-29 15:25
*/ */
public interface ShopPointService { public interface PointService {
/** /**
* 新增铺位 * 新增铺位
@@ -185,4 +185,12 @@ public interface ShopPointService {
* @return * @return
*/ */
Integer updateWantShopNum(UpdateWantShopNumRequest request); Integer updateWantShopNum(UpdateWantShopNumRequest request);
/**
* 获取待办列表
* @param request
* @return
*/
PageInfo<PointPageVO> getTodoList(PointTodoPageRequest request);
} }

View File

@@ -4,6 +4,7 @@ import com.cool.store.entity.RegionDO;
import com.cool.store.vo.RegionPathNameVO; import com.cool.store.vo.RegionPathNameVO;
import java.util.List; import java.util.List;
import java.util.Map;
public interface RegionService { public interface RegionService {
@@ -16,6 +17,13 @@ public interface RegionService {
*/ */
String getBelongWarRegionName(Long regionId); String getBelongWarRegionName(Long regionId);
/**
* 获取所属战区
* @param regionIds
* @return
*/
Map<Long, String> getBelongWarRegionNameMap(List<Long> regionIds);
/** /**
* 根据意向区域找大区id * 根据意向区域找大区id
* @param wantShopAreaId * @param wantShopAreaId

View File

@@ -0,0 +1,20 @@
package com.cool.store.service;
import com.cool.store.entity.LineInfoDO;
/**
* @author zhangchenbiao
* @FileName: ShopService
* @Description:店铺
* @date 2024-04-11 10:25
*/
public interface ShopService {
/**
* 初始化店铺数据
* @param lineInfo
* @return
*/
Integer initShop(LineInfoDO lineInfo);
}

View File

@@ -0,0 +1,55 @@
package com.cool.store.service;
import com.cool.store.dao.ShopInfoDAO;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.point.ShopStageEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.utils.NumberConverter;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @author zhangchenbiao
* @FileName: ShopServiceImpl
* @Description:
* @date 2024-04-11 10:26
*/
@Service
public class ShopServiceImpl implements ShopService{
@Resource
private ShopInfoDAO shopInfoDAO;
@Resource
private ShopStageInfoDAO shopStageInfoDAO;
@Override
@Transactional(rollbackFor = Exception.class)
public Integer initShop(LineInfoDO lineInfo) {
if(Objects.isNull(lineInfo)){
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
Integer wantShopNum = lineInfo.getWantShopNum();
List<ShopInfoDO> addShopList = new ArrayList<>();
for (int i = 0; i < wantShopNum; i++) {
ShopInfoDO shopInfo = new ShopInfoDO();
shopInfo.setRegionId(lineInfo.getRegionId());
shopInfo.setLineId(lineInfo.getId());
shopInfo.setPartnerId(lineInfo.getPartnerId());
shopInfo.setShopName("店铺" + NumberConverter.convertArabicToChinese(i + 1));
addShopList.add(shopInfo);
}
shopInfoDAO.batchAddShop(addShopList);
List<ShopInfoDO> shopList = shopInfoDAO.getShopList(lineInfo.getId());
List<Long> shopIds = shopList.stream().map(ShopInfoDO::getId).collect(Collectors.toList());
return shopStageInfoDAO.initShopStageInfo(lineInfo.getId(), shopIds, ShopStageEnum.SHOP_STAGE_1);
}
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.service.impl;
import com.cool.store.entity.AuditStatusDO;
import com.cool.store.mapper.AuditStatusMapper;
import com.cool.store.service.AuditStatusService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
@Slf4j
public class AuditStatusServiceImpl implements AuditStatusService {
@Resource
AuditStatusMapper auditStatusMapper;
@Override
public List<AuditStatusDO> list() {
return null;
}
@Override
public Boolean audit() {
return null;
}
@Override
public int insert(Long lineId, Long interviewId, Long auditId,Integer auditStage) {
AuditStatusDO auditStatusDO = new AuditStatusDO();
auditStatusDO.setLineId(lineId);
auditStatusDO.setInterviewId(interviewId);
auditStatusDO.setAuditId(auditId);
auditStatusDO.setAuditStage(auditStage);
int result = auditStatusMapper.insertSelective(auditStatusDO);
return result;
}
}

View File

@@ -190,11 +190,11 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId()); LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
initiatingDO.setKdzBusinessId(lineInfoDO.getId() + "_" + lineInfoDO.getWorkflowSubStageStatus()); initiatingDO.setKdzBusinessId(lineInfoDO.getId() + "_" + lineInfoDO.getWorkflowSubStageStatus());
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, initiatingDO, InitiatingResponse.class); InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, initiatingDO, InitiatingResponse.class);
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode()); if (initiatingResponse.getCode() != 0L){
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
if (initiatingResponse.getCode() != 0){
return new ResponseResult(500,initiatingResponse.getMsg(),initiatingResponse.getData()); return new ResponseResult(500,initiatingResponse.getMsg(),initiatingResponse.getData());
}else { }else {
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
return new ResponseResult(200000,initiatingResponse.getMsg(),initiatingResponse.getData()); return new ResponseResult(200000,initiatingResponse.getMsg(),initiatingResponse.getData());
} }
} }
@@ -222,7 +222,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(lineInfoDO.getWantShopAreaId()); HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(lineInfoDO.getWantShopAreaId());
franchiseeDO.setProvinceCode(String.valueOf(openAreaInfoDO.getParentId())); franchiseeDO.setProvinceCode(String.valueOf(openAreaInfoDO.getParentId()));
franchiseeDO.setCityCode(String.valueOf(openAreaInfoDO.getId())); franchiseeDO.setCityCode(String.valueOf(openAreaInfoDO.getId()));
//操作人工号 暂时写死 //todo 操作人工号 暂时写死
LoginUserInfo user = CurrentUserHolder.getUser(); LoginUserInfo user = CurrentUserHolder.getUser();
franchiseeDO.setOperator("22090043"); franchiseeDO.setOperator("22090043");
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, franchiseeDO, InitiatingResponse.class); InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, franchiseeDO, InitiatingResponse.class);

View File

@@ -15,6 +15,7 @@ import com.cool.store.request.JoinIntentionRequest;
import com.cool.store.service.JoinIntentionService; import com.cool.store.service.JoinIntentionService;
import com.cool.store.service.OpenAreaService; import com.cool.store.service.OpenAreaService;
import com.cool.store.service.UserAuthMappingService; import com.cool.store.service.UserAuthMappingService;
import com.cool.store.utils.poi.StringUtils;
import com.cool.store.vo.PartnerBaseInfoVO; import com.cool.store.vo.PartnerBaseInfoVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -54,6 +55,9 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
@Resource @Resource
RegionAreaConfigDao regionAreaConfigDao; RegionAreaConfigDao regionAreaConfigDao;
@Resource
LineInfoMapper lineInfoMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean submit(JoinIntentionRequest request) { public boolean submit(JoinIntentionRequest request) {
@@ -69,7 +73,8 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
if (Objects.isNull(lineInfoParam)) { if (Objects.isNull(lineInfoParam)) {
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
} }
if (Objects.nonNull(request.getAreaCode())){ LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
if ((Objects.nonNull(request.getAreaCode()) && Objects.nonNull(lineInfoDO) && StringUtils.isBlank(lineInfoDO.getInvestmentManager())) || (Objects.isNull(lineInfoDO))){
EnterpriseUserDO userByRoleNameAndAreaId = userAuthMappingService.getUserByRoleEnumAndAreaId(UserRoleEnum.INVESTMENT_MANAGER, Long.valueOf(request.getAreaCode())); EnterpriseUserDO userByRoleNameAndAreaId = userAuthMappingService.getUserByRoleEnumAndAreaId(UserRoleEnum.INVESTMENT_MANAGER, Long.valueOf(request.getAreaCode()));
lineInfoParam.setInvestmentManager(userByRoleNameAndAreaId.getUserId()); lineInfoParam.setInvestmentManager(userByRoleNameAndAreaId.getUserId());
} }

View File

@@ -34,7 +34,7 @@ public class KdzApiServiceImpl implements KdzApiService {
String kdzBusinessId = request.getKdzBusinessId(); String kdzBusinessId = request.getKdzBusinessId();
String lineId = splitMethod(kdzBusinessId); String lineId = splitMethod(kdzBusinessId);
if (StringUtil.isBlank(lineId)){ if (StringUtil.isBlank(lineId)){
throw new ServiceException("kdzBusinessId解析异常,请检查"); throw new ServiceException(ErrorCodeEnum.BUSINESS_ID_NOT_EXIST);
} }
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(Long.valueOf(lineId)); LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(Long.valueOf(lineId));
if (Objects.isNull(lineInfoDO)){ if (Objects.isNull(lineInfoDO)){

View File

@@ -8,6 +8,7 @@ import com.cool.store.dto.interview.LineInterviewPageDTO;
import com.cool.store.entity.*; import com.cool.store.entity.*;
import com.cool.store.enums.*; import com.cool.store.enums.*;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.AuditStatusMapper;
import com.cool.store.request.*; import com.cool.store.request.*;
import com.cool.store.service.*; import com.cool.store.service.*;
import com.cool.store.utils.TRTCUtils; import com.cool.store.utils.TRTCUtils;
@@ -71,6 +72,11 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
private TransferLogService transferLogService; private TransferLogService transferLogService;
@Resource @Resource
private HyPartnerUserChannelDAO hyPartnerUserChannelDAO; private HyPartnerUserChannelDAO hyPartnerUserChannelDAO;
@Resource
private ShopService shopService;
@Resource
AuditStatusService auditStatusService;
@Override @Override
public List<AppointmentTimeVO> getAppointmentTime(Long lineId, Integer interviewType, LocalDate appointmentDate) { public List<AppointmentTimeVO> getAppointmentTime(Long lineId, Integer interviewType, LocalDate appointmentDate) {
@@ -402,6 +408,8 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
if(!WorkflowSubStageEnum.SECOND_INTERVIEWS.equals(workflowSubStageEnum)){ if(!WorkflowSubStageEnum.SECOND_INTERVIEWS.equals(workflowSubStageEnum)){
//更新线索阶段 //更新线索阶段
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus()); lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus());
//一审稽核
auditStatusService.insert(lineInfo.getId(),interviewInfo.getId(),auditId,AuditStageEnum.ONE.getCode());
}else{ }else{
LineInfoDO updateLine = new LineInfoDO(); LineInfoDO updateLine = new LineInfoDO();
updateLine.setId(lineInfo.getId()); updateLine.setId(lineInfo.getId());
@@ -412,7 +420,9 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
updateLine.setDevelopmentManager(developmentManager); updateLine.setDevelopmentManager(developmentManager);
lineInfoDAO.updateLineInfo(updateLine); lineInfoDAO.updateLineInfo(updateLine);
//初始化店铺 //初始化店铺
shopService.initShop(lineInfo);
//二审稽核
auditStatusService.insert(lineInfo.getId(),interviewInfo.getId(),auditId,AuditStageEnum.TWO.getCode());
} }
return lineInterviewDAO.updateInterviewInfo(updateInterviewInfo) > 0; return lineInterviewDAO.updateInterviewInfo(updateInterviewInfo) > 0;
} }

View File

@@ -16,7 +16,7 @@ import com.cool.store.exception.ServiceException;
import com.cool.store.request.*; import com.cool.store.request.*;
import com.cool.store.service.LabelService; import com.cool.store.service.LabelService;
import com.cool.store.service.RegionService; import com.cool.store.service.RegionService;
import com.cool.store.service.ShopPointService; import com.cool.store.service.PointService;
import com.cool.store.service.UserAuthMappingService; import com.cool.store.service.UserAuthMappingService;
import com.cool.store.utils.RedisUtilPool; import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.poi.StringUtils; import com.cool.store.utils.poi.StringUtils;
@@ -46,7 +46,7 @@ import java.util.stream.Collectors;
*/ */
@Slf4j @Slf4j
@Service @Service
public class ShopPointServiceImpl implements ShopPointService { public class PointServiceImpl implements PointService {
@Resource @Resource
private ShopInfoDAO shopInfoDAO; private ShopInfoDAO shopInfoDAO;
@@ -122,7 +122,7 @@ public class ShopPointServiceImpl implements ShopPointService {
if(Objects.isNull(pointInfo) || Objects.isNull(pointDetailInfo)){ if(Objects.isNull(pointInfo) || Objects.isNull(pointDetailInfo)){
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
} }
if(!pointDetailInfo.isCanSubmitEvaluable()){ if(!pointDetailInfo.isCanSubmitEvaluable() || StringUtils.isBlank(pointInfo.getPointArea())){
throw new ServiceException(ErrorCodeEnum.POINT_NOT_COMPLETE); throw new ServiceException(ErrorCodeEnum.POINT_NOT_COMPLETE);
} }
Integer totalPointScore = pointDetailInfo.getTotalPointScore(); Integer totalPointScore = pointDetailInfo.getTotalPointScore();
@@ -216,7 +216,7 @@ public class ShopPointServiceImpl implements ShopPointService {
if(Objects.isNull(auditSetting)){ if(Objects.isNull(auditSetting)){
throw new ServiceException(ErrorCodeEnum.POINT_AUDIT_NOT_SETTING); throw new ServiceException(ErrorCodeEnum.POINT_AUDIT_NOT_SETTING);
} }
List<AuditNodeDTO> auditNode = dealAuditNode(auditSetting, pointInfo); List<AuditNodeDTO> auditNode = dealAuditNode(auditSetting, pointInfo.getRegionId(), request.getOperateUserId(), pointInfo.getDevelopmentManager());
//获取审批节点上的数据 //获取审批节点上的数据
List<PointAuditRecordDO> recordList = AuditNodeDTO.convertDO(pointId, submitAuditCount, auditNode); List<PointAuditRecordDO> recordList = AuditNodeDTO.convertDO(pointId, submitAuditCount, auditNode);
pointAuditRecordDAO.addPointAuditRecord(recordList); pointAuditRecordDAO.addPointAuditRecord(recordList);
@@ -399,16 +399,13 @@ public class ShopPointServiceImpl implements ShopPointService {
@Override @Override
public PageInfo<PointPageVO> getMyPointPage(PointPageRequest request) { public PageInfo<PointPageVO> getMyPointPage(PointPageRequest request) {
if(Objects.nonNull(request.getPointStatus()) && PointStatusEnum.POINT_STATUS_3.getCode().equals(request.getPointStatus())){
request.setPointStatus(CommonConstants.ONE == request.getStorageStatus() ? PointStatusEnum.POINT_STATUS_4.getCode() : PointStatusEnum.POINT_STATUS_3.getCode());
}
List<PointPageVO> resultList = new ArrayList(); List<PointPageVO> resultList = new ArrayList();
Page<PointInfoDO> pointPage = pointInfoDAO.getMyPointPage(request); Page<PointInfoDO> pointPage = pointInfoDAO.getMyPointPage(request);
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){ if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList()); List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList()); List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers); Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
Map<Long, String> regionNameMap = new HashMap<>(); Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
resultList = PointPageVO.convertVO(pointPage.getResult(), userNameMap, regionNameMap); resultList = PointPageVO.convertVO(pointPage.getResult(), userNameMap, regionNameMap);
} }
PageInfo resultPage = new PageInfo(pointPage); PageInfo resultPage = new PageInfo(pointPage);
@@ -441,16 +438,13 @@ public class ShopPointServiceImpl implements ShopPointService {
@Override @Override
public PageInfo<PointPageVO> getRecommendPointList(RecommendPointPageRequest request) { public PageInfo<PointPageVO> getRecommendPointList(RecommendPointPageRequest request) {
if(Objects.nonNull(request.getPointStatus()) && PointStatusEnum.POINT_STATUS_3.getCode().equals(request.getPointStatus())){
request.setPointStatus(PointStatusEnum.POINT_STATUS_4.getCode());
}
List<PointPageVO> resultList = new ArrayList(); List<PointPageVO> resultList = new ArrayList();
Page<PointInfoDO> pointPage = pointInfoDAO.getRecommendPointList(request); Page<PointInfoDO> pointPage = pointInfoDAO.getRecommendPointList(request);
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){ if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList()); List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList()); List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers); Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
Map<Long, String> regionNameMap = new HashMap<>(); Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
resultList = PointPageVO.convertVO(pointPage.getResult(), userNameMap, regionNameMap); resultList = PointPageVO.convertVO(pointPage.getResult(), userNameMap, regionNameMap);
} }
PageInfo resultPage = new PageInfo(pointPage); PageInfo resultPage = new PageInfo(pointPage);
@@ -500,7 +494,23 @@ public class ShopPointServiceImpl implements ShopPointService {
return lineInfoDAO.updateLineInfo(updateLine); return lineInfoDAO.updateLineInfo(updateLine);
} }
public List<AuditNodeDTO> dealAuditNode(AuditSettingVO auditSetting, PointInfoDO pointInfo) { @Override
public PageInfo<PointPageVO> getTodoList(PointTodoPageRequest request) {
Page<PointInfoDO> pointPage = pointTodoInfoDAO.getUserTodoList(request);
List<PointPageVO> resultList = new ArrayList<>();
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
List<String> developmentManagers = pointPage.stream().map(PointInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList());
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(developmentManagers);
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
resultList = PointPageVO.convertVO(pointPage.getResult(), userNameMap, regionNameMap);
}
PageInfo resultPage = new PageInfo(pointPage);
resultPage.setList(resultList);
return resultPage;
}
public List<AuditNodeDTO> dealAuditNode(AuditSettingVO auditSetting, Long regionId, String operateUserId, String developmentManager) {
List<String> roleIds = new ArrayList<>(); List<String> roleIds = new ArrayList<>();
//审核人 //审核人
Pair<List<String>, List<String>> firstApproval = getUserIdsAndPositionIds(auditSetting.getFirstApproval()); Pair<List<String>, List<String>> firstApproval = getUserIdsAndPositionIds(auditSetting.getFirstApproval());
@@ -520,17 +530,17 @@ public class ShopPointServiceImpl implements ShopPointService {
roleIds.addAll(fifthApproval.getValue()); roleIds.addAll(fifthApproval.getValue());
} }
List<AuditNodeDTO> resultList = new ArrayList<>(); List<AuditNodeDTO> resultList = new ArrayList<>();
Map<String, List<String>> userIdsMap = userAuthMappingService.getUserIdByRoleIdAndRegionId(roleIds, pointInfo.getRegionId()); Map<String, List<String>> userIdsMap = userAuthMappingService.getUserIdByRoleIdAndRegionId(roleIds, regionId);
List<String> firstApprovalUserIds = getUserIdsByPositionIds(firstApproval, userIdsMap); List<String> firstApprovalUserIds = getUserIdsByPositionIds(firstApproval, userIdsMap);
List<String> thirdApprovalUserIds = getUserIdsByPositionIds(thirdApproval, userIdsMap); List<String> thirdApprovalUserIds = getUserIdsByPositionIds(thirdApproval, userIdsMap);
List<String> fourthApprovalUserIds = getUserIdsByPositionIds(fourthApproval, userIdsMap); List<String> fourthApprovalUserIds = getUserIdsByPositionIds(fourthApproval, userIdsMap);
List<String> fifthApprovalUserIds = getUserIdsByPositionIds(fifthApproval, userIdsMap); List<String> fifthApprovalUserIds = getUserIdsByPositionIds(fifthApproval, userIdsMap);
resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_0.getCode(), PointAuditRecordDO.SUBMIT_TASK, Boolean.FALSE, Arrays.asList(pointInfo.getDevelopmentManager()))); resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_0.getCode(), PointAuditRecordDO.SUBMIT_TASK, Boolean.FALSE, Arrays.asList(developmentManager)));
if(CollectionUtils.isNotEmpty(firstApprovalUserIds)){ if(CollectionUtils.isNotEmpty(firstApprovalUserIds)){
resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_1.getCode(), PointAuditRecordDO.RECEIVE_TASK, Boolean.TRUE, firstApprovalUserIds)); resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_1.getCode(), PointAuditRecordDO.RECEIVE_TASK, Boolean.TRUE, firstApprovalUserIds));
resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_2.getCode(), Arrays.asList(pointInfo.getOperateUserId()))); resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_2.getCode(), Arrays.asList(operateUserId)));
}else{ }else{
resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_2.getCode(), PointAuditRecordDO.RECEIVE_TASK, Boolean.TRUE, Arrays.asList(pointInfo.getOperateUserId()))); resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_2.getCode(), PointAuditRecordDO.RECEIVE_TASK, Boolean.TRUE, Arrays.asList(operateUserId)));
} }
if(CollectionUtils.isNotEmpty(thirdApprovalUserIds)){ if(CollectionUtils.isNotEmpty(thirdApprovalUserIds)){

View File

@@ -15,6 +15,7 @@ import com.cool.store.utils.RedisConstantUtil;
import com.cool.store.utils.RedisUtilPool; import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.poi.constant.Constants; import com.cool.store.utils.poi.constant.Constants;
import com.cool.store.vo.RegionPathNameVO; import com.cool.store.vo.RegionPathNameVO;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -100,6 +101,18 @@ public class RegionServiceImpl implements RegionService {
return ""; return "";
} }
@Override
public Map<Long, String> getBelongWarRegionNameMap(List<Long> regionIds) {
if(CollectionUtils.isEmpty(regionIds)){
return Maps.newHashMap();
}
Map<Long, String> regionNameMap = Maps.newHashMap();
for (Long regionId : regionIds) {
regionNameMap.put(regionId, getBelongWarRegionName(regionId));
}
return regionNameMap;
}
/** /**
* 根据意向区域找大区id * 根据意向区域找大区id
* @param wantShopAreaId * @param wantShopAreaId

View File

@@ -31,7 +31,7 @@ public class KdzApiController {
@RequestBody XfsgOpenApiRequest request) { @RequestBody XfsgOpenApiRequest request) {
log.info("auditResult requestBody :{}", JSONObject.toJSONString(request)); log.info("auditResult requestBody :{}", JSONObject.toJSONString(request));
if(!verifyMD5(request,eid)){ if(!verifyMD5(request,eid)){
return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR); return ResponseResult.fail(ErrorCodeEnum.VERIFY_MD5_FALSE);
} }
if(eid == null || request.getBizContent() == null){ if(eid == null || request.getBizContent() == null){
return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR); return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
@@ -46,11 +46,8 @@ public class KdzApiController {
//用户唯一标识id //用户唯一标识id
sb.append("timestamp=").append(request.getTimestamp()).append("&"); sb.append("timestamp=").append(request.getTimestamp()).append("&");
//企业唯一标识enterpriseId //企业唯一标识enterpriseId
sb.append("enterpriseId=").append(eid).append("&"); sb.append("enterpriseId=").append(eid);
sb.append("bizContent=").append(request.getBizContent());
String md5 = EncryptUtil.xfsgMd5(sb.toString()); String md5 = EncryptUtil.xfsgMd5(sb.toString());
return md5.equals(request.getSign()); return md5.equals(request.getSign());
} }

View File

@@ -7,6 +7,7 @@ import com.cool.store.entity.*;
import com.cool.store.enums.MessageEnum; import com.cool.store.enums.MessageEnum;
import com.cool.store.mapper.HyOpenAreaInfoMapper; import com.cool.store.mapper.HyOpenAreaInfoMapper;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.service.ShopService;
import com.cool.store.service.impl.CommonService; import com.cool.store.service.impl.CommonService;
import com.cool.store.utils.poi.ExcelUtil; import com.cool.store.utils.poi.ExcelUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -26,6 +27,10 @@ public class PCTestController {
@Resource @Resource
private CommonService commonService; private CommonService commonService;
@Resource
private LineInfoDAO lineInfoDAO;
@Resource
private ShopService shopService;
@GetMapping("/sendMessage") @GetMapping("/sendMessage")
@@ -33,4 +38,11 @@ public class PCTestController {
commonService.sendMessage(Arrays.asList("123836131931284423"), 1L, MessageEnum.MESSAGE_1, "张三", "浙江-杭州"); commonService.sendMessage(Arrays.asList("123836131931284423"), 1L, MessageEnum.MESSAGE_1, "张三", "浙江-杭州");
return ResponseResult.success(Boolean.FALSE); return ResponseResult.success(Boolean.FALSE);
} }
@GetMapping("/initShop")
public ResponseResult<Boolean> initShop(@RequestParam("lineId")Long lineId){
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
shopService.initShop(lineInfo);
return ResponseResult.success(Boolean.FALSE);
}
} }

View File

@@ -1,11 +1,14 @@
package com.cool.store.controller.webb; package com.cool.store.controller.webb;
import com.cool.store.context.CurrentUserHolder; import com.cool.store.context.CurrentUserHolder;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.request.*; import com.cool.store.request.*;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.service.ShopPointService; import com.cool.store.service.PointService;
import com.cool.store.vo.LinePointBaseInfoVO; import com.cool.store.vo.LinePointBaseInfoVO;
import com.cool.store.vo.point.*; import com.cool.store.vo.point.*;
import com.cool.store.vo.shop.ShopStageVO;
import com.cool.store.vo.shop.ShopSubStageVO;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -24,159 +27,171 @@ import java.util.List;
@Api(tags = "铺位") @Api(tags = "铺位")
@RestController @RestController
@RequestMapping("/pc/point") @RequestMapping("/pc/point")
public class ShopPointController { public class PointController {
@Resource @Resource
private ShopPointService shopPointService; private PointService pointService;
@ApiOperation("新增铺位") @ApiOperation("新增铺位")
@PostMapping("/add") @PostMapping("/add")
public ResponseResult<Long> addPointDetailInfo(@RequestBody @Validated AddPointDetailRequest shopPointDetailRequest) { public ResponseResult<Long> addPointDetailInfo(@RequestBody @Validated AddPointDetailRequest shopPointDetailRequest) {
return ResponseResult.success(shopPointService.addPointDetailInfo(shopPointDetailRequest, CurrentUserHolder.getUserId())); return ResponseResult.success(pointService.addPointDetailInfo(shopPointDetailRequest, CurrentUserHolder.getUserId()));
} }
@ApiOperation("铺位详情") @ApiOperation("铺位详情")
@GetMapping("/detail") @GetMapping("/detail")
public ResponseResult<PointDetailVO> getPointDetailInfo(@RequestParam("pointId")Long pointId) { public ResponseResult<PointDetailVO> getPointDetailInfo(@RequestParam("pointId")Long pointId) {
return ResponseResult.success(shopPointService.getPointDetailInfo(pointId)); return ResponseResult.success(pointService.getPointDetailInfo(pointId));
} }
@ApiOperation("完善铺位") @ApiOperation("完善铺位")
@PostMapping("/update") @PostMapping("/update")
public ResponseResult<Integer> updatePointDetailInfo(@RequestBody @Validated UpdatePointDetailRequest shopPointDetailRequest) { public ResponseResult<Integer> updatePointDetailInfo(@RequestBody @Validated UpdatePointDetailRequest shopPointDetailRequest) {
return ResponseResult.success(shopPointService.updatePointDetailInfo(shopPointDetailRequest)); return ResponseResult.success(pointService.updatePointDetailInfo(shopPointDetailRequest));
} }
@ApiOperation("生成评估报告") @ApiOperation("生成评估报告")
@GetMapping("/generateEvaluationReport") @PostMapping("/generateEvaluationReport")
public ResponseResult<Integer> generateEvaluationReport(@RequestBody PointIdRequest request) { public ResponseResult<Integer> generateEvaluationReport(@RequestBody PointIdRequest request) {
return ResponseResult.success(shopPointService.generateEvaluationReport(request.getPointId())); return ResponseResult.success(pointService.generateEvaluationReport(request.getPointId()));
} }
@ApiOperation("铺位失效") @ApiOperation("铺位失效")
@PostMapping("/invalid") @PostMapping("/invalid")
public ResponseResult<Integer> pointInvalid(@RequestBody PointIdRequest request) { public ResponseResult<Integer> pointInvalid(@RequestBody PointIdRequest request) {
return ResponseResult.success(shopPointService.pointInvalid(request.getPointId())); return ResponseResult.success(pointService.pointInvalid(request.getPointId()));
} }
@ApiOperation("铺位解绑") @ApiOperation("铺位解绑")
@PostMapping("/unbind") @PostMapping("/unbind")
public ResponseResult<Integer> pointUnbind(@RequestBody PointIdRequest request) { public ResponseResult<Integer> pointUnbind(@RequestBody PointIdRequest request) {
return ResponseResult.success(shopPointService.pointUnbind(request.getPointId())); return ResponseResult.success(pointService.pointUnbind(request.getPointId()));
} }
@ApiOperation("配置评估报告") @ApiOperation("配置高德评估报告")
@PostMapping("/addMapEvaluationReport") @PostMapping("/addMapEvaluationReport")
public ResponseResult<Integer> addMapEvaluationReport(@RequestBody AddMapEvaluationReportRequest request) { public ResponseResult<Integer> addMapEvaluationReport(@RequestBody AddMapEvaluationReportRequest request) {
return ResponseResult.success(shopPointService.addMapEvaluationReport(request)); return ResponseResult.success(pointService.addMapEvaluationReport(request));
} }
@ApiOperation("提交审批") @ApiOperation("选址人员提交审批")
@PostMapping("/submitAudit") @PostMapping("/submitAudit")
public ResponseResult<Integer> submitAudit(@RequestBody @Validated SubmitPointAuditRequest request) { public ResponseResult<Integer> submitAudit(@RequestBody @Validated SubmitPointAuditRequest request) {
return ResponseResult.success(shopPointService.submitAudit(request)); return ResponseResult.success(pointService.submitAudit(request));
} }
@ApiOperation("选址审批设置") @ApiOperation("选址审批设置")
@PostMapping("/auditSetting") @PostMapping("/auditSetting")
public ResponseResult<Integer> auditSetting(@RequestBody AuditSettingRequest request) { public ResponseResult<Integer> auditSetting(@RequestBody AuditSettingRequest request) {
return ResponseResult.success(shopPointService.auditSetting(request)); return ResponseResult.success(pointService.auditSetting(request));
} }
@ApiOperation("获取选址审批设置") @ApiOperation("获取选址审批设置")
@GetMapping("/getAuditSetting") @GetMapping("/getAuditSetting")
public ResponseResult<AuditSettingVO> getAuditSetting() { public ResponseResult<AuditSettingVO> getAuditSetting() {
return ResponseResult.success(shopPointService.getAuditSetting()); return ResponseResult.success(pointService.getAuditSetting());
} }
@ApiOperation("获取催办用户列表") @ApiOperation("获取催办用户列表")
@GetMapping("/getTodoUserList") @GetMapping("/getTodoUserList")
public ResponseResult<List<String>> getTodoUserList(@RequestParam("pointId")Long pointId) { public ResponseResult<List<String>> getTodoUserList(@RequestParam("pointId")Long pointId) {
return ResponseResult.success(shopPointService.getTodoUserList(pointId)); return ResponseResult.success(pointService.getTodoUserList(pointId));
} }
@ApiOperation("营运人员审批") @ApiOperation("营运人员审批")
@PostMapping("/operationUserAudit") @PostMapping("/operationUserAudit")
public ResponseResult<Integer> operationUserAudit(@RequestBody @Validated OperationAuditRequest request) { public ResponseResult<Integer> operationUserAudit(@RequestBody @Validated OperationAuditRequest request) {
return ResponseResult.success(shopPointService.operationUserAudit(CurrentUserHolder.getUserId(), request)); return ResponseResult.success(pointService.operationUserAudit(CurrentUserHolder.getUserId(), request));
} }
@ApiOperation("审批(排除第二级审批)") @ApiOperation("审批(排除第二级审批)")
@PostMapping("/audit") @PostMapping("/audit")
public ResponseResult<Integer> audit(@RequestBody PointAuditRequest request) { public ResponseResult<Integer> audit(@RequestBody PointAuditRequest request) {
return ResponseResult.success(shopPointService.audit(CurrentUserHolder.getUserId(), request)); return ResponseResult.success(pointService.audit(CurrentUserHolder.getUserId(), request));
} }
@ApiOperation("铺位转让") @ApiOperation("铺位转让")
@PostMapping("/turnDevelopmentManager") @PostMapping("/turnDevelopmentManager")
public ResponseResult<Integer> turnDevelopmentManager(@RequestBody @Validated TurnDevelopmentManagerRequest request) { public ResponseResult<Integer> turnDevelopmentManager(@RequestBody @Validated TurnDevelopmentManagerRequest request) {
return ResponseResult.success(shopPointService.turnDevelopmentManager(request)); return ResponseResult.success(pointService.turnDevelopmentManager(request));
} }
@ApiOperation("获取我负责的加盟商列表") @ApiOperation("获取我负责的加盟商列表")
@PostMapping("/getLinePage") @PostMapping("/getLinePage")
public ResponseResult<PageInfo<LinePointBaseInfoVO>> getLinePage(@RequestBody PointLinePageRequest request) { public ResponseResult<PageInfo<LinePointBaseInfoVO>> getLinePage(@RequestBody PointLinePageRequest request) {
request.setDevelopmentManager(CurrentUserHolder.getUserId()); request.setDevelopmentManager(CurrentUserHolder.getUserId());
return ResponseResult.success(shopPointService.getLinePage(request)); return ResponseResult.success(pointService.getLinePage(request));
} }
@ApiOperation("首页我的数据") @ApiOperation("首页我的数据")
@GetMapping("/getMyData") @GetMapping("/getMyData")
public ResponseResult<PointHomePageDataVO> getMyPointData() { public ResponseResult<PointHomePageDataVO> getMyPointData() {
return ResponseResult.success(shopPointService.getMyPointData(CurrentUserHolder.getUserId())); return ResponseResult.success(pointService.getMyPointData(CurrentUserHolder.getUserId()));
} }
@ApiOperation("我的铺位-已入库/暂未入库") @ApiOperation("我的铺位-已入库/暂未入库")
@PostMapping("/getMyPointPage") @PostMapping("/getMyPointPage")
public ResponseResult<PageInfo<PointPageVO>> getMyPointPage(@RequestBody @Validated PointPageRequest request) { public ResponseResult<PageInfo<PointPageVO>> getMyPointPage(@RequestBody @Validated PointPageRequest request) {
request.setDevelopmentManager(CurrentUserHolder.getUserId()); request.setDevelopmentManager(CurrentUserHolder.getUserId());
return ResponseResult.success(shopPointService.getMyPointPage(request)); return ResponseResult.success(pointService.getMyPointPage(request));
} }
@ApiOperation("获取单个铺位审批记录") @ApiOperation("获取单个铺位审批记录")
@GetMapping("/getAuditRecord") @GetMapping("/getAuditRecord")
public ResponseResult<List<PointAuditRecordVO>> getPointAllAuditRecord(@RequestParam("pointId")Long pointId) { public ResponseResult<List<PointAuditRecordVO>> getPointAllAuditRecord(@RequestParam("pointId")Long pointId) {
return ResponseResult.success(shopPointService.getPointAllAuditRecord(pointId)); return ResponseResult.success(pointService.getPointAllAuditRecord(pointId));
} }
@ApiOperation("获取加盟商的推荐铺位列表") @ApiOperation("获取加盟商的推荐铺位列表")
@GetMapping("/getLineRecommendPointList") @GetMapping("/getLineRecommendPointList")
public ResponseResult<List<PointRecommendPageVO>> getLineRecommendPointList(@RequestParam("lineId")Long lineId) { public ResponseResult<List<PointRecommendPageVO>> getLineRecommendPointList(@RequestParam("lineId")Long lineId) {
return ResponseResult.success(shopPointService.getLineRecommendPointList(lineId)); return ResponseResult.success(pointService.getLineRecommendPointList(lineId));
} }
@ApiOperation("选址人员获取可推荐铺位列表") @ApiOperation("选址人员获取可推荐铺位列表")
@PostMapping("/getRecommendPointList") @PostMapping("/getRecommendPointList")
public ResponseResult<PageInfo<PointPageVO>> getRecommendPointList(@RequestBody @Validated RecommendPointPageRequest request) { public ResponseResult<PageInfo<PointPageVO>> getRecommendPointList(@RequestBody @Validated RecommendPointPageRequest request) {
request.setDevelopmentManager(CurrentUserHolder.getUserId()); request.setDevelopmentManager(CurrentUserHolder.getUserId());
return ResponseResult.success(shopPointService.getRecommendPointList(request)); return ResponseResult.success(pointService.getRecommendPointList(request));
} }
@ApiOperation("加盟商详情推送铺位") @ApiOperation("加盟商详情推送铺位")
@PostMapping("/lineRecommendPoint") @PostMapping("/lineRecommendPoint")
public ResponseResult<Integer> lineRecommendPoint(@RequestBody @Validated LineRecommendPointRequest request) { public ResponseResult<Integer> lineRecommendPoint(@RequestBody @Validated LineRecommendPointRequest request) {
request.setDevelopmentManager(CurrentUserHolder.getUserId()); request.setDevelopmentManager(CurrentUserHolder.getUserId());
return ResponseResult.success(shopPointService.lineRecommendPoint(request)); return ResponseResult.success(pointService.lineRecommendPoint(request));
} }
@ApiOperation("铺位详情推送加盟商") @ApiOperation("铺位详情推送加盟商")
@PostMapping("/pointRecommendLine") @PostMapping("/pointRecommendLine")
public ResponseResult<Integer> pointRecommendLine(@RequestBody @Validated PointRecommendLineRequest request) { public ResponseResult<Integer> pointRecommendLine(@RequestBody @Validated PointRecommendLineRequest request) {
request.setDevelopmentManager(CurrentUserHolder.getUserId()); request.setDevelopmentManager(CurrentUserHolder.getUserId());
return ResponseResult.success(shopPointService.pointRecommendLine(request)); return ResponseResult.success(pointService.pointRecommendLine(request));
} }
@ApiOperation("选址人员转让加盟商") @ApiOperation("选址人员转让加盟商")
@PostMapping("/turnLine") @PostMapping("/turnLine")
public ResponseResult<Integer> turnLine(@RequestBody @Validated TurnLineRequest request) { public ResponseResult<Integer> turnLine(@RequestBody @Validated TurnLineRequest request) {
return ResponseResult.success(shopPointService.turnLine(request)); return ResponseResult.success(pointService.turnLine(request));
} }
@ApiOperation("修改意向开店数量") @ApiOperation("修改意向开店数量")
@PostMapping("/updateWantShopNum") @PostMapping("/updateWantShopNum")
public ResponseResult<Integer> updateWantShopNum(@RequestBody @Validated UpdateWantShopNumRequest request) { public ResponseResult<Integer> updateWantShopNum(@RequestBody @Validated UpdateWantShopNumRequest request) {
return ResponseResult.success(shopPointService.updateWantShopNum(request)); return ResponseResult.success(pointService.updateWantShopNum(request));
} }
@ApiOperation("获取阶段/子阶段/子阶段状态枚举")
@GetMapping("/getShopSubStageStatusEnum")
public ResponseResult<List<ShopStageVO>> getShopSubStageStatusEnum() {
return ResponseResult.success(ShopStageVO.getShopStageList());
}
@ApiOperation("获取待办列表")
@PostMapping("/getTodoList")
public ResponseResult<PageInfo<PointPageVO>> getTodoList(@RequestBody PointTodoPageRequest request) {
request.setDevelopmentManager(CurrentUserHolder.getUserId());
return ResponseResult.success(pointService.getTodoList(request));
}
} }