| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.connection.ReactiveListCommands; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | throw new RuntimeException("整改信息保存失败"); |
| | | } |
| | | return ApiResult.success("隐患整改保存成功"); |
| | | } catch (Exception e) { |
| | | return ApiResult.error("异常"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 整改延期--保存 |
| | | */ |
| | | public ApiResult rectifyTimeOutSave(String str, ApiRequestHeader header) { |
| | | //验证userId,loginName,token,deviceType,deviceId,appType 是否一致 |
| | | ApiRequestHeader requestHeader = getHeader(header); |
| | | if (!(header.equals(requestHeader))) { |
| | | return ApiResult.errorToken("验证userId,loginName,token,deviceType,deviceId,appType 不一致"); |
| | | } |
| | | try { |
| | | HiddenDangerCheckPoint hdcp = new ObjectMapper().readValue(str, HiddenDangerCheckPoint.class); |
| | | hdcp.setUpdateBy(header.loginName); |
| | | hdcp.setUpdateTime(DateUtils.getNowDate()); |
| | | |
| | | int result = hdcpService.rectifyTimeOut(hdcp.getId(), hdcp.getRectifyDeadlineTime()); |
| | | if (result < 1) { |
| | | return ApiResult.error("延期失败"); |
| | | } |
| | | |
| | | return ApiResult.success("延期成功"); |
| | | } catch (Exception e) { |
| | | return ApiResult.error("异常"); |
| | | } |
| | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | } |