片仔癀U8系统接口对接bug修改

master
anthonyywj2 2 years ago
parent 0efc6b24c2
commit ade8a99b8e

@ -11,6 +11,7 @@ import com.glxp.mipsdl.admin.dao.basic.*;
import com.glxp.mipsdl.admin.dao.business.StockOrderDao;
import com.glxp.mipsdl.admin.dao.business.StockOrderDetailDao;
import com.glxp.mipsdl.admin.dao.business.StockOrderUploadLogDao;
import com.glxp.mipsdl.admin.dao.inout.CodesDao;
import com.glxp.mipsdl.admin.dao.inout.OrderDao;
import com.glxp.mipsdl.admin.dao.inventory.InvWarehouseDao;
import com.glxp.mipsdl.admin.dao.phxyy.BasicThirdSysDetailDao;
@ -92,6 +93,10 @@ public class PhxyyClient {
private BussinessOriginTypeService bussinessOriginTypeService;
@Resource
SubmitOrderUtils submitOrderUtils;
@Resource
CodesDao codesDao;
@Resource
UnitMaintainDao unitMaintainDao;
public HttpHeaders getHeaders() {
HttpHeaders headers = new HttpHeaders();
@ -230,9 +235,14 @@ public class PhxyyClient {
InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectOneByCode(orderEntity.getInvStorageCode());
try {
ThrInvWarehouseEntity thrInvWarehouseEntity = thrInvWarehouseDao.selectByCode(invWarehouseEntity.getThirdId(), thirdId);
udiwmsOrderRequest.setLocStorageCode(thrInvWarehouseEntity.getCode());
udiwmsOrderRequest.setLocStorageName(thrInvWarehouseEntity.getName());
if (StrUtil.isNotEmpty(invWarehouseEntity.getThirdId())) {
ThrInvWarehouseEntity thrInvWarehouseEntity = thrInvWarehouseDao.selectByCode(invWarehouseEntity.getThirdId(), thirdId);
udiwmsOrderRequest.setLocStorageCode(thrInvWarehouseEntity.getCode());
udiwmsOrderRequest.setLocStorageName(thrInvWarehouseEntity.getName());
} else {
return ResultVOUtils.error(500, "未绑定第三方仓库!");
}
} catch (Exception e) {
log.error("查询第三方系统仓库异常", e);
}
@ -254,6 +264,34 @@ public class PhxyyClient {
} else if (ConstantType.TYPE_OUT.equals(mainAction)) {
udiwmsOrderRequest.setInoutType(2); //出入库类型:出库
}
// //出库单转入库单
// if (StrUtil.nullToEmpty(thirdSysBusApiEntity.getUrl()).equals("useOut")) {
// //使用部门
// udiwmsOrderRequest.setUseDeptCode(udiwmsOrderRequest.getLocStorageCode());
// udiwmsOrderRequest.setUseDeptName(udiwmsOrderRequest.getLocStorageName());
//
//
// ThrInvWarehouseEntity deviceInv = thrInvWarehouseDao.selectByCode("29", thirdId);
// udiwmsOrderRequest.setLocStorageCode("29");
// udiwmsOrderRequest.setLocStorageName(deviceInv.getName());
//
//
// udiwmsOrderRequest.setInoutType(1); //出入库类型:入库
//
// List<WarehouseEntity> warehouseEntities = codesDao.findByReceiptId(stockOrderEntity.getOrderIdFk());
// if (CollUtil.isNotEmpty(warehouseEntities)) {
// UnitMaintainEntity unitMaintainEntity = unitMaintainDao.selectThirdInfoByErpId(warehouseEntities.get(0).getSupId());
// udiwmsOrderRequest.setCorpId(unitMaintainEntity.getThirdId());
// udiwmsOrderRequest.setCorpName(unitMaintainEntity.getThirdName());
// }
//// udiwmsOrderRequest.setCorpId(udiwmsOrderRequest.getLocStorageCode());
//// udiwmsOrderRequest.setCorpName(udiwmsOrderRequest.getLocStorageName());
//
//
// }
udiwmsOrderRequest.setRemark("udi管理系统提交单据"); //备注
//组装明细数据
@ -263,10 +301,10 @@ public class PhxyyClient {
UdiwmsOrderDetail item = new UdiwmsOrderDetail();
BeanUtil.copyProperties(stockOrderDetailEntity, item);
if (StrUtil.isNotEmpty(stockOrderDetailEntity.getProductDate())) {
item.setProductDate(com.glxp.mipsdl.admin.util.DateUtil.formatExpireTime("20" + stockOrderDetailEntity.getProductDate()));
// item.setProductDate(com.glxp.mipsdl.admin.util.DateUtil.formatExpireTime("20" + stockOrderDetailEntity.getProductDate()));
}
if (StrUtil.isNotEmpty(stockOrderDetailEntity.getExpireDate())) {
item.setExpireDate(com.glxp.mipsdl.admin.util.DateUtil.formatExpireTime("20" + stockOrderDetailEntity.getExpireDate()));
// item.setExpireDate(com.glxp.mipsdl.admin.util.DateUtil.formatExpireTime("20" + stockOrderDetailEntity.getExpireDate()));
}
item.setMeasname(udiRelevanceEntity.getMeasname());
item.setStandard(stockOrderDetailEntity.getSpec());
@ -309,6 +347,7 @@ public class PhxyyClient {
uploadLog.setThrBillNo(null);
uploadLog.setResult("提交成功");
stockOrderUploadLogDao.insert(uploadLog);
orderDao.updateOrder(orderEntity);
return ResultVOUtils.success("提交成功");
}
uploadLog.setStatus(3);

@ -189,7 +189,7 @@ public class TestClient {
subErpOrders.add(subErpOrder);
}
udiwmsOrderResponse.setDetailList(subErpOrders);
udiwmsOrderResponse.setSubErpOrders(subErpOrders);
return ResultVOUtils.success(udiwmsOrderResponse);
}

@ -1,5 +1,6 @@
package com.glxp.mipsdl.admin.client.http;
import cn.hutool.core.util.StrUtil;
import com.glxp.mipsdl.admin.client.BaseHttpClient;
import com.glxp.mipsdl.admin.entity.yyu8v31.YyUcloudV31SetEntity;
import com.glxp.mipsdl.admin.entity.yyu8v31.ErpOrderEntity;
@ -106,6 +107,7 @@ public class YyUCloud31Client implements BaseHttpClient {
invmandocResponse.setName(queryResponse.getParentvo().getInvbasVo().getInvname());
invmandocResponse.setMeasname(queryResponse.getParentvo().getInvbasVo().getMeasname());
invmandocResponse.setSpec(queryResponse.getParentvo().getInvbasVo().getInvspec());
invmandocResponse.setStandard(invmandocResponse.getSpec());
invmandocResponse.setRegisterNo(queryResponse.getParentvo().getInvbasVo().getInvtype());
invmandocResponse.setManufactory(queryResponse.getParentvo().getInvmanVo().getProdarea());
custmandocResponses.add(invmandocResponse);
@ -129,6 +131,15 @@ public class YyUCloud31Client implements BaseHttpClient {
if (udiwmsOrderRequest.getAction() == null && udiwmsOrderRequest.getBillAction() == null) {
return ResultVOUtils.error(500, "单据类型不能为空!");
}
if (StrUtil.isEmpty(udiwmsOrderRequest.getStartDate())) {
return ResultVOUtils.error(500, "起始时间不能为空");
}
if (StrUtil.isEmpty(udiwmsOrderRequest.getEndDate())) {
return ResultVOUtils.error(500, "结束时间不能为空");
}
if ("WareHouseIn".equals(udiwmsOrderRequest.getAction()) || udiwmsOrderRequest.getBillAction().equals("采购入库")
|| udiwmsOrderRequest.getBillAction().equals("退货出库")) {
UPurchaseinRequest uPurchaseinRequest = new UPurchaseinRequest();
@ -137,11 +148,11 @@ public class YyUCloud31Client implements BaseHttpClient {
uPurchaseinRequest.setPage_now(udiwmsOrderRequest.getPage() + "");
uPurchaseinRequest.setPage_size(udiwmsOrderRequest.getLimit() + "");
// 3是已签字 2是未签字
if ("0".equals(udiwmsOrderRequest.getBillFlag())) {
uPurchaseinRequest.setFbillflag("2");
} else if (("1").equals(udiwmsOrderRequest.getBillFlag())) {
uPurchaseinRequest.setFbillflag("3");
}
// if ("0".equals(udiwmsOrderRequest.getBillFlag())) {
// uPurchaseinRequest.setFbillflag("2");
// } else if (("1").equals(udiwmsOrderRequest.getBillFlag())) {
// uPurchaseinRequest.setFbillflag("3");
// }
uPurchaseinRequest.setBillcode(udiwmsOrderRequest.getBillNo());
List<UdiwmsOrderResponse> udiwmsOrderResponses = getPurchasein(uPurchaseinRequest);
if (udiwmsOrderResponses != null && udiwmsOrderResponses.size() > 0) {
@ -414,7 +425,7 @@ public class YyUCloud31Client implements BaseHttpClient {
subErpOrder.setExpireDate(childrenvoBean.getDvalidate());
subPurchases.add(subErpOrder);
}
udiwmsOrderResponse.setDetailList(subPurchases);
udiwmsOrderResponse.setSubErpOrders(subPurchases);
}
purchaseinResponses.add(udiwmsOrderResponse);
}
@ -462,7 +473,7 @@ public class YyUCloud31Client implements BaseHttpClient {
subPurchase.setBatchNo(childrenvoBean.getVbatchcode());
subPurchases.add(subPurchase);
}
purchaseinResponse.setDetailList(subPurchases);
purchaseinResponse.setSubErpOrders(subPurchases);
}
purchaseinResponses.add(purchaseinResponse);
}

@ -113,7 +113,7 @@ public class UdiWmsController {
@PostMapping("/udiwms/erp/getOrders")
public BaseResponse getOrders(@RequestBody UdiwmsOrderRequest udiwmsOrderRequest) {
if (curFlag.equals("YONGYOU_U8_V3.1")) {
return pzhzdClient.getOrders(udiwmsOrderRequest);
} else if (curFlag.equals("TEST")) {
return testClient.getOrders(udiwmsOrderRequest);
} else if (curFlag.equals("YONGYOU_U8_V3.1")) {
@ -289,6 +289,16 @@ public class UdiWmsController {
return phxyyClient.testConnect();
} else if (curFlag.equals("ZAXZYY")) {
return zaxyyClient.testConnect();
}
if (curFlag.equals("YONGYOU_U8_V3.1")) {
UdiwmsUnitRequest udiwmsUnitRequest = new UdiwmsUnitRequest();
udiwmsUnitRequest.setPage(1);
udiwmsUnitRequest.setLimit(2);
BaseResponse baseResponse = pzhzdClient.getUnit(udiwmsUnitRequest);
if (baseResponse.getCode() == 20000) {
return ResultVOUtils.success("连接成功!");
} else
return baseResponse;
} else return ResultVOUtils.error(500, "暂不支持联通性测试!");
}

@ -17,8 +17,12 @@ public class PhOrderRequest {
private String remark; //备注
private String corpId; //第三方单据往来单位ID
private String corpName; //往来单位
private String locStorageCode;
private String locStorageName;
private String locStorageCode; //当前仓库
private String locStorageName; //当前仓库名称
private String useDeptCode;
private String useDeptName;
private List<UdiwmsOrderDetail> item; //单据详情数组
}

@ -17,7 +17,7 @@ public class UdiwmsOrderResponse {
private String signFlag;
@JsonIgnore
private String originType;
private List<SubErpOrder> detailList;
private List<SubErpOrder> subErpOrders;
private String startDate; //起始时间
private String endDate; //结束时间
@ -29,6 +29,102 @@ public class UdiwmsOrderResponse {
private String linkTel; //电话
private String remark; //| 备注
private Integer id;
private String locStorageCode;
private String invWarehouseCode;//当前分库
private String fromSubInvCode; //往来分库
private String thirdSysFk;
//增加字段
private String remark1; //备注1
private String remark2; //备注2
private String remark3; //备注3
private String billTypeName;
public List<SubErpOrder> getSubErpOrders() {
return subErpOrders;
}
public void setSubErpOrders(List<SubErpOrder> subErpOrders) {
this.subErpOrders = subErpOrders;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getLocStorageCode() {
return locStorageCode;
}
public void setLocStorageCode(String locStorageCode) {
this.locStorageCode = locStorageCode;
}
public String getInvWarehouseCode() {
return invWarehouseCode;
}
public void setInvWarehouseCode(String invWarehouseCode) {
this.invWarehouseCode = invWarehouseCode;
}
public String getFromSubInvCode() {
return fromSubInvCode;
}
public void setFromSubInvCode(String fromSubInvCode) {
this.fromSubInvCode = fromSubInvCode;
}
public String getThirdSysFk() {
return thirdSysFk;
}
public void setThirdSysFk(String thirdSysFk) {
this.thirdSysFk = thirdSysFk;
}
public String getRemark1() {
return remark1;
}
public void setRemark1(String remark1) {
this.remark1 = remark1;
}
public String getRemark2() {
return remark2;
}
public void setRemark2(String remark2) {
this.remark2 = remark2;
}
public String getRemark3() {
return remark3;
}
public void setRemark3(String remark3) {
this.remark3 = remark3;
}
public String getBillTypeName() {
return billTypeName;
}
public void setBillTypeName(String billTypeName) {
this.billTypeName = billTypeName;
}
public String getSignFlag() {
return signFlag;
}
@ -153,13 +249,6 @@ public class UdiwmsOrderResponse {
this.signFlag = signFlag;
}
public List<SubErpOrder> getDetailList() {
return detailList;
}
public void setDetailList(List<SubErpOrder> detailList) {
this.detailList = detailList;
}
public String getOriginType() {
return originType;
@ -188,6 +277,44 @@ public class UdiwmsOrderResponse {
private String remark3; //备注3/规格
private String orderIdFk;
private String thirdSysFk;
private String sweepCount;
private String relId; //基础信息关联表主键
public String getOrderIdFk() {
return orderIdFk;
}
public void setOrderIdFk(String orderIdFk) {
this.orderIdFk = orderIdFk;
}
public String getThirdSysFk() {
return thirdSysFk;
}
public void setThirdSysFk(String thirdSysFk) {
this.thirdSysFk = thirdSysFk;
}
public String getSweepCount() {
return sweepCount;
}
public void setSweepCount(String sweepCount) {
this.sweepCount = sweepCount;
}
public String getRelId() {
return relId;
}
public void setRelId(String relId) {
this.relId = relId;
}
public String getDetailId() {
return detailId;
}

@ -58,7 +58,7 @@ public class InvDlErpStockService {
page++;
for (UdiwmsOrderResponse erpOrderEntity : erpOrderEntities) {
//ERP数据更新
List<UdiwmsOrderResponse.SubErpOrder> subErpOrders = erpOrderEntity.getDetailList();
List<UdiwmsOrderResponse.SubErpOrder> subErpOrders = erpOrderEntity.getSubErpOrders();
if (subErpOrders != null && subErpOrders.size() > 0) {
for (UdiwmsOrderResponse.SubErpOrder subErpOrder : subErpOrders) {
ErpStockEntity erpStockEntity = new ErpStockEntity();
@ -162,7 +162,7 @@ public class InvDlErpStockService {
subErpOrder.setExpireDate(childrenvoBean.getDvalidate());
subPurchases.add(subErpOrder);
}
udiwmsOrderResponse.setDetailList(subPurchases);
udiwmsOrderResponse.setSubErpOrders(subPurchases);
}
purchaseinResponses.add(udiwmsOrderResponse);
}

@ -2,8 +2,8 @@
server.port=9997
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.jdbc-url=jdbc:mysql://192.168.235.137:33306/udiwms_erp?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://192.168.0.109:3306/udiwms_ph1?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
#spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/udiwms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
#spring.datasource.jdbc-url=jdbc:mysql://192.168.0.109:3306/udiwms_ph1?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/udiwms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=123456
#spring.datasource.password=89083fb2fc145533
@ -29,11 +29,11 @@ API_KEY=1102
API_SECRET=4dc07484afd34e8083ba96e8fe564224
#文件导入
#0.NULL(空未配置1.GLXP(自定义规范标准2.ZHIYE_V1(智业V1,诏安医院),3.YG_UDPLAT_V1(阳光采购平台),4.PHXYY(平和县医院)
FILE_VERSION_FLAG=ZHIYE_V1
FILE_VERSION_FLAG=TEST
#接口实时获取
#0.NULL(空,未配置),1.YONGYOU_U8_V3.1(用友3.1版本,片仔癀诊断) 2.YG_UDPLAT_V1.0(阳光采购平台) 3.TEST(标准接口,测试用),4.PHXYY(平和县医院)
#5.ZAXZYY(诏安县医院)
ONLINE_VESRION_FLAG=PHXYY
ONLINE_VESRION_FLAG=TEST
THIRD_ID=thirdId
ok.http.connect-timeout=3000
ok.http.read-timeout=3000

@ -32,7 +32,7 @@ FILE_VERSION_FLAG=ZHIYE_V1
#接口实时获取
#0.NULL(空,未配置),1.YONGYOU_U8_V3.1(用友3.1版本,片仔癀诊断) 2.YG_UDPLAT_V1.0(阳光采购平台) 3.TEST(标准接口,测试用),4.PHXYY(平和县医院)
#5.ZAXZYY(诏安县医院)
ONLINE_VESRION_FLAG=ZAXZYY
ONLINE_VESRION_FLAG=YONGYOU_U8_V3.1
THIRD_ID=thirdId
ok.http.connect-timeout=3000
ok.http.read-timeout=3000

Loading…
Cancel
Save