package com.zy.common.model; import com.core.common.DateUtils; import com.zy.asrs.entity.OrderDetl; import lombok.Data; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * Created by vincent on 2022/4/21 */ @Data public class YXErpPakinParam { // 单据日期 private String dAVDate; //必填 private String dTVDate; //必填 private String dVerifyDate; private String cODepCode = "01"; //必填 private String cIRdCode = "107"; //必填 private String cORdCode = "207"; //必填 // 转入仓库编码 private String cMaker = "WMS管理员"; // 转出部门编码 private String cVerifyPerson = "WMS管理员"; // 转出仓库编码 private String cAVMemo = "备注"; private String cAVCode; private List detail = new ArrayList<>(); public YXErpPakinParam() { this.dTVDate = DateUtils.convert(new Date(), DateUtils.yyyyMMdd_F); this.dAVDate = DateUtils.convert(new Date(), DateUtils.yyyyMMdd_F); this.dVerifyDate = DateUtils.convert(new Date(), DateUtils.yyyyMMdd_F); } public YXErpPakinParam(String cAVCod, String cAVMemo) { this.dTVDate = DateUtils.convert(new Date(), DateUtils.yyyyMMdd_F); this.dAVDate = DateUtils.convert(new Date(), DateUtils.yyyyMMdd_F); this.dVerifyDate = DateUtils.convert(new Date(), DateUtils.yyyyMMdd_F); this.cAVCode = cAVCod; this.cAVMemo = cAVMemo; } public YXErpPakinParam(String dTVDate, String cAVMemo, String cAVCod, List detail) { this.dTVDate = DateUtils.convert(new Date(), DateUtils.yyyyMMdd_F); this.dAVDate = DateUtils.convert(new Date(), DateUtils.yyyyMMdd_F); this.dVerifyDate = DateUtils.convert(new Date(), DateUtils.yyyyMMdd_F); this.dTVDate = dTVDate; this.cAVMemo = cAVMemo; this.cAVCode = cAVCod; this.detail = detail; } public YXErpPakinParam(String cODepCode, String cIRdCode, String cORdCode, String cAVMemo, String cMaker, String cVerifyPerson, List detail) { this.dTVDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); this.dAVDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); this.dVerifyDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); this.cODepCode = cODepCode; this.cIRdCode = cIRdCode; this.cORdCode = cORdCode; this.cAVMemo = cAVMemo; this.cMaker = cMaker; this.cVerifyPerson = cVerifyPerson; this.detail = detail; } @Data public static class Detl { // 库存调拨单号 private String cbMemo; //必填 // 物料编码 存货编码 private String cAVCode; //必填 private String cWhCode; //必填 private String cInvCode; //必填 private double iAVQuantity; //必填 private String cAVBatch; //必填 private String bAVType; //必填 private Integer iGroupNO; //必填 public Detl() { } public Detl(OrderDetl orderDetl,boolean bool) { if (bool){ Detl1(orderDetl); } else { Detl2(orderDetl); } } public void Detl1(OrderDetl orderDetl) { this.cbMemo = orderDetl.getMemo(); this.cAVCode = orderDetl.getOrderNo(); this.cWhCode = "100"; // this.cInvCode = orderDetl.getMatnr$(); this.cInvCode = "XJ0001"; this.iAVQuantity = orderDetl.getWeight(); this.cAVBatch = orderDetl.getBatch(); this.bAVType = "转换前"; this.iGroupNO = 1; } public void Detl2(OrderDetl orderDetl) { this.cbMemo = orderDetl.getMemo(); this.cAVCode = orderDetl.getOrderNo(); this.cWhCode = "201"; this.cInvCode = orderDetl.getMatnr(); this.iAVQuantity = orderDetl.getWeight(); this.cAVBatch = orderDetl.getBatch(); this.bAVType = "转换后"; this.iGroupNO = 1; } } }