Commit 6a44ae04 authored by xinglei's avatar xinglei

*)新增更新巡检检查项接口

parent 8050892c
......@@ -12,12 +12,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
......@@ -307,4 +302,11 @@ public class LatentDangerController extends AbstractBaseController {
public CommonResponse getPatrolDangerInfo(@RequestBody(required = false) JSONObject param) {
return CommonResponseUtil.success(iLatentDangerService.getPatrolDangerInfo(param));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "修改巡检检查项", notes = "修改巡检检查项")
@PutMapping(value = "/patrol/danger/check")
public CommonResponse getPatrolDangerCheck(@RequestBody(required = false) JSONObject param) {
return CommonResponseUtil.success(iLatentDangerService.getPatrolDangerCheck(param));
}
}
package com.yeejoin.amos.supervision.business.dao.mapper;
import com.yeejoin.amos.supervision.business.dto.CheckInputDto;
import com.yeejoin.amos.supervision.business.dto.InputCheckDto;
import org.apache.ibatis.annotations.Param;
......@@ -9,4 +10,6 @@ public interface CheckInputMapper extends BaseMapper {
InputCheckDto getByCheckIdAndItemIdAndRoutePointItemId(@Param(value = "checkId") Long checkId, @Param(value =
"itemId") Long itemId, @Param(value = "routePointItemId") Long routePointItemId, @Param(value = "checkInputId") Long checkInputId);
void updateCheckInput(@Param(value = "dto") CheckInputDto checkInputDto);
}
package com.yeejoin.amos.supervision.business.dto;
import lombok.Data;
/**
* @Author: xl
* @Description:
* @Date: 2021/9/23 15:01
*/
@Data
public class CheckInputDto {
private Long id;
private Integer dangerHandleState;
private Integer safetyDangerNum;
private Integer majorDangerNum;
}
......@@ -17,6 +17,7 @@ import com.yeejoin.amos.supervision.business.dao.repository.ICheckDao;
import com.yeejoin.amos.supervision.business.dao.repository.ICheckShotDao;
import com.yeejoin.amos.supervision.business.dao.repository.IInputItemDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPointClassifyDao;
import com.yeejoin.amos.supervision.business.dto.CheckInputDto;
import com.yeejoin.amos.supervision.business.dto.DangerExecuteSubmitDto;
import com.yeejoin.amos.supervision.business.dto.InputCheckDto;
import com.yeejoin.amos.supervision.business.entity.mybatis.DangerResultBo;
......@@ -1660,6 +1661,15 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
return result;
}
@Override
public JSONObject getPatrolDangerCheck(JSONObject param) {
Long checkInputId = param.getLong("id");
Assert.notNull(checkInputId, "检查项ID不能为空");
CheckInputDto checkInputDto = JSON.parseObject(JSON.toJSONString(param), CheckInputDto.class);
checkInputMapper.updateCheckInput(checkInputDto);
return null;
}
private Check getCheck(Long checkId) {
Assert.notNull(checkId, "巡检ID不能为空!");
Check check = iCheckDao.getById(Long.valueOf(checkId));
......
......@@ -89,4 +89,12 @@ public interface ILatentDangerService {
* @return
*/
JSONObject getPatrolDangerInfo(JSONObject param);
/**
* 根据参数修改巡检检查项
*
* @param param
* @return
*/
JSONObject getPatrolDangerCheck(JSONObject param);
}
......@@ -57,4 +57,14 @@
</where>
limit 1
</select>
<update id="updateCheckInput" parameterType="com.yeejoin.amos.supervision.business.dto.CheckInputDto">
update p_check_input
<trim prefix="SET" suffixOverrides=",">
<if test="dto.dangerHandleState != null">danger_handle_state = #{dto.dangerHandleState},</if>
<if test="dto.safetyDangerNum != null">safety_danger_num = #{dto.safetyDangerNum},</if>
<if test="dto.majorDangerNum != null">major_danger_num = #{dto.majorDangerNum},</if>
</trim>
where id = #{dto.id}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment