荣圣达泛微OA,防止重复提交修改

DS7_HYRD
ddlucky 1 year ago
parent 396a44de2e
commit cf26e6aaff

@ -47,6 +47,78 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
strCondition = rangstr;
}
}
return Do_GetDataList(start, limit, strCondition, sort, lan);
//var strSql = new StringBuilder();
//strSql.Append(@"SELECT * from (SELECT row_number() over (");
//var sortstring = DatasetSort.Getsortstring(sort);
//if (!string.IsNullOrEmpty(sortstring))
//{
// sortstring = sortstring.Replace("APPLICANTNAME", "(select ShowName from [user] where GID=cm.APPLICANT)");
// sortstring = sortstring.Replace("SETTLETYPEREF", "(select STLNAME from [code_stlmode] where STLCODE=cm.SETTLETYPE)");
// sortstring = sortstring.Replace("RMBDOAMOUNT", "(select SUM(CASE FEETYPE WHEN 1 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do where CURRENCY='RMB' AND BILLNO=cm.BILLNO)");
// sortstring = sortstring.Replace("USDDOAMOUNT", "(select SUM(CASE FEETYPE WHEN 1 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do where CURRENCY='USD' AND BILLNO=cm.BILLNO)");
// sortstring = sortstring.Replace("SALECORP", "cm.SALECORPID");
// sortstring = sortstring.Replace("APPLICANTDEPT", "(select DEPTNAME from VW_user where userid=cm.APPLICANT)");
// sortstring = sortstring.Replace("BILLSTATUSREF", "BILLSTATUS");
// strSql.Append(" order by " + sortstring);
//}
//else
//{
// strSql.Append(" order by APPLYTIME DESC");
//}
//strSql.Append(@") as num , ");
//strSql.Append(" GID,BILLNO,BILLSTATUS,CUSTOMERNAME,CURR,CHEQUEPAYABLE,SETTLETYPE,PAYTYPE");
//strSql.Append(" ,PAYABLETIME,AMOUNTRMB,RATE,AMOUNTUSD,AMOUNTOT,SETTLERMB,SETTLEUSD,SETTLEOT,SETTLERATE");
//strSql.Append(" ,APPLICANT,APPLYTIME,ENTERTIME,SETTLEUSER,SETTLETIME,AUDITUSER,AUDITTIME ");
//strSql.Append(" ,REMARK,COMPANYID,ISAPP,PAYAPPID,CHEQUENUMREMARK,INVDATE,INVNO,INVOICEAMOUNT, ");
//if (lan == "en-us") {
// strSql.Append("(select EnumValueName_2 from tSysEnumValue where LangId=0 and EnumTypeID=97005 and EnumValueID=cm.BILLSTATUS) as BILLSTATUSREF");
//}
//else
// strSql.Append("(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=97005 and EnumValueID=cm.BILLSTATUS) as BILLSTATUSREF");
//strSql.Append(",(select ShowName from [user] where GID=cm.APPLICANT) as APPLICANTNAME");
//strSql.Append(",(select DEPTNAME from VW_user where userid=cm.APPLICANT) as APPLICANTDEPT");
//strSql.Append(",(select ShowName from [user] where GID=cm.AUDITUSER) as AUDITUSERREF");
//if (lan == "en-us")
//{
// strSql.Append(",(select ENAME from [code_stlmode] where STLCODE=cm.SETTLETYPE) as SETTLETYPEREF");
//}
//else
// strSql.Append(",(select STLNAME from [code_stlmode] where STLCODE=cm.SETTLETYPE) as SETTLETYPEREF");
//strSql.Append(",CUSTACCOUNTGID,cm.REASON,AUDITREMARK");
//strSql.Append(",(select SUM(CASE FEETYPE WHEN 1 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do WITH (NOLOCK) where CURRENCY='RMB' AND BILLNO=cm.BILLNO AND CATEGORY=4) as RMBDOAMOUNT ");
//strSql.Append(",(select SUM(CASE FEETYPE WHEN 1 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do WITH (NOLOCK) where CURRENCY='USD' AND BILLNO=cm.BILLNO AND CATEGORY=4) as USDDOAMOUNT ");
//strSql.Append(",(select SUM(CASE FEETYPE WHEN 1 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do WITH (NOLOCK) where CURRENCY!='RMB' AND CURRENCY!='USD' AND BILLNO=cm.BILLNO AND CATEGORY=4) as OTDOAMOUNT ");
//strSql.Append(",(select CODENAME+'_'+bankname from info_client_bank where gid=cm.CUSTACCOUNTGID) CUSTBANKNAME");
//strSql.Append(",(select ACCOUNT from info_client_bank where gid=cm.CUSTACCOUNTGID) CUSTACCOUNT");
//strSql.Append(",ISNULL((select sum(isnull(amount,0)-isnull(invoice,0)) as noinvoice from ch_fee WITH (NOLOCK) where isnull(ISINVOICE,0)<>1 and EXISTS (select 1 from ch_fee_do WITH (NOLOCK) where ch_fee_do.FEEID=ch_fee.gid and ch_fee_do.BILLNO=cm.BILLNO)),0) as NOINVOICE");
//strSql.Append(",cm.BS_CUSTOMERNAME,0 IsAudit,PREAMOUNTRMB,PREAMOUNTUSD,PREAMOUNTOT ");
//strSql.Append(",dbo.GetStlByPayNo(cm.BILLNO) as BALBILLNO,cm.ISPRINT,cm.PRINTCOUNT,wxpush,STLRATE,STLAMOUNT,STLCURR,ISREVINV ");
//strSql.Append(",cm.SALECORPID,(select [NAME] from [company] where GID=cm.SALECORPID) as SALECORP");
//strSql.Append(",(select DESCRIPTION from info_client where SHORTNAME=cm.CUSTOMERNAME) as CUSTOMERFULLNAME");
//strSql.Append(" FROM ch_fee_payapplication cm where 1=1 ");
//if (!string.IsNullOrEmpty(strCondition))
//{
// strSql.Append(" and " + strCondition);
//}
//strSql.Append(@")as t ");
//strSql.Append(string.Format("where t.num>{0} and t.num<={1} order by t.num ", start, start + limit)); //
//return SetData(strSql);
}
static public List<ChPayapplication> Do_GetDataList(int start, int limit, string strCondition, string sort = null, string lan = "")
{
var strSql = new StringBuilder();
strSql.Append(@"SELECT * from (SELECT row_number() over (");
var sortstring = DatasetSort.Getsortstring(sort);
@ -75,11 +147,12 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
strSql.Append(" ,PAYABLETIME,AMOUNTRMB,RATE,AMOUNTUSD,AMOUNTOT,SETTLERMB,SETTLEUSD,SETTLEOT,SETTLERATE");
strSql.Append(" ,APPLICANT,APPLYTIME,ENTERTIME,SETTLEUSER,SETTLETIME,AUDITUSER,AUDITTIME ");
strSql.Append(" ,REMARK,COMPANYID,ISAPP,PAYAPPID,CHEQUENUMREMARK,INVDATE,INVNO,INVOICEAMOUNT, ");
if (lan == "en-us") {
if (lan == "en-us")
{
strSql.Append("(select EnumValueName_2 from tSysEnumValue where LangId=0 and EnumTypeID=97005 and EnumValueID=cm.BILLSTATUS) as BILLSTATUSREF");
}
else
strSql.Append("(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=97005 and EnumValueID=cm.BILLSTATUS) as BILLSTATUSREF");
else
strSql.Append("(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=97005 and EnumValueID=cm.BILLSTATUS) as BILLSTATUSREF");
strSql.Append(",(select ShowName from [user] where GID=cm.APPLICANT) as APPLICANTNAME");
strSql.Append(",(select DEPTNAME from VW_user where userid=cm.APPLICANT) as APPLICANTDEPT");
strSql.Append(",(select ShowName from [user] where GID=cm.AUDITUSER) as AUDITUSERREF");
@ -87,7 +160,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
{
strSql.Append(",(select ENAME from [code_stlmode] where STLCODE=cm.SETTLETYPE) as SETTLETYPEREF");
}
else
else
strSql.Append(",(select STLNAME from [code_stlmode] where STLCODE=cm.SETTLETYPE) as SETTLETYPEREF");
strSql.Append(",CUSTACCOUNTGID,cm.REASON,AUDITREMARK");
strSql.Append(",(select SUM(CASE FEETYPE WHEN 1 THEN -DOAMOUNT ELSE DOAMOUNT END) from ch_fee_do WITH (NOLOCK) where CURRENCY='RMB' AND BILLNO=cm.BILLNO AND CATEGORY=4) as RMBDOAMOUNT ");
@ -159,6 +232,15 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
return new ChPayapplication();
}
static public ChPayapplication GetData_All(string condition)
{
var list = Do_GetDataList(0, 1, condition);
if (list.Count > 0)
return list[0];
return new ChPayapplication();
}
#region 付费审核列表
static public List<ChPayapplication> GetAuditDataList(string strCondition, string userid, string isaudit, string usercode, string orgcode, string sort = null, string lan = "")

@ -1010,7 +1010,9 @@ namespace DSWeb.Areas.CommMng.DAL
//var cdc = new CommonDataContext();
//var currHead = cdc.ch_fee_payapplication.First(x => x.BILLNO == headdata.BILLNO);
if (!string.IsNullOrWhiteSpace(headdata.PAYAPPID))
var currHead = ChpayapplicationDAL.GetData_All($" cm.billno={headdata.BILLNO}");
if (!string.IsNullOrWhiteSpace(currHead.PAYAPPID))
{
result.SetErrorInfo("业务已经提交至泛微OA");
OAHelper.BILLDONE(headdata.BILLNO);
@ -1482,11 +1484,7 @@ namespace DSWeb.Areas.CommMng.DAL
var _res2 = new FailResponse();
try
{
var cansend = CanSend(headdata);
if (!cansend.Success) {
return cansend;
}
GetUrl();
@ -1639,6 +1637,13 @@ namespace DSWeb.Areas.CommMng.DAL
};
}
var cansend = CanSend(headdata);
if (!cansend.Success)
{
return cansend;
}
//var jsonstr=JsonConvert.Serialize(sendobj).Replace("\r\n","");
BasicDataRefDAL.SaveLog("url:" + Url + "dic" + JsonConvert.Serialize(dic) + "valuedic" + JsonConvert.Serialize(valuedic)
,"","泛微OA","发送"

Loading…
Cancel
Save