|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using System.Web.Services;
|
|
|
|
|
using DSWeb.MvcShipping.Models.MsOpSeae;
|
|
|
|
|
using DSWeb.Areas.CommMng.Models;
|
|
|
|
|
using DSWeb.EntityDA;
|
|
|
|
|
using DSWeb.MvcShipping.DAL.MsSysParamSet;
|
|
|
|
|
using Microsoft.Practices.EnterpriseLibrary.Data;
|
|
|
|
|
|
|
|
|
|
namespace DSWebMobileService
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// MsOpSeaeServer 的摘要说明
|
|
|
|
|
/// </summary>
|
|
|
|
|
[WebService(Namespace = "http://tempuri.org/")]
|
|
|
|
|
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
|
|
|
|
|
[System.ComponentModel.ToolboxItem(false)]
|
|
|
|
|
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
|
|
|
|
|
// [System.Web.Script.Services.ScriptService]
|
|
|
|
|
public class MsOpSeaeServer : System.Web.Services.WebService
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
[WebMethod]
|
|
|
|
|
public string HelloWorld()
|
|
|
|
|
{
|
|
|
|
|
return "Hello World";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[WebMethod]
|
|
|
|
|
public static List<MsOpSeae> GetDataList(string strCondition, string userid, string usercode, string companyid, string sort = null, string load = null)
|
|
|
|
|
{
|
|
|
|
|
var rangstr = GetRangDAStr("index", userid, usercode, companyid);
|
|
|
|
|
if (!string.IsNullOrEmpty(rangstr))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(strCondition))
|
|
|
|
|
{
|
|
|
|
|
strCondition = strCondition + " and " + rangstr;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
strCondition = rangstr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var strSql = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
strSql.Append("SELECT BSNO,MASTERNO,ORDERTYPE,ORDTYPE,ORDERNO,BSSTATUS,FEESTATUS,BSDATE,ACCDATE,MBLNO,HBLNO,CUSTNO,TRANSNO,CUSTOMERNAME,BLTYPE,SHIPPERID,");
|
|
|
|
|
strSql.Append("CONSIGNEEID,NOTIFYPARTYID,SHIPPER,CONSIGNEE,NOTIFYPARTY,AGENTID,AGENT,YARD,VESSEL,VOYNO,ETD,CLOSINGDATE,ETA,");
|
|
|
|
|
//}
|
|
|
|
|
strSql.Append("PlACERECEIPT,PORTLOADID,PORTLOAD,PORTDISCHARGEID,PORTDISCHARGE,PLACEDELIVERYID,PLACEDELIVERY,DESTINATIONID,DESTINATION,");
|
|
|
|
|
strSql.Append("NOBILL,ISSUETYPE,ISSUEDATE,ISSUEPLACE,BLFRT,PREPARDAT,PAYABLEAT,[SERVICE],MARKS,CNTRSEALNO,NOPKGS,[DESCRIPTION],GOODSNAME,");
|
|
|
|
|
strSql.Append("GROSSWEIGHT,MEASUREMENT,PKGS,KINDPKGS,KGS,CBM,TOTALNO,CNTRNO,CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR,");
|
|
|
|
|
strSql.Append("TEU,CNTRTOTAL,INPUTBY,OP,CUSTSERVICE,LANE,SALE,CARRIER,FORWARDER,CUSTOMSER,TRUCKER,INVNO,CARGOID,DCLASS,DUNNO,DPAGE,DLABEL,LINKMAN,");
|
|
|
|
|
strSql.Append("REEFERF,TEMPID,TEMPSET,TEMPMAX,TEMPMIN,BSSOURCE,BSSOURCEDETAIL,CUSTOMSNUM,CONTRACTNO,INSURANCEER,INSURANCENO,INAMOUT,ISVOU,VOUNO,REMARK,STATUS1,");
|
|
|
|
|
strSql.Append("STATUS2,STATUS3,STATUS4,STATUS5,ISFUMIGATION,ISSTORAGE,ISLAND,ISCUSTOMS,ISINSPECTION,ISBOOKING,ISAGENT,ISHBLNO,SERVICE9,SERVICE10,DOC,PACKINGTYPE,");
|
|
|
|
|
strSql.Append("WAREHOUSE,CLOSEDOCDATE,INTOPORTDATE,CORPID,SALEDEPT,MBLFRT,CREATETIME,STLNAME,STLDATE,OPERATORCODE,OPERATOR,OPERATOREMAIL,OPERATORTEL,OPERATORFAX,");
|
|
|
|
|
strSql.Append("FINANCIALSTAFFCODE,FINANCIALSTAFF,FINANCIALSTAFFEMAIL,FINANCIALSTAFFTEL,FINANCIALSTAFFFAX,PLACERECEIPTID,SOURCECODE,ISCONTAINERSOC,VESSELID,ISSUEPLACEID,HSCODE");
|
|
|
|
|
strSql.Append(",TRANSTATUS,EDIREMARK,SERVICECONTRACTNO,(CASE BSSTATUS WHEN 1 THEN '锁定' else '未锁定' end) as BSSTATUSREF ");
|
|
|
|
|
strSql.Append(",(CASE FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF ");
|
|
|
|
|
strSql.Append(",(SELECT TOP 1 STATUS FROM OP_STATUS WHERE BSNO=OP_SEAE.BSNO ORDER BY COMPTIME DESC,INPUTTIME DESC) as OPSTATUS ");
|
|
|
|
|
strSql.Append(",(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=97018 and EnumValueID=OP_SEAE.MANIFESTSTATUS) as MANIFESTSTATUSREF");
|
|
|
|
|
strSql.Append(",CUSTOMNO,ENTERPID,ENTERP,INSPECTIONNO,INSPECTIONDATE,CUSTOMDATE,CLEARCUSTOMDATE,ISMOREGOOD,TERMSDELIVERY,INSPECTSERVICE,TRADETERM,0 FENPIAO");
|
|
|
|
|
|
|
|
|
|
strSql.Append(",dbo.F_GetBillDrFeeStatus(OP_SEAE.BSNO) DRFEESTATUS");
|
|
|
|
|
strSql.Append(",dbo.F_GetBillCrFeeStatus(OP_SEAE.BSNO) CRFEESTATUS,ISPRINTPR");
|
|
|
|
|
strSql.Append(",SHIPAGENCY");
|
|
|
|
|
strSql.Append(" from OP_SEAE ");
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(strCondition))
|
|
|
|
|
{
|
|
|
|
|
strSql.Append(" where MASTERNO=BSNO AND EXISTS ( select 1 from OP_SEAE B WHERE OP_SEAE.BSNO=B.MASTERNO ) AND " + strCondition + " ");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
strSql.Append(" where MASTERNO=BSNO ");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
var sortstring = DatasetSort.Getsortstring(sort);
|
|
|
|
|
if (!string.IsNullOrEmpty(sortstring))
|
|
|
|
|
{
|
|
|
|
|
strSql.Append(" order by " + sortstring);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var SeaeDefaultSort = MsSysParamSetDAL.GetData("PARAMNAME='SeaeDefaultSort'");
|
|
|
|
|
if (SeaeDefaultSort.PARAMVALUE != "")
|
|
|
|
|
strSql.Append(" order by " + SeaeDefaultSort.PARAMVALUE + " desc");
|
|
|
|
|
else
|
|
|
|
|
strSql.Append(" order by BSDATE desc");
|
|
|
|
|
}
|
|
|
|
|
return SetData(strSql);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static List<MsOpSeae> SetData(StringBuilder strSql)
|
|
|
|
|
{
|
|
|
|
|
var headList = new List<MsOpSeae>();
|
|
|
|
|
Database db = DatabaseFactory.CreateDatabase();
|
|
|
|
|
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
|
|
|
|
|
{
|
|
|
|
|
while (reader.Read())
|
|
|
|
|
{
|
|
|
|
|
MsOpSeae data = new MsOpSeae();
|
|
|
|
|
#region Set DB data to Object
|
|
|
|
|
data.BSNO = Convert.ToString(reader["BSNO"]);//业务编号
|
|
|
|
|
data.ORDERTYPE = Convert.ToString(reader["ORDERTYPE"]);//委托方式
|
|
|
|
|
data.MASTERNO = Convert.ToString(reader["MASTERNO"]);//主编号
|
|
|
|
|
data.CUSTNO = Convert.ToString(reader["CUSTNO"]);//委托编号
|
|
|
|
|
data.MBLNO = Convert.ToString(reader["MBLNO"]);//主提单号
|
|
|
|
|
data.HBLNO = Convert.ToString(reader["HBLNO"]);//分提单号
|
|
|
|
|
data.BSSTATUS = Convert.ToBoolean(reader["BSSTATUS"]);//业务状态
|
|
|
|
|
data.FEESTATUS = Convert.ToBoolean(reader["FEESTATUS"]);//费用状态
|
|
|
|
|
data.BSSTATUSREF = Convert.ToString(reader["BSSTATUSREF"]);// 业务状态
|
|
|
|
|
data.FEESTATUSREF = Convert.ToString(reader["FEESTATUSREF"]);// 费用状态
|
|
|
|
|
data.MANIFESTSTATUS = Convert.ToString(reader["MANIFESTSTATUSREF"]); //舱单状态
|
|
|
|
|
if (Convert.ToString(reader["OPSTATUS"]) != "")
|
|
|
|
|
data.OPSTATUS = Convert.ToString(reader["OPSTATUS"]);// 费用状态
|
|
|
|
|
data.DRFEESTATUS = getfeestatus(Convert.ToString(reader["DRFEESTATUS"]));
|
|
|
|
|
data.CRFEESTATUS = getfeestatus(Convert.ToString(reader["CRFEESTATUS"]));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.BSDATE = Convert.ToDateTime(reader["BSDATE"]);//接单日期
|
|
|
|
|
data.ACCDATE = Convert.ToString(reader["ACCDATE"]);//会计期间
|
|
|
|
|
data.CUSTOMERNAME = Convert.ToString(reader["CUSTOMERNAME"]);//委托单位
|
|
|
|
|
data.BSSOURCE = Convert.ToString(reader["BSSOURCE"]);//业务来源
|
|
|
|
|
data.BSSOURCEDETAIL = Convert.ToString(reader["BSSOURCEDETAIL"]);//来源明细
|
|
|
|
|
data.INPUTBY = Convert.ToString(reader["INPUTBY"]);//录入人
|
|
|
|
|
data.OP = Convert.ToString(reader["OP"]);//操作员
|
|
|
|
|
data.CUSTSERVICE = Convert.ToString(reader["CUSTSERVICE"]);//客服员
|
|
|
|
|
data.SALE = Convert.ToString(reader["SALE"]);//揽货人
|
|
|
|
|
data.CORPID = Convert.ToString(reader["CORPID"]);//分公司代码
|
|
|
|
|
data.SALEDEPT = Convert.ToString(reader["SALEDEPT"]);//所属部门
|
|
|
|
|
data.CREATETIME = Convert.ToString(reader["CREATETIME"]);//创建时间
|
|
|
|
|
data.VESSEL = Convert.ToString(reader["VESSEL"]);//船名
|
|
|
|
|
data.VOYNO = Convert.ToString(reader["VOYNO"]);//航次
|
|
|
|
|
if (reader["ETD"] != DBNull.Value)
|
|
|
|
|
data.ETD = Convert.ToDateTime(reader["ETD"]).ToString("yyyy-MM-dd");//到港日期
|
|
|
|
|
|
|
|
|
|
data.PORTLOADID = Convert.ToString(reader["PORTLOADID"]);//装货港代码
|
|
|
|
|
data.PORTLOAD = Convert.ToString(reader["PORTLOAD"]);//装货港
|
|
|
|
|
data.PORTDISCHARGEID = Convert.ToString(reader["PORTDISCHARGEID"]);//卸货港代码
|
|
|
|
|
data.PORTDISCHARGE = Convert.ToString(reader["PORTDISCHARGE"]);//卸货港
|
|
|
|
|
data.CNTRNO = Convert.ToString(reader["CNTRNO"]);//集装箱大写
|
|
|
|
|
if (reader["CNTR1"] != DBNull.Value)
|
|
|
|
|
data.CNTR1 = Convert.ToInt32(reader["CNTR1"]);//箱型1
|
|
|
|
|
if (reader["CNTR2"] != DBNull.Value)
|
|
|
|
|
data.CNTR2 = Convert.ToInt32(reader["CNTR2"]);//箱型2
|
|
|
|
|
if (reader["CNTR3"] != DBNull.Value)
|
|
|
|
|
data.CNTR3 = Convert.ToInt32(reader["CNTR3"]);//箱型3
|
|
|
|
|
if (reader["CNTR4"] != DBNull.Value)
|
|
|
|
|
data.CNTR4 = Convert.ToInt32(reader["CNTR4"]);//箱型4
|
|
|
|
|
if (reader["CNTR5"] != DBNull.Value)
|
|
|
|
|
data.CNTR5 = Convert.ToInt32(reader["CNTR5"]);//箱型5
|
|
|
|
|
if (reader["CNTR6"] != DBNull.Value)
|
|
|
|
|
data.CNTR6 = Convert.ToInt32(reader["CNTR6"]);//箱型6
|
|
|
|
|
if (reader["CNTR7"] != DBNull.Value)
|
|
|
|
|
data.CNTR7 = Convert.ToInt32(reader["CNTR7"]);//箱型7
|
|
|
|
|
if (reader["CNTR8"] != DBNull.Value)
|
|
|
|
|
data.CNTR8 = Convert.ToInt32(reader["CNTR8"]);//箱型8
|
|
|
|
|
if (reader["CNTR9"] != DBNull.Value)
|
|
|
|
|
data.CNTR9 = Convert.ToInt32(reader["CNTR9"]);//箱型9
|
|
|
|
|
if (reader["CNTR10"] != DBNull.Value)
|
|
|
|
|
data.CNTR10 = Convert.ToInt32(reader["CNTR10"]);//箱型10
|
|
|
|
|
if (reader["OTCNTR"] != DBNull.Value)
|
|
|
|
|
data.OTCNTR = Convert.ToInt32(reader["OTCNTR"]);//其他箱型
|
|
|
|
|
if (reader["TEU"] != DBNull.Value)
|
|
|
|
|
data.TEU = Convert.ToInt32(reader["TEU"]);//箱TEU
|
|
|
|
|
data.CNTRTOTAL = Convert.ToString(reader["CNTRTOTAL"]);//集装箱全部内容
|
|
|
|
|
data.GOODSNAME = Convert.ToString(reader["GOODSNAME"]);//品名
|
|
|
|
|
data.CONTRACTNO = Convert.ToString(reader["CONTRACTNO"]);//合同号
|
|
|
|
|
if (reader["KGS"] != DBNull.Value)
|
|
|
|
|
data.KGS = Convert.ToDecimal(reader["KGS"]);//毛重
|
|
|
|
|
data.CUSTOMSER = Convert.ToString(reader["CUSTOMSER"]);//报关行
|
|
|
|
|
if (reader["PKGS"] != DBNull.Value)
|
|
|
|
|
data.PKGS = Convert.ToInt32(reader["PKGS"]);//件数
|
|
|
|
|
if (reader["ISVOU"] != DBNull.Value)
|
|
|
|
|
data.ISVOU = Convert.ToBoolean(reader["ISVOU"]);//是否生成凭证
|
|
|
|
|
data.VOUNO = Convert.ToString(reader["VOUNO"]);//凭证号
|
|
|
|
|
data.KINDPKGS = Convert.ToString(reader["KINDPKGS"]);//件数包装
|
|
|
|
|
data.REMARK = Convert.ToString(reader["REMARK"]).Replace(@"\\\\", "\n").Replace(@"^", "\'");//备注
|
|
|
|
|
data.YARD = Convert.ToString(reader["YARD"]);//场站/靠泊码头
|
|
|
|
|
data.BLTYPE = Convert.ToString(reader["BLTYPE"]);//装运方式
|
|
|
|
|
if (reader["CBM"] != DBNull.Value)
|
|
|
|
|
data.CBM = Convert.ToDecimal(reader["CBM"]);//立方数/尺码
|
|
|
|
|
data.CNTRSEALNO = Convert.ToString(reader["CNTRSEALNO"]);//箱号封号
|
|
|
|
|
data.CARRIER = Convert.ToString(reader["CARRIER"]);//船公司
|
|
|
|
|
data.TRUCKER = Convert.ToString(reader["TRUCKER"]);//承运车队
|
|
|
|
|
if (reader["CUSTOMSNUM"] != DBNull.Value)
|
|
|
|
|
data.CUSTOMSNUM = Convert.ToInt32(reader["CUSTOMSNUM"]);//报关票数
|
|
|
|
|
data.NOPKGS = Convert.ToString(reader["NOPKGS"]);//件数包装
|
|
|
|
|
if (reader["GROSSWEIGHT"] != DBNull.Value)
|
|
|
|
|
data.GROSSWEIGHT = Convert.ToString(reader["GROSSWEIGHT"]);//货物毛重
|
|
|
|
|
if (reader["MEASUREMENT"] != DBNull.Value)
|
|
|
|
|
data.MEASUREMENT = Convert.ToString(reader["MEASUREMENT"]);//货物尺码
|
|
|
|
|
data.DESCRIPTION = Convert.ToString(reader["DESCRIPTION"]);//货物描述
|
|
|
|
|
data.TOTALNO = Convert.ToString(reader["TOTALNO"]);//件数大写
|
|
|
|
|
data.TRANSNO = Convert.ToString(reader["TRANSNO"]);//运单号
|
|
|
|
|
data.SHIPPERID = Convert.ToString(reader["SHIPPERID"]);//发货人
|
|
|
|
|
data.CONSIGNEEID = Convert.ToString(reader["CONSIGNEEID"]);//收货人
|
|
|
|
|
data.NOTIFYPARTYID = Convert.ToString(reader["NOTIFYPARTYID"]);//通知人
|
|
|
|
|
data.SHIPPER = Convert.ToString(reader["SHIPPER"]).Replace(@"\\\\", "\n").Replace(@"^", "\'");//发货人内容
|
|
|
|
|
data.CONSIGNEE = Convert.ToString(reader["CONSIGNEE"]).Replace(@"\\\\", "\n").Replace(@"^", "\'");//收货人内容
|
|
|
|
|
data.NOTIFYPARTY = Convert.ToString(reader["NOTIFYPARTY"]).Replace(@"\\\\", "\n").Replace(@"^", "\'");//通知人内容
|
|
|
|
|
data.AGENTID = Convert.ToString(reader["AGENTID"]);//国外代理
|
|
|
|
|
data.AGENT = Convert.ToString(reader["AGENT"]);//国外代理内容
|
|
|
|
|
if (reader["CLOSINGDATE"] != DBNull.Value)
|
|
|
|
|
data.CLOSINGDATE = Convert.ToDateTime(reader["CLOSINGDATE"]).ToString("yyyy-MM-dd HH:mm:ss");//截港日期
|
|
|
|
|
if (reader["ETA"] != DBNull.Value)
|
|
|
|
|
data.ETA = Convert.ToDateTime(reader["ETA"]).ToString("yyyy-MM-dd");//预抵日期
|
|
|
|
|
data.PLACERECEIPT = Convert.ToString(reader["PlACERECEIPT"]);//收货地
|
|
|
|
|
data.PLACERECEIPTID = Convert.ToString(reader["PLACERECEIPTID"]);//收货地
|
|
|
|
|
data.PLACEDELIVERYID = Convert.ToString(reader["PLACEDELIVERYID"]);//交货地代码
|
|
|
|
|
data.PLACEDELIVERY = Convert.ToString(reader["PLACEDELIVERY"]);//交货地
|
|
|
|
|
data.DESTINATIONID = Convert.ToString(reader["DESTINATIONID"]);//目的地代码
|
|
|
|
|
data.DESTINATION = Convert.ToString(reader["DESTINATION"]);//目的地
|
|
|
|
|
data.NOBILL = Convert.ToString(reader["NOBILL"]);//提单份数
|
|
|
|
|
data.ISSUETYPE = Convert.ToString(reader["ISSUETYPE"]);//签单方式
|
|
|
|
|
if (reader["ISSUEDATE"] != DBNull.Value)
|
|
|
|
|
data.ISSUEDATE = Convert.ToDateTime(reader["ISSUEDATE"]).ToString("yyyy-MM-dd");//预抵日期
|
|
|
|
|
data.ISSUEPLACE = Convert.ToString(reader["ISSUEPLACE"]);//签单地点
|
|
|
|
|
data.BLFRT = Convert.ToString(reader["BLFRT"]);//付费方式
|
|
|
|
|
data.PREPARDAT = Convert.ToString(reader["PREPARDAT"]);//预付地点
|
|
|
|
|
data.PAYABLEAT = Convert.ToString(reader["PAYABLEAT"]);//到付地点
|
|
|
|
|
data.SERVICE = Convert.ToString(reader["SERVICE"]);//运输条款
|
|
|
|
|
data.MARKS = Convert.ToString(reader["MARKS"]);//唛头
|
|
|
|
|
data.LANE = Convert.ToString(reader["LANE"]);//航线
|
|
|
|
|
data.FORWARDER = Convert.ToString(reader["FORWARDER"]);//订舱公司
|
|
|
|
|
data.INVNO = Convert.ToString(reader["INVNO"]);//发票号
|
|
|
|
|
data.CARGOID = Convert.ToString(reader["CARGOID"]);//货物标识
|
|
|
|
|
data.DCLASS = Convert.ToString(reader["DCLASS"]);//危险品分类/等级
|
|
|
|
|
data.DUNNO = Convert.ToString(reader["DUNNO"]);//危险品编号
|
|
|
|
|
data.REEFERF = Convert.ToString(reader["REEFERF"]);//冷藏通风量
|
|
|
|
|
data.TEMPID = Convert.ToString(reader["TEMPID"]);//温度单位
|
|
|
|
|
data.TEMPSET = Convert.ToString(reader["TEMPSET"]);//设置温度
|
|
|
|
|
data.TEMPMAX = Convert.ToString(reader["TEMPMAX"]);//最高温度
|
|
|
|
|
data.TEMPMIN = Convert.ToString(reader["TEMPMIN"]);//最低温度
|
|
|
|
|
data.ORDTYPE = Convert.ToString(reader["ORDTYPE"]);//订舱类型
|
|
|
|
|
data.ORDERNO = Convert.ToString(reader["ORDERNO"]);//订舱编号
|
|
|
|
|
data.INSURANCEER = Convert.ToString(reader["INSURANCEER"]);//保险人
|
|
|
|
|
data.INSURANCENO = Convert.ToString(reader["INSURANCENO"]);//保险单号
|
|
|
|
|
if (reader["INAMOUT"] != DBNull.Value)
|
|
|
|
|
data.INAMOUT = Convert.ToDecimal(reader["INAMOUT"]);//保险金额
|
|
|
|
|
if (reader["STATUS1"] != DBNull.Value)
|
|
|
|
|
data.STATUS1 = Convert.ToBoolean(reader["STATUS1"]);//状态1
|
|
|
|
|
if (reader["STATUS2"] != DBNull.Value)
|
|
|
|
|
data.STATUS2 = Convert.ToBoolean(reader["STATUS2"]);//状态2
|
|
|
|
|
if (reader["STATUS3"] != DBNull.Value)
|
|
|
|
|
data.STATUS3 = Convert.ToBoolean(reader["STATUS3"]);//状态3
|
|
|
|
|
if (reader["STATUS4"] != DBNull.Value)
|
|
|
|
|
data.STATUS4 = Convert.ToBoolean(reader["STATUS4"]);//状态4
|
|
|
|
|
if (reader["STATUS5"] != DBNull.Value)
|
|
|
|
|
data.STATUS5 = Convert.ToBoolean(reader["STATUS5"]);//状态5
|
|
|
|
|
if (reader["ISFUMIGATION"] != DBNull.Value)
|
|
|
|
|
data.ISFUMIGATION = Convert.ToBoolean(reader["ISFUMIGATION"]);//熏蒸
|
|
|
|
|
if (reader["ISSTORAGE"] != DBNull.Value)
|
|
|
|
|
data.ISSTORAGE = Convert.ToBoolean(reader["ISSTORAGE"]);//仓储
|
|
|
|
|
if (reader["ISLAND"] != DBNull.Value)
|
|
|
|
|
data.ISLAND = Convert.ToBoolean(reader["ISLAND"]);//陆运
|
|
|
|
|
if (reader["ISCUSTOMS"] != DBNull.Value)
|
|
|
|
|
data.ISCUSTOMS = Convert.ToBoolean(reader["ISCUSTOMS"]);//报关
|
|
|
|
|
if (reader["ISINSPECTION"] != DBNull.Value)
|
|
|
|
|
data.ISINSPECTION = Convert.ToBoolean(reader["ISINSPECTION"]);//报检
|
|
|
|
|
if (reader["ISBOOKING"] != DBNull.Value)
|
|
|
|
|
data.ISBOOKING = Convert.ToBoolean(reader["ISBOOKING"]);//订舱
|
|
|
|
|
if (reader["ISAGENT"] != DBNull.Value)
|
|
|
|
|
data.ISAGENT = Convert.ToBoolean(reader["ISAGENT"]);//使用代理
|
|
|
|
|
if (reader["ISHBLNO"] != DBNull.Value)
|
|
|
|
|
data.ISHBLNO = Convert.ToBoolean(reader["ISHBLNO"]);//分单签单
|
|
|
|
|
if (reader["SERVICE9"] != DBNull.Value)
|
|
|
|
|
data.SERVICE9 = Convert.ToBoolean(reader["SERVICE9"]);//服务项目9
|
|
|
|
|
if (reader["SERVICE10"] != DBNull.Value)
|
|
|
|
|
data.SERVICE10 = Convert.ToBoolean(reader["SERVICE10"]);//服务项目10
|
|
|
|
|
data.DOC = Convert.ToString(reader["DOC"]);//单证
|
|
|
|
|
data.PACKINGTYPE = Convert.ToString(reader["PACKINGTYPE"]);//装箱类型
|
|
|
|
|
data.WAREHOUSE = Convert.ToString(reader["WAREHOUSE"]);//仓库
|
|
|
|
|
if (reader["CLOSEDOCDATE"] != DBNull.Value)
|
|
|
|
|
data.CLOSEDOCDATE = Convert.ToDateTime(reader["CLOSEDOCDATE"]).ToString("yyyy-MM-dd HH:mm:ss");//截单日期
|
|
|
|
|
data.INTOPORTDATE = Convert.ToString(reader["INTOPORTDATE"]);//集港日期
|
|
|
|
|
data.MBLFRT = Convert.ToString(reader["MBLFRT"]);//MBL付费方式
|
|
|
|
|
data.STLNAME = Convert.ToString(reader["STLNAME"]);//结算方式
|
|
|
|
|
data.STLDATE = Convert.ToString(reader["STLDATE"]);//结算时间
|
|
|
|
|
data.OPERATORCODE = Convert.ToString(reader["OPERATORCODE"]);//客户操作代码
|
|
|
|
|
data.OPERATOR = Convert.ToString(reader["OPERATOR"]);//客户操作名称
|
|
|
|
|
data.OPERATOREMAIL = Convert.ToString(reader["OPERATOREMAIL"]);//操作电子邮箱
|
|
|
|
|
data.OPERATORTEL = Convert.ToString(reader["OPERATORTEL"]);//操作电话
|
|
|
|
|
data.OPERATORFAX = Convert.ToString(reader["OPERATORFAX"]);//操作传真
|
|
|
|
|
data.FINANCIALSTAFFCODE = Convert.ToString(reader["FINANCIALSTAFFCODE"]);//客户财务代码
|
|
|
|
|
data.FINANCIALSTAFF = Convert.ToString(reader["FINANCIALSTAFF"]);//客户财务名称
|
|
|
|
|
data.FINANCIALSTAFFEMAIL = Convert.ToString(reader["FINANCIALSTAFFEMAIL"]);//财务电子邮箱
|
|
|
|
|
data.FINANCIALSTAFFTEL = Convert.ToString(reader["FINANCIALSTAFFTEL"]);//财务电话
|
|
|
|
|
data.FINANCIALSTAFFFAX = Convert.ToString(reader["FINANCIALSTAFFFAX"]);//财务传真
|
|
|
|
|
data.SOURCECODE = Convert.ToString(reader["SOURCECODE"]);//集装箱(器)来源代码
|
|
|
|
|
if (reader["ISCONTAINERSOC"] != DBNull.Value)
|
|
|
|
|
data.ISCONTAINERSOC = Convert.ToBoolean(reader["ISCONTAINERSOC"]);//货主箱标志,是否自有箱
|
|
|
|
|
data.DPAGE = Convert.ToString(reader["DPAGE"]);//危险品页号
|
|
|
|
|
data.DLABEL = Convert.ToString(reader["DLABEL"]);//危险品标签
|
|
|
|
|
data.LINKMAN = Convert.ToString(reader["LINKMAN"]);//危险品联系人
|
|
|
|
|
data.VESSELID = Convert.ToString(reader["VESSELID"]);//船舶呼号
|
|
|
|
|
data.ISSUEPLACEID = Convert.ToString(reader["ISSUEPLACEID"]);//提单签发地代码
|
|
|
|
|
data.HSCODE = Convert.ToString(reader["HSCODE"]);//HS编码
|
|
|
|
|
data.TRANSTATUS = Convert.ToString(reader["TRANSTATUS"]);//出运状态
|
|
|
|
|
data.EDIREMARK = Convert.ToString(reader["EDIREMARK"]);//EDI备注
|
|
|
|
|
data.SERVICECONTRACTNO = Convert.ToString(reader["SERVICECONTRACTNO"]);//EDI备注
|
|
|
|
|
data.CUSTOMNO = Convert.ToString(reader["CUSTOMNO"]);//报关单号
|
|
|
|
|
if (reader["CUSTOMDATE"] != DBNull.Value)
|
|
|
|
|
data.CUSTOMDATE = Convert.ToDateTime(reader["CUSTOMDATE"]).ToString("yyyy-MM-dd");//
|
|
|
|
|
data.INSPECTIONNO = Convert.ToString(reader["INSPECTIONNO"]);//商检号
|
|
|
|
|
if (reader["INSPECTIONDATE"] != DBNull.Value)
|
|
|
|
|
data.INSPECTIONDATE = Convert.ToDateTime(reader["INSPECTIONDATE"]).ToString("yyyy-MM-dd");//
|
|
|
|
|
data.ENTERP = Convert.ToString(reader["ENTERP"]);//经营单位
|
|
|
|
|
data.ENTERPID = Convert.ToString(reader["ENTERPID"]);//经营单位代码
|
|
|
|
|
if (reader["CLEARCUSTOMDATE"] != DBNull.Value)
|
|
|
|
|
data.CLEARCUSTOMDATE = Convert.ToDateTime(reader["CLEARCUSTOMDATE"]).ToString("yyyy-MM-dd");//
|
|
|
|
|
data.TERMSDELIVERY = Convert.ToString(reader["TERMSDELIVERY"]);//经营单位
|
|
|
|
|
data.INSPECTSERVICE = Convert.ToString(reader["INSPECTSERVICE"]);//经营单位代码
|
|
|
|
|
data.TRADETERM = Convert.ToString(reader["TRADETERM"]);//贸易条款
|
|
|
|
|
data.SHIPAGENCY = Convert.ToString(reader["SHIPAGENCY"]);//船代
|
|
|
|
|
|
|
|
|
|
if (reader["ISMOREGOOD"] != DBNull.Value)
|
|
|
|
|
data.ISMOREGOOD = Convert.ToBoolean(reader["ISMOREGOOD"]);//多品名
|
|
|
|
|
if (Convert.ToString(reader["BLTYPE"]) == "拼箱主票")
|
|
|
|
|
data.FENPIAO = "1";//件数
|
|
|
|
|
else
|
|
|
|
|
data.FENPIAO = "0";//件数
|
|
|
|
|
data.ISPRINTPR = Convert.ToString(reader["ISPRINTPR"]);
|
|
|
|
|
#endregion
|
|
|
|
|
headList.Add(data);
|
|
|
|
|
}
|
|
|
|
|
reader.Close();
|
|
|
|
|
}
|
|
|
|
|
return headList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string getfeestatus(string feestatusint)
|
|
|
|
|
{
|
|
|
|
|
var result = "";
|
|
|
|
|
if (feestatusint == "0:")
|
|
|
|
|
{
|
|
|
|
|
return "审核通过";
|
|
|
|
|
}
|
|
|
|
|
else if (feestatusint == "1:")
|
|
|
|
|
{
|
|
|
|
|
return "录入状态";
|
|
|
|
|
}
|
|
|
|
|
else if (feestatusint == "2:")
|
|
|
|
|
{
|
|
|
|
|
return "提交审核";
|
|
|
|
|
}
|
|
|
|
|
else if (feestatusint == "8:")
|
|
|
|
|
{
|
|
|
|
|
return "部分结算";
|
|
|
|
|
}
|
|
|
|
|
else if (feestatusint == "9:")
|
|
|
|
|
{
|
|
|
|
|
return "结算完毕";
|
|
|
|
|
}
|
|
|
|
|
else if (feestatusint == "")
|
|
|
|
|
{
|
|
|
|
|
return "未录入";
|
|
|
|
|
}
|
|
|
|
|
else if (feestatusint == "3:")
|
|
|
|
|
{
|
|
|
|
|
return "申请修改";
|
|
|
|
|
}
|
|
|
|
|
else if (feestatusint == "4:")
|
|
|
|
|
{
|
|
|
|
|
return "申请删除";
|
|
|
|
|
}
|
|
|
|
|
else if (feestatusint == "6:")
|
|
|
|
|
{
|
|
|
|
|
return "驳回提交";
|
|
|
|
|
}
|
|
|
|
|
else if (feestatusint == "7:")
|
|
|
|
|
{
|
|
|
|
|
return "驳回申请";
|
|
|
|
|
}
|
|
|
|
|
else if (feestatusint.IndexOf("9:") > -1)
|
|
|
|
|
{
|
|
|
|
|
return "部分结算";
|
|
|
|
|
}
|
|
|
|
|
else if (feestatusint.IndexOf("0:") > -1)
|
|
|
|
|
{
|
|
|
|
|
return "部分审核";
|
|
|
|
|
}
|
|
|
|
|
else if (feestatusint.IndexOf("2:") > -1)
|
|
|
|
|
{
|
|
|
|
|
return "部分提交";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GetRangDAStr(string tb, string userid, string username, string companyid)
|
|
|
|
|
{
|
|
|
|
|
string str = "";
|
|
|
|
|
var strSql = new StringBuilder();
|
|
|
|
|
strSql.Append("SELECT ");
|
|
|
|
|
strSql.Append(" VISIBLERANGE,OPERATERANGE ");
|
|
|
|
|
strSql.Append(" from VW_User_Authority ");
|
|
|
|
|
strSql.Append(" where [NAME]='modOrderManagement' and USERID='" + userid + "' and ISDELETE=0");
|
|
|
|
|
|
|
|
|
|
string visiblerange = "4";
|
|
|
|
|
string operaterange = "4";
|
|
|
|
|
|
|
|
|
|
Database db = DatabaseFactory.CreateDatabase();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
while (reader.Read())
|
|
|
|
|
{
|
|
|
|
|
visiblerange = Convert.ToString(reader["VISIBLERANGE"]);
|
|
|
|
|
operaterange = Convert.ToString(reader["OPERATERANGE"]);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
reader.Close();
|
|
|
|
|
}
|
|
|
|
|
if (visiblerange == "4")
|
|
|
|
|
{
|
|
|
|
|
str = "1=2";
|
|
|
|
|
}
|
|
|
|
|
else if (visiblerange == "3")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
str = " (B.OP='" + username + "' OR B.SALE='" + username + "' OR B.CUSTSERVICE='" + username + "' OR B.DOC='" + username + "')";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (visiblerange == "2")
|
|
|
|
|
{
|
|
|
|
|
if (tb == "index")
|
|
|
|
|
{
|
|
|
|
|
var rangeDa = new RangeDA();
|
|
|
|
|
var deptname = rangeDa.GetDEPTNAME(userid);
|
|
|
|
|
var userstr = new StringBuilder();
|
|
|
|
|
userstr.Append(" select SHOWNAME from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "')");
|
|
|
|
|
Database userdb = DatabaseFactory.CreateDatabase();
|
|
|
|
|
using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString()))
|
|
|
|
|
{
|
|
|
|
|
str = "";
|
|
|
|
|
while (reader.Read())
|
|
|
|
|
{
|
|
|
|
|
if (str == "")
|
|
|
|
|
{
|
|
|
|
|
str = " (B.OP='" + Convert.ToString(reader["SHOWNAME"]) + "' OR B.SALE='" + Convert.ToString(reader["SHOWNAME"]) + "' OR B.CUSTSERVICE='" + Convert.ToString(reader["SHOWNAME"]) + "' OR B.DOC='" + Convert.ToString(reader["SHOWNAME"]) + "'";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
str = str + " or B.OP='" + Convert.ToString(reader["SHOWNAME"]) + "' OR B.SALE='" + Convert.ToString(reader["SHOWNAME"]) + "' OR B.CUSTSERVICE='" + Convert.ToString(reader["SHOWNAME"]) + "' OR B.DOC='" + Convert.ToString(reader["SHOWNAME"]) + "'";
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
str = str + ")";
|
|
|
|
|
reader.Close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
str = " UPPER(B.Corpid)='" + companyid + "'";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (visiblerange == "1")
|
|
|
|
|
{
|
|
|
|
|
str = " UPPER(B.Corpid)='" + companyid + "'";
|
|
|
|
|
}
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|