diff --git a/src/main/java/com/glxp/mipsdl/client/scpwxyy/ScpwxyyClient.java b/src/main/java/com/glxp/mipsdl/client/scpwxyy/ScpwxyyClient.java deleted file mode 100644 index c978fca..0000000 --- a/src/main/java/com/glxp/mipsdl/client/scpwxyy/ScpwxyyClient.java +++ /dev/null @@ -1,2060 +0,0 @@ -package com.glxp.mipsdl.client.scpwxyy; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ReflectUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.json.JSONUtil; -import com.alibaba.fastjson.JSON; -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.StringUtils; -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; -import com.glxp.mipsdl.dao.auth.AuthWarehouseDao; -import com.glxp.mipsdl.dao.basic.*; -import com.glxp.mipsdl.dao.inout.*; -import com.glxp.mipsdl.dao.thrsys.ThrInvWarehouseDao; -import com.glxp.mipsdl.dao.thrsys.ThrProductsDao; -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.*; -import com.glxp.mipsdl.entity.inout.*; -import com.glxp.mipsdl.entity.system.ThrYbSetupMapper; -import com.glxp.mipsdl.entity.thrsys.ThrCorpEntity; -import com.glxp.mipsdl.entity.thrsys.ThrInvWarehouseEntity; -import com.glxp.mipsdl.entity.thrsys.ThrProductsEntity; -import com.glxp.mipsdl.entity.thrsys.ThrSystemBusApiEntity; -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; -import com.glxp.mipsdl.res.PageSimpleResponse; -import com.glxp.mipsdl.res.ctqyy.CtBaseResponse; -import com.glxp.mipsdl.res.udiwms.*; -import com.glxp.mipsdl.service.auth.AuthWarehouseService; -import com.glxp.mipsdl.service.basic.RelCodeDetailService; -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; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.util.*; -import java.util.stream.Collectors; - -@Slf4j -@Service(value = "100014HttpClient") -public class ScpwxyyClient extends CommonHttpClient { - private final String[] buyType_3501 = {"24"}; - private final String[] buyType_3502 = {"7", "6", "5", "4", "1", "16", "12", "28", "35"}; - private final String[] buyType_3505 = {"QXCF001", "YPCF002"}; - private final String[] buyType_3506 = {"YPTH001"}; - - @Resource - private ThrSystemDetailService thrSystemDetailService; - @Resource - private HttpClient httpClient; - - @Resource - private SubmitOrderUtil submitOrderUtil; - @Resource - private IoOrderUploadLogDao orderUploadLogDao; - @Resource - private IoOrderDao orderDao; - @Resource - private ThrSystemBusApiDao thrSystemBusApiDao; - @Resource - private BasicBussinessTypeDao basicBussinessTypeDao; - @Resource - private BasicCorpDao basicCorpDao; - @Resource - private IoCodeDao codeDao; - @Resource - private AuthWarehouseDao authWarehouseDao; - @Resource - private ThrInvWarehouseDao thrInvWarehouseDao; - @Resource - private AuthWarehouseService authWarehouseService; - @Resource - private ThirdSysConfig thirdSysConfig; - @Resource - private ThrCorpService thrCorpService; - @Resource - private IoOrderDetailBizDao orderDetailBizDao; - @Resource - private IoOrderDetailCodeDao orderDetailCodeDao; - @Resource - private AuthUserDao authUserDao; - @Resource - BasicUdirelDao basicUdirelDao; - @Resource - 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; - @Resource - private ThrYbSetupMapper thrYbSetupMapper; - @Resource - private RelCodeDetailService relCodeDetailService; - - /** - * 拼接xml请求头 - * - * @param methodName 方法名 - * @return - */ - public String getMsgHeader(String methodName) { - return "" + - "" + - "" + - methodName + - "" + - ""; - } - - - public String parserResult(String response) { - if (response.contains(" zzzyyProductsResponse = JSON.parseArray(map.get("list") + "", ZzzyyProductsResponse.class); - for (ZzzyyProductsResponse productsResponse : zzzyyProductsResponse) { - //判断要是规格和型号一致就是取规格 不一致就合并 - if (StrUtil.isNotEmpty(productsResponse.getModel_number()) && StrUtil.isNotEmpty(productsResponse.getStandard())) { - if (productsResponse.getModel_number().equals(productsResponse.getStandard())) { - productsResponse.setStandard(productsResponse.getStandard()); - } else { - productsResponse.setStandard(productsResponse.getStandard() + productsResponse.getModel_number()); - } - } else if (StrUtil.isNotEmpty(productsResponse.getModel_number()) && StrUtil.isBlank(productsResponse.getStandard())) { - productsResponse.setStandard(productsResponse.getModel_number()); - } - productsResponse.setProductType(1); - } - map.put("list", JSON.toJSON(zzzyyProductsResponse)); - baseResponse.setData(""); - baseResponse.setData(map); - return baseResponse; - } catch (Exception e) { - log.error("解析长泰区医院智业接口返回产品信息字典数据异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - } else if (udiwmsProductRequest.getProductType().equals(Constants.PRODUCT_TYPE_DRUG)) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper(); - //补充其他查询条件 - wrapper.eq(StrUtil.isNotBlank(udiwmsProductRequest.getCode()), VYpzsPhysicDict::getPHYSIC_CODE, udiwmsProductRequest.getCode()); - wrapper.eq(StrUtil.isNotBlank(udiwmsProductRequest.getName()), VYpzsPhysicDict::getPHYSIC_NAME, udiwmsProductRequest.getName()); - wrapper.eq(StrUtil.isNotBlank(udiwmsProductRequest.getRegisterNo()), VYpzsPhysicDict::getPHYSIC_NO, udiwmsProductRequest.getRegisterNo()); - IPage page = vYpzsPhysicDictMapper.selectPage(new Page(udiwmsProductRequest.getPage(), udiwmsProductRequest.getLimit()), wrapper); - List physicDictEntities = page.getRecords(); - List thrProductsEntityList = null; - if (CollUtil.isNotEmpty(physicDictEntities)) { - //数据处理以thr_products 返回 - thrProductsEntityList = physicDictEntities.stream().map(dict -> { - ThrProductsEntity products = new ThrProductsEntity(); - products.setCode(dict.getPHYSIC_CODE()); - products.setName(dict.getPHYSIC_NAME()); - products.setMeasname(dict.getPACK_UNIT()); - products.setSpec(dict.getPACK_SPEC()); - products.setYbbm(dict.getCOUNTRY_CODE()); - products.setPrepnSpec(dict.getPHYSIC_SPEC()); - products.setPrepnUnit(dict.getPHYSIC_UNIT()); - products.setProductType(2); - return products; - }).collect(Collectors.toList()); - } - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); - pageSimpleResponse.setTotal(page.getTotal()); - pageSimpleResponse.setList(thrProductsEntityList); - return ResultVOUtils.success(pageSimpleResponse); - } - log.error("解析长泰区医院医疗类型,返回结果:{}", udiwmsProductRequest.getProductType()); - return ResultVOUtils.error(500, "医疗类型不正确,productType:" + udiwmsProductRequest.getProductType()); - } - - @Override - public BaseResponse getOrderTypes(UdiwmsBusTypeRequest udiwmsBusTypeRequest) { - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getMaterialType")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsBusTypeRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_BUS_TYPE_QUERY_URL), ctqyyRequest); - response = parserResult(response); - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - return baseResponse; - } catch (Exception e) { - log.error("解析四川武平县医院智业接口返回单据类型数据异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - } - - /** - * 提交关联产品更新 - * - * @return - */ - @Override - public BaseResponse postRelProduct(PostRelProductRequest postThrInvProductsRequest) { - UdiRelevanceResponse udiRelevanceResponse = postThrInvProductsRequest.getUdiRelevanceResponse(); - - if (udiRelevanceResponse == null) { - return ResultVOUtils.error(500, "提交产品列表不能为空!"); - } - MaterialDictEntity materialDictEntity = new MaterialDictEntity(); - if (StrUtil.isEmpty(udiRelevanceResponse.getMainId()) && StrUtil.isNotEmpty(udiRelevanceResponse.getOriginUuid())) - materialDictEntity.setOperatType("1"); - else - materialDictEntity.setOperatType("2"); - materialDictEntity.setMaterialName(udiRelevanceResponse.getCpmctymc()); - materialDictEntity.setCostlySign("1"); - if (StrUtil.isNotEmpty(udiRelevanceResponse.getMainId()) && udiRelevanceResponse.getMainId().endsWith("x")) { - materialDictEntity.setMaterialMasterCode(null); - materialDictEntity.setHisMaterialCode(null); - materialDictEntity.setCostlySign("0"); - materialDictEntity.setOperatType("1"); - } else { - materialDictEntity.setMaterialMasterCode(udiRelevanceResponse.getNameCode()); - materialDictEntity.setHisMaterialCode(udiRelevanceResponse.getMainId()); - } - - materialDictEntity.setMaterialSpec(udiRelevanceResponse.getGgxh()); - materialDictEntity.setMaterialUnit(udiRelevanceResponse.getMeasname()); - //暂无区分进货价,零售价 - materialDictEntity.setImportPrice(udiRelevanceResponse.getPrice() == null ? "0" : udiRelevanceResponse.getPrice().toString()); - materialDictEntity.setRetailPrice(udiRelevanceResponse.getPrice() == null ? "0" : udiRelevanceResponse.getPrice().toString()); - materialDictEntity.setFactoryName(udiRelevanceResponse.getManufactory()); - materialDictEntity.setSupplierName(udiRelevanceResponse.getSupName()); - materialDictEntity.setInsuranceCode(udiRelevanceResponse.getYbbm()); - materialDictEntity.setRegeditNo(udiRelevanceResponse.getZczbhhzbapzbh()); - materialDictEntity.setMaterialClass(udiRelevanceResponse.getBasicPrductRemak7()); - //暂无中标标识 - materialDictEntity.setPublicFlag("1"); - materialDictEntity.setPriceItemClass(udiRelevanceResponse.getBasicPrductRemak8()); - //暂无收费标志 - materialDictEntity.setFeeFlag(udiRelevanceResponse.getBasicPrductRemak6()); - - - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("addMaterialDict")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(materialDictEntity)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_PRODUCT_SUBMIT_URL), ctqyyRequest); - response = parserResult(response); - try { - log.error("提交新增产品信息:" + ctqyyRequest.getMsgBody()); - CtBaseResponse baseResponse = JSONObject.parseObject(response, CtBaseResponse.class); - if (baseResponse.getCode() != 20000) { - String errMsg = "提交新增产品信息,异常:{}" + response; - log.error(errMsg); - return ResultVOUtils.error(500, "提交新增产品失败!"); - - } else { -// materialDictEntity.setMaterialNo(baseResponse.getMaterialNo()); - log.error("提交新增产品信息,成功:{}", response); - return ResultVOUtils.success(baseResponse.getMaterialNo()); - } - } catch (Exception e) { - String errMsg = "提交新增产品信息,异常:{}" + response; - log.error(errMsg); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, errMsg); - - } - } - - - /** - * 获取患者信息 - * - * @param getSickRequest - * @return - */ - public BaseResponse getSickInfo(GetSickRequest getSickRequest) { - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getSickVisitInfo")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(getSickRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URI_GET_SICKER), ctqyyRequest); - response = parserResult(response); - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - Map map = (Map) baseResponse.getData(); - List basicSkSickerResponses = JSON.parseArray(map.get("list") + "", BasicSkSickerResponse.class); -// for (BasicSkSickerResponse productsResponse : basicSkSickerResponses) { -// -// } - map.put("list", JSON.toJSON(basicSkSickerResponses)); - baseResponse.setData(""); - baseResponse.setData(map); - return baseResponse; - } catch (Exception e) { - log.error("解析长泰医院智业返回病人信息数据异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - } - - /** - * 获取患者处方信息 - * - * @param getSickPrescribeRequest - * @return - */ - public BaseResponse getSickPescribe(GetSickPrescribeRequest getSickPrescribeRequest) { - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getResiPresInfo")); - getSickPrescribeRequest.setResiNo(getSickPrescribeRequest.getAdNum()); - getSickPrescribeRequest.setAdNum(null); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(getSickPrescribeRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URI_GET_SICKER_PRESCIRBE), ctqyyRequest); - response = parserResult(response); - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - Map map = (Map) baseResponse.getData(); - List basicSkPrescribeResponses = JSON.parseArray(map.get("list") + "", BasicSkPrescribeResponse.class); - for (BasicSkPrescribeResponse basicSkPrescribeResponse : basicSkPrescribeResponses) { - List itemEntities = basicSkPrescribeResponse.getItemList(); - if (CollUtil.isNotEmpty(itemEntities)) { - for (BasicSkPrescribeItemEntity itemEntity : itemEntities) { - itemEntity.setCount("0"); - } - } - } - map.put("list", JSON.toJSON(basicSkPrescribeResponses)); - baseResponse.setData(""); - baseResponse.setData(map); - return baseResponse; - } catch (Exception e) { - log.error("解析长泰医院智业返回处方信息数据异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - - } - - -// public String getStrConut(String str) { -// if (StrUtil.isNotEmpty(str)) { -// return "0"; -// } -// Pattern pattern = Pattern.compile("\\d+"); -// Matcher matcher = pattern.matcher(str); -// String strCount = ""; -// while (matcher.find()) { -// strCount = strCount + matcher.group(); -// } -// return strCount; -// } - - - /** - * 获取项目组套字典 - * - * @param dlThirdProjectRequest - * @return - */ - @Override - public BaseResponse getBasicProject(DlThirdProjectRequest dlThirdProjectRequest) { - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getMaterialDict")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(dlThirdProjectRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URI_GET_PROJECT), ctqyyRequest); - response = parserResult(response); - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - Map map = (Map) baseResponse.getData(); - List basicSkProjectResponses = JSON.parseArray(map.get("list") + "", BasicSkProjectResponse.class); - for (BasicSkProjectResponse basicSkProjectResponse : basicSkProjectResponses) { - - } - map.put("list", JSON.toJSON(basicSkProjectResponses)); - baseResponse.setData(""); - baseResponse.setData(map); - return baseResponse; - } catch (Exception e) { - log.error("解析长泰医院智业返回项目信息数据异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - } - - - /** - * 获取核算类别 - * - * @param hslbRequest - * @return - */ - @Override - public BaseResponse getHsfl(FilterThrHslbRequest hslbRequest) { - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getItemClass")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(hslbRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URI_GET_HSLB), ctqyyRequest); - response = parserResult(response); - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - Map map = (Map) baseResponse.getData(); - List priceClassEntities = JSON.parseArray(map.get("list") + "", PriceClassEntity.class); - - List hslbEntities = new ArrayList<>(); - for (PriceClassEntity priceClassEntity : priceClassEntities) { - ThrHslbEntity thrHslbEntity = new ThrHslbEntity(); - thrHslbEntity.setHsbm(priceClassEntity.getClassCode()); - thrHslbEntity.setHsmc(priceClassEntity.getClassName()); - hslbEntities.add(thrHslbEntity); - } - map.put("list", JSON.toJSON(hslbEntities)); - baseResponse.setData(""); - baseResponse.setData(map); - return baseResponse; - } catch (Exception e) { - log.error("解析长泰医院智业返回物价类别信息异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - } - - - @Override - public BaseResponse getOrders(UdiwmsOrderQueryRequest udiwmsOrderQueryRequest) { - return null; - } - - @Resource - SysParamConfigService sysParamConfigService; - - @Override - public BaseResponse submitOrders(UdiwmsOrderRequest udiwmsOrderRequest) { - if (StrUtil.isBlank(udiwmsOrderRequest.getBillNo())) { - return ResultVOUtils.error(500, "单据号不能为空"); - } - - ZaxzyyOrderRequest zaxzyyOrderRequest = new ZaxzyyOrderRequest(); - BeanUtil.copyProperties(udiwmsOrderRequest, zaxzyyOrderRequest); - //查询单据和详情信息,组装第三方系统接口所需参数 - IoOrderEntity orderEntity = orderDao.selectOne(new QueryWrapper().eq("billNo", udiwmsOrderRequest.getBillNo())); - - zaxzyyOrderRequest.setBillDate(DateUtil.formatDateTime(orderEntity.getCreateTime())); - //查询对应的第三方单据类型 - ThrSystemBusApiEntity thrSystemBusApiEntity = thrSystemBusApiDao.selectOne(new QueryWrapper().eq("code", udiwmsOrderRequest.getBillType())); - zaxzyyOrderRequest.setThirdSys(getUserName(orderEntity)); - zaxzyyOrderRequest.setBillType(thrSystemBusApiEntity.getThirdBuyCode()); - zaxzyyOrderRequest.setBillFlag("1"); - - //查询单据类型 - BasicBussinessTypeEntity basicBussinessTypeEntity = basicBussinessTypeDao.selectByAction(udiwmsOrderRequest.getBillType()); - if (basicBussinessTypeEntity.getCorpType().equals(Constants.CORP_HOSPTIAL)) { - //医院客户 - zaxzyyOrderRequest.setCorpId(orderEntity.getFromCorp()); - //查询客户名称 - String corpName = basicCorpDao.selectNameByErpId(orderEntity.getFromCorp()); - zaxzyyOrderRequest.setCorpName(corpName); - } else if (basicBussinessTypeEntity.getCorpType().equals(Constants.CORP_INTTERNAL)) { - //内部科室 - BasicCorpEntity basicCorpEntity = null; - if (StrUtil.isNotEmpty(orderEntity.getFromCorp())) { - basicCorpEntity = basicCorpDao.selectByErpId(orderEntity.getFromCorp()); - } - if (basicCorpEntity != null) { - zaxzyyOrderRequest.setCorpId(basicCorpEntity.getThirdId()); - zaxzyyOrderRequest.setCorpName(basicCorpEntity.getName()); - } else { - AuthWarehouseEntity warehouseEntity = authWarehouseDao.selectOne(new QueryWrapper().eq("code", udiwmsOrderRequest.getCorpId())); - try { - //根据第三方系统标识,获取对应字段的值 - ThrInvWarehouseEntity thrInvWarehouseEntity = thrInvWarehouseDao.selectOne(new LambdaQueryWrapper() - .eq(ThrInvWarehouseEntity::getCode, authWarehouseService.getThirdInvCode(warehouseEntity)) - .eq(ThrInvWarehouseEntity::getThirdSysFk, thirdSysConfig.getThirdId())); - - zaxzyyOrderRequest.setCorpId(thrInvWarehouseEntity.getCode()); - zaxzyyOrderRequest.setCorpName(thrInvWarehouseEntity.getName()); - } catch (Exception e) { - String msg = "查询单据对应往来单位的第三方仓库信息异常"; - orderUploadLogService.updateLocalErr(orderEntity, msg); - log.error("----单据提交-----" + orderEntity.getBillNo() + msg); - return ResultVOUtils.error(500, msg); - } - } - - } else { - //供应商 - BasicCorpEntity basicCorpEntity = null; - if (StrUtil.isNotEmpty(orderEntity.getFromCorp())) { - basicCorpEntity = basicCorpDao.selectByErpId(orderEntity.getFromCorp()); - } - if (basicCorpEntity != null) { - zaxzyyOrderRequest.setCorpId(basicCorpEntity.getThirdId()); - zaxzyyOrderRequest.setCorpName(basicCorpEntity.getName()); - } else { - String msg = "查询单据对应的第三方往来单位信息异常"; - orderUploadLogService.updateLocalErr(orderEntity, msg); - log.error("----单据提交-----" + orderEntity.getBillNo() + msg); - return ResultVOUtils.error(500, msg); - } - } - - - //查询仓库信息 - AuthWarehouseEntity warehouseEntity = authWarehouseDao.selectOne(new QueryWrapper().eq("code", orderEntity.getInvCode())); - try { - ThrInvWarehouseEntity thrInvWarehouseEntity = thrInvWarehouseDao.selectOne(new LambdaQueryWrapper() - .eq(ThrInvWarehouseEntity::getCode, authWarehouseService.getThirdInvCode(warehouseEntity)) - .eq(ThrInvWarehouseEntity::getThirdSysFk, thirdSysConfig.getThirdId())); - - zaxzyyOrderRequest.setLocInvCode(thrInvWarehouseEntity.getCode()); - zaxzyyOrderRequest.setLocInvName(thrInvWarehouseEntity.getName()); - - zaxzyyOrderRequest.setLocStorageCode(thrInvWarehouseEntity.getCode()); - zaxzyyOrderRequest.setLocStorageName(thrInvWarehouseEntity.getName()); - } catch (Exception e) { - log.error("查询第三方系统仓库信息异常", e); - String msg = "查询第三方系统仓库信息异常"; - orderUploadLogService.updateLocalErr(orderEntity, msg); - return ResultVOUtils.error(500, msg); - } - - //设置单据出入库类型 - if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { - zaxzyyOrderRequest.setInoutType(1); //入库 - } else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { - zaxzyyOrderRequest.setInoutType(2); //出库 - } - - //设置备注信息 - zaxzyyOrderRequest.setRemark("udi管理系统提交单据"); - //组装单据明细数据 - List ioCodeEntities = codeDao.selectList(new QueryWrapper() - .eq("orderId", orderEntity.getBillNo()) - .ne("action", "StockCheck") - ); - List items = new ArrayList<>(); - //查询业务单据详情 - List detailBizEntities = orderDetailBizDao.selectList(new QueryWrapper().eq("orderIdFk", orderEntity.getBillNo())); - String errMsg = setOrderDetailList(ioCodeEntities, items, detailBizEntities); - zaxzyyOrderRequest.setItem(items); - if (CollUtil.isEmpty(items)) { - orderUploadLogService.updateLocalErr(orderEntity, errMsg); - return ResultVOUtils.error(500, errMsg); - } - - if (StrUtil.isNotEmpty(errMsg)) { - orderUploadLogService.updateLocalErr(orderEntity, errMsg); - return ResultVOUtils.error(500, errMsg); - } - - - for (UdiwmsOrderDetailRequest i : items) { - String fphm = ""; - String fprq = null; - List invoiceList = IoOrderInvoiceEntity.builder().build() - .selectList(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class).eq(IoOrderInvoiceEntity::getOrderIdFk, orderEntity.getBillNo()) - .eq(IoOrderInvoiceEntity::getBindRlFk, i.getBindRlFk()) - .eq(StrUtil.isNotEmpty(i.getBatchNo()), IoOrderInvoiceEntity::getBatchNo, i.getBatchNo()). - groupBy(IoOrderInvoiceEntity::getInvoiceEncode)); - if (CollectionUtil.isNotEmpty(invoiceList)) { - fphm = invoiceList.stream().map(IoOrderInvoiceEntity::getInvoiceEncode).collect(Collectors.joining(",")); - if (invoiceList.get(0).getInvoiceDate() != null) - fprq = DateUtil.formatDateTime(invoiceList.get(0).getInvoiceDate()); - } - i.setFirstSalesInvNo(fphm); - i.setSecSalesInvNo(fphm); - i.setInvoiceDate(fprq); - } - - - //构造诏安接口参数 - ZzzyyRequest zaZyRequest = new ZzzyyRequest(); - - //提交到第三方系统 - if (thrSystemBusApiEntity.getUrl().equals("saveMasterialInput")) { -// //采购入库单据 -// if (vailHightMaterial(detailBizEntities.get(0))) { -// zaZyRequest.setMsgHeader(getMsgHeader("saveMaterialHight")); -// UdiwmsPreInOrderRequest udiwmsPreInOrderRequest = submitPreInOrderToThirdSys(zaxzyyOrderRequest, orderEntity); -// zaZyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsPreInOrderRequest)); -// } else { -// zaZyRequest.setMsgHeader(getMsgHeader("saveMasterialInput")); -// zaZyRequest.setMsgBody(JSONUtil.toJsonStr(zaxzyyOrderRequest)); -// } - Boolean b = sysParamConfigService.selectByKey("ct_split_groupbuy"); - if (b) { - Map> splitMap = items.stream() - .collect(Collectors.groupingBy(UdiwmsOrderDetailRequest::getFirstSalesInvNo)); - BaseResponse baseResponse = null; - int index = 1; - if (splitMap.size() > 1) { - for (List splitItems : splitMap.values()) { - zaxzyyOrderRequest.setItem(splitItems); - zaZyRequest.setMsgHeader(getMsgHeader("saveMasterialInput")); - zaZyRequest.setMsgBody(JSONUtil.toJsonStr(zaxzyyOrderRequest)); - orderEntity.setBillNo(orderEntity.getBillNo() + "-" + index); - baseResponse = submitOrder(orderEntity, zaZyRequest); - } - return baseResponse; - } else { - zaZyRequest.setMsgHeader(getMsgHeader("saveMasterialInput")); - zaZyRequest.setMsgBody(JSONUtil.toJsonStr(zaxzyyOrderRequest)); - return submitOrder(orderEntity, zaZyRequest); - } - } else { - zaZyRequest.setMsgHeader(getMsgHeader("saveMasterialInput")); - zaZyRequest.setMsgBody(JSONUtil.toJsonStr(zaxzyyOrderRequest)); - return submitOrder(orderEntity, zaZyRequest); - } - - - } else if (thrSystemBusApiEntity.getUrl().equals("saveMaterialHight")) { - -// // 1.先提交到物资 -// zaZyRequest.setMsgHeader(getMsgHeader("saveMasterialInput")); -// zaZyRequest.setMsgBody(JSONUtil.toJsonStr(zaxzyyOrderRequest)); -// submitOrder(orderEntity, zaZyRequest); - - - //2.提交到预备货 - zaZyRequest.setMsgHeader(getMsgHeader("saveMaterialHight")); - UdiwmsPreInOrderRequest udiwmsPreInOrderRequest = submitPreInOrderToThirdSys(zaxzyyOrderRequest, orderEntity); - zaZyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsPreInOrderRequest)); - return submitOrder(orderEntity, zaZyRequest); - } - - return ResultVOUtils.error(500, "提交失败!"); - } - - - /** - * 校验是否高值耗材 - * - * @return - */ - public boolean vailHightMaterial(IoOrderDetailBizEntity orderDetailBizEntity) { - BasicUdirelEntity basicUdirel = basicUdirelDao.selectById(orderDetailBizEntity.getBindRlFk()); - BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new QueryWrapper().eq("uuid", basicUdirel.getUuid()).last("limit 1")); - if (basicProductsEntity != null && - (StrUtil.trimToEmpty(basicProductsEntity.getBasicPrductRemak7()).equals("1101") - || StrUtil.trimToEmpty(basicProductsEntity.getBasicPrductRemak7()).equals("3601"))) { - return true; - } else - return false; - - } - - - public String getUserName(IoOrderEntity orderEntity) { - - return "方奕生/1007"; -// String userName = null; -// //创建人非供应商 -// if (StrUtil.isNotEmpty(orderEntity.getCheckUser())) { -// AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getCheckUser()); -// if (authUserEntity == null) -// userName = null; -// userName = authUserEntity.getUserName() + authUserEntity.getEmployeeName(); -// } else if (StrUtil.isNotEmpty(orderEntity.getReviewUser())) { -// AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getReviewUser()); -// userName = authUserEntity.getUserName() + authUserEntity.getEmployeeName(); -// } else if (StrUtil.isNotEmpty(orderEntity.getCreateUser()) && orderEntity.getCreateUser().length() != 14) { -// AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getCreateUser()); -// userName = authUserEntity.getUserName() + authUserEntity.getEmployeeName(); -// } else if (StrUtil.isNotEmpty(orderEntity.getUpdateUser()) && orderEntity.getUpdateUser().length() != 14) { -// AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getUpdateUser()); -// userName = authUserEntity.getUserName() + authUserEntity.getEmployeeName(); -// } -// if (userName == null) { -// List authWarehouseUsers = authWarehouseUserMapper.selectList(new QueryWrapper().eq("code", orderEntity.getInvCode())); -// if (CollUtil.isNotEmpty(authWarehouseUsers)) { -// AuthWarehouseUser authWarehouseUser = authWarehouseUsers.get(0); -// AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getCheckUser()); -// userName = authUserEntity.getUserName() + authUserEntity.getEmployeeName(); -// return userName; -// } -// } -// return userName; - - } - - /** - * 获取库存出入库明细 (普耗出库明细) - * - * @param udiwmsInvProductsRequest - * @return - */ - @Override - public BaseResponse getInvResult(UdiwmsInvProductsRequest udiwmsInvProductsRequest) { - CtqyyInvRequest ptxhyyInvRequest = new CtqyyInvRequest(); - ptxhyyInvRequest.setStartdate(DateUtil.formatDate(udiwmsInvProductsRequest.getStartDate(), "yyyy-MM-dd")); - ptxhyyInvRequest.setEnddate(DateUtil.formatDate(udiwmsInvProductsRequest.getEndDate(), "yyyy-MM-dd")); - - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getMaterialSheet")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(ptxhyyInvRequest)); - - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_GET_INV_RESULT), ctqyyRequest); -// String response = "{\"code\":20000,\"message\":\"success\",\"data\":{\"list\":[{\"applyNo\":\"74192\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"65\",\"CreditName\":\"急诊科\",\"AccoutDate\":\"2024-02-2210:36:28\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"66666666\",\"materialName\":\"一次性注射器2ml\",\"materialSpec\":\"0.6\",\"materialUnit\":\"支\",\"batchNo\":65212,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":200,\"importPrc\":0.21,\"importMoney\":42,\"factoryCode\":\"0006064349\",\"factoryName\":\"河南曙光汇知康生物科技股份有限公司\"},{\"applyNo\":\"74208\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"70\",\"CreditName\":\"手术室\",\"AccoutDate\":\"2024-02-2315:29:48\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"31585\",\"materialName\":\"一次性使用鼻氧管(吸氧管)\",\"materialSpec\":\"长单鼻/条\",\"materialUnit\":\"条\",\"batchNo\":64113,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":19,\"importPrc\":1.15,\"importMoney\":21.85,\"factoryCode\":\"0006063576\",\"factoryName\":\"苏州市麦克林医疗器械制品有限公司\"},{\"applyNo\":\"74208\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"70\",\"CreditName\":\"手术室\",\"AccoutDate\":\"2024-02-2315:29:48\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"31585\",\"materialName\":\"一次性使用鼻氧管(吸氧管)\",\"materialSpec\":\"长单鼻/条\",\"materialUnit\":\"条\",\"batchNo\":65526,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":81,\"importPrc\":1.15,\"importMoney\":93.15,\"factoryCode\":\"0006063576\",\"factoryName\":\"苏州市麦克林医疗器械制品有限公司\"},{\"applyNo\":\"74209\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"92\",\"CreditName\":\"儿科\",\"AccoutDate\":\"2024-02-2315:31:58\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"30936\",\"materialName\":\"一次性静脉输液针5(1/2)\",\"materialSpec\":\"/条\",\"materialUnit\":\"条\",\"batchNo\":64898,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":250,\"importPrc\":0.17,\"importMoney\":42.5,\"factoryCode\":\"0006063565\",\"factoryName\":\"浙江康康\"}],\"total\":4}}"; - - BaseResponse> baseResponse = - JSONObject.parseObject(response, new TypeReference>>() { - }); - if (baseResponse.getCode() == 20000) { - List ptxhInvResponses = baseResponse.getData().getList(); - List thrInvResultResponses = new ArrayList<>(); - if (CollUtil.isNotEmpty(ptxhInvResponses)) { - for (InvResultEntity ptxhInvResponse : ptxhInvResponses) { - ThrInvResultResponse thrInvResultResponse = new ThrInvResultResponse(); - thrInvResultResponse.setThrCode(ptxhInvResponse.getMaterialCode()); - thrInvResultResponse.setCpmctymc(ptxhInvResponse.getMaterialName()); - thrInvResultResponse.setGgxh(ptxhInvResponse.getMaterialSpec()); - thrInvResultResponse.setBatchNo(ptxhInvResponse.getBatchNo()); - thrInvResultResponse.setMeasname(ptxhInvResponse.getMaterialUnit()); - thrInvResultResponse.setPrice(BigDecimal.valueOf(ptxhInvResponse.getImportPrc())); - thrInvResultResponse.setAmount(BigDecimal.valueOf(ptxhInvResponse.getImportMoney())); -// thrInvResultResponse.setDeptName(ptxhInvResponse.getDebitName()); -// thrInvResultResponse.setDeptCode(ptxhInvResponse.getDebit()); -// thrInvResultResponse.setInvName(ptxhInvResponse.getCreditName()); -// thrInvResultResponse.setInvCode(ptxhInvResponse.getCredit()); - - thrInvResultResponse.setDeptName(ptxhInvResponse.getDebitName()); - thrInvResultResponse.setDeptCode("1002"); - thrInvResultResponse.setInvName(ptxhInvResponse.getCreditName()); - thrInvResultResponse.setInvCode("1000003"); - - thrInvResultResponse.setManufacturer(ptxhInvResponse.getFactoryName()); - thrInvResultResponse.setManufactoryCode(ptxhInvResponse.getFactoryCode()); - thrInvResultResponse.setMainAction(ConstantType.TYPE_OUT); - thrInvResultResponse.setBillType(ptxhInvResponse.getIoType()); - thrInvResultResponse.setType("1"); - thrInvResultResponse.setOutCount(ptxhInvResponse.getQuantity() + ""); - thrInvResultResponse.setReCount(ptxhInvResponse.getQuantity() + ""); - thrInvResultResponses.add(thrInvResultResponse); - } - } - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); - pageSimpleResponse.setTotal(thrInvResultResponses.size() + 0l); - pageSimpleResponse.setList(thrInvResultResponses); - return ResultVOUtils.success(pageSimpleResponse); - } - return baseResponse; - } - - - /** - * 获取库存扫码出入库明细(高值耗材出库明细) - * - * @param udiwmsInvProductsRequest - * @return - */ - @Override - public BaseResponse getInvCodeResult(UdiwmsInvProductsRequest udiwmsInvProductsRequest) { - CtqyyInvRequest ptxhyyInvRequest = new CtqyyInvRequest(); - ptxhyyInvRequest.setStartdate(DateUtil.formatDate(udiwmsInvProductsRequest.getStartDate(), "yyyy-MM-dd")); - ptxhyyInvRequest.setEnddate(DateUtil.formatDate(udiwmsInvProductsRequest.getEndDate(), "yyyy-MM-dd")); - - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getSickHighitem")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(ptxhyyInvRequest)); - - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_GET_INV_RESULT), ctqyyRequest); -// String response = -// "{\"code\": 20000,\"message\": \"success\",\"data\": {\"list\": [{\"recordNo\": 391,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63374\",\"materialName\": \"调节杠\",\"materialPrc\": 2100,\"dictBarcode\": \"0106971221560052\",\"Barcode\": \"111704022117000188340055\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"},{\"recordNo\": 390,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63374\",\"materialName\": \"调节杠\",\"materialPrc\": 2100,\"dictBarcode\": \"0106946149100093\",\"Barcode\": \"111704022117000188340007\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"},{\"recordNo\": 408,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63182\",\"materialName\": \"椎弓根螺钉\",\"materialPrc\": 4000,\"dictBarcode\": \"0106938695502193\",\"Barcode\": \"111703012117000076800035\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"},{\"recordNo\": 401,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63186\",\"materialName\": \"椎弓根螺钉\",\"materialPrc\": 4000,\"dictBarcode\": \"0106938695522023\",\"Barcode\": \"111612212116120902040009\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"},{\"recordNo\": 423,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63186\",\"materialName\": \"椎弓根螺钉\",\"materialPrc\": 4000,\"dictBarcode\": \"0106938695525055\",\"Barcode\": \"111701062116122700670005\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"},{\"recordNo\": 400,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63186\",\"materialName\": \"椎弓根螺钉\",\"materialPrc\": 4000,\"dictBarcode\": \"0106921814249918\",\"Barcode\": \"111612212116120902040047\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"},{\"recordNo\": 422,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63186\",\"materialName\": \"椎弓根螺钉\",\"materialPrc\": 4000,\"dictBarcode\": \"0106921814249918\",\"Barcode\": \"111701062116122700670013\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"}],\"total\": 7}}"; -// String response = null; -// try { -// response = FileUtils.getFileContent("E://ghresponse.json"); -// } catch (IOException e) { -// e.printStackTrace(); -// } - - BaseResponse> baseResponse = - JSONObject.parseObject(response, new TypeReference>>() { - }); - if (baseResponse.getCode() == 20000) { - Map mapArry = new HashMap<>(); - List newArry = new ArrayList<>(); - List ptxhInvResponses = baseResponse.getData().getList(); - List thrInvResultResponses = new ArrayList<>(); - if (CollUtil.isNotEmpty(ptxhInvResponses)) { - for (InvCodeResultEntity ptxhInvResponse : ptxhInvResponses) { - ThrInvResultResponse thrInvResultResponse = new ThrInvResultResponse(); - thrInvResultResponse.setThrCode(ptxhInvResponse.getMaterialCode()); - thrInvResultResponse.setCpmctymc(ptxhInvResponse.getMaterialName()); - thrInvResultResponse.setPrice(BigDecimal.valueOf(ptxhInvResponse.getMaterialPrc())); - - - thrInvResultResponse.setInvName(ptxhInvResponse.getDeptName()); - -// AuthWarehouseEntity warehouseEntity = authWarehouseDao.selectOne(new LambdaQueryWrapper().eq(AuthWarehouseEntity::getThirdId, ptxhInvResponse.getInDept())); -// if (warehouseEntity != null) -// thrInvResultResponse.setInvCode(warehouseEntity.getCode()); -// else -// thrInvResultResponse.setInvCode(ptxhInvResponse.getInDept()); - - thrInvResultResponse.setInvCode("1000003"); - thrInvResultResponse.setDeptCode("1002"); - thrInvResultResponse.setSickerCode(ptxhInvResponse.getVisitNo()); - thrInvResultResponse.setSickerName(ptxhInvResponse.getSickName()); - thrInvResultResponse.setBillType("SC71090077430919"); - thrInvResultResponse.setMainAction(ConstantType.TYPE_OUT); - thrInvResultResponse.setType("1"); - thrInvResultResponse.setOutCount("1"); - thrInvResultResponse.setReCount("1"); - IoCodeEntity codeEntity = codeDao.selectOne(new LambdaQueryWrapper().eq(IoCodeEntity::getCode, ptxhInvResponse.getBarcode()).last("limit 1")); - if (codeEntity == null) { - codeEntity = codeDao.selectOne(new LambdaQueryWrapper().eq(IoCodeEntity::getErrUdiCode, ptxhInvResponse.getBarcode()).last("limit 1")); - } - if (codeEntity != null) - thrInvResultResponse.setUdiCode(codeEntity.getCode()); - else - thrInvResultResponse.setUdiCode(ptxhInvResponse.getBarcode()); - thrInvResultResponses.add(thrInvResultResponse); - } - - for (ThrInvResultResponse thrInvResultResponse : thrInvResultResponses) { - mapArry.merge(thrInvResultResponse.getUdiCode(), thrInvResultResponse, (existingValue, newValue) -> { - // Assuming reCount can be directly handled as an integer to avoid String to Integer conversions - int updatedReCount = Integer.parseInt(existingValue.getReCount()) + Integer.parseInt(newValue.getReCount()); - existingValue.setReCount(String.valueOf(updatedReCount)); - existingValue.setOutCount(existingValue.getReCount()); - return existingValue; - }); - } - for (String key : mapArry.keySet()) { - newArry.add(mapArry.get(key)); - } - - } - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); - pageSimpleResponse.setTotal(newArry.size() + 0l); - pageSimpleResponse.setList(newArry); - return ResultVOUtils.success(pageSimpleResponse); - } - return baseResponse; - } - - @Resource - BasicSkProjectMapper basicSkProjectMapper; - @Resource - UdiRlSupDao udiRlSupDao; - @Resource - BasicDestinyRelMapper basicDestinyRelMapper; - - @Override - public BaseResponse getInvFeeResult(UdiwmsInvProductsRequest udiwmsInvProductsRequest) { - CtqyyInvRequest ptxhyyInvRequest = new CtqyyInvRequest(); - ptxhyyInvRequest.setStartdate(DateUtil.formatDate(udiwmsInvProductsRequest.getStartDate(), "yyyy-MM-dd")); - ptxhyyInvRequest.setEnddate(DateUtil.formatDate(udiwmsInvProductsRequest.getEndDate(), "yyyy-MM-dd")); - - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getSickPriceitem")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(ptxhyyInvRequest)); - - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_GET_INV_RESULT), ctqyyRequest); -// String response = -// "{\"code\": 20000,\"message\": \"success\",\"data\": {\"list\": [{\"seqNo\": \"97425947\",\"visitNo\": \"1471827014\",\"sickName\": \"杨玉聪\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 00:53:56\"},{\"seqNo\": \"97425950\",\"visitNo\": \"1471827014\",\"sickName\": \"杨玉聪\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 00:53:56\"},{\"seqNo\": \"97426036\",\"visitNo\": \"1940696001\",\"sickName\": \"郑良屹\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950057000000\",\"itemName\": \"热敏胶片 8in*10in/HQ-KX411 A型\",\"Price\": 7.8,\"quantity\": 4,\"Cost\": 31.2,\"materialCode\": \"00087\",\"materialName\": \"热敏胶片\",\"OperTime\": \"2024-02-21 01:39:39\"},{\"seqNo\": \"97426048\",\"visitNo\": \"1746585006\",\"sickName\": \"张杨妍\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950030000005\",\"itemName\": \"一次性注射器2ml(/支)\",\"Price\": 0.21,\"quantity\": 1,\"Cost\": 0.21,\"materialCode\": \"77375\",\"materialName\": \"一次性注射器2ml\",\"OperTime\": \"2024-02-21 02:06:05\"},{\"seqNo\": \"97426113\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 04:49:46\"},{\"seqNo\": \"97426233\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 04:54:51\"},{\"seqNo\": \"97426247\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 04:54:55\"},{\"seqNo\": \"97426250\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950029000010\",\"itemName\": \"一次性使用输液器BI-IT带针0.7# /支)\",\"Price\": 0.81,\"quantity\": 1,\"Cost\": 0.81,\"materialCode\": \"02585\",\"materialName\": \"一次性使用输液器 带针\",\"OperTime\": \"2024-02-21 04:56:20\"},{\"seqNo\": \"97426251\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950030000006\",\"itemName\": \"一次性无菌注射器20ml(/支)\",\"Price\": 0.48,\"quantity\": 2,\"Cost\": 0.96,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 04:56:21\"},{\"seqNo\": \"97426252\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950031000025\",\"itemName\": \"一次性使用静脉留置针22GII型A(直型连接座式安全型)Y型2225601\",\"Price\": 4.82,\"quantity\": 1,\"Cost\": 4.82,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 04:56:21\"},{\"seqNo\": \"97426258\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950030000005\",\"itemName\": \"一次性注射器2ml(/支)\",\"Price\": 0.21,\"quantity\": 1,\"Cost\": 0.21,\"materialCode\": \"77375\",\"materialName\": \"一次性注射器2ml\",\"OperTime\": \"2024-02-21 04:56:24\"},{\"seqNo\": \"97426284\",\"visitNo\": \"1801137003\",\"sickName\": \"杨立群\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950030000005\",\"itemName\": \"一次性注射器2ml(/支)\",\"Price\": 0.21,\"quantity\": 1,\"Cost\": 0.21,\"materialCode\": \"77375\",\"materialName\": \"一次性注射器2ml\",\"OperTime\": \"2024-02-21 05:03:40\"},{\"seqNo\": \"97426357\",\"visitNo\": \"1940699001\",\"sickName\": \"严明祥\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950031000025\",\"itemName\": \"一次性使用静脉留置针22GII型A(直型连接座式安全型)Y型2225601\",\"Price\": 4.82,\"quantity\": 1,\"Cost\": 4.82,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 05:28:40\"},{\"seqNo\": \"97426358\",\"visitNo\": \"1940699001\",\"sickName\": \"严明祥\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950030000006\",\"itemName\": \"一次性无菌注射器20ml(/支)\",\"Price\": 0.48,\"quantity\": 2,\"Cost\": 0.96,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 05:28:40\"},{\"seqNo\": \"97426359\",\"visitNo\": \"1940699001\",\"sickName\": \"严明祥\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950029000010\",\"itemName\": \"一次性使用输液器BI-IT带针0.7# /支)\",\"Price\": 0.81,\"quantity\": 1,\"Cost\": 0.81,\"materialCode\": \"02585\",\"materialName\": \"一次性使用输液器 带针\",\"OperTime\": \"2024-02-21 05:28:40\"},{\"seqNo\": \"97426433\",\"visitNo\": \"1940702001\",\"sickName\": \"伍邦柏\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950030000005\",\"itemName\": \"一次性注射器2ml(/支)\",\"Price\": 0.21,\"quantity\": 1,\"Cost\": 0.21,\"materialCode\": \"77375\",\"materialName\": \"一次性注射器2ml\",\"OperTime\": \"2024-02-21 06:51:25\"},{\"seqNo\": \"97426478\",\"visitNo\": \"1927463002\",\"sickName\": \"林海龙\",\"applyDept\": \"187\",\"deptName\": \"门诊呼吸与危重症医学科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:42:23\"},{\"seqNo\": \"97426486\",\"visitNo\": \"1927463002\",\"sickName\": \"林海龙\",\"applyDept\": \"187\",\"deptName\": \"门诊呼吸与危重症医学科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:42:24\"},{\"seqNo\": \"97426518\",\"visitNo\": \"1940705001\",\"sickName\": \"姚连菊\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:48:31\"},{\"seqNo\": \"97426521\",\"visitNo\": \"1940705001\",\"sickName\": \"姚连菊\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:48:31\"},{\"seqNo\": \"97426523\",\"visitNo\": \"1940703001\",\"sickName\": \"薛连辉\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:49:10\"},{\"seqNo\": \"97426529\",\"visitNo\": \"1940703001\",\"sickName\": \"薛连辉\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000007\",\"itemName\": \"一次性使用人体静脉血样采集容器(肝素锂 绿色 5ml/支)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68972\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:49:11\"},{\"seqNo\": \"97426535\",\"visitNo\": \"1940703001\",\"sickName\": \"薛连辉\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:49:13\"},{\"seqNo\": \"97426537\",\"visitNo\": \"1940703001\",\"sickName\": \"薛连辉\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:49:15\"},{\"seqNo\": \"97426557\",\"visitNo\": \"1629086067\",\"sickName\": \"杨培恭\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:50:11\"},{\"seqNo\": \"97426559\",\"visitNo\": \"1629086067\",\"sickName\": \"杨培恭\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:50:12\"},{\"seqNo\": \"97426561\",\"visitNo\": \"1629086067\",\"sickName\": \"杨培恭\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:50:14\"},{\"seqNo\": \"97426567\",\"visitNo\": \"1629086067\",\"sickName\": \"杨培恭\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950046000007\",\"itemName\": \"一次性使用人体静脉血样采集容器(肝素锂 绿色 5ml/支)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68972\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:50:15\"},{\"seqNo\": \"97426570\",\"visitNo\": \"1407999064\",\"sickName\": \"蔡美花\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:50:24\"},{\"seqNo\": \"97426572\",\"visitNo\": \"1407999064\",\"sickName\": \"蔡美花\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:50:24\"},{\"seqNo\": \"97426574\",\"visitNo\": \"1407999064\",\"sickName\": \"蔡美花\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:50:24\"},{\"seqNo\": \"97426576\",\"visitNo\": \"1547551020\",\"sickName\": \"黄靖宇\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:50:44\"},{\"seqNo\": \"97426581\",\"visitNo\": \"1547551020\",\"sickName\": \"黄靖宇\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950046000007\",\"itemName\": \"一次性使用人体静脉血样采集容器(肝素锂 绿色 5ml/支)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68972\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:50:46\"},{\"seqNo\": \"97426583\",\"visitNo\": \"1547551020\",\"sickName\": \"黄靖宇\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:50:47\"},{\"seqNo\": \"97426591\",\"visitNo\": \"1547551020\",\"sickName\": \"黄靖宇\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:50:48\"},{\"seqNo\": \"97426642\",\"visitNo\": \"1613276019\",\"sickName\": \"黄英连\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:56:13\"},{\"seqNo\": \"97426649\",\"visitNo\": \"1613276019\",\"sickName\": \"黄英连\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:56:16\"},{\"seqNo\": \"97426654\",\"visitNo\": \"1613276019\",\"sickName\": \"黄英连\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:56:18\"},{\"seqNo\": \"97426704\",\"visitNo\": \"1408701039\",\"sickName\": \"胡玮坤\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:56:40\"},{\"seqNo\": \"97426705\",\"visitNo\": \"1408701039\",\"sickName\": \"胡玮坤\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:56:40\"},{\"seqNo\": \"97426713\",\"visitNo\": \"1408701039\",\"sickName\": \"胡玮坤\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:56:40\"},{\"seqNo\": \"97426714\",\"visitNo\": \"1408701039\",\"sickName\": \"胡玮坤\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000007\",\"itemName\": \"一次性使用人体静脉血样采集容器(肝素锂 绿色 5ml/支)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68972\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:56:40\"},{\"seqNo\": \"97426719\",\"visitNo\": \"1900545011\",\"sickName\": \"李光婷\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:56:42\"},{\"seqNo\": \"97426724\",\"visitNo\": \"1900545011\",\"sickName\": \"李光婷\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950046000007\",\"itemName\": \"一次性使用人体静脉血样采集容器(肝素锂 绿色 5ml/支)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68972\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:56:42\"},{\"seqNo\": \"97426934\",\"visitNo\": \"1719779006\",\"sickName\": \"吴玉秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 08:00:20\"},{\"seqNo\": \"97427072\",\"visitNo\": \"1719779006\",\"sickName\": \"吴玉秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000007\",\"itemName\": \"一次性使用人体静脉血样采集容器(肝素锂 绿色 5ml/支)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68972\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 08:00:22\"},{\"seqNo\": \"97427377\",\"visitNo\": \"1537583008\",\"sickName\": \"刘阿花\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 08:02:37\"},{\"seqNo\": \"97427380\",\"visitNo\": \"1537583008\",\"sickName\": \"刘阿花\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 08:02:39\"},{\"seqNo\": \"97427383\",\"visitNo\": \"1537583008\",\"sickName\": \"刘阿花\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 08:02:41\"},{\"seqNo\": \"97427390\",\"visitNo\": \"1398769053\",\"sickName\": \"徐丽松\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 08:02:48\"}],\"total\": 12296}}"; - BaseResponse> baseResponse = - JSONObject.parseObject(response, new TypeReference>>() { - }); - if (baseResponse.getCode() == 20000) { - List ptxhInvResponses = baseResponse.getData().getList(); - List thrInvResultResponses = new ArrayList<>(); - Set seenNames = new HashSet<>(); - List itemData = new ArrayList<>(); - if (CollUtil.isNotEmpty(ptxhInvResponses)) { - for (InvProjectResultEntity ptxhInvResponse : ptxhInvResponses) { - ThrInvResultResponse thrInvResultResponse = new ThrInvResultResponse(); - thrInvResultResponse.setThrCode(ptxhInvResponse.getMaterialCode()); - thrInvResultResponse.setCpmctymc(ptxhInvResponse.getItemName()); - thrInvResultResponse.setSickerCode(ptxhInvResponse.getVisitNo()); - thrInvResultResponse.setSickerName(ptxhInvResponse.getSickName()); - thrInvResultResponse.setPrice(BigDecimal.valueOf(ptxhInvResponse.getPrice())); - thrInvResultResponse.setAmount(BigDecimal.valueOf(ptxhInvResponse.getCost())); - thrInvResultResponse.setDeptName(ptxhInvResponse.getDeptName()); - thrInvResultResponse.setDeptCode("1002"); - thrInvResultResponse.setInvName(ptxhInvResponse.getDeptName()); - thrInvResultResponse.setInvCode("1000003"); - thrInvResultResponse.setThrCode(ptxhInvResponse.getItemCode()); - thrInvResultResponse.setMainAction(ConstantType.TYPE_OUT); - thrInvResultResponse.setType("1"); - thrInvResultResponse.setOutCount(ptxhInvResponse.getQuantity() + ""); - thrInvResultResponse.setReCount(ptxhInvResponse.getQuantity() + ""); - thrInvResultResponses.add(thrInvResultResponse); - if (seenNames.add(ptxhInvResponse.getItemCode())) { - itemData.add(ptxhInvResponse); - } - } - } - for (InvProjectResultEntity invProjectResultEntity : itemData) { - if (!basicSkProjectMapper.exists(new QueryWrapper().eq("code", invProjectResultEntity.getItemCode()))) { - BasicSkProjectEntity basicSkProjectEntity = new BasicSkProjectEntity(); - basicSkProjectEntity.setCode(invProjectResultEntity.getItemCode()); - basicSkProjectEntity.setName(invProjectResultEntity.getItemName()); - basicSkProjectEntity.setType(2); - basicSkProjectEntity.setCreateTime(new Date()); - basicSkProjectEntity.setUpdateTime(new Date()); - basicSkProjectEntity.setRemark("出入库明细自动生成"); - basicSkProjectEntity.setId(IdUtil.getSnowflakeNextId()); - basicSkProjectMapper.insert(basicSkProjectEntity); - List thrProductsEntitys = thrProductsDao.selectList(new QueryWrapper().eq("prcitmcode", invProjectResultEntity.getItemCode())); - if (CollUtil.isNotEmpty(thrProductsEntitys)) { - for (ThrProductsEntity thrProductsEntity : thrProductsEntitys) { - CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest(); - companyProductRelevanceRequest.setThirdId(thrProductsEntity.getCode()); - List udiRlSupResponses = udiRlSupDao.filterUdiGp(companyProductRelevanceRequest); - if (CollUtil.isNotEmpty(udiRlSupResponses)) { - UdiRlSupResponse udiRlSupResponse = udiRlSupResponses.get(0); - BasicSkProjectDetailEntity basicSkProjectDetailEntity = new BasicSkProjectDetailEntity(); - basicSkProjectDetailEntity.setId(IdUtil.getSnowflakeNextId()); - basicSkProjectDetailEntity.setRelId(udiRlSupResponse.getRlId()); - basicSkProjectDetailEntity.setSupId(udiRlSupResponse.getCustomerId()); - basicSkProjectDetailEntity.setPId(basicSkProjectEntity.getId()); - basicSkProjectDetailEntity.setThrCode(thrProductsEntity.getCode()); - basicSkProjectDetailEntity.setThrName(thrProductsEntity.getName()); - basicSkProjectDetailEntity.setCreateTime(DateUtil.formatDateTime(new Date())); - basicSkProjectDetailEntity.setCreateUser("1"); - basicSkProjectDetailEntity.setUpdateTime(DateUtil.formatDateTime(new Date())); - basicSkProjectDetailEntity.setUpdateUser("1"); - basicSkProjectDetailEntity.setRemark("出入库明细自动生成"); - basicSkProjectDetailEntity.setCount(1); - basicDestinyRelMapper.insert(basicSkProjectDetailEntity); - } - } - } - - } - } - - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); - pageSimpleResponse.setTotal(thrInvResultResponses.size() + 0l); - pageSimpleResponse.setList(thrInvResultResponses); - return ResultVOUtils.success(pageSimpleResponse); - } - return baseResponse; - } - - @Override - public BaseResponse getInvProducts(UdiwmsInvProductsRequest udiwmsInvProductsRequest) { - return null; - } - - @Override - public BaseResponse getWarehouse(UdiwmsWarehouseRequest udiwmsWarehouseRequest) { - return null; - } - - @Override - public BaseResponse testConnect() { - UdiwmsUnitRequest udiwmsUnitRequest = new UdiwmsUnitRequest(); - udiwmsUnitRequest.setPage(1); - udiwmsUnitRequest.setLimit(1); - BaseResponse baseResponse = getUnit(udiwmsUnitRequest); - if (baseResponse.getCode() == 20000) { - return ResultVOUtils.success("连接成功!"); - } - return ResultVOUtils.error(500, "连接失败!"); - } - - @Override - public BaseResponse queryUdiInvProducts(UdiwmsQueryUdiInvProductsRequest queryUdiInvProductsRequest) { - return null; - } - - @Override - public BaseResponse submitProducts(UdiwmsAddProductsRequest udiwmsAddProductsRequest) { - return null; - } - - @Override - public BaseResponse submitUnit(UdiwmsAddUnitRequest udiwmsAddUnitRequest) { - - - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("addSupplierDict")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsAddUnitRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_PRODUCT_SUBMIT_URL), ctqyyRequest); - response = parserResult(response); - try { - log.error("提交往来单位/生产厂家:" + ctqyyRequest.getMsgBody()); - CtBaseResponse baseResponse = JSONObject.parseObject(response, CtBaseResponse.class); - if (baseResponse.getCode() != 20000) { - String errMsg = "提交往来单位/生产厂家,异常:{}" + response; - log.error(errMsg); - return ResultVOUtils.error(500, "提交往来单位/生产厂家失败!"); - } else { - BasicCorpEntity basicCorpEntity = new BasicCorpEntity(); - basicCorpEntity.setErpId(CustomUtil.getUnitId()); - basicCorpEntity.setName(udiwmsAddUnitRequest.getSupplierName()); - basicCorpEntity.setCorpType(2); - basicCorpEntity.setThirdId(baseResponse.getSupplierCode()); - basicCorpDao.insert(basicCorpEntity); - log.error("提交往来单位/生产厂家,成功:{}", response); - return ResultVOUtils.success(baseResponse.getMaterialNo()); - } - } catch (Exception e) { - String errMsg = "提交往来单位/生产厂家,异常:{}" + response; - log.error(errMsg); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, errMsg); - - } - } - - @Override - public BaseResponse postProducts(PostThrProductsRequest postThrProductsRequest) { - return null; - } - - @Override - public BaseResponse postCorps(PostThrCorpRequest postThrCorpRequest) { - return null; - } - - @Override - public BaseResponse postOrderDetail(PostFileThrOrderRequest postFileThrOrderRequest) { - return null; - } - - @Override - public BaseResponse postInvProducts(PostThrInvProductsRequest postThrInvProductsRequest) { - return null; - } - - - /** - * 封装单据详情参数 - * - * @param ioCodeEntities 单据码明细 - * @param orderDetailRequests 单据详情参数 - * @param detailBizEntities 单据业务详情 - */ - private String setOrderDetailList(List ioCodeEntities, List orderDetailRequests, List detailBizEntities) { - String errMsg = ""; - for (IoOrderDetailBizEntity detailBizEntity : detailBizEntities) { - - IoOrderDetailCodeEntity orderDetailCodeEntity = orderDetailCodeDao - .selectOne(new QueryWrapper() - .eq("orderIdFk", detailBizEntity.getOrderIdFk()) - .eq("bindRlFk", detailBizEntity.getBindRlFk()) - .eq(StrUtil.isNotEmpty(detailBizEntity.getBatchNo()), "batchNo", detailBizEntity.getBatchNo()) - .isNull(StrUtil.isEmpty(detailBizEntity.getBatchNo()), "batchNo").last("LIMIT 1")); - if (orderDetailCodeEntity != null && IntUtil.value(orderDetailCodeEntity.getReCount()) > 0) { - detailBizEntity.setCount(orderDetailCodeEntity.getReCount()); - UdiwmsOrderDetailRequest item = buildProductInfo(detailBizEntity); - if (item != null) { - //封装条码信息 - submitOrderUtil.setCodeList(ioCodeEntities, detailBizEntity, item); - orderDetailRequests.add(item); - } else { - errMsg = detailBizEntity.getCoName() + "," + "第三方产品编码未关联"; - } - } - } - return errMsg; - } - - - @Resource - private ThrProductsDao thrProductsDao; - - public UdiwmsOrderDetailRequest buildProductInfo(IoOrderDetailBizEntity detailBizEntity) { - //查询产品信息 - BasicUdirelEntity basicUdirel = basicUdirelDao.selectById(detailBizEntity.getBindRlFk()); - BasicProductsEntity basicProducts = basicProductsDao.selectOne(new LambdaQueryWrapper().eq(BasicProductsEntity::getUuid, basicUdirel.getUuid()).last("limit 1")); - - UdiwmsOrderDetailRequest item = new UdiwmsOrderDetailRequest(); - BeanUtil.copyProperties(detailBizEntity, item); - - item.setProductDate(DateUtil.formatExpireTime(StrUtil.isBlank(detailBizEntity.getProductDate()) ? null : "20" + detailBizEntity.getProductDate())); - item.setExpireDate(DateUtil.formatExpireTime(StrUtil.isBlank(detailBizEntity.getExpireDate()) ? null : "20" + detailBizEntity.getExpireDate())); - - String thirdProductId = (String) ReflectUtil.getFieldValue(basicUdirel, thirdSysConfig.getThirdId()); - item.setProductId(thirdProductId); //产品ID - //查询第三方产品名称 - ThrProductsEntity thrProductsEntity = thrProductsDao.selectOne(new LambdaQueryWrapper() - .eq(ThrProductsEntity::getCode, thirdProductId).last("limit 1")); - if (thrProductsEntity == null) { - log.error("第三方产品编码未关联"); - return null; - } - item.setProductName(thrProductsEntity.getName()); //产品名称 - item.setBindRlFk(detailBizEntity.getBindRlFk()); - item.setStandard(detailBizEntity.getSpec()); //规格型号 - item.setBillNo(detailBizEntity.getOrderIdFk()); //单据号 - item.setRegisterNo(detailBizEntity.getCertCode()); //注册/备案证号 - item.setManufactory(basicProducts.getManufactory()); //生产厂家 - item.setMeasname(thrProductsEntity.getMeasname()); //计量单位 - item.setAllowNoBatch(IntUtil.value(basicProducts.getAllowNoBatch())); //是否允许无批次号 - if (StrUtil.isNotEmpty(item.getManufactory())) { - ThrCorpEntity thrCorpEntity = thrCorpService.getThrCorpByName(item.getManufactory()); - if (thrCorpEntity != null) - item.setManufactoryCode(thrCorpEntity.getUnitId()); - } - item.setSupCode(thrProductsEntity.getSupCode()); - item.setCplb(thrProductsEntity.getFlbm()); - item.setHslb(thrProductsEntity.getCplb()); - item.setCount(detailBizEntity.getCount()); - return item; - } - - - /** - * 处理提交单据,记录日志,解析结果逻辑 - * - * @param orderEntity - * @param zaZyRequest - * @return - */ - private BaseResponse submitOrder(IoOrderEntity orderEntity, ZzzyyRequest zaZyRequest) { - //记录日志 - IoOrderUploadLogEntity uploadLog = new IoOrderUploadLogEntity(); - uploadLog.setBillDate(orderEntity.getCreateTime()); - uploadLog.setBillType(orderEntity.getAction()); - uploadLog.setSubmitTime(new Date()); - uploadLog.setBillNo(orderEntity.getBillNo()); - uploadLog.setFromType(Constants.THIRD_ORDER_UPLOAD); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_ORDER_SUBMIT_URL), zaZyRequest); - response = parserResult(response); - if (StrUtil.isNotBlank(response)) { - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - if (baseResponse.getCode() == 20000) { - String thirdBillNo = String.valueOf(baseResponse.getData()); - orderEntity.setThirdBillNo(thirdBillNo); - orderEntity.setExportStatus(1); //提交成功 - uploadLog.setStatus(2); - uploadLog.setThrBillNo(thirdBillNo); - uploadLog.setResult("提交成功"); - orderDao.updateById(orderEntity); - orderUploadLogDao.insert(uploadLog); - return ResultVOUtils.success("提交成功"); - } - uploadLog.setStatus(3); - uploadLog.setResult("提交失败,错误信息:" + baseResponse.getMessage()); - orderEntity.setExportStatus(2); //上传失败 - orderDao.updateById(orderEntity); - orderUploadLogDao.insert(uploadLog); - return baseResponse; - } catch (Exception e) { - log.error("解析提交到智业单据返回结果异常,结果信息:{}", response); - log.error("异常信息:{}", e); - uploadLog.setStatus(3); - uploadLog.setResult("提交失败,错误信息:" + response); - orderEntity.setExportStatus(2); //上传失败 - orderDao.updateById(orderEntity); - orderUploadLogDao.insert(uploadLog); - return ResultVOUtils.error(500, "提交失败"); - } - } else { - uploadLog.setStatus(3); - uploadLog.setResult("提交失败,调用接口返回为空"); - orderEntity.setExportStatus(2); //上传失败 - orderDao.updateById(orderEntity); - orderUploadLogDao.insert(uploadLog); - return ResultVOUtils.error(500, "提交失败"); - } - } - - - @Override - public BaseResponse submitPreInOrders(UdiwmsPreInOrderRequest udiwmsPreInOrderRequest) { - ZzzyyRequest zaZyRequest = new ZzzyyRequest(); - zaZyRequest.setMsgHeader(getMsgHeader("saveMaterialHight")); - zaZyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsPreInOrderRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_PRE_IN_ORDER_SUBMIT_URL), zaZyRequest); - response = parserResult(response); - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - return baseResponse; - } catch (Exception e) { - log.error("解析四川武平县医院智业接口提交单据返回数据异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - } - - - /** - * 转换提交单据参数 - * - * @param udiwmsOrderRequest - * @param orderEntity - * @return - */ - public UdiwmsPreInOrderRequest submitPreInOrderToThirdSys(ZaxzyyOrderRequest udiwmsOrderRequest, IoOrderEntity orderEntity) { - UdiwmsPreInOrderRequest udiwmsPreInOrderRequest = new UdiwmsPreInOrderRequest(); - if (udiwmsOrderRequest != null) { - BeanUtils.copyProperties(udiwmsOrderRequest, udiwmsPreInOrderRequest); - udiwmsPreInOrderRequest.setLocInvCode(udiwmsOrderRequest.getLocStorageCode()); - udiwmsPreInOrderRequest.setLocInvName(udiwmsOrderRequest.getLocStorageName()); - String deptCode = "70"; - if (StrUtil.isNotEmpty(orderEntity.getOriginUllageSupNo())) { - IoOrderEntity temp = orderDao.selectOne(new QueryWrapper().eq("billNo", orderEntity.getOriginUllageSupNo()).last("limit 1")); - if (temp != null && StrUtil.isNotEmpty(temp.getFromInvCode())) { - AuthWarehouseEntity authWarehouseEntity = - authWarehouseDao.selectOne(new QueryWrapper().eq("code", temp.getFromInvCode()).last("limit 1")); - deptCode = authWarehouseEntity.getThirdId(); - } - } - udiwmsPreInOrderRequest.setDeptCode(deptCode); - if (orderEntity.getReviewUser() != null) { - AuthUserEntity authUser = authUserDao.selectById(orderEntity.getReviewUser()); - udiwmsPreInOrderRequest.setActor(authUser.getEmployeeName()); - } else if (orderEntity.getCreateUser() != null) { - AuthUserEntity authUser = authUserDao.selectById(orderEntity.getCreateUser()); - udiwmsPreInOrderRequest.setActor(authUser.getEmployeeName()); - } - List itemDTOS = new ArrayList<>(); - if (CollUtil.isNotEmpty(udiwmsOrderRequest.getItem())) { - for (UdiwmsOrderDetailRequest udiwmsOrderDetail : udiwmsOrderRequest.getItem()) { - if (CollUtil.isNotEmpty(udiwmsOrderDetail.getCodeList())) { - for (UdiwmsOrderDetailRequest.CodeDetailEntity codeDetaiEntity : udiwmsOrderDetail.getCodeList()) { - UdiwmsPreInOrderRequest.ItemDTO itemDTO = new UdiwmsPreInOrderRequest.ItemDTO(); - BeanUtils.copyProperties(udiwmsOrderDetail, itemDTO); - if (StrUtil.isNotEmpty(itemDTO.getManufactory())) { - ThrCorpEntity thrCorpEntity = thrCorpService.getThrCorpByName(itemDTO.getManufactory()); - if (thrCorpEntity != null) - itemDTO.setManufactoryCode(thrCorpEntity.getUnitId()); - } - String code = codeDetaiEntity.getCode(); - if (code.contains("\u001D")) { -// code = code.replace("\u001D", "zysoft"); 智业无法识别GS1符号 - code = code.replace("\u001D", ""); - } - itemDTO.setCode(code); - itemDTO.setNameCode(codeDetaiEntity.getNameCode()); - - if (IntUtil.value(codeDetaiEntity.getCount()) > 1) { - for (int i = 0; i < codeDetaiEntity.getCount(); i++) { - itemDTO.setCount(1); - itemDTOS.add(itemDTO); - } - } else { - itemDTO.setCount(codeDetaiEntity.getCount()); - itemDTOS.add(itemDTO); - } - - - } - } - } - } - udiwmsPreInOrderRequest.setItems(itemDTOS); - } - return udiwmsPreInOrderRequest; - } - - - /** - * ------------------------------------------现场管理医保相关接口方法-------------------------------------------------------------- - */ - /** - * 处方拉取视图 - * - * @param udiwmsBasicSkPrescribeRequest - * @return - */ - @Override - public BaseResponse getPrescribes(UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest) { - if (IntUtil.value(udiwmsBasicSkPrescribeRequest.getInOutType()) == 0) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - - String startTime = udiwmsBasicSkPrescribeRequest.getStartTime(); - String endTime = udiwmsBasicSkPrescribeRequest.getEndTime(); - wrapper.ge(StrUtil.isNotEmpty(startTime), VInsurNationGoodsPhysic::getSEL_RETN_TIME, startTime); - wrapper.le(StrUtil.isNotEmpty(endTime), VInsurNationGoodsPhysic::getSEL_RETN_TIME, endTime); - - String code = udiwmsBasicSkPrescribeRequest.getCode(); - String fromCorpName = udiwmsBasicSkPrescribeRequest.getFromCorpName(); - String key = udiwmsBasicSkPrescribeRequest.getKey(); - wrapper.and(StrUtil.isNotEmpty(code), t -> t.eq(VInsurNationGoodsPhysic::getSTOOUT_NO, code).or().eq(VInsurNationGoodsPhysic::getRXNO, code)); - wrapper.and(StrUtil.isNotEmpty(key), t -> t.like(VInsurNationGoodsPhysic::getSTOOUT_NO, key) - .or().like(VInsurNationGoodsPhysic::getRXNO, key) - .or().like(VInsurNationGoodsPhysic::getPSN_NAME, key) - .or().like(VInsurNationGoodsPhysic::getPSN_NO, key) - ); - wrapper.and(StrUtil.isNotEmpty(fromCorpName), t -> t.eq(VInsurNationGoodsPhysic::getPSN_NAME, fromCorpName)); - // 拉取处方时,改成拉取v_ypzs_pres_info - IPage page = vYpzsPresInfoMapper.selectGroupedWithPagination(new Page(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()), - udiwmsBasicSkPrescribeRequest); - - return this.covertSellOrder(udiwmsBasicSkPrescribeRequest, page); - } else { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - - String startTime = udiwmsBasicSkPrescribeRequest.getStartTime(); - String endTime = udiwmsBasicSkPrescribeRequest.getEndTime(); - wrapper.ge(StrUtil.isNotEmpty(startTime), VInsurNationGoodsReturn::getSEL_RETN_TIME, startTime); - wrapper.le(StrUtil.isNotEmpty(endTime), VInsurNationGoodsReturn::getSEL_RETN_TIME, endTime); - - - String code = udiwmsBasicSkPrescribeRequest.getCode(); - String fromCorpName = udiwmsBasicSkPrescribeRequest.getFromCorpName(); - String key = udiwmsBasicSkPrescribeRequest.getKey(); - wrapper.and(StrUtil.isNotEmpty(key), t -> t.like(VInsurNationGoodsReturn::getAPPLY_NO, key) - .or().like(VInsurNationGoodsReturn::getPSN_NAME, key) - .or().like(VInsurNationGoodsReturn::getPSN_NO, key) - ); - wrapper.and(StrUtil.isNotEmpty(code), t -> t.eq(VInsurNationGoodsReturn::getAPPLY_NO, code)); - wrapper.and(StrUtil.isNotEmpty(fromCorpName), t -> t.eq(VInsurNationGoodsReturn::getPSN_NAME, fromCorpName)); - //拉取处方退货时,改成拉取v_ypzs_pres_info_return - IPage page = vYpzsPresInfoReturnMapper.selectGroupedWithPagination(new Page(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()), - udiwmsBasicSkPrescribeRequest); - return this.covertReturnOrder(udiwmsBasicSkPrescribeRequest, page); - } - - } - - - /** - * 采购计划拉取视图 - * - * @param udiwmsThrOrderRequest - * @return - */ - @Override - public BaseResponse getThrOrders(UdiwmsThrOrderRequest udiwmsThrOrderRequest) { - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); - if (BusTypeConstant.CGJH001.getBusType().equals(udiwmsThrOrderRequest.getBusType())) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - -// String startTime = udiwmsThrOrderRequest.getStartTime(); -// String endTime = udiwmsThrOrderRequest.getEndTime(); -// wrapper.ge(StrUtil.isNotEmpty(startTime),VYpzsPlanInfo::getKEEP_BOOK_TIME,startTime+" 00:00:00"); -// wrapper.le(StrUtil.isNotEmpty(endTime),VYpzsPlanInfo::getKEEP_BOOK_TIME,endTime+" 23:59:59"); - - wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBillNo()), VYpzsPlanInfo::getCGDBH, udiwmsThrOrderRequest.getBillNo()); - //关键字模糊处理 - String keywords = udiwmsThrOrderRequest.getKeyWords(); - wrapper.and(StrUtil.isNotEmpty(keywords), t -> t.like(VYpzsPlanInfo::getCGDBH, keywords)//单据号 - ); - wrapper.like(StrUtil.isNotEmpty(udiwmsThrOrderRequest.getFromCorpName()), VYpzsPlanInfo::getSCQYMC, udiwmsThrOrderRequest.getFromCorpName()); - - Page page = vYpzsPlanInfoMapper.selectGroupedWithPagination(new Page(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), udiwmsThrOrderRequest); - - List planInfos = page.getRecords(); - List ioCollectOrders = new ArrayList<>(); - if (CollUtil.isNotEmpty(planInfos)) { - - List collect = planInfos.stream().map(VYpzsPlanInfo::getCGDBH).collect(Collectors.toList()); - LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); - wrapper1.in(VYpzsPlanInfo::getCGDBH, collect); - List vYpzsPlanInfos = vYpzsPlanInfoMapper.selectList(wrapper1); - - Map> groupedByBz = vYpzsPlanInfos.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 bizList = new ArrayList<>(); - value.forEach(entity -> { - IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz(); - BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper().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 wrapper = new LambdaQueryWrapper<>(); - - String startTime = udiwmsThrOrderRequest.getStartTime(); - String endTime = udiwmsThrOrderRequest.getEndTime(); - wrapper.ge(StrUtil.isNotEmpty(startTime), VYpzsIoInfo::getKEEP_BOOK_TIME, startTime); - wrapper.le(StrUtil.isNotEmpty(endTime), VYpzsIoInfo::getKEEP_BOOK_TIME, endTime); - wrapper.and(StrUtil.isNotEmpty(udiwmsThrOrderRequest.getCorpName()), t -> t.like(VYpzsIoInfo::getCONSIGNEE_NAME, udiwmsThrOrderRequest.getCorpName()).or().eq(VYpzsIoInfo::getCONSIGNOR_NAME, udiwmsThrOrderRequest.getCorpName())); - - wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBillNo()), VYpzsIoInfo::getPHYSIC_CODE, udiwmsThrOrderRequest.getBillNo()); - wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBusType()), VYpzsIoInfo::getIO_SORT, udiwmsThrOrderRequest.getBusType()); - - wrapper.like(StrUtil.isNotEmpty(udiwmsThrOrderRequest.getFromCorpName()), VYpzsIoInfo::getCONSIGNEE_NAME, udiwmsThrOrderRequest.getFromCorpName()); - wrapper.like(StrUtil.isNotEmpty(udiwmsThrOrderRequest.getShipperName()), VYpzsIoInfo::getCONSIGNOR_NAME, udiwmsThrOrderRequest.getShipperName()); - //关键字模糊处理 - String keywords = udiwmsThrOrderRequest.getKeyWords(); - wrapper.and(StrUtil.isNotEmpty(keywords), t -> t.like(VYpzsIoInfo::getPHYSIC_CODE, keywords)//单据号 - .or().like(VYpzsIoInfo::getCONSIGNOR_NAME, keywords)//发货方 - .or().like(VYpzsIoInfo::getCONSIGNEE_NAME, keywords)//收货方 - .or().like(VYpzsIoInfo::getKEEP_BOOK_TIME, keywords)//收货方 - .or().like(VYpzsIoInfo::getIO_SORT, keywords)//收货方 - ); - - Page page = vYpzsIoInfoMapper.selectGroupedWithPagination(new Page(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), udiwmsThrOrderRequest); - - List ioInfos = page.getRecords(); - List ioCollectOrders = new ArrayList<>(); - if (CollUtil.isNotEmpty(ioInfos)) { - List collect = ioInfos.stream().map(VYpzsIoInfo::getRECEIPT_NUMBER).collect(Collectors.toList()); - LambdaQueryWrapper vYpzsIoInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); - vYpzsIoInfoLambdaQueryWrapper.in(VYpzsIoInfo::getRECEIPT_NUMBER, collect); - List vYpzsIoInfos = vYpzsIoInfoMapper.selectList(vYpzsIoInfoLambdaQueryWrapper); - - Map> groupedByPhysicCode = vYpzsIoInfos.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.getRECEIPT_NUMBER()); - ioCollectOrder.setFromType("HIS系统"); - ioCollectOrder.setBillTime(DateUtil.parseDate(info.getKEEP_BOOK_TIME())); - ioCollectOrder.setFromCorp(info.getCONSIGNEE()); - ioCollectOrder.setFromCorpName(info.getCONSIGNEE_NAME()); - - ioCollectOrder.setShipper(info.getCONSIGNOR()); - ioCollectOrder.setShipperName(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 bizList = new ArrayList<>(); - value.forEach(entity -> { - IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz(); - BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper().eq(BasicUdirelEntity::getMainId, entity.getPHYSIC_CODE()).last("limit 1")); - 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) { - - - List 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)) { - return 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 page) { - List presInfoEntities = page.getRecords(); - List vInsurNationGoodsPhysics = new ArrayList<>(); - if (CollUtil.isNotEmpty(presInfoEntities)) { - List collect = presInfoEntities.stream().map(VYpzsPresInfo::getPRESCRIBE_NUMBER).collect(Collectors.toList()); - LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); - wrapper1.in(VYpzsPresInfo::getPRESCRIBE_NUMBER, collect); - vInsurNationGoodsPhysics = vYpzsPresInfoMapper.selectList(wrapper1); - } - - // TODO: 2024/9/19 这边在转换的时候就不能用VInsurNationGoodsPhysic - if (CollUtil.isNotEmpty(vInsurNationGoodsPhysics)) { - Map> groupedByPrescribeNumber = vInsurNationGoodsPhysics.stream() - .collect(Collectors.groupingBy(VYpzsPresInfo::getPHYSIC_CODE)); - List ioCollectOrders = new ArrayList<>(); - groupedByPrescribeNumber.forEach((key, value) -> { - VYpzsPresInfo presInfoEntity = value.get(0); - StringBuilder errorMsg = new StringBuilder(); - IoCollectOrder ioCollectOrder = new IoCollectOrder(); - ioCollectOrder.setBillNo(presInfoEntity.getPRESCRIBE_NUMBER()); - ioCollectOrder.setFromType("HIS系统"); - ioCollectOrder.setFromCorp(presInfoEntity.getSICK_ID()); - ioCollectOrder.setWorkPlaceCode(udiwmsBasicSkPrescribeRequest.getWorkPlaceCode()); - ioCollectOrder.setFromCorpName(presInfoEntity.getSICK_NAME()); - Date date = DateUtil.parseDate(presInfoEntity.getLAY_TIME()); - ioCollectOrder.setBillTime(date); - ioCollectOrder.setCreateTime(new Date()); - ioCollectOrder.setCreateUser(udiwmsBasicSkPrescribeRequest.getCreateUser()); - ioCollectOrder.setBackupOrderRemark1(presInfoEntity.getSTOOUT_NO()); - ioCollectOrder.setBackupOrderRemark2(presInfoEntity.getSICK_ID()); -// ioCollectOrder.setBackupOrderRemark3(presInfoEntity.getPSN_NAME()); -// ioCollectOrder.setBackupOrderRemark4(presInfoEntity.getPSN_NO()); - ioCollectOrder.setUpdateTime(new Date()); - ioCollectOrder.setSplitStatus(0); - ioCollectOrder.setTagStatus(0); - List bizList = new ArrayList<>(); - value.forEach(entity -> { - IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz(); - List basicUdirelEntities = basicUdirelDao.selectList(new LambdaQueryWrapper().eq(BasicUdirelEntity::getMainId, entity.getPHYSIC_CODE())); - if (CollUtil.isNotEmpty(basicUdirelEntities)) { - BasicUdirelEntity basicUdirelEntity = basicUdirelEntities.get(0); - collectOrderBiz.setRelId(basicUdirelEntity.getId()); - } else { - errorMsg.append(entity.getPHYSIC_NAME()).append("字典未对照").append(";"); - } - -// List vYpzsPresInfos = vYpzsPresInfoMapper.selectList(new LambdaQueryWrapper().eq(VYpzsPresInfo::getPRESCRIBE_NUMBER, entity.getPRESCRIBE_NUMBER()).eq(VYpzsPresInfo::getPHYSIC_CODE, entity.getPHYSIC_CODE())); - -// if (CollUtil.isNotEmpty(vYpzsPresInfos)) { -// VYpzsPresInfo vYpzsPresInfo = vYpzsPresInfos.get(0); -// -// } - collectOrderBiz.setGgxh(entity.getPACK_SPEC()); - collectOrderBiz.setMeasureUnit(entity.getPHYSIC_UNIT()); - collectOrderBiz.setCount(IntUtil.value(entity.getLAY_PHYSIC_QUANTITY())); - collectOrderBiz.setThrCode(entity.getPHYSIC_CODE()); - collectOrderBiz.setCpmctymc(entity.getPHYSIC_NAME()); - collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo()); - collectOrderBiz.setYbbm(entity.getCOUNTRY_CODE()); -// collectOrderBiz.setRemark1(entity.get() + ""); - - 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 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 page) { - List presInfoEntities = page.getRecords(); - List vInsurNationGoodsReturns = new ArrayList<>(); - if (CollUtil.isNotEmpty(presInfoEntities)) { - List collect = presInfoEntities.stream().map(VYpzsPresInfoReturn::getAPPLY_NO).collect(Collectors.toList()); - LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); - wrapper1.in(VYpzsPresInfoReturn::getAPPLY_NO, collect); - vInsurNationGoodsReturns = vYpzsPresInfoReturnMapper.selectList(wrapper1); - } - // TODO: 2024/9/19 这边在转换的时候就不能用vInsurNationGoodsReturns - if (CollUtil.isNotEmpty(vInsurNationGoodsReturns)) { - Map> groupedByPrescribeNumber = vInsurNationGoodsReturns.stream() - .collect(Collectors.groupingBy(VYpzsPresInfoReturn::getAPPLY_NO)); - List ioCollectOrders = new ArrayList<>(); - groupedByPrescribeNumber.forEach((key, value) -> { - VYpzsPresInfoReturn 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.getSICK_NAME()); -// Date date = DateUtil.parseDate(presInfoEntity.get()); - ioCollectOrder.setBillTime(presInfoEntity.getKEEP_BOOK_TIME()); - ioCollectOrder.setCreateTime(new Date()); - ioCollectOrder.setCreateUser(udiwmsBasicSkPrescribeRequest.getCreateUser()); - ioCollectOrder.setUpdateTime(new Date()); - ioCollectOrder.setSplitStatus(0); - ioCollectOrder.setTagStatus(0); - List bizList = new ArrayList<>(); - value.forEach(entity -> { - IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz(); - BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper().eq(BasicUdirelEntity::getMainId, entity.getPHYSIC_CODE())); - if (basicUdirelEntity != null) { - collectOrderBiz.setRelId(basicUdirelEntity.getId()); - } else { - errorMsg.append(entity.getPHYSIC_NAME()).append("字典未对照").append(";"); - } - List vYpzsPresInfoReturns = vYpzsPresInfoReturnMapper.selectList(new LambdaQueryWrapper().eq(VYpzsPresInfoReturn::getAPPLY_NO, entity.getAPPLY_NO()).eq(VYpzsPresInfoReturn::getPHYSIC_CODE, entity.getPHYSIC_CODE())); - - if (CollUtil.isNotEmpty(vYpzsPresInfoReturns)) { - VYpzsPresInfoReturn vYpzsPresInfo = vYpzsPresInfoReturns.get(0); - collectOrderBiz.setGgxh(vYpzsPresInfo.getPHYSIC_SPEC()); - collectOrderBiz.setMeasureUnit(vYpzsPresInfo.getPHYSIC_UNIT()); - } - collectOrderBiz.setThrCode(entity.getPHYSIC_CODE()); - collectOrderBiz.setCpmctymc(entity.getPHYSIC_NAME()); -// collectOrderBiz.setBatchNo(entity.getBATCH_NUMBER()); - collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo()); - collectOrderBiz.setYbbm(entity.getFEE_SEQUENCE_NO()); - collectOrderBiz.setCount(entity.getQUANTITY()); - 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 pageSimpleResponse = new PageSimpleResponse<>(); - pageSimpleResponse.setTotal(page.getTotal()); - pageSimpleResponse.setList(ioCollectOrders); - return ResultVOUtils.success(pageSimpleResponse); - } else { - return ResultVOUtils.error(500, "下载失败!"); - } - } - - - public BaseResponse optionUploadCollectOrder3505(IoCollectOrder ioCollectOrder) { - //摆药流水号 -// String stoout_no = ioCollectOrder.getBackupOrderRemark1(); - String stoout_no = StringUtils.isBlank(ioCollectOrder.getBackupOrderRemark1()) ? ioCollectOrder.getBackupOrderRemark2() : ioCollectOrder.getBackupOrderRemark1(); - List vInsurNationGoodsPhysics = goodsPhysicMapper.selectList(new LambdaQueryWrapper().eq(VInsurNationGoodsPhysic::getSTOOUT_NO, stoout_no)); - if (CollUtil.isNotEmpty(vInsurNationGoodsPhysics)) { - List collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList(); - List 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 drugTraceList = new ArrayList<>(); - // 遍历fruits数组 - for (String code : codes) { - if (StrUtil.isNotBlank(code)) { - List relCodeDetailList = relCodeDetailService.getAllNext(code); - if (relCodeDetailList != null && relCodeDetailList.size() > 0) { - for (RelCodeDetail relCodeDetail : relCodeDetailList) { - DrugInfoRequest request = new DrugInfoRequest(); - request.setDrug_trac_codg(relCodeDetail.getCurCode()); - 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); - - - return ybClient.ybPostScyh("3505A", dataJson); - - } else { - return ResultVOUtils.error(500, "医保视图数据查不到,请核实"); - } - - } - - - public void optionUploadCollectOrder3501(IoCollectOrder ioCollectOrder) { - List bizList = ioCollectOrder.getBizList(); - if (CollUtil.isNotEmpty(bizList)) { - List collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList(); - List 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 drugTraceList = new ArrayList<>(); - // 遍历fruits数组 - for (String code : codes) { - if (StrUtil.isNotBlank(code)) { - List relCodeDetailList = relCodeDetailService.getAllNext(code); - if (relCodeDetailList != null && relCodeDetailList.size() > 0) { - 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.ybPostScyh("3501A", dataJson); - } - } - - - public void optionUploadCollectOrder3502(IoCollectOrder ioCollectOrder) { - List bizList = ioCollectOrder.getBizList(); - if (CollUtil.isNotEmpty(bizList)) { - List collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList(); - List 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 drugTraceList = new ArrayList<>(); - // 遍历fruits数组 - for (String code : codes) { - if (StrUtil.isNotBlank(code)) { - List relCodeDetailList = relCodeDetailService.getAllNext(code); - if (relCodeDetailList != null && relCodeDetailList.size() > 0) { - 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.setInvinfoDetail(kcbg3502Requests); - String jsonStr = JSONUtil.toJsonStr(baseKcbg3502Request); - JSONObject dataJson = JSONObject.parseObject(jsonStr); - ybClient.ybPostScyh("3502A", dataJson); - } - } - - public void optionUploadCollectOrder3506(IoCollectOrder ioCollectOrder) { -// List bizList = ioCollectOrder.getBizList(); - List collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList(); - List xsth3506Requests = new ArrayList<>(); - List vInsurNationGoodsReturns = vInsurNationGoodsReturnMapper.selectList(new LambdaQueryWrapper().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 drugTraceList = new ArrayList<>(); - // 遍历fruits数组 - for (String code : codes) { - if (StrUtil.isNotBlank(code)) { - List relCodeDetailList = relCodeDetailService.getAllNext(code); - if (relCodeDetailList != null && relCodeDetailList.size() > 0) { - 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.ybPostScyh("3506A", dataJson); - } - - @Override - public BaseResponse getBuyType() { - Map buyTypeMap= new HashMap<>(); - buyTypeMap.put("buyType_3501",buyType_3501); - buyTypeMap.put("buyType_3502",buyType_3502); - buyTypeMap.put("buyType_3505",buyType_3505); - buyTypeMap.put("buyType_3506",buyType_3506); - return ResultVOUtils.success(buyTypeMap); - } -} diff --git a/src/main/java/com/glxp/mipsdl/client/scpwxyy/entity/InvCodeResultEntity.java b/src/main/java/com/glxp/mipsdl/client/scpwxyy/entity/InvCodeResultEntity.java deleted file mode 100644 index 675704b..0000000 --- a/src/main/java/com/glxp/mipsdl/client/scpwxyy/entity/InvCodeResultEntity.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.glxp.mipsdl.client.scpwxyy.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 高值耗材出入库明细 - */ -@NoArgsConstructor -@Data -public class InvCodeResultEntity { - - - @JsonProperty("recordNo") - private Integer recordNo; - @JsonProperty("visitNo") - private String visitNo; - @JsonProperty("sickName") - private String sickName; - @JsonProperty("inDept") - private String inDept; - @JsonProperty("deptName") - private String deptName; - @JsonProperty("materialCode") - private String materialCode; - @JsonProperty("materialName") - private String materialName; - @JsonProperty("materialPrc") - private Integer materialPrc; - @JsonProperty("dictBarcode") - private String dictBarcode; - @JsonProperty("Barcode") - private String barcode; - @JsonProperty("feeTime") - private String feeTime; - @JsonProperty("feeOper") - private String feeOper; -} - - diff --git a/src/main/java/com/glxp/mipsdl/client/scpwxyy/entity/InvProjectResultEntity.java b/src/main/java/com/glxp/mipsdl/client/scpwxyy/entity/InvProjectResultEntity.java deleted file mode 100644 index 200adca..0000000 --- a/src/main/java/com/glxp/mipsdl/client/scpwxyy/entity/InvProjectResultEntity.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.glxp.mipsdl.client.scpwxyy.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 收费项目出入库明细 - */ -@NoArgsConstructor -@Data -public class InvProjectResultEntity { - - - @JsonProperty("seqNo") - private String seqNo; - @JsonProperty("visitNo") - private String visitNo; - @JsonProperty("sickName") - private String sickName; - @JsonProperty("applyDept") - private String applyDept; - @JsonProperty("deptName") - private String deptName; - @JsonProperty("itemCode") - private String itemCode; - @JsonProperty("itemName") - private String itemName; - @JsonProperty("Price") - private Double price; - @JsonProperty("quantity") - private Integer quantity; - @JsonProperty("Cost") - private Double cost; - @JsonProperty("materialCode") - private String materialCode; - @JsonProperty("materialName") - private String materialName; - @JsonProperty("OperTime") - private String operTime; -} diff --git a/src/main/java/com/glxp/mipsdl/client/scpwxyy/entity/InvResultEntity.java b/src/main/java/com/glxp/mipsdl/client/scpwxyy/entity/InvResultEntity.java deleted file mode 100644 index a5abb53..0000000 --- a/src/main/java/com/glxp/mipsdl/client/scpwxyy/entity/InvResultEntity.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.glxp.mipsdl.client.scpwxyy.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 库存出入库明细 - */ -@NoArgsConstructor -@Data -public class InvResultEntity { - - @JsonProperty("applyNo") - private String applyNo; - @JsonProperty("ioFlag") - private String ioFlag; - @JsonProperty("ioType") - private String ioType; - @JsonProperty("ioTypeName") - private String ioTypeName; - @JsonProperty("Debit") - private String debit; - @JsonProperty("DebitName") - private String debitName; - @JsonProperty("Credit") - private String credit; - @JsonProperty("CreditName") - private String creditName; - @JsonProperty("AccoutDate") - private String accoutDate; - @JsonProperty("Accoutant") - private String accoutant; - @JsonProperty("receiveOper") - private String receiveOper; - @JsonProperty("materialCode") - private String materialCode; - @JsonProperty("materialName") - private String materialName; - @JsonProperty("materialSpec") - private String materialSpec; - @JsonProperty("materialUnit") - private String materialUnit; - @JsonProperty("batchNo") - private String batchNo; - @JsonProperty("invoiceNo") - private String invoiceNo; - @JsonProperty("invoiceDate") - private String invoiceDate; - @JsonProperty("quantity") - private Integer quantity; - @JsonProperty("importPrc") - private Double importPrc; - @JsonProperty("importMoney") - private Integer importMoney; - @JsonProperty("factoryCode") - private String factoryCode; - @JsonProperty("factoryName") - private String factoryName; -} diff --git a/src/main/java/com/glxp/mipsdl/client/yxfuyy/YxfyyyClient.java b/src/main/java/com/glxp/mipsdl/client/yxfuyy/YxfyyyClient.java deleted file mode 100644 index 4e22c81..0000000 --- a/src/main/java/com/glxp/mipsdl/client/yxfuyy/YxfyyyClient.java +++ /dev/null @@ -1,2049 +0,0 @@ -package com.glxp.mipsdl.client.yxfuyy; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ReflectUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.json.JSONUtil; -import com.alibaba.fastjson.JSON; -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; -import com.glxp.mipsdl.dao.auth.AuthWarehouseDao; -import com.glxp.mipsdl.dao.basic.*; -import com.glxp.mipsdl.dao.inout.*; -import com.glxp.mipsdl.dao.thrsys.ThrInvWarehouseDao; -import com.glxp.mipsdl.dao.thrsys.ThrProductsDao; -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.*; -import com.glxp.mipsdl.entity.inout.*; -import com.glxp.mipsdl.entity.thrsys.ThrCorpEntity; -import com.glxp.mipsdl.entity.thrsys.ThrInvWarehouseEntity; -import com.glxp.mipsdl.entity.thrsys.ThrProductsEntity; -import com.glxp.mipsdl.entity.thrsys.ThrSystemBusApiEntity; -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; -import com.glxp.mipsdl.res.PageSimpleResponse; -import com.glxp.mipsdl.res.ctqyy.CtBaseResponse; -import com.glxp.mipsdl.res.udiwms.*; -import com.glxp.mipsdl.service.auth.AuthWarehouseService; -import com.glxp.mipsdl.service.basic.RelCodeDetailService; -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; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.util.*; -import java.util.stream.Collectors; - -@Slf4j -@Service(value = "100013HttpClient") -public class YxfyyyClient extends CommonHttpClient { - private final String[] buyType_3501 = {"24"}; - private final String[] buyType_3502 = {"7", "6", "5", "4", "1", "16", "12", "28", "35"}; - private final String[] buyType_3505 = {"QXCF001", "YPCF002"}; - private final String[] buyType_3506 = {"YPTH001"}; - - @Resource - private ThrSystemDetailService thrSystemDetailService; - @Resource - private HttpClient httpClient; - - @Resource - private SubmitOrderUtil submitOrderUtil; - @Resource - private IoOrderUploadLogDao orderUploadLogDao; - @Resource - private IoOrderDao orderDao; - @Resource - private ThrSystemBusApiDao thrSystemBusApiDao; - @Resource - private BasicBussinessTypeDao basicBussinessTypeDao; - @Resource - private BasicCorpDao basicCorpDao; - @Resource - private IoCodeDao codeDao; - @Resource - private AuthWarehouseDao authWarehouseDao; - @Resource - private ThrInvWarehouseDao thrInvWarehouseDao; - @Resource - private AuthWarehouseService authWarehouseService; - @Resource - private ThirdSysConfig thirdSysConfig; - @Resource - private ThrCorpService thrCorpService; - @Resource - private IoOrderDetailBizDao orderDetailBizDao; - @Resource - private IoOrderDetailCodeDao orderDetailCodeDao; - @Resource - private AuthUserDao authUserDao; - @Resource - BasicUdirelDao basicUdirelDao; - @Resource - 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; - @Resource - private RelCodeDetailService relCodeDetailService; - - /** - * 拼接xml请求头 - * - * @param methodName 方法名 - * @return - */ - public String getMsgHeader(String methodName) { - return "" + - "" + - "" + - methodName + - "" + - ""; - } - - - public String parserResult(String response) { - if (response.contains(" zzzyyProductsResponse = JSON.parseArray(map.get("list") + "", ZzzyyProductsResponse.class); - for (ZzzyyProductsResponse productsResponse : zzzyyProductsResponse) { - //判断要是规格和型号一致就是取规格 不一致就合并 - if (StrUtil.isNotEmpty(productsResponse.getModel_number()) && StrUtil.isNotEmpty(productsResponse.getStandard())) { - if (productsResponse.getModel_number().equals(productsResponse.getStandard())) { - productsResponse.setStandard(productsResponse.getStandard()); - } else { - productsResponse.setStandard(productsResponse.getStandard() + productsResponse.getModel_number()); - } - } else if (StrUtil.isNotEmpty(productsResponse.getModel_number()) && StrUtil.isBlank(productsResponse.getStandard())) { - productsResponse.setStandard(productsResponse.getModel_number()); - } - productsResponse.setProductType(1); - } - map.put("list", JSON.toJSON(zzzyyProductsResponse)); - baseResponse.setData(""); - baseResponse.setData(map); - return baseResponse; - } catch (Exception e) { - log.error("解析长泰区医院智业接口返回产品信息字典数据异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - } else if (udiwmsProductRequest.getProductType().equals(Constants.PRODUCT_TYPE_DRUG)) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper(); - //补充其他查询条件 - wrapper.eq(StrUtil.isNotBlank(udiwmsProductRequest.getCode()), VYpzsPhysicDict::getPHYSIC_CODE, udiwmsProductRequest.getCode()); - wrapper.eq(StrUtil.isNotBlank(udiwmsProductRequest.getName()), VYpzsPhysicDict::getPHYSIC_NAME, udiwmsProductRequest.getName()); - wrapper.eq(StrUtil.isNotBlank(udiwmsProductRequest.getRegisterNo()), VYpzsPhysicDict::getPHYSIC_NO, udiwmsProductRequest.getRegisterNo()); - IPage page = vYpzsPhysicDictMapper.selectPage(new Page(udiwmsProductRequest.getPage(), udiwmsProductRequest.getLimit()), wrapper); - List physicDictEntities = page.getRecords(); - List thrProductsEntityList = null; - if (CollUtil.isNotEmpty(physicDictEntities)) { - //数据处理以thr_products 返回 - thrProductsEntityList = physicDictEntities.stream().map(dict -> { - ThrProductsEntity products = new ThrProductsEntity(); - products.setCode(dict.getPHYSIC_CODE()); - products.setName(dict.getPHYSIC_NAME()); - products.setMeasname(dict.getPACK_UNIT()); - products.setSpec(dict.getPACK_SPEC()); - products.setYbbm(dict.getCOUNTRY_CODE()); - products.setPrepnSpec(dict.getPHYSIC_SPEC()); - products.setPrepnUnit(dict.getPHYSIC_UNIT()); - products.setProductType(2); - return products; - }).collect(Collectors.toList()); - } - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); - pageSimpleResponse.setTotal(page.getTotal()); - pageSimpleResponse.setList(thrProductsEntityList); - return ResultVOUtils.success(pageSimpleResponse); - } - log.error("解析长泰区医院医疗类型,返回结果:{}", udiwmsProductRequest.getProductType()); - return ResultVOUtils.error(500, "医疗类型不正确,productType:" + udiwmsProductRequest.getProductType()); - } - - @Override - public BaseResponse getOrderTypes(UdiwmsBusTypeRequest udiwmsBusTypeRequest) { - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getMaterialType")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsBusTypeRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_BUS_TYPE_QUERY_URL), ctqyyRequest); - response = parserResult(response); - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - return baseResponse; - } catch (Exception e) { - log.error("解析云霄妇幼医院智业接口返回单据类型数据异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - } - - /** - * 提交关联产品更新 - * - * @return - */ - @Override - public BaseResponse postRelProduct(PostRelProductRequest postThrInvProductsRequest) { - UdiRelevanceResponse udiRelevanceResponse = postThrInvProductsRequest.getUdiRelevanceResponse(); - - if (udiRelevanceResponse == null) { - return ResultVOUtils.error(500, "提交产品列表不能为空!"); - } - MaterialDictEntity materialDictEntity = new MaterialDictEntity(); - if (StrUtil.isEmpty(udiRelevanceResponse.getMainId()) && StrUtil.isNotEmpty(udiRelevanceResponse.getOriginUuid())) - materialDictEntity.setOperatType("1"); - else - materialDictEntity.setOperatType("2"); - materialDictEntity.setMaterialName(udiRelevanceResponse.getCpmctymc()); - materialDictEntity.setCostlySign("1"); - if (StrUtil.isNotEmpty(udiRelevanceResponse.getMainId()) && udiRelevanceResponse.getMainId().endsWith("x")) { - materialDictEntity.setMaterialMasterCode(null); - materialDictEntity.setHisMaterialCode(null); - materialDictEntity.setCostlySign("0"); - materialDictEntity.setOperatType("1"); - } else { - materialDictEntity.setMaterialMasterCode(udiRelevanceResponse.getNameCode()); - materialDictEntity.setHisMaterialCode(udiRelevanceResponse.getMainId()); - } - - materialDictEntity.setMaterialSpec(udiRelevanceResponse.getGgxh()); - materialDictEntity.setMaterialUnit(udiRelevanceResponse.getMeasname()); - //暂无区分进货价,零售价 - materialDictEntity.setImportPrice(udiRelevanceResponse.getPrice() == null ? "0" : udiRelevanceResponse.getPrice().toString()); - materialDictEntity.setRetailPrice(udiRelevanceResponse.getPrice() == null ? "0" : udiRelevanceResponse.getPrice().toString()); - materialDictEntity.setFactoryName(udiRelevanceResponse.getManufactory()); - materialDictEntity.setSupplierName(udiRelevanceResponse.getSupName()); - materialDictEntity.setInsuranceCode(udiRelevanceResponse.getYbbm()); - materialDictEntity.setRegeditNo(udiRelevanceResponse.getZczbhhzbapzbh()); - materialDictEntity.setMaterialClass(udiRelevanceResponse.getBasicPrductRemak7()); - //暂无中标标识 - materialDictEntity.setPublicFlag("1"); - materialDictEntity.setPriceItemClass(udiRelevanceResponse.getBasicPrductRemak8()); - //暂无收费标志 - materialDictEntity.setFeeFlag(udiRelevanceResponse.getBasicPrductRemak6()); - - - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("addMaterialDict")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(materialDictEntity)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_PRODUCT_SUBMIT_URL), ctqyyRequest); - response = parserResult(response); - try { - log.error("提交新增产品信息:" + ctqyyRequest.getMsgBody()); - CtBaseResponse baseResponse = JSONObject.parseObject(response, CtBaseResponse.class); - if (baseResponse.getCode() != 20000) { - String errMsg = "提交新增产品信息,异常:{}" + response; - log.error(errMsg); - return ResultVOUtils.error(500, "提交新增产品失败!"); - - } else { -// materialDictEntity.setMaterialNo(baseResponse.getMaterialNo()); - log.error("提交新增产品信息,成功:{}", response); - return ResultVOUtils.success(baseResponse.getMaterialNo()); - } - } catch (Exception e) { - String errMsg = "提交新增产品信息,异常:{}" + response; - log.error(errMsg); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, errMsg); - - } - } - - - /** - * 获取患者信息 - * - * @param getSickRequest - * @return - */ - public BaseResponse getSickInfo(GetSickRequest getSickRequest) { - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getSickVisitInfo")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(getSickRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URI_GET_SICKER), ctqyyRequest); - response = parserResult(response); - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - Map map = (Map) baseResponse.getData(); - List basicSkSickerResponses = JSON.parseArray(map.get("list") + "", BasicSkSickerResponse.class); -// for (BasicSkSickerResponse productsResponse : basicSkSickerResponses) { -// -// } - map.put("list", JSON.toJSON(basicSkSickerResponses)); - baseResponse.setData(""); - baseResponse.setData(map); - return baseResponse; - } catch (Exception e) { - log.error("解析长泰医院智业返回病人信息数据异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - } - - /** - * 获取患者处方信息 - * - * @param getSickPrescribeRequest - * @return - */ - public BaseResponse getSickPescribe(GetSickPrescribeRequest getSickPrescribeRequest) { - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getResiPresInfo")); - getSickPrescribeRequest.setResiNo(getSickPrescribeRequest.getAdNum()); - getSickPrescribeRequest.setAdNum(null); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(getSickPrescribeRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URI_GET_SICKER_PRESCIRBE), ctqyyRequest); - response = parserResult(response); - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - Map map = (Map) baseResponse.getData(); - List basicSkPrescribeResponses = JSON.parseArray(map.get("list") + "", BasicSkPrescribeResponse.class); - for (BasicSkPrescribeResponse basicSkPrescribeResponse : basicSkPrescribeResponses) { - List itemEntities = basicSkPrescribeResponse.getItemList(); - if (CollUtil.isNotEmpty(itemEntities)) { - for (BasicSkPrescribeItemEntity itemEntity : itemEntities) { - itemEntity.setCount("0"); - } - } - } - map.put("list", JSON.toJSON(basicSkPrescribeResponses)); - baseResponse.setData(""); - baseResponse.setData(map); - return baseResponse; - } catch (Exception e) { - log.error("解析长泰医院智业返回处方信息数据异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - - } - - -// public String getStrConut(String str) { -// if (StrUtil.isNotEmpty(str)) { -// return "0"; -// } -// Pattern pattern = Pattern.compile("\\d+"); -// Matcher matcher = pattern.matcher(str); -// String strCount = ""; -// while (matcher.find()) { -// strCount = strCount + matcher.group(); -// } -// return strCount; -// } - - - /** - * 获取项目组套字典 - * - * @param dlThirdProjectRequest - * @return - */ - @Override - public BaseResponse getBasicProject(DlThirdProjectRequest dlThirdProjectRequest) { - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getMaterialDict")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(dlThirdProjectRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URI_GET_PROJECT), ctqyyRequest); - response = parserResult(response); - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - Map map = (Map) baseResponse.getData(); - List basicSkProjectResponses = JSON.parseArray(map.get("list") + "", BasicSkProjectResponse.class); - for (BasicSkProjectResponse basicSkProjectResponse : basicSkProjectResponses) { - - } - map.put("list", JSON.toJSON(basicSkProjectResponses)); - baseResponse.setData(""); - baseResponse.setData(map); - return baseResponse; - } catch (Exception e) { - log.error("解析长泰医院智业返回项目信息数据异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - } - - - /** - * 获取核算类别 - * - * @param hslbRequest - * @return - */ - @Override - public BaseResponse getHsfl(FilterThrHslbRequest hslbRequest) { - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getItemClass")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(hslbRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URI_GET_HSLB), ctqyyRequest); - response = parserResult(response); - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - Map map = (Map) baseResponse.getData(); - List priceClassEntities = JSON.parseArray(map.get("list") + "", PriceClassEntity.class); - - List hslbEntities = new ArrayList<>(); - for (PriceClassEntity priceClassEntity : priceClassEntities) { - ThrHslbEntity thrHslbEntity = new ThrHslbEntity(); - thrHslbEntity.setHsbm(priceClassEntity.getClassCode()); - thrHslbEntity.setHsmc(priceClassEntity.getClassName()); - hslbEntities.add(thrHslbEntity); - } - map.put("list", JSON.toJSON(hslbEntities)); - baseResponse.setData(""); - baseResponse.setData(map); - return baseResponse; - } catch (Exception e) { - log.error("解析长泰医院智业返回物价类别信息异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - } - - - @Override - public BaseResponse getOrders(UdiwmsOrderQueryRequest udiwmsOrderQueryRequest) { - return null; - } - - @Resource - SysParamConfigService sysParamConfigService; - - @Override - public BaseResponse submitOrders(UdiwmsOrderRequest udiwmsOrderRequest) { - if (StrUtil.isBlank(udiwmsOrderRequest.getBillNo())) { - return ResultVOUtils.error(500, "单据号不能为空"); - } - - ZaxzyyOrderRequest zaxzyyOrderRequest = new ZaxzyyOrderRequest(); - BeanUtil.copyProperties(udiwmsOrderRequest, zaxzyyOrderRequest); - //查询单据和详情信息,组装第三方系统接口所需参数 - IoOrderEntity orderEntity = orderDao.selectOne(new QueryWrapper().eq("billNo", udiwmsOrderRequest.getBillNo())); - - zaxzyyOrderRequest.setBillDate(DateUtil.formatDateTime(orderEntity.getCreateTime())); - //查询对应的第三方单据类型 - ThrSystemBusApiEntity thrSystemBusApiEntity = thrSystemBusApiDao.selectOne(new QueryWrapper().eq("code", udiwmsOrderRequest.getBillType())); - zaxzyyOrderRequest.setThirdSys(getUserName(orderEntity)); - zaxzyyOrderRequest.setBillType(thrSystemBusApiEntity.getThirdBuyCode()); - zaxzyyOrderRequest.setBillFlag("1"); - - //查询单据类型 - BasicBussinessTypeEntity basicBussinessTypeEntity = basicBussinessTypeDao.selectByAction(udiwmsOrderRequest.getBillType()); - if (basicBussinessTypeEntity.getCorpType().equals(Constants.CORP_HOSPTIAL)) { - //医院客户 - zaxzyyOrderRequest.setCorpId(orderEntity.getFromCorp()); - //查询客户名称 - String corpName = basicCorpDao.selectNameByErpId(orderEntity.getFromCorp()); - zaxzyyOrderRequest.setCorpName(corpName); - } else if (basicBussinessTypeEntity.getCorpType().equals(Constants.CORP_INTTERNAL)) { - //内部科室 - BasicCorpEntity basicCorpEntity = null; - if (StrUtil.isNotEmpty(orderEntity.getFromCorp())) { - basicCorpEntity = basicCorpDao.selectByErpId(orderEntity.getFromCorp()); - } - if (basicCorpEntity != null) { - zaxzyyOrderRequest.setCorpId(basicCorpEntity.getThirdId()); - zaxzyyOrderRequest.setCorpName(basicCorpEntity.getName()); - } else { - AuthWarehouseEntity warehouseEntity = authWarehouseDao.selectOne(new QueryWrapper().eq("code", udiwmsOrderRequest.getCorpId())); - try { - //根据第三方系统标识,获取对应字段的值 - ThrInvWarehouseEntity thrInvWarehouseEntity = thrInvWarehouseDao.selectOne(new LambdaQueryWrapper() - .eq(ThrInvWarehouseEntity::getCode, authWarehouseService.getThirdInvCode(warehouseEntity)) - .eq(ThrInvWarehouseEntity::getThirdSysFk, thirdSysConfig.getThirdId())); - - zaxzyyOrderRequest.setCorpId(thrInvWarehouseEntity.getCode()); - zaxzyyOrderRequest.setCorpName(thrInvWarehouseEntity.getName()); - } catch (Exception e) { - String msg = "查询单据对应往来单位的第三方仓库信息异常"; - orderUploadLogService.updateLocalErr(orderEntity, msg); - log.error("----单据提交-----" + orderEntity.getBillNo() + msg); - return ResultVOUtils.error(500, msg); - } - } - - } else { - //供应商 - BasicCorpEntity basicCorpEntity = null; - if (StrUtil.isNotEmpty(orderEntity.getFromCorp())) { - basicCorpEntity = basicCorpDao.selectByErpId(orderEntity.getFromCorp()); - } - if (basicCorpEntity != null) { - zaxzyyOrderRequest.setCorpId(basicCorpEntity.getThirdId()); - zaxzyyOrderRequest.setCorpName(basicCorpEntity.getName()); - } else { - String msg = "查询单据对应的第三方往来单位信息异常"; - orderUploadLogService.updateLocalErr(orderEntity, msg); - log.error("----单据提交-----" + orderEntity.getBillNo() + msg); - return ResultVOUtils.error(500, msg); - } - } - - - //查询仓库信息 - AuthWarehouseEntity warehouseEntity = authWarehouseDao.selectOne(new QueryWrapper().eq("code", orderEntity.getInvCode())); - try { - ThrInvWarehouseEntity thrInvWarehouseEntity = thrInvWarehouseDao.selectOne(new LambdaQueryWrapper() - .eq(ThrInvWarehouseEntity::getCode, authWarehouseService.getThirdInvCode(warehouseEntity)) - .eq(ThrInvWarehouseEntity::getThirdSysFk, thirdSysConfig.getThirdId())); - - zaxzyyOrderRequest.setLocInvCode(thrInvWarehouseEntity.getCode()); - zaxzyyOrderRequest.setLocInvName(thrInvWarehouseEntity.getName()); - - zaxzyyOrderRequest.setLocStorageCode(thrInvWarehouseEntity.getCode()); - zaxzyyOrderRequest.setLocStorageName(thrInvWarehouseEntity.getName()); - } catch (Exception e) { - log.error("查询第三方系统仓库信息异常", e); - String msg = "查询第三方系统仓库信息异常"; - orderUploadLogService.updateLocalErr(orderEntity, msg); - return ResultVOUtils.error(500, msg); - } - - //设置单据出入库类型 - if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { - zaxzyyOrderRequest.setInoutType(1); //入库 - } else if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { - zaxzyyOrderRequest.setInoutType(2); //出库 - } - - //设置备注信息 - zaxzyyOrderRequest.setRemark("udi管理系统提交单据"); - //组装单据明细数据 - List ioCodeEntities = codeDao.selectList(new QueryWrapper() - .eq("orderId", orderEntity.getBillNo()) - .ne("action", "StockCheck") - ); - List items = new ArrayList<>(); - //查询业务单据详情 - List detailBizEntities = orderDetailBizDao.selectList(new QueryWrapper().eq("orderIdFk", orderEntity.getBillNo())); - String errMsg = setOrderDetailList(ioCodeEntities, items, detailBizEntities); - zaxzyyOrderRequest.setItem(items); - if (CollUtil.isEmpty(items)) { - orderUploadLogService.updateLocalErr(orderEntity, errMsg); - return ResultVOUtils.error(500, errMsg); - } - - if (StrUtil.isNotEmpty(errMsg)) { - orderUploadLogService.updateLocalErr(orderEntity, errMsg); - return ResultVOUtils.error(500, errMsg); - } - - - for (UdiwmsOrderDetailRequest i : items) { - String fphm = ""; - String fprq = null; - List invoiceList = IoOrderInvoiceEntity.builder().build() - .selectList(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class).eq(IoOrderInvoiceEntity::getOrderIdFk, orderEntity.getBillNo()) - .eq(IoOrderInvoiceEntity::getBindRlFk, i.getBindRlFk()) - .eq(StrUtil.isNotEmpty(i.getBatchNo()), IoOrderInvoiceEntity::getBatchNo, i.getBatchNo()). - groupBy(IoOrderInvoiceEntity::getInvoiceEncode)); - if (CollectionUtil.isNotEmpty(invoiceList)) { - fphm = invoiceList.stream().map(IoOrderInvoiceEntity::getInvoiceEncode).collect(Collectors.joining(",")); - if (invoiceList.get(0).getInvoiceDate() != null) - fprq = DateUtil.formatDateTime(invoiceList.get(0).getInvoiceDate()); - } - i.setFirstSalesInvNo(fphm); - i.setSecSalesInvNo(fphm); - i.setInvoiceDate(fprq); - } - - - //构造诏安接口参数 - ZzzyyRequest zaZyRequest = new ZzzyyRequest(); - - //提交到第三方系统 - if (thrSystemBusApiEntity.getUrl().equals("saveMasterialInput")) { -// //采购入库单据 -// if (vailHightMaterial(detailBizEntities.get(0))) { -// zaZyRequest.setMsgHeader(getMsgHeader("saveMaterialHight")); -// UdiwmsPreInOrderRequest udiwmsPreInOrderRequest = submitPreInOrderToThirdSys(zaxzyyOrderRequest, orderEntity); -// zaZyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsPreInOrderRequest)); -// } else { -// zaZyRequest.setMsgHeader(getMsgHeader("saveMasterialInput")); -// zaZyRequest.setMsgBody(JSONUtil.toJsonStr(zaxzyyOrderRequest)); -// } - Boolean b = sysParamConfigService.selectByKey("ct_split_groupbuy"); - if (b) { - Map> splitMap = items.stream() - .collect(Collectors.groupingBy(UdiwmsOrderDetailRequest::getFirstSalesInvNo)); - BaseResponse baseResponse = null; - int index = 1; - if (splitMap.size() > 1) { - for (List splitItems : splitMap.values()) { - zaxzyyOrderRequest.setItem(splitItems); - zaZyRequest.setMsgHeader(getMsgHeader("saveMasterialInput")); - zaZyRequest.setMsgBody(JSONUtil.toJsonStr(zaxzyyOrderRequest)); - orderEntity.setBillNo(orderEntity.getBillNo() + "-" + index); - baseResponse = submitOrder(orderEntity, zaZyRequest); - } - return baseResponse; - } else { - zaZyRequest.setMsgHeader(getMsgHeader("saveMasterialInput")); - zaZyRequest.setMsgBody(JSONUtil.toJsonStr(zaxzyyOrderRequest)); - return submitOrder(orderEntity, zaZyRequest); - } - } else { - zaZyRequest.setMsgHeader(getMsgHeader("saveMasterialInput")); - zaZyRequest.setMsgBody(JSONUtil.toJsonStr(zaxzyyOrderRequest)); - return submitOrder(orderEntity, zaZyRequest); - } - - - } else if (thrSystemBusApiEntity.getUrl().equals("saveMaterialHight")) { - -// // 1.先提交到物资 -// zaZyRequest.setMsgHeader(getMsgHeader("saveMasterialInput")); -// zaZyRequest.setMsgBody(JSONUtil.toJsonStr(zaxzyyOrderRequest)); -// submitOrder(orderEntity, zaZyRequest); - - - //2.提交到预备货 - zaZyRequest.setMsgHeader(getMsgHeader("saveMaterialHight")); - UdiwmsPreInOrderRequest udiwmsPreInOrderRequest = submitPreInOrderToThirdSys(zaxzyyOrderRequest, orderEntity); - zaZyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsPreInOrderRequest)); - return submitOrder(orderEntity, zaZyRequest); - } - - return ResultVOUtils.error(500, "提交失败!"); - } - - - /** - * 校验是否高值耗材 - * - * @return - */ - public boolean vailHightMaterial(IoOrderDetailBizEntity orderDetailBizEntity) { - BasicUdirelEntity basicUdirel = basicUdirelDao.selectById(orderDetailBizEntity.getBindRlFk()); - BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(new QueryWrapper().eq("uuid", basicUdirel.getUuid()).last("limit 1")); - if (basicProductsEntity != null && - (StrUtil.trimToEmpty(basicProductsEntity.getBasicPrductRemak7()).equals("1101") - || StrUtil.trimToEmpty(basicProductsEntity.getBasicPrductRemak7()).equals("3601"))) { - return true; - } else - return false; - - } - - - public String getUserName(IoOrderEntity orderEntity) { - - return "方奕生/1007"; -// String userName = null; -// //创建人非供应商 -// if (StrUtil.isNotEmpty(orderEntity.getCheckUser())) { -// AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getCheckUser()); -// if (authUserEntity == null) -// userName = null; -// userName = authUserEntity.getUserName() + authUserEntity.getEmployeeName(); -// } else if (StrUtil.isNotEmpty(orderEntity.getReviewUser())) { -// AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getReviewUser()); -// userName = authUserEntity.getUserName() + authUserEntity.getEmployeeName(); -// } else if (StrUtil.isNotEmpty(orderEntity.getCreateUser()) && orderEntity.getCreateUser().length() != 14) { -// AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getCreateUser()); -// userName = authUserEntity.getUserName() + authUserEntity.getEmployeeName(); -// } else if (StrUtil.isNotEmpty(orderEntity.getUpdateUser()) && orderEntity.getUpdateUser().length() != 14) { -// AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getUpdateUser()); -// userName = authUserEntity.getUserName() + authUserEntity.getEmployeeName(); -// } -// if (userName == null) { -// List authWarehouseUsers = authWarehouseUserMapper.selectList(new QueryWrapper().eq("code", orderEntity.getInvCode())); -// if (CollUtil.isNotEmpty(authWarehouseUsers)) { -// AuthWarehouseUser authWarehouseUser = authWarehouseUsers.get(0); -// AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getCheckUser()); -// userName = authUserEntity.getUserName() + authUserEntity.getEmployeeName(); -// return userName; -// } -// } -// return userName; - - } - - /** - * 获取库存出入库明细 (普耗出库明细) - * - * @param udiwmsInvProductsRequest - * @return - */ - @Override - public BaseResponse getInvResult(UdiwmsInvProductsRequest udiwmsInvProductsRequest) { - CtqyyInvRequest ptxhyyInvRequest = new CtqyyInvRequest(); - ptxhyyInvRequest.setStartdate(DateUtil.formatDate(udiwmsInvProductsRequest.getStartDate(), "yyyy-MM-dd")); - ptxhyyInvRequest.setEnddate(DateUtil.formatDate(udiwmsInvProductsRequest.getEndDate(), "yyyy-MM-dd")); - - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getMaterialSheet")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(ptxhyyInvRequest)); - - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_GET_INV_RESULT), ctqyyRequest); -// String response = "{\"code\":20000,\"message\":\"success\",\"data\":{\"list\":[{\"applyNo\":\"74192\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"65\",\"CreditName\":\"急诊科\",\"AccoutDate\":\"2024-02-2210:36:28\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"66666666\",\"materialName\":\"一次性注射器2ml\",\"materialSpec\":\"0.6\",\"materialUnit\":\"支\",\"batchNo\":65212,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":200,\"importPrc\":0.21,\"importMoney\":42,\"factoryCode\":\"0006064349\",\"factoryName\":\"河南曙光汇知康生物科技股份有限公司\"},{\"applyNo\":\"74208\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"70\",\"CreditName\":\"手术室\",\"AccoutDate\":\"2024-02-2315:29:48\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"31585\",\"materialName\":\"一次性使用鼻氧管(吸氧管)\",\"materialSpec\":\"长单鼻/条\",\"materialUnit\":\"条\",\"batchNo\":64113,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":19,\"importPrc\":1.15,\"importMoney\":21.85,\"factoryCode\":\"0006063576\",\"factoryName\":\"苏州市麦克林医疗器械制品有限公司\"},{\"applyNo\":\"74208\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"70\",\"CreditName\":\"手术室\",\"AccoutDate\":\"2024-02-2315:29:48\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"31585\",\"materialName\":\"一次性使用鼻氧管(吸氧管)\",\"materialSpec\":\"长单鼻/条\",\"materialUnit\":\"条\",\"batchNo\":65526,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":81,\"importPrc\":1.15,\"importMoney\":93.15,\"factoryCode\":\"0006063576\",\"factoryName\":\"苏州市麦克林医疗器械制品有限公司\"},{\"applyNo\":\"74209\",\"ioFlag\":\"出库业务\",\"ioType\":\"104\",\"ioTypeName\":\"科室领用\",\"Debit\":\"50\",\"DebitName\":\"供应室仓库\",\"Credit\":\"92\",\"CreditName\":\"儿科\",\"AccoutDate\":\"2024-02-2315:31:58\",\"Accoutant\":\"徐秀娥/160\",\"receiveOper\":\"\",\"materialCode\":\"30936\",\"materialName\":\"一次性静脉输液针5(1/2)\",\"materialSpec\":\"/条\",\"materialUnit\":\"条\",\"batchNo\":64898,\"invoiceNo\":\"\",\"invoiceDate\":\"\",\"quantity\":250,\"importPrc\":0.17,\"importMoney\":42.5,\"factoryCode\":\"0006063565\",\"factoryName\":\"浙江康康\"}],\"total\":4}}"; - - BaseResponse> baseResponse = - JSONObject.parseObject(response, new TypeReference>>() { - }); - if (baseResponse.getCode() == 20000) { - List ptxhInvResponses = baseResponse.getData().getList(); - List thrInvResultResponses = new ArrayList<>(); - if (CollUtil.isNotEmpty(ptxhInvResponses)) { - for (InvResultEntity ptxhInvResponse : ptxhInvResponses) { - ThrInvResultResponse thrInvResultResponse = new ThrInvResultResponse(); - thrInvResultResponse.setThrCode(ptxhInvResponse.getMaterialCode()); - thrInvResultResponse.setCpmctymc(ptxhInvResponse.getMaterialName()); - thrInvResultResponse.setGgxh(ptxhInvResponse.getMaterialSpec()); - thrInvResultResponse.setBatchNo(ptxhInvResponse.getBatchNo()); - thrInvResultResponse.setMeasname(ptxhInvResponse.getMaterialUnit()); - thrInvResultResponse.setPrice(BigDecimal.valueOf(ptxhInvResponse.getImportPrc())); - thrInvResultResponse.setAmount(BigDecimal.valueOf(ptxhInvResponse.getImportMoney())); -// thrInvResultResponse.setDeptName(ptxhInvResponse.getDebitName()); -// thrInvResultResponse.setDeptCode(ptxhInvResponse.getDebit()); -// thrInvResultResponse.setInvName(ptxhInvResponse.getCreditName()); -// thrInvResultResponse.setInvCode(ptxhInvResponse.getCredit()); - - thrInvResultResponse.setDeptName(ptxhInvResponse.getDebitName()); - thrInvResultResponse.setDeptCode("1002"); - thrInvResultResponse.setInvName(ptxhInvResponse.getCreditName()); - thrInvResultResponse.setInvCode("1000003"); - - thrInvResultResponse.setManufacturer(ptxhInvResponse.getFactoryName()); - thrInvResultResponse.setManufactoryCode(ptxhInvResponse.getFactoryCode()); - thrInvResultResponse.setMainAction(ConstantType.TYPE_OUT); - thrInvResultResponse.setBillType(ptxhInvResponse.getIoType()); - thrInvResultResponse.setType("1"); - thrInvResultResponse.setOutCount(ptxhInvResponse.getQuantity() + ""); - thrInvResultResponse.setReCount(ptxhInvResponse.getQuantity() + ""); - thrInvResultResponses.add(thrInvResultResponse); - } - } - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); - pageSimpleResponse.setTotal(thrInvResultResponses.size() + 0l); - pageSimpleResponse.setList(thrInvResultResponses); - return ResultVOUtils.success(pageSimpleResponse); - } - return baseResponse; - } - - - /** - * 获取库存扫码出入库明细(高值耗材出库明细) - * - * @param udiwmsInvProductsRequest - * @return - */ - @Override - public BaseResponse getInvCodeResult(UdiwmsInvProductsRequest udiwmsInvProductsRequest) { - CtqyyInvRequest ptxhyyInvRequest = new CtqyyInvRequest(); - ptxhyyInvRequest.setStartdate(DateUtil.formatDate(udiwmsInvProductsRequest.getStartDate(), "yyyy-MM-dd")); - ptxhyyInvRequest.setEnddate(DateUtil.formatDate(udiwmsInvProductsRequest.getEndDate(), "yyyy-MM-dd")); - - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getSickHighitem")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(ptxhyyInvRequest)); - - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_GET_INV_RESULT), ctqyyRequest); -// String response = -// "{\"code\": 20000,\"message\": \"success\",\"data\": {\"list\": [{\"recordNo\": 391,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63374\",\"materialName\": \"调节杠\",\"materialPrc\": 2100,\"dictBarcode\": \"0106971221560052\",\"Barcode\": \"111704022117000188340055\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"},{\"recordNo\": 390,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63374\",\"materialName\": \"调节杠\",\"materialPrc\": 2100,\"dictBarcode\": \"0106946149100093\",\"Barcode\": \"111704022117000188340007\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"},{\"recordNo\": 408,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63182\",\"materialName\": \"椎弓根螺钉\",\"materialPrc\": 4000,\"dictBarcode\": \"0106938695502193\",\"Barcode\": \"111703012117000076800035\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"},{\"recordNo\": 401,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63186\",\"materialName\": \"椎弓根螺钉\",\"materialPrc\": 4000,\"dictBarcode\": \"0106938695522023\",\"Barcode\": \"111612212116120902040009\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"},{\"recordNo\": 423,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63186\",\"materialName\": \"椎弓根螺钉\",\"materialPrc\": 4000,\"dictBarcode\": \"0106938695525055\",\"Barcode\": \"111701062116122700670005\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"},{\"recordNo\": 400,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63186\",\"materialName\": \"椎弓根螺钉\",\"materialPrc\": 4000,\"dictBarcode\": \"0106921814249918\",\"Barcode\": \"111612212116120902040047\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"},{\"recordNo\": 422,\"visitNo\": \"1711088001\",\"sickName\": \"黄瑞梅\",\"inDept\": \"88\",\"deptName\": \"骨科\",\"materialCode\": \"63186\",\"materialName\": \"椎弓根螺钉\",\"materialPrc\": 4000,\"dictBarcode\": \"0106921814249918\",\"Barcode\": \"111701062116122700670013\",\"feeTime\": \"2024-03-01 19:29:02\",\"feeOper\": \"郑淑环/2032\"}],\"total\": 7}}"; -// String response = null; -// try { -// response = FileUtils.getFileContent("E://ghresponse.json"); -// } catch (IOException e) { -// e.printStackTrace(); -// } - - BaseResponse> baseResponse = - JSONObject.parseObject(response, new TypeReference>>() { - }); - if (baseResponse.getCode() == 20000) { - Map mapArry = new HashMap<>(); - List newArry = new ArrayList<>(); - List ptxhInvResponses = baseResponse.getData().getList(); - List thrInvResultResponses = new ArrayList<>(); - if (CollUtil.isNotEmpty(ptxhInvResponses)) { - for (InvCodeResultEntity ptxhInvResponse : ptxhInvResponses) { - ThrInvResultResponse thrInvResultResponse = new ThrInvResultResponse(); - thrInvResultResponse.setThrCode(ptxhInvResponse.getMaterialCode()); - thrInvResultResponse.setCpmctymc(ptxhInvResponse.getMaterialName()); - thrInvResultResponse.setPrice(BigDecimal.valueOf(ptxhInvResponse.getMaterialPrc())); - - - thrInvResultResponse.setInvName(ptxhInvResponse.getDeptName()); - -// AuthWarehouseEntity warehouseEntity = authWarehouseDao.selectOne(new LambdaQueryWrapper().eq(AuthWarehouseEntity::getThirdId, ptxhInvResponse.getInDept())); -// if (warehouseEntity != null) -// thrInvResultResponse.setInvCode(warehouseEntity.getCode()); -// else -// thrInvResultResponse.setInvCode(ptxhInvResponse.getInDept()); - - thrInvResultResponse.setInvCode("1000003"); - thrInvResultResponse.setDeptCode("1002"); - thrInvResultResponse.setSickerCode(ptxhInvResponse.getVisitNo()); - thrInvResultResponse.setSickerName(ptxhInvResponse.getSickName()); - thrInvResultResponse.setBillType("SC71090077430919"); - thrInvResultResponse.setMainAction(ConstantType.TYPE_OUT); - thrInvResultResponse.setType("1"); - thrInvResultResponse.setOutCount("1"); - thrInvResultResponse.setReCount("1"); - IoCodeEntity codeEntity = codeDao.selectOne(new LambdaQueryWrapper().eq(IoCodeEntity::getCode, ptxhInvResponse.getBarcode()).last("limit 1")); - if (codeEntity == null) { - codeEntity = codeDao.selectOne(new LambdaQueryWrapper().eq(IoCodeEntity::getErrUdiCode, ptxhInvResponse.getBarcode()).last("limit 1")); - } - if (codeEntity != null) - thrInvResultResponse.setUdiCode(codeEntity.getCode()); - else - thrInvResultResponse.setUdiCode(ptxhInvResponse.getBarcode()); - thrInvResultResponses.add(thrInvResultResponse); - } - - for (ThrInvResultResponse thrInvResultResponse : thrInvResultResponses) { - mapArry.merge(thrInvResultResponse.getUdiCode(), thrInvResultResponse, (existingValue, newValue) -> { - // Assuming reCount can be directly handled as an integer to avoid String to Integer conversions - int updatedReCount = Integer.parseInt(existingValue.getReCount()) + Integer.parseInt(newValue.getReCount()); - existingValue.setReCount(String.valueOf(updatedReCount)); - existingValue.setOutCount(existingValue.getReCount()); - return existingValue; - }); - } - for (String key : mapArry.keySet()) { - newArry.add(mapArry.get(key)); - } - - } - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); - pageSimpleResponse.setTotal(newArry.size() + 0l); - pageSimpleResponse.setList(newArry); - return ResultVOUtils.success(pageSimpleResponse); - } - return baseResponse; - } - - @Resource - BasicSkProjectMapper basicSkProjectMapper; - @Resource - UdiRlSupDao udiRlSupDao; - @Resource - BasicDestinyRelMapper basicDestinyRelMapper; - - @Override - public BaseResponse getInvFeeResult(UdiwmsInvProductsRequest udiwmsInvProductsRequest) { - CtqyyInvRequest ptxhyyInvRequest = new CtqyyInvRequest(); - ptxhyyInvRequest.setStartdate(DateUtil.formatDate(udiwmsInvProductsRequest.getStartDate(), "yyyy-MM-dd")); - ptxhyyInvRequest.setEnddate(DateUtil.formatDate(udiwmsInvProductsRequest.getEndDate(), "yyyy-MM-dd")); - - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("getSickPriceitem")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(ptxhyyInvRequest)); - - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_GET_INV_RESULT), ctqyyRequest); -// String response = -// "{\"code\": 20000,\"message\": \"success\",\"data\": {\"list\": [{\"seqNo\": \"97425947\",\"visitNo\": \"1471827014\",\"sickName\": \"杨玉聪\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 00:53:56\"},{\"seqNo\": \"97425950\",\"visitNo\": \"1471827014\",\"sickName\": \"杨玉聪\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 00:53:56\"},{\"seqNo\": \"97426036\",\"visitNo\": \"1940696001\",\"sickName\": \"郑良屹\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950057000000\",\"itemName\": \"热敏胶片 8in*10in/HQ-KX411 A型\",\"Price\": 7.8,\"quantity\": 4,\"Cost\": 31.2,\"materialCode\": \"00087\",\"materialName\": \"热敏胶片\",\"OperTime\": \"2024-02-21 01:39:39\"},{\"seqNo\": \"97426048\",\"visitNo\": \"1746585006\",\"sickName\": \"张杨妍\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950030000005\",\"itemName\": \"一次性注射器2ml(/支)\",\"Price\": 0.21,\"quantity\": 1,\"Cost\": 0.21,\"materialCode\": \"77375\",\"materialName\": \"一次性注射器2ml\",\"OperTime\": \"2024-02-21 02:06:05\"},{\"seqNo\": \"97426113\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 04:49:46\"},{\"seqNo\": \"97426233\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 04:54:51\"},{\"seqNo\": \"97426247\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 04:54:55\"},{\"seqNo\": \"97426250\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950029000010\",\"itemName\": \"一次性使用输液器BI-IT带针0.7# /支)\",\"Price\": 0.81,\"quantity\": 1,\"Cost\": 0.81,\"materialCode\": \"02585\",\"materialName\": \"一次性使用输液器 带针\",\"OperTime\": \"2024-02-21 04:56:20\"},{\"seqNo\": \"97426251\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950030000006\",\"itemName\": \"一次性无菌注射器20ml(/支)\",\"Price\": 0.48,\"quantity\": 2,\"Cost\": 0.96,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 04:56:21\"},{\"seqNo\": \"97426252\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950031000025\",\"itemName\": \"一次性使用静脉留置针22GII型A(直型连接座式安全型)Y型2225601\",\"Price\": 4.82,\"quantity\": 1,\"Cost\": 4.82,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 04:56:21\"},{\"seqNo\": \"97426258\",\"visitNo\": \"1735717004\",\"sickName\": \"林文秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950030000005\",\"itemName\": \"一次性注射器2ml(/支)\",\"Price\": 0.21,\"quantity\": 1,\"Cost\": 0.21,\"materialCode\": \"77375\",\"materialName\": \"一次性注射器2ml\",\"OperTime\": \"2024-02-21 04:56:24\"},{\"seqNo\": \"97426284\",\"visitNo\": \"1801137003\",\"sickName\": \"杨立群\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950030000005\",\"itemName\": \"一次性注射器2ml(/支)\",\"Price\": 0.21,\"quantity\": 1,\"Cost\": 0.21,\"materialCode\": \"77375\",\"materialName\": \"一次性注射器2ml\",\"OperTime\": \"2024-02-21 05:03:40\"},{\"seqNo\": \"97426357\",\"visitNo\": \"1940699001\",\"sickName\": \"严明祥\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950031000025\",\"itemName\": \"一次性使用静脉留置针22GII型A(直型连接座式安全型)Y型2225601\",\"Price\": 4.82,\"quantity\": 1,\"Cost\": 4.82,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 05:28:40\"},{\"seqNo\": \"97426358\",\"visitNo\": \"1940699001\",\"sickName\": \"严明祥\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950030000006\",\"itemName\": \"一次性无菌注射器20ml(/支)\",\"Price\": 0.48,\"quantity\": 2,\"Cost\": 0.96,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 05:28:40\"},{\"seqNo\": \"97426359\",\"visitNo\": \"1940699001\",\"sickName\": \"严明祥\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950029000010\",\"itemName\": \"一次性使用输液器BI-IT带针0.7# /支)\",\"Price\": 0.81,\"quantity\": 1,\"Cost\": 0.81,\"materialCode\": \"02585\",\"materialName\": \"一次性使用输液器 带针\",\"OperTime\": \"2024-02-21 05:28:40\"},{\"seqNo\": \"97426433\",\"visitNo\": \"1940702001\",\"sickName\": \"伍邦柏\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950030000005\",\"itemName\": \"一次性注射器2ml(/支)\",\"Price\": 0.21,\"quantity\": 1,\"Cost\": 0.21,\"materialCode\": \"77375\",\"materialName\": \"一次性注射器2ml\",\"OperTime\": \"2024-02-21 06:51:25\"},{\"seqNo\": \"97426478\",\"visitNo\": \"1927463002\",\"sickName\": \"林海龙\",\"applyDept\": \"187\",\"deptName\": \"门诊呼吸与危重症医学科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:42:23\"},{\"seqNo\": \"97426486\",\"visitNo\": \"1927463002\",\"sickName\": \"林海龙\",\"applyDept\": \"187\",\"deptName\": \"门诊呼吸与危重症医学科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:42:24\"},{\"seqNo\": \"97426518\",\"visitNo\": \"1940705001\",\"sickName\": \"姚连菊\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:48:31\"},{\"seqNo\": \"97426521\",\"visitNo\": \"1940705001\",\"sickName\": \"姚连菊\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:48:31\"},{\"seqNo\": \"97426523\",\"visitNo\": \"1940703001\",\"sickName\": \"薛连辉\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:49:10\"},{\"seqNo\": \"97426529\",\"visitNo\": \"1940703001\",\"sickName\": \"薛连辉\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000007\",\"itemName\": \"一次性使用人体静脉血样采集容器(肝素锂 绿色 5ml/支)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68972\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:49:11\"},{\"seqNo\": \"97426535\",\"visitNo\": \"1940703001\",\"sickName\": \"薛连辉\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:49:13\"},{\"seqNo\": \"97426537\",\"visitNo\": \"1940703001\",\"sickName\": \"薛连辉\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:49:15\"},{\"seqNo\": \"97426557\",\"visitNo\": \"1629086067\",\"sickName\": \"杨培恭\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:50:11\"},{\"seqNo\": \"97426559\",\"visitNo\": \"1629086067\",\"sickName\": \"杨培恭\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:50:12\"},{\"seqNo\": \"97426561\",\"visitNo\": \"1629086067\",\"sickName\": \"杨培恭\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:50:14\"},{\"seqNo\": \"97426567\",\"visitNo\": \"1629086067\",\"sickName\": \"杨培恭\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950046000007\",\"itemName\": \"一次性使用人体静脉血样采集容器(肝素锂 绿色 5ml/支)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68972\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:50:15\"},{\"seqNo\": \"97426570\",\"visitNo\": \"1407999064\",\"sickName\": \"蔡美花\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:50:24\"},{\"seqNo\": \"97426572\",\"visitNo\": \"1407999064\",\"sickName\": \"蔡美花\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:50:24\"},{\"seqNo\": \"97426574\",\"visitNo\": \"1407999064\",\"sickName\": \"蔡美花\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:50:24\"},{\"seqNo\": \"97426576\",\"visitNo\": \"1547551020\",\"sickName\": \"黄靖宇\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:50:44\"},{\"seqNo\": \"97426581\",\"visitNo\": \"1547551020\",\"sickName\": \"黄靖宇\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950046000007\",\"itemName\": \"一次性使用人体静脉血样采集容器(肝素锂 绿色 5ml/支)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68972\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:50:46\"},{\"seqNo\": \"97426583\",\"visitNo\": \"1547551020\",\"sickName\": \"黄靖宇\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:50:47\"},{\"seqNo\": \"97426591\",\"visitNo\": \"1547551020\",\"sickName\": \"黄靖宇\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:50:48\"},{\"seqNo\": \"97426642\",\"visitNo\": \"1613276019\",\"sickName\": \"黄英连\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:56:13\"},{\"seqNo\": \"97426649\",\"visitNo\": \"1613276019\",\"sickName\": \"黄英连\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:56:16\"},{\"seqNo\": \"97426654\",\"visitNo\": \"1613276019\",\"sickName\": \"黄英连\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:56:18\"},{\"seqNo\": \"97426704\",\"visitNo\": \"1408701039\",\"sickName\": \"胡玮坤\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:56:40\"},{\"seqNo\": \"97426705\",\"visitNo\": \"1408701039\",\"sickName\": \"胡玮坤\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:56:40\"},{\"seqNo\": \"97426713\",\"visitNo\": \"1408701039\",\"sickName\": \"胡玮坤\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:56:40\"},{\"seqNo\": \"97426714\",\"visitNo\": \"1408701039\",\"sickName\": \"胡玮坤\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000007\",\"itemName\": \"一次性使用人体静脉血样采集容器(肝素锂 绿色 5ml/支)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68972\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:56:40\"},{\"seqNo\": \"97426719\",\"visitNo\": \"1900545011\",\"sickName\": \"李光婷\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 07:56:42\"},{\"seqNo\": \"97426724\",\"visitNo\": \"1900545011\",\"sickName\": \"李光婷\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950046000007\",\"itemName\": \"一次性使用人体静脉血样采集容器(肝素锂 绿色 5ml/支)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68972\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 07:56:42\"},{\"seqNo\": \"97426934\",\"visitNo\": \"1719779006\",\"sickName\": \"吴玉秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 08:00:20\"},{\"seqNo\": \"97427072\",\"visitNo\": \"1719779006\",\"sickName\": \"吴玉秀\",\"applyDept\": \"65\",\"deptName\": \"急诊科\",\"itemCode\": \"950046000007\",\"itemName\": \"一次性使用人体静脉血样采集容器(肝素锂 绿色 5ml/支)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68972\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 08:00:22\"},{\"seqNo\": \"97427377\",\"visitNo\": \"1537583008\",\"sickName\": \"刘阿花\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950027000004\",\"itemName\": \"一次性使用静脉采血针\",\"Price\": 0.19,\"quantity\": 1,\"Cost\": 0.19,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 08:02:37\"},{\"seqNo\": \"97427380\",\"visitNo\": \"1537583008\",\"sickName\": \"刘阿花\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 08:02:39\"},{\"seqNo\": \"97427383\",\"visitNo\": \"1537583008\",\"sickName\": \"刘阿花\",\"applyDept\": \"113\",\"deptName\": \"内一门诊\",\"itemCode\": \"950046000004\",\"itemName\": \"一次性使用人体静脉血样采集容器(血常规管 2ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"\",\"materialName\": \"\",\"OperTime\": \"2024-02-21 08:02:41\"},{\"seqNo\": \"97427390\",\"visitNo\": \"1398769053\",\"sickName\": \"徐丽松\",\"applyDept\": \"56\",\"deptName\": \"门诊内科\",\"itemCode\": \"950046000005\",\"itemName\": \"一次性使用人体静脉血样采集容器(生化管 5ml)\",\"Price\": 0.59,\"quantity\": 1,\"Cost\": 0.59,\"materialCode\": \"68973\",\"materialName\": \"一次性使用人体静脉血样采集容器\",\"OperTime\": \"2024-02-21 08:02:48\"}],\"total\": 12296}}"; - BaseResponse> baseResponse = - JSONObject.parseObject(response, new TypeReference>>() { - }); - if (baseResponse.getCode() == 20000) { - List ptxhInvResponses = baseResponse.getData().getList(); - List thrInvResultResponses = new ArrayList<>(); - Set seenNames = new HashSet<>(); - List itemData = new ArrayList<>(); - if (CollUtil.isNotEmpty(ptxhInvResponses)) { - for (InvProjectResultEntity ptxhInvResponse : ptxhInvResponses) { - ThrInvResultResponse thrInvResultResponse = new ThrInvResultResponse(); - thrInvResultResponse.setThrCode(ptxhInvResponse.getMaterialCode()); - thrInvResultResponse.setCpmctymc(ptxhInvResponse.getItemName()); - thrInvResultResponse.setSickerCode(ptxhInvResponse.getVisitNo()); - thrInvResultResponse.setSickerName(ptxhInvResponse.getSickName()); - thrInvResultResponse.setPrice(BigDecimal.valueOf(ptxhInvResponse.getPrice())); - thrInvResultResponse.setAmount(BigDecimal.valueOf(ptxhInvResponse.getCost())); - thrInvResultResponse.setDeptName(ptxhInvResponse.getDeptName()); - thrInvResultResponse.setDeptCode("1002"); - thrInvResultResponse.setInvName(ptxhInvResponse.getDeptName()); - thrInvResultResponse.setInvCode("1000003"); - thrInvResultResponse.setThrCode(ptxhInvResponse.getItemCode()); - thrInvResultResponse.setMainAction(ConstantType.TYPE_OUT); - thrInvResultResponse.setType("1"); - thrInvResultResponse.setOutCount(ptxhInvResponse.getQuantity() + ""); - thrInvResultResponse.setReCount(ptxhInvResponse.getQuantity() + ""); - thrInvResultResponses.add(thrInvResultResponse); - if (seenNames.add(ptxhInvResponse.getItemCode())) { - itemData.add(ptxhInvResponse); - } - } - } - for (InvProjectResultEntity invProjectResultEntity : itemData) { - if (!basicSkProjectMapper.exists(new QueryWrapper().eq("code", invProjectResultEntity.getItemCode()))) { - BasicSkProjectEntity basicSkProjectEntity = new BasicSkProjectEntity(); - basicSkProjectEntity.setCode(invProjectResultEntity.getItemCode()); - basicSkProjectEntity.setName(invProjectResultEntity.getItemName()); - basicSkProjectEntity.setType(2); - basicSkProjectEntity.setCreateTime(new Date()); - basicSkProjectEntity.setUpdateTime(new Date()); - basicSkProjectEntity.setRemark("出入库明细自动生成"); - basicSkProjectEntity.setId(IdUtil.getSnowflakeNextId()); - basicSkProjectMapper.insert(basicSkProjectEntity); - List thrProductsEntitys = thrProductsDao.selectList(new QueryWrapper().eq("prcitmcode", invProjectResultEntity.getItemCode())); - if (CollUtil.isNotEmpty(thrProductsEntitys)) { - for (ThrProductsEntity thrProductsEntity : thrProductsEntitys) { - CompanyProductRelevanceRequest companyProductRelevanceRequest = new CompanyProductRelevanceRequest(); - companyProductRelevanceRequest.setThirdId(thrProductsEntity.getCode()); - List udiRlSupResponses = udiRlSupDao.filterUdiGp(companyProductRelevanceRequest); - if (CollUtil.isNotEmpty(udiRlSupResponses)) { - UdiRlSupResponse udiRlSupResponse = udiRlSupResponses.get(0); - BasicSkProjectDetailEntity basicSkProjectDetailEntity = new BasicSkProjectDetailEntity(); - basicSkProjectDetailEntity.setId(IdUtil.getSnowflakeNextId()); - basicSkProjectDetailEntity.setRelId(udiRlSupResponse.getRlId()); - basicSkProjectDetailEntity.setSupId(udiRlSupResponse.getCustomerId()); - basicSkProjectDetailEntity.setPId(basicSkProjectEntity.getId()); - basicSkProjectDetailEntity.setThrCode(thrProductsEntity.getCode()); - basicSkProjectDetailEntity.setThrName(thrProductsEntity.getName()); - basicSkProjectDetailEntity.setCreateTime(DateUtil.formatDateTime(new Date())); - basicSkProjectDetailEntity.setCreateUser("1"); - basicSkProjectDetailEntity.setUpdateTime(DateUtil.formatDateTime(new Date())); - basicSkProjectDetailEntity.setUpdateUser("1"); - basicSkProjectDetailEntity.setRemark("出入库明细自动生成"); - basicSkProjectDetailEntity.setCount(1); - basicDestinyRelMapper.insert(basicSkProjectDetailEntity); - } - } - } - - } - } - - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); - pageSimpleResponse.setTotal(thrInvResultResponses.size() + 0l); - pageSimpleResponse.setList(thrInvResultResponses); - return ResultVOUtils.success(pageSimpleResponse); - } - return baseResponse; - } - - @Override - public BaseResponse getInvProducts(UdiwmsInvProductsRequest udiwmsInvProductsRequest) { - return null; - } - - @Override - public BaseResponse getWarehouse(UdiwmsWarehouseRequest udiwmsWarehouseRequest) { - return null; - } - - @Override - public BaseResponse testConnect() { - UdiwmsUnitRequest udiwmsUnitRequest = new UdiwmsUnitRequest(); - udiwmsUnitRequest.setPage(1); - udiwmsUnitRequest.setLimit(1); - BaseResponse baseResponse = getUnit(udiwmsUnitRequest); - if (baseResponse.getCode() == 20000) { - return ResultVOUtils.success("连接成功!"); - } - return ResultVOUtils.error(500, "连接失败!"); - } - - @Override - public BaseResponse queryUdiInvProducts(UdiwmsQueryUdiInvProductsRequest queryUdiInvProductsRequest) { - return null; - } - - @Override - public BaseResponse submitProducts(UdiwmsAddProductsRequest udiwmsAddProductsRequest) { - return null; - } - - @Override - public BaseResponse submitUnit(UdiwmsAddUnitRequest udiwmsAddUnitRequest) { - - - CtqyyRequest ctqyyRequest = new CtqyyRequest(); - ctqyyRequest.setMsgHeader(getMsgHeader("addSupplierDict")); - ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsAddUnitRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_PRODUCT_SUBMIT_URL), ctqyyRequest); - response = parserResult(response); - try { - log.error("提交往来单位/生产厂家:" + ctqyyRequest.getMsgBody()); - CtBaseResponse baseResponse = JSONObject.parseObject(response, CtBaseResponse.class); - if (baseResponse.getCode() != 20000) { - String errMsg = "提交往来单位/生产厂家,异常:{}" + response; - log.error(errMsg); - return ResultVOUtils.error(500, "提交往来单位/生产厂家失败!"); - } else { - BasicCorpEntity basicCorpEntity = new BasicCorpEntity(); - basicCorpEntity.setErpId(CustomUtil.getUnitId()); - basicCorpEntity.setName(udiwmsAddUnitRequest.getSupplierName()); - basicCorpEntity.setCorpType(2); - basicCorpEntity.setThirdId(baseResponse.getSupplierCode()); - basicCorpDao.insert(basicCorpEntity); - log.error("提交往来单位/生产厂家,成功:{}", response); - return ResultVOUtils.success(baseResponse.getMaterialNo()); - } - } catch (Exception e) { - String errMsg = "提交往来单位/生产厂家,异常:{}" + response; - log.error(errMsg); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, errMsg); - - } - } - - @Override - public BaseResponse postProducts(PostThrProductsRequest postThrProductsRequest) { - return null; - } - - @Override - public BaseResponse postCorps(PostThrCorpRequest postThrCorpRequest) { - return null; - } - - @Override - public BaseResponse postOrderDetail(PostFileThrOrderRequest postFileThrOrderRequest) { - return null; - } - - @Override - public BaseResponse postInvProducts(PostThrInvProductsRequest postThrInvProductsRequest) { - return null; - } - - - /** - * 封装单据详情参数 - * - * @param ioCodeEntities 单据码明细 - * @param orderDetailRequests 单据详情参数 - * @param detailBizEntities 单据业务详情 - */ - private String setOrderDetailList(List ioCodeEntities, List orderDetailRequests, List detailBizEntities) { - String errMsg = ""; - for (IoOrderDetailBizEntity detailBizEntity : detailBizEntities) { - - IoOrderDetailCodeEntity orderDetailCodeEntity = orderDetailCodeDao - .selectOne(new QueryWrapper() - .eq("orderIdFk", detailBizEntity.getOrderIdFk()) - .eq("bindRlFk", detailBizEntity.getBindRlFk()) - .eq(StrUtil.isNotEmpty(detailBizEntity.getBatchNo()), "batchNo", detailBizEntity.getBatchNo()) - .isNull(StrUtil.isEmpty(detailBizEntity.getBatchNo()), "batchNo").last("LIMIT 1")); - if (orderDetailCodeEntity != null && IntUtil.value(orderDetailCodeEntity.getReCount()) > 0) { - detailBizEntity.setCount(orderDetailCodeEntity.getReCount()); - UdiwmsOrderDetailRequest item = buildProductInfo(detailBizEntity); - if (item != null) { - //封装条码信息 - submitOrderUtil.setCodeList(ioCodeEntities, detailBizEntity, item); - orderDetailRequests.add(item); - } else { - errMsg = detailBizEntity.getCoName() + "," + "第三方产品编码未关联"; - } - } - } - return errMsg; - } - - - @Resource - private ThrProductsDao thrProductsDao; - - public UdiwmsOrderDetailRequest buildProductInfo(IoOrderDetailBizEntity detailBizEntity) { - //查询产品信息 - BasicUdirelEntity basicUdirel = basicUdirelDao.selectById(detailBizEntity.getBindRlFk()); - BasicProductsEntity basicProducts = basicProductsDao.selectOne(new LambdaQueryWrapper().eq(BasicProductsEntity::getUuid, basicUdirel.getUuid()).last("limit 1")); - - UdiwmsOrderDetailRequest item = new UdiwmsOrderDetailRequest(); - BeanUtil.copyProperties(detailBizEntity, item); - - item.setProductDate(DateUtil.formatExpireTime(StrUtil.isBlank(detailBizEntity.getProductDate()) ? null : "20" + detailBizEntity.getProductDate())); - item.setExpireDate(DateUtil.formatExpireTime(StrUtil.isBlank(detailBizEntity.getExpireDate()) ? null : "20" + detailBizEntity.getExpireDate())); - - String thirdProductId = (String) ReflectUtil.getFieldValue(basicUdirel, thirdSysConfig.getThirdId()); - item.setProductId(thirdProductId); //产品ID - //查询第三方产品名称 - ThrProductsEntity thrProductsEntity = thrProductsDao.selectOne(new LambdaQueryWrapper() - .eq(ThrProductsEntity::getCode, thirdProductId).last("limit 1")); - if (thrProductsEntity == null) { - log.error("第三方产品编码未关联"); - return null; - } - item.setProductName(thrProductsEntity.getName()); //产品名称 - item.setBindRlFk(detailBizEntity.getBindRlFk()); - item.setStandard(detailBizEntity.getSpec()); //规格型号 - item.setBillNo(detailBizEntity.getOrderIdFk()); //单据号 - item.setRegisterNo(detailBizEntity.getCertCode()); //注册/备案证号 - item.setManufactory(basicProducts.getManufactory()); //生产厂家 - item.setMeasname(thrProductsEntity.getMeasname()); //计量单位 - item.setAllowNoBatch(IntUtil.value(basicProducts.getAllowNoBatch())); //是否允许无批次号 - if (StrUtil.isNotEmpty(item.getManufactory())) { - ThrCorpEntity thrCorpEntity = thrCorpService.getThrCorpByName(item.getManufactory()); - if (thrCorpEntity != null) - item.setManufactoryCode(thrCorpEntity.getUnitId()); - } - item.setSupCode(thrProductsEntity.getSupCode()); - item.setCplb(thrProductsEntity.getFlbm()); - item.setHslb(thrProductsEntity.getCplb()); - item.setCount(detailBizEntity.getCount()); - return item; - } - - - /** - * 处理提交单据,记录日志,解析结果逻辑 - * - * @param orderEntity - * @param zaZyRequest - * @return - */ - private BaseResponse submitOrder(IoOrderEntity orderEntity, ZzzyyRequest zaZyRequest) { - //记录日志 - IoOrderUploadLogEntity uploadLog = new IoOrderUploadLogEntity(); - uploadLog.setBillDate(orderEntity.getCreateTime()); - uploadLog.setBillType(orderEntity.getAction()); - uploadLog.setSubmitTime(new Date()); - uploadLog.setBillNo(orderEntity.getBillNo()); - uploadLog.setFromType(Constants.THIRD_ORDER_UPLOAD); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_ORDER_SUBMIT_URL), zaZyRequest); - response = parserResult(response); - if (StrUtil.isNotBlank(response)) { - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - if (baseResponse.getCode() == 20000) { - String thirdBillNo = String.valueOf(baseResponse.getData()); - orderEntity.setThirdBillNo(thirdBillNo); - orderEntity.setExportStatus(1); //提交成功 - uploadLog.setStatus(2); - uploadLog.setThrBillNo(thirdBillNo); - uploadLog.setResult("提交成功"); - orderDao.updateById(orderEntity); - orderUploadLogDao.insert(uploadLog); - return ResultVOUtils.success("提交成功"); - } - uploadLog.setStatus(3); - uploadLog.setResult("提交失败,错误信息:" + baseResponse.getMessage()); - orderEntity.setExportStatus(2); //上传失败 - orderDao.updateById(orderEntity); - orderUploadLogDao.insert(uploadLog); - return baseResponse; - } catch (Exception e) { - log.error("解析提交到智业单据返回结果异常,结果信息:{}", response); - log.error("异常信息:{}", e); - uploadLog.setStatus(3); - uploadLog.setResult("提交失败,错误信息:" + response); - orderEntity.setExportStatus(2); //上传失败 - orderDao.updateById(orderEntity); - orderUploadLogDao.insert(uploadLog); - return ResultVOUtils.error(500, "提交失败"); - } - } else { - uploadLog.setStatus(3); - uploadLog.setResult("提交失败,调用接口返回为空"); - orderEntity.setExportStatus(2); //上传失败 - orderDao.updateById(orderEntity); - orderUploadLogDao.insert(uploadLog); - return ResultVOUtils.error(500, "提交失败"); - } - } - - - @Override - public BaseResponse submitPreInOrders(UdiwmsPreInOrderRequest udiwmsPreInOrderRequest) { - ZzzyyRequest zaZyRequest = new ZzzyyRequest(); - zaZyRequest.setMsgHeader(getMsgHeader("saveMaterialHight")); - zaZyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsPreInOrderRequest)); - String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_PRE_IN_ORDER_SUBMIT_URL), zaZyRequest); - response = parserResult(response); - try { - BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); - return baseResponse; - } catch (Exception e) { - log.error("解析云霄妇幼医院智业接口提交单据返回数据异常,返回结果:{}", response); - log.error("异常信息:{}", e); - return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); - } - } - - - /** - * 转换提交单据参数 - * - * @param udiwmsOrderRequest - * @param orderEntity - * @return - */ - public UdiwmsPreInOrderRequest submitPreInOrderToThirdSys(ZaxzyyOrderRequest udiwmsOrderRequest, IoOrderEntity orderEntity) { - UdiwmsPreInOrderRequest udiwmsPreInOrderRequest = new UdiwmsPreInOrderRequest(); - if (udiwmsOrderRequest != null) { - BeanUtils.copyProperties(udiwmsOrderRequest, udiwmsPreInOrderRequest); - udiwmsPreInOrderRequest.setLocInvCode(udiwmsOrderRequest.getLocStorageCode()); - udiwmsPreInOrderRequest.setLocInvName(udiwmsOrderRequest.getLocStorageName()); - String deptCode = "70"; - if (StrUtil.isNotEmpty(orderEntity.getOriginUllageSupNo())) { - IoOrderEntity temp = orderDao.selectOne(new QueryWrapper().eq("billNo", orderEntity.getOriginUllageSupNo()).last("limit 1")); - if (temp != null && StrUtil.isNotEmpty(temp.getFromInvCode())) { - AuthWarehouseEntity authWarehouseEntity = - authWarehouseDao.selectOne(new QueryWrapper().eq("code", temp.getFromInvCode()).last("limit 1")); - deptCode = authWarehouseEntity.getThirdId(); - } - } - udiwmsPreInOrderRequest.setDeptCode(deptCode); - if (orderEntity.getReviewUser() != null) { - AuthUserEntity authUser = authUserDao.selectById(orderEntity.getReviewUser()); - udiwmsPreInOrderRequest.setActor(authUser.getEmployeeName()); - } else if (orderEntity.getCreateUser() != null) { - AuthUserEntity authUser = authUserDao.selectById(orderEntity.getCreateUser()); - udiwmsPreInOrderRequest.setActor(authUser.getEmployeeName()); - } - List itemDTOS = new ArrayList<>(); - if (CollUtil.isNotEmpty(udiwmsOrderRequest.getItem())) { - for (UdiwmsOrderDetailRequest udiwmsOrderDetail : udiwmsOrderRequest.getItem()) { - if (CollUtil.isNotEmpty(udiwmsOrderDetail.getCodeList())) { - for (UdiwmsOrderDetailRequest.CodeDetailEntity codeDetaiEntity : udiwmsOrderDetail.getCodeList()) { - UdiwmsPreInOrderRequest.ItemDTO itemDTO = new UdiwmsPreInOrderRequest.ItemDTO(); - BeanUtils.copyProperties(udiwmsOrderDetail, itemDTO); - if (StrUtil.isNotEmpty(itemDTO.getManufactory())) { - ThrCorpEntity thrCorpEntity = thrCorpService.getThrCorpByName(itemDTO.getManufactory()); - if (thrCorpEntity != null) - itemDTO.setManufactoryCode(thrCorpEntity.getUnitId()); - } - String code = codeDetaiEntity.getCode(); - if (code.contains("\u001D")) { -// code = code.replace("\u001D", "zysoft"); 智业无法识别GS1符号 - code = code.replace("\u001D", ""); - } - itemDTO.setCode(code); - itemDTO.setNameCode(codeDetaiEntity.getNameCode()); - - if (IntUtil.value(codeDetaiEntity.getCount()) > 1) { - for (int i = 0; i < codeDetaiEntity.getCount(); i++) { - itemDTO.setCount(1); - itemDTOS.add(itemDTO); - } - } else { - itemDTO.setCount(codeDetaiEntity.getCount()); - itemDTOS.add(itemDTO); - } - - - } - } - } - } - udiwmsPreInOrderRequest.setItems(itemDTOS); - } - return udiwmsPreInOrderRequest; - } - - - /** - * ------------------------------------------现场管理医保相关接口方法-------------------------------------------------------------- - */ - /** - * 处方拉取视图 - * - * @param udiwmsBasicSkPrescribeRequest - * @return - */ - @Override - public BaseResponse getPrescribes(UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest) { - if (IntUtil.value(udiwmsBasicSkPrescribeRequest.getInOutType()) == 0) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - - String startTime = udiwmsBasicSkPrescribeRequest.getStartTime(); - String endTime = udiwmsBasicSkPrescribeRequest.getEndTime(); - wrapper.ge(StrUtil.isNotEmpty(startTime), VInsurNationGoodsPhysic::getSEL_RETN_TIME, startTime); - wrapper.le(StrUtil.isNotEmpty(endTime), VInsurNationGoodsPhysic::getSEL_RETN_TIME, endTime); - - String code = udiwmsBasicSkPrescribeRequest.getCode(); - String fromCorpName = udiwmsBasicSkPrescribeRequest.getFromCorpName(); - String key = udiwmsBasicSkPrescribeRequest.getKey(); - wrapper.and(StrUtil.isNotEmpty(code), t -> t.eq(VInsurNationGoodsPhysic::getSTOOUT_NO, code).or().eq(VInsurNationGoodsPhysic::getRXNO, code)); - wrapper.and(StrUtil.isNotEmpty(key), t -> t.like(VInsurNationGoodsPhysic::getSTOOUT_NO, key) - .or().like(VInsurNationGoodsPhysic::getRXNO, key) - .or().like(VInsurNationGoodsPhysic::getPSN_NAME, key) - .or().like(VInsurNationGoodsPhysic::getPSN_NO, key) - ); - wrapper.and(StrUtil.isNotEmpty(fromCorpName), t -> t.eq(VInsurNationGoodsPhysic::getPSN_NAME, fromCorpName)); - // 拉取处方时,改成拉取v_ypzs_pres_info - IPage page = vYpzsPresInfoMapper.selectGroupedWithPagination(new Page(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()), - udiwmsBasicSkPrescribeRequest); - - return this.covertSellOrder(udiwmsBasicSkPrescribeRequest, page); - } else { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - - String startTime = udiwmsBasicSkPrescribeRequest.getStartTime(); - String endTime = udiwmsBasicSkPrescribeRequest.getEndTime(); - wrapper.ge(StrUtil.isNotEmpty(startTime), VInsurNationGoodsReturn::getSEL_RETN_TIME, startTime); - wrapper.le(StrUtil.isNotEmpty(endTime), VInsurNationGoodsReturn::getSEL_RETN_TIME, endTime); - - - String code = udiwmsBasicSkPrescribeRequest.getCode(); - String fromCorpName = udiwmsBasicSkPrescribeRequest.getFromCorpName(); - String key = udiwmsBasicSkPrescribeRequest.getKey(); - wrapper.and(StrUtil.isNotEmpty(key), t -> t.like(VInsurNationGoodsReturn::getAPPLY_NO, key) - .or().like(VInsurNationGoodsReturn::getPSN_NAME, key) - .or().like(VInsurNationGoodsReturn::getPSN_NO, key) - ); - wrapper.and(StrUtil.isNotEmpty(code), t -> t.eq(VInsurNationGoodsReturn::getAPPLY_NO, code)); - wrapper.and(StrUtil.isNotEmpty(fromCorpName), t -> t.eq(VInsurNationGoodsReturn::getPSN_NAME, fromCorpName)); - //拉取处方退货时,改成拉取v_ypzs_pres_info_return - IPage page = vYpzsPresInfoReturnMapper.selectGroupedWithPagination(new Page(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()), - udiwmsBasicSkPrescribeRequest); - return this.covertReturnOrder(udiwmsBasicSkPrescribeRequest, page); - } - - } - - - /** - * 采购计划拉取视图 - * - * @param udiwmsThrOrderRequest - * @return - */ - @Override - public BaseResponse getThrOrders(UdiwmsThrOrderRequest udiwmsThrOrderRequest) { - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); - if (BusTypeConstant.CGJH001.getBusType().equals(udiwmsThrOrderRequest.getBusType())) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - -// String startTime = udiwmsThrOrderRequest.getStartTime(); -// String endTime = udiwmsThrOrderRequest.getEndTime(); -// wrapper.ge(StrUtil.isNotEmpty(startTime),VYpzsPlanInfo::getKEEP_BOOK_TIME,startTime+" 00:00:00"); -// wrapper.le(StrUtil.isNotEmpty(endTime),VYpzsPlanInfo::getKEEP_BOOK_TIME,endTime+" 23:59:59"); - - wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBillNo()), VYpzsPlanInfo::getCGDBH, udiwmsThrOrderRequest.getBillNo()); - //关键字模糊处理 - String keywords = udiwmsThrOrderRequest.getKeyWords(); - wrapper.and(StrUtil.isNotEmpty(keywords), t -> t.like(VYpzsPlanInfo::getCGDBH, keywords)//单据号 - ); - wrapper.like(StrUtil.isNotEmpty(udiwmsThrOrderRequest.getFromCorpName()), VYpzsPlanInfo::getSCQYMC, udiwmsThrOrderRequest.getFromCorpName()); - - Page page = vYpzsPlanInfoMapper.selectGroupedWithPagination(new Page(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), udiwmsThrOrderRequest); - - List planInfos = page.getRecords(); - List ioCollectOrders = new ArrayList<>(); - if (CollUtil.isNotEmpty(planInfos)) { - - List collect = planInfos.stream().map(VYpzsPlanInfo::getCGDBH).collect(Collectors.toList()); - LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); - wrapper1.in(VYpzsPlanInfo::getCGDBH, collect); - List vYpzsPlanInfos = vYpzsPlanInfoMapper.selectList(wrapper1); - - Map> groupedByBz = vYpzsPlanInfos.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 bizList = new ArrayList<>(); - value.forEach(entity -> { - IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz(); - BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper().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 wrapper = new LambdaQueryWrapper<>(); - - String startTime = udiwmsThrOrderRequest.getStartTime(); - String endTime = udiwmsThrOrderRequest.getEndTime(); - wrapper.ge(StrUtil.isNotEmpty(startTime), VYpzsIoInfo::getKEEP_BOOK_TIME, startTime); - wrapper.le(StrUtil.isNotEmpty(endTime), VYpzsIoInfo::getKEEP_BOOK_TIME, endTime); - wrapper.and(StrUtil.isNotEmpty(udiwmsThrOrderRequest.getCorpName()), t -> t.like(VYpzsIoInfo::getCONSIGNEE_NAME, udiwmsThrOrderRequest.getCorpName()).or().eq(VYpzsIoInfo::getCONSIGNOR_NAME, udiwmsThrOrderRequest.getCorpName())); - - wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBillNo()), VYpzsIoInfo::getPHYSIC_CODE, udiwmsThrOrderRequest.getBillNo()); - wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBusType()), VYpzsIoInfo::getIO_SORT, udiwmsThrOrderRequest.getBusType()); - - wrapper.like(StrUtil.isNotEmpty(udiwmsThrOrderRequest.getFromCorpName()), VYpzsIoInfo::getCONSIGNEE_NAME, udiwmsThrOrderRequest.getFromCorpName()); - wrapper.like(StrUtil.isNotEmpty(udiwmsThrOrderRequest.getShipperName()), VYpzsIoInfo::getCONSIGNOR_NAME, udiwmsThrOrderRequest.getShipperName()); - //关键字模糊处理 - String keywords = udiwmsThrOrderRequest.getKeyWords(); - wrapper.and(StrUtil.isNotEmpty(keywords), t -> t.like(VYpzsIoInfo::getPHYSIC_CODE, keywords)//单据号 - .or().like(VYpzsIoInfo::getCONSIGNOR_NAME, keywords)//发货方 - .or().like(VYpzsIoInfo::getCONSIGNEE_NAME, keywords)//收货方 - .or().like(VYpzsIoInfo::getKEEP_BOOK_TIME, keywords)//收货方 - .or().like(VYpzsIoInfo::getIO_SORT, keywords)//收货方 - ); - - Page page = vYpzsIoInfoMapper.selectGroupedWithPagination(new Page(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), udiwmsThrOrderRequest); - - List ioInfos = page.getRecords(); - List ioCollectOrders = new ArrayList<>(); - if (CollUtil.isNotEmpty(ioInfos)) { - List collect = ioInfos.stream().map(VYpzsIoInfo::getRECEIPT_NUMBER).collect(Collectors.toList()); - LambdaQueryWrapper vYpzsIoInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); - vYpzsIoInfoLambdaQueryWrapper.in(VYpzsIoInfo::getRECEIPT_NUMBER, collect); - List vYpzsIoInfos = vYpzsIoInfoMapper.selectList(vYpzsIoInfoLambdaQueryWrapper); - - Map> groupedByPhysicCode = vYpzsIoInfos.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.getRECEIPT_NUMBER()); - ioCollectOrder.setFromType("HIS系统"); - ioCollectOrder.setBillTime(DateUtil.parseDate(info.getKEEP_BOOK_TIME())); - ioCollectOrder.setFromCorp(info.getCONSIGNEE()); - ioCollectOrder.setFromCorpName(info.getCONSIGNEE_NAME()); - - ioCollectOrder.setShipper(info.getCONSIGNOR()); - ioCollectOrder.setShipperName(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 bizList = new ArrayList<>(); - value.forEach(entity -> { - IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz(); - BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper().eq(BasicUdirelEntity::getMainId, entity.getPHYSIC_CODE()).last("limit 1")); - 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) { - - - List 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 page) { - List presInfoEntities = page.getRecords(); - List vInsurNationGoodsPhysics = new ArrayList<>(); - if (CollUtil.isNotEmpty(presInfoEntities)) { - List collect = presInfoEntities.stream().map(VYpzsPresInfo::getPRESCRIBE_NUMBER).collect(Collectors.toList()); - LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); - wrapper1.in(VYpzsPresInfo::getPRESCRIBE_NUMBER, collect); - vInsurNationGoodsPhysics = vYpzsPresInfoMapper.selectList(wrapper1); - } - - // TODO: 2024/9/19 这边在转换的时候就不能用VInsurNationGoodsPhysic - if (CollUtil.isNotEmpty(vInsurNationGoodsPhysics)) { - Map> groupedByPrescribeNumber = vInsurNationGoodsPhysics.stream() - .collect(Collectors.groupingBy(VYpzsPresInfo::getPHYSIC_CODE)); - List ioCollectOrders = new ArrayList<>(); - groupedByPrescribeNumber.forEach((key, value) -> { - VYpzsPresInfo presInfoEntity = value.get(0); - StringBuilder errorMsg = new StringBuilder(); - IoCollectOrder ioCollectOrder = new IoCollectOrder(); - ioCollectOrder.setBillNo(presInfoEntity.getSTOOUT_NO()); - ioCollectOrder.setFromType("HIS系统"); - ioCollectOrder.setFromCorp(presInfoEntity.getSICK_ID()); - ioCollectOrder.setWorkPlaceCode(udiwmsBasicSkPrescribeRequest.getWorkPlaceCode()); - ioCollectOrder.setFromCorpName(presInfoEntity.getSICK_NAME()); - Date date = DateUtil.parseDate(presInfoEntity.getLAY_TIME()); - ioCollectOrder.setBillTime(date); - ioCollectOrder.setCreateTime(new Date()); - ioCollectOrder.setCreateUser(udiwmsBasicSkPrescribeRequest.getCreateUser()); - ioCollectOrder.setBackupOrderRemark1(presInfoEntity.getSTOOUT_NO()); - ioCollectOrder.setBackupOrderRemark2(presInfoEntity.getSICK_ID()); -// ioCollectOrder.setBackupOrderRemark3(presInfoEntity.getPSN_NAME()); -// ioCollectOrder.setBackupOrderRemark4(presInfoEntity.getPSN_NO()); - ioCollectOrder.setUpdateTime(new Date()); - ioCollectOrder.setSplitStatus(0); - ioCollectOrder.setTagStatus(0); - List bizList = new ArrayList<>(); - value.forEach(entity -> { - IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz(); - List basicUdirelEntities = basicUdirelDao.selectList(new LambdaQueryWrapper().eq(BasicUdirelEntity::getMainId, entity.getPHYSIC_CODE())); - if (CollUtil.isNotEmpty(basicUdirelEntities)) { - BasicUdirelEntity basicUdirelEntity = basicUdirelEntities.get(0); - collectOrderBiz.setRelId(basicUdirelEntity.getId()); - } else { - errorMsg.append(entity.getPHYSIC_NAME()).append("字典未对照").append(";"); - } - -// List vYpzsPresInfos = vYpzsPresInfoMapper.selectList(new LambdaQueryWrapper().eq(VYpzsPresInfo::getPRESCRIBE_NUMBER, entity.getPRESCRIBE_NUMBER()).eq(VYpzsPresInfo::getPHYSIC_CODE, entity.getPHYSIC_CODE())); - -// if (CollUtil.isNotEmpty(vYpzsPresInfos)) { -// VYpzsPresInfo vYpzsPresInfo = vYpzsPresInfos.get(0); -// -// } - collectOrderBiz.setGgxh(entity.getPACK_SPEC()); - collectOrderBiz.setMeasureUnit(entity.getPHYSIC_UNIT()); - collectOrderBiz.setCount(IntUtil.value(entity.getLAY_PHYSIC_QUANTITY())); - collectOrderBiz.setThrCode(entity.getPHYSIC_CODE()); - collectOrderBiz.setCpmctymc(entity.getPHYSIC_NAME()); - collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo()); - collectOrderBiz.setYbbm(entity.getCOUNTRY_CODE()); -// collectOrderBiz.setRemark1(entity.get() + ""); - - 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 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 page) { - List presInfoEntities = page.getRecords(); - List vInsurNationGoodsReturns = new ArrayList<>(); - if (CollUtil.isNotEmpty(presInfoEntities)) { - List collect = presInfoEntities.stream().map(VYpzsPresInfoReturn::getAPPLY_NO).collect(Collectors.toList()); - LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); - wrapper1.in(VYpzsPresInfoReturn::getAPPLY_NO, collect); - vInsurNationGoodsReturns = vYpzsPresInfoReturnMapper.selectList(wrapper1); - } - // TODO: 2024/9/19 这边在转换的时候就不能用vInsurNationGoodsReturns - if (CollUtil.isNotEmpty(vInsurNationGoodsReturns)) { - Map> groupedByPrescribeNumber = vInsurNationGoodsReturns.stream() - .collect(Collectors.groupingBy(VYpzsPresInfoReturn::getAPPLY_NO)); - List ioCollectOrders = new ArrayList<>(); - groupedByPrescribeNumber.forEach((key, value) -> { - VYpzsPresInfoReturn 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.getSICK_NAME()); -// Date date = DateUtil.parseDate(presInfoEntity.get()); - ioCollectOrder.setBillTime(presInfoEntity.getKEEP_BOOK_TIME()); - ioCollectOrder.setCreateTime(new Date()); - ioCollectOrder.setCreateUser(udiwmsBasicSkPrescribeRequest.getCreateUser()); - ioCollectOrder.setUpdateTime(new Date()); - ioCollectOrder.setSplitStatus(0); - ioCollectOrder.setTagStatus(0); - List bizList = new ArrayList<>(); - value.forEach(entity -> { - IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz(); - BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper().eq(BasicUdirelEntity::getMainId, entity.getPHYSIC_CODE())); - if (basicUdirelEntity != null) { - collectOrderBiz.setRelId(basicUdirelEntity.getId()); - } else { - errorMsg.append(entity.getPHYSIC_NAME()).append("字典未对照").append(";"); - } - List vYpzsPresInfoReturns = vYpzsPresInfoReturnMapper.selectList(new LambdaQueryWrapper().eq(VYpzsPresInfoReturn::getAPPLY_NO, entity.getAPPLY_NO()).eq(VYpzsPresInfoReturn::getPHYSIC_CODE, entity.getPHYSIC_CODE())); - - if (CollUtil.isNotEmpty(vYpzsPresInfoReturns)) { - VYpzsPresInfoReturn vYpzsPresInfo = vYpzsPresInfoReturns.get(0); - collectOrderBiz.setGgxh(vYpzsPresInfo.getPHYSIC_SPEC()); - collectOrderBiz.setMeasureUnit(vYpzsPresInfo.getPHYSIC_UNIT()); - } - collectOrderBiz.setThrCode(entity.getPHYSIC_CODE()); - collectOrderBiz.setCpmctymc(entity.getPHYSIC_NAME()); -// collectOrderBiz.setBatchNo(entity.getBATCH_NUMBER()); - collectOrderBiz.setOrderIdFk(ioCollectOrder.getBillNo()); - collectOrderBiz.setYbbm(entity.getFEE_SEQUENCE_NO()); - collectOrderBiz.setCount(entity.getQUANTITY()); - 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 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 vInsurNationGoodsPhysics = goodsPhysicMapper.selectList(new LambdaQueryWrapper().eq(VInsurNationGoodsPhysic::getSTOOUT_NO, stoout_no)); - if (CollUtil.isNotEmpty(vInsurNationGoodsPhysics)) { - List collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList(); - List 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 drugTraceList = new ArrayList<>(); - // 遍历fruits数组 - for (String code : codes) { - if (StrUtil.isNotBlank(code)) { - List relCodeDetailList = relCodeDetailService.getAllNext(code); - if (relCodeDetailList != null && relCodeDetailList.size() > 0) { - 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 bizList = ioCollectOrder.getBizList(); - if (CollUtil.isNotEmpty(bizList)) { - List collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList(); - List 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 drugTraceList = new ArrayList<>(); - // 遍历fruits数组 - for (String code : codes) { - if (StrUtil.isNotBlank(code)) { - List relCodeDetailList = relCodeDetailService.getAllNext(code); - if (relCodeDetailList != null && relCodeDetailList.size() > 0) { - 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 bizList = ioCollectOrder.getBizList(); - if (CollUtil.isNotEmpty(bizList)) { - List collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList(); - List 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 drugTraceList = new ArrayList<>(); - // 遍历fruits数组 - for (String code : codes) { - if (StrUtil.isNotBlank(code)) { - List relCodeDetailList = relCodeDetailService.getAllNext(code); - if (relCodeDetailList != null && relCodeDetailList.size() > 0) { - 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.setInvinfoDetail(kcbg3502Requests); - String jsonStr = JSONUtil.toJsonStr(baseKcbg3502Request); - JSONObject dataJson = JSONObject.parseObject(jsonStr); - ybClient.ybPost("3502A", dataJson); - } - } - - public void optionUploadCollectOrder3506(IoCollectOrder ioCollectOrder) { -// List bizList = ioCollectOrder.getBizList(); - List collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList(); - List xsth3506Requests = new ArrayList<>(); - List vInsurNationGoodsReturns = vInsurNationGoodsReturnMapper.selectList(new LambdaQueryWrapper().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 drugTraceList = new ArrayList<>(); - // 遍历fruits数组 - for (String code : codes) { - if (StrUtil.isNotBlank(code)) { - List relCodeDetailList = relCodeDetailService.getAllNext(code); - if (relCodeDetailList != null && relCodeDetailList.size() > 0) { - 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); - } - - /** - * 获取交易类型集合 - * - * @return - */ - public BaseResponse getBuyType() { - Map buyTypeMap= new HashMap<>(); - buyTypeMap.put("buyType_3501",buyType_3501); - buyTypeMap.put("buyType_3502",buyType_3502); - buyTypeMap.put("buyType_3505",buyType_3505); - buyTypeMap.put("buyType_3506",buyType_3506); - return ResultVOUtils.success(buyTypeMap); - } -} diff --git a/src/main/java/com/glxp/mipsdl/client/yxfuyy/entity/InvCodeResultEntity.java b/src/main/java/com/glxp/mipsdl/client/yxfuyy/entity/InvCodeResultEntity.java deleted file mode 100644 index 9dcd0b5..0000000 --- a/src/main/java/com/glxp/mipsdl/client/yxfuyy/entity/InvCodeResultEntity.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.glxp.mipsdl.client.yxfuyy.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 高值耗材出入库明细 - */ -@NoArgsConstructor -@Data -public class InvCodeResultEntity { - - - @JsonProperty("recordNo") - private Integer recordNo; - @JsonProperty("visitNo") - private String visitNo; - @JsonProperty("sickName") - private String sickName; - @JsonProperty("inDept") - private String inDept; - @JsonProperty("deptName") - private String deptName; - @JsonProperty("materialCode") - private String materialCode; - @JsonProperty("materialName") - private String materialName; - @JsonProperty("materialPrc") - private Integer materialPrc; - @JsonProperty("dictBarcode") - private String dictBarcode; - @JsonProperty("Barcode") - private String barcode; - @JsonProperty("feeTime") - private String feeTime; - @JsonProperty("feeOper") - private String feeOper; -} - - diff --git a/src/main/java/com/glxp/mipsdl/client/yxfuyy/entity/InvProjectResultEntity.java b/src/main/java/com/glxp/mipsdl/client/yxfuyy/entity/InvProjectResultEntity.java deleted file mode 100644 index 8dea922..0000000 --- a/src/main/java/com/glxp/mipsdl/client/yxfuyy/entity/InvProjectResultEntity.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.glxp.mipsdl.client.yxfuyy.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 收费项目出入库明细 - */ -@NoArgsConstructor -@Data -public class InvProjectResultEntity { - - - @JsonProperty("seqNo") - private String seqNo; - @JsonProperty("visitNo") - private String visitNo; - @JsonProperty("sickName") - private String sickName; - @JsonProperty("applyDept") - private String applyDept; - @JsonProperty("deptName") - private String deptName; - @JsonProperty("itemCode") - private String itemCode; - @JsonProperty("itemName") - private String itemName; - @JsonProperty("Price") - private Double price; - @JsonProperty("quantity") - private Integer quantity; - @JsonProperty("Cost") - private Double cost; - @JsonProperty("materialCode") - private String materialCode; - @JsonProperty("materialName") - private String materialName; - @JsonProperty("OperTime") - private String operTime; -} diff --git a/src/main/java/com/glxp/mipsdl/client/yxfuyy/entity/InvResultEntity.java b/src/main/java/com/glxp/mipsdl/client/yxfuyy/entity/InvResultEntity.java deleted file mode 100644 index 5767740..0000000 --- a/src/main/java/com/glxp/mipsdl/client/yxfuyy/entity/InvResultEntity.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.glxp.mipsdl.client.yxfuyy.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 库存出入库明细 - */ -@NoArgsConstructor -@Data -public class InvResultEntity { - - @JsonProperty("applyNo") - private String applyNo; - @JsonProperty("ioFlag") - private String ioFlag; - @JsonProperty("ioType") - private String ioType; - @JsonProperty("ioTypeName") - private String ioTypeName; - @JsonProperty("Debit") - private String debit; - @JsonProperty("DebitName") - private String debitName; - @JsonProperty("Credit") - private String credit; - @JsonProperty("CreditName") - private String creditName; - @JsonProperty("AccoutDate") - private String accoutDate; - @JsonProperty("Accoutant") - private String accoutant; - @JsonProperty("receiveOper") - private String receiveOper; - @JsonProperty("materialCode") - private String materialCode; - @JsonProperty("materialName") - private String materialName; - @JsonProperty("materialSpec") - private String materialSpec; - @JsonProperty("materialUnit") - private String materialUnit; - @JsonProperty("batchNo") - private String batchNo; - @JsonProperty("invoiceNo") - private String invoiceNo; - @JsonProperty("invoiceDate") - private String invoiceDate; - @JsonProperty("quantity") - private Integer quantity; - @JsonProperty("importPrc") - private Double importPrc; - @JsonProperty("importMoney") - private Integer importMoney; - @JsonProperty("factoryCode") - private String factoryCode; - @JsonProperty("factoryName") - private String factoryName; -} diff --git a/src/main/java/com/glxp/mipsdl/client/ctqyy/entity/InvCodeResultEntity.java b/src/main/java/com/glxp/mipsdl/client/yxfy/entity/InvCodeResultEntity.java similarity index 95% rename from src/main/java/com/glxp/mipsdl/client/ctqyy/entity/InvCodeResultEntity.java rename to src/main/java/com/glxp/mipsdl/client/yxfy/entity/InvCodeResultEntity.java index e58bffb..e8cb29e 100644 --- a/src/main/java/com/glxp/mipsdl/client/ctqyy/entity/InvCodeResultEntity.java +++ b/src/main/java/com/glxp/mipsdl/client/yxfy/entity/InvCodeResultEntity.java @@ -1,4 +1,4 @@ -package com.glxp.mipsdl.client.ctqyy.entity; +package com.glxp.mipsdl.client.yxfy.entity; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; diff --git a/src/main/java/com/glxp/mipsdl/client/ctqyy/entity/InvProjectResultEntity.java b/src/main/java/com/glxp/mipsdl/client/yxfy/entity/InvProjectResultEntity.java similarity index 95% rename from src/main/java/com/glxp/mipsdl/client/ctqyy/entity/InvProjectResultEntity.java rename to src/main/java/com/glxp/mipsdl/client/yxfy/entity/InvProjectResultEntity.java index 775aa9f..5d826d6 100644 --- a/src/main/java/com/glxp/mipsdl/client/ctqyy/entity/InvProjectResultEntity.java +++ b/src/main/java/com/glxp/mipsdl/client/yxfy/entity/InvProjectResultEntity.java @@ -1,4 +1,4 @@ -package com.glxp.mipsdl.client.ctqyy.entity; +package com.glxp.mipsdl.client.yxfy.entity; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; diff --git a/src/main/java/com/glxp/mipsdl/client/ctqyy/entity/InvResultEntity.java b/src/main/java/com/glxp/mipsdl/client/yxfy/entity/InvResultEntity.java similarity index 97% rename from src/main/java/com/glxp/mipsdl/client/ctqyy/entity/InvResultEntity.java rename to src/main/java/com/glxp/mipsdl/client/yxfy/entity/InvResultEntity.java index 9e1f0df..90acd43 100644 --- a/src/main/java/com/glxp/mipsdl/client/ctqyy/entity/InvResultEntity.java +++ b/src/main/java/com/glxp/mipsdl/client/yxfy/entity/InvResultEntity.java @@ -1,4 +1,4 @@ -package com.glxp.mipsdl.client.ctqyy.entity; +package com.glxp.mipsdl.client.yxfy.entity; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; diff --git a/src/main/java/com/glxp/mipsdl/client/ctqyy/CtqyyClient.java b/src/main/java/com/glxp/mipsdl/client/yxfy/yxfyClient.java similarity index 95% rename from src/main/java/com/glxp/mipsdl/client/ctqyy/CtqyyClient.java rename to src/main/java/com/glxp/mipsdl/client/yxfy/yxfyClient.java index 10037d3..b1f2618 100644 --- a/src/main/java/com/glxp/mipsdl/client/ctqyy/CtqyyClient.java +++ b/src/main/java/com/glxp/mipsdl/client/yxfy/yxfyClient.java @@ -1,4 +1,4 @@ -package com.glxp.mipsdl.client.ctqyy; +package com.glxp.mipsdl.client.yxfy; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; @@ -12,15 +12,14 @@ 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.enums.SqlLike; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.StringUtils; 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.ctqyy.entity.InvCodeResultEntity; -import com.glxp.mipsdl.client.ctqyy.entity.InvProjectResultEntity; -import com.glxp.mipsdl.client.ctqyy.entity.InvResultEntity; +import com.glxp.mipsdl.client.yxfy.entity.InvCodeResultEntity; +import com.glxp.mipsdl.client.yxfy.entity.InvProjectResultEntity; +import com.glxp.mipsdl.client.yxfy.entity.InvResultEntity; import com.glxp.mipsdl.config.ThirdSysConfig; import com.glxp.mipsdl.constant.BusTypeConstant; import com.glxp.mipsdl.constant.ConstantType; @@ -36,9 +35,8 @@ 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.*; +import com.glxp.mipsdl.entity.hyfy.*; import com.glxp.mipsdl.entity.inout.*; -import com.glxp.mipsdl.entity.system.UdiEntity; import com.glxp.mipsdl.entity.thrsys.*; import com.glxp.mipsdl.http.HttpClient; import com.glxp.mipsdl.req.base.*; @@ -51,7 +49,6 @@ import com.glxp.mipsdl.req.zzzyy.ZzzyyRequest; import com.glxp.mipsdl.res.BaseResponse; import com.glxp.mipsdl.res.PageSimpleResponse; import com.glxp.mipsdl.res.ctqyy.CtBaseResponse; -import com.glxp.mipsdl.res.ctqyy.ThrOrderResponse; import com.glxp.mipsdl.res.udiwms.*; import com.glxp.mipsdl.service.auth.AuthWarehouseService; import com.glxp.mipsdl.service.basic.RelCodeDetailService; @@ -72,18 +69,20 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @Slf4j @Service(value = "100011HttpClient") -public class CtqyyClient extends CommonHttpClient { +public class yxfyClient extends CommonHttpClient { // 目前只有3505调通过上传医保 其他先不配置怕自动上传出问题 private final String[] buyType_3501 = {}; private final String[] buyType_3502 = { }; + private final String[] buyType_3504 = { }; + private final String[] buyType_3505 = {"QXCF001", "YPCF002"}; + private final String[] buyType_35051 = {"SC72197936495755"}; private final String[] buyType_3506 = {}; @Resource AuthWarehouseUserMapper authWarehouseUserMapper; @@ -187,7 +186,7 @@ public class CtqyyClient extends CommonHttpClient { String message = document.getRootElement().element("message").getText(); return message; } catch (DocumentException e) { - log.info("解析长泰区医院智业接口返回结果异常, 返回结果:{}", response); + log.info("解析云霄妇幼医院智业接口返回结果异常, 返回结果:{}", response); log.error("异常信息:", e); } } @@ -207,7 +206,7 @@ public class CtqyyClient extends CommonHttpClient { BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); return baseResponse; } catch (Exception e) { - log.error("解析长泰区医院智业接口返回往来单位字典数据异常,返回结果:{}", response); + log.error("解析云霄妇幼医院智业接口返回往来单位字典数据异常,返回结果:{}", response); log.error("异常信息:{}", e); return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); } @@ -226,7 +225,7 @@ public class CtqyyClient extends CommonHttpClient { BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); return baseResponse; } catch (Exception e) { - log.error("解析长泰区医院智业接口返回生产企业字典数据异常,返回结果:{}", response); + log.error("解析云霄妇幼医院智业接口返回生产企业字典数据异常,返回结果:{}", response); log.error("异常信息:{}", e); return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); } @@ -269,7 +268,7 @@ public class CtqyyClient extends CommonHttpClient { baseResponse.setData(map); return baseResponse; } catch (Exception e) { - log.error("解析长泰区医院智业接口返回产品信息字典数据异常,返回结果:{}", response); + log.error("解析云霄妇幼医院智业接口返回产品信息字典数据异常,返回结果:{}", response); log.error("异常信息:{}", e); return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); } @@ -332,7 +331,7 @@ public class CtqyyClient extends CommonHttpClient { pageSimpleResponse.setList(listNew); return ResultVOUtils.success(pageSimpleResponse); } - log.error("解析长泰区医院医疗类型,返回结果:{}", udiwmsProductRequest.getProductType()); + log.error("解析云霄妇幼医院医疗类型,返回结果:{}", udiwmsProductRequest.getProductType()); return ResultVOUtils.error(500, "医疗类型不正确,productType:" + udiwmsProductRequest.getProductType()); } @@ -347,7 +346,7 @@ public class CtqyyClient extends CommonHttpClient { BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); return baseResponse; } catch (Exception e) { - log.error("解析长泰区医院智业接口返回单据类型数据异常,返回结果:{}", response); + log.error("解析云霄妇幼医院智业接口返回单据类型数据异常,返回结果:{}", response); log.error("异常信息:{}", e); return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); } @@ -451,7 +450,7 @@ public class CtqyyClient extends CommonHttpClient { baseResponse.setData(map); return baseResponse; } catch (Exception e) { - log.error("解析长泰医院智业返回病人信息数据异常,返回结果:{}", response); + log.error("解析云霄妇幼医院智业返回病人信息数据异常,返回结果:{}", response); log.error("异常信息:{}", e); return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); } @@ -488,7 +487,7 @@ public class CtqyyClient extends CommonHttpClient { baseResponse.setData(map); return baseResponse; } catch (Exception e) { - log.error("解析长泰医院智业返回处方信息数据异常,返回结果:{}", response); + log.error("解析云霄妇幼医院智业返回处方信息数据异常,返回结果:{}", response); log.error("异常信息:{}", e); return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); } @@ -532,7 +531,7 @@ public class CtqyyClient extends CommonHttpClient { baseResponse.setData(map); return baseResponse; } catch (Exception e) { - log.error("解析长泰医院智业返回项目信息数据异常,返回结果:{}", response); + log.error("解析云霄妇幼医院智业返回项目信息数据异常,返回结果:{}", response); log.error("异常信息:{}", e); return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); } @@ -569,7 +568,7 @@ public class CtqyyClient extends CommonHttpClient { baseResponse.setData(map); return baseResponse; } catch (Exception e) { - log.error("解析长泰医院智业返回物价类别信息异常,返回结果:{}", response); + log.error("解析云霄妇幼医院智业返回物价类别信息异常,返回结果:{}", response); log.error("异常信息:{}", e); return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); } @@ -1327,7 +1326,7 @@ public class CtqyyClient extends CommonHttpClient { BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class); return baseResponse; } catch (Exception e) { - log.error("解析长泰区医院智业接口提交单据返回数据异常,返回结果:{}", response); + log.error("解析云霄妇幼医院智业接口提交单据返回数据异常,返回结果:{}", response); log.error("异常信息:{}", e); return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")"); } @@ -1695,6 +1694,8 @@ public class CtqyyClient extends CommonHttpClient { return optionUploadCollectOrder3502(ioCollectOrder); } else if (matchBusType(busType, buyType_3505)) { return optionUploadCollectOrder3505(ioCollectOrder); + } else if (matchBusType(busType, buyType_35051)) { + return optionUploadCollectOrder35051(ioCollectOrder); } else if (matchBusType(busType, buyType_3506)) { optionUploadCollectOrder3506(ioCollectOrder); } else { @@ -2159,7 +2160,112 @@ public class CtqyyClient extends CommonHttpClient { return ResultVOUtils.error(500,"上传医保数据为空请核实"); } + public BaseResponse optionUploadCollectOrder35051(IoCollectOrder ioCollectOrder) { + List bizList = ioCollectOrder.getCollectOrderBizResponseList(); + + if (CollUtil.isNotEmpty(bizList)) { + List xsck35051Requests = new ArrayList<>(); + for (CollectOrderBizResponse item : bizList) { + BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(item.getRelId()); + String itemCode = basicUdirelEntity.getMainId(); +// for (CollectOrderBizResponse item : collectOrderBizResponseList) { +// if (item.getYbbm().equals(itemCode)) { + String[] codes = item.getFinishUdiCode().split(","); + + String nameCode = item.getNameCode(); + BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne( + new QueryWrapper().eq("nameCode", nameCode).last("limit 1") + ); + if (Objects.isNull(basicProductsEntity)) { + return ResultVOUtils.error(500, "产品为空请检查"); + } + Integer packLevel = Integer.valueOf(basicProductsEntity.getPackLevel()); + List drugTraceList = new ArrayList<>(); + List codeList = new ArrayList<>(); + // 遍历fruits数组 + for (String code : codes) { + if (StrUtil.isNotBlank(code)) { + List relCodeDetailList = relCodeDetailService.getAllNext(code); + if (relCodeDetailList != null && relCodeDetailList.size() > 0) { + for (RelCodeDetail relCodeDetail : relCodeDetailList) { + codeList.add(relCodeDetail.getCurCode()); + + } + } + // 级别为2的产品码不可能只有一个 + if (packLevel > 1 && codeList.size() < 2) { + return ResultVOUtils.error(500, "大包装码关联关系拉取不到请检查" + code); + } + } + } + Set set = new HashSet(codeList); + for (String code : set) { + DrugInfoRequest request = new DrugInfoRequest(); + request.setDrug_trac_codg(code); + drugTraceList.add(request); + } + + if (CollUtil.isEmpty(drugTraceList)) { + return ResultVOUtils.error(500, "单据要传的码为空请检查"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String formattedDate = sdf.format(ioCollectOrder.getBillTime()); + //todo 处方药标志先写死 后面要商量怎么获得 + String rxFlag ="1"; + log.error("optionUploadCollectOrder35051===item==="+item); + Xsck35051Request xsck35051Request = Xsck35051Request.builder() + .med_list_codg(item.getYbbm()) + .fixmedins_hilist_id(item.getNameCode()) + .fixmedins_hilist_name(item.getCpmctymc()) + .fixmedins_bchno(item.getOrderIdFk()) + .prsc_dr_cert_type(null) + .prsc_dr_certno(null) + .prsc_dr_name(null) + .phar_cert_type(null) + .phar_certno(null) + .phar_name(null) + .phar_prac_cert_no(null) + .hi_feesetl_type(null) + .setl_id(null) + .mdtrt_sn(null) + .psn_no(null) + .psn_cert_type(null) + .certno(null) + .psn_name(null) + .manu_lotnum(item.getBatchNo()) + .manu_date(DateUtil.timeTransition(item.getProductDate())) + .expy_end(DateUtil.timeTransition(item.getExpireDate())) + .rx_flag(rxFlag) + .trdn_flag(item.getTrdnFlag()) + .finl_trns_pric(null) + .rxno(null) + .rx_circ_flag(null) + .rtal_docno(null) + .stoout_no(null) + .bchno(null) + .drug_prod_barc(null) + .shelf_posi(null) + .sel_retn_cnt(item.getCount()) + .sel_retn_time(formattedDate) + .sel_retn_opter_name(ioCollectOrder.getCreateUser()) + .memo(null) + .mdtrt_setl_type(null) + .drugtracinfo(drugTraceList).build(); + xsck35051Requests.add(xsck35051Request); +// } +// } + } + BaseXsck35051Request baseXsck35051Request = new BaseXsck35051Request(); + baseXsck35051Request.setSelinfoDetail(xsck35051Requests); + String jsonStr = JSONUtil.toJsonStr(baseXsck35051Request); + JSONObject dataJson = JSONObject.parseObject(jsonStr); + return ybClient.ybPost("35051", dataJson); + } else { + return ResultVOUtils.error(500, "上传医保数据为空请核实"); + } + + } public void optionUploadCollectOrder3501(IoCollectOrder ioCollectOrder) { List bizList = ioCollectOrder.getBizList(); @@ -2370,10 +2476,11 @@ public class CtqyyClient extends CommonHttpClient { @Override public BaseResponse getBuyType() { Map buyTypeMap = new HashMap<>(); - buyTypeMap.put("buyType_3501", buyType_3501); buyTypeMap.put("buyType_3502", buyType_3502); + buyTypeMap.put("buyType_3504", buyType_3504); buyTypeMap.put("buyType_3505", buyType_3505); buyTypeMap.put("buyType_3506", buyType_3506); + buyTypeMap.put("buyType_35051", buyType_35051); return ResultVOUtils.success(buyTypeMap); } } diff --git a/src/main/java/com/glxp/mipsdl/controller/YbApiController.java b/src/main/java/com/glxp/mipsdl/controller/YbApiController.java index 5e11c19..8f2ab2d 100644 --- a/src/main/java/com/glxp/mipsdl/controller/YbApiController.java +++ b/src/main/java/com/glxp/mipsdl/controller/YbApiController.java @@ -7,16 +7,12 @@ import cn.hsa.zephyr.apisdk.internal.util.encrypt.SignTypeEnum; import cn.hsa.zephyr.apisdk.request.ZephyrMedicalRequest; import cn.hsa.zephyr.apisdk.response.ChsMedicalResponse; import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.date.DatePattern; -import cn.hutool.core.date.DateUtil; -import cn.hutool.crypto.SecureUtil; import cn.hutool.json.JSONUtil; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.glxp.mipsdl.dao.basic.BasicUdirelDao; import com.glxp.mipsdl.entity.basic.BasicUdirelEntity; -import com.glxp.mipsdl.entity.ctqyy.VInsurNationGoodsPhysic; +import com.glxp.mipsdl.entity.hyfy.VInsurNationGoodsPhysic; import com.glxp.mipsdl.entity.inout.CollectOrderBizResponse; import com.glxp.mipsdl.entity.inout.IoCollectOrder; import com.glxp.mipsdl.req.post.PostCollectOrderRequest; @@ -32,7 +28,6 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.ArrayList; -import java.util.Date; import java.util.List; @Slf4j diff --git a/src/main/java/com/glxp/mipsdl/entity/ctqyy/BasicSkPrescribeItemEntity.java b/src/main/java/com/glxp/mipsdl/entity/hyfy/BasicSkPrescribeItemEntity.java similarity index 98% rename from src/main/java/com/glxp/mipsdl/entity/ctqyy/BasicSkPrescribeItemEntity.java rename to src/main/java/com/glxp/mipsdl/entity/hyfy/BasicSkPrescribeItemEntity.java index 32d3100..46311db 100644 --- a/src/main/java/com/glxp/mipsdl/entity/ctqyy/BasicSkPrescribeItemEntity.java +++ b/src/main/java/com/glxp/mipsdl/entity/hyfy/BasicSkPrescribeItemEntity.java @@ -1,4 +1,4 @@ -package com.glxp.mipsdl.entity.ctqyy; +package com.glxp.mipsdl.entity.hyfy; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; diff --git a/src/main/java/com/glxp/mipsdl/entity/ctqyy/MaterialDictEntity.java b/src/main/java/com/glxp/mipsdl/entity/hyfy/MaterialDictEntity.java similarity index 95% rename from src/main/java/com/glxp/mipsdl/entity/ctqyy/MaterialDictEntity.java rename to src/main/java/com/glxp/mipsdl/entity/hyfy/MaterialDictEntity.java index b983340..fe522fd 100644 --- a/src/main/java/com/glxp/mipsdl/entity/ctqyy/MaterialDictEntity.java +++ b/src/main/java/com/glxp/mipsdl/entity/hyfy/MaterialDictEntity.java @@ -1,9 +1,7 @@ -package com.glxp.mipsdl.entity.ctqyy; +package com.glxp.mipsdl.entity.hyfy; import lombok.Data; -import java.math.BigDecimal; - @Data public class MaterialDictEntity { diff --git a/src/main/java/com/glxp/mipsdl/entity/ctqyy/PriceClassEntity.java b/src/main/java/com/glxp/mipsdl/entity/hyfy/PriceClassEntity.java similarity index 88% rename from src/main/java/com/glxp/mipsdl/entity/ctqyy/PriceClassEntity.java rename to src/main/java/com/glxp/mipsdl/entity/hyfy/PriceClassEntity.java index 91a2546..b448670 100644 --- a/src/main/java/com/glxp/mipsdl/entity/ctqyy/PriceClassEntity.java +++ b/src/main/java/com/glxp/mipsdl/entity/hyfy/PriceClassEntity.java @@ -1,4 +1,4 @@ -package com.glxp.mipsdl.entity.ctqyy; +package com.glxp.mipsdl.entity.hyfy; import lombok.Data; diff --git a/src/main/java/com/glxp/mipsdl/entity/ctqyy/ThrHslbEntity.java b/src/main/java/com/glxp/mipsdl/entity/hyfy/ThrHslbEntity.java similarity index 67% rename from src/main/java/com/glxp/mipsdl/entity/ctqyy/ThrHslbEntity.java rename to src/main/java/com/glxp/mipsdl/entity/hyfy/ThrHslbEntity.java index a770a1b..a456412 100644 --- a/src/main/java/com/glxp/mipsdl/entity/ctqyy/ThrHslbEntity.java +++ b/src/main/java/com/glxp/mipsdl/entity/hyfy/ThrHslbEntity.java @@ -1,9 +1,5 @@ -package com.glxp.mipsdl.entity.ctqyy; +package com.glxp.mipsdl.entity.hyfy; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VInsurNationGoodsCl.java b/src/main/java/com/glxp/mipsdl/entity/hyfy/VInsurNationGoodsCl.java similarity index 98% rename from src/main/java/com/glxp/mipsdl/entity/ctqyy/VInsurNationGoodsCl.java rename to src/main/java/com/glxp/mipsdl/entity/hyfy/VInsurNationGoodsCl.java index 3d7b00a..9738aa8 100644 --- a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VInsurNationGoodsCl.java +++ b/src/main/java/com/glxp/mipsdl/entity/hyfy/VInsurNationGoodsCl.java @@ -1,4 +1,4 @@ -package com.glxp.mipsdl.entity.ctqyy; +package com.glxp.mipsdl.entity.hyfy; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; @@ -6,7 +6,6 @@ import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; -import java.util.Date; @Data @TableName(value = "v_insur_nation_goods_cl") @@ -147,4 +146,4 @@ public class VInsurNationGoodsCl implements Serializable { private String MATERIAL_CODE; -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VInsurNationGoodsPhysic.java b/src/main/java/com/glxp/mipsdl/entity/hyfy/VInsurNationGoodsPhysic.java similarity index 95% rename from src/main/java/com/glxp/mipsdl/entity/ctqyy/VInsurNationGoodsPhysic.java rename to src/main/java/com/glxp/mipsdl/entity/hyfy/VInsurNationGoodsPhysic.java index 977c857..a736942 100644 --- a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VInsurNationGoodsPhysic.java +++ b/src/main/java/com/glxp/mipsdl/entity/hyfy/VInsurNationGoodsPhysic.java @@ -1,12 +1,10 @@ -package com.glxp.mipsdl.entity.ctqyy; +package com.glxp.mipsdl.entity.hyfy; -import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; import java.math.BigDecimal; -import java.util.Date; + import lombok.Data; @Data @@ -133,4 +131,4 @@ public class VInsurNationGoodsPhysic implements Serializable { private String SICK_ID; private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VInsurNationGoodsReturn.java b/src/main/java/com/glxp/mipsdl/entity/hyfy/VInsurNationGoodsReturn.java similarity index 93% rename from src/main/java/com/glxp/mipsdl/entity/ctqyy/VInsurNationGoodsReturn.java rename to src/main/java/com/glxp/mipsdl/entity/hyfy/VInsurNationGoodsReturn.java index d891874..0fa093f 100644 --- a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VInsurNationGoodsReturn.java +++ b/src/main/java/com/glxp/mipsdl/entity/hyfy/VInsurNationGoodsReturn.java @@ -1,8 +1,6 @@ -package com.glxp.mipsdl.entity.ctqyy; +package com.glxp.mipsdl.entity.hyfy; -import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.math.BigDecimal; diff --git a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsIoInfo.java b/src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsIoInfo.java similarity index 94% rename from src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsIoInfo.java rename to src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsIoInfo.java index fe574b3..10099da 100644 --- a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsIoInfo.java +++ b/src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsIoInfo.java @@ -1,8 +1,6 @@ -package com.glxp.mipsdl.entity.ctqyy; +package com.glxp.mipsdl.entity.hyfy; -import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; @@ -92,4 +90,4 @@ public class VYpzsIoInfo implements Serializable { private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsPhysicDict.java b/src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsPhysicDict.java similarity index 96% rename from src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsPhysicDict.java rename to src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsPhysicDict.java index 6becbe7..4601b29 100644 --- a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsPhysicDict.java +++ b/src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsPhysicDict.java @@ -1,4 +1,4 @@ -package com.glxp.mipsdl.entity.ctqyy; +package com.glxp.mipsdl.entity.hyfy; import com.baomidou.mybatisplus.annotation.TableField; diff --git a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsPlanInfo.java b/src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsPlanInfo.java similarity index 97% rename from src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsPlanInfo.java rename to src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsPlanInfo.java index f5dc693..3b0b66e 100644 --- a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsPlanInfo.java +++ b/src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsPlanInfo.java @@ -1,4 +1,4 @@ -package com.glxp.mipsdl.entity.ctqyy; +package com.glxp.mipsdl.entity.hyfy; import com.baomidou.mybatisplus.annotation.TableField; diff --git a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsPresInfo.java b/src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsPresInfo.java similarity index 89% rename from src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsPresInfo.java rename to src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsPresInfo.java index 75f3391..84d779c 100644 --- a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsPresInfo.java +++ b/src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsPresInfo.java @@ -1,13 +1,9 @@ -package com.glxp.mipsdl.entity.ctqyy; +package com.glxp.mipsdl.entity.hyfy; -import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; import lombok.Data; diff --git a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsPresInfoReturn.java b/src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsPresInfoReturn.java similarity index 97% rename from src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsPresInfoReturn.java rename to src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsPresInfoReturn.java index 79d5cb1..9130445 100644 --- a/src/main/java/com/glxp/mipsdl/entity/ctqyy/VYpzsPresInfoReturn.java +++ b/src/main/java/com/glxp/mipsdl/entity/hyfy/VYpzsPresInfoReturn.java @@ -1,4 +1,4 @@ -package com.glxp.mipsdl.entity.ctqyy; +package com.glxp.mipsdl.entity.hyfy; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/src/main/java/com/glxp/mipsdl/entity/inout/CollectOrderBizResponse.java b/src/main/java/com/glxp/mipsdl/entity/inout/CollectOrderBizResponse.java index 718e01a..a3e5d5f 100644 --- a/src/main/java/com/glxp/mipsdl/entity/inout/CollectOrderBizResponse.java +++ b/src/main/java/com/glxp/mipsdl/entity/inout/CollectOrderBizResponse.java @@ -8,6 +8,7 @@ import java.util.Date; public class CollectOrderBizResponse { + private Long id; /** * 单据号外键 @@ -127,4 +128,6 @@ public class CollectOrderBizResponse { private Integer autoResCount; private String replaceCode; + + private String trdnFlag; } diff --git a/src/main/java/com/glxp/mipsdl/req/yb/BaseXsck35051Request.java b/src/main/java/com/glxp/mipsdl/req/yb/BaseXsck35051Request.java new file mode 100644 index 0000000..76035e6 --- /dev/null +++ b/src/main/java/com/glxp/mipsdl/req/yb/BaseXsck35051Request.java @@ -0,0 +1,10 @@ +package com.glxp.mipsdl.req.yb; + +import lombok.Data; + +import java.util.List; + +@Data +public class BaseXsck35051Request { + private List selinfoDetail; +} diff --git a/src/main/java/com/glxp/mipsdl/req/yb/Xsck35051Request.java b/src/main/java/com/glxp/mipsdl/req/yb/Xsck35051Request.java new file mode 100644 index 0000000..80dea1a --- /dev/null +++ b/src/main/java/com/glxp/mipsdl/req/yb/Xsck35051Request.java @@ -0,0 +1,213 @@ +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.List; + +/** + * 药品销售 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class Xsck35051Request { + + + /** + * 医疗目录编码 + */ + private String med_list_codg; + + /** + * 定点医药机构目录编号 + */ + private String fixmedins_hilist_id; + + /** + * 定点医药机构目录名称 + */ + private String fixmedins_hilist_name; + + /** + * 定点医药机构批次流水号 + */ + private String fixmedins_bchno; + + /** + * 开方医师证件类型 + */ + private String prsc_dr_cert_type; + + /** + * 开方医师证件号码 + */ + private String prsc_dr_certno; + + /** + * 开方医师姓名 + */ + private String prsc_dr_name; + + /** + * 药师证件类型 + */ + private String phar_cert_type; + + /** + * 药师证件号码 + */ + private String phar_certno; + + /** + * 药师姓名 + */ + private String phar_name; + + /** + * 药师执业资格证号 + */ + private String phar_prac_cert_no; + + /** + * 医保费用结算类型 + */ + private String hi_feesetl_type; + + /** + * 结算ID + */ + private String setl_id; + + /** + * 就医流水号 + */ + private String mdtrt_sn; + + /** + * 人员编号 + */ + private String psn_no; + + /** + * 人员证件类型 + */ + private String psn_cert_type; + + /** + * 证件号码 + */ + private String certno; + + /** + * 人员姓名 + */ + private String psn_name; + + /** + * 生产批号 + */ + private String manu_lotnum; + + /** + * 生产日期 + */ + private String manu_date; + + /** + * 有效期止 + */ + private String expy_end; + + /** + * 处方药标志 + */ + private String rx_flag; + + /** + * 拆零标志 + */ + private String trdn_flag; + + /** + * 最终成交单价 + */ + private BigDecimal finl_trns_pric; + + /** + * 处方号 + */ + private String rxno; + + /** + * 外购处方标志 + */ + private String rx_circ_flag; + + /** + * 零售单据号 + */ + private String rtal_docno; + + /** + * 销售出库单据号 + */ + private String stoout_no; + + /** + * 批次号 + */ + private String bchno; + /** + * 药品追溯码 + */ + private String drug_trac_codg; + + /** + * 药品条形码 + */ + private String drug_prod_barc; + + /** + * 货架位 + */ + private String shelf_posi; + + /** + * 销售/退货数量 + */ + private Integer sel_retn_cnt; + + /** + * 销售/退货时间 + */ + private String sel_retn_time; + + /** + * 销售/退货经办人姓名 + */ + private String sel_retn_opter_name; + + /** + * 备注 + */ + private String memo; + + /** + * 就诊结算类型 + */ + private String mdtrt_setl_type; + + /** + * 溯源码节点信息 + */ + private List drugtracinfo; + + + + +} diff --git a/src/main/java/com/glxp/mipsdl/res/udiwms/BasicSkPrescribeResponse.java b/src/main/java/com/glxp/mipsdl/res/udiwms/BasicSkPrescribeResponse.java index 2245d18..8fdab0a 100644 --- a/src/main/java/com/glxp/mipsdl/res/udiwms/BasicSkPrescribeResponse.java +++ b/src/main/java/com/glxp/mipsdl/res/udiwms/BasicSkPrescribeResponse.java @@ -1,6 +1,6 @@ package com.glxp.mipsdl.res.udiwms; -import com.glxp.mipsdl.entity.ctqyy.BasicSkPrescribeItemEntity; +import com.glxp.mipsdl.entity.hyfy.BasicSkPrescribeItemEntity; import lombok.Data; import java.math.BigDecimal; diff --git a/src/main/java/com/glxp/mipsdl/service/ctqyy/VInsurNationGoodsPhysicService.java b/src/main/java/com/glxp/mipsdl/service/ctqyy/VInsurNationGoodsPhysicService.java index f55576a..f24280b 100644 --- a/src/main/java/com/glxp/mipsdl/service/ctqyy/VInsurNationGoodsPhysicService.java +++ b/src/main/java/com/glxp/mipsdl/service/ctqyy/VInsurNationGoodsPhysicService.java @@ -3,7 +3,7 @@ package com.glxp.mipsdl.service.ctqyy; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.glxp.mipsdl.thirddao.ctqyy.VInsurNationGoodsPhysicMapper; -import com.glxp.mipsdl.entity.ctqyy.VInsurNationGoodsPhysic; +import com.glxp.mipsdl.entity.hyfy.VInsurNationGoodsPhysic; @Service public class VInsurNationGoodsPhysicService extends ServiceImpl { diff --git a/src/main/java/com/glxp/mipsdl/service/ctqyy/VYpzsIoInfoService.java b/src/main/java/com/glxp/mipsdl/service/ctqyy/VYpzsIoInfoService.java index c44e543..73edf7d 100644 --- a/src/main/java/com/glxp/mipsdl/service/ctqyy/VYpzsIoInfoService.java +++ b/src/main/java/com/glxp/mipsdl/service/ctqyy/VYpzsIoInfoService.java @@ -3,7 +3,7 @@ package com.glxp.mipsdl.service.ctqyy; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.glxp.mipsdl.thirddao.ctqyy.VYpzsIoInfoMapper; -import com.glxp.mipsdl.entity.ctqyy.VYpzsIoInfo; +import com.glxp.mipsdl.entity.hyfy.VYpzsIoInfo; @Service public class VYpzsIoInfoService extends ServiceImpl { diff --git a/src/main/java/com/glxp/mipsdl/service/ctqyy/VYpzsPresInfoService.java b/src/main/java/com/glxp/mipsdl/service/ctqyy/VYpzsPresInfoService.java index 6e62268..ec5cde4 100644 --- a/src/main/java/com/glxp/mipsdl/service/ctqyy/VYpzsPresInfoService.java +++ b/src/main/java/com/glxp/mipsdl/service/ctqyy/VYpzsPresInfoService.java @@ -3,7 +3,7 @@ package com.glxp.mipsdl.service.ctqyy; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.glxp.mipsdl.thirddao.ctqyy.VYpzsPresInfoMapper; -import com.glxp.mipsdl.entity.ctqyy.VYpzsPresInfo; +import com.glxp.mipsdl.entity.hyfy.VYpzsPresInfo; @Service public class VYpzsPresInfoService extends ServiceImpl { diff --git a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VInsurNationGoodsClMapper.java b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VInsurNationGoodsClMapper.java index fbd8c6c..b8ce55f 100644 --- a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VInsurNationGoodsClMapper.java +++ b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VInsurNationGoodsClMapper.java @@ -4,7 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.glxp.mipsdl.entity.ctqyy.VInsurNationGoodsCl; +import com.glxp.mipsdl.entity.hyfy.VInsurNationGoodsCl; import com.glxp.mipsdl.req.base.UdiwmsBasicSkPrescribeRequest; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -13,4 +13,4 @@ import org.apache.ibatis.annotations.Param; @DS("ctqyySql") public interface VInsurNationGoodsClMapper extends BaseMapper { IPage selectGroupedWithPagination(Page page, @Param("udiwmsBasicSkPrescribeRequest") UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest); -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VInsurNationGoodsPhysicMapper.java b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VInsurNationGoodsPhysicMapper.java index 7c6d1ee..1374b69 100644 --- a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VInsurNationGoodsPhysicMapper.java +++ b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VInsurNationGoodsPhysicMapper.java @@ -4,7 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.glxp.mipsdl.entity.ctqyy.VInsurNationGoodsPhysic; +import com.glxp.mipsdl.entity.hyfy.VInsurNationGoodsPhysic; import com.glxp.mipsdl.req.base.UdiwmsBasicSkPrescribeRequest; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -13,4 +13,4 @@ import org.apache.ibatis.annotations.Param; @DS("ctqyySql") public interface VInsurNationGoodsPhysicMapper extends BaseMapper { IPage selectGroupedWithPagination(Page vInsurNationGoodsPhysicPage, @Param("udiwmsBasicSkPrescribeRequest")UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest); -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VInsurNationGoodsReturnMapper.java b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VInsurNationGoodsReturnMapper.java index 1a89d54..fd1a5d4 100644 --- a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VInsurNationGoodsReturnMapper.java +++ b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VInsurNationGoodsReturnMapper.java @@ -4,7 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.glxp.mipsdl.entity.ctqyy.VInsurNationGoodsReturn; +import com.glxp.mipsdl.entity.hyfy.VInsurNationGoodsReturn; import com.glxp.mipsdl.req.base.UdiwmsBasicSkPrescribeRequest; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -13,4 +13,4 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface VInsurNationGoodsReturnMapper extends BaseMapper { IPage selectGroupedWithPagination(Page vInsurNationGoodsReturnPage,@Param("udiwmsBasicSkPrescribeRequest") UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest); -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsIoInfoMapper.java b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsIoInfoMapper.java index a72d349..7492db9 100644 --- a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsIoInfoMapper.java +++ b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsIoInfoMapper.java @@ -4,7 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.glxp.mipsdl.entity.ctqyy.VYpzsIoInfo; +import com.glxp.mipsdl.entity.hyfy.VYpzsIoInfo; import com.glxp.mipsdl.req.base.UdiwmsThrOrderRequest; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -16,4 +16,4 @@ public interface VYpzsIoInfoMapper extends BaseMapper { Page selectGroupedWithPagination(IPage page, @Param("udiwmsThrOrderRequest") UdiwmsThrOrderRequest udiwmsThrOrderRequest); -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPhysicDictMapper.java b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPhysicDictMapper.java index 2f53296..8ba4067 100644 --- a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPhysicDictMapper.java +++ b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPhysicDictMapper.java @@ -2,7 +2,7 @@ package com.glxp.mipsdl.thirddao.ctqyy; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.glxp.mipsdl.entity.ctqyy.VYpzsPhysicDict; +import com.glxp.mipsdl.entity.hyfy.VYpzsPhysicDict; import org.apache.ibatis.annotations.Mapper; diff --git a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPlanInfoMapper.java b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPlanInfoMapper.java index 235ab7d..2980d7c 100644 --- a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPlanInfoMapper.java +++ b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPlanInfoMapper.java @@ -4,8 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.glxp.mipsdl.entity.ctqyy.VYpzsIoInfo; -import com.glxp.mipsdl.entity.ctqyy.VYpzsPlanInfo; +import com.glxp.mipsdl.entity.hyfy.VYpzsPlanInfo; import com.glxp.mipsdl.req.base.UdiwmsThrOrderRequest; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPresInfoMapper.java b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPresInfoMapper.java index 3a4c7d0..d357024 100644 --- a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPresInfoMapper.java +++ b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPresInfoMapper.java @@ -4,8 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.glxp.mipsdl.entity.ctqyy.VInsurNationGoodsPhysic; -import com.glxp.mipsdl.entity.ctqyy.VYpzsPresInfo; +import com.glxp.mipsdl.entity.hyfy.VYpzsPresInfo; import com.glxp.mipsdl.req.base.UdiwmsBasicSkPrescribeRequest; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -16,4 +15,4 @@ public interface VYpzsPresInfoMapper extends BaseMapper { IPage selectGroupedWithPagination(Page vYpzsPresInfoPage,@Param("udiwmsBasicSkPrescribeRequest") UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest); -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPresInfoReturnMapper.java b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPresInfoReturnMapper.java index d0a55e7..39a4259 100644 --- a/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPresInfoReturnMapper.java +++ b/src/main/java/com/glxp/mipsdl/thirddao/ctqyy/VYpzsPresInfoReturnMapper.java @@ -4,8 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.glxp.mipsdl.entity.ctqyy.VInsurNationGoodsReturn; -import com.glxp.mipsdl.entity.ctqyy.VYpzsPresInfoReturn; +import com.glxp.mipsdl.entity.hyfy.VYpzsPresInfoReturn; import com.glxp.mipsdl.req.base.UdiwmsBasicSkPrescribeRequest; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -15,4 +14,4 @@ import org.apache.ibatis.annotations.Param; public interface VYpzsPresInfoReturnMapper extends BaseMapper { IPage selectGroupedWithPagination(Page vYpzsPresInfoReturnPage, @Param("udiwmsBasicSkPrescribeRequest")UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest); -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/mipsdl/util/DateUtil.java b/src/main/java/com/glxp/mipsdl/util/DateUtil.java index a46c820..8b17a21 100644 --- a/src/main/java/com/glxp/mipsdl/util/DateUtil.java +++ b/src/main/java/com/glxp/mipsdl/util/DateUtil.java @@ -9,6 +9,8 @@ import lombok.extern.slf4j.Slf4j; import java.lang.management.ManagementFactory; import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.*; @Slf4j @@ -482,4 +484,18 @@ public class DateUtil { String formattedDate = sdf.format(date); return formattedDate; } + public static String timeTransition(String input) { + if(StrUtil.isEmpty(input)){ + return null; + } + // 定义输入日期的格式 + DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern("yyMMdd"); + // 定义输出日期的格式 + DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + // 将输入字符串解析为 LocalDate 对象 + LocalDate date = LocalDate.parse(input, inputFormatter); + // 将 LocalDate 对象格式化为目标字符串 + String output = date.format(outputFormatter); + return output; + } } diff --git a/src/main/resources/mybatis/mapper/other/ctqyy/VInsurNationGoodsClMapper.xml b/src/main/resources/mybatis/mapper/other/ctqyy/VInsurNationGoodsClMapper.xml index ad53ca7..6370291 100644 --- a/src/main/resources/mybatis/mapper/other/ctqyy/VInsurNationGoodsClMapper.xml +++ b/src/main/resources/mybatis/mapper/other/ctqyy/VInsurNationGoodsClMapper.xml @@ -1,7 +1,7 @@ - SELECT STOOUT_NO FROM v_insur_nation_goods_cl @@ -57,4 +57,4 @@ ORDER BY STOOUT_NO - \ No newline at end of file + diff --git a/src/main/resources/mybatis/mapper/other/ctqyy/VInsurNationGoodsPhysicMapper.xml b/src/main/resources/mybatis/mapper/other/ctqyy/VInsurNationGoodsPhysicMapper.xml index 8c27cc7..098b0a4 100644 --- a/src/main/resources/mybatis/mapper/other/ctqyy/VInsurNationGoodsPhysicMapper.xml +++ b/src/main/resources/mybatis/mapper/other/ctqyy/VInsurNationGoodsPhysicMapper.xml @@ -1,7 +1,7 @@ - + @@ -56,7 +56,7 @@ - SELECT PHYSIC_CODE FROM v_insur_nation_goods_physic @@ -92,4 +92,4 @@ ORDER BY PHYSIC_CODE - \ No newline at end of file + diff --git a/src/main/resources/mybatis/mapper/other/ctqyy/VInsurNationGoodsReturnMapper.xml b/src/main/resources/mybatis/mapper/other/ctqyy/VInsurNationGoodsReturnMapper.xml index c972ee3..a162bfa 100644 --- a/src/main/resources/mybatis/mapper/other/ctqyy/VInsurNationGoodsReturnMapper.xml +++ b/src/main/resources/mybatis/mapper/other/ctqyy/VInsurNationGoodsReturnMapper.xml @@ -1,7 +1,7 @@ - + @@ -37,7 +37,7 @@ - SELECT APPLY_NO FROM V_INSUR_NATION_GOODS_RETURN @@ -72,4 +72,4 @@ ORDER BY APPLY_NO - \ No newline at end of file + diff --git a/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsIoInfoMapper.xml b/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsIoInfoMapper.xml index 7253d77..3fea412 100644 --- a/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsIoInfoMapper.xml +++ b/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsIoInfoMapper.xml @@ -1,7 +1,7 @@ - + @@ -32,7 +32,7 @@ BATCH_NUMBER, QUANTITY, PACK_UNIT1, IMPORT_PRICE, IMPORT_MONEY, RETAIL_PRICE, RETAIL_MONEY - SELECT RECEIPT_NUMBER FROM v_ypzs_io_info @@ -130,4 +130,4 @@ GROUP BY RECEIPT_NUMBER ORDER BY RECEIPT_NUMBER - \ No newline at end of file + diff --git a/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsPlanInfoMapper.xml b/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsPlanInfoMapper.xml index 364b45e..2be5beb 100644 --- a/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsPlanInfoMapper.xml +++ b/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsPlanInfoMapper.xml @@ -1,7 +1,7 @@ - SELECT CGDBH FROM V_YPZS_PLAN_INFO diff --git a/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsPresInfoMapper.xml b/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsPresInfoMapper.xml index 8701401..6f9c64c 100644 --- a/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsPresInfoMapper.xml +++ b/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsPresInfoMapper.xml @@ -1,7 +1,7 @@ - + @@ -44,7 +44,7 @@ - SELECT PRESCRIBE_NUMBER FROM v_ypzs_pres_info diff --git a/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsPresInfoReturnMapper.xml b/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsPresInfoReturnMapper.xml index 52e82a3..d815611 100644 --- a/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsPresInfoReturnMapper.xml +++ b/src/main/resources/mybatis/mapper/other/ctqyy/VYpzsPresInfoReturnMapper.xml @@ -1,7 +1,7 @@ - + @@ -23,13 +23,13 @@ - APPLY_NO, SICK_ID, STORAGE_CODE, DEPT_NAME, KEEP_BOOK_TIME, KEEP_BOOK_OPERATOR, SETTLE_NO, - PHYSIC_CODE, PHYSIC_NAME, PHYSIC_SPEC, QUANTITY, PHYSIC_UNIT, PRICE, COST, BATCH_NUMBER, + APPLY_NO, SICK_ID, STORAGE_CODE, DEPT_NAME, KEEP_BOOK_TIME, KEEP_BOOK_OPERATOR, SETTLE_NO, + PHYSIC_CODE, PHYSIC_NAME, PHYSIC_SPEC, QUANTITY, PHYSIC_UNIT, PRICE, COST, BATCH_NUMBER, FEE_SEQUENCE_NO - SELECT APPLY_NO FROM v_ypzs_pres_info_return @@ -97,4 +97,4 @@ ORDER BY APPLY_NO - \ No newline at end of file +