@ -29,6 +29,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup ;
import com.epmet.commons.tools.validator.group.AddGroup ;
import com.epmet.commons.tools.validator.group.DefaultGroup ;
import com.epmet.commons.tools.validator.group.DefaultGroup ;
import com.epmet.commons.tools.validator.group.UpdateGroup ;
import com.epmet.commons.tools.validator.group.UpdateGroup ;
import com.epmet.constant.IcResiCategoryStatsConfigConstant ;
import com.epmet.dao.IcResiCategoryStatsConfigDao ;
import com.epmet.dao.IcResiCategoryStatsConfigDao ;
import com.epmet.dao.IcResiCategoryWarnConfigDao ;
import com.epmet.dao.IcResiCategoryWarnConfigDao ;
import com.epmet.dto.IcResiCategoryStatsConfigDTO ;
import com.epmet.dto.IcResiCategoryStatsConfigDTO ;
@ -89,8 +90,23 @@ public class ResiCategoryStatsConfigController {
ValidatorUtils . validateEntity ( formDTO , UpdateGroup . class ) ;
ValidatorUtils . validateEntity ( formDTO , UpdateGroup . class ) ;
String customerId = tokenDTO . getCustomerId ( ) ;
String customerId = tokenDTO . getCustomerId ( ) ;
// String customerId = "123123";
// String customerId = "123123";
Integer level1 = formDTO . getLevel1 ( ) ;
Integer level2 = formDTO . getLevel2 ( ) ;
Integer level3 = formDTO . getLevel3 ( ) ;
if ( IcResiCategoryStatsConfigConstant . WARN_YES . equals ( formDTO . getWarn ( ) ) ) {
//判断level1 和level2 的值
if ( null = = level1 | | level1 = = 0 ) {
return new Result ( ) . error ( 8001 , "等级1阈值需大于0" ) ;
}
if ( null = = level2 | | level2 = = 0 ) {
return new Result ( ) . error ( 8001 , "等级2阈值需大于0" ) ;
}
if ( level1 < = level2 ) {
return new Result ( ) . error ( 8001 , "等级1阈值需大于等级2阈值" ) ;
}
}
resiCategoryStatsConfigService . update ( customerId , formDTO ) ;
resiCategoryStatsConfigService . update ( customerId , formDTO ) ;
return new Result ( ) ;
return new Result ( ) . ok ( "修改成功" ) ;
}
}
@PostMapping ( "updatestatus" )
@PostMapping ( "updatestatus" )
public Result updateStatus ( @LoginUser TokenDto tokenDTO , @RequestBody IcResiCategoryStatsConfigFormDTO formDTO ) {
public Result updateStatus ( @LoginUser TokenDto tokenDTO , @RequestBody IcResiCategoryStatsConfigFormDTO formDTO ) {
@ -98,7 +114,7 @@ public class ResiCategoryStatsConfigController {
String customerId = tokenDTO . getCustomerId ( ) ;
String customerId = tokenDTO . getCustomerId ( ) ;
// String customerId = "123123";
// String customerId = "123123";
resiCategoryStatsConfigService . updateStatus ( customerId , formDTO ) ;
resiCategoryStatsConfigService . updateStatus ( customerId , formDTO ) ;
return new Result ( ) ;
return new Result ( ) . ok ( "修改成功" ) ;
}
}
@PostMapping ( "updatesort" )
@PostMapping ( "updatesort" )
public Result updateSort ( @LoginUser TokenDto tokenDTO , @RequestBody List < IcResiCategoryStatsConfigSortFormDTO > formDTOs ) {
public Result updateSort ( @LoginUser TokenDto tokenDTO , @RequestBody List < IcResiCategoryStatsConfigSortFormDTO > formDTOs ) {