From bac3c8c5aaac44e6cd4d010fca729960f29e9069 Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Apr 2024 14:20:13 +0800 Subject: [PATCH 01/10] =?UTF-8?q?fix:=20=E5=9F=B9=E8=AE=AD=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/safeproduct/mapper/TestMapper.java | 3 ++ .../hnac/hzims/safeproduct/mapper/TestMapper.xml | 4 +- .../hzims/safeproduct/mapper/TrainPlanMapper.java | 25 +++++++++++ .../hzims/safeproduct/mapper/TrainPlanMapper.xml | 48 ++++++++++++++++++++-- .../safeproduct/mapper/TrainRecordMapper.java | 3 ++ .../hzims/safeproduct/mapper/TrainRecordMapper.xml | 4 +- .../service/impl/TestScoreServiceImpl.java | 11 +++-- .../safeproduct/service/impl/TestServiceImpl.java | 1 - .../service/impl/TrainPlanServiceImpl.java | 32 ++------------- 9 files changed, 87 insertions(+), 44 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java index 9441e30..906f6b2 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.dto.TestDTO; import com.hnac.hzims.safeproduct.entity.TestEntity; import org.apache.ibatis.annotations.Mapper; +import org.springblade.core.datascope.annotation.UserDataAuth; import java.util.List; import java.util.Map; @@ -23,6 +24,7 @@ public interface TestMapper extends BaseMapper { * @param trainPlanId 培训计划id * @return 考试记录名称列表 */ + @UserDataAuth List getTestNameList(String trainPlanId); /** @@ -31,5 +33,6 @@ public interface TestMapper extends BaseMapper { * @param page 分页类 * @return 考试记录数据 */ + @UserDataAuth IPage testPage(IPage page, Map param); } 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 65649d1..626bbad 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 @@ -4,7 +4,7 @@ \ No newline at end of file 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 6839241..4a63a61 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 @@ -7,8 +7,10 @@ import com.hnac.hzims.safeproduct.entity.TrainPlanEntity; import com.hnac.hzims.safeproduct.vo.TrainMonthVO; import com.hnac.hzims.safeproduct.vo.TrainYearVO; import org.apache.ibatis.annotations.Mapper; +import org.springblade.core.datascope.annotation.UserDataAuth; import java.util.List; +import java.util.Map; /** * 培训计划Mapper类 @@ -26,6 +28,7 @@ public interface TrainPlanMapper extends BaseMapper { * @param month 月份 * @return 当月培训计划总数 */ + @UserDataAuth IPage selectByMonth(IPage page, String unit, String month); /** @@ -35,6 +38,7 @@ public interface TrainPlanMapper extends BaseMapper { * @param month 月份 * @return 当月已完成培训计划数 */ + @UserDataAuth IPage selectFinishedDataByMonth(IPage page1, String unit, String month); /** @@ -44,6 +48,7 @@ public interface TrainPlanMapper extends BaseMapper { * @param year 年份 * @return 年度单位数据 */ + @UserDataAuth IPage selectUnitByYear(IPage page, String unit, String year); /** @@ -52,5 +57,25 @@ public interface TrainPlanMapper extends BaseMapper { * @param year 年份 * @return 单位各月的培训计划数 */ + @UserDataAuth List selectFinishedDataByUnit(List unitList, String year); + + /** + * 培训计划分页 + * @param param 入参 + * @param page 分页类 + * @return 培训计划数据 + */ + @UserDataAuth + IPage trainPlanPage(IPage page, Map param); + + /** + * 根据单位和计划时间查询培训计划数据 + * @param unit 单位 + * @param startTime 计划开始时间 + * @param endTime 计划结束时间 + * @return 培训计划列表 + */ + @UserDataAuth + List selectListByUnitAndDate(String unit, String startTime, String endTime); } 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 57c83d1..a9ca3f6 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 @@ -4,7 +4,7 @@ SELECT - unit, count(1) as finished_train_num + unit, count(1) as finished_train_num, create_user, create_dept FROM hzims_train_plan WHERE @@ -39,7 +39,7 @@ SELECT - unit, DATE_FORMAT(scheduled_end_time, '%m') as dateTime, count(1) as finished_num + unit, DATE_FORMAT(scheduled_end_time, '%m') as dateTime, count(1) as finished_num, create_user, create_dept FROM hzims_train_plan WHERE @@ -70,4 +70,44 @@ ORDER BY unit + + + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java index 28419b3..a4dd083 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java @@ -7,6 +7,7 @@ import com.hnac.hzims.safeproduct.entity.TrainRecordEntity; import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; import com.hnac.hzims.safeproduct.vo.TrainRecordVO; import org.apache.ibatis.annotations.Mapper; +import org.springblade.core.datascope.annotation.UserDataAuth; import java.util.List; import java.util.Map; @@ -25,6 +26,7 @@ public interface TrainRecordMapper extends BaseMapper { * @param trainPlanId 培训计划id * @return 培训记录名称列表 */ + @UserDataAuth List getTrainRecordNameList(String trainPlanId); /** @@ -40,5 +42,6 @@ public interface TrainRecordMapper extends BaseMapper { * @param page 分页类 * @return 培训记录数据 */ + @UserDataAuth IPage trainRecordPage(IPage page, Map param); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml index 5201998..a719263 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml @@ -4,7 +4,7 @@ SELECT - unit, scheduled_start_time, scheduled_end_time, theme, location, conference_method, host, conference_status + unit, scheduled_start_time, scheduled_end_time, theme, location, conference_method, host, conference_status, + create_user, create_dept FROM hzims_conference_plan WHERE diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java index 6c5bb95..61c55af 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java @@ -1,12 +1,14 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO; import com.hnac.hzims.safeproduct.vo.ConferenceRecordVO; import org.apache.ibatis.annotations.Mapper; +import org.springblade.core.datascope.annotation.UserDataAuth; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; +import java.util.List; import java.util.Map; /** @@ -16,7 +18,7 @@ import java.util.Map; * @date 2023-12-27 */ @Mapper -public interface ConferenceRecordMapper extends BaseMapper { +public interface ConferenceRecordMapper extends UserDataScopeBaseMapper { /** * 查询会议记录表详情 @@ -31,5 +33,13 @@ public interface ConferenceRecordMapper extends BaseMapper getConferenceRecordPage(IPage page, Map param); + + /** + * 查询当月会议记录 + * @param month 当月 + * @return 当月会议数据表 + */ + List selectConferenceByMonth(String month); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml index 88c5b1d..f46e80d 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml @@ -17,7 +17,8 @@ + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java index fb4fa22..b2f88f4 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java @@ -178,9 +178,6 @@ public class ConferenceRecordServiceImpl extends ServiceImpl getConferenceByMonth(String month) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().like(ConferenceRecordEntity::getCreateTime, month) - .orderByDesc(ConferenceRecordEntity::getCode); - return this.list(queryWrapper); + return baseMapper.selectConferenceByMonth(month); } } From af94dfe8d7f680b8b97568d4a3aaf2f10e124821 Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Apr 2024 15:46:57 +0800 Subject: [PATCH 06/10] =?UTF-8?q?fix:=20=E6=BC=94=E7=BB=83=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java | 8 ++++++++ .../hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml | 12 ++++++++++++ .../safeproduct/service/impl/RehearsalRecordServiceImpl.java | 6 +----- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java index 3746e36..5d6242d 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java @@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Mapper; import org.springblade.core.datascope.annotation.UserDataAuth; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; +import java.util.List; import java.util.Map; /** @@ -34,4 +35,11 @@ public interface RehearsalRecordMapper extends UserDataScopeBaseMapper getRehearsalRecordPage(IPage page, Map param); + + /** + * 查询当月演练记录 + * @param month 当月 + * @return 当月演练数据表 + */ + List selectRehearsalByMonth(String month); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml index 5241221..2130923 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml @@ -39,4 +39,16 @@ 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/service/impl/RehearsalRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java index 7ac4d6e..55aaf12 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java @@ -23,7 +23,6 @@ import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; import com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.support.Query; -import org.springblade.core.secure.utils.AuthUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -116,10 +115,7 @@ public class RehearsalRecordServiceImpl extends ServiceImpl getRehearsalByMonth(String month) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().like(RehearsalRecordEntity::getCreateTime, month) - .orderByDesc(RehearsalRecordEntity::getCode); - return this.list(queryWrapper); + return baseMapper.selectRehearsalByMonth(month); } /** From 151b8c418046a9b42614c8e719711c5518070f74 Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Apr 2024 16:14:02 +0800 Subject: [PATCH 07/10] =?UTF-8?q?fix:=20=E5=8D=AB=E7=94=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/safeproduct/mapper/HygienePlanMapper.java | 7 +++++-- .../hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml | 4 ++-- .../hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java | 14 ++++++++++++-- .../hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml | 14 +++++++++++++- .../hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java | 4 ++-- .../safeproduct/service/impl/HygieneRecordServiceImpl.java | 5 +---- 6 files changed, 35 insertions(+), 13 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.java index 324d14f..946d92b 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.java @@ -1,10 +1,11 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.entity.HygienePlanEntity; import com.hnac.hzims.safeproduct.vo.HygieneMonthVO; import org.apache.ibatis.annotations.Mapper; +import org.springblade.core.datascope.annotation.UserDataAuth; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; /** @@ -14,7 +15,7 @@ import org.apache.ibatis.annotations.Mapper; * @date 2023-12-27 */ @Mapper -public interface HygienePlanMapper extends BaseMapper { +public interface HygienePlanMapper extends UserDataScopeBaseMapper { /** * 查询当月各单位的卫生自查总数 @@ -23,6 +24,7 @@ public interface HygienePlanMapper extends BaseMapper { * @param month 月份 * @return 当月的卫生自查总数据 */ + @UserDataAuth IPage selectByMonth(IPage page, String unit, String month); /** @@ -32,5 +34,6 @@ public interface HygienePlanMapper extends BaseMapper { * @param month 月份 * @return 当月的已完成数据 */ + @UserDataAuth IPage selectFinishedDataByMonth(IPage page, String unit, String month); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml index 39919c0..6e7b224 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml @@ -3,7 +3,7 @@ SELECT - unit, count(1) as finished_check_num + unit, count(1) as finished_check_num, create_user, create_dept FROM hzims_hygiene_plan WHERE diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java index b888c54..d8095f6 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java @@ -1,12 +1,14 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity; import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO; import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO; import org.apache.ibatis.annotations.Mapper; +import org.springblade.core.datascope.annotation.UserDataAuth; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; +import java.util.List; import java.util.Map; /** @@ -16,7 +18,7 @@ import java.util.Map; * @date 2023-12-27 */ @Mapper -public interface HygieneRecordMapper extends BaseMapper { +public interface HygieneRecordMapper extends UserDataScopeBaseMapper { /** * 查询卫生自查记录详情 @@ -31,5 +33,13 @@ public interface HygieneRecordMapper extends BaseMapper { * @param page 分页类 * @return 记录数据页 */ + @UserDataAuth IPage recordPage(IPage page, Map param); + + /** + * 查询当月卫生自查记录 + * @param month 当月 + * @return 当月卫生自查数据表 + */ + List selectHygieneByMonth(String month); } 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 e7953b6..d012ec4 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 @@ -14,7 +14,7 @@ + + \ 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 6614aff..50d9e76 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 @@ -1,8 +1,8 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; import org.apache.ibatis.annotations.Mapper; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; /** * 卫生自查责任区Mapper类 @@ -11,6 +11,6 @@ import org.apache.ibatis.annotations.Mapper; * @date 2024-01-02 */ @Mapper -public interface HygieneZoneMapper extends BaseMapper { +public interface HygieneZoneMapper extends UserDataScopeBaseMapper { } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java index aab7037..24d3a9f 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java @@ -218,10 +218,7 @@ public class HygieneRecordServiceImpl extends ServiceImpl getHygieneByMonth(String month) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().like(HygieneRecordEntity::getCreateTime, month) - .orderByDesc(HygieneRecordEntity::getCode); - return this.list(queryWrapper); + return baseMapper.selectHygieneByMonth(month); } /** From d347fa6f9db1f83eb2d274d0eddc0b87cd934a11 Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Apr 2024 16:23:32 +0800 Subject: [PATCH 08/10] =?UTF-8?q?fix:=20=E7=89=B9=E7=A7=8D=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=AE=A1=E7=90=86=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90=EF=BC=9B=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java | 6 ++++++ .../hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java | 6 ++++-- .../java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java index 5c12f90..8b3722b 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceEntity.java @@ -7,6 +7,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; +import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.util.Date; @@ -20,6 +21,11 @@ import java.util.Date; @ApiModel(value = "特种设备实体类") public class SpecialDeviceEntity extends BaseEntity { + @NotNull + @Size(max = 50, message = "设备所属机构字段长度不能超过50") + @ApiModelProperty("设备所属机构") + private String unit; + @Size(max = 50, message = "设备名称长度不能超过50") @ApiModelProperty("设备名称") private String name; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java index 4bbe2e9..39132ff 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java @@ -1,9 +1,10 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity; import org.apache.ibatis.annotations.Mapper; +import org.springblade.core.datascope.annotation.UserDataAuth; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import java.util.List; import java.util.Map; @@ -15,7 +16,7 @@ import java.util.Map; * @date 2024-01-22 */ @Mapper -public interface SpecialDeviceInspectionMapper extends BaseMapper { +public interface SpecialDeviceInspectionMapper extends UserDataScopeBaseMapper { /** * 设备检验记录分页 @@ -23,6 +24,7 @@ public interface SpecialDeviceInspectionMapper extends BaseMapper getInspectionPage(IPage page, Map param); /** diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java index 1c2ace4..5fa5b96 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceMapper.java @@ -1,8 +1,8 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; import org.apache.ibatis.annotations.Mapper; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; /** * 特种设备Mapper类 @@ -11,6 +11,6 @@ import org.apache.ibatis.annotations.Mapper; * @date 2024-01-12 */ @Mapper -public interface SpecialDeviceMapper extends BaseMapper { +public interface SpecialDeviceMapper extends UserDataScopeBaseMapper { } From faa5305f7fcf642adad516928c8379afb058cbeb Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Apr 2024 16:26:43 +0800 Subject: [PATCH 09/10] =?UTF-8?q?fix:=20=E7=89=B9=E7=A7=8D=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=AE=A1=E7=90=86=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90=EF=BC=9B=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hzims-service/safeproduct/src/main/resources/db/2.0.1.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql b/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql index d66265a..9ac560e 100644 --- a/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql +++ b/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql @@ -7,3 +7,7 @@ ALTER TABLE hzims_conference_plan ALTER TABLE hzims_rehearsal_plan MODIFY COLUMN scheduled_start_time datetime NOT NULL COMMENT '演练计划开始时间', MODIFY COLUMN scheduled_end_time datetime NOT NULL COMMENT '演练计划结束时间'; + +-- 特种设备表:添加单位字段 +ALTER TABLE hzims_device + ADD COLUMN unit varchar(50) NOT NULL COMMENT '单位'; \ No newline at end of file From 8b0b6e244f4df834abe86a7c4b3a1248240a147d Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Apr 2024 16:41:04 +0800 Subject: [PATCH 10/10] =?UTF-8?q?fix:=20=E5=9F=B9=E8=AE=AD=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml | 2 +- .../java/com/hnac/hzims/safeproduct/mapper/TestMapper.java | 11 +++++++++-- .../java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml | 12 ++++++++++++ .../com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java | 4 ++-- .../com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java | 4 ++-- .../com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java | 11 +++++++++-- .../com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml | 12 ++++++++++++ .../hnac/hzims/safeproduct/service/impl/TestServiceImpl.java | 5 +---- .../safeproduct/service/impl/TrainRecordServiceImpl.java | 5 +---- 9 files changed, 49 insertions(+), 17 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml index 2130923..c1d3077 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml @@ -49,6 +49,6 @@ is_deleted = 0 AND create_time like concat(#{month}, '%') ORDER BY - create_time DESC + code DESC \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java index 906f6b2..0817af7 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java @@ -1,11 +1,11 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.dto.TestDTO; import com.hnac.hzims.safeproduct.entity.TestEntity; import org.apache.ibatis.annotations.Mapper; import org.springblade.core.datascope.annotation.UserDataAuth; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import java.util.List; import java.util.Map; @@ -17,7 +17,7 @@ import java.util.Map; * @date 2023-12-25 */ @Mapper -public interface TestMapper extends BaseMapper { +public interface TestMapper extends UserDataScopeBaseMapper { /** * 查询考试记录名称列表 @@ -35,4 +35,11 @@ public interface TestMapper extends BaseMapper { */ @UserDataAuth IPage testPage(IPage page, Map param); + + /** + * 查询当月考试记录 + * @param month 当月 + * @return 当月考试记录 + */ + List selectTestByMonth(String month); } 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 626bbad..18d8ea1 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 @@ -38,4 +38,16 @@ 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/TestScoreMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java index 23290b8..061d4a5 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java @@ -1,9 +1,9 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.safeproduct.entity.TestScoreEntity; import com.hnac.hzims.safeproduct.vo.TestScoreVO; import org.apache.ibatis.annotations.Mapper; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import java.util.List; @@ -14,7 +14,7 @@ import java.util.List; * @date 2023-12-25 */ @Mapper -public interface TestScoreMapper extends BaseMapper { +public interface TestScoreMapper extends UserDataScopeBaseMapper { /** * 查询考试成绩列表 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 4a63a61..bbb1960 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 @@ -1,6 +1,5 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO; import com.hnac.hzims.safeproduct.entity.TrainPlanEntity; @@ -8,6 +7,7 @@ import com.hnac.hzims.safeproduct.vo.TrainMonthVO; import com.hnac.hzims.safeproduct.vo.TrainYearVO; import org.apache.ibatis.annotations.Mapper; import org.springblade.core.datascope.annotation.UserDataAuth; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import java.util.List; import java.util.Map; @@ -19,7 +19,7 @@ import java.util.Map; * @date 2023-12-25 */ @Mapper -public interface TrainPlanMapper extends BaseMapper { +public interface TrainPlanMapper extends UserDataScopeBaseMapper { /** * 查询当月各单位的培训计划总数 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java index a4dd083..a7265c8 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java @@ -1,6 +1,5 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.dto.TrainRecordDTO; import com.hnac.hzims.safeproduct.entity.TrainRecordEntity; @@ -8,6 +7,7 @@ import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; import com.hnac.hzims.safeproduct.vo.TrainRecordVO; import org.apache.ibatis.annotations.Mapper; import org.springblade.core.datascope.annotation.UserDataAuth; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import java.util.List; import java.util.Map; @@ -19,7 +19,7 @@ import java.util.Map; * @date 2023-12-25 */ @Mapper -public interface TrainRecordMapper extends BaseMapper { +public interface TrainRecordMapper extends UserDataScopeBaseMapper { /** * 查询培训记录名称列表 @@ -44,4 +44,11 @@ public interface TrainRecordMapper extends BaseMapper { */ @UserDataAuth IPage trainRecordPage(IPage page, Map param); + + /** + * 查询当月培训记录 + * @param month 当月 + * @return 当月培训记录 + */ + List selectTrainByMonth(String month); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml index a719263..cf36041 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml @@ -53,4 +53,16 @@ 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/service/impl/TestServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java index 2645f06..8e75d9c 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java @@ -246,9 +246,6 @@ public class TestServiceImpl extends ServiceImpl impleme * @return 当月考试记录 */ public List getTestByMonth(String month) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().like(TestEntity::getCreateTime, month) - .orderByDesc(TestEntity::getCode); - return this.list(queryWrapper); + return baseMapper.selectTestByMonth(month); } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java index 9a79a53..9a04c57 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java @@ -219,9 +219,6 @@ public class TrainRecordServiceImpl extends ServiceImpl getTrainByMonth(String month) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().like(TrainRecordEntity::getCreateTime, month) - .orderByDesc(TrainRecordEntity::getCode); - return this.list(queryWrapper); + return baseMapper.selectTrainByMonth(month); } }