选入阳采,选入阿里

dev_unify
yewj 3 months ago
parent 9a5efc897b
commit 50a6e79798

@ -140,13 +140,6 @@
<version>3.9.1</version> <version>3.9.1</version>
</dependency> </dependency>
<!--自动生成 GET SET-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!--JWT--> <!--JWT-->
<dependency> <dependency>
<groupId>io.jsonwebtoken</groupId> <groupId>io.jsonwebtoken</groupId>
@ -400,12 +393,12 @@
<!-- <scope>system</scope>--> <!-- <scope>system</scope>-->
<!-- <systemPath>${pom.basedir}/src/main/resources/lib/alicode-1.0.jar</systemPath>--> <!-- <systemPath>${pom.basedir}/src/main/resources/lib/alicode-1.0.jar</systemPath>-->
<!-- </dependency>--> <!-- </dependency>-->
<!-- javassist --> <!-- &lt;!&ndash; javassist &ndash;&gt;-->
<dependency> <!-- <dependency>-->
<groupId>org.javassist</groupId> <!-- <groupId>org.javassist</groupId>-->
<artifactId>javassist</artifactId> <!-- <artifactId>javassist</artifactId>-->
<version>3.28.0-GA</version> <!-- <version>3.28.0-GA</version>-->
</dependency> <!-- </dependency>-->
</dependencies> </dependencies>
@ -431,13 +424,13 @@
</configuration> </configuration>
</plugin> </plugin>
<plugin> <!-- <plugin>-->
<groupId>org.springframework.boot</groupId> <!-- <groupId>org.springframework.boot</groupId>-->
<artifactId>spring-boot-maven-plugin</artifactId> <!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<configuration> <!-- <configuration>-->
<fork>true</fork><!-- 如果没有该项配置肯呢个devtools不会起作用即应用不会restart --> <!-- <fork>true</fork>&lt;!&ndash; 如果没有该项配置肯呢个devtools不会起作用即应用不会restart &ndash;&gt;-->
</configuration> <!-- </configuration>-->
</plugin> <!-- </plugin>-->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

@ -795,15 +795,14 @@ public class IoOrderDetailBizController extends BaseController {
addBizProductReqeust.setOrderEntity(ioOrderEntity); addBizProductReqeust.setOrderEntity(ioOrderEntity);
} }
addBizProductReqeust.setProductType(udiRelevanceResponse.getProductType()); addBizProductReqeust.setProductType(udiRelevanceResponse.getProductType());
BaseResponse response = orderDetailBizService.addBizProduct(addBizProductReqeust); // BaseResponse response = orderDetailBizService.addBizProduct(addBizProductReqeust);
if (response.getCode() != 20000) { // if (response.getCode() != 20000) {
return response; // return response;
} // }
if (i == 0) { // if (i == 0) {
ioOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(response.getData()), IoOrderEntity.class); // ioOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(response.getData()), IoOrderEntity.class);
addBizProductReqeust.setOrderEntity(ioOrderEntity); // addBizProductReqeust.setOrderEntity(ioOrderEntity);
} // }
AddOrderRequest addOrderRequest = new AddOrderRequest(); AddOrderRequest addOrderRequest = new AddOrderRequest();
BeanUtils.copyProperties(ioOrderEntity, addOrderRequest); BeanUtils.copyProperties(ioOrderEntity, addOrderRequest);
@ -850,7 +849,6 @@ public class IoOrderDetailBizController extends BaseController {
} }
//录入阳光采购的追溯码 //录入阳光采购的追溯码
@PostMapping("/udiwms/inout/order/yc/fileUpload") @PostMapping("/udiwms/inout/order/yc/fileUpload")
@CusRedissonAnnotation(cacheName = RedissonCacheKey.XML_UPLOAD, key = {"#billNo"}, timeOutMsg = "系统正在处理,请勿重复上传") @CusRedissonAnnotation(cacheName = RedissonCacheKey.XML_UPLOAD, key = {"#billNo"}, timeOutMsg = "系统正在处理,请勿重复上传")
@ -864,8 +862,7 @@ public class IoOrderDetailBizController extends BaseController {
@PostMapping("/udiwms/inout/order/yc/orderFileUpload") @PostMapping("/udiwms/inout/order/yc/orderFileUpload")
@CusRedissonAnnotation(cacheName = RedissonCacheKey.XML_UPLOAD, key = {"#billNoJson"}, timeOutMsg = "系统正在处理,请勿重复上传") @CusRedissonAnnotation(cacheName = RedissonCacheKey.XML_UPLOAD, key = {"#billNoJson"}, timeOutMsg = "系统正在处理,请勿重复上传")
public BaseResponse ycOrderFileUpload(@RequestParam("billNoJson") String billNoJson, @RequestParam("file") MultipartFile file) { public BaseResponse ycOrderFileUpload(@RequestParam("billNoJson") String billNoJson, @RequestParam("file") MultipartFile file) {
IoOrderEntity ioOrderEntity = alihealthBusService.ycOrderFileUpload(billNoJson,file); return alihealthBusService.ycOrderFileUpload(billNoJson, file);
return ResultVOUtils.success(ioOrderEntity);
} }
} }

@ -4,6 +4,8 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
@Data @Data
public class YcFileOrderUploadVo { public class YcFileOrderUploadVo {
@ -55,7 +57,7 @@ public class YcFileOrderUploadVo {
@ExcelProperty("采购价格(元)") @ExcelProperty("采购价格(元)")
@ColumnWidth(20) @ColumnWidth(20)
private String purchasePrice; private BigDecimal purchasePrice;
@ExcelProperty("挂网价(元)") @ExcelProperty("挂网价(元)")
@ColumnWidth(20) @ColumnWidth(20)

@ -283,4 +283,12 @@ public class IoOrderEntity {
*/ */
@TableField(value = "aliOrderBillNo") @TableField(value = "aliOrderBillNo")
private String aliOrderBillNo; private String aliOrderBillNo;
/**
*
*/
@TableField(value = "ycBillNo")
private String ycBillNo;
} }

@ -6,6 +6,7 @@ import com.glxp.api.entity.alihealth.AliYljgSearchbill;
import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.inout.IoOrderEntity;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
@Data @Data
@ -24,6 +25,11 @@ public class AddBizProductReqeust {
private Integer count; private Integer count;
private Integer productType; private Integer productType;
private String aliOrderBillNo; private String aliOrderBillNo;
private BigDecimal price;
private String ycBillNo;
private String ycBizNo;
private String fromCorp;
List<AddBizProductReqeust> datas; //多选添加 List<AddBizProductReqeust> datas; //多选添加
AliYljgSearchbill aliData; //多选添加 AliYljgSearchbill aliData; //多选添加

@ -1,5 +1,6 @@
package com.glxp.api.service.alihealth; package com.glxp.api.service.alihealth;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.entity.alihealth.AliYljgBillDetail; import com.glxp.api.entity.alihealth.AliYljgBillDetail;
import com.glxp.api.entity.alihealth.AliYljgBillDetailDrug; import com.glxp.api.entity.alihealth.AliYljgBillDetailDrug;
import com.glxp.api.entity.alihealth.AliYljgBillDetailDrugCode; import com.glxp.api.entity.alihealth.AliYljgBillDetailDrugCode;
@ -18,5 +19,5 @@ public interface AlihealthBusService {
void ycFileUpload(String billNo, MultipartFile file); void ycFileUpload(String billNo, MultipartFile file);
IoOrderEntity ycOrderFileUpload(String billNoJson, MultipartFile file); BaseResponse ycOrderFileUpload(String billNoJson, MultipartFile file);
} }

@ -25,9 +25,12 @@ import com.glxp.api.req.inout.AddOrderRequest;
import com.glxp.api.req.inout.FilterOrderRequest; import com.glxp.api.req.inout.FilterOrderRequest;
import com.glxp.api.res.basic.UdiRelevanceResponse; import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.service.alihealth.AlihealthBusService; import com.glxp.api.service.alihealth.AlihealthBusService;
import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.service.inout.IoCodeLostService; import com.glxp.api.service.inout.IoCodeLostService;
import com.glxp.api.service.inout.IoOrderDetailBizService;
import com.glxp.api.service.inout.IoOrderService; import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.service.inout.impl.IoCodeTempService; import com.glxp.api.service.inout.impl.IoCodeTempService;
import com.glxp.api.util.IntUtil;
import com.glxp.api.util.StringUtils; import com.glxp.api.util.StringUtils;
import com.glxp.api.util.alihealth.AlihealthYljgUtils; import com.glxp.api.util.alihealth.AlihealthYljgUtils;
import com.glxp.api.util.udi.FilterUdiUtils; import com.glxp.api.util.udi.FilterUdiUtils;
@ -39,6 +42,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -185,11 +189,43 @@ public class AlihealthBusServiceImpl implements AlihealthBusService {
} }
} }
@Resource
private UdiRelevanceService udiRelevanceService;
@Resource
private IoOrderDetailBizService orderDetailBizService;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public IoOrderEntity ycOrderFileUpload(String billNoJson, MultipartFile file) { public BaseResponse ycOrderFileUpload(String billNoJson, MultipartFile file) {
// 解析请求参数
AddBizProductReqeust bizProductRequest = JSONObject.parseObject(billNoJson, AddBizProductReqeust.class);
// 校验上传文件
validateUploadFile(file);
// 解析Excel文件数据
List<YcFileOrderUploadVo> orderList = getOrderList(file);
if (CollUtil.isEmpty(orderList)) {
throw new JsonException("文件数据为空");
}
// 构建业务请求参数
IoOrderEntity orderEntity = bizProductRequest.getOrderEntity();
bizProductRequest.setProductType(2);
bizProductRequest.setOrderEntity(orderEntity);
AddBizProductReqeust addBizProductReqeust = JSONObject.parseObject(billNoJson, AddBizProductReqeust.class); // 处理每条订单数据
List<AddBizProductReqeust> productRequests = new ArrayList<>();
for (YcFileOrderUploadVo orderUploadVo : orderList) {
AddBizProductReqeust productRequest = buildProductRequest(orderUploadVo, orderEntity, bizProductRequest.getFromCorp());
productRequests.add(productRequest);
}
bizProductRequest.setDatas(productRequests);
return orderDetailBizService.addBizProduct(bizProductRequest);
}
private void validateUploadFile(MultipartFile file) {
try { try {
String fileName = file.getOriginalFilename(); String fileName = file.getOriginalFilename();
String suffix = FileUtil.getSuffix(fileName); String suffix = FileUtil.getSuffix(fileName);
@ -202,75 +238,29 @@ public class AlihealthBusServiceImpl implements AlihealthBusService {
} catch (Exception e) { } catch (Exception e) {
throw new JsonException("上传失败:" + e.getMessage()); throw new JsonException("上传失败:" + e.getMessage());
} }
List<YcFileOrderUploadVo> list = getOrderList(file);
if (CollUtil.isEmpty(list)){
throw new JsonException("文件数据为空");
} }
IoOrderEntity ioOrderEntity = addBizProductReqeust.getOrderEntity(); private AddBizProductReqeust buildProductRequest(YcFileOrderUploadVo orderUploadVo, IoOrderEntity orderEntity, String fromCorp) {
// TODO: 2024/12/25 阳采导入业务明细功能 1、参考阿里的业务导入下方注释的代码搜索 addAliBizProduct 参考 需要考虑 发票的问题 和 后续导出 阳采的单号 和 明细 需要先做存储 有单号追加 orderEntity.setYcBillNo(orderUploadVo.getYcBillNo());
return ioOrderEntity;
// UdiRelevanceResponse udiRelevance = udiRelevanceService.selectByMainIdOne(orderUploadVo.getDrugUnifiedCode());
// IoOrderEntity ioOrderEntity = addBizProductReqeust.getOrderEntity(); if (udiRelevance == null) {
// addBizProductReqeust.setAliOrderBillNo(billCode); throw new JsonException(500, "未通过药品标识获取详情信息!");
// ioOrderEntity.setAliOrderBillNo(billCode); }
// for (int i = 0; i < aliYljgBillDetailDrugList.size(); i++) {
// AliYljgBillDetailDrug aliYljgBillDetailDrug = aliYljgBillDetailDrugList.get(i);
//
//
// String code = aliYljgBillDetailDrug.getAliYljgBillDetailDrugCodeList().get(0).getCode();
// if (StrUtil.isEmpty(code)) {
// return ResultVOUtils.error("单据码为空!");
// }
//
// UdiEntity drugInfo = FilterUdiUtils.getDrugInfo(code);
// if (drugInfo == null) {
// return ResultVOUtils.error("单据码解析药品信息错误!");
// }
//
// //获取药品信息
// String nameCode = drugInfo.getUdi();
// if (StrUtil.isEmpty(nameCode)) {
// return ResultVOUtils.error("单据码解析药品标识错误!");
// }
// FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
// filterUdiRelRequest.setNameCode(nameCode);
// List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceDao.filterUdiRelevance(filterUdiRelRequest);
// if (CollUtil.isEmpty(udiRelevanceResponses)) {
// return ResultVOUtils.error("未通过药品标识获取详情信息!");
// }
// UdiRelevanceResponse udiRelevanceResponse = udiRelevanceResponses.get(0);
// List<AliYljgBillDetailDrugCode> aliYljgBillDetailDrugCodeList1 = aliYljgBillDetailDrug.getAliYljgBillDetailDrugCodeList();
// //1、直接模拟增加biz一行
// addBizProductReqeust.setProductId(String.valueOf(udiRelevanceResponse.getProductId()));
// addBizProductReqeust.setRelId(udiRelevanceResponse.getRelId());
// addBizProductReqeust.setZczbhhzbapzbh(udiRelevanceResponse.getZczbhhzbapzbh());
// addBizProductReqeust.setSupId(udiRelevanceResponse.getSupId());
// addBizProductReqeust.setDatas(null);
// addBizProductReqeust.setCount(aliYljgBillDetailDrugCodeList1.size() * udiCalCountUtil.getCirActCount(udiRelevanceResponse));
//
// addBizProductReqeust.setBatchNo(aliYljgBillDetailDrug.getProduceBatchNo());
// if (StrUtil.isNotEmpty(aliYljgBillDetailDrug.getProduceDate())) {
// addBizProductReqeust.setProductDate(aliYljgBillDetailDrug.getProduceDate().substring(2).replace(" 00:00:00", "").replace("-", ""));
// }
// if (StrUtil.isNotEmpty(aliYljgBillDetailDrug.getValidEndDate())) {
// addBizProductReqeust.setExpireDate(aliYljgBillDetailDrug.getValidEndDate().substring(2).replace(" 00:00:00", "").replace("-", ""));
// }
// if (i == 0) {
// addBizProductReqeust.setOrderEntity(ioOrderEntity);
// }
// addBizProductReqeust.setProductType(udiRelevanceResponse.getProductType());
// BaseResponse response = orderDetailBizService.addBizProduct(addBizProductReqeust);
// if (response.getCode() != 20000) {
// return response;
// }
// if (i == 0) {
// ioOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(response.getData()), IoOrderEntity.class);
// addBizProductReqeust.setOrderEntity(ioOrderEntity);
// }
AddBizProductReqeust productRequest = new AddBizProductReqeust();
productRequest.setProductId(String.valueOf(udiRelevance.getProductId()));
productRequest.setRelId(udiRelevance.getRelId());
productRequest.setZczbhhzbapzbh(udiRelevance.getZczbhhzbapzbh());
productRequest.setDatas(null);
productRequest.setCount(IntUtil.value(orderUploadVo.getShipmentQuantity()));
productRequest.setBatchNo(orderUploadVo.getBatchNumber());
productRequest.setProductType(udiRelevance.getProductType());
productRequest.setYcBizNo(orderUploadVo.getShipmentDetailId());
productRequest.setPrice(orderUploadVo.getPurchasePrice());
productRequest.setSupId(fromCorp);
return productRequest;
} }
public List<YcFileCodeUploadVo> getList(MultipartFile file) { public List<YcFileCodeUploadVo> getList(MultipartFile file) {

@ -66,6 +66,8 @@ public interface UdiRelevanceService extends IService<UdiRelevanceEntity> {
List<UdiRelevanceResponse> selectByMainId(String mainId); List<UdiRelevanceResponse> selectByMainId(String mainId);
UdiRelevanceResponse selectByMainIdOne(String mainId);
UdiRelevanceEntity selectUpteaByAll(String uuid, String thirdId); UdiRelevanceEntity selectUpteaByAll(String uuid, String thirdId);
UdiRelevanceEntity selectByThirdId(String thirdId, String thirdSys); UdiRelevanceEntity selectByThirdId(String thirdId, String thirdSys);

@ -275,6 +275,14 @@ public class UdiRelevanceServiceImpl extends ServiceImpl<UdiRelevanceDao, UdiRel
return udiRelevanceResponses; return udiRelevanceResponses;
} }
@Override
public UdiRelevanceResponse selectByMainIdOne(String mainId) {
List<UdiRelevanceResponse> udiRelevanceResponses = selectByMainId(mainId);
if (udiRelevanceResponses != null && udiRelevanceResponses.size() > 0)
return udiRelevanceResponses.get(0);
return null;
}
@Override @Override
public UdiRelevanceEntity selectUpteaByAll(String uuid, String thirdId) { public UdiRelevanceEntity selectUpteaByAll(String uuid, String thirdId) {
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest(); FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();

@ -438,7 +438,7 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
ioOrderDetailBizEntity.setManufacturer(udiRelevanceResponse.getManufactory()); ioOrderDetailBizEntity.setManufacturer(udiRelevanceResponse.getManufactory());
ioOrderDetailBizEntity.setMeasname(udiRelevanceResponse.getMeasname()); ioOrderDetailBizEntity.setMeasname(udiRelevanceResponse.getMeasname());
ioOrderDetailBizEntity.setSpec(udiRelevanceResponse.getGgxh()); ioOrderDetailBizEntity.setSpec(udiRelevanceResponse.getGgxh());
ioOrderDetailBizEntity.setPrice(udiRelevanceResponse.getPrice()); ioOrderDetailBizEntity.setPrice(item.getPrice());
ioOrderDetailBizEntity.setProductDate(item.getProductDate()); ioOrderDetailBizEntity.setProductDate(item.getProductDate());
ioOrderDetailBizEntity.setExpireDate(item.getExpireDate()); ioOrderDetailBizEntity.setExpireDate(item.getExpireDate());
ioOrderDetailBizEntity.setBatchNo(item.getBatchNo()); ioOrderDetailBizEntity.setBatchNo(item.getBatchNo());

@ -1255,11 +1255,15 @@ CALL Pro_Temp_ColumnWork('io_order', 'aliOrderBillNo',
' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ''阿里来源单号''', ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ''阿里来源单号''',
1); 1);
CALL Pro_Temp_ColumnWork('io_order', 'ycBillNo',
' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ''来源阳采单号''',
1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'detailSort', ' tinyint DEFAULT NULL', 1); CALL Pro_Temp_ColumnWork('basic_udirel', 'detailSort', ' tinyint DEFAULT NULL', 1);
CALL Pro_Temp_ColumnWork('basic_corp', 'adSickNum', ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL', 1); CALL Pro_Temp_ColumnWork('basic_corp', 'adSickNum',
' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL', 1);

Loading…
Cancel
Save