From ade8a99b8ea024cf6e7501e1c6a5b9ed4142514c Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Mon, 24 Oct 2022 14:09:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=87=E4=BB=94=E7=99=80U8=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mipsdl/admin/client/http/PhxyyClient.java | 49 +++++- .../mipsdl/admin/client/http/TestClient.java | 2 +- .../admin/client/http/YyUCloud31Client.java | 25 ++- .../admin/controller/UdiWmsController.java | 12 +- .../admin/req/phxyy/PhOrderRequest.java | 8 +- .../admin/res/system/UdiwmsOrderResponse.java | 143 +++++++++++++++++- .../thread/yyu8v31/InvDlErpStockService.java | 4 +- .../main/resources/application-pro.properties | 8 +- .../resources/application-test1.properties | 2 +- 9 files changed, 222 insertions(+), 31 deletions(-) diff --git a/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/PhxyyClient.java b/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/PhxyyClient.java index fab7b53..4f74534 100644 --- a/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/PhxyyClient.java +++ b/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/PhxyyClient.java @@ -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 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); diff --git a/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/TestClient.java b/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/TestClient.java index 1cb3959..4411172 100644 --- a/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/TestClient.java +++ b/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/TestClient.java @@ -189,7 +189,7 @@ public class TestClient { subErpOrders.add(subErpOrder); } - udiwmsOrderResponse.setDetailList(subErpOrders); + udiwmsOrderResponse.setSubErpOrders(subErpOrders); return ResultVOUtils.success(udiwmsOrderResponse); } diff --git a/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/YyUCloud31Client.java b/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/YyUCloud31Client.java index 03d499a..7620692 100644 --- a/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/YyUCloud31Client.java +++ b/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/YyUCloud31Client.java @@ -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 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); } diff --git a/api-sync/src/main/java/com/glxp/mipsdl/admin/controller/UdiWmsController.java b/api-sync/src/main/java/com/glxp/mipsdl/admin/controller/UdiWmsController.java index f5901f9..64a2b67 100644 --- a/api-sync/src/main/java/com/glxp/mipsdl/admin/controller/UdiWmsController.java +++ b/api-sync/src/main/java/com/glxp/mipsdl/admin/controller/UdiWmsController.java @@ -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, "暂不支持联通性测试!"); } diff --git a/api-sync/src/main/java/com/glxp/mipsdl/admin/req/phxyy/PhOrderRequest.java b/api-sync/src/main/java/com/glxp/mipsdl/admin/req/phxyy/PhOrderRequest.java index a5907aa..bd09be7 100644 --- a/api-sync/src/main/java/com/glxp/mipsdl/admin/req/phxyy/PhOrderRequest.java +++ b/api-sync/src/main/java/com/glxp/mipsdl/admin/req/phxyy/PhOrderRequest.java @@ -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 item; //单据详情数组 } diff --git a/api-sync/src/main/java/com/glxp/mipsdl/admin/res/system/UdiwmsOrderResponse.java b/api-sync/src/main/java/com/glxp/mipsdl/admin/res/system/UdiwmsOrderResponse.java index a11e9ab..732d54a 100644 --- a/api-sync/src/main/java/com/glxp/mipsdl/admin/res/system/UdiwmsOrderResponse.java +++ b/api-sync/src/main/java/com/glxp/mipsdl/admin/res/system/UdiwmsOrderResponse.java @@ -17,7 +17,7 @@ public class UdiwmsOrderResponse { private String signFlag; @JsonIgnore private String originType; - private List detailList; + private List 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 getSubErpOrders() { + return subErpOrders; + } + + public void setSubErpOrders(List 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 getDetailList() { - return detailList; - } - - public void setDetailList(List 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; } diff --git a/api-sync/src/main/java/com/glxp/mipsdl/admin/thread/yyu8v31/InvDlErpStockService.java b/api-sync/src/main/java/com/glxp/mipsdl/admin/thread/yyu8v31/InvDlErpStockService.java index 01c6506..728d01c 100644 --- a/api-sync/src/main/java/com/glxp/mipsdl/admin/thread/yyu8v31/InvDlErpStockService.java +++ b/api-sync/src/main/java/com/glxp/mipsdl/admin/thread/yyu8v31/InvDlErpStockService.java @@ -58,7 +58,7 @@ public class InvDlErpStockService { page++; for (UdiwmsOrderResponse erpOrderEntity : erpOrderEntities) { //ERP数据更新 - List subErpOrders = erpOrderEntity.getDetailList(); + List 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); } diff --git a/api-sync/src/main/resources/application-pro.properties b/api-sync/src/main/resources/application-pro.properties index d94021d..9987719 100644 --- a/api-sync/src/main/resources/application-pro.properties +++ b/api-sync/src/main/resources/application-pro.properties @@ -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 diff --git a/api-sync/src/main/resources/application-test1.properties b/api-sync/src/main/resources/application-test1.properties index 510397b..7dd0d82 100644 --- a/api-sync/src/main/resources/application-test1.properties +++ b/api-sync/src/main/resources/application-test1.properties @@ -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