|
|
@ -1255,6 +1255,18 @@ namespace DSWeb.SoftMng.Controllers
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//20230824 增加校验:
|
|
|
|
|
|
|
|
//1:货值超过50万,提示确认币值
|
|
|
|
|
|
|
|
//2、进出口报关单分项净重合计要与净重一致,系统比对提示
|
|
|
|
|
|
|
|
//3、境内收发货人与生产销售单位保持一致,不一致需要提示是否确认(用查询条件方式解决)
|
|
|
|
|
|
|
|
//4、进口报关单添加复核提示:特殊关系确认(用查询条件方式解决)
|
|
|
|
|
|
|
|
//5、原产国与启运国一致,否则提示(用查询条件方式解决)
|
|
|
|
|
|
|
|
//6、分项价格合计总数
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ch = 报关数值校验.getHelper(model, list);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ch.GetErrorString(ref errorstr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (errorstr != "") {
|
|
|
|
if (errorstr != "") {
|
|
|
|
return Json(new { success = false, message ="审核条件不通过:"+errorstr});
|
|
|
|
return Json(new { success = false, message ="审核条件不通过:"+errorstr});
|
|
|
@ -1326,6 +1338,106 @@ namespace DSWeb.SoftMng.Controllers
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
///20230824 增加校验:
|
|
|
|
|
|
|
|
///1:货值超过50万,提示确认币值
|
|
|
|
|
|
|
|
///2、进出口报关单分项净重合计要与净重一致,系统比对提示
|
|
|
|
|
|
|
|
///3、境内收发货人与生产销售单位保持一致,不一致需要提示是否确认(用查询条件方式解决)
|
|
|
|
|
|
|
|
///4、进口报关单添加复核提示:特殊关系确认(用查询条件方式解决)
|
|
|
|
|
|
|
|
///5、原产国与启运国一致,否则提示(用查询条件方式解决)
|
|
|
|
|
|
|
|
///6、分项价格合计总数
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public class 报关数值校验 {
|
|
|
|
|
|
|
|
public DecHead head { get; set; }
|
|
|
|
|
|
|
|
public List<DecList> body { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public 报关数值校验() { }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static 报关数值校验 getHelper(DecHead Head, List<DecList> Body) {
|
|
|
|
|
|
|
|
var result = new 报关数值校验();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.head = Head;
|
|
|
|
|
|
|
|
result.body = Body;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DBResult DoCheck(string checktype) {
|
|
|
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
|
|
|
result.OK();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (checktype=="明细净重")
|
|
|
|
|
|
|
|
{ ///2、进出口报关单分项净重合计要与净重一致,系统比对提示
|
|
|
|
|
|
|
|
//用declist.FirstQty 的合计 与 dechead.NetWt 比对 如不一致则提示
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var 第一法定数量合计 = 0M;
|
|
|
|
|
|
|
|
foreach (var item in body) {
|
|
|
|
|
|
|
|
if (item.FirstUnit_Text == "千克")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
第一法定数量合计 += item.FirstQty == null ? 0 : (decimal)item.FirstQty;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (第一法定数量合计!=0M && 第一法定数量合计 != head.NetWt) {
|
|
|
|
|
|
|
|
result.SetErrorInfo($"明细合计净重{第一法定数量合计},与报关单净重{head.NetWt}不相等,请注意核对!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (checktype == "明细价格")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
///1:货值超过50万,提示确认币值
|
|
|
|
|
|
|
|
//用declist.DeclTotal 的合计 高于系统配置的50w则提示
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var 金额合计 = 0M;
|
|
|
|
|
|
|
|
foreach (var item in body)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
金额合计 += item.DeclTotal == null ? 0 : (decimal)item.DeclTotal;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var maxvalue = 500000M;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var setamountmax= MsSysParamSetDAL.GetSysParamValue("OpApply_Check_MaxAmount");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(setamountmax))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
maxvalue = Convert.ToDecimal(setamountmax);
|
|
|
|
|
|
|
|
}catch (Exception) { }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (金额合计 > maxvalue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result.SetErrorInfo($"金额合计{金额合计}大于警戒值{maxvalue},请注意核对!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///6、分项价格合计总数
|
|
|
|
|
|
|
|
//用declist.FirstQty 的合计 与 dechead.NetWt 比对 如不一致则提示
|
|
|
|
|
|
|
|
//头表没有金额合计 放弃
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void GetErrorString(ref string errorstr)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var _r = DoCheck("明细净重");
|
|
|
|
|
|
|
|
if (!_r.Success) {
|
|
|
|
|
|
|
|
errorstr += "<br>序号:9001 (" + _r.Message + ")";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_r = DoCheck("明细价格");
|
|
|
|
|
|
|
|
if (!_r.Success)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
errorstr += "<br>序号:9002 (" + _r.Message + ")";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public JsonResult GetHead(string gid)
|
|
|
|
public JsonResult GetHead(string gid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var model = bll.GetModel(gid);
|
|
|
|
var model = bll.GetModel(gid);
|
|
|
|