DS7Zhanhao
hanxuntao 2 years ago
commit 7315ad6b7d

@ -13639,7 +13639,7 @@ namespace DSWeb.MvcShipping.Controllers
#endregion
#region 东胜VGM发送
#region 东胜VGM发送 直发VGM
public ContentResult CreateAndSendVGM(string mblno, string userid, string type,string bsno)
{
string path = Server.MapPath("../../VGMFile/");
@ -13726,10 +13726,16 @@ namespace DSWeb.MvcShipping.Controllers
string rtn = WebRequestHelper.DoPost(DsVgmUrl, dict, 30 * 1000);
if (rtn == "操作太频繁" || rtn == "参数有误" || rtn == "参数有误!" || rtn == "身份验证错误!" || rtn == "箱号格式错误!" || rtn == "箱号重复" || rtn == "封号重复") {
var json = JsonConvert.Serialize(new { Success =false, Message = rtn});
if (rtn == "操作太频繁" || rtn == "参数有误" || rtn == "参数有误!" || rtn == "身份验证错误!" || rtn == "箱号格式错误!" || rtn == "箱号重复" || rtn == "封号重复")
{
var json = JsonConvert.Serialize(new { Success = false, Message = rtn });
return new ContentResult() { Content = json };
}
else {
var headlist = MsOpSeaeDAL.GetDataList(" BSNO='" + bsno + "'", Convert.ToString(Session["USERID"]), Convert.ToString(Session["CODENAME"]), Convert.ToString(Session["COMPANYID"]));
//9原始 2增加 3删除 4更新
MakeFee_VGM(headlist, type);
}
return new ContentResult() { Content = rtn };
}
@ -13740,6 +13746,11 @@ namespace DSWeb.MvcShipping.Controllers
string msg = vgmDAL.writeAndSendVgmXml(bsno, userid, type, path, CARRIERID, out filepath,mblno);
//var headlist = MsOpSeaeDAL.GetDataList(" BSNO='"+bsno+"'", Convert.ToString(Session["USERID"]), Convert.ToString(Session["CODENAME"]), Convert.ToString(Session["COMPANYID"]));
////9原始 2增加 3删除 4更新
//MakeFee_VGM(headlist, type);
var json = JsonConvert.Serialize(new { Success = true, Message = msg, totalCount = 10, data = filepath });
return new ContentResult() { Content = json };
}
@ -13795,6 +13806,109 @@ namespace DSWeb.MvcShipping.Controllers
var json = JsonConvert.Serialize(new { Success = rst, Message = rst ? "生成成功" : outMessage, totalCount = 10, data = filepath });
return new ContentResult() { Content = json };
}
/// <summary>
/// 用于给对应业务增加费用
/// bsnos
/// </summary>
/// <param name="bsnos">业务编号 逗号隔开的文本</param>
/// <param name="filetype">修改类型 9 2 3 4 原始 增加 删除 更新</param>
private void MakeFee_VGM(List<MsOpSeae> headlist, string type, bool isfen = false)
{
var filetype = "B";
if (type == "9"|| type=="2") filetype = "B";
if (type == "4") filetype = "E";
if (type == "3") filetype = "D";
var VGMPriceInfo = new VGMPriceParam();
foreach (var item in headlist)
{
var amount = 0M;
if (filetype == "B")
{
amount = VGMPriceInfo.Price1;
}
if (filetype == "E")
{
amount = VGMPriceInfo.Price2;
}
if (filetype == "D")
{
amount = VGMPriceInfo.Price3;
}
var USERID = Convert.ToString(Session["USERID"]);
var = 1;
MsChFeeDAL.MakeNewFee(USERID, item.BSNO, VGMPriceInfo.DJYName, "其它", 2, "VGM费", amount * , "单票", );
if (VGMPriceInfo.NeedYingFu)
{
if (filetype == "B")
{
amount = VGMPriceInfo.Price4;
}
if (filetype == "E")
{
amount = VGMPriceInfo.Price5;
}
if (filetype == "D")
{
amount = VGMPriceInfo.Price6;
}
MsChFeeDAL.MakeNewFee(USERID, item.BSNO, item.CUSTOMERNAME, "其它", 1, "VGM费", amount, "单票", );
}
}
}
private class VGMPriceParam
{
public decimal Price1 { get; set; } = 0M;
public decimal Price2 { get; set; } = 0M;
public decimal Price3 { get; set; } = 0M;
public string DJYName { get; set; } = "大简云";
public bool NeedYingFu { get; set; } = false;
public decimal Price4 { get; set; } = 0M;
public decimal Price5 { get; set; } = 0M;
public decimal Price6 { get; set; } = 0M;
public decimal FenPrice1 { get; set; } = 0M;
public decimal FenPrice2 { get; set; } = 0M;
public decimal FenPrice3 { get; set; } = 0M;
public VGMPriceParam()
{
var paramvalue = MsSysParamSetDAL.GetSysParamValue("VGMPrice");
var paramvalueList = paramvalue.Split(',');
Price1 = Convert.ToDecimal(paramvalueList[0]);
Price2 = Convert.ToDecimal(paramvalueList[1]);
Price3 = Convert.ToDecimal(paramvalueList[2]);
DJYName = paramvalueList[3];
NeedYingFu = paramvalueList[4] == "产生应收(是)" ? true : false;
Price4 = Convert.ToDecimal(paramvalueList[5]);
Price5 = Convert.ToDecimal(paramvalueList[6]);
Price6 = Convert.ToDecimal(paramvalueList[7]);
FenPrice1 = Convert.ToDecimal(paramvalueList[8]);
FenPrice2 = Convert.ToDecimal(paramvalueList[9]);
FenPrice3 = Convert.ToDecimal(paramvalueList[10]);
}
public VGMPriceParam(string paramvalue)
{
}
}
#endregion
#region 舱单状态青岛港

@ -1595,9 +1595,9 @@ namespace DSWeb.MvcShipping.Controllers
Price4 = Convert.ToDecimal(paramvalueList[5]);
Price5 = Convert.ToDecimal(paramvalueList[6]);
Price6 = Convert.ToDecimal(paramvalueList[7]);
Price4 = Convert.ToDecimal(paramvalueList[8]);
Price5 = Convert.ToDecimal(paramvalueList[9]);
Price6 = Convert.ToDecimal(paramvalueList[10]);
FenPrice1 = Convert.ToDecimal(paramvalueList[8]);
FenPrice2 = Convert.ToDecimal(paramvalueList[9]);
FenPrice3 = Convert.ToDecimal(paramvalueList[10]);
}

@ -6644,11 +6644,15 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
result.OK("");
try
{
if (AMOUNT != 0)
{
var newfee = getChFee(USERID, BSNO, CUSTOMERNAME, FEETYPE, FEENAME, AMOUNT,UNIT, QUANTITY);
var newfee = getChFee(USERID, BSNO, CUSTOMERNAME, FEETYPE, FEENAME, AMOUNT,UNIT, QUANTITY);
CommonDataContext cdc = new CommonDataContext();
cdc.ch_fee.Add(newfee);
cdc.SaveChanges();
CommonDataContext cdc = new CommonDataContext();
cdc.ch_fee.Add(newfee);
cdc.SaveChanges();
}
}
catch (Exception e)
{

Loading…
Cancel
Save