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.
667 lines
26 KiB
C#
667 lines
26 KiB
C#
using System;
|
|
using HcUtility.Core;
|
|
using Newtonsoft.Json;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using DSWeb.Areas.CommMng.DAL;
|
|
using HcUtility.Comm;
|
|
using DSWeb.EntityDA;
|
|
using DSWeb.MvcShipping.Models.MsCrmPriceCarrier;
|
|
using DSWeb.Areas.CommMng.Models;
|
|
|
|
namespace DSWeb.MvcShipping.Models.MsPrice
|
|
{
|
|
|
|
[JsonObject]//运价合约 头表
|
|
public class MsPrice_Contract_mb : ModelObjectBillHead
|
|
{
|
|
public override Dictionary<string, ModelDBOprationType> GetPKey()
|
|
{//用于给扩展的动态数据提供主键字段名
|
|
var d = new Dictionary<string, ModelDBOprationType>() { { "BSNO", ModelDBOprationType.All } };
|
|
|
|
return d;
|
|
}
|
|
|
|
public Dictionary<string, string> SaveDic = new Dictionary<string, string>();
|
|
|
|
private static string getBaseSql() {
|
|
return @" SELECT [BSNO],[CONTRACTNO],[CARRIER],dbo.trimdate([EFFECTIVEDATE]) EFFECTIVEDATE,dbo.trimdate([VALIDDATE]) VALIDDATE,dbo.F_ContractPODLOAD(bsno)[PORTLOADCOMMASTR],dbo.F_ContractPORTDISCHARGE(bsno)[PORTDISCHARGECOMMASTR],[dbo].[F_ContractVIA](bsno)[VIACOMMASTR],CREATOR,dbo.trimtime(CREATETIME) CREATETIME,REMARK,convert(bigint ,TIMEMARK)TIMEMARK"
|
|
+ " ,CSTATUS,dbo.GetTaskStateNameBySTATEKEY(isnull(CSTATUS, 0)) CSTATUSREF "
|
|
//+ " ,dbo.F_ContractPrice_CTN0(CONTRACTNO) CTN0PRICE,dbo.F_ContractPriceStr_CTN0(CONTRACTNO) CTN0PRICESTR "
|
|
//+ " ,dbo.F_ContractPrice_CTN1(CONTRACTNO) CTN1PRICE,dbo.F_ContractPriceStr_CTN1(CONTRACTNO) CTN1PRICESTR "
|
|
//+ " ,dbo.F_ContractPrice_CTN2(CONTRACTNO) CTN2PRICE,dbo.F_ContractPriceStr_CTN2(CONTRACTNO) CTN2PRICESTR "
|
|
//+ " ,dbo.F_ContractPrice_CTN3(CONTRACTNO) CTN3PRICE,dbo.F_ContractPriceStr_CTN3(CONTRACTNO) CTN3PRICESTR "
|
|
//+ " ,dbo.F_ContractPrice_CTN4(CONTRACTNO) CTN4PRICE,dbo.F_ContractPriceStr_CTN4(CONTRACTNO) CTN4PRICESTR "
|
|
+ " ,case when exists(select 1 from crm_price_carrier_2 where CONTRACTBSNO=bsno) then 1 else 0 end MadePrice"
|
|
+ " from Op_SeaPrice_Contract where 1 = 1 ";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取查询语句 含权限和分页
|
|
/// </summary>
|
|
/// <param name="start"></param>
|
|
/// <param name="limit"></param>
|
|
/// <param name="strCondition"></param>
|
|
/// <param name="sortstring"></param>
|
|
/// <returns></returns>
|
|
public string getSQL(int start, int limit, string strCondition, string userid, out int count, string sort = "")
|
|
{
|
|
var sortstring = "";
|
|
var rangestr = BasicDataRefDAL.GetRangeCondition(BasicDataRefDAL.RangeType.Visable,"modPrice_Contract", userid, GetCompanyFieldName(),new string[] { "CREATOR" });
|
|
|
|
var param = new BasicDataRefDAL.PagedQuaryParam();
|
|
param.strSql = getBaseSql();
|
|
param.strCondition = strCondition;
|
|
param.rangestr = rangestr;
|
|
if (!string.IsNullOrWhiteSpace(sort)) {
|
|
sortstring = DatasetSort.Getsortstring(sort);
|
|
}
|
|
param.sortstring = sortstring;
|
|
param.defaultsortstr = "VALIDDATE,EFFECTIVEDATE,CARRIER";
|
|
param.start = start;
|
|
param.limit = limit;
|
|
|
|
var result = BasicDataRefDAL.PagedQuaryStr(param);
|
|
count = BasicDataRefDAL.PagedCount(param);
|
|
|
|
return result.ToString();
|
|
}
|
|
|
|
public string getSQL_all(int start, int limit, string strCondition,string sortstring = "")
|
|
{
|
|
|
|
var param = new BasicDataRefDAL.PagedQuaryParam();
|
|
param.strSql = getBaseSql();
|
|
param.strCondition = strCondition;
|
|
param.rangestr = "";
|
|
param.sortstring = sortstring;
|
|
param.defaultsortstr = "VALIDDATE,EFFECTIVEDATE";
|
|
param.start = start;
|
|
param.limit = limit;
|
|
|
|
var result = BasicDataRefDAL.PagedQuaryStr(param);
|
|
|
|
return result.ToString();
|
|
}
|
|
|
|
public MsPrice_Contract_mb()
|
|
{
|
|
TableName = "Op_SeaPrice_Contract";
|
|
|
|
}
|
|
|
|
|
|
public void getDef(string USERID) {
|
|
//将一个数据对象的有默认值的数据项 设置为默认
|
|
var rangeDa = new RangeDA();
|
|
var CORPID = rangeDa.GetCORPID(USERID);
|
|
|
|
//var deflist = MsCodeOpDefDAL.getDefList("运价合约", CORPID);
|
|
//if (deflist.Count > 0) {
|
|
// foreach (var defitem in deflist) {
|
|
// SetValue(defitem.FIELDNAME, defitem.DEFVALUE);
|
|
// }
|
|
//}
|
|
SetValue("CSTATUS", "3100");
|
|
SetValue("TIMEMARK", "0");
|
|
|
|
|
|
//设置一些数字字段的默认值:
|
|
|
|
}
|
|
|
|
public override string GetBillNoFieldName()
|
|
{
|
|
return "BSNO";
|
|
}
|
|
|
|
public override string GetTimeMarkFieldName()
|
|
{
|
|
return "TIMEMARK";
|
|
}
|
|
|
|
}
|
|
|
|
[JsonObject]//运价合约 明细表
|
|
public class MsPrice_Contract_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()
|
|
{
|
|
var result = @" SELECT [GID],[BSNO],isnull([SEQUENCE],0)SEQUENCE,FEENAME,isnull(CTN0,0) CTN0,isnull(CTN1,0) CTN1,isnull(CTN2,0) CTN2,isnull(CTN3,0) CTN3,isnull(CTN4,0) CTN4,PODLOAD,PORTDISCHARGE,VIA,VIA2 from Op_SeaPrice_Contract_Detail where 1=1 ";
|
|
|
|
return result;
|
|
}
|
|
|
|
public MsPrice_Contract_Detailmb()
|
|
{
|
|
TableName = "Op_SeaPrice_Contract_Detail";
|
|
}
|
|
|
|
public MsPrice_Contract_Detailmb(string BSNO)
|
|
{
|
|
|
|
SetValue("BSNO", BSNO);
|
|
TableName = "Op_SeaPrice_Contract_Detail";
|
|
}
|
|
|
|
public override string GetBillNoFieldName()
|
|
{
|
|
return "BSNO";
|
|
}
|
|
|
|
public override string GetTimeMarkFieldName()
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
|
|
[JsonObject]//运价合约 运输路径表
|
|
public class MsPrice_Contract_Waymb : ModelObjectBillBody
|
|
{
|
|
public override Dictionary<string, ModelDBOprationType> GetPKey()
|
|
{//用于给扩展的动态数据提供主键字段名
|
|
var d = new Dictionary<string, ModelDBOprationType>() { { "ID", ModelDBOprationType.EditDelete } };
|
|
|
|
return d;
|
|
}
|
|
public Dictionary<string, string> SaveDic = new Dictionary<string, string>();
|
|
|
|
public static string getSQL()
|
|
{
|
|
var result = @" SELECT [ID],[BSNO],PODLOAD,PORTDISCHARGE,VIA,VIA2,ETD,isnull(TT,0) TT from Op_SeaPrice_Contract_Way where 1=1 ";
|
|
|
|
return result;
|
|
}
|
|
|
|
public MsPrice_Contract_Waymb()
|
|
{
|
|
TableName = "Op_SeaPrice_Contract_Way";
|
|
}
|
|
|
|
public MsPrice_Contract_Waymb(string BSNO)
|
|
{
|
|
|
|
SetValue("BSNO", BSNO);
|
|
TableName = "Op_SeaPrice_Contract_Way";
|
|
}
|
|
|
|
public override string GetBillNoFieldName()
|
|
{
|
|
return "BSNO";
|
|
}
|
|
|
|
public override string GetTimeMarkFieldName()
|
|
{
|
|
return "";
|
|
}
|
|
|
|
|
|
public bool issame(MsPrice_Contract_Detailmb detail) {
|
|
if (detail.GetValue("PODLOAD") == GetValue("PODLOAD") && detail.GetValue("PORTDISCHARGE") == GetValue("PORTDISCHARGE") && detail.GetValue("VIA") == GetValue("VIA") && detail.GetValue("VIA2") == GetValue("VIA2"))
|
|
{
|
|
return true;
|
|
}
|
|
else {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
[JsonObject]//报价 头表
|
|
public class MsQuotationmb : ModelObjectBillHead
|
|
{
|
|
public override Dictionary<string, ModelDBOprationType> GetPKey()
|
|
{//用于给扩展的动态数据提供主键字段名
|
|
var d = new Dictionary<string, ModelDBOprationType>() { { "BSNO", ModelDBOprationType.All } };
|
|
|
|
return d;
|
|
}
|
|
|
|
public Dictionary<string, string> SaveDic = new Dictionary<string, string>();
|
|
|
|
private static string getBaseSql()
|
|
{
|
|
return @" SELECT [BSNO],[CUSTOMERNAME],dbo.trimdate([EFFECTIVEDATE]) EFFECTIVEDATE,dbo.trimdate([VALIDDATE]) VALIDDATE,CREATOR,dbo.trimtime(CREATETIME) CREATETIME,REMARK,PDFURL,convert(bigint ,TIMEMARK)TIMEMARK" +
|
|
" from Op_SeaPrice_Quotation where 1 = 1 ";
|
|
}
|
|
|
|
private static string getSmallSql(string mblno)
|
|
{
|
|
return @" SELECT [BSNO],[CUSTOMERNAME],dbo.trimdate([EFFECTIVEDATE]) EFFECTIVEDATE,dbo.trimdate([VALIDDATE]) VALIDDATE,CREATOR,dbo.trimtime(CREATETIME) CREATETIME,REMARK,PDFURL,convert(bigint ,TIMEMARK)TIMEMARK " +
|
|
$" ,case when exists (select 1 from Op_SeaPrice_Quotation_MblnoList ml where ml.bsno=Op_SeaPrice_Quotation.BSNO and ml.MBLNO='{mblno}') then 1 else 0 end HAVEMBLNO" +
|
|
$" ,(select top 1 CREATOR from op_seaprice_quotation_mblnolist ml where ml.BSNO=Op_SeaPrice_Quotation.BSNO and ml.MBLNO='{mblno}') CONN_CREATOR" +
|
|
$" ,dbo.trimtime((select top 1 CREATETIME from op_seaprice_quotation_mblnolist ml where ml.BSNO=Op_SeaPrice_Quotation.BSNO and ml.MBLNO='{mblno}')) CONN_CREATETIME" +
|
|
" from Op_SeaPrice_Quotation where 1 = 1 ";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取查询语句 含权限和分页
|
|
/// </summary>
|
|
/// <param name="start"></param>
|
|
/// <param name="limit"></param>
|
|
/// <param name="strCondition"></param>
|
|
/// <param name="sortstring"></param>
|
|
/// <returns></returns>
|
|
public string getSQL(int start, int limit, string strCondition, string userid, string sortstring = "")
|
|
{
|
|
|
|
var rangestr = BasicDataRefDAL.GetRangeCondition(BasicDataRefDAL.RangeType.Visable, "modPrice_Quotation", userid, GetCompanyFieldName(), new string[] { "CREATOR" });
|
|
|
|
var param = new BasicDataRefDAL.PagedQuaryParam();
|
|
param.strSql = getBaseSql();
|
|
param.strCondition = strCondition;
|
|
param.rangestr = rangestr;
|
|
param.sortstring = sortstring;
|
|
param.defaultsortstr = "VALIDDATE";
|
|
param.start = start;
|
|
param.limit = limit;
|
|
|
|
var result = BasicDataRefDAL.PagedQuaryStr(param);
|
|
|
|
return result.ToString();
|
|
}
|
|
|
|
public string getSQL_all(int start, int limit, string strCondition, string sortstring = "")
|
|
{
|
|
|
|
var param = new BasicDataRefDAL.PagedQuaryParam();
|
|
param.strSql = getBaseSql();
|
|
param.strCondition = strCondition;
|
|
param.rangestr = "";
|
|
param.sortstring = sortstring;
|
|
param.defaultsortstr = "VALIDDATE";
|
|
param.start = start;
|
|
param.limit = limit;
|
|
|
|
var result = BasicDataRefDAL.PagedQuaryStr(param);
|
|
|
|
return result.ToString();
|
|
}
|
|
|
|
public string getSQL_Small(int start, int limit, string strCondition,string mblno, string userid, string sortstring = "")
|
|
{
|
|
|
|
var rangestr = BasicDataRefDAL.GetRangeCondition(BasicDataRefDAL.RangeType.Visable, "modPrice_Quotation", userid, GetCompanyFieldName(), new string[] { "CREATOR" });
|
|
|
|
var param = new BasicDataRefDAL.PagedQuaryParam();
|
|
param.strSql = getSmallSql(mblno);
|
|
param.strCondition = strCondition;
|
|
param.rangestr = rangestr;
|
|
param.sortstring = sortstring;
|
|
param.defaultsortstr = "CREATETIME DESC";
|
|
param.start = start;
|
|
param.limit = limit;
|
|
|
|
var result = BasicDataRefDAL.PagedQuaryStr(param);
|
|
|
|
return result.ToString();
|
|
}
|
|
|
|
|
|
public MsQuotationmb()
|
|
{
|
|
TableName = "Op_SeaPrice_Quotation";
|
|
|
|
}
|
|
|
|
public void getDef(string USERID)
|
|
{
|
|
//将一个数据对象的有默认值的数据项 设置为默认
|
|
//var rangeDa = new RangeDA();
|
|
//var CORPID = rangeDa.GetCORPID(USERID);
|
|
|
|
//var deflist = MsCodeOpDefDAL.getDefList("内贸管理", CORPID);
|
|
//if (deflist.Count > 0)
|
|
//{
|
|
// foreach (var defitem in deflist)
|
|
// {
|
|
// SetValue(defitem.FIELDNAME, defitem.DEFVALUE);
|
|
// }
|
|
//}
|
|
SetValue("TIMEMARK", "0");
|
|
|
|
|
|
//设置一些数字字段的默认值:
|
|
|
|
}
|
|
|
|
public override string GetBillNoFieldName()
|
|
{
|
|
return "BSNO";
|
|
}
|
|
|
|
public override string GetTimeMarkFieldName()
|
|
{
|
|
return "TIMEMARK";
|
|
}
|
|
|
|
}
|
|
|
|
[JsonObject]//报价 明细表
|
|
public class MsQuotation_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()
|
|
{
|
|
var result = @" SELECT [GID],[BSNO],[SEQUENCE],[LANE],[PODLOAD],[PORTDISCHARGE],[CARRIER],[VIA],[VIA2],[ETD],[TT],[EFFECTIVEDATE],[VALIDDATE],[COMMODITY],[REMARK],[INPUTBY],[INPUTTIME],[MODIFIEDUSER],[MODIFYTIME],[FEE0],[FEE1],[FEE2],[FEE3],[FEE4],[CTN00],[CTN10],[CTN20],[CTN30],[CTN40],[CTN50],[CTN60],[CTN70],[CTN80],[CTN90],[CTN01],[CTN11],[CTN21],[CTN31],[CTN41],[CTN51],[CTN61],[CTN71],[CTN81],[CTN91],[CTN02],[CTN12],[CTN22],[CTN32],[CTN42],[CTN52],[CTN62],[CTN72],[CTN82],[CTN92],[CTN03],[CTN13],[CTN23],[CTN33],[CTN43],[CTN53],[CTN63],[CTN73],[CTN83],[CTN93],[CTN04],[CTN14],[CTN24],[CTN34],[CTN44],[CTN54],[CTN64],[CTN74],[CTN84],[CTN94],[PORTDISCHARGEID],[CONTRACTNO],[CONTRACTBSNO], dbo.F_ContractPriceStr_CTN0(CONTRACTBSNO,PODLOAD,PORTDISCHARGEID,VIA,VIA2) CTN0PRICESTR, dbo.F_ContractPriceStr_CTN1(CONTRACTBSNO,PODLOAD,PORTDISCHARGEID,VIA,VIA2) CTN1PRICESTR, dbo.F_ContractPriceStr_CTN2(CONTRACTBSNO,PODLOAD,PORTDISCHARGEID,VIA,VIA2) CTN2PRICESTR, dbo.F_ContractPriceStr_CTN3(CONTRACTBSNO,PODLOAD,PORTDISCHARGEID,VIA,VIA2) CTN3PRICESTR, dbo.F_ContractPriceStr_CTN4(CONTRACTBSNO,PODLOAD,PORTDISCHARGEID,VIA,VIA2) CTN4PRICESTR,CTN0DETENTION,CTN1DETENTION,CTN2DETENTION,CTN3DETENTION,CTN4DETENTION FROM [dbo].[Op_SeaPrice_Quotation_Detail] where 1=1 ";
|
|
|
|
return result;
|
|
}
|
|
|
|
public static string getSQL(string condition ,string[] ctntype)
|
|
{
|
|
//[CTN02],[CTN12],[CTN22],[CTN32],[CTN42]
|
|
//分别代表5种柜型的报价
|
|
|
|
var ctninfoList = new List<string>();
|
|
|
|
foreach (var ctn in ctntype) {
|
|
|
|
if (ctn == "CTN02") {
|
|
ctninfoList.Add( ",'20GP' 报价类型,[CTN02] 报价,CTN0DETENTION 目的港免箱期 ");
|
|
}
|
|
if (ctn == "CTN12")
|
|
{
|
|
ctninfoList.Add(",'40GP' 报价类型,[CTN12] 报价,CTN1DETENTION 目的港免箱期 ");
|
|
}
|
|
if (ctn == "CTN22")
|
|
{
|
|
ctninfoList.Add(",'40HQ' 报价类型,[CTN22] 报价,CTN2DETENTION 目的港免箱期 ");
|
|
}
|
|
if (ctn == "CTN32")
|
|
{
|
|
ctninfoList.Add(",'20RF' 报价类型,[CTN32] 报价,CTN3DETENTION 目的港免箱期 ");
|
|
}
|
|
if (ctn == "CTN42")
|
|
{
|
|
ctninfoList.Add(",'40RF' 报价类型,[CTN42] 报价,CTN4DETENTION 目的港免箱期 ");
|
|
}
|
|
}
|
|
|
|
var result = "";
|
|
|
|
if (ctninfoList.Count == 0) return result;
|
|
|
|
var basestr = @" SELECT [GID],[BSNO],[SEQUENCE],[LANE],[PODLOAD],[PORTDISCHARGE],[CARRIER],[VIA],[VIA2],[ETD],[TT],[EFFECTIVEDATE],[VALIDDATE],[COMMODITY],[REMARK],[INPUTBY],[INPUTTIME],[MODIFIEDUSER],[MODIFYTIME],[FEE0],[FEE1],[FEE2],[FEE3],[FEE4],[CTN00],[CTN10],[CTN20],[CTN30],[CTN40],[CTN50],[CTN60],[CTN70],[CTN80],[CTN90],[CTN01],[CTN11],[CTN21],[CTN31],[CTN41],[CTN51],[CTN61],[CTN71],[CTN81],[CTN91],[CTN52],[CTN62],[CTN72],[CTN82],[CTN92],[CTN03],[CTN13],[CTN23],[CTN33],[CTN43],[CTN53],[CTN63],[CTN73],[CTN83],[CTN93],[CTN04],[CTN14],[CTN24],[CTN34],[CTN44],[CTN54],[CTN64],[CTN74],[CTN84],[CTN94],[PORTDISCHARGEID],[CONTRACTNO],[CONTRACTBSNO],dbo.F_ContractPriceStr_CTN0(CONTRACTBSNO,PODLOAD,PORTDISCHARGEID,VIA,VIA2) CTN0PRICESTR, dbo.F_ContractPriceStr_CTN1(CONTRACTBSNO,PODLOAD,PORTDISCHARGEID,VIA,VIA2) CTN1PRICESTR, dbo.F_ContractPriceStr_CTN2(CONTRACTBSNO,PODLOAD,PORTDISCHARGEID,VIA,VIA2) CTN2PRICESTR, dbo.F_ContractPriceStr_CTN3(CONTRACTBSNO,PODLOAD,PORTDISCHARGEID,VIA,VIA2) CTN3PRICESTR, dbo.F_ContractPriceStr_CTN4(CONTRACTBSNO,PODLOAD,PORTDISCHARGEID,VIA,VIA2) CTN4PRICESTR #### FROM [dbo].[Op_SeaPrice_Quotation_Detail] where 1=1 ";
|
|
|
|
foreach (var ctninfo in ctninfoList) {
|
|
if (result != "") result += " union all ";
|
|
result += basestr.Replace("####", ctninfo);
|
|
if (!string.IsNullOrWhiteSpace(condition)) result += condition;
|
|
}
|
|
|
|
//,[CTN02],[CTN12],[CTN22],[CTN32],[CTN42]
|
|
//, CTN0DETENTION,CTN1DETENTION,CTN2DETENTION,CTN3DETENTION,CTN4DETENTION
|
|
return result;
|
|
}
|
|
|
|
public MsQuotation_Detailmb()
|
|
{
|
|
TableName = "Op_SeaPrice_Quotation_Detail";
|
|
}
|
|
|
|
public MsQuotation_Detailmb(string BSNO)
|
|
{
|
|
SetValue("BSNO", BSNO);
|
|
TableName = "Op_SeaPrice_Quotation_Detail";
|
|
}
|
|
|
|
public override string GetBillNoFieldName()
|
|
{
|
|
return "BSNO";
|
|
}
|
|
|
|
public override string GetTimeMarkFieldName()
|
|
{
|
|
return "";
|
|
}
|
|
|
|
public void setCrmValue(MsCrmPriceCarrier.MsCrmPriceCarrier crmprice)
|
|
{
|
|
|
|
DbOperationType = DbOperationType.DbotIns;
|
|
|
|
SetValue("GID",Guid.NewGuid().ToString());
|
|
//SetValue("BSNO", "");
|
|
|
|
SetValue("LANE", crmprice.LANE);
|
|
SetValue("PODLOAD", crmprice.PODLOAD);
|
|
SetValue("PORTDISCHARGE", crmprice.PORTDISCHARGE);
|
|
SetValue("PORTDISCHARGEID", crmprice.PORTDISCHARGEID);
|
|
SetValue("CARRIER", crmprice.CARRIER);
|
|
SetValue("VIA", crmprice.VIA);
|
|
SetValue("VIA2", crmprice.VIA2);
|
|
SetValue("ETD", crmprice.ETD);
|
|
SetValue("TT", crmprice.TT);
|
|
SetValue("EFFECTIVEDATE", crmprice.EFFECTIVEDATE.ToString("yyyy-MM-dd"));
|
|
SetValue("VALIDDATE", crmprice.VALIDDATE.ToString("yyyy-MM-dd"));
|
|
SetValue("COMMODITY", crmprice.COMMODITY);
|
|
SetValue("REMARK", crmprice.REMARK);
|
|
|
|
SetValue("FEE0", crmprice.FEE0);
|
|
|
|
SetValue("CTN00", crmprice.CTN00.ToString());
|
|
SetValue("CTN10", crmprice.CTN10.ToString());
|
|
SetValue("CTN20", crmprice.CTN20.ToString());
|
|
SetValue("CTN30", crmprice.CTN30.ToString());
|
|
SetValue("CTN40", crmprice.CTN40.ToString());
|
|
SetValue("CTN02", crmprice.CTN02.ToString());
|
|
SetValue("CTN12", crmprice.CTN12.ToString());
|
|
SetValue("CTN22", crmprice.CTN22.ToString());
|
|
SetValue("CTN32", crmprice.CTN32.ToString());
|
|
SetValue("CTN42", crmprice.CTN42.ToString());
|
|
|
|
SetValue("CONTRACTNO", crmprice.CONTRACTNO.ToString());
|
|
SetValue("CONTRACTBSNO", crmprice.CONTRACTBSNO.ToString());
|
|
|
|
SetValue("CTN0DETENTION", crmprice.CTN0DETENTION.ToString());
|
|
SetValue("CTN1DETENTION", crmprice.CTN1DETENTION.ToString());
|
|
SetValue("CTN2DETENTION", crmprice.CTN2DETENTION.ToString());
|
|
SetValue("CTN3DETENTION", crmprice.CTN3DETENTION.ToString());
|
|
SetValue("CTN4DETENTION", crmprice.CTN4DETENTION.ToString());
|
|
|
|
}
|
|
|
|
|
|
public bool Issame(MsCrmPriceCarrier.MsCrmPriceCarrier crmprice)
|
|
{
|
|
var result = false;
|
|
|
|
result = (crmprice.CARRIER == GetValue("CARRIER") && crmprice.PODLOAD == GetValue("PODLOAD") && crmprice.PORTDISCHARGEID == GetValue("PORTDISCHARGEID") && crmprice.VIA == GetValue("VIA") && crmprice.VIA2 == GetValue("VIA2"));
|
|
|
|
return result;
|
|
}
|
|
}
|
|
|
|
[JsonObject]//报价 提单号关联
|
|
public class MsQuotation_MblnoListmb : ModelObjectBillBody
|
|
{
|
|
public override Dictionary<string, ModelDBOprationType> GetPKey()
|
|
{//用于给扩展的动态数据提供主键字段名
|
|
var d = new Dictionary<string, ModelDBOprationType>() { { "ID", ModelDBOprationType.EditDelete } };
|
|
|
|
return d;
|
|
}
|
|
public Dictionary<string, string> SaveDic = new Dictionary<string, string>();
|
|
|
|
public static string getSQL(string condition="")
|
|
{
|
|
var result = @" SELECT [ID],[BSNO],[MBLNO],[CREATOR],dbo.trimtime([CREATETIME]) CREATETIME FROM [dbo].[Op_SeaPrice_Quotation_MBLNOList] where 1=1 ";
|
|
|
|
if (!string.IsNullOrWhiteSpace(condition)) {
|
|
result += " and " + condition;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
public MsQuotation_MblnoListmb()
|
|
{
|
|
TableName = "Op_SeaPrice_Quotation_MblnoList";
|
|
}
|
|
|
|
public MsQuotation_MblnoListmb(string BSNO)
|
|
{
|
|
SetValue("BSNO", BSNO);
|
|
TableName = "Op_SeaPrice_Quotation_MblnoList";
|
|
}
|
|
|
|
public override string GetBillNoFieldName()
|
|
{
|
|
return "BSNO";
|
|
}
|
|
|
|
public override string GetTimeMarkFieldName()
|
|
{
|
|
return "";
|
|
}
|
|
|
|
}
|
|
|
|
[JsonObject]//报价 杂费列表
|
|
public class MsQuotation_ZaFeiListmb : ModelObjectBillBody
|
|
{
|
|
public override Dictionary<string, ModelDBOprationType> GetPKey()
|
|
{//用于给扩展的动态数据提供主键字段名
|
|
var d = new Dictionary<string, ModelDBOprationType>() { { "ID", ModelDBOprationType.EditDelete } };
|
|
|
|
return d;
|
|
}
|
|
public Dictionary<string, string> SaveDic = new Dictionary<string, string>();
|
|
|
|
public static string getSQL(string condition = "")
|
|
{
|
|
var result = @" SELECT [ID],[BSNO],[SEQUENCE],[FEENAME],[CURRENCY],[AMOUNT],UNIT,NEEDHIDE,~NEEDHIDE NEEDSHOW FROM [dbo].[Op_SeaPrice_Quotation_ZaFeiList] where 1=1 ";
|
|
|
|
if (!string.IsNullOrWhiteSpace(condition))
|
|
{
|
|
result += " and " + condition;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
public MsQuotation_ZaFeiListmb()
|
|
{
|
|
TableName = "Op_SeaPrice_Quotation_ZaFeiList";
|
|
}
|
|
|
|
public MsQuotation_ZaFeiListmb(string BSNO)
|
|
{
|
|
SetValue("BSNO", BSNO);
|
|
TableName = "Op_SeaPrice_Quotation_ZaFeiList";
|
|
}
|
|
|
|
public override string GetBillNoFieldName()
|
|
{
|
|
return "BSNO";
|
|
}
|
|
|
|
public override string GetTimeMarkFieldName()
|
|
{
|
|
return "";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
[JsonObject]//运价表
|
|
public class CRMPRICEmb : 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()
|
|
{
|
|
var result = @" SELECT [GID],[LANE],[PODLOAD],[PORTDISCHARGE],[CARRIER],[VIA],[VIA2],[ETD],[TT],[EFFECTIVEDATE],[VALIDDATE],[COMMODITY],[REMARK],[INPUTBY],[INPUTTIME],[MODIFIEDUSER],[MODIFYTIME],[FEE0],[FEE1],[FEE2],[FEE3],[FEE4],[CTN00],[CTN10],[CTN20],[CTN30],[CTN40],[CTN50],[CTN60],[CTN70],[CTN80],[CTN90],[CTN01],[CTN11],[CTN21],[CTN31],[CTN41],[CTN51],[CTN61],[CTN71],[CTN81],[CTN91],[CTN02],[CTN12],[CTN22],[CTN32],[CTN42],[CTN52],[CTN62],[CTN72],[CTN82],[CTN92],[CTN03],[CTN13],[CTN23],[CTN33],[CTN43],[CTN53],[CTN63],[CTN73],[CTN83],[CTN93],[CTN04],[CTN14],[CTN24],[CTN34],[CTN44],[CTN54],[CTN64],[CTN74],[CTN84],[CTN94],[PORTDISCHARGEID],[CONTRACTNO],[CONTRACTBSNO]
|
|
, dbo.F_ContractPriceStr_CTN0(CONTRACTNO) CTN0PRICESTR
|
|
, dbo.F_ContractPriceStr_CTN1(CONTRACTNO) CTN1PRICESTR
|
|
, dbo.F_ContractPriceStr_CTN2(CONTRACTNO) CTN2PRICESTR
|
|
, dbo.F_ContractPriceStr_CTN3(CONTRACTNO) CTN3PRICESTR
|
|
, dbo.F_ContractPriceStr_CTN4(CONTRACTNO) CTN4PRICESTR
|
|
FROM [dbo].[crm_price_carrier_2] ";
|
|
|
|
return result;
|
|
}
|
|
|
|
public CRMPRICEmb()
|
|
{
|
|
TableName = "crm_price_carrier_2";
|
|
}
|
|
|
|
|
|
public override string GetBillNoFieldName()
|
|
{
|
|
return "GID";
|
|
}
|
|
|
|
public override string GetTimeMarkFieldName()
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[JsonObject]//目的港免箱期
|
|
public class MsPrice_Contract_PortDetentionmb : ModelObjectBillBody
|
|
{
|
|
public override Dictionary<string, ModelDBOprationType> GetPKey()
|
|
{//用于给扩展的动态数据提供主键字段名
|
|
var d = new Dictionary<string, ModelDBOprationType>() { { "ID", ModelDBOprationType.EditDelete } };
|
|
|
|
return d;
|
|
}
|
|
public Dictionary<string, string> SaveDic = new Dictionary<string, string>();
|
|
|
|
public static string getSQL()
|
|
{
|
|
var result = @" SELECT [ID],[BSNO],PORTDISCHARGE,CTN0,CTN1,CTN2,CTN3,CTN4 from op_SeaPrice_Contract_PortDetention where 1=1 ";
|
|
|
|
return result;
|
|
}
|
|
|
|
public MsPrice_Contract_PortDetentionmb()
|
|
{
|
|
TableName = "op_SeaPrice_Contract_PortDetention";
|
|
}
|
|
|
|
public MsPrice_Contract_PortDetentionmb(string BSNO)
|
|
{
|
|
|
|
SetValue("BSNO", BSNO);
|
|
TableName = "op_SeaPrice_Contract_PortDetention";
|
|
}
|
|
|
|
public override string GetBillNoFieldName()
|
|
{
|
|
return "BSNO";
|
|
}
|
|
|
|
public override string GetTimeMarkFieldName()
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
}
|