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/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.java index b540c27..932cc16 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.java @@ -28,7 +28,9 @@ public interface TaskMapper extends UserDataScopeBaseMapper { */ List getListPage(@Param("page") IPage page, @Param("task") TaskListQuery task); + @UserDataAuth List getAllPageList(@Param("page") IPage page, @Param("task") TaskDTO taskDTO); + List getAllExportList(@Param("task") TaskDTO taskDTO); List mainQueryPage(@Param("page") IPage page, @Param("task") TaskListQuery task); diff --git a/hzims-service/operational/src/main/resources/db/2.0.3.sql b/hzims-service/operational/src/main/resources/db/2.0.3.sql index b42a617..2b49805 100644 --- a/hzims-service/operational/src/main/resources/db/2.0.3.sql +++ b/hzims-service/operational/src/main/resources/db/2.0.3.sql @@ -22,7 +22,7 @@ update hzims_oper_maintenance_plan t1,( ) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null; -- 更新日常维护任务设备名称 update hzims_oper_maintenance_task t1,( - select ml.`id`,ml.`EM_CODE`,GROUP_CONCAT(ei.`NAME`) EM_NAME from hzims_oper_maintenance_task ml,prod_hzims_equipment.hzims_em_info ei where ml.`IS_DELETED` = 0 and ei.`IS_DELETED` = 0 and FIND_IN_SET(ei.`NUMBER`,ml.`EM_CODE`) group by ml.`id`,ml.`EM_CODE` + select ml.`id`,ml.`EM_CODE`,GROUP_CONCAT(ei.`NAME`) EM_NAME from hzims_oper_maintenance_task ml,equipment.hzims_em_info ei where ml.`IS_DELETED` = 0 and ei.`IS_DELETED` = 0 and FIND_IN_SET(ei.`NUMBER`,ml.`EM_CODE`) group by ml.`id`,ml.`EM_CODE` ) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null; -- 更新日常维护计划周期字段值 update `hzims_oper_maintenance_plan` mp,`hzims_oper_maintenance_library` ml diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.java index 6aab066..549e430 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferencePlanMapper.java @@ -1,9 +1,10 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.safeproduct.dto.ConferenceExportDTO; import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity; import org.apache.ibatis.annotations.Mapper; +import org.springblade.core.datascope.annotation.UserDataAuth; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import java.util.List; @@ -14,7 +15,7 @@ import java.util.List; * @date 2023-12-27 */ @Mapper -public interface ConferencePlanMapper extends BaseMapper { +public interface ConferencePlanMapper extends UserDataScopeBaseMapper { /** * 根据单位和计划时间查询会议记录 @@ -23,5 +24,6 @@ public interface ConferencePlanMapper extends BaseMapper { * @param endTime 计划结束时间 * @return 会议记录列表 */ + @UserDataAuth List getConferenceByUnitAndDate(String unit, String startTime, String endTime); } 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 8b5f204..d8981d2 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 @@ -3,7 +3,8 @@ SELECT t1.id, t1.code, t2.unit, t2.scheduled_start_time, t2.scheduled_end_time, t1.actual_start_time, t1.actual_end_time, - t2.location, t2.host, t2.conference_method, t2.theme, t2.conference_status, t1.recorder, t1.content + t2.location, t2.host, t2.conference_method, t2.theme, t2.conference_status, t1.recorder, t1.content, t1.create_user, + t1.create_dept FROM hzims_conference_record t1 LEFT JOIN hzims_conference_plan t2 ON t1.conference_plan_id = t2.id @@ -38,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/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/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..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 @@ -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/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 { } 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..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,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.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; @@ -16,13 +17,14 @@ import java.util.Map; * @date 2023-12-25 */ @Mapper -public interface TestMapper extends BaseMapper { +public interface TestMapper extends UserDataScopeBaseMapper { /** * 查询考试记录名称列表 * @param trainPlanId 培训计划id * @return 考试记录名称列表 */ + @UserDataAuth List getTestNameList(String trainPlanId); /** @@ -31,5 +33,13 @@ public interface TestMapper extends BaseMapper { * @param page 分页类 * @return 考试记录数据 */ + @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 65649d1..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 @@ -4,7 +4,7 @@ + + \ 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 6839241..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,14 +1,16 @@ 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; 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; /** * 培训计划Mapper类 @@ -17,7 +19,7 @@ import java.util.List; * @date 2023-12-25 */ @Mapper -public interface TrainPlanMapper extends BaseMapper { +public interface TrainPlanMapper extends UserDataScopeBaseMapper { /** * 查询当月各单位的培训计划总数 @@ -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..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,12 +1,13 @@ 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; 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; @@ -18,13 +19,14 @@ import java.util.Map; * @date 2023-12-25 */ @Mapper -public interface TrainRecordMapper extends BaseMapper { +public interface TrainRecordMapper extends UserDataScopeBaseMapper { /** * 查询培训记录名称列表 * @param trainPlanId 培训计划id * @return 培训记录名称列表 */ + @UserDataAuth List getTrainRecordNameList(String trainPlanId); /** @@ -40,5 +42,13 @@ public interface TrainRecordMapper extends BaseMapper { * @param page 分页类 * @return 培训记录数据 */ + @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 5201998..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 @@ -4,7 +4,7 @@ + + \ 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); } } 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); } /** 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); } /** diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java index ce59424..6145b38 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java @@ -11,8 +11,6 @@ import com.hnac.hzims.safeproduct.mapper.TestScoreMapper; import com.hnac.hzims.safeproduct.service.ITestScoreService; import com.hnac.hzims.safeproduct.vo.TestScoreSumVO; import com.hnac.hzims.safeproduct.vo.TestScoreVO; -import com.hnac.hzinfo.inspect.ai.entity.RobotTaskEntity; -import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; @@ -22,8 +20,8 @@ import org.springblade.system.entity.Dept; import org.springblade.system.feign.ISysClient; import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; -import org.springblade.system.user.feign.IUserClient; import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -41,11 +39,12 @@ import java.util.stream.Collectors; * @date 2023-12-25 */ @Service -@RequiredArgsConstructor @Slf4j public class TestScoreServiceImpl extends ServiceImpl implements ITestScoreService { - private final ISysClient sysClient; - private final IUserClient userClient; + + @Autowired + ISysClient sysClient; + @Resource TestMapper testMapper; 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 4179aae..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 @@ -18,7 +18,6 @@ import com.hnac.hzims.safeproduct.service.ITestScoreService; import com.hnac.hzims.safeproduct.service.ITestService; import com.hnac.hzims.safeproduct.utils.BaseUtil; import lombok.RequiredArgsConstructor; -import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; @@ -247,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/TrainPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java index 37aabc0..3f3af95 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 @@ -5,12 +5,10 @@ import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.converters.longconverter.LongStringConverter; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO; import com.hnac.hzims.safeproduct.entity.TrainPlanEntity; @@ -265,21 +263,8 @@ public class TrainPlanServiceImpl extends ServiceImpl trainPlanPage(Map param, Query query) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - String unit = String.valueOf(param.get("unit")); - String startTime = String.valueOf(param.get("scheduledStartTime")); - String endTime = String.valueOf((param.get("scheduledEndTime"))); - if (!unit.equals("null") && !unit.equals("")) { - queryWrapper.lambda().like(TrainPlanEntity::getUnit, unit); - } - if (!startTime.equals("null") && !startTime.equals("")) { - queryWrapper.lambda().ge(TrainPlanEntity::getScheduledStartTime, startTime); - } - if (!endTime.equals("null") && !endTime.equals("")) { - queryWrapper.lambda().le(TrainPlanEntity::getScheduledEndTime, endTime); - } - queryWrapper.lambda().orderByDesc(TrainPlanEntity::getCreateTime); - return this.page(Condition.getPage(query), queryWrapper); + IPage page = new Page<>(query.getCurrent(), query.getSize()); + return baseMapper.trainPlanPage(page, param); } /** @@ -290,17 +275,6 @@ public class TrainPlanServiceImpl extends ServiceImpl getTrainPlanByUnitAndDate(String unit, String startTime, String endTime) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - if (!unit.equals("null")) { - queryWrapper.eq(TrainPlanEntity::getUnit, unit); - } - if (!startTime.equals("null")) { - queryWrapper.ge(TrainPlanEntity::getScheduledStartTime, startTime); - } - if (!endTime.equals("null")) { - queryWrapper.lt(TrainPlanEntity::getScheduledEndTime, endTime); - } - queryWrapper.orderByDesc(TrainPlanEntity::getCreateTime); - return this.list(queryWrapper); + return baseMapper.selectListByUnitAndDate(unit, startTime, endTime); } } 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); } } 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 diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java index 66f6b0a..41d0b30 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java @@ -373,7 +373,9 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); if(CollectionUtil.isNotEmpty(safetyMeasuresList)) { @@ -643,7 +641,43 @@ public class TicketProcessServiceImpl implements TicketProcessService { } } - + /** + * 填充工作票当前流程环节名称 + * @param workTicket 工作票 + * @param response redis订阅消息 + * @return 当前流程环节名称 + */ + private void fillCurrentFlowName(WorkTicketInfoEntity workTicket, ProcessWorkFlowResponse response) { + String taskId = response.getTaskId(); + Object variablesObj = response.getVariables(); + JSONObject variable = JSONObject.parseObject(JSON.toJSONString(variablesObj)); + Boolean signFlag = Func.isNotEmpty(variable.getBoolean("signFlag")) ? variable.getBoolean("signFlag") : true; + Boolean receiveFlag = Func.isNotEmpty(variable.getBoolean("recieveFlag")) ? variable.getBoolean("recieveFlag") : true; + if(StringUtil.isNotBlank(taskId)) { + workTicket.setFlowUserId(response.getUserId()); + workTicket.setNextStepOperator(response.getNextStepOperator()); + String flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(response.getNextStepOperator()).concat("审批"); + workTicket.setFlowDescription(flowDescription); + workTicket.setFlowTaskId(taskId); + workTicket.setFlowTaskName(response.getTaskName()); + } + else if(!signFlag || !receiveFlag ) { + // 作废 + workTicket.setFlowDescription("作废"); + workTicket.setFlowTaskName("作废"); + workTicket.setNextStepOperator(null); + workTicket.setStepOperator(null); + } + else { + // 结束 + workTicket.setFlowDescription("结束"); + workTicket.setFlowTaskName("结束"); + workTicket.setNextStepOperator(null); + workTicket.setStepOperator(null); + workTicket.setFlowStatus(999); + workTicket.setImplementStatus("3"); + } + } /** * 获取描述信息 *