@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.tuoheng.common.core.common.BaseEntity; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
import lombok.ToString; | |||
import lombok.experimental.Accessors; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
@@ -22,6 +23,7 @@ import java.util.Date; | |||
@EqualsAndHashCode(callSuper = true) | |||
@Accessors(chain = true) | |||
@TableName("th_inspection") | |||
@ToString(callSuper = true) | |||
public class Inspection extends BaseEntity { | |||
private static final long serialVersionUID = 1L; |
@@ -47,7 +47,9 @@ public interface InspectionMapper extends BaseMapper<Inspection> { | |||
* @param inspection 巡检任务 | |||
* @return 结果 | |||
*/ | |||
int update(Inspection inspection); | |||
int update(Inspection inspection); | |||
int updateStatus(Inspection inspection); | |||
int updateByPrimaryKeySelective(Inspection request); | |||
@@ -31,14 +31,14 @@ public class QueryWorkOrderPageListRequest extends BaseQuery { | |||
/** | |||
* 工单生成开始时间 | |||
*/ | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date beginTime; | |||
/** | |||
* 工单生成结束时间 | |||
*/ | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
private Date endTime; | |||
@@ -53,7 +53,6 @@ public class UpdateFlightStatusService { | |||
Inspection inspectionUpdate = new Inspection(); | |||
inspectionUpdate.setId(inspection.getId()); | |||
JsonResult result = startAI(missionStatusRequest); | |||
if (0 != result.getCode()) { | |||
//如果调用DSP失败就直接失败! | |||
log.info("修改任务状态业务接口:调用DSP数据失败:{}", result.getMsg()); | |||
@@ -66,13 +65,14 @@ public class UpdateFlightStatusService { | |||
log.info("dsp响应体:{}", JacksonUtil.obj2StringPretty(dspCallbackVo)); | |||
log.info("修改inspection status 开始"); | |||
log.info("inspectionUpdate id : {}", inspectionUpdate.getId()); | |||
log.info("inspectionUpdate status", InspectionStatusEnum.IN_FLIGHT.getCode()); | |||
inspectionUpdate.setStatus(InspectionStatusEnum.IN_FLIGHT.getCode()); | |||
log.info("修改inspection:{}", inspectionUpdate); | |||
Integer count = inspectionMapper.updateById(inspectionUpdate); | |||
inspectionUpdate.setUpdateTime(DateUtils.now()); | |||
log.info("inspectionUpdate:{}", inspectionUpdate); | |||
Integer count = inspectionMapper.updateStatus(inspectionUpdate); | |||
if (count <= 0) { | |||
log.info("修改inspection status 失败"); | |||
} else { | |||
log.info("修改inspection status 成功"); | |||
} | |||
log.info("修改inspection status 结束"); | |||
@@ -78,6 +78,7 @@ public class UpdateInspectionStatusService { | |||
.eq(Inspection::getId, missionStatusRequest.getRequestId()) | |||
.eq(Inspection::getInspectionLine, missionStatusRequest.getId())); | |||
if (ObjectUtil.isEmpty(inspection)) { | |||
log.info("任务不存在"); | |||
return JsonResult.error(EditInspectionStatusCodeEnum.INSPECTION_IS_NOT_EXIST.getCode(), EditInspectionStatusCodeEnum.INSPECTION_IS_NOT_EXIST.getMsg()); | |||
} | |||
return JsonResult.success(inspection); |
@@ -354,7 +354,7 @@ public class GenerateReportWordService { | |||
} else { | |||
imageTileCell = this.getCell(font, "处理图片" + (i+1)); | |||
} | |||
imageUrl = CommonConfig.imageURL + list.get(i); | |||
imageUrl = list.get(i); | |||
Cell imageCell = this.getImageCell(imageUrl); | |||
table.addCell(imageTileCell); | |||
table.addCell(imageCell); |
@@ -188,6 +188,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
where id = #{id} | |||
</update> | |||
<update id="updateStatus" parameterType="com.tuoheng.admin.entity.Inspection"> | |||
update th_inspection | |||
<trim prefix="SET" suffixOverrides=","> | |||
<if test="status != null"> status = #{status}, </if> | |||
<if test="updateUser != null and updateUser != ''"> update_user = #{updateUser},</if> | |||
<if test="updateTime != null and updateTime != ''"> update_time = #{updateTime},</if> | |||
</trim> | |||
where id = #{id} | |||
</update> | |||
<update id="updateByPrimaryKeySelective" parameterType="com.tuoheng.admin.entity.Inspection"> | |||
update th_inspection | |||
<set> |
@@ -48,18 +48,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
<if test="1 == 1"> and mark = 1 </if> | |||
<if test="request.code != null and request.code != 0"> and code = #{request.code} </if> | |||
<if test="request.status != null and request.status != ''"> and status = #{request.status} </if> | |||
<if test="request.userDeptId != null and request.userDeptId != ''"> and assign_dept_id = #{request.userDeptId} </if> | |||
<if test="request.deptIdList != null and request.deptIdList.size() > 0"> | |||
or dept_id in | |||
<foreach item="deptId" collection="request.deptIdList" open="(" separator="," close=")"> | |||
#{deptId} | |||
</foreach> | |||
<if test="(request.userDeptId != null and request.userDeptId != '') or (request.deptIdList != null and request.deptIdList.size() > 0)"> | |||
and ( | |||
<trim prefixOverrides="or"> | |||
<if test="(request.userDeptId != null and request.userDeptId != '')"> | |||
or assign_dept_id = #{request.userDeptId} | |||
</if> | |||
<if test="request.deptIdList != null and request.deptIdList.size() > 0"> | |||
or dept_id in | |||
<foreach item="deptId" collection="request.deptIdList" open="(" separator="," close=")"> | |||
#{deptId} | |||
</foreach> | |||
</if> | |||
</trim> | |||
) | |||
</if> | |||
<if test="request.beginTime != null"> | |||
and check_time >= #{request.beginTime} | |||
and create_time >= #{request.beginTime} | |||
</if> | |||
<if test="request.endTime != null"> | |||
and check_time <= #{request.endTime} | |||
and create_time <= #{request.endTime} | |||
</if> | |||
</where> | |||
order by create_time desc |