关贸云导入修改

DS7_JingHan
ddlucky 2 years ago
parent fb480e9a05
commit 333cc0df79

@ -687,24 +687,6 @@ namespace DSWeb.Common.DB
public string INVLINKGID { get; set; } public string INVLINKGID { get; set; }
/// <summary>
/// 当这条业务没有进入任何下游业务时
/// </summary>
/// <returns></returns>
public bool chfeeCanChange()
{
if (
SETTLEMENT == 0 &&
ORDERAMOUNT == 0 &&
ORDERINVOICE == 0 &&
ORDERINVSETTLEMENT == 0 &&
ORDERSETTLEMENT == 0 &&
INVOICE == 0 &&
!(ISDEBIT == null ? false : (bool)ISDEBIT)
) return true;
return false;
}
} }
public partial class ch_fee_md public partial class ch_fee_md
@ -850,24 +832,32 @@ namespace DSWeb.Common.DB
} }
public bool CanChange()
{
if (
SETTLEMENT == 0 &&
ORDERAMOUNT == 0 && ///// <summary>
ORDERINVOICE == 0 && ///// 当这条业务没有进入任何下游业务时
ORDERINVSETTLEMENT == 0 && ///// </summary>
ORDERSETTLEMENT == 0 && ///// <returns></returns>
INVOICE == 0 && //public bool chfeeCanChange()
!(ISDEBIT == null ? false : (bool)ISDEBIT) //{
) return true; // if (
// SETTLEMENT == 0 &&
return false; // ORDERAMOUNT == 0 &&
} // ORDERINVOICE == 0 &&
// ORDERINVSETTLEMENT == 0 &&
// ORDERSETTLEMENT == 0 &&
// INVOICE == 0 &&
// !(ISDEBIT == null ? false : (bool)ISDEBIT)
// ) return true;
// return false;
//}
} }
[Table("v_fee_do_settlement")] [Table("v_fee_do_settlement")]
public partial class v_fee_do_settlement_md public partial class v_fee_do_settlement_md
{ {

@ -740,7 +740,7 @@ namespace DSWeb.Service.Output.DS7
foreach (var ctn in _edi.ctnlist) { foreach (var ctn in _edi.ctnlist) {
var newctn = new op_seae_edi_ctn_md var newctn = new op_seae_edi_ctn_md
{ {
ctn_id = ctn.ctn_id, ctn_id = Guid.NewGuid().ToString(),//ctn.ctn_id,
MFNO = _edi.MFNO, MFNO = _edi.MFNO,
CTNCODE = ctn.CTNCODE, CTNCODE = ctn.CTNCODE,
CNTRNO= ctn.CNTRNO, CNTRNO= ctn.CNTRNO,
@ -882,7 +882,7 @@ namespace DSWeb.Service.Output.DS7
feeFu.ISADVANCEDPAY = false; feeFu.ISADVANCEDPAY = false;
feeFu.ISINVOICE = false; feeFu.ISINVOICE = false;
feeFu.ISCRMORDERFEE = false; feeFu.ISCRMORDERFEE = false;
feeFu.TAXUNITPRICE = 0; feeFu.TAXUNITPRICE = FeePayPrice;
feeFu.NOTAXAMOUNT = 0; feeFu.NOTAXAMOUNT = 0;
//2021-12-9要求下列字段不能为空填写0或false //2021-12-9要求下列字段不能为空填写0或false
@ -938,7 +938,7 @@ namespace DSWeb.Service.Output.DS7
feeFuDJY.ISADVANCEDPAY = false; feeFuDJY.ISADVANCEDPAY = false;
feeFuDJY.ISINVOICE = false; feeFuDJY.ISINVOICE = false;
feeFuDJY.ISCRMORDERFEE = false; feeFuDJY.ISCRMORDERFEE = false;
feeFuDJY.TAXUNITPRICE = 0; feeFuDJY.TAXUNITPRICE = FeePayMyshippingPrice;
feeFuDJY.NOTAXAMOUNT = 0; feeFuDJY.NOTAXAMOUNT = 0;
//2021-12-9要求下列字段不能为空填写0或false //2021-12-9要求下列字段不能为空填写0或false

@ -29,7 +29,7 @@ namespace DSWeb.Areas.CommMng.Controllers
var sr = new StreamReader(Request.InputStream, Encoding.UTF8); var sr = new StreamReader(Request.InputStream, Encoding.UTF8);
var strJson = sr.ReadToEnd(); var strJson = sr.ReadToEnd();
BasicDataRefDAL.SaveLog(strJson, "", "关贸云_报关业务", "");
//var usercode = CookieConfig.GetCookie_UserCode(Request); //var usercode = CookieConfig.GetCookie_UserCode(Request);
@ -41,11 +41,12 @@ namespace DSWeb.Areas.CommMng.Controllers
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
} }
catch (Exception) catch (Exception e)
{ {
var jsonRespose = new JsonResponse { Success = false, Message = "" }; var jsonRespose = new JsonResponse { Success = false, Message = "" };
jsonRespose.Success = false; jsonRespose.Success = false;
jsonRespose.Message = "上传出错"; jsonRespose.Message = "上传出错"+ e.Message + "//" + e.InnerException.Message;
BasicDataRefDAL.SaveLog(e.Message+"//"+e.InnerException.Message, "", "关贸云_报关业务", "报错");
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
} }
} }
@ -58,7 +59,7 @@ namespace DSWeb.Areas.CommMng.Controllers
var sr = new StreamReader(Request.InputStream, Encoding.UTF8); var sr = new StreamReader(Request.InputStream, Encoding.UTF8);
var strJson = sr.ReadToEnd(); var strJson = sr.ReadToEnd();
BasicDataRefDAL.SaveLog(strJson, "", "关贸云_报关业务费用", "");
//var usercode = CookieConfig.GetCookie_UserCode(Request); //var usercode = CookieConfig.GetCookie_UserCode(Request);
@ -74,7 +75,8 @@ namespace DSWeb.Areas.CommMng.Controllers
{ {
var jsonRespose = new JsonResponse { Success = false, Message = "" }; var jsonRespose = new JsonResponse { Success = false, Message = "" };
jsonRespose.Success = false; jsonRespose.Success = false;
jsonRespose.Message = "上传出错:["+e.Message+"]"; jsonRespose.Message = "上传出错:["+e.Message+"]" + e.InnerException.Message;
BasicDataRefDAL.SaveLog(e.Message + "//" + e.InnerException.Message, "", "关贸云_报关业务费用", "报错");
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
} }
} }

@ -210,11 +210,18 @@ namespace DSWeb.Areas.CommMng.DAL
//20230103 导入费用时先删除所有能删的费用 //20230103 导入费用时先删除所有能删的费用
var = cdc.ch_fee.Where(x => x.BSNO == BSNO && x.chfeeCanChange()).ToList(); var = cdc.ch_fee.Where(x => x.BSNO == BSNO ).ToList();
if( != null && .Count > 0) {
var delgids = .Select(s => s.GID).ToArray(); var delgidListstr = "";
var delgidstr = "'" + string.Join("','", delgids) + "'"; foreach (var item2 in ) {
BasicDataRefDAL.ExecSql($"delete from ch_fee where gid in({delgidstr})"); if( MsChFeeDAL.ChFeeCanChange(item2)) {
var delgidstr = "'" + item2.GID + "'";
if (delgidListstr != "") delgidListstr += ",";
delgidListstr += delgidstr;
}
}
if (delgidListstr != "") {
delgidListstr += BasicDataRefDAL.ExecSql($"delete from ch_fee where gid in({delgidListstr})");
} }
var customername= cdc.code_cust_edi.FirstOrDefault(x => x.EDINAME == "关贸云" && x.EDICODE == item.COAGENT_ID); var customername= cdc.code_cust_edi.FirstOrDefault(x => x.EDINAME == "关贸云" && x.EDICODE == item.COAGENT_ID);

@ -31,6 +31,9 @@ using DSWeb.Areas.MvcShipping.DAL;
using DSWeb.Common.DB; using DSWeb.Common.DB;
using System.Linq; using System.Linq;
using DSWeb.MvcShipping.DAL.MsCodeGoodInv; using DSWeb.MvcShipping.DAL.MsCodeGoodInv;
using DSWeb.Areas.CommMng.Models;
using DSWeb.Settlements;
using FeeTypeRefModel = DSWeb.MvcShipping.Models.MsChFee.FeeTypeRefModel;
namespace DSWeb.MvcShipping.DAL.MsChFeeDAL namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
{ {
@ -6926,6 +6929,22 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
} }
public static bool ChFeeCanChange(ch_fee_md chfee) {
if (
chfee.SETTLEMENT == 0 &&
chfee.ORDERAMOUNT == 0 &&
chfee.ORDERINVOICE == 0 &&
chfee.ORDERINVSETTLEMENT == 0 &&
chfee.ORDERSETTLEMENT == 0 &&
chfee.INVOICE == 0 &&
!(chfee.ISDEBIT == null ? false : (bool)chfee.ISDEBIT)
) return true;
return false;
}
} }

Loading…
Cancel
Save