This commit is contained in:
zhangchenbiao
2024-04-07 15:41:12 +08:00
parent bb1ef733c6
commit ca87658f5e
38 changed files with 1664 additions and 74 deletions

View File

@@ -0,0 +1,40 @@
package com.cool.store.enums;
/**
* @author zhangchenbiao
* @FileName: AuditStatusEnum
* @Description:
* @date 2024-03-20 14:55
*/
public enum AuditStatusEnum {
TODO(0, "待处理"),
PASS(1, "通过"),
REJECT(2, "拒绝");
private Integer code;
private String name;
private AuditStatusEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
public static AuditStatusEnum getByCode(Integer code) {
for (AuditStatusEnum auditStatusEnum : AuditStatusEnum.values()) {
if (auditStatusEnum.getCode().equals(code)) {
return auditStatusEnum;
}
}
return null;
}
}

View File

@@ -83,6 +83,10 @@ public enum ErrorCodeEnum {
POINT_NOT_EXIST(600001, "铺位信息不存在", null), POINT_NOT_EXIST(600001, "铺位信息不存在", null),
POINT_SIGNED(600002, "操作失败,铺位已签约", null), POINT_SIGNED(600002, "操作失败,铺位已签约", null),
NOT_ALLOW_OPERATE(600003, "当前状态不允许该操作", null), NOT_ALLOW_OPERATE(600003, "当前状态不允许该操作", null),
POINT_AUDIT_NOT_SETTING(600004, "选址审批未设置", null),
NO_PERMISSION(600004, "暂无处理审批任务权限", null),
POINT_AUDIT_NODE_ERROR(600005, "当前审批任务异常", null),
USER_NOT_TODO_AUDIT(600005, "当前用户没有待审批的任务", null),
INTERVIEW_ENTER_FAIL(1021101, "进入面审间失败", null), INTERVIEW_ENTER_FAIL(1021101, "进入面审间失败", null),
DINGDING_USER_NOT_EXIST(1021102, "用户钉钉信息不存在,无法发起资质审核!", null), DINGDING_USER_NOT_EXIST(1021102, "用户钉钉信息不存在,无法发起资质审核!", null),

View File

@@ -0,0 +1,70 @@
package com.cool.store.enums;
import com.google.common.collect.Lists;
import java.util.List;
public enum NodeNoEnum {
NODE_NO_0(0,"提交任务"),
NODE_NO_1(1,"第一级审批"),
NODE_NO_2(2,"第二级审批"),
NODE_NO_3(3,"第三级审批"),
NODE_NO_4(4,"第四级审批"),
NODE_NO_5(5,"第五级审批"),
NODE_NO_100(100,"结束"),
;
private Integer code;
private String typeName;
NodeNoEnum(Integer code, String typeName) {
this.code = code;
this.typeName = typeName;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
/**
* 获取之后的审批节点集合
* @param nodeNo
* @return
*/
public static List<NodeNoEnum> getNextNodeNoList(Integer nodeNo){
if(nodeNo == NodeNoEnum.NODE_NO_1.getCode()){
return Lists.newArrayList(NodeNoEnum.NODE_NO_2, NodeNoEnum.NODE_NO_3, NodeNoEnum.NODE_NO_4, NodeNoEnum.NODE_NO_5);
}else if(nodeNo == NodeNoEnum.NODE_NO_2.getCode()){
return Lists.newArrayList(NodeNoEnum.NODE_NO_3, NodeNoEnum.NODE_NO_4, NodeNoEnum.NODE_NO_5);
}else if(nodeNo == NodeNoEnum.NODE_NO_3.getCode()){
return Lists.newArrayList(NodeNoEnum.NODE_NO_4, NodeNoEnum.NODE_NO_5);
}else if(nodeNo == NodeNoEnum.NODE_NO_4.getCode()){
return Lists.newArrayList(NodeNoEnum.NODE_NO_5);
}else {
return Lists.newArrayList();
}
}
public static NodeNoEnum getByCode(Integer code){
for(NodeNoEnum nodeNoEnum : NodeNoEnum.values()){
if(nodeNoEnum.getCode().equals(code)){
return nodeNoEnum;
}
}
return null;
}
}

View File

@@ -11,7 +11,9 @@ import com.cool.store.request.LineListRequest;
import com.cool.store.request.PartnerRequest; import com.cool.store.request.PartnerRequest;
import com.cool.store.request.PublicLineListRequest; import com.cool.store.request.PublicLineListRequest;
import com.cool.store.vo.PublicLineListVO; import com.cool.store.vo.PublicLineListVO;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@@ -64,6 +66,15 @@ public class LineInfoDAO {
return lineInfoMapper.updateByPrimaryKeySelective(lineInfo); return lineInfoMapper.updateByPrimaryKeySelective(lineInfo);
} }
public Integer batchUpdateInterviewWorkflowStage(List<Long> lineIds, WorkflowSubStageEnum workflowSubStage, WorkflowSubStageStatusEnum workflowSubStageStatus) {
if(Objects.isNull(workflowSubStageStatus) || CollectionUtils.isEmpty(lineIds)){
log.info("更新线索阶段,子阶段 和 子阶段状态不能同时为空");
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
return lineInfoMapper.batchUpdateInterviewWorkflowStage(lineIds, workflowSubStage.getCode(), workflowSubStageStatus.getCode());
}
public Integer updateWorkflowStageAndInterviewer(Long lineId, WorkflowSubStageStatusEnum workflowSubStageStatus, String firstInterviewer, String secondInterviewer) { public Integer updateWorkflowStageAndInterviewer(Long lineId, WorkflowSubStageStatusEnum workflowSubStageStatus, String firstInterviewer, String secondInterviewer) {
LineInfoDO lineInfo = new LineInfoDO(); LineInfoDO lineInfo = new LineInfoDO();
lineInfo.setId(lineId); lineInfo.setId(lineId);
@@ -115,4 +126,8 @@ public class LineInfoDAO {
public void insertOrUpdate(LineInfoDO lineInfoParam){ public void insertOrUpdate(LineInfoDO lineInfoParam){
lineInfoMapper.insertOrUpdate(lineInfoParam); lineInfoMapper.insertOrUpdate(lineInfoParam);
} }
public List<LineInfoDO> getLineListByDevelopmentManager(String developmentManager) {
return Lists.newArrayList();
}
} }

View File

@@ -2,6 +2,7 @@ package com.cool.store.dao;
import com.cool.store.dto.interview.LineInterviewPageDTO; import com.cool.store.dto.interview.LineInterviewPageDTO;
import com.cool.store.entity.LineInterviewDO; import com.cool.store.entity.LineInterviewDO;
import com.cool.store.enums.InterviewStatusEnum;
import com.cool.store.enums.InterviewTypeEnum; import com.cool.store.enums.InterviewTypeEnum;
import com.cool.store.mapper.LineInterviewMapper; import com.cool.store.mapper.LineInterviewMapper;
import com.cool.store.request.LineInterviewPageRequest; import com.cool.store.request.LineInterviewPageRequest;
@@ -82,4 +83,15 @@ public class LineInterviewDAO {
public List<LineInterviewDO> getInterviewByLineId(Long lineId){ public List<LineInterviewDO> getInterviewByLineId(Long lineId){
return lineInterviewMapper.getInterviewByLineId(lineId); return lineInterviewMapper.getInterviewByLineId(lineId);
} }
public List<LineInterviewDO> getWaitAuditInterview(){
return lineInterviewMapper.getWaitAuditInterview();
}
public Integer batchUpdateInterviewStatus(List<Long> interviewIds, InterviewStatusEnum interviewStatus) {
if(CollectionUtils.isEmpty(interviewIds) || Objects.isNull(interviewIds)){
return null;
}
return lineInterviewMapper.batchUpdateInterviewStatus(interviewIds, interviewStatus.getCode());
}
} }

View File

@@ -0,0 +1,60 @@
package com.cool.store.dao;
import com.cool.store.entity.PointAuditRecordDO;
import com.cool.store.enums.AuditStatusEnum;
import com.cool.store.enums.NodeNoEnum;
import com.cool.store.mapper.PointAuditRecordMapper;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@Repository
public class PointAuditRecordDAO {
@Resource
private PointAuditRecordMapper pointAuditRecordMapper;
/**
* 新增审批记录
* @param historyList
*/
public void addPointAuditRecord(List<PointAuditRecordDO> recordList) {
pointAuditRecordMapper.batchInsertSelective(recordList);
}
public List<PointAuditRecordDO> getPointAuditRecord(Long pointId, Integer cycleCount) {
if(Objects.isNull(pointId)){
return Lists.newArrayList();
}
return pointAuditRecordMapper.getPointAuditRecord(pointId, cycleCount);
}
public Map<Integer, PointAuditRecordDO> getPointAuditRecordMap(Long pointId, Integer cycleCount) {
if(Objects.isNull(pointId) || Objects.isNull(cycleCount)){
return Maps.newHashMap();
}
List<PointAuditRecordDO> pointAuditRecord = pointAuditRecordMapper.getPointAuditRecord(pointId, cycleCount);
return pointAuditRecord.stream().collect(Collectors.toMap(k->k.getNodeNo(), v->v));
}
public Integer updatePointAuditRecord(PointAuditRecordDO param) {
if(Objects.isNull(param) || Objects.isNull(param.getId())){
return null;
}
return pointAuditRecordMapper.updateByPrimaryKeySelective(param);
}
public Integer deletePointAuditRecord(Long pointId, Integer cycleCount) {
if(Objects.isNull(pointId) || Objects.isNull(cycleCount)){
return null;
}
return pointAuditRecordMapper.deletePointAuditRecord(pointId, cycleCount);
}
}

View File

@@ -0,0 +1,45 @@
package com.cool.store.dao;
import com.cool.store.entity.PointTodoInfoDO;
import com.cool.store.enums.NodeNoEnum;
import com.cool.store.mapper.PointTodoInfoMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
@Repository
public class PointTodoInfoDAO {
@Resource
private PointTodoInfoMapper pointTodoInfoMapper;
public Integer addPointTodoInfo(List<PointTodoInfoDO> todoList) {
if(CollectionUtils.isEmpty(todoList)){
return null;
}
return pointTodoInfoMapper.batchInsertSelective(todoList);
}
public List<String> getTodoUserList(Long pointId) {
return pointTodoInfoMapper.getTodoUserList(pointId);
}
public List<PointTodoInfoDO> getTodoList(Long pointId) {
return pointTodoInfoMapper.getTodoList(pointId);
}
public Integer updatePointTodoInfo(Long pointId, Integer nodeNo, Integer cycleCount, String handlerUserId) {
return pointTodoInfoMapper.updatePointTodoInfo(pointId, nodeNo, cycleCount, handlerUserId);
}
public PointTodoInfoDO getPointToDoByUserIdAndPointId(String userId, Long pointId){
if(StringUtils.isBlank(userId) || Objects.isNull(pointId)){
return null;
}
return pointTodoInfoMapper.getPointToDoByUserIdAndPointId(userId, pointId);
}
}

View File

@@ -62,4 +62,6 @@ public interface LineInfoMapper extends Mapper<LineInfoDO> {
void toExperiencing(@Param("lineIds") List<Long> lineIds, void toExperiencing(@Param("lineIds") List<Long> lineIds,
@Param("code") Integer code); @Param("code") Integer code);
Integer batchUpdateInterviewWorkflowStage(@Param("lineIds") List<Long> lineIds, @Param("workflowSubStage")Integer workflowSubStage, @Param("workflowSubStageStatus")Integer workflowSubStageStatus);
} }

View File

@@ -48,5 +48,24 @@ public interface LineInterviewMapper extends Mapper<LineInterviewDO> {
*/ */
Integer deleteInterviewInfo(@Param("interviewId")Long interviewId); Integer deleteInterviewInfo(@Param("interviewId")Long interviewId);
/**
* 获取面试信息
* @param lineId
* @return
*/
List<LineInterviewDO> getInterviewByLineId(@Param("lineId") Long lineId); List<LineInterviewDO> getInterviewByLineId(@Param("lineId") Long lineId);
/**
* 获取待审核面试信息
* @return
*/
List<LineInterviewDO> getWaitAuditInterview();
/**
* 批量更新面试状态
* @param interviewIds
* @param interviewStatus
* @return
*/
Integer batchUpdateInterviewStatus(@Param("interviewIds") List<Long> interviewIds, @Param("interviewStatus") Integer interviewStatus);
} }

View File

@@ -0,0 +1,34 @@
package com.cool.store.mapper;
import com.cool.store.entity.PointAuditRecordDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.Date;
import java.util.List;
public interface PointAuditRecordMapper extends Mapper<PointAuditRecordDO> {
/**
* 批量插入
* @param addList
* @return
*/
Integer batchInsertSelective(@Param("addList") List<PointAuditRecordDO> addList);
/**
* 获取处理记录
* @param pointId
* @param cycleCount
* @return
*/
List<PointAuditRecordDO> getPointAuditRecord(@Param("pointId") Long pointId, @Param("cycleCount")Integer cycleCount);
/**
* 删除未完成的处理记录
* @param pointId
* @param cycleCount
* @return
*/
Integer deletePointAuditRecord(@Param("pointId") Long pointId, @Param("cycleCount") Integer cycleCount);
}

View File

@@ -0,0 +1,49 @@
package com.cool.store.mapper;
import com.cool.store.entity.PointTodoInfoDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface PointTodoInfoMapper extends Mapper<PointTodoInfoDO> {
/**
* 批量插入
* @param addList
* @return
*/
Integer batchInsertSelective(@Param("addList") List<PointTodoInfoDO> addList);
/**
* 获取待办用户列表
* @param pointId
* @return
*/
List<String> getTodoUserList(@Param("pointId") Long pointId);
/**
* 获取待办列表
* @param pointId
* @return
*/
List<PointTodoInfoDO> getTodoList(@Param("pointId") Long pointId);
/**
* 更新待办
* @param pointId
* @param code
* @param cycleCount
* @param handlerUserId
* @return
*/
Integer updatePointTodoInfo(@Param("pointId") Long pointId, @Param("nodeNo") Integer nodeNo, @Param("cycleCount") Integer cycleCount, @Param("handlerUserId") String handlerUserId);
/**
* 获取用户关于某个铺位的待办
* @param userId
* @param pointId
* @return
*/
PointTodoInfoDO getPointToDoByUserIdAndPointId(String userId, Long pointId);
}

View File

@@ -427,5 +427,13 @@
and investment_manager = #{request.lastInvestmentManagerUserId} and investment_manager = #{request.lastInvestmentManagerUserId}
</if> </if>
</select> </select>
<update id="batchUpdateInterviewWorkflowStage">
update xfsg_line_info set workflow_sub_stage = #{workflowSubStage}, workflow_sub_stage_status = #{workflowSubStageStatus} where id in
<foreach collection="lineIds" item="lineId" open="(" separator="," close=")">
#{lineId}
</foreach>
and workflow_sub_stage_status = 15 and workflow_sub_stage = 5
</update>
</mapper> </mapper>

View File

@@ -112,4 +112,15 @@
and deleted = '0' and deleted = '0'
</select> </select>
<select id="getWaitAuditInterview" resultMap="BaseResultMap">
select id, line_id from xfsg_line_interview where interview_status = 1 and deleted = '0' and interview_type = 0 and now() >= end_time
</select>
<update id="batchUpdateInterviewStatus">
update xfsg_line_interview set interview_status = #{interviewStatus} where id in
<foreach collection="interviewIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</update>
</mapper> </mapper>

View File

@@ -0,0 +1,129 @@
<?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.PointAuditRecordMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointAuditRecordDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="point_id" jdbcType="BIGINT" property="pointId" />
<result column="node_no" jdbcType="INTEGER" property="nodeNo" />
<result column="cycle_count" jdbcType="TINYINT" property="cycleCount" />
<result column="action_remark" jdbcType="VARCHAR" property="actionRemark" />
<result column="handler_user_id" jdbcType="VARCHAR" property="handlerUserId" />
<result column="handler_user_ids" jdbcType="VARCHAR" property="handlerUserIds" />
<result column="receive_task_time" jdbcType="TIMESTAMP" property="receiveTaskTime" />
<result column="finish_task_time" jdbcType="TIMESTAMP" property="finishTaskTime" />
<result column="audit_status" jdbcType="TINYINT" property="auditStatus" />
<result column="sign_time" jdbcType="TIMESTAMP" property="signTime" />
<result column="sign_address" jdbcType="VARCHAR" property="signAddress" />
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
<result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<insert id="batchInsertSelective">
<foreach collection="addList" item="item" separator=";">
insert into xfsg_point_audit_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="item.pointId != null">
point_id,
</if>
<if test="item.nodeNo != null">
node_no,
</if>
<if test="item.cycleCount != null">
cycle_count,
</if>
<if test="item.actionRemark != null">
action_remark,
</if>
<if test="item.handlerUserId != null">
handler_user_id,
</if>
<if test="item.handlerUserIds != null">
handler_user_ids,
</if>
<if test="item.receiveTaskTime != null">
receive_task_time,
</if>
<if test="item.finishTaskTime != null">
finish_task_time,
</if>
<if test="item.auditStatus != null">
audit_status,
</if>
<if test="item.signTime != null">
sign_time,
</if>
<if test="item.signAddress != null">
sign_address,
</if>
<if test="item.pictureUrl != null">
picture_url,
</if>
<if test="item.reason != null">
reason,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="item.pointId != null">
#{item.pointId},
</if>
<if test="item.nodeNo != null">
#{item.nodeNo},
</if>
<if test="item.cycleCount != null">
#{item.cycleCount},
</if>
<if test="item.actionRemark != null">
#{item.actionRemark},
</if>
<if test="item.handlerUserId != null">
#{item.handlerUserId},
</if>
<if test="item.handlerUserIds != null">
#{item.handlerUserIds},
</if>
<if test="item.receiveTaskTime != null">
#{item.receiveTaskTime},
</if>
<if test="item.finishTaskTime != null">
#{item.finishTaskTime},
</if>
<if test="item.auditStatus != null">
#{item.auditStatus},
</if>
<if test="item.signTime != null">
#{item.signTime},
</if>
<if test="item.signAddress != null">
#{item.signAddress},
</if>
<if test="item.pictureUrl != null">
#{item.pictureUrl},
</if>
<if test="item.reason != null">
#{item.reason},
</if>
</trim>
</foreach>
</insert>
<select id="getPointAuditRecord" resultMap="BaseResultMap">
select
id, point_id, node_no, cycle_count, action_remark, handler_user_id, handler_user_ids, receive_task_time, finish_task_time, audit_status, sign_time, sign_address, picture_url, reason
from
xfsg_point_audit_record
where
point_id = #{pointId} and deleted = 0
<if test="cycleCount != null">
and cycle_count = #{cycleCount}
</if>
order by node_no asc
</select>
<update id="deletePointAuditRecord">
update xfsg_point_audit_record set deleted = 1 where point_id = #{pointId} and cycle_count = #{cycleCount} and audit_status = 0
</update>
</mapper>

View File

@@ -44,10 +44,10 @@
<result column="brand_use_rate" jdbcType="VARCHAR" property="brandUseRate" /> <result column="brand_use_rate" jdbcType="VARCHAR" property="brandUseRate" />
<result column="brand_use_fee" jdbcType="VARCHAR" property="brandUseFee" /> <result column="brand_use_fee" jdbcType="VARCHAR" property="brandUseFee" />
<result column="staff_fee" jdbcType="VARCHAR" property="staffFee" /> <result column="staff_fee" jdbcType="VARCHAR" property="staffFee" />
<result column="shop_manager_num" jdbcType="VARCHAR" property="shopManagerNum" /> <result column="shop_manager_num" jdbcType="INTEGER" property="shopManagerNum" />
<result column="shop_manager_fee" jdbcType="VARCHAR" property="shopManagerFee" /> <result column="shop_manager_fee" jdbcType="INTEGER" property="shopManagerFee" />
<result column="clerk_num" jdbcType="VARCHAR" property="clerkNum" /> <result column="clerk_num" jdbcType="INTEGER" property="clerkNum" />
<result column="clerk_fee" jdbcType="VARCHAR" property="clerkFee" /> <result column="clerk_fee" jdbcType="INTEGER" property="clerkFee" />
<result column="bonus" jdbcType="VARCHAR" property="bonus" /> <result column="bonus" jdbcType="VARCHAR" property="bonus" />
<result column="month_rent" jdbcType="VARCHAR" property="monthRent" /> <result column="month_rent" jdbcType="VARCHAR" property="monthRent" />
<result column="other_fee" jdbcType="VARCHAR" property="otherFee" /> <result column="other_fee" jdbcType="VARCHAR" property="otherFee" />

View File

@@ -0,0 +1,71 @@
<?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.PointTodoInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointTodoInfoDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="point_id" jdbcType="BIGINT" property="pointId" />
<result column="node_no" jdbcType="INTEGER" property="nodeNo" />
<result column="handler_user_id" jdbcType="VARCHAR" property="handlerUserId" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="cycle_count" jdbcType="TINYINT" property="cycleCount" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<insert id="batchInsertSelective">
<foreach collection="addList" separator=";" item="item">
insert into xfsg_point_todo_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="item.pointId != null">
point_id,
</if>
<if test="item.nodeNo != null">
node_no,
</if>
<if test="item.handlerUserId != null">
handler_user_id,
</if>
<if test="item.status != null">
status,
</if>
<if test="item.cycleCount != null">
cycle_count,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="item.pointId != null">
#{item.pointId},
</if>
<if test="item.nodeNo != null">
#{item.nodeNo},
</if>
<if test="item.handlerUserId != null">
#{item.handlerUserId},
</if>
<if test="item.status != null">
#{item.status},
</if>
<if test="item.cycleCount != null">
#{item.cycleCount},
</if>
</trim>
</foreach>
</insert>
<select id="getTodoUserList" resultType="java.lang.String">
select handler_user_id from xfsg_point_todo_info where point_id = #{pointId} and status = 0 and deleted = 0
</select>
<select id="getTodoList" resultMap="BaseResultMap">
select * from xfsg_point_todo_info where point_id = #{pointId} and status = 0 and deleted = 0
</select>
<select id="getPointToDoByUserIdAndPointId" resultMap="BaseResultMap">
select * from xfsg_point_todo_info where point_id = #{pointId} and handler_user_id = #{userId} and status = 0 and deleted = 0
</select>
<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>
</mapper>

View File

@@ -3,6 +3,6 @@ jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcoll
jdbc.user= coolstore jdbc.user= coolstore
jdbc.password = CSCErYcXniNYm7bT jdbc.password = CSCErYcXniNYm7bT
table.name = xfsg_shop_point_recommend table.name = xfsg_point_deal_record
table.object.class = ShopPointRecommendDO table.object.class = PointDealRecordDO
table.mapper = ShopPointRecommendMapper table.mapper = PointDealRecordMapper

View File

@@ -0,0 +1,96 @@
package com.cool.store.dto.point;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.entity.PointAuditRecordDO;
import com.cool.store.entity.PointTodoInfoDO;
import com.cool.store.enums.AuditStatusEnum;
import com.cool.store.enums.NodeNoEnum;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: AuditNodeDTO
* @Description:
* @date 2024-04-02 15:10
*/
@Data
public class AuditNodeDTO {
@ApiModelProperty("流程号")
private Integer nodeNo;
@ApiModelProperty("是否待处理")
private Boolean isToDo;
@ApiModelProperty("动作")
private String actionRemark;
@ApiModelProperty("用户id")
private List<String> userIds;
public AuditNodeDTO(Integer nodeNo, List<String> userIds) {
this.nodeNo = nodeNo;
this.userIds = userIds;
}
public AuditNodeDTO(Integer nodeNo, String actionRemark, Boolean isToDo, List<String> userIds) {
this.nodeNo = nodeNo;
this.actionRemark = actionRemark;
this.isToDo = isToDo;
this.userIds = userIds;
}
public static List<PointAuditRecordDO> convertDO(Long pointId, Integer cycleCount, List<AuditNodeDTO> nodeList){
if(CollectionUtils.isEmpty(nodeList)){
return Lists.newArrayList();
}
List<PointAuditRecordDO> resultList = new ArrayList<>();
for (AuditNodeDTO auditNode : nodeList) {
PointAuditRecordDO node = new PointAuditRecordDO();
node.setPointId(pointId);
node.setNodeNo(auditNode.getNodeNo());
node.setCycleCount(cycleCount);
node.setActionRemark(auditNode.getActionRemark());
node.setHandlerUserIds(JSONObject.toJSONString(auditNode.getUserIds()));
if(Objects.nonNull(auditNode.isToDo) && auditNode.isToDo){
node.setReceiveTaskTime(new Date());
}
if(NodeNoEnum.NODE_NO_0.getCode().equals(auditNode.getNodeNo())){
node.setHandlerUserId(auditNode.getUserIds().get(0));
node.setReceiveTaskTime(new Date());
node.setFinishTaskTime(new Date());
node.setAuditStatus(AuditStatusEnum.PASS.getCode());
}
resultList.add(node);
}
return resultList;
}
public static List<PointTodoInfoDO> convertTODO(Long pointId, Integer cycleCount, List<AuditNodeDTO> nodeList){
if(CollectionUtils.isEmpty(nodeList)){
return Lists.newArrayList();
}
List<PointTodoInfoDO> resultList = new ArrayList<>();
for (AuditNodeDTO auditNode : nodeList) {
if(Objects.nonNull(auditNode.isToDo) && auditNode.isToDo){
for (String userId : auditNode.getUserIds()) {
PointTodoInfoDO todo = new PointTodoInfoDO();
todo.setPointId(pointId);
todo.setNodeNo(auditNode.getNodeNo());
todo.setHandlerUserId(userId);
todo.setCycleCount(cycleCount);
resultList.add(todo);
}
}
}
return resultList;
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.entity; package com.cool.store.entity;
import com.cool.store.enums.InterviewStatusEnum;
import com.cool.store.utils.UUIDUtils; import com.cool.store.utils.UUIDUtils;
import lombok.Data; import lombok.Data;
@@ -150,6 +151,7 @@ public class LineInterviewDO {
addInterview.setInterviewerUserId(interviewer); addInterview.setInterviewerUserId(interviewer);
addInterview.setInterviewType(interviewType); addInterview.setInterviewType(interviewType);
addInterview.setCalendarsEventId(calendarsEventId); addInterview.setCalendarsEventId(calendarsEventId);
addInterview.setInterviewStatus(InterviewStatusEnum.WAIT_INTERVIEW.getCode());
return addInterview; return addInterview;
} }

View File

@@ -0,0 +1,169 @@
package com.cool.store.entity;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dto.point.AuditNodeDTO;
import com.cool.store.enums.AuditStatusEnum;
import com.cool.store.enums.NodeNoEnum;
import com.cool.store.request.PointAuditRequest;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
@Data
@Table(name = "xfsg_point_audit_record")
public class PointAuditRecordDO {
public final static String SUBMIT_TASK = "提交审批任务";
public final static String RECEIVE_TASK = "收到任务";
public final static String AUDIT_PASS = "审批通过";
public final static String AUDIT_REJECT = "审批拒绝";
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 点位id
*/
@Column(name = "point_id")
private Long pointId;
/**
* 当前节点 0提交审批任务 1-5级审批, 100完成
*/
@Column(name = "node_no")
private Integer nodeNo;
/**
* 轮次
*/
@Column(name = "cycle_count")
private Integer cycleCount;
/**
* 动作备注
*/
@Column(name = "action_remark")
private String actionRemark;
/**
* 实际处理人
*/
@Column(name = "handler_user_id")
private String handlerUserId;
/**
* 处理人集合
*/
@Column(name = "handler_user_ids")
private String handlerUserIds;
/**
* 收到任务时间
*/
@Column(name = "receive_task_time")
private Date receiveTaskTime;
/**
* 完成任务时间
*/
@Column(name = "finish_task_time")
private Date finishTaskTime;
/**
* 审核状态0待处理,1通过,2拒绝
*/
@Column(name = "audit_status")
private Integer auditStatus;
/**
* 签到时间
*/
@Column(name = "sign_time")
private Date signTime;
/**
* 签到位置
*/
@Column(name = "sign_address")
private String signAddress;
/**
* 图片
*/
@Column(name = "picture_url")
private String pictureUrl;
/**
* 原因
*/
private String reason;
/**
* 删除标识
*/
private Boolean deleted;
/**
* 创建时间
*/
@Column(name = "create_time")
private Date createTime;
/**
* 更新时间
*/
@Column(name = "update_time")
private Date updateTime;
public static List<PointTodoInfoDO> convertTODO(PointAuditRecordDO nextAuditRecord){
List<PointTodoInfoDO> resultList = new ArrayList<>();
List<String> handlerUserIds = JSONObject.parseArray(nextAuditRecord.getHandlerUserIds(), String.class);
for (String userId : handlerUserIds) {
PointTodoInfoDO todo = new PointTodoInfoDO();
todo.setPointId(nextAuditRecord.getPointId());
todo.setNodeNo(nextAuditRecord.getNodeNo());
todo.setHandlerUserId(userId);
todo.setCycleCount(nextAuditRecord.getCycleCount());
resultList.add(todo);
}
return resultList;
}
public static PointAuditRecordDO convert(Long auditRecordId, String handlerUserId, AuditStatusEnum auditStatus, String reason, NodeNoEnum nodeNoEnum){
PointAuditRecordDO updateAuditRecord = new PointAuditRecordDO();
updateAuditRecord.setId(auditRecordId);
updateAuditRecord.setHandlerUserId(handlerUserId);
updateAuditRecord.setAuditStatus(auditStatus.getCode());
updateAuditRecord.setReason(reason);
updateAuditRecord.setActionRemark(nodeNoEnum.getTypeName() + " " +auditStatus.getName());
updateAuditRecord.setFinishTaskTime(new Date());
return updateAuditRecord;
}
public static PointAuditRecordDO convert(Long auditRecordId, Date receiveTaskTime){
PointAuditRecordDO updateAuditRecord = new PointAuditRecordDO();
updateAuditRecord.setId(auditRecordId);
updateAuditRecord.setReceiveTaskTime(receiveTaskTime);
return updateAuditRecord;
}
public static PointAuditRecordDO convert(Long auditRecordId, String handlerUserId, AuditStatusEnum auditStatus, String reason, NodeNoEnum nodeNoEnum, Date signTime, String signAddress, String pictureUrl){
PointAuditRecordDO updateAuditRecord = new PointAuditRecordDO();
updateAuditRecord.setId(auditRecordId);
updateAuditRecord.setHandlerUserId(handlerUserId);
updateAuditRecord.setAuditStatus(auditStatus.getCode());
updateAuditRecord.setReason(reason);
updateAuditRecord.setActionRemark(nodeNoEnum.getTypeName() + " " +auditStatus.getName());
updateAuditRecord.setSignTime(signTime);
updateAuditRecord.setSignAddress(signAddress);
updateAuditRecord.setPictureUrl(pictureUrl);
updateAuditRecord.setFinishTaskTime(new Date());
return updateAuditRecord;
}
}

View File

@@ -265,25 +265,25 @@ public class PointDetailInfoDO {
* 店长数量 * 店长数量
*/ */
@Column(name = "shop_manager_num") @Column(name = "shop_manager_num")
private String shopManagerNum; private Integer shopManagerNum;
/** /**
* 店长费用 * 店长基本工资
*/ */
@Column(name = "shop_manager_fee") @Column(name = "shop_manager_fee")
private String shopManagerFee; private Integer shopManagerFee;
/** /**
* 店员数量 * 店员数量
*/ */
@Column(name = "clerk_num") @Column(name = "clerk_num")
private String clerkNum; private Integer clerkNum;
/** /**
* 店员费用 * 店员基本工资
*/ */
@Column(name = "clerk_fee") @Column(name = "clerk_fee")
private String clerkFee; private Integer clerkFee;
/** /**
* 奖金分红 * 奖金分红
@@ -587,12 +587,6 @@ public class PointDetailInfoDO {
if(Objects.isNull(this.staffFee)){ if(Objects.isNull(this.staffFee)){
return false; return false;
} }
if(Objects.isNull(this.shopManagerFee) || Objects.isNull(this.shopManagerNum)){
return false;
}
if(Objects.isNull(this.clerkFee) || Objects.isNull(this.clerkNum)){
return false;
}
if(Objects.isNull(this.bonus) || Objects.isNull(this.monthRent) ||Objects.isNull(this.otherFee)){ if(Objects.isNull(this.bonus) || Objects.isNull(this.monthRent) ||Objects.isNull(this.otherFee)){
return false; return false;
} }

View File

@@ -0,0 +1,61 @@
package com.cool.store.entity;
import lombok.Data;
import java.util.Date;
import javax.persistence.*;
@Data
@Table(name = "xfsg_point_todo_info")
public class PointTodoInfoDO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 铺位id
*/
@Column(name = "point_id")
private Long pointId;
/**
* 当前节点 0提交审批 1-5级审批, 100完成
*/
@Column(name = "node_no")
private Integer nodeNo;
/**
* 处理人
*/
@Column(name = "handler_user_id")
private String handlerUserId;
/**
* 0待完成1已完成
*/
private Integer status;
/**
* 轮次
*/
@Column(name = "cycle_count")
private Integer cycleCount;
/**
* 删除标识
*/
private Boolean deleted;
/**
* 创建时间
*/
@Column(name = "create_time")
private Date createTime;
/**
* 更新时间
*/
@Column(name = "update_time")
private Date updateTime;
}

View File

@@ -188,18 +188,6 @@ public class AddPointDetailRequest {
@ApiModelProperty("基本人工费用") @ApiModelProperty("基本人工费用")
private String staffFee; private String staffFee;
@ApiModelProperty("店长数量")
private String shopManagerNum;
@ApiModelProperty("店长费用")
private String shopManagerFee;
@ApiModelProperty("店员数量")
private String clerkNum;
@ApiModelProperty("店员费用")
private String clerkFee;
@ApiModelProperty("奖金分红") @ApiModelProperty("奖金分红")
private String bonus; private String bonus;
@@ -263,10 +251,6 @@ public class AddPointDetailRequest {
result.setBrandUseRate(request.getBrandUseRate()); result.setBrandUseRate(request.getBrandUseRate());
result.setBrandUseFee(request.getBrandUseFee()); result.setBrandUseFee(request.getBrandUseFee());
result.setStaffFee(request.getStaffFee()); result.setStaffFee(request.getStaffFee());
result.setShopManagerNum(request.getShopManagerNum());
result.setShopManagerFee(request.getShopManagerFee());
result.setClerkNum(request.getClerkNum());
result.setClerkFee(request.getClerkFee());
result.setBonus(request.getBonus()); result.setBonus(request.getBonus());
result.setMonthRent(request.getMonthRent()); result.setMonthRent(request.getMonthRent());
result.setOtherFee(request.getOtherFee()); result.setOtherFee(request.getOtherFee());

View File

@@ -0,0 +1,32 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: AuditSettingRequest
* @Description:
* @date 2024-04-02 14:11
*/
@Data
public class AuditSettingRequest {
@ApiModelProperty("第一级审批")
private List<UserAndPositionRequest> firstApproval;
@ApiModelProperty("第二级审批")
private List<UserAndPositionRequest> secondApproval;
@ApiModelProperty("第三级审批")
private List<UserAndPositionRequest> thirdApproval;
@ApiModelProperty("第四级审批")
private List<UserAndPositionRequest> fourthApproval;
@ApiModelProperty("第五级审批")
private List<UserAndPositionRequest> fifthApproval;
}

View File

@@ -0,0 +1,96 @@
package com.cool.store.request;
import com.cool.store.entity.PointDetailInfoDO;
import com.cool.store.enums.AuditResultTypeEnum;
import com.cool.store.enums.AuditStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.Objects;
/**
* @author zhangchenbiao
* @FileName: PointAuditRequest
* @Description:
* @date 2024-04-03 14:13
*/
@Data
public class OperationAuditRequest {
@NotNull
@ApiModelProperty("铺位id")
private Long pointId;
@NotNull
@Min(1)
@Max(2)
@ApiModelProperty("1通过,2拒绝")
private Integer auditStatus;
@NotNull
@ApiModelProperty("签到时间")
private Date signTime;
@NotNull
@NotBlank
@ApiModelProperty("签到位置")
private String signAddress;
@NotNull
@NotBlank
@ApiModelProperty("图片")
private String pictureUrl;
@ApiModelProperty("原因")
private String reason;
@ApiModelProperty("店长数量")
private Integer shopManagerNum;
@ApiModelProperty("店长基本工资")
private Integer shopManagerFee;
@ApiModelProperty("店员数量")
private Integer clerkNum;
@ApiModelProperty("店员基本工资")
private Integer clerkFee;
@ApiModelProperty("营运人员签字")
private String operationUserSign;
public boolean check() {
if(AuditStatusEnum.PASS.getCode().equals(this.auditStatus)){
if(Objects.isNull(this.shopManagerNum) || Objects.isNull(this.shopManagerFee) || Objects.isNull(this.clerkNum) || Objects.isNull(this.clerkFee)){
return false;
}
if(StringUtils.isBlank(this.operationUserSign)){
return false;
}
}else{
if(StringUtils.isBlank(this.reason)){
return false;
}
}
return true;
}
public static PointDetailInfoDO convertDO(Long pointDetailId, OperationAuditRequest request){
PointDetailInfoDO pointDetailInfo = new PointDetailInfoDO();
pointDetailInfo.setId(pointDetailId);
pointDetailInfo.setPointId(request.getPointId());
pointDetailInfo.setShopManagerNum(request.getShopManagerNum());
pointDetailInfo.setShopManagerFee(request.getShopManagerFee());
pointDetailInfo.setClerkNum(request.getClerkNum());
pointDetailInfo.setClerkFee(request.getClerkFee());
pointDetailInfo.setOperationUserSign(request.getOperationUserSign());
return pointDetailInfo;
}
}

View File

@@ -0,0 +1,27 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author zhangchenbiao
* @FileName: PointAuditRequest
* @Description:
* @date 2024-04-03 14:13
*/
@Data
public class PointAuditRequest {
@ApiModelProperty("铺位id")
private Long pointId;
@ApiModelProperty("1通过,2拒绝")
private Integer auditStatus;
@ApiModelProperty("原因")
private String reason;
}

View File

@@ -0,0 +1,18 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: PointIdRequest
* @Description:
* @date 2024-04-02 17:19
*/
@Data
public class PointIdRequest {
@ApiModelProperty("点位id")
private Long pointId;
}

View File

@@ -0,0 +1,32 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @author zhangchenbiao
* @FileName: SubmitPointAuditRequest
* @Description:
* @date 2024-04-03 14:03
*/
@Data
public class SubmitPointAuditRequest {
@NotNull
@ApiModelProperty("点位id")
private Long pointId;
@NotNull
@NotBlank
@ApiModelProperty("营运人员")
private String operateUserId;
@NotNull
@NotBlank
@ApiModelProperty("拓展专员签名")
private String developmentManagerSign;
}

View File

@@ -0,0 +1,21 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: TurnDevelopmentManagerRequest
* @Description:转让招商经理
* @date 2024-04-07 14:34
*/
@Data
public class TurnDevelopmentManagerRequest {
@ApiModelProperty("铺位id")
private Long pointId;
@ApiModelProperty("拓展经理")
private String developmentManager;
}

View File

@@ -58,10 +58,6 @@ public class UpdatePointDetailRequest extends AddPointDetailRequest {
result.setBrandUseRate(request.getBrandUseRate()); result.setBrandUseRate(request.getBrandUseRate());
result.setBrandUseFee(request.getBrandUseFee()); result.setBrandUseFee(request.getBrandUseFee());
result.setStaffFee(request.getStaffFee()); result.setStaffFee(request.getStaffFee());
result.setShopManagerNum(request.getShopManagerNum());
result.setShopManagerFee(request.getShopManagerFee());
result.setClerkNum(request.getClerkNum());
result.setClerkFee(request.getClerkFee());
result.setBonus(request.getBonus()); result.setBonus(request.getBonus());
result.setMonthRent(request.getMonthRent()); result.setMonthRent(request.getMonthRent());
result.setOtherFee(request.getOtherFee()); result.setOtherFee(request.getOtherFee());

View File

@@ -0,0 +1,27 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class UserAndPositionRequest {
@ApiModelProperty("类型 职位:position 人员:person")
private String type;
@ApiModelProperty("type对应的值")
private String value;
@ApiModelProperty("名称")
private String name;
public static UserAndPositionRequest convert(String type, String value, String name) {
UserAndPositionRequest userAndPositionRequest = new UserAndPositionRequest();
userAndPositionRequest.setType(type);
userAndPositionRequest.setValue(value);
userAndPositionRequest.setName(name);
return userAndPositionRequest;
}
}

View File

@@ -0,0 +1,24 @@
package com.cool.store.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: LineUsernameAndMobileVO
* @Description:
* @date 2024-04-07 14:39
*/
@Data
public class LineUsernameAndMobileVO {
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("手机号")
private String mobile;
}

View File

@@ -0,0 +1,33 @@
package com.cool.store.vo.point;
import com.cool.store.request.UserAndPositionRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: AuditSettingRequest
* @Description:
* @date 2024-04-02 14:11
*/
@Data
public class AuditSettingVO {
@ApiModelProperty("第一级审批")
private List<UserAndPositionRequest> firstApproval;
@ApiModelProperty("第二级审批")
private List<UserAndPositionRequest> secondApproval;
@ApiModelProperty("第三级审批")
private List<UserAndPositionRequest> thirdApproval;
@ApiModelProperty("第四级审批")
private List<UserAndPositionRequest> fourthApproval;
@ApiModelProperty("第五级审批")
private List<UserAndPositionRequest> fifthApproval;
}

View File

@@ -161,16 +161,16 @@ public class PointDetailVO {
private String staffFee; private String staffFee;
@ApiModelProperty("店长数量") @ApiModelProperty("店长数量")
private String shopManagerNum; private Integer shopManagerNum;
@ApiModelProperty("店长费用") @ApiModelProperty("店长基本工资")
private String shopManagerFee; private Integer shopManagerFee;
@ApiModelProperty("店员数量") @ApiModelProperty("店员数量")
private String clerkNum; private Integer clerkNum;
@ApiModelProperty("店员费用") @ApiModelProperty("店员基本工资")
private String clerkFee; private Integer clerkFee;
@ApiModelProperty("奖金分红") @ApiModelProperty("奖金分红")
private String bonus; private String bonus;

View File

@@ -1,10 +1,12 @@
package com.cool.store.service; package com.cool.store.service;
import com.cool.store.request.AddMapEvaluationReportRequest; import com.cool.store.request.*;
import com.cool.store.request.AddPointDetailRequest; import com.cool.store.vo.LineUsernameAndMobileVO;
import com.cool.store.request.UpdatePointDetailRequest; import com.cool.store.vo.point.AuditSettingVO;
import com.cool.store.vo.point.PointDetailVO; import com.cool.store.vo.point.PointDetailVO;
import java.util.List;
/** /**
* @author zhangchenbiao * @author zhangchenbiao
* @FileName: ShopPointService * @FileName: ShopPointService
@@ -69,5 +71,55 @@ public interface ShopPointService {
* @param pointId * @param pointId
* @return * @return
*/ */
Integer submitAudit(Long pointId); Integer submitAudit(SubmitPointAuditRequest request);
/**
* 审批设置
* @param request
* @return
*/
Integer auditSetting(AuditSettingRequest request);
/**
* 获取审批设置
* @return
*/
AuditSettingVO getAuditSetting();
/**
* 获取点位待办用户列表
* @param pointId
* @return
*/
List<String> getTodoUserList(Long pointId);
/**
* 营运人员审批
* @param userId
* @param request
* @return
*/
Integer operationUserAudit(String userId, OperationAuditRequest request);
/**
* 审批
* @param userId
* @param request
* @return
*/
Integer audit(String userId, PointAuditRequest request);
/**
* 转让招商经理
* @param request
* @return
*/
Integer turnDevelopmentManager(TurnDevelopmentManagerRequest request);
/**
* 获取我负责的线索列表
* @param developmentManager
* @return
*/
List<LineUsernameAndMobileVO> getLineList(String developmentManager);
} }

View File

@@ -1,27 +1,37 @@
package com.cool.store.service.impl; package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.*; import com.cool.store.dao.*;
import com.cool.store.entity.PointDetailInfoDO; import com.cool.store.dto.point.AuditNodeDTO;
import com.cool.store.entity.PointInfoDO; import com.cool.store.entity.*;
import com.cool.store.enums.AuditStatusEnum;
import com.cool.store.enums.ErrorCodeEnum; import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.NodeNoEnum;
import com.cool.store.enums.point.PointRecommendStatus; import com.cool.store.enums.point.PointRecommendStatus;
import com.cool.store.enums.point.PointStatusEnum; import com.cool.store.enums.point.PointStatusEnum;
import com.cool.store.enums.point.SelectStatusEnum; import com.cool.store.enums.point.SelectStatusEnum;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.request.AddMapEvaluationReportRequest; import com.cool.store.request.*;
import com.cool.store.request.AddPointDetailRequest;
import com.cool.store.request.UpdatePointDetailRequest;
import com.cool.store.service.ShopPointService; import com.cool.store.service.ShopPointService;
import com.cool.store.service.UserAuthMappingService;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.poi.StringUtils;
import com.cool.store.vo.LineUsernameAndMobileVO;
import com.cool.store.vo.point.AuditSettingVO;
import com.cool.store.vo.point.PointDetailVO; import com.cool.store.vo.point.PointDetailVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Arrays; import java.util.*;
import java.util.Date; import java.util.stream.Collectors;
import java.util.Objects;
/** /**
* @author zhangchenbiao * @author zhangchenbiao
@@ -43,6 +53,16 @@ public class ShopPointServiceImpl implements ShopPointService {
private LineInfoDAO lineInfoDAO; private LineInfoDAO lineInfoDAO;
@Resource @Resource
private PointRecommendDAO pointRecommendDAO; private PointRecommendDAO pointRecommendDAO;
@Resource
private RedisUtilPool redisUtilPool;
@Resource
private UserAuthMappingService userAuthMappingService;
@Resource
private PointAuditRecordDAO pointAuditRecordDAO;
@Resource
private PointTodoInfoDAO pointTodoInfoDAO;
private static final String AUDIT_SETTING_KEY = "audit_setting_key";
@Override @Override
public Long addPointDetailInfo(AddPointDetailRequest shopPointDetailRequest, String userId) { public Long addPointDetailInfo(AddPointDetailRequest shopPointDetailRequest, String userId) {
@@ -148,7 +168,9 @@ public class ShopPointServiceImpl implements ShopPointService {
} }
@Override @Override
public Integer submitAudit(Long pointId) { @Transactional(rollbackFor = Exception.class)
public Integer submitAudit(SubmitPointAuditRequest request) {
Long pointId = request.getPointId();
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId); PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){ if(Objects.isNull(pointInfo)){
log.error("铺位基本信息不存在"); log.error("铺位基本信息不存在");
@@ -157,14 +179,281 @@ public class ShopPointServiceImpl implements ShopPointService {
if(!PointStatusEnum.POINT_STATUS_2.getCode().equals(pointInfo.getPointStatus())){ if(!PointStatusEnum.POINT_STATUS_2.getCode().equals(pointInfo.getPointStatus())){
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE); throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
} }
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
if(Objects.isNull(pointDetailInfo)){
log.error("铺位详细信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
int submitAuditCount = pointInfo.getSubmitAuditCount() + 1;
PointInfoDO updatePoint = new PointInfoDO(); PointInfoDO updatePoint = new PointInfoDO();
updatePoint.setId(pointId); updatePoint.setId(pointId);
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_3.getCode()); updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_3.getCode());
updatePoint.setSubmitAuditCount(pointInfo.getSubmitAuditCount() + 1); updatePoint.setSubmitAuditCount(submitAuditCount);
PointDetailInfoDO updatePointDetail = new PointDetailInfoDO();
updatePointDetail.setId(pointDetailInfo.getId());
updatePointDetail.setDevelopmentManagerSign(request.getDevelopmentManagerSign());
updatePointDetail.setDevelopmentManagerSignTime(new Date());
pointDetailInfoDAO.updatePointDetailInfo(updatePointDetail);
//处理子任务审核记录表 //处理子任务审核记录表
AuditSettingVO auditSetting = getAuditSetting();
if(Objects.isNull(auditSetting)){
throw new ServiceException(ErrorCodeEnum.POINT_AUDIT_NOT_SETTING);
}
List<AuditNodeDTO> auditNode = dealAuditNode(auditSetting, pointInfo);
//获取审批节点上的数据
List<PointAuditRecordDO> recordList = AuditNodeDTO.convertDO(pointId, submitAuditCount, auditNode);
pointAuditRecordDAO.addPointAuditRecord(recordList);
//获取待办数据
List<PointTodoInfoDO> todoList = AuditNodeDTO.convertTODO(pointId, submitAuditCount, auditNode);
pointTodoInfoDAO.addPointTodoInfo(todoList);
return pointInfoDAO.updatePointInfo(updatePoint); return pointInfoDAO.updatePointInfo(updatePoint);
} }
@Override
public Integer auditSetting(AuditSettingRequest request) {
request.setSecondApproval(Arrays.asList(UserAndPositionRequest.convert("position", null, "战区营运")));
redisUtilPool.setString(AUDIT_SETTING_KEY, JSONObject.toJSONString(request));
return null;
}
@Override
public AuditSettingVO getAuditSetting() {
String auditSetting = redisUtilPool.getString(AUDIT_SETTING_KEY);
if(StringUtils.isBlank(auditSetting)){
return null;
}
return JSONObject.parseObject(auditSetting, AuditSettingVO.class);
}
@Override
public List<String> getTodoUserList(Long pointId) {
return pointTodoInfoDAO.getTodoUserList(pointId);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Integer operationUserAudit(String userId, OperationAuditRequest request) {
if(!request.check()){
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
Long pointId = request.getPointId();
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
PointDetailInfoDO pointDetailInfo = pointDetailInfoDAO.getPointDetailInfoByPointId(pointId);
if(Objects.isNull(pointInfo) || Objects.isNull(pointDetailInfo)){
log.info("铺位基本信息不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
if(!PointStatusEnum.POINT_STATUS_3.getCode().equals(pointInfo.getPointStatus())){
log.info("铺位状态不允许该操作");
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
}
if(!userId.equals(pointInfo.getOperateUserId())){
log.info("运营人员不对");
throw new ServiceException(ErrorCodeEnum.NO_PERMISSION);
}
PointTodoInfoDO pointTodo = pointTodoInfoDAO.getPointToDoByUserIdAndPointId(userId, pointId);
if(Objects.isNull(pointTodo)){
log.info("该用户没有待办数据");
throw new ServiceException(ErrorCodeEnum.USER_NOT_TODO_AUDIT);
}
if(!NodeNoEnum.NODE_NO_2.getCode().equals(pointTodo.getNodeNo())){
log.info("获取铺位待办数据不对");
throw new ServiceException(ErrorCodeEnum.POINT_AUDIT_NODE_ERROR);
}
Map<Integer, PointAuditRecordDO> pointAuditRecordMap = pointAuditRecordDAO.getPointAuditRecordMap(pointId, pointInfo.getSubmitAuditCount());
PointAuditRecordDO pointAuditRecord = pointAuditRecordMap.get(NodeNoEnum.NODE_NO_2.getCode());
if(Objects.isNull(pointAuditRecord) || !AuditStatusEnum.TODO.getCode().equals(pointAuditRecord.getAuditStatus())){
log.info("铺位处理记录中的数据不对或者状态不对");
throw new ServiceException(ErrorCodeEnum.POINT_AUDIT_NODE_ERROR);
}
AuditStatusEnum auditStatus = AuditStatusEnum.getByCode(request.getAuditStatus());
PointInfoDO updatePoint = new PointInfoDO();
updatePoint.setId(pointId);
PointDetailInfoDO updatePointDetailInfo = OperationAuditRequest.convertDO(pointDetailInfo.getId(), request);
pointDetailInfoDAO.updatePointDetailInfo(updatePointDetailInfo);
pointTodoInfoDAO.updatePointTodoInfo(pointId, NodeNoEnum.NODE_NO_2.getCode(), pointInfo.getSubmitAuditCount(), userId);
PointAuditRecordDO updateAuditRecord = PointAuditRecordDO.convert(pointAuditRecord.getId(), userId, auditStatus, request.getReason(), NodeNoEnum.NODE_NO_2, request.getSignTime(), request.getSignAddress(), request.getPictureUrl());
pointAuditRecordDAO.updatePointAuditRecord(updateAuditRecord);
if(AuditStatusEnum.REJECT.equals(auditStatus)){
//删除剩余未完成的审核记录
pointAuditRecordDAO.deletePointAuditRecord(pointId, pointInfo.getSubmitAuditCount());
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_2.getCode());
return pointInfoDAO.updatePointInfo(updatePoint);
}
PointAuditRecordDO nextAuditRecord = getNextAuditRecord(NodeNoEnum.NODE_NO_2.getCode(), pointAuditRecordMap);
if(Objects.nonNull(nextAuditRecord)){
pointAuditRecordDAO.updatePointAuditRecord(PointAuditRecordDO.convert(nextAuditRecord.getId(), new Date()));
//审批通过的情况下 生成下一个节点的待办数据
pointTodoInfoDAO.addPointTodoInfo(PointAuditRecordDO.convertTODO(nextAuditRecord));
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_4.getCode());
}else{
//没有下一节点 审批通过
Integer pointStatus = SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus()) ? PointStatusEnum.POINT_STATUS_6.getCode() : PointStatusEnum.POINT_STATUS_5.getCode();
updatePoint.setPointStatus(pointStatus);
}
return pointInfoDAO.updatePointInfo(updatePoint);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Integer audit(String userId, PointAuditRequest request) {
Long pointId = request.getPointId();
PointTodoInfoDO pointTodo = pointTodoInfoDAO.getPointToDoByUserIdAndPointId(userId, pointId);
if(Objects.isNull(pointTodo)){
log.info("该用户没有待办数据");
throw new ServiceException(ErrorCodeEnum.USER_NOT_TODO_AUDIT);
}
if(NodeNoEnum.NODE_NO_2.getCode().equals(pointTodo.getNodeNo())){
log.info("获取铺位待办数据不对");
throw new ServiceException(ErrorCodeEnum.POINT_AUDIT_NODE_ERROR);
}
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
if(Objects.isNull(pointInfo)){
log.info("铺位不存在");
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
AuditStatusEnum auditStatus = AuditStatusEnum.getByCode(request.getAuditStatus());
//更新当前待办
pointTodoInfoDAO.updatePointTodoInfo(pointId, pointTodo.getNodeNo(), pointInfo.getSubmitAuditCount(), userId);
Map<Integer, PointAuditRecordDO> pointAuditRecordMap = pointAuditRecordDAO.getPointAuditRecordMap(pointId, pointInfo.getSubmitAuditCount());
PointAuditRecordDO pointAuditRecord = pointAuditRecordMap.get(pointTodo.getNodeNo());
if(Objects.isNull(pointAuditRecord)){
log.info("铺位处理记录中的数据不对");
throw new ServiceException(ErrorCodeEnum.POINT_AUDIT_NODE_ERROR);
}
NodeNoEnum nodeNoEnum = NodeNoEnum.getByCode(pointTodo.getNodeNo());
PointAuditRecordDO auditRecord = PointAuditRecordDO.convert(pointAuditRecord.getId(), userId, auditStatus, request.getReason(), nodeNoEnum);
pointAuditRecordDAO.updatePointAuditRecord(auditRecord);
if(AuditStatusEnum.REJECT.equals(auditStatus)){
PointInfoDO pointInfoUpdate = new PointInfoDO();
pointInfoUpdate.setId(pointId);
pointInfoUpdate.setPointStatus(PointStatusEnum.POINT_STATUS_2.getCode());
//删除剩余未完成的审核记录
pointAuditRecordDAO.deletePointAuditRecord(pointId, pointInfo.getSubmitAuditCount());
return pointInfoDAO.updatePointInfo(pointInfoUpdate);
}
PointAuditRecordDO nextAuditRecord = getNextAuditRecord(pointTodo.getNodeNo(), pointAuditRecordMap);
if(Objects.nonNull(nextAuditRecord)){
//更新下一阶段任务的收到任务时间
pointAuditRecordDAO.updatePointAuditRecord(PointAuditRecordDO.convert(nextAuditRecord.getId(), new Date()));
//审批通过的情况下 生成下一个节点的待办数据
return pointTodoInfoDAO.addPointTodoInfo(PointAuditRecordDO.convertTODO(nextAuditRecord));
}
PointInfoDO pointInfoUpdate = new PointInfoDO();
pointInfoUpdate.setId(pointId);
Integer pointStatus = SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus()) ? PointStatusEnum.POINT_STATUS_6.getCode() : PointStatusEnum.POINT_STATUS_5.getCode();
pointInfoUpdate.setPointStatus(pointStatus);
return pointInfoDAO.updatePointInfo(pointInfoUpdate);
}
@Override
public Integer turnDevelopmentManager(TurnDevelopmentManagerRequest request) {
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(request.getPointId());
if(Objects.isNull(pointInfo)){
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
}
pointInfo.setDevelopmentManager(request.getDevelopmentManager());
return pointInfoDAO.updatePointInfo(pointInfo);
}
@Override
public List<LineUsernameAndMobileVO> getLineList(String developmentManager) {
lineInfoDAO.getLineListByDevelopmentManager(developmentManager);
return null;
}
public List<AuditNodeDTO> dealAuditNode(AuditSettingVO auditSetting, PointInfoDO pointInfo) {
List<String> roleIds = new ArrayList<>();
//审核人
Pair<List<String>, List<String>> firstApproval = getUserIdsAndPositionIds(auditSetting.getFirstApproval());
Pair<List<String>, List<String>> thirdApproval = getUserIdsAndPositionIds(auditSetting.getThirdApproval());
Pair<List<String>, List<String>> fourthApproval = getUserIdsAndPositionIds(auditSetting.getFourthApproval());
Pair<List<String>, List<String>> fifthApproval = getUserIdsAndPositionIds(auditSetting.getFifthApproval());
if(CollectionUtils.isNotEmpty(firstApproval.getValue())){
roleIds.addAll(firstApproval.getValue());
}
if(CollectionUtils.isNotEmpty(thirdApproval.getValue())){
roleIds.addAll(thirdApproval.getValue());
}
if(CollectionUtils.isNotEmpty(fourthApproval.getValue())){
roleIds.addAll(fourthApproval.getValue());
}
if(CollectionUtils.isNotEmpty(fifthApproval.getValue())){
roleIds.addAll(fifthApproval.getValue());
}
List<AuditNodeDTO> resultList = new ArrayList<>();
Map<String, List<String>> userIdsMap = userAuthMappingService.getUserIdByRoleIdAndRegionId(roleIds, pointInfo.getRegionId());
List<String> firstApprovalUserIds = getUserIdsByPositionIds(firstApproval, userIdsMap);
List<String> thirdApprovalUserIds = getUserIdsByPositionIds(thirdApproval, userIdsMap);
List<String> fourthApprovalUserIds = getUserIdsByPositionIds(fourthApproval, 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())));
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_2.getCode(), Arrays.asList(pointInfo.getOperateUserId())));
}else{
resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_2.getCode(), PointAuditRecordDO.RECEIVE_TASK, Boolean.TRUE, Arrays.asList(pointInfo.getOperateUserId())));
}
if(CollectionUtils.isNotEmpty(thirdApprovalUserIds)){
resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_3.getCode(), thirdApprovalUserIds));
}
if(CollectionUtils.isNotEmpty(fourthApprovalUserIds)){
resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_4.getCode(), fourthApprovalUserIds));
}
if(CollectionUtils.isNotEmpty(fifthApprovalUserIds)){
resultList.add(new AuditNodeDTO(NodeNoEnum.NODE_NO_5.getCode(), fifthApprovalUserIds));
}
return resultList;
}
/**
* 获取配置的userId 和 角色id
* @param requests
* @return
*/
private Pair<List<String>, List<String>> getUserIdsAndPositionIds(List<UserAndPositionRequest> requests){
List<String> positionIds = ListUtils.emptyIfNull(requests).stream().filter(o -> "position".equals(o.getType())).map(UserAndPositionRequest::getValue).collect(Collectors.toList());
List<String> userIds = ListUtils.emptyIfNull(requests).stream().filter(o -> "person".equals(o.getType())).map(UserAndPositionRequest::getValue).collect(Collectors.toList());
return Pair.of(userIds, positionIds);
}
/**
* 获取userId
* @param userIdsAndPositionIds
* @param userIdsMap
* @return
*/
private List<String> getUserIdsByPositionIds(Pair<List<String>, List<String>> userIdsAndPositionIds, Map<String, List<String>> userIdsMap) {
List<String> userIds = new ArrayList<>();
if(CollectionUtils.isNotEmpty(userIdsAndPositionIds.getKey())){
userIds.addAll(userIdsAndPositionIds.getKey());
}
if(CollectionUtils.isNotEmpty(userIdsAndPositionIds.getValue())){
userIdsAndPositionIds.getValue().forEach(positionId -> {
List<String> userIdList = userIdsMap.get(positionId);
if(CollectionUtils.isNotEmpty(userIdList)){
userIds.addAll(userIdList);
}
});
}
return userIds;
}
private PointAuditRecordDO getNextAuditRecord(Integer currentNodeNo, Map<Integer, PointAuditRecordDO> auditRecordMap){
List<NodeNoEnum> nextNodeNoList = NodeNoEnum.getNextNodeNoList(currentNodeNo);
if(CollectionUtils.isEmpty(nextNodeNoList)){
return null;
}
for (NodeNoEnum nodeNoEnum : nextNodeNoList) {
PointAuditRecordDO pointAuditRecord = auditRecordMap.get(nodeNoEnum.getCode());
if(Objects.nonNull(pointAuditRecord)){
return pointAuditRecord;
}
}
return null;
}
/** /**
* 生成code * 生成code
* @return * @return

View File

@@ -1,11 +1,11 @@
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.request.AddMapEvaluationReportRequest; import com.cool.store.request.*;
import com.cool.store.request.AddPointDetailRequest;
import com.cool.store.request.UpdatePointDetailRequest;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.service.ShopPointService; import com.cool.store.service.ShopPointService;
import com.cool.store.vo.LineUsernameAndMobileVO;
import com.cool.store.vo.point.AuditSettingVO;
import com.cool.store.vo.point.PointDetailVO; import com.cool.store.vo.point.PointDetailVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -13,6 +13,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* @author zhangchenbiao * @author zhangchenbiao
@@ -48,20 +49,20 @@ public class ShopPointController {
@ApiOperation("生成评估报告") @ApiOperation("生成评估报告")
@GetMapping("/generateEvaluationReport") @GetMapping("/generateEvaluationReport")
public ResponseResult<Integer> generateEvaluationReport(@RequestParam("pointId")Long pointId) { public ResponseResult<Integer> generateEvaluationReport(@RequestBody PointIdRequest request) {
return ResponseResult.success(shopPointService.generateEvaluationReport(pointId)); return ResponseResult.success(shopPointService.generateEvaluationReport(request.getPointId()));
} }
@ApiOperation("铺位失效") @ApiOperation("铺位失效")
@GetMapping("/invalid") @PostMapping("/invalid")
public ResponseResult<Integer> pointInvalid(@RequestParam("pointId")Long pointId) { public ResponseResult<Integer> pointInvalid(@RequestBody PointIdRequest request) {
return ResponseResult.success(shopPointService.pointInvalid(pointId)); return ResponseResult.success(shopPointService.pointInvalid(request.getPointId()));
} }
@ApiOperation("铺位解绑") @ApiOperation("铺位解绑")
@GetMapping("/unbind") @PostMapping("/unbind")
public ResponseResult<Integer> pointUnbind(@RequestParam("pointId")Long pointId) { public ResponseResult<Integer> pointUnbind(@RequestBody PointIdRequest request) {
return ResponseResult.success(shopPointService.pointUnbind(pointId)); return ResponseResult.success(shopPointService.pointUnbind(request.getPointId()));
} }
@ApiOperation("配置评估报告") @ApiOperation("配置评估报告")
@@ -71,11 +72,52 @@ public class ShopPointController {
} }
@ApiOperation("提交审批") @ApiOperation("提交审批")
@GetMapping("/submitAudit") @PostMapping("/submitAudit")
public ResponseResult<Integer> submitAudit(@RequestParam("pointId")Long pointId) { public ResponseResult<Integer> submitAudit(@RequestBody @Validated SubmitPointAuditRequest request) {
return ResponseResult.success(shopPointService.submitAudit(pointId)); return ResponseResult.success(shopPointService.submitAudit(request));
}
@ApiOperation("选址审批设置")
@PostMapping("/auditSetting")
public ResponseResult<Integer> auditSetting(@RequestBody AuditSettingRequest request) {
return ResponseResult.success(shopPointService.auditSetting(request));
}
@ApiOperation("获取选址审批设置")
@GetMapping("/getAuditSetting")
public ResponseResult<AuditSettingVO> getAuditSetting() {
return ResponseResult.success(shopPointService.getAuditSetting());
}
@ApiOperation("获取催办用户列表")
@GetMapping("/getTodoUserList")
public ResponseResult<List<String>> getTodoUserList(@RequestParam("pointId")Long pointId) {
return ResponseResult.success(shopPointService.getTodoUserList(pointId));
}
@ApiOperation("营运人员审批")
@PostMapping("/operationUserAudit")
public ResponseResult<Integer> operationUserAudit(@RequestBody @Validated OperationAuditRequest request) {
return ResponseResult.success(shopPointService.operationUserAudit(CurrentUserHolder.getUserId(), request));
}
@ApiOperation("审批")
@PostMapping("/audit")
public ResponseResult<Integer> audit(@RequestBody PointAuditRequest request) {
return ResponseResult.success(shopPointService.audit(CurrentUserHolder.getUserId(), request));
}
@ApiOperation("铺位转让")
@PostMapping("/turnDevelopmentManager")
public ResponseResult<Integer> turnDevelopmentManager(@RequestBody TurnDevelopmentManagerRequest request) {
return ResponseResult.success(shopPointService.turnDevelopmentManager(request));
}
@ApiOperation("获取我负责的加盟商列表")
@GetMapping("/getLineList")
public ResponseResult<List<LineUsernameAndMobileVO>> getLineList() {
return ResponseResult.success(shopPointService.getLineList(CurrentUserHolder.getUserId()));
} }
} }

View File

@@ -1,6 +1,12 @@
package com.cool.store.job; package com.cool.store.job;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.dao.LineInterviewDAO;
import com.cool.store.entity.LeaseBaseInfoDO; import com.cool.store.entity.LeaseBaseInfoDO;
import com.cool.store.entity.LineInterviewDO;
import com.cool.store.enums.InterviewStatusEnum;
import com.cool.store.enums.WorkflowStageEnum;
import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum; import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.mapper.LineInfoMapper; import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.mapper.TrainingExperienceMapper; import com.cool.store.mapper.TrainingExperienceMapper;
@@ -25,6 +31,11 @@ public class XxlJobHandler {
@Resource @Resource
LineInfoMapper lineInfoMapper; LineInfoMapper lineInfoMapper;
@Resource
private LineInterviewDAO lineInterviewDAO;
@Resource
private LineInfoDAO lineInfoDAO;
/** /**
* 每天都将待体验门店信息变更到体验中 * 每天都将待体验门店信息变更到体验中
*/ */
@@ -46,4 +57,19 @@ public class XxlJobHandler {
log.info("------实训体验状态变更结束------"); log.info("------实训体验状态变更结束------");
XxlJobHelper.handleSuccess(); XxlJobHelper.handleSuccess();
} }
@XxlJob("batchUpdateInterviewWorkflowStage")
public void batchUpdateInterviewWorkflowStage() {
log.info("------面谈待审核状态变更------");
List<LineInterviewDO> interviewList = lineInterviewDAO.getWaitAuditInterview();
if (CollectionUtils.isEmpty(interviewList)) {
log.info("------今日没有待更新数据------");
return;
}
List<Long> lineIds = interviewList.stream().map(LineInterviewDO::getLineId).collect(Collectors.toList());
List<Long> interviewIds = interviewList.stream().map(LineInterviewDO::getId).collect(Collectors.toList());
lineInfoDAO.batchUpdateInterviewWorkflowStage(lineIds, WorkflowSubStageEnum.INVITING_INTERVIEWS, WorkflowSubStageStatusEnum.INVITING_INTERVIEWS_20);
lineInterviewDAO.batchUpdateInterviewStatus(interviewIds, InterviewStatusEnum.WAIT_AUDIT);
XxlJobHelper.handleSuccess();
}
} }