|
|
|
@ -2,12 +2,14 @@
|
|
|
|
|
using DSWeb.Common.DB;
|
|
|
|
|
using DSWeb.Common.Helper;
|
|
|
|
|
using log4net;
|
|
|
|
|
using log4net.Repository.Hierarchy;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using Quartz;
|
|
|
|
|
using RabbitMQ.Client;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Runtime.Caching;
|
|
|
|
@ -32,10 +34,14 @@ namespace DSWeb.Service.Output
|
|
|
|
|
|
|
|
|
|
public void Execute(IJobExecutionContext context)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//int reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout"));
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
log.Debug("Execute start");
|
|
|
|
|
//int reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout"));
|
|
|
|
|
|
|
|
|
|
int reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout"));
|
|
|
|
|
|
|
|
|
|
var dc1 = new OtherDB(OAconnStr);
|
|
|
|
|
|
|
|
|
@ -48,7 +54,7 @@ namespace DSWeb.Service.Output
|
|
|
|
|
|
|
|
|
|
var idList = 待审核付费申请List.Select(s => s.PAYAPPID).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.Info(idList.ToList());
|
|
|
|
|
//从dc1中寻找这些id的业务的审核结果
|
|
|
|
|
var 审核结果List = dc1.view_pjrequestbas.Where(x => x.workflowid == 79 && x.currentnodetype == "3" && idList.Contains(x.requestid.ToString())).ToList();
|
|
|
|
|
|
|
|
|
@ -59,8 +65,10 @@ namespace DSWeb.Service.Output
|
|
|
|
|
SetAudit(dc1, cdc, DS7URL, item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//将审核完成的更新至cdc中的业务中
|
|
|
|
|
//update ch_fee_payapplication set BILLSTATUS=0,AUDITUSER='" + USERID + "',AUDITTIME='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' where BILLNO=@BILLNO");
|
|
|
|
|
log.Debug("Execute end");
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -70,14 +78,42 @@ namespace DSWeb.Service.Output
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SetAudit(OtherDB dc1, CommonDataContext cdc, string DS7URL, view_pjrequestbas_md Audititem)
|
|
|
|
|
public void DoWork()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//根据oa系统的userid查找ds7系统的userid
|
|
|
|
|
var dc1 = new OtherDB(OAconnStr);
|
|
|
|
|
|
|
|
|
|
var cdc = new CommonDataContext(DS7connStr);
|
|
|
|
|
|
|
|
|
|
//从cdc中寻找待读取审核结果的业务
|
|
|
|
|
var 待审核付费申请List = cdc.ch_fee_payapplication.Where(x => x.BILLSTATUS == 2 && x.PAYAPPID != null && x.PAYAPPID != "").ToList();
|
|
|
|
|
|
|
|
|
|
if (待审核付费申请List == null || 待审核付费申请List.Count <= 0) return;
|
|
|
|
|
|
|
|
|
|
var idList = 待审核付费申请List.Select(s => s.PAYAPPID).ToList();
|
|
|
|
|
|
|
|
|
|
log.Debug(idList.ToList());
|
|
|
|
|
|
|
|
|
|
//从dc1中寻找这些id的业务的审核结果
|
|
|
|
|
var 审核结果List = dc1.view_pjrequestbas.Where(x => x.workflowid == 79 && x.currentnodetype == "3" && idList.Contains(x.requestid.ToString())).ToList();
|
|
|
|
|
|
|
|
|
|
//var AuditGidlistStr = "";
|
|
|
|
|
|
|
|
|
|
foreach (var item in 审核结果List)
|
|
|
|
|
{
|
|
|
|
|
SetAudit(dc1, cdc, DS7URL, item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private void SetAudit(OtherDB dc1, CommonDataContext cdc, string DS7URL, view_pjrequestbas_md Audititem)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
//根据oa系统的userid查找ds7系统的userid
|
|
|
|
|
log.Debug("audit start");
|
|
|
|
|
var OAUser = dc1.view_hrmresource.FirstOrDefault(x => x.id == Audititem.lastoperator);
|
|
|
|
|
|
|
|
|
|
var ds7user = cdc.VW_user.Where(x => x.SHOWNAME == OAUser.lastname).ToList();
|
|
|
|
|
var ds7user = cdc.VW_user.Where(x => x.SHOWNAME.Replace(" ","") == OAUser.lastname).ToList();
|
|
|
|
|
|
|
|
|
|
//var ds7user = cdc.VW_user.Where(x => x.SHOWNAME == "系统管理员").ToList();
|
|
|
|
|
|
|
|
|
@ -94,6 +130,11 @@ namespace DSWeb.Service.Output
|
|
|
|
|
|
|
|
|
|
log.Debug("rtn=" + rtn);
|
|
|
|
|
}
|
|
|
|
|
log.Debug("audit end");
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e) {
|
|
|
|
|
log.Error(e.Message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|