13 changed files with 450 additions and 7 deletions
@ -0,0 +1,65 @@ |
|||||
|
package com.zdxt.enforcementnos.controller.app.enforcement; |
||||
|
|
||||
|
import com.zdxt.enforcementnos.common.PageParam; |
||||
|
import com.zdxt.enforcementnos.domain.vo.NosLawEnforcementCommentMsgPageVO; |
||||
|
import com.zdxt.enforcementnos.service.NosLawEnforcementCommentMsgService; |
||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||
|
import io.swagger.v3.oas.annotations.Parameter; |
||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
|
import jakarta.annotation.Resource; |
||||
|
import jakarta.validation.Valid; |
||||
|
import org.dromara.common.core.domain.R; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* @author msy |
||||
|
* @Date: 2026/6/9 |
||||
|
*/ |
||||
|
@Tag(name = "执法端 - 非现场执法任务评价消息") |
||||
|
@Validated |
||||
|
@RestController |
||||
|
@RequestMapping("/app-enf/nos-law-enforcement-task/comment-msg") |
||||
|
public class NosLawEnforcementCommentMsgController { |
||||
|
|
||||
|
@Resource |
||||
|
private NosLawEnforcementCommentMsgService nosLawEnforcementCommentMsgService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 分页查询非现场执法任务评价消息 |
||||
|
* @param pageParam 分页参数 |
||||
|
* @return TableDataInfo<NosLawEnforcementCommentMsgPageVO> |
||||
|
*/ |
||||
|
@Operation(summary = "分页查询非现场执法任务评价消息") |
||||
|
@PostMapping("/page") |
||||
|
public TableDataInfo<NosLawEnforcementCommentMsgPageVO> commentMsgPage(@RequestBody @Valid PageParam pageParam) { |
||||
|
return nosLawEnforcementCommentMsgService.commentMsgPage(pageParam); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 查询未读消息数量 |
||||
|
* @return R<Integer> |
||||
|
*/ |
||||
|
@Operation(summary = "查询未读消息数量") |
||||
|
@PostMapping("/un-read/count") |
||||
|
public R<Integer> unReadCommentMsgCount() { |
||||
|
return R.ok(nosLawEnforcementCommentMsgService.unReadCommentMsgCount()); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 标记消息为已读 |
||||
|
* @param msgId 消息id |
||||
|
* @return R<Boolean> |
||||
|
*/ |
||||
|
@Operation(summary = "标记消息为已读") |
||||
|
@Parameter(name = "msgId", description = "消息id", required = true) |
||||
|
@GetMapping("/mark-read") |
||||
|
public R<Boolean> markRead(@RequestParam @Valid String msgId) { |
||||
|
return R.ok(nosLawEnforcementCommentMsgService.markRead(msgId)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,100 @@ |
|||||
|
package com.zdxt.enforcementnos.domain.vo; |
||||
|
|
||||
|
import com.zdxt.enforcementnos.common.LawEnforcer; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author msy |
||||
|
* @Date: 2026/6/9 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class NosLawEnforcementCommentMsgPageVO { |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
@Schema(description = "id") |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 任务id |
||||
|
*/ |
||||
|
@Schema(description = "任务id") |
||||
|
private String taskId; |
||||
|
|
||||
|
/** |
||||
|
* 任务类别(1-行政检查、2-材料备案、3-材料验证、4-待核实案件) |
||||
|
*/ |
||||
|
@Schema(description = "任务类别(1-行政检查、2-材料备案、3-材料验证、4-待核实案件)") |
||||
|
private Integer taskType; |
||||
|
|
||||
|
/** |
||||
|
* 标题 |
||||
|
*/ |
||||
|
@Schema(description = "标题") |
||||
|
private String title; |
||||
|
|
||||
|
/** |
||||
|
* 企业id |
||||
|
*/ |
||||
|
@Schema(description = "企业id") |
||||
|
private String enterpriseId; |
||||
|
|
||||
|
/** |
||||
|
* 企业名称 |
||||
|
*/ |
||||
|
@Schema(description = "企业名称") |
||||
|
private String enterpriseName; |
||||
|
|
||||
|
/** |
||||
|
* 执法单位id |
||||
|
*/ |
||||
|
@Schema(description = "执法单位id") |
||||
|
private String lawEnforcementAgencyId; |
||||
|
|
||||
|
/** |
||||
|
* 执法单位名称 |
||||
|
*/ |
||||
|
@Schema(description = "执法单位名称") |
||||
|
private String lawEnforcementAgency; |
||||
|
|
||||
|
/** |
||||
|
* 执法人员 |
||||
|
*/ |
||||
|
@Schema(description = "执法人员") |
||||
|
private List<LawEnforcer> lawEnforcer; |
||||
|
|
||||
|
/** |
||||
|
* 评价状态(0-未评价,1-已评价) |
||||
|
*/ |
||||
|
@Schema(description = "评价状态(0-未评价,1-已评价)") |
||||
|
private Integer commentStatus; |
||||
|
|
||||
|
/** |
||||
|
* 评价时间 |
||||
|
*/ |
||||
|
@Schema(description = "评价时间") |
||||
|
private Date commentTime; |
||||
|
|
||||
|
/** |
||||
|
* 办结时间 |
||||
|
*/ |
||||
|
@Schema(description = "办结时间") |
||||
|
private Date checkTime; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
@Schema(description = "创建时间") |
||||
|
private Date createTime; |
||||
|
|
||||
|
/** |
||||
|
* 是否已读 |
||||
|
*/ |
||||
|
@Schema(description = "是否已读") |
||||
|
private Boolean read; |
||||
|
} |
||||
@ -1,11 +1,20 @@ |
|||||
package com.zdxt.enforcementnos.service; |
package com.zdxt.enforcementnos.service; |
||||
|
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.zdxt.enforcementnos.common.PageParam; |
||||
import com.zdxt.enforcementnos.domain.NosLawEnforcementCommentMsg; |
import com.zdxt.enforcementnos.domain.NosLawEnforcementCommentMsg; |
||||
|
import com.zdxt.enforcementnos.domain.vo.NosLawEnforcementCommentMsgPageVO; |
||||
|
import jakarta.validation.Valid; |
||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
||||
|
|
||||
/** |
/** |
||||
* @author msy |
* @author msy |
||||
* @Date: 2026/6/3 |
* @Date: 2026/6/3 |
||||
*/ |
*/ |
||||
public interface NosLawEnforcementCommentMsgService extends IService<NosLawEnforcementCommentMsg> { |
public interface NosLawEnforcementCommentMsgService extends IService<NosLawEnforcementCommentMsg> { |
||||
|
TableDataInfo<NosLawEnforcementCommentMsgPageVO> commentMsgPage(@Valid PageParam pageParam); |
||||
|
|
||||
|
Integer unReadCommentMsgCount(); |
||||
|
|
||||
|
Boolean markRead(@Valid String msgId); |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,80 @@ |
|||||
|
<?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.zdxt.enforcementnos.mapper.NosLawEnforcementCommentMsgMapper"> |
||||
|
|
||||
|
<select id="queryCommentMsgPage" |
||||
|
resultType="com.zdxt.enforcementnos.domain.vo.NosLawEnforcementCommentMsgPageVO"> |
||||
|
SELECT |
||||
|
m.id, |
||||
|
m.task_id, |
||||
|
m.task_type, |
||||
|
m.title, |
||||
|
m.enterprise_id, |
||||
|
m.enterprise_name, |
||||
|
m.law_enforcement_agency_id, |
||||
|
m.law_enforcement_agency, |
||||
|
m.comment_status, |
||||
|
m.comment_time, |
||||
|
m.check_time, |
||||
|
m.create_time |
||||
|
FROM nos_law_enforcement_comment_msg m |
||||
|
INNER JOIN nos_law_enforcement_task_law_enforcer_relation r |
||||
|
ON m.task_id = r.task_id |
||||
|
AND r.is_delete = '0' |
||||
|
WHERE m.is_delete = '0' |
||||
|
AND r.law_enforcer_id = #{userId} |
||||
|
ORDER BY m.create_time DESC |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
<select id="unReadCommentMsgCount" resultType="java.lang.Integer"> |
||||
|
SELECT |
||||
|
count(*) |
||||
|
FROM nos_law_enforcement_comment_msg msg |
||||
|
WHERE msg.is_delete = '0' |
||||
|
AND NOT EXISTS ( |
||||
|
SELECT 1 |
||||
|
FROM sys_message_view_log log |
||||
|
WHERE log.source_id = msg.id |
||||
|
AND log.create_by = #{userId} |
||||
|
AND log.is_delete = 0 |
||||
|
AND log.platform_type = 2 |
||||
|
) |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
<select id="queryCommentMsgByUser" resultType="com.zdxt.enforcementnos.domain.NosLawEnforcementCommentMsg"> |
||||
|
SELECT |
||||
|
m.id, |
||||
|
m.task_id, |
||||
|
m.task_type, |
||||
|
m.title, |
||||
|
m.enterprise_id, |
||||
|
m.enterprise_name, |
||||
|
m.law_enforcement_agency_id, |
||||
|
m.law_enforcement_agency, |
||||
|
m.law_enforcer, |
||||
|
m.comment_status, |
||||
|
m.comment_time, |
||||
|
m.check_time, |
||||
|
m.create_by, |
||||
|
m.create_time, |
||||
|
m.update_by, |
||||
|
m.update_time, |
||||
|
m.is_delete, |
||||
|
m.create_dept, |
||||
|
m.bureau_dept_id, |
||||
|
m.dept_id, |
||||
|
m.organ_id |
||||
|
FROM nos_law_enforcement_comment_msg m |
||||
|
INNER JOIN nos_law_enforcement_task_law_enforcer_relation r |
||||
|
ON m.task_id = r.task_id |
||||
|
AND r.is_delete = '0' |
||||
|
WHERE m.is_delete = '0' |
||||
|
AND m.id = #{msgId} |
||||
|
AND r.law_enforcer_id = #{userId} |
||||
|
LIMIT 1 |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
Loading…
Reference in new issue