关联DI必填字段不被覆盖

dev
anthonywj 2 years ago
parent fdbe829ef0
commit 654d32def0

@ -354,6 +354,57 @@ public class UdiContrastController {
public void updateDi(UdiRelevanceEntity udiRelevanceEntity, String key) {
List<UdiProductEntity> udiInfoEntities = udiDlHttpClient.getOrUpdateByUuid(key);
List<UdiProductEntity> originProductEntities = udiProductService.findByUuids(udiRelevanceEntity.getUuid());
if (CollUtil.isNotEmpty(originProductEntities) && CollUtil.isNotEmpty(udiInfoEntities)) {
UdiProductEntity originProductEntity = originProductEntities.get(0);
for (UdiProductEntity udiProductEntity : udiInfoEntities) {
if (StrUtil.isEmpty(udiProductEntity.getSptm())) {
udiProductEntity.setSptm(originProductEntity.getSptm());
}
if (StrUtil.isEmpty(udiProductEntity.getYbbm())) {
udiProductEntity.setYbbm(originProductEntity.getYbbm());
}
if (StrUtil.isEmpty(udiProductEntity.getMeasname())) {
udiProductEntity.setMeasname(originProductEntity.getMeasname());
}
if (StrUtil.isEmpty(udiProductEntity.getManufactory())) {
udiProductEntity.setManufactory(originProductEntity.getManufactory());
}
if (StrUtil.isEmpty(udiProductEntity.getPrice())) {
udiProductEntity.setPrice(originProductEntity.getPrice());
}
if (StrUtil.isEmpty(udiProductEntity.getSpmc())) {
udiProductEntity.setSpmc(originProductEntity.getSpmc());
}
if (StrUtil.isEmpty(udiProductEntity.getCpms())) {
udiProductEntity.setCpms(originProductEntity.getCpms());
}
if (StrUtil.isEmpty(udiProductEntity.getBasicPrductRemak1())) {
udiProductEntity.setBasicPrductRemak1(originProductEntity.getBasicPrductRemak1());
}
if (StrUtil.isEmpty(udiProductEntity.getBasicPrductRemak2())) {
udiProductEntity.setBasicPrductRemak2(originProductEntity.getBasicPrductRemak2());
}
if (StrUtil.isEmpty(udiProductEntity.getBasicPrductRemak3())) {
udiProductEntity.setBasicPrductRemak3(originProductEntity.getBasicPrductRemak3());
}
if (StrUtil.isEmpty(udiProductEntity.getBasicPrductRemak4())) {
udiProductEntity.setBasicPrductRemak4(originProductEntity.getBasicPrductRemak4());
}
if (StrUtil.isEmpty(udiProductEntity.getBasicPrductRemak5())) {
udiProductEntity.setBasicPrductRemak5(originProductEntity.getBasicPrductRemak5());
}
if (StrUtil.isEmpty(udiProductEntity.getBasicPrductRemak6())) {
udiProductEntity.setBasicPrductRemak6(originProductEntity.getBasicPrductRemak6());
}
if (StrUtil.isEmpty(udiProductEntity.getBasicPrductRemak7())) {
udiProductEntity.setBasicPrductRemak7(originProductEntity.getBasicPrductRemak7());
}
if (StrUtil.isEmpty(udiProductEntity.getBasicPrductRemak8())) {
udiProductEntity.setBasicPrductRemak8(originProductEntity.getBasicPrductRemak8());
}
}
}
udiProductService.deleteByUuid(udiRelevanceEntity.getUuid());
udiRelevanceEntity.setUuid(udiInfoEntities.get(0).getUuid());
udiRelevanceEntity.setUpdateTime(new Date());

Loading…
Cancel
Save