|
@@ -234,7 +234,12 @@ public class ProductServiceImpl implements ProductService {
|
|
|
continue;
|
|
|
}
|
|
|
ProductDerivativeDO productDerivativeDO = toProductDerivativeDO(productDerivativeData);
|
|
|
- ProductInformationDO productInformationDO = productInformationMapper.selectByNameAndRegisterNumber(productDerivativeDO.getRegisterNumber(),productDerivativeDO.getProductName());
|
|
|
+ ProductInformationDO productInformationDO = null;
|
|
|
+ if(!StringUtil.isEmpty(productDerivativeDO.getProductName())){
|
|
|
+ productInformationDO = productInformationMapper.selectByRegisterNumber(productDerivativeDO.getRegisterNumber());
|
|
|
+ }else{
|
|
|
+ productInformationDO = productInformationMapper.selectByProductName(productDerivativeDO.getProductName());
|
|
|
+ }
|
|
|
if(productInformationDO != null){
|
|
|
productDerivativeDO.setProductId(productInformationDO.getId());
|
|
|
}else{
|
|
@@ -292,7 +297,12 @@ public class ProductServiceImpl implements ProductService {
|
|
|
continue;
|
|
|
}
|
|
|
ProductContractDO productContractDO = toProductContractDO(productContractData);
|
|
|
- ProductInformationDO productInformationDO = productInformationMapper.selectByNameAndRegisterNumber(productContractData.getRegisterNumber(),productContractData.getProductName());
|
|
|
+ ProductInformationDO productInformationDO = null;
|
|
|
+ if(!StringUtil.isEmpty(productContractDO.getProductName())){
|
|
|
+ productInformationDO = productInformationMapper.selectByRegisterNumber(productContractDO.getRegisterNumber());
|
|
|
+ }else{
|
|
|
+ productInformationDO = productInformationMapper.selectByProductName(productContractDO.getProductName());
|
|
|
+ }
|
|
|
if(productInformationDO != null){
|
|
|
productContractDO.setProductId(productInformationDO.getId());
|
|
|
}else{
|
|
@@ -363,7 +373,12 @@ public class ProductServiceImpl implements ProductService {
|
|
|
continue;
|
|
|
}
|
|
|
ProductInformationDO productInformationDO = toProductDO(productInformationData);
|
|
|
- ProductInformationDO oldProductInformationDO = productInformationMapper.selectByNameAndRegisterNumber(productInformationDO.getRegisterNumber(),productInformationDO.getProductName());
|
|
|
+ ProductInformationDO oldProductInformationDO = null;
|
|
|
+ if(!StringUtil.isEmpty(productInformationDO.getProductName())){
|
|
|
+ oldProductInformationDO = productInformationMapper.selectByRegisterNumber(productInformationDO.getRegisterNumber());
|
|
|
+ }else{
|
|
|
+ oldProductInformationDO = productInformationMapper.selectByProductName(productInformationDO.getProductName());
|
|
|
+ }
|
|
|
if(oldProductInformationDO != null){
|
|
|
productInformationDO.setId(oldProductInformationDO.getId());
|
|
|
}else{
|