Browse Source

fit:1、批量下发改造(督察报告关联);2、我的待办改造(督察报告关联);3、问题界面改造(督察报告附件展示)

master
pengwei 5 months ago
parent
commit
d30fc111fe
  1. 79
      src/main/java/com/biutag/supervision/controller/supervise/SuperviseReportController.java
  2. 2
      src/main/java/com/biutag/supervision/controller/work/NegativeController.java
  3. 13
      src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java
  4. 22
      src/main/java/com/biutag/supervision/flow/FlowService.java
  5. 3
      src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java
  6. 9
      src/main/java/com/biutag/supervision/mapper/SuperviseReportFileMapper.java
  7. 14
      src/main/java/com/biutag/supervision/mapper/SuperviseReportMapper.java
  8. 2
      src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java
  9. 2
      src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java
  10. 2
      src/main/java/com/biutag/supervision/pojo/dto/NegativeImportDto.java
  11. 5
      src/main/java/com/biutag/supervision/pojo/dto/flow/ConfirmationCompletionData.java
  12. 24
      src/main/java/com/biutag/supervision/pojo/entity/Negative.java
  13. 35
      src/main/java/com/biutag/supervision/pojo/entity/SuperviseReport.java
  14. 42
      src/main/java/com/biutag/supervision/pojo/entity/SuperviseReportFile.java
  15. 13
      src/main/java/com/biutag/supervision/pojo/param/SuperviseReportQueryParam.java
  16. 31
      src/main/java/com/biutag/supervision/pojo/vo/SuperviseReportVo.java
  17. 1
      src/main/java/com/biutag/supervision/service/NegativeTaskService.java
  18. 11
      src/main/java/com/biutag/supervision/service/SamplingService.java
  19. 10
      src/main/java/com/biutag/supervision/service/SuperviseReportFileService.java
  20. 126
      src/main/java/com/biutag/supervision/service/SuperviseReportService.java
  21. 14
      src/main/resources/mapper/SuperviseReportMapper.xml
  22. 4
      src/test/java/com/biutag/supervision/tools/dto/flow/ConfirmationCompletionData.java

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

@ -0,0 +1,79 @@
package com.biutag.supervision.controller.supervise;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.SuperviseReport;
import com.biutag.supervision.pojo.entity.SuperviseReportFile;
import com.biutag.supervision.pojo.param.SupRiskPersonalQueryParam;
import com.biutag.supervision.pojo.param.SuperviseReportQueryParam;
import com.biutag.supervision.pojo.vo.SupRiskPersonalVo;
import com.biutag.supervision.pojo.vo.SuperviseReportVo;
import com.biutag.supervision.service.SuperviseReportFileService;
import com.biutag.supervision.service.SuperviseReportService;
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@RestController
@RequiredArgsConstructor
@RequestMapping("/supervise/report")
public class SuperviseReportController {
private final SuperviseReportService service;
private final SuperviseReportFileService fileService;
/**
* 分页
* */
@GetMapping
Result<Page<SuperviseReportVo>> queryPage(SuperviseReportQueryParam queryParam){
return Result.success(service.page(queryParam));
}
/**
* 编辑
* */
@PostMapping
Result addOrUpdata(@RequestBody SuperviseReportVo superviseReportVo){
List<SuperviseReport> superviseReport = service.list(new LambdaQueryWrapper<SuperviseReport>().eq(SuperviseReport::getReportName,superviseReportVo.getReportName()));
if(CollectionUtil.isNotEmpty(superviseReport)){
return Result.failed("报告名称不能重复,请填写报告全称");
}
if(service.addOrUpdate(superviseReportVo)){
return Result.success();
}else{
return Result.failed("操作失败");
}
}
/**
* 删除
* */
@DeleteMapping("/{id}")
Result delDataById(@PathVariable String id){
if(service.delById(id)){
return Result.success();
}else{
return Result.failed("操作失败");
}
}
/**
* 获取附件清单
* */
@GetMapping("getReportFile")
Result<List<SuperviseReportFile>> getReportFile(SuperviseReportQueryParam queryParam){
List<SuperviseReportFile> files = service.getReportFile(queryParam);
return Result.success(files);
}
@GetMapping("/getReportDetail/{id}")
Result<SuperviseReport> getReportDetail(@PathVariable String id){
SuperviseReport superviseReport =service.getOne(new LambdaQueryWrapper<SuperviseReport>().eq(SuperviseReport::getId,id));
return Result.success(superviseReport);
}
}

2
src/main/java/com/biutag/supervision/controller/work/NegativeController.java

@ -134,6 +134,7 @@ public class NegativeController {
.set(Negative::getThingDesc, negativeDto.getThingDesc())
.set(Negative::getSpecialSupervision, negativeDto.getSpecialSupervision())
.set(Negative::getReportNumber, negativeDto.getReportNumber())
.set(StrUtil.isNotEmpty(negativeDto.getReportId()),Negative::getReportId,negativeDto.getReportId())
.set(Negative::getInvolveDepartId, negativeDto.getInvolveDepartId())
.set(Negative::getInvolveDepartName, depart.getShortName())
// 涉嫌问题
@ -157,6 +158,7 @@ public class NegativeController {
@PostMapping("{id}/execute")
public Result<Boolean> execute(@PathVariable String id, @RequestBody ActionDto action) {
action.setNegativeId(id);
return Result.success(flowService.execute(action));
}

13
src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java

@ -1,5 +1,6 @@
package com.biutag.supervision.controller.work;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
@ -21,11 +22,13 @@ import com.biutag.supervision.pojo.dto.NegativeImportDto;
import com.biutag.supervision.pojo.entity.NegativeTask;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.entity.SupDictData;
import com.biutag.supervision.pojo.entity.SuperviseReport;
import com.biutag.supervision.pojo.model.ModelClueTaskDepartModel;
import com.biutag.supervision.pojo.param.NegativeTaskQueryParam;
import com.biutag.supervision.service.NegativeTaskService;
import com.biutag.supervision.service.SupDepartService;
import com.biutag.supervision.service.SupDictDataService;
import com.biutag.supervision.service.SuperviseReportService;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validator;
import lombok.RequiredArgsConstructor;
@ -56,6 +59,8 @@ public class NegativeTaskController {
private final SupDepartService departService;
private final SuperviseReportService reportService;
@GetMapping
public Result<Page<NegativeTask>> page(NegativeTaskQueryParam param) {
return Result.success(negativeTaskService.page(param));
@ -108,6 +113,14 @@ public class NegativeTaskController {
.map(label -> suspectProblem.stream().filter(item -> label.equals(item.getDictLabel())).map(SupDictData::getDictValue).findFirst().orElse(null)).filter(StrUtil::isNotBlank).toList();
data.setInvolveProblem(involveProblem);
}
if (StrUtil.isNotBlank(data.getReportNumber())){
List<SuperviseReport> reportList = reportService.list(new LambdaQueryWrapper<SuperviseReport>().eq(SuperviseReport::getReportName,data.getReportNumber())).stream().toList();
if(CollectionUtil.isNotEmpty(reportList)){
data.setReportId(reportList.get(0).getId());
}
}
if (StrUtil.isNotBlank(data.getInvolveDepartName())) {
String[] departNames = data.getInvolveDepartName().split("/");
List<SupDepart> departs = departService.list(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getLevel, DepartLevelEnum.SECOND.getValue())

22
src/main/java/com/biutag/supervision/flow/FlowService.java

@ -1,14 +1,19 @@
package com.biutag.supervision.flow;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.flow.action.Action;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeHistory;
import com.biutag.supervision.pojo.entity.NegativeWork;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.service.NegativeHistoryService;
import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NegativeWorkService;
import com.biutag.supervision.service.SupDepartService;
import com.biutag.supervision.util.JSON;
@ -18,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
@RequiredArgsConstructor
@Service
@ -31,6 +37,8 @@ public class FlowService {
private final SupDepartService departService;
private final NegativeService negativeService;
@Transactional(rollbackFor = Exception.class)
public Boolean execute(ActionDto actionDto) {
Action action = actions
@ -39,6 +47,18 @@ public class FlowService {
.findFirst()
.orElseThrow(() -> new RuntimeException("配置异常,请联系系统管理员"));
action.next(actionDto);
if("confirmationCompletion".equals(actionDto.getActionKey())&& ObjectUtil.isNotEmpty(actionDto.getData())){
Map<String,String > maps = (Map<String, String>) actionDto.getData();
String reportNumber = StrUtil.isNotBlank(maps.get("reportNumber"))?maps.get("reportNumber"):null;
String reportId = StrUtil.isNotBlank(maps.get("reportId"))?maps.get("reportId"):null;
if(StrUtil.isNotEmpty(actionDto.getNegativeId()) && (StrUtil.isNotEmpty(reportNumber) || StrUtil.isNotEmpty(reportId))){
negativeService.update(new LambdaUpdateWrapper<Negative>().eq(Negative::getId,actionDto.getNegativeId())
.set(StrUtil.isNotEmpty(reportId),Negative::getReportId,reportId)
.set(StrUtil.isNotEmpty(reportNumber),Negative::getReportNumber,reportNumber)
);
}
}
NegativeWork work = workService.getById(actionDto.getWorkId());
UserAuth user = UserContextHolder.getCurrentUser();
NegativeHistory history = new NegativeHistory().setHistoryId(IdUtil.fastSimpleUUID())
@ -53,4 +73,4 @@ public class FlowService {
return negativeHistoryService.save(history);
}
}
}

3
src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java

@ -2,6 +2,7 @@ package com.biutag.supervision.flow.action;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.enums.*;
@ -98,6 +99,8 @@ public class ConfirmationCompletionAction implements Action {
.set(Negative::getVerifySituation, completionData.getVerifySituation())
.set(Negative::getVerifyFileSituation, completionData.getVerifyFileSituation())
.set(Negative::getCompleteDate, LocalDateTime.now())
.set(StrUtil.isNotEmpty(completionData.getReportId()),Negative::getReportId,completionData.getReportId())
.set(StrUtil.isNotEmpty(completionData.getReportNumber()),Negative::getReportNumber,completionData.getReportNumber())
.set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey())
.set(Negative::getUpdTime, LocalDateTime.now());
negativeService.update(updateWrapper);

9
src/main/java/com/biutag/supervision/mapper/SuperviseReportFileMapper.java

@ -0,0 +1,9 @@
package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.SuperviseReport;
import com.biutag.supervision.pojo.entity.SuperviseReportFile;
public interface SuperviseReportFileMapper extends BaseMapper<SuperviseReportFile> {
}

14
src/main/java/com/biutag/supervision/mapper/SuperviseReportMapper.java

@ -0,0 +1,14 @@
package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.entity.Sampling;
import com.biutag.supervision.pojo.entity.SuperviseReport;
import org.apache.ibatis.annotations.Param;
public interface SuperviseReportMapper extends BaseMapper<SuperviseReport> {
Page<SuperviseReport> queryPage(@Param("page") Page<SuperviseReport> page, @Param(Constants.WRAPPER) QueryWrapper<SuperviseReport> queryWrapper);
}

2
src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java

@ -193,6 +193,8 @@ public class NegativeVo {
// 通报期数
private String reportNumber;
private String reportId;
// 核查办理情况
private String verifySituation;

2
src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java

@ -100,6 +100,8 @@ public class NegativeDto {
// 通报期数
private String reportNumber;
//督察报告id
private String reportId;
private String taskId;

2
src/main/java/com/biutag/supervision/pojo/dto/NegativeImportDto.java

@ -91,4 +91,6 @@ public class NegativeImportDto {
@ExcelProperty("通报期数")
private String reportNumber;
private String reportId;
}

5
src/main/java/com/biutag/supervision/pojo/dto/flow/ConfirmationCompletionData.java

@ -23,6 +23,11 @@ public class ConfirmationCompletionData {
// 认定办结意见
private String completionComment;
//督察报告名称
private String reportNumber;
//督察报告Id
private String reportId;
private List<Blame> blames = new ArrayList<>();
@Setter

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

@ -14,7 +14,7 @@ import java.time.LocalDateTime;
@Getter
public class Negative {
//
//
@TableId
private String id;
@ -109,20 +109,20 @@ public class Negative {
@TableField("checkIdCode")
private String checkIdCode;
//
//
@TableField("crtTime")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime crtTime;
//
//
@TableField("updName")
private String updName;
//
//
@TableField("updUser")
private String updUser;
//
//
@TableField("updTime")
private LocalDateTime updTime;
@ -130,7 +130,7 @@ public class Negative {
@TableField("status")
private String status;
//
//
@TableField("remark")
private String remark;
@ -154,15 +154,15 @@ public class Negative {
@TableField("lastEditName")
private String lastEditName;
//
//
@TableField("taskId")
private String taskId;
//
//
@TableField("supervisionSubjectCode")
private String supervisionSubjectCode;
//
//
@TableField("supervisionSubjectName")
private String supervisionSubjectName;
@ -177,7 +177,9 @@ public class Negative {
// 办结时间
@TableField("completeDate")
private LocalDateTime completeDate;
//督察报告id
@TableField("report_id")
private String reportId;
//---------------------------------------------
private String flowKey;
@ -322,4 +324,4 @@ public class Negative {
private String visitingLeaderEmpNo;
}
}

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

@ -0,0 +1,35 @@
package com.biutag.supervision.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.Date;
@Getter
@Setter
public class SuperviseReport {
@TableId
private String id;
//督察报告
@TableField("report_name")
private String reportName;
//创建人
@TableField("crt_time")
private LocalDateTime crtTime;
//创建单位
@TableField("crt_depart")
private String crtDepart;
//创建单位Id
@TableField("crt_depart_id")
private String crtDepartId;
//创建用户
@TableField("crt_user")
private String crtUser;
//创建人警号
@TableField("crt_emp_no")
private String crtEmpNo;
}

42
src/main/java/com/biutag/supervision/pojo/entity/SuperviseReportFile.java

@ -0,0 +1,42 @@
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 com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import java.io.Serial;
import java.time.LocalDateTime;
@Setter
@Getter
@TableName("supervise_report_file")
public class SuperviseReportFile {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@TableField("file_name")
String fileName;
@TableField("file_path")
String filePath;
@TableField("supervise_id")
String superviseId;
/**
* 创建时间
*/
@TableField("`crt_time`")
LocalDateTime crtTime;
Integer del;
}

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

@ -0,0 +1,13 @@
package com.biutag.supervision.pojo.param;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
public class SuperviseReportQueryParam extends BasePage{
//报告名称
private String reportName;
//创建用户
private String crtUser;
}

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

@ -0,0 +1,31 @@
package com.biutag.supervision.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.biutag.supervision.pojo.entity.SuperviseReportFile;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
import java.util.List;
@Getter
@Setter
public class SuperviseReportVo {
private String id;
//督察报告
private String reportName;
//创建人
private Date crtTime;
//创建单位
private String crtDepart;
//创建单位Id
private String crtDepartId;
//创建用户
private String crtUser;
//创建人警号
private String crtEmpNo;
//附件清单
private List<SuperviseReportFile> files;
}

1
src/main/java/com/biutag/supervision/service/NegativeTaskService.java

@ -247,6 +247,7 @@ public class NegativeTaskService extends ServiceImpl<NegativeTaskMapper, Negativ
negativeDto.setMaxHandleDuration(distributeData.getMaxHandleDuration());
negativeDto.setMaxExtensionDuration(distributeData.getMaxExtensionDuration());
negativeDto.setTaskId(negativeTask.getId());
negativeDto.setReportId(item.getReportId());
negativeService.save(negativeDto);
});
return true;

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

@ -16,10 +16,12 @@ import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.RoleCodeEnum;
import com.biutag.supervision.mapper.SamplingMapper;
import com.biutag.supervision.mapper.SamplingPoliceMapper;
import com.biutag.supervision.mapper.SupTaskTestingAlcoholSamplingMapper;
import com.biutag.supervision.pojo.dto.SamplingPoliceDto;
import com.biutag.supervision.pojo.entity.Confinement;
import com.biutag.supervision.pojo.entity.Sampling;
import com.biutag.supervision.pojo.entity.SamplingPolice;
import com.biutag.supervision.pojo.entity.SupTaskTestingAlcoholSampling;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.pojo.param.SamplingQueryParam;
import com.biutag.supervision.pojo.vo.DataPetitionComplaintExportGabxfVo;
@ -47,6 +49,8 @@ public class SamplingService extends ServiceImpl<SamplingMapper, Sampling> {
private final SamplingPoliceMapper samplingPoliceMapper;
private final SupDepartService departService;
private final SupTaskTestingAlcoholSamplingMapper samplingMapper;
//添加或者修改
@Transactional(rollbackFor = Exception.class)
public boolean addOrUpdata(SamplingVo vo){
@ -150,6 +154,13 @@ public class SamplingService extends ServiceImpl<SamplingMapper, Sampling> {
SamplingVo samplingVo =new SamplingVo();
BeanUtil.copyProperties(s,samplingVo);
samplingVo.setSamplingPolices(samplingPoliceMapper.selectList(new LambdaQueryWrapper<SamplingPolice>().eq(SamplingPolice::getSamplingId,s.getId())));
List<SupTaskTestingAlcoholSampling> list =samplingMapper.selectList(new LambdaQueryWrapper<SupTaskTestingAlcoholSampling>().eq(SupTaskTestingAlcoholSampling::getSamplingId,s.getId()));
if(CollectionUtil.isNotEmpty(list)){
samplingVo.setState("已使用");
}else{
samplingVo.setState("未使用");
}
listData.add(samplingVo);
});
Page<SamplingVo> voPage = new Page<>(page.getCurrent(),page.getSize(),page.getTotal());

10
src/main/java/com/biutag/supervision/service/SuperviseReportFileService.java

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

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

@ -0,0 +1,126 @@
package com.biutag.supervision.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.RoleCodeEnum;
import com.biutag.supervision.mapper.SuperviseReportMapper;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.pojo.param.SamplingQueryParam;
import com.biutag.supervision.pojo.param.SuperviseReportQueryParam;
import com.biutag.supervision.pojo.vo.SamplingVo;
import com.biutag.supervision.pojo.vo.SuperviseReportVo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@RequiredArgsConstructor
@Service
public class SuperviseReportService extends ServiceImpl<SuperviseReportMapper, SuperviseReport> {
private final SupDepartService departService;
private final SuperviseReportFileService superviseReportFileService;
/**
* 分页查询
* */
public Page<SuperviseReportVo> page(SuperviseReportQueryParam queryParam){
QueryWrapper<SuperviseReport> queryWrapper = new QueryWrapper<>();
UserAuth user = UserContextHolder.getCurrentUser();
// 权限
if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) {
if (user.getAuthDepartIds().isEmpty() || user.getRoleCodes().isEmpty()) {
return new Page<SuperviseReportVo>().setTotal(0).setRecords(new ArrayList<>());
}
List<String> orgIds = departService.getAllNodeIds(user.getAuthDepartIds());
queryWrapper.in("t.crt_depart_id", orgIds);
}
//查询条件
queryWrapper.like(StrUtil.isNotEmpty(queryParam.getReportName()),"t.report_name",queryParam.getReportName())
.like(StrUtil.isNotEmpty(queryParam.getCrtUser()),"t.crt_user",queryParam.getCrtUser());
Page<SuperviseReport> page= baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
List<SuperviseReportVo> listData = new ArrayList<>();
page.getRecords().forEach(s->{
SuperviseReportVo vo =new SuperviseReportVo();
BeanUtil.copyProperties(s,vo);
listData.add(vo);
});
Page<SuperviseReportVo> voPage = new Page<>(page.getCurrent(),page.getSize(),page.getTotal());
listData.forEach(s->{
List<SuperviseReportFile> files= superviseReportFileService.list(new LambdaQueryWrapper<SuperviseReportFile>().eq(SuperviseReportFile::getSuperviseId,s.getId()));
if(CollectionUtil.isNotEmpty(files)){
s.setFiles(files);
}
});
voPage.setRecords(listData);
return voPage;
}
/**
* 保存或修改
* */
public boolean addOrUpdate(SuperviseReportVo vo){
SuperviseReport report =new SuperviseReport();
BeanUtil.copyProperties(vo,report);
report.setCrtTime(LocalDateTime.now());
UserAuth user = UserContextHolder.getCurrentUser();
// 权限
if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) {
report.setCrtDepart(user.getDepartName());
report.setCrtDepartId(user.getDepartId());
report.setCrtUser(user.getNickName());
report.setCrtEmpNo(user.getEmpNo());
}
if(baseMapper.insertOrUpdate(report) ){
if( CollectionUtil.isNotEmpty(vo.getFiles())){
superviseReportFileService.remove(new LambdaQueryWrapper<SuperviseReportFile>().eq(SuperviseReportFile::getSuperviseId,report.getId()));
vo.getFiles().forEach(s->{
s.setSuperviseId(report.getId());
s.setCrtTime(LocalDateTime.now());
});
return superviseReportFileService.saveOrUpdateBatch(vo.getFiles());
}
return true;
}else{
return false;
}
}
/**
* 删除
* */
public boolean delById(String id){
baseMapper.deleteById(id);
superviseReportFileService.remove(new LambdaQueryWrapper<SuperviseReportFile>().eq(SuperviseReportFile::getSuperviseId,id));
return true;
}
/**
* 获取文件附录
* */
public List<SuperviseReportFile> getReportFile(SuperviseReportQueryParam queryParam){
SuperviseReport report=baseMapper.selectOne(new LambdaQueryWrapper<SuperviseReport>().eq(SuperviseReport::getReportName,queryParam.getReportName()));
if(ObjectUtil.isNotEmpty(report)){
return superviseReportFileService.list(new LambdaQueryWrapper<SuperviseReportFile>().eq(SuperviseReportFile::getSuperviseId,report.getId()));
}else{
return null;
}
}
}

14
src/main/resources/mapper/SuperviseReportMapper.xml

@ -0,0 +1,14 @@
<?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.biutag.supervision.mapper.SuperviseReportMapper">
<select id="queryPage" resultType="com.biutag.supervision.pojo.entity.SuperviseReport">
select t.*
from supervise_report as t
${ew.getCustomSqlSegment}
</select>
</mapper>

4
src/test/java/com/biutag/supervision/tools/dto/flow/ConfirmationCompletionData.java

@ -22,6 +22,10 @@ public class ConfirmationCompletionData {
// 认定办结意见
private String completionComment;
//督察报告名称
private String reportNumber;
//督察报告Id
private String reportId;
private List<Blame> blames = new ArrayList<>();

Loading…
Cancel
Save