You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

581 lines
29 KiB
C#

10 months ago
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
using DSWeb.MvcShipping.DAL.Chfee_AuditDAL;
using DSWeb.MvcShipping.DAL.MsChFeeDAL;
using DSWeb.MvcShipping.Models.MsChFee;
using DSWeb.MvcShipping.Controllers;
using Newtonsoft.Json;
using DSWebComponent;
using DSWebMobileService;
using DSWebMobileService.Common;
using HcUtility.Comm;
namespace DSWebMobile.Handler
{
/// <summary>
/// Profit 的摘要说明
/// </summary>
public class Profit : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
string action = context.Request.QueryString["action"].ToString();
switch (action)
{
case "0":
GetBillDataList(context);
break;
case "1":
GetDataList(context);
break;
case "3":
Audit(context);
break;
case "4":
AuditBack(context);
break;
case "5":
NoIvoice(context);
break;
case "6":
CancelNoIvoice(context);
break;
case "7":
AuditShen(context);
break;
case "8":
AuditBackShen(context);
break;
case "9":
GetFeeInfo(context);
break;
/*case "10":
IsReject(context);
break;*/
case "10":
GetOPGain(context);
break;
}
}
private void GetOPGain(HttpContext context)
{
string jsonStr = "[";
string relBSNO = "";
string bsno = context.Request.Form["bo"].ToString();
string pattern = "\0";
string replacement = "";
Regex rgx = new Regex(pattern);
relBSNO = rgx.Replace(bsno, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relBSNO = rgx2.Replace(relBSNO, replacement);
List<MsOpGain> _chFee = MsChFeeDAL.GetOPGainList("BSNO='" + relBSNO + "'", SessionUtil.Session["USERID"].ToString(), SessionUtil.Session["SHOWNAME"].ToString(), SessionUtil.Session["COMPANYID"].ToString());//ChfeeAuditServer.GetDataList(billIDArr[iCount], relBSNO, type, relOpType, expenseStatusIsAll, SessionUtil.Session["USERID"].ToString(), SessionUtil.Session["SHOWNAME"].ToString(), SessionUtil.Session["COMPANYID"].ToString());
foreach (MsOpGain chfee in _chFee)
{
jsonStr += "{";
jsonStr += "\"PR\":\"" + chfee.PR + "\"";
jsonStr += "},";
}
jsonStr = jsonStr.Substring(0, jsonStr.Length - 1);
jsonStr += "]";
/*var billData = JsonConvert.DeserializeObject<List<MsChFee>>(jsonStr);
DBResult result = Chfee_AuditDAL.AuditShenNew(relOpType, Convert.ToString(SessionUtil.Session["USERID"]), billData);
var json = Newtonsoft.Json.JsonConvert.SerializeObject(result);
json = "[" + json + "]";*/
context.Response.ContentType = "text/plain";
context.Response.Write(jsonStr);
context.Response.End();
}
private void GetFeeInfo(HttpContext context)
{
string relFeeID = "";
string feeID = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["id"].ToString());
string pattern = "\0";
string replacement = "";
Regex rgx = new Regex(pattern);
relFeeID = rgx.Replace(feeID, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relFeeID = rgx2.Replace(relFeeID, replacement);
MsChFeeController _chfee = new MsChFeeController();
var result = _chfee.GetModifyData(relFeeID, "2");
string result2 = result.Content;
result2 = result2.Replace("\r\n", "");
result2 = result2.Substring(result2.IndexOf('['), result2.Length - result2.IndexOf('[') - 1);
context.Response.ContentType = "text/plain";
context.Response.Write(result2);
context.Response.End();
}
private void CancelNoIvoice(HttpContext context)
{
string relBillID = "";
string billID = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["b"].ToString());
string pattern = "\0";
string replacement = "";
Regex rgx = new Regex(pattern);
relBillID = rgx.Replace(billID, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relBillID = rgx2.Replace(relBillID, replacement);
DBResult result = Chfee_AuditDAL.CancelNoIvoice(relBillID);
var json = JsonConvert.SerializeObject(result);
json = "[" + json + "]";
context.Response.ContentType = "text/plain";
context.Response.Write(json);
context.Response.End();
}
private void NoIvoice(HttpContext context)
{
string relBillID = "";
string billID = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["b"].ToString());
string pattern = "\0";
string replacement = "";
Regex rgx = new Regex(pattern);
relBillID = rgx.Replace(billID, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relBillID = rgx2.Replace(relBillID, replacement);
DBResult result = Chfee_AuditDAL.NoIvoice(relBillID);
var json = JsonConvert.SerializeObject(result);
json = "[" + json + "]";
context.Response.ContentType = "text/plain";
context.Response.Write(json);
context.Response.End();
}
private void AuditBackShen(HttpContext context)
{
string relOpType = "";
string relBillID = "";
string relReason = "";
string billID = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["b"].ToString());
string opType = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["y"].ToString());
string reason = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["r"].ToString());
string pattern = "\0";
string replacement = "";
Regex rgx = new Regex(pattern);
relOpType = rgx.Replace(opType, replacement);
relBillID = rgx.Replace(billID, replacement);
relReason = rgx.Replace(reason, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relOpType = rgx2.Replace(relOpType, replacement);
relBillID = rgx2.Replace(relBillID, replacement);
relReason = rgx2.Replace(relReason, replacement);
DBResult result = Chfee_AuditDAL.AuditBackShen(relOpType, SessionUtil.Session["USERID"].ToString(), relBillID, relReason);
var json = JsonConvert.SerializeObject(result);
json = "[" + json + "]";
context.Response.ContentType = "text/plain";
context.Response.Write(json);
context.Response.End();
}
private void AuditShen(HttpContext context)
{
string relOpType = "";
string relBillID = "";
string relBSNO = "";
string billID = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["b"].ToString());
string opType = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["y"].ToString());
string bsno = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["b"].ToString());
int type = int.Parse(context.Request.QueryString["t"].ToString());
string expenseStatusIsAll = context.Request.QueryString["es"].ToString();
string pattern = "\0";
string replacement = "";
Regex rgx = new Regex(pattern);
relOpType = rgx.Replace(opType, replacement);
relBillID = rgx.Replace(billID, replacement);
relBSNO = rgx.Replace(bsno, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relOpType = rgx2.Replace(relOpType, relOpType);
relBillID = rgx2.Replace(relBillID, relBillID);
relBSNO = rgx.Replace(relBSNO, replacement);
//如果只有一个值,则在值的末尾加上','
if (relBillID.IndexOf(',') == -1)
{
relBillID += ",";
}
string[] billIDArr = relBillID.Split(',');
string jsonStr = "[";
for (int iCount = 0; iCount < billIDArr.Length; iCount++)
{
List<MsChFee> temp = ChfeeAuditServer.GetDataList(billIDArr[iCount], relBSNO, type, relOpType, expenseStatusIsAll, SessionUtil.Session["USERID"].ToString(), SessionUtil.Session["SHOWNAME"].ToString(), SessionUtil.Session["COMPANYID"].ToString());
foreach (MsChFee chfee in temp)
{
jsonStr += "{";
jsonStr += "\"GId\":\"" + chfee.GId + "\",";
jsonStr += "\"BsNo\":\"" + chfee.BsNo + "\",";
jsonStr += "\"FeeStatus\":" + chfee.FeeStatus + ",";
jsonStr += "\"FeeStatus_Ref\":\"" + chfee.FeeStatus_Ref + "\",";
jsonStr += "\"FeeType\":" + chfee.FeeType + ",";
jsonStr += "\"FeeName\":\"" + chfee.FeeName + "\",";
jsonStr += "\"FeeDescription\":\"" + chfee.FeeDescription + "\",";
jsonStr += "\"CustomerType\":\"" + chfee.CustomerType + "\",";
jsonStr += "\"CustomerName\":\"" + chfee.CustomerName + "\",";
jsonStr += "\"Unit\":\"" + chfee.Unit + "\",";
jsonStr += "\"UnitPrice\":" + chfee.UnitPrice + ",";
jsonStr += "\"Quantity\":\"" + chfee.Quantity + "\",";
jsonStr += "\"TaxRate\":" + chfee.TaxRate + ",";
jsonStr += "\"TaxUnitPrice\":" + chfee.TaxUnitPrice + ",";
jsonStr += "\"NoTaxAmount\":" + chfee.NoTaxAmount + ",";
jsonStr += "\"Amount\":" + chfee.Amount + ",";
jsonStr += "\"AccTaxRate\":" + chfee.AccTaxRate + ",";
jsonStr += "\"Currency\":\"" + chfee.Currency + "\",";
jsonStr += "\"ExChangerate\":" + chfee.ExChangerate + ",";
jsonStr += "\"Reason\":\"" + chfee.Reason + "\",";
jsonStr += "\"Remark\":\"" + chfee.Remark + "\",";
jsonStr += "\"Commissionrate\":" + chfee.Commissionrate + ",";
jsonStr += "\"Settlement\":" + chfee.Settlement + ",";
jsonStr += "\"Invoice\":" + chfee.Invoice + ",";
jsonStr += "\"OrderAmount\":" + chfee.OrderAmount + ",";
jsonStr += "\"OrderInvoice\":" + chfee.OrderInvoice + ",";
jsonStr += "\"SubmitDate\":\"" + chfee.SubmitDate + "\",";
jsonStr += "\"Auditoperator\":\"" + chfee.Auditoperator + "\",";
jsonStr += "\"AuditDate\":\"" + chfee.AuditDate + "\",";
jsonStr += "\"EnteroPerator\":\"" + chfee.EnteroPerator + "\",";
jsonStr += "\"EnterDate\":\"" + chfee.EnterDate + "\",";
jsonStr += "\"DebitNo\":\"" + chfee.DebitNo + "\",";
jsonStr += "\"IsDebit\":\"" + chfee.IsDebit + "\",";
jsonStr += "\"IsOpen\":\"" + chfee.IsOpen + "\",";
jsonStr += "\"OpName\":\"" + chfee.OpName + "\",";
jsonStr += "\"IsAdvancedpay\":\"" + chfee.IsAdvancedpay + "\",";
jsonStr += "\"Sort\":\"" + chfee.Sort + "\",";
jsonStr += "\"IsInvoice\":\"" + chfee.IsInvoice + "\",";
jsonStr += "\"FeeFrt\":\"" + chfee.FeeFrt + "\",";
jsonStr += "\"IsCrmOrderFee\":\"" + chfee.IsCrmOrderFee + "\",";
jsonStr += "\"AuditStatus\":\"" + chfee.AuditStatus + "\",";
jsonStr += "\"InvoiceNum\":\"" + chfee.InvoiceNum + "\",";
jsonStr += "\"ChequeNum\":\"" + chfee.ChequeNum + "\",";
jsonStr += "\"WmsOutBsNo\":\"" + chfee.WmsOutBsNo + "\",";
jsonStr += "\"LineNum\":" + chfee.LineNum + ",";
jsonStr += "\"IsAudit\":\"" + chfee.IsAudit + "\"";
jsonStr += "},";
}
}
jsonStr = jsonStr.Substring(0, jsonStr.Length - 1);
jsonStr += "]";
var billData = JsonConvert.DeserializeObject<List<MsChFee>>(jsonStr);
DBResult result = Chfee_AuditDAL.AuditShenNew(relOpType, Convert.ToString(SessionUtil.Session["USERID"]), billData);
var json = Newtonsoft.Json.JsonConvert.SerializeObject(result);
json = "[" + json + "]";
context.Response.ContentType = "text/plain";
context.Response.Write(json);
context.Response.End();
}
private void AuditBack(HttpContext context)
{
string relOpType = "";
string relBillID = "";
string relReason = "";
string relBSNO = "";
string billID = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["b"].ToString());
string opType = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["y"].ToString());
string reason = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["r"].ToString());
string bsno = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["b"].ToString());
int type = int.Parse(context.Request.QueryString["t"].ToString());
string expenseStatusIsAll = context.Request.QueryString["es"].ToString();
string pattern = "\0";
string replacement = "";
Regex rgx = new Regex(pattern);
relOpType = rgx.Replace(opType, replacement);
relBillID = rgx.Replace(billID, replacement);
relReason = rgx.Replace(reason, replacement);
relBSNO = rgx.Replace(bsno, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relOpType = rgx2.Replace(relOpType, replacement);
relBillID = rgx2.Replace(relBillID, replacement);
relReason = rgx2.Replace(relReason, replacement);
relBSNO = rgx2.Replace(relBSNO, replacement);
if (relBillID.IndexOf(',') == -1)
{
relBillID += ",";
}
string[] billIDArr = relBillID.Split(',');
string jsonStr="[";
for (int iCount = 0; iCount < billIDArr.Length; iCount++)
{
List<MsChFee> temp = ChfeeAuditServer.GetDataList(billIDArr[iCount], relBSNO, type, relOpType, expenseStatusIsAll, SessionUtil.Session["USERID"].ToString(), SessionUtil.Session["SHOWNAME"].ToString(), SessionUtil.Session["COMPANYID"].ToString());
foreach (MsChFee chfee in temp)
{
jsonStr+="{";
jsonStr+="\"GId\":\""+chfee.GId+"\",";
jsonStr += "\"BsNo\":\"" + chfee.BsNo + "\",";
jsonStr += "\"FeeStatus\":" + chfee.FeeStatus + ",";
jsonStr += "\"FeeStatus_Ref\":\"" + chfee.FeeStatus_Ref + "\",";
jsonStr += "\"FeeType\":" + chfee.FeeType + ",";
jsonStr += "\"FeeName\":\"" + chfee.FeeName + "\",";
jsonStr += "\"FeeDescription\":\"" + chfee.FeeDescription + "\",";
jsonStr += "\"CustomerType\":\"" + chfee.CustomerType + "\",";
jsonStr += "\"CustomerName\":\"" + chfee.CustomerName + "\",";
jsonStr += "\"Unit\":\"" + chfee.Unit + "\",";
jsonStr += "\"UnitPrice\":" + chfee.UnitPrice + ",";
jsonStr += "\"Quantity\":\"" + chfee.Quantity + "\",";
jsonStr += "\"TaxRate\":" + chfee.TaxRate + ",";
jsonStr += "\"TaxUnitPrice\":" + chfee.TaxUnitPrice + ",";
jsonStr += "\"NoTaxAmount\":" + chfee.NoTaxAmount + ",";
jsonStr += "\"Amount\":" + chfee.Amount + ",";
jsonStr += "\"AccTaxRate\":" + chfee.AccTaxRate + ",";
jsonStr += "\"Currency\":\"" + chfee.Currency + "\",";
jsonStr += "\"ExChangerate\":" + chfee.ExChangerate + ",";
jsonStr += "\"Reason\":\"" + chfee.Reason + "\",";
jsonStr += "\"Remark\":\"" + chfee.Remark + "\",";
jsonStr += "\"Commissionrate\":" + chfee.Commissionrate + ",";
jsonStr += "\"Settlement\":" + chfee.Settlement + ",";
jsonStr += "\"Invoice\":" + chfee.Invoice + ",";
jsonStr += "\"OrderAmount\":" + chfee.OrderAmount + ",";
jsonStr += "\"OrderInvoice\":" + chfee.OrderInvoice + ",";
jsonStr += "\"SubmitDate\":\"" + chfee.SubmitDate + "\",";
jsonStr += "\"Auditoperator\":\"" + chfee.Auditoperator + "\",";
jsonStr += "\"AuditDate\":\"" + chfee.AuditDate + "\",";
jsonStr += "\"EnteroPerator\":\"" + chfee.EnteroPerator + "\",";
jsonStr += "\"EnterDate\":\"" + chfee.EnterDate + "\",";
jsonStr += "\"DebitNo\":\"" + chfee.DebitNo + "\",";
jsonStr += "\"IsDebit\":\"" + chfee.IsDebit + "\",";
jsonStr += "\"IsOpen\":\"" + chfee.IsOpen + "\",";
jsonStr += "\"OpName\":\"" + chfee.OpName + "\",";
jsonStr += "\"IsAdvancedpay\":\"" + chfee.IsAdvancedpay + "\",";
jsonStr += "\"Sort\":\"" + chfee.Sort + "\",";
jsonStr += "\"IsInvoice\":\"" + chfee.IsInvoice + "\",";
jsonStr += "\"FeeFrt\":\"" + chfee.FeeFrt + "\",";
jsonStr += "\"IsCrmOrderFee\":\"" + chfee.IsCrmOrderFee + "\",";
jsonStr += "\"AuditStatus\":\"" + chfee.AuditStatus + "\",";
jsonStr += "\"InvoiceNum\":\"" + chfee.InvoiceNum + "\",";
jsonStr += "\"ChequeNum\":\"" + chfee.ChequeNum + "\",";
jsonStr += "\"WmsOutBsNo\":\"" + chfee.WmsOutBsNo + "\",";
jsonStr += "\"LineNum\":" + chfee.LineNum + ",";
jsonStr += "\"IsAudit\":\"" + chfee.IsAudit + "\"";
jsonStr += "},";
}
}
jsonStr = jsonStr.Substring(0, jsonStr.Length - 1);
jsonStr += "]";
var billData = JsonConvert.DeserializeObject<List<MsChFee>>(jsonStr);
DBResult result = Chfee_AuditDAL.AuditBack(relOpType, SessionUtil.Session["USERID"].ToString(), billData, relReason);
var json = JsonConvert.SerializeObject(result);
json = "[" + json + "]";
context.Response.ContentType = "text/plain";
context.Response.Write(json);
context.Response.End();
}
private void Audit(HttpContext context)
{
string relOpType = "";
string relBillID = "";
string billID = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["b"].ToString());
string opType = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["y"].ToString());
string pattern = "\0";
string replacement = "";
Regex rgx = new Regex(pattern);
relOpType = rgx.Replace(opType, replacement);
relBillID = rgx.Replace(billID, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relOpType = rgx2.Replace(relOpType, relOpType);
relBillID = rgx2.Replace(relBillID, relBillID);
DBResult result = Chfee_AuditDAL.Audit(relOpType, Convert.ToString(SessionUtil.Session["USERID"]), relBillID);
var json = Newtonsoft.Json.JsonConvert.SerializeObject(result);
//{\"Success\":true,\"Message\":\"审核成功\",\"Data\":null}
json = "[" + json + "]";
context.Response.ContentType = "text/plain";
context.Response.Write(json);
context.Response.End();
}
private void GetDataList(HttpContext context)
{
string relStrCondition = "";
string relBSNO = "";
string relOpType = "";
string strCondition = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["s"].ToString());
string bsno = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["b"].ToString());
int type = int.Parse(context.Request.QueryString["t"].ToString());
string expenseStatusIsAll = context.Request.Form["es"].ToString();//费用明细仅显示待审核
string opType = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["y"].ToString());
string pattern = "\0";
string replacement = "";
Regex rgx = new Regex(pattern);
relStrCondition = rgx.Replace(strCondition, replacement);
relBSNO = rgx.Replace(bsno, replacement);
relOpType = rgx.Replace(opType, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relStrCondition = rgx2.Replace(relStrCondition, replacement);
relBSNO = rgx2.Replace(relBSNO, replacement);
relOpType = rgx2.Replace(relOpType, replacement);
var dataList = Chfee_AuditDAL.GetDataList(relBSNO, type, relOpType, expenseStatusIsAll, relStrCondition, SessionUtil.Session["USERID"].ToString(),SessionUtil.Session["SHOWNAME"].ToString(),SessionUtil.Session["COMPANYID"].ToString());
//var list = dataList.Skip(start).Take(limit);
string json = Newtonsoft.Json.JsonConvert.SerializeObject(dataList);
context.Response.ContentType = "text/plain";
context.Response.Write(json);
context.Response.End();
}
private void GetBillDataList(HttpContext context)
{
string relStrCondition = "";
string relBeginFrom = "";
string relBeginTo = "";
string relAccFrom = "";
string relAccTo = "";
string relETDFrom = "";
string relETDTo = "";
string strCondition = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["s"].ToString());
string bf = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["bf"].ToString());
string bt = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["bt"].ToString());
string af = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["af"].ToString());
string at = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["at"].ToString());
string ef = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["ef"].ToString());
string et = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["et"].ToString());
//string strCondition = context.Request.Form["s"].ToString();
string isAll = context.Request.Form["isall"].ToString();
string pattern = "\0";
string replacement = "";
int start = int.Parse(context.Request.QueryString["t"].ToString());
int limit = int.Parse(context.Request.QueryString["l"].ToString());
Regex rgx = new Regex(pattern);
relStrCondition = rgx.Replace(strCondition, replacement);
relBeginFrom = rgx.Replace(bf, replacement);
relBeginTo = rgx.Replace(bt, replacement);
relAccFrom = rgx.Replace(af, replacement);
relAccTo = rgx.Replace(at, replacement);
relETDFrom = rgx.Replace(ef, replacement);
relETDTo = rgx.Replace(et, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relStrCondition = rgx2.Replace(relStrCondition, replacement);
relBeginFrom = rgx2.Replace(relBeginFrom, replacement);
relBeginTo = rgx2.Replace(relBeginTo, replacement);
relAccFrom = rgx2.Replace(relAccFrom, replacement);
relAccTo = rgx2.Replace(relAccTo, replacement);
relETDFrom = rgx2.Replace(relETDFrom, replacement);
relETDTo = rgx2.Replace(relETDTo, replacement);
/*
var StrAudit = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID where v_op_bill.BSNO=ch_fee.BSNO and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + userid + "',wu.stepno)>0 "
+ " and wu.WORKFLOWID IN (SELECT GID FROM v_workflow WHERE TYPENAME='FeeRecvPayAudit' or TYPENAME='FeeModifyAudit' "
+ " or TYPENAME='FeeSeaiRecvPayAudit' or TYPENAME='FeeSeaiModifyAudit' or TYPENAME='ApplyFeeAudit' "
+ " or TYPENAME='ApplyFeeModify' or TYPENAME='BulkFeeAudit' or TYPENAME='BulkFeeModify' or TYPENAME='FeeOpOpOtherRecvPayAudit' "
+ " or TYPENAME='FeeOpOtherModifyAudit' or TYPENAME='AireFeeAudit' or TYPENAME='AireFeeModify' "
+ " or TYPENAME='AiriFeeAudit' or TYPENAME='AiriFeeModify' or TYPENAME='RailwayFeeAudit' or TYPENAME='RailwayFeeModify')) ";
isAll=0
isAll=1
*/
if (relStrCondition != "" && isAll == "1")
{
relStrCondition += " and EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID where v_op_bill.BSNO=ch_fee.BSNO and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + SessionUtil.Session["USERID"].ToString() + "',wu.stepno)>0 and wu.WORKFLOWID IN (SELECT GID FROM v_workflow WHERE TYPENAME='FeeRecvPayAudit' or TYPENAME='FeeModifyAudit' or TYPENAME='FeeSeaiRecvPayAudit' or TYPENAME='FeeSeaiModifyAudit' or TYPENAME='ApplyFeeAudit' or TYPENAME='ApplyFeeModify' or TYPENAME='BulkFeeAudit' or TYPENAME='BulkFeeModify' or TYPENAME='FeeOpOpOtherRecvPayAudit' or TYPENAME='FeeOpOtherModifyAudit' or TYPENAME='AireFeeAudit' or TYPENAME='AireFeeModify' or TYPENAME='AiriFeeAudit' or TYPENAME='AiriFeeModify' or TYPENAME='RailwayFeeAudit' or TYPENAME='RailwayFeeModify'))";
}
else if(relStrCondition=="" && isAll == "1")
{
relStrCondition = " EXISTS (select 1 from ch_fee left join workflow_using wu on wu.bsno=ch_fee.GID where v_op_bill.BSNO=ch_fee.BSNO and dbo.[GetUsingStep](wu.WORKFLOWID,wu.currentid,'" + SessionUtil.Session["USERID"].ToString() + "',wu.stepno)>0 and wu.WORKFLOWID IN (SELECT GID FROM v_workflow WHERE TYPENAME='FeeRecvPayAudit' or TYPENAME='FeeModifyAudit' or TYPENAME='FeeSeaiRecvPayAudit' or TYPENAME='FeeSeaiModifyAudit' or TYPENAME='ApplyFeeAudit' or TYPENAME='ApplyFeeModify' or TYPENAME='BulkFeeAudit' or TYPENAME='BulkFeeModify' or TYPENAME='FeeOpOpOtherRecvPayAudit' or TYPENAME='FeeOpOtherModifyAudit' or TYPENAME='AireFeeAudit' or TYPENAME='AireFeeModify' or TYPENAME='AiriFeeAudit' or TYPENAME='AiriFeeModify' or TYPENAME='RailwayFeeAudit' or TYPENAME='RailwayFeeModify'))";
}
if (relBeginFrom != "") { relStrCondition += " and BSDATE>='" + relBeginFrom + " 00:00:00' "; }
if (relBeginTo != "") { relStrCondition += " and BSDATE<='" + relBeginTo + " 23:59:59' "; }
if (relAccFrom != "") { relStrCondition += " and ACCDATE>='" + relAccFrom.Substring(0, 7) + "' "; }
if (relAccTo != "") { relStrCondition += " and ACCDATE<='" + relAccTo.Substring(0, 7) + "' "; }
if (relETDFrom != "") { relStrCondition += " and ETD>='" + relETDFrom + " 00:00:00' "; }
if (relETDTo != "") { relStrCondition += " and ETD<='" + relETDTo + " 23:59:59' "; }
var dataList = Chfee_AuditDAL.GetBillDataList(relStrCondition, SessionUtil.Session["USERID"].ToString(), SessionUtil.Session["SHOWNAME"].ToString(), SessionUtil.Session["COMPANYID"].ToString(), "");
//var list = dataList.Skip(start).Take(limit);
string json = Newtonsoft.Json.JsonConvert.SerializeObject(dataList);
context.Response.ContentType = "text/plain";
context.Response.Write(json);
context.Response.End();
}
public bool IsReusable
{
get
{
return false;
}
}
}
}