医保相关迁移到云霄妇幼

scpwxyy
yewj 7 months ago
parent 1e8d0a35a3
commit a03b1914fe

@ -129,6 +129,22 @@ public class CtqyyClient extends CommonHttpClient {
private VYpzsIoInfoMapper vYpzsIoInfoMapper;
@Resource
private YbClient ybClient;
@Resource
SysParamConfigService sysParamConfigService;
@Resource
BasicSkProjectMapper basicSkProjectMapper;
@Resource
UdiRlSupDao udiRlSupDao;
@Resource
BasicDestinyRelMapper basicDestinyRelMapper;
@Resource
VInsurNationGoodsPhysicMapper goodsPhysicMapper;
@Resource
VInsurNationGoodsReturnMapper vInsurNationGoodsReturnMapper;
@Resource
VYpzsPresInfoReturnMapper vYpzsPresInfoReturnMapper;
@Resource
private ThrProductsDao thrProductsDao;
/**
* xml
@ -430,8 +446,6 @@ public class CtqyyClient extends CommonHttpClient {
}
}
// public String getStrConut(String str) {
// if (StrUtil.isNotEmpty(str)) {
// return "0";
@ -445,7 +459,6 @@ public class CtqyyClient extends CommonHttpClient {
// return strCount;
// }
/**
*
*
@ -525,8 +538,6 @@ public class CtqyyClient extends CommonHttpClient {
return null;
}
@Resource
SysParamConfigService sysParamConfigService;
@Override
public BaseResponse submitOrders(UdiwmsOrderRequest udiwmsOrderRequest) {
@ -943,12 +954,6 @@ public class CtqyyClient extends CommonHttpClient {
return baseResponse;
}
@Resource
BasicSkProjectMapper basicSkProjectMapper;
@Resource
UdiRlSupDao udiRlSupDao;
@Resource
BasicDestinyRelMapper basicDestinyRelMapper;
@Override
public BaseResponse getInvFeeResult(UdiwmsInvProductsRequest udiwmsInvProductsRequest) {
@ -1164,9 +1169,6 @@ public class CtqyyClient extends CommonHttpClient {
}
@Resource
private ThrProductsDao thrProductsDao;
public UdiwmsOrderDetailRequest buildProductInfo(IoOrderDetailBizEntity detailBizEntity) {
//查询产品信息
BasicUdirelEntity basicUdirel = basicUdirelDao.selectById(detailBizEntity.getBindRlFk());
@ -1358,14 +1360,10 @@ public class CtqyyClient extends CommonHttpClient {
return udiwmsPreInOrderRequest;
}
@Resource
VInsurNationGoodsPhysicMapper goodsPhysicMapper;
@Resource
VInsurNationGoodsReturnMapper vInsurNationGoodsReturnMapper;
@Resource
VYpzsPresInfoReturnMapper vYpzsPresInfoReturnMapper;
/**
* --------------------------------------------------------------------------------------------------------
*/
/**
*
*

@ -12,12 +12,15 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.glxp.mipsdl.client.CommonHttpClient;
import com.glxp.mipsdl.client.yxfuyy.entity.InvCodeResultEntity;
import com.glxp.mipsdl.client.yxfuyy.entity.InvProjectResultEntity;
import com.glxp.mipsdl.client.yxfuyy.entity.InvResultEntity;
import com.glxp.mipsdl.config.ThirdSysConfig;
import com.glxp.mipsdl.constant.BusTypeConstant;
import com.glxp.mipsdl.constant.ConstantType;
import com.glxp.mipsdl.constant.Constants;
import com.glxp.mipsdl.dao.auth.AuthUserDao;
@ -31,10 +34,7 @@ import com.glxp.mipsdl.dao.thrsys.ThrSystemBusApiDao;
import com.glxp.mipsdl.entity.auth.AuthUserEntity;
import com.glxp.mipsdl.entity.auth.AuthWarehouseEntity;
import com.glxp.mipsdl.entity.basic.*;
import com.glxp.mipsdl.entity.ctqyy.BasicSkPrescribeItemEntity;
import com.glxp.mipsdl.entity.ctqyy.MaterialDictEntity;
import com.glxp.mipsdl.entity.ctqyy.PriceClassEntity;
import com.glxp.mipsdl.entity.ctqyy.ThrHslbEntity;
import com.glxp.mipsdl.entity.ctqyy.*;
import com.glxp.mipsdl.entity.inout.*;
import com.glxp.mipsdl.entity.thrsys.ThrCorpEntity;
import com.glxp.mipsdl.entity.thrsys.ThrInvWarehouseEntity;
@ -44,6 +44,7 @@ import com.glxp.mipsdl.http.HttpClient;
import com.glxp.mipsdl.req.base.*;
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;
@ -55,6 +56,8 @@ 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;
import org.dom4j.Document;
@ -71,8 +74,7 @@ import java.util.stream.Collectors;
@Slf4j
@Service(value = "100013HttpClient")
public class YxfyyyClient extends CommonHttpClient {
@Resource
AuthWarehouseUserMapper authWarehouseUserMapper;
@Resource
private ThrSystemDetailService thrSystemDetailService;
@Resource
@ -82,7 +84,6 @@ public class YxfyyyClient extends CommonHttpClient {
private SubmitOrderUtil submitOrderUtil;
@Resource
private IoOrderUploadLogDao orderUploadLogDao;
@Resource
private IoOrderDao orderDao;
@Resource
@ -115,6 +116,22 @@ public class YxfyyyClient extends CommonHttpClient {
BasicProductsDao basicProductsDao;
@Resource
private OrderUploadLogService orderUploadLogService;
@Resource
VInsurNationGoodsPhysicMapper goodsPhysicMapper;
@Resource
VInsurNationGoodsReturnMapper vInsurNationGoodsReturnMapper;
@Resource
VYpzsPresInfoReturnMapper vYpzsPresInfoReturnMapper;
@Resource
private VYpzsPhysicDictMapper vYpzsPhysicDictMapper;
@Resource
private VYpzsPresInfoMapper vYpzsPresInfoMapper;
@Resource
private VYpzsPlanInfoMapper vYpzsPlanInfoMapper;
@Resource
private VYpzsIoInfoMapper vYpzsIoInfoMapper;
@Resource
private YbClient ybClient;
/**
* xml
@ -1286,4 +1303,567 @@ public class YxfyyyClient extends CommonHttpClient {
}
return udiwmsPreInOrderRequest;
}
/**
* --------------------------------------------------------------------------------------------------------
*/
/**
*
*
* @param udiwmsBasicSkPrescribeRequest
* @return
*/
@Override
public BaseResponse getPrescribes(UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest) {
if (IntUtil.value(udiwmsBasicSkPrescribeRequest.getInOutType()) == 0) {
LambdaQueryWrapper<VInsurNationGoodsPhysic> wrapper = new LambdaQueryWrapper<>();
String code = udiwmsBasicSkPrescribeRequest.getCode();
wrapper.and(StrUtil.isNotEmpty(code), t -> t.eq(VInsurNationGoodsPhysic::getSTOOUT_NO, code).or().eq(VInsurNationGoodsPhysic::getRXNO, code));
IPage<VInsurNationGoodsPhysic> page = goodsPhysicMapper
.selectPage(new Page<VInsurNationGoodsPhysic>(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()), wrapper);
return this.covertSellOrder(udiwmsBasicSkPrescribeRequest, page);
} else {
LambdaQueryWrapper<VInsurNationGoodsReturn> wrapper = new LambdaQueryWrapper<>();
String code = udiwmsBasicSkPrescribeRequest.getCode();
wrapper.and(StrUtil.isNotEmpty(code), t -> t.eq(VInsurNationGoodsReturn::getAPPLY_NO, code));
IPage<VInsurNationGoodsReturn> page = vInsurNationGoodsReturnMapper
.selectPage(new Page<VInsurNationGoodsReturn>(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()), wrapper);
return this.covertReturnOrder(udiwmsBasicSkPrescribeRequest, page);
}
}
/**
*
*
* @param udiwmsThrOrderRequest
* @return
*/
@Override
public BaseResponse getThrOrders(UdiwmsThrOrderRequest udiwmsThrOrderRequest) {
PageSimpleResponse<IoCollectOrder> pageSimpleResponse = new PageSimpleResponse<>();
if (udiwmsThrOrderRequest.getBusType().equals(BusTypeConstant.CGJH001.getBusType())) {
LambdaQueryWrapper<VYpzsPlanInfo> wrapper = new LambdaQueryWrapper<>();
//补充其他查询条件
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBillNo()), VYpzsPlanInfo::getCGDBH, udiwmsThrOrderRequest.getBillNo());
IPage<VYpzsPlanInfo> page = vYpzsPlanInfoMapper.selectPage(new Page<VYpzsPlanInfo>(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), wrapper);
List<VYpzsPlanInfo> planInfos = page.getRecords();
List<IoCollectOrder> ioCollectOrders = new ArrayList<>();
if (CollUtil.isNotEmpty(planInfos)) {
Map<String, List<VYpzsPlanInfo>> groupedByBz = planInfos.stream()
.collect(Collectors.groupingBy(VYpzsPlanInfo::getCGDBH));
groupedByBz.forEach((key, value) -> {
VYpzsPlanInfo planInfo = value.get(0);
StringBuilder errorMsg = new StringBuilder();
IoCollectOrder ioCollectOrder = new IoCollectOrder();
ioCollectOrder.setBillNo(planInfo.getCGDBH());
// ioCollectOrder.setBilldate(planInfo.());
ioCollectOrder.setFromType("HIS系统");
ioCollectOrder.setBillTime(new Date());
ioCollectOrder.setFromCorp(planInfo.getSCQYBM());
ioCollectOrder.setFromCorpName(planInfo.getSCQYMC());
ioCollectOrder.setBusType(udiwmsThrOrderRequest.getBusType());
ioCollectOrder.setWorkPlaceCode(udiwmsThrOrderRequest.getWorkPlaceCode());
ioCollectOrder.setCreateTime(new Date());
ioCollectOrder.setUpdateTime(new Date());
ioCollectOrder.setSplitStatus(0);
ioCollectOrder.setTagStatus(0);
List<IoCollectOrderBiz> bizList = new ArrayList<>();
value.forEach(entity -> {
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getYPBM()));
if (basicUdirelEntity != null) {
collectOrderBiz.setRelId(basicUdirelEntity.getId());
} else {
errorMsg.append(entity.getYPMC()).append("字典未对照").append(";");
}
collectOrderBiz.setThrCode(entity.getYPBM());
collectOrderBiz.setCpmctymc(entity.getYPMC());
collectOrderBiz.setBatchNo(entity.getYPBM());
collectOrderBiz.setGgxh(entity.getGGMC());
collectOrderBiz.setCount(entity.getGMSL());
collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo());
collectOrderBiz.setMeasureUnit(entity.getBZDW());
collectOrderBiz.setTagStatus(1);
collectOrderBiz.setUnTagCount(0);
bizList.add(collectOrderBiz);
});
ioCollectOrder.setBizList(bizList);
ioCollectOrders.add(ioCollectOrder);
});
}
pageSimpleResponse.setTotal(page.getTotal());
pageSimpleResponse.setList(ioCollectOrders);
} else {
LambdaQueryWrapper<VYpzsIoInfo> wrapper = new LambdaQueryWrapper<>();
//补充其他查询条件
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBillNo()), VYpzsIoInfo::getPHYSIC_CODE, udiwmsThrOrderRequest.getBillNo());
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBusType()), VYpzsIoInfo::getIO_SORT, udiwmsThrOrderRequest.getBusType());
Page<VYpzsIoInfo> page = vYpzsIoInfoMapper.selectPage(new Page<VYpzsIoInfo>(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), wrapper);
List<VYpzsIoInfo> ioInfos = page.getRecords();
List<IoCollectOrder> ioCollectOrders = new ArrayList<>();
if (CollUtil.isNotEmpty(ioInfos)) {
Map<String, List<VYpzsIoInfo>> groupedByPhysicCode = ioInfos.stream()
.collect(Collectors.groupingBy(VYpzsIoInfo::getRECEIPT_NUMBER));
groupedByPhysicCode.forEach((key, value) -> {
VYpzsIoInfo info = value.get(0);
StringBuilder errorMsg = new StringBuilder();
IoCollectOrder ioCollectOrder = new IoCollectOrder();
ioCollectOrder.setBillNo(info.getPHYSIC_CODE());
ioCollectOrder.setFromType("HIS系统");
ioCollectOrder.setBillTime(DateUtil.parseDate(info.getKEEP_BOOK_TIME()));
ioCollectOrder.setFromCorp(info.getCONSIGNOR());
ioCollectOrder.setFromCorpName(info.getCONSIGNOR_NAME());
ioCollectOrder.setBusType(udiwmsThrOrderRequest.getBusType());
ioCollectOrder.setWorkPlaceCode(udiwmsThrOrderRequest.getWorkPlaceCode());
ioCollectOrder.setCreateTime(new Date());
ioCollectOrder.setUpdateTime(new Date());
ioCollectOrder.setSplitStatus(0);
ioCollectOrder.setTagStatus(0);
List<IoCollectOrderBiz> bizList = new ArrayList<>();
value.forEach(entity -> {
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getPHYSIC_CODE()));
if (basicUdirelEntity != null) {
collectOrderBiz.setRelId(basicUdirelEntity.getId());
} else {
errorMsg.append(entity.getPHYSIC_NAME()).append("字典未对照").append(";");
}
collectOrderBiz.setThrCode(entity.getPHYSIC_CODE());
collectOrderBiz.setCpmctymc(entity.getPHYSIC_NAME());
collectOrderBiz.setBatchNo(entity.getBATCH_NO());
collectOrderBiz.setCount(entity.getQUANTITY());
collectOrderBiz.setYbbm(entity.getCOUNTRY_CODE());
collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo());
collectOrderBiz.setMeasureUnit(entity.getPACK_UNIT1());
collectOrderBiz.setGgxh(entity.getPACK_SPEC() + ":" + entity.getPHYSIC_UNIT());
collectOrderBiz.setTagStatus(1);
collectOrderBiz.setUnTagCount(0);
collectOrderBiz.setRemark1(entity.getRETAIL_PRICE().toString());
collectOrderBiz.setRemark2(entity.getRETAIL_MONEY().toString());
collectOrderBiz.setRemark3(entity.getIMPORT_PRICE().toString());
collectOrderBiz.setRemark4(entity.getIMPORT_MONEY().toString());
collectOrderBiz.setRemark5(entity.getFIXMEDINS_BCHNO());
collectOrderBiz.setRemark6(entity.getRX_FLAG());
collectOrderBiz.setRemark7(entity.getINV_CHG_TYPE());
bizList.add(collectOrderBiz);
});
if (StrUtil.isNotBlank(errorMsg)) {
ioCollectOrder.setErrorMsg(errorMsg.toString());
ioCollectOrder.setTagStatus(4);
}
ioCollectOrder.setBizList(bizList);
ioCollectOrders.add(ioCollectOrder);
});
}
pageSimpleResponse.setTotal(page.getTotal());
pageSimpleResponse.setList(ioCollectOrders);
}
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @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
}
/**
*
*
* @param udiwmsBasicSkPrescribeRequest
* @return
*/
private BaseResponse covertSellOrder(UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest, IPage<VInsurNationGoodsPhysic> page) {
List<VInsurNationGoodsPhysic> presInfoEntities = page.getRecords();
if (CollUtil.isNotEmpty(presInfoEntities)) {
Map<String, List<VInsurNationGoodsPhysic>> groupedByPrescribeNumber = presInfoEntities.stream()
.collect(Collectors.groupingBy(VInsurNationGoodsPhysic::getRXNO));
List<IoCollectOrder> ioCollectOrders = new ArrayList<>();
groupedByPrescribeNumber.forEach((key, value) -> {
VInsurNationGoodsPhysic presInfoEntity = value.get(0);
StringBuilder errorMsg = new StringBuilder();
IoCollectOrder ioCollectOrder = new IoCollectOrder();
ioCollectOrder.setBillNo(presInfoEntity.getRXNO());
ioCollectOrder.setFromType("HIS系统");
ioCollectOrder.setFromCorp(presInfoEntity.getSICK_ID());
ioCollectOrder.setWorkPlaceCode(udiwmsBasicSkPrescribeRequest.getWorkPlaceCode());
ioCollectOrder.setFromCorpName(presInfoEntity.getPSN_NAME());
Date date = DateUtil.parseDate(presInfoEntity.getSEL_RETN_TIME());
ioCollectOrder.setBillTime(date);
ioCollectOrder.setCreateTime(new Date());
ioCollectOrder.setCreateUser(udiwmsBasicSkPrescribeRequest.getCreateUser());
ioCollectOrder.setBackupOrderRemark1(presInfoEntity.getSTOOUT_NO());
ioCollectOrder.setUpdateTime(new Date());
ioCollectOrder.setSplitStatus(0);
ioCollectOrder.setTagStatus(0);
List<IoCollectOrderBiz> bizList = new ArrayList<>();
value.forEach(entity -> {
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getFIXMEDINS_HILIST_ID()));
if (basicUdirelEntity != null) {
collectOrderBiz.setRelId(basicUdirelEntity.getId());
} else {
errorMsg.append(entity.getFIXMEDINS_HILIST_NAME()).append("字典未对照").append(";");
}
VYpzsPresInfo vYpzsPresInfo = vYpzsPresInfoMapper.selectOne(new LambdaQueryWrapper<VYpzsPresInfo>().eq(VYpzsPresInfo::getPRESCRIBE_NUMBER, entity.getRXNO()).eq(VYpzsPresInfo::getPHYSIC_CODE, entity.getFIXMEDINS_HILIST_ID()));
if (vYpzsPresInfo != null) {
collectOrderBiz.setGgxh(vYpzsPresInfo.getPACK_SPEC());
collectOrderBiz.setMeasureUnit(vYpzsPresInfo.getPHYSIC_UNIT());
}
collectOrderBiz.setCount(entity.getSEL_RETN_CNT());
collectOrderBiz.setThrCode(entity.getFIXMEDINS_HILIST_ID());
collectOrderBiz.setCpmctymc(entity.getFIXMEDINS_HILIST_NAME());
collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo());
collectOrderBiz.setYbbm(entity.getMED_LIST_CODG());
collectOrderBiz.setRemark1(entity.getFINL_TRNS_PRIC() + "");
collectOrderBiz.setTagStatus(1);
collectOrderBiz.setUnTagCount(0);
bizList.add(collectOrderBiz);
});
if (StrUtil.isNotBlank(errorMsg)) {
ioCollectOrder.setErrorMsg(errorMsg.toString());
ioCollectOrder.setTagStatus(4);
}
ioCollectOrder.setBizList(bizList);
ioCollectOrders.add(ioCollectOrder);
});
PageSimpleResponse<IoCollectOrder> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(page.getTotal());
pageSimpleResponse.setList(ioCollectOrders);
return ResultVOUtils.success(pageSimpleResponse);
} else {
return ResultVOUtils.error(500, "下载失败!");
}
}
private BaseResponse covertReturnOrder(UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest, IPage<VInsurNationGoodsReturn> page) {
List<VInsurNationGoodsReturn> presInfoEntities = page.getRecords();
if (CollUtil.isNotEmpty(presInfoEntities)) {
Map<String, List<VInsurNationGoodsReturn>> groupedByPrescribeNumber = presInfoEntities.stream()
.collect(Collectors.groupingBy(VInsurNationGoodsReturn::getAPPLY_NO));
List<IoCollectOrder> ioCollectOrders = new ArrayList<>();
groupedByPrescribeNumber.forEach((key, value) -> {
VInsurNationGoodsReturn presInfoEntity = value.get(0);
StringBuilder errorMsg = new StringBuilder();
IoCollectOrder ioCollectOrder = new IoCollectOrder();
ioCollectOrder.setBillNo(presInfoEntity.getAPPLY_NO());
ioCollectOrder.setFromType("HIS系统");
ioCollectOrder.setFromCorp(presInfoEntity.getSICK_ID());
ioCollectOrder.setWorkPlaceCode(udiwmsBasicSkPrescribeRequest.getWorkPlaceCode());
ioCollectOrder.setFromCorpName(presInfoEntity.getPSN_NAME());
Date date = DateUtil.parseDate(presInfoEntity.getSEL_RETN_TIME());
ioCollectOrder.setBillTime(date);
ioCollectOrder.setCreateTime(new Date());
ioCollectOrder.setCreateUser(udiwmsBasicSkPrescribeRequest.getCreateUser());
ioCollectOrder.setUpdateTime(new Date());
ioCollectOrder.setSplitStatus(0);
ioCollectOrder.setTagStatus(0);
List<IoCollectOrderBiz> bizList = new ArrayList<>();
value.forEach(entity -> {
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getFIXMEDINS_HILIST_ID()));
if (basicUdirelEntity != null) {
collectOrderBiz.setRelId(basicUdirelEntity.getId());
} else {
errorMsg.append(entity.getFIXMEDINS_HILIST_NAME()).append("字典未对照").append(";");
}
VYpzsPresInfoReturn vYpzsPresInfo = vYpzsPresInfoReturnMapper.selectOne(new LambdaQueryWrapper<VYpzsPresInfoReturn>().eq(VYpzsPresInfoReturn::getAPPLY_NO, entity.getAPPLY_NO()).eq(VYpzsPresInfoReturn::getPHYSIC_CODE, entity.getFIXMEDINS_HILIST_ID()));
if (vYpzsPresInfo != null) {
collectOrderBiz.setGgxh(vYpzsPresInfo.getPHYSIC_SPEC());
collectOrderBiz.setMeasureUnit(vYpzsPresInfo.getPHYSIC_UNIT());
}
collectOrderBiz.setThrCode(entity.getFIXMEDINS_HILIST_ID());
collectOrderBiz.setCpmctymc(entity.getFIXMEDINS_HILIST_NAME());
// collectOrderBiz.setBatchNo(entity.getBATCH_NUMBER());
collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo());
collectOrderBiz.setYbbm(entity.getMED_LIST_CODG());
collectOrderBiz.setCount(entity.getSEL_RETN_CNT());
collectOrderBiz.setTagStatus(1);
collectOrderBiz.setUnTagCount(0);
bizList.add(collectOrderBiz);
});
if (StrUtil.isNotBlank(errorMsg)) {
ioCollectOrder.setErrorMsg(errorMsg.toString());
ioCollectOrder.setTagStatus(4);
}
ioCollectOrder.setBizList(bizList);
ioCollectOrders.add(ioCollectOrder);
});
PageSimpleResponse<IoCollectOrder> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(page.getTotal());
pageSimpleResponse.setList(ioCollectOrders);
return ResultVOUtils.success(pageSimpleResponse);
} else {
return ResultVOUtils.error(500, "下载失败!");
}
}
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(item.getRemark5())
.rx_flag(item.getRemark6())
.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(item.getRemark7())
.fixmedins_hilist_id(item.getThrCode())
.fixmedins_hilist_name(item.getCpmctymc())
.fixmedins_bchno(item.getRemark5())
.pric(item.getRemark1())
.cnt(item.getActCount())
.rx_flag(item.getRemark6())
.inv_chg_time(item.getUpdateTime())
.inv_chg_opter_name(ioCollectOrder.getCreateUser())
.memo(item.getRemark())
.trdn_flag("0")
.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();
List<CollectOrderBizResponse> collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList();
List<Xsth3506Request> xsth3506Requests = new ArrayList<>();
List<VInsurNationGoodsReturn> vInsurNationGoodsReturns = vInsurNationGoodsReturnMapper.selectList(new LambdaQueryWrapper<VInsurNationGoodsReturn>().eq(VInsurNationGoodsReturn::getAPPLY_NO, ioCollectOrder.getBillNo()));
if (CollUtil.isEmpty(vInsurNationGoodsReturns)) {
log.error("申请单号{}不存在", ioCollectOrder.getBillNo());
return;
}
for (CollectOrderBizResponse item : collectOrderBizResponseList) {
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(item.getRelId());
String itemCode = basicUdirelEntity.getMainId();
for (VInsurNationGoodsReturn vInsurNationGoodsPhysic : vInsurNationGoodsReturns) {
if (vInsurNationGoodsPhysic.getFIXMEDINS_HILIST_ID().equals(itemCode)) {
String[] codes = item.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(vInsurNationGoodsPhysic.getFIXMEDINS_BCHNO())
.setl_id(vInsurNationGoodsPhysic.getSETL_ID())
.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())
.sel_retn_cnt(vInsurNationGoodsPhysic.getSEL_RETN_CNT())
.sel_retn_time(vInsurNationGoodsPhysic.getSEL_RETN_TIME())
.sel_retn_opter_name(vInsurNationGoodsPhysic.getSEL_RETN_OPTER_NAME())
.memo(item.getRemark())
.medins_prod_sel_no(vInsurNationGoodsPhysic.getMEDINS_PROL_SEL_NO())
.mdtrt_sn(vInsurNationGoodsPhysic.getMDTRT_SN())
.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);
}
}

Loading…
Cancel
Save