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. 4
      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. 4
      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);
req.setDisplay(1);
req.setIsRoot(0);
req.setOrderBy("NAME");
req.setOrderBy("STATION,ORD,NAME");
req.setOrderKind("desc");
String result = HttpRequestUtil.postCallObjectParam(req, getNeoFaultTableData, "POST");
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
*/
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);
List<AnalyseDataTaosVO> datas = dataService.periodTargetData(beginTime, endTime,6, 2,instanceCode,signage);
// 开始日期
String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00";
// 结束日期
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)){
return new HashMap<>();
}
@ -1115,8 +1117,8 @@ public class RealTargetServiceImpl implements RealTargetService {
return dateTime.getHours();
},
value -> {
if(StringUtil.isBlank(value.getVal())){
return "0";
if(StringUtil.isEmpty(value.getVal())){
return "";
}
return value.getVal();
})
@ -1379,12 +1381,10 @@ public class RealTargetServiceImpl implements RealTargetService {
* @return
*/
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(calendar.getTime(),DateUtil.PATTERN_DATETIME);
String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00";
// 结束日期
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);
if (CollectionUtil.isEmpty(records)) {
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");
load.setStrHour(DateUtil.format(time,"yyyy-MM-dd HH"));
load.setHour(time.getHours());
load.setActivePower(Optional.ofNullable(record.getVal()).orElse("0"));
if(StringUtil.isNotBlank(record.getVal())){
load.setActivePower(record.getVal());
}
return load;
}).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);
for(int i = 0; i < realIds.size() ;i++){
if(ObjectUtil.isEmpty(objects.get(i))){
log.error(realIds.get(i) + "is null");
// log.error(realIds.get(i) + "is null");
}else{
Map<String,String> attribute = (Map<String, String>) JSONObject.parse(objects.get(i));
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<>();
paramMap.put("startDate", startTime);
paramMap.put("endDate", endTime);
paramMap.put("deptList", deptId);
paramMap.put("deptList", Arrays.asList(deptId));
R<List<WorkTicketInfoEntity>> workTicketInfo = ticketInfoClient.getWorkTicketInfo(paramMap);
if(workTicketInfo.isSuccess()&& cn.hutool.core.util.ObjectUtil.isNotEmpty(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()))
.collect(Collectors.toList());
dutyLogEntity.setWorkCancel(String.valueOf(invalidList.size()));
Integer i=0;
//工作票未执行数量
List<WorkTicketInfoEntity> unExecutedList = ticketInfoData.stream()
.filter(item -> i.equals(item.getImplementStatus()))
.filter(item -> "0".equals(item.getImplementStatus()))
.collect(Collectors.toList());
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;
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.dto.RehearsalExportDTO;
@ -9,6 +8,8 @@ import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO;
import com.hnac.hzims.safeproduct.vo.RehearsalYearVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
@ -19,7 +20,7 @@ import java.util.List;
* @date 2023-12-27
*/
@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 月份
* @return 当月的演练总数据
*/
@UserDataAuth
IPage<RehearsalMonthVO> selectByMonth(IPage<RehearsalMonthVO> page, String unit, String month);
/**
@ -37,6 +39,7 @@ public interface RehearsalPlanMapper extends BaseMapper<RehearsalPlanEntity> {
* @param month 月份
* @return 当月的已完成数据
*/
@UserDataAuth
IPage<RehearsalMonthVO> selectFinishedDataByMonth(IPage<RehearsalMonthVO> page, String unit, String month);
/**
@ -46,6 +49,7 @@ public interface RehearsalPlanMapper extends BaseMapper<RehearsalPlanEntity> {
* @param year 年份
* @return 年度单位数据
*/
@UserDataAuth
IPage<RehearsalYearVO> selectUnitByYear(IPage<RehearsalYearVO> page, String unit, @Param("year") String year);
/**
@ -54,6 +58,7 @@ public interface RehearsalPlanMapper extends BaseMapper<RehearsalPlanEntity> {
* @param year 年份
* @return 单位各月的数据列表
*/
@UserDataAuth
List<AnalysisYearDTO> selectFinishedDataByUnit(@Param("unitList") List<String> unitList, @Param("year") String year);
/**
@ -63,5 +68,6 @@ public interface RehearsalPlanMapper extends BaseMapper<RehearsalPlanEntity> {
* @param endTime 计划结束时间
* @return 演练数据列表
*/
@UserDataAuth
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
unit, count(1) as scheduled_task_num
unit, count(1) as scheduled_task_num, create_user, create_dept
FROM
hzims_rehearsal_plan
WHERE
@ -21,7 +21,7 @@
<select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.RehearsalMonthVO">
SELECT
unit, count(1) as finished_task_num
unit, count(1) as finished_task_num, create_user, create_dept
FROM
hzims_rehearsal_plan
WHERE
@ -39,7 +39,7 @@
<select id="selectUnitByYear" resultType="com.hnac.hzims.safeproduct.vo.RehearsalYearVO">
SELECT
distinct unit
distinct unit, create_user, create_dept
FROM
hzims_rehearsal_plan
WHERE
@ -54,7 +54,7 @@
<select id="selectFinishedDataByUnit" resultType="com.hnac.hzims.safeproduct.dto.AnalysisYearDTO">
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_rehearsal_plan
WHERE
@ -73,7 +73,8 @@
<select id="getRehearsalByUnitAndDate" resultType="com.hnac.hzims.safeproduct.dto.RehearsalExportDTO">
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
hzims_rehearsal_plan
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;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity;
import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.Map;
@ -16,7 +17,7 @@ import java.util.Map;
* @date 2023-12-13
*/
@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 参数
* @return 演练记录分页
*/
@UserDataAuth
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
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
hzims_rehearsal_record t1
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.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<TestEntity> {
* @param trainPlanId 培训计划id
* @return 考试记录名称列表
*/
@UserDataAuth
List<TestDTO> getTestNameList(String trainPlanId);
/**
@ -31,5 +33,6 @@ public interface TestMapper extends BaseMapper<TestEntity> {
* @param page 分页类
* @return 考试记录数据
*/
@UserDataAuth
IPage<TestEntity> testPage(IPage<TestEntity> page, Map<String, Object> param);
}

4
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, test_name
id, test_name, create_user, create_dept
FROM
hzims_test
WHERE
@ -36,6 +36,6 @@
AND test_name like concat('%', #{param.unit}, '%)'
</if>
ORDER BY
create_time DESC
create_time DESC
</select>
</mapper>

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.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<TrainPlanEntity> {
* @param month 月份
* @return 当月培训计划总数
*/
@UserDataAuth
IPage<TrainMonthVO> selectByMonth(IPage<TrainMonthVO> page, String unit, String month);
/**
@ -35,6 +38,7 @@ public interface TrainPlanMapper extends BaseMapper<TrainPlanEntity> {
* @param month 月份
* @return 当月已完成培训计划数
*/
@UserDataAuth
IPage<TrainMonthVO> selectFinishedDataByMonth(IPage<TrainMonthVO> page1, String unit, String month);
/**
@ -44,6 +48,7 @@ public interface TrainPlanMapper extends BaseMapper<TrainPlanEntity> {
* @param year 年份
* @return 年度单位数据
*/
@UserDataAuth
IPage<TrainYearVO> selectUnitByYear(IPage<TrainYearVO> page, String unit, String year);
/**
@ -52,5 +57,25 @@ public interface TrainPlanMapper extends BaseMapper<TrainPlanEntity> {
* @param year 年份
* @return 单位各月的培训计划数
*/
@UserDataAuth
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
unit, count(1) as scheduled_train_num
unit, count(1) as scheduled_train_num, create_user, create_dept
FROM
hzims_train_plan
WHERE
@ -21,7 +21,7 @@
<select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.TrainMonthVO">
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 id="selectUnitByYear" resultType="com.hnac.hzims.safeproduct.vo.TrainYearVO">
SELECT
distinct unit
distinct unit, create_user, create_dept
FROM
hzims_train_plan
WHERE
@ -54,7 +54,7 @@
<select id="selectFinishedDataByUnit" resultType="com.hnac.hzims.safeproduct.dto.AnalysisYearDTO">
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
</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>

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.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<TrainRecordEntity> {
* @param trainPlanId 培训计划id
* @return 培训记录名称列表
*/
@UserDataAuth
List<TrainRecordDTO> getTrainRecordNameList(String trainPlanId);
/**
@ -40,5 +42,6 @@ public interface TrainRecordMapper extends BaseMapper<TrainRecordEntity> {
* @param page 分页类
* @return 培训记录数据
*/
@UserDataAuth
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, train_record_name
id, train_record_name, create_user, create_dept
FROM
hzims_train_record
WHERE
@ -32,7 +32,7 @@
SELECT
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,
t1.command
t1.command, t1.create_user, t1.create_dept
FROM
hzims_train_record t1
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.extension.plugins.pagination.Page;
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.safeproduct.dto.AnalysisYearDTO;
import com.hnac.hzims.safeproduct.dto.RehearsalExportDTO;
@ -51,6 +52,9 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R
@Autowired
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.service.impl.ServiceImpl;
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.entity.RehearsalPlanEntity;
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 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;
import org.springframework.transaction.annotation.Transactional;
@ -41,6 +44,9 @@ import java.util.stream.Collectors;
@Slf4j
public class RehearsalRecordServiceImpl extends ServiceImpl<RehearsalRecordMapper, RehearsalRecordEntity> implements IRehearsalRecordService {
@Autowired
UserAuthDataService userAuthDataService;
@Resource
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.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<TestScoreMapper, TestScoreEntity> implements ITestScoreService {
private final ISysClient sysClient;
private final IUserClient userClient;
@Autowired
ISysClient sysClient;
@Resource
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.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;

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.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<TrainPlanMapper, TrainPlan
*/
@Override
public IPage<TrainPlanEntity> trainPlanPage(Map<String, Object> param, Query query) {
QueryWrapper<TrainPlanEntity> 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<TrainPlanEntity> page = new Page<>(query.getCurrent(), query.getSize());
return baseMapper.trainPlanPage(page, param);
}
/**
@ -290,17 +275,6 @@ public class TrainPlanServiceImpl extends ServiceImpl<TrainPlanMapper, TrainPlan
* @return 培训计划列表
*/
public List<TrainPlanEntity> getTrainPlanByUnitAndDate(String unit, String startTime, String endTime) {
LambdaQueryWrapper<TrainPlanEntity> 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);
}
}

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

@ -78,6 +78,7 @@ public class BaseUtil {
BaseUtil.exportWord(res, wordPath);
} catch (Exception e) {
log.error("文件导出异常: {}", e.getMessage());
e.printStackTrace();
}
AsposeUtil.wordToPdf(wordPath, pdfPath);
BaseUtil.readPdf(response,pdfPath);
@ -138,6 +139,7 @@ public class BaseUtil {
JSONObject jsonObject = jsonArray.getJSONObject(i);
String name = jsonObject.getString("name");
String url = jsonObject.getString("url");
url = URLEncoder.encode(url, "UTF-8");
String id = paragraph.getDocument().getPackagePart().addExternalRelationship(url, XWPFRelation.HYPERLINK.getRelation()).getId();
CTHyperlink cLink = paragraph.getCTP().addNewHyperlink();
cLink.setId(id);
@ -146,7 +148,7 @@ public class BaseUtil {
CTR ctr = CTR.Factory.newInstance();
ctr.setTArray(new CTText[]{ctText});
cLink.setRArray(new CTR[]{ctr});
if(i<jsonArray.length()-1) {
if (i<jsonArray.length()-1) {
paragraph.createRun().addBreak();
}
}

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

Binary file not shown.
Loading…
Cancel
Save