using System; using HcUtility.Core; using Newtonsoft.Json; using System.Collections.Generic; namespace DSWeb.WMS.Models.WMS { [JsonObject]//押箱业务 头表 public class WMS_DOmb : ModelObjectBillHead { public override Dictionary GetPKey() {//用于给扩展的动态数据提供主键字段名 var d = new Dictionary() { { "GID", ModelDBOprationType.All } }; return d; } public Dictionary SaveDic = new Dictionary(); public static string getSQL() { return " select GID,YXNO,CUSTOMERNAME "+ " ,dbo.trimdate(YXDATE) YXDATE" + " ,dbo.trimdate(PATMENTDATE_EX) PATMENTDATE_EX"+ " ,YXSTATE,isnull(YXMONEY, 0) YXMONEY,dbo.trimtime(CREATETIME) CREATETIME,CREATEUSER,AUDITOR,dbo.trimtime(AUDITTIME) AUDITTIME" + " ,PAYMENTTYPE,dbo.trimdate(PAYMENTDATE) PAYMENTDATE,PAYMENTBANK,PAYMENTFINANCESOFTCODE,PAYMENTREMARK,RETURNTYPE" + " ,dbo.trimdate(RETURNDATE) RETURNDATE,isnull(RETURNMONEY, 0) RETURNMONEY,RETURNBANK,RETURNFINANCESOFTCODE,RETURNREMARK" + " ,isnull(SPENDMONEY, 0) SPENDMONEY,COMPANYID,DEPTID" + " ,convert(bigint, TimeMark) as TIMEMARK" + " ,dbo.GetTaskStateNameBySTATEKEY(isnull(YXSTATE, 0)) YXSTATEREF" + " ,dbo.[GetUSER](CREATEUSER)CREATEUSERREF,dbo.[GetUSER](AUDITOR)AUDITORREF" + " ,(select NAME from company where GID = COMPANYID)COMPANYIDREF" + " ,(select DEPTNAME from SYS_DEPT where GID = DEPTID)DEPTIDREF" + " ,(select STLNAME from code_stlmode where STLCODE = PAYMENTTYPE)PAYMENTTYPEREF" + " ,(select STLNAME from code_stlmode where STLCODE = RETURNTYPE)RETURNTYPEREF" + " ,(select BANKNAME from SYS_BANK where GID = PAYMENTBANK)PAYMENTBANKREF" + " ,(select BANKNAME from SYS_BANK where GID = RETURNBANK)RETURNBANKREF" + " ,(select DESCRIPTION from info_client where shortname=customername)CUSTOMERFULLNAME" + " ,CUSTOMERBANK,(select account from info_client_bank where gid=CUSTOMERBANK) CUSTOMERACCOUNT" + " ,(select BANKNAME from info_client_bank where GID = CUSTOMERBANK)CUSTOMERBANKREF" + " from MsOp_YAXIANG where 1 = 1 "; } public void getDef(string USERID) { //将一个数据对象的有默认值的数据项 设置为默认 SetValue("TIMEMARK", "0"); //设置一些数字字段的默认值: setNoNullDef("BSSTATUS"); setNoNullDef("FEESTATUS"); setNoNullDef("CONTAINERDAYS"); setNoNullDef("PORTLOADSTORAGEPERIOD"); setNoNullDef("FBPPORTLOAD"); setNoNullDef("VIA_STORAGEPERIOD"); setNoNullDef("VIA2_STORAGEPERIOD"); setNoNullDef("VIA3_STORAGEPERIOD"); setNoNullDef("PAYMENTTYPE","7"); setNoNullDef("RETURNTYPE", "7"); setNoNullDef("ACCDATE", DateTime.Now.ToString("yyyy-MM")); } public WMS_DOmb() { TableName = "Op_WMS_IN_PLAN"; } public override string GetBillNoFieldName() { return "BSNO"; } public override string GetTimeMarkFieldName() { return "TIMEMARK"; } public override string GetStateFieldName() { return "OPSTATE"; } } [JsonObject]//押箱业务 明细表 public class WMS_DO_GOODSmb : ModelObjectBillBody { public override Dictionary GetPKey() {//用于给扩展的动态数据提供主键字段名 var d = new Dictionary() { { "GID", ModelDBOprationType.All } }; return d; } public Dictionary SaveDic = new Dictionary(); public static string getSQL() { return " select D.[GID],D.[YXNO],D.[SORT],D.[BSNO],D.[FIXFEE],D.[WASHFEE],D.[FWFEE]"+ " ,D.[OVERFEE],D.[LATEFEE],D.[TOTALFEE],D.[REMARK]" + " ,b.CUSTNO,b.MBLNO,b.CUSTOMERNAME,b.OP,b.SALE,b.CNTRTOTAL " + " from MsOp_YAXIANG_DETAIL D " + " left Join v_op_bill b on b.bsno = d.BSNO where 1=1 "; } public WMS_DO_GOODSmb() { TableName = "Op_WMS_IN_PLAN_GOODS"; } public WMS_DO_GOODSmb(string BSNO) { setDefault(); SetValue("BSNO", BSNO); TableName = "Op_WMS_IN_PLAN_GOODS"; } public void setDefault() { SetValue("GID", System.Guid.NewGuid().ToString()); //SetValue("FIXFEE","0"); //SetValue("WASHFEE", "0"); //SetValue("FWFEE", "0"); //SetValue("OVERFEE", "0"); //SetValue("LATEFEE", "0"); //SetValue("TOTALFEE", "0"); } public override string GetBillNoFieldName() { return "BSNO"; } public override string GetTimeMarkFieldName() { return ""; } } }