长泰接口修改

dev
anthonywj 1 year ago
parent 59fc390ed3
commit bde1c7ac54

@ -2,6 +2,7 @@ package com.glxp.mipsdl.client;
import com.glxp.mipsdl.req.base.*;
import com.glxp.mipsdl.req.ctqyy.DlThirdProjectRequest;
import com.glxp.mipsdl.req.ctqyy.FilterThrHslbRequest;
import com.glxp.mipsdl.req.ctqyy.GetSickPrescribeRequest;
import com.glxp.mipsdl.req.ctqyy.GetSickRequest;
import com.glxp.mipsdl.req.post.*;
@ -177,4 +178,11 @@ public interface BaseHttpClient {
*
*/
BaseResponse getBasicProject(DlThirdProjectRequest dlThirdProjectRequest);
/**
*
*/
BaseResponse getHsfl(FilterThrHslbRequest hslbRequest);
}

@ -26,6 +26,7 @@ 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.DlThirdProjectRequest;
import com.glxp.mipsdl.req.ctqyy.FilterThrHslbRequest;
import com.glxp.mipsdl.req.ctqyy.GetSickPrescribeRequest;
import com.glxp.mipsdl.req.ctqyy.GetSickRequest;
import com.glxp.mipsdl.req.post.*;
@ -252,4 +253,9 @@ public abstract class CommonHttpClient implements BaseHttpClient {
public BaseResponse getBasicProject(DlThirdProjectRequest dlThirdProjectRequest) {
return null;
}
@Override
public BaseResponse getHsfl(FilterThrHslbRequest hslbRequest) {
return null;
}
}

@ -1,35 +1,23 @@
package com.glxp.mipsdl.client.ctqyy;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.glxp.mipsdl.client.BaseHttpClient;
import com.glxp.mipsdl.client.CommonHttpClient;
import com.glxp.mipsdl.config.ThirdSysConfig;
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.auth.AuthWarehouseUserMapper;
import com.glxp.mipsdl.dao.basic.BasicBussinessTypeDao;
import com.glxp.mipsdl.dao.basic.BasicCorpDao;
import com.glxp.mipsdl.dao.inout.*;
import com.glxp.mipsdl.dao.thrsys.ThrInvWarehouseDao;
import com.glxp.mipsdl.dao.thrsys.ThrSystemBusApiDao;
import com.glxp.mipsdl.entity.ctqyy.MaterialDictEntity;
import com.glxp.mipsdl.entity.ctqyy.PriceClassEntity;
import com.glxp.mipsdl.entity.ctqyy.ThrHslbEntity;
import com.glxp.mipsdl.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.zzzyy.ZzzyyRequest;
import com.glxp.mipsdl.res.BaseResponse;
import com.glxp.mipsdl.res.udiwms.*;
import com.glxp.mipsdl.service.auth.AuthWarehouseService;
import com.glxp.mipsdl.service.thrsys.ThrCorpService;
import com.glxp.mipsdl.service.thrsys.ThrSystemDetailService;
import com.glxp.mipsdl.util.ResultVOUtils;
import com.glxp.mipsdl.util.SubmitOrderUtil;
import lombok.extern.slf4j.Slf4j;
import org.dom4j.Document;
import org.dom4j.DocumentException;
@ -37,6 +25,7 @@ import org.dom4j.DocumentHelper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -48,40 +37,6 @@ public class CtqyyClient extends CommonHttpClient {
private ThrSystemDetailService thrSystemDetailService;
@Resource
private HttpClient httpClient;
@Resource
private IoOrderDao orderDao;
@Resource
private ThrSystemBusApiDao thrSystemBusApiDao;
@Resource
private AuthUserDao authUserDao;
@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 IoOrderUploadLogDao orderUploadLogDao;
@Resource
private SubmitOrderUtil submitOrderUtil;
@Resource
AuthWarehouseUserMapper authWarehouseUserMapper;
/**
* xml
@ -187,7 +142,6 @@ public class CtqyyClient extends CommonHttpClient {
*
* @return
*/
@Override
public BaseResponse postRelProduct(PostRelProductRequest postThrInvProductsRequest) {
List<UdiRelevanceResponse> udiRelevanceResponses = postThrInvProductsRequest.getDatas();
@ -195,15 +149,50 @@ public class CtqyyClient extends CommonHttpClient {
if (CollUtil.isEmpty(udiRelevanceResponses)) {
return ResultVOUtils.error(500, "提交产品列表不能为空!");
}
List<MaterialDictEntity> materialDictEntities = new ArrayList<>();
for (UdiRelevanceResponse udiRelevanceResponse : udiRelevanceResponses) {
CtqPostRelProductRequest ctqPostRelProductRequest = new CtqPostRelProductRequest();
BeanUtil.copyProperties(udiRelevanceResponse, ctqPostRelProductRequest);
ctqPostRelProductRequest.setDiCode(udiRelevanceResponse.getNameCode());
ctqPostRelProductRequest.setPriceCategory(udiRelevanceResponse.getBasicPrductRemak8());
MaterialDictEntity materialDictEntity = new MaterialDictEntity();
materialDictEntity.setOperatType(1);
materialDictEntity.setMaterialName(udiRelevanceResponse.getCpmctymc());
materialDictEntity.setCostlySign(1);
materialDictEntity.setHisMaterialCode(udiRelevanceResponse.getNameCode());
materialDictEntity.setHisMaterialCode(udiRelevanceResponse.getMainId());
materialDictEntity.setMaterialSpec(udiRelevanceResponse.getGgxh());
materialDictEntity.setMaterialUnit(udiRelevanceResponse.getMeasname());
//暂无区分进货价,零售价
materialDictEntity.setImportPrice(udiRelevanceResponse.getPrice());
materialDictEntity.setRetailPrice(udiRelevanceResponse.getPrice());
materialDictEntity.setFactoryName(udiRelevanceResponse.getManufactory());
materialDictEntity.setSupplierName(udiRelevanceResponse.getSupName());
materialDictEntity.setInsuranceCode(udiRelevanceResponse.getYbbm());
materialDictEntity.setRegeditNo(udiRelevanceResponse.getZczbhhzbapzbh());
//暂无中标标识
materialDictEntity.setPublicFlag(null);
materialDictEntity.setPriceItemClass(udiRelevanceResponse.getBasicPrductRemak8());
//暂无收费标志
materialDictEntity.setFeeFlag(null);
materialDictEntities.add(materialDictEntity);
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());
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
if (baseResponse.getCode() != 20000) {
log.error("提交新增产品信息,异常:{}", response);
} else {
log.error("提交新增产品信息,成功:{}", response);
}
} catch (Exception e) {
log.error("提交新增产品信息,返回结果:{}", response);
log.error("异常信息:{}", e);
// return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
}
}
//todo 调用提交接口
return null;
return ResultVOUtils.success("新增成功!");
}
@ -300,6 +289,43 @@ public class CtqyyClient extends CommonHttpClient {
}
/**
*
*
* @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<PriceClassEntity> priceClassEntities = JSON.parseArray(map.get("list") + "", PriceClassEntity.class);
List<ThrHslbEntity> 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;

@ -151,7 +151,11 @@ public class PhxyyClient extends CommonHttpClient {
//查询单据和详情信息,组装第三方系统接口参数
IoOrderEntity orderEntity = orderDao.selectOne(new LambdaQueryWrapper<IoOrderEntity>().eq(IoOrderEntity::getBillNo, udiwmsOrderRequest.getBillNo()).last("limit 1"));
phOrderRequest.setBillDate(DateUtil.formatDateTime(orderEntity.getCreateTime()));
if (orderEntity.getAuditTime() == null)
phOrderRequest.setBillDate(DateUtil.formatDateTime(orderEntity.getCreateTime()));
else {
phOrderRequest.setBillDate(DateUtil.formatDateTime(orderEntity.getAuditTime()));
}
//查询对应的第三方单据类型
ThrSystemBusApiEntity thrSystemBusApiEntity = thrSystemBusApiDao.selectOne(new LambdaQueryWrapper<ThrSystemBusApiEntity>().eq(ThrSystemBusApiEntity::getCode, udiwmsOrderRequest.getBillType()));
if (StrUtil.isBlank(thrSystemBusApiEntity.getUrl())) {

@ -75,6 +75,12 @@ public interface Constants {
*/
String URI_GET_PROJECT = "basicProjectUrl";
/**
*
*/
String URI_GET_HSLB = "getHslbUrl";
//上传数据到UDI管理系统URL名称合集
/**

@ -4,6 +4,7 @@ import com.glxp.mipsdl.client.ClientProcessor;
import com.glxp.mipsdl.client.pzh.PzhzdClient;
import com.glxp.mipsdl.req.base.*;
import com.glxp.mipsdl.req.ctqyy.DlThirdProjectRequest;
import com.glxp.mipsdl.req.ctqyy.FilterThrHslbRequest;
import com.glxp.mipsdl.req.ctqyy.GetSickPrescribeRequest;
import com.glxp.mipsdl.req.ctqyy.GetSickRequest;
import com.glxp.mipsdl.req.post.PostRelProductRequest;
@ -161,6 +162,17 @@ public class UdiWmsController {
}
/**
*
*
* @return
*/
@PostMapping("/udiwms/erp/basic/getHslb")
public BaseResponse getHslb(@RequestBody FilterThrHslbRequest filterThrHslbRequest) {
return ClientProcessor.getHttpClient().getHsfl(filterThrHslbRequest);
}
@PostMapping("/udiwms/erp/testThirdSys")
public BaseResponse testThirdSys() {
return ClientProcessor.getHttpClient().testConnect();

@ -0,0 +1,89 @@
package com.glxp.mipsdl.entity.ctqyy;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class MaterialDictEntity {
/**
*
* 1
* 2
* 9
*/
private Integer operatType;
/**
*
*/
private String materialName;
/**
*
* 10
*/
private Integer costlySign;
/**
*
*
*/
private String materialMasterCode;
/**
* HIS
*
*/
private String hisMaterialCode;
/**
*
*/
private String materialSpec;
/**
*
*/
private String materialUnit;
/**
*
*/
private BigDecimal importPrice;
/**
*
*/
private BigDecimal retailPrice;
/**
*
*/
private String factoryCode;
/**
*
*/
private String factoryName;
/**
*
*/
private String supplierCode;
/**
*
*/
private String supplierName;
/**
*
*/
private String insuranceCode;
/**
*
*/
private String regeditNo;
/**
*
*/
private Integer publicFlag;
/**
*
*/
private String priceItemClass;
/**
*
*/
private Integer feeFlag;
}

@ -0,0 +1,22 @@
package com.glxp.mipsdl.entity.ctqyy;
import lombok.Data;
@Data
public class PriceClassEntity {
/**
*
*/
private String classCode;
/**
*
*/
private String className;
/**
*
* 10
*/
private String remark;
}

@ -0,0 +1,35 @@
package com.glxp.mipsdl.entity.ctqyy;
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;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ThrHslbEntity implements Serializable {
private Integer id;
private String hslb;
private String hsmc;
private String hsbm;
private String remark;
private Date updateTime;
private Date createTime;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,12 @@
package com.glxp.mipsdl.req.ctqyy;
import com.glxp.mipsdl.req.base.ListPageRequest;
import lombok.Data;
@Data
public class FilterThrHslbRequest extends ListPageRequest {
private String key;
private String code;
}
Loading…
Cancel
Save