Merge remote-tracking branch 'origin/ctyxyb' into ctyxyb

# Conflicts:
#	src/main/java/com/glxp/mipsdl/client/ctqyy/CtqyyClient.java
scpwxyy
yewj 7 months ago
commit 668437ca03

@ -280,4 +280,11 @@ public interface BaseHttpClient {
*/
BaseResponse getThrOrders(UdiwmsThrOrderRequest udiwmsThrOrderRequest);
/**
*
* @param postCollectOrderRequest
* @return
*/
BaseResponse uploadCollectOrder(PostCollectOrderRequest postCollectOrderRequest);
}

@ -305,4 +305,8 @@ public abstract class CommonHttpClient implements BaseHttpClient {
public BaseResponse getThrOrders(UdiwmsThrOrderRequest udiwmsThrOrderRequest) {
return null;
}
@Override
public BaseResponse uploadCollectOrder(PostCollectOrderRequest postCollectOrderRequest) {
return null;
}
}

@ -42,6 +42,7 @@ import com.glxp.mipsdl.req.base.*;
import com.glxp.mipsdl.req.base.forthird.ForInvProductsFilter;
import com.glxp.mipsdl.req.ctqyy.*;
import com.glxp.mipsdl.req.post.*;
import com.glxp.mipsdl.req.yb.*;
import com.glxp.mipsdl.req.zaxyy.ZaxzyyOrderRequest;
import com.glxp.mipsdl.req.zzzyy.ZzzyyRequest;
import com.glxp.mipsdl.res.BaseResponse;
@ -54,6 +55,7 @@ import com.glxp.mipsdl.service.order.OrderUploadLogService;
import com.glxp.mipsdl.service.system.SysParamConfigService;
import com.glxp.mipsdl.service.thrsys.ThrCorpService;
import com.glxp.mipsdl.service.thrsys.ThrSystemDetailService;
import com.glxp.mipsdl.service.yb.YbClient;
import com.glxp.mipsdl.thirddao.ctqyy.*;
import com.glxp.mipsdl.util.*;
import lombok.extern.slf4j.Slf4j;
@ -125,7 +127,8 @@ public class CtqyyClient extends CommonHttpClient {
private VYpzsPlanInfoMapper vYpzsPlanInfoMapper;
@Resource
private VYpzsIoInfoMapper vYpzsIoInfoMapper;
@Resource
private YbClient ybClient;
/**
* xml
@ -1466,7 +1469,7 @@ public class CtqyyClient extends CommonHttpClient {
VYpzsIoInfo info = value.get(0);
StringBuilder errorMsg = new StringBuilder();
IoCollectOrder ioCollectOrder = new IoCollectOrder();
ioCollectOrder.setBillNo(info.getRECEIPT_NUMBER());
ioCollectOrder.setBillNo(info.getPHYSIC_CODE());
ioCollectOrder.setFromType("HIS系统");
ioCollectOrder.setBillTime(DateUtil.parseDate(info.getKEEP_BOOK_TIME()));
ioCollectOrder.setFromCorp(info.getCONSIGNOR());
@ -1513,6 +1516,51 @@ public class CtqyyClient extends CommonHttpClient {
}
/**
*
*
* @param postCollectOrderRequest
* @return
*/
@Override
public BaseResponse uploadCollectOrder(PostCollectOrderRequest postCollectOrderRequest) {
String[] buyType_3501 = {"24"};
String[] buyType_3502 = {"7", "6", "5", "4", "1", "16", "12", "28", "35"};
String[] buyType_3505 = {"QXCF001","YPCF002"};
String[] buyType_3506 = {"YPTH001"};
List<IoCollectOrder> collectOrderList = postCollectOrderRequest.getCollectOrderList();
if (CollUtil.isNotEmpty(collectOrderList)) {
for (IoCollectOrder ioCollectOrder : collectOrderList) {
String busType = ioCollectOrder.getBusType();
if (matchBusType(busType, buyType_3501)) {
optionUploadCollectOrder3501(ioCollectOrder);
} else if (matchBusType(busType, buyType_3502)) {
optionUploadCollectOrder3502(ioCollectOrder);
} else if (matchBusType(busType, buyType_3505)) {
optionUploadCollectOrder3505(ioCollectOrder);
}else if (matchBusType(busType, buyType_3506)) {
optionUploadCollectOrder3506(ioCollectOrder);
} else {
return ResultVOUtils.error(500,"业务类型未找到对应上传接口");
}
}
}
return ResultVOUtils.success();
}
// 辅助方法用于检查busType是否存在于指定的buyType数组中
private static boolean matchBusType(String busType, String[] buyTypes) {
for (String buyType : buyTypes) {
if (busType.equals(buyType)) {
return true; // 如果找到匹配项则返回true
}
}
return false; // 如果没有找到匹配项则返回false
}
/**
*
*
@ -1644,6 +1692,221 @@ public class CtqyyClient extends CommonHttpClient {
}
// TODO: 2024/9/10 医保上传
public void optionUploadCollectOrder3505(IoCollectOrder ioCollectOrder){
//摆药流水号
String stoout_no = ioCollectOrder.getBackupOrderRemark1();
List<VInsurNationGoodsPhysic> vInsurNationGoodsPhysics = goodsPhysicMapper.selectList(new LambdaQueryWrapper<VInsurNationGoodsPhysic>().eq(VInsurNationGoodsPhysic::getSTOOUT_NO, stoout_no));
if (CollUtil.isNotEmpty(vInsurNationGoodsPhysics)) {
List<CollectOrderBizResponse> collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList();
List<Xsck3505Request> xsck3505Requests = new ArrayList<>();
for (CollectOrderBizResponse collectOrderBizResponse : collectOrderBizResponseList) {
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(collectOrderBizResponse.getRelId());
String itemCode = basicUdirelEntity.getMainId();
for (VInsurNationGoodsPhysic vInsurNationGoodsPhysic : vInsurNationGoodsPhysics) {
if (vInsurNationGoodsPhysic.getFIXMEDINS_HILIST_ID().equals(itemCode)) {
String[] codes = collectOrderBizResponse.getFinishUdiCode().split(",");
List<DrugInfoRequest> drugTraceList = new ArrayList<>();
// 遍历fruits数组
for (String code : codes) {
DrugInfoRequest request = new DrugInfoRequest();
request.setDrug_trac_codg(code);
drugTraceList.add(request);
}
Xsck3505Request xsck3505Request = Xsck3505Request.builder()
.med_list_codg(vInsurNationGoodsPhysic.getMED_LIST_CODG())
.fixmedins_hilist_id(vInsurNationGoodsPhysic.getFIXMEDINS_HILIST_ID())
.fixmedins_hilist_name(vInsurNationGoodsPhysic.getFIXMEDINS_HILIST_NAME())
.fixmedins_bchno(vInsurNationGoodsPhysic.getFIXMEDINS_BCHNO())
.prsc_dr_cert_type(vInsurNationGoodsPhysic.getPRSC_DR_CERT_TYPE())
.prsc_dr_certno(vInsurNationGoodsPhysic.getPRSC_DR_CERTNO())
.prsc_dr_name(vInsurNationGoodsPhysic.getPRSC_DR_NAME())
.phar_cert_type(vInsurNationGoodsPhysic.getPHAR_CERT_TYPE())
.phar_certno(vInsurNationGoodsPhysic.getPHAR_CERTNO())
.phar_name(vInsurNationGoodsPhysic.getPHAR_NAME())
.phar_prac_cert_no(vInsurNationGoodsPhysic.getPHAR_PRAC_CERT_NO())
.hi_feesetl_type(vInsurNationGoodsPhysic.getHI_FEESETL_TYPE())
.setl_id(vInsurNationGoodsPhysic.getSETL_ID())
.mdtrt_sn(vInsurNationGoodsPhysic.getMDTRT_SN())
.psn_no(vInsurNationGoodsPhysic.getPSN_NO())
.psn_cert_type(vInsurNationGoodsPhysic.getPSN_CERT_TYPE())
.certno(vInsurNationGoodsPhysic.getCERTNO())
.psn_name(vInsurNationGoodsPhysic.getPSN_NAME())
.manu_lotnum(vInsurNationGoodsPhysic.getMANU_LOTNUM())
.manu_date(vInsurNationGoodsPhysic.getMANU_DATE())
.expy_end(vInsurNationGoodsPhysic.getEXPY_END())
.rx_flag(vInsurNationGoodsPhysic.getRX_FLAG())
.trdn_flag(vInsurNationGoodsPhysic.getTRDN_FLAG())
.finl_trns_pric(vInsurNationGoodsPhysic.getFINL_TRNS_PRIC())
.rxno(vInsurNationGoodsPhysic.getRXNO())
.rx_circ_flag(vInsurNationGoodsPhysic.getRX_CIRC_FLAG())
.rtal_docno(vInsurNationGoodsPhysic.getRTAL_DOCNO())
.stoout_no(vInsurNationGoodsPhysic.getSTOOUT_NO())
.bchno(vInsurNationGoodsPhysic.getBCHNO())
.drug_prod_barc(vInsurNationGoodsPhysic.getRUG_PROD_BARC())
.shelf_posi(vInsurNationGoodsPhysic.getSHELF_POSI())
.sel_retn_cnt(vInsurNationGoodsPhysic.getSEL_RETN_CNT())
.sel_retn_time(vInsurNationGoodsPhysic.getSEL_RETN_TIME())
.sel_retn_opter_name(vInsurNationGoodsPhysic.getSEL_RETN_OPTER_NAME())
.memo(vInsurNationGoodsPhysic.getMEMO())
.mdtrt_setl_type(vInsurNationGoodsPhysic.getMDTRT_SETL_TYPE())
.drugtracinfo(drugTraceList).build();
xsck3505Requests.add(xsck3505Request);
}
}
}
BaseXsck3505Request baseXsck3505Request = new BaseXsck3505Request();
baseXsck3505Request.setSelinfoDetail(xsck3505Requests);
String jsonStr = JSONUtil.toJsonStr(baseXsck3505Request);
JSONObject dataJson = JSONObject.parseObject(jsonStr);
ybClient.ybPost("3505A", dataJson);
}
}
public void optionUploadCollectOrder3501(IoCollectOrder ioCollectOrder){
List<IoCollectOrderBiz> bizList = ioCollectOrder.getBizList();
if (CollUtil.isNotEmpty(bizList)) {
List<CollectOrderBizResponse> collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList();
List<Pcsc3501Request> pcsc3501Requests = new ArrayList<>();
for (CollectOrderBizResponse collectOrderBizResponse : collectOrderBizResponseList) {
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(collectOrderBizResponse.getRelId());
String itemCode = basicUdirelEntity.getMainId();
for (IoCollectOrderBiz item : bizList) {
if (item.getNameCode().equals(itemCode)) {
String[] codes = collectOrderBizResponse.getFinishUdiCode().split(",");
List<DrugInfoRequest> drugTraceList = new ArrayList<>();
// 遍历fruits数组
for (String code : codes) {
DrugInfoRequest request = new DrugInfoRequest();
request.setDrug_trac_codg(code);
drugTraceList.add(request);
}
// TODO: 2024/9/10 字段未完全正确对应
Pcsc3501Request pcsc3501Request = Pcsc3501Request.builder()
.med_list_codg(item.getYbbm())
.fixmedins_hilist_id(item.getThrCode())
.fixmedins_hilist_name(item.getCpmctymc())
.fixmedins_bchno("")
.rx_flag("")
.invdate(item.getUpdateTime())
.inv_cnt(item.getActCount())
.manu_lotnum(item.getBatchNo())
.manu_date(item.getProductDate())
.expy_end(item.getExpireDate())
.memo(item.getRemark())
.drugtracinfo(drugTraceList).build();
pcsc3501Requests.add(pcsc3501Request);
}
}
}
BasePcsc3501Request basePcsc3501Request = new BasePcsc3501Request();
basePcsc3501Request.setSelinfoDetail(pcsc3501Requests);
String jsonStr = JSONUtil.toJsonStr(basePcsc3501Request);
JSONObject dataJson = JSONObject.parseObject(jsonStr);
ybClient.ybPost("3501A", dataJson);
}
}
public void optionUploadCollectOrder3502(IoCollectOrder ioCollectOrder){
List<IoCollectOrderBiz> bizList = ioCollectOrder.getBizList();
if (CollUtil.isNotEmpty(bizList)) {
List<CollectOrderBizResponse> collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList();
List<Kcbg3502Request> kcbg3502Requests = new ArrayList<>();
for (CollectOrderBizResponse collectOrderBizResponse : collectOrderBizResponseList) {
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(collectOrderBizResponse.getRelId());
String itemCode = basicUdirelEntity.getMainId();
for (IoCollectOrderBiz item : bizList) {
if (item.getNameCode().equals(itemCode)) {
String[] codes = collectOrderBizResponse.getFinishUdiCode().split(",");
List<DrugInfoRequest> drugTraceList = new ArrayList<>();
// 遍历fruits数组
for (String code : codes) {
DrugInfoRequest request = new DrugInfoRequest();
request.setDrug_trac_codg(code);
drugTraceList.add(request);
}
// TODO: 2024/9/10 字段未完全正确对应
Kcbg3502Request kcbg3502Request = Kcbg3502Request.builder()
.med_list_codg(item.getYbbm())
.inv_chg_type("")
.fixmedins_hilist_id(item.getThrCode())
.fixmedins_hilist_name(item.getCpmctymc())
.fixmedins_bchno("")
.pric(null)
.cnt(item.getActCount())
.rx_flag("")
.inv_chg_time(item.getUpdateTime())
.inv_chg_opter_name(ioCollectOrder.getCreateUser())
.memo(item.getRemark())
.trdn_flag(ioCollectOrder.getSplitStatus() == 0?"0":"1")
.drug_trac_codg(item.getReplaceCode())
.drugtracinfo(drugTraceList).build();
kcbg3502Requests.add(kcbg3502Request);
}
}
}
BaseKcbg3502Request baseKcbg3502Request = new BaseKcbg3502Request();
baseKcbg3502Request.setSelinfoDetail(kcbg3502Requests);
String jsonStr = JSONUtil.toJsonStr(baseKcbg3502Request);
JSONObject dataJson = JSONObject.parseObject(jsonStr);
ybClient.ybPost("3502A", dataJson);
}
}
public void optionUploadCollectOrder3506(IoCollectOrder ioCollectOrder){
List<IoCollectOrderBiz> bizList = ioCollectOrder.getBizList();
if (CollUtil.isNotEmpty(bizList)) {
List<CollectOrderBizResponse> collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList();
List<Xsth3506Request> xsth3506Requests = new ArrayList<>();
for (CollectOrderBizResponse collectOrderBizResponse : collectOrderBizResponseList) {
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(collectOrderBizResponse.getRelId());
String itemCode = basicUdirelEntity.getMainId();
for (IoCollectOrderBiz item : bizList) {
if (item.getNameCode().equals(itemCode)) {
String[] codes = collectOrderBizResponse.getFinishUdiCode().split(",");
List<DrugInfoRequest> drugTraceList = new ArrayList<>();
// 遍历fruits数组
for (String code : codes) {
DrugInfoRequest request = new DrugInfoRequest();
request.setDrug_trac_codg(code);
drugTraceList.add(request);
}
// TODO: 2024/9/10 字段未完全正确对应
Xsth3506Request xsth3506Request = Xsth3506Request.builder()
.med_list_codg(item.getYbbm())
.fixmedins_hilist_id(item.getThrCode())
.fixmedins_hilist_name(item.getCpmctymc())
.fixmedins_bchno("")
.setl_id(null)
.psn_no(null)
.psn_cert_type(null)
.certno(null)
.psn_name(ioCollectOrder.getFromCorp())
.manu_lotnum(item.getBatchNo())
.manu_date(item.getProductDate())
.expy_end(item.getExpireDate())
.rx_flag(null)
.trdn_flag(ioCollectOrder.getSplitStatus() == 0?"0":"1")
.finl_trns_pric(null)
.sel_retn_cnt(BigDecimal.valueOf(item.getActCount()))
.sel_retn_time(ioCollectOrder.getUpdateTime())
.sel_retn_opter_name(ioCollectOrder.getCreateUser())
.memo(item.getRemark())
.medins_prod_sel_no(null)
.mdtrt_sn(null)
.drugtracinfo(drugTraceList).build();
xsth3506Requests.add(xsth3506Request);
}
}
}
BaseXsth3506Request baseXsth3506Request = new BaseXsth3506Request();
baseXsth3506Request.setSelinfoDetail(xsth3506Requests);
String jsonStr = JSONUtil.toJsonStr(baseXsth3506Request);
JSONObject dataJson = JSONObject.parseObject(jsonStr);
ybClient.ybPost("3506A", dataJson);
}
}
}

@ -8,6 +8,7 @@ import com.glxp.mipsdl.req.ctqyy.DlThirdProjectRequest;
import com.glxp.mipsdl.req.ctqyy.FilterThrHslbRequest;
import com.glxp.mipsdl.req.ctqyy.GetSickPrescribeRequest;
import com.glxp.mipsdl.req.ctqyy.GetSickRequest;
import com.glxp.mipsdl.req.post.PostCollectOrderRequest;
import com.glxp.mipsdl.req.post.PostRelProductRequest;
import com.glxp.mipsdl.req.pzh.USignRequest;
import com.glxp.mipsdl.res.BaseResponse;
@ -334,6 +335,15 @@ public class UdiWmsController {
}
// TODO: 2024/9/10 医保上传
/**
*
*
* @param postCollectOrderRequest
* @return
*/
@PostMapping("/udiwms/erp/uploadCollectOrder")
public BaseResponse uploadCollectOrder(@RequestBody PostCollectOrderRequest postCollectOrderRequest) {
return ClientProcessor.getHttpClient().uploadCollectOrder(postCollectOrderRequest);
}
}

@ -0,0 +1,10 @@
package com.glxp.mipsdl.req.yb;
import lombok.Data;
import java.util.List;
@Data
public class BaseKcbg3502Request {
private List<Kcbg3502Request> selinfoDetail;
}

@ -0,0 +1,10 @@
package com.glxp.mipsdl.req.yb;
import lombok.Data;
import java.util.List;
@Data
public class BasePcsc3501Request {
private List<Pcsc3501Request> selinfoDetail;
}

@ -0,0 +1,10 @@
package com.glxp.mipsdl.req.yb;
import lombok.Data;
import java.util.List;
@Data
public class BaseXsth3506Request {
private List<Xsth3506Request> selinfoDetail;
}

@ -1,14 +1,21 @@
package com.glxp.mipsdl.req.yb;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
*
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Kcbg3502Request {
/**
@ -62,11 +69,16 @@ public class Kcbg3502Request {
/**
*
*/
private String drugtracinfo;
// private String drugtracinfo;
/**
*
*/
private List<DrugInfoRequest> drugtracinfo;
/**
*
*/
private String drug_trac_codg;
}

@ -1,14 +1,20 @@
package com.glxp.mipsdl.req.yb;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
*
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Pcsc3501Request {
/**
@ -46,19 +52,28 @@ public class Pcsc3501Request {
/**
*
*/
private Date manu_date;
private String manu_date;
/**
*
*/
private Date expy_end;
private String expy_end;
/**
*
*/
private String memo;
// /**
// * 溯源码节点信息
// */
// private String drugtracinfo;
/**
*
*/
private String drugtracinfo;
private List<DrugInfoRequest> drugtracinfo;
/**
*
*/
private String drug_trac_codg;
}

@ -1,14 +1,21 @@
package com.glxp.mipsdl.req.yb;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 退
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Xsth3506Request {
@ -65,12 +72,12 @@ public class Xsth3506Request {
/**
*
*/
private Date manu_date;
private String manu_date;
/**
*
*/
private Date expy_end;
private String expy_end;
/**
*
@ -117,10 +124,14 @@ public class Xsth3506Request {
*/
private String mdtrt_sn;
/**
*
*/
private String drugtracinfo;
private List<DrugInfoRequest> drugtracinfo;
private String drug_trac_codg;
}

Loading…
Cancel
Save