bug修改 耗材字典字段修改

dev
anthonywj 2 years ago
parent e1625cf500
commit 5194ab6afa

@ -33,6 +33,7 @@ import com.glxp.api.service.thrsys.ThrSystemService;
import com.glxp.api.util.CustomUtil; import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.udi.UdiInfoUtil; import com.glxp.api.util.udi.UdiInfoUtil;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -173,20 +174,24 @@ public class UdiContrastController {
/** /**
* *
*/ */
@Transactional(rollbackFor = Exception.class)
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@PostMapping("/udi/udirel/syncOnline") @PostMapping("/udi/udirel/syncOnline")
@Log(title = "耗材字典", businessType = BusinessType.UPDATE) @Log(title = "耗材字典", businessType = BusinessType.UPDATE)
public BaseResponse syncOnline(@RequestBody UdiCombineRequest udiCombineRequest) { public BaseResponse syncOnline(@RequestBody UdiCombineRequest udiCombineRequest) {
List<UdiProductEntity> udiInfoEntities = udiDlHttpClient.getUdiByUuid(udiCombineRequest.getOriginUuid()); List<UdiProductEntity> udiInfoEntities = udiProductService.findByOriginUuid(udiCombineRequest.getOriginUuid());
if (CollUtil.isNotEmpty(udiInfoEntities)) { if (CollUtil.isNotEmpty(udiInfoEntities)) {
String newUuid = null;
BaseResponse<List<ProductInfoEntity>> listBaseResponse = asyncDiDlHelper.dlLastVersionByDi(udiInfoEntities.get(0).getNameCode()); BaseResponse<List<ProductInfoEntity>> listBaseResponse = asyncDiDlHelper.dlLastVersionByDi(udiInfoEntities.get(0).getNameCode());
if (listBaseResponse.getCode() == 20000) { if (listBaseResponse.getCode() == 20000) {
List<ProductInfoEntity> productInfoEntityList = listBaseResponse.getData(); List<ProductInfoEntity> productInfoEntityList = listBaseResponse.getData();
if (CollUtil.isNotEmpty(productInfoEntityList)) { if (CollUtil.isNotEmpty(productInfoEntityList)) {
productInfoService.insertProductInfos(productInfoEntityList); productInfoService.insertProductInfos(productInfoEntityList);
newUuid = productInfoEntityList.get(0).getUuid();
} }
} }
udiInfoEntities = udiDlHttpClient.getUdiByUuid(udiCombineRequest.getOriginUuid());
udiInfoEntities = udiDlHttpClient.getUdiByUuid(newUuid);
udiProductService.deleteByUuid(udiCombineRequest.getUuid()); udiProductService.deleteByUuid(udiCombineRequest.getUuid());
for (UdiProductEntity udiProductEntity : udiInfoEntities) { for (UdiProductEntity udiProductEntity : udiInfoEntities) {
udiProductEntity.setUuid(udiCombineRequest.getUuid()); udiProductEntity.setUuid(udiCombineRequest.getUuid());

Loading…
Cancel
Save