From 35bfc9080d167ad3fb0d1a0b2e5e4415f5b33cc8 Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Thu, 7 Nov 2024 16:19:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E7=80=9A=E9=AB=98=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/manager/UserExamManager.java | 6 ++++ .../count/SysPropertynumController.java | 4 +-- .../system/count/SysUsernumController.java | 4 +-- .../system/count/TdExamnumController.java | 13 ++++++-- .../system/domain/exam/ExamManagerDTO.java | 31 +++++++++++++++++++ .../ruoyi/system/mapper/ElUserExamMapper.java | 4 +++ .../system/service/ElUserExamService.java | 4 +++ .../service/impl/ElUserExamServiceImpl.java | 6 ++++ .../mapper/system/ElUserExamMapper.xml | 6 ++++ .../resources/mapper/system/SysUserMapper.xml | 16 +++++----- 10 files changed, 80 insertions(+), 14 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ExamManagerDTO.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java index 5463012..b5dcd4e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/UserExamManager.java @@ -2,6 +2,7 @@ package com.ruoyi.web.controller.manager; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.ruoyi.system.domain.check.TdCheckReport; +import com.ruoyi.system.domain.exam.ExamManagerDTO; import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO; import com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO; import com.ruoyi.system.domain.userexam.ElUserExam; @@ -111,4 +112,9 @@ public class UserExamManager { .count(); } + public Integer countExamMonth(ExamManagerDTO examManagerDTO){ + return elUserExamService.countExamMonth(examManagerDTO); + } + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysPropertynumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysPropertynumController.java index 4d21100..5d355f5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysPropertynumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysPropertynumController.java @@ -152,11 +152,11 @@ public class SysPropertynumController extends BaseController { value.set(propertyStateCountDTO.getYbf()); } else if("设备未报废".equals(name)) { value.set(tdPropertyEmentService.lambdaQuery() - .eq(TdPropertyEment::getDestoryType,0) + .eq(TdPropertyEment::getDestoryType,'0') .count()); }else{ value.set(tdPropertyEmentService.lambdaQuery() - .eq(TdPropertyEment::getDestoryType,1) + .eq(TdPropertyEment::getDestoryType,'1') .count()); } JSONObject jsonObject = new JSONObject(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysUsernumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysUsernumController.java index 60b12ba..cc500ad 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysUsernumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/SysUsernumController.java @@ -111,8 +111,8 @@ public class SysUsernumController extends BaseController { @GetMapping("/print/{deptId}") public String print(@PathVariable("deptId") Long deptId, SysUser user, ModelMap mmap) { List list = userService.lambdaQuery().eq(SysUser::getDeptId, deptId) - .eq(SysUser::getDelFlag, 0) - .ne(SysUser::getUserId, 1) + .eq(SysUser::getDelFlag, '0') + .ne(SysUser::getUserId, '1') .list(); list.forEach(sysuser -> { List postList = sysUserPostService.lambdaQuery(). diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdExamnumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdExamnumController.java index cb8d919..49d1462 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdExamnumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdExamnumController.java @@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.ruoyi.common.utils.ObtainLastSixMonthsUtil; import com.ruoyi.system.domain.check.TdCheckReport; +import com.ruoyi.system.domain.exam.ExamManagerDTO; import com.ruoyi.system.domain.userbook.dto.UserBookDTO; import com.ruoyi.system.domain.userexam.dto.request.UserExamReqDTO; import com.ruoyi.system.domain.userexam.dto.response.UserExamExportDTO; @@ -136,7 +137,11 @@ public class TdExamnumController extends BaseController { date = Date.from(LocalDate.parse(month.concat(StrPool.DASHED).concat("01")).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); Date minDayTime = ObtainLastSixMonthsUtil.getStartOfDay(date); AtomicReference yAxis = new AtomicReference<>(0L); - Integer count = userExamManager.countExamMonth(minDayTime, maxDayTime,true); + ExamManagerDTO examManagerDTO =new ExamManagerDTO(); + examManagerDTO.setMinDayTime(minDayTime); + examManagerDTO.setMaxDayTime(maxDayTime); + examManagerDTO.setPassed(1); + Integer count = userExamManager.countExamMonth(examManagerDTO); if(Objects.isNull(count)){ count = 0; } @@ -169,7 +174,11 @@ public class TdExamnumController extends BaseController { date = Date.from(LocalDate.parse(month.concat(StrPool.DASHED).concat("01")).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); Date minDayTime = ObtainLastSixMonthsUtil.getStartOfDay(date); AtomicReference yAxis = new AtomicReference<>(0L); - Integer count = userExamManager.countExamMonth(minDayTime, maxDayTime,false); + ExamManagerDTO examManagerDTO =new ExamManagerDTO(); + examManagerDTO.setMinDayTime(minDayTime); + examManagerDTO.setMaxDayTime(maxDayTime); + examManagerDTO.setPassed(0); + Integer count = userExamManager.countExamMonth(examManagerDTO); if(Objects.isNull(count)){ count = 0; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ExamManagerDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ExamManagerDTO.java new file mode 100644 index 0000000..811a20b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/exam/ExamManagerDTO.java @@ -0,0 +1,31 @@ +package com.ruoyi.system.domain.exam; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * ClassName: PropertyManagerDTO + * Package: com.ruoyi.system.domain.count + * Description: + * + * @Author wangxy + * @Create 2024/10/8 16:21 + * @Version 1.0 + */ +@Data +@ApiModel(value="密品报废统计", description="密品报废统计") +public class ExamManagerDTO implements Serializable { + + + + private Date minDayTime; + + private Date maxDayTime; + + private Integer passed; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElUserExamMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElUserExamMapper.java index 2e362fb..4ce38ea 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElUserExamMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/ElUserExamMapper.java @@ -1,6 +1,7 @@ package com.ruoyi.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.exam.ExamManagerDTO; import com.ruoyi.system.domain.userexam.ElUserExam; import com.ruoyi.system.domain.userexam.dto.request.UserExamReqDTO; import com.ruoyi.system.domain.userexam.dto.response.ExamCountDTO; @@ -28,6 +29,9 @@ public interface ElUserExamMapper extends BaseMapper { public List selectCountExam(); + + public Integer countExamMonth(ExamManagerDTO examManagerDTO); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElUserExamService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElUserExamService.java index 9f0bc63..18be146 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ElUserExamService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ElUserExamService.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.exam.ExamManagerDTO; import com.ruoyi.system.domain.exam.dto.ExamDTO; import com.ruoyi.system.domain.userexam.ElUserExam; import com.ruoyi.system.domain.userexam.dto.request.UserExamReqDTO; @@ -27,4 +28,7 @@ public interface ElUserExamService extends IService { public List selectCountExam(); + + public Integer countExamMonth(ExamManagerDTO ExamManagerDTO); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElUserExamServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElUserExamServiceImpl.java index 9621c11..efce18c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElUserExamServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ElUserExamServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.exam.ExamManagerDTO; import com.ruoyi.system.domain.exam.dto.ExamDTO; import com.ruoyi.system.domain.userexam.ElUserExam; import com.ruoyi.system.domain.userexam.dto.request.UserExamReqDTO; @@ -40,6 +41,11 @@ public class ElUserExamServiceImpl extends ServiceImpl selectCountExam() { return userExamMapper.selectCountExam(); } + + @Override + public Integer countExamMonth(ExamManagerDTO examManagerDTO) { + return userExamMapper.countExamMonth(examManagerDTO); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml index fee8906..3a126d3 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ElUserExamMapper.xml @@ -67,6 +67,12 @@ + + + diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 8d3ce6c..756443f 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -317,12 +317,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -330,9 +330,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"