From 24a675f77bb42c8a7567f7b6e206f484abc602d4 Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Wed, 25 Sep 2024 11:05:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=BD=BD=E4=BD=93=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E9=94=80=E6=AF=81=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/CheckReportManager.java | 57 ++++++++++++---- .../system/check/CheckReportController.java | 9 +++ .../system/check/TdCheckResultController.java | 13 ---- .../system/domain/check/TdCheckReport.java | 22 +++++++ .../system/domain/check/TdCheckType.java | 35 ++++++++-- .../system/domain/check/dto/CheckTypeDTO.java | 39 +++++++++++ .../domain/check/dto/CheckTypeItemDTO.java | 65 +++++++++++++++++++ .../domain/check/dto/TdCheckReportDTO.java | 21 ++++++ .../domain/check/dto/TdCheckTypeDTO.java | 36 ++++++++-- .../mapper/system/TdCheckReportMapper.xml | 6 +- .../mapper/system/TdCheckTypeMapper.xml | 8 ++- 11 files changed, 273 insertions(+), 38 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckTypeDTO.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckTypeItemDTO.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/CheckReportManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/CheckReportManager.java index 1001117..da3c56c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/CheckReportManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/CheckReportManager.java @@ -3,21 +3,24 @@ package com.ruoyi.web.controller.manager; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; import cn.hutool.core.text.CharSequenceUtil; +import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.system.domain.check.TdCheckReport; import com.ruoyi.system.domain.check.TdCheckType; +import com.ruoyi.system.domain.check.dto.CheckTypeDTO; +import com.ruoyi.system.domain.check.dto.CheckTypeItemDTO; import com.ruoyi.system.domain.check.dto.TdCheckReportDTO; import com.ruoyi.system.domain.check.dto.TdCheckTypeDTO; +import com.ruoyi.system.service.ISysDictDataService; import com.ruoyi.system.service.check.TdCheckReportService; import com.ruoyi.system.service.check.TdCheckTypeService; +import lombok.val; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Objects; +import java.util.*; /** * packageName com.ruoyi.web.controller.manager @@ -39,6 +42,11 @@ public class CheckReportManager { private TdCheckTypeService checkTypeService; + @Autowired + private ISysDictDataService dictDataService; + + + public List selectTdCheckReportList(TdCheckReport tdCheckReport) { return checkReportService.selectTdCheckReportList(tdCheckReport); } @@ -69,6 +77,39 @@ public class CheckReportManager { return checkTypeService.saveBatch(list); } + public List getCheckTypeDTO(String type) { + List checkTypeDtoS = new ArrayList<>(); + SysDictData sysDictData =new SysDictData(); + sysDictData.setDictType(type); + List list = dictDataService.selectDictDataList(sysDictData); + list.forEach(sysDictData1 -> { + List checkTypeItemDTOList =new ArrayList<>(); + checkTypeDtoS.add(CheckTypeDTO.builder() + .typeName(sysDictData1.getDictLabel()) + .checkType(sysDictData1.getDictValue()).checkTypeItemDTOList(checkTypeItemDTOList).build()); + SysDictData dictData = new SysDictData(); + dictData.setDictType(sysDictData1.getDictValue()); + List dataList = dictDataService.selectDictDataList(dictData); + dataList.forEach(sysDictData2 -> checkTypeItemDTOList.add(CheckTypeItemDTO.builder().typeName(sysDictData1.getDictLabel()) + .checkType(sysDictData1.getDictValue()) + .checkItems(sysDictData2.getDictLabel()) + .typeContent(sysDictData2.getDictValue()) + .score(sysDictData2.getCssClass()) + .deductionCriteria(sysDictData2.getRemark()) + .build())); + }); + return checkTypeDtoS; + } + + + @Transactional(rollbackFor = Exception.class) + public boolean deletedTdCheckReportIds(String ids) { + List list = Arrays.asList(Convert.toStrArray(ids)); + checkTypeService.lambdaUpdate().in(TdCheckType::getCheckId,list).remove(); + return checkReportService.removeByIds(list); + } + + public TdCheckReportDTO getTdCheckReportDTO(String id) { TdCheckReport tdCheckReport = checkReportService.getById(id); TdCheckReportDTO tdCheckReportDto = Convert.convert(TdCheckReportDTO.class, tdCheckReport); @@ -82,12 +123,4 @@ public class CheckReportManager { } - @Transactional(rollbackFor = Exception.class) - public boolean deletedTdCheckReportIds(String ids) { - List list = Arrays.asList(Convert.toStrArray(ids)); - checkTypeService.lambdaUpdate().in(TdCheckType::getCheckId,list).remove(); - return checkReportService.removeByIds(list); - } - - } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/CheckReportController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/CheckReportController.java index 8960645..06206cf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/CheckReportController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/CheckReportController.java @@ -140,6 +140,15 @@ public class CheckReportController extends BaseController { return AjaxResult.success(checkReportManager.getTdCheckReportDTO(checkId)); } + /** + * 查询自查项 :sys_check_type_report + */ + @GetMapping("/checkView/{type}") + @ResponseBody + public AjaxResult checkView(@PathVariable("type") String type) { + return AjaxResult.success(checkReportManager.getCheckTypeDTO(type)); + } + /** * 删除 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/TdCheckResultController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/TdCheckResultController.java index 9aba08a..8a69b57 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/TdCheckResultController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/check/TdCheckResultController.java @@ -133,19 +133,6 @@ public class TdCheckResultController extends BaseController { @PostMapping("/checkresult") @ResponseBody public AjaxResult selfcheckSave(@RequestBody TdCheckReportDTO checkReportDTO) { - boolean flag = false; - List checkTypeDtoS = checkReportDTO.getCheckTypeDTOS(); - for (TdCheckTypeDTO tdCheckTypeDTO :checkTypeDtoS){ - if("1".equals(tdCheckTypeDTO.getResultStarts())){ - flag = true; - break; - } - } - if (flag) { - checkReportDTO.setCheckState("1"); - } else { - checkReportDTO.setCheckState("0"); - } return toAjax(checkReportManager.saveOrUpdate(checkReportDTO)); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/TdCheckReport.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/TdCheckReport.java index 2a2d462..5d63aae 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/TdCheckReport.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/TdCheckReport.java @@ -88,6 +88,28 @@ public class TdCheckReport implements Serializable { */ private Date createTime; + /** + * 实有项目总分 + */ + private String totalScore; + + /** + * 实有项目得分 + */ + private String realScore; + + /** + * 得分占比 + */ + private String percentageScore; + + + /** + * 备注 + */ + private String remark; + + @TableField(exist = false) private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/TdCheckType.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/TdCheckType.java index 3dd8b48..495777b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/TdCheckType.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/TdCheckType.java @@ -28,24 +28,49 @@ public class TdCheckType implements Serializable { private String checkId; /** - * 检查类型 + * 自查类 */ private String checkType; + + /** + * 自查类名称 + */ + private String typeName; + + /** - * 内容 + * 自查项 + */ + private String checkItems; + + /** + * 自查内容 */ private String typeContent; + /** - * 自查状态,0合格,1不合格 + * 分值 + */ + private String score; + + + /** + * 得分 + */ + private String realScore; + + /** + * 实有内容:检查了存打钩:1 */ private String starts; + /** - * 结果状态,0合格,1不合格 + * 扣分标准 */ - private String resultStarts; + private String deductionCriteria; /** * 批注 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckTypeDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckTypeDTO.java new file mode 100644 index 0000000..845c814 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckTypeDTO.java @@ -0,0 +1,39 @@ +package com.ruoyi.system.domain.check.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * + * @author 13560 + * @TableName td_check_type + */ +@Data +@Builder +public class CheckTypeDTO implements Serializable { + + /** + * 自查类 + */ + private String checkType; + + + /** + * 自查类名称 + */ + private String typeName; + + + /** + * 检查类型 + */ + private List checkTypeItemDTOList; + + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckTypeItemDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckTypeItemDTO.java new file mode 100644 index 0000000..6d14e58 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckTypeItemDTO.java @@ -0,0 +1,65 @@ +package com.ruoyi.system.domain.check.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; + +/** + * + * @author 13560 + * @TableName td_check_type + */ +@Data +@Builder +public class CheckTypeItemDTO implements Serializable { + + /** + * 自查类 + */ + private String checkType; + + + /** + * 自查类名称 + */ + private String typeName; + + /** + * 自查项 + */ + private String checkItems; + + /** + * 自查内容 + */ + private String typeContent; + + + /** + * 分值 + */ + private String score; + + + /** + * 得分 + */ + private String realScore; + + /** + * 实有内容:检查了存打钩:1 + */ + private String starts; + + + /** + * 扣分标准 + */ + private String deductionCriteria; + + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/TdCheckReportDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/TdCheckReportDTO.java index e1af070..853b618 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/TdCheckReportDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/TdCheckReportDTO.java @@ -72,6 +72,27 @@ public class TdCheckReportDTO implements Serializable { */ private Date createTime; + + /** + * 实有项目总分 + */ + private String totalScore; + + /** + * 实有项目得分 + */ + private String realScore; + + /** + * 得分占比 + */ + private String percentageScore; + + /** + * 备注 + */ + private String remark; + @TableField(exist = false) private static final long serialVersionUID = 1L; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/TdCheckTypeDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/TdCheckTypeDTO.java index a5541f9..27cec4c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/TdCheckTypeDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/TdCheckTypeDTO.java @@ -26,30 +26,56 @@ public class TdCheckTypeDTO implements Serializable { private String checkId; /** - * 检查类型 + * 自查类 */ private String checkType; + + /** + * 自查类名称 + */ + private String typeName; + + /** - * 内容 + * 自查项 + */ + private String checkItems; + + /** + * 自查内容 */ private String typeContent; + /** - * 自查状态,0合格,1不合格 + * 分值 + */ + private String score; + + + /** + * 得分 + */ + private String realScore; + + /** + * 实有内容:检查了存打钩:1 */ private String starts; + /** - * 结果状态,0合格,1不合格 + * 扣分标准 */ - private String resultStarts; + private String deductionCriteria; /** * 批注 */ private String remark; + @TableField(exist = false) private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/TdCheckReportMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TdCheckReportMapper.xml index 73a8dba..d9a3619 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TdCheckReportMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TdCheckReportMapper.xml @@ -16,13 +16,17 @@ + + + + check_id,adduser,depart, check_start_time,check_end_time,check_type, area,framework,check_state, - check_name,create_time + check_name,create_time,total_score,real_score,percentage_score,remark