20230307放单部分修改完成。暂无未修改完成的问题

临时发布20240103
ddlucky 2 years ago
parent bd79b644b3
commit 7ad75aa437

@ -1251,6 +1251,11 @@ namespace DSWeb.MvcShipping.Controllers
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose0) };
}
//20230303 如果是财务扣单的话 也不允许添加
var cwkd = MsOp_BLISSUEDAL.ISKDWithCW(dataList);
if (cwkd.Success) {
return BasicDataRefDAL.GetContentResult(cwkd);
}
var DoDataList = new List<MsOp_BLISSUEList_Detailmb>();
var DoDataListDel = new List<MsOp_BLISSUEList_Detailmb>();

@ -3628,29 +3628,21 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
var _recount = 0;
var headList = GetDataList(" B.BSNO in (" + BSNO + ") ",0,999,out _recount);
//0 如果所有BSNO对应的特殊放单申请都已被审核通过 则直接返回true
var cdc = new CommonDataContext();
var bsnoList = BSNO.Replace("'", "").Split(',').ToList();
var List = cdc.v_op_blissuelist_Detail.Where(x => bsnoList.Contains(x.bsno));
var = true;
foreach (var bsno in bsnoList) {
var = List.Where(x => x.bsno == bsno && x.BLSTATUS == "审核通过").ToList();
var = List.Where(x => x.bsno == bsno && x.BLSTATUS != "审核通过").ToList();
if ( != null && .Count > 0 && ( == null || .Count == 0))
{
if (headList.Count == 0) {
result.SetErrorInfo("没有可以放单或放货的业务");
return result;
}
}
else {
= false;
break;
}
//0 如果所有BSNO对应的特殊放单申请都已被审核通过 则直接返回true
result = (BSNO);
if (result.Success) return result;
//如果有财务扣单的 直接报错返回
result = ISKDWithCW(BSNO);
if (result.Success) {
result.Success = false;
return result;
}
if () {
result.OK();
return result;
}
//1 如果是“最后一单” 即:除了这票业务之外,其他业务都已“提单签出”
//则 只要客户有欠费 即不允许提单签出
@ -3737,41 +3729,48 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
var result = new DBResult();
result.OK();
//判断标准 该客户的全部其他业务 是否存在 BLISSUESTATUS<>'提单签出'且<>'已放货' 且其下属明细中有箱号长度11位的箱号 的
var recordcount = 0;
var bsnostr ="'"+ string.Join("','", headList.Select(s => s.BSNO))+ "'";
var List = GetDataList($" b.CUSTOMERNAME='{headList[0].CUSTOMERNAME}' and b.BLISSUESTATUS<>'提单签出' and b.BLISSUESTATUS<>'已放货' and exists(select 1 from op_ctn where BSNO=b.BSNO and len(CNTRNO)=11) and b.BSNO not in({bsnostr})", 0, 9, out recordcount);
if (recordcount > 0)
try
{
//result.OK("", false);
//判断这个或者这些业务当中 是否有其下属明细中有箱号长度11位的箱号 的 且 ETD=【该客户所有业务中其下属明细中有箱号长度11位的箱号的ETD最晚的】
//如果有 也认为符合该条件的业务为【最后一票业务】
var 11ETD = GetDataList($" b.CUSTOMERNAME='{headList[0].CUSTOMERNAME}' and b.BLISSUESTATUS<>'提单签出' and b.BLISSUESTATUS<>'已放货' and exists(select 1 from op_ctn where BSNO=b.BSNO and len(CNTRNO)=11) ", 0, 9, out recordcount);
11ETD = 11ETD.OrderByDescending(o => o.ETD).ToList();
//var LastEtd = 该客户所有业务中未放货未提单签出且具备箱号长度11位的箱号当中ETD最大的业务.Max(s=> Convert.ToDateTime(s.ETD));
var LastEtd = 11ETD[0].ETD;
if (headList.Exists(e => e.ETD == LastEtd))
//判断标准 该客户的全部其他业务 是否存在 BLISSUESTATUS<>'提单签出'且<>'已放货' 且其下属明细中有箱号长度11位的箱号 的
var recordcount = 0;
var bsnostr = "'" + string.Join("','", headList.Select(s => s.BSNO)) + "'";
var List = GetDataList($" b.CUSTOMERNAME='{headList[0].CUSTOMERNAME}' and b.BLISSUESTATUS<>'提单签出' and b.BLISSUESTATUS<>'已放货' and exists(select 1 from op_ctn where BSNO=b.BSNO and len(CNTRNO)=11) and b.BSNO not in({bsnostr})", 0, 9, out recordcount);
if (recordcount > 0)
{
var = headList.Where(x => x.ETD == LastEtd).ToList();
//有其他未签出的 且用于判断的这些业务是ETD最晚的 是最后一票
var custnoStr = "单号[" + string.Join(",", .Select(s=>s.CUSTNO).Distinct().ToArray()) + "]ATD:"+ LastEtd+",此后无单";
//result.OK("", false);
//判断这个或者这些业务当中 是否有其下属明细中有箱号长度11位的箱号 的 且 ETD=【该客户所有业务中其下属明细中有箱号长度11位的箱号的ETD最晚的】
//如果有 也认为符合该条件的业务为【最后一票业务】
var 11ETD = GetDataList($" b.CUSTOMERNAME='{headList[0].CUSTOMERNAME}' and b.BLISSUESTATUS<>'提单签出' and b.BLISSUESTATUS<>'已放货' and exists(select 1 from op_ctn where BSNO=b.BSNO and len(CNTRNO)=11) ", 0, 9, out recordcount);
11ETD = 11ETD.OrderByDescending(o => o.ETD).ToList();
//var LastEtd = 该客户所有业务中未放货未提单签出且具备箱号长度11位的箱号当中ETD最大的业务.Max(s=> Convert.ToDateTime(s.ETD));
var LastEtd = 11ETD[0].ETD;
if (headList.Exists(e => e.ETD == LastEtd))
{
var = headList.Where(x => x.ETD == LastEtd).ToList();
//有其他未签出的 且用于判断的这些业务是ETD最晚的 是最后一票
var custnoStr = "单号[" + string.Join(",", .Select(s => s.CUSTNO).Distinct().ToArray()) + "]ATD:" + LastEtd + ",此后无单";
result.OK($"最后开船的{headList.Count}票,"+ custnoStr+"", true);
result.OK($"最后开船的{headList.Count}票," + custnoStr + "", true);
}
else
{
//有其他未签出的 但用于判断的这些业务不是ETD最晚的 不是最后一票
result.OK("", false);
}
}
else {
//有其他未签出的 但用于判断的这些业务不是ETD最晚的 不是最后一票
result.OK("", false);
else
{
//没有其他未签出的业务了 是最后一票
result.OK($"警示!!!该客户仅剩此{headList.Count}票", true);
}
}
else
{
//没有其他未签出的业务了 是最后一票
result.OK($"警示!!!该客户仅剩此{headList.Count}票", true);
catch (Exception e) {
result.SetErrorInfo(e.Message);
}
return result;
}
@ -3995,38 +3994,93 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
return result;
}
public static DBResult (string BSNO)
{
var result = new DBResult();
var cdc = new CommonDataContext();
var bsnoList = BSNO.Replace("'", "").Split(',').ToList();
var List = cdc.v_op_blissuelist_Detail.Where(x => bsnoList.Contains(x.bsno));
var = true;
foreach (var bsno in bsnoList)
{
var = List.Where(x => x.bsno == bsno && x.BLSTATUS == "审核通过").ToList();
var = List.Where(x => x.bsno == bsno && x.BLSTATUS != "审核通过").ToList();
if ( != null && .Count > 0 && ( == null || .Count == 0))
{
}
else
{
= false;
break;
}
}
if ()
{
result.OK();
}
else {
result.SetErrorInfo("");
}
return result;
}
/// <summary>
/// 是否财务扣单
/// 由财务扣单的业务 不可以申请特放
/// 由财务扣单的业务 不可以申请特放;
/// 如有财务扣单 返回true,如无返回false
/// </summary>
/// <param name="BSNO"></param>
/// <returns></returns>
public static DBResult ISKDWithCW(string BSNO)
{
var _recount = 0;
var headList = GetDataList(" B.BSNO in (" + BSNO + ") and oB.blstatus='扣单' ", 0, 999, out _recount);
return ISKDWithCW(headList);
}
/// <summary>
/// 是否财务扣单
/// 由财务扣单的业务 不可以申请特放;
/// 如有财务扣单 返回true,如无返回false
/// </summary>
/// <param name="BSNO"></param>
/// <returns></returns>
public static DBResult ISKDWithCW(List<MsOp_BLISSUEmb> headList)
{
var result = new DBResult();
result.SetErrorInfo("没有财务角色扣单");
var _recount = 0;
var headList = GetDataList(" B.BSNO in (" + BSNO + ") and oB.blstatus='扣单' ", 0, 999, out _recount);
//var _recount = 0;
//var headList = GetDataList(" B.BSNO in (" + BSNO + ") and oB.blstatus='扣单' ", 0, 999, out _recount);
if (headList != null && headList.Count > 0) {
if (headList != null && headList.Count > 0)
{
var GIDList = headList.Select(s => s.GID).ToList();
var cdc = new CommonDataContext();
var = cdc.WorkLog.Where(x => GIDList.Contains(x.BSNO) && x.ACTNAME==BLSTATUSTYPE.).ToList();
var = cdc.WorkLog.Where(x => GIDList.Contains(x.BSNO) && x.ACTNAME == BLSTATUSTYPE.).ToList();
var UseridList= .Select(s=>s.OP).Distinct().ToList();
var UseridList = .Select(s => s.OP).Distinct().ToList();
var List = ();
var IDList = List.Where(x => x.GVALUE.Contains("财务")).Select(s=>s.GID).ToList();
var IDList = List.Where(x => x.GVALUE.Contains("财务")).Select(s => s.GID).ToList();
var IDList = cdc.user_role.Where(x => UseridList.Contains(x.USERID) && IDList.Contains(x.ROLEID)).ToList();
if (IDList.Count > 0) {
if (IDList.Count > 0)
{
var USERID = IDList[0].USERID;
var = .First(x => x.OP == USERID);
var head = headList.First(x => x.GID == .BSNO);
var msg = $"存在一个由财务扣单的业务,不能执行特殊放单申请【{head.CUSTNO}】";
var msg = $"存在一个由财务扣单的业务,不能执行放货或特殊放单申请【{head.CUSTNO}】";
result.OK(msg);
return result;
}

@ -8122,18 +8122,18 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
// _this2.winFDTZShow.close();
// }
//},
{
text: Zi.LAN.btnprint, //"打印",
text: Zi.LAN.TFSQ, //"特放申请",
minWidth: 70,
handler: function () {
_this2.Print_FDTZ();
_this2.TFSQ();
}
}, {
text: Zi.LAN.TFSQ, //"特放申请",
},
{
text: Zi.LAN.btnprint, //"打印",
minWidth: 70,
handler: function () {
_this2.TFSQ();
_this2.Print_FDTZ();
}
}]
});

Loading…
Cancel
Save