|
|
@ -19,15 +19,11 @@ package com.epmet.controller; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.ExcelUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.validator.AssertUtils; |
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.epmet.commons.tools.validator.group.AddGroup; |
|
|
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|
|
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|
|
|
import com.epmet.constant.IcResiCategoryStatsConfigConstant; |
|
|
|
import com.epmet.dao.IcResiCategoryStatsConfigDao; |
|
|
@ -36,22 +32,20 @@ import com.epmet.dto.IcResiCategoryStatsConfigDTO; |
|
|
|
import com.epmet.dto.IcResiCategoryWarnConfigDTO; |
|
|
|
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; |
|
|
|
import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; |
|
|
|
import com.epmet.dto.form.UpGovRoleFormDTO; |
|
|
|
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; |
|
|
|
import com.epmet.entity.IcResiCategoryStatsConfigEntity; |
|
|
|
import com.epmet.entity.IcResiCategoryWarnConfigEntity; |
|
|
|
import com.epmet.excel.IcResiCategoryStatsConfigExcel; |
|
|
|
import com.epmet.service.IcResiCategoryStatsConfigService; |
|
|
|
import com.epmet.service.ResiCategoryStatsConfigService; |
|
|
|
import com.github.pagehelper.util.StringUtil; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
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.RestController; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
@ -63,7 +57,7 @@ import java.util.Map; |
|
|
|
@RestController |
|
|
|
@RequestMapping("resicategorystatsconfig") |
|
|
|
public class ResiCategoryStatsConfigController { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService; |
|
|
|
@Autowired |
|
|
@ -96,13 +90,13 @@ public class ResiCategoryStatsConfigController { |
|
|
|
if(IcResiCategoryStatsConfigConstant.WARN_YES.equals(formDTO.getWarn())){ |
|
|
|
//判断level1 和level2 的值
|
|
|
|
if(null ==level1 || level1==0){ |
|
|
|
return new Result().error(8001,"等级1阈值需大于0"); |
|
|
|
return new Result().error(EpmetErrorCode.OPERATION_FAILED.getCode(),"黄色预警阈值需大于0"); |
|
|
|
} |
|
|
|
if(null == level2 || level2==0){ |
|
|
|
return new Result().error(8001,"等级2阈值需大于0"); |
|
|
|
return new Result().error(EpmetErrorCode.OPERATION_FAILED.getCode(),"红色预警阈值需大于0"); |
|
|
|
} |
|
|
|
if(level2<=level1){ |
|
|
|
return new Result().error(8001,"等级2阈值需大于等级1阈值"); |
|
|
|
return new Result().error(EpmetErrorCode.OPERATION_FAILED.getCode(),"黄色预警阈值需大于红色预警阈值"); |
|
|
|
} |
|
|
|
} |
|
|
|
resiCategoryStatsConfigService.update(customerId,formDTO); |
|
|
@ -170,4 +164,4 @@ public class ResiCategoryStatsConfigController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|