feat:医共体

dev_unify
chenhc 3 months ago
parent 6d4e107586
commit 1d90878606

@ -669,96 +669,80 @@ public class UdiRelevanceController extends BaseController {
if (basicThirdSysEntities != null && basicThirdSysEntities.size() > 0) {
for (ThrSystemEntity thrSystemEntity : basicThirdSysEntities) {
if (thrSystemEntity.getThirdId().equals("thirdId")) {
BasicProductThirdSysResponse basicProductThirdSysResponse = new BasicProductThirdSysResponse();
if (StrUtil.isNotEmpty(udiRelevanceEntity.getThirdId()))
basicProductThirdSysResponse.setThirdId(udiRelevanceEntity.getThirdId());
basicProductThirdSysResponse.setSysName(thrSystemEntity.getThirdName());
basicProductThirdSysResponse.setSysId(thrSystemEntity.getThirdId());
if (udiRelevanceEntity.getThirdId() != null && !udiRelevanceEntity.getThirdId().isEmpty()) {
if (udiRelevanceEntity.getThirdId() != null) {
ThrProductsEntity thrProductsEntity = thrDataService.getProducts(udiRelevanceEntity.getThirdId(), "thirdId");
if (thrProductsEntity != null) {
basicProductThirdSysResponse.setManufactory(thrProductsEntity.getManufactory());
basicProductThirdSysResponse.setRegisterNo(thrProductsEntity.getRegisterNo());
basicProductThirdSysResponse.setSpec(thrProductsEntity.getSpec());
basicProductThirdSysResponse.setThirdName(thrProductsEntity.getName());
}
}
}
basicProductThirdSysResponses.add(basicProductThirdSysResponse);
}
if (thrSystemEntity.getThirdId().equals("thirdId1")) {
BasicProductThirdSysResponse basicProductThirdSysResponse = new BasicProductThirdSysResponse();
if (StrUtil.isNotEmpty(udiRelevanceEntity.getThirdId1()))
basicProductThirdSysResponse.setThirdId(udiRelevanceEntity.getThirdId1());
basicProductThirdSysResponse.setSysName(thrSystemEntity.getThirdName());
basicProductThirdSysResponse.setSysId(thrSystemEntity.getThirdId());
if (udiRelevanceEntity.getThirdId1() != null && !udiRelevanceEntity.getThirdId1().isEmpty()) {
ThrProductsEntity thrProductsEntity = thrDataService.getProducts(udiRelevanceEntity.getThirdId1(), "thirdId1");
if (thrProductsEntity != null) {
basicProductThirdSysResponse.setManufactory(thrProductsEntity.getManufactory());
basicProductThirdSysResponse.setRegisterNo(thrProductsEntity.getRegisterNo());
basicProductThirdSysResponse.setSpec(thrProductsEntity.getSpec());
basicProductThirdSysResponse.setThirdName(thrProductsEntity.getName());
}
}
basicProductThirdSysResponses.add(basicProductThirdSysResponse);
}
if (thrSystemEntity.getThirdId().equals("thirdId2")) {
BasicProductThirdSysResponse basicProductThirdSysResponse = new BasicProductThirdSysResponse();
if (StrUtil.isNotEmpty(udiRelevanceEntity.getThirdId2()))
basicProductThirdSysResponse.setThirdId(udiRelevanceEntity.getThirdId2());
basicProductThirdSysResponse.setSysName(thrSystemEntity.getThirdName());
basicProductThirdSysResponse.setSysId(thrSystemEntity.getThirdId());
if (udiRelevanceEntity.getThirdId2() != null && !udiRelevanceEntity.getThirdId2().isEmpty()) {
ThrProductsEntity thrProductsEntity = thrDataService.getProducts(udiRelevanceEntity.getThirdId2(), "thirdId2");
if (thrProductsEntity != null) {
basicProductThirdSysResponse.setManufactory(thrProductsEntity.getManufactory());
basicProductThirdSysResponse.setRegisterNo(thrProductsEntity.getRegisterNo());
basicProductThirdSysResponse.setSpec(thrProductsEntity.getSpec());
basicProductThirdSysResponse.setThirdName(thrProductsEntity.getName());
}
}
basicProductThirdSysResponses.add(basicProductThirdSysResponse);
String thirdId = thrSystemEntity.getThirdId();
String correspondingId = null;
switch (thirdId) {
case "thirdId":
correspondingId = udiRelevanceEntity.getThirdId();
break;
case "thirdId1":
correspondingId = udiRelevanceEntity.getThirdId1();
break;
case "thirdId3":
correspondingId = udiRelevanceEntity.getThirdId3();
break;
case "thirdId4":
correspondingId = udiRelevanceEntity.getThirdId4();
break;
case "thirdId5":
correspondingId = udiRelevanceEntity.getThirdId5();
break;
case "thirdId6":
correspondingId = udiRelevanceEntity.getThirdId6();
break;
case "thirdId7":
correspondingId = udiRelevanceEntity.getThirdId7();
break;
case "thirdId8":
correspondingId = udiRelevanceEntity.getThirdId8();
break;
case "thirdId9":
correspondingId = udiRelevanceEntity.getThirdId9();
break;
case "thirdId10":
correspondingId = udiRelevanceEntity.getThirdId10();
break;
case "thirdId11":
correspondingId = udiRelevanceEntity.getThirdId11();
break;
case "thirdId12":
correspondingId = udiRelevanceEntity.getThirdId12();
break;
case "thirdId13":
correspondingId = udiRelevanceEntity.getThirdId13();
break;
case "thirdId14":
correspondingId = udiRelevanceEntity.getThirdId14();
break;
case "thirdId15":
correspondingId = udiRelevanceEntity.getThirdId15();
break;
case "thirdId16":
correspondingId = udiRelevanceEntity.getThirdId16();
break;
case "thirdId17":
correspondingId = udiRelevanceEntity.getThirdId17();
break;
case "thirdId18":
correspondingId = udiRelevanceEntity.getThirdId18();
break;
case "thirdId19":
correspondingId = udiRelevanceEntity.getThirdId19();
break;
case "thirdId20":
correspondingId = udiRelevanceEntity.getThirdId20();
break;
default:
// 处理未知的 thirdId
break;
}
if (thrSystemEntity.getThirdId().equals("thirdId3")) {
BasicProductThirdSysResponse basicProductThirdSysResponse = new BasicProductThirdSysResponse();
if (StrUtil.isNotEmpty(udiRelevanceEntity.getThirdId3()))
basicProductThirdSysResponse.setThirdId(udiRelevanceEntity.getThirdId3());
basicProductThirdSysResponse.setSysName(thrSystemEntity.getThirdName());
basicProductThirdSysResponse.setSysId(thrSystemEntity.getThirdId());
if (udiRelevanceEntity.getThirdId3() != null && !udiRelevanceEntity.getThirdId3().isEmpty()) {
ThrProductsEntity thrProductsEntity = thrDataService.getProducts(udiRelevanceEntity.getThirdId3(), "thirdId3");
if (thrProductsEntity != null) {
basicProductThirdSysResponse.setManufactory(thrProductsEntity.getManufactory());
basicProductThirdSysResponse.setRegisterNo(thrProductsEntity.getRegisterNo());
basicProductThirdSysResponse.setSpec(thrProductsEntity.getSpec());
basicProductThirdSysResponse.setThirdName(thrProductsEntity.getName());
}
}
basicProductThirdSysResponses.add(basicProductThirdSysResponse);
}
if (thrSystemEntity.getThirdId().equals("thirdId4")) {
BasicProductThirdSysResponse basicProductThirdSysResponse = new BasicProductThirdSysResponse();
if (StrUtil.isNotEmpty(udiRelevanceEntity.getThirdId4()))
basicProductThirdSysResponse.setThirdId(udiRelevanceEntity.getThirdId4());
basicProductThirdSysResponse.setSysName(thrSystemEntity.getThirdName());
basicProductThirdSysResponse.setSysId(thrSystemEntity.getThirdId());
if (udiRelevanceEntity.getThirdId4() != null && !udiRelevanceEntity.getThirdId4().isEmpty()) {
ThrProductsEntity thrProductsEntity = thrDataService.getProducts(udiRelevanceEntity.getThirdId4(), "thirdId4");
if (thrProductsEntity != null) {
basicProductThirdSysResponse.setManufactory(thrProductsEntity.getManufactory());
basicProductThirdSysResponse.setRegisterNo(thrProductsEntity.getRegisterNo());
basicProductThirdSysResponse.setSpec(thrProductsEntity.getSpec());
basicProductThirdSysResponse.setThirdName(thrProductsEntity.getName());
}
if (correspondingId != null) {
BasicProductThirdSysResponse response = handleThirdId(thirdId, correspondingId, thrSystemEntity);
if (response != null) {
basicProductThirdSysResponses.add(response);
}
basicProductThirdSysResponses.add(basicProductThirdSysResponse);
}
}
}
@ -770,6 +754,29 @@ public class UdiRelevanceController extends BaseController {
return ResultVOUtils.success(pageSimpleResponse);
}
// 假设 handleThirdId 方法返回 null 或一个有效的 BasicProductThirdSysResponse 对象
private BasicProductThirdSysResponse handleThirdId(String thirdId, String value, ThrSystemEntity thrSystemEntity) {
BasicProductThirdSysResponse basicProductThirdSysResponse = new BasicProductThirdSysResponse();
if (StrUtil.isNotEmpty(value)) {
if (StrUtil.isNotEmpty(value))
basicProductThirdSysResponse.setThirdId(value);
basicProductThirdSysResponse.setSysName(thrSystemEntity.getThirdName());
basicProductThirdSysResponse.setSysId(thrSystemEntity.getThirdId());
if (value != null && !value.isEmpty()) {
if (value != null) {
ThrProductsEntity thrProductsEntity = thrDataService.getProducts(value, thirdId);
if (thrProductsEntity != null) {
basicProductThirdSysResponse.setManufactory(thrProductsEntity.getManufactory());
basicProductThirdSysResponse.setRegisterNo(thrProductsEntity.getRegisterNo());
basicProductThirdSysResponse.setSpec(thrProductsEntity.getSpec());
basicProductThirdSysResponse.setThirdName(thrProductsEntity.getName());
}
}
}
}
return basicProductThirdSysResponse;
}
private BasicProductThirdSysResponse createResponse(ThrSystemEntity thrSystemEntity, UdiRelevanceEntity udiRelevanceEntity, ThrDataService thrDataService, String thirdId) {
BasicProductThirdSysResponse basicProductThirdSysResponse = new BasicProductThirdSysResponse();
if (StrUtil.isNotEmpty(udiRelevanceEntity.getThirdId()))

Loading…
Cancel
Save