From 410816823c81d680e39af2ed6d7a0b93fe90e622 Mon Sep 17 00:00:00 2001 From: liwen Date: Wed, 3 Jan 2024 14:03:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?update:=20=E6=BC=94=E7=BB=83/=E5=9F=B9?= =?UTF-8?q?=E8=AE=AD/=E4=BC=9A=E8=AE=AE/=E5=8D=AB=E7=94=9F=E8=87=AA?= =?UTF-8?q?=E6=9F=A5=E5=88=97=E8=A1=A8=E9=BB=98=E8=AE=A4=E6=8C=89=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=97=B6=E9=97=B4=E5=80=92=E5=BA=8F=E6=8E=92=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/safeproduct/controller/ConferenceController.java | 4 ++-- .../com/hnac/hzims/safeproduct/controller/HygieneController.java | 2 -- .../com/hnac/hzims/safeproduct/controller/RehearsalController.java | 4 ++-- .../java/com/hnac/hzims/safeproduct/controller/TrainController.java | 6 ++++-- .../java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.xml | 2 ++ .../java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml | 2 ++ .../java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java | 6 ++++++ .../java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml | 2 ++ .../src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml | 4 ++++ .../com/hnac/hzims/safeproduct/service/IHygieneZoneService.java | 6 ++++++ .../hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java | 1 + .../hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java | 1 + .../hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java | 3 --- .../hnac/hzims/safeproduct/service/impl/HygieneZoneServiceImpl.java | 6 ++++++ .../hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java | 1 + .../hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java | 3 ++- .../hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java | 2 +- 17 files changed, 42 insertions(+), 13 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java index aa12908..2a09af6 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java @@ -114,8 +114,8 @@ public class ConferenceController extends BladeController { @ApiOperation(value = "会议记录分页") @ApiOperationSupport(order = 10) public R> recordPage(@ApiIgnore @RequestParam Map param, Query query) { - IPage page = conferenceRecordService.page(Condition.getPage(query), - Condition.getQueryWrapper(param, ConferenceRecordEntity.class)); + IPage page = conferenceRecordService.page(Condition.getPage(query), Condition.getQueryWrapper( + param, ConferenceRecordEntity.class).lambda().orderByDesc(ConferenceRecordEntity::getCreateTime)); return R.data(page); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java index f73fc03..e0e36e9 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java @@ -2,11 +2,9 @@ package com.hnac.hzims.safeproduct.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.safeproduct.dto.HygienePlanDTO; import com.hnac.hzims.safeproduct.dto.HygieneRecordDTO; import com.hnac.hzims.safeproduct.entity.HygienePlanEntity; -import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity; import com.hnac.hzims.safeproduct.service.IHygienePlanService; import com.hnac.hzims.safeproduct.service.IHygieneRecordService; import com.hnac.hzims.safeproduct.vo.HygienePlanDetailVO; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java index 58b036e..21d6442 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java @@ -116,8 +116,8 @@ public class RehearsalController extends BladeController { @ApiOperation(value = "演练记录分页") @ApiOperationSupport(order = 10) public R> rehearsalRecordPage(@ApiIgnore @RequestParam Map param, Query query) { - IPage page = rehearsalRecordService.page(Condition.getPage(query), - Condition.getQueryWrapper(param, RehearsalRecordEntity.class)); + IPage page = rehearsalRecordService.page(Condition.getPage(query), Condition.getQueryWrapper( + param, RehearsalRecordEntity.class).lambda().orderByDesc(RehearsalRecordEntity::getCreateTime)); return R.data(page); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java index 172a59b..50d64a1 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java @@ -128,7 +128,8 @@ public class TrainController extends BladeController { @ApiOperation(value = "培训记录分页") @ApiOperationSupport(order = 10) public R> trainRecordPage(@ApiIgnore @RequestParam Map param, Query query) { - IPage page = trainRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(param, TrainRecordEntity.class)); + IPage page = trainRecordService.page(Condition.getPage(query), Condition.getQueryWrapper( + param, TrainRecordEntity.class).lambda().orderByDesc(TrainRecordEntity::getCreateTime)); return R.data(page); } @@ -176,7 +177,8 @@ public class TrainController extends BladeController { @ApiOperation(value = "考试记录分页") @ApiOperationSupport(order = 16) public R> testPage(@ApiIgnore @RequestParam Map param, Query query) { - IPage page = testService.page(Condition.getPage(query), Condition.getQueryWrapper(param, TestEntity.class)); + IPage page = testService.page(Condition.getPage(query), Condition.getQueryWrapper(param, TestEntity.class) + .lambda().orderByDesc(TestEntity::getCreateTime)); return R.data(page); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.xml index c71d0dc..b6cd857 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.xml @@ -19,5 +19,7 @@ AND t1.scheduled_end_time < #{endTime} + ORDER BY + t1.create_time DESC \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml index 68efbe5..7536baa 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml @@ -22,5 +22,7 @@ AND hygiene_plan_id = #{hygienePlanId} + ORDER BY + create_time DESC \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java index b3d0e5c..6614aff 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java @@ -4,6 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; import org.apache.ibatis.annotations.Mapper; +/** + * 卫生自查责任区Mapper类 + * + * @author liwen + * @date 2024-01-02 + */ @Mapper public interface HygieneZoneMapper extends BaseMapper { diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml index e3f1b14..63c26df 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml @@ -80,5 +80,7 @@ AND t1.scheduled_end_time < #{endTime} + ORDER BY + t1.create_time DESC \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml index f6ded92..7b1556d 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml @@ -9,6 +9,10 @@ hzims_test WHERE is_deleted = 0 + AND train_plan_id = #{trainPlanId} + + ORDER BY + create_time DESC \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneZoneService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneZoneService.java index 3c62284..add6ee3 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneZoneService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygieneZoneService.java @@ -5,6 +5,12 @@ import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; import java.util.List; +/** + * 卫生自查责任区服务类 + * + * @author liwen + * @date 2024-01-02 + */ public interface IHygieneZoneService extends IService { /** diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java index 803b972..08255fc 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java @@ -73,6 +73,7 @@ public class ConferencePlanServiceImpl extends ServiceImpl implements IHygieneZoneService { diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java index 1d1932c..308df13 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java @@ -259,6 +259,7 @@ public class RehearsalPlanServiceImpl extends ServiceImpl Date: Wed, 3 Jan 2024 15:11:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?update:=20=E6=BC=94=E7=BB=83/=E5=9F=B9?= =?UTF-8?q?=E8=AE=AD/=E5=8D=AB=E7=94=9F=E8=87=AA=E6=9F=A5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=9F=E8=AE=A1=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/safeproduct/vo/RehearsalYearVO.java | 3 ++ .../com/hnac/hzims/safeproduct/vo/TrainYearVO.java | 3 ++ .../controller/RehearsalController.java | 8 ++--- .../safeproduct/controller/TrainController.java | 8 ++--- .../safeproduct/mapper/RehearsalPlanMapper.java | 9 +++-- .../safeproduct/mapper/RehearsalPlanMapper.xml | 9 +++++ .../hzims/safeproduct/mapper/TrainPlanMapper.java | 9 +++-- .../hzims/safeproduct/mapper/TrainPlanMapper.xml | 9 +++++ .../safeproduct/service/IRehearsalPlanService.java | 6 ++-- .../safeproduct/service/ITrainPlanService.java | 6 ++-- .../service/impl/RehearsalPlanServiceImpl.java | 42 +++++++++++++++------- .../service/impl/TrainPlanServiceImpl.java | 42 +++++++++++++++------- 12 files changed, 112 insertions(+), 42 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalYearVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalYearVO.java index 97556b8..1b9f289 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalYearVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalYearVO.java @@ -50,4 +50,7 @@ public class RehearsalYearVO { @ApiModelProperty("12月完成数") private Long decemberNum; + + @ApiModelProperty("合计完成数") + private Long sum; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainYearVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainYearVO.java index 227b355..f9e3745 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainYearVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainYearVO.java @@ -50,4 +50,7 @@ public class TrainYearVO { @ApiModelProperty("12月完成数") private Long decemberNum; + + @ApiModelProperty("合计完成数") + private Long sum; } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java index 21d6442..aea0139 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java @@ -124,16 +124,16 @@ public class RehearsalController extends BladeController { @GetMapping("/dataByMonth") @ApiOperation(value = "月度统计表") @ApiOperationSupport(order = 11) - public R> dataByMonth(@RequestParam String month, Query query) { - IPage page = rehearsalPlanService.dataByMonth(month, query); + public R> dataByMonth(@RequestParam String month, String unit, Query query) { + IPage page = rehearsalPlanService.dataByMonth(month, unit, query); return R.data(page); } @GetMapping("/dataByYear") @ApiOperation(value = "年度统计表") @ApiOperationSupport(order = 12) - public R> dataByYear(@RequestParam String year, Query query) { - IPage page = rehearsalPlanService.dataByYear(year, query); + public R> dataByYear(@RequestParam String year, String unit, Query query) { + IPage page = rehearsalPlanService.dataByYear(year, unit, query); return R.data(page); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java index 50d64a1..8cf7a62 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java @@ -208,16 +208,16 @@ public class TrainController extends BladeController { @GetMapping("/trainDataByMonth") @ApiOperation(value = "培训月度统计表") @ApiOperationSupport(order = 20) - public R> trainDataByMonth(@RequestParam String month, Query query) { - IPage page = trainPlanService.dataByMonth(month, query); + public R> trainDataByMonth(@RequestParam String month, String unit, Query query) { + IPage page = trainPlanService.dataByMonth(month, unit, query); return R.data(page); } @GetMapping("/trainDataByYear") @ApiOperation(value = "培训年度统计表") @ApiOperationSupport(order = 21) - public R> trainDataByYear(@RequestParam String year, Query query) { - IPage page = trainPlanService.dataByYear(year, query); + public R> trainDataByYear(@RequestParam String year, String unit, Query query) { + IPage page = trainPlanService.dataByYear(year, unit, query); return R.data(page); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.java index 990793b..7eaee13 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.java @@ -24,26 +24,29 @@ public interface RehearsalPlanMapper extends BaseMapper { /** * 查询当月各单位的演练总数 * @param page 分页类 + * @param unit 单位 * @param month 月份 * @return 当月的演练总数据 */ - IPage selectByMonth(IPage page, String month); + IPage selectByMonth(IPage page, String unit, String month); /** * 查询当月各单位已完成的演练数据 * @param page 分页类 + * @param unit 单位 * @param month 月份 * @return 当月的已完成数据 */ - IPage selectFinishedDataByMonth(IPage page, String month); + IPage selectFinishedDataByMonth(IPage page, String unit, String month); /** * 查询当年的所有单位 * @param page 分页类 + * @param unit 单位 * @param year 年份 * @return 年度单位数据 */ - IPage selectUnitByYear(IPage page, @Param("year") String year); + IPage selectUnitByYear(IPage page, String unit, @Param("year") String year); /** * 查询各单位全年已完成的演练数据 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml index 63c26df..38b8ac3 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml @@ -10,6 +10,9 @@ WHERE is_deleted = 0 AND scheduled_end_time like concat('%', #{month}, '%') + + AND unit like concat('%', #{unit}, '%') + GROUP BY unit ORDER BY @@ -25,6 +28,9 @@ is_deleted = 0 AND scheduled_end_time like concat('%', #{month}, '%') AND rehearsal_status = 'FINISHED' + + AND unit like concat('%', #{unit}, '%') + GROUP BY unit ORDER BY @@ -39,6 +45,9 @@ WHERE is_deleted = 0 AND scheduled_end_time like concat('%', #{year}, '%') + + AND unit like concat('%', #{unit}, '%') + ORDER BY unit diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java index 38eaa5b..6839241 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java @@ -22,26 +22,29 @@ public interface TrainPlanMapper extends BaseMapper { /** * 查询当月各单位的培训计划总数 * @param page 分页类 + * @param unit 单位 * @param month 月份 * @return 当月培训计划总数 */ - IPage selectByMonth(IPage page, String month); + IPage selectByMonth(IPage page, String unit, String month); /** * 查询当月各单位已完成的培训计划数据 * @param page1 分页类 + * @param unit 单位 * @param month 月份 * @return 当月已完成培训计划数 */ - IPage selectFinishedDataByMonth(IPage page1, String month); + IPage selectFinishedDataByMonth(IPage page1, String unit, String month); /** * 查询当年的所有单位 * @param page 分页类 + * @param unit 单位 * @param year 年份 * @return 年度单位数据 */ - IPage selectUnitByYear(IPage page, String year); + IPage selectUnitByYear(IPage page, String unit, String year); /** * 查询各单位全年已完成的培训计划数 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml index 1b600f5..57c83d1 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml @@ -10,6 +10,9 @@ WHERE is_deleted = 0 AND scheduled_end_time like concat('%', #{month}, '%') + + AND unit like concat('%', #{unit}, '%') + GROUP BY unit ORDER BY @@ -25,6 +28,9 @@ is_deleted = 0 AND scheduled_end_time like concat('%', #{month}, '%') AND train_status = 'FINISHED' + + AND unit like concat('%', #{unit}, '%') + GROUP BY unit ORDER BY @@ -39,6 +45,9 @@ WHERE is_deleted = 0 AND scheduled_end_time like concat('%', #{year}, '%') + + AND unit like concat('%', #{unit}, '%') + ORDER BY unit diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java index cc18cfe..d679fc0 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java @@ -29,18 +29,20 @@ public interface IRehearsalPlanService extends IService { /** * 演练月度数据 * @param month 月份 + * @param unit 单位 * @param query 分页类 * @return 月度统计分页 */ - IPage dataByMonth(String month, Query query); + IPage dataByMonth(String month, String unit, Query query); /** * 演练年度数据 * @param year 年份 + * @param unit 单位 * @param query 分页类 * @return 年度统计分页 */ - IPage dataByYear(String year, Query query); + IPage dataByYear(String year, String unit, Query query); /** * 演练计划数据导出 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java index 50571cc..75e86ed 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java @@ -22,18 +22,20 @@ public interface ITrainPlanService extends IService { /** * 月度培训数据 * @param month 月份 + * @param unit 单位 * @param query 分页类 * @return 月度培训分页 */ - IPage dataByMonth(String month, Query query); + IPage dataByMonth(String month, String unit, Query query); /** * 年度培训数据 * @param year 年份 + * @param unit 单位 * @param query 分页类 * @return 年度培训分页 */ - IPage dataByYear(String year, Query query); + IPage dataByYear(String year, String unit, Query query); /** * 删除培训计划 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java index 308df13..040e07a 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java @@ -32,6 +32,7 @@ import java.io.IOException; import java.math.BigDecimal; import java.math.RoundingMode; import java.net.URLEncoder; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; @@ -68,10 +69,10 @@ public class RehearsalPlanServiceImpl extends ServiceImpl dataByMonth(String month, Query query) { + public IPage dataByMonth(String month, String unit, Query query) { // 查询当月各单位的演练总数 IPage page = new Page<>(query.getCurrent(), query.getSize()); - IPage unitPage = baseMapper.selectByMonth(page, month); + IPage unitPage = baseMapper.selectByMonth(page, unit, month); List unitList = unitPage.getRecords(); // 若无数据,返回空页面 if (CollectionUtils.isEmpty(unitList)) { @@ -79,18 +80,18 @@ public class RehearsalPlanServiceImpl extends ServiceImpl page1 = new Page<>(query.getCurrent(), query.getSize()); - IPage finishedPage = baseMapper.selectFinishedDataByMonth(page1, month); + IPage finishedPage = baseMapper.selectFinishedDataByMonth(page1, unit, month); List finishedList = finishedPage.getRecords(); // 处理统计数据 - for (RehearsalMonthVO unit : unitList) { - Long taskNum = unit.getScheduledTaskNum(); - Optional finishedRehearsal = finishedList.stream().filter(x -> x.getUnit().equals(unit.getUnit())).findFirst(); + for (RehearsalMonthVO u : unitList) { + Long taskNum = u.getScheduledTaskNum(); + Optional finishedRehearsal = finishedList.stream().filter(x -> x.getUnit().equals(u.getUnit())).findFirst(); Long finishedTaskNum = finishedRehearsal.isPresent() ? finishedRehearsal.get().getFinishedTaskNum() : 0L; - unit.setFinishedTaskNum(finishedTaskNum); - unit.setUnfinishedTaskNum(taskNum - finishedTaskNum); + u.setFinishedTaskNum(finishedTaskNum); + u.setUnfinishedTaskNum(taskNum - finishedTaskNum); BigDecimal taskDecimal = new BigDecimal(taskNum); BigDecimal finishedDecimal = new BigDecimal(finishedTaskNum); - unit.setTaskCompletionRate(finishedDecimal.divide(taskDecimal, 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")) + u.setTaskCompletionRate(finishedDecimal.divide(taskDecimal, 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")) .setScale(2, RoundingMode.HALF_UP)); } unitPage.setRecords(unitList); @@ -101,10 +102,10 @@ public class RehearsalPlanServiceImpl extends ServiceImpl dataByYear(String year, Query query) { + public IPage dataByYear(String year, String unit, Query query) { IPage page = new Page<>(query.getCurrent(), query.getSize()); // 查询当年的所有单位 - IPage unitPage = baseMapper.selectUnitByYear(page, year); + IPage unitPage = baseMapper.selectUnitByYear(page, unit, year); List records = unitPage.getRecords(); // 若无数据,返回空页面 if (CollectionUtils.isEmpty(records)) { @@ -114,49 +115,66 @@ public class RehearsalPlanServiceImpl extends ServiceImpl unitMonthDataList = baseMapper.selectFinishedDataByUnit(unitList, year); // 将各单位每个月的演练数据写入统计列表 + List res = new ArrayList<>(); unitMonthDataList.forEach(data -> { RehearsalYearVO rehearsalYearVO = records.stream().filter(x -> x.getUnit().equals(data.getUnit())) .collect(Collectors.toList()).get(0); + long sum = rehearsalYearVO.getSum() == null ? 0 : rehearsalYearVO.getSum(); // 根据月份匹配写入对应字段 switch (data.getDateTime()) { case "01": rehearsalYearVO.setJanuaryNum(data.getFinishedNum()); + rehearsalYearVO.setSum(sum + data.getFinishedNum()); break; case "02": rehearsalYearVO.setFebruaryNum(data.getFinishedNum()); + rehearsalYearVO.setSum(sum + data.getFinishedNum()); break; case "03": rehearsalYearVO.setMarchNum(data.getFinishedNum()); + rehearsalYearVO.setSum(sum + data.getFinishedNum()); break; case "04": rehearsalYearVO.setAprilNum(data.getFinishedNum()); + rehearsalYearVO.setSum(sum + data.getFinishedNum()); break; case "05": rehearsalYearVO.setMayNum(data.getFinishedNum()); + rehearsalYearVO.setSum(sum + data.getFinishedNum()); break; case "06": rehearsalYearVO.setJuneNum(data.getFinishedNum()); + rehearsalYearVO.setSum(sum + data.getFinishedNum()); break; case "07": rehearsalYearVO.setJulyNum(data.getFinishedNum()); + rehearsalYearVO.setSum(sum + data.getFinishedNum()); break; case "08": rehearsalYearVO.setAugustNum(data.getFinishedNum()); + rehearsalYearVO.setSum(sum + data.getFinishedNum()); break; case "09": rehearsalYearVO.setSeptemberNum(data.getFinishedNum()); + rehearsalYearVO.setSum(sum + data.getFinishedNum()); break; case "10": rehearsalYearVO.setOctoberNum(data.getFinishedNum()); + rehearsalYearVO.setSum(sum + data.getFinishedNum()); break; case "11": rehearsalYearVO.setNovemberNum(data.getFinishedNum()); + rehearsalYearVO.setSum(sum + data.getFinishedNum()); break; case "12": rehearsalYearVO.setDecemberNum(data.getFinishedNum()); + rehearsalYearVO.setSum(sum + data.getFinishedNum()); + } + if (rehearsalYearVO.getSum() != 0) { + res.add(rehearsalYearVO); } }); - unitPage.setRecords(records); + unitPage.setRecords(res); return unitPage; } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java index 027430b..9dc05c5 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java @@ -34,6 +34,7 @@ import java.io.IOException; import java.math.BigDecimal; import java.math.RoundingMode; import java.net.URLEncoder; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; @@ -58,10 +59,10 @@ public class TrainPlanServiceImpl extends ServiceImpl dataByMonth(String month, Query query) { + public IPage dataByMonth(String month, String unit, Query query) { // 查询当月各单位的培训计划总数 IPage page = new Page<>(query.getCurrent(), query.getSize()); - IPage unitPage = baseMapper.selectByMonth(page, month); + IPage unitPage = baseMapper.selectByMonth(page, unit, month); List unitList = unitPage.getRecords(); // 若无数据,返回空页面 if (CollectionUtils.isEmpty(unitList)) { @@ -69,18 +70,18 @@ public class TrainPlanServiceImpl extends ServiceImpl page1 = new Page<>(query.getCurrent(), query.getSize()); - IPage finishedPage = baseMapper.selectFinishedDataByMonth(page1, month); + IPage finishedPage = baseMapper.selectFinishedDataByMonth(page1, unit, month); List finishedList = finishedPage.getRecords(); // 处理统计数据 - for (TrainMonthVO unit : unitList) { - Long taskNum = unit.getScheduledTrainNum(); - Optional finishedRehearsal = finishedList.stream().filter(x -> x.getUnit().equals(unit.getUnit())).findFirst(); + for (TrainMonthVO u : unitList) { + Long taskNum = u.getScheduledTrainNum(); + Optional finishedRehearsal = finishedList.stream().filter(x -> x.getUnit().equals(u.getUnit())).findFirst(); Long finishedTaskNum = finishedRehearsal.isPresent() ? finishedRehearsal.get().getFinishedTrainNum() : 0L; - unit.setFinishedTrainNum(finishedTaskNum); - unit.setUnfinishedTrainNum(taskNum - finishedTaskNum); + u.setFinishedTrainNum(finishedTaskNum); + u.setUnfinishedTrainNum(taskNum - finishedTaskNum); BigDecimal taskDecimal = new BigDecimal(taskNum); BigDecimal finishedDecimal = new BigDecimal(finishedTaskNum); - unit.setCompletionRate(finishedDecimal.divide(taskDecimal, 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")) + u.setCompletionRate(finishedDecimal.divide(taskDecimal, 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")) .setScale(2, RoundingMode.HALF_UP)); } unitPage.setRecords(unitList); @@ -91,10 +92,10 @@ public class TrainPlanServiceImpl extends ServiceImpl dataByYear(String year, Query query) { + public IPage dataByYear(String year, String unit, Query query) { IPage page = new Page<>(query.getCurrent(), query.getSize()); // 查询当年的所有单位 - IPage unitPage = baseMapper.selectUnitByYear(page, year); + IPage unitPage = baseMapper.selectUnitByYear(page, unit, year); List records = unitPage.getRecords(); // 若无数据,返回空页面 if (CollectionUtils.isEmpty(records)) { @@ -104,49 +105,66 @@ public class TrainPlanServiceImpl extends ServiceImpl unitMonthDataList = baseMapper.selectFinishedDataByUnit(unitList, year); // 将各单位每个月的培训计划数据写入统计列表 + List res = new ArrayList<>(); unitMonthDataList.forEach(data -> { TrainYearVO trainYearVO = records.stream().filter(x -> x.getUnit().equals(data.getUnit())) .collect(Collectors.toList()).get(0); + long sum = trainYearVO.getSum() == null ? 0 : trainYearVO.getSum(); // 根据月份匹配写入对应字段 switch (data.getDateTime()) { case "01": trainYearVO.setJanuaryNum(data.getFinishedNum()); + trainYearVO.setSum(sum + data.getFinishedNum()); break; case "02": trainYearVO.setFebruaryNum(data.getFinishedNum()); + trainYearVO.setSum(sum + data.getFinishedNum()); break; case "03": trainYearVO.setMarchNum(data.getFinishedNum()); + trainYearVO.setSum(sum + data.getFinishedNum()); break; case "04": trainYearVO.setAprilNum(data.getFinishedNum()); + trainYearVO.setSum(sum + data.getFinishedNum()); break; case "05": trainYearVO.setMayNum(data.getFinishedNum()); + trainYearVO.setSum(sum + data.getFinishedNum()); break; case "06": trainYearVO.setJuneNum(data.getFinishedNum()); + trainYearVO.setSum(sum + data.getFinishedNum()); break; case "07": trainYearVO.setJulyNum(data.getFinishedNum()); + trainYearVO.setSum(sum + data.getFinishedNum()); break; case "08": trainYearVO.setAugustNum(data.getFinishedNum()); + trainYearVO.setSum(sum + data.getFinishedNum()); break; case "09": trainYearVO.setSeptemberNum(data.getFinishedNum()); + trainYearVO.setSum(sum + data.getFinishedNum()); break; case "10": trainYearVO.setOctoberNum(data.getFinishedNum()); + trainYearVO.setSum(sum + data.getFinishedNum()); break; case "11": trainYearVO.setNovemberNum(data.getFinishedNum()); + trainYearVO.setSum(sum + data.getFinishedNum()); break; case "12": trainYearVO.setDecemberNum(data.getFinishedNum()); + trainYearVO.setSum(sum + data.getFinishedNum()); + } + if (trainYearVO.getSum() != 0) { + res.add(trainYearVO); } }); - unitPage.setRecords(records); + unitPage.setRecords(res); return unitPage; } From 389571d726169012519f1dad58aaaf738db57031 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Wed, 3 Jan 2024 16:19:19 +0800 Subject: [PATCH 3/3] =?UTF-8?q?#=20=E7=BA=BF=E4=B8=8B=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E7=A5=A8=E9=A2=84=E8=A7=88=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java index 29cda63..1a55a22 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java @@ -516,7 +516,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { contentService.saveOrUpdateBatch(workTicketContentDtoList); } WorkTicketFinish workTicketFinish = workTicketVo.getWorkTicketFinish(); - if(CollectionUtil.isNotEmpty(workTicketContentDtoList)) { + if(ObjectUtil.isNotEmpty(workTicketFinish)) { workTicketFinishService.saveOrUpdate(workTicketFinish); } // 推送消息