DS7_JinGang
hanxuntao 2 years ago
commit bea67ab9f4

@ -1706,4 +1706,40 @@ namespace DSWeb.Common.DB
return firstNumberBetweenBrackets;
}
}
public static class StrHelper
{
#region 将一个dictionary转化为用;;和::隔开的文本
public static string DicToStr(Dictionary<string, string> dic)
{
var result = "";
foreach (var item in dic)
{
result += item.Key + "::" + item.Value + ";;";
}
return result;
}
#endregion
#region 将一个用;;和::隔开的文本转化为dictionary
public static Dictionary<string, string> StrToDic(string dicstr)
{
var result = new Dictionary<string, string>();
var list = Regex.Split(dicstr, ";;").ToList();
foreach (var item in list)
{
var itemarray = Regex.Split(item, "::");
if (itemarray.Length < 2) continue;
result.Add(itemarray[0], itemarray[1] == null ? "" : itemarray[1]);
}
return result;
}
#endregion
}
}

@ -2408,7 +2408,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
if (WorkFlowid == "") WorkFlowid = "no";
}
var headdata = ChpayapplicationDAL.GetData(" BILLNO='" + bill + "'", USERID, usercode, companyid);
Resultmb WorkResult = WorkFlowDAL.WorkFlowStart(WorkFlowName, bill, USERID,bill, bill,"", WorkFlowid);
@ -2445,7 +2445,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
if (result.Success) {
var _r = FanWeiOA_Submit(bill, USERID, usercode, companyid);
var _r = FanWeiOA_Submit(headdata, USERID, usercode, companyid);
if (!_r.Success)
{
@ -2455,6 +2455,14 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
return result;
}
else {
var requestid = result.Data.ToString();
var cmdupdate = db.GetSqlStringCommand("update ch_fee_payapplication set PAYAPPID='"+ requestid + "' where BILLNO=@BILLNO");
cmdupdate.Parameters.Clear();
db.AddInParameter(cmdupdate, "@BILLNO", DbType.String, bill);
db.ExecuteNonQuery(cmdupdate, tran);
}
}
tran.Commit();
}
@ -2509,11 +2517,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
try
{
var oacommitList = new List<string>();
var oacommitList = new List<ChPayapplication>();
foreach (var bill in billList)
{
var headdata = ChpayapplicationDAL.GetData(" BILLNO='" + bill + "'", USERID, usercode, companyid);
var isclose = false;
if (FEECLOSEPAYAUTOAUDIT.PARAMVALUE == "1")
{
@ -2599,7 +2607,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
result.Success = true;
result.Message = "提交审核成功";
oacommitList.Add(bill);
oacommitList.Add(headdata);
//FanWeiOA_Submit(bill, USERID, usercode, companyid);
}
@ -2613,8 +2621,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
}
foreach (var bill in oacommitList) {
var _r =FanWeiOA_Submit(bill, USERID, usercode, companyid);
foreach (var headdata in oacommitList) {
var _r =FanWeiOA_Submit(headdata, USERID, usercode, companyid);
if (!_r.Success) {
tran.Rollback();
@ -2623,6 +2631,15 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
return result;
}
else
{
var requestid = _r.Data.ToString();
var cmdupdate = db.GetSqlStringCommand("update ch_fee_payapplication set PAYAPPID='" + requestid + "' where BILLNO=@BILLNO");
cmdupdate.Parameters.Clear();
db.AddInParameter(cmdupdate, "@BILLNO", DbType.String, headdata.BILLNO);
db.ExecuteNonQuery(cmdupdate, tran);
}
}
tran.Commit();
@ -2644,11 +2661,34 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
return result;
}
/// <summary>
/// 撤回提交
/// </summary>
/// <param name="WorkFlowName"></param>
/// <param name="USERID"></param>
/// <param name="bill"></param>
/// <returns></returns>
public static DBResult SubmitAuditBack(string WorkFlowName, String USERID, String bill)
{
var result = new DBResult();
try
{
if (ConfigurationManager.AppSettings["FanWeiOAAPI"] == "true")
{
result = new DBResult();
result.Success = false;
result.Message = "现行逻辑不允许执行撤回提交!";
return result;
}
}
catch (Exception e)
{
}
finally { }
Database db = DatabaseFactory.CreateDatabase();
using (var conn = db.CreateConnection())
{
@ -2932,7 +2972,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
return result;
}
public static DBResult FanWeiOA_Submit(string bill, string userid, string usercode, string companyid)
public static DBResult FanWeiOA_Submit(ChPayapplication headdata, string userid, string usercode, string companyid)
{
var result = new DBResult();
@ -2948,7 +2988,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
{
//泛微OAHelper.GetToken();
var headdata = ChpayapplicationDAL.GetData(" BILLNO='" + bill + "'", userid, usercode, companyid);
//var headdata = ChpayapplicationDAL.GetData(" BILLNO='" + bill + "'", userid, usercode, companyid);
//var userid = Convert.ToString(Session["USERID"]);
//var usercode = Convert.ToString(Session["CODENAME"]);

@ -1216,14 +1216,9 @@ namespace DSWeb.Areas.CommMng.DAL
var cdc = new CommonDataContext();
var _user = cdc.VW_user.FirstOrDefault(x => x.USERID == userid);
//String secretUserid = rsa.encrypt(null, userid, null, "utf-8", spk, false);
//heads.put("userid", secretUserid);
//userid将会填在user.wechetaccount里面
#region 正式获取userid的逻辑
var _userid = "0";
//var _userinfo = MsSysThirdPartyAccountDAL.GetDataList($" userid='{userid}' and thirdparty='泛微OA账号'");
//if (_userinfo != null && _userinfo.Count > 0) {
// _userid = _userinfo[0].ACCOUNT;
//}
var fanweiconnstr = MsSysParamSetDAL.GetData("PARAMNAME='FanWei_DBCONN'").PARAMVALUE;
@ -1237,12 +1232,15 @@ namespace DSWeb.Areas.CommMng.DAL
result.SetErrorInfo($"用户[{_user.SHOWNAME}]在OA系统中不存在");
return result;
}
else {
else
{
_userid = fwuser[0].id.ToString();
}
var _userid_m = EncryptByPublicKey(_userid, SPK);
#endregion
//var _userid_m = EncryptByPublicKey("49", SPK);
var dic = new Dictionary<string, string> {
@ -1282,11 +1280,20 @@ namespace DSWeb.Areas.CommMng.DAL
try {
_res = JsonConvert.Deserialize<SuccessResponse>(rtn);
result.Data = _res.data.requestid;
result.OK("发送成功");
//要记录requestid
//var logicdic = new Dictionary<string, string> {
// { "requestid", _res.data.requestid }
//};
//BasicDataRefDAL.SaveLogicInfo(headdata.GID, "泛微审批", logicdic);
}
catch (Exception e) {
_res2 = JsonConvert.Deserialize<FailResponse>(rtn);
result.SetErrorInfo("发送失败:"+ _res2.errMsg.saveRequestError);
result.SetErrorInfo("发送失败:"+ _res2.errMsg.ToString());
}
@ -1319,6 +1326,7 @@ namespace DSWeb.Areas.CommMng.DAL
public class SuccessResponse : Response
{
public string code { get; set; }
/// <summary>
///
/// </summary>
@ -1326,7 +1334,11 @@ namespace DSWeb.Areas.CommMng.DAL
/// <summary>
///
/// </summary>
public string errMsg { get; set; }
public ErrMsg errMsg { get; set; }
/// <summary>
///
/// </summary>
public ReqFailMsg reqFailMsg { get; set; }
}
@ -1342,15 +1354,14 @@ namespace DSWeb.Areas.CommMng.DAL
public class Data
{
public string requestid { get; set; }
/// <summary>
///
/// </summary>
public int requestid { get; set; }
}
public class ErrMsg
{
/// <summary>
/// 流程保存失败
/// </summary>
public string saveRequestError { get; set; }
}
public class KeyParameters
@ -1363,6 +1374,10 @@ namespace DSWeb.Areas.CommMng.DAL
public class OtherParams
{
/// <summary>
///
/// </summary>
public string doAutoApprove { get; set; }
}
public class ReqFailMsg
@ -1378,15 +1393,10 @@ namespace DSWeb.Areas.CommMng.DAL
/// <summary>
///
/// </summary>
public string msgType { get; set; }
/// <summary>
///
/// </summary>
public OtherParams otherParams { get; set; }
}
}
#endregion

@ -21,20 +21,22 @@ namespace JobReqWebData
{
try
{
string connStr = context.JobDetail.JobDataMap.GetString("ConnectString");
string OAconnStr = context.JobDetail.JobDataMap.GetString("ConnectString");
string DS7connStr = context.JobDetail.JobDataMap.GetString("DS7ConnectString");
int reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout"));
var dc1 = new CommonDataContext(connStr);
var dc1 = new OtherDB(OAconnStr);
var cdc = new CommonDataContext(DS7connStr);
//从cdc中寻找待读取审核结果的业务
//var 待审核付费申请List = cdc.ch_fee_p
//从dc1中寻找这些id的业务的审核结果
//将审核完成的更新至cdc中的业务中
//update ch_fee_payapplication set BILLSTATUS=0,AUDITUSER='" + USERID + "',AUDITTIME='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' where BILLNO=@BILLNO");
}
catch (Exception ex)
{

Loading…
Cancel
Save