Merge #99 into master from cc_20260408_close_up

feat:歇业管理

* cc_20260408_close_up: (18 commits squashed)

  - fix:歇业管理(部分)

  - fix:歇业管理(部分)

  - fix:审批逻辑修改;拒绝审批实现

  - fix:恢复开业申请及审批

  - fix:主流程补充

  - fix:主流程补充

  - fix:字段补充及逻辑修改

  - fix:字段补充

  - fix

  - fix:平台处理新增字段

  - fix

  - Merge remote-tracking branch 'origin/cc_20260408_close_up' into cc_20260408_close_up

  - fix:歇业营业发送短信

  - fix:排序

  - fix:详情接口新增加盟商手机号字段;申请单日期和已有申请单存在交集时申请失败

  - fix:申请单详情接口新增品牌字段

  - fix:新增列表筛选条件;审批单状态校验

  - Merge branch 'master' into cc_20260408_close_up
    
    # Conflicts:
    #	coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java

Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com>
Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>

CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/99
This commit is contained in:
王非凡
2026-04-15 08:23:40 +00:00
committed by 正新
parent 1b3ae71c3a
commit 19bce915ac
51 changed files with 2502 additions and 9 deletions

View File

@@ -302,6 +302,12 @@
WHERE store_id = #{storeId} AND is_delete = 'effective'
</update>
<update id="updateStatus">
UPDATE store_${enterpriseId}
SET store_status = #{storeStatus}
WHERE store_id = #{storeId} AND is_delete = 'effective'
</update>
<update id="closeStore">
UPDATE store_${enterpriseId}
SET store_status = 'closed',
@@ -317,6 +323,13 @@
close_nature = VALUES(close_nature)
</insert>
<insert id="insertOrUpdateCloseUpReason">
INSERT INTO store_extend_info_${enterpriseId}(store_id, close_up_reason)
VALUES(#{storeId}, #{closeUpReason})
ON DUPLICATE KEY UPDATE
close_up_reason = VALUES(close_up_reason)
</insert>
<select id="getNoOrderStore" resultType="com.cool.store.entity.StoreDO">
SELECT * FROM store_${enterpriseId} a
LEFT JOIN store_extend_info_${enterpriseId} b ON a.store_id = b.store_id

View File

@@ -0,0 +1,108 @@
<?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.closeup.CloseUpApplyFormMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.closeup.CloseUpApplyFormDO">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="store_id" jdbcType="VARCHAR" property="storeId" />
<result column="apply_no" jdbcType="VARCHAR" property="applyNo" />
<result column="line_id" jdbcType="VARCHAR" property="lineId" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="plan_close_date" jdbcType="DATE" property="planCloseDate" />
<result column="actual_close_date" jdbcType="DATE" property="actualCloseDate" />
<result column="plan_open_date" jdbcType="DATE" property="planOpenDate" />
<result column="actual_open_date" jdbcType="TIMESTAMP" property="actualOpenDate" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="source_apply_id" jdbcType="BIGINT" property="sourceApplyId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
<result column="urls" jdbcType="LONGVARCHAR" property="urls" />
</resultMap>
<sql id="Base_Column_List_A">
a.id, a.type, a.store_id, a.apply_no, a.line_id, a.status, a.plan_close_date, a.actual_close_date, a.plan_open_date, a.actual_open_date,
a.user_id, a.reason, a.source_apply_id, a.create_time, a.updated_time, a.urls
</sql>
<select id="getList" parameterType="com.cool.store.request.closeup.CloseUpQueryRequest" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List_A" />
FROM zxjp_close_up_apply_form a
INNER JOIN store_${enterpriseId} b ON a.store_id = b.store_id AND b.is_delete = 'effective'
<if test="lineKeyword != null and lineKeyword != ''">
INNER JOIN xfsg_line_info c ON a.line_id = c.id AND c.deleted = 0
</if>
<if test="closeUpApplyNo != null and closeUpApplyNo != ''">
LEFT JOIN zxjp_close_up_apply_form d ON a.source_apply_id = d.id
</if>
<where>
<if test="type != null">
AND a.type = #{type}
</if>
<if test="status != null">
AND a.status = #{status}
</if>
<if test="beginPlanCloseDate != null and endPlanCloseDate!= null">
AND a.plan_close_date BETWEEN #{beginPlanCloseDate} AND #{endPlanCloseDate}
</if>
<if test="beginActualOpenDate != null and endActualOpenDate != null">
AND a.actual_open_date BETWEEN #{beginActualOpenDate} AND #{endActualOpenDate}
</if>
<if test="applyNo != null and applyNo != ''">
AND a.apply_no LIKE CONCAT('%',#{applyNo},'%')
</if>
<if test="storeKeyword != null and storeKeyword != ''">
AND (b.store_name LIKE CONCAT('%',#{storeKeyword},'%') OR b.store_num LIKE CONCAT('%',#{storeKeyword},'%'))
</if>
<if test="joinBrand != null">
AND b.join_brand = #{joinBrand}
</if>
<if test="regionIds != null and regionIds.size() > 0">
<foreach item="regionId" collection="regionIds" separator=" OR " open="AND (" close=")" index="">
b.region_path LIKE CONCAT('%/',#{regionId},'/%')
</foreach>
</if>
<if test="lineKeyword != null and lineKeyword != ''">
AND (c.username LIKE CONCAT('%',#{lineKeyword},'%') OR c.mobile LIKE CONCAT('%',#{lineKeyword},'%'))
</if>
<if test="closeUpApplyNo != null and closeUpApplyNo != ''">
AND d.apply_no LIKE CONCAT('%', #{closeUpApplyNo}, '%')
</if>
</where>
ORDER BY a.create_time DESC
</select>
<insert id="insertOrUpdate" parameterType="com.cool.store.entity.closeup.CloseUpApplyFormDO" useGeneratedKeys="true" keyProperty="id">
INSERT INTO zxjp_close_up_apply_form (
id, type, store_id, apply_no, line_id, status, plan_close_date, actual_close_date,
plan_open_date, actual_open_date, user_id, reason, source_apply_id, urls
) VALUES (
#{id}, #{type}, #{storeId}, #{applyNo}, #{lineId}, #{status}, #{planCloseDate}, #{actualCloseDate},
#{planOpenDate}, #{actualOpenDate}, #{userId}, #{reason}, #{sourceApplyId}, #{urls}
) ON DUPLICATE KEY UPDATE
type = #{type},
store_id = #{storeId},
apply_no = #{applyNo},
line_id = #{lineId},
status = #{status},
plan_close_date = #{planCloseDate},
actual_close_date = #{actualCloseDate},
plan_open_date = #{planOpenDate},
actual_open_date = #{actualOpenDate},
user_id = #{userId},
reason = #{reason},
source_apply_id = #{sourceApplyId},
urls = #{urls}
</insert>
<select id="existsTimeOverlap" resultType="int">
SELECT COUNT(1) FROM zxjp_close_up_apply_form
WHERE store_id = #{storeId}
AND type = 0
AND status != 5
AND plan_close_date &lt;= #{planOpenDate}
AND plan_open_date >= #{planCloseDate}
</select>
</mapper>

View File

@@ -0,0 +1,22 @@
<?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.closeup.CloseUpAuditRecordMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.closeup.CloseUpAuditRecordDO">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="apply_id" jdbcType="BIGINT" property="applyId" />
<result column="record_type" jdbcType="TINYINT" property="recordType" />
<result column="action_remark" jdbcType="VARCHAR" property="actionRemark" />
<result column="handler_user_id" jdbcType="VARCHAR" property="handlerUserId" />
<result column="handler_user_name" jdbcType="VARCHAR" property="handlerUserName" />
<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="deleted" jdbcType="BIT" property="deleted" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,44 @@
<?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.closeup.CloseUpPlatformMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.closeup.CloseUpPlatformDO">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="apply_id" jdbcType="BIGINT" property="applyId" />
<result column="apply_type" jdbcType="TINYINT" property="applyType" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="task_start_date" jdbcType="DATE" property="taskStartDate" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<insert id="insertBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT INTO zxjp_close_up_platform(apply_id, apply_type, code, name, status, type, task_start_date, icon)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.applyId}, #{item.applyType}, #{item.code}, #{item.name}, #{item.status}, #{item.type}, #{item.taskStartDate}, #{item.icon})
</foreach>
</insert>
<select id="selectTodoApplyIds" resultType="java.lang.Long">
SELECT DISTINCT apply_id FROM zxjp_close_up_platform a
<if test="storeKeyword != null and storeKeyword != ''">
LEFT JOIN zxjp_close_up_apply_form b ON a.apply_id = b.id
LEFT JOIN store_${enterpriseId} c ON b.store_id = c.store_id
</if>
WHERE a.status = 0 AND a.task_start_date &lt;= now()
<if test="applyType != null">
AND a.apply_type = #{applyType}
</if>
<if test="storeKeyword != null and storeKeyword != ''">
AND (c.store_name LIKE CONCAT('%', #{storeKeyword}, '%') OR c.store_num LIKE CONCAT('%', #{storeKeyword}, '%'))
</if>
ORDER BY a.create_time DESC
</select>
</mapper>