Browse Source

feat: 新增通知管理

master
wxc 2 months ago
parent
commit
abc8eac8f0
  1. 17
      sql/20250925.sql
  2. 18
      src/main/java/com/biutag/supervision/constants/enums/SuperviseReportTypeEnum.java
  3. 3
      src/main/java/com/biutag/supervision/controller/books/NegativeBookController.java
  4. 4
      src/main/java/com/biutag/supervision/controller/supervise/SuperviseReportController.java
  5. 7
      src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java
  6. 8
      src/main/java/com/biutag/supervision/mapper/SuperviseReportDepartMapper.java
  7. 3
      src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java
  8. 3
      src/main/java/com/biutag/supervision/pojo/entity/Negative.java
  9. 6
      src/main/java/com/biutag/supervision/pojo/entity/SuperviseReport.java
  10. 35
      src/main/java/com/biutag/supervision/pojo/entity/SuperviseReportDepart.java
  11. 2
      src/main/java/com/biutag/supervision/pojo/param/SuperviseReportQueryParam.java
  12. 2
      src/main/java/com/biutag/supervision/pojo/vo/DataPetition12337ExportVo.java
  13. 7
      src/main/java/com/biutag/supervision/pojo/vo/SuperviseReportVo.java
  14. 11
      src/main/java/com/biutag/supervision/service/SuperviseReportDepartService.java
  15. 39
      src/main/java/com/biutag/supervision/service/SuperviseReportService.java
  16. 2
      src/main/resources/mapper/DataPetition12337Mapper.xml
  17. 2
      src/test/java/com/biutag/supervision/tools/GenCodeTests.java

17
sql/20250925.sql

@ -0,0 +1,17 @@
ALTER TABLE `negative`.`negative`
ADD COLUMN `disciplinary_action_desc` text NULL COMMENT '处分处理情况' AFTER `process_result`;
ALTER TABLE `negative`.`supervise_report`
ADD COLUMN `type` int NULL DEFAULT 1 COMMENT '通知通报类型 1-通报 2-通知' AFTER `crt_emp_no`,
ADD COLUMN `depart_name` varchar(500) NULL COMMENT '通知单位' AFTER `type`;
CREATE TABLE `supervise_report_depart` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
`depart_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '单位ID',
`depart_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '单位名称',
`supervise_id` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '通知通报ID',
`crt_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='通知单位';

18
src/main/java/com/biutag/supervision/constants/enums/SuperviseReportTypeEnum.java

@ -0,0 +1,18 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author wxc
* @date 2025/9/25
*/
@AllArgsConstructor
public enum SuperviseReportTypeEnum {
REPORT(1),
NOTICE(2);
@Getter
private Integer value;
}

3
src/main/java/com/biutag/supervision/controller/books/NegativeBookController.java

@ -268,12 +268,11 @@ public class NegativeBookController {
if (!negativeBlames.isEmpty() && NumberUtil.isInteger(negativeBlames.get(0).getBlameEmpNo())) { if (!negativeBlames.isEmpty() && NumberUtil.isInteger(negativeBlames.get(0).getBlameEmpNo())) {
item.setVerifiedPersonType("在编人员"); item.setVerifiedPersonType("在编人员");
} }
if (!"免予处分".equals(item.getHandleResult12337()) && !"不予处分".equals(item.getHandleResult12337())) { if ("具有违纪违法情况".equals(item.getProcessResult1()) && !"免予处分".equals(item.getHandleResult12337()) && !"不予处分".equals(item.getHandleResult12337())) {
item.setIsPunish("是"); item.setIsPunish("是");
} else { } else {
item.setIsPunish("否"); item.setIsPunish("否");
} }
item.setPunishDes(item.getCheckStatusDesc());
}); });
String headerValue = "attachment; filename=\"" + URLEncoder.encode("12337信访投诉数据台账.xlsx", "UTF-8") + "\""; String headerValue = "attachment; filename=\"" + URLEncoder.encode("12337信访投诉数据台账.xlsx", "UTF-8") + "\"";
response.setHeader("Content-Disposition", headerValue); response.setHeader("Content-Disposition", headerValue);

4
src/main/java/com/biutag/supervision/controller/supervise/SuperviseReportController.java

@ -27,8 +27,6 @@ import java.util.List;
public class SuperviseReportController { public class SuperviseReportController {
private final SuperviseReportService service; private final SuperviseReportService service;
private final SuperviseReportFileService fileService;
/** /**
* 分页 * 分页
* */ * */
@ -48,6 +46,7 @@ public class SuperviseReportController {
Result<Page<Negative>> negativePage(SuperviseReportQueryParam queryParam){ Result<Page<Negative>> negativePage(SuperviseReportQueryParam queryParam){
return Result.success(service.negativePage(queryParam)); return Result.success(service.negativePage(queryParam));
} }
/** /**
* 编辑 * 编辑
* */ * */
@ -74,6 +73,7 @@ public class SuperviseReportController {
return Result.failed("操作失败"); return Result.failed("操作失败");
} }
} }
/** /**
* 获取附件清单 * 获取附件清单
* */ * */

7
src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java

@ -44,8 +44,6 @@ public class ApplyCompletionAction implements Action {
private final SupDepartService departService; private final SupDepartService departService;
private final Validator validator;
@Override @Override
public void next(ActionDto actionDto) { public void next(ActionDto actionDto) {
VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class); VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class);
@ -95,6 +93,11 @@ public class ApplyCompletionAction implements Action {
if ("具有违纪违法情况".equals(verifyData.getProcessResult())) { if ("具有违纪违法情况".equals(verifyData.getProcessResult())) {
updateWrapper.set(Negative::getHandleResult12337, verifyData.getHandleResult12337()) updateWrapper.set(Negative::getHandleResult12337, verifyData.getHandleResult12337())
.set(Negative::getHandleResult12337Group, verifyData.getHandleResult12337Group()); .set(Negative::getHandleResult12337Group, verifyData.getHandleResult12337Group());
if (!"免予处分".equals(verifyData.getHandleResult12337()) && !"不予处分".equals(verifyData.getHandleResult12337())) {
updateWrapper.set(Negative::getDisciplinaryActionDesc, verifyData.getDisciplinaryActionDesc());
} else {
updateWrapper.set(Negative::getDisciplinaryActionDesc, null);
}
} else { } else {
updateWrapper.set(Negative::getHandleResult12337, null) updateWrapper.set(Negative::getHandleResult12337, null)
.set(Negative::getHandleResult12337Group, null); .set(Negative::getHandleResult12337Group, null);

8
src/main/java/com/biutag/supervision/mapper/SuperviseReportDepartMapper.java

@ -0,0 +1,8 @@
package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.SuperviseReportDepart;
public interface SuperviseReportDepartMapper extends BaseMapper<SuperviseReportDepart> {
}

3
src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java

@ -86,6 +86,9 @@ public class VerifyData {
private String verifiedIsLeader; private String verifiedIsLeader;
// 处分处理情况
private String disciplinaryActionDesc;
@Setter @Setter
@Getter @Getter
public static class Blame { public static class Blame {

3
src/main/java/com/biutag/supervision/pojo/entity/Negative.java

@ -334,4 +334,7 @@ public class Negative {
// 办理结果 // 办理结果
private String processResult; private String processResult;
// 处分处理情况
private String disciplinaryActionDesc;
} }

6
src/main/java/com/biutag/supervision/pojo/entity/SuperviseReport.java

@ -34,4 +34,10 @@ public class SuperviseReport {
@TableField("crt_emp_no") @TableField("crt_emp_no")
private String crtEmpNo; private String crtEmpNo;
// 通知通报类型 1-通报 2-通知
private Integer type;
// 通知单位
private String departName;
} }

35
src/main/java/com/biutag/supervision/pojo/entity/SuperviseReportDepart.java

@ -0,0 +1,35 @@
package com.biutag.supervision.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Setter
@Getter
public class SuperviseReportDepart {
// 主键
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
// 单位ID
@TableField("depart_id")
private String departId;
// 单位名称
@TableField("depart_name")
private String departName;
// 通知通报ID
@TableField("supervise_id")
private String superviseId;
// 创建时间
@TableField("crt_time")
private LocalDateTime crtTime;
}

2
src/main/java/com/biutag/supervision/pojo/param/SuperviseReportQueryParam.java

@ -14,4 +14,6 @@ public class SuperviseReportQueryParam extends BasePage{
private String id; private String id;
private String deptId; private String deptId;
private Integer type;
} }

2
src/main/java/com/biutag/supervision/pojo/vo/DataPetition12337ExportVo.java

@ -372,7 +372,7 @@ public class DataPetition12337ExportVo implements Serializable {
* 处分处理情况 * 处分处理情况
*/ */
@ExcelProperty("处分处理情况") @ExcelProperty("处分处理情况")
private String punishDes; private String disciplinaryActionDesc;
/** /**
* 是否适用自查从宽政策 * 是否适用自查从宽政策

7
src/main/java/com/biutag/supervision/pojo/vo/SuperviseReportVo.java

@ -30,4 +30,11 @@ public class SuperviseReportVo {
private int superviseNumber; private int superviseNumber;
//附件清单 //附件清单
private List<SuperviseReportFile> files; private List<SuperviseReportFile> files;
private Integer type;
private List<String> departIds;
private String departName;
} }

11
src/main/java/com/biutag/supervision/service/SuperviseReportDepartService.java

@ -0,0 +1,11 @@
package com.biutag.supervision.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.pojo.entity.SuperviseReportDepart;
import com.biutag.supervision.mapper.SuperviseReportDepartMapper;
import org.springframework.stereotype.Service;
@Service
public class SuperviseReportDepartService extends ServiceImpl<SuperviseReportDepartMapper, SuperviseReportDepart> {
}

39
src/main/java/com/biutag/supervision/service/SuperviseReportService.java

@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.common.UserContextHolder; import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.AppConstants; import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.RoleCodeEnum; import com.biutag.supervision.constants.enums.RoleCodeEnum;
import com.biutag.supervision.constants.enums.SuperviseReportTypeEnum;
import com.biutag.supervision.mapper.SuperviseReportMapper; import com.biutag.supervision.mapper.SuperviseReportMapper;
import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.model.UserAuth;
@ -21,11 +22,14 @@ import com.biutag.supervision.pojo.vo.SamplingVo;
import com.biutag.supervision.pojo.vo.SuperviseReportVo; import com.biutag.supervision.pojo.vo.SuperviseReportVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
@ -36,6 +40,8 @@ public class SuperviseReportService extends ServiceImpl<SuperviseReportMapper, S
private final SuperviseReportFileService superviseReportFileService; private final SuperviseReportFileService superviseReportFileService;
private final NegativeService negativeService; private final NegativeService negativeService;
private final SuperviseReportDepartService superviseReportDepartService;
/** /**
* 分页查询 * 分页查询
* */ * */
@ -56,7 +62,9 @@ public class SuperviseReportService extends ServiceImpl<SuperviseReportMapper, S
queryWrapper.in("t.crt_depart_id", orgIds); queryWrapper.in("t.crt_depart_id", orgIds);
} }
//查询条件 //查询条件
queryWrapper.like(StrUtil.isNotEmpty(queryParam.getReportName()),"t.report_name",queryParam.getReportName()) queryWrapper
.eq(Objects.nonNull(queryParam.getType()), "t.type", queryParam.getType())
.like(StrUtil.isNotEmpty(queryParam.getReportName()),"t.report_name",queryParam.getReportName())
.like(StrUtil.isNotEmpty(queryParam.getCrtUser()),"t.crt_user",queryParam.getCrtUser()) .like(StrUtil.isNotEmpty(queryParam.getCrtUser()),"t.crt_user",queryParam.getCrtUser())
.groupBy("t.id").orderByDesc("t.crt_time"); .groupBy("t.id").orderByDesc("t.crt_time");
@ -72,7 +80,6 @@ public class SuperviseReportService extends ServiceImpl<SuperviseReportMapper, S
} }
public Page<Negative> negativePage(SuperviseReportQueryParam param){ public Page<Negative> negativePage(SuperviseReportQueryParam param){
LambdaQueryWrapper<Negative> queryWrapper=new LambdaQueryWrapper<>(); LambdaQueryWrapper<Negative> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(Negative::getReportId,param.getId()); queryWrapper.eq(Negative::getReportId,param.getId());
@ -81,9 +88,11 @@ public class SuperviseReportService extends ServiceImpl<SuperviseReportMapper, S
Page<Negative> page = negativeService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); Page<Negative> page = negativeService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper);
return page; return page;
} }
/** /**
* 保存或修改 * 保存或修改
* */ * */
@Transactional(rollbackFor = Exception.class)
public boolean addOrUpdate(SuperviseReportVo vo){ public boolean addOrUpdate(SuperviseReportVo vo){
SuperviseReport report =new SuperviseReport(); SuperviseReport report =new SuperviseReport();
BeanUtil.copyProperties(vo,report); BeanUtil.copyProperties(vo,report);
@ -97,7 +106,31 @@ public class SuperviseReportService extends ServiceImpl<SuperviseReportMapper, S
report.setCrtUser(user.getNickName()); report.setCrtUser(user.getNickName());
report.setCrtEmpNo(user.getEmpNo()); report.setCrtEmpNo(user.getEmpNo());
} }
if(baseMapper.insertOrUpdate(report) ){
if (SuperviseReportTypeEnum.NOTICE.getValue().equals(vo.getType())) {
if (CollectionUtil.isNotEmpty(vo.getDepartIds())) {
List<SupDepart> departs = departService.listByIds(vo.getDepartIds());
String departNames = departs.stream().map(SupDepart::getShortName).collect(Collectors.joining("、"));
report.setDepartName(departNames);
}
}
if(saveOrUpdate(report) ){
if (SuperviseReportTypeEnum.NOTICE.getValue().equals(vo.getType())) {
if (StrUtil.isNotBlank(vo.getId())) {
superviseReportDepartService.remove(new LambdaQueryWrapper<SuperviseReportDepart>().eq(SuperviseReportDepart::getSuperviseId, vo.getId()));
}
if (CollectionUtil.isNotEmpty(vo.getDepartIds())) {
List<SupDepart> departs = departService.listByIds(vo.getDepartIds());
List<SuperviseReportDepart> list = departs.stream().map(d -> {
SuperviseReportDepart reportDepart = new SuperviseReportDepart();
reportDepart.setDepartId(d.getId());
reportDepart.setDepartName(d.getShortName());
reportDepart.setSuperviseId(vo.getId());
return reportDepart;
}).toList();
superviseReportDepartService.saveBatch(list);
}
}
if( CollectionUtil.isNotEmpty(vo.getFiles())){ if( CollectionUtil.isNotEmpty(vo.getFiles())){
superviseReportFileService.remove(new LambdaQueryWrapper<SuperviseReportFile>().eq(SuperviseReportFile::getSuperviseId,report.getId())); superviseReportFileService.remove(new LambdaQueryWrapper<SuperviseReportFile>().eq(SuperviseReportFile::getSuperviseId,report.getId()));
vo.getFiles().forEach(s->{ vo.getFiles().forEach(s->{

2
src/main/resources/mapper/DataPetition12337Mapper.xml

@ -168,7 +168,7 @@
<select id="queryPageExport" resultType="com.biutag.supervision.pojo.vo.DataPetition12337ExportVo"> <select id="queryPageExport" resultType="com.biutag.supervision.pojo.vo.DataPetition12337ExportVo">
SELECT SELECT
p.*, n.handle_second_depart_name, n.handle_polices, n.check_status_desc, n.checkStatus, n.checkStatusName, n.id, n.processing_status, p.*, n.handle_second_depart_name, n.handle_polices, n.check_status_desc, n.checkStatus, n.checkStatusName, n.id, n.processing_status,
n.accountability_target, n.handle_result12337, n.handle_result12337_group, n.verify_time, n.verified_is_leader, n.process_result process_result1 n.accountability_target, n.handle_result12337, n.handle_result12337_group, n.verify_time, n.verified_is_leader, n.process_result process_result1, n.disciplinary_action_desc
FROM FROM
data_petition_12337 p left join negative n on p.only_id = n.originId data_petition_12337 p left join negative n on p.only_id = n.originId
${ew.getCustomSqlSegment} ${ew.getCustomSqlSegment}

2
src/test/java/com/biutag/supervision/tools/GenCodeTests.java

@ -25,7 +25,7 @@ public class GenCodeTests {
@Test @Test
public void genEntity() throws TemplateException, IOException { public void genEntity() throws TemplateException, IOException {
String tableName = "sup_dict_12337_handle_result"; String tableName = "supervise_report_depart";
String tableSchema = "negative"; String tableSchema = "negative";
boolean genMapper = true; boolean genMapper = true;
boolean genService = true; boolean genService = true;

Loading…
Cancel
Save