Browse Source

修改居民配置类别提醒

master
lzh 4 years ago
parent
commit
b8fc9bc716
  1. 5
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java
  2. 20
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java
  3. 4
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java

5
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java

@ -53,13 +53,13 @@ public class IcResiCategoryStatsConfigFormDTO implements Serializable {
/** /**
* 数据平台分类图标 * 数据平台分类图标
*/ */
@NotBlank(message = "管理平台分类图标不能为空",groups = {UpdateGroup.class}) @NotBlank(message = "数据平台分类图标不能为空",groups = {UpdateGroup.class})
private String dataIcon; private String dataIcon;
/** /**
* 房屋显示分类图标 * 房屋显示分类图标
*/ */
@NotBlank(message = "管理平台分类图标不能为空",groups = {UpdateGroup.class}) @NotBlank(message = "房屋显示分类图标不能为空",groups = {UpdateGroup.class})
private String houseShowIcon; private String houseShowIcon;
/** /**
@ -72,7 +72,6 @@ public class IcResiCategoryStatsConfigFormDTO implements Serializable {
private String warn; private String warn;
private Integer level1; private Integer level1;
private Integer level2; private Integer level2;
private Integer level3; private Integer level3;

20
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java

@ -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){

4
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java

@ -103,7 +103,7 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
entity.setDataIcon(""); entity.setDataIcon("");
entity.setHouseShowIcon(""); entity.setHouseShowIcon("");
entity.setStatus("show"); entity.setStatus("show");
entity.setSort(0); entity.setSort(icFormItemEntity.getSort());
newStatsEntityList.add(entity); newStatsEntityList.add(entity);
}); });
if(!CollectionUtils.isEmpty(newStatsEntityList)){ if(!CollectionUtils.isEmpty(newStatsEntityList)){
@ -205,8 +205,6 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
//更新配置预警 //更新配置预警
if(IcResiCategoryStatsConfigConstant.WARN_YES.equals(formDTO.getWarn())){ if(IcResiCategoryStatsConfigConstant.WARN_YES.equals(formDTO.getWarn())){
//TODO 判断阈值范围
//更新 //更新
IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda() IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName()) .eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName())

Loading…
Cancel
Save