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.

123 lines
4.3 KiB
C#

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<string, ModelDBOprationType> GetPKey()
{//用于给扩展的动态数据提供主键字段名
var d = new Dictionary<string, ModelDBOprationType>() { { "GID", ModelDBOprationType.All } };
return d;
}
public Dictionary<string, string> SaveDic = new Dictionary<string, string>();
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 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<string, ModelDBOprationType> GetPKey()
{//用于给扩展的动态数据提供主键字段名
var d = new Dictionary<string, ModelDBOprationType>() { { "GID", ModelDBOprationType.All } };
return d;
}
public Dictionary<string, string> SaveDic = new Dictionary<string, string>();
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 "";
}
}
}