委托结算,增加运踪

dev
ddlucky 7 months ago
parent f5ad899773
commit 7852e7b563

@ -24,6 +24,15 @@ namespace DSWeb.Common.DB
//public string PARAMVALUE2 { get; set; }
//public string PARAMVALUE3 { get; set; }
//public string PARAMVALUE4 { get; set; }
public sys_param_set_md() { }
public sys_param_set_md(string paramname,string description)
{
GID = Guid.NewGuid().ToString();
PARAMNAME = paramname;
PARAMDESCRIPTION = description;
}
}
[Table("sys_parameter_value")]
@ -3712,6 +3721,12 @@ namespace DSWeb.Common.DB
[NotMapped]
public string OT4 { get; set; }
public string CangDanShiJian { get; set; }
public string HaiFangShiJian { get; set; }
public string TiHuo { get; set; }
public string TiHuoInfo { get; set; }
public string FanKong { get; set; }
public string FanKongInfo { get; set; }
public class SearchParam
{
public string BSNO { get; set; } = "";

@ -122,6 +122,30 @@ namespace DSWeb.Common.DB
public string PCTN_ID { get; set; }
public string ISTEMP { get; set; }
public long? DJYCTNID { get; set; }
public op_ctn_md() { }
public op_ctn_md(string _BSNO)
{
CTN_ID = Guid.NewGuid().ToString();
BSNO= _BSNO;
CTNNUM = 0;
TEU = 0;
PKGS = 0;
KGS = 0;
CBM = 0;
TAREWEIGHT = 0;
WEIGHKGS = 0;
TRUCKFEE = 0;
STORAGEPRICE = 0;
STORAGEFEE = 0;
FREECTNDAY = 0;
CTNDAY = 0;
CTNPRICE = 0;
CTNFEE = 0;
ISWMS = false;
DJYCTNID = 0;
}
}

@ -2146,14 +2146,14 @@ namespace DSWeb.Areas.Account.Controllers
//此时head.billUuid如果不为空 代表已有红字申请单
if (!string.IsNullOrWhiteSpace(head.billUuid))//&&
{
redhead.BILLNO = redhead.billUuid;
//redhead.BILLNO = redhead.billUuid;
redhead.GID = redhead.billUuid;
var _r = hx.ReadRedConfirm(ref redhead, detailList);
if (!_r.Success)
{
if (_r.Message != "红字确认单申请中") {
if (_r.Message != "红字确认单申请中" && _r.Message != "提交失败,请先完成扫脸身份认证后再试。") {
head.billUuid = "";
modb.Save(head);
}
@ -2227,11 +2227,11 @@ namespace DSWeb.Areas.Account.Controllers
}
else
{
//head.billUuid如果为空 代表还没发红字申请单
//head.billUuid如果为空 代表还没发红字申请单
//获取红票信息并发出
redhead.BILLNO = PubSysDAL.GetBillNo("0308");
head.billUuid = redhead.BILLNO;
head.billUuid = redhead.GID.Replace("-","");
result = hx.PostRedConfirm(redhead, ref head, detailList,Session);

@ -946,8 +946,10 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
/// <summary>
/// 红字确认单申请号,需要保持唯一,不传的话系统自动生成一个;
/// 此处使用蓝票的billno
/// 20240423 改为使用红票的GID 并去除-
/// 在初次冲红时记录在蓝票的billUuid
/// </summary>
public string billId { get { return ChInvoice_HangXin.BILLNO; } }
public string billId { get { return ChInvoice_HangXin.GID.Replace("-",""); } }
/// <summary>
/// 对应蓝票发票种类: bs:电子发票(增值税专用发票) pc:电子发票(普通发票)es:全电纸质发票(增值税专用发票) ec:全电纸质发票(普通发票
@ -1083,8 +1085,10 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
public string billStatus { get; set; }
/// <summary>
/// 红字确认单申请号 ds7当中红票的billno
/// 20240423 改为使用红票的GID 并去除-
/// 在初次冲红时记录在蓝票的billUuid
/// </summary>
public string billId { get { return ChInvoice_HangXin.BILLNO; } }
public string billId { get { return ChInvoice_HangXin.billUuid; } }
/// <summary>
/// 红字确认单编号
/// </summary>
@ -2320,6 +2324,130 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
}
}
public DBResult ReadRedInvoice(ChInvoice_HangXin head)
{
if (string.IsNullOrEmpty(head.INVOICESERIALNUM) && !head.())
{
var result = new DBResult { Success = false, Message = "还未成功进行平台开票,无可读数据", Data = "" };
return result;
}
string method = "nuonuo.OpeMplatform.queryInvoiceResult";
var json = "{" + "\"serialNos\":[\"" + head.INVOICESERIALNUM + "\"]," + "\"orderNo\":[]," + "\"isOfferInvoiceDetail\":0 }";
if (string.IsNullOrWhiteSpace(head.INVOICESERIALNUM))
{
//如果流水号为空 则改为按业务编号读取
method = "nuonuo.OpeMplatform.queryInvoiceResult";
json = "{" + "\"orderNos\":[\"" + head.GID.Replace("-","") + "\"]," + "\"serialNos\":[]," + "\"isOfferInvoiceDetail\":0 }";
}
//读取业务
//string method = "nuonuo.electronInvoice.querySerialNum";
//var json = "{" + "\"orderNo\":[\"" + head.BILLNO + "\"]" + "}";
BasicDataRefDAL.SaveLog("URL=" + URL + ";appKey=" + appKey + ";appSecret=" + appSecret + ";accessToken=" + accessToken + ";taxnum=" + taxnum + ";method=" + method + ";content=" + json, "诺诺平台", "读取发票信息", "发送值");
string _r = NNOpenSDK.sendPostSyncRequest(URL, getSendid(), appKey, appSecret, accessToken, taxnum, method, json);
BasicDataRefDAL.SaveLog(_r, "诺诺平台", "读取发票信息", "返回值");
var _return = dealresponse_Read(_r);
if (_return.code == "070101" || _return.code == "070301")
{
//appkey与token问题 需要重新认证
//HangXinRequestHelper.clear(accessToken);
var result = new DBResult(false, "需要重新认证", null);
return result;
}
if (_return.code == "070302")
{
//appkey与token问题 需要重新认证
//HangXinRequestHelper.clear(accessToken);
var result = new DBResult(false, "需要联系诺诺平台开通相关权限", null);
return result;
}
if (_return.code == "E0000")
{
//开票信息读取成功
var returndate = new ChInvoice_HangXin();
if (!head.())
{
returndate = ChinvoiceDAL.GetData("cm.INVOICESERIALNUM='" + head.INVOICESERIALNUM + "'");
}
if (head.())
{
returndate = ChinvoiceDAL.GetData("cm.BILLNO='" + head.BILLNO + "'");
}
head = returndate;
//var invoiceSerialNum = _return.result[0].invoiceSerialNum;
var info = _return.result[0];
//立即调用读取发票信息的方法 将返回值设置进head 并保存
//head.INVOICESERIALNUM = invoiceSerialNum;
head.INVOICECODE = info.invoiceCode;
head.INVOICENO = info.invoiceNo;
head.EINVOICESTATE = info.status;
head.INVOICEINFOURL = info.pdfUrl;
head.INVOICEPDFURL = info.pdfUrl;
head.INVOICEMAKETIME = BasicDataRefDAL.Timestamp2Datetime(info.invoiceTime).ToString("yyyy-MM-dd HH:mm:ss");
//if (!string.IsNullOrWhiteSpace(info.invoiceSerialNum))
//{
// head.INVOICESERIALNUM = info.invoiceSerialNum;
//}
//head.REMARK = head.REMARK.Replace(info.remark,"")+ info.remark;
head.DbOperationType = DbOperationType.DbotUpd;
head.ModelUIStatus = "E";
//head.INVOICEMAKETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
var modb = new ModelObjectDB();
var result = modb.Save(head);
if (!result.Success)
return result;
result.Message = info.statusMsg;
if (result.Message.IndexOf("失败") >= 0)
{
result.Success = false;
result.Message += ":" + info.failCause;
//此处调用一次重推
var hx = getHelper(head);
hx.(head);
}
else
{
result.Message += ":" + info.failCause;
}
result.Data = head;
return result;
}
else
{
var failCause = "";
try
{
var info = _return.result[0];
failCause = "[" + info.failCause + "]";
}
catch
{
}
var msg = _return.code + ":" + _return.describe + failCause;
var result = new DBResult { Success = false, Message = DSWeb.TruckMng.Helper.JsonConvert.Serialize(msg), Data = "" };
return result;
}
}
public DBResult (ChInvoice_HangXin head)
{
@ -2536,7 +2664,6 @@ namespace DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin
BasicDataRefDAL.SaveLog(rtn, "诺诺全电", "红字确认单", "返回值");
var _return = DSWeb.TruckMng.Helper.JsonConvert.Deserialize<>(rtn.Trim('"'));
var result = new DBResult();

@ -559,6 +559,12 @@ Ext.extend(Shipping.MsChInvoiceBLEdit, Ext.Panel, {
value: '1',
name: 'INVOICETYPE', flex: 0, hidden: true, margins: '0'
},
{
fieldLabel: "billUuid",
hidden: true,
readOnly: true,
name: 'billUuid'
},
{
fieldLabel: Zi.LAN.BIANHAO,
readOnly: true,

@ -66,7 +66,10 @@
{ name: 'PTORRED', type: 'string' },
{ name: 'SETRED', type: 'string' },
{ name: 'INVSHENNO', type: 'string' },
{ name: 'VOUNO', type: 'string' }
{ name: 'VOUNO', type: 'string' },
{ name: 'billUuid', type: 'string' }
]
});

@ -15,6 +15,13 @@ using DSWeb.Areas.MvcShipping.DB;
using DSWeb.MvcShipping.Models.MsOpSeae;
using DSWeb.Areas.MvcShipping.Models.Message.VGM;
using DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL;
using NPOI.SS.Formula.Functions;
using DSWeb.Areas.MvcShipping.Comm;
using DSWeb.MvcShipping.DAL.MsSysThirdPartyAccount;
using DSWeb.MvcShipping.Models.MsCwVouchersGl;
using DSWeb.Common.DB;
using System.Linq;
using DSWeb.MvcShipping.Models.MsSysParamSet;
namespace DSWeb.Areas.CommMng.Models
{
@ -1741,5 +1748,288 @@ namespace DSWeb.Areas.CommMng.Models
#endregion
#region 云港通实时接口
public class Helper {
public string user_key { get; set; }
public string user_secret { get; set; }
public string bno { get; set; }
public string web_user { get; set; }
public string web_psw { get; set; }
public string vessel { get; set; }
public string voyage { get; set; }
public string email { get; set; }
public string ServerUrl { get; set; }
public virtual string apiurl { get; set; }
public DBResult GetUrl(string USERID) {
var result = new DBResult();
result.OK();
CommonDataContext commonData = new CommonDataContext();
var pUserKey = commonData.sys_param_set.AsNoTracking().FirstOrDefault(p => p.PARAMNAME == "billTraceNewUserKey");
var pUserSecret = commonData.sys_param_set.AsNoTracking().FirstOrDefault(p => p.PARAMNAME == "billTraceNewUserSecret");
if (pUserKey == null || string.IsNullOrEmpty(pUserKey.PARAMVALUE) || pUserSecret == null || string.IsNullOrEmpty(pUserSecret.PARAMVALUE))
{
result.SetErrorInfo("运踪爬虫用户KEY和SECRET参数未正确配置");
}
else {
user_key = pUserKey.PARAMVALUE;
user_secret = pUserSecret.PARAMVALUE;
}
var pServerUrl = commonData.sys_param_set.AsNoTracking().FirstOrDefault(p => p.PARAMNAME == "billTraceNewServerUrl");
if (pServerUrl == null || string.IsNullOrEmpty(pServerUrl.PARAMVALUE))
{
result.SetErrorInfo("运踪爬虫服务地址参数未正确配置");
}
else {
ServerUrl = pServerUrl.PARAMVALUE;
}
var accCfg = MsSysThirdPartyAccountDAL.GetData($" THIRDPARTY='运港通' and USERID ='{USERID}' ");
if (!accCfg.HaveAccount())
{
result.SetErrorInfo("需要为该用户在第三方账号中设置【运港通】的账号密码。");
}
else {
web_user = accCfg.ACCOUNT;
web_psw = accCfg.ACCOUNTPSW;
}
return result;
}
public void SetSearch(string _bno, string _vessel, string _voyage, string _email = "")
{
bno = _bno;
vessel = _vessel;
voyage = _voyage;
email = _email;
}
public DBResult DoSend()
{
DBResult result = new DBResult();
var dic = new Dictionary<string, string>();
dic.Add("user_key", user_key);
dic.Add("user_secret", user_secret);
dic.Add("bno", bno);
dic.Add("web_user", web_user);
dic.Add("web_psw", web_psw);
dic.Add("vessel", vessel);
dic.Add("voyage", voyage);
dic.Add("email", email);
var json = DSWeb.MvcShipping.Helper.JsonConvert.Serialize(dic);
var rtn= WebRequestHelper.DoPost(ServerUrl+apiurl, json, 10000);
result.OK("", rtn);
return result;
}
}
public class _ : Helper
{
//public string apiurl { get; set; } = "/import/v1/ygt/single/vote";
public _() {
apiurl= "/import/v1/ygt/single/vote";
}
}
public class _
{
public int? code { get; set; }
public virtual object data { get; set; }
public string msg { get; set; }
public string request { get; set; }
public string getErrorName() {
if (code == 200) return "成功";
if (code == 1000) return "查询失败, 没有查询到相关信息";
if (code == 1001) return "参数错误,具体原因参照 msg";
if (code == 1002) return "数据提交错误";
if (code == 1003) return "权限错误";
if (code == 999) return "内部未知错误";
return code.ToString();
}
}
public class _data
{
public containerShipScheme { get; set; }
public customsRelease { get; set; }
public List<> originalInfos { get; set; }
public List<> tallyInfos { get; set; }
public List<> tdReleaseInfos { get; set; }
public List<> wharfInfos { get; set; }
}
/// <summary>
/// 进口码头信息
/// </summary>
public class
{
public string wharfName { get; set; } // 码头名称
public string bno { get; set; } // 单号
public string vesselCN { get; set; } // 中文船名
public string vesselEN { get; set; } // 英文船名
public string voyage { get; set; } // 航次
public string boxStationCode { get; set; } // 箱站代码
public string ctnNO { get; set; } // 箱号
public string boxIS { get; set; } // 箱属
public string boxSize { get; set; } // 箱尺寸
public string boxPile { get; set; } // 箱型
public string sealNO { get; set; } // 铅封号
public string grossWeight { get; set; } // 整箱重
public string bareWeight { get; set; } // 空重
public string wharfPermit { get; set; } // 码头放行
public string loadingPort { get; set; } // 装货港
public string currentStatus { get; set; } // 当前状态
public string entryCategory { get; set; } // 入港类别
public string entryTime { get; set; } // 入港时间
public string entryDetails { get; set; } // 入港明细
public string clearanceCategory { get; set; } // 出港类别
public string clearanceTime { get; set; } // 出港时间
public string clearanceDetails { get; set; } // 出港明细
public string stockpilingDays { get; set; } // 堆存天数
public string geographicPosition { get; set; } // 地理位置
public string foreignTrade { get; set; } // 内外贸
public string dischargingPort { get; set; } // 卸货港
public string destinationPort { get; set; } // 目的港
}
/// <summary>
/// 进口原始舱单
/// </summary>
public class
{
public string bno { get; set; } // 提单号
public string fbno { get; set; } // 分提单号
public string vesselCN { get; set; } // 中文船名
public string vesselEN { get; set; } // 英文船名
public string voyage { get; set; } // 航次
public string ctnNO { get; set; } // 箱号
public string bareWeight { get; set; } // 空重
public string boxSize { get; set; } // 箱尺寸
public string boxPile { get; set; } // 箱型
public string sealNO { get; set; } // 铅封号
public string quantity { get; set; } // 件数
public string weight { get; set; } // 重量
public string volume { get; set; } // 体积
}
/// <summary>
/// 外理理货
/// </summary>
public class
{
public string bno { get; set; } // 提单号
public string vesselEN { get; set; } // 英文船名
public string voyage { get; set; } // 航次
public string IMO { get; set; } // IMO
public string customsCode { get; set; } // 关区代码
public string ctnNO { get; set; } // 箱号
public string quantity { get; set; } // 件数
public string weight { get; set; } // 重量
public string volume { get; set; } // 体积
public string sendTime { get; set; } // 发送时间
public string receiptExplain { get; set; } // 回执说明
public string receiptTime { get; set; } // 回执时间
public string deletedMarker { get; set; } // 删除标志
}
/// <summary>
/// 海关放行
/// </summary>
public class
{
public string customsNO { get; set; } // 报关单号
public string fbno { get; set; } // 分单号
public string vesselEN { get; set; } // 英文船名
public string voyage { get; set; } // 航次
public string IMO { get; set; } // IMO
public string customsCode { get; set; } // 关区代码
public string permitTime { get; set; } // 放行时间
public string permitNum { get; set; } // 放行件数
public string ctnNO { get; set; } // 箱号
public string weight { get; set; } // 净重
public string roughWeight { get; set; } // 毛重
public string customsStatus { get; set; } // 海关状态
public string permitType { get; set; } // 放行类别
}
/// <summary>
/// 提单放行
/// </summary>
public class
{
public string bno { get; set; } // 主单号
public string vesselEN { get; set; } // 英文船名
public string voyage { get; set; } // 航次
public string IMO { get; set; } // IMO
public string vesselEnBranch { get; set; } // 支线英文船名
public string voyageBranch { get; set; } // 支线航次
public string customsNO { get; set; } // 报关单号
public string permitTime { get; set; } // 放行时间
public string permitNum { get; set; } // 放行件数
public string ctnNO { get; set; } // 箱号
public string weight { get; set; } // 净重
public string roughWeight { get; set; } // 毛重
public string customsStatus { get; set; } // 海关状态
public string permitType { get; set; } // 放行类别
}
/// <summary>
/// 集装箱船舶计划 字段说明
/// </summary>
public class
{
public string vesselCode { get; set; } //船名代码
public string vesselCN { get; set; } //中文船名
public string vesselEN { get; set; } //英文船名
public string importVoyage { get; set; } //进口航次
public string exportVoyage { get; set; } //出口航次
public string estimatedArrivalTime { get; set; } //预计到港时间
public string estimatedDepartureTime { get; set; } //预计离港时间
public string actualArrivalTime { get; set; } //实际到港时间 ATA
public string actualDepartureTime { get; set; } //实际离港时间
public string receivingStartTime { get; set; } //收箱开始时间
public string receivingEndTime { get; set; } //收箱结束时间
public string airlineCode { get; set; } //航线代码
public string location { get; set; } //位置
public string importAgency { get; set; } //进口代理
public string arrivalStatus { get; set; } //抵港状态
public string carrier { get; set; } //承运人
public string airline { get; set; } //航线
public string berth { get; set; } //泊位
public string foreignTrade { get; set; } //内外贸
public string IMO { get; set; } //IMO
}
public class _ : Helper
{
//public string apiurl { get; set; } = "/import/v1/ygt/box/empty_return";
public _()
{
apiurl = "/import/v1/ygt/box/empty_return";
}
}
public class _data
{
public string bno { get; set; } // 单号
public string ctnNO { get; set; } // 箱号
public string boxSize { get; set; } // 尺寸
public string boxType { get; set; } // 箱型
public string actualRecStation { get; set; } // 还空场站
public string returnCarNo { get; set; } // 还空车号
public string emptyReturnTime { get; set; } // 还空时间
public string stationConfirmFlag { get; set; } // 场站确认标志, '1'为以确认
public string driverConfirmFlag { get; set; } // 司机确认标志, '1'为以确认
}
#endregion
}

@ -8107,11 +8107,11 @@ namespace DSWeb.MvcShipping.Controllers
return Json(resp);
}
var accCfg = MsSysThirdPartyAccountDAL.GetData($" THIRDPARTY='青岛港物流信息网' and USERID ='{userid}') ");
var accCfg = MsSysThirdPartyAccountDAL.GetData($" THIRDPARTY='运港通' and USERID ='{userid}' ");
if (!accCfg.HaveAccount())
{
resp.Success = false;
resp.Message = "需要为该用户在第三方账号中设置【青岛港物流信息网】的账号密码。";
resp.Message = "需要为该用户在第三方账号中设置【运港通】的账号密码。";
return Json(resp);
}

@ -61,6 +61,12 @@ namespace DSWeb.MvcShipping.Controllers
var count = 0;
var canlogin = BasicDataRefDAL.CheckLogin(Session);
if (!canlogin.Success)
{
return (ContentResult)canlogin.Data;
}
var uid = Session["USERID"].ToString();
CommonDataContext cdc = new CommonDataContext();
var _user = cdc.VW_user.AsNoTracking().FirstOrDefault(u => u.USERID == uid);
@ -212,18 +218,15 @@ namespace DSWeb.MvcShipping.Controllers
var seaefield = MsSoftSysTableDAL.GetDefTableDetailList("info_client");
foreach (var enumValue in seaefield)
{
if (enumValue.FIELDNAME == "MBLNO" && headData.MBLNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "客户代码超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "MBLNO" && headData.MBLNO.Length > 25) { isPost = false; errorstr = "提单号超长,字段长度限制" + 25; }
if (enumValue.FIELDNAME == "CUSTNO" && headData.CUSTNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "客户简称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CUSTOMNO" && headData.CUSTOMNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "客户全称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CONTRACTNO" && headData.CONTRACTNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "英文全称超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "SERVICETYPE" && headData.SERVICETYPE.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "地址超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "VESSEL" && headData.VESSEL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "邮件地址超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "VOYNO" && headData.VOYNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "网址超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "FORWARDER" && headData.FORWARDER.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "TEL超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CARRIER" && headData.CARRIER.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "英文地址超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "CUSTOMERNAME" && headData.CUSTOMERNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "负责人超长,字段长度限制" + enumValue.FIELDLEN; }
//if (enumValue.FIELDNAME == "CUSTOMERNAME" && headData.CUSTOMERNAME.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "负责人超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "TEL" && headData.TEL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "电话超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "VESSEL" && headData.VESSEL.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "船名超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "VOYNO" && headData.VOYNO.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "航次超长,字段长度限制" + enumValue.FIELDLEN; }
if (enumValue.FIELDNAME == "REMARK" && headData.REMARK.Length > Convert.ToInt32(enumValue.FIELDLEN)) { isPost = false; errorstr = "备注超长,字段长度限制" + enumValue.FIELDLEN; }
}
@ -270,6 +273,14 @@ namespace DSWeb.MvcShipping.Controllers
// return BasicDataRefDAL.GetContentResult(canchange);
//}
//不改变原值的字段
headData.CangDanShiJian = oldheaddata.CangDanShiJian;
headData.HaiFangShiJian = oldheaddata.HaiFangShiJian;
headData.TiHuo = oldheaddata.TiHuo;
headData.TiHuoInfo = oldheaddata.TiHuoInfo;
headData.FanKong = oldheaddata.FanKong;
headData.FanKongInfo = oldheaddata.FanKongInfo;
BasicDataRefDAL.CopyProperties(headData, oldheaddata);
@ -429,6 +440,56 @@ namespace DSWeb.MvcShipping.Controllers
return result;
}
public ContentResult RefreshYunZong( string BSNOList)
{
var result = new DBResult();
var canlogin = BasicDataRefDAL.CheckLogin(Session);
if (!canlogin.Success)
{
return (ContentResult)canlogin.Data;
}
var count = 0;
var uid = Session["USERID"].ToString();
CommonDataContext cdc = new CommonDataContext();
var _user = cdc.VW_user.AsNoTracking().FirstOrDefault(u => u.USERID == uid);
var BSNOlist = new List<string>();
BSNOlist = BSNOList.Split(',').ToList();
foreach (var BSNO in BSNOlist)
{
result=OP_SERVICEBILLDAL.RefreshYunZong(BSNO, uid);
if (!result.Success) {
break;
}
}
return BasicDataRefDAL.GetContentResult(result);
}
public ContentResult GetCtnList(string condition)
{
var canlogin = BasicDataRefDAL.CheckLogin(Session);
if (!canlogin.Success)
{
return (ContentResult)canlogin.Data;
}
var uid = Session["USERID"].ToString();
CommonDataContext cdc = new CommonDataContext();
var ctnlist = cdc.OP_CTN.AsNoTracking().Where(x => x.BSNO == condition);
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = ctnlist.Count(), data = ctnlist.ToList() });
return new ContentResult() { Content = json };
}
//private ContentResult DoSend_File(OP_SERVICEBILL_md head)
//{

@ -38,6 +38,7 @@ using DSWeb.MvcShipping.Models.MsSysThirdPartyAccount;
using System.Web.Mvc;
using System.Reflection;
using NPOI.SS.Formula.Functions;
using com.sun.org.apache.bcel.@internal.generic;
//using java.lang;
namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL
@ -46,7 +47,7 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL
{
#region 查询
const string HeadSql = " SELECT BSNO,PARENTID,CORPID,SALECORPID,DEPT,SALEDEPT,SALE,BILLSTATUS,BSSTATUS,FEESTATS,MBLNO,CUSTNO,CUSTOMNO,CONTRACTNO,SERVICETYPE,INPUTBY,TEL,ACCDATE,BSDATE,MODIFIEDUSER,MODIFIEDTIME,ETA,ATA,VESSEL,VOYNO,FORWARDER,SHIPAGENCY,CARRIER,CUSTOMERNAME,FEE_1 ,FEE_2,REMARK,SERVICE,DJYID,''OT1,''OT2,''OT3,''OT4 FROM OP_SERVICEBILL where 1=1 ";
const string HeadSql = " SELECT BSNO,PARENTID,CORPID,SALECORPID,DEPT,SALEDEPT,SALE,BILLSTATUS,BSSTATUS,FEESTATS,MBLNO,CUSTNO,CUSTOMNO,CONTRACTNO,SERVICETYPE,INPUTBY,TEL,ACCDATE,BSDATE,MODIFIEDUSER,MODIFIEDTIME,ETA,ATA,VESSEL,VOYNO,FORWARDER,SHIPAGENCY,CARRIER,CUSTOMERNAME,FEE_1 ,FEE_2,REMARK,SERVICE,DJYID,''OT1,''OT2,''OT3,''OT4,CangDanShiJian,HaiFangShiJian,TiHuo,TiHuoInfo,FanKong,FanKongInfo FROM OP_SERVICEBILL where 1=1 ";
public static List<OP_SERVICEBILL_md> GetDataList(int start, int limit, string sort, string condition, VW_user_md userinfo, ref int count)
@ -92,18 +93,6 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL
public static string GetDataListStr( string condition, VW_user_md userinfo)
{
var cdc = new CommonDataContext();
var Condition = new OP_SERVICEBILL_md.SearchParam();
try
{
Condition = JsonConvert.Deserialize<OP_SERVICEBILL_md.SearchParam>(condition);
}
catch
{
}
//range
@ -111,7 +100,7 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL
//condition
var strCondition = "";
var strCondition = condition;
var sortstring = "";
@ -190,7 +179,12 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL
if (reader["DJYID"] != DBNull.Value)
data.DJYID = Convert.ToInt64(reader["DJYID"]);
data.CangDanShiJian = Convert.ToString(reader["CangDanShiJian"]);
data.HaiFangShiJian = Convert.ToString(reader["HaiFangShiJian"]);
data.TiHuo = Convert.ToString(reader["TiHuo"]);
data.TiHuoInfo = Convert.ToString(reader["TiHuoInfo"]);
data.FanKong = Convert.ToString(reader["FanKong"]);
data.FanKongInfo = Convert.ToString(reader["FanKongInfo"]);
#endregion
@ -722,6 +716,211 @@ namespace DSWeb.MvcShipping.DAL.OP_SERVICEBILLDAL
result.SetErrorInfo($"系统配置文件中没有配置【{itemname}】项目");
}
}
public static DBResult RefreshYunZong(string BSNO, string USERID)
{
var result = new DBResult();
/*
ATA: - containerShipScheme actualArrivalTime
-originalInfos
originalInfos (bno)
-customsRelease permitTime | String |
wharfInfos()
wharfInfos
| clearanceCategory | String | | = "T"
| clearanceTime | String | |
emptyReturnTime | str |
*/
//1 调用 云港通实时接口 进口单票查询
_ hp = new _();
result = hp.GetUrl(USERID);
if (!result.Success) {
return result;
}
var cdc = new CommonDataContext();
var head = cdc.OP_SERVICEBILL.FirstOrDefault(x => x.BSNO == BSNO);
if (head == null) {
result.SetErrorInfo("没有找到业务");
return result;
}
hp.SetSearch(head.MBLNO,head.VESSEL,head.VOYNO,"");
result = hp.DoSend();
//2 处理返回的结果
if (!result.Success) return result;
var Head = JsonConvert.Deserialize<_>(result.Data.ToString());
if (Head.code != 200) {
result.SetErrorInfo(Head.getErrorName()+":"+ Head.msg);
return result;
}
var = JsonConvert.Deserialize < _data>(Head.data.ToString());
//1.1 ATA
var ATAStr = .containerShipScheme.actualArrivalTime;
if(!string.IsNullOrWhiteSpace(ATAStr))
head.ATA = Convert.ToDateTime(ATAStr);
//cdc.OP_SERVICEBILL.AddOrUpdate(head);
//1.2 舱单
if (.originalInfos != null && .originalInfos.Count > 0) {
if (!string.IsNullOrWhiteSpace(.originalInfos[0].bno))
{
head.CangDanShiJian = "已有舱单";
}
else {
head.CangDanShiJian = "";
}
}
//1.3 海关放行
if (.customsRelease!=null && !string.IsNullOrWhiteSpace( .customsRelease.permitTime))
{
head.HaiFangShiJian = .customsRelease.permitTime;
}
//1.4 提货
if (.wharfInfos != null && .wharfInfos.Count>0)
{
head.TiHuo = "";
if (.wharfInfos.Exists(x => x.clearanceCategory == "T")) {
if (.wharfInfos.Exists(x => x.clearanceCategory != "T"))
{
head.TiHuo = "部分提货";
}
else {
head.TiHuo = "已提货";
}
var currctnList = cdc.OP_CTN.Where(x => x.BSNO == head.BSNO).ToList();
foreach (var item in .wharfInfos)
{
//if (currctnList.Exists(x=>x.CNTRNO== item.ctnNO))
if (currctnList.Exists(x => x.CNTRNO == item.ctnNO))
{
var currctn = currctnList.First(x=>x.CNTRNO == item.ctnNO);
if (item.clearanceCategory == "T")
{
currctn.TiHuoShiJian = item.clearanceTime;
cdc.OP_CTN.AddOrUpdate(currctn);
}
}
else
{
var newrec = new op_ctn_md(head.BSNO);
newrec.CNTRNO = item.ctnNO;
if (item.clearanceCategory == "T")
{
newrec.CNTRNO = item.ctnNO;
newrec.TiHuoShiJian = item.clearanceTime;
cdc.OP_CTN.Add(newrec);
}
else
{
}
}
}
}
}
cdc.SaveChanges();
//3 调用 集装箱进口空箱返场查询
var hp = new _();
result = hp.GetUrl(USERID);
if (!result.Success)
{
return result;
}
hp.SetSearch(head.MBLNO, "", "", "");
result = hp.DoSend();
//4 处理返回结果
if (!result.Success) return result;
var Head = JsonConvert.Deserialize<_>(result.Data.ToString());
if (Head.code != 200)
{
result.SetErrorInfo(Head.getErrorName() + ":" + Head.msg);
return result;
}
var = JsonConvert.Deserialize<List<_data>>(Head.data.ToString());
if ( != null && .Count > 0)
{
head.FanKong = "";
var currctnList = cdc.OP_CTN.Where(x => x.BSNO == head.BSNO).ToList();
foreach (var item in )
{
if (currctnList.Exists(x => x.CNTRNO == item.ctnNO))
{
var updrec = currctnList.First(x => x.CNTRNO == item.ctnNO);
updrec.FanKongShiJian = item.emptyReturnTime;
cdc.OP_CTN.AddOrUpdate(updrec);
}
else {
var newrec = new op_ctn_md(head.BSNO);
newrec.CNTRNO = item.ctnNO;
newrec.FanKongShiJian = item.emptyReturnTime;
cdc.OP_CTN.Add(newrec);
}
}
}
cdc.SaveChanges();
head.FanKong = "";
var currctnList3 = cdc.OP_CTN.Where(x => x.BSNO == head.BSNO).ToList();
if (currctnList3.Exists(x => !string.IsNullOrWhiteSpace(x.FanKongShiJian)))
{
if (currctnList3.Exists(x => string.IsNullOrWhiteSpace(x.FanKongShiJian)))
{
head.FanKong = "部分返空";
}
else {
head.FanKong = "已返空";
}
}
cdc.OP_SERVICEBILL.AddOrUpdate(head);
cdc.SaveChanges();
result.OK("查询成功");
return result;
}
}
public class SERVICEBILL_RTN {

@ -142,11 +142,12 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCARRIER' }
});
this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船公司',
fieldLabel: "<a><font color='#FF0000'>*</font></a>" + '船公司',
store: this.storeCARRIER,
//queryMode: 'remote',
//minChars: 1,
//queryParam: 'CODENAME',
allowBlank:false,
name: 'CARRIER',
valueField: 'CustName',
displayField: 'CodeAndName',
@ -247,8 +248,9 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' }
});
this.comboxCompany = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '所属分部',
fieldLabel: "<a><font color='#FF0000'>*</font></a>"+'所属分部',
store: this.storeCompany,
allowBlank:false,
flex:1,
name: 'CORPID',
valueField: 'gid',
@ -279,9 +281,10 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
});
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操作',
fieldLabel: "<a><font color='#FF0000'>*</font></a>" + '操作',
//renderTo: 'basicBoxselect',
//autoHeight:true,
allowBlank: false,
name: 'INPUTBY',
autosize: true,
bodyPadding: 1,
@ -499,6 +502,24 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
}, {
fieldLabel: 'DJYID',
name: 'DJYID'
}, {
fieldLabel: 'CangDanShiJian',
name: 'CangDanShiJian'
}, {
fieldLabel: 'HaiFangShiJian',
name: 'HaiFangShiJian'
}, {
fieldLabel: 'TiHuo',
name: 'TiHuo'
}, {
fieldLabel: 'TiHuoInfo',
name: 'TiHuoInfo'
}, {
fieldLabel: 'FanKong',
name: 'FanKong'
}, {
fieldLabel: 'FanKongInfo',
name: 'FanKongInfo'
}
]
}
@ -526,8 +547,8 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
defaultType: 'textfield',
items: [
{
fieldLabel: Zi.LAN.TEL,
allowBlank: true,
fieldLabel: "<a><font color='#FF0000'>*</font></a>" +Zi.LAN.TEL,
allowBlank: false,
name: 'TEL'
}
]
@ -538,8 +559,8 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
defaultType: 'textfield',
items: [
{
fieldLabel: Zi.LAN.MBLNO,
allowBlank: true,
fieldLabel: "<a><font color='#FF0000'>*</font></a>" +Zi.LAN.MBLNO,
allowBlank: false,
name: 'MBLNO'
}
, this.comboxCARRIER
@ -585,7 +606,10 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
, {
id: 'ServiceGroup',
xtype: 'checkboxgroup',
fieldLabel: Zi.LAN.SERVICEBILLService, //'费用项目',
fieldLabel: "<a><font color='#FF0000'>*</font></a>" + Zi.LAN.SERVICEBILLService, //'费用项目',
allowBlank:false,
columns: 4,
name: 'SERVICE',
items: []
@ -786,7 +810,7 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
scope: this
},
{
id: 'btnESaveAndClose',
id: 'btnESaveAndClose',hidden:true,
text: "下单并关闭",
handler: function (button, event) {
this.Save('1');
@ -1156,8 +1180,15 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
this.Editdata = result.data;
//this.LoadInit(data);
if (this.Editdata.ETA)
//去除eta字段中的时分秒
if (this.Editdata.ETA) {
this.Editdata.ETA = this.Editdata.ETA.replace(" 00:00:00", "");
}
if (opstatus == 'add') {
this.Editdata.SERVICETYPE = "码头堆存缴费";
}
this.formHead.getForm().reset();
this.formHead.getForm().setValues(this.Editdata);
@ -1403,7 +1434,7 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
LoadDefValue: function () {
this.storeDefValue.load({
params: { condition: "BSTYPE='内贸海运管理'" },
params: { condition: "BSTYPE='委托结算管理'" },
callback: function (r, options, success) {
if (success) {
if (this.storeDefValue.getCount() > 0) {
@ -1470,7 +1501,7 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
if (enable) {
btnESave.enable();
btnESaveAndClose.enable();
//btnESaveAndClose.enable();
//btndeletedetail.enable();
} else {
btnESave.disable();
@ -1499,7 +1530,7 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
Ext.getCmp('btnESave').show();
Ext.getCmp('btnESaveAndClose').show();
//Ext.getCmp('btnESaveAndClose').show();
Ext.getCmp('btnESave2').hide();
Ext.getCmp('btnESaveAndClose2').hide();
@ -1529,7 +1560,7 @@ Ext.extend(Shipping.OP_SERVICEBILLEdit, Ext.Panel, {
Ext.getCmp('REMARK2').show();
Ext.getCmp('btnESave').hide();
Ext.getCmp('btnESaveAndClose').hide();
//Ext.getCmp('btnESaveAndClose').hide();
Ext.getCmp('btnESave2').show();
Ext.getCmp('btnESaveAndClose2').show();

@ -184,6 +184,63 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, {
dataIndex: 'FEE_1',
header: Zi.LAN.FEETITLE,
width: 80
}, {
dataIndex: 'CangDanShiJian',
header: '舱单',
align: 'center',
width: 35,
renderer: function (value, meta, record) {
if (value != "") {
return "<div title=\"" + value + "\"><img src=\"/images/yuan.png\" height=\"12\" width=\"12\" /></div>"
} else {
return "<b style=\"color:#FF0000\">---</b>";
}
}
}, {
dataIndex: 'HaiFangShiJian',
header: '海放',
align: 'center',
width: 35,
renderer: function (value, meta, record) {
if (value != "") {
return "<div title=\"" + value + "\"><img src=\"/images/yuan.png\" height=\"12\" width=\"12\" /></div>"
} else {
return "<b style=\"color:#FF0000\">---</b>";
}
}
}, {
dataIndex: 'TiHuo',
header: '提货',
align: 'center',
width: 35,
renderer: function (value, meta, record) {
if (value == "已提货") {
return "<div title=\"" + value + "\"><img src=\"/images/yuan.png\" height=\"12\" width=\"12\" /></div>"
} else if (value == "部分提货") {
return "<div title=\"" + value + "\"><img src=\"/images/yuan2.png\" height=\"12\" width=\"12\" /></div>"
} else {
return "<b style=\"color:#FF0000\">---</b>";
}
}
}, {
dataIndex: 'FanKong',
header: '返空',
align: 'center',
width: 35,
renderer: function (value, meta, record) {
if (value == "已返空") {
return "<div title=\"" + value + "\"><img src=\"/images/yuan.png\" height=\"12\" width=\"12\" /></div>"
} else if (value == "部分返空") {
return "<div title=\"" + value + "\"><img src=\"/images/yuan2.png\" height=\"12\" width=\"12\" /></div>"
} else {
return "<b style=\"color:#FF0000\">---</b>";
}
}
},
{
sortable: true,
@ -288,13 +345,7 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, {
}
}
//, {
// header: "操作", dataIndex: 'Gender',
// renderer: function (value, cellmeta) {
// var returnStr = "<INPUT style='width:100%' type='button' value='打印'>";
// return returnStr;
// }
//}
];
@ -463,6 +514,13 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, {
}
});
}
if (FieldName == "TiHuo") {
_this.ShowCtnInfo(rec.data.BSNO);
}
if (FieldName == "FanKong") {
_this.ShowCtnInfo(rec.data.BSNO);
}
});
//#endregion
@ -736,7 +794,7 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, {
}
}
}, {
fieldLabel: '到..下单时间',
fieldLabel: '到',
format: 'Y-m-d',
xtype: 'datefield',
name: 'BSDATE_END',
@ -761,7 +819,7 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, {
}
}
}, {
fieldLabel: '到..ETA',
fieldLabel: '到',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETA_END',
@ -807,15 +865,6 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, {
region: "north",
tbar: [
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
saveQuerySetting(this.formname, this.formSearch, true, true);
},
scope: this
}, '-', {
text: "新建", id: "btnadd",
iconCls: "btnadd",
handler: function (button, event) {
@ -877,8 +926,32 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, {
DsTruck.SaveGridPanel(USERID, formname, tempcolumns, this.column, 0, false);
},
scope: this
}, '-', {
text: "刷新运踪",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshYunZong(button, event);
},
scope: this
}, '-',
{
text: "重置条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onResetClick(button, event);
},
scope: this
}, {
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
saveQuerySetting(this.formname, this.formSearch, true, true);
},
scope: this
}
//,this.CB_EditMode
]
});
@ -1059,6 +1132,71 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, {
});
},
onRefreshYunZong: function () {
//刷新运踪
//对选中的单号执行调用接口查询
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 GidSql = '';
for (var i = 0; i < selections.length; i++) {
var record = selections[i];
var GId = "" + record.get('BSNO') + "";
if (GidSql == '') {
GidSql = GId;
} else {
GidSql = GidSql + "," + GId;
}
};
Ext.Msg.wait('正在查询数据...');
Ext.Ajax.request({
waitMsg: '正在查询数据...',
url: '/MvcShipping/OP_SERVICEBILL/RefreshYunZong',
params: {
BSNOList: GidSql
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.onRefreshClick();
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
this.onRefreshClick();
},
scope: this
}); //end Ext.Ajax.request
var feeGidSql = '';
for (var i = 0; i < selections.length; i++) {
var record = selections[i];
var feeGId = "'" + record.get('BSNO') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
},
onResetClick: function (button, event) {
this.formSearch.getForm().reset();
},
onRefreshClick: function (button, event) {
this.PageSize = this.Pagenum.getValue();
@ -1396,6 +1534,48 @@ Ext.extend(Shipping.OP_SERVICEBILLIndex, Ext.Panel, {
}
}
});
}
, ShowCtnInfo: function (BSNO) {
title = "";
model = Ext.define('OP_CTN_md', {
extend: 'Ext.data.Model',
idProperty: 'CNTRNO',
fields: [
{ name: 'CNTRNO', type: 'string' },
{ name: 'TiHuoShiJian', type: 'string' },
{ name: 'FanKongShiJian', type: 'string' }
]
});
proxyUrl = '/MvcShipping/OP_SERVICEBILL/GetCtnList';
condition = BSNO;
columns = [
{
sortable: true,
dataIndex: 'CNTRNO',
header: '箱号',
width: 120
}, {
sortable: true,
dataIndex: 'TiHuoShiJian',
header: '提货',
width: 120
}, {
sortable: true,
dataIndex: 'FanKongShiJian',
header: '返空',
width: 120
}
];
ShowPublicINFO(title, model, proxyUrl, condition, columns, 380);
},
});

@ -37,7 +37,15 @@
{ name: 'OT1', type: 'string' },
{ name: 'OT2', type: 'string' },
{ name: 'OT3', type: 'string' },
{ name: 'OT4', type: 'string' }
{ name: 'OT4', type: 'string' },
{ name: 'CangDanShiJian', type: 'string' },
{ name: 'HaiFangShiJian', type: 'string' },
{ name: 'TiHuo', type: 'string' },
{ name: 'TiHuoInfo', type: 'string' },
{ name: 'FanKong', type: 'string' },
{ name: 'FanKongInfo', type: 'string' }
]
});

@ -5370,6 +5370,8 @@
<Content Include="images\userpic\noImage.gif" />
<Content Include="images\wait.gif" />
<Content Include="images\weixin.png" />
<Content Include="images\yuan.png" />
<Content Include="images\yuan2.png" />
<Content Include="Invoice\CommonInvoiceApplication.aspx" />
<Content Include="Invoice\ImportFee.aspx" />
<Content Include="Invoice\InvoiceApplicationGridSource.aspx" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

@ -64,6 +64,9 @@
<Reference Include="Quartz, Version=2.6.2.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<HintPath>..\packages\Quartz.2.6.2\lib\net40\Quartz.dll</HintPath>
</Reference>
<Reference Include="RabbitMQ.Client, Version=3.6.9.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ce, processorArchitecture=MSIL">
<HintPath>..\packages\RabbitMQ.Client.3.6.9\lib\net45\RabbitMQ.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Entity" />

@ -13,6 +13,8 @@ using System.Text;
using HcUtility.Core;
using HcUtility.Comm;
using System.Data.Entity;
using RabbitMQ.Client;
namespace JobPingTaiWork
{
@ -152,6 +154,10 @@ namespace JobPingTaiWork
reqUrl = context.JobDetail.JobDataMap.GetString("ReqUrl");
reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout"));
var mqConnStr = context.JobDetail.JobDataMap.GetString("RabbitConnectString");
log.Debug($"连接字符串:{connStr}");
log.Debug($"请求URL{reqUrl}");
log.Debug($"请求超时:{reqTimeout}");
@ -199,15 +205,17 @@ namespace JobPingTaiWork
try
{
//log.Debug($"请求数据:{reqObj}");
//rtn = WebRequestHelper.DoPost(reqUrl, reqObj.ToString(Newtonsoft.Json.Formatting.None), reqTimeout * 1000);
//log.Debug($"返回数据:{rtn}");
log.Debug($"请求数据:{reqObj}");
rtn = WebRequestHelper.DoPost(reqUrl, reqObj.ToString(Newtonsoft.Json.Formatting.None), reqTimeout * 1000);
log.Debug($"返回数据:{rtn}");
//rtn = @"{""code"": 200, ""data"": [{""ChuKouBaoGuan"": """", ""FangXingShiJian"": """", ""FangXingZhuangTai"": ""未放行"", ""HuoWuZhuangTai"": ""进、出口货物"", ""ISFenDan"": false, ""JianShu"": ""212"", ""MBLNO"": ""HDMUTAOZ27376200"", ""ShenBaoXiangShu"": ""1"", ""YARDNAME"": ""HLW_CD"", ""YuPeiJieGuo"": ""接受申报"", ""YuPeiShiJian"": ""2023/5/10 13:29:46"", ""YunDiJieGuo"": ""未申报"", ""YunDiShiJian"": """", ""ZhongLiang"": ""17530.20"", ""ZhuangZaiJieGuo"": ""未申报"", ""ZhuangZaiShiJian"": """", ""ZuDanInfo"": ""HDMUTAOZ27376200"", ""vessel"": ""YM TRAVEL"", ""voyage"": ""009E""}], ""msg"": ""ok"", ""request"": ""POST /v1/real/query""}";
try
{
var needPushStatus = false;
var PortResult = Newtonsoft.Json.JsonConvert.DeserializeObject<RepWLXXModel>(rtn);
//测试数据
@ -273,12 +281,49 @@ namespace JobPingTaiWork
EdiStatusDAL.Insert(newStatusRecord);
needPushStatus = true;
}
}
DelMinMblno(connStr);
}
if (needPushStatus)
{
//回推舱单状态
try
{
if (string.IsNullOrEmpty(mqConnStr))
{
log.Warn($"未配置舱单回推消息队列,不会回推状态:{MFNO}");
}
else
{
log.Debug($"准备推送舱单状态回推到消息队列:{string.Join(",", MFNO)}");
//推送消息
ConnectionFactory factory = new ConnectionFactory();
factory.Uri = mqConnStr;
var mqConn = factory.CreateConnection("JobPingTaiWork");
var exchangeName = "myshiping.feedback.status.cangdan";
IModel model = mqConn.CreateModel();
model.ExchangeDeclare(exchange: exchangeName, type: ExchangeType.Fanout);
model.BasicPublish(exchange: exchangeName,
routingKey: "",
basicProperties: null,
body: Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(new { MfnoList = new string[] { MFNO } })));
mqConn.Close();
log.Debug($"推送舱单状态回推消息完成");
}
}
catch (Exception ex)
{
log.Error($"推送舱单状态回推消息失败:{ex.Message}");
log.Error(ex.StackTrace);
}
}
}
else {
if (PortResult.msg.Contains("单号信息不存在"))
@ -659,6 +704,8 @@ where s.group_idx = 1*/
reqUrl = context.JobDetail.JobDataMap.GetString("ReqUrl");
reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout"));
var mqConnStr = context.JobDetail.JobDataMap.GetString("RabbitConnectString");
log.Debug($"连接字符串:{connStr}");
log.Debug($"请求URL{reqUrl}");
log.Debug($"请求超时:{reqTimeout}");
@ -710,6 +757,8 @@ where s.group_idx = 1*/
log.Debug($"返回数据:{rtn}");
try
{
var needPushStatus = false;
var PortResult = Newtonsoft.Json.JsonConvert.DeserializeObject<RepWLXXModel>(rtn);
if (PortResult.code == 200)
@ -745,11 +794,48 @@ where s.group_idx = 1*/
{
EdiStatusDAL_D6.Update(portstatus, localrecord.GetValue("编号"), ISMAIN);
}
needPushStatus = true;
}
DelMinMblno(connStr);
if (needPushStatus)
{
//回推舱单状态
try
{
if (string.IsNullOrEmpty(mqConnStr))
{
log.Warn($"未配置舱单回推消息队列,不会回推状态:{MFNO}");
}
else
{
log.Debug($"准备推送舱单状态回推到消息队列:{string.Join(",", MFNO)}");
//推送消息
ConnectionFactory factory = new ConnectionFactory();
factory.Uri = mqConnStr;
var mqConn = factory.CreateConnection("JobPingTaiWork");
var exchangeName = "myshiping.feedback.status.cangdan";
IModel model = mqConn.CreateModel();
model.ExchangeDeclare(exchange: exchangeName, type: ExchangeType.Fanout);
model.BasicPublish(exchange: exchangeName,
routingKey: "",
basicProperties: null,
body: Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(new { MfnoList = new string[] { MFNO } })));
mqConn.Close();
log.Debug($"推送舱单状态回推消息完成");
}
}
catch (Exception ex)
{
log.Error($"推送舱单状态回推消息失败:{ex.Message}");
log.Error(ex.StackTrace);
}
}
}
else
{

@ -61,6 +61,7 @@
</job-data-map>
</job>
<!--
<trigger>
<cron>
<name>TriggerJobWLXXSave</name>
@ -71,6 +72,7 @@
<cron-expression>26 02 0/1 * * ? *</cron-expression>
</cron>
</trigger>
-->
<job>
<name>JobWLXXGet</name>
@ -87,6 +89,12 @@
<value>Data Source=djypaas.myshipping.net,5099;Initial Catalog=DsPingTai;Persist Security Info=True;User ID=sa;Password=QDdjy#2020*</value>
</entry>
<!--MQ连接串-->
<entry>
<key>RabbitConnectString</key>
<value>amqp://myshipping:myshipping2024@172.31.85.159:13866/myshipping.feedback</value>
</entry>
<!--请求url-->
<entry>
<key>ReqUrl</key>
@ -103,6 +111,7 @@
</job-data-map>
</job>
<!---->
<trigger>
<cron>
<name>TriggerJobWLXXGet</name>

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net45" />
<package id="RabbitMQ.Client" version="3.6.9" targetFramework="net45" />
</packages>

@ -61,6 +61,7 @@
</job-data-map>
</job>
<!--
<trigger>
<cron>
<name>TriggerJobWLXXSave</name>
@ -71,6 +72,7 @@
<cron-expression>26 02 0/1 * * ? *</cron-expression>
</cron>
</trigger>
-->
<job>
<name>JobWLXXGet</name>
@ -87,6 +89,12 @@
<value>Data Source=djypaas.myshipping.net,5099;Initial Catalog=DsPingTai;Persist Security Info=True;User ID=sa;Password=QDdjy#2020*</value>
</entry>
<!--MQ连接串-->
<entry>
<key>RabbitConnectString</key>
<value>amqp://myshipping:myshipping2024@172.31.85.159:13866/myshipping.feedback</value>
</entry>
<!--请求url-->
<entry>
<key>ReqUrl</key>
@ -103,6 +111,7 @@
</job-data-map>
</job>
<!---->
<trigger>
<cron>
<name>TriggerJobWLXXGet</name>

Loading…
Cancel
Save