DS7Zhanhao
hanxuntao 2 years ago
parent 658e6ce3b2
commit 749f067ccc

@ -242,7 +242,7 @@ namespace DSWeb.Common.Helper
spec = item.SPEC,
uom = item.UNIT,
quantity = item.PKGS,
taxRate = item.TAXRATE/100,
taxRate = Math.Round(item.TAXRATE/100, 2, MidpointRounding.AwayFromZero),
amount = Math.Round(item.AMOUNT + item.TAX, 2, MidpointRounding.AwayFromZero) ,
price = item.PRICE,
catalogCode = goodsCode,

@ -438,9 +438,20 @@ Ext.extend(Shipping.MsChPayapplicationBLEdit, Ext.Panel, {
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.Remarks, //备注
xtype: 'textareafield',
grow: true,
flex: 4,
id:'REMARK',
name: 'REMARK'
}]
}, {
xtype: 'button',
iconCls: "btnsearchBig",
width: 20,
handler: function (button, event) {
this.ShowBigEdit("REMARK", '备注');
},
scope: this
}]
}
]//end items(fieldset 1)
@ -2376,7 +2387,75 @@ Ext.extend(Shipping.MsChPayapplicationBLEdit, Ext.Panel, {
});
this.FormBigMemoShow = Ext.widget('form', {
frame: true,
region: 'center',
height: 480,
autoScroll: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [
{
xtype: 'textareafield',
// grow: true,
name: 'DSMEMO',
anchor: '100%',
height: 480,
listeners: {
scope: this,
blur: function (field, The, eOpts) {
_this.FormBigMemoShow.getForm().findField('DSMEMO')
.setValue(field.value.toUpperCase());
}
}
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.winBigMemoShow = Ext.create('Ext.window.Window', {
title: "", //"集装箱明细",
width: 750,
height: 550,
//plain : true,
layout: "border",
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.FormBigMemoShow],
buttons: [{
text: '确定', //"关闭",
minWidth: 70,
handler: function () {
_this.showField.setValue(_this.FormBigMemoShow.getForm().findField('DSMEMO').getValue());
_this.winBigMemoShow.close();
}
}]
});
}, //end initUIComponents
@ -4146,7 +4225,15 @@ Ext.extend(Shipping.MsChPayapplicationBLEdit, Ext.Panel, {
},
ShowBigEdit: function (fieldname, cname) {
this.showField = _this.formEdit.getForm().findField(fieldname);
var value = this.showField.getValue();
this.winBigMemoShow.setTitle(cname);
this.FormBigMemoShow.getForm().findField('DSMEMO').setValue(value);
this.winBigMemoShow.show();
},
GetGroupCorp: function (custname) {
_this = this;

@ -205,13 +205,13 @@ namespace DSWeb.Areas.CommMng.Models
TableName = "USER_BASEINFO";
KeyName = "USERID";
UrlName = "SIGNATUREURL";
ImgName = "AIGNATURE";
ImgName = "SIGNATUREPIC";
FilePath = path + "\\" + ModelName;
this.ModelName = ModelName;
this.ChildName = ChildName;
//INDATABASE = true;
INDATABASE ="True";
}
if (ModelName == "Price_Quotation")
{

@ -62,7 +62,7 @@ namespace DSWeb.MvcShipping.Controllers
if (handle == "edit")
{
var list = MsChDuiDAL.GetDataList(1,1,condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), CookieConfig.GetCookie_OrgCode(Request));
var list = MsChDuiDAL.GetDataList(0,1,condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), CookieConfig.GetCookie_OrgCode(Request));
if (list.Count > 0)
head = list[0];
}

@ -1219,9 +1219,9 @@ namespace DSWeb.MvcShipping.Controllers
if (isfee)
{
if (errstr == "")
errstr = enumValue.CUSTNO;
errstr = enumValue.BILLNO;
else
errstr = errstr + "," + enumValue.CUSTNO;
errstr = errstr + "," + enumValue.BILLNO;
}
else
{
@ -1257,9 +1257,9 @@ namespace DSWeb.MvcShipping.Controllers
if (isfee)
{
if (errstr == "")
errstr = enumValue.CUSTNO;
errstr = enumValue.BILLNO;
else
errstr = errstr + "," + enumValue.CUSTNO;
errstr = errstr + "," + enumValue.BILLNO;
}
else
{

@ -34,6 +34,7 @@ using DSWeb.MvcShipping.DAL.MsCodeOpDef;
using DSWeb.MvcShipping.DAL.MsInfoClient;
using DSWeb.MvcShipping.DAL.MsOpSeaeDAL;
using DSWeb.Common.DB;
using DSWeb.MvcShipping.DAL.MsChFeeDAL;
namespace DSWeb.MvcShipping.Controllers
{
@ -109,6 +110,20 @@ namespace DSWeb.MvcShipping.Controllers
result.getDef(Session["USERID"].ToString());
}else
result = MsOp_InternalTradeDAL.GetData(condition, Session["USERID"].ToString());
if (handle == "copyadd")
{
var BSNO = System.Guid.NewGuid().ToString();
result.SetValue("BSNO", BSNO);
var feelist = MsChFeeDAL.GetAllDataList(condition);
if (feelist != null)
{
for (int _i = 0; _i < feelist.Count; _i++)
{
feelist[_i].BsNo = "*";
}
MsChFeeDAL.SaveFee(feelist, BSNO, CookieConfig.GetCookie_UserId(Request));
}
}
var json = JsonConvert.Serialize(new
{
@ -395,8 +410,11 @@ namespace DSWeb.MvcShipping.Controllers
{
head.DbOperationType = DbOperationType.DbotIns;
head.ModelUIStatus = "I";
var _bsno = System.Guid.NewGuid().ToString();
head.SetValue("BSNO", _bsno);
if (string.IsNullOrEmpty(head.GetValue("BSNO")))
{
var _bsno = System.Guid.NewGuid().ToString();
head.SetValue("BSNO", _bsno);
}
head.SetValue("BSDATE", _date);
head.SetValue("CREATOR", Session["SHOWNAME"].ToString());
}
@ -538,7 +556,108 @@ namespace DSWeb.MvcShipping.Controllers
#endregion
[HttpPost]
public ContentResult ImpExcel()
{
var jsonRespose = new JsonResponse { Success = false, Message = "" };
if (Request.Files.Count != 1)
{
jsonRespose.Success = false;
jsonRespose.Message = "请选择上传的文件";
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
var file = Request.Files["DsLoadExcel"];
if (file == null)
{
jsonRespose.Success = false;
jsonRespose.Message = "上传文件发生未知错误,请重新上传";
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
var path = Server.MapPath("../../UploadFiles/ImpBsExcel");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
var size = file.ContentLength;
var name = Path.GetFileName(file.FileName);
var usercode = CookieConfig.GetCookie_UserCode(Request);
string filename = path + "\\" + usercode + DateTime.Now.ToString("yyyyMMddHHmmssfff") + name;
if (System.IO.File.Exists(filename))
{
System.IO.File.Delete(filename);
}
file.SaveAs(filename);
if (!System.IO.File.Exists(filename))
{
jsonRespose.Success = false;
jsonRespose.Message = "上传的Excel不包含数据01";
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
try
{
string ext = Path.GetExtension(file.FileName).ToLower();
if (ext != ".xls" && ext != ".xlsx")
{
jsonRespose.Success = false;
jsonRespose.Message = "上传的文件不是Excel文件";
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
var strMsg = "";
System.Data.DataTable table = ExcelHelper.ReadStreamToDataTable(file.InputStream, out strMsg);
if (!string.IsNullOrEmpty(strMsg))
{
jsonRespose.Success = false;
jsonRespose.Message = strMsg;
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
if (table.Rows.Count > 0)
{
}
else
{
jsonRespose.Success = false;
jsonRespose.Message = "excel无数据";
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
var result = new DBResult();
//if (customerFieldName == "委托单位")
//{
var userid = Session["USERID"].ToString();
var username = Session["SHOWNAME"].ToString();
var companyid = Session["COMPANYID"].ToString();
result = MsOp_InternalTradeDAL.ImpOpInternalTrade(table, userid, username, companyid);
var json = JsonConvert.Serialize(new
{
success = result.Success,
Message = result.Message
});
return new ContentResult() { Content = json };
}
catch (Exception e)
{
jsonRespose.Success = false;
jsonRespose.Message = "读取Excel文件出错请确认文件正确性" + e.Message;
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
}
public ContentResult SaveList(string BSNOList, string headdata)//
{
var modb = new ModelObjectRepository();

@ -198,7 +198,7 @@ namespace DSWeb.MvcShipping.DAL.MsChDui
static public ChDui GetData(string condition, string userid, string usercode, string orgcode)
{
ChDui data = null;
var list = GetDataList(1,1,condition,userid,usercode,orgcode);
var list = GetDataList(0,1,condition,userid,usercode,orgcode);
if (list.Count > 0)
data = list[0];

@ -124,7 +124,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeAutoDuiDAL
var strSql = new StringBuilder();
strSql.Append("select dl.*,b.ETD,B.CUSTOMERNAME,B.OP,B.CARRIER,B.TEU,B.SALE,B.CUSTNO from ");
// strSql.Append("(select GID,BSNO,(select top 1 BSNO from v_op_bill where (MBLNO=D.b_mblno or HBLNO=D.MBLNO) and OPLBNAME in('海运进口','海运出口','空运进口','空运出口')) B_BSNO,MBLNO,B_MBLNO,RMBAMOUNT,USDAMOUNT,L_RMBAMOUNT,L_USDAMOUNT,ISOK,REMARK,REMARK2 ");
strSql.Append("(select GID,BSNO,B_BSNO,MBLNO,B_MBLNO,RMBAMOUNT,USDAMOUNT,L_RMBAMOUNT,L_USDAMOUNT,ISOK,REMARK,REMARK2 ");
strSql.Append("(select GID,BSNO,B_BSNO,MBLNO,B_MBLNO,RMBAMOUNT,USDAMOUNT,L_RMBAMOUNT,L_USDAMOUNT,ISOK,REMARK,REMARK2,B_AMOUNT ");
strSql.Append(" from CH_FEE_AutoDuiDetail D ");
if (!string.IsNullOrEmpty(strCondition))
{
@ -154,7 +154,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeAutoDuiDAL
var strSql = new StringBuilder();
strSql.Append("select dl.*,b.ETD,B.CUSTOMERNAME,B.OP,B.CARRIER,B.TEU,B.SALE,B.CUSTNO from ");
// strSql.Append("(select GID,BSNO,(select top 1 BSNO from v_op_bill where (MBLNO=D.b_mblno or HBLNO=D.MBLNO) and OPLBNAME in('海运进口','海运出口','空运进口','空运出口')) B_BSNO,MBLNO,B_MBLNO,RMBAMOUNT,USDAMOUNT,L_RMBAMOUNT,L_USDAMOUNT,ISOK,REMARK,REMARK2 ");
strSql.Append("(select GID,BSNO,B_BSNO,MBLNO,B_MBLNO,RMBAMOUNT,USDAMOUNT,L_RMBAMOUNT,L_USDAMOUNT,ISOK,REMARK,REMARK2 ");
strSql.Append("(select GID,BSNO,B_BSNO,MBLNO,B_MBLNO,RMBAMOUNT,USDAMOUNT,L_RMBAMOUNT,L_USDAMOUNT,ISOK,REMARK,REMARK2,B_AMOUNT ");
strSql.Append(",isnull(RMBAMOUNT,0)-isnull(L_RMBAMOUNT,0) Y_RMBAMOUNT,isnull(USDAMOUNT,0)-isnull(L_USDAMOUNT,0) Y_USDAMOUNT ");
strSql.Append(" from CH_FEE_AutoDuiDetail D ");
if (!string.IsNullOrEmpty(strCondition))
@ -184,7 +184,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeAutoDuiDAL
{
var strSql = new StringBuilder();
strSql.Append("select D.GID,D.BSNO,B.BSNO B_BSNO,D.MBLNO,d.B_MBLNO,dbo.trimdate(B.ETD) ETD,B.CUSTOMERNAME,B.OP,B.CARRIER,B.TEU,B.SALE,B.CUSTNO,D.RMBAMOUNT,D.USDAMOUNT,D.L_RMBAMOUNT,D.L_USDAMOUNT,D.ISOK,D.REMARK,D.REMARK2 ");
strSql.Append("select D.GID,D.BSNO,B.BSNO B_BSNO,D.MBLNO,d.B_MBLNO,dbo.trimdate(B.ETD) ETD,B.CUSTOMERNAME,B.OP,B.CARRIER,B.TEU,B.SALE,B.CUSTNO,D.RMBAMOUNT,D.USDAMOUNT,D.L_RMBAMOUNT,D.L_USDAMOUNT,D.ISOK,D.REMARK,D.REMARK2,D.B_AMOUNT ");
strSql.Append(" from CH_FEE_AutoDuiDetail D left join V_op_bill B on B.MBLNO=D.MBLNO ");
if (!string.IsNullOrEmpty(strCondition))
{
@ -232,6 +232,9 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeAutoDuiDAL
strSql.Append(" isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0)- ");
strSql.Append(" isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS L_USDAMOUNT ");
}
strSql.Append(",isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE WHEN F.FEESTATUS=0 OR F.FEESTATUS=8 OR F.FEESTATUS=9 THEN 0 ELSE ISNULL(AMOUNT,0) END)ELSE 0 END),0)- ");
strSql.Append(" isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE WHEN F.FEESTATUS=0 OR F.FEESTATUS=8 OR F.FEESTATUS=9 THEN 0 ELSE ISNULL(AMOUNT,0) END)ELSE 0 END),0) AS B_AMOUNT ");
strSql.Append(" FROM CH_FEE F ");
strSql.Append(" INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) ");
strSql.Append(" where F.AMOUNT<>F.SETTLEMENT and F.CUSTOMERNAME='" + CUSTOMERNAME + "' and EXISTS (select 1 from CH_FEE_AutoDuiDetail fd where (fd.MBLNO=B.MBLNO OR fd.MBLNO=B.HBLNO) and fd.BSNO='" + AutoDui_GID + "') ");
@ -293,6 +296,10 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeAutoDuiDAL
strSql.Append(" isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0)- ");
strSql.Append(" isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS L_USDAMOUNT ");
}
strSql.Append(",isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE WHEN F.FEESTATUS=0 OR F.FEESTATUS=8 OR F.FEESTATUS=9 THEN 0 ELSE ISNULL(AMOUNT,0) END)ELSE 0 END),0)- ");
strSql.Append(" isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE WHEN F.FEESTATUS=0 OR F.FEESTATUS=8 OR F.FEESTATUS=9 THEN 0 ELSE ISNULL(AMOUNT,0) END)ELSE 0 END),0) AS B_AMOUNT ");
strSql.Append(" FROM CH_FEE F ");
strSql.Append(" INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) ");
strSql.Append(" where F.AMOUNT<>F.SETTLEMENT and F.CUSTOMERNAME='" + CUSTOMERNAME + "' and EXISTS (select 1 from CH_FEE_AutoDuiDetail fd where (fd.MBLNO=B.MBLNO OR fd.MBLNO=B.HBLNO) and fd.BSNO='" + AutoDui_GID + "') ");
@ -375,6 +382,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeAutoDuiDAL
data.ISOK = Convert.ToString(reader["ISOK"]);
data.REMARK = Convert.ToString(reader["REMARK"]);
data.REMARK2 = Convert.ToString(reader["REMARK2"]);
data.B_AMOUNT = Convert.ToString(reader["B_AMOUNT"]);
try
{
data.Y_RMBAMOUNT = Convert.ToDecimal(data.RMBAMOUNT) - Convert.ToDecimal(data.L_RMBAMOUNT);
@ -809,6 +817,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeAutoDuiDAL
{
_D.L_RMBAMOUNT = _localDetail.L_RMBAMOUNT;
_D.L_USDAMOUNT = _localDetail.L_USDAMOUNT;
_D.B_AMOUNT= _localDetail.B_AMOUNT;
}
if (_D.REMARK2 != "对方账单无此提单号")

@ -12011,6 +12011,9 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlChFeeDAL
foreach (var enumValue in CwVouitemsEntities)
{
if (enumValue.ORDNO == enumValue0.ORDNO)
{
if (enumValue.AMTDR != 0 && enumValue.AMTCR != 0)
{
if (n == 1)
{
@ -12024,7 +12027,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlChFeeDAL
}
}
enumValue.GID = Guid.NewGuid().ToString();
// enumValue.ITEMNO = n;
// enumValue.ITEMNO = n;
dlRMBd += enumValue.AMTDR;
dlRMBc += enumValue.AMTCR;
enumValue.DbOperationType = DbOperationType.DbotIns;
@ -12033,6 +12036,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlChFeeDAL
n++;
CwVouitemsEntitiesCopy.Add(enumValue);
}
}
}
//
var modb3 = new ModelObjectDB();

@ -41,7 +41,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpRailwayDAL
//
var strSql = new StringBuilder();
strSql.Append("SELECT B.BSNO,MASTERNO,BSSTATUS,FEESTATUS,BSDATE,ACCDATE,MBLNO,HBLNO,ORDERNO,CUSTNO,TRANSNO,CUSTOMERNAME,BLTYPE,TRANSTYPE");
strSql.Append(",TRANSDIRECT,TRAINNO,BSSOURCE,BSSOURCEDETAIL,PLACETRANSITENAME,ISVOU,VOUNO,REMARK");
strSql.Append(",TRANSDIRECT,TRAINNO,BSSOURCE,BSSOURCEDETAIL,PLACETRANSITENAME,ISVOU,VOUNO,REMARK,INVNO");
strSql.Append(",CARRIER,PlACERECEIPT,PLACELOADID,PLACELOAD,PLACELOADENAME,DESTINATIONID,DESTINATION,DESTINATIONDETAIL,DESTINATIONENAME,PLACETRANSITID,PLACETRANSIT,SETOUTDATE,ASETOUTDATE");
strSql.Append(",TRAINREPORTDATE,TRAINDAY,STATIONTIME,ETA,PREVESSEL,PREVOY,VESSELDAY,REPLACEDOCDATE,CUSTOMDATE,CUSTOMCLEARDATE,CUSTOMTRANSITCORP,SHENCODE,CODESTATUS,SHENCODETIME,GIVECODETIME");
strSql.Append(",ARRIVEPLACETRANSIT,SETOUTPLACETRANSIT,TRANSITDAY,RETRAINNO,RETRAINDATE,FRPLACETRANSITID,FRPLACETRANSIT,ARRIVEFRPLACETRANSIT,RECTNTYPE,RECTNDATE");
@ -90,7 +90,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpRailwayDAL
//
var strSql = new StringBuilder();
strSql.Append("SELECT B.BSNO,MASTERNO,BSSTATUS,FEESTATUS,BSDATE,ACCDATE,MBLNO,HBLNO,ORDERNO,CUSTNO,TRANSNO,CUSTOMERNAME,BLTYPE,TRANSTYPE");
strSql.Append(",TRANSDIRECT,TRAINNO,BSSOURCE,BSSOURCEDETAIL,PLACETRANSITENAME,ISVOU,VOUNO,REMARK");
strSql.Append(",TRANSDIRECT,TRAINNO,BSSOURCE,BSSOURCEDETAIL,PLACETRANSITENAME,ISVOU,VOUNO,REMARK,INVNO");
strSql.Append(",CARRIER,PlACERECEIPT,PLACELOADID,PLACELOAD,PLACELOADENAME,DESTINATIONID,DESTINATION,DESTINATIONDETAIL,DESTINATIONENAME,PLACETRANSITID,PLACETRANSIT,SETOUTDATE,ASETOUTDATE");
strSql.Append(",TRAINREPORTDATE,TRAINDAY,STATIONTIME,ETA,PREVESSEL,PREVOY,VESSELDAY,REPLACEDOCDATE,CUSTOMDATE,CUSTOMCLEARDATE,CUSTOMTRANSITCORP,SHENCODE,CODESTATUS,SHENCODETIME,GIVECODETIME");
strSql.Append(",ARRIVEPLACETRANSIT,SETOUTPLACETRANSIT,TRANSITDAY,RETRAINNO,RETRAINDATE,FRPLACETRANSITID,FRPLACETRANSIT,ARRIVEFRPLACETRANSIT,RECTNTYPE,RECTNDATE");
@ -126,7 +126,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpRailwayDAL
{
var strSql = new StringBuilder();
strSql.Append("SELECT BSNO,MASTERNO,BSSTATUS,FEESTATUS,BSDATE,ACCDATE,MBLNO,HBLNO,ORDERNO,CUSTNO,TRANSNO,CUSTOMERNAME,BLTYPE,TRANSTYPE");
strSql.Append(",TRANSDIRECT,TRAINNO,BSSOURCE,BSSOURCEDETAIL,PLACETRANSITENAME,ISVOU,VOUNO,REMARK");
strSql.Append(",TRANSDIRECT,TRAINNO,BSSOURCE,BSSOURCEDETAIL,PLACETRANSITENAME,ISVOU,VOUNO,REMARK,INVNO");
strSql.Append(",CARRIER,PlACERECEIPT,PLACELOADID,PLACELOAD,PLACELOADENAME,DESTINATIONID,DESTINATION,DESTINATIONDETAIL,DESTINATIONENAME,PLACETRANSITID,PLACETRANSIT,SETOUTDATE,ASETOUTDATE");
strSql.Append(",TRAINREPORTDATE,TRAINDAY,STATIONTIME,ETA,PREVESSEL,PREVOY,VESSELDAY,REPLACEDOCDATE,CUSTOMDATE,CUSTOMCLEARDATE,CUSTOMTRANSITCORP,SHENCODE,CODESTATUS,SHENCODETIME,GIVECODETIME");
strSql.Append(",ARRIVEPLACETRANSIT,SETOUTPLACETRANSIT,TRANSITDAY,RETRAINNO,RETRAINDATE,FRPLACETRANSITID,FRPLACETRANSIT,ARRIVEFRPLACETRANSIT,RECTNTYPE,RECTNDATE");
@ -303,6 +303,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpRailwayDAL
data.ISVOU = Convert.ToBoolean(reader["ISVOU"]);
data.VOUNO = Convert.ToString(reader["VOUNO"]);
data.REMARK = Convert.ToString(reader["REMARK"]);
data.INVNO = Convert.ToString(reader["INVNO"]);
data.ORDERNO = Convert.ToString(reader["ORDERNO"]);
data.SALECORPID = Convert.ToString(reader["SALECORPID"]);
data.SALECORP = Convert.ToString(reader["SALECORP"]);

@ -91,7 +91,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",dbo.F_GetBillCrFeeStatus(OP_SEAE.BSNO) CRFEESTATUS,ISPRINTPR,MAILPROJECT");
// strSql.Append(",S.STATUS as OPSTATUS ");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID=OP_SEAE.BSNO) as AMENDCOUNT,SHIPAGENCY ");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 TTLPROFIT,0 PROFITRATE,0 NODAY");
strSql.Append(",(SELECT COUNT(*) FROM OP_APPLY WHERE MASTERNO=OP_SEAE.BSNO) as APPLYCOUNT ");
//20161117 邓羽 增加对提单签发状态的查询
@ -227,7 +227,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",dbo.F_GetBillCrFeeStatus(OP_SEAE.BSNO) CRFEESTATUS,ISPRINTPR,MAILPROJECT");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID=OP_SEAE.BSNO) as AMENDCOUNT,SHIPAGENCY ");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 TTLPROFIT,0 PROFITRATE,0 NODAY");
strSql.Append(",(SELECT COUNT(*) FROM OP_APPLY WHERE MASTERNO=OP_SEAE.BSNO) as APPLYCOUNT ");
@ -338,7 +338,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",dbo.F_GetBillDrFeeStatus(B.BSNO) DRFEESTATUS");
strSql.Append(",dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS,ISPRINTPR,MAILPROJECT,0 AMENDCOUNT,0 as APPLYCOUNT,ISCANCEL,ISTUI,TRANSREMARK,PRERECORD ");
strSql.Append(",SHIPAGENCY");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 TTLPROFIT,0 PROFITRATE,0 NODAY");
strSql.Append(",'' MSHIPPERID,'' MCONSIGNEEID,'' MNOTIFYPARTYID,'' MSHIPPER,'' MCONSIGNEE,'' MNOTIFYPARTY,null ATD,DELIVERYDATE,YARDATTN,YARDTEL,'' COUNTRY ");
//20161117 邓羽 增加对提单签发状态的查询
@ -476,7 +476,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",dbo.F_GetBillCrFeeStatus(OP_SEAE.BSNO) CRFEESTATUS,ISPRINTPR,MAILPROJECT");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID=OP_SEAE.BSNO) as AMENDCOUNT,SHIPAGENCY ");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 TTLPROFIT,0 PROFITRATE,0 NODAY");
strSql.Append(",(SELECT COUNT(*) FROM OP_APPLY WHERE MASTERNO=OP_SEAE.BSNO) as APPLYCOUNT ");
@ -568,7 +568,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",dbo.F_GetBillCrFeeStatus(A.BSNO) CRFEESTATUS,ISPRINTPR,B.MAILPROJECT");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID=A.PARENTID) as AMENDCOUNT,SHIPAGENCY ");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 TTLPROFIT,0 PROFITRATE,0 NODAY");
strSql.Append(",0 as APPLYCOUNT ");
@ -682,7 +682,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",dbo.F_GetBillCrFeeStatus(A.BSNO) CRFEESTATUS,ISPRINTPR");
strSql.Append(",0 as AMENDCOUNT,SHIPAGENCY ");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 TTLPROFIT,0 PROFITRATE,0 NODAY");
strSql.Append(",0 as APPLYCOUNT ");
@ -769,7 +769,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",dbo.F_GetBillCrFeeStatus(OP_SEAE.BSNO) CRFEESTATUS,ISPRINTPR,MAILPROJECT");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID=OP_SEAE.BSNO) as AMENDCOUNT,SHIPAGENCY ");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 TTLPROFIT,0 PROFITRATE,0 NODAY");
strSql.Append(",(SELECT COUNT(*) FROM OP_APPLY WHERE MASTERNO=OP_SEAE.BSNO) as APPLYCOUNT ");
@ -838,7 +838,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",CUSTOMNO,ENTERPID,ENTERP,INSPECTIONNO,INSPECTIONDATE,CUSTOMDATE,CLEARCUSTOMDATE,ISMOREGOOD,TERMSDELIVERY,INSPECTSERVICE,TRADETERM,0 FENPIAO,ISGAIQIAN,WARNCOUNT");
strSql.Append(",'' DRFEESTATUS");
strSql.Append(",'' CRFEESTATUS");
strSql.Append(",SHIPAGENCY,ISPRINTPR,MAILPROJECT,0 AMENDCOUNT,0 as APPLYCOUNT,0 TTLDR,0 TTLINVDR,0 TTLDUIDR,0 TTLCR,0 TTLINVCR,0 TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY,ISCANCEL,ISTUI,''TRANSREMARK,PRERECORD ");
strSql.Append(",SHIPAGENCY,ISPRINTPR,MAILPROJECT,0 AMENDCOUNT,0 as APPLYCOUNT,0 TTLDR,0 TTLINVDR,0 TTLDUIDR,0 TTLCR,0 TTLINVCR,0 TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 TTLPROFIT,0 PROFITRATE,0 NODAY,ISCANCEL,ISTUI,''TRANSREMARK,PRERECORD ");
strSql.Append(",MSHIPPERID,MCONSIGNEEID,MNOTIFYPARTYID,MSHIPPER,MCONSIGNEE,MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL ");
// strSql.Append(",(SELECT COUNT(*) FROM OP_SEAE WHERE BSNO<>MASTERNO AND MASTERNO=B.BSNO) as FENPIAO ");
@ -901,7 +901,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",CUSTOMNO,ENTERPID,ENTERP,INSPECTIONNO,INSPECTIONDATE,CUSTOMDATE,CLEARCUSTOMDATE,ISMOREGOOD,TERMSDELIVERY,INSPECTSERVICE,TRADETERM,0 FENPIAO,ISGAIQIAN,WARNCOUNT");
strSql.Append(",dbo.F_GetBillDrFeeStatus(B.BSNO) DRFEESTATUS");
strSql.Append(",dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS");
strSql.Append(",SHIPAGENCY,ISPRINTPR,MAILPROJECT,0 AMENDCOUNT,0 as APPLYCOUNT,0 TTLDR,0 TTLINVDR,0 TTLDUIDR,0 TTLCR,0 TTLINVCR,0 TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY,ISCANCEL,ISTUI,'' TRANSREMARK,PRERECORD");
strSql.Append(",SHIPAGENCY,ISPRINTPR,MAILPROJECT,0 AMENDCOUNT,0 as APPLYCOUNT,0 TTLDR,0 TTLINVDR,0 TTLDUIDR,0 TTLCR,0 TTLINVCR,0 TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 TTLPROFIT,0 PROFITRATE,0 NODAY,ISCANCEL,ISTUI,'' TRANSREMARK,PRERECORD");
strSql.Append(",'' MSHIPPERID,'' MCONSIGNEEID,'' MNOTIFYPARTYID,'' MSHIPPER,'' MCONSIGNEE,'' MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL ");
@ -972,7 +972,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",CUSTOMNO,ENTERPID,ENTERP,INSPECTIONNO,INSPECTIONDATE,CUSTOMDATE,CLEARCUSTOMDATE,ISMOREGOOD,TERMSDELIVERY,INSPECTSERVICE,TRADETERM,0 FENPIAO,ISGAIQIAN,WARNCOUNT");
strSql.Append(",dbo.F_GetBillDrFeeStatus(B.BSNO) DRFEESTATUS");
strSql.Append(",dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS");
strSql.Append(",SHIPAGENCY,ISPRINTPR,MAILPROJECT,0 AMENDCOUNT,0 as APPLYCOUNT,0 TTLDR,0 TTLINVDR,0 TTLCR,0 TTLINVCR,0 TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 NODAY,ISCANCEL,ISTUI");
strSql.Append(",SHIPAGENCY,ISPRINTPR,MAILPROJECT,0 AMENDCOUNT,0 as APPLYCOUNT,0 TTLDR,0 TTLINVDR,0 TTLCR,0 TTLINVCR,0 TTLDUICR,0 YJCR,0 HYFDR,0 HYFCR,0 BGFDR,0 TTLPROFIT,0 PROFITRATE,0 NODAY,ISCANCEL,ISTUI");
strSql.Append(",'' MSHIPPERID,'' MCONSIGNEEID,'' MNOTIFYPARTYID,'' MSHIPPER,'' MCONSIGNEE,'' MNOTIFYPARTY,ATD,DELIVERYDATE,YARDATTN,YARDTEL ");
@ -1359,6 +1359,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
data.HYFDR = Convert.ToString(reader["HYFDR"]);
data.HYFCR = Convert.ToString(reader["HYFCR"]);
data.BGFDR = Convert.ToString(reader["BGFDR"]);
data.PROFITRATE = Convert.ToString(reader["PROFITRATE"]);
data.TTLPROFIT = Convert.ToString(reader["TTLPROFIT"]);
data.GROUPBS = data.ETD +"-"+ data.CARRIER+ "-" + data.LANE +"-"+ data.VESSEL+data.VOYNO;
#endregion
headList.Add(data);
@ -1409,7 +1411,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
else if (sortstring.ToUpper().IndexOf("DRDUISTATUS") >= 0)
strSql.Append(" order by " + sortstring.Replace("DRDUISTATUS", " CASE WHEN ISNULL(I.TTLDUIDR,0)=0 THEN '未对账' ELSE CASE WHEN ISNULL(I.TTLDUIDR,0)=ISNULL(I.TTLDR,0) THEN '已对账' ELSE '部分对账' END END "));
else if (sortstring.ToUpper().IndexOf("GROUPBS") >= 0)
strSql.Append(" order by " + sortstring.Replace("GROUPBS", " ISNULL(ETD,GETDATE()+1000) DESC,CARRIER,LANE,DESTINATION,VESSEL,VOYNO desc "));
strSql.Append(" order by " + sortstring.Replace("GROUPBS", " ISNULL(ETD,GETDATE()+1000) DESC,CARRIER,LANE,DESTINATION,VESSEL,VOYNO "));
else
{
sortstring = sortstring.Replace("SALECORP", "OP_SEAE.SALECORPID");
@ -1447,7 +1449,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",dbo.F_GetBillCrFeeStatus(OP_SEAE.BSNO) CRFEESTATUS,ISPRINTPR,MAILPROJECT");
strSql.Append(",(SELECT COUNT(*) FROM OP_AMEND WHERE PARENTID=OP_SEAE.BSNO) as AMENDCOUNT,SHIPAGENCY ");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,I.YJCR,I.HYFDR,I.HYFCR,I.BGFDR,case ETD when '' then 0 else case when I.TTLBALDR<>0 then DATEDIFF([day],CASE WHEN STLDATE IS NULL THEN ETD ELSE STLDATE END,GETDATE()) ");
strSql.Append(",I.TTLDR,I.TTLINVDR,I.TTLDUIDR,I.TTLCR,I.TTLINVCR,I.TTLDUICR,I.YJCR,I.HYFDR,I.HYFCR,I.BGFDR,I.TTLPROFIT,I.PROFITRATE,case ETD when '' then 0 else case when I.TTLBALDR<>0 then DATEDIFF([day],CASE WHEN STLDATE IS NULL THEN ETD ELSE STLDATE END,GETDATE()) ");
strSql.Append(" else 0 end end AS NODAY");
strSql.Append(",(SELECT COUNT(*) FROM OP_APPLY WHERE MASTERNO=OP_SEAE.BSNO) as APPLYCOUNT ");
@ -1942,6 +1944,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
headData.CONSIGNEE = DelEndSpace(headData.CONSIGNEE);
headData.NOTIFYPARTY = FullWidthToHalfWidth(ToDBC(headData.NOTIFYPARTY));
headData.NOTIFYPARTY = DelEndSpace(headData.NOTIFYPARTY);
headData.VESSEL = FullWidthToHalfWidth(ToDBC(DelEndSpace(headData.VESSEL)));
headData.VOYNO = FullWidthToHalfWidth(ToDBC(DelEndSpace(headData.VOYNO)));
//headData.MSHIPPER = ToDBC(headData.MSHIPPER);
//headData.MSHIPPER = DelEndSpace(headData.MSHIPPER);
//headData.MCONSIGNEE = ToDBC(headData.MCONSIGNEE);
@ -3484,6 +3488,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
strSql.Append(",SERVICECONTRACTNO=@SERVICECONTRACTNO");
if (modifydata.ORDERNO != "" && modifydata.ORDERNO != null)
strSql.Append(",ORDERNO=@ORDERNO");
if (!string.IsNullOrEmpty(modifydata.HSCODE))
strSql.Append(",HSCODE=@HSCODE");
if (modifydata.ISFUMIGATION) strSql.Append(",ISFUMIGATION=1");
if (modifydata.ISSTORAGE) strSql.Append(",ISSTORAGE=1");
if (modifydata.ISLAND) strSql.Append(",ISLAND=1");
@ -3726,6 +3732,9 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
db.AddInParameter(cmdupdate, "@SERVICECONTRACTNO", DbType.String, modifydata.SERVICECONTRACTNO);
if (modifydata.ORDERNO != "" && modifydata.ORDERNO != null)
db.AddInParameter(cmdupdate, "@ORDERNO", DbType.String, modifydata.ORDERNO);
if (!string.IsNullOrEmpty(modifydata.HSCODE))
db.AddInParameter(cmdupdate, "@HSCODE", DbType.String, modifydata.HSCODE);
db.AddInParameter(cmdupdate, "@BSNO", DbType.String, enumValue.BSNO);
db.ExecuteNonQuery(cmdupdate, tran);
db.AddInParameter(cmdupdateBL, "@BSNO", DbType.String, enumValue.BSNO);

@ -10732,13 +10732,14 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
r.WriteLine("00:IFCSUM:MANIFEST:" + filerole + ":" + ftpset.SENDCODE + ":" + ftpset.RECEIVECODE + ":" + DateTime.Now.ToString("yyMMddHHmm") + "'");
var isfirst = true;
icount = icount + 1;
foreach (var bill in headData)
{
OpBill = MsOpSeaeDAL.MsOpSeaeDAL.GetBillData("BSNO='" + bill.BSNO + "'");
if (isfirst)
{
r.WriteLine("10::" + bill.VESSEL + "::" + bill.VOYNO + "::" + bill.LANE + ":" + GetDateStr(bill.ETA, "yyyyMMdd") + ":" + GetDateStr(bill.ETD, "yyyyMMdd") + ":"+bill.PORTLOADID+":"+bill.PORTLOAD+"'");
r.WriteLine("10::" + bill.VESSEL + ":" + bill.VOYNO + "::" + bill.LANE + ":" + GetDateStr(bill.ETA, "yyyyMMdd") + ":" + GetDateStr(bill.ETD, "yyyyMMdd") + ":"+bill.PORTLOADID+":"+bill.PORTLOAD+"'");
r.WriteLine("11:" + ftpset.SENDCODE + ":" + bill.CARRIER + "'");
isfirst = false;
}
@ -10756,7 +10757,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
if (isbill == 1)
{
r.WriteLine("12:" + OpBill.MBLNO.Trim() + "::::::" + GetPortEDICode(OpBill.PORTLOADID, type) + ":" + OpBill.PORTLOAD
+ ":" + OpBill.SERVICE + ":" + xtype + "::::::'");
+ ":" + OpBill.SERVICE + ":" + xtype + ":" + GetDateStr(bill.ETD, "yyyyMMdd") + ":::::'");
r.WriteLine("13:" + GetPortEDICode(OpBill.PORTDISCHARGEID, type) + ":" + OpBill.PORTDISCHARGE
+ ":" + GetPortEDICode(OpBill.DESTINATIONID, type) + ":" + OpBill.DESTINATION + "::::" + OpBill.ISSUEPLACE + "::'");
@ -10765,7 +10766,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
{
r.WriteLine("12:" + bill.MBLNO.Trim() + "::::::" + GetPortEDICode(bill.PORTLOADID, type) + ":" + bill.PORTLOAD
+ ":" + bill.SERVICE + ":" + xtype + "::::::'");
+ ":" + bill.SERVICE + ":" + xtype + ":"+ GetDateStr(bill.ETD, "yyyyMMdd") + ":::::'");
r.WriteLine("13:" + GetPortEDICode(bill.PORTDISCHARGEID, type) + ":" + bill.PORTDISCHARGE
+ ":" + GetPortEDICode(bill.DESTINATIONID, type) + ":" + bill.DESTINATION + "::::" + bill.ISSUEPLACE + "::'");
}
@ -10799,17 +10800,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
r.WriteLine("18::" + formatListStr(ShippingList, 6) + "'");
}
if (isbill == 1)
Shipping = formatEdiStr("txt", OpBill.AGENT);
else
Shipping = formatEdiStr("txt", bill.AGENT);
ShippingList = formatlengthStr(Shipping, 35);
if (ShippingList.Count != 0 && Shipping.Length > 0)
{
r.WriteLine("19::" + formatListStr(ShippingList, 6) + "'");
}
var cargoid = bill.CARGOID;
@ -10819,7 +10810,52 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
r.WriteLine("41:1:0:" + bill.PKGS.ToString() + "::" + bill.KINDPKGS + ":"
+ bill.KGS.ToString() + "::" + bill.CBM.ToString() + "'");
icount = icount + 10;
icount = icount + 8;
Shipping = formatEdiStr("txt", OpBill.DESCRIPTION);
ShippingList = formatlengthStr(Shipping, 300);
var m = 1;
var strtemp = "";
if (ShippingList.Count != 0 && Shipping.Length > 0)
{
for (var i = 0; i < ShippingList.Count; i++)
{
if (m <= 5)
{
if (m == 1) strtemp = "42:" + ShippingList[i] + ":";
else
{
if (m == 5)
strtemp = strtemp + ShippingList[i];
else
strtemp = strtemp + ShippingList[i] + ":";
}
}
else
{
m = 1;
r.WriteLine(strtemp + "'");
strtemp = "42:" + ShippingList[i] + ":";
icount = icount + 1;
}
m = m + 1;
}
}
if (strtemp != "")
{
r.WriteLine(strtemp + "'");
icount = icount + 1;
};
if (cargoid == "D")
{
@ -10829,7 +10865,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
}
if (cargoid == "R")
{
r.WriteLine("43:" + bill.TEMPID + ":" + bill.TEMPSET + ":" + bill.TEMPMIN + ":" + bill.TEMPMAX + "'");
r.WriteLine("43:" + bill.TEMPID + ":" + bill.TEMPSET + ":" + bill.REEFERF + ":" + bill.HUMIDITY + "'");
icount = icount + 1;
}
@ -10850,14 +10886,11 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
}
if (isbill == 1)
Shipping = formatEdiStr("txt", OpBill.DESCRIPTION);
else
Shipping = formatEdiStr("txt", bill.DESCRIPTION);
ShippingList = formatlengthStr(Shipping, 300);
Shipping = formatEdiStr("txt", OpBill.DESCRIPTION);
ShippingList = formatlengthStr(Shipping, 300);
var m = 1;
var strtemp = "";
m = 1;
strtemp = "";
if (ShippingList.Count != 0 && Shipping.Length > 0)
{
@ -10911,7 +10944,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
var ctnlist = MsOpSeaeDAL.MsOpSeaeDAL.GetBodyList("BSNO='" + bill.BSNO + "'");
foreach (var ctn in ctnlist)
{
r.WriteLine("51:001:" + ctn.CNTRNO + ":" + ctn.SEALNO + ":" + ctn.SIZE.ToString() + ctn.CTN + ":F:" + ctn.PKGS.ToString()
r.WriteLine("51:001:" + ctn.CNTRNO + ":" + ctn.SEALNO + ":" + GetCtnEDICode(ctn.CTNALL,"NHEDI") + ":F:" + ctn.PKGS.ToString()
+ ":" + ctn.KGS.ToString() + "::" + ctn.CBM.ToString() + "'");
icount = icount + 1;
}

@ -11,6 +11,11 @@ using DSWeb.TruckMng.Helper.Repository;//ModelObjectRepository
using DSWeb.MvcShipping.Helper;
using DSWeb.Areas.CommMng.DAL;//使用获取权限子句
using DSWeb.Areas.SysMng.DAL.SysTask;
using DSWeb.MvcShipping.DAL.ChMonthCloseDAL;
using DSWeb.MvcShipping.DAL.MsSysBillNoSet;
using HcUtility.Core;
using DSWeb.MvcShipping.Models.MsChFee;
using DSWeb.MvcShipping.DAL.MsChFeeDAL;
namespace DSWeb.Areas.MvcShipping.DAL.MsOp_InternalTrade
{
@ -154,7 +159,806 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_InternalTrade
}
#endregion
public static DBResult ImpOpInternalTrade(DataTable table, string userid, string username, string companyid)
{
var result = new DBResult();
var PreCUSTNO = "";
var BSNO = "";
Database db = DatabaseFactory.CreateDatabase();
var cmdInsert =
db.GetSqlStringCommand(
@"insert into op_InternalTrade_Detail (GID,BSNO,ORDERNO,LOTNO,GOODSNAME,PACKEGS,LOADDATE,LOADADDR,SEQUENCE)
values (@GID,@BSNO,@ORDERNO,@LOTNO,@GOODSNAME,@PACKEGS,@LOADDATE,@LOADADDR,@SEQUENCE) ");
var _date = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
try
{
var CUSTOMERNAME = "";
var TRUCKER = "";
var TRUCKER2 = "";
var CARRIER = "";
int num = 0;
foreach (DataRow row in table.Rows)
{
if (row[1].ToString() != "")
{
num = num + 1;
var CUSTNO = Convert.ToString(row["委托编号"]);
if (!string.IsNullOrEmpty(CUSTNO))
{
PreCUSTNO = CUSTNO;
num = 0;
var headData = new MsOp_INTERNALTRADEmb();
headData.GetTableField(db);
BSNO = System.Guid.NewGuid().ToString();
headData.SetValue("BSNO", BSNO);
headData.SetValue("MASTERNO", BSNO);
headData.SetValue("BSSTATUS", "0");
headData.SetValue("FEESTATUS","0");
headData.SetValue("BSDATE", _date);
headData.SetValue("CREATOR", username);
headData.SetValue("OP", username);
headData.SetValue("DOC", username);
headData.SetValue("CUSTSERVICE", username);
headData.SetValue("CORPID", companyid);
headData.SetValue("SALECORPID", companyid);
headData.DbOperationType = DbOperationType.DbotIns;
headData.SetValue("CUSTNO", CUSTNO);
CUSTOMERNAME = Convert.ToString(row["委托单位"]);
headData.SetValue("CUSTOMERNAME", CUSTOMERNAME);
headData.SetValue("MBLNO", Convert.ToString(row["主提单号"]));
headData.SetValue("OP", Convert.ToString(row["操作"]));
headData.SetValue("SALE", Convert.ToString(row["销售"]));
CARRIER = Convert.ToString(row["船公司"]);
headData.SetValue("CARRIER", CARRIER);
headData.SetValue("VESSEL", Convert.ToString(row["船名"]));
headData.SetValue("VOYNO", Convert.ToString(row["航次"]));
var period = ChMonthCloseDAL.GetData("", companyid);
if (Convert.ToDateTime(period.FDAY) > DateTime.Now)
{
headData.SetValue("ACCDATE", period.PERIOD);
}
else
{
headData.SetValue("ACCDATE", DateTime.Now.ToString("yyyy-MM"));
}
headData.SetValue("PORTLOADID", Convert.ToString(row["启运港"]));
headData.SetValue("ETD", Convert.ToString(row["开船日期"]));
headData.SetValue("ETA", Convert.ToString(row["到港日期"]));
headData.SetValue("EMPTYCTNTOSHIPPERDATE", Convert.ToString(row["提箱日期"]));
headData.SetValue("CTNALL", Convert.ToString(row["箱型"]));
headData.SetValue("SALEDEPT", Convert.ToString(row["所属部门"]));
TRUCKER = Convert.ToString(row["装货车队"]);
headData.SetValue("TRUCKER", TRUCKER);
headData.SetValue("TRUCKNO", Convert.ToString(row["装货车牌号"]));
headData.SetValue("CNTRNO", Convert.ToString(row["箱号"]));
headData.SetValue("SEALNO", Convert.ToString(row["封号"]));
headData.SetValue("PORTDISCHARGEID", Convert.ToString(row["目的港"]));
headData.SetValue("CONSIGNEE", Convert.ToString(row["收货人"]));
headData.SetValue("CONSIGNEETEL", Convert.ToString(row["收货人电话"]));
headData.SetValue("PlACERECEIPT", Convert.ToString(row["收货人地址"]));
TRUCKER2 = Convert.ToString(row["送货车队名称"]);
headData.SetValue("TRUCKER2", TRUCKER2);
headData.SetValue("TRUCKNO2", Convert.ToString(row["送货车牌号"]));
headData.SetValue("RECEIVEDATE", Convert.ToString(row["到厂日期"]));
headData.SetValue("DISCHARGEREMARK", Convert.ToString(row["备注"]));
var modb = new ModelObjectDB();
result = modb.Save(headData);
}
if (result.Success)
{
cmdInsert.Parameters.Clear();
db.AddInParameter(cmdInsert, "@GID", DbType.String, Guid.NewGuid().ToString());
db.AddInParameter(cmdInsert, "@BSNO", DbType.String, BSNO);
db.AddInParameter(cmdInsert, "@ORDERNO", DbType.String, Convert.ToString(row["系统订单号"]));
db.AddInParameter(cmdInsert, "@LOTNO", DbType.String, Convert.ToString(row["批次号"]));
db.AddInParameter(cmdInsert, "@GOODSNAME", DbType.String, Convert.ToString(row["品名"]));
db.AddInParameter(cmdInsert, "@PACKEGS", DbType.String, Convert.ToString(row["单柜数量"]));
db.AddInParameter(cmdInsert, "@LOADDATE", DbType.String, Convert.ToString(row["装箱时间"]));
db.AddInParameter(cmdInsert, "@LOADADDR", DbType.String, Convert.ToString(row["装箱地点"]));
db.AddInParameter(cmdInsert, "@SEQUENCE", DbType.Int16, num);
db.ExecuteNonQuery(cmdInsert);
var newfeelist = new List<MsChFee>();
var baoxian = Convert.ToString(row["保险费"]);
var baoxiangongs = Convert.ToString(row["保险公司名称"]);
if ((!string.IsNullOrEmpty(baoxian)) &&(Convert.ToDecimal(baoxian)!=0)) {
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType =2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName ="保险费";
enumValueBody.CustomerName = baoxiangongs;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(baoxian);
enumValueBody.Amount = Convert.ToDecimal(baoxian);
enumValueBody.NoTaxAmount = Convert.ToDecimal(baoxian);
enumValueBody.Currency ="RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var HYF = Convert.ToString(row["海运费"]);
var HYFGS = Convert.ToString(row["船公司名称"]);
if ((!string.IsNullOrEmpty(HYF)) && (Convert.ToDecimal(HYF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "海运费";
enumValueBody.CustomerName = HYFGS;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(HYF);
enumValueBody.Amount = Convert.ToDecimal(HYF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(HYF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var QYGLYF = Convert.ToString(row["起始港陆运费"]);
var QYGLYFGS = Convert.ToString(row["车队名称1"]);
if ((!string.IsNullOrEmpty(QYGLYF)) && (Convert.ToDecimal(QYGLYF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "起始港陆运费";
enumValueBody.CustomerName = QYGLYFGS;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(QYGLYF);
enumValueBody.Amount = Convert.ToDecimal(QYGLYF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(QYGLYF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var QYGLXF = Convert.ToString(row["落箱费"]);
if ((!string.IsNullOrEmpty(QYGLXF)) && (Convert.ToDecimal(QYGLXF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "落箱费";
enumValueBody.CustomerName = TRUCKER;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(QYGLXF);
enumValueBody.Amount = Convert.ToDecimal(QYGLXF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(QYGLXF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var QYGYYFJF = Convert.ToString(row["起始港燃油附加费"]);
if ((!string.IsNullOrEmpty(QYGYYFJF)) && (Convert.ToDecimal(QYGYYFJF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "起始港燃油附加费";
enumValueBody.CustomerName = TRUCKER;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(QYGYYFJF);
enumValueBody.Amount = Convert.ToDecimal(QYGYYFJF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(QYGYYFJF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var QYGCZF = Convert.ToString(row["船证费"]);
if ((!string.IsNullOrEmpty(QYGCZF)) && (Convert.ToDecimal(QYGCZF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "船证费";
enumValueBody.CustomerName = TRUCKER;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(QYGCZF);
enumValueBody.Amount = Convert.ToDecimal(QYGCZF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(QYGCZF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var MDGLYF = Convert.ToString(row["目的港陆运费"]);
var MDGLYFGS = Convert.ToString(row["车队名称2"]);
if ((!string.IsNullOrEmpty(MDGLYF)) && (Convert.ToDecimal(MDGLYF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "目的港陆运费";
enumValueBody.CustomerName = MDGLYFGS;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(MDGLYF);
enumValueBody.Amount = Convert.ToDecimal(MDGLYF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(MDGLYF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var MDGZF = Convert.ToString(row["目的港杂费"]);
if ((!string.IsNullOrEmpty(MDGZF)) && (Convert.ToDecimal(MDGZF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "目的港杂费";
enumValueBody.CustomerName = TRUCKER2;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(MDGZF);
enumValueBody.Amount = Convert.ToDecimal(MDGZF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(MDGZF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var YYFJF = Convert.ToString(row["燃油附加费"]);
if ((!string.IsNullOrEmpty(YYFJF)) && (Convert.ToDecimal(YYFJF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "燃油附加费";
enumValueBody.CustomerName = TRUCKER2;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(YYFJF);
enumValueBody.Amount = Convert.ToDecimal(YYFJF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(YYFJF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var ZXF = Convert.ToString(row["装卸费"]);
if ((!string.IsNullOrEmpty(ZXF)) && (Convert.ToDecimal(ZXF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "装卸费";
enumValueBody.CustomerName = TRUCKER2;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(ZXF);
enumValueBody.Amount = Convert.ToDecimal(ZXF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(ZXF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var BW1J = Convert.ToString(row["保温一级"]);
if ((!string.IsNullOrEmpty(BW1J)) && (Convert.ToDecimal(BW1J) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "保温一级";
enumValueBody.CustomerName = TRUCKER2;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(BW1J);
enumValueBody.Amount = Convert.ToDecimal(BW1J);
enumValueBody.NoTaxAmount = Convert.ToDecimal(BW1J);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var BW2J = Convert.ToString(row["保温二级"]);
if ((!string.IsNullOrEmpty(BW2J)) && (Convert.ToDecimal(BW2J) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "保温二级";
enumValueBody.CustomerName = TRUCKER2;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(BW2J);
enumValueBody.Amount = Convert.ToDecimal(BW2J);
enumValueBody.NoTaxAmount = Convert.ToDecimal(BW2J);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var BW3J = Convert.ToString(row["保温三级"]);
if ((!string.IsNullOrEmpty(BW3J)) && (Convert.ToDecimal(BW3J) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "保温三级";
enumValueBody.CustomerName = TRUCKER2;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(BW3J);
enumValueBody.Amount = Convert.ToDecimal(BW3J);
enumValueBody.NoTaxAmount = Convert.ToDecimal(BW3J);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var CGSLYF = Convert.ToString(row["船公司陆运费"]);
if ((!string.IsNullOrEmpty(CGSLYF)) && (Convert.ToDecimal(CGSLYF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "陆运费";
enumValueBody.CustomerName = CARRIER;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(CGSLYF);
enumValueBody.Amount = Convert.ToDecimal(CGSLYF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(CGSLYF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var MDGHDF = Convert.ToString(row["目的港换单费"]);
if ((!string.IsNullOrEmpty(MDGHDF)) && (Convert.ToDecimal(MDGHDF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "换单费";
enumValueBody.CustomerName = TRUCKER2;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(MDGHDF);
enumValueBody.Amount = Convert.ToDecimal(MDGHDF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(MDGHDF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var RYFJF = Convert.ToString(row["燃油附加费"]);
if ((!string.IsNullOrEmpty(RYFJF)) && (Convert.ToDecimal(RYFJF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "燃油附加费";
enumValueBody.CustomerName = TRUCKER2;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(RYFJF);
enumValueBody.Amount = Convert.ToDecimal(RYFJF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(RYFJF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var PSF = Convert.ToString(row["破损"]);
if ((!string.IsNullOrEmpty(PSF)) && (Convert.ToDecimal(PSF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "破损";
enumValueBody.CustomerName = TRUCKER2;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(PSF);
enumValueBody.Amount = Convert.ToDecimal(PSF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(PSF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
enumValueBody.Remark= Convert.ToString(row["破损备注"]);
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var DCCQF = Convert.ToString(row["堆存超期费"]);
if ((!string.IsNullOrEmpty(DCCQF)) && (Convert.ToDecimal(DCCQF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "堆存超期费";
enumValueBody.CustomerName = TRUCKER2;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(DCCQF);
enumValueBody.Amount = Convert.ToDecimal(DCCQF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(DCCQF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var XSCQF = Convert.ToString(row["箱使费超期"]);
if ((!string.IsNullOrEmpty(XSCQF)) && (Convert.ToDecimal(XSCQF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "箱使费超期";
enumValueBody.CustomerName = CARRIER;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(XSCQF);
enumValueBody.Amount = Convert.ToDecimal(XSCQF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(XSCQF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var XTFJF = Convert.ToString(row["箱体附加费"]);
if ((!string.IsNullOrEmpty(XTFJF)) && (Convert.ToDecimal(XTFJF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "箱体附加费";
enumValueBody.CustomerName = CARRIER;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(XTFJF);
enumValueBody.Amount = Convert.ToDecimal(XTFJF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(XTFJF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var YSYF = Convert.ToString(row["运费"]);
if ((!string.IsNullOrEmpty(YSYF)) && (Convert.ToDecimal(YSYF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 1;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "运费";
enumValueBody.CustomerName = CUSTOMERNAME;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(YSYF);
enumValueBody.Amount = Convert.ToDecimal(YSYF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(YSYF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var HYGZF = Convert.ToString(row["海运港杂费"]);
if ((!string.IsNullOrEmpty(HYGZF)) && (Convert.ToDecimal(HYGZF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "海运港杂费";
enumValueBody.CustomerName = CARRIER;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(HYGZF);
enumValueBody.Amount = Convert.ToDecimal(HYGZF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(HYGZF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var HYCZF = Convert.ToString(row["海运操作费"]);
if ((!string.IsNullOrEmpty(HYCZF)) && (Convert.ToDecimal(HYCZF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "海运操作费";
enumValueBody.CustomerName = CARRIER;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(HYCZF);
enumValueBody.Amount = Convert.ToDecimal(HYCZF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(HYCZF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
var HYDZF = Convert.ToString(row["海运单证费"]);
if ((!string.IsNullOrEmpty(HYCZF)) && (Convert.ToDecimal(HYCZF) != 0))
{
var enumValueBody = new MsChFee();
enumValueBody.GId = Guid.NewGuid().ToString();
enumValueBody.BsNo = "*";
enumValueBody.FeeType = 2;
enumValueBody.FeeStatus = 0;
enumValueBody.FeeName = "海运单证费";
enumValueBody.CustomerName = CARRIER;
enumValueBody.EnteroPerator = userid;
enumValueBody.Unit = "票";
enumValueBody.Quantity = 1;
enumValueBody.UnitPrice = Convert.ToDecimal(HYDZF);
enumValueBody.Amount = Convert.ToDecimal(HYDZF);
enumValueBody.NoTaxAmount = Convert.ToDecimal(HYDZF);
enumValueBody.Currency = "RMB";
enumValueBody.ExChangerate = 1;
enumValueBody.IsOpen = "0";
enumValueBody.IsAdvancedpay = "0";
enumValueBody.FeeStatus = 1;
enumValueBody.TaxRate = 0;
enumValueBody.AccTaxRate = 0;
enumValueBody.IsInvoice = "0";
enumValueBody.LOCALCURR = "RMB";
if (enumValueBody.Amount != 0)
newfeelist.Add(enumValueBody);
}
if (newfeelist.Count != 0)
MsChFeeDAL.SaveUpdateFee(newfeelist,BSNO, userid);
}
}
}
result.Success = true;
result.Message = "导入成功";
}
catch (Exception ex)
{
result.Success = false;
result.Message = "导入中出错:" + ex.Message;
}
return result;
}
}
}

@ -12,6 +12,232 @@ namespace DSWeb.MvcShipping.Helper
{
public static class ExcelHelper
{
/// <summary>
/// 将excel文件内容读取到DataTable数据表中
/// </summary>
/// <param name="fileName">文件完整路径名</param>
/// <param name="sheetName">指定读取excel工作薄sheet的名称</param>
/// <param name="isFirstRowColumn">第一行是否是DataTable的列名true=是false=否</param>
/// <returns>DataTable数据表</returns>
public static DataTable ReadExcelToDataTable(string fileName, out string strMsg, string sheetName = null, bool isFirstRowColumn = true)
{
strMsg = "";
//定义要返回的datatable对象
DataTable data = new DataTable();
//excel工作表
NPOI.SS.UserModel.ISheet sheet = null;
//数据开始行(排除标题行)
int startRow = 0;
try
{
if (!File.Exists(fileName))
{
return null;
}
//根据指定路径读取文件
FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
//根据文件流创建excel数据结构
NPOI.SS.UserModel.IWorkbook workbook = NPOI.SS.UserModel.WorkbookFactory.Create(fs);
//IWorkbook workbook = new HSSFWorkbook(fs);
//如果有指定工作表名称
if (!string.IsNullOrEmpty(sheetName))
{
sheet = workbook.GetSheet(sheetName);
//如果没有找到指定的sheetName对应的sheet则尝试获取第一个sheet
if (sheet == null)
{
sheet = workbook.GetSheetAt(0);
}
}
else
{
//如果没有指定的sheetName则尝试获取第一个sheet
sheet = workbook.GetSheetAt(0);
}
if (sheet != null)
{
NPOI.SS.UserModel.IRow firstRow = sheet.GetRow(0);
//一行最后一个cell的编号 即总的列数
int cellCount = firstRow.LastCellNum;
//如果第一行是标题列名
if (isFirstRowColumn)
{
for (int i = firstRow.FirstCellNum; i < cellCount; ++i)
{
NPOI.SS.UserModel.ICell cell = firstRow.GetCell(i);
if (cell != null)
{
string cellValue = cell.StringCellValue;
if (cellValue != null)
{
DataColumn column = new DataColumn(cellValue);
data.Columns.Add(column);
}
}
}
startRow = sheet.FirstRowNum + 1;
}
else
{
startRow = sheet.FirstRowNum;
}
//最后一列的标号
int rowCount = sheet.LastRowNum;
for (int i = startRow; i <= rowCount; ++i)
{
NPOI.SS.UserModel.IRow row = sheet.GetRow(i);
if (row == null) continue; //没有数据的行默认是null
DataRow dataRow = data.NewRow();
for (int j = row.FirstCellNum; j < cellCount; ++j)
{
if (row.GetCell(j) != null) //同理没有数据的单元格都默认是null
dataRow[j] = row.GetCell(j).ToString();
}
data.Rows.Add(dataRow);
}
}
}
catch (Exception ex)
{
strMsg = ex.Message;
}
return data;
}
public static DateTime GetDateTime(int timestamp)
{
//DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
//使用上面的方式会显示TimeZone已过时
//DateTime dtStart = TimeZoneInfo.ConvertTime(new DateTime(1970, 1, 1), TimeZoneInfo.Local);
//long lTime = long.Parse(timestamp + "0000");
//TimeSpan timeSpan = new TimeSpan(lTime);
//DateTime targetDt = dtStart.Add(timeSpan).AddHours(8);
DateTime dtStart = Convert.ToDateTime("1970-01-01");
DateTime targetDt = dtStart.AddDays(timestamp-1);
return targetDt;
}
/// <summary>
/// 将文件流读取到DataTable数据表中
/// </summary>
/// <param name="fileStream">文件流</param>
/// <param name="sheetName">指定读取excel工作薄sheet的名称</param>
/// <param name="isFirstRowColumn">第一行是否是DataTable的列名true=是false=否</param>
/// <returns>DataTable数据表</returns>
public static DataTable ReadStreamToDataTable(Stream fileStream, out string strMsg, string sheetName = null, bool isFirstRowColumn = true)
{
strMsg = "";
//定义要返回的datatable对象
DataTable data = new DataTable();
//excel工作表
NPOI.SS.UserModel.ISheet sheet = null;
//数据开始行(排除标题行)
int startRow = 0;
try
{
//根据文件流创建excel数据结构,NPOI的工厂类WorkbookFactory会自动识别excel版本创建出不同的excel数据结构
NPOI.SS.UserModel.IWorkbook workbook = NPOI.SS.UserModel.WorkbookFactory.Create(fileStream);
//如果有指定工作表名称
if (!string.IsNullOrEmpty(sheetName))
{
sheet = workbook.GetSheet(sheetName);
//如果没有找到指定的sheetName对应的sheet则尝试获取第一个sheet
if (sheet == null)
{
sheet = workbook.GetSheetAt(0);
}
}
else
{
//如果没有指定的sheetName则尝试获取第一个sheet
sheet = workbook.GetSheetAt(0);
}
if (sheet != null)
{
NPOI.SS.UserModel.IRow firstRow = sheet.GetRow(0);
//一行最后一个cell的编号 即总的列数
int cellCount = firstRow.LastCellNum;
//如果第一行是标题列名
if (isFirstRowColumn)
{
for (int i = firstRow.FirstCellNum; i < cellCount; ++i)
{
NPOI.SS.UserModel.ICell cell = firstRow.GetCell(i);
if (cell != null)
{
string cellValue = cell.StringCellValue;
if (cellValue != null)
{
DataColumn column = new DataColumn(cellValue);
data.Columns.Add(column);
}
}
}
startRow = sheet.FirstRowNum + 1;
}
else
{
startRow = sheet.FirstRowNum;
}
//最后一列的标号
int rowCount = sheet.LastRowNum;
for (int i = startRow; i <= rowCount; ++i)
{
NPOI.SS.UserModel.IRow row = sheet.GetRow(i);
if (row == null || row.FirstCellNum < 0) continue; //没有数据的行默认是null
DataRow dataRow = data.NewRow();
for (int j = row.FirstCellNum; j < cellCount; ++j)
{
//同理没有数据的单元格都默认是null
NPOI.SS.UserModel.ICell cell = row.GetCell(j);
if (cell != null)
{
if (cell.CellType == NPOI.SS.UserModel.CellType.Numeric)
{
//判断是否日期类型
if (NPOI.SS.UserModel.DateUtil.IsCellDateFormatted(cell))
{
try
{
dataRow[j] = row.GetCell(j).DateCellValue;
}
catch
{
dataRow[j] = GetDateTime((int)row.GetCell(j).NumericCellValue);
//strMsg = row.GetCell(j).NumericCellValue.ToString();
}
}
else
{
dataRow[j] = row.GetCell(j).ToString().Trim();
}
}
else
{
dataRow[j] = row.GetCell(j).ToString().Trim();
}
}
}
data.Rows.Add(dataRow);
}
}
}
catch (Exception ex)
{
strMsg = ex.Message;
}
return data;
}
/// <summary>
/// 将Excel单表转为Datatable
/// </summary>
@ -30,9 +256,14 @@ namespace DSWeb.MvcShipping.Helper
{
#region 判断excel版本
//2007以上版本excel
if (fileType == ".xlsx")
{
workbook = new XSSFWorkbook(stream);
stream.Seek(0, SeekOrigin.Begin);
// workbook = new XSSFWorkbook(stream);
workbook = NPOI.SS.UserModel.WorkbookFactory.Create(stream);
}
//2007以下版本excel
else if (fileType == ".xls")
@ -94,14 +325,14 @@ namespace DSWeb.MvcShipping.Helper
//判断是否为数字型,必须加这个判断不然下面的日期判断会异常
if (cellData.CellType == CellType.Numeric)
{
//判断是否日期类型
if (DateUtil.IsCellDateFormatted(cellData))
try
{
dataRow[i] = cellData.DateCellValue;
dataRow[j] = row.GetCell(j).DateCellValue;
}
else
catch
{
dataRow[i] = cellData.ToString().Trim();
dataRow[j] = GetDateTime((int)row.GetCell(j).NumericCellValue);
//strMsg = row.GetCell(j).NumericCellValue.ToString();
}
} else if (cellData.CellType == CellType.Formula)
{
@ -132,9 +363,11 @@ namespace DSWeb.MvcShipping.Helper
{
throw new Exception("没有获取到Excel中的数据表");
}
}
catch (Exception ex)
{
stream.Position = 0; // 增加这句
workbook = new HSSFWorkbook(stream);
strMsg = ex.Message;
}

@ -1000,6 +1000,16 @@ namespace DSWeb.MvcShipping.Models.MsChFee
public decimal AMOUNT { get; set; }
}
public class CreateFee
{
public string CUST { get; set; }
public string CURR { get; set; }
public int FEETYPE { get; set; }
public decimal AMOUNT { get; set; }
}
#region 参照部分

@ -315,6 +315,9 @@ namespace DSWeb.MvcShipping.Models.MsChFeeAutoDui
public decimal Y_RMBAMOUNT { set; get; }
public decimal Y_USDAMOUNT { set; get; }
[ModelDB]
public string B_AMOUNT { get; set; }
public string CARRIER { set; get; }
public string TEU { set; get; }
public string SALE{ set; get; }

@ -1013,19 +1013,28 @@ namespace DSWeb.MvcShipping.Models.MsOpRailway
set{ _vouno = value; }
}
private string _remark = "";
private string _INVNO = "";
/// <summary>
/// 备注
/// 发票号
/// </summary>
[ModelDB]
public string INVNO
{
get{ return _INVNO; }
set{ _INVNO = value; }
}
private string _remark = "";
/// <summary>
/// 备注
/// </summary>
[ModelDB]
public string REMARK
{
get{ return _remark; }
set{ _remark = value; }
}
private string _doc = "";
get { return _remark; }
set { _remark = value; }
}
private string _doc = "";
/// <summary>
/// 单证
/// </summary>

@ -2110,6 +2110,8 @@ namespace DSWeb.MvcShipping.Models.MsOpSeae
public string HYFDR { get; set; }
public string HYFCR { get; set; }
public string BGFDR { get; set; }
public string TTLPROFIT { get; set; }
public string PROFITRATE { get; set; }
public string GROUPBS { get; set; }
private string _mdescription = "";

@ -9169,6 +9169,21 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
}
}
//如果是进口的设置净重
} else if (DEFAULTUNIT == "12") {
e.record.set('Unit', "天");
UNIT = '天';
//设置数量
//获取业务类型 获取所有集装箱信息 折算TEU
} else if (DEFAULTUNIT == "13") {
e.record.set('Unit', "个");
UNIT = '个';
//设置数量
//获取业务类型 获取所有集装箱信息 折算TEU
} else if (DEFAULTUNIT == "14") {
e.record.set('Unit', "小时");
UNIT = '小时';
//设置数量
//获取业务类型 获取所有集装箱信息 折算TEU
} else {
e.record.set('Unit', DEFAULTUNIT);
UNIT = DEFAULTUNIT;
@ -9822,12 +9837,21 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
var otlb = "";
var ttllb = "";
if (rmbdr != 0 || rmbcr != 0 || (rmbprofit != 0&&rmbprofit !="***")) {
rmblb = "&nbsp&nbsp&nbsp" + LOCALCURR + "应收:<font color='green'>" + returnfloat(rmbdr) + "</font> &nbsp&nbsp " + LOCALCURR + "应付: <font color='green'>" + returnfloat(rmbcr) + "</font> &nbsp&nbsp" + LOCALCURR + "利润:<font color='green'>" + returnfloat(rmbprofit) + "</font>&nbsp&nbsp&nbsp|";
if (rmbdr != 0 || rmbcr != 0 || (rmbprofit != 0 && rmbprofit != "***")) {
if (rmbprofit < 0) {
rmblb = "&nbsp&nbsp&nbsp" + LOCALCURR + "应收:<font color='green'>" + returnfloat(rmbdr) + "</font> &nbsp&nbsp " + LOCALCURR + "应付: <font color='green'>" + returnfloat(rmbcr) + "</font> &nbsp&nbsp" + LOCALCURR + "利润:<font color='red'>" + returnfloat(rmbprofit) + "</font>&nbsp&nbsp&nbsp|";
} else {
rmblb = "&nbsp&nbsp&nbsp" + LOCALCURR + "应收:<font color='green'>" + returnfloat(rmbdr) + "</font> &nbsp&nbsp " + LOCALCURR + "应付: <font color='green'>" + returnfloat(rmbcr) + "</font> &nbsp&nbsp" + LOCALCURR + "利润:<font color='green'>" + returnfloat(rmbprofit) + "</font>&nbsp&nbsp&nbsp|";
}
// rmblb = "<span style="margin:0;padding:0;height:22px;line-height:22px;font-size:12px;color:#04408c;font-family:'微软雅黑';font-weight:bold;display:inline-block;">统计信息(文字标题)<span style="margin:0;margin-left:40px;padding:0;height:22px;line-height:22px;font-size:12px;color:#04408c;font-family:'微软雅黑';font-weight:normal;display:inline-block;">(字段名-中文)</span><span style="margin:0;padding:0;height:22px;line-height:22px;font-size:12px;color:#ff0000;font-family:'微软雅黑';font-weight:normal;display:inline-block;">(字段值-负值)</span><span style="margin:0;margin-left:20px;padding:0;height:22px;line-height:22px;font-size:12px;color:#04408c;font-family:'微软雅黑';font-weight:normal;display:inline-block;">(字段名-中文)</span><span style="margin:0;padding:0;height:22px;line-height:22px;font-size:12px;color:#009bdb;font-family:'微软雅黑';font-weight:normal;display:inline-block;">(字段值-正值)</span></span>";
}
if (usddr != 0 || usdcr != 0 || (usdprofit != 0&&usdprofit !="***")) {
usdlb = "&nbsp&nbsp&nbspUSD应收: <font color='green'>" + returnfloat(usddr) + "</font> &nbsp&nbspUSD应付:<font color='green'>" + returnfloat(usdcr) + "</font> &nbsp&nbspUSD利润<font color='green'>" + returnfloat(usdprofit) + "</font>&nbsp&nbsp&nbsp|";
if (usddr != 0 || usdcr != 0 || (usdprofit != 0 && usdprofit != "***")) {
if (usdprofit < 0) {
usdlb = "&nbsp&nbsp&nbspUSD应收: <font color='green'>" + returnfloat(usddr) + "</font> &nbsp&nbspUSD应付:<font color='green'>" + returnfloat(usdcr) + "</font> &nbsp&nbspUSD利润<font color='red'>" + returnfloat(usdprofit) + "</font>&nbsp&nbsp&nbsp|";
}else
usdlb = "&nbsp&nbsp&nbspUSD应收: <font color='green'>" + returnfloat(usddr) + "</font> &nbsp&nbspUSD应付:<font color='green'>" + returnfloat(usdcr) + "</font> &nbsp&nbspUSD利润<font color='green'>" + returnfloat(usdprofit) + "</font>&nbsp&nbsp&nbsp|";
}
if (otdr != 0 || otcr != 0 || (otprofit != 0&&otprofit !="***")) {
otlb = "&nbsp&nbsp&nbsp其他币别应收: <font color='green'>" + returnfloat(otdr) + "</font> &nbsp&nbsp 其他币别应付:<font color='green'>" + returnfloat(otcr) + "</font> &nbsp&nbsp其他币别利润<font color='green'>" + returnfloat(otprofit) + "</font>&nbsp&nbsp&nbsp|";

@ -6930,6 +6930,21 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
}
}
//如果是进口的设置净重
} else if (DEFAULTUNIT == "12") {
e.record.set('Unit', "天");
UNIT = '天';
//设置数量
//获取业务类型 获取所有集装箱信息 折算TEU
} else if (DEFAULTUNIT == "13") {
e.record.set('Unit', "个");
UNIT = '个';
//设置数量
//获取业务类型 获取所有集装箱信息 折算TEU
} else if (DEFAULTUNIT == "14") {
e.record.set('Unit', "小时");
UNIT = '小时';
//设置数量
//获取业务类型 获取所有集装箱信息 折算TEU
} else {
e.record.set('Unit', DEFAULTUNIT);
UNIT = DEFAULTUNIT;

@ -607,6 +607,21 @@
value = usMoney(value, 2, '', true);
return value;
}
},
{
sortable: true, align: 'right',
dataIndex: 'B_AMOUNT',
text: '未审核金额',
width: 80,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
},
summaryType: 'sum', align: 'right',
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
}
},
{
sortable: true,

@ -53,7 +53,9 @@ Ext.define('CH_FEE_AutoDuiDetailmb', {
{ name: 'L_RMBAMOUNT', type: 'number' },
{ name: 'L_USDAMOUNT', type: 'number' },
{ name: 'Y_RMBAMOUNT', type: 'number' },
{ name: 'Y_USDAMOUNT', type: 'number' },
{ name: 'Y_USDAMOUNT', type: 'number' },
{ name: 'B_AMOUNT', type: 'number' },
{ name: 'ISOK', type: 'string' },
{ name: 'REMARK', type: 'string' },
{ name: 'REMARK2', type: 'string' }

@ -1426,9 +1426,9 @@ Ext.extend(Shipping.MsChFeeYsAutoDuiEdit, Ext.Panel, {
var KP = form.findField('ShiFouYiKaiPiao').getValue();
if (KP != "全部" && KP != "0" && KP != null) {
if (KP == "1") {
sql = sql + getAndConSql(sql, KP, " (C.INVOICE <> 0 or C.ORDERINVOICE <>0)");
sql = sql + getAndConSql(sql, KP, " (C.ISINVOICE=1 OR C.INVOICE <> 0 or C.ORDERINVOICE <>0)");
} else if (KP == "2") {
sql = sql + getAndConSql(sql, KP, " (C.INVOICE = 0 and C.ORDERINVOICE =0)");
sql = sql + getAndConSql(sql, KP, " C.ISINVOICE<>1 and (C.INVOICE = 0 and C.ORDERINVOICE =0)");
}
}
@ -1590,9 +1590,9 @@ Ext.extend(Shipping.MsChFeeYsAutoDuiEdit, Ext.Panel, {
var KP = form.findField('ShiFouYiKaiPiao').getValue();
if (KP != "全部" && KP != "0" && KP != null) {
if (KP == "1") {
sql = sql + getAndConSql(sql, KP, " (C.INVOICE <> 0 or C.ORDERINVOICE <>0)");
sql = sql + getAndConSql(sql, KP, " (C.ISINVOICE=1 or C.INVOICE <> 0 or C.ORDERINVOICE <>0)");
} else if (KP == "2") {
sql = sql + getAndConSql(sql, KP, " (C.INVOICE = 0 and C.ORDERINVOICE =0)");
sql = sql + getAndConSql(sql, KP, " (C.ISINVOICE<>1 and C.INVOICE = 0 and C.ORDERINVOICE =0)");
}
}
@ -1683,9 +1683,9 @@ Ext.extend(Shipping.MsChFeeYsAutoDuiEdit, Ext.Panel, {
var KP = form.findField('ShiFouYiKaiPiao').getValue();
if (KP != "全部" && KP != "0" && KP != null) {
if (KP == "1") {
sql = sql + getAndConSql(sql, KP, " (C.INVOICE <> 0 or C.ORDERINVOICE <>0)");
sql = sql + getAndConSql(sql, KP, " (C.ISINVOICE=1 or C.INVOICE <> 0 or C.ORDERINVOICE <>0)");
} else if (KP == "2") {
sql = sql + getAndConSql(sql, KP, " (C.INVOICE = 0 and C.ORDERINVOICE =0)");
sql = sql + getAndConSql(sql, KP, " (C.ISINVOICE<>1 and C.INVOICE = 0 and C.ORDERINVOICE =0)");
}
}

@ -37,9 +37,9 @@ Ext.extend(Shipping.MsCodeFeeSetListEdit, Ext.Panel, {
this.StoreDefaultUnit.add({ 'value': '9', 'text': '箱型' });
this.StoreDefaultUnit.add({ 'value': '10', 'text': 'CBM' });
this.StoreDefaultUnit.add({ 'value': '11', 'text': 'BILL' });
this.StoreDefaultUnit.add({ 'value': '', 'text': '天' });
this.StoreDefaultUnit.add({ 'value': '', 'text': '个' });
this.StoreDefaultUnit.add({ 'value': '小时', 'text': '小时' });
this.StoreDefaultUnit.add({ 'value': '12', 'text': '天' });
this.StoreDefaultUnit.add({ 'value': '13', 'text': '个' });
this.StoreDefaultUnit.add({ 'value': '14', 'text': '小时' });
this.comboxDefaultUnit = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.DEFAULTUNIT, //'默认计费标准',

@ -23,6 +23,9 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
this.SALEORDERDEPTBYOP = 0;
this.copyfee = false;
this.storePLList = Ext.create('Ext.data.Store', {
model: 'MsOpOtherEntity'
});
this.storeDefValue = Ext.create('Ext.data.Store', {
model: 'DsShipping.ux.OpDefValue',
remoteSort: true,
@ -468,11 +471,25 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '委托编号',
readOnly: false,
name: 'CUSTNO'
}, {
items: [{
xtype: 'container',
layout: 'hbox',
flex: 1,
defaultType: 'textfield',
items: [{
fieldLabel: '委托编号', //'委托编号',
allowBlank: true,
name: 'CUSTNO'
}, {
xtype: 'button',
id: 'btnCUSTNO',
iconCls: "btncancel",
handler: function (button, event) {
this.ClearCustNo();
},
scope: this
}]
}, {
fieldLabel: '主提单号',
name: 'MBLNO',
listeners: {
@ -772,68 +789,94 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
this.Save('2');
},
scope: this
}, {
id: 'btnECopyNew',
text: "复制新建",
handler: function (button, event) {
var basicForm = this.formHead.getForm();
this.opStatus = 'add';
basicForm.findField('BSNO').setDisabled(false);
var BSNO = NewGuid();
var field = basicForm.findField('BSNO');
field.setValue(BSNO);
basicForm.findField('BSNO').setDisabled(true);
field = basicForm.findField('CUSTNO');
field.setValue('');
field = basicForm.findField('OP');
field.setValue(SHOWNAME);
field = basicForm.findField('CUSTSERVICE');
field.setValue(SHOWNAME);
field = basicForm.findField('SALE');
field.setValue(SHOWNAME);
var field = basicForm.findField('BSSTATUSREF');
field.setValue('未锁定');
var field = basicForm.findField('FEESTATUSREF');
field.setValue('未锁定');
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m-d');
field = basicForm.findField('BSDATE');
field.setValue(mydatestr);
var mydatestr = Ext.util.Format.date(myDate, 'Y-m');
field = basicForm.findField('ACCDATE');
field.setValue(mydatestr);
}, , {
text: '复制新建', //"国外舱单",
menu: [{
id: 'btnECopyNew',
text: "复制新建",
handler: function (button, event) {
var btnESave = Ext.getCmp('btnESave');
if (btnESave.isDisabled() || this.getIsModify == '') {
var basicForm = this.formHead.getForm();
this.opStatus = 'add';
basicForm.findField('BSNO').setDisabled(false);
var field = basicForm.findField('BSNO');
var oldbsno = field.getValue();
this.LoadCopyData(oldbsno, false);
this.LoadPeriodStatus(this.opStatus);
var children = this.tabOtherPanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
if (children.items[i].id) {
if (children.items[i].id == 'pnlmodOpOtherInfo') {
// this.tabSeaepanel.setActiveTab(i);
} else {
children.items[i].close();
}
}
}
}
this.tabOtherPanel.doLayout();
this.GetEditStatus();
this.LoadPeriodStatus(this.opStatus);
this.panelFee.strBSNO = BSNO;
this.panelFee.storeDrChFee.removeAll();
this.panelFee.storeCrChFee.removeAll();
//for (var j = 0; j < this.panelFee.storeDrChFee.getCount(); j += 1) {
// var memberbody = this.panelFee.storeDrChFee.getAt(j);
// memberbody.set("GId", NewGuid());
// memberbody.set("BsNo", '*');
// memberbody.commit();
//};
//for (var j = 0; j < this.panelFee.storeCrChFee.getCount(); j += 1) {
// var memberbody = this.panelFee.storeCrChFee.getAt(j);
// memberbody.set("GId", NewGuid());
// memberbody.set("BsNo", '*');
// memberbody.commit();
//};
} else {
this.CopyNew();
},
scope: this
}, '-', {
}
this.panelOcr.hide();
},
scope: this
}, {
id: 'btnECopyNewFee',
text: '复制新建(含费用)', //"复制新建",
handler: function (button, event) {
var btnESave = Ext.getCmp('btnESave');
if (btnESave.isDisabled() || this.getIsModify == '') {
var basicForm = this.formHead.getForm();
this.opStatus = 'add';
basicForm.findField('BSNO').setDisabled(false);
var field = basicForm.findField('BSNO');
var oldbsno = field.getValue();
this.LoadCopyData(oldbsno,true);
var children = this.tabOtherPanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
if (children.items[i].id) {
if (children.items[i].id == 'pnlmodOpOtherInfo') {
// this.tabSeaepanel.setActiveTab(i);
} else {
children.items[i].close();
}
}
}
}
this.tabOtherPanel.doLayout();
} else {
this.copyfee = true;
this.CopyNew();
}
this.panelOcr.hide();
},
scope: this
}]
}, '-', {
text: "关闭",
handler: function (button, event) {
window.close();
},
scope: this
}, {
text: "新建",
text: "新建",
id: 'btnENew',
handler: function (button, event) {
this.LoadData('add', '');
},
@ -1104,7 +1147,10 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
this.LoadPeriod(this.opStatus);
if (this.opStatus == 'copyaddfee') {
this.opStatus = 'copyadd';
this.copyfee = true;
}
//
if (this.opStatus == 'edit') {
@ -1147,8 +1193,12 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
_this.formHead.doLayout();
}
if (this.opStatus == 'edit')
this.LoadData(this.opStatus, condition);
if (this.opStatus == 'copyadd') {
this.LoadCopyData(this.editRecord.get('BSNO'),this.copyfee);
} else {
if (this.opStatus == 'edit')
this.LoadData(this.opStatus, condition);
}
//if (this.opStatus == 'add') {
// this.LoadPeriod('add');
//}
@ -1217,6 +1267,8 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
field = basicForm.findField('ACCDATE');
field.setValue(mydatestr);
}
if (this.opStatus == 'copyadd')
this.CopyNewData(data);
var CUSTOMERNAME = data.CUSTOMERNAME;
if (CUSTOMERNAME != '') {
@ -1258,6 +1310,223 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
},
LoadCopyData: function (bsno, CopyFee) {
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOpOther/GetCopyData',
params: {
condition: "BSNO='" + bsno + "'",
copyfee: CopyFee
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
data = result.data;
//this.LoadInit(data);
this.formHead.getForm().reset();
this.formHead.getForm().setValues(data);
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(data);
this.opStatus = 'add';
var arrNewRecords = this.storePLList.add(data);
this.editRecord = arrNewRecords[0];
this.Editdata = data;
this.GetEditStatus();
this.LoadPeriod(this.opStatus);
this.panelFee.EditRecord = this.editRecord;
this.panelFee.strBSNO = this.editRecord.get('BSNO');
this.panelFee.strMBLNO = this.editRecord.get('MBLNO');
this.panelFee.StoreUnit.load({ params: { BSNO: data.BSNO, bstype: "op_other" } });
this.panelFee.StoreDateCurr.load({ params: { optype: "op_other", BSNO: data.BSNO } });
this.panelFee.storeDrChFee.load({ params: { billno: data.BSNO, type: 1, optype: "op_other" } });
this.panelFee.storeCrChFee.load({ params: { billno: data.BSNO, type: 2, optype: "op_other" } });
this.panelFee.storeBodySum.load({
params: { bsno: data.BSNO, optype: "op_other" },
callback: function (r, options, success) {
if (success) {
_thisfee.setTotalHead();
}
}
});
this.panelFee.storeChFeeGain.load({ params: { bsno: data.BSNO, optype: "op_other" } });
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
CopyNewData: function () {
var basicForm = this.formHead.getForm();
this.opStatus = 'add';
basicForm.findField('BSNO').setDisabled(false);
var BSNO = NewGuid();
var field = basicForm.findField('BSNO');
field.setValue(BSNO);
basicForm.findField('BSNO').setDisabled(true);
field = basicForm.findField('CUSTNO');
field.setValue('');
field = basicForm.findField('OP');
field.setValue(SHOWNAME);
field = basicForm.findField('CUSTSERVICE');
field.setValue(SHOWNAME);
field = basicForm.findField('SALE');
field.setValue(SHOWNAME);
var field = basicForm.findField('BSSTATUSREF');
field.setValue('未锁定');
var field = basicForm.findField('FEESTATUSREF');
field.setValue('未锁定');
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m-d');
field = basicForm.findField('BSDATE');
field.setValue(mydatestr);
var mydatestr = Ext.util.Format.date(myDate, 'Y-m');
field = basicForm.findField('ACCDATE');
field.setValue(mydatestr);
this.GetEditStatus();
this.LoadPeriodStatus(this.opStatus);
this.panelFee.strBSNO = BSNO;
this.panelFee.storeDrChFee.removeAll();
this.panelFee.storeCrChFee.removeAll();
},
CopyNew: function (type) {
var basicForm2 = this.formHead.getForm();
if (!basicForm2.isValid()) {
return;
}
var basicForm = this.formEdit.getForm();
if (!basicForm.isValid()) {
return;
}
if (this.accdatesameetd == 1) {
var ETD = this.formEdit.getForm().findField('ETD').getRawValue();
if (ETD == '') {
} else {
var oDate1 = new Date(ETD);
var oDate2 = new Date(_this.MsPeriod.FDAY);
if (oDate1.getTime() >= oDate2.getTime()) {
var mydatestr = Ext.util.Format.date(ETD, 'Y-m');
if (_this.MsPeriod.CLOSEDAY != 0) {
var myday = Ext.util.Format.date(ETD, 'd');
if (myday > _this.MsPeriod.CLOSEDAY) {
var mymonth = Ext.util.Format.date(ETD, 'm');
var myyear = Ext.util.Format.date(ETD, 'Y');
mymonth = parseInt(mymonth) + 1;
var mymonthstr = mymonth.toString();
if (mymonthstr.length == 1) mymonthstr = '0' + mymonthstr;
mydatestr = myyear.toString() + '-' + mymonthstr;
}
} else {
}
var field = this.formHead.getForm().findField('ACCDATE');
field.setValue(mydatestr);
}
}
}
var jsonDelBody = ConvertRecordsToJsonAll(this.bodyDel);
this.formHead.getForm().findField('BSNO').setDisabled(false);
var data = this.formHead.getForm().getValues(false, false, false);
this.formHead.getForm().findField('BSNO').setDisabled(true);
var data2 = this.formEdit.getForm().getValues(false, false, false);
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsOpOther/Save',
scope: this,
params: {
opstatus: this.opStatus,
data: Ext.JSON.encode(data),
data2: Ext.JSON.encode(data2)
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnData = jsonresult.Data;
this.formHead.getForm().reset();
this.formHead.getForm().setValues(returnData);
this.formEdit.getForm().reset();
this.formEdit.getForm().setValues(returnData);
if (this.opStatus == 'add') {
var arrNewRecords = this.StoreList.add(returnData);
this.editRecord = arrNewRecords[0];
}
else if (this.opStatus == 'edit') {
var editp = Ext.create('MsOpOtherEntity', returnData);
this.editRecord.fields.each(function (field) {
if (field.persist) {
name = field.name;
if (name != 'id')
this.editRecord.set(name, editp.get(name));
}
}, this);
this.editRecord.commit();
}
var basicForm = this.formHead.getForm();
this.opStatus = 'add';
basicForm.findField('BSNO').setDisabled(false);
var field = basicForm.findField('BSNO');
var oldbsno = field.getValue();
this.LoadCopyData(oldbsno, this.copyfee);
var children = this.tabOtherPanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {
if (children.items[i].id) {
if (children.items[i].id == 'pnlmodOpOtherInfo') {
// this.tabSeaepanel.setActiveTab(i);
} else {
children.items[i].close();
}
}
}
}
this.tabOtherPanel.doLayout();
this.LoadPeriodStatus(this.opStatus);
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
LoadPeriod: function (opstatus) {
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
@ -1439,6 +1708,37 @@ Ext.extend(Shipping.MsOpOtherEdit, Ext.Panel, {
});
}, //end save
//#region 清空委托编号
ClearCustNo: function () {
var CUSTNO = this.formHead.getForm().findField('CUSTNO').getValue();
Ext.Ajax.request({
waitMsg: '正在查询委托编号状态...', //'正在查询委托编号状态...',
url: '/MvcShipping/MsSysBillNoSet/DeleteBsNo',
params: {
custno: CUSTNO
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
this.formHead.getForm().findField('CUSTNO').setValue('');
}
} else {
Ext.MessageBox.alert('服务器响应出错...', response.responseText);
}
},
scope: this
});
},
//#endregion
GetEditStatus: function () {
var canedit = false;
var BSSTATUSREF = this.formHead.getForm().findField('BSSTATUSREF').getValue();

@ -1060,7 +1060,41 @@ Ext.extend(Shipping.MsOpOtherIndex, Ext.Panel, {
this.onDeleteClick(button, event);
},
scope: this
}, '-', {
}, {
text: "复制", //"复制",
id: 'btncopyaddbs',
menu: [{
text: "复制新建",
iconCls: "btnadd",
handler: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要复制的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
this.SelectedRecord = record;
this.OprationStatus = 'copyadd';
DsOpenEditWin('/MvcShipping/MsOpOther/Edit');
},
scope: this
}, {
text: "复制新建(含费用)", //"复制新建",
iconCls: "btnadd",
handler: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要复制的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
this.SelectedRecord = record;
this.OprationStatus = 'copyaddfee';
DsOpenEditWin('/MvcShipping/MsOpOther/Edit');
},
scope: this
}]
}, '-', {
text: "保存列表样式",
id: "btntest",
menu: [

@ -624,7 +624,7 @@ Ext.extend(Shipping.MsOpRailwayEdit, Ext.Panel, {
fieldLabel: '主运单号',
name: 'MBLNO'
}, {
fieldLabel: '运单号',
fieldLabel: '运单号',
name: 'HBLNO'
}]
}, {
@ -641,7 +641,10 @@ Ext.extend(Shipping.MsOpRailwayEdit, Ext.Panel, {
flex: 1,
xtype: 'datefield',
name: 'STLDATE'
}]
}, {
fieldLabel: '发票号',
name: 'INVNO'
}]
}, {
xtype: 'container',
layout: 'hbox',

@ -98,6 +98,7 @@
{ name: 'ISVOU', type: 'string' },
{ name: 'VOUNO', type: 'string' },
{ name: 'REMARK', type: 'string' },
{ name: 'INVNO', type: 'string' },
{ name: 'STLNAME', type: 'string' },
{ name: 'STLDATE', type: 'string' },
{ name: 'OPERATORCODE', type: 'string' },

@ -584,7 +584,10 @@ Ext.extend(Shipping.MsOpRailwayEdit, Ext.Panel, {
flex: 1,
xtype: 'datefield',
name: 'STLDATE'
}]
}, {
fieldLabel: '发票号',
name: 'INVNO'
}]
}, {
xtype: 'container',
layout: 'hbox',
@ -698,6 +701,7 @@ Ext.extend(Shipping.MsOpRailwayEdit, Ext.Panel, {
this.StorePLACETRANSIT.add({ "PORT": "Xinuiju", "PORTID": "DANDONG" });
this.StorePLACETRANSIT.add({ "PORT": "Brest-Tsentral'nny(V PNR)", "PORTID": "PINGXIANG" });
this.StorePLACETRANSIT.add({ "PORT": "Altynko-eks", "PORTID": "HORGOS" });
this.StorePLACETRANSIT.add({ "PORT": "Huoerguosi Port", "PORTID": "HORGOS2" });
this.comboxPLACETRANSIT = Ext.create('DsExt.ux.RefTableCombox', {

@ -3194,15 +3194,36 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
this.panelBodyRf2.setVisible(true);
this.winCargoShow.setWidth(700);
this.winCargoShow.show();
this.formEdit.getForm().findField('DCLASS').setValue('');
this.formEdit.getForm().findField('DUNNO').setValue('');
this.formEdit.getForm().findField('DPAGE').setValue('');
this.formEdit.getForm().findField('DLABEL').setValue('');
this.formEdit.getForm().findField('LINKMAN').setValue('');
} else if (combo.value == 'D') {
this.panelBodyDr2.setVisible(true);
this.panelBodyRf2.setVisible(false);
this.winCargoShow.setWidth(1200);
this.formEdit.getForm().findField('TEMPSET').setValue('');
this.formEdit.getForm().findField('TEMPID').setValue('');
this.formEdit.getForm().findField('TEMPMAX').setValue('');
this.formEdit.getForm().findField('TEMPMIN').setValue('');
this.formEdit.getForm().findField('HUMIDITY').setValue('');
// this.winCargoShow.width = 1200;
this.winCargoShow.show();
} else {
this.panelBodyDr.setVisible(false);
this.panelBodyRf.setVisible(false);
this.formEdit.getForm().findField('DCLASS').setValue('');
this.formEdit.getForm().findField('DUNNO').setValue('');
this.formEdit.getForm().findField('DPAGE').setValue('');
this.formEdit.getForm().findField('DLABEL').setValue('');
this.formEdit.getForm().findField('LINKMAN').setValue('');
this.formEdit.getForm().findField('REEFERF').setValue('');
this.formEdit.getForm().findField('TEMPSET').setValue('');
this.formEdit.getForm().findField('TEMPID').setValue('');
this.formEdit.getForm().findField('TEMPMAX').setValue('');
this.formEdit.getForm().findField('TEMPMIN').setValue('');
this.formEdit.getForm().findField('HUMIDITY').setValue('');
}
}
@ -13430,6 +13451,28 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: '此业务为冻柜业务,设置温度为必填,如果是冻代干的业务请修改货物标识为普通货!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
} else if (CARGOID == 'S' || CARGOID == '') {
var DCLASS = this.formEdit.getForm().findField('DCLASS').getValue();
var DUNNO = this.formEdit.getForm().findField('DUNNO').getValue();
var DPAGE = this.formEdit.getForm().findField('DPAGE').getValue();
var DLABEL = this.formEdit.getForm().findField('DLABEL').getValue();
var LINKMAN=this.formEdit.getForm().findField('LINKMAN').getValue();
var REEFERF = this.formEdit.getForm().findField('REEFERF').getValue();
var TEMPSET = this.formEdit.getForm().findField('TEMPSET').getValue();
var TEMPID = this.formEdit.getForm().findField('TEMPID').getValue();
var TEMPMAX = this.formEdit.getForm().findField('TEMPMAX').getValue();
var TEMPMIN = this.formEdit.getForm().findField('TEMPMIN').getValue();
var HUMIDITY = this.formEdit.getForm().findField('HUMIDITY').getValue();
if (TEMPSET != '' || REEFERF != '' || TEMPID != '' || TEMPMAX != '' || TEMPMIN != '' || HUMIDITY!='') {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: '此业务为普通货业务,冻柜货物信息有值,请先清空!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
if (DCLASS != '' || DUNNO != '' || DPAGE != '' || DLABEL != '' || LINKMAN != '') {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: '此业务为普通货业务,危险品货物信息有值,请先清空!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
}
var ATD = this.formEdit.getForm().findField('ATD').getRawValue();

@ -1285,6 +1285,14 @@ Ext.extend(Shipping.MsOpSeaeFeeIndex, Ext.Panel, {
header: '应收包干费', //'货物标识',
width: 70
}, {
dataIndex: 'TTLPROFIT',
header: '合计利润', //'货物标识',
width: 70
}, {
dataIndex: 'PROFITRATE',
header: '利润率', //'货物标识',
width: 70
}, {
dataIndex: 'ISCANCEL',
header: '退舱', //'退舱',
width: 60,

@ -7313,7 +7313,10 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
flex: 1,
xtype: 'datefield',
name: 'ATD'
}, { xtype: 'hiddenfield' }
}, {
fieldLabel: Zi.LAN.HSCODE, //'船舶呼号',
name: 'HSCODE'
}
]
}, {

@ -223,6 +223,8 @@
{ name: 'HYFDR', type: 'string' },
{ name: 'HYFCR', type: 'string' },
{ name: 'BGFDR', type: 'string' },
{ name: 'TTLPROFIT', type: 'string' },
{ name: 'PROFITRATE', type: 'string' },
{ name: 'GROUPBS', type: 'string' },
{ name: 'BillFeeStatus', type: 'string' }

@ -245,6 +245,7 @@ Ext.extend(Shipping.SeaeFee, Ext.Panel, {
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CDD-船代", "CUSTTYPE": "船代", "CUSTNAME": "SHIPAGENCY" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "BXGS-保险公司", "CUSTTYPE": "保险公司", "CUSTNAME": "" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "QT-其他", "CUSTTYPE": "其他", "CUSTNAME": "" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "CK-仓库", "CUSTTYPE": "仓库", "CUSTNAME": "WAREHOUSE" });
this.panelFee.StoreCustType.add({ "SCUSTTYPE": "", "CUSTTYPE": "", "CUSTNAME": "" });
this.panelFee.StoreDrOpRange.load({ params: { optype: "modRecvFeeManagement"} });

@ -1897,7 +1897,7 @@ Ext.extend(Shipping.MsOp_InternalTradeEdit, Ext.Panel, {
this.storeCtn.loadData(_storeCtn.data.items);
}
if (this.opStatus == 'edit') {
if (this.opStatus == 'edit' || this.opStatus == 'copyadd') {
Headcondition = "BSNO='" + this.editRecord.get('BSNO') + "'";
Bodycondition = "D.BSNO='" + this.editRecord.get('BSNO') + "'";
//this.storeBodyList.load({ params: { condition: condition} });
@ -1947,6 +1947,9 @@ Ext.extend(Shipping.MsOp_InternalTradeEdit, Ext.Panel, {
this.formHead.getForm().reset();
this.formHead.getForm().setValues(this.Editdata);
if (opstatus == 'copyadd') {
this.CopyNew();
}
this.SetLockStatus(this.Editdata);
@ -2068,7 +2071,9 @@ Ext.extend(Shipping.MsOp_InternalTradeEdit, Ext.Panel, {
} else if (type == '1') {
window.close();
} else if (type == '2') {
_this.CopyNew();
var Headcondition = "BSNO='" + this.editRecord.get('BSNO') + "'";
var Bodycondition = "D.BSNO='" + this.editRecord.get('BSNO') + "'";
this.LoadData('copyadd', Headcondition, Bodycondition);
}
} else {
@ -2089,8 +2094,10 @@ Ext.extend(Shipping.MsOp_InternalTradeEdit, Ext.Panel, {
this.opStatus = 'add';
var basicForm = this.formHead.getForm();
//basicForm.findField('BSNO').setDisabled(false);
basicForm.findField('BSNO').setValue(NewGuid());
//basicForm.findField('BSNO').setValue(NewGuid());
basicForm.findField('CUSTNO').setValue();
basicForm.findField('CNTRNO').setValue('');
basicForm.findField('SEALNO').setValue('');
var children = this.tabOpPanel.items;
if (children) {
for (var i = children.length - 1, len = 0; i >= len; i--) {

@ -1160,6 +1160,13 @@ Ext.extend(Shipping.MsOp_InternalTradeIndex, Ext.Panel, {
this.onExportClick(button, event);
},
scope: this
}, {
text: "EXCEL导入", //"EXCEL导入",
iconCls: "btnexportexcel",
handler: function (button, event) {
this.onImportBillClick(button, event);
},
scope: this
}, {
text: "打印", id: "print",
tooltip: 'print',
@ -1514,6 +1521,92 @@ Ext.extend(Shipping.MsOp_InternalTradeIndex, Ext.Panel, {
this);
},
//#region EXCEL导入
onImportBillClick: function (button, event) {
var BSNO = "";
me = this;
var imgform = new Ext.FormPanel({
region: 'center',
labelWidth: 20,
frame: true,
autoScroll: false,
border: false,
fileUpload: true,
items: [{
xtype: 'fileuploadfield',
id: 'DsLoadExcel',
name: 'DsLoadExcel',
emptyText: '请选择EXCEL文件', //'请选择EXCEL文件',
fieldLabel: 'EXCEL', //'EXCEL',
buttonText: '选择文件', //'选择文件',
allowBlank: false,
width: 200,
buttonCfg:
{
iconCls: 'uploaddialog'
},
anchor: '98%'
}],
buttons: [{
text: '上传', //'上传',
type: 'submit',
handler: function () {
var UserFilePath = Ext.getCmp('DsLoadExcel').getValue();
if (!CheckFileExt(UserFilePath, /.xls|.xlsx/i)) {
Ext.Msg.show({ title: '错误', msg: '请确认上传的文件为EXCEL', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //'请确认你上传的文件为EXCEL文件!'
return;
}
if (!imgform.form.isValid()) { return; }
imgform.form.submit({
url: '/MvcShipping/MsOp_InternalTrade/ImpExcel',
waitMsg: '正在上传数据',
method: 'POST',
params: {
bsno: BSNO
},
success: function (form, action) {
win.close(this);
_this.storeList.reload();
},
failure: function (form, action) {
form.reset();
if (action.failureType == Ext.form.Action.SERVER_INVALID)
Ext.MessageBox.alert('错误', action.result.Message);
}
});
}
}, {
text: '关闭', //'关闭',
type: 'submit',
handler: function () {
win.close(this);
}
}]
});
var win = new Ext.Window({
title: "上传EXCEL", //"上传EXCEL",
width: 380,
height: 120,
modal: true,
resizable: false,
border: false,
items: imgform
});
win.show();
return;
},
//#endregion
getCondition: function () {
var form = this.formSearch.getForm();

@ -2539,12 +2539,14 @@ namespace DSWeb.TruckMng.DAL.MsOpTruckBulkDAL
string str = "";
var strSql = new StringBuilder();
strSql.Append("SELECT");
strSql.Append(" VISIBLERANGE,OPERATERANGE");
strSql.Append(" VISIBLERANGE,OPERATERANGE,AUTHORITYID,VSSQL ");
strSql.Append(" from VW_User_Authority");
strSql.Append(" where [NAME]='modOpTruckBulkList' and USERID='" + userid + "' and ISDELETE=0");
string visiblerange = "4";
string operaterange = "4";
string AUTHORITYID = "";
string VSSQL = "";
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
@ -2553,6 +2555,9 @@ namespace DSWeb.TruckMng.DAL.MsOpTruckBulkDAL
{
visiblerange = Convert.ToString(reader["VISIBLERANGE"]);
operaterange = Convert.ToString(reader["OPERATERANGE"]);
AUTHORITYID = Convert.ToString(reader["AUTHORITYID"]);
VSSQL = Convert.ToString(reader["VSSQL"]);
break;
}
reader.Close();
@ -2572,6 +2577,75 @@ namespace DSWeb.TruckMng.DAL.MsOpTruckBulkDAL
str = " (op_truck_bulk.OP in (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 + "'))"
+ " OR op_truck_bulk.CREATEUSER in (select GID from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "')))";
}
else if (visiblerange == "5")
{
if (tb == "index")
{
var userstr = new StringBuilder();
userstr.Append(" select COMPANYID from user_authority_range_company where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1");
Database userdb = DatabaseFactory.CreateDatabase();
using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString()))
{
str = "";
while (reader.Read())
{
if (str == "")
{
str = " (op_truck_bulk.Corpid='" + Convert.ToString(reader["COMPANYID"]) + "' ";
}
else
{
str = str + " or op_truck_bulk.Corpid='" + Convert.ToString(reader["COMPANYID"]) + "' ";
};
}
str = str + ")";
reader.Close();
}
}
else
{
str = " (UPPER(op_truck_bulk.Corpid)='" + companyid + "') ";
}
}
else if (visiblerange == "6")
{
if (tb == "index")
{
var opstr = "";
var userstr = new StringBuilder();
userstr.Append(" select OPID,(select SHOWNAME from [user] where GID=user_authority_range_op.OPID) SHOWNAME from user_authority_range_op where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1");
Database userdb = DatabaseFactory.CreateDatabase();
using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString()))
{
while (reader.Read())
{
if (opstr == "")
{
opstr = " ('" + Convert.ToString(reader["SHOWNAME"]) + "'";
}
else
{
opstr = opstr + ",'" + Convert.ToString(reader["SHOWNAME"]) + "'";
};
}
if (opstr != "") opstr = opstr + ")";
reader.Close();
}
if (opstr == "") opstr = "('" + username + "')";
str = " (op_truck_bulk.OP in " + opstr + " or op_truck_bulk.SALE in " + opstr + " or op_truck_bulk.CUSTSERVICE IN " + opstr + " or op_truck_bulk.CREATEUSER IN " + opstr + " )";
}
else
{
str = " (UPPER(op_truck_bulk.Corpid)='" + companyid + "' ) ";
}
}
else if (visiblerange == "1")
{
str = " (op_truck_bulk.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "'))"
@ -2589,12 +2663,14 @@ namespace DSWeb.TruckMng.DAL.MsOpTruckBulkDAL
string str = "";
var strSql = new StringBuilder();
strSql.Append("SELECT");
strSql.Append(" VISIBLERANGE,OPERATERANGE");
strSql.Append(" VISIBLERANGE,OPERATERANGE,AUTHORITYID,VSSQL ");
strSql.Append(" from VW_User_Authority");
strSql.Append(" where [NAME]='modOpTruckBulkList' and USERID='" + userid + "' and ISDELETE=0");
string visiblerange = "4";
string operaterange = "4";
string AUTHORITYID = "";
string VSSQL = "";
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
@ -2603,6 +2679,9 @@ namespace DSWeb.TruckMng.DAL.MsOpTruckBulkDAL
{
visiblerange = Convert.ToString(reader["VISIBLERANGE"]);
operaterange = Convert.ToString(reader["OPERATERANGE"]);
AUTHORITYID = Convert.ToString(reader["AUTHORITYID"]);
VSSQL = Convert.ToString(reader["VSSQL"]);
break;
}
reader.Close();
@ -2622,6 +2701,75 @@ namespace DSWeb.TruckMng.DAL.MsOpTruckBulkDAL
str = " (B.OP in (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 + "'))"
+ " OR B.CREATEUSER in (select GID from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "')))";
}
else if (visiblerange == "5")
{
if (tb == "index")
{
var userstr = new StringBuilder();
userstr.Append(" select COMPANYID from user_authority_range_company where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1");
Database userdb = DatabaseFactory.CreateDatabase();
using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString()))
{
str = "";
while (reader.Read())
{
if (str == "")
{
str = " (B.Corpid='" + Convert.ToString(reader["COMPANYID"]) + "' ";
}
else
{
str = str + " or B.Corpid='" + Convert.ToString(reader["COMPANYID"]) + "' ";
};
}
str = str + ")";
reader.Close();
}
}
else
{
str = " (UPPER(B.Corpid)='" + companyid + "') ";
}
}
else if (visiblerange == "6")
{
if (tb == "index")
{
var opstr = "";
var userstr = new StringBuilder();
userstr.Append(" select OPID,(select SHOWNAME from [user] where GID=user_authority_range_op.OPID) SHOWNAME from user_authority_range_op where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1");
Database userdb = DatabaseFactory.CreateDatabase();
using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString()))
{
while (reader.Read())
{
if (opstr == "")
{
opstr = " ('" + Convert.ToString(reader["SHOWNAME"]) + "'";
}
else
{
opstr = opstr + ",'" + Convert.ToString(reader["SHOWNAME"]) + "'";
};
}
if (opstr != "") opstr = opstr + ")";
reader.Close();
}
if (opstr == "") opstr = "('" + username + "')";
str = " (B.OP in " + opstr + " or B.SALE in " + opstr + " or B.CUSTSERVICE IN " + opstr + " or B.CREATEUSER IN " + opstr + " )";
}
else
{
str = " (UPPER(B.Corpid)='" + companyid + "' ) ";
}
}
else if (visiblerange == "1")
{
str = " (B.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "'))"

@ -1949,12 +1949,15 @@ namespace DSWeb.TruckMng.DAL.MsOpTruckBulkPcDAL
string str = "";
var strSql = new StringBuilder();
strSql.Append("SELECT");
strSql.Append(" VISIBLERANGE,OPERATERANGE");
strSql.Append(" VISIBLERANGE,OPERATERANGE,AUTHORITYID,VSSQL ");
strSql.Append(" from VW_User_Authority");
strSql.Append(" where [NAME]='modOpTruckBulkPcList' and USERID='" + userid + "' and ISDELETE=0");
string visiblerange = "4";
string operaterange = "4";
string AUTHORITYID = "";
string VSSQL = "";
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
@ -1963,6 +1966,9 @@ namespace DSWeb.TruckMng.DAL.MsOpTruckBulkPcDAL
{
visiblerange = Convert.ToString(reader["VISIBLERANGE"]);
operaterange = Convert.ToString(reader["OPERATERANGE"]);
AUTHORITYID = Convert.ToString(reader["AUTHORITYID"]);
VSSQL = Convert.ToString(reader["VSSQL"]);
break;
}
reader.Close();
@ -1987,6 +1993,85 @@ namespace DSWeb.TruckMng.DAL.MsOpTruckBulkPcDAL
str = " (op_truck_bulk_pc.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "'))"
+ " OR op_truck_bulk_pc.CREATEUSER in (select USERID from user_company where COMPANYID='" + companyid + "'))";
}
else if (visiblerange == "5")
{
if (tb == "index")
{
var userstr = new StringBuilder();
userstr.Append(" select COMPANYID from user_authority_range_company where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1");
Database userdb = DatabaseFactory.CreateDatabase();
using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString()))
{
str = "";
while (reader.Read())
{
if (str == "")
{
str = " (op_truck_bulk_pc.Corpid='" + Convert.ToString(reader["COMPANYID"]) + "' ";
}
else
{
str = str + " or op_truck_bulk_pc.Corpid='" + Convert.ToString(reader["COMPANYID"]) + "' ";
};
}
str = str + ")";
reader.Close();
}
}
else
{
str = " (UPPER(op_truck_bulk_pc.Corpid)='" + companyid + "') ";
}
}
else if (visiblerange == "6")
{
if (tb == "index")
{
var opstr = "";
var opidstr = "";
var userstr = new StringBuilder();
userstr.Append(" select OPID,(select SHOWNAME from [user] where GID=user_authority_range_op.OPID) SHOWNAME from user_authority_range_op where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1");
Database userdb = DatabaseFactory.CreateDatabase();
using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString()))
{
while (reader.Read())
{
if (opstr == "")
{
opstr = " ('" + Convert.ToString(reader["SHOWNAME"]) + "'";
}
else
{
opstr = opstr + ",'" + Convert.ToString(reader["SHOWNAME"]) + "'";
};
if (opidstr == "")
{
opidstr = " ('" + Convert.ToString(reader["OPID"]) + "'";
}
else
{
opidstr = opidstr + ",'" + Convert.ToString(reader["OPID"]) + "'";
};
}
if (opstr != "") opstr = opstr + ")";
if (opidstr != "") opidstr = opidstr + ")";
reader.Close();
}
if (opstr == "") opstr = "('" + username + "')";
str = " (op_truck_bulk_pc.OP in " + opstr + " or op_truck_bulk_pc.DDOP in " + opstr + " or op_truck_bulk_pc.CREATEUSER IN " + opidstr + " )";
}
else
{
str = " (UPPER(op_truck_bulk_pc.Corpid)='" + companyid + "' ) ";
}
}
else if (visiblerange == "0")
{
str = " 1=1 ";

Loading…
Cancel
Save