You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DSWMS/Vue.Net/VOL.Entity/DomainModels/WMS/partial/Op_Wms_Change.cs

1556 lines
56 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
*如果数据库字段发生变化请在代码生器重新生成此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<OP_YARD_CTNMNG> 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() { }
/// <summary>
/// 入库或货转入
/// </summary>
/// <param name="ingoods"></param>
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.;
}
/// <summary>
/// 货转产生新的库存
/// </summary>
/// <param name="wms"></param>
/// <param name="货转明细"></param>
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;
}
/// <summary>
/// 库存增加
/// </summary>
/// <param name="ingoods"></param>
public void setAdd(VW_OP_WMS_IN_DO_GOODS ingoods)
{
}
/// <summary>
/// 库存减少
/// </summary>
/// <param name="ingoods"></param>
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;
}
/// <summary>
/// 货转出库_取消 向原库存内添加执行数量
/// </summary>
/// <param name="wms"></param>
/// <param name="货转明细"></param>
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;
}
/// <summary>
/// 库存减少 移库并使用新费率
/// </summary>
/// <param name="原物理库存"></param>
/// <param name="移库"></param>
/// <param name="移库明细"></param>
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;
}
/// <summary>
/// 移库并使用新费率 产生新的库存
/// </summary>
/// <param name="wms"></param>
/// <param name="移库"></param>
/// <param name="移库明细"></param>
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
{
/// <summary>
/// 入库或货转入
/// </summary>
/// <param name="ingoods"></param>
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.;
}
/// <summary>
/// 移库产生的新建
/// </summary>
/// <param name="ingoods"></param>
//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;
//}
/// <summary>
/// 货转产生的入库变动
/// </summary>
/// <param name="_new"></param>
/// <param name="货转"></param>
/// <param name="货转的物理执行"></param>
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;
}
/// <summary>
/// 库存增加
/// </summary>
/// <param name="ingoods"></param>
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;
}
/// <summary>
/// 物理库存减少 货转
/// </summary>
/// <param name="ingoods"></param>
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;
}
/// <summary>
/// 物理库存减少 移库
/// </summary>
/// <param name="原物理库存"></param>
/// <param name="货转的物理执行明细"></param>
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;
}
/// <summary>
/// 库存增加 移库
/// </summary>
/// <param name="原物理库存"></param>
/// <param name="货转的物理执行明细"></param>
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;
}
/// <summary>
/// 货转出库_取消 向原库存内添加执行数量
/// </summary>
/// <param name="wms"></param>
/// <param name="货转明细"></param>
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;
}
/// <summary>
/// 货转出库_取消 移库后新的物理库存
/// </summary>
/// <param name="_new"></param>
/// <param name="需要撤销的货转的物理执行明细"></param>
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 {
/// <summary>
/// 如果 KGS CBM PKGS均为0 则将计费数量和申报数量也设为0 并将ISCLEAR置为true
/// 否则将ISCLEAR置为false
/// 20201124 同时将结束计费日期设为一个指定日期 (货转为仓储费截止日期,出库为出库日期)
/// </summary>
/// <returns></returns>
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;
}
/// <summary>
/// 库存减少的反向操作
/// 用负变动值的库存变动明细 恢复库存数量
/// </summary>
/// <param name="库存变更item"></param>
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
{
/// <summary>
/// 如果 KGS CBM PKGS均为0 则将计费数量和申报数量也设为0 并将ISCLEAR置为true
/// 否则将ISCLEAR置为false
/// 20201124 同时将结束计费日期设为一个指定日期 (货转为仓储费截止日期,出库为出库日期)
/// </summary>
/// <returns></returns>
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 ;
}
}
}
/// <summary>
/// 用于组织分类监管数据的xml对象
/// </summary>
///
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);
}
}
/// <summary>
/// 货转业务中 旧业务的费用结束日期是货转日期的前一天(执行isclear时如为空 才真的设定)
/// </summary>
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;
}
}
}