ddlucky 1 year ago
parent cb297595a2
commit 7a607c9fa4

@ -191,11 +191,11 @@ namespace VOL.WMS.Services
foreach (var item in AuditParam.wheres.Where(x=>x.name != "isaudit").ToList()) {
if (item.name == "BILLNO" && !string.IsNullOrWhiteSpace( item.value)) {
addcondition($"i.BILLNO like '%{item.value}'");
addcondition($"cm.BILLNO like '%{item.value}'");
}
if (item.name == "APPLICANTNAME" && !string.IsNullOrWhiteSpace(item.value))
{
addcondition($"i.APPLICANT = '{item.value}'");
addcondition($"cm.APPLICANT = '{item.value}'");
}
if (item.name == "MBLNO" && !string.IsNullOrWhiteSpace(item.value))
{
@ -281,7 +281,7 @@ namespace VOL.WMS.Services
{
if (item.name == "GID" && !string.IsNullOrWhiteSpace(item.value))
{
addcondition($" i.GID = '{item.value}' ");
addcondition($" cm.GID = '{item.value}' ");
}
}
@ -316,7 +316,7 @@ namespace VOL.WMS.Services
{
if (item.name == "GID" && !string.IsNullOrWhiteSpace(item.value))
{
addcondition($" i.GID = '{item.value}' ");
addcondition($" cm.GID = '{item.value}' ");
}
}
@ -345,33 +345,6 @@ namespace VOL.WMS.Services
}
}
if (AuditParam.execution == "关联业务") {
var BSNO = "";
foreach (var item in AuditParam.wheres)
{
if (item.name == "BSNO" && !string.IsNullOrWhiteSpace(item.value))
{
BSNO=item.value;
}
}
return GetBillView(BSNO);
}
if (AuditParam.execution == "关联业务费用")
{
var BSNO = "";
var OPLBNAME = "";
foreach (var item in AuditParam.wheres)
{
if (item.name == "BSNO" && !string.IsNullOrWhiteSpace(item.value))
{
BSNO = item.value;
}
}
return GetBillFeeView(BSNO, OPLBNAME);
}
}
if (jp.TYPENAME == "付费发票核销")
@ -615,7 +588,7 @@ namespace VOL.WMS.Services
if (AuditParam.isaudit == "仅需自己审核")
{
addcondition($" EXISTS (select 1 from workflow_using wu where wu.BSNO=info_client.GID and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'{userid}',wu.stepno)>0 ) " );
addcondition($" EXISTS (select 1 from workflow_using wu where wu.BSNO=info_client.GID and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'{userid}',wu.stepno)>0 ) " );
}
if (AuditParam.isaudit == "已审核")
{
@ -727,7 +700,223 @@ namespace VOL.WMS.Services
}
}
//Logger.PushStatus_PUB("虎鲸接口", "", jp.ToString());
if (jp.TYPENAME == "发票申请审批")
{
try
{
if (UserContext.Current.UserId != null)
{
}
}
catch
{
return _webResponseContent.Error("请重新登陆");
}
var dicnos3 = new string[] { "DS7url" };
var tUrlList = DictionaryManager.GetDictionaries(dicnos3).ToList();
var urlhead = tUrlList[0].Sys_DictionaryList[0].DicValue;
var urlDetail = "/CommMng/DSWEBAPPInterface/InvApplicationAuditInterface";
var url = urlhead + urlDetail;
var AuditParam = JsonConvert.DeserializeObject<DS7Audit_param>(JsonBody.ToString());
var userid = UserContext.Current.UserInfo.User_Id;
var username = UserContext.Current.UserInfo.UserName;
var usercompanyid = UserContext.Current.UserInfo.CompanyId;
var condition = "";
void addcondition(string str)
{
if (condition != "") condition += " and ";
condition += str;
}
if (AuditParam.execution == "查询列表")
{
var isaudit = "2";
if (!string.IsNullOrWhiteSpace(AuditParam.isaudit))
{
if (AuditParam.isaudit == "仅需自己审核")
{
isaudit = "2";
}
if (AuditParam.isaudit == "已审核")
{
isaudit = "0";
}
}
addcondition($"BILLSTATUS ='{isaudit}'");
if (AuditParam.wheres.Exists(x => x.name != "isaudit"))
{
foreach (var item in AuditParam.wheres.Where(x => x.name != "isaudit").ToList())
{
if (item.name == "BILLNO" && !string.IsNullOrWhiteSpace(item.value))
{
addcondition($" cm.BILLNO like '%{item.value}%' ");
}
if (item.name == "MBLNO" && !string.IsNullOrWhiteSpace(item.value))
{
addcondition($" BILLNO IN (SELECT BILLNO FROM CH_FEE_DO WHERE BSNO IN (SELECT BSNO FROM V_OP_BILL b WHERE b.CUSTNO like '%{item.value}%' or b.MBLNO like '%{item.value}%' or b.HBLNO like '%{item.value}%' or b.CUSTOMNO like '%{item.value}%' or b.ORDERNO like '%{item.value}%')) ");
}
if (item.name == "CUSTOMERNAME" && !string.IsNullOrWhiteSpace(item.value))
{
addcondition($"CUSTOMERNAME like '%{item.value}%'");
}
if (item.name == "APPLYTIMEBgn" && !string.IsNullOrWhiteSpace(item.value))
{
addcondition($"APPLYTIME >='{item.value}'");
}
if (item.name == "APPLYTIMEEnd" && !string.IsNullOrWhiteSpace(item.value))
{
addcondition($"APPLYTIME <='{item.value} 23:59:59'");
}
}
}
JObject reqObj = new JObject
{
{ "userid", userid },
{ "formname", AuditParam.execution },
{ "isaudit", isaudit },
{ "condition", condition }
};
try
{
var t_str = reqObj.ToString(Newtonsoft.Json.Formatting.None);
var rtn = SendHelper.DoPost(url, t_str);
var rtnresult = JsonConvert.DeserializeObject<DBResult>(rtn);
_webResponseContent = new WebResponseContent(rtnresult);
}
catch (Exception e)
{
_webResponseContent.Error(e.Message);
}
}
if (AuditParam.execution == "查询明细")
{
foreach (var item in AuditParam.wheres)
{
if (item.name == "GID" && !string.IsNullOrWhiteSpace(item.value))
{
addcondition($" PID = '{item.value}' ");
}
}
JObject reqObj = new JObject
{
{ "userid", userid },
{ "formname", AuditParam.execution },
{ "isaudit", "" },
{ "condition", condition }
};
try
{
var t_str = reqObj.ToString(Newtonsoft.Json.Formatting.None);
var rtn = SendHelper.DoPost(url, t_str);
var rtnresult = JsonConvert.DeserializeObject<DBResult>(rtn);
_webResponseContent = new WebResponseContent(rtnresult);
}
catch (Exception e)
{
_webResponseContent.Error(e.Message);
}
}
if (AuditParam.execution == "审批通过")
{
foreach (var item in AuditParam.wheres)
{
if (item.name == "GID" && !string.IsNullOrWhiteSpace(item.value))
{
addcondition($" cm.GID = '{item.value}' ");
}
}
JObject reqObj = new JObject
{
{ "userid", userid },
{ "formname", AuditParam.execution },
{ "isaudit", "" },
{ "condition", condition }
};
try
{
var t_str = reqObj.ToString(Newtonsoft.Json.Formatting.None);
var rtn = SendHelper.DoPost(url, t_str);
var rtnresult = JsonConvert.DeserializeObject<DBResult>(rtn);
_webResponseContent = new WebResponseContent(rtnresult);
}
catch (Exception e)
{
_webResponseContent.Error(e.Message);
}
}
if (AuditParam.execution == "驳回")
{
foreach (var item in AuditParam.wheres)
{
if (item.name == "GID" && !string.IsNullOrWhiteSpace(item.value))
{
addcondition($" cm.GID = '{item.value}' ");
}
}
JObject reqObj = new JObject
{
{ "userid", userid },
{ "formname", AuditParam.execution },
{ "isaudit", AuditParam.reason },
{ "condition", condition }
};
try
{
var t_str = reqObj.ToString(Newtonsoft.Json.Formatting.None);
var rtn = SendHelper.DoPost(url, t_str);
var rtnresult = JsonConvert.DeserializeObject<DBResult>(rtn);
_webResponseContent = new WebResponseContent(rtnresult);
}
catch (Exception e)
{
_webResponseContent.Error(e.Message);
}
}
}
return _webResponseContent;
}

Loading…
Cancel
Save