/* *代码由框架生成,任何更改都可能导致被代码生成器覆盖 *如果数据库字段发生变化,请在代码生器重新生成此Model */ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Net.Sockets; using System.Text; using System.Threading.Tasks; using VOL.Entity.MappingConfiguration; using VOL.Entity.SystemModels; namespace VOL.Entity.DomainModels { public struct WMSCHANGTYPE { public const string 入库 = "入库"; public const string 出库 = "出库"; public const string 出库_取消 = "出库_取消"; public const string 货转入库 = "货转入库"; public const string 货转出库 = "货转出库"; //public const string 货转入库_取消 = "货转入库_取消"; //public const string 货转出库_取消 = "货转出库_取消"; public const string 盘点_盘亏 = "盘点_盘亏"; public const string 盘点_盘盈 = "盘点_盘盈"; public const string 移库_移入 = "移库_移入"; public const string 移库_移出 = "移库_移出"; public const string 清库 = "清库"; //public const string 移库_移入_取消 = "移库_移入_取消"; //public const string 移库_移出_取消 = "移库_移出_取消"; } #region 虎鲸 场站管理 业务和状态维护 public struct OPYARDMNG_WORKTYPE { public const string 调度待入场 = "调度待入场"; public const string 调度入场 = "调度入场"; public const string 场站落箱 = "场站落箱"; public const string 场站出场 = "场站出场"; public const string 后台待出场 = "后台待出场"; //public const string 后台出场 = "后台出场"; } public struct OPYARDMNG_BOXSTATUS { public const string 未入场 = "未入场"; public const string 待入场 = "待入场"; public const string 已入场 = "已入场"; public const string 已落箱 = "已落箱"; public const string 待出场 = "待出场"; public const string 已出场 = "已出场"; } public struct OPYARDMNG_AppointType { public const string 堆场预约 = "yard"; public const string 保税预约 = "bond"; } public class OPYARDMNGStatusHelper { private Tb_BlockTrainOrder order { get; set; } private OP_YARD_CTNMNG 堆场预约 { get; set; } = null; private OP_YARD_CTNMNG 保税预约 { get; set; } = null; public OPYARDMNGStatusHelper() { } public OPYARDMNGStatusHelper(Tb_BlockTrainOrder _order,List 预约List) { //this.head = head; order= _order; if (预约List.Exists(x => x.AppointType == OPYARDMNG_AppointType.堆场预约)) { 堆场预约= 预约List.FirstOrDefault(x => x.AppointType == OPYARDMNG_AppointType.堆场预约); } if (预约List.Exists(x => x.AppointType == OPYARDMNG_AppointType.保税预约)) { 保税预约 = 预约List.FirstOrDefault(x => x.AppointType == OPYARDMNG_AppointType.保税预约); } } public Tb_BlockTrainOrder get台账() { return order; } public OP_YARD_CTNMNG get堆场预约() { return 堆场预约; } public OP_YARD_CTNMNG get保税预约() { return 保税预约; } public bool 仅有堆场预约() { return 堆场预约 != null && 保税预约 == null; } public bool 仅有保税预约() { return 保税预约 != null && 堆场预约 == null; } public bool 两种预约皆有() { return 堆场预约 != null && 保税预约 != null; } public bool 有堆场预约() { return 堆场预约 != null; } public bool 有保税预约() { return 保税预约 != null; } private void doset堆场预约和台账(string boxstatus) { 堆场预约.BILLSTATUS_CUST = boxstatus; order.BoxStatus = boxstatus; } private void doset保税预约和台账(string boxstatus) { 保税预约.BILLSTATUS_CUST = boxstatus; order.BoxStatus = boxstatus; } private void doset保税预约(string boxstatus) { 保税预约.BILLSTATUS_CUST = boxstatus; } private void set堆场预约和台账(string worktype) { if (堆场预约.BILLSTATUS_CUST == OPYARDMNG_BOXSTATUS.未入场 && worktype == OPYARDMNG_WORKTYPE.调度待入场) { doset堆场预约和台账(OPYARDMNG_BOXSTATUS.待入场); } if (堆场预约.BILLSTATUS_CUST == OPYARDMNG_BOXSTATUS.待入场 && worktype == OPYARDMNG_WORKTYPE.调度入场) { doset堆场预约和台账(OPYARDMNG_BOXSTATUS.已入场); } if (堆场预约.BILLSTATUS_CUST == OPYARDMNG_BOXSTATUS.已入场 && worktype == OPYARDMNG_WORKTYPE.场站落箱) { doset堆场预约和台账(OPYARDMNG_BOXSTATUS.已落箱); } if (堆场预约.BILLSTATUS_CUST == OPYARDMNG_BOXSTATUS.已落箱 && worktype == OPYARDMNG_WORKTYPE.后台待出场) { doset堆场预约和台账(OPYARDMNG_BOXSTATUS.待出场); } if (堆场预约.BILLSTATUS_CUST == OPYARDMNG_BOXSTATUS.待出场 && worktype == OPYARDMNG_WORKTYPE.场站出场) { doset堆场预约和台账(OPYARDMNG_BOXSTATUS.已出场); } } private void set保税预约和台账(string worktype) { if (保税预约.BILLSTATUS_CUST == OPYARDMNG_BOXSTATUS.未入场 && worktype == OPYARDMNG_WORKTYPE.调度待入场) { doset保税预约和台账(OPYARDMNG_BOXSTATUS.待入场); } if (保税预约.BILLSTATUS_CUST == OPYARDMNG_BOXSTATUS.待入场 && worktype == OPYARDMNG_WORKTYPE.调度入场) { doset保税预约和台账(OPYARDMNG_BOXSTATUS.已入场); } if (保税预约.BILLSTATUS_CUST == OPYARDMNG_BOXSTATUS.已入场 && worktype == OPYARDMNG_WORKTYPE.后台待出场) { doset保税预约和台账(OPYARDMNG_BOXSTATUS.已出场); } } private void set保税预约(string worktype) { if (保税预约.BILLSTATUS_CUST == OPYARDMNG_BOXSTATUS.未入场 && worktype == OPYARDMNG_WORKTYPE.调度待入场) { doset保税预约(OPYARDMNG_BOXSTATUS.待入场); } if (堆场预约.BILLSTATUS_CUST == OPYARDMNG_BOXSTATUS.待入场 && worktype == OPYARDMNG_WORKTYPE.调度入场) { doset保税预约(OPYARDMNG_BOXSTATUS.已入场); } if (堆场预约.BILLSTATUS_CUST == OPYARDMNG_BOXSTATUS.已入场 && worktype == OPYARDMNG_WORKTYPE.后台待出场) { doset保税预约(OPYARDMNG_BOXSTATUS.已出场); } } public bool candowork(string worktype) { var oldestatus = order.BoxStatus; DoWork(worktype); if (oldestatus == order.BoxStatus) return false; return true; } private void DoWork(string worktype) { if (两种预约皆有()) { //以堆场预约为主 推进预约状态和箱状态 //保税预约状态相应变更 set堆场预约和台账(worktype); set保税预约(worktype); } if (仅有堆场预约()) { set堆场预约和台账(worktype); } if (仅有保税预约()) { set保税预约和台账(worktype); } } } #endregion //用于设定值 public partial class Op_Wms_Change:BaseEntity { public Op_Wms_Change() { } /// /// 入库或货转入 /// /// public void setNew(VW_OP_WMS_IN_DO_GOODS ingoods) { KGS2 = 0; NETWEIGHT2 = 0; CBM2 = 0; PKGS2 = 0; SMALLPKGS2 = 0; MINPKGS2 = 0; KINDPKGS2 = ""; PAYEDTAXES2 = false; STORAGEUNIT2 = ""; STORAGEUNITCOUNT2 = 0; RULEUNIT2 = ""; RULEUNITCOUNT2 = 0; KGS3 = KGS; NETWEIGHT3 = NETWEIGHT; CBM3 = CBM; PKGS3 = PKGS; SMALLPKGS3 = SMALLPKGS; MINPKGS3 = MINPKGS; KINDPKGS3 = KINDPKGS; PAYEDTAXES3 = false; STORAGEUNIT3 = STORAGEUNIT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT; RULEUNIT3 = RULEUNIT; RULEUNITCOUNT3 = RULEUNITCOUNT; DOBSNO = ingoods.WMSDOID.ToString(); DOGID = ingoods.WMSDODETAILID; CHANGETYPE = WMSCHANGTYPE.入库; } public void setNew(OP_WMS_IN_DO_GOODS ingoods) { KGS2 = 0; NETWEIGHT2 = 0; CBM2 = 0; PKGS2 = 0; SMALLPKGS2 = 0; MINPKGS3 = 0; KINDPKGS2 = ""; PAYEDTAXES2 = false; STORAGEUNIT2 = ""; STORAGEUNITCOUNT2 = 0; RULEUNIT2 = ""; RULEUNITCOUNT2 = 0; KGS3 = KGS; NETWEIGHT3 = NETWEIGHT; CBM3 = CBM; PKGS3 = PKGS; SMALLPKGS3 = SMALLPKGS; MINPKGS3 = MINPKGS; KINDPKGS3 = KINDPKGS; PAYEDTAXES3 = false; STORAGEUNIT3 = STORAGEUNIT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT; RULEUNIT3 = RULEUNIT; RULEUNITCOUNT3 = RULEUNITCOUNT; DOBSNO = ingoods.WMSDOID.ToString(); DOGID = ingoods.WMSDODETAILID; CHANGETYPE = WMSCHANGTYPE.入库; } /// /// 货转产生新的库存 /// /// /// public void setNew(OP_WMS wms, VW_OP_WMS_TRANSFERGOODS_DETAIL 货转明细) { WMSLOGID = Guid.NewGuid(); WMSID = wms.WMSID; DOBSNO = 货转明细.WMSTRANSFERGOODSID.ToString(); DOGID = 货转明细.WMSDODETAILID; CHANGETYPE = WMSCHANGTYPE.货转入库; KGS = wms.KGS; CBM = wms.CBM; PKGS = wms.PKGS; SMALLPKGS = wms.SMALLPKGS; MINPKGS = wms.MINPKGS; KINDPKGS = wms.KINDPKGS; STORAGEUNIT = wms.STORAGEUNIT; STORAGEUNITCOUNT = wms.STORAGEUNITCOUNT; RULEUNIT = wms.RULEUNIT; RULEUNITCOUNT = wms.RULEUNITCOUNT; NETWEIGHT = wms.NETWEIGHT; KGS2 = 0; CBM2 = 0; PKGS2 = 0; SMALLPKGS2 = 0; MINPKGS2 = 0; KINDPKGS2 = ""; PAYEDTAXES2 = false; STORAGEUNIT2 = ""; STORAGEUNITCOUNT2 = 0; RULEUNIT2 = ""; RULEUNITCOUNT2 = 0; NETWEIGHT2 = 0; KGS3 = KGS; CBM3 = CBM; PKGS3 = PKGS; SMALLPKGS3 = SMALLPKGS; MINPKGS3 = MINPKGS; KINDPKGS3 = KINDPKGS; PAYEDTAXES3 = false; STORAGEUNIT3 = STORAGEUNIT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT; RULEUNIT3 = RULEUNIT; RULEUNITCOUNT3 = RULEUNITCOUNT; NETWEIGHT3 = NETWEIGHT; } /// /// 库存增加 /// /// public void setAdd(VW_OP_WMS_IN_DO_GOODS ingoods) { } /// /// 库存减少 /// /// public void setOut(Vw_Op_Wms wms, VW_OP_WMS_TRANSFERGOODS_DETAIL 货转明细) { CHANGETYPE = WMSCHANGTYPE.货转出库; WMSID = wms.WMSID; DOBSNO = 货转明细.WMSTRANSFERGOODSID.ToString(); DOGID = 货转明细.WMSDODETAILID; KGS2 = wms.KGS; CBM2 = wms.CBM; PKGS2 = wms.PKGS; SMALLPKGS2 = wms.SMALLPKGS; MINPKGS2 = wms.MINPKGS; PKGS2 = wms.PKGS; KINDPKGS2 = wms.KINDPKGS; STORAGEUNIT2 = wms.STORAGEUNIT; STORAGEUNITCOUNT2 = wms.STORAGEUNITCOUNT; RULEUNIT2 = wms.RULEUNIT; RULEUNITCOUNT2 = wms.RULEUNITCOUNT; NETWEIGHT2 = wms.NETWEIGHT; KGS = -货转明细.KGS; CBM = -货转明细.CBM; PKGS = -货转明细.PKGS; SMALLPKGS = -货转明细.SMALLPKGS; MINPKGS = -货转明细.MINPKGS; KINDPKGS = 货转明细.KINDPKGS; //PAYEDTAXES2 = false; STORAGEUNIT = 货转明细.STORAGEUNIT; STORAGEUNITCOUNT = -货转明细.STORAGEUNITCOUNT; RULEUNIT = 货转明细.RULEUNIT; RULEUNITCOUNT = -货转明细.RULEUNITCOUNT; NETWEIGHT = -货转明细.NETWEIGHT; KGS3 = KGS2+KGS; CBM3 = CBM2+ CBM; PKGS3 = PKGS2+ PKGS; SMALLPKGS3 = SMALLPKGS2+ SMALLPKGS; MINPKGS3 = MINPKGS2+ MINPKGS; KINDPKGS3 = KINDPKGS; //PAYEDTAXES3 = false; STORAGEUNIT3 = STORAGEUNIT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT2+ STORAGEUNITCOUNT; RULEUNIT3 = RULEUNIT; RULEUNITCOUNT3 = RULEUNITCOUNT2+ RULEUNITCOUNT; NETWEIGHT3 = NETWEIGHT2 + NETWEIGHT; } /// /// 货转出库_取消 向原库存内添加执行数量 /// /// /// public void setUnOut(ref OP_WMS wms, VW_OP_WMS_TRANSFERGOODS_DETAIL 货转明细) { CHANGETYPE = WMSCHANGTYPE.货转入库; wms.ISCLEAR = false; wms.FEEENDDATE = null; WMSID = wms.WMSID; DOBSNO = 货转明细.WMSTRANSFERGOODSID.ToString(); DOGID = 货转明细.WMSDODETAILID; KGS = 货转明细.KGS; CBM = 货转明细.CBM; PKGS = 货转明细.PKGS; SMALLPKGS = 货转明细.SMALLPKGS; MINPKGS = 货转明细.MINPKGS; KINDPKGS = 货转明细.KINDPKGS; //PAYEDTAXES2 = false; STORAGEUNIT = 货转明细.STORAGEUNIT; STORAGEUNITCOUNT = 货转明细.STORAGEUNITCOUNT; RULEUNIT = 货转明细.RULEUNIT; RULEUNITCOUNT = 货转明细.RULEUNITCOUNT; NETWEIGHT = 货转明细.NETWEIGHT; KGS2 = wms.KGS; CBM2 = wms.CBM; PKGS2 = wms.PKGS; SMALLPKGS2 = wms.SMALLPKGS; MINPKGS2 = wms.MINPKGS; KINDPKGS2 = wms.KINDPKGS; STORAGEUNIT2 = wms.STORAGEUNIT; STORAGEUNITCOUNT2 = wms.STORAGEUNITCOUNT; RULEUNIT2 = wms.RULEUNIT; RULEUNITCOUNT2 = wms.RULEUNITCOUNT; NETWEIGHT2 = wms.NETWEIGHT; KGS3 = KGS2 + KGS; CBM3 = CBM2 + CBM; PKGS3 = PKGS2 + PKGS; SMALLPKGS3 = SMALLPKGS2 + SMALLPKGS; MINPKGS3 = MINPKGS2 + MINPKGS; KINDPKGS3 = KINDPKGS; //PAYEDTAXES3 = false; STORAGEUNIT3 = STORAGEUNIT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT2 + STORAGEUNITCOUNT; RULEUNIT3 = RULEUNIT; RULEUNITCOUNT3 = RULEUNITCOUNT2 + RULEUNITCOUNT; NETWEIGHT3 = NETWEIGHT2 + NETWEIGHT; wms.KGS= KGS3; wms.CBM = CBM3; wms.PKGS = PKGS3; wms.SMALLPKGS = SMALLPKGS3; wms.MINPKGS = MINPKGS3; wms.STORAGEUNITCOUNT = STORAGEUNITCOUNT3; wms.RULEUNITCOUNT = RULEUNITCOUNT3; wms.NETWEIGHT = NETWEIGHT3; } /// /// 库存减少 移库并使用新费率 /// /// /// /// public void setOut(ref OP_WMS 原库存, OP_WMS_MOVE 移库, OP_WMS_MOVE_DETAIL 移库明细) { WMSLOGID = Guid.NewGuid(); WMSID = 原库存.WMSID; DOBSNO = 移库.WMSDOID.ToString(); DOGID = 移库明细.WMSMOVEDETAILID; CHANGETYPE = WMSCHANGTYPE.移库_移出; DODATE = 移库.DODATE; KGS2 = 原库存.KGS; NETWEIGHT2 = 原库存.NETWEIGHT; CBM2 = 原库存.CBM; PKGS2 = 原库存.PKGS; SMALLPKGS2 = 原库存.SMALLPKGS; MINPKGS2 = 原库存.MINPKGS; STORAGEUNITCOUNT2 = 原库存.STORAGEUNITCOUNT; RULEUNITCOUNT2 = 原库存.RULEUNITCOUNT; KGS = -移库明细.KGS; NETWEIGHT = -移库明细.NETWEIGHT; CBM = -移库明细.CBM; PKGS = -移库明细.PKGS; SMALLPKGS = -移库明细.SMALLPKGS; MINPKGS = -移库明细.MINPKGS; STORAGEUNITCOUNT = -移库明细.STORAGEUNITCOUNT; RULEUNITCOUNT = -移库明细.RULEUNITCOUNT; 原库存.KGS += KGS; 原库存.NETWEIGHT += NETWEIGHT; 原库存.CBM += CBM; 原库存.PKGS += PKGS; 原库存.SMALLPKGS += SMALLPKGS; 原库存.MINPKGS += MINPKGS; 原库存.STORAGEUNITCOUNT += STORAGEUNITCOUNT; 原库存.RULEUNITCOUNT += RULEUNITCOUNT; 原库存.FEEENDDATE = ((DateTime)移库.DODATE).AddDays(-1); KGS3 = 原库存.KGS; NETWEIGHT3 = 原库存.NETWEIGHT; CBM3 = 原库存.CBM; PKGS3 = 原库存.PKGS; SMALLPKGS3 = 原库存.SMALLPKGS; MINPKGS3 = 原库存.MINPKGS; STORAGEUNITCOUNT3 = 原库存.STORAGEUNITCOUNT; RULEUNITCOUNT3 = 原库存.RULEUNITCOUNT; } /// /// 移库并使用新费率 产生新的库存 /// /// /// /// public void setNew(ref OP_WMS wms, OP_WMS_MOVE 移库, OP_WMS_MOVE_DETAIL 移库明细) { WMSLOGID = Guid.NewGuid(); WMSID = wms.WMSID; DOBSNO = 移库.WMSDOID.ToString(); DOGID = 移库明细.WMSMOVEDETAILID; DODATE = 移库.DODATE; wms.WMSINDATE = 移库.DODATE; wms.FEERATESTARTDATE = 移库.DODATE; wms.FEESTARTDATE = 移库.DODATE; CHANGETYPE = WMSCHANGTYPE.移库_移入; KGS = wms.KGS; CBM = wms.CBM; PKGS = wms.PKGS; SMALLPKGS = wms.SMALLPKGS; MINPKGS = wms.MINPKGS; KINDPKGS = wms.KINDPKGS; STORAGEUNIT = wms.STORAGEUNIT; STORAGEUNITCOUNT = wms.STORAGEUNITCOUNT; RULEUNIT = wms.RULEUNIT; RULEUNITCOUNT = wms.RULEUNITCOUNT; NETWEIGHT = wms.NETWEIGHT; KGS2 = 0; CBM2 = 0; PKGS2 = 0; SMALLPKGS2 = 0; MINPKGS2 = 0; KINDPKGS2 = ""; PAYEDTAXES2 = false; STORAGEUNIT2 = ""; STORAGEUNITCOUNT2 = 0; RULEUNIT2 = ""; RULEUNITCOUNT2 = 0; NETWEIGHT2 = 0; KGS3 = KGS; CBM3 = CBM; PKGS3 = PKGS; SMALLPKGS3 = SMALLPKGS; MINPKGS3 = MINPKGS; KINDPKGS3 = KINDPKGS; PAYEDTAXES3 = false; STORAGEUNIT3 = STORAGEUNIT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT; RULEUNIT3 = RULEUNIT; RULEUNITCOUNT3 = RULEUNITCOUNT; NETWEIGHT3 = NETWEIGHT; } public void setValue3() { PKGS3 = PKGS2 + PKGS; SMALLPKGS3 = SMALLPKGS2 + SMALLPKGS; MINPKGS3 = MINPKGS2 + MINPKGS; KGS3 = KGS2 + KGS; CBM3 = CBM2 + CBM; NETWEIGHT3 = NETWEIGHT2 + NETWEIGHT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT2 + STORAGEUNITCOUNT; RULEUNITCOUNT3 = RULEUNITCOUNT2 + RULEUNITCOUNT; } public void 较晚录入的变动更新变动前后值至当时状态(Op_Wms_Change 较晚的变动日志) { //通常变动值为负 PKGS2 -= 较晚的变动日志.PKGS; SMALLPKGS2 -= 较晚的变动日志.SMALLPKGS; MINPKGS2 -= 较晚的变动日志.MINPKGS; KGS2 -= 较晚的变动日志.KGS; CBM2 -= 较晚的变动日志.CBM; NETWEIGHT2 -= 较晚的变动日志.NETWEIGHT; STORAGEUNITCOUNT2 -= 较晚的变动日志.STORAGEUNITCOUNT; RULEUNITCOUNT2 -= 较晚的变动日志.RULEUNITCOUNT; PKGS3 -= 较晚的变动日志.PKGS; SMALLPKGS3 -= 较晚的变动日志.SMALLPKGS; MINPKGS3 -= 较晚的变动日志.MINPKGS; KGS3 -= 较晚的变动日志.KGS; CBM3 -= 较晚的变动日志.CBM; NETWEIGHT3 -= 较晚的变动日志.NETWEIGHT; STORAGEUNITCOUNT3 -= 较晚的变动日志.STORAGEUNITCOUNT; RULEUNITCOUNT3 -= 较晚的变动日志.RULEUNITCOUNT; } } public partial class Op_Wms_Physics_Change : BaseEntity { /// /// 入库或货转入 /// /// public void setNew(VW_OP_WMS_IN_DO_GOODS ingoods) { KGS2 = 0; NETWEIGHT2 = 0; CBM2 = 0; PKGS2 = 0; SMALLPKGS2 = 0; MINPKGS2 = 0; KINDPKGS2 = ""; STORAGEUNIT2 = ""; STORAGEUNITCOUNT2 = 0; RULEUNIT2 = ""; RULEUNITCOUNT2 = 0; STOREHOUSE2 = ingoods.STOREHOUSE; AREACODE2 = ingoods.AREACODE; KGS3 = KGS; NETWEIGHT3 = NETWEIGHT; CBM3 = CBM; PKGS3 = PKGS; SMALLPKGS3 = SMALLPKGS; MINPKGS3 = MINPKGS; KINDPKGS3 = KINDPKGS; STOREHOUSE3 = STOREHOUSE; AREACODE3 = AREACODE; STORAGEUNIT3 = STORAGEUNIT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT; RULEUNIT3 = RULEUNIT; RULEUNITCOUNT3 = RULEUNITCOUNT; DOBSNO = ingoods.WMSDOID.ToString(); DOGID = ingoods.WMSDODETAILID.ToString(); CHANGETYPE = WMSCHANGTYPE.入库; } public void setNew(OP_WMS_IN_DO_GOODS ingoods) { KGS2 = 0; NETWEIGHT2 = 0; CBM2 = 0; PKGS2 = 0; SMALLPKGS2 = 0; MINPKGS2 = 0; KINDPKGS2 = ""; STORAGEUNIT2 = ""; STORAGEUNITCOUNT2 = 0; RULEUNIT2 = ""; RULEUNITCOUNT2 = 0; STOREHOUSE2 = ingoods.STOREHOUSE; AREACODE2 = ingoods.AREACODE; KGS3 = KGS; NETWEIGHT3 = NETWEIGHT; CBM3 = CBM; PKGS3 = PKGS; SMALLPKGS3 = SMALLPKGS; MINPKGS3 = MINPKGS; KINDPKGS3 = KINDPKGS; STOREHOUSE3 = STOREHOUSE; AREACODE3 = AREACODE; STORAGEUNIT3 = STORAGEUNIT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT; RULEUNIT3 = RULEUNIT; RULEUNITCOUNT3 = RULEUNITCOUNT; DOBSNO = ingoods.WMSDOID.ToString(); DOGID = ingoods.WMSDODETAILID.ToString(); CHANGETYPE = WMSCHANGTYPE.入库; } /// /// 移库产生的新建 /// /// //public void setNew(ref OP_WMS_PHYSICS 新物理库存, VW_OP_WMS_MOVE 移库) //{ // 新物理库存.WMSPHYSICSID = Guid.NewGuid(); // 新物理库存.AREACODE = 移库.AREACODE_NEW; // 新物理库存.STOREHOUSE = 移库.STOREHOUSE_NEW; // WMSID = 新物理库存.WMSID; // WMSPHYSICSID = 新物理库存.WMSPHYSICSID; // WMSPHYSICS_LOGID = Guid.NewGuid(); // DOBSNO = 移库.WMSDOID.ToString(); // DOGID = 移库.WMSDOID.ToString(); // CHANGETYPE = WMSCHANGTYPE.移库_移入; // DODATE = 移库.DODATE; // KGS = 新物理库存.KGS; // NETWEIGHT = 新物理库存.NETWEIGHT; // CBM = 新物理库存.CBM; // PKGS = 新物理库存.PKGS; // KINDPKGS = 新物理库存.KINDPKGS; // STOREHOUSE = 新物理库存.STOREHOUSE; // AREACODE = 新物理库存.AREACODE; // STORAGEUNIT = 新物理库存.STORAGEUNIT; // STORAGEUNITCOUNT = 新物理库存.STORAGEUNITCOUNT; // RULEUNIT = 新物理库存.RULEUNIT; // RULEUNITCOUNT = 新物理库存.RULEUNITCOUNT; // KGS2 = 0; // NETWEIGHT2 = 0; // CBM2 = 0; // PKGS2 = 0; // KINDPKGS2 = ""; // STORAGEUNIT2 = ""; // STORAGEUNITCOUNT2 = 0; // RULEUNIT2 = ""; // RULEUNITCOUNT2 = 0; // STOREHOUSE2 = 移库.STOREHOUSE;//原仓库 // AREACODE2 = 移库.AREACODE; // KGS3 = KGS; // NETWEIGHT3 = NETWEIGHT; // CBM3 = CBM; // PKGS3 = PKGS; // KINDPKGS3 = KINDPKGS; // STOREHOUSE3 = STOREHOUSE; // AREACODE3 = AREACODE; // STORAGEUNIT3 = STORAGEUNIT; // STORAGEUNITCOUNT3 = STORAGEUNITCOUNT; // RULEUNIT3 = RULEUNIT; // RULEUNITCOUNT3 = RULEUNITCOUNT; //} /// /// 货转产生的入库变动 /// /// /// /// public void setNew(OP_WMS_PHYSICS _new, OP_WMS_TRANSFERGOODS 货转, OP_WMS_PHYSICS_DODETAIL 货转的物理执行) { WMSID = _new.WMSID; WMSPHYSICSID = _new.WMSPHYSICSID; DOBSNO = 货转.WMSTRANSFERGOODSID.ToString(); DOGID = 货转的物理执行.DODETAILID.ToString(); CHANGETYPE = WMSCHANGTYPE.货转入库; DODATE = 货转.TRANSFERDATE; KINDPKGS = 货转的物理执行.KINDPKGS; KINDPKGS3 = 货转的物理执行.KINDPKGS; KGS = _new.KGS; NETWEIGHT = _new.NETWEIGHT; CBM = _new.CBM; PKGS = _new.PKGS; SMALLPKGS = _new.SMALLPKGS; MINPKGS = _new.MINPKGS; KINDPKGS = _new.KINDPKGS; STORAGEUNIT = _new.STORAGEUNIT; STORAGEUNITCOUNT = _new.STORAGEUNITCOUNT; RULEUNIT = _new.RULEUNIT; RULEUNITCOUNT = _new.RULEUNITCOUNT; STOREHOUSE = _new.STOREHOUSE; AREACODE = _new.AREACODE; KGS2 = 0; NETWEIGHT2 = 0; CBM2 = 0; PKGS2 = 0; SMALLPKGS2 = 0; MINPKGS2 = 0; KINDPKGS2 = ""; STORAGEUNIT2 = ""; STORAGEUNITCOUNT2 = 0; RULEUNIT2 = ""; RULEUNITCOUNT2 = 0; STOREHOUSE2 = _new.STOREHOUSE; AREACODE2 = _new.AREACODE; KGS3 = KGS; NETWEIGHT3 = NETWEIGHT; CBM3 = CBM; PKGS3 = PKGS; SMALLPKGS3 = SMALLPKGS; MINPKGS3 = MINPKGS; KINDPKGS3 = KINDPKGS; STOREHOUSE3 = STOREHOUSE; AREACODE3 = AREACODE; STORAGEUNIT3 = STORAGEUNIT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT; RULEUNIT3 = RULEUNIT; RULEUNITCOUNT3 = RULEUNITCOUNT; } /// /// 库存增加 /// /// public void setAdd(VW_OP_WMS_IN_DO_GOODS ingoods) { } private bool ThisPhysicsEnough(OP_WMS_PHYSICS_DODETAIL 货转的物理执行明细, OP_WMS_PHYSICS 物理库存) { if (货转的物理执行明细.KGS <= 物理库存.KGS && 货转的物理执行明细.CBM <= 物理库存.CBM && 货转的物理执行明细.PKGS <= 物理库存.PKGS) { return true; } return false; } private void 引用物理库存(OP_WMS_PHYSICS 原物理库存) { WMSPHYSICSID = 原物理库存.WMSPHYSICSID; WMSID = 原物理库存.WMSID; STOREHOUSE = 原物理库存.STOREHOUSE; STOREHOUSE3 = 原物理库存.STOREHOUSE; AREACODE = 原物理库存.AREACODE; AREACODE3 = 原物理库存.AREACODE; RULEUNIT = 原物理库存.RULEUNIT; STORAGEUNIT = 原物理库存.STORAGEUNIT; RULEUNIT2 = RULEUNIT; STORAGEUNIT2 = STORAGEUNIT; RULEUNIT3 = RULEUNIT; STORAGEUNIT3 = STORAGEUNIT; KGS2 = 原物理库存.KGS; CBM2 = 原物理库存.CBM; PKGS2 = 原物理库存.PKGS; SMALLPKGS2 = 原物理库存.SMALLPKGS; MINPKGS2 = 原物理库存.MINPKGS; NETWEIGHT2 = 原物理库存.NETWEIGHT; STORAGEUNITCOUNT2 = 原物理库存.STORAGEUNITCOUNT; RULEUNITCOUNT2 = 原物理库存.RULEUNITCOUNT; } /// /// 物理库存减少 货转 /// /// public void setOut(ref OP_WMS_PHYSICS 原物理库存, OP_WMS_PHYSICS_DODETAIL 货转的物理执行明细) { 引用物理库存(原物理库存); WMSPHYSICS_LOGID = Guid.NewGuid(); DOBSNO = 货转的物理执行明细.WMSDOID.ToString(); DOGID = 货转的物理执行明细.DODETAILID.ToString(); CHANGETYPE = WMSCHANGTYPE.货转出库; if (ThisPhysicsEnough(货转的物理执行明细, 原物理库存)) { KGS = -货转的物理执行明细.KGS; NETWEIGHT = -货转的物理执行明细.NETWEIGHT; CBM = -货转的物理执行明细.CBM; PKGS = -货转的物理执行明细.PKGS; SMALLPKGS = -货转的物理执行明细.SMALLPKGS; MINPKGS = -货转的物理执行明细.MINPKGS; STORAGEUNITCOUNT = -货转的物理执行明细.STORAGEUNITCOUNT; RULEUNITCOUNT = -货转的物理执行明细.RULEUNITCOUNT; } else { KGS = -原物理库存.KGS; NETWEIGHT = -原物理库存.NETWEIGHT; CBM = -原物理库存.CBM; PKGS = -原物理库存.PKGS; SMALLPKGS = -原物理库存.SMALLPKGS; MINPKGS = -原物理库存.MINPKGS; STORAGEUNITCOUNT = -原物理库存.STORAGEUNITCOUNT; RULEUNITCOUNT = -原物理库存.RULEUNITCOUNT; } if (ThisPhysicsEnough(货转的物理执行明细, 原物理库存)) { 原物理库存.KGS = 原物理库存.KGS - 货转的物理执行明细.KGS; 原物理库存.NETWEIGHT = 原物理库存.NETWEIGHT - 货转的物理执行明细.NETWEIGHT; 原物理库存.CBM = 原物理库存.CBM - 货转的物理执行明细.CBM; 原物理库存.PKGS = 原物理库存.PKGS - 货转的物理执行明细.PKGS; 原物理库存.SMALLPKGS = 原物理库存.SMALLPKGS - 货转的物理执行明细.SMALLPKGS; 原物理库存.MINPKGS = 原物理库存.MINPKGS - 货转的物理执行明细.MINPKGS; 原物理库存.STORAGEUNITCOUNT = 原物理库存.STORAGEUNITCOUNT - 货转的物理执行明细.STORAGEUNITCOUNT; 原物理库存.RULEUNITCOUNT = 原物理库存.RULEUNITCOUNT - 货转的物理执行明细.RULEUNITCOUNT; } else { 原物理库存.KGS = 0; 原物理库存.NETWEIGHT = 0; 原物理库存.CBM = 0; 原物理库存.PKGS = 0; 原物理库存.SMALLPKGS = 0; 原物理库存.MINPKGS = 0; 原物理库存.STORAGEUNITCOUNT = 0; 原物理库存.RULEUNITCOUNT = 0; } KGS3 = 原物理库存.KGS; NETWEIGHT3 = 原物理库存.NETWEIGHT; CBM3 = 原物理库存.CBM; PKGS3 = 原物理库存.PKGS; SMALLPKGS3 = 原物理库存.SMALLPKGS; MINPKGS3 = 原物理库存.MINPKGS; STORAGEUNITCOUNT3 = 原物理库存.STORAGEUNITCOUNT; RULEUNITCOUNT3 = 原物理库存.RULEUNITCOUNT; STOREHOUSE2 = 原物理库存.STOREHOUSE; AREACODE2 = 原物理库存.AREACODE; } /// /// 物理库存减少 移库 /// /// /// public void setOut(ref OP_WMS_PHYSICS 原物理库存,OP_WMS_MOVE 移库, OP_WMS_MOVE_DETAIL 移库明细) { WMSPHYSICS_LOGID = Guid.NewGuid(); 引用物理库存(原物理库存); DOBSNO = 移库.WMSDOID.ToString(); DOGID = 移库明细.WMSMOVEDETAILID.ToString(); CHANGETYPE = WMSCHANGTYPE.移库_移出; DODATE = 移库.DODATE; KGS = -移库明细.KGS; NETWEIGHT = -移库明细.NETWEIGHT; CBM = -移库明细.CBM; PKGS = -移库明细.PKGS; SMALLPKGS = -移库明细.SMALLPKGS; MINPKGS = -移库明细.MINPKGS; STORAGEUNITCOUNT = -移库明细.STORAGEUNITCOUNT; RULEUNITCOUNT = -移库明细.RULEUNITCOUNT; KGS2 = 原物理库存.KGS; NETWEIGHT2 = 原物理库存.NETWEIGHT; CBM2 = 原物理库存.CBM; PKGS2 = 原物理库存.PKGS; SMALLPKGS2 = 原物理库存.SMALLPKGS; MINPKGS2 = 原物理库存.MINPKGS; STORAGEUNITCOUNT2 = 原物理库存.STORAGEUNITCOUNT; RULEUNITCOUNT2 = 原物理库存.RULEUNITCOUNT; 原物理库存.KGS += KGS; 原物理库存.NETWEIGHT += NETWEIGHT; 原物理库存.CBM += CBM; 原物理库存.PKGS += PKGS; 原物理库存.SMALLPKGS += SMALLPKGS; 原物理库存.MINPKGS += MINPKGS; 原物理库存.STORAGEUNITCOUNT += STORAGEUNITCOUNT; 原物理库存.RULEUNITCOUNT += RULEUNITCOUNT; KGS3 = 原物理库存.KGS; NETWEIGHT3 = 原物理库存.NETWEIGHT; CBM3 = 原物理库存.CBM ; PKGS3 = 原物理库存.PKGS ; SMALLPKGS3 = 原物理库存.SMALLPKGS; MINPKGS3 = 原物理库存.MINPKGS; STORAGEUNITCOUNT3 = 原物理库存.STORAGEUNITCOUNT ; RULEUNITCOUNT3 = 原物理库存.RULEUNITCOUNT ; STOREHOUSE2 = STOREHOUSE; AREACODE2 = AREACODE; STOREHOUSE3 = STOREHOUSE; AREACODE3 = AREACODE; } /// /// 库存增加 移库 /// /// /// public void setIn( OP_WMS_PHYSICS 原物理库存,ref OP_WMS_PHYSICS 新物理库存, OP_WMS_MOVE 移库, OP_WMS_MOVE_DETAIL 移库明细) { WMSPHYSICS_LOGID = Guid.NewGuid(); 新物理库存.WMSPHYSICSID= Guid.NewGuid(); WMSPHYSICSID = 新物理库存.WMSPHYSICSID; 新物理库存.STOREHOUSE = 移库明细.STOREHOUSE_NEW; 新物理库存.AREACODE = 移库明细.AREACODE_NEW; DODATE = 移库.DODATE; DOBSNO = 移库.WMSDOID.ToString(); DOGID = 移库明细.WMSMOVEDETAILID.ToString(); WMSID = 新物理库存.WMSID; CHANGETYPE = WMSCHANGTYPE.移库_移入; STOREHOUSE = 新物理库存.STOREHOUSE; STOREHOUSE2 = 原物理库存.STOREHOUSE; STOREHOUSE3 = 新物理库存.STOREHOUSE; AREACODE = 新物理库存.AREACODE; AREACODE2 = 原物理库存.AREACODE; AREACODE3 = 新物理库存.AREACODE; STORAGEUNIT = 原物理库存.STORAGEUNIT; RULEUNIT = 原物理库存.RULEUNIT; STORAGEUNIT2 = 原物理库存.STORAGEUNIT; RULEUNIT2 = 原物理库存.RULEUNIT; STORAGEUNIT3 = 原物理库存.STORAGEUNIT; RULEUNIT3 = 原物理库存.RULEUNIT; KGS = 移库明细.KGS; NETWEIGHT = 移库明细.NETWEIGHT; CBM = 移库明细.CBM; PKGS = 移库明细.PKGS; SMALLPKGS = 移库明细.SMALLPKGS; MINPKGS = 移库明细.MINPKGS; STORAGEUNITCOUNT = 移库明细.STORAGEUNITCOUNT; RULEUNITCOUNT = 移库明细.RULEUNITCOUNT; //原值应均为0 KGS2 = 0; NETWEIGHT2 = 0; CBM2 = 0; PKGS2 = 0; SMALLPKGS2 = 0; MINPKGS2 = 0; STORAGEUNITCOUNT2 = 0; RULEUNITCOUNT2 = 0; //KGS2 = 0; //NETWEIGHT2 = 0; //CBM2 = 0; //PKGS2 = 0; //STORAGEUNITCOUNT2 = 0; //RULEUNITCOUNT2 = 0; KGS3 = 新物理库存.KGS; NETWEIGHT3 = 新物理库存.NETWEIGHT; CBM3 = 新物理库存.CBM; PKGS3 = 新物理库存.PKGS; SMALLPKGS3 = 新物理库存.SMALLPKGS; MINPKGS3 = 新物理库存.MINPKGS; STORAGEUNITCOUNT3 = 新物理库存.STORAGEUNITCOUNT; RULEUNITCOUNT3 = 新物理库存.RULEUNITCOUNT; } /// /// 货转出库_取消 向原库存内添加执行数量 /// /// /// public void setUnOut(ref OP_WMS_PHYSICS wms, OP_WMS_PHYSICS 需要撤销的货转产生的新物理库存,OP_WMS_PHYSICS_DODETAIL 需要撤销的货转的物理执行明细) { CHANGETYPE = WMSCHANGTYPE.货转入库; WMSID = wms.WMSID; WMSPHYSICSID = wms.WMSPHYSICSID; STOREHOUSE = wms.STOREHOUSE; AREACODE = wms.AREACODE; DOBSNO = 需要撤销的货转的物理执行明细.WMSDOID.ToString(); DOGID = 需要撤销的货转的物理执行明细.DODETAILID.ToString(); KGS = 需要撤销的货转产生的新物理库存.KGS; NETWEIGHT = 需要撤销的货转产生的新物理库存.NETWEIGHT; CBM = 需要撤销的货转产生的新物理库存.CBM; PKGS = 需要撤销的货转产生的新物理库存.PKGS; SMALLPKGS = 需要撤销的货转产生的新物理库存.SMALLPKGS; MINPKGS = 需要撤销的货转产生的新物理库存.MINPKGS; KINDPKGS = 需要撤销的货转产生的新物理库存.KINDPKGS; //PAYEDTAXES2 = false; STORAGEUNIT = 需要撤销的货转产生的新物理库存.STORAGEUNIT; STORAGEUNITCOUNT = 需要撤销的货转产生的新物理库存.STORAGEUNITCOUNT; RULEUNIT = 需要撤销的货转产生的新物理库存.RULEUNIT; RULEUNITCOUNT = 需要撤销的货转产生的新物理库存.RULEUNITCOUNT; STOREHOUSE = 需要撤销的货转产生的新物理库存.STOREHOUSE; AREACODE = 需要撤销的货转产生的新物理库存.AREACODE; AREACODE2 = AREACODE; AREACODE3 = AREACODE; STOREHOUSE2 = STOREHOUSE; STOREHOUSE3 = STOREHOUSE; KGS2 = wms.KGS; NETWEIGHT2 = wms.NETWEIGHT; CBM2 = wms.CBM; PKGS2 = wms.PKGS; SMALLPKGS2 = wms.SMALLPKGS; MINPKGS2 = wms.MINPKGS; KINDPKGS2 = wms.KINDPKGS; STORAGEUNIT2 = wms.STORAGEUNIT; STORAGEUNITCOUNT2 = wms.STORAGEUNITCOUNT; RULEUNIT2 = wms.RULEUNIT; RULEUNITCOUNT2 = wms.RULEUNITCOUNT; KGS3 = KGS2 + KGS; NETWEIGHT3 = NETWEIGHT2 + NETWEIGHT; CBM3 = CBM2 + CBM; PKGS3 = PKGS2 + PKGS; SMALLPKGS3 = SMALLPKGS2 + SMALLPKGS; MINPKGS3 = MINPKGS2 + MINPKGS; KINDPKGS3 = KINDPKGS; //PAYEDTAXES3 = false; STORAGEUNIT3 = STORAGEUNIT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT2 + STORAGEUNITCOUNT; RULEUNIT3 = RULEUNIT; RULEUNITCOUNT3 = RULEUNITCOUNT2 + RULEUNITCOUNT; wms.KGS = KGS3; wms.NETWEIGHT = NETWEIGHT3; wms.CBM = CBM3; wms.PKGS = PKGS3; wms.SMALLPKGS = SMALLPKGS3; wms.MINPKGS = MINPKGS3; wms.STORAGEUNITCOUNT = STORAGEUNITCOUNT3; wms.RULEUNITCOUNT = RULEUNITCOUNT3; } /// /// 货转出库_取消 移库后新的物理库存 /// /// /// public void setUnOut_New(OP_WMS_PHYSICS _new, OP_WMS_PHYSICS_DODETAIL 需要撤销的货转的物理执行明细, Op_Wms_Physics_Change 移库的物理变动明细) { DOBSNO = 需要撤销的货转的物理执行明细.WMSDOID.ToString(); DOGID = 需要撤销的货转的物理执行明细.DODETAILID.ToString(); CHANGETYPE = WMSCHANGTYPE.货转入库; STOREHOUSE = 移库的物理变动明细.STOREHOUSE; AREACODE = 移库的物理变动明细.AREACODE; AREACODE2 = AREACODE; AREACODE3 = AREACODE; STOREHOUSE2 = STOREHOUSE; STOREHOUSE3 = STOREHOUSE; KGS = _new.KGS; NETWEIGHT = _new.NETWEIGHT; CBM = _new.CBM; PKGS = _new.PKGS; SMALLPKGS = _new.SMALLPKGS; MINPKGS = _new.MINPKGS; KINDPKGS = _new.KINDPKGS; STORAGEUNIT = _new.STORAGEUNIT; STORAGEUNITCOUNT = _new.STORAGEUNITCOUNT; RULEUNIT = _new.RULEUNIT; RULEUNITCOUNT = _new.RULEUNITCOUNT; STOREHOUSE = _new.STOREHOUSE; AREACODE = _new.AREACODE; KGS2 = 0; NETWEIGHT2 = 0; CBM2 = 0; PKGS2 = 0; KINDPKGS2 = ""; STORAGEUNIT2 = ""; STORAGEUNITCOUNT2 = 0; RULEUNIT2 = ""; RULEUNITCOUNT2 = 0; STOREHOUSE2 = ""; AREACODE2 = ""; KGS3 = KGS; NETWEIGHT3 = NETWEIGHT; CBM3 = CBM; PKGS3 = PKGS; SMALLPKGS3 = SMALLPKGS; MINPKGS3 = MINPKGS; KINDPKGS3 = KINDPKGS; STOREHOUSE3 = STOREHOUSE; AREACODE3 = AREACODE; STORAGEUNIT3 = STORAGEUNIT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT; RULEUNIT3 = RULEUNIT; RULEUNITCOUNT3 = RULEUNITCOUNT; } public void setValue3() { PKGS3 = PKGS2 + PKGS; SMALLPKGS3 = SMALLPKGS2 + SMALLPKGS; MINPKGS3 = MINPKGS2 + MINPKGS; KGS3 = KGS2 + KGS; CBM3 = CBM2 + CBM; NETWEIGHT3 = NETWEIGHT2 + NETWEIGHT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT2 + STORAGEUNITCOUNT; RULEUNITCOUNT3 = RULEUNITCOUNT2 + RULEUNITCOUNT; } //20210819 但如果即将被删的这个是“出库”(也就是说,这票库存这天同时出现的多个库存变动当中 包含出库,则出库不被删除)则出库不删除,而将后面的出库合并至前面(变动前取原值,变动值相加,变动后重算)\ //20211216 //changetype=入库时 (合计变动值 合计变动后 变动前不变) //changetype=出库/货转出库 {变动前值取新旧两者最大值 变动后正常计算;变动类型变为出库/货转出库(计费时当日会使用变动前值作为计费数量)} //changetype=移库移出时 合计变动值 合计变动后 变动前不变 //changetype=货转转入/移库移入时 合计变动值 合计变动后 变动前不变 // public void 合并出库物理变动(Op_Wms_Physics_Change 新的变动日志) { PKGS += 新的变动日志.PKGS; SMALLPKGS += 新的变动日志.SMALLPKGS; MINPKGS += 新的变动日志.MINPKGS; KGS += 新的变动日志.KGS; CBM += 新的变动日志.CBM; NETWEIGHT += 新的变动日志.NETWEIGHT; STORAGEUNITCOUNT += 新的变动日志.STORAGEUNITCOUNT; RULEUNITCOUNT += 新的变动日志.RULEUNITCOUNT; //CHANGETYPE = 新的变动日志.CHANGETYPE; if (新的变动日志.CHANGETYPE == WMSCHANGTYPE.出库 || 新的变动日志.CHANGETYPE == WMSCHANGTYPE.货转出库) { PKGS3 = 新的变动日志.PKGS3 ; SMALLPKGS3 = 新的变动日志.SMALLPKGS3; MINPKGS3 = 新的变动日志.MINPKGS3; KGS3 = 新的变动日志.KGS3 ; CBM3 = 新的变动日志.CBM3 ; NETWEIGHT3 = 新的变动日志.NETWEIGHT3 ; STORAGEUNITCOUNT3 = 新的变动日志.STORAGEUNITCOUNT3 ; RULEUNITCOUNT3 = 新的变动日志.RULEUNITCOUNT3 ; CHANGETYPE = 新的变动日志.CHANGETYPE; if (新的变动日志.PKGS2 > PKGS2) PKGS2 = 新的变动日志.PKGS2; if (新的变动日志.SMALLPKGS2 > SMALLPKGS2) SMALLPKGS2 = 新的变动日志.SMALLPKGS2; if (新的变动日志.MINPKGS2 > MINPKGS2) MINPKGS2 = 新的变动日志.MINPKGS2; if (新的变动日志.KGS2 > KGS2) KGS2 = 新的变动日志.KGS2; if (新的变动日志.CBM2 > CBM2) CBM2 = 新的变动日志.CBM2; if (新的变动日志.NETWEIGHT2 > NETWEIGHT2) NETWEIGHT2 = 新的变动日志.NETWEIGHT2; if (新的变动日志.STORAGEUNITCOUNT2 > STORAGEUNITCOUNT2) STORAGEUNITCOUNT2 = 新的变动日志.STORAGEUNITCOUNT2; if (新的变动日志.RULEUNITCOUNT2 > RULEUNITCOUNT2) RULEUNITCOUNT2 = 新的变动日志.RULEUNITCOUNT2; } else { PKGS3 = PKGS2 + PKGS; SMALLPKGS3 = SMALLPKGS2 + SMALLPKGS; MINPKGS3 = MINPKGS2 + MINPKGS; KGS3 = KGS2 + KGS; CBM3 = CBM2 + CBM; NETWEIGHT3 = NETWEIGHT2 + NETWEIGHT; STORAGEUNITCOUNT3 = STORAGEUNITCOUNT2 + STORAGEUNITCOUNT; RULEUNITCOUNT3 = RULEUNITCOUNT2 + RULEUNITCOUNT; } } public void 较晚录入的物理变动更新变动前后值至当时状态(Op_Wms_Physics_Change 较晚的变动日志) { //通常变动值为负 PKGS2 -= 较晚的变动日志.PKGS; SMALLPKGS2 -= 较晚的变动日志.SMALLPKGS; MINPKGS2 -= 较晚的变动日志.MINPKGS; KGS2 -= 较晚的变动日志.KGS; CBM2 -= 较晚的变动日志.CBM; NETWEIGHT2 -= 较晚的变动日志.NETWEIGHT; STORAGEUNITCOUNT2 -= 较晚的变动日志.STORAGEUNITCOUNT; RULEUNITCOUNT2 -= 较晚的变动日志.RULEUNITCOUNT; PKGS3 -= 较晚的变动日志.PKGS; SMALLPKGS3 -= 较晚的变动日志.SMALLPKGS; MINPKGS3 -= 较晚的变动日志.MINPKGS; KGS3 -= 较晚的变动日志.KGS; CBM3 -= 较晚的变动日志.CBM; NETWEIGHT3 -= 较晚的变动日志.NETWEIGHT; STORAGEUNITCOUNT3 -= 较晚的变动日志.STORAGEUNITCOUNT; RULEUNITCOUNT3 = -较晚的变动日志.RULEUNITCOUNT; } } public partial class Vw_Op_Wms : BaseEntity { /// /// 如果 KGS CBM PKGS均为0 则将计费数量和申报数量也设为0 并将ISCLEAR置为true /// 否则将ISCLEAR置为false /// 20201124 同时将结束计费日期设为一个指定日期 (货转为仓储费截止日期,出库为出库日期) /// /// public bool isclear(DateTime EndDate) { if (KGS <= 0 && CBM <= 0 && PKGS <= 0 && STORAGEUNITCOUNT <= 0) { //STORAGEUNITCOUNT = 0; //RULEUNITCOUNT = 0; ISCLEAR = true; FEEENDDATE = EndDate; } else ISCLEAR = false; return (bool)ISCLEAR; } public void setsingle() { KGS_SINGLE = KGS / PKGS; CBM_SINGLE = CBM / PKGS; STORAGEUNITCOUNT_SINGLE = STORAGEUNITCOUNT / PKGS; RULEUNITCOUNT_SINGLE = RULEUNITCOUNT / PKGS; } /// /// 库存减少的反向操作 /// 用负变动值的库存变动明细 恢复库存数量 /// /// public void WmsUnReduce(Op_Wms_Change 库存变更item) { KGS += -库存变更item.KGS; NETWEIGHT += -库存变更item.NETWEIGHT; CBM += -库存变更item.CBM; PKGS += -库存变更item.PKGS; SMALLPKGS += -库存变更item.SMALLPKGS; MINPKGS += -库存变更item.MINPKGS; STORAGEUNITCOUNT += -库存变更item.STORAGEUNITCOUNT; RULEUNITCOUNT += -库存变更item.RULEUNITCOUNT; } } public partial class Vw_Op_Wms_Physics : BaseEntity { public void WmsPhysicsUnReduce(Op_Wms_Physics_Change 库存变更item) { KGS += -库存变更item.KGS; NETWEIGHT += -库存变更item.NETWEIGHT; CBM += -库存变更item.CBM; PKGS += -库存变更item.PKGS; SMALLPKGS += -库存变更item.SMALLPKGS; MINPKGS += -库存变更item.MINPKGS; STORAGEUNITCOUNT += -库存变更item.STORAGEUNITCOUNT; RULEUNITCOUNT += -库存变更item.RULEUNITCOUNT; } public bool isEmpty() { if (PKGS == 0 || STORAGEUNITCOUNT == 0) return true; return false; } } public partial class OP_WMS : BaseEntity { /// /// 如果 KGS CBM PKGS均为0 则将计费数量和申报数量也设为0 并将ISCLEAR置为true /// 否则将ISCLEAR置为false /// 20201124 同时将结束计费日期设为一个指定日期 (货转为仓储费截止日期,出库为出库日期) /// /// public bool isclear(DateTime EndDate) { if (KGS == 0 && CBM == 0 && PKGS == 0) { STORAGEUNITCOUNT = 0; RULEUNITCOUNT = 0; ISCLEAR = true; FEEENDDATE = EndDate; } else ISCLEAR = false; return (bool)ISCLEAR; } public void setsingle() { KGS_SINGLE = Decimal.Round((Decimal)KGS / (Decimal)PKGS,3); CBM_SINGLE = Decimal.Round((Decimal)CBM / (Decimal)PKGS, 3); STORAGEUNITCOUNT_SINGLE = Decimal.Round((Decimal)STORAGEUNITCOUNT / (Decimal)PKGS, 6); RULEUNITCOUNT_SINGLE = Decimal.Round((Decimal)RULEUNITCOUNT / (Decimal)PKGS, 3); } } public partial class OP_WMS_PHYSICS : BaseEntity { public void setsingle() { if (PKGS != null && PKGS > 0) { KGS_SINGLE = KGS / PKGS; CBM_SINGLE = CBM / PKGS; STORAGEUNITCOUNT_SINGLE = STORAGEUNITCOUNT / PKGS; RULEUNITCOUNT_SINGLE = RULEUNITCOUNT / PKGS; } else { KGS_SINGLE = KGS ; CBM_SINGLE = CBM ; STORAGEUNITCOUNT_SINGLE = STORAGEUNITCOUNT ; RULEUNITCOUNT_SINGLE = RULEUNITCOUNT ; } } } /// /// 用于组织分类监管数据的xml对象 /// /// public class 分类监管类 { public class XMLObject { public string APP_CODE { get; set; } public string APP_STEP_ID { get; set; } public string CLASS_NAME { get; set; } public string CLASS_VER { get; set; } public string FILE_DATE_TIME { get; set; } public string FILE_GERATER { get; set; } public string FILE_ORDER { get; set; } public string FILE_ORIGINAL_NAME { get; set; } public string FILE_SIZE { get; set; } public SDEPORT_DATA SDEPORT_DATA { get; set; } public XMLObject() { SDEPORT_DATA = new SDEPORT_DATA(); SDEPORT_DATA.StockRecordMessage = new StockRecordMessage(); } } public class SDEPORT_DATA { public StockRecordMessage StockRecordMessage { get; set; } } public class StockRecordMessage { public string TradeCode { get; set; } public string TradeName { get; set; } public string ApplyDate { get; set; } } public class StockInfo { public string EmsNo { get; set; } public string EmsSeqNo { get; set; } public string WmsMtsNo { get; set; } public string GoodsMtsNo { get; set; } public string CodeTs { get; set; } public string GoodsName { get; set; } public string WmsDclUnit { get; set; } public string WmsDclQty { get; set; } public string WmsLawUnit { get; set; } public string WmsLawQty { get; set; } public string PlaceIds { get; set; } public string LocationIds { get; set; } public string StockStatus { get; set; } public string GoodsType { get; set; } } } public partial class OP_WMS_REPORT_TIMEZONES_DETAIL { public OP_WMS_REPORT_TIMEZONES_DETAIL() { PKGS = 0; KGS = 0; CBM = 0; NETWEIGHT = 0; STORAGEUNITCOUNT = 0; RULEUNITCOUNT = 0; PKGS2_1 = 0; KGS2_1 = 0; CBM2_1 = 0; NETWEIGHT2_1 = 0; STORAGEUNITCOUNT2_1 = 0; RULEUNITCOUNT2_1 = 0; PKGS2_2 = 0; KGS2_2 = 0; CBM2_2 = 0; NETWEIGHT2_2 = 0; STORAGEUNITCOUNT2_2 = 0; RULEUNITCOUNT2_2 = 0; PKGS3 = 0; KGS3 = 0; CBM3 = 0; NETWEIGHT3 = 0; STORAGEUNITCOUNT3 = 0; RULEUNITCOUNT3 = 0; } } public partial class OP_WMS_TRANSFERGOODS { private DateTime _旧业务费用结束日期() { if (TRANSFERDATE>STOREHOUSEENDDATE) { //2.如果货转使用新费率,则采用费率开始日期的前一天 NEWFEERATEDATE -1 return ((DateTime)STOREHOUSEENDDATE); } else { return ((DateTime)TRANSFERDATE).AddDays(-1); } } /// /// 货转业务中 旧业务的费用结束日期是货转日期的前一天(执行isclear时如为空 才真的设定) /// public DateTime OldWmsFeeEndDate { get{ return _旧业务费用结束日期(); } } public DateTime NewWmsFeeStartDate { get { return _旧业务费用结束日期().AddDays(1); } } } public partial class OP_WMS_FEECALENDAR { public OP_WMS_FEECALENDAR(){} public OP_WMS_FEECALENDAR(Guid WMSDUIID, Guid WMSID, string CUSTOMERNAME, DateTime DODATE, decimal STORAGEUNITCOUNT, decimal PRICE) { FEECALENDARID = Guid.NewGuid(); this.WMSDUIID = WMSDUIID; this.WMSID = WMSID; this.CUSTOMERNAME = CUSTOMERNAME; this.FEEDATE = DODATE; this.QUANTITY = STORAGEUNITCOUNT; this.PRICE = PRICE; AMOUNT = QUANTITY * PRICE; } } }