|
|
@@ -1,6 +1,7 @@ |
|
|
|
package com.ningdatech.pmapi.dashboard.manage; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.bean.copier.CopyOptions; |
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.ningdatech.pmapi.common.constant.BizConst; |
|
|
@@ -67,10 +68,10 @@ public class CockpitStatsManage { |
|
|
|
public void save(CockpitStatsSaveDTO save) { |
|
|
|
List<CockpitStats> cockpitStatsList = cockpitStatsService.list(Wrappers.lambdaUpdate(CockpitStats.class) |
|
|
|
.eq(Objects.nonNull(save.getRegionCode()), CockpitStats::getRegionCode, save.getRegionCode()) |
|
|
|
.eq(Objects.isNull(save.getYear()), CockpitStats::getYear, save.getYear())); |
|
|
|
.eq(Objects.nonNull(save.getYear()), CockpitStats::getYear, save.getYear())); |
|
|
|
if(CollUtil.isNotEmpty(cockpitStatsList)){ |
|
|
|
for(CockpitStats cockpitStats : cockpitStatsList){ |
|
|
|
cockpitStats = BeanUtil.copyProperties(save,CockpitStats.class); |
|
|
|
BeanUtil.copyProperties(save,cockpitStats, CopyOptions.create().ignoreNullValue()); |
|
|
|
cockpitStatsService.updateById(cockpitStats); |
|
|
|
} |
|
|
|
} |
|
|
|