feat:事项
This commit is contained in:
@@ -291,6 +291,8 @@ public enum ErrorCodeEnum {
|
|||||||
|
|
||||||
MESSAGE_TEMPLATE_NOT_SUPPORT_EDIT(1610001,"当前消息已发布,不支持编辑!",null),
|
MESSAGE_TEMPLATE_NOT_SUPPORT_EDIT(1610001,"当前消息已发布,不支持编辑!",null),
|
||||||
MESSAGE_TEMPLATE_NOT_SUPPORT_DELETED(1610002,"只有未发布的消息能删除,请确认!",null),
|
MESSAGE_TEMPLATE_NOT_SUPPORT_DELETED(1610002,"只有未发布的消息能删除,请确认!",null),
|
||||||
|
STORE_MESSAGE_REVOKE(1610003,"当前门店消息已撤销,请务重复操作",null),
|
||||||
|
STORE_MESSAGE_HANDLED(1610004,"当前门店消息已处理,无法撤销!",null),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.cool.store.dao;
|
package com.cool.store.dao;
|
||||||
|
|
||||||
|
import com.cool.store.dto.notice.NoticeDTO;
|
||||||
import com.cool.store.entity.MessageTemplateDO;
|
import com.cool.store.entity.MessageTemplateDO;
|
||||||
import com.cool.store.mapper.MessageTemplateMapper;
|
import com.cool.store.mapper.MessageTemplateMapper;
|
||||||
|
import com.cool.store.request.notice.MessageTemplateQueryRequest;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@@ -47,7 +49,27 @@ public class MessageTemplateDAO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<NoticeDTO> getMessageTemplateList(MessageTemplateQueryRequest request) {
|
||||||
|
return messageTemplateMapper.getMessageTemplateList(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int batchUpdateStoreInfoAndUserInfo(List<Long> ids,
|
||||||
|
String storeInfo,
|
||||||
|
String userInfo,
|
||||||
|
String userId) {
|
||||||
|
if (CollectionUtils.isEmpty(ids)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return messageTemplateMapper.batchUpdateStoreInfoAndUserInfo(ids,storeInfo,userInfo,userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int batchUpdatePublishStatus(List<Long> ids) {
|
||||||
|
if (CollectionUtils.isEmpty(ids)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return messageTemplateMapper.batchUpdatePublishStatus(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
package com.cool.store.dao;
|
package com.cool.store.dao;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.cool.store.dto.notice.MessageTemplateCountDTO;
|
||||||
import com.cool.store.entity.StoreMessageDO;
|
import com.cool.store.entity.StoreMessageDO;
|
||||||
import com.cool.store.mapper.StoreMessageMapper;
|
import com.cool.store.mapper.StoreMessageMapper;
|
||||||
|
import com.cool.store.request.notice.StoreMessageRequest;
|
||||||
|
import com.cool.store.vo.notice.MessageDetailVO;
|
||||||
|
import com.cool.store.vo.notice.StoreMessageVO;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,16 +25,63 @@ public class StoreMessageDAO {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
StoreMessageMapper storeMessageMapper;
|
StoreMessageMapper storeMessageMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public StoreMessageDO getById(Long id){
|
||||||
|
return storeMessageMapper.selectByPrimaryKey(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int update(StoreMessageDO storeMessageDO){
|
||||||
|
return storeMessageMapper.updateByPrimaryKey(storeMessageDO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量新增
|
* 批量新增
|
||||||
* @param list
|
* @param list
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int batchInsert(List<StoreMessageDO> list){
|
public int batchInsert(List<StoreMessageDO> list){
|
||||||
|
if (CollectionUtils.isEmpty(list)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return storeMessageMapper.insertBatch(list);
|
return storeMessageMapper.insertBatch(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<MessageTemplateCountDTO> getMessageTemplateCountList(List<Long> templateIds){
|
||||||
|
if (CollUtil.isEmpty(templateIds)){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return storeMessageMapper.getMessageTemplateCountList(templateIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StoreMessageDO> getStoreMessageList(StoreMessageRequest request){
|
||||||
|
return storeMessageMapper.getStoreMessageList(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer batchRevoke(List<Long> ids, String userId, String userName){
|
||||||
|
if (CollectionUtils.isEmpty(ids)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return storeMessageMapper.batchRevoke(ids,userId,userName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer revokeById(Long id, String userId, String userName){
|
||||||
|
if (id == null){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return storeMessageMapper.revokeById(id,userId,userName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer queryStoreModuleCount(String storeId, Integer moduleCode){
|
||||||
|
return storeMessageMapper.queryStoreModuleCount(storeId,moduleCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StoreMessageVO> getStoreMessageListByCondition(String storeId, Integer moduleCode, Integer todayTask, Integer pendingFlag, String userId){
|
||||||
|
return storeMessageMapper.getStoreMessageListByCondition(storeId,moduleCode,todayTask,pendingFlag,userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MessageDetailVO getMessageDetail(Long id){
|
||||||
|
return storeMessageMapper.getMessageDetail(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package com.cool.store.mapper;
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
|
import com.cool.store.dto.notice.CommonDTO;
|
||||||
|
import com.cool.store.dto.notice.NoticeDTO;
|
||||||
import com.cool.store.entity.MessageTemplateDO;
|
import com.cool.store.entity.MessageTemplateDO;
|
||||||
|
import com.cool.store.request.notice.MessageTemplateQueryRequest;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import tk.mybatis.mapper.common.Mapper;
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
@@ -12,4 +15,16 @@ public interface MessageTemplateMapper extends Mapper<MessageTemplateDO> {
|
|||||||
|
|
||||||
int updateDeleteStatusBatch(@Param("ids") List<Long> ids, @Param("userId") String userId);
|
int updateDeleteStatusBatch(@Param("ids") List<Long> ids, @Param("userId") String userId);
|
||||||
|
|
||||||
|
List<NoticeDTO> getMessageTemplateList(@Param("request") MessageTemplateQueryRequest request);
|
||||||
|
|
||||||
|
int batchUpdateStoreInfoAndUserInfo(@Param("ids") List<Long> ids,
|
||||||
|
@Param("storeInfo") String storeInfo,
|
||||||
|
@Param("userInfo") String userInfo,
|
||||||
|
@Param("userId") String userId);
|
||||||
|
|
||||||
|
int batchUpdatePublishStatus(@Param("ids") List<Long> ids);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
package com.cool.store.mapper;
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
|
import com.cool.store.dto.notice.MessageTemplateCountDTO;
|
||||||
import com.cool.store.entity.StoreMessageDO;
|
import com.cool.store.entity.StoreMessageDO;
|
||||||
|
import com.cool.store.request.notice.StoreMessageRequest;
|
||||||
|
import com.cool.store.vo.notice.MessageDetailVO;
|
||||||
|
import com.cool.store.vo.notice.StoreMessageVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import tk.mybatis.mapper.common.Mapper;
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
@@ -10,4 +14,23 @@ public interface StoreMessageMapper extends Mapper<StoreMessageDO> {
|
|||||||
|
|
||||||
int insertBatch(@Param("list") List<StoreMessageDO> list);
|
int insertBatch(@Param("list") List<StoreMessageDO> list);
|
||||||
|
|
||||||
|
|
||||||
|
List<MessageTemplateCountDTO> getMessageTemplateCountList(@Param("templateIds") List<Long> templateIds);
|
||||||
|
|
||||||
|
List<StoreMessageDO> getStoreMessageList(@Param("request") StoreMessageRequest request);
|
||||||
|
|
||||||
|
int batchRevoke(@Param("ids") List<Long> ids, @Param("userId") String userId, @Param("userName") String userName);
|
||||||
|
|
||||||
|
int revokeById(@Param("id") Long id, @Param("userId") String userId, @Param("userName") String userName);
|
||||||
|
|
||||||
|
Integer queryStoreModuleCount(@Param("storeId") String storeId, @Param("moduleCode") Integer moduleCode);
|
||||||
|
|
||||||
|
List<StoreMessageVO> getStoreMessageListByCondition(@Param("storeId") String storeId,
|
||||||
|
@Param("moduleCode") Integer moduleCode,
|
||||||
|
@Param("todayTask") Integer todayTask,
|
||||||
|
@Param("pendingFlag") Integer pendingFlag,
|
||||||
|
@Param("userId") String userId);
|
||||||
|
|
||||||
|
MessageDetailVO getMessageDetail(Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -57,4 +57,75 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getMessageTemplateList" resultType="com.cool.store.dto.notice.NoticeDTO" >
|
||||||
|
SELECT
|
||||||
|
id as id,
|
||||||
|
message_code as messageCode,
|
||||||
|
module_code as moduleCode,
|
||||||
|
matter_type as matterType,
|
||||||
|
message_title as messageTitle,
|
||||||
|
system_source as systemSource,
|
||||||
|
process_type as processType,
|
||||||
|
remind_type as remindType,
|
||||||
|
remind_start_time as remindStartTime,
|
||||||
|
remind_end_time as remindEndTime,
|
||||||
|
deadline as deadline,
|
||||||
|
today_task as todayTask,
|
||||||
|
message_image as messageImage,
|
||||||
|
publish_status as publishStatus,
|
||||||
|
publish_time as publishTime,
|
||||||
|
publisher_user_id as publisherUserId,
|
||||||
|
create_user_id as createUserId,
|
||||||
|
create_time as createTime
|
||||||
|
FROM zxjp_message_template
|
||||||
|
WHERE deleted = 0
|
||||||
|
<if test="request.moduleCode != null">
|
||||||
|
AND module_code = #{request.moduleCode,jdbcType=TINYINT}
|
||||||
|
</if>
|
||||||
|
<if test="request.matterType != null">
|
||||||
|
AND matter_type = #{request.matterType,jdbcType=TINYINT}
|
||||||
|
</if>
|
||||||
|
<if test="request.messageTitle != null and messageTitle != ''">
|
||||||
|
AND message_title LIKE CONCAT('%', #{request.messageTitle,jdbcType=VARCHAR}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="request.todayTask != null">
|
||||||
|
AND today_task = #{request.todayTask,jdbcType=BIT}
|
||||||
|
</if>
|
||||||
|
<if test="request.systemSource != null and request.systemSource != ''">
|
||||||
|
AND system_source = #{request.systemSource,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="request.publishStatus != null">
|
||||||
|
AND publish_status = #{request.publishStatus,jdbcType=BIT}
|
||||||
|
</if>
|
||||||
|
<if test="request.publishUserId != null">
|
||||||
|
AND publisher_user_id = #{request.publishUserId,jdbcType=BIT}
|
||||||
|
</if>
|
||||||
|
ORDER BY create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="batchUpdateStoreInfoAndUserInfo">
|
||||||
|
UPDATE zxjp_message_template
|
||||||
|
SET
|
||||||
|
store_info = #{storeInfo,jdbcType=LONGVARCHAR},
|
||||||
|
handle_person_info = #{userInfo,jdbcType=LONGVARCHAR},
|
||||||
|
update_time = NOW(),
|
||||||
|
publish_status = 1,
|
||||||
|
publish_time = NOW(),
|
||||||
|
publisher_user_id = #{userId}
|
||||||
|
WHERE id IN
|
||||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
|
#{id,jdbcType=BIGINT}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="batchUpdatePublishStatus">
|
||||||
|
UPDATE zxjp_message_template
|
||||||
|
SET
|
||||||
|
publish_status = 2
|
||||||
|
WHERE id IN
|
||||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
|
#{id,jdbcType=BIGINT}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="insertBatch" parameterType="java.util.List">
|
<insert id="insertBatch" parameterType="java.util.List">
|
||||||
INSERT INTO store_message (
|
INSERT INTO zxjp_store_message (
|
||||||
store_id,
|
store_id,
|
||||||
store_code,
|
store_code,
|
||||||
store_name,
|
store_name,
|
||||||
@@ -40,17 +40,164 @@
|
|||||||
VALUES
|
VALUES
|
||||||
<foreach collection="list" item="item" index="index" separator=",">
|
<foreach collection="list" item="item" index="index" separator=",">
|
||||||
(
|
(
|
||||||
#{item.storeId,jdbcType=VARCHAR},
|
#{item.storeId},
|
||||||
#{item.storeCode,jdbcType=VARCHAR},
|
#{item.storeCode},
|
||||||
#{item.storeName,jdbcType=VARCHAR},
|
#{item.storeName},
|
||||||
#{item.messageTemplateId,jdbcType=BIGINT},
|
#{item.messageTemplateId},
|
||||||
#{item.readStatus,jdbcType=BIT},
|
#{item.readStatus},
|
||||||
#{item.readTime,jdbcType=TIMESTAMP},
|
#{item.readTime},
|
||||||
#{item.processStatus,jdbcType=TINYINT},
|
#{item.processStatus},
|
||||||
#{item.processTime,jdbcType=TIMESTAMP},
|
#{item.processTime},
|
||||||
#{item.operatorList,jdbcType=LONGVARCHAR}
|
#{item.operatorList}
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<select id="getMessageTemplateCountList" resultType="com.cool.store.dto.notice.MessageTemplateCountDTO">
|
||||||
|
SELECT
|
||||||
|
message_template_id AS templateId,
|
||||||
|
COUNT(DISTINCT store_id) AS totalStoreCount,
|
||||||
|
SUM(CASE WHEN process_status = 1 THEN 1 ELSE 0 END) AS processedStoreCount
|
||||||
|
FROM
|
||||||
|
zxjp_store_message
|
||||||
|
<where>
|
||||||
|
message_template_id IN
|
||||||
|
<foreach item="item" collection="templateIds" index="index" separator="," close=")" open="(">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
GROUP BY
|
||||||
|
message_template_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getStoreMessageList" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
id,
|
||||||
|
store_id,
|
||||||
|
store_code,
|
||||||
|
store_name,
|
||||||
|
message_template_id,
|
||||||
|
read_status,
|
||||||
|
read_time,
|
||||||
|
process_status,
|
||||||
|
process_time,
|
||||||
|
actual_operator_id,
|
||||||
|
actual_operator_name,
|
||||||
|
revoke_status,
|
||||||
|
revoke_time,
|
||||||
|
revoke_operator_id,
|
||||||
|
revoke_operator_name,
|
||||||
|
create_time,
|
||||||
|
update_time
|
||||||
|
FROM zxjp_store_message
|
||||||
|
<where>
|
||||||
|
<if test="request.templateId != null">
|
||||||
|
AND message_template_id = #{request.templateId,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<if test="request.readStatus != null">
|
||||||
|
AND read_status = #{request.readStatus,jdbcType=BIT}
|
||||||
|
</if>
|
||||||
|
<if test="request.processStatus != null">
|
||||||
|
AND process_status = #{request.processStatus,jdbcType=TINYINT}
|
||||||
|
</if>
|
||||||
|
<if test="request.keyword != null">
|
||||||
|
AND ( store_code LIKE CONCAT('%',#{request.keyword,jdbcType=VARCHAR},'%')
|
||||||
|
OR store_name LIKE CONCAT('%',#{request.keyword,jdbcType=VARCHAR},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
AND revoke_status = 0
|
||||||
|
</where>
|
||||||
|
ORDER BY create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="batchRevoke">
|
||||||
|
UPDATE zxjp_store_message
|
||||||
|
SET
|
||||||
|
revoke_status = 1,
|
||||||
|
revoke_time = NOW(),
|
||||||
|
revoke_operator_id = #{userId,jdbcType=BIGINT},
|
||||||
|
revoke_operator_name = #{userName,jdbcType=VARCHAR},
|
||||||
|
update_time = NOW()
|
||||||
|
<where>
|
||||||
|
message_template_id IN
|
||||||
|
<foreach item="item" collection="templateIds" index="index" separator="," close=")" open="(">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
AND process_status = 0
|
||||||
|
AND revoke_status = 0
|
||||||
|
</where>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="revokeById">
|
||||||
|
UPDATE zxjp_store_message
|
||||||
|
SET
|
||||||
|
revoke_status = 1,
|
||||||
|
revoke_time = NOW(),
|
||||||
|
revoke_operator_id = #{userId,jdbcType=BIGINT},
|
||||||
|
revoke_operator_name = #{userName,jdbcType=VARCHAR},
|
||||||
|
update_time = NOW()
|
||||||
|
WHERE
|
||||||
|
id = #{id,jdbcType=BIGINT}
|
||||||
|
AND process_status = 0
|
||||||
|
AND revoke_status = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="queryStoreModuleCount" resultType="java.lang.Integer">
|
||||||
|
select count(1) from zxjp_store_message a
|
||||||
|
left join zxjp_message_template b on a.message_template_id = b.id
|
||||||
|
where a.store_id = #{storeId}
|
||||||
|
and b.module_id = #{moduleCode}
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getStoreMessageListByCondition" resultType="com.cool.store.vo.notice.StoreMessageVO">
|
||||||
|
select
|
||||||
|
a.id,
|
||||||
|
a.store_id as storeId,
|
||||||
|
a.store_code as storeCode,
|
||||||
|
a.message_template_id as templateId,
|
||||||
|
a.read_status as readStatus,
|
||||||
|
a.process_status as processStatus,
|
||||||
|
a.create_time as createTime,
|
||||||
|
b.module_code as moduleCode,
|
||||||
|
b.message_title as messageTitle,
|
||||||
|
b.message_image as messageImage
|
||||||
|
from zxjp_store_message a
|
||||||
|
left join zxjp_message_template b on a.message_template_id = b.id
|
||||||
|
<where>
|
||||||
|
<if test="storeId != null">
|
||||||
|
and a.store_id = #{storeId}
|
||||||
|
</if>
|
||||||
|
<if test="moduleCode != null">
|
||||||
|
and b.module_id = #{moduleCode}
|
||||||
|
</if>
|
||||||
|
<if test="todayTask != null">
|
||||||
|
and b.today_task = #{todayTask}
|
||||||
|
</if>
|
||||||
|
<if test="pendingFlag != null">
|
||||||
|
and a.process_status = #{pendingFlag}
|
||||||
|
and (b.remind_type = 1 or (b.remind_type = 2 and NOW() BETWEEN b.remind_start_time AND b.remind_end_time ))
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getMessageDetail" resultType="com.cool.store.vo.notice.MessageDetailVO">
|
||||||
|
select
|
||||||
|
a.id,
|
||||||
|
a.message_title,
|
||||||
|
a.message_image,
|
||||||
|
a.create_time,
|
||||||
|
a.publish_user_name
|
||||||
|
from
|
||||||
|
zxjp_store_message a
|
||||||
|
left join zxjp_message_template b on a.template_id = b.id
|
||||||
|
where
|
||||||
|
a.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.cool.store.dto.notice;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/7/26 19:47
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MessageTemplateCountDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模版ID
|
||||||
|
*/
|
||||||
|
private Long templateId;
|
||||||
|
/**
|
||||||
|
* 总门店数据
|
||||||
|
*/
|
||||||
|
private Integer totalStoreCount;
|
||||||
|
/**
|
||||||
|
* 已处理门店数据
|
||||||
|
*/
|
||||||
|
private Integer processedStoreCount;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,6 +3,9 @@ package com.cool.store.dto.notice;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author suzhuhong
|
* @Author suzhuhong
|
||||||
* @Date 2025/7/25 16:49
|
* @Date 2025/7/25 16:49
|
||||||
@@ -11,17 +14,65 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class NoticeDTO {
|
public class NoticeDTO {
|
||||||
|
|
||||||
|
private Long id ;
|
||||||
|
|
||||||
@ApiModelProperty("消息编码")
|
@ApiModelProperty("消息编码")
|
||||||
private String messageCode;
|
private String messageCode;
|
||||||
|
|
||||||
@ApiModelProperty("模块")
|
@ApiModelProperty("模块")
|
||||||
private Integer moduleCode;
|
private Integer moduleCode;
|
||||||
|
|
||||||
@ApiModelProperty("事项类型")
|
@ApiModelProperty("事项类型")
|
||||||
private Integer matterType;
|
private Integer matterType;
|
||||||
|
|
||||||
@ApiModelProperty("消息标题")
|
@ApiModelProperty("消息标题")
|
||||||
private String messageTitle;
|
private String messageTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty("系统来源")
|
||||||
|
private String systemSource;
|
||||||
|
|
||||||
|
@ApiModelProperty("处理类型")
|
||||||
|
private Integer processType;
|
||||||
|
|
||||||
|
@ApiModelProperty("提醒")
|
||||||
|
private Integer remindType;
|
||||||
|
|
||||||
|
@ApiModelProperty("提醒时间段 开始时间")
|
||||||
|
private Date remindStartTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("提醒时间段 结束时间")
|
||||||
|
private Date remindEndTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("截止日期")
|
||||||
|
private Date deadline;
|
||||||
|
|
||||||
|
@ApiModelProperty("截止日期")
|
||||||
|
private Boolean todayTask;
|
||||||
|
|
||||||
|
@ApiModelProperty("发布状态")
|
||||||
|
private Integer publishStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("处理完数据")
|
||||||
|
private Integer handleNum;
|
||||||
|
@ApiModelProperty("总数")
|
||||||
|
private Integer totalNum;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人")
|
||||||
|
private String createUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建名称")
|
||||||
|
private String createUserName;
|
||||||
|
|
||||||
|
@ApiModelProperty("总数")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("发布人id")
|
||||||
|
private String publishUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("发布人名称")
|
||||||
|
private String publishUserName;
|
||||||
|
|
||||||
|
@ApiModelProperty("发布人时间")
|
||||||
|
private Date publishTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.cool.store.request.notice;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/7/27 20:07
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BatchRevokeRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("批量撤销的消息ID列表")
|
||||||
|
private List<Long> ids;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -20,7 +20,7 @@ public class MessageTemplateAddRequest {
|
|||||||
|
|
||||||
@ApiModelProperty("模块")
|
@ApiModelProperty("模块")
|
||||||
private Integer moduleCode;
|
private Integer moduleCode;
|
||||||
@ApiModelProperty("事项类型")
|
@ApiModelProperty("提醒类型")
|
||||||
private Integer remindType;
|
private Integer remindType;
|
||||||
@ApiModelProperty("提醒时间段 开始时间 阶段提醒时传")
|
@ApiModelProperty("提醒时间段 开始时间 阶段提醒时传")
|
||||||
private Date remindStartTime;
|
private Date remindStartTime;
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.cool.store.request.notice;
|
||||||
|
|
||||||
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/7/26 19:09
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MessageTemplateQueryRequest extends PageBasicInfo {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("模块")
|
||||||
|
private Integer moduleCode;
|
||||||
|
@ApiModelProperty("事项类型")
|
||||||
|
private Integer matterType;
|
||||||
|
@ApiModelProperty("事项标题")
|
||||||
|
private String messageTitle;
|
||||||
|
@ApiModelProperty("今日必办")
|
||||||
|
private Integer todayTask;
|
||||||
|
@ApiModelProperty("系统来源")
|
||||||
|
private String systemSource;
|
||||||
|
@ApiModelProperty("发布用户ID")
|
||||||
|
private String publishUserId;
|
||||||
|
@ApiModelProperty("发布状态")
|
||||||
|
private Integer publishStatus;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.cool.store.request.notice;
|
||||||
|
|
||||||
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/7/27 21:21
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StoreMessageListRequest extends PageBasicInfo {
|
||||||
|
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
private Integer moduleCode;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.cool.store.request.notice;
|
||||||
|
|
||||||
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/7/27 21:23
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StoreMessagePendingRequest extends PageBasicInfo {
|
||||||
|
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("待办列表时 不需要传")
|
||||||
|
private Integer moduleCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("手机号")
|
||||||
|
@NotEmpty
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否今日必办")
|
||||||
|
private Integer todayTask;
|
||||||
|
|
||||||
|
@ApiModelProperty("待办标识")
|
||||||
|
private Integer pendingFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.cool.store.request.notice;
|
||||||
|
|
||||||
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/7/26 20:13
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StoreMessageRequest extends PageBasicInfo {
|
||||||
|
|
||||||
|
@ApiModelProperty("模板ID")
|
||||||
|
private Long templateId;
|
||||||
|
|
||||||
|
@ApiModelProperty("阅读状态 0未读 1-已读")
|
||||||
|
private Integer readStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("处理状态 0未处理 1-已处理")
|
||||||
|
private Integer processStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("关键字查询")
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.cool.store.vo.notice;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/7/27 21:16
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MessageDetailVO {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("消息标题")
|
||||||
|
private String messageTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty("消息图片URL")
|
||||||
|
private String messageImage;
|
||||||
|
|
||||||
|
@ApiModelProperty("消息详情")
|
||||||
|
private String messageContent;
|
||||||
|
|
||||||
|
@ApiModelProperty("发布时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("发布人")
|
||||||
|
private String publishUserName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -41,5 +41,12 @@ public class MessageTemplateDetailVO {
|
|||||||
List<CommonDTO> storeInfoList;
|
List<CommonDTO> storeInfoList;
|
||||||
@ApiModelProperty( "默认处理人信息 type[person position userGroup organization]")
|
@ApiModelProperty( "默认处理人信息 type[person position userGroup organization]")
|
||||||
List<CommonDTO> userInfoList;
|
List<CommonDTO> userInfoList;
|
||||||
|
@ApiModelProperty("发布时间")
|
||||||
|
private Date publishTime;
|
||||||
|
@ApiModelProperty("处理完数据")
|
||||||
|
private Integer handleNum;
|
||||||
|
@ApiModelProperty("总数")
|
||||||
|
private Integer totalNum;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package com.cool.store.vo.notice;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/7/26 20:21
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StoreMessageDetailVO{
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店编码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("门店编码")
|
||||||
|
private String storeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("门店名称")
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联的消息模板ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("关联的消息模板ID")
|
||||||
|
private Long messageTemplateId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 阅读状态(0:未读 1:已读)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("阅读状态(0:未读 1:已读)")
|
||||||
|
private Integer readStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 阅读时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("阅读时间")
|
||||||
|
private Date readTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理状态(0:未处理 1:处理中)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("处理状态(0:未处理 1:处理中)")
|
||||||
|
private Integer processStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("处理时间")
|
||||||
|
private Date processTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际操作人ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("操作人ID")
|
||||||
|
private String actualOperatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际操作人姓名
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("操作人姓名")
|
||||||
|
private String actualOperatorName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤销状态(0:未撤销 1:已撤销)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("撤销状态(0:未撤销 1:已撤销)")
|
||||||
|
private Boolean revokeStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤销时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("撤销时间")
|
||||||
|
private Date revokeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤销操作人ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("撤销操作人ID")
|
||||||
|
private String revokeOperatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤销操作人姓名
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("撤销操作人姓名")
|
||||||
|
private String revokeOperatorName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.cool.store.vo.notice;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/7/27 21:10
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StoreMessageVO {
|
||||||
|
private Long id;
|
||||||
|
@ApiModelProperty("模版COde")
|
||||||
|
private Integer moduleCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("模版ID")
|
||||||
|
private Long templateId;
|
||||||
|
@ApiModelProperty("已读状态")
|
||||||
|
private Integer readStatus;
|
||||||
|
@ApiModelProperty("处理状态")
|
||||||
|
private Integer processStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("消息标题")
|
||||||
|
private String messageTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty("消息图片URL")
|
||||||
|
private String messageImage;
|
||||||
|
@ApiModelProperty("发布时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,10 +1,13 @@
|
|||||||
package com.cool.store.service;
|
package com.cool.store.service;
|
||||||
|
|
||||||
import com.cool.store.context.LoginUserInfo;
|
import com.cool.store.context.LoginUserInfo;
|
||||||
import com.cool.store.request.notice.BatchDeletedRequest;
|
import com.cool.store.dto.notice.NoticeDTO;
|
||||||
import com.cool.store.request.notice.BatchPublishRequest;
|
import com.cool.store.request.notice.*;
|
||||||
import com.cool.store.request.notice.MessageTemplateAddRequest;
|
import com.cool.store.vo.PartnerUserInfoVO;
|
||||||
import com.cool.store.vo.notice.MessageTemplateDetailVO;
|
import com.cool.store.vo.notice.*;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author suzhuhong
|
* @Author suzhuhong
|
||||||
@@ -54,9 +57,40 @@ public interface MessageTemplateService {
|
|||||||
Boolean batchPublishMessageTemplate(BatchPublishRequest request, LoginUserInfo user);
|
Boolean batchPublishMessageTemplate(BatchPublishRequest request, LoginUserInfo user);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取列表
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageInfo<NoticeDTO> getMessageTemplateList(MessageTemplateQueryRequest request);
|
||||||
|
|
||||||
|
|
||||||
|
PageInfo<StoreMessageDetailVO> getStoreMessageListByTemplateId(StoreMessageRequest request);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量撤销
|
||||||
|
* @param request
|
||||||
|
* @param user
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean batchRevokeNotice(BatchRevokeRequest request, LoginUserInfo user);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤销单个门店通知
|
||||||
|
* @param id
|
||||||
|
* @param user
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean revokeById(Long id, LoginUserInfo user);
|
||||||
|
|
||||||
|
List<ModuleAndMatterVO> getModuleList(String storeId);
|
||||||
|
|
||||||
|
PageInfo<StoreMessageVO> getStorePendingList(StoreMessagePendingRequest request);
|
||||||
|
|
||||||
|
MessageDetailVO getMessageDetail(Long id);
|
||||||
|
|
||||||
|
Boolean readMessage(Long id, PartnerUserInfoVO userInfoVO);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +1,43 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.context.LoginUserInfo;
|
import com.cool.store.context.LoginUserInfo;
|
||||||
|
import com.cool.store.context.PartnerUserHolder;
|
||||||
|
import com.cool.store.dao.EnterpriseUserDAO;
|
||||||
import com.cool.store.dao.MessageTemplateDAO;
|
import com.cool.store.dao.MessageTemplateDAO;
|
||||||
import com.cool.store.dao.RegionDao;
|
import com.cool.store.dao.RegionDao;
|
||||||
import com.cool.store.dao.StoreMessageDAO;
|
import com.cool.store.dao.StoreMessageDAO;
|
||||||
import com.cool.store.dto.notice.CommonDTO;
|
import com.cool.store.dto.notice.CommonDTO;
|
||||||
|
import com.cool.store.dto.notice.MessageTemplateCountDTO;
|
||||||
|
import com.cool.store.dto.notice.NoticeDTO;
|
||||||
import com.cool.store.dto.store.AuthStoreUserDTO;
|
import com.cool.store.dto.store.AuthStoreUserDTO;
|
||||||
import com.cool.store.dto.store.StoreAreaDTO;
|
import com.cool.store.dto.store.StoreAreaDTO;
|
||||||
import com.cool.store.entity.MessageTemplateDO;
|
import com.cool.store.entity.*;
|
||||||
import com.cool.store.entity.RegionDO;
|
|
||||||
import com.cool.store.entity.StoreGroupMappingDO;
|
|
||||||
import com.cool.store.entity.StoreMessageDO;
|
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
import com.cool.store.enums.notice.ProcessStatusEnum;
|
import com.cool.store.enums.notice.*;
|
||||||
import com.cool.store.enums.notice.PublishStatusEnum;
|
|
||||||
import com.cool.store.enums.notice.ReadStatusEnum;
|
|
||||||
import com.cool.store.enums.notice.TypeEnum;
|
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.mapper.StoreGroupMappingMapper;
|
import com.cool.store.mapper.StoreGroupMappingMapper;
|
||||||
import com.cool.store.mapper.StoreMapper;
|
import com.cool.store.mapper.StoreMapper;
|
||||||
import com.cool.store.request.notice.BatchDeletedRequest;
|
import com.cool.store.request.notice.*;
|
||||||
import com.cool.store.request.notice.BatchPublishRequest;
|
|
||||||
import com.cool.store.request.notice.MessageTemplateAddRequest;
|
|
||||||
import com.cool.store.service.MessageTemplateService;
|
import com.cool.store.service.MessageTemplateService;
|
||||||
import com.cool.store.service.StoreService;
|
import com.cool.store.service.StoreService;
|
||||||
import com.cool.store.vo.notice.MessageTemplateDetailVO;
|
import com.cool.store.utils.CoolDateUtils;
|
||||||
|
import com.cool.store.vo.PartnerUserInfoVO;
|
||||||
|
import com.cool.store.vo.notice.*;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
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;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,6 +62,8 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
StoreService storeService;
|
StoreService storeService;
|
||||||
@Resource
|
@Resource
|
||||||
StoreMessageDAO storeMessageDAO;
|
StoreMessageDAO storeMessageDAO;
|
||||||
|
@Resource
|
||||||
|
EnterpriseUserDAO enterpriseUserDAO;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -66,11 +71,20 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
public Boolean addMessageTemplate(MessageTemplateAddRequest request, LoginUserInfo user) {
|
public Boolean addMessageTemplate(MessageTemplateAddRequest request, LoginUserInfo user) {
|
||||||
MessageTemplateDO messageTemplateDO = new MessageTemplateDO();
|
MessageTemplateDO messageTemplateDO = new MessageTemplateDO();
|
||||||
BeanUtils.copyProperties(request, messageTemplateDO);
|
BeanUtils.copyProperties(request, messageTemplateDO);
|
||||||
|
messageTemplateDO.setMessageCode(getMessageTemplateCode());
|
||||||
|
messageTemplateDO.setMatterType(MatterTypeEnum.NOTICE.getCode());
|
||||||
messageTemplateDO.setCreateUserId(user.getUserId());
|
messageTemplateDO.setCreateUserId(user.getUserId());
|
||||||
|
messageTemplateDO.setSystemSource("CRM");
|
||||||
messageTemplateDAO.insert(messageTemplateDO);
|
messageTemplateDAO.insert(messageTemplateDO);
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMessageTemplateCode() {
|
||||||
|
//当前日期
|
||||||
|
String today = CoolDateUtils.getToday();
|
||||||
|
return "16" + today + String.format("%04d", ThreadLocalRandom.current().nextInt(10000));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean editMessageTemplate(MessageTemplateAddRequest request, LoginUserInfo user) {
|
public Boolean editMessageTemplate(MessageTemplateAddRequest request, LoginUserInfo user) {
|
||||||
if (request.getId()==null){
|
if (request.getId()==null){
|
||||||
@@ -97,6 +111,12 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
BeanUtils.copyProperties(messageTemplateDO, messageTemplateDetailVO);
|
BeanUtils.copyProperties(messageTemplateDO, messageTemplateDetailVO);
|
||||||
messageTemplateDetailVO.setUserInfoList(JSONObject.parseArray(messageTemplateDO.getHandlePersonInfo(), CommonDTO.class));
|
messageTemplateDetailVO.setUserInfoList(JSONObject.parseArray(messageTemplateDO.getHandlePersonInfo(), CommonDTO.class));
|
||||||
messageTemplateDetailVO.setStoreInfoList(JSONObject.parseArray(messageTemplateDO.getStoreInfo(), CommonDTO.class));
|
messageTemplateDetailVO.setStoreInfoList(JSONObject.parseArray(messageTemplateDO.getStoreInfo(), CommonDTO.class));
|
||||||
|
List<MessageTemplateCountDTO> messageTemplateCountList = storeMessageDAO.getMessageTemplateCountList(Arrays.asList(messageTemplateDO.getId()));
|
||||||
|
|
||||||
|
if (CollectionUtils.isNotEmpty(messageTemplateCountList)){
|
||||||
|
messageTemplateDetailVO.setTotalNum(messageTemplateCountList.get(0).getTotalStoreCount());
|
||||||
|
messageTemplateDetailVO.setHandleNum(messageTemplateCountList.get(0).getProcessedStoreCount());
|
||||||
|
}
|
||||||
return messageTemplateDetailVO;
|
return messageTemplateDetailVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,6 +138,7 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
if (CollectionUtils.isEmpty(request.getIds())||CollectionUtils.isEmpty(request.getStoreInfoList())||CollectionUtils.isEmpty(request.getUserInfoList())){
|
if (CollectionUtils.isEmpty(request.getIds())||CollectionUtils.isEmpty(request.getStoreInfoList())||CollectionUtils.isEmpty(request.getUserInfoList())){
|
||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<StoreAreaDTO> storeAreaDTOS = getStoreRange(request.getStoreInfoList());
|
List<StoreAreaDTO> storeAreaDTOS = getStoreRange(request.getStoreInfoList());
|
||||||
List<String> storeIds = storeAreaDTOS.stream().map(StoreAreaDTO::getStoreId).collect(Collectors.toList());
|
List<String> storeIds = storeAreaDTOS.stream().map(StoreAreaDTO::getStoreId).collect(Collectors.toList());
|
||||||
|
|
||||||
@@ -127,6 +148,10 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
//过滤 只保留未发布的
|
//过滤 只保留未发布的
|
||||||
list = list.stream().filter(x -> PublishStatusEnum.UNPUBLISHED.getCode().equals(x.getPublishStatus())).collect(Collectors.toList());
|
list = list.stream().filter(x -> PublishStatusEnum.UNPUBLISHED.getCode().equals(x.getPublishStatus())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (CollUtil.isEmpty(list)){
|
||||||
|
log.info("未找到待发布消息模板");
|
||||||
|
}
|
||||||
|
|
||||||
list.stream().forEach(x -> {
|
list.stream().forEach(x -> {
|
||||||
List<StoreMessageDO> result = new ArrayList<>();
|
List<StoreMessageDO> result = new ArrayList<>();
|
||||||
storeAreaDTOS.forEach(y->{
|
storeAreaDTOS.forEach(y->{
|
||||||
@@ -136,6 +161,7 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
}
|
}
|
||||||
StoreMessageDO storeMessageDO = new StoreMessageDO();
|
StoreMessageDO storeMessageDO = new StoreMessageDO();
|
||||||
storeMessageDO.setStoreId(y.getStoreId());
|
storeMessageDO.setStoreId(y.getStoreId());
|
||||||
|
storeMessageDO.setStoreName(y.getStoreName());
|
||||||
storeMessageDO.setStoreCode(y.getStoreCode());
|
storeMessageDO.setStoreCode(y.getStoreCode());
|
||||||
storeMessageDO.setMessageTemplateId(x.getId());
|
storeMessageDO.setMessageTemplateId(x.getId());
|
||||||
storeMessageDO.setReadStatus(ReadStatusEnum.UNREAD.getCode());
|
storeMessageDO.setReadStatus(ReadStatusEnum.UNREAD.getCode());
|
||||||
@@ -148,24 +174,166 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
});
|
});
|
||||||
storeMessageDAO.batchInsert(result);
|
storeMessageDAO.batchInsert(result);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
List<Long> updateIds = list.stream().map(MessageTemplateDO::getId).collect(Collectors.toList());
|
||||||
|
messageTemplateDAO.batchUpdateStoreInfoAndUserInfo(updateIds,
|
||||||
|
JSONObject.toJSONString(request.getStoreInfoList()),
|
||||||
|
JSONObject.toJSONString(request.getUserInfoList()),
|
||||||
|
user.getUserId());
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<NoticeDTO> getMessageTemplateList(MessageTemplateQueryRequest request) {
|
||||||
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
|
List<NoticeDTO> list = messageTemplateDAO.getMessageTemplateList(request);
|
||||||
|
if (CollectionUtils.isEmpty(list)){
|
||||||
|
return new PageInfo<>(list);
|
||||||
|
}
|
||||||
|
//将列表中的创建人id与发布人id 放到同一个list 去重
|
||||||
|
Set<String> userIdSet = new HashSet<>();
|
||||||
|
list.forEach(notice -> {
|
||||||
|
if (notice.getCreateUserId() != null) {
|
||||||
|
userIdSet.add(String.valueOf(notice.getCreateUserId()));
|
||||||
|
}
|
||||||
|
if (notice.getPublishUserId() != null) {
|
||||||
|
userIdSet.add(String.valueOf(notice.getPublishUserId()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
List<String> uniqueUserIds = new ArrayList<>(userIdSet);
|
||||||
|
List<EnterpriseUserDO> userInfoByUserIds = enterpriseUserDAO.getUserInfoByUserIds(uniqueUserIds);
|
||||||
|
Map<String, String> userMap = userInfoByUserIds.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getName));
|
||||||
|
|
||||||
|
|
||||||
|
List<Long> templateIds = list.stream().map(NoticeDTO::getId).collect(Collectors.toList());
|
||||||
|
List<MessageTemplateCountDTO> messageTemplateCountList = storeMessageDAO.getMessageTemplateCountList(templateIds);
|
||||||
|
//根据模板id查询 转为map
|
||||||
|
Map<Long, MessageTemplateCountDTO> messageTemplateCountMap = messageTemplateCountList.stream().collect(Collectors.toMap(MessageTemplateCountDTO::getTemplateId, x -> x));
|
||||||
|
list.forEach(x -> {
|
||||||
|
x.setCreateUserName(userMap.get(x.getCreateUserId()));
|
||||||
|
x.setPublishUserName(userMap.get(x.getPublishUserId()));
|
||||||
|
MessageTemplateCountDTO count = messageTemplateCountMap.getOrDefault(x.getId(), new MessageTemplateCountDTO());
|
||||||
|
x.setHandleNum(count.getProcessedStoreCount());
|
||||||
|
x.setTotalNum(count.getTotalStoreCount());
|
||||||
|
});
|
||||||
|
return new PageInfo<>(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<StoreMessageDetailVO> getStoreMessageListByTemplateId(StoreMessageRequest request) {
|
||||||
|
PageHelper.startPage(request.getPageNum(),request.getPageSize());
|
||||||
|
List<StoreMessageDO> list = storeMessageDAO.getStoreMessageList(request);
|
||||||
|
if (CollectionUtils.isEmpty(list)){
|
||||||
|
return new PageInfo<>();
|
||||||
|
}
|
||||||
|
StoreMessageDetailVO storeMessageDetailVO = new StoreMessageDetailVO();
|
||||||
|
List<StoreMessageDetailVO> result = new ArrayList<>();
|
||||||
|
list.forEach(x->{
|
||||||
|
BeanUtils.copyProperties(x,storeMessageDetailVO);
|
||||||
|
result.add(storeMessageDetailVO);
|
||||||
|
});
|
||||||
|
PageInfo storeMessageDOPageInfo = new PageInfo<>(list);
|
||||||
|
storeMessageDOPageInfo.setList(result);
|
||||||
|
return storeMessageDOPageInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean batchRevokeNotice(BatchRevokeRequest request, LoginUserInfo user) {
|
||||||
|
log.info("batchRevokeNotice request:{}", JSONObject.toJSONString(request));
|
||||||
|
List<Long> ids = request.getIds();
|
||||||
|
if (ids == null || ids.size() == 0) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||||
|
}
|
||||||
|
//将消息置为撤销状态
|
||||||
|
messageTemplateDAO.batchUpdatePublishStatus(ids);
|
||||||
|
//将门店未处理的消息置为撤销状态 已处理和撤销的保持不变
|
||||||
|
storeMessageDAO.batchRevoke(ids, user.getUserId(), user.getName());
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean revokeById(Long id, LoginUserInfo user) {
|
||||||
|
//查询门店消息
|
||||||
|
StoreMessageDO storeMessage = storeMessageDAO.getById(id);
|
||||||
|
if (storeMessage == null){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||||
|
}
|
||||||
|
if (RevokeStatusEnum.REVOKE.getCode().equals(storeMessage.getRevokeStatus())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.STORE_MESSAGE_REVOKE);
|
||||||
|
}
|
||||||
|
if (ProcessStatusEnum.PROCESSED.getCode().equals(storeMessage.getProcessStatus())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.STORE_MESSAGE_HANDLED);
|
||||||
|
}
|
||||||
|
storeMessageDAO.revokeById(id,user.getUserId(),user.getName());
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ModuleAndMatterVO> getModuleList(String storeId) {
|
||||||
|
List<ModuleAndMatterVO> moduleAndMatterList = ModuleAndMatterVO.getModuleAndMatterList();
|
||||||
|
List<ModuleAndMatterVO> list= new ArrayList<>();
|
||||||
|
moduleAndMatterList.forEach(x->{
|
||||||
|
Integer integer = storeMessageDAO.queryStoreModuleCount(storeId, x.getModuleCode());
|
||||||
|
if (integer > 0){
|
||||||
|
list.add(x);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<StoreMessageVO> getStorePendingList(StoreMessagePendingRequest request) {
|
||||||
|
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.selectByMobile(request.getMobile());
|
||||||
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
|
List<StoreMessageVO> storeMessageListByCondition = storeMessageDAO.getStoreMessageListByCondition(request.getStoreId(), request.getModuleCode(),
|
||||||
|
request.getTodayTask(), request.getPendingFlag(), enterpriseUserDO.getUserId());
|
||||||
|
return new PageInfo<>(storeMessageListByCondition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MessageDetailVO getMessageDetail(Long id) {
|
||||||
|
MessageDetailVO messageDetailVO = storeMessageDAO.getMessageDetail(id);
|
||||||
|
return messageDetailVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean readMessage(Long id, PartnerUserInfoVO userInfoVO) {
|
||||||
|
StoreMessageDO message = storeMessageDAO.getById(id);
|
||||||
|
if (ProcessStatusEnum.PROCESSED.getCode().equals(message.getProcessStatus())){
|
||||||
|
log.info("当前消息已读已处理:{}",JSONObject.toJSONString( message));
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
message.setReadStatus(ProcessStatusEnum.PROCESSED.getCode());
|
||||||
|
message.setReadTime(new Date());
|
||||||
|
MessageTemplateDO template = messageTemplateDAO.getById(message.getMessageTemplateId());
|
||||||
|
if (ProcessTypeEnum.READ.getCode().equals(template.getProcessType())){
|
||||||
|
message.setProcessStatus(ProcessStatusEnum.PROCESSED.getCode());
|
||||||
|
message.setProcessTime(new Date());
|
||||||
|
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.selectByMobile(userInfoVO.getMobile());
|
||||||
|
if (enterpriseUserDO != null){
|
||||||
|
message.setActualOperatorId(enterpriseUserDO.getId());
|
||||||
|
message.setActualOperatorName(enterpriseUserDO.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storeMessageDAO.update( message);
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Map<String, List<String>> getAuthUser(List<CommonDTO> personInfo, List<String> storeIds){
|
public Map<String, List<String>> getAuthUser(List<CommonDTO> personInfo, List<String> storeIds){
|
||||||
if (CollectionUtils.isEmpty(personInfo)){
|
if (CollectionUtils.isEmpty(personInfo)){
|
||||||
return new HashMap<>();
|
return new HashMap<>();
|
||||||
}
|
}
|
||||||
List<String> personIds = personInfo.stream().filter(x -> TypeEnum.PERSON.equals(x.getType()))
|
List<String> personIds = personInfo.stream().filter(x -> TypeEnum.PERSON.getType().equals(x.getType()))
|
||||||
.map(CommonDTO::getValue).collect(Collectors.toList());
|
.map(CommonDTO::getValue).collect(Collectors.toList());
|
||||||
List<String> positionIds = personInfo.stream().filter(x -> TypeEnum.POSITION.equals(x.getType()))
|
List<String> positionIds = personInfo.stream().filter(x -> TypeEnum.POSITION.getType().equals(x.getType()))
|
||||||
.map(CommonDTO::getValue).collect(Collectors.toList());
|
.map(CommonDTO::getValue).collect(Collectors.toList());
|
||||||
List<String> groupIdList = personInfo.stream().filter(x -> TypeEnum.USER_GROUP.equals(x.getType()))
|
List<String> groupIdList = personInfo.stream().filter(x -> TypeEnum.USER_GROUP.getType().equals(x.getType()))
|
||||||
.map(CommonDTO::getValue).collect(Collectors.toList());
|
.map(CommonDTO::getValue).collect(Collectors.toList());
|
||||||
List<String> regionIdList = personInfo.stream().filter(x -> TypeEnum.ORGANIZATION.equals(x.getType()))
|
List<String> regionIdList = personInfo.stream().filter(x -> TypeEnum.ORGANIZATION.getType().equals(x.getType()))
|
||||||
.map(CommonDTO::getValue).collect(Collectors.toList());
|
.map(CommonDTO::getValue).collect(Collectors.toList());
|
||||||
//权限
|
//权限
|
||||||
List<AuthStoreUserDTO> authStoreUserList = storeService.getStorePositionUserList(storeIds, positionIds, personIds, groupIdList, regionIdList);
|
List<AuthStoreUserDTO> authStoreUserList = storeService.getStorePositionUserList(storeIds, positionIds, personIds, groupIdList, regionIdList);
|
||||||
@@ -183,7 +351,7 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private List<StoreAreaDTO> getStoreRange( List<CommonDTO> commonDTOS){
|
private List<StoreAreaDTO> getStoreRange( List<CommonDTO> commonDTOS){
|
||||||
List<String> regionIds = commonDTOS.stream().filter(x -> TypeEnum.REGION.equals(x.getType()))
|
List<String> regionIds = commonDTOS.stream().filter(x -> TypeEnum.REGION.getType().equals(x.getType()))
|
||||||
.map(CommonDTO::getValue).collect(Collectors.toList());
|
.map(CommonDTO::getValue).collect(Collectors.toList());
|
||||||
|
|
||||||
List<RegionDO> regionDOsByRegionIds = new ArrayList<>();
|
List<RegionDO> regionDOsByRegionIds = new ArrayList<>();
|
||||||
@@ -196,13 +364,13 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
|
|||||||
List<StoreAreaDTO> storeAreaDTOS = storeMapper.listStoreByRegionPathList(regionFullRegionPathList);
|
List<StoreAreaDTO> storeAreaDTOS = storeMapper.listStoreByRegionPathList(regionFullRegionPathList);
|
||||||
storeIdSet = storeAreaDTOS.stream().map(StoreAreaDTO::getStoreId).collect(Collectors.toSet());
|
storeIdSet = storeAreaDTOS.stream().map(StoreAreaDTO::getStoreId).collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
List<String> storeIdList = commonDTOS.stream().filter(x -> TypeEnum.STORE.equals(x.getType()))
|
List<String> storeIdList = commonDTOS.stream().filter(x -> TypeEnum.STORE.getType().equals(x.getType()))
|
||||||
.map(CommonDTO::getValue).collect(Collectors.toList());
|
.map(CommonDTO::getValue).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(storeIdList)){
|
if (CollectionUtils.isNotEmpty(storeIdList)){
|
||||||
//将寻找的门店添加到set中
|
//将寻找的门店添加到set中
|
||||||
storeIdSet.addAll(storeIdList);
|
storeIdSet.addAll(storeIdList);
|
||||||
}
|
}
|
||||||
List<String> groupList = commonDTOS.stream().filter(x -> TypeEnum.GROUP.equals(x.getType()))
|
List<String> groupList = commonDTOS.stream().filter(x -> TypeEnum.GROUP.getType().equals(x.getType()))
|
||||||
.map(CommonDTO::getValue).collect(Collectors.toList());
|
.map(CommonDTO::getValue).collect(Collectors.toList());
|
||||||
//分组
|
//分组
|
||||||
if (CollectionUtils.isNotEmpty(groupList)) {
|
if (CollectionUtils.isNotEmpty(groupList)) {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
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.notice.BatchDeletedRequest;
|
import com.cool.store.dto.notice.NoticeDTO;
|
||||||
import com.cool.store.request.notice.BatchPublishRequest;
|
import com.cool.store.request.notice.*;
|
||||||
import com.cool.store.request.notice.MatterConfigAddRequest;
|
|
||||||
import com.cool.store.request.notice.MessageTemplateAddRequest;
|
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.MessageTemplateService;
|
import com.cool.store.service.MessageTemplateService;
|
||||||
import com.cool.store.vo.notice.MessageTemplateDetailVO;
|
import com.cool.store.vo.notice.MessageTemplateDetailVO;
|
||||||
|
import com.cool.store.vo.notice.StoreMessageDetailVO;
|
||||||
|
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;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -58,9 +58,33 @@ public class MessageTemplateController {
|
|||||||
|
|
||||||
@PostMapping("/batchPublish")
|
@PostMapping("/batchPublish")
|
||||||
@ApiOperation("批量发布")
|
@ApiOperation("批量发布")
|
||||||
public ResponseResult<Boolean> editMessageTemplate(@RequestBody BatchPublishRequest request) {
|
public ResponseResult<Boolean> batchPublishMessageTemplate(@RequestBody BatchPublishRequest request) {
|
||||||
return ResponseResult.success(messageTemplateService.batchPublishMessageTemplate(request, CurrentUserHolder.getUser()));
|
return ResponseResult.success(messageTemplateService.batchPublishMessageTemplate(request, CurrentUserHolder.getUser()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getMessageTemplateList")
|
||||||
|
@ApiOperation("通知管理列表/事项管理列表")
|
||||||
|
public ResponseResult<PageInfo<NoticeDTO>> getMessageTemplateList(@RequestBody MessageTemplateQueryRequest request) {
|
||||||
|
return ResponseResult.success(messageTemplateService.getMessageTemplateList(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getStoreMessageListByTemplateId")
|
||||||
|
@ApiOperation("进度管理")
|
||||||
|
public ResponseResult<PageInfo<StoreMessageDetailVO>> getStoreMessageListByTemplateId(@RequestBody StoreMessageRequest request) {
|
||||||
|
return ResponseResult.success(messageTemplateService.getStoreMessageListByTemplateId(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/batchRevokeNotice")
|
||||||
|
@ApiOperation("进度管理")
|
||||||
|
public ResponseResult<Boolean> batchRevokeNotice(@RequestBody BatchRevokeRequest request) {
|
||||||
|
return ResponseResult.success(messageTemplateService.batchRevokeNotice(request,CurrentUserHolder.getUser()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("撤销单个门店消息")
|
||||||
|
@GetMapping("/revokeById")
|
||||||
|
public ResponseResult<Boolean> revokeById(@RequestParam("id")Long id) {
|
||||||
|
return ResponseResult.success(messageTemplateService.revokeById(id,CurrentUserHolder.getUser()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.cool.store.controller.webc;
|
||||||
|
|
||||||
|
import com.cool.store.context.CurrentUserHolder;
|
||||||
|
import com.cool.store.context.PartnerUserHolder;
|
||||||
|
import com.cool.store.request.notice.StoreMessagePendingRequest;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.MessageTemplateService;
|
||||||
|
import com.cool.store.vo.notice.MessageDetailVO;
|
||||||
|
import com.cool.store.vo.notice.ModuleAndMatterVO;
|
||||||
|
import com.cool.store.vo.notice.StoreMessageVO;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/7/27 21:04
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/mini/notice")
|
||||||
|
@Api(tags = "mini事项/通知管理")
|
||||||
|
@Slf4j
|
||||||
|
public class MiniMessageTemplateController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MessageTemplateService messageTemplateService;
|
||||||
|
|
||||||
|
@ApiOperation("获取每个门店需要展示的模块")
|
||||||
|
@GetMapping("/getModuleListByStoreId")
|
||||||
|
public ResponseResult<List<ModuleAndMatterVO>> getModuleListByStoreId(@RequestParam("id")String storeId) {
|
||||||
|
return ResponseResult.success(messageTemplateService.getModuleList(storeId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取消息详情")
|
||||||
|
@GetMapping("/getMessageDetail")
|
||||||
|
public ResponseResult<MessageDetailVO> getMessageDetail(@RequestParam("id")Long id) {
|
||||||
|
return ResponseResult.success(messageTemplateService.getMessageDetail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("待办列表/模块列表")
|
||||||
|
@GetMapping("/getStorePendingList")
|
||||||
|
public ResponseResult<PageInfo<StoreMessageVO>> getStorePendingList(@RequestBody StoreMessagePendingRequest request) {
|
||||||
|
return ResponseResult.success(messageTemplateService.getStorePendingList(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("确认已读")
|
||||||
|
@GetMapping("/readMessage")
|
||||||
|
public ResponseResult<Boolean> readMessage(@RequestParam("id")Long id) {
|
||||||
|
return ResponseResult.success(messageTemplateService.readMessage(id, PartnerUserHolder.getUser()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user