修改后保证各区域,各车系预测占比的百分比之和要等于100%。
区域分为北区,南区,中区
求支援
实现层代码
@Override
public void updateDtoById(TcWsCrFctRgnQuotaRatioDTO tcWsCrFctRgnQuotaRatioDTO) {
TcWsCrFctRgnQuotaRatioPO tcWsCrFctRgnQuotaRatioPO = tcWsCrFctRgnQuotaRatioMapper.selectById(tcWsCrFctRgnQuotaRatioDTO.getConfigId());
//TODO 修改需要根据页面元素,手动set需要修改的属性
tcWsCrFctRgnQuotaRatioPO.setRatio(tcWsCrFctRgnQuotaRatioDTO.getRatio());
int deleteCount = tcWsCrFctRgnQuotaRatioMapper.updateById(tcWsCrFctRgnQuotaRatioPO);
if (deleteCount <= 0) {
throw new ServiceBizException("修改失败,没有符合条件的数据");
}
}
实体类
private static final long serialVersionUID = 1L;
/**
* 配置id
*/
private Long configId;
/**
* 品牌代码
*/
@TableField("brand_code")
private String brandCode;
/**
* 车系代码
*/
@TableField("series_code")
private String seriesCode;
/**
* 区域代码
*/
@TableField("region_code")
private String regionCode;
/**
* 百分比
*/
@TableField("ratio")
private String ratio;