方合小程序,调整未完成

DS7_HYRD
dengyu 1 year ago
parent 1ee70ef353
commit 881e4e2f74

@ -31,7 +31,7 @@ using DSWeb.MvcShipping.DAL.MsSysParamSet;
using DSWeb.Areas.MvcShipping.Models.Message.VGM;
using sun.swing;
using DSWeb.MvcShipping.Models.WMSNew;
using DSWeb.Areas.MvcShipping.Helper;
namespace DSWeb.Areas.Dispatch.Controllers
{
@ -1789,18 +1789,23 @@ namespace DSWeb.Areas.Dispatch.Controllers
var condition = $" t.GId='{GId}'";
var dataList = MsRptPcHeadEditDAL.GetWFSDList(condition, "", "", "", "", "");
var dataList_b = MsRptPcHeadEditDAL.GetWFSDList(condition, "", "", "", "", "");
if (dataList_b == null || dataList_b.Count == 0)
{
return result;
}
var dataList = new List<MsWlPcHead_FH>();
foreach (var item in dataList_b) {
var _item = AutoMapperHelper.MapTo<MsWlPcHead_WFSDEdit, MsWlPcHead_FH>(item);
dataList.Add(_item);
}
//if (dataList != null && dataList.Count > 0)
//{
// foreach (var item in dataList)
// {
// if (!string.IsNullOrWhiteSpace(item.ExpDate))
// {
// item.ExpDate = item.ExpDate.Replace(" 00:00:00", "");
// }
// }
//}
if (dataList != null && dataList.Count > 0)
{
@ -1847,6 +1852,15 @@ namespace DSWeb.Areas.Dispatch.Controllers
dataList[0].TASKSTATUS = tasklist[0].TASKSTATUS;
}
var jyzlist = new string[]
{
"中石油","中石化","金盾","大象"
};
dataList[0].JYZList = jyzlist;
dataList[0].app();
result.Data = dataList[0];
}
@ -1903,6 +1917,9 @@ namespace DSWeb.Areas.Dispatch.Controllers
var BSNO = headData.gId;
//将几个字段解析成备注
headData.app();
var modb = new ModelObjectDB();
result = modb.Save(headData);
@ -2089,10 +2106,10 @@ namespace DSWeb.Areas.Dispatch.Controllers
//20231107 将油量拼在备注里面
if (!headData.Remark.Contains("油量"))
{
headData.Remark += " 油量:" + headData.FuelQty.ToString();
}
//if (!headData.Remark.Contains("油量"))
//{
// headData.Remark += " 油量:" + headData.FuelQty.ToString();
//}
result = DoSave();

@ -6,6 +6,10 @@ using DSWeb.Areas.Import.Models.ImportTrade;
using HcUtility.Core;
using Newtonsoft.Json;
using DSWeb.Common.DB;
using System.Text.RegularExpressions;
using System.Linq;
using com.sun.org.apache.bcel.@internal.generic;
using sun.security.krb5;
namespace DSWeb.Areas.TruckMng.Models.MsWlBs
{
@ -1827,7 +1831,7 @@ namespace DSWeb.Areas.TruckMng.Models.MsWlBs
public List<ch_fee_order_md> FeeList { get; set; }
public string[] FeeNameList { get; set; }
#endregion
#region Public Properties
@ -2424,14 +2428,84 @@ namespace DSWeb.Areas.TruckMng.Models.MsWlBs
public class MsWlPcHead_FH: MsWlPcHead_WFSDEdit
{
[ModelDB]
new public string FuelPrice { get; set; }
//[ModelDB]
//new public string FuelPrice { get; set; }
[ModelDB]
new public decimal FuelQty { get; set; } = 0;
[ModelDB]
new public decimal RealMil { get; set; } = 0;
public string[] FeeNameList { get; set; }
public string[] JYZList { get; set; }
public string JYZ { get; set; }
public decimal StartMil { get; set; } = 0M;
public decimal EndMil { get; set; } = 0M;
public decimal Amount { get; set; } = 0M;
/// <summary>
/// 查询时使用
/// </summary>
public void app()
{ //JYZ 加油类型StartMil 开始公里数EndMil 结束公里数Amount 加油金额
//从str当中截取[]之间的部分
//Regex regex = new Regex(@"\\[[^\\]]+\\]", RegexOptions.Multiline);
Regex regex = new Regex(@"(?i)(?<=\[)(.*)(?=\])");//中括号[]
var InnerStr = regex.Match(Remark).Value;
var sl = InnerStr.Split(';').ToList();
foreach (var l in sl)
{
var ti = InnerStr.Split(':').ToList();
if (ti[0] == "加油类型") JYZ = ti[1];
if (ti[0] == "开始公里数") StartMil = string.IsNullOrWhiteSpace(ti[1].ToString()) ? 0 : Convert.ToDecimal(ti[1]);
if (ti[0] == "结束公里数") EndMil = string.IsNullOrWhiteSpace(ti[1].ToString()) ? 0 : Convert.ToDecimal(ti[1]);
if (ti[0] == "加油金额") Amount = string.IsNullOrWhiteSpace(ti[1].ToString()) ? 0 : Convert.ToDecimal(ti[1]);
}
}
/// <summary>
/// 保存时使用
/// </summary>
public void app()
{
//JYZ 加油类型StartMil 开始公里数EndMil 结束公里数
//加油量 FuelQty加油金额 Amount公里数合计 RealMil
var InnerStr = "";
if (Remark.IndexOf("[") < 0)
{
Remark += "[]";
InnerStr = "[]";
}
else
{
Regex regex = new Regex(@"(?i)(?<=\[)(.*)(?=\])");//中括号[]
InnerStr = "[" + regex.Match(Remark).Value + "]";
}
RealMil = EndMil - StartMil;
var jyzlist = new List<string>
{
"中石油","中石化","金盾","大象"
};
var jyzindex = string.IsNullOrWhiteSpace(JYZ) ? 0 : Convert.ToInt32(JYZ);
var jyzstr = jyzlist[jyzindex];
var newStr = "";
newStr += "加油类型:" + jyzstr + ";";
newStr += "加油量:" + FuelQty.ToString() + ";";
newStr += "加油金额:" + Amount.ToString() + ";";
newStr += "开始公里数:" + StartMil.ToString() + ";";
newStr += "结束公里数:" + EndMil.ToString() + ";";
newStr += "公里数合计:" + RealMil.ToString() + ";";
Remark = Remark.Replace(InnerStr, newStr);
}
//data.isEnd = Convert.ToString(reader["isEnd"]);
}

Loading…
Cancel
Save