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 9400684..413916a 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 @@ -7,10 +7,7 @@ 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.domain.check.dto.*; import com.ruoyi.system.service.ISysDictDataService; import com.ruoyi.system.service.check.TdCheckReportService; import com.ruoyi.system.service.check.TdCheckTypeService; @@ -47,7 +44,7 @@ public class CheckReportManager { - public List selectTdCheckReportList(TdCheckReport tdCheckReport) { + public List selectTdCheckReportList(CheckReportDTO tdCheckReport) { return checkReportService.selectTdCheckReportList(tdCheckReport); } 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 8530d56..3980835 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 @@ -7,6 +7,7 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.domain.check.TdCheckReport; +import com.ruoyi.system.domain.check.dto.CheckReportDTO; import com.ruoyi.system.domain.check.dto.TdCheckReportDTO; import com.ruoyi.web.controller.manager.CheckReportManager; import com.ruoyi.web.controller.manager.SysAreaManager; @@ -52,7 +53,7 @@ public class CheckReportController extends BaseController { @RequiresPermissions("system:check:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(TdCheckReport tdCheckReport) { + public TableDataInfo list(CheckReportDTO tdCheckReport) { startPage(); List tdCheckReports = checkReportManager.selectTdCheckReportList(tdCheckReport); return getDataTable(tdCheckReports); @@ -65,7 +66,7 @@ public class CheckReportController extends BaseController { @Log(title = "检查报告", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(TdCheckReport tdCheckReport) { + public AjaxResult export(CheckReportDTO tdCheckReport) { List tdCheckReports = checkReportManager.selectTdCheckReportList(tdCheckReport); tdCheckReports.forEach(tdCheck1 -> { tdCheck1.setFramework(sysAreaManager.getAreaName(tdCheck1.getFramework())); 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 0e7a457..47c0485 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 @@ -1,23 +1,26 @@ package com.ruoyi.web.controller.system.count; +import cn.hutool.core.text.StrPool; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.ObtainLastSixMonthsUtil; import com.ruoyi.system.domain.TdPropertyEment; import com.ruoyi.system.domain.TdPropertyInfo; import com.ruoyi.system.domain.TdPropertyManager; -import com.ruoyi.system.domain.count.PropertyDesCountDTO; -import com.ruoyi.system.domain.count.PropertyStateCountDTO; -import com.ruoyi.system.domain.count.UserCountDTO; -import com.ruoyi.system.domain.count.UserSmCountDTO; +import com.ruoyi.system.domain.check.TdCheckReport; +import com.ruoyi.system.domain.count.*; import com.ruoyi.system.service.ISysDictDataService; import com.ruoyi.system.service.ITdPropertyInfoService; import com.ruoyi.system.service.ITdPropertyManagerService; import com.ruoyi.system.service.TdPropertyEmentService; +import lombok.val; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -25,9 +28,9 @@ import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.*; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -183,4 +186,41 @@ public class SysPropertynumController extends BaseController { return AjaxResult.success(datas); } + /** + * + *检查近6个月统计 + * @return + */ + @PostMapping("/countSecretsMonth") + @ResponseBody + public AjaxResult countSecretsMonth() { + List recentlySixMonth = ObtainLastSixMonthsUtil.getRecentlySixMonth(); + List yAxisData = new ArrayList<>(); + recentlySixMonth.forEach(month -> { + // 获取指定月份的最大日期 + String lastDayOfMonth = ObtainLastSixMonthsUtil.getLastDayOfMonth(month); + // 获取指定天的最大时间 + Date date = Date.from(LocalDate.parse(lastDayOfMonth).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); + Date maxDayTime = ObtainLastSixMonthsUtil.getEndOfDay(date); + // 获取最小时间 + 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); + PropertyManagerDTO tdPropertyManager = new PropertyManagerDTO(); + tdPropertyManager.setMinDayTime(minDayTime); + tdPropertyManager.setMaxDayTime(maxDayTime); + tdPropertyManager.setSecretsType("1"); + Integer count = tdPropertyManagerService.countSecretsMonth(tdPropertyManager); + if(Objects.isNull(count)){ + count = 0; + } + yAxis.set(Long.valueOf(count)); + yAxisData.add(yAxis.get()); + }); + JSONObject obj = new JSONObject(); + obj.put("xAxisData", recentlySixMonth.toArray()); + obj.put("yAxisData", yAxisData); + return AjaxResult.success(obj); + } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdChecknumController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdChecknumController.java index ccb8fe9..9393fd8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdChecknumController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/count/TdChecknumController.java @@ -10,6 +10,7 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.utils.ObtainLastSixMonthsUtil; import com.ruoyi.system.domain.TdPropertyInfo; import com.ruoyi.system.domain.check.TdCheckReport; +import com.ruoyi.system.domain.check.dto.CheckReportDTO; import com.ruoyi.system.domain.count.CheckResultCountDTO; import com.ruoyi.system.domain.count.CheckTypeCountDTO; import com.ruoyi.system.service.ISysDictDataService; @@ -60,7 +61,7 @@ public class TdChecknumController extends BaseController{ */ @PostMapping("/list") @ResponseBody - public TableDataInfo list(TdCheckReport tdCheckReport) { + public TableDataInfo list(CheckReportDTO tdCheckReport) { startPage(); List tdCheckReports = checkReportManager.selectTdCheckReportList(tdCheckReport); return getDataTable(tdCheckReports); @@ -74,7 +75,7 @@ public class TdChecknumController extends BaseController{ @PostMapping("/countCheckMonth") @ResponseBody public AjaxResult countCheckMonth() { - List recentlySixMonth = ObtainLastSixMonthsUtil.getRecentlySixMonth(); + List recentlySixMonth = ObtainLastSixMonthsUtil.getRecentlyTwelveMonth(); List yAxisData = new ArrayList<>(); recentlySixMonth.forEach(month -> { // 获取指定月份的最大日期 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ObtainLastSixMonthsUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ObtainLastSixMonthsUtil.java index b4431cb..f275f8d 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ObtainLastSixMonthsUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ObtainLastSixMonthsUtil.java @@ -24,6 +24,23 @@ import java.util.List; */ public class ObtainLastSixMonthsUtil { + /** + * 获取最近十二个月的yyyy-MM集合 + * + * @return List + */ + public static List getRecentlyTwelveMonth() { + List previousMonths = new ArrayList<>(); + String currentMonth = DateUtil.format(LocalDateTime.now(), "yyyy-MM"); + previousMonths.add(currentMonth); + for (int i = 1; i <= 11; i++) { + DateTime dateTime = DateUtil.offsetMonth(new Date(), -i); + String dateMonth = DateUtil.format(dateTime, "yyyy-MM"); + previousMonths.add(dateMonth); + } + return previousMonths; + } + /** * 获取最近六个月的yyyy-MM集合 * @@ -33,7 +50,7 @@ public class ObtainLastSixMonthsUtil { List previousMonths = new ArrayList<>(); String currentMonth = DateUtil.format(LocalDateTime.now(), "yyyy-MM"); previousMonths.add(currentMonth); - for (int i = 1; i <= 11; i++) { + for (int i = 1; i <= 5; i++) { DateTime dateTime = DateUtil.offsetMonth(new Date(), -i); String dateMonth = DateUtil.format(dateTime, "yyyy-MM"); previousMonths.add(dateMonth); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckReportDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckReportDTO.java new file mode 100644 index 0000000..9d813ad --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/check/dto/CheckReportDTO.java @@ -0,0 +1,113 @@ +package com.ruoyi.system.domain.check.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.ruoyi.common.annotation.Excel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Date; + +/** + * 检查报告结果 + * @author 13560 + * @TableName td_check_report + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class CheckReportDTO implements Serializable { + /** + * id + */ + @TableId + private String checkId; + + /** + * 报告人员 + */ + @Excel(name = "检查人员") + private String adduser; + + /** + * 报告人单位 + */ + @Excel(name = "检查单位") + private String depart; + + /** + * 检查开始时间 + */ + @Excel(name = "检查开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private String checkStartTime; + + /** + * 检查结束时间 + */ + @Excel(name = "检查结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private String checkEndTime; + + /** + * 检查类型(0.自检 1.保密局检查) + */ + private String checkType; + + /** + * 市州 + */ + @Excel(name = "所属市州") + private String framework; + + /** + * 地区 + */ + @Excel(name = "所属区县") + private String area; + + + /** + * 检查状态(0:通过1:未通过2:待检查) + */ + private String checkState; + + /** + * 检查人名 + */ + private String checkName; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 实有项目总分 + */ + @Excel(name = "实有项目总分") + private String totalScore; + + /** + * 实有项目得分 + */ + @Excel(name = "实有项目得分") + private String realScore; + + /** + * 得分占比 + */ + @Excel(name = "得分占比") + private String percentageScore; + + + /** + * 备注 + */ + @Excel(name = "备注") + 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/count/PropertyManagerDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/count/PropertyManagerDTO.java new file mode 100644 index 0000000..a681558 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/count/PropertyManagerDTO.java @@ -0,0 +1,30 @@ +package com.ruoyi.system.domain.count; + +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 PropertyManagerDTO implements Serializable { + + + + private Date minDayTime; + + private Date maxDayTime; + + private String secretsType; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdPropertyManagerMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdPropertyManagerMapper.java index 0e5a777..9a01b43 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdPropertyManagerMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TdPropertyManagerMapper.java @@ -1,7 +1,13 @@ package com.ruoyi.system.mapper; +import java.util.Date; import java.util.List; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.TdPropertyInfo; import com.ruoyi.system.domain.TdPropertyManager; +import com.ruoyi.system.domain.count.PropertyManagerDTO; +import org.apache.ibatis.annotations.Param; /** * 密品登记Mapper接口 @@ -9,7 +15,7 @@ import com.ruoyi.system.domain.TdPropertyManager; * @author ruoyi * @date 2024-04-26 */ -public interface TdPropertyManagerMapper +public interface TdPropertyManagerMapper extends BaseMapper { /** * 查询密品登记 @@ -58,4 +64,7 @@ public interface TdPropertyManagerMapper * @return 结果 */ public int deleteTdPropertyManagerByUseIds(String[] useIds); + + + public Integer countSecretsMonth(PropertyManagerDTO propertyManagerDTO); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/check/TdCheckReportMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/check/TdCheckReportMapper.java index 0d3477a..a8094ca 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/check/TdCheckReportMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/check/TdCheckReportMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.system.mapper.check; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.domain.check.TdCheckReport; +import com.ruoyi.system.domain.check.dto.CheckReportDTO; import com.ruoyi.system.domain.count.CheckResultCountDTO; import com.ruoyi.system.domain.count.CheckTypeCountDTO; @@ -16,7 +17,7 @@ import java.util.List; public interface TdCheckReportMapper extends BaseMapper { - public List selectTdCheckReportList(TdCheckReport tdCheckReport); + public List selectTdCheckReportList(CheckReportDTO tdCheckReport); public List selectTdCheckResultList(TdCheckReport tdCheckReport); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdPropertyManagerService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdPropertyManagerService.java index d552573..94a07e0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdPropertyManagerService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITdPropertyManagerService.java @@ -1,7 +1,13 @@ package com.ruoyi.system.service; +import java.util.Date; import java.util.List; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.TdPropertyInfo; import com.ruoyi.system.domain.TdPropertyManager; +import com.ruoyi.system.domain.count.PropertyManagerDTO; +import org.apache.ibatis.annotations.Param; /** * 密品登记Service接口 @@ -9,7 +15,7 @@ import com.ruoyi.system.domain.TdPropertyManager; * @author ruoyi * @date 2024-04-26 */ -public interface ITdPropertyManagerService +public interface ITdPropertyManagerService extends IService { /** * 查询密品登记 @@ -58,4 +64,7 @@ public interface ITdPropertyManagerService * @return 结果 */ public int deleteTdPropertyManagerByUseId(String useId); + + + public Integer countSecretsMonth(PropertyManagerDTO propertyManagerDTO); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/check/TdCheckReportService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/check/TdCheckReportService.java index d9db7b4..0a8f5d7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/check/TdCheckReportService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/check/TdCheckReportService.java @@ -2,6 +2,7 @@ package com.ruoyi.system.service.check; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.system.domain.check.TdCheckReport; +import com.ruoyi.system.domain.check.dto.CheckReportDTO; import com.ruoyi.system.domain.count.CheckResultCountDTO; import com.ruoyi.system.domain.count.CheckTypeCountDTO; import com.ruoyi.system.domain.place.TdPlace; @@ -16,7 +17,7 @@ import java.util.List; public interface TdCheckReportService extends IService { - public List selectTdCheckReportList(TdCheckReport tdCheckReport); + public List selectTdCheckReportList(CheckReportDTO tdCheckReport); public List selectTdCheckResultList(TdCheckReport tdCheckReport); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/check/impl/TdCheckReportServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/check/impl/TdCheckReportServiceImpl.java index d99dbba..7f137d5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/check/impl/TdCheckReportServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/check/impl/TdCheckReportServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.system.service.check.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.system.domain.check.TdCheckReport; +import com.ruoyi.system.domain.check.dto.CheckReportDTO; import com.ruoyi.system.domain.count.CheckResultCountDTO; import com.ruoyi.system.domain.count.CheckTypeCountDTO; import com.ruoyi.system.mapper.check.TdCheckReportMapper; @@ -25,7 +26,7 @@ public class TdCheckReportServiceImpl extends ServiceImpl selectTdCheckReportList(TdCheckReport tdCheckReport) { + public List selectTdCheckReportList(CheckReportDTO tdCheckReport) { return checkReportMapper.selectTdCheckReportList(tdCheckReport); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyManagerServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyManagerServiceImpl.java index 4913407..05929cb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyManagerServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TdPropertyManagerServiceImpl.java @@ -1,6 +1,13 @@ package com.ruoyi.system.service.impl; +import java.util.Date; import java.util.List; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.system.domain.TdPropertyInfo; +import com.ruoyi.system.domain.count.PropertyManagerDTO; +import com.ruoyi.system.mapper.TdPropertyInfoMapper; +import com.ruoyi.system.service.ITdPropertyInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.TdPropertyManagerMapper; @@ -15,7 +22,7 @@ import com.ruoyi.common.core.text.Convert; * @date 2024-04-26 */ @Service -public class TdPropertyManagerServiceImpl implements ITdPropertyManagerService +public class TdPropertyManagerServiceImpl extends ServiceImpl implements ITdPropertyManagerService { @Autowired private TdPropertyManagerMapper tdPropertyManagerMapper; @@ -91,4 +98,9 @@ public class TdPropertyManagerServiceImpl implements ITdPropertyManagerService { return tdPropertyManagerMapper.deleteTdPropertyManagerByUseId(useId); } + + @Override + public Integer countSecretsMonth(PropertyManagerDTO propertyManagerDTO) { + return tdPropertyManagerMapper.countSecretsMonth(propertyManagerDTO); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TdCheckReportMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TdCheckReportMapper.xml index 12857fd..af30240 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TdCheckReportMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TdCheckReportMapper.xml @@ -49,10 +49,10 @@ AND real_score = #{realScore} - + AND check_start_time >= #{checkStartTime} - + AND check_end_time <= #{checkEndTime} diff --git a/ruoyi-system/src/main/resources/mapper/system/TdPropertyManagerMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TdPropertyManagerMapper.xml index 7f8815e..f2fe9c5 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TdPropertyManagerMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TdPropertyManagerMapper.xml @@ -112,4 +112,12 @@ + + \ No newline at end of file