using System; using HcUtility.Core; using Newtonsoft.Json; using System.Collections.Generic; namespace DSWeb.MvcShipping.Models.MsOp_YAXIANG { [JsonObject]//押箱业务 头表 public class YXmb : 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" + " ,isnull(YXMONEY, 0)-isnull(RETURNMONEY, 0) WSHJE" + " 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 YXmb() { TableName = "MsOp_YAXIANG"; } public override string GetBillNoFieldName() { return "YXNO"; } public override string GetTimeMarkFieldName() { return "TIMEMARK"; } public override string GetStateFieldName() { return "YXSTATE"; } } [JsonObject]//押箱业务 明细表 public class YX_DETAILmb : 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 YX_DETAILmb() { TableName = "MsOp_YAXIANG_DETAIL"; } public YX_DETAILmb(string BSNO) { setDefault(); SetValue("BSNO", BSNO); TableName = "MsOp_YAXIANG_DETAIL"; } 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 "YXNO"; } public override string GetTimeMarkFieldName() { return ""; } } }