Commit 35ee00c5 authored by tianbo's avatar tianbo

检查报告接口修改

parent 3ffa5dbf
package com.yeejoin.amos.supervision.core.common.dto; package com.yeejoin.amos.supervision.core.common.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -22,9 +23,11 @@ public class CheckReportParamDto implements Serializable { ...@@ -22,9 +23,11 @@ public class CheckReportParamDto implements Serializable {
String checkLevel; String checkLevel;
@ApiModelProperty(value = "检查开始时间") @ApiModelProperty(value = "检查开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
Date startCheckTime; Date startCheckTime;
@ApiModelProperty(value = "检查结束时间") @ApiModelProperty(value = "检查结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
Date endCheckTime; Date endCheckTime;
@ApiModelProperty(value = "检查执行人") @ApiModelProperty(value = "检查执行人")
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.supervision.business.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.supervision.business.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.supervision.business.feign.DangerFeignClient; import com.yeejoin.amos.supervision.business.feign.DangerFeignClient;
import com.yeejoin.amos.supervision.business.service.intfc.ICheckReportService; import com.yeejoin.amos.supervision.business.service.intfc.ICheckReportService;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportParamDto; import com.yeejoin.amos.supervision.core.common.dto.CheckReportParamDto;
...@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -24,6 +26,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -24,6 +26,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.text.ParseException; import java.text.ParseException;
import java.util.Date;
@RestController @RestController
@RequestMapping(value = "/check/report") @RequestMapping(value = "/check/report")
...@@ -46,14 +49,32 @@ public class CheckReportController extends BaseController { ...@@ -46,14 +49,32 @@ public class CheckReportController extends BaseController {
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "分页查询检查报告", notes = "分页查询检查报告") @ApiOperation(value = "分页查询检查报告", notes = "分页查询检查报告")
@PostMapping(value = "/page") @GetMapping(value = "/page")
public ResponseModel queryPage(@RequestParam int current, @RequestParam int size, public ResponseModel queryPage(@RequestParam int current, @RequestParam int size,
@RequestBody(required = false) CheckReportParamDto queryParam) { @RequestParam(required = false) String name,
@RequestParam(required = false) String planName,
@RequestParam(required = false) String planCheckType,
@RequestParam(required = false) String checkLevel,
@RequestParam(required = false) String startCheckTime,
@RequestParam(required = false) String endCheckTime,
@RequestParam(required = false) String checkUser) throws ParseException {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams); String loginOrgCode = getOrgCode(reginParams);
if (loginOrgCode.contains("-")) { if (loginOrgCode.contains("-")) {
loginOrgCode = loginOrgCode.substring(0, loginOrgCode.indexOf("-")); loginOrgCode = loginOrgCode.substring(0, loginOrgCode.indexOf("-"));
} }
CheckReportParamDto queryParam = new CheckReportParamDto();
queryParam.setName(name);
queryParam.setPlanName(planName);
queryParam.setPlanCheckType(planCheckType);
queryParam.setCheckLevel(checkLevel);
if (!ValidationUtil.isEmpty(startCheckTime)) {
queryParam.setStartCheckTime(DateUtils.dateParse(startCheckTime, DateUtils.DATE_TIME_PATTERN));
}
if (!ValidationUtil.isEmpty(endCheckTime)) {
queryParam.setEndCheckTime(DateUtils.dateParse(endCheckTime, DateUtils.DATE_TIME_PATTERN));
}
queryParam.setCheckUser(checkUser);
queryParam.setOrgCode(loginOrgCode); queryParam.setOrgCode(loginOrgCode);
Page page = new Page<>(current, size); Page page = new Page<>(current, size);
return ResponseHelper.buildResponse(iCheckReportService.pageList(page, queryParam)); return ResponseHelper.buildResponse(iCheckReportService.pageList(page, queryParam));
......
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
<if test="queryParam != null and queryParam.checkLevel != null and queryParam.checkLevel != ''"> <if test="queryParam != null and queryParam.checkLevel != null and queryParam.checkLevel != ''">
and p.check_level = #{queryParam.checkLevel} and p.check_level = #{queryParam.checkLevel}
</if> </if>
<if test="queryParam != null and queryParam.startCheckTime != null and queryParam.startCheckTime != ''"> <if test="queryParam != null and queryParam.startCheckTime != null">
and cr.start_check_date <![CDATA[>=]]> #{queryParam.startCheckTime} and cr.start_check_date <![CDATA[>=]]> #{queryParam.startCheckTime}
</if> </if>
<if test="queryParam != null and queryParam.endCheckTime != null and queryParam.endCheckTime != ''"> <if test="queryParam != null and queryParam.endCheckTime != null">
and cr.end_check_date <![CDATA[<=]]> #{queryParam.endCheckTime} and cr.end_check_date <![CDATA[<=]]> #{queryParam.endCheckTime}
</if> </if>
<if test="queryParam != null and queryParam.checkUser != null and queryParam.checkUser != ''"> <if test="queryParam != null and queryParam.checkUser != null and queryParam.checkUser != ''">
......
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