|
|
|
@ -39,9 +39,9 @@ public class UdiCompanyTask {
|
|
|
|
|
udiCompanyEntity.setQylxrcz(contactlist.getQylxrcz());
|
|
|
|
|
udiCompanyEntity.setQylxrdh(contactlist.getQylxrdh());
|
|
|
|
|
udiCompanyEntity.setQylxryx(contactlist.getQylxryx());
|
|
|
|
|
udiCompanyService.insertUdiCompany(udiCompanyEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
udiCompanyService.insertUdiCompany(udiCompanyEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -58,19 +58,24 @@ public class UdiCompanyTask {
|
|
|
|
|
productInfoFilterRequest.setDiType("1");
|
|
|
|
|
List<ProductInfoEntity> productInfoEntities = productInfoDao.filterUdiByCreditNo(productInfoFilterRequest);
|
|
|
|
|
for (ProductInfoEntity productInfoEntity : productInfoEntities) {
|
|
|
|
|
|
|
|
|
|
//将该记录所有产品初始化
|
|
|
|
|
ProductInfoFilterRequest filterRequest = new ProductInfoFilterRequest();
|
|
|
|
|
filterRequest.setDeviceRecordKey(productInfoEntity.getDeviceRecordKey());
|
|
|
|
|
List<ProductInfoEntity> temps = productInfoDao.filterProductInfo(filterRequest);
|
|
|
|
|
if (temps != null && temps.size() > 0) {
|
|
|
|
|
ProductInfoEntity maxProduct = temps.get(0);
|
|
|
|
|
for (ProductInfoEntity change : temps) {
|
|
|
|
|
change.setIsNewest(false);
|
|
|
|
|
if (change.getVersionNumber() > maxProduct.getVersionNumber()) {
|
|
|
|
|
maxProduct = change;
|
|
|
|
|
}
|
|
|
|
|
productInfoDao.updateProductInfo(change);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
List<ProductInfoEntity> updates = productInfoDao.selectByUuid(productInfoEntity.getUuid());
|
|
|
|
|
for (ProductInfoEntity update : updates) {
|
|
|
|
|
update.setIsNewest(true);
|
|
|
|
|
productInfoDao.updateProductInfo(update);
|
|
|
|
|
ProductInfoEntity updateEntity = new ProductInfoEntity();
|
|
|
|
|
updateEntity.setIsNewest(true);
|
|
|
|
|
updateEntity.setUuid(maxProduct.getUuid());
|
|
|
|
|
productInfoDao.updateProductByUuid(updateEntity);
|
|
|
|
|
}
|
|
|
|
|
logger.info("更新 = " + productInfoEntity.getNameCode() + "--" + index);
|
|
|
|
|
index++;
|
|
|
|
@ -89,18 +94,23 @@ public class UdiCompanyTask {
|
|
|
|
|
ProductInfoFilterRequest filterRequest = new ProductInfoFilterRequest();
|
|
|
|
|
filterRequest.setDeviceRecordKey(productInfoEntity.getDeviceRecordKey());
|
|
|
|
|
List<ProductInfoEntity> temps = productInfoDao.filterProductInfo(filterRequest);
|
|
|
|
|
|
|
|
|
|
if (temps != null && temps.size() > 0) {
|
|
|
|
|
ProductInfoEntity maxProduct = temps.get(0);
|
|
|
|
|
for (ProductInfoEntity change : temps) {
|
|
|
|
|
change.setIsNewest(false);
|
|
|
|
|
if (change.getVersionNumber() > maxProduct.getVersionNumber()) {
|
|
|
|
|
maxProduct = change;
|
|
|
|
|
}
|
|
|
|
|
productInfoDao.updateProductInfo(change);
|
|
|
|
|
}
|
|
|
|
|
ProductInfoEntity updateEntity = new ProductInfoEntity();
|
|
|
|
|
updateEntity.setIsNewest(true);
|
|
|
|
|
updateEntity.setUuid(maxProduct.getUuid());
|
|
|
|
|
productInfoDao.updateProductByUuid(updateEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<ProductInfoEntity> updates = productInfoDao.selectByUuid(productInfoEntity.getUuid());
|
|
|
|
|
for (ProductInfoEntity update : updates) {
|
|
|
|
|
update.setIsNewest(true);
|
|
|
|
|
productInfoDao.updateProductInfo(update);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info("更新 = " + productInfoEntity.getNameCode());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|