Browse Source

Merge branch 'release' of gitadmin/tuoheng_hhz into master

master
xuziqing 9 months ago
parent
commit
f227ad153a
3 changed files with 52 additions and 39 deletions
  1. +6
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionFileServiceImpl.java
  2. +31
    -32
      tuoheng-admin/src/main/resources/mapper/ReportPatrolMapper.xml
  3. +15
    -6
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/TaskServiceImpl.java

+ 6
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionFileServiceImpl.java View File

@@ -84,6 +84,8 @@ public class ThInspectionFileServiceImpl implements IThInspectionFileService {
*/
@Resource
private ThInspectionMapper thInspectionMapper;
@Autowired
private InspectionMapper inspectionMapper;
/**
* 注入 巡检任务工单Mapper
*/
@@ -769,7 +771,10 @@ public class ThInspectionFileServiceImpl implements IThInspectionFileService {
thInspectionQuestion.setStatus(3);
thInspectionQuestion.setWorkCompleteTime(null);
thInspectionQuestionMapper.updateByPrimaryKey(thInspectionQuestion);

Inspection inspection = inspectionMapper.selectById(thInspectionQuestion.getInspectionId());
//报告待生成
inspection.setStatus(35);
inspectionMapper.updateById(inspection);
} else {
status = 2;
}

+ 31
- 32
tuoheng-admin/src/main/resources/mapper/ReportPatrolMapper.xml View File

@@ -2,36 +2,35 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tuoheng.admin.mapper.ReportPatrolMapper">

<select id="selectPageNew" resultType="com.tuoheng.admin.entity.vo.ReportPatrolVo">
select
tsr.id,
tsr.report_no reportNo,
tsr.inspection_id inspectionId,
tsr.inspection_code inspectionCode,
tsr.inspection_name inspectionName,
tsr.stream_id streamId,
tsr.stream_name streamName,
tsr.stream_area streamArea,
tsr.stream_length streamLength,
tsr.stream_location streamLocation,
tsr.weather,
tsr.flight_hand flightHand,
tsr.flight_hand_name flightHandName,
tsr.inspection_way inspectionWay,
tsr.inspection_device inspectionDevice,
tsr.inspection_time inspectionTime,
tsr.flight_height flightHeight,
tsr.inspection_type inspectionType,
tsr.create_user createUser,
tsr.create_time createTime,
tsr.update_user updateUser,
tsr.update_time updateTime,
tsr.mark,
tr.id patrolId
from
th_stream_report tsr
left join th_report tr on
tsr.inspection_id = tr.inspection_id
${ew.customSqlSegment}
</select>
<select id="selectPageNew" resultType="com.tuoheng.admin.entity.vo.ReportPatrolVo">
select tsr.id,
tsr.report_no reportNo,
tsr.inspection_id inspectionId,
tsr.inspection_code inspectionCode,
tsr.inspection_name inspectionName,
tsr.stream_id streamId,
tsr.stream_name streamName,
tsr.stream_area streamArea,
tsr.stream_length streamLength,
tsr.stream_location streamLocation,
tsr.weather,
tsr.flight_hand flightHand,
tsr.flight_hand_name flightHandName,
tsr.inspection_way inspectionWay,
tsr.inspection_device inspectionDevice,
tsr.inspection_time inspectionTime,
tsr.flight_height flightHeight,
tsr.inspection_type inspectionType,
tsr.create_user createUser,
tsr.create_time createTime,
tsr.update_user updateUser,
tsr.update_time updateTime,
tsr.mark,
tr.id patrolId
from th_stream_report tsr
left join th_report tr on
tsr.inspection_id = tr.inspection_id
and tr.mark = 1
${ew.customSqlSegment}
</select>
</mapper>

+ 15
- 6
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/TaskServiceImpl.java View File

@@ -241,18 +241,18 @@ public class TaskServiceImpl implements ITaskService {
.eq(InspectionFile::getInspectionId, record.getInspectionId())
.eq(InspectionFile::getMark, 1));

if(null != record.getWorkCreateTime()){
if (null != record.getWorkCreateTime()) {
ArrayList<Long> leaveTimeList = new ArrayList<>();
if(StringUtils.isNotEmpty(inspectionFileList)){
if (StringUtils.isNotEmpty(inspectionFileList)) {
for (InspectionFile inspectionFile : inspectionFileList) {
ThQuestionType thQuestionType = questionTypeMapper.selectById(inspectionFile.getQuestionTypeId());

if(ObjectUtils.isNotNull(thQuestionType)){
if (ObjectUtils.isNotNull(thQuestionType)) {
long leaveTimeLong = getLeaveTimeLong(record.getWorkCreateTime(), thQuestionType.getRectification());
leaveTimeList.add(leaveTimeLong);
}
}
if(StringUtils.isNotEmpty(leaveTimeList)){
if (StringUtils.isNotEmpty(leaveTimeList)) {
String leaveTimeStr = getLeaveTimeStr(Collections.max(leaveTimeList));
record.setLeaveTime(leaveTimeStr);
}
@@ -931,6 +931,15 @@ public class TaskServiceImpl implements ITaskService {
inspectionQuestionUpdateWrapper.set(ThInspectionQuestion::getWorkCompleteTime, DateUtils.now());
inspectionQuestionMapper.update(null, inspectionQuestionUpdateWrapper);
// 问题处理完成,生成巡检报告
Report report = reportMapper.selectOne(Wrappers.<Report>lambdaQuery()
.eq(BaseEntity::getMark, 1)
.eq(Report::getTenantId, tenantId)
.eq(Report::getInspectionId, inspection.getId()));

if (StringUtils.isNotNull(report)) {
report.setMark(0);
reportMapper.updateById(report);
}
generatePatrolReport(inspectionQuestionItem.getInspectionId());
} else {
Inspection inspectionQuery = inspectionMapper.selectById(inspectionQuestionItem.getInspectionId());
@@ -1126,7 +1135,7 @@ public class TaskServiceImpl implements ITaskService {
return thDspServiceInst.getDspServiceInstId();
}

private long getLeaveTimeLong(Date beginTime, Integer rectification){
private long getLeaveTimeLong(Date beginTime, Integer rectification) {
//进行时间计算
DateTime nowTime = DateUtil.date();
long leaveTime = 0L;
@@ -1143,7 +1152,7 @@ public class TaskServiceImpl implements ITaskService {
return leaveTime;
}

private String getLeaveTimeStr(long between){
private String getLeaveTimeStr(long between) {
//进行时间计算
DateTime nowTime = DateUtil.date();
String leaveTime = "";

Loading…
Cancel
Save