|
|
@@ -1,6 +1,8 @@
|
|
|
package com.uas.eis.entity.vwms.req;
|
|
|
|
|
|
-import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
|
|
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
|
|
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
|
|
import com.uas.eis.utils.StringUtil;
|
|
|
import lombok.Data;
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
|
@@ -9,255 +11,89 @@ import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Data
|
|
|
-@JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
+@JacksonXmlRootElement(localName = "request")
|
|
|
+@JsonIgnoreProperties(ignoreUnknown = true) // 忽略未知字段
|
|
|
public class OUTConfirm {
|
|
|
+ @JacksonXmlProperty(localName = "deliveryOrder")
|
|
|
private DeliveryOrder deliveryOrder;
|
|
|
- private Packages packages;
|
|
|
+ @JacksonXmlProperty(localName = "orderLines")
|
|
|
private OrderLines orderLines;
|
|
|
- private OrderDetails orderDetails;
|
|
|
|
|
|
@Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
+ @JsonIgnoreProperties(ignoreUnknown = true) // 忽略未知字段
|
|
|
public static class DeliveryOrder {
|
|
|
/** 出库单号 长度:50 */
|
|
|
private String deliveryOrderCode;
|
|
|
/** 仓储系统出库单号 长度:50 条件必填 */
|
|
|
private String deliveryOrderId;
|
|
|
- /** 仓库代码 长度:50 */
|
|
|
- private String warehouseCode;
|
|
|
+ private String warehouseCode; // 出库仓库编码(物理仓)
|
|
|
+ private String inWarehouseCode; // 调入仓库编码(物理仓) 条件必填,调拨出库业务类型该字段必填
|
|
|
/** 货主代码 长度:50 */
|
|
|
private String ownerCode;
|
|
|
- /** 出库单类型 长度:50 例如: XSDD=销售订单, DBCK=调拨出库、CGTH=采购退货, QTCK=其他出库 */
|
|
|
+ private String ownerName;
|
|
|
+
|
|
|
+ private String inOwnerCode; // 目标货主编码 转库目标账套编码
|
|
|
+ /** 客户编码 长度:50 */
|
|
|
+ private String transceiverCode;
|
|
|
+ private String transceiverName;
|
|
|
+
|
|
|
+ /** 出库单类型 长度:50 例如: YPCK=样品出库、DHCK=大货出库、CGTH=退货出库、DBCK=调拨出库、QTCK=其他出库、LYCK=领用出库、JSCK=寄售出库 */
|
|
|
private String orderType;
|
|
|
- /** 出库单状态 长度:50 NEW-未开始处理, ACCEPT=仓库接单, PARTDELIVERED=部分发货完成, DELIVERED=发货完成, CANCELED=取消, CLOSED=关闭, CANCELEDFAIL=取消失败(只传英文编码) */
|
|
|
+ /** 出库单状态 长度:50 NEW-未开始处理, ACCEPT-仓库接单, PARTDELIVERED-部分发货完成, DELIVERED-发货完成, EXCEPTION-异常, CANCELED-取消, CLOSED-关闭, REJECT-拒单, CANCELEDFAIL-取消失败,只传英文编码*/
|
|
|
private String status;
|
|
|
- /** 外部业务编码 长度:50 消息ID, 用于去重, 因为网络等原因导致重复传输, 请求不会被重复处理 */
|
|
|
- private String outBizCode;
|
|
|
/** 支持出库单多次发货 多次发货确认时 0=发货单最终状态确认: 1=发货单中间状态确认 */
|
|
|
- private String confirmType;
|
|
|
- /** 物流公司编码 长度:50 SF=顺丰、EMS=标准快递、EYB=经济快件、ZJS=宅急送、YTO=圆通、ZTO=中通、HTKY=百世汇通、UC=优速、STO=申通、TTKDEX=天天快递、QFKD=全峰、FAST=快捷、POSTB=邮政小包、GTO=国通、YUNDA=韵达、JD=京东配送、DD=当当宅配、AMAZON=亚马逊物流、OTHER=其他(只传英文编码) */
|
|
|
+ private Integer confirmType;
|
|
|
+
|
|
|
+ /** 物流公司编码 长度:50 SF=顺丰、EMS=标准快递、EYB=经济快件、ZJS=宅急送、YTO=圆通 、ZTO=中通 (ZTO) 、HTKY=百世汇通、BSKY=百世快运、UC=优速、STO=申通、TTKDEX=天天快递 、QFKD=全峰、FAST=快捷、POSTB=邮政小包 、GTO=国通、YUNDA=韵达、JD=京东配送、DD=当当宅配、AMAZON=亚马逊物流、DBWL=德邦物流、DBKD=德邦快递、DBKY=德邦快运、RRS=日日顺、OTHER=其他 ,(只传英文编码) 如果没有购买OMS系统请不要传OTHER,可以传其他自定义的 */
|
|
|
private String logisticsCode;
|
|
|
+ /*物流公司名称(包括干线物流公司等)*/
|
|
|
+ private String logisticsName;
|
|
|
/** 运单号 长度:50 */
|
|
|
private String expressCode;
|
|
|
- /** 制单人 长度:50 */
|
|
|
- private String documentMaker;
|
|
|
- /** 发货人 长度:50 */
|
|
|
- private String shipper;
|
|
|
- /** 收货人 长度:50 */
|
|
|
- private String receiverName;
|
|
|
- /** 订单发运时间 长度:19 YYYY-MM-DD HH:MM:SS */
|
|
|
- private String deliveryTime;
|
|
|
- /** 用户自定义1 长度:50 */
|
|
|
- private String userDefined1;
|
|
|
- /** 用户自定义2 长度:50 */
|
|
|
- private String userDefined2;
|
|
|
- /** 用户自定义3 长度:50 */
|
|
|
- private String userDefined3;
|
|
|
- /** 用户自定义4 长度:50 */
|
|
|
- private String userDefined4;
|
|
|
- /** 客户 长度:50 */
|
|
|
- private String customer;
|
|
|
- /** 序列号 长度:50 */
|
|
|
- private String serialNos;
|
|
|
- /** 序列号数量 长度:50 */
|
|
|
- private String serialNoQty;
|
|
|
- /** 订单来源平台代码 长度:50 */
|
|
|
- private String sourcePlatformCode;
|
|
|
- /** 备注 长度:100 */
|
|
|
- private String remark;
|
|
|
- /** 文件信息 */
|
|
|
- private Files files;
|
|
|
- }
|
|
|
-
|
|
|
- @Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
- public static class Files {
|
|
|
- private List<File> file;
|
|
|
-
|
|
|
- @Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
- public static class File {
|
|
|
- /** 文件url,仅出库单关闭状态时回传,文件url有效时间24小时内*/
|
|
|
- private String url;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
- public static class Packages {
|
|
|
- @JsonProperty("package")
|
|
|
-// private List<Pkg> pkg;
|
|
|
- private Pkg pkg;
|
|
|
-
|
|
|
- @Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
- public static class Pkg {
|
|
|
- /** 物流公司编码 长度:50 SF=顺丰、EMS=标准快递、EYB=经济快件、ZJS=宅急送、YTO=圆通、ZTO=中通、HTKY=百世汇通、UC=优速、STO=申通、TTKDEX=天天快递、QFKD=全峰、FAST=快捷、POSTB=邮政小包、GTO=国通、YUNDA=韵达、JD=京东配送、DD=当当宅配、AMAZON=亚马逊物流、OTHER=其他(只传英文编码) */
|
|
|
- private String logisticsCode;
|
|
|
- /** 运单号 长度:50 */
|
|
|
- private String expressCode;
|
|
|
- /** 箱号 长度:50 */
|
|
|
- private String packageCode;
|
|
|
- /** 商品信息 */
|
|
|
- private Items items;
|
|
|
- /** 耗材信息 */
|
|
|
- private ConsumableDetails consumableDetails;
|
|
|
- /** 箱重量 类型:double(18,3) */
|
|
|
- private Double weight;
|
|
|
- /** 箱体积 类型:double(18,3) */
|
|
|
- private Double volume;
|
|
|
- /** 耗材体积 类型:double(18,3) */
|
|
|
- private Double consumableVolume;
|
|
|
- /** 耗材代码 长度:50 */
|
|
|
- private String consumableCode;
|
|
|
- /** 货品体积 double (18,3)*/
|
|
|
- private String productVolume;
|
|
|
- /** 货品重量 */
|
|
|
- private String productWeight;
|
|
|
- /** 箱自定义1 */
|
|
|
- private String userDefined1;
|
|
|
- /** 箱自定义2 */
|
|
|
- private String userDefined2;
|
|
|
- /** 箱自定义3 */
|
|
|
- private String userDefined3;
|
|
|
- /** 箱自定义4 */
|
|
|
- private String userDefined4;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
- public static class Items {
|
|
|
- private List<Item> item;
|
|
|
-
|
|
|
- @Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
- public static class Item {
|
|
|
- /** 货品代码 */
|
|
|
- private String itemCode;
|
|
|
- /** 箱内该货品的数量 */
|
|
|
- private String quantity;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
- public static class ConsumableDetails {
|
|
|
- private List<ConsumableDetail> consumableDetail;
|
|
|
-
|
|
|
- @Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
- public static class ConsumableDetail {
|
|
|
- /** 耗材代码 */
|
|
|
- private String consumableCode;
|
|
|
- /** 箱内该耗材的数量 */
|
|
|
- private String quantity;
|
|
|
- }
|
|
|
+ /** 订单完成时间 长度:19 YYYY-MM-DD HH:MM:SS */
|
|
|
+ private String orderConfirmTime;
|
|
|
+ private String operateTime;//当前状态操作时间, string (19) , YYYY-MM-DD HH:MM:SS
|
|
|
+ /*当前状态操作员姓名, string (50)*/
|
|
|
+ private String operatorName;
|
|
|
}
|
|
|
|
|
|
@Data
|
|
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
public static class OrderLines {
|
|
|
+ @JacksonXmlElementWrapper(useWrapping = false) // 去掉外层的包装
|
|
|
+ @JacksonXmlProperty(localName = "orderLine")
|
|
|
private List<OrderLine> orderLine;
|
|
|
|
|
|
@Data
|
|
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
public static class OrderLine {
|
|
|
+ /** 外部业务编码 长度:50 消息ID, 用于去重, 因为网络等原因导致重复传输, 请求不会被重复处理 */
|
|
|
+ private String outBizCode;
|
|
|
/** 行号 */
|
|
|
- private Integer lineNo;
|
|
|
+ private Integer orderLineNo;
|
|
|
/** 货品代码 长度:50 */
|
|
|
private String itemCode;
|
|
|
- /** 包装单位 长度:50 */
|
|
|
- private String packUom;
|
|
|
+ private String itemId;
|
|
|
+ private String itemName;
|
|
|
/** 预期货品数量 类型:float */
|
|
|
private Float planQty;
|
|
|
/** 实发货品数量 类型:float */
|
|
|
private Float actualQty;
|
|
|
- /** 实发包装数量 类型:float */
|
|
|
- private Float actualPackUomQty;
|
|
|
- /** 质量状态 长度:50 ZP=正品, CC=残次, 默认为ZP */
|
|
|
- private String inventoryType;
|
|
|
- /** 序列号,多个序列号用英文逗号隔开 长度:500 */
|
|
|
- private String serialNo;
|
|
|
- /** 自定义字段1 长度:50 */
|
|
|
- private String customField1;
|
|
|
- /** 自定义字段2 长度:50 */
|
|
|
- private String customField2;
|
|
|
- /** 自定义字段3 长度:50 */
|
|
|
- private String customField3;
|
|
|
- /** 自定义字段4 长度:50 */
|
|
|
- private String customField4;
|
|
|
- /** 自定义字段5 长度:50 */
|
|
|
- private String customField5;
|
|
|
- /** 自定义字段6 长度:50 */
|
|
|
- private String customField6;
|
|
|
- /** 自定义字段7 长度:50 */
|
|
|
- private String customField7;
|
|
|
- /** 自定义字段8 长度:50 */
|
|
|
- private String customField8;
|
|
|
- /** 批次信息 */
|
|
|
- private Batchs batchs;
|
|
|
- @Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
- public static class Batchs {
|
|
|
- private List<Batch> batch;
|
|
|
-
|
|
|
- @Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
- public static class Batch {
|
|
|
- /** 实发货品数量 类型:float */
|
|
|
- private Float actualQty;
|
|
|
- /** 实收包装数量 类型:float */
|
|
|
- private Float actualPackUomQty;
|
|
|
- /** 库存类型 长度:50 ZP=正品, CC=残次, 默认ZP */
|
|
|
- private String inventoryType;
|
|
|
- /** 虚拟仓库 长度:50 条件必填, 条件为使用虚拟仓库 */
|
|
|
- private String virtualWarehouse;
|
|
|
- /** 生产日期 长度:10 YYYY-MM-DD */
|
|
|
- private String productDate;
|
|
|
- /** 失效日期 长度:10 YYYY-MM-DD */
|
|
|
- private String expireDate;
|
|
|
- /** 批次号 长度:50 */
|
|
|
- private String batchCode;
|
|
|
- /** 入库日期 长度:10 YYYY-MM-DD */
|
|
|
- private String stockinDate;
|
|
|
- /** 自定义批次1 长度:50 */
|
|
|
- private String userDefined1;
|
|
|
- /** 自定义批次2 长度:50 */
|
|
|
- private String userDefined2;
|
|
|
- /** 自定义批次3 长度:50 */
|
|
|
- private String userDefined3;
|
|
|
- /** 自定义批次4 长度:50 */
|
|
|
- private String userDefined4;
|
|
|
- /** 拣货容器号 长度:50 */
|
|
|
- private String lpn;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- @Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
- public static class OrderDetails {
|
|
|
- private List<Detail> detail;
|
|
|
|
|
|
- @Data
|
|
|
- @JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
- public static class Detail {
|
|
|
- /** 容器号 */
|
|
|
- private String boxNo;
|
|
|
- /** epc码 RFID场景适用 */
|
|
|
- private String epc;
|
|
|
+ private String ownerCode;
|
|
|
+ private String logicWarehouseCode;
|
|
|
+ private String inLogicWarehouseCode;
|
|
|
}
|
|
|
}
|
|
|
- public String getMasterName() {
|
|
|
- if (orderLines.getOrderLine() != null) {//账套名称
|
|
|
- return orderLines.getOrderLine().get(0).getBatchs().getBatch().get(0).getUserDefined4();
|
|
|
+ public String getMasterCode() {
|
|
|
+ if(StringUtil.hasText(deliveryOrder.getOwnerCode())){
|
|
|
+ return deliveryOrder.getOwnerCode();
|
|
|
} else {
|
|
|
- return null;
|
|
|
+ if(orderLines != null && orderLines.getOrderLine() != null && orderLines.getOrderLine().size() > 0){
|
|
|
+ return orderLines.getOrderLine().get(0).getOwnerCode();
|
|
|
+ }
|
|
|
}
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
public String getGenerateMainSql() {
|
|
|
@@ -267,50 +103,51 @@ public class OUTConfirm {
|
|
|
.append("'").append("@INOUTNO").append("' PIINOUTNO, ")
|
|
|
.append("'").append(StringUtil.nvl(deliveryOrder.getDeliveryOrderCode(), "")).append("' ORDERCODE, ")
|
|
|
.append("'").append(StringUtil.nvl(deliveryOrder.getOwnerCode(), "")).append("' OWNERCODE, ")
|
|
|
+ .append("'").append(StringUtil.nvl(deliveryOrder.getInOwnerCode(), "")).append("' inOwnerCode, ")
|
|
|
.append("'").append(StringUtil.nvl(deliveryOrder.getWarehouseCode(), "")).append("' WAREHOUSECODE, ")
|
|
|
+ .append("'").append(StringUtil.nvl(deliveryOrder.getInWarehouseCode(), "")).append("' inWarehouseCode, ")
|
|
|
.append("'").append(StringUtil.nvl(deliveryOrder.getDeliveryOrderId(), "")).append("' WMSORDERID, ")
|
|
|
.append("'").append(StringUtil.nvl(deliveryOrder.getOrderType(), "")).append("' WMSORDERTYPE, ")
|
|
|
- .append("'").append(StringUtil.nvl(deliveryOrder.getOutBizCode(), "")).append("' OUTBIZCODE, ")
|
|
|
.append(StringUtil.nvl(deliveryOrder.getConfirmType(), "0")).append(" CONFIRMTYPE, ")
|
|
|
.append("'").append(StringUtil.nvl(deliveryOrder.getStatus(), "")).append("' STATUS, ")
|
|
|
- .append((StringUtil.hasText(deliveryOrder.getDeliveryTime()) ? "to_date('" + deliveryOrder.getDeliveryTime() + "','yyyy-mm-dd hh24:mi:ss')" : "null")).append(" deliveryTime, ")
|
|
|
- .append("'").append(StringUtil.nvl(deliveryOrder.getShipper(), "")).append("' shipper, ")
|
|
|
- .append("'").append(StringUtil.nvl(deliveryOrder.getRemark(), "")).append("' REMARK, ")
|
|
|
- .append("'").append(StringUtil.nvl(deliveryOrder.getUserDefined1(), "")).append("' USERDEFINED1, ")
|
|
|
- .append("'").append(StringUtil.nvl(deliveryOrder.getUserDefined2(), "")).append("' USERDEFINED2, ")
|
|
|
- .append("'").append(StringUtil.nvl(deliveryOrder.getUserDefined3(), "")).append("' USERDEFINED3, ")
|
|
|
- .append("'").append(StringUtil.nvl(deliveryOrder.getUserDefined4(), "")).append("' USERDEFINED4 ")
|
|
|
+ .append("'").append(StringUtil.nvl(deliveryOrder.getLogisticsCode(), "")).append("' logisticsCode, ")
|
|
|
+ .append("'").append(StringUtil.nvl(deliveryOrder.getLogisticsName(), "")).append("' logisticsName, ")
|
|
|
+ .append("'").append(StringUtil.nvl(deliveryOrder.getExpressCode(), "")).append("' expressCode, ")
|
|
|
+ .append((StringUtil.hasText(deliveryOrder.getOrderConfirmTime()) ? "to_date('" + deliveryOrder.getOrderConfirmTime() + "','yyyy-mm-dd hh24:mi:ss')" : "null")).append(" orderConfirmTime, ")
|
|
|
+ .append((StringUtil.hasText(deliveryOrder.getOperateTime()) ? "to_date('" + deliveryOrder.getOperateTime() + "','yyyy-mm-dd hh24:mi:ss')" : "null")).append(" operateTime, ")
|
|
|
+ .append("'").append(StringUtil.nvl(deliveryOrder.getOperatorName(), "")).append("' operatorName ")
|
|
|
.append("FROM dual) doc ON (wmsl.PIID = doc.PIID AND wmsl.PIINOUTNO = doc.PIINOUTNO) ")
|
|
|
.append("WHEN MATCHED THEN UPDATE SET ")
|
|
|
.append("wmsl.ORDERCODE = doc.ORDERCODE, ")
|
|
|
- .append("wmsl.OWNERCODE = doc.OWNERCODE, ")
|
|
|
- .append("wmsl.WAREHOUSECODE = doc.WAREHOUSECODE, ")
|
|
|
- .append("wmsl.WMSORDERID = doc.WMSORDERID, ")
|
|
|
- .append("wmsl.WMSORDERTYPE = doc.WMSORDERTYPE, ")
|
|
|
+// .append("wmsl.OWNERCODE = doc.OWNERCODE, ")
|
|
|
+// .append("wmsl.inOwnerCode = doc.inOwnerCode, ")
|
|
|
+// .append("wmsl.WAREHOUSECODE = doc.WAREHOUSECODE, ")
|
|
|
+// .append("wmsl.inWarehouseCode = doc.inWarehouseCode, ")
|
|
|
+// .append("wmsl.WMSORDERID = doc.WMSORDERID, ")
|
|
|
+// .append("wmsl.WMSORDERTYPE = doc.WMSORDERTYPE, ")
|
|
|
.append("wmsl.OUTBIZCODE = doc.OUTBIZCODE, ")
|
|
|
.append("wmsl.CONFIRMTYPE = doc.CONFIRMTYPE, ")
|
|
|
.append("wmsl.STATUS = doc.STATUS, ")
|
|
|
- .append("wmsl.deliveryTime = doc.deliveryTime, ")
|
|
|
- .append("wmsl.shipper = doc.shipper, ")
|
|
|
- .append("wmsl.REMARK = doc.REMARK, ")
|
|
|
- .append("wmsl.USERDEFINED1 = doc.USERDEFINED1, ")
|
|
|
- .append("wmsl.USERDEFINED2 = doc.USERDEFINED2, ")
|
|
|
- .append("wmsl.USERDEFINED3 = doc.USERDEFINED3, ")
|
|
|
- .append("wmsl.USERDEFINED4 = doc.USERDEFINED4, ")
|
|
|
+ .append("wmsl.logisticsCode = doc.logisticsCode, ")
|
|
|
+ .append("wmsl.logisticsName = doc.logisticsName, ")
|
|
|
+ .append("wmsl.expressCode = doc.expressCode, ")
|
|
|
+ .append("wmsl.ORDERFINISHEDTIME = doc.orderConfirmTime, ")
|
|
|
+ .append("wmsl.operateTime = doc.operateTime, ")
|
|
|
+ .append("wmsl.operatorName = doc.operatorName, ")
|
|
|
.append("wmsl.UTIME = SYSDATE ")
|
|
|
- .append("WHEN NOT MATCHED THEN INSERT (ITIME,PIID, PIINOUTNO, ORDERCODE, OWNERCODE, WAREHOUSECODE, WMSORDERID, WMSORDERTYPE, OUTBIZCODE, CONFIRMTYPE, STATUS, deliveryTime, shipper, REMARK, USERDEFINED1, USERDEFINED2, USERDEFINED3, USERDEFINED4) ")
|
|
|
- .append("VALUES (SYSDATE,doc.PIID, doc.PIINOUTNO, doc.ORDERCODE, doc.OWNERCODE, doc.WAREHOUSECODE, doc.WMSORDERID, doc.WMSORDERTYPE, doc.OUTBIZCODE, doc.CONFIRMTYPE, doc.STATUS, doc.deliveryTime, doc.shipper, doc.REMARK, doc.USERDEFINED1, doc.USERDEFINED2, doc.USERDEFINED3, doc.USERDEFINED4)");
|
|
|
+ .append("WHEN NOT MATCHED THEN INSERT (ITIME,PIID, PIINOUTNO, ORDERCODE, OWNERCODE,TOOWNERCODE, WAREHOUSECODE,INWAREHOUSECODE, WMSORDERID, WMSORDERTYPE, OUTBIZCODE, CONFIRMTYPE, STATUS" +
|
|
|
+ ", ORDERFINISHEDTIME, operatorName, OPERATETIME,logisticsCode,logisticsName,expressCode) ")
|
|
|
+ .append("VALUES (SYSDATE,doc.PIID, doc.PIINOUTNO, doc.ORDERCODE, doc.OWNERCODE,doc.inOwnerCode,doc.WAREHOUSECODE,doc.inWarehouseCode,doc.WMSORDERID,doc.OUTBIZCODE,doc.CONFIRMTYPE,doc.STATUS" +
|
|
|
+ " ,doc.orderConfirmTime,doc.operatorName,doc.operateTime,doc.logisticsCode,doc.logisticsName,doc.expressCode" +
|
|
|
+ ")");
|
|
|
return sql.toString();
|
|
|
}
|
|
|
|
|
|
public List<String> getGenerateLinesSql() {
|
|
|
List<String> sqls = new ArrayList<>();
|
|
|
+ sqls.add("UPDATE @MASTERCODE.prodiowms_Lines SET ACTUALQTY=0 WHERE PL_PIID = @PIID");
|
|
|
for (OUTConfirm.OrderLines.OrderLine line : orderLines.getOrderLine()) {
|
|
|
sqls.add(getGenerateLinesSql(line));
|
|
|
- for (int i = 0; i < line.getBatchs().getBatch().size(); i++) {
|
|
|
- OUTConfirm.OrderLines.OrderLine.Batchs.Batch batch = line.getBatchs().getBatch().get(i);
|
|
|
- sqls.add(getGenerateBatchsSql(line,line.getLineNo(), (i + 1), batch));
|
|
|
- }
|
|
|
}
|
|
|
return sqls;
|
|
|
}
|
|
|
@@ -320,77 +157,19 @@ public class OUTConfirm {
|
|
|
sql.append("MERGE INTO ").append("@MASTERCODE").append(".prodiowms_Lines wmsl USING (")
|
|
|
.append("SELECT ")
|
|
|
.append("@PIID").append(" PIID, ")
|
|
|
- .append(line.getLineNo()).append(" LINENO, ")
|
|
|
+ .append("'").append(line.getOutBizCode()).append("' OUTBIZCODE, ")
|
|
|
+ .append(line.getOrderLineNo()).append(" LINENO, ")
|
|
|
.append("'").append(line.getItemCode()).append("' ITEMCODE, ")
|
|
|
.append("'").append(StringUtil.nvl(line.getPlanQty(), "")).append("' PLANQTY, ")
|
|
|
.append(StringUtil.nvl(line.getActualQty(), "0")).append(" ACTUALQTY, ")
|
|
|
- .append(StringUtil.nvl(line.getActualPackUomQty(), "0")).append(" ACTUALPACKUOMQTY, ")
|
|
|
- .append("'").append(StringUtil.nvl(line.getSerialNo(), "")).append("' SERIALNO, ")
|
|
|
- .append("'").append(StringUtil.nvl(line.getCustomField1(), "")).append("' CUSTOMFIELD1, ")
|
|
|
- .append("'").append(StringUtil.nvl(line.getCustomField2(), "")).append("' CUSTOMFIELD2, ")
|
|
|
- .append("'").append(StringUtil.nvl(line.getCustomField3(), "")).append("' CUSTOMFIELD3, ")
|
|
|
- .append("'").append(StringUtil.nvl(line.getCustomField4(), "")).append("' CUSTOMFIELD4, ")
|
|
|
- .append("'").append(StringUtil.nvl(line.getCustomField5(), "")).append("' CUSTOMFIELD5, ")
|
|
|
- .append("'").append(StringUtil.nvl(line.getCustomField6(), "")).append("' CUSTOMFIELD6, ")
|
|
|
- .append("'").append(StringUtil.nvl(line.getCustomField7(), "")).append("' CUSTOMFIELD7, ")
|
|
|
- .append("'").append(StringUtil.nvl(line.getCustomField8(), "")).append("' CUSTOMFIELD8 ")
|
|
|
- .append("FROM dual) doc ON (wmsl.PL_PIID = doc.PIID AND wmsl.LINENO = doc.LINENO AND wmsl.ITEMCODE = doc.ITEMCODE) ")
|
|
|
+ .append("FROM dual) doc ON (wmsl.PL_PIID = doc.PIID AND wmsl.LINENO = doc.LINENO) ")
|
|
|
.append("WHEN MATCHED THEN UPDATE SET ")
|
|
|
- .append("wmsl.ACTUALQTY = doc.ACTUALQTY, ")
|
|
|
- .append("wmsl.ACTUALPACKUOMQTY = doc.ACTUALPACKUOMQTY, ")
|
|
|
- .append("wmsl.SERIALNO = doc.SERIALNO, ")
|
|
|
- .append("wmsl.CUSTOMFIELD1 = doc.CUSTOMFIELD1, ")
|
|
|
- .append("wmsl.CUSTOMFIELD2 = doc.CUSTOMFIELD2, ")
|
|
|
- .append("wmsl.CUSTOMFIELD3 = doc.CUSTOMFIELD3, ")
|
|
|
- .append("wmsl.CUSTOMFIELD4 = doc.CUSTOMFIELD4, ")
|
|
|
- .append("wmsl.CUSTOMFIELD5 = doc.CUSTOMFIELD5, ")
|
|
|
- .append("wmsl.CUSTOMFIELD6 = doc.CUSTOMFIELD6, ")
|
|
|
- .append("wmsl.CUSTOMFIELD7 = doc.CUSTOMFIELD7, ")
|
|
|
- .append("wmsl.CUSTOMFIELD8 = doc.CUSTOMFIELD8, ")
|
|
|
+ .append("wmsl.OUTBIZCODE = doc.OUTBIZCODE, ")
|
|
|
+ .append("wmsl.ACTUALQTY = NVL(msl.ACTUALQTY,0)+doc.ACTUALQTY, ")
|
|
|
.append("wmsl.UTIME = SYSDATE ")
|
|
|
- .append("WHEN NOT MATCHED THEN INSERT (ITIME,PL_PIID, LINENO, ITEMCODE, PLANQTY, ACTUALQTY, ACTUALPACKUOMQTY, SERIALNO, ")
|
|
|
- .append("CUSTOMFIELD1, CUSTOMFIELD2, CUSTOMFIELD3, CUSTOMFIELD4, CUSTOMFIELD5, CUSTOMFIELD6, CUSTOMFIELD7, CUSTOMFIELD8) ")
|
|
|
- .append("VALUES (SYSDATE,doc.PIID, doc.LINENO, doc.ITEMCODE, doc.PLANQTY, doc.ACTUALQTY,doc.ACTUALPACKUOMQTY, ")
|
|
|
- .append(" doc.SERIALNO, doc.CUSTOMFIELD1, doc.CUSTOMFIELD2, doc.CUSTOMFIELD3, doc.CUSTOMFIELD4, doc.CUSTOMFIELD5, ")
|
|
|
- .append("doc.CUSTOMFIELD6, doc.CUSTOMFIELD7, doc.CUSTOMFIELD8)");
|
|
|
+ .append("WHEN NOT MATCHED THEN INSERT (PL_PIID,OUTBIZCODE,LINENO, ITEMCODE, PLANQTY,ACTUALQTY) ")
|
|
|
+ .append("VALUES (doc.PIID,doc.OUTBIZCODE, doc.LINENO, doc.ITEMCODE, doc.PLANQTY, doc.ACTUALQTY)");
|
|
|
return sql.toString();
|
|
|
}
|
|
|
|
|
|
- public String getGenerateBatchsSql(OUTConfirm.OrderLines.OrderLine line,Integer lineNo, Integer detno, OUTConfirm.OrderLines.OrderLine.Batchs.Batch batch) {
|
|
|
- StringBuilder sql = new StringBuilder();
|
|
|
- sql.append("INSERT INTO ").append("@MASTERCODE")
|
|
|
- .append(".prodiowms_batchs(ITIME,PB_PIID, PD_DETNO, LINENO, ACTUALQTY, ACTUALPACKUOMQTY, INVENTORYTYPE, VIRTUALWAREHOUSE, PRODUCTDATE, EXPIREDATE, BATCHCODE, STOCKINDATE, USERDEFINED1, USERDEFINED2, USERDEFINED3, USERDEFINED4, LPN) VALUES(");
|
|
|
- // 添加字段值
|
|
|
- sql.append("SYSDATE, ");
|
|
|
- sql.append("@PIID").append(", ");
|
|
|
- sql.append(detno).append(", "); // PD_DETNO
|
|
|
- sql.append(lineNo).append(", "); // LINENO
|
|
|
- sql.append(StringUtil.nvl(batch.getActualQty(), "0")).append(", ");
|
|
|
- sql.append(StringUtil.nvl(batch.getActualPackUomQty(), "0")).append(", ");
|
|
|
- sql.append("'").append(StringUtil.nvl(line.getInventoryType(), "")).append("', ");
|
|
|
- sql.append("'").append(StringUtil.nvl(batch.getVirtualWarehouse(), "")).append("', ");
|
|
|
- if (StringUtil.hasText(batch.getProductDate())) {
|
|
|
- sql.append("to_date('").append(batch.getProductDate()).append("','yyyy-mm-dd hh24:mi:ss'), ");
|
|
|
- } else {
|
|
|
- sql.append("null, ");
|
|
|
- }
|
|
|
- if (StringUtil.hasText(batch.getExpireDate())) {
|
|
|
- sql.append("to_date('").append(batch.getExpireDate()).append("','yyyy-mm-dd hh24:mi:ss'), ");
|
|
|
- } else {
|
|
|
- sql.append("null, ");
|
|
|
- }
|
|
|
- sql.append("'").append(StringUtil.nvl(batch.getBatchCode(), "")).append("', ");
|
|
|
- if (StringUtil.hasText(batch.getStockinDate())) {
|
|
|
- sql.append("to_date('").append(batch.getStockinDate()).append("','yyyy-mm-dd hh24:mi:ss'), ");
|
|
|
- } else {
|
|
|
- sql.append("null, ");
|
|
|
- }
|
|
|
- sql.append("'").append(StringUtil.nvl(batch.getUserDefined1(), "")).append("', ");
|
|
|
- sql.append("'").append(StringUtil.nvl(batch.getUserDefined2(), "")).append("', ");
|
|
|
- sql.append("'").append(StringUtil.nvl(batch.getUserDefined3(), "")).append("', ");
|
|
|
- sql.append("'").append(StringUtil.nvl(batch.getUserDefined4(), "")).append("', ");
|
|
|
- sql.append("'").append(StringUtil.nvl(batch.getLpn(), "")).append("'");
|
|
|
- sql.append(")");
|
|
|
- return sql.toString();
|
|
|
- }
|
|
|
}
|