diff --git a/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java b/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java index f7455369..b58b9535 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java @@ -359,6 +359,7 @@ public class UdiRlSupController extends BaseController { udiRelevanceEntity.setLockStatus(1); udiRelevanceEntity.setProductsType(2); udiRelevanceEntity.setUpdateTime(new Date()); + udiRelevanceEntity.setDetailSort(udiInfoExportRequest.getSupplementRequest().getDetailSort()); udiRelevanceService.updateUdiRelevance(udiRelevanceEntity); UdiProductEntity udiProductEntity = new UdiProductEntity(); udiProductEntity.setProductsType(2); @@ -373,7 +374,7 @@ public class UdiRlSupController extends BaseController { byUuid.setCatalogname1(udiProductEntity.getCatalogname1()); byUuid.setCatalogname2(udiProductEntity.getCatalogname2()); byUuid.setCatalogname3(udiProductEntity.getCatalogname3()); - byUuid.setDetailSort(udiProductEntity.getDetailSort()); +// byUuid.setDetailSort(udiProductEntity.getDetailSort()); byUuid.setYbbm(udiProductEntity.getYbbm()); byUuid.setManufactory(udiProductEntity.getManufactory()); byUuid.setUpdateTime(new Date()); diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index 2659c77b..382d389a 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -457,7 +457,10 @@ public class IoOrderDetailBizController extends BaseController { List orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderDetailBizRequest.getOrderIdFk()); ioCheckInoutService.bizOrderCheck2(list, orderDetailCodeEntities); PageInfo pageInfo = new PageInfo<>(list); - return ResultVOUtils.page(pageInfo); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(list); + return ResultVOUtils.success(pageSimpleResponse); } @@ -818,6 +821,8 @@ public class IoOrderDetailBizController extends BaseController { if (StrUtil.isNotEmpty(aliYljgBillDetailDrug.getValidEndDate())) { codeLostEntity.setExpireDate(aliYljgBillDetailDrug.getValidEndDate().substring(2).replace(" 00:00:00", "").replace("-", "")); } + Long id = codeLostEntity.getId(); + if (id == null) codeLostEntity.setId(IdUtil.getSnowflakeNextId()); } ioCodeLostService.insertOrUpdate(codeLostEntity); diff --git a/src/main/java/com/glxp/api/controller/test/TestCodeController.java b/src/main/java/com/glxp/api/controller/test/TestCodeController.java index 1f1a3fb6..97b0fc4a 100644 --- a/src/main/java/com/glxp/api/controller/test/TestCodeController.java +++ b/src/main/java/com/glxp/api/controller/test/TestCodeController.java @@ -2,6 +2,7 @@ package com.glxp.api.controller.test; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.dao.auth.AuthCompanyMapper; import com.glxp.api.entity.alihealth.AliYljgBillDetail; import com.glxp.api.entity.alihealth.AliYljgSearchbill; @@ -21,8 +22,10 @@ import com.glxp.api.res.alihealth.AlihealthYljgListupoutDetailResponse; import com.glxp.api.service.collect.RelCodeBatchService; import com.glxp.api.service.collect.RelCodeDetailService; import com.glxp.api.service.thrsys.ThirdAliDrugService; +import com.glxp.api.util.DimaUtil; import com.glxp.api.util.alihealth.AlihealthUtils; import com.glxp.api.util.alihealth.AlihealthYljgUtils; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; @@ -87,46 +90,48 @@ public class TestCodeController { return null; } - @PostMapping("/test1") + + @PostMapping("/test1") public BaseResponse test1() { - AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust = new AlihealthThirdAliDrugInsertReqeust(); - alihealthThirdAliDrugInsertReqeust.setErpId("123"); - alihealthThirdAliDrugInsertReqeust.setAppSecret("5231c601505706a9d49823c3dfe2cb01"); - AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust(); - alihealthKytDrugrescodeReqeust.setPhysic_name("苯巴比妥片"); + AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust = new AlihealthThirdAliDrugInsertReqeust(); + alihealthThirdAliDrugInsertReqeust.setErpId("123"); + alihealthThirdAliDrugInsertReqeust.setAppSecret("5231c601505706a9d49823c3dfe2cb01"); + AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust(); + alihealthKytDrugrescodeReqeust.setPhysic_name("苯巴比妥片"); // alihealthKytDrugrescodeReqeust.setApproval_licence_no(); // alihealthKytDrugrescodeReqeust.setStart_date(); // alihealthKytDrugrescodeReqeust.setEnd_date(); // alihealthKytDrugrescodeReqeust.setEnt_name(); // alihealthKytDrugrescodeReqeust.setPackage_spec(); // alihealthKytDrugrescodeReqeust.setPrepn_spec(); - alihealthKytDrugrescodeReqeust.setPage_size(20); - alihealthKytDrugrescodeReqeust.setPage(1); - alihealthKytDrugrescodeReqeust.setApp_key("31721223"); - alihealthKytDrugrescodeReqeust.setRef_ent_id("ef99b78bd9c54c1284f813149c858fb0"); - alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust); - BaseResponse> baseResponse = alihealthUtils.thirdAliDrugInsertAll(alihealthThirdAliDrugInsertReqeust); - if(baseResponse.getCode() == 20000){ - List list = baseResponse.getData(); - if(list!=null && list.size() >0){ - for (ThirdAliDrug thirdAliDrug : list) { - ThirdAliDrug thirdAliDrugNew = thirdAliDrugService.getOne(new QueryWrapper().eq("nameCode", thirdAliDrug.getNameCode()) - .last("limit 1") - ); - if (Objects.isNull(thirdAliDrugNew)) { - - thirdAliDrugService.save(thirdAliDrug); - - } else { - thirdAliDrugService.update(thirdAliDrug, new QueryWrapper().eq("nameCode", thirdAliDrug.getNameCode())); - } + alihealthKytDrugrescodeReqeust.setPage_size(20); + alihealthKytDrugrescodeReqeust.setPage(1); + alihealthKytDrugrescodeReqeust.setApp_key("31721223"); + alihealthKytDrugrescodeReqeust.setRef_ent_id("ef99b78bd9c54c1284f813149c858fb0"); + alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust); + BaseResponse> baseResponse = alihealthUtils.thirdAliDrugInsertAll(alihealthThirdAliDrugInsertReqeust); + if (baseResponse.getCode() == 20000) { + List list = baseResponse.getData(); + if (list != null && list.size() > 0) { + for (ThirdAliDrug thirdAliDrug : list) { + ThirdAliDrug thirdAliDrugNew = thirdAliDrugService.getOne(new QueryWrapper().eq("nameCode", thirdAliDrug.getNameCode()) + .last("limit 1") + ); + if (Objects.isNull(thirdAliDrugNew)) { + + thirdAliDrugService.save(thirdAliDrug); + + } else { + thirdAliDrugService.update(thirdAliDrug, new QueryWrapper().eq("nameCode", thirdAliDrug.getNameCode())); } } - } - return baseResponse; + + } + return baseResponse; // return alihealthUtils.thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust,true); } + @PostMapping("/test2") public BaseResponse test2() { AlihealthKytThirdAliSearchbillInsertReqeust alihealthKytThirdAliSearchbillInsertReqeust = new AlihealthKytThirdAliSearchbillInsertReqeust(); @@ -166,6 +171,7 @@ public class TestCodeController { return alihealthUtils.thirdAliSearchbillInsert(alihealthKytThirdAliSearchbillInsertReqeust); } + @PostMapping("/test3") public BaseResponse> test3() { @@ -174,8 +180,9 @@ public class TestCodeController { alihealthYljgListupoutReqeust1.setEnd_date("2024-05-01"); alihealthYljgListupoutReqeust1.setPage(1); alihealthYljgListupoutReqeust1.setPage_size(20); - return alihealthYljgUtils.listupout(alihealthYljgListupoutReqeust1,"72890663819159"); + return alihealthYljgUtils.listupout(alihealthYljgListupoutReqeust1, "72890663819159"); } + @PostMapping("/test4") public BaseResponse test4() { @@ -183,6 +190,6 @@ public class TestCodeController { alihealthYljgListupoutDetailReqeust.setBill_code("19604910"); alihealthYljgListupoutDetailReqeust.setFrom_ref_user_id("a74061d26923498785ad8489962d9de2"); - return alihealthYljgUtils.listupoutDetail(alihealthYljgListupoutDetailReqeust); + return alihealthYljgUtils.listupoutDetail(alihealthYljgListupoutDetailReqeust); } } diff --git a/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java b/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java index 7e8934c3..af69b851 100644 --- a/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java +++ b/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java @@ -347,8 +347,8 @@ public class UdiProductEntity { /** * 明细分类 */ - @TableField(value = "detailSort") - private Integer detailSort; +// @TableField(value = "detailSort") +// private Integer detailSort; public Integer getMyBhxjsl() { if (bhxjsl == null || bhxjsl == 0) diff --git a/src/main/java/com/glxp/api/entity/basic/UdiRelevanceEntity.java b/src/main/java/com/glxp/api/entity/basic/UdiRelevanceEntity.java index dbe5db06..ec0177de 100644 --- a/src/main/java/com/glxp/api/entity/basic/UdiRelevanceEntity.java +++ b/src/main/java/com/glxp/api/entity/basic/UdiRelevanceEntity.java @@ -311,4 +311,7 @@ public class UdiRelevanceEntity { @TableField(value = "unpackUseTime") private Integer unpackUseTime; + + @TableField(value = "detailSort") + private Integer detailSort; } diff --git a/src/main/java/com/glxp/api/req/basic/UpdateLevelDrugRequest.java b/src/main/java/com/glxp/api/req/basic/UpdateLevelDrugRequest.java index 854a01ea..66b479f2 100644 --- a/src/main/java/com/glxp/api/req/basic/UpdateLevelDrugRequest.java +++ b/src/main/java/com/glxp/api/req/basic/UpdateLevelDrugRequest.java @@ -35,6 +35,7 @@ public class UpdateLevelDrugRequest { private String uuid; private String xjdw; private Integer diType; + private String packRatio; public Integer getMyBhxjsl() { if (bhxjsl == null || bhxjsl == 0) diff --git a/src/main/java/com/glxp/api/service/basic/UdiContrastService.java b/src/main/java/com/glxp/api/service/basic/UdiContrastService.java index de197c00..d553aa70 100644 --- a/src/main/java/com/glxp/api/service/basic/UdiContrastService.java +++ b/src/main/java/com/glxp/api/service/basic/UdiContrastService.java @@ -433,6 +433,7 @@ public class UdiContrastService { udiProductEntity.setSpmc(thirdAliDrug.getSpmc()); udiProductEntity.setBzgg(thirdAliDrug.getBzgg()); + udiProductEntity.setPackRatio(thirdAliDrug.getPackRatio()); // udiProductEntity.setMatrial(ybDrug.getMaterialName()); // udiProductEntity.setPackMatrial(ybDrug.getMaterialName()); // udiProductEntity.setMedicareType(setMedicareType(ybDrug.getProductInsuranceType())); diff --git a/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java index 49145e6d..d5602b64 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java @@ -324,6 +324,7 @@ public class UdiProductServiceImpl implements UdiProductService { udiRelevanceEntity.setUseMaxLevel(addProductRequest.getUseMaxLevel()); udiRelevanceEntity.setDistributeMaxLevel(addProductRequest.getDistributeMaxLevel()); udiRelevanceEntity.setUnpackUseTime(addProductRequest.getUnpackUseTime()); + udiRelevanceEntity.setDetailSort(addProductRequest.getDetailSort()); udiRelevanceEntity.setUpdateTime(new Date()); udiRelevanceDao.updateById(udiRelevanceEntity); updateLevelCount(udiRelevanceEntity); @@ -342,6 +343,7 @@ public class UdiProductServiceImpl implements UdiProductService { udiRelevanceEntity.setHcType(addProductRequest.getHcType()); udiRelevanceEntity.setPayFeeCode(addProductRequest.getPayFeeCode()); udiRelevanceEntity.setUnpackUseTime(addProductRequest.getUnpackUseTime()); + udiRelevanceEntity.setDetailSort(addProductRequest.getDetailSort()); udiRelevanceEntity.setUpdateTime(new Date()); // if (addProductRequest.getDistributeLevelDi() != null) { // udiRelevanceEntity.setDistributeLevelDi(addProductRequest.getDistributeLevelDi()); diff --git a/src/main/java/com/glxp/api/service/collect/RelCodeBatchService.java b/src/main/java/com/glxp/api/service/collect/RelCodeBatchService.java index 405ca816..2c2d24bd 100644 --- a/src/main/java/com/glxp/api/service/collect/RelCodeBatchService.java +++ b/src/main/java/com/glxp/api/service/collect/RelCodeBatchService.java @@ -703,7 +703,7 @@ public class RelCodeBatchService extends ServiceImpl set, String erpId){ + public void addRelCodeAli(Set set, String erpId){ try { List relCodeBatchList =new ArrayList<>(); //2.下载关联关系存到关联关系表 diff --git a/src/main/java/com/glxp/api/util/DimaUtil.java b/src/main/java/com/glxp/api/util/DimaUtil.java index 40ae6c49..111bf39e 100644 --- a/src/main/java/com/glxp/api/util/DimaUtil.java +++ b/src/main/java/com/glxp/api/util/DimaUtil.java @@ -28,16 +28,18 @@ public class DimaUtil { } // 最后加上最小单位(第一层级为 1) - calculatedLevels.add(1); + calculatedLevels.add(0,1); // 结果倒序 - List reversed = new ArrayList<>(); - for (int i = calculatedLevels.size() - 1; i >= 0; i--) { - reversed.add(calculatedLevels.get(i)); - } - return reversed; +// List reversed = new ArrayList<>(); +// for (int i = calculatedLevels.size() - 1; i >= 0; i--) { +// reversed.add(calculatedLevels.get(i)); +// } + return calculatedLevels; } + + public static Integer trMinCount(String bzgg) { // 定义正则表达式模式,用于匹配数字 Pattern pattern = Pattern.compile("\\d+"); diff --git a/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml b/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml index eb03fc47..007a42d0 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml @@ -599,9 +599,7 @@ catalogname2=#{catalogname2}, - - detailSort=#{detailSort}, - + WHERE nameCode = #{nameCode} and uuid = #{uuid} diff --git a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml index 08ab19c1..bbd197ad 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml @@ -494,8 +494,7 @@ basic_products.workPlaceCount, basic_products.bhltcjsl, basic_products.bhsycjsl, - th.hsmc hslbName, - basic_products.detailSort + th.hsmc hslbName FROM basic_products inner JOIN basic_udirel ON basic_products.uuid = basic_udirel.uuid @@ -1067,7 +1066,7 @@ groupBuy, needCert, isStack, distributeLevelCount, useLevel, distributeLevel, - splitEnable, autoCode, distributeMaxLevel, useMaxLevel,unpackUseTime) + splitEnable, autoCode, distributeMaxLevel, useMaxLevel,unpackUseTime,detailSort) values (#{id}, #{uuid}, #{mainId}, @@ -1103,7 +1102,7 @@ #{useLevel}, #{distributeLevel}, #{splitEnable}, - #{autoCode}, #{distributeMaxLevel}, #{useMaxLevel}, #{unpackUseTime}) + #{autoCode}, #{distributeMaxLevel}, #{useMaxLevel}, #{unpackUseTime},#{detailSort}) unpackUseTime=#{unpackUseTime}, + + detailSort=#{detailSort}, + WHERE id = #{id} diff --git a/src/main/resources/mybatis/mapper/basic/UdiRlSupDao.xml b/src/main/resources/mybatis/mapper/basic/UdiRlSupDao.xml index 840d8f0e..4235d77f 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiRlSupDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiRlSupDao.xml @@ -145,7 +145,7 @@ basic_products.physicType, basic_products.medicareType, basic_products.indate, - basic_products.detailSort + basic_udirel.detailSort FROM company_product_relevance inner JOIN basic_udirel ON company_product_relevance.udiRlIdFk = basic_udirel.id diff --git a/src/main/resources/schemas/schema_v2.4.sql b/src/main/resources/schemas/schema_v2.4.sql index 9e0a48c6..4e6f42f9 100644 --- a/src/main/resources/schemas/schema_v2.4.sql +++ b/src/main/resources/schemas/schema_v2.4.sql @@ -1184,9 +1184,9 @@ CALL Pro_Temp_ColumnWork('third_ali_drug', 'approvalNum', call Modify_index('third_ali_drug', 'approvalNum', 'approvalNum', 'BTREE'); -CALL Pro_Temp_ColumnWork('basic_products', 'detailSort', - ' tinyint DEFAULT NULL COMMENT ''明细分类''', - 1); +# CALL Pro_Temp_ColumnWork('basic_products', 'detailSort', +# ' tinyint DEFAULT NULL COMMENT ''明细分类''', +# 1); CALL Pro_Temp_ColumnWork('sync_data_set', 'drugDataTask', ' tinyint NULL DEFAULT NULL COMMENT ''药品关联关系同步''', @@ -1253,4 +1253,9 @@ call Modify_UNIQUE_index('io_code_lost', 'code', 'uniqueCode', 'BTREE'); CALL Pro_Temp_ColumnWork('io_order', 'aliOrderBillNo', ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ''阿里来源单号''', - 1); \ No newline at end of file + 1); + + + + +CALL Pro_Temp_ColumnWork('basic_udirel', 'detailSort', ' tinyint DEFAULT NULL', 1);