1.添加平潭协和医院物资字典解析

master
x_z 2 years ago
parent 2fcaa427c6
commit 6a4ff6c0fd

@ -0,0 +1,113 @@
package com.glxp.mipsdl.client.ptxhyy;
import com.alibaba.fastjson2.JSONObject;
import com.glxp.mipsdl.client.BaseHttpClient;
import com.glxp.mipsdl.config.ThirdSysConfig;
import com.glxp.mipsdl.http.HttpClient;
import com.glxp.mipsdl.req.base.*;
import com.glxp.mipsdl.req.post.PostFileThrOrderRequest;
import com.glxp.mipsdl.req.post.PostThrCorpRequest;
import com.glxp.mipsdl.req.post.PostThrInvProductsRequest;
import com.glxp.mipsdl.req.post.PostThrProductsRequest;
import com.glxp.mipsdl.res.BaseResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
*
*/
@Slf4j
@Service(value = "100008HttpClient")
public class PtxhyyClient implements BaseHttpClient {
@Resource
private HttpClient httpClient;
@Resource
private ThirdSysConfig thirdSysConfig;
@Override
public BaseResponse getUnit(UdiwmsUnitRequest udiwmsUnitRequest) {
return null;
}
@Override
public BaseResponse getProducts(UdiwmsProductRequest udiwmsProductRequest) {
return null;
}
@Override
public BaseResponse getOrderTypes(UdiwmsBusTypeRequest udiwmsBusTypeRequest) {
return null;
}
@Override
public BaseResponse getOrders(UdiwmsOrderQueryRequest udiwmsOrderQueryRequest) {
return null;
}
@Override
public BaseResponse submitOrders(UdiwmsOrderRequest udiwmsOrderRequest) {
return null;
}
@Override
public BaseResponse getInvProducts(UdiwmsInvProductsRequest udiwmsInvProductsRequest) {
return null;
}
@Override
public BaseResponse getWarehouse(UdiwmsWarehouseRequest udiwmsWarehouseRequest) {
return null;
}
@Override
public BaseResponse testConnect() {
return null;
}
@Override
public BaseResponse queryUdiInvProducts(UdiwmsQueryUdiInvProductsRequest queryUdiInvProductsRequest) {
return null;
}
@Override
public BaseResponse submitProducts(UdiwmsAddProductsRequest udiwmsAddProductsRequest) {
return null;
}
@Override
public BaseResponse submitUnit(UdiwmsAddUnitRequest udiwmsAddUnitRequest) {
return null;
}
@Override
public BaseResponse submitPreInOrders(UdiwmsPreInOrderRequest udiwmsPreInOrderRequest) {
return null;
}
@Override
public BaseResponse postProducts(PostThrProductsRequest postThrProductsRequest) {
postThrProductsRequest.setUploadType("文件导入");
String response = httpClient.postUDIWMSJson(thirdSysConfig.getPostPiUrl(), postThrProductsRequest);
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
return baseResponse;
}
@Override
public BaseResponse postCorps(PostThrCorpRequest postThrCorpRequest) {
return null;
}
@Override
public BaseResponse postOrderDetail(PostFileThrOrderRequest postFileThrOrderRequest) {
return null;
}
@Override
public BaseResponse postInvProducts(PostThrInvProductsRequest postThrInvProductsRequest) {
return null;
}
}

@ -0,0 +1,78 @@
package com.glxp.mipsdl.client.ptxhyy;
import cn.hutool.core.thread.ThreadUtil;
import com.glxp.mipsdl.client.BaseFileClient;
import com.glxp.mipsdl.req.post.PostThrProductsRequest;
import com.glxp.mipsdl.res.BaseResponse;
import com.glxp.mipsdl.res.udiwms.UdiwmsProductInfoResponse;
import com.glxp.mipsdl.service.file.UdiInfoUploadService;
import com.glxp.mipsdl.util.ExcelUtil;
import com.glxp.mipsdl.util.ExecutorUtil;
import com.glxp.mipsdl.util.ResultVOUtils;
import com.glxp.mipsdl.vo.file.ptxhyy.PtxhyyProductEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
/**
*
*/
@Slf4j
@Service(value = "100008FileClient")
public class PtxhyyFileClient implements BaseFileClient {
@Resource
private UdiInfoUploadService udiInfoUploadService;
@Resource
private ExecutorUtil executorUtil;
@Override
public BaseResponse uploadPi(List<MultipartFile> files, String thirdSys) {
for (int i = 0; i < files.size(); i++) {
MultipartFile file = files.get(i);
if (file.isEmpty()) {
return ResultVOUtils.error(500, "上传第" + (i++) + "个文件失败");
}
try {
InputStream inputStream = file.getInputStream();
ExcelUtil<PtxhyyProductEntity> util = new ExcelUtil(PtxhyyProductEntity.class);
List<UdiwmsProductInfoResponse> udiwmsProductInfoResponses = util.importPi(inputStream);
PostThrProductsRequest postThrProductsRequest = new PostThrProductsRequest();
postThrProductsRequest.setDatas(udiwmsProductInfoResponses);
postThrProductsRequest.setUploadType("文件导入");
postThrProductsRequest.setThirdSys(thirdSys);
executorUtil.getUploadExecutor().execute(ThreadUtil.newThread(() -> {
udiInfoUploadService.postProducts(postThrProductsRequest);
}, "uploadPi"));
log.error("上传完" + System.currentTimeMillis());
} catch (IOException e) {
log.error("解析上传excel文件IO异常异常信息{}", e);
return ResultVOUtils.error(500, "数据异常");
} catch (Exception e) {
log.error("处理产品信息excel文件异常异常信息{}", e);
return ResultVOUtils.error(500, "数据异常");
}
}
return ResultVOUtils.success("文件解析成功,正在上传,请稍后刷新查看");
}
@Override
public BaseResponse uploadCorps(List<MultipartFile> files, String thirdSys) {
return null;
}
@Override
public BaseResponse uploadInvPi(List<MultipartFile> files, String thirdSys) {
return null;
}
@Override
public BaseResponse uploadOrders(List<MultipartFile> files, String thirdSys) {
return null;
}
}

@ -1,9 +1,12 @@
package com.glxp.mipsdl.util; package com.glxp.mipsdl.util;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.glxp.mipsdl.annotation.Excel; import com.glxp.mipsdl.annotation.Excel;
import com.glxp.mipsdl.res.udiwms.UdiwmsProductInfoResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.HSSFDateUtil; import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.ss.usermodel.DateUtil; import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
@ -14,8 +17,9 @@ import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
//@Slf4j @Slf4j
public class ExcelUtil<T> { public class ExcelUtil<T> {
/** /**
* Excel sheet65536 * Excel sheet65536
@ -236,4 +240,20 @@ public class ExcelUtil<T> {
return propertyValue; return propertyValue;
} }
/**
*
*
* @param inputStream
* @return
*/
public List<UdiwmsProductInfoResponse> importPi(InputStream inputStream) throws Exception{
List<T> list = this.importExcel(inputStream);
List<UdiwmsProductInfoResponse> result = new CopyOnWriteArrayList<>();
list.parallelStream().forEach(item -> {
UdiwmsProductInfoResponse udiwmsProductInfoResponse = new UdiwmsProductInfoResponse();
BeanUtil.copyProperties(item, udiwmsProductInfoResponse);
result.add(udiwmsProductInfoResponse);
});
return result;
}
} }

@ -0,0 +1,92 @@
package com.glxp.mipsdl.vo.file.ptxhyy;
import com.glxp.mipsdl.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* excel
*/
@Data
public class PtxhyyProductEntity {
@Excel(name = "LASTUPDATETIME")
private Date updateTime;
@Excel(name="CODE")
private String code;
@Excel(name = "NAME")
private String name;
@Excel(name = "MEASNAME")
private String measname;
@Excel(name = "STANDARD")
private String standard;
@Excel(name = "REGISTERNO")
private String registerNo;
@Excel(name = "MANUFACTORYCODE")
private String manufactoryCode;
@Excel(name = "MANUFACTORY")
private String manufactory;
@Excel(name = "SUPCODE")
private String supCode;
@Excel(name = "SUPNAME")
private String supName;
@Excel(name = "CPLB")
private String cplb;
@Excel(name = "FLBM")
private String flbm;
//器械类别
@Excel(name = "QXLB")
private String qxlb;
//医保编码
@Excel(name = "YBBM")
private String ybbm;
//商品条码
@Excel(name = "SPTM")
private String sptm;
//注册人社会信用号
@Excel(name = "TYSHXYDM")
private String tyshxydm;
//注册/备案人
@Excel(name = "YLQXZCRBARMC")
private String ylqxzcrbarmc;
//注册/备案人英文
@Excel(name = "YLQXZCRBARYWMC")
private String ylqxzcrbarywmc;
//商品名称
@Excel(name = "SPMC")
private String spmc;
//其他编码
@Excel(name = "QTBM")
private String qtbm;
@Excel(name = "CPMS")
private String cpms;
//注册证有效期至
@Excel(name = "ZCZYXQZ")
private String zczyxqz;
@Excel(name = "PRICE")
private String price;
}

@ -1,16 +1,19 @@
spring: spring:
profiles: profiles:
active: dev active: dev
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
server: server:
port: 9997 port: 9997
max-http-header-size: 100MB # tomcat:
tomcat: # max-http-form-post-size: 100MB
max-http-form-post-size: 100MB # accept-count: 100
accept-count: 100 # threads:
threads: # max: 200
max: 200 # min-spare: 10
min-spare: 10
#第三方系统标识 #第三方系统标识
THIRD_ID: thirdId THIRD_ID: thirdId

@ -6,5 +6,6 @@
{"code": "100004", "name": "阳光采购平台"}, {"code": "100004", "name": "阳光采购平台"},
{"code": "100005", "name": "平和县医院"}, {"code": "100005", "name": "平和县医院"},
{"code": "100006", "name": "东山县医院"}, {"code": "100006", "name": "东山县医院"},
{"code": "100007", "name": "云霄中医院"} {"code": "100007", "name": "云霄中医院"},
{"code": "100008", "name": "平潭协和医院"}
] ]
Loading…
Cancel
Save