Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 7 months ago
parent
commit
a1ed4fe025
  1. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java
  2. 24
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  3. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  4. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java
  5. 10
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.java
  6. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml
  7. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java
  8. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml
  9. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java
  10. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml
  11. 25
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java
  12. 48
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml
  13. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java
  14. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml
  15. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java
  16. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java
  17. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java
  18. 1
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java
  19. 32
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java
  20. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java
  21. BIN
      hzims-service/safeproduct/src/main/resources/template/培训记录表.docx

2
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java

@ -85,7 +85,7 @@ public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
page.setCurrent(req.getPageIndex() + 1); page.setCurrent(req.getPageIndex() + 1);
req.setDisplay(1); req.setDisplay(1);
req.setIsRoot(0); req.setIsRoot(0);
req.setOrderBy("NAME"); req.setOrderBy("STATION,ORD,NAME");
req.setOrderKind("desc"); req.setOrderKind("desc");
String result = HttpRequestUtil.postCallObjectParam(req, getNeoFaultTableData, "POST"); String result = HttpRequestUtil.postCallObjectParam(req, getNeoFaultTableData, "POST");
log.info("FdpFaultTableListEntity接口:"+result.toString()); log.info("FdpFaultTableListEntity接口:"+result.toString());

24
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -1103,9 +1103,11 @@ public class RealTargetServiceImpl implements RealTargetService {
* @return * @return
*/ */
private Map<Integer, String> getWaterLevelMap(String instanceCode, String signage) { private Map<Integer, String> getWaterLevelMap(String instanceCode, String signage) {
String beginTime = DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00"; // 开始日期
String endTime = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME); String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00";
List<AnalyseDataTaosVO> datas = dataService.periodTargetData(beginTime, endTime,6, 2,instanceCode,signage); // 结束日期
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 23:59:59";
List<AnalyseDataTaosVO> datas = dataService.periodTargetData(start, end,6, 2,instanceCode,signage);
if(CollectionUtil.isEmpty(datas)){ if(CollectionUtil.isEmpty(datas)){
return new HashMap<>(); return new HashMap<>();
} }
@ -1115,8 +1117,8 @@ public class RealTargetServiceImpl implements RealTargetService {
return dateTime.getHours(); return dateTime.getHours();
}, },
value -> { value -> {
if(StringUtil.isBlank(value.getVal())){ if(StringUtil.isEmpty(value.getVal())){
return "0"; return "";
} }
return value.getVal(); return value.getVal();
}) })
@ -1379,12 +1381,10 @@ public class RealTargetServiceImpl implements RealTargetService {
* @return * @return
*/ */
private List<ActivePowerVo> getLoadsByDay(EminfoAndEmParamVo device) { private List<ActivePowerVo> getLoadsByDay(EminfoAndEmParamVo device) {
// 结束日期
Calendar calendar = Calendar.getInstance();
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
// 开始日期 // 开始日期
calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR_OF_DAY) - 24); String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00";
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); // 结束日期
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 23:59:59";
List<AnalyseDataTaosVO> records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD); List<AnalyseDataTaosVO> records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD);
if (CollectionUtil.isEmpty(records)) { if (CollectionUtil.isEmpty(records)) {
return new ArrayList<>(); return new ArrayList<>();
@ -1394,7 +1394,9 @@ public class RealTargetServiceImpl implements RealTargetService {
Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s");
load.setStrHour(DateUtil.format(time,"yyyy-MM-dd HH")); load.setStrHour(DateUtil.format(time,"yyyy-MM-dd HH"));
load.setHour(time.getHours()); load.setHour(time.getHours());
load.setActivePower(Optional.ofNullable(record.getVal()).orElse("0")); if(StringUtil.isNotBlank(record.getVal())){
load.setActivePower(record.getVal());
}
return load; return load;
}).sorted(Comparator.comparing(ActivePowerVo::getStrHour)).collect(Collectors.toList()); }).sorted(Comparator.comparing(ActivePowerVo::getStrHour)).collect(Collectors.toList());
} }

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

@ -205,7 +205,7 @@ public class MonitorServiceImpl implements MonitorService {
List<String> objects = redisClient.getBatchRealDataByRealId(stationReal.getStation(),realIds); List<String> objects = redisClient.getBatchRealDataByRealId(stationReal.getStation(),realIds);
for(int i = 0; i < realIds.size() ;i++){ for(int i = 0; i < realIds.size() ;i++){
if(ObjectUtil.isEmpty(objects.get(i))){ if(ObjectUtil.isEmpty(objects.get(i))){
log.error(realIds.get(i) + "is null"); // log.error(realIds.get(i) + "is null");
}else{ }else{
Map<String,String> attribute = (Map<String, String>) JSONObject.parse(objects.get(i)); Map<String,String> attribute = (Map<String, String>) JSONObject.parse(objects.get(i));
attribute.put("realId",attribute.get("k")); attribute.put("realId",attribute.get("k"));

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java

@ -1571,7 +1571,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("startDate", startTime); paramMap.put("startDate", startTime);
paramMap.put("endDate", endTime); paramMap.put("endDate", endTime);
paramMap.put("deptList", deptId); paramMap.put("deptList", Arrays.asList(deptId));
R<List<WorkTicketInfoEntity>> workTicketInfo = ticketInfoClient.getWorkTicketInfo(paramMap); R<List<WorkTicketInfoEntity>> workTicketInfo = ticketInfoClient.getWorkTicketInfo(paramMap);
if(workTicketInfo.isSuccess()&& cn.hutool.core.util.ObjectUtil.isNotEmpty(workTicketInfo.getData())){ if(workTicketInfo.isSuccess()&& cn.hutool.core.util.ObjectUtil.isNotEmpty(workTicketInfo.getData())){
List<WorkTicketInfoEntity> ticketInfoData = workTicketInfo.getData(); List<WorkTicketInfoEntity> ticketInfoData = workTicketInfo.getData();
@ -1583,10 +1583,9 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
List<WorkTicketInfoEntity> invalidList = ticketInfoData.stream().filter(item -> "废票".equals(item.getFlowTaskName())) List<WorkTicketInfoEntity> invalidList = ticketInfoData.stream().filter(item -> "废票".equals(item.getFlowTaskName()))
.collect(Collectors.toList()); .collect(Collectors.toList());
dutyLogEntity.setWorkCancel(String.valueOf(invalidList.size())); dutyLogEntity.setWorkCancel(String.valueOf(invalidList.size()));
Integer i=0;
//工作票未执行数量 //工作票未执行数量
List<WorkTicketInfoEntity> unExecutedList = ticketInfoData.stream() List<WorkTicketInfoEntity> unExecutedList = ticketInfoData.stream()
.filter(item -> i.equals(item.getImplementStatus())) .filter(item -> "0".equals(item.getImplementStatus()))
.collect(Collectors.toList()); .collect(Collectors.toList());
dutyLogEntity.setWorkUnFinish(String.valueOf(unExecutedList.size())); dutyLogEntity.setWorkUnFinish(String.valueOf(unExecutedList.size()));
// 工作票执行数量 // 工作票执行数量

10
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.java

@ -1,6 +1,5 @@
package com.hnac.hzims.safeproduct.mapper; package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO; import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO;
import com.hnac.hzims.safeproduct.dto.RehearsalExportDTO; import com.hnac.hzims.safeproduct.dto.RehearsalExportDTO;
@ -9,6 +8,8 @@ import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO;
import com.hnac.hzims.safeproduct.vo.RehearsalYearVO; import com.hnac.hzims.safeproduct.vo.RehearsalYearVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List; import java.util.List;
@ -19,7 +20,7 @@ import java.util.List;
* @date 2023-12-27 * @date 2023-12-27
*/ */
@Mapper @Mapper
public interface RehearsalPlanMapper extends BaseMapper<RehearsalPlanEntity> { public interface RehearsalPlanMapper extends UserDataScopeBaseMapper<RehearsalPlanEntity> {
/** /**
* 查询当月各单位的演练总数 * 查询当月各单位的演练总数
@ -28,6 +29,7 @@ public interface RehearsalPlanMapper extends BaseMapper<RehearsalPlanEntity> {
* @param month 月份 * @param month 月份
* @return 当月的演练总数据 * @return 当月的演练总数据
*/ */
@UserDataAuth
IPage<RehearsalMonthVO> selectByMonth(IPage<RehearsalMonthVO> page, String unit, String month); IPage<RehearsalMonthVO> selectByMonth(IPage<RehearsalMonthVO> page, String unit, String month);
/** /**
@ -37,6 +39,7 @@ public interface RehearsalPlanMapper extends BaseMapper<RehearsalPlanEntity> {
* @param month 月份 * @param month 月份
* @return 当月的已完成数据 * @return 当月的已完成数据
*/ */
@UserDataAuth
IPage<RehearsalMonthVO> selectFinishedDataByMonth(IPage<RehearsalMonthVO> page, String unit, String month); IPage<RehearsalMonthVO> selectFinishedDataByMonth(IPage<RehearsalMonthVO> page, String unit, String month);
/** /**
@ -46,6 +49,7 @@ public interface RehearsalPlanMapper extends BaseMapper<RehearsalPlanEntity> {
* @param year 年份 * @param year 年份
* @return 年度单位数据 * @return 年度单位数据
*/ */
@UserDataAuth
IPage<RehearsalYearVO> selectUnitByYear(IPage<RehearsalYearVO> page, String unit, @Param("year") String year); IPage<RehearsalYearVO> selectUnitByYear(IPage<RehearsalYearVO> page, String unit, @Param("year") String year);
/** /**
@ -54,6 +58,7 @@ public interface RehearsalPlanMapper extends BaseMapper<RehearsalPlanEntity> {
* @param year 年份 * @param year 年份
* @return 单位各月的数据列表 * @return 单位各月的数据列表
*/ */
@UserDataAuth
List<AnalysisYearDTO> selectFinishedDataByUnit(@Param("unitList") List<String> unitList, @Param("year") String year); List<AnalysisYearDTO> selectFinishedDataByUnit(@Param("unitList") List<String> unitList, @Param("year") String year);
/** /**
@ -63,5 +68,6 @@ public interface RehearsalPlanMapper extends BaseMapper<RehearsalPlanEntity> {
* @param endTime 计划结束时间 * @param endTime 计划结束时间
* @return 演练数据列表 * @return 演练数据列表
*/ */
@UserDataAuth
List<RehearsalExportDTO> getRehearsalByUnitAndDate(String unit, String startTime, String endTime); List<RehearsalExportDTO> getRehearsalByUnitAndDate(String unit, String startTime, String endTime);
} }

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml

@ -4,7 +4,7 @@
<select id="selectByMonth" resultType="com.hnac.hzims.safeproduct.vo.RehearsalMonthVO"> <select id="selectByMonth" resultType="com.hnac.hzims.safeproduct.vo.RehearsalMonthVO">
SELECT SELECT
unit, count(1) as scheduled_task_num unit, count(1) as scheduled_task_num, create_user, create_dept
FROM FROM
hzims_rehearsal_plan hzims_rehearsal_plan
WHERE WHERE
@ -21,7 +21,7 @@
<select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.RehearsalMonthVO"> <select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.RehearsalMonthVO">
SELECT SELECT
unit, count(1) as finished_task_num unit, count(1) as finished_task_num, create_user, create_dept
FROM FROM
hzims_rehearsal_plan hzims_rehearsal_plan
WHERE WHERE
@ -39,7 +39,7 @@
<select id="selectUnitByYear" resultType="com.hnac.hzims.safeproduct.vo.RehearsalYearVO"> <select id="selectUnitByYear" resultType="com.hnac.hzims.safeproduct.vo.RehearsalYearVO">
SELECT SELECT
distinct unit distinct unit, create_user, create_dept
FROM FROM
hzims_rehearsal_plan hzims_rehearsal_plan
WHERE WHERE
@ -54,7 +54,7 @@
<select id="selectFinishedDataByUnit" resultType="com.hnac.hzims.safeproduct.dto.AnalysisYearDTO"> <select id="selectFinishedDataByUnit" resultType="com.hnac.hzims.safeproduct.dto.AnalysisYearDTO">
SELECT 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 FROM
hzims_rehearsal_plan hzims_rehearsal_plan
WHERE WHERE
@ -73,7 +73,8 @@
<select id="getRehearsalByUnitAndDate" resultType="com.hnac.hzims.safeproduct.dto.RehearsalExportDTO"> <select id="getRehearsalByUnitAndDate" resultType="com.hnac.hzims.safeproduct.dto.RehearsalExportDTO">
SELECT SELECT
unit, subject, scheduled_start_time, scheduled_end_time, location, rehearsal_status, commander unit, subject, scheduled_start_time, scheduled_end_time, location, rehearsal_status, commander, create_user,
create_dept
FROM FROM
hzims_rehearsal_plan hzims_rehearsal_plan
WHERE WHERE

6
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java

@ -1,11 +1,12 @@
package com.hnac.hzims.safeproduct.mapper; package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity;
import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO; import com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.Map; import java.util.Map;
@ -16,7 +17,7 @@ import java.util.Map;
* @date 2023-12-13 * @date 2023-12-13
*/ */
@Mapper @Mapper
public interface RehearsalRecordMapper extends BaseMapper<RehearsalRecordEntity> { public interface RehearsalRecordMapper extends UserDataScopeBaseMapper<RehearsalRecordEntity> {
/** /**
* 查询演练记录表详情 * 查询演练记录表详情
@ -31,5 +32,6 @@ public interface RehearsalRecordMapper extends BaseMapper<RehearsalRecordEntity>
* @param param 参数 * @param param 参数
* @return 演练记录分页 * @return 演练记录分页
*/ */
@UserDataAuth
IPage<RehearsalRecordlVO> getRehearsalRecordPage(IPage<RehearsalRecordlVO> page, Map<String, Object> param); IPage<RehearsalRecordlVO> getRehearsalRecordPage(IPage<RehearsalRecordlVO> page, Map<String, Object> param);
} }

3
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml

@ -17,7 +17,8 @@
<select id="getRehearsalRecordPage" resultType="com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO"> <select id="getRehearsalRecordPage" resultType="com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO">
SELECT SELECT
t1.id, t1.code, t2.unit, t2.subject, t2.scheduled_start_time, t2.scheduled_end_time, t1.people_name, t1.people_num, t1.id, t1.code, t2.unit, t2.subject, t2.scheduled_start_time, t2.scheduled_end_time, t1.people_name, t1.people_num,
t2.location, t1.actual_start_time, t1.actual_end_time, t2.rehearsal_status, t1.record, t1.comment t2.location, t1.actual_start_time, t1.actual_end_time, t2.rehearsal_status, t1.record, t1.comment, t1.create_user,
t1.create_dept
FROM FROM
hzims_rehearsal_record t1 hzims_rehearsal_record t1
LEFT JOIN hzims_rehearsal_plan t2 ON t1.rehearsal_plan_id = t2.id LEFT JOIN hzims_rehearsal_plan t2 ON t1.rehearsal_plan_id = t2.id

3
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.dto.TestDTO;
import com.hnac.hzims.safeproduct.entity.TestEntity; import com.hnac.hzims.safeproduct.entity.TestEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -23,6 +24,7 @@ public interface TestMapper extends BaseMapper<TestEntity> {
* @param trainPlanId 培训计划id * @param trainPlanId 培训计划id
* @return 考试记录名称列表 * @return 考试记录名称列表
*/ */
@UserDataAuth
List<TestDTO> getTestNameList(String trainPlanId); List<TestDTO> getTestNameList(String trainPlanId);
/** /**
@ -31,5 +33,6 @@ public interface TestMapper extends BaseMapper<TestEntity> {
* @param page 分页类 * @param page 分页类
* @return 考试记录数据 * @return 考试记录数据
*/ */
@UserDataAuth
IPage<TestEntity> testPage(IPage<TestEntity> page, Map<String, Object> param); IPage<TestEntity> testPage(IPage<TestEntity> page, Map<String, Object> param);
} }

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml

@ -4,7 +4,7 @@
<select id="getTestNameList" resultType="com.hnac.hzims.safeproduct.dto.TestDTO"> <select id="getTestNameList" resultType="com.hnac.hzims.safeproduct.dto.TestDTO">
SELECT SELECT
id, test_name id, test_name, create_user, create_dept
FROM FROM
hzims_test hzims_test
WHERE WHERE

25
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.TrainMonthVO;
import com.hnac.hzims.safeproduct.vo.TrainYearVO; import com.hnac.hzims.safeproduct.vo.TrainYearVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 培训计划Mapper类 * 培训计划Mapper类
@ -26,6 +28,7 @@ public interface TrainPlanMapper extends BaseMapper<TrainPlanEntity> {
* @param month 月份 * @param month 月份
* @return 当月培训计划总数 * @return 当月培训计划总数
*/ */
@UserDataAuth
IPage<TrainMonthVO> selectByMonth(IPage<TrainMonthVO> page, String unit, String month); IPage<TrainMonthVO> selectByMonth(IPage<TrainMonthVO> page, String unit, String month);
/** /**
@ -35,6 +38,7 @@ public interface TrainPlanMapper extends BaseMapper<TrainPlanEntity> {
* @param month 月份 * @param month 月份
* @return 当月已完成培训计划数 * @return 当月已完成培训计划数
*/ */
@UserDataAuth
IPage<TrainMonthVO> selectFinishedDataByMonth(IPage<TrainMonthVO> page1, String unit, String month); IPage<TrainMonthVO> selectFinishedDataByMonth(IPage<TrainMonthVO> page1, String unit, String month);
/** /**
@ -44,6 +48,7 @@ public interface TrainPlanMapper extends BaseMapper<TrainPlanEntity> {
* @param year 年份 * @param year 年份
* @return 年度单位数据 * @return 年度单位数据
*/ */
@UserDataAuth
IPage<TrainYearVO> selectUnitByYear(IPage<TrainYearVO> page, String unit, String year); IPage<TrainYearVO> selectUnitByYear(IPage<TrainYearVO> page, String unit, String year);
/** /**
@ -52,5 +57,25 @@ public interface TrainPlanMapper extends BaseMapper<TrainPlanEntity> {
* @param year 年份 * @param year 年份
* @return 单位各月的培训计划数 * @return 单位各月的培训计划数
*/ */
@UserDataAuth
List<AnalysisYearDTO> selectFinishedDataByUnit(List<String> unitList, String year); List<AnalysisYearDTO> selectFinishedDataByUnit(List<String> unitList, String year);
/**
* 培训计划分页
* @param param 入参
* @param page 分页类
* @return 培训计划数据
*/
@UserDataAuth
IPage<TrainPlanEntity> trainPlanPage(IPage<TrainPlanEntity> page, Map<String, Object> param);
/**
* 根据单位和计划时间查询培训计划数据
* @param unit 单位
* @param startTime 计划开始时间
* @param endTime 计划结束时间
* @return 培训计划列表
*/
@UserDataAuth
List<TrainPlanEntity> selectListByUnitAndDate(String unit, String startTime, String endTime);
} }

48
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml

@ -4,7 +4,7 @@
<select id="selectByMonth" resultType="com.hnac.hzims.safeproduct.vo.TrainMonthVO"> <select id="selectByMonth" resultType="com.hnac.hzims.safeproduct.vo.TrainMonthVO">
SELECT SELECT
unit, count(1) as scheduled_train_num unit, count(1) as scheduled_train_num, create_user, create_dept
FROM FROM
hzims_train_plan hzims_train_plan
WHERE WHERE
@ -21,7 +21,7 @@
<select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.TrainMonthVO"> <select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.TrainMonthVO">
SELECT SELECT
unit, count(1) as finished_train_num unit, count(1) as finished_train_num, create_user, create_dept
FROM FROM
hzims_train_plan hzims_train_plan
WHERE WHERE
@ -39,7 +39,7 @@
<select id="selectUnitByYear" resultType="com.hnac.hzims.safeproduct.vo.TrainYearVO"> <select id="selectUnitByYear" resultType="com.hnac.hzims.safeproduct.vo.TrainYearVO">
SELECT SELECT
distinct unit distinct unit, create_user, create_dept
FROM FROM
hzims_train_plan hzims_train_plan
WHERE WHERE
@ -54,7 +54,7 @@
<select id="selectFinishedDataByUnit" resultType="com.hnac.hzims.safeproduct.dto.AnalysisYearDTO"> <select id="selectFinishedDataByUnit" resultType="com.hnac.hzims.safeproduct.dto.AnalysisYearDTO">
SELECT 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 FROM
hzims_train_plan hzims_train_plan
WHERE WHERE
@ -70,4 +70,44 @@
ORDER BY ORDER BY
unit unit
</select> </select>
<select id="trainPlanPage" resultType="com.hnac.hzims.safeproduct.entity.TrainPlanEntity">
SELECT
*
FROM
hzims_train_plan
WHERE
is_deleted = 0
<if test="param.unit != null and param.unit != ''">
AND unit like concat('%', #{param.unit}, '%')
</if>
<if test="param.startTime != null and param.startTime != ''">
AND scheduled_start_time >= #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
AND scheduled_end_time &lt;= #{param.endTime}
</if>
ORDER BY
create_time DESC
</select>
<select id="selectListByUnitAndDate" resultType="com.hnac.hzims.safeproduct.entity.TrainPlanEntity">
SELECT
*
FROM
hzims_train_plan
WHERE
is_deleted = 0
<if test="unit != 'null' and unit != ''">
AND unit like concat('%', #{unit}, '%')
</if>
<if test="startTime != 'null' and startTime != ''">
AND scheduled_start_time >= #{startTime}
</if>
<if test="endTime != 'null' and endTime != ''">
AND scheduled_end_time &lt;= #{endTime}
</if>
ORDER BY
create_time DESC
</select>
</mapper> </mapper>

3
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.TrainRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.TrainRecordVO; import com.hnac.hzims.safeproduct.vo.TrainRecordVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -25,6 +26,7 @@ public interface TrainRecordMapper extends BaseMapper<TrainRecordEntity> {
* @param trainPlanId 培训计划id * @param trainPlanId 培训计划id
* @return 培训记录名称列表 * @return 培训记录名称列表
*/ */
@UserDataAuth
List<TrainRecordDTO> getTrainRecordNameList(String trainPlanId); List<TrainRecordDTO> getTrainRecordNameList(String trainPlanId);
/** /**
@ -40,5 +42,6 @@ public interface TrainRecordMapper extends BaseMapper<TrainRecordEntity> {
* @param page 分页类 * @param page 分页类
* @return 培训记录数据 * @return 培训记录数据
*/ */
@UserDataAuth
IPage<TrainRecordVO> trainRecordPage(IPage<TrainRecordVO> page, Map<String, Object> param); IPage<TrainRecordVO> trainRecordPage(IPage<TrainRecordVO> page, Map<String, Object> param);
} }

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml

@ -4,7 +4,7 @@
<select id="getTrainRecordNameList" resultType="com.hnac.hzims.safeproduct.dto.TrainRecordDTO"> <select id="getTrainRecordNameList" resultType="com.hnac.hzims.safeproduct.dto.TrainRecordDTO">
SELECT SELECT
id, train_record_name id, train_record_name, create_user, create_dept
FROM FROM
hzims_train_record hzims_train_record
WHERE WHERE
@ -32,7 +32,7 @@
SELECT SELECT
t1.id, t2.scheduled_start_time, t2.scheduled_end_time, t2.unit, t1.train_record_name, t2.location, t2.train_method, t1.id, t2.scheduled_start_time, t2.scheduled_end_time, t2.unit, t1.train_record_name, t2.location, t2.train_method,
t2.teacher, t2.lesson, t1.actual_start_time, t1.actual_end_time, t2.is_test, t2.train_status, t1.code, t1.content, t2.teacher, t2.lesson, t1.actual_start_time, t1.actual_end_time, t2.is_test, t2.train_status, t1.code, t1.content,
t1.command t1.command, t1.create_user, t1.create_dept
FROM FROM
hzims_train_record t1 hzims_train_record t1
LEFT JOIN hzims_train_plan t2 ON t1.train_plan_id = t2.id LEFT JOIN hzims_train_plan t2 ON t1.train_plan_id = t2.id

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.common.service.UserAuthDataService;
import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO; import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO;
import com.hnac.hzims.safeproduct.dto.RehearsalExportDTO; import com.hnac.hzims.safeproduct.dto.RehearsalExportDTO;
@ -51,6 +52,9 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R
@Autowired @Autowired
IRehearsalRecordService rehearsalRecordService; IRehearsalRecordService rehearsalRecordService;
@Autowired
UserAuthDataService userAuthDataService;
/** /**
* 删除演练计划 * 删除演练计划
*/ */

6
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.common.service.UserAuthDataService;
import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity; import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity;
@ -22,6 +23,8 @@ import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO; import com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.Query; 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.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -41,6 +44,9 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMapper, RehearsalRecordEntity> implements IRehearsalRecordService { public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMapper, RehearsalRecordEntity> implements IRehearsalRecordService {
@Autowired
UserAuthDataService userAuthDataService;
@Resource @Resource
RehearsalPlanMapper rehearsalPlanMapper; RehearsalPlanMapper rehearsalPlanMapper;

11
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.service.ITestScoreService;
import com.hnac.hzims.safeproduct.vo.TestScoreSumVO; import com.hnac.hzims.safeproduct.vo.TestScoreSumVO;
import com.hnac.hzims.safeproduct.vo.TestScoreVO; import com.hnac.hzims.safeproduct.vo.TestScoreVO;
import com.hnac.hzinfo.inspect.ai.entity.RobotTaskEntity;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils; 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.feign.ISysClient;
import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -41,11 +39,12 @@ import java.util.stream.Collectors;
* @date 2023-12-25 * @date 2023-12-25
*/ */
@Service @Service
@RequiredArgsConstructor
@Slf4j @Slf4j
public class TestScoreServiceImpl extends ServiceImpl<TestScoreMapper, TestScoreEntity> implements ITestScoreService { public class TestScoreServiceImpl extends ServiceImpl<TestScoreMapper, TestScoreEntity> implements ITestScoreService {
private final ISysClient sysClient;
private final IUserClient userClient; @Autowired
ISysClient sysClient;
@Resource @Resource
TestMapper testMapper; TestMapper testMapper;

1
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.service.ITestService;
import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.utils.BaseUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;

32
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.converters.longconverter.LongStringConverter;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO; import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO;
import com.hnac.hzims.safeproduct.entity.TrainPlanEntity; import com.hnac.hzims.safeproduct.entity.TrainPlanEntity;
@ -265,21 +263,8 @@ public class TrainPlanServiceImpl extends ServiceImpl<TrainPlanMapper, TrainPlan
*/ */
@Override @Override
public IPage<TrainPlanEntity> trainPlanPage(Map<String, Object> param, Query query) { public IPage<TrainPlanEntity> trainPlanPage(Map<String, Object> param, Query query) {
QueryWrapper<TrainPlanEntity> queryWrapper = new QueryWrapper<>(); IPage<TrainPlanEntity> page = new Page<>(query.getCurrent(), query.getSize());
String unit = String.valueOf(param.get("unit")); return baseMapper.trainPlanPage(page, param);
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);
} }
/** /**
@ -290,17 +275,6 @@ public class TrainPlanServiceImpl extends ServiceImpl<TrainPlanMapper, TrainPlan
* @return 培训计划列表 * @return 培训计划列表
*/ */
public List<TrainPlanEntity> getTrainPlanByUnitAndDate(String unit, String startTime, String endTime) { public List<TrainPlanEntity> getTrainPlanByUnitAndDate(String unit, String startTime, String endTime) {
LambdaQueryWrapper<TrainPlanEntity> queryWrapper = new LambdaQueryWrapper<>(); return baseMapper.selectListByUnitAndDate(unit, startTime, endTime);
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);
} }
} }

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java

@ -78,6 +78,7 @@ public class BaseUtil {
BaseUtil.exportWord(res, wordPath); BaseUtil.exportWord(res, wordPath);
} catch (Exception e) { } catch (Exception e) {
log.error("文件导出异常: {}", e.getMessage()); log.error("文件导出异常: {}", e.getMessage());
e.printStackTrace();
} }
AsposeUtil.wordToPdf(wordPath, pdfPath); AsposeUtil.wordToPdf(wordPath, pdfPath);
BaseUtil.readPdf(response,pdfPath); BaseUtil.readPdf(response,pdfPath);
@ -138,6 +139,7 @@ public class BaseUtil {
JSONObject jsonObject = jsonArray.getJSONObject(i); JSONObject jsonObject = jsonArray.getJSONObject(i);
String name = jsonObject.getString("name"); String name = jsonObject.getString("name");
String url = jsonObject.getString("url"); String url = jsonObject.getString("url");
url = URLEncoder.encode(url, "UTF-8");
String id = paragraph.getDocument().getPackagePart().addExternalRelationship(url, XWPFRelation.HYPERLINK.getRelation()).getId(); String id = paragraph.getDocument().getPackagePart().addExternalRelationship(url, XWPFRelation.HYPERLINK.getRelation()).getId();
CTHyperlink cLink = paragraph.getCTP().addNewHyperlink(); CTHyperlink cLink = paragraph.getCTP().addNewHyperlink();
cLink.setId(id); cLink.setId(id);

BIN
hzims-service/safeproduct/src/main/resources/template/培训记录表.docx

Binary file not shown.
Loading…
Cancel
Save