条件判断
This commit is contained in:
parent
8f8184a7ce
commit
25df92278a
|
|
@ -108,7 +108,7 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void insertOptionAction(OptionalEbomImportChildEntity item){
|
public void insertOptionAction(OptionalEbomImportChildEntity item) throws NflgBusinessException {
|
||||||
QueryWrapper<OptionalEbomImportChildEntity> queryWrapper3 = new QueryWrapper<>();
|
QueryWrapper<OptionalEbomImportChildEntity> queryWrapper3 = new QueryWrapper<>();
|
||||||
// 同一个机型下不可以存在相同的物料信息(物料编号),如果是“无”的情况,需同一个机型+同一个选项来做唯一判断
|
// 同一个机型下不可以存在相同的物料信息(物料编号),如果是“无”的情况,需同一个机型+同一个选项来做唯一判断
|
||||||
if (StrUtil.isEmpty(item.getMaterialNo()) && item.getMaterialName().equals("无")) {
|
if (StrUtil.isEmpty(item.getMaterialNo()) && item.getMaterialName().equals("无")) {
|
||||||
|
|
@ -131,11 +131,14 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
|
||||||
// item.setUpdatedTime(new Date());
|
// item.setUpdatedTime(new Date());
|
||||||
save(item);
|
save(item);
|
||||||
} else {
|
} else {
|
||||||
item.setRowId(childEntity.getRowId());
|
// item.setRowId(childEntity.getRowId());
|
||||||
|
// this.getBaseMapper().updateById(item);
|
||||||
|
String bizErr=item.getMaterialNo();
|
||||||
this.getBaseMapper().updateById(item);
|
if (StrUtil.isEmpty(bizErr)) {
|
||||||
|
bizErr=item.getMaterialName();
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new NflgBusinessException(STATE.BusinessError, "存在相同的数据, "+bizErr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -336,11 +336,12 @@ public class OptionalExcelService {
|
||||||
|
|
||||||
childOptionEntity.setCreatedTime(DateUtil.now());
|
childOptionEntity.setCreatedTime(DateUtil.now());
|
||||||
optionalEbomImportService.save(childOptionEntity);
|
optionalEbomImportService.save(childOptionEntity);
|
||||||
}else{
|
|
||||||
childOptionEntity.setParentRowId(parentOptionEntity.getRowId());
|
|
||||||
|
|
||||||
optionalEbomImportService.updateById(childOptionEntity);
|
|
||||||
}
|
}
|
||||||
|
// else{
|
||||||
|
// childOptionEntity.setParentRowId(parentOptionEntity.getRowId());
|
||||||
|
//
|
||||||
|
// optionalEbomImportService.updateById(childOptionEntity);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
if (childOptionEntity == null || childOptionEntity.getRowId() == null) {
|
if (childOptionEntity == null || childOptionEntity.getRowId() == null) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue