hanxuntao 2 months ago
parent 25f23e3dd2
commit 291a38253d

@ -53,7 +53,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>A8B991D831FDB5D1789CEC8EC45F87A2C3E3677C</ManifestCertificateThumbprint>
<ManifestCertificateThumbprint>824D7E858B5F5DE6242219CC1E5BB202C8231DA3</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>D7MqClient_TemporaryKey.pfx</ManifestKeyFile>
@ -67,6 +67,7 @@
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>

@ -28,34 +28,9 @@
/// </summary>
private void InitializeComponent()
{
this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
//
// serviceProcessInstaller1
//
this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
this.serviceProcessInstaller1.Password = null;
this.serviceProcessInstaller1.Username = null;
//
// serviceInstaller1
//
this.serviceInstaller1.DelayedAutoStart = true;
this.serviceInstaller1.Description = "东胜消息队列客户端";
this.serviceInstaller1.DisplayName = "东胜消息队列客户端";
this.serviceInstaller1.ServiceName = "D7MqClient";
this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
//
// ProjectInstaller
//
this.Installers.AddRange(new System.Configuration.Install.Installer[] {
this.serviceProcessInstaller1,
this.serviceInstaller1});
}
#endregion
private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1;
private System.ServiceProcess.ServiceInstaller serviceInstaller1;
}
}

@ -117,12 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="serviceProcessInstaller1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<metadata name="serviceInstaller1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>208, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>

File diff suppressed because it is too large Load Diff

@ -30,17 +30,14 @@ namespace DSWeb.Common.DB
public DbSet<sys_param_set_md> sys_param_set { get; set; }
//public DbSet<op_seae_md> OP_SEAE { get; set; }
//public DbSet<opseae_md> OP_SEAE { get; set; }
public DbSet<opseae_md> OP_SEAE { get; set; }
public DbSet<op_seae_md> OP_SEAE { get; set; }
public DbSet<op_ctn_md> OP_CTN { get; set; }
public DbSet<Op_INTERNALTRADEmd> Op_INTERNALTRADE { get; set; }
public DbSet<info_client_md> info_client { get; set; }
public DbSet<info_client_bank_mb> info_client_bank { get; set; }
public DbSet<Info_Client_ACCDATE_mb> Info_Client_ACCDATE { get; set; }
public DbSet<info_client_contact_mb> info_client_contact { get; set; }
public DbSet<code_fee_md> code_fee { get; set; }
public DbSet<CODE_CTN_md> CODE_CTN { get; set; }
@ -131,18 +128,37 @@ namespace DSWeb.Common.DB
public DbSet<VW_JGWL_APPLYNEEDREAD_md> VW_JGWL_APPLYNEEDREAD { get; set; }
public DbSet<t_Truck_FHApp_Fuel_md> t_Truck_FHApp_Fuel { get; set; }
public DbSet<OP_SERVICEBILL_md> OP_SERVICEBILL { get; set; }
public DbSet<OP_SERVICEBILL_INVINFO_md> OP_SERVICEBILL_INVINFO { get; set; }
public DbSet<t_PublicInterface_Log_md> t_PublicInterface_Log { get; set; }
public DbSet<code_disport_edi_md> code_disport_edi { get; set; }
public DbSet<code_ctn_edi_md> code_ctn_edi { get; set; }
public DbSet<sys_log_md> sys_log { get; set; }
public DbSet<DJY_SYNC_BC_md> DJY_SYNC_BC { get; set; }
public DbSet<OP_SEAE_DJYORDER_md> OP_SEAE_DJYORDER { get; set; }
public DbSet<DJYORDER_CONTRACTNO_md> DJYORDER_CONTRACTNO { get; set; }
public DbSet<DJYORDER_ACCOUNTINFO_md> DJYORDER_ACCOUNTINFO { get; set; }
public DbSet<VW_DJYORDER_LASTShipper_md> VW_DJYORDER_LASTShipper { get; set; }
public DbSet<VW_DJYORDER_LASTConsignee_md> VW_DJYORDER_LASTConsignee { get; set; }
public DbSet<VW_DJYORDER_LASTNotifypart_md> VW_DJYORDER_LASTNotifypart { get; set; }
public DbSet<op_seae_vgm_send_md> op_seae_vgm_send { get; set; }
public DbSet<op_seae_vgm_history_md> op_seae_vgm_history { get; set; }
public DbSet<op_seae_vgm_state_md> op_seae_vgm_state { get; set; }
public DbSet<op_seae_vgm_ctn_md> op_seae_vgm_ctn { get; set; }
}
public DbSet<op_seae_vgm_history_md> op_seae_vgm_history { get; set; }
public DbSet<op_seae_vgm_state_md> op_seae_vgm_state { get; set; }
public DbSet<user_attribute_md> user_attribute { get; set; }
}
}

@ -2627,7 +2627,7 @@ Ext.extend(Shipping.MsChPayapplicationBLEdit, Ext.Panel, {
condition = " BILLNO='" + this.editRecord.get('BILLNO') + "'";
this.LoadData(this.opStatus, condition);
//this.LoadMustBe();
this.LoadMustBe2();
}, //end InitData
@ -4452,6 +4452,29 @@ Ext.extend(Shipping.MsChPayapplicationBLEdit, Ext.Panel, {
} else {
}
},
LoadMustBe2: function () {
if (this.storeMustBe.getCount() > 0) {
for (var j = 0; j < this.storeMustBe.getCount(); j += 1) {
var member = this.storeMustBe.getAt(j);
var headfield = this.formEdit.getForm().findField(member.data.FIELDNAME);
if (headfield != NaN && headfield != null) {
if (member.data.ISCOLOR == "1")
headfield.setFieldStyle({ background: '#ffc' });
if (member.data.ISREADONLY == "1")
headfield.setReadOnly(true);
}
};
} else {
}
},
//#endregion
// #region 根据权限和状态判断是否允许修改

@ -3598,6 +3598,8 @@ Ext.extend(Shipping.MsChRecvapplicationBLEdit, Ext.Panel, {
headfield.allowBlank = false;
if (member.data.ISCOLOR == "1")
headfield.setFieldStyle({ background: '#ffc' });
if (member.data.ISREADONLY == "1")
headfield.setReadOnly(true);
}
};

@ -32,15 +32,19 @@ namespace DSWeb.Areas.CommMng.Controllers
public class PubSysController : Controller
{
//
//GET: /CommMng/PubSys/GetEnumValueList
public JsonResult GetEnumValueList(decimal enumTypeId)
public JsonResult GetEnumValueList(decimal enumTypeId, string sCondition = "")
{
return GetEnumValueListByCondition(enumTypeId, String.Empty);
if (string.IsNullOrWhiteSpace(sCondition))
{
return GetEnumValueListByCondition(enumTypeId, String.Empty);
}
else
{
return GetEnumValueListByCondition(enumTypeId, sCondition);
}
}
public JsonResult GetEnumValueListByCondition(decimal enumTypeId, string sCondition)
{
List<SysEnumValue> evList = PubSysDAL.GetEnumValueList(enumTypeId, sCondition);

@ -1756,18 +1756,6 @@ namespace DSWeb.Areas.CommMng.Models
}
public class vgmResult : DJYResult
{
public string data { get; set; }
public string errors { get; set; }
}
public class djyvgmresult : DJYResult
{
public op_seae_vgm_send_md data { get; set; }
public string errors { get; set; }
}
}

@ -77,13 +77,15 @@ namespace DSWeb.MvcShipping.Controllers
/// <summary>
/// 点击 发送VGM
/// 点击 保存VGM
/// </summary>
/// <param name="data"></param>
/// <param name="bodylist"></param>
/// <returns></returns>
public ContentResult SendVgm(string data,string bodylist)
public ContentResult SaveVgm(string data, string bodylist)
{
if (Convert.ToString(Session["COMPANYID"]).ToString().Trim() == "" || Convert.ToString(Session["USERID"]).ToString().Trim() == "" || Convert.ToString(Session["CODENAME"]).ToString().Trim() == "" || Convert.ToString(Session["SHOWNAME"]).ToString().Trim() == "" || Convert.ToString(Session["DEPTNAME"]).ToString().Trim() == "")
{
var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" };
@ -109,7 +111,7 @@ namespace DSWeb.MvcShipping.Controllers
{
headData.GID = Guid.NewGuid().ToString().Replace("-", "");
}
//
headData.DbOperationType = DbOperationType.DbotIns;
}
@ -140,41 +142,165 @@ namespace DSWeb.MvcShipping.Controllers
if (MsOpVgmCtnList != null && MsOpVgmCtnList.Count > 0) {
foreach (var item in MsOpVgmCtnList) {
item.VGMKGS = item.KGS + item.TAREWEIGHT;
if (!string.IsNullOrWhiteSpace(item.WEIGHDATE))
item.WEIGHDATE = item.WEIGHDATE.Replace("T", " ");
else item.WEIGHDATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
}
MsOpVgmSendDAL.SaveDetail(headData.GID, MsOpVgmCtnList);
}
var BSNO = headData.BSNO;
result.OK("保存成功");
//20240830 发送vgm报文
return BasicDataRefDAL.GetContentResult(result);
}
else {
return BasicDataRefDAL.GetContentResult(result);
}
}
public ContentResult DelCtn(string data, string bodylist)
{
if (Convert.ToString(Session["COMPANYID"]).ToString().Trim() == "" || Convert.ToString(Session["USERID"]).ToString().Trim() == "" || Convert.ToString(Session["CODENAME"]).ToString().Trim() == "" || Convert.ToString(Session["SHOWNAME"]).ToString().Trim() == "" || Convert.ToString(Session["DEPTNAME"]).ToString().Trim() == "")
{
var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
//
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
var headData = JsonConvert.Deserialize<MsOpVgmSend>(data);
var DelCtnList = JsonConvert.Deserialize<List<MsOpVgmCtn>>(bodylist);
var result = new DBResult();
var oldheaddata = MsOpVgmSendDAL.GetData("BSNO='" + headData.BSNO + "'");
if (!string.IsNullOrEmpty(oldheaddata.BSNO))
{
headData.GID = oldheaddata.GID;
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
}
else
{
//分公司代码
if (string.IsNullOrEmpty(headData.GID))
{
headData.GID = Guid.NewGuid().ToString().Replace("-", "");
}
headData.DbOperationType = DbOperationType.DbotIns;
}
result.OK();
if (headData.CTNNUM == null) { headData.CTNNUM = 0; }
//if (headData.CTNNUM == 0) {
// result.SetErrorInfo("必须有至少一条集装箱信息");
//}
var _r = MsOpVgmSendDAL.SendDjyVgm(headData, MsOpVgmCtnList);
if (_r.Success)
if (result.Success)
{
var modb = new ModelObjectDB();
result = modb.Save(headData);
if (result.Success)
{
//记录日志
var cdc = new DSWeb.Common.DB.CommonDataContext();
var newrec = new op_seae_vgm_history_md();
newrec.BSNO = headData.BSNO;
newrec.SENDERUSER = headData.SENDERUSER;
newrec.SENDTIME = headData.SENDTIME;
newrec.CTNNUM = headData.CTNNUM;
newrec.REMARK = headData.REMARK;
newrec.SENDTYPE = headData.SENDTYPE;
cdc.op_seae_vgm_history.Add(newrec);
cdc.SaveChanges();
if (DelCtnList != null && DelCtnList.Count > 0)
{
var cdc = new Common.DB.CommonDataContext();
var currctnlist = cdc.op_seae_vgm_ctn.Where(x => x.BSNO == headData.BSNO).ToList();
var needsave = false;
foreach (var item in DelCtnList)
{
//判断当前箱的 carrierflag 和 ygtflag是否包含已发送 ,如果包含则不能删除
if (currctnlist.Exists(x => x.CTN_ID == item.CTN_ID)) {
var _currctn = currctnlist.First(x => x.CTN_ID == item.CTN_ID);
if (_currctn.carrierSendFlag == 1 || _currctn.ygtSendFlag == 1)
{
result.SetErrorInfo("当前箱号已发送,不能删除");
}
else {
cdc.op_seae_vgm_ctn.Remove(_currctn);
needsave = true;
}
}
}
if (needsave) {
cdc.SaveChanges();
}
}
}
return BasicDataRefDAL.GetContentResult(_r);
result.OK("保存成功");
return BasicDataRefDAL.GetContentResult(result);
}
else {
else
{
return BasicDataRefDAL.GetContentResult(result);
}
}
/// <summary>
/// 点击 发送VGM
/// </summary>
/// <param name="data"></param>
/// <param name="bodylist"></param>
/// <returns></returns>
public ContentResult SendVgm(string data, string bodylist)
{
var result = new DBResult();
if (Convert.ToString(Session["COMPANYID"]).ToString().Trim() == "" || Convert.ToString(Session["USERID"]).ToString().Trim() == "" || Convert.ToString(Session["CODENAME"]).ToString().Trim() == "" || Convert.ToString(Session["SHOWNAME"]).ToString().Trim() == "" || Convert.ToString(Session["DEPTNAME"]).ToString().Trim() == "")
{
var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
//
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
var _headData = JsonConvert.Deserialize<MsOpVgmSend>(data);
var _MsOpVgmCtnList = JsonConvert.Deserialize<List<MsOpVgmCtn>>(bodylist);
if (_MsOpVgmCtnList == null || _MsOpVgmCtnList.Count == 0)
{
result.SetErrorInfo("必须选择至少一个箱");
return BasicDataRefDAL.GetContentResult(result);
}
if (_MsOpVgmCtnList.Exists(x=>x.CNTRNO==null||x.CNTRNO==""))
{
result.SetErrorInfo("箱号不能为空");
return BasicDataRefDAL.GetContentResult(result);
}
var bsnolist= _MsOpVgmCtnList.Select(p => p.CNTRNO).Distinct().ToList();
var bsnosqlstr= string.Join("','", bsnolist.ToArray());
var BSNO = _headData.BSNO;
var headData = _headData;
var MsOpVgmCtnList= MsOpVgmSendDAL.GetVgmCtnList("BSNO='" + BSNO + "' and CNTRNO in ('" + bsnosqlstr + "')", "");
//20240830 发送vgm报文
var _r = MsOpVgmSendDAL.SendDjyVgm(headData, MsOpVgmCtnList, Convert.ToString(Session["USERID"]).ToString(), Convert.ToString(Session["COMPANYID"]).ToString());
return BasicDataRefDAL.GetContentResult(_r);
}
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
@ -305,7 +431,7 @@ namespace DSWeb.MvcShipping.Controllers
}
else {
var _r = MsOpVgmSendDAL.SendDjyVgm(headData, MsOpVgmCtnList,"0");
var _r = MsOpVgmSendDAL.SendDjyVgm(headData, MsOpVgmCtnList, Convert.ToString(Session["USERID"]).ToString(), Convert.ToString(Session["COMPANYID"]).ToString(), "0");
if (!_r.Success)
{

@ -9,7 +9,6 @@ using DSWeb.EntityDA;
using DSWeb.Areas.CommMng.Models;
using HcUtility.Comm;
using DSWeb.Areas.CommMng.DAL;
using DSWeb.MvcShipping.Models.MsChFee;
using DSWeb.MvcShipping.DAL.MsSysParamSet;
using DSWeb.MvcShipping.Helper;
using DSWeb.Areas.MvcShipping.Comm;
@ -22,6 +21,7 @@ using System.Data.Entity.Migrations;
using DSWeb.MvcShipping.Models.MsOpSeae;
using NPOI.SS.Formula.Functions;
using Quartz.Util;
using DSWeb.MvcShipping.DAL.MsSysThirdPartyAccount;
namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
{
@ -219,6 +219,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
if (reader["VGMKGS"] != DBNull.Value)
data.VGMKGS = Convert.ToDecimal(reader["VGMKGS"]);//
data.carrierSendFlag = Convert.ToInt32(reader["carrierSendFlag"]);
data.ygtSendFlag = Convert.ToInt32(reader["ygtSendFlag"]);
#endregion
headList.Add(data);
}
@ -247,8 +249,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
{
foreach (var enumValue in bodyList)
{
var cmdInsert = db.GetSqlStringCommand(@"insert into op_seae_vgm_ctn ([CTN_ID],[BSNO],[SENDGID],[CTNALL],[CNTRNO],[SEALNO],[KGS],[TAREWEIGHT],[WEIGHTYPE],[VGMKGS],[YARD],[WEIGHDATE])
values (NEWID(),'" + enumValue.BSNO + "','" + LE_ID + "','" + enumValue.CTNALL + "','" + enumValue.CNTRNO + "','" + enumValue.SEALNO + "'," + enumValue.KGS + "," + enumValue.TAREWEIGHT + ",'" + enumValue.WEIGHTYPE + "'," + enumValue.VGMKGS + ",'" + enumValue.YARD + "','" + enumValue.WEIGHDATE + "')");
var cmdInsert = db.GetSqlStringCommand(@"insert into op_seae_vgm_ctn ([CTN_ID],[BSNO],[SENDGID],[CTNALL],[CNTRNO],[SEALNO],[KGS],[TAREWEIGHT],[WEIGHTYPE],[VGMKGS],[YARD],[WEIGHDATE],[carrierSendFlag],[ygtSendFlag])
values (NEWID(),'" + enumValue.BSNO + "','" + LE_ID + "','" + enumValue.CTNALL + "','" + enumValue.CNTRNO + "','" + enumValue.SEALNO + "'," + enumValue.KGS + "," + enumValue.TAREWEIGHT + ",'" + enumValue.WEIGHTYPE + "'," + enumValue.VGMKGS + ",'" + enumValue.YARD + "','" + enumValue.WEIGHDATE + "',"+enumValue.carrierSendFlag.ToString()+ ","+enumValue.ygtSendFlag.ToString()+")");
db.ExecuteNonQuery(cmdInsert, tran);
}
@ -256,11 +258,11 @@ namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
tran.Commit();
}
catch (Exception)
catch (Exception e)
{
tran.Rollback();
result.Success = false;
result.Message = "保存出现错误,请重试或联系系统管理员";
result.Message = $"保存出现错误:{JsonConvert.Serialize(e)},请重试或联系系统管理员";
return result;
}
}
@ -280,13 +282,13 @@ namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
DsVgm.mblno = headData.MBLNO;
DsVgm.carrier = BasicDataRefDAL.GetCustEdiCodeByName2(OpSeaehead.CARRIER, "DJY");
DsVgm.carrier = BasicDataRefDAL.GetCustEdiCodeByName2(headData.CARRIER, "DJY");
//DsVgm.carrier = headData.CARRIER;
DsVgm.etd = OpSeaehead.ETD;
DsVgm.weiTuoFaSongFang = BasicDataRefDAL.GetCustEdiCodeByName2(OpSeaehead.CUSTOMERNAME, "DJY");
DsVgm.weiTuoFaSongFang = "QDDS";//BasicDataRefDAL.GetCustEdiCodeByName2(OpSeaehead.CUSTOMERNAME, "DJY");
DsVgm.chuanMing = headData.CARRIER;
DsVgm.chuanMing = headData.VESSEL;
DsVgm.vsid = OpSeaehead.VESSELID;
DsVgm.hangCi = headData.VOYNO;
@ -302,11 +304,16 @@ namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
var = cdc.tSysEnumValue.Where(x => x.EnumTypeID == 96303 && x.EnumValueID == ).FirstOrDefault();
if ( != null) {
if ( != null)
{
DsVgm.zhuangHuoGang = .EnumValueName;
DsVgm.zhuangHuoGangDaiMa = .EnumValueID;
}
DsVgm.yard = BasicDataRefDAL.GetCustEdiCodeByName2(OpSeaehead.YARD, "DJY");
else {
DsVgm.zhuangHuoGang = "QINGDAO,CHINA";
DsVgm.zhuangHuoGangDaiMa = "CNTAO";
}
//DsVgm.yard = BasicDataRefDAL.GetCustEdiCodeByName2(ctn.YARD, "DJY");//BasicDataRefDAL.GetCustEdiCodeByName2(OpSeaehead.YARD, "DJY");
DsVgm.orderno = headData.ORDERNO;
@ -316,6 +323,9 @@ namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
DsVgm.wharf = headData.MATOU;
DsVgm.sendType = Convert.ToInt32(headData.SENDTYPE);
DsVgm.sendCarr = headData.ISCARRIER;
DsVgm.sendYGT = headData.ISYGT;
var cntrlist = new List<Ctn>();
foreach (var ctn in bodyList)
@ -332,16 +342,18 @@ namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
//cntr.yard = ctn.YARD;
cntr.yard = BasicDataRefDAL.GetCustEdiCodeByName2(ctn.YARD, "DJY");
if(!string.IsNullOrWhiteSpace(ctn.WEIGHDATE))
cntr.chengZhongShiJian = ctn.WEIGHDATE.Replace("T"," ");
if (!string.IsNullOrWhiteSpace(ctn.WEIGHDATE))
cntr.chengZhongShiJian = ctn.WEIGHDATE.Replace("T", " ");
else cntr.chengZhongShiJian = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//20240906 判断发船公司/云港通 和箱明细是否已发船公司云港通之间的关系
cntr.sendFlag = true;
cntrlist.Add(cntr);
DsVgm.yard = BasicDataRefDAL.GetCustEdiCodeByName2(ctn.YARD, "DJY");
}
DsVgm.ctnList = cntrlist;
DsVgm.sendType = Convert.ToInt32(headData.SENDTYPE);
DsVgm.sendCarr = headData.ISCARRIER;
DsVgm.sendYGT = headData.ISYGT;
return DsVgm;
}
@ -390,24 +402,236 @@ namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
#region 发送vgm至大简云
public static DBResult SendDjyVgm(MsOpVgmSend headData, List<MsOpVgmCtn> bodyList, string SendType = "")
public static DBResult CanSend(ref MsOpVgmSend headData,ref List<MsOpVgmCtn> bodyList,string SendType)
{
var result = new DBResult();
result.OK();
if (headData.ISCARRIER == false && headData.ISYGT == false)
{
result.SetErrorInfo("不能 船公司和云港通 都不选择");
}
var _iscarrier = headData.ISCARRIER;
var _isygt = headData.ISYGT;
if (string.IsNullOrWhiteSpace(headData.MBLNO)) {
result.SetErrorInfo("提单号不能为空");
}
if (headData.SENDTYPE == "0") {
return result;
}
if (string.IsNullOrWhiteSpace(headData.CARRIER))
{
result.SetErrorInfo($"船公司{headData.CARRIER}不能为空");
}
var = BasicDataRefDAL.GetCustEdiCodeByName2(headData.CARRIER, "DJY");
if (string.IsNullOrWhiteSpace())
{
result.SetErrorInfo($"船公司{headData.CARRIER}未配置大简云代码");
}
//var 场站 = BasicDataRefDAL.GetCustEdiCodeByName2(headData.CARRIER, "DJY");
//if (string.IsNullOrWhiteSpace(船公司))
//{
// result.SetErrorInfo("船公司未配置大简云代码");
//}
foreach (var ctn in bodyList) {
if (string.IsNullOrWhiteSpace(ctn.YARD))
{
result.SetErrorInfo($"场站{ctn.YARD}不能为空");
}
var _yard= BasicDataRefDAL.GetCustEdiCodeByName2(ctn.YARD, "DJY");
if (string.IsNullOrWhiteSpace(_yard))
{
result.SetErrorInfo($"场站{ctn.YARD}未配置大简云代码");
}
}
//如果所有这些箱 船公司状态都为已发 而且此次选择了 发送船公司+sendtype=新增 则取消头表的发送船公司
if (headData.SENDTYPE == "9") {
if (headData.ISCARRIER == true)
{
if (bodyList.Exists(x => x.carrierSendFlag != 1))
{
if (bodyList.Exists(x => x.carrierSendFlag == 1))
{
//var ctn = bodyList.FirstOrDefault(x => x.carrierSendFlag == 1);
//result.SetErrorInfo($"箱号{ctn.CNTRNO}已发船公司,不能再次发送新增");
}
}
else
{
if (!bodyList.Exists(x => x.carrierSendFlag != 1))
{
headData.ISCARRIER = false;
}
}
}
if (headData.ISYGT == true)
{
if (bodyList.Exists(x => x.ygtSendFlag != 1))
{
if (bodyList.Exists(x => x.ygtSendFlag == 1))
{
var ctn = bodyList.FirstOrDefault(x => x.ygtSendFlag == 1);
result.SetErrorInfo($"箱号{ctn.CNTRNO}已发云港通,不能再次发送新增");
}
}
else
{
if (!bodyList.Exists(x => x.ygtSendFlag != 1))
{
headData.ISYGT = false;
}
}
}
if (headData.ISCARRIER == false && headData.ISYGT == false)
{
var msg = "";
if (_iscarrier) msg = "船公司";
if (_isygt) msg = "云港通";
result.SetErrorInfo($"你选择的集装箱军已发({msg})");
}
}
if ( headData.ISCARRIER && ( == "HLC" || == "WHL"))
{
if (headData.ORDERNO == null || headData.ORDERNO == "")
{
result.SetErrorInfo("HLC/WHL船公司的订舱编号不能为空");
}
}
if (headData.ISCARRIER )
{
var cdc = new CommonDataContext();
var = cdc.tSysEnumValue.Where(x => x.EnumTypeID == 96306).ToList();
if (!.Any(x => x.EnumValueID == )) {
result.SetErrorInfo($"船公司{船公司}暂时没有船公司VGM通道");
}
}
//if (headData.ISYGT)
//{
// if (string.IsNullOrWhiteSpace(headData.MATOU))
// {
// result.SetErrorInfo($"发送云港通时码头不能为空");
// }
//}
if (bodyList == null || bodyList.Count == 0)
{
result.SetErrorInfo("集装箱信息不能为空");
}
var firstctn=new MsOpVgmCtn();
foreach (var ctnitems in bodyList)
{
//MsOpSeaVgmCtn OpSeaVgmCtn = new MsOpSeaVgmCtn();
if (ctnitems.CNTRNO == "")
result.SetErrorInfo("箱号不能为空");
if (ctnitems.CTNALL == "")
result.SetErrorInfo("箱型不能为空");
if (ctnitems.SEALNO == "")
result.SetErrorInfo("封号不能为空");
if ((ctnitems.KGS+ctnitems.TAREWEIGHT) <= 0 )
result.SetErrorInfo("称重重量不能为空或小于零");
if (string.IsNullOrWhiteSpace( ctnitems.WEIGHDATE))
{
//result.SetErrorInfo("称重时间不能为空");
}
}
if (result.Success) {
//根据head的iscarrier和isygt 以及
}
return result;
}
public static DBResult SendDjyVgm(MsOpVgmSend headData, List<MsOpVgmCtn> bodyList,string userid,string companyid, string SendType = "")
{
var result = new DBResult();
result.OK();
var _cansend = CanSend(ref headData,ref bodyList, SendType );
if (!_cansend.Success) {
return _cansend;
}
var DsVgmUrl = MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024URL'").PARAMVALUE;
var headers = new NameValueCollection();
var key= MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024_Key'").PARAMVALUE;
var secret = MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024_Secret'").PARAMVALUE;
var userkey = "";
var usersecret = "";
var userkeyinfo = MsSysThirdPartyAccountDAL.GetData($"USERID ='{userid}' and THIRDPARTY='大简云用户userkey' ");
{
if (userkeyinfo != null && !string.IsNullOrWhiteSpace(userkeyinfo.ACCOUNT))
{
userkey = userkeyinfo.ACCOUNT;
usersecret = userkeyinfo.ACCOUNTPSW;
}
}
if (string.IsNullOrWhiteSpace(userkey))
{
var companykeyinfo = MsSysThirdPartyAccountDAL.GetData($"USERID in(select USERID from user_company where companyid='{companyid}') and THIRDPARTY='大简云用户userkey' ");
headers["USER_KEY"] = key;
headers["USER_SECRET"] = secret;
if (companykeyinfo != null && !string.IsNullOrWhiteSpace(companykeyinfo.ACCOUNT))
{
userkey = companykeyinfo.ACCOUNT;
usersecret = companykeyinfo.ACCOUNTPSW;
}
}
if (string.IsNullOrWhiteSpace(userkey))
{
userkey = MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024_Key'").PARAMVALUE;
usersecret = MsSysParamSetDAL.GetData("PARAMNAME='DJYVGM2024_Secret'").PARAMVALUE;
}
if (string.IsNullOrWhiteSpace(userkey) || string.IsNullOrWhiteSpace(usersecret)) {
result.SetErrorInfo("请配置大简云VGM的key和secret");
return result;
}
headers["USER_KEY"] = userkey;
headers["USER_SECRET"] = usersecret;
var OpSeaehead = MsOpSeaeDAL.MsOpSeaeDAL.GetData("BSNO='" + headData.BSNO + "'");
@ -420,7 +644,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
var sendinfo = CreateDjyVgm(headData, bodyList, OpSeaehead);
BasicDataRefDAL.SaveLog(JsonConvert.Serialize(DsVgmUrl) + "////" + key +"////"+ secret + "////"+JsonConvert.Serialize(sendinfo), "", "DJYVGM2024", "发送");
BasicDataRefDAL.SaveLog(JsonConvert.Serialize(DsVgmUrl) + "////" + userkey + "////"+ usersecret + "////"+JsonConvert.Serialize(sendinfo), "", "DJYVGM2024", "发送");
var rtn = WebRequestHelper.DoPost_JSON_Header(DsVgmUrl, JsonConvert.Serialize(sendinfo), 10000,headers);
BasicDataRefDAL.SaveLog(rtn, "", "DJYVGM2024", "返回");
@ -428,14 +652,78 @@ namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
if (_r.statusCode == 200)
{
//20240904 然后判断 CarrierSendFlag 或 YGTSendFlag 中有-1的 对应发送失败
var cdc = new CommonDataContext();
var updrec = cdc.op_seae_vgm_send.FirstOrDefault(x => x.BSNO == OpSeaehead.BSNO);
updrec.MFNO = _r.data.MFNO;
updrec.LINKURL = _r.data.LINKURL;
updrec.VGMSTATUS = _r.data.sendstatus;
updrec.MFNO = _r.data.mfno;
updrec.LINKURL = _r.data.linkUrl;
//updrec.VGMSTATUS = _r.data.sendstatus;
updrec.VGMSTATUS = "";
if (_r.data.carrierSendFlag == -1)
{
updrec.VGMSTATUS = "船公司发送失败";
}
if (_r.data.carrierSendFlag == 1)
{
updrec.VGMSTATUS = "船公司发送成功";
}
if (_r.data.ygtSendFlag == -1)
{
updrec.VGMSTATUS += " 云港通发送失败";
}
if (_r.data.ygtSendFlag == 1)
{
updrec.VGMSTATUS += " 云港通发送成功";
}
if (string.IsNullOrWhiteSpace(updrec.VGMSTATUS))
{
updrec.VGMSTATUS = _r.data.sendstatus;
}
if (_r.data.ctnList != null && _r.data.ctnList.Count > 0)
{
var returnCtnList = _r.data.ctnList;
var currctnlist = cdc.op_seae_vgm_ctn.Where(p => p.BSNO == OpSeaehead.BSNO).ToList();
foreach (var ctn in currctnlist)
{
if (returnCtnList.Exists(x => x.cntrno == ctn.CNTRNO))
{
ctn.ygtSendFlag = returnCtnList.FirstOrDefault(x => x.cntrno == ctn.CNTRNO).ygtSendFlag;
ctn.carrierSendFlag = returnCtnList.FirstOrDefault(x => x.cntrno == ctn.CNTRNO).carrierSendFlag;
cdc.op_seae_vgm_ctn.AddOrUpdate(ctn);
}
}
}
cdc.op_seae_vgm_send.AddOrUpdate(updrec);
cdc.SaveChanges();
//cdc.SaveChanges();
result.OK("上传成功",updrec);
//记录日志
//var cdc = new DSWeb.Common.DB.CommonDataContext();
var newrec = new op_seae_vgm_history_md();
newrec.BSNO = updrec.BSNO;
newrec.SENDERUSER = updrec.SENDERUSER;
newrec.SENDTIME = updrec.SENDTIME;
newrec.CTNNUM = updrec.CTNNUM;
newrec.REMARK = updrec.REMARK;
if (!string.IsNullOrEmpty(_r.data.sendRltMsg))
{
newrec.REMARK += " " + _r.data.sendRltMsg;
}
newrec.SENDTYPE = updrec.SENDTYPE;
cdc.op_seae_vgm_history.Add(newrec);
cdc.SaveChanges();
}
else {
result.Success = false;
@ -466,7 +754,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpVgmSendDAL
var cdc = new CommonDataContext();
var _head = cdc.op_seae_vgm_send.Where(p => p.BSNO == sendparam.mfno).FirstOrDefault();
var _head = cdc.op_seae_vgm_send.Where(p => p.BSNO == sendparam.mfno||p.MFNO==sendparam.mfno).FirstOrDefault();
//var head = MsOpVgmSendDAL.GetData("BSNO='" + sendparam.mfno + "'");

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using DSWeb.Areas.CommMng.Models;
using HcUtility.Core;
using java.lang;
using Newtonsoft.Json;
@ -153,7 +154,16 @@ namespace DSWeb.MvcShipping.Models.MsOpVgmSend
public string WEIGHDATE { get; set; }
/// <summary>
/// 船司发送状态
/// 船司发送状态 0-未发送 1-发送成功 -1 发送失败
/// </summary>
public int? carrierSendFlag { get; set; } = 0;
/// <summary>
/// 云港通发送状态 0-未发送 1-发送成功 -1 发送失败
/// </summary>
public int? ygtSendFlag { get; set; } = 0;
#endregion
@ -226,6 +236,17 @@ namespace DSWeb.MvcShipping.Models.MsOpVgmSend
///
/// </summary>
public bool sendFlag { get; set; }
/// <summary>
/// 船司发送状态
/// 船司发送状态 0-未发送 1-发送成功 -1 发送失败
/// </summary>
public int? carrierSendFlag { get; set; } = 0;
/// <summary>
/// 云港通发送状态 0-未发送 1-发送成功 -1 发送失败
/// </summary>
public int? ygtSendFlag { get; set; } = 0;
}
public class DsVgm
@ -308,5 +329,55 @@ namespace DSWeb.MvcShipping.Models.MsOpVgmSend
public bool sendYGT { get; set; }
}
public class vgmResult : DJYResult
{
public string data { get; set; }
public string errors { get; set; }
}
public class VgmSendResult
{
public string sendstatus { get; set; }
public string huiZhiZhuangTai { get; set; }
public string zhuangTaiShiJian { get; set; }
public string ygtResp { get; set; }
public string ygtRespTime { get; set; }
public string linkUrl { get; set; }
public string mfno { get; set; }
public string mblno { get; set; }
public string carrier { get; set; }
/// <summary>
/// 船司发送状态
/// 船司发送状态 0-未发送 1-发送成功 -1 发送失败
/// </summary>
public int? carrierSendFlag { get; set; }
/// <summary>
/// 云港通发送状态 0-未发送 1-发送成功 -1 发送失败
/// </summary>
public int? ygtSendFlag { get; set; }
/// <summary>
/// 发送回执消息
/// </summary>
public string sendRltMsg { get; set; }
/// <summary>
///
/// </summary>
public List<Ctn> ctnList { get; set; }
}
public class djyvgmresult : DJYResult
{
public VgmSendResult data { get; set; }
public string errors { get; set; }
}
}

@ -928,7 +928,7 @@ Ext.extend(Shipping.MsOpSeaeAmendIndex, Ext.Panel, {
return '';
}
}, {
dataIndex: 'REMARKS',
dataIndex: 'REMARK',
header: '备注', //'推航次',
width: 70
}];

@ -117,7 +117,14 @@ Ext.extend(Shipping.MsOpSeaiAmendIndex, Ext.Panel, {
dataIndex: 'ACCDATE',
header: Zi.LAN.ACCDATE, //'会计期间',
width: 60
},
},
{
sortable: true,
id: '',
dataIndex: 'REMARK',
header: Zi.LAN.REMARK, //'更改原因',
width: 120
},
{
sortable: true,
id: '',

@ -165,100 +165,144 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
plugins: [this.gridListCellEditing],
selModel: this.CtnGridCheckBoxModel,
selType: 'cellmodel',
columns: [{
sortable: true,
dataIndex: 'CTN_ID',
header: 'CTN_ID', //'编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'BSNO',
header: 'BSNO', //'业务编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'MFNO',
header: 'MFNO', //'业务编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'SENDGID',
header: 'SENDGID', //'业务编号',
hidden: true,
width: 0
},
{
dataIndex: 'CTNALL',
header: '箱型', //'箱型',
width: 65,
editor: this.comboxCTNALL
}, {
dataIndex: 'CNTRNO',
header: '箱号', //'箱号',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
columns: [
{
sortable: true,
dataIndex: 'CTN_ID',
header: 'CTN_ID', //'编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'BSNO',
header: 'BSNO', //'业务编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'MFNO',
header: 'MFNO', //'业务编号',
hidden: true,
width: 0
}, {
sortable: true,
dataIndex: 'SENDGID',
header: 'SENDGID', //'业务编号',
hidden: true,
width: 0
},
renderer: function (value, cellmeta) {
return value.trim();
}
}, {
dataIndex: 'SEALNO',
header: '封号', //'封号',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'KGS',
header: '毛重', //'重量',
width: 80,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'TAREWEIGHT',
header: '箱皮重', //'箱皮重',
width: 80,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'WEIGHTYPE',
header: '称重方式', //'称重方式',
width: 80,
editor: this.comboxWEIGHTYPE
}, {
dataIndex: 'VGMKGS',
header: 'VGM重量', //'参考重量',
width: 80,
renderer: function (value, meta, record) {
return Add(record.data.KGS, record.data.TAREWEIGHT);
{
dataIndex: 'CTNALL',
header: '箱型', //'箱型',
width: 50,
editor: this.comboxCTNALL
}, {
dataIndex: 'CNTRNO',
header: '箱号', //'箱号',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
},
renderer: function (value, cellmeta) {
return value.trim();
}
}, {
dataIndex: 'SEALNO',
header: '封号', //'封号',
width: 100,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'KGS',
header: '毛重', //'重量',
width: 65,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'TAREWEIGHT',
header: '箱皮重', //'箱皮重',
width: 65,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
dataIndex: 'WEIGHTYPE',
header: '称重方式', //'称重方式',
width: 60,
editor: this.comboxWEIGHTYPE
}, {
dataIndex: 'VGMKGS',
header: 'VGM重量', //'参考重量',
width: 65,
renderer: function (value, meta, record) {
return Add(record.data.KGS, record.data.TAREWEIGHT);
}
}, {
dataIndex: 'WEIGHDATE',
header: '称重时间', //'箱皮重',
width: 70,
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
editor: {
xtype: 'datefield',
format: 'Y-m-d',
selectOnFocus: true
}
}, {
dataIndex: 'YARD',
header: '场站', //'箱状态',
width: 100,
editor: this.comboxYARD
}, {
sortable: true,
dataIndex: 'carrierSendFlag',
header: '船公司发送',
width: 70,
renderer: function (value, meta) {
if (value == '-1') {
return "失败";
} else if (value == '0') {
return "未发";
} else if (value == '1') {
return "发送成功";
} else {
return ""
}
}
}, {
sortable: true,
dataIndex: 'ygtSendFlag',
header: '云港通发送',
width: 70,
renderer: function (value, meta) {
if (value == '-1') {
return "失败";
} else if (value == '0') {
return "未发";
} else if (value == '1') {
return "发送成功";
} else {
return ""
}
}
}],
tbar: [
{
text: '删除明细', //'删除明细',
tooltip: '注意已发送成功的箱无法删除', //'删除明细',
iconCls: "btndeletedetail",
handler: function (button, event) {
this.OnDelCtn(button, event, 1);
},
scope: this
}]
}
}, {
dataIndex: 'WEIGHDATE',
header: '称重时间', //'箱皮重',
width: 80,
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
editor: {
xtype: 'datefield',
format: 'Y-m-d',
selectOnFocus: true
}
}, {
dataIndex: 'YARD',
header: '场站', //'箱状态',
width: 100,
editor: this.comboxYARD
}]
});
this.panelBodyCtn = new Ext.Panel({
@ -302,31 +346,37 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
layout: 'hbox',
defaultType: 'textfield',
items: [
{
fieldLabel: '提单号',
xtype: 'label',
id:"MBLNOLabel",
flex: 1.1, margins: '0'
},
{
fieldLabel: '发送状态',
id: "VGMSTATUS",
flex: 0.4,
//hidden: true,
html: "",
flex: 1.4,
hidden: true,
html: "<a><b></b></a>",
}
,
{
xtype: 'checkboxgroup',
flex: 2,
flex: 1.6,
fieldLabel: '发送方', //'文件功能',
items: [{
xtype: "checkbox", //checkbox控件
name: "ISCARRIER",
boxLabel: "",
fieldLabel: "船公司",
labelWidth: 50,
labelWidth: 45,
inputValue: true, //选中的值
uncheckedValue: false, //未选中的值
checked: true //绘制时的选中状态
}, {
xtype: "checkbox", //checkbox控件
name: "ISYGT",
labelWidth: 50,
labelWidth: 45,
boxLabel: "",
fieldLabel: "云港通",
inputValue: true, //选中的值
@ -339,17 +389,20 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
, { xtype: 'hiddenfield', flex: 0.6 },
{
xtype: 'radiogroup',
flex: 2,
flex: 1.4,
labelWidth: 60,
fieldLabel: '操作类型', //'文件功能',
id: 'vGMFILEROLE',
defaults: { flex: 1 },
layout: 'hbox',
items: [{
labelWidth: 45,
boxLabel: "新增", //'原始',
name: 'FILEROLE',
inputValue: '9',
checked: true
}, {
labelWidth: 45,
boxLabel: "修改", //'更新',
name: 'FILEROLE',
inputValue: '5'
@ -375,7 +428,18 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
}, {
fieldLabel: 'BSNO',
name: 'BSNO', flex: 0, hidden: true, margins: '0'
}
}, {
fieldLabel: 'MBLNO',
name: 'MBLNO', flex: 0, hidden: true, margins: '0'
}
, {
fieldLabel: 'MFNO',
name: 'MFNO', flex: 0, hidden: true, margins: '0'
}
, {
fieldLabel: 'VGMSTATUS',
name: 'VGMSTATUS', flex: 0, hidden: true, margins: '0'
}
//, {
// fieldLabel: 'ISCARRIER',
@ -390,9 +454,6 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
, {
fieldLabel: 'SENDTYPE',
name: 'SENDTYPE', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: 'MBLNO',
name: 'MBLNO', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: '船名',
name: 'VESSEL'
@ -581,6 +642,28 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
, '-',
//
{
text: "刷新", //
minWidth: 70,
handler: function () {
_this.OnRefreshCtn();
}
},
{
text: "保存", //
minWidth: 70,
handler: function () {
var cgFILEROLE = Ext.getCmp('vGMFILEROLE');
var FILEROLE = cgFILEROLE.getValue();
var ISCARRIER = _this.formEdit.getForm().findField('ISCARRIER').getValue();
var ISYGT = _this.formEdit.getForm().findField('ISYGT').getValue();
_this.onSaveVGM(ISCARRIER, ISYGT, FILEROLE.FILEROLE, false);
}
}, '-',
{
text: "发送VGM", //"生成并发送VGM报文",
minWidth: 70,
@ -590,7 +673,7 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
var ISCARRIER = _this.formEdit.getForm().findField('ISCARRIER').getValue();
var ISYGT = _this.formEdit.getForm().findField('ISYGT').getValue();
_this.onSendVGM(ISCARRIER, ISYGT, FILEROLE.FILEROLE);
_this.onSaveVGM(ISCARRIER, ISYGT, FILEROLE.FILEROLE,true);
}
}
@ -612,7 +695,7 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 390,
height: 380,
items: [this.formEdit, this.panelBtn]
});
@ -719,7 +802,7 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
bodyStyle: "padding:0 0 0 0",
items: [this.formVGMShow],
buttons: [{
text: "发送VGM", //"生成并发送VGM报文",
text: "发送VGM_del", //"生成并发送VGM报文",
minWidth: 70,
handler: function () {
var cgFILEROLE = Ext.getCmp('vGMFILEROLE');
@ -730,13 +813,13 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
_this.onSendVGM(ISCARRIER, ISYGT, FILEROLE.FILEROLE);
}
}, {
text: "获取链接",
text: "获取链接_del",
handler: function (button, event) {
_this.GetVgmLink();
},
scope: this
}, '-', {
text: "关闭", //"关闭",
text: "关闭_Del", //"关闭",
minWidth: 70,
handler: function () {
_this.winVGMShow.close();
@ -744,6 +827,15 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
}]
});
//#endregion
this.storeCtnList.on('beforeload', function (store) {
var condition = "BSNO='" + this.bsno + "'";
Ext.apply(store.proxy.extraParams, { condition: condition });
}, this);
//绑定查询窗体
parentWin = window.parent.opener.panelEdit;
@ -774,11 +866,16 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
LoadData: function (bsno) {
this.formEdit.getForm().reset();
if (!this.MeditRecord.data.LOADPORT) {
this.MeditRecord.data.LOADPORT = this.MeditRecord.data.PORTLOAD;
if (this.MeditRecord.data.PORTLOADID) {
this.MeditRecord.data.LOADPORT = this.MeditRecord.data.PORTLOADID;
this.storeMATOU.load({ params: { enumTypeId: 96304, sCondition: "EnumValueName_2='" + this.MeditRecord.data.PORTLOADID + "'" } });
}
this.formEdit.getForm().setValues(this.MeditRecord.data);
Ext.getCmp("MBLNOLabel").setText("提单号:" +this.MeditRecord.data.MBLNO);
//for (var j = 0; j < this.MStoreList.getCount(); j += 1) {
// var memberbody = this.MStoreList.getAt(j);
@ -819,8 +916,10 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
var data = result.data;
if (data.MBLNO) {
Ext.getCmp("MBLNOLabel").setText(""+data.MBLNO);
}
if (data.BSNO) {
data.VGM_TIME = data.VGM_TIME.replace(" 0:00:00", "");
@ -885,7 +984,9 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
params: { condition: "bsno='" + this.bsno + "'" },
callback: function (options, success, response) {
if (_this.storeCtnList.getCount() == 0) {
if (_this.storeCtnList.getCount() == 0)
{
//没有获取到已保存的箱信息 从海运出口箱信息中获取
for (var j = 0; j < _this.MStoreList.getCount(); j += 1) {
var memberbody = _this.MStoreList.getAt(j);
@ -902,17 +1003,62 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
WEIGHDATE: memberbody.data.WEIGHDATE
});
_this.storeCtnList.add(record);
};
//var testGrid = Ext.getCmp('testGrid');
var records = _this.gridList.getStore().getRange();
var selectModel = _this.gridList.getSelectionModel();
for (var i = 0; i < records.length; i++) {
var record = records[i];
selectModel.select(record, true);
//if (selectModel.isSelected(record)) {
// selectModel.deselect(record);
//} else {
// selectModel.select(record, true);
//}
}
//for (var j = 0; j < _this.MStoreList.getCount(); j += 1) {
// _this.gridList.getSelectionModel().select(j);
//};
} else {
//for (var j = 0; j < _this.storeCtnList.getCount(); j += 1) {
// var memberbody = _this.storeCtnList.getAt(j);
// if (memberbody.data.carrierSendFlag != 1 || memberbody.data.ygtSendFlag != 1) {
// _this.gridList.getSelectionModel().select(j);
// }
//};
var records = _this.gridList.getStore().getRange();
var selectModel = _this.gridList.getSelectionModel();
for (var i = 0; i < records.length; i++) {
var record = records[i];
if (record.data.carrierSendFlag != 1 || record.data.ygtSendFlag != 1) {
selectModel.select(record, true);
} else {
selectModel.deselect(record);
}
//if (selectModel.isSelected(record)) {
// selectModel.deselect(record);
//} else {
// selectModel.select(record, true);
//}
}
}
}
});
}, // end LoadDate
} // end LoadDate
onSendVGM: function (ISCARRIER, ISYGT, FILEROLE) {
, onSendVGM: function (ISCARRIER, ISYGT, FILEROLE) {
var basicForm = this.formEdit.getForm();
if (!basicForm.isValid()) {
@ -929,12 +1075,22 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
var data = this.formEdit.getForm().getValues(false, false, false);
this.formEdit.getForm().findField('GID').setDisabled(true);
var bodyctndatas = [];
for (var i = 0; i < this.storeCtnList.getCount(); i += 1) {
var member = this.storeCtnList.getAt(i);
bodyctndatas.push(member);
var selectedRecords = this.gridList.selModel.getSelection();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
bodyctndatas.push(rec);
}
;
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: '错误', msg: "发送时必须选择至少一条箱信息", icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
var jsonCtnBody = ConvertRecordsToJsonAll(bodyctndatas);
@ -945,7 +1101,7 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
scope: this,
params: {
data: Ext.JSON.encode(data),
bodylist: jsonCtnBody,
bodylist: jsonCtnBody
},
callback: function (options, success, response) {
if (success) {
@ -972,6 +1128,71 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
}
});
} //end save
, onSaveVGM: function (ISCARRIER, ISYGT, FILEROLE,saveandsend=false) {
var basicForm = this.formEdit.getForm();
if (!basicForm.isValid()) {
return;
}
this.formEdit.getForm().findField('ISCARRIER').setValue(ISCARRIER);
this.formEdit.getForm().findField('ISYGT').setValue(ISYGT);
this.formEdit.getForm().findField('SENDTYPE').setValue(FILEROLE);
MATOU = this.formEdit.getForm().findField('MATOU').getValue();
LOADPORT = this.formEdit.getForm().findField('LOADPORT').getValue();
this.formEdit.getForm().findField('GID').setDisabled(false);
var data = this.formEdit.getForm().getValues(false, false, false);
this.formEdit.getForm().findField('GID').setDisabled(true);
var bodyctndatas = [];
for (var i = 0; i < this.storeCtnList.getCount(); i += 1) {
var member = this.storeCtnList.getAt(i);
bodyctndatas.push(member);
}
var jsonCtnBody = ConvertRecordsToJsonAll(bodyctndatas);
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsOpVgmSend/SaveVgm',
scope: this,
params: {
data: Ext.JSON.encode(data),
bodylist: jsonCtnBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
if (!saveandsend) {
_this.LoadData(_this.bsno);
_this.winVGMShow.close();
} else {
_this.onSendVGM(ISCARRIER, ISYGT, FILEROLE);
}
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
_this.winVGMShow.close();
}
} else {
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
} //end save
, ShowHistory: function (BSNO) {
@ -1165,6 +1386,135 @@ Ext.extend(Shipping.MsOpVgmSendEdit, Ext.Panel, {
ShowPublicINFO(title, model, proxyUrl, condition, columns, 500);
}
, OnRefreshCtn: function () {
_this = this;
//this.storeCtnList.removeAll();
var addList = [];
for (var j = 0; j < this.MStoreList.getCount(); j += 1) {
var memberbody = this.MStoreList.getAt(j);
havecntrno = false;
for (var i = 0; i < this.storeCtnList.getCount(); i += 1) {
var ctndata = this.storeCtnList.getAt(i).data;
if (ctndata.CNTRNO == memberbody.data.CNTRNO) {
havecntrno = true;
}
};
if (!havecntrno) {
var record = Ext.create('MsOpVgmCtn', {
BSNO: memberbody.data.BSNO,
CTNALL: memberbody.data.CTNALL,
CNTRNO: memberbody.data.CNTRNO,
SEALNO: memberbody.data.SEALNO,
KGS: memberbody.data.KGS,
WEIGHTYPE: 'SM2',
TAREWEIGHT: memberbody.data.TAREWEIGHT,
VGMKGS: Add(memberbody.data.KGS, memberbody.data.TAREWEIGHT),
YARD: _this.MeditRecord.data.YARD,
WEIGHDATE: memberbody.data.WEIGHDATE
});
//addList.push(record);
this.storeCtnList.add(record);
}
};
//if (addList != []) {
// foreach(addList, function (item) {
// _this.storeCtnList.add(item);
// });
//}
var cgFILEROLE = Ext.getCmp('vGMFILEROLE');
var FILEROLE = cgFILEROLE.getValue();
var ISCARRIER = _this.formEdit.getForm().findField('ISCARRIER').getValue();
var ISYGT = _this.formEdit.getForm().findField('ISYGT').getValue();
_this.onSaveVGM(ISCARRIER, ISYGT, FILEROLE.FILEROLE, false);
}
, OnDelCtn: function () {
_this = this;
var basicForm = this.formEdit.getForm();
if (!basicForm.isValid()) {
return;
}
var cgFILEROLE = Ext.getCmp('vGMFILEROLE');
var FILEROLE = cgFILEROLE.getValue();
var ISCARRIER = _this.formEdit.getForm().findField('ISCARRIER').getValue();
var ISYGT = _this.formEdit.getForm().findField('ISYGT').getValue();
this.formEdit.getForm().findField('ISCARRIER').setValue(ISCARRIER);
this.formEdit.getForm().findField('ISYGT').setValue(ISYGT);
this.formEdit.getForm().findField('SENDTYPE').setValue(FILEROLE);
MATOU = this.formEdit.getForm().findField('MATOU').getValue();
LOADPORT = this.formEdit.getForm().findField('LOADPORT').getValue();
this.formEdit.getForm().findField('GID').setDisabled(false);
var data = this.formEdit.getForm().getValues(false, false, false);
this.formEdit.getForm().findField('GID').setDisabled(true);
var selectedRecords = this.gridList.selModel.getSelection();
var bodyctndatas = [];
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.CTN_ID == "" || !rec.data.CTN_ID)//如果是新增但没有保存的数据,没有必要提交到后台
{
this.storeCtnList.remove(selectedRecords[i]);
}
else {
bodyctndatas.push(rec);
}
}
var jsonCtnBody = ConvertRecordsToJsonAll(bodyctndatas);
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsOpVgmSend/DelCtn',
scope: this,
params: {
data: Ext.JSON.encode(data),
bodylist: jsonCtnBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.LoadData(_this.bsno);
_this.winVGMShow.close();
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
_this.winVGMShow.close();
}
} else {
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}
});

@ -40,7 +40,9 @@ Ext.define('MsOpVgmCtn', {
{ name: 'TAREWEIGHT', type: 'number' }, //
{ name: 'VGMKGS', type: 'number' }, //
{ name: 'YARD', type: 'string' }, // 创建人
{ name: 'WEIGHDATE', type: 'date' }
{ name: 'WEIGHDATE', type: 'date' },
{ name: 'carrierSendFlag', type: 'number' },
{ name: 'ygtSendFlag', type: 'number' }
]
});

@ -1895,7 +1895,7 @@ Ext.extend(Shipping.MsOp_BLISSUEIndex, Ext.Panel, {
format: 'Y-m-d',
flex: 1,
id: 'QRDATE',
xtype: 'datefield',
xtype: 'datetimefield',
name: 'QRDATE'
},
{

@ -465,7 +465,10 @@ namespace DSWeb.Areas.SysMng.DAL.SysUser
}
if (!userActionDA.IsExistUserModule(USERID, tempSelectedModuleID))
{
BasicDataRefDAL.SaveLog("更新权限"+ USERID+";"+ tempSelectedModuleID, MODIFIEDUSER,"更新权限","更新权限");
result.SetErrorInfo(userActionDA.InsertUserAction(USERID, tempSelectedModuleID, MODIFIEDUSER) == 1 ? "模块【" + model.DESCRIPTION + "】添加成功" : "模块【" + model.DESCRIPTION + "】添加失败");
}else
result.SetErrorInfo("");
}
@ -473,6 +476,8 @@ namespace DSWeb.Areas.SysMng.DAL.SysUser
{
if (!userActionDA.IsExistUserModule(USERID, tempSelectedModuleID))
{
BasicDataRefDAL.SaveLog("更新权限" + USERID + ";" + tempSelectedModuleID, MODIFIEDUSER, "更新权限", "更新权限");
result.SetErrorInfo(userActionDA.InsertUserAction(USERID, tempSelectedModuleID, MODIFIEDUSER) == 1 ? "模块【" + model.DESCRIPTION + "】添加成功" : "模块【" + model.DESCRIPTION + "】添加失败");
}else
result.SetErrorInfo("");

@ -0,0 +1,58 @@
[database]
Provider=SQLOLEDB.1;
Password=Ds2019*20040201;
Persist Security Info=False;
User ID=sa;
Initial Catalog=shippingweb_ds;
Data Source=47.104.102.13,3433;
Use Procedure for Prepare=1;
Auto Translate=True;
Workstation ID=server
[other]
emp=邓羽
subcompy=青岛分公司
Exrate=7.7
qdisp=1
edmainbill=1
aedisp=1
sidisp=1
webmsg=1
closeusedate=0
[View]
t_project=1
Viewskin=4
tabindex=0
[NYKEDI]
SEND=030
RECIEVE=3213
SENDNAME=3213321
FTPSERVER=
FTPPATH=/
FTPNAME=
FTPPASS=
[PINGZHENG]
USDRATE=6.8
[seaeorder]
op=邓羽
opdept=软件开发部
kf=邓羽
kfdept=软件开发部
savecheck=1
[YMEDI]
SEND=
RECIEVE=
SENDNAME=
FTPSERVER=
FTPPATH=/
FTPNAME=
FTPPASS=
[BBEDI]
SENDCODE=启明信息青岛分公司
RECIEVECODE=
[CMA]
SEND_CODE=
SEND_NAME=
RECEIVE_CODE=
RECEIVE_NAME=

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.
Loading…
Cancel
Save