From 1bccf9a83259e3fd642cfca17b396006d61d3629 Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期二, 26 十一月 2024 14:01:05 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/数据同步/钉钉同步/DD_DataSynchronizationController.cs | 525 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 524 insertions(+), 1 deletions(-)
diff --git "a/WebAPI/Controllers/\346\225\260\346\215\256\345\220\214\346\255\245/\351\222\211\351\222\211\345\220\214\346\255\245/DD_DataSynchronizationController.cs" "b/WebAPI/Controllers/\346\225\260\346\215\256\345\220\214\346\255\245/\351\222\211\351\222\211\345\220\214\346\255\245/DD_DataSynchronizationController.cs"
index e4a1e66..7dbfc38 100644
--- "a/WebAPI/Controllers/\346\225\260\346\215\256\345\220\214\346\255\245/\351\222\211\351\222\211\345\220\214\346\255\245/DD_DataSynchronizationController.cs"
+++ "b/WebAPI/Controllers/\346\225\260\346\215\256\345\220\214\346\255\245/\351\222\211\351\222\211\345\220\214\346\255\245/DD_DataSynchronizationController.cs"
@@ -17,6 +17,8 @@
using DingTalk.Api.Response;
using System.Globalization;
using System.Linq;
+using AlibabaCloud.SDK.Dingtalkworkflow_1_0.Models;
+using System.Text.RegularExpressions;
namespace WebAPI.Controllers
{
@@ -85,6 +87,13 @@
public long? TotalCount;
public long? PageNumber;
public List<string> Data;
+ }
+ //oa瀹℃壒杩斿洖绫�
+ public class OA_GetInstanceIDListResponse
+ {
+ public List<string> list;//鑾峰彇鐨刬d鍒楄〃
+ public string nextToken;
+ public bool? success;
}
#region 鍒嗗眰瀹℃牳绛惧埌琛�
@@ -358,8 +367,83 @@
public List<Sc_MouldRepairWorkBillSub> DetailColMouldRepair = new List<Sc_MouldRepairWorkBillSub>();
}
-
+
#endregion
+
+ #region 寮傚父宸ユ椂鐢宠鍗�
+
+ #region 涓昏〃+瀛愯〃
+ public class Pay_ErrWorkTimesRequestBill
+ {
+ public int HInterID;
+ public string HBillNo;
+ public string HDate;
+ public string HInnerBillNo;
+ public int HDeptID;
+ public string HDeptName;
+ public int HGroupID;
+ public string HGroupName;
+ public int HMangerID;
+ public string HManagerName;
+ public int HICMOInterID;
+ public string HICMOBillNo;
+ public string HExplanation;
+ public double HSumRequestTimes;
+ public int HMaterID;
+ public string HMaterName;
+ public int HUnitID;
+ public string HUnitName;
+ public double HPlanQty;
+ public string HBatchNo;
+ public string HRemark;
+
+ public string HMaker;
+ public string HMakerDate;
+ public string HUpdater;
+ public string HUpdaterDate;
+ public string HChecker;
+ public string HCheckerDate;
+ public string HCloseMan;
+ public string HCloseManDate;
+ public string HDeleteMan;
+ public string HDeleteManDate;
+ public string HBacker;
+ public string HBackerDate;
+ public string HBackRemark;
+ public List<Pay_ErrWorkTimesRequestBillSub> Pay_ErrWorkTimesRequestBillSub = new List<Pay_ErrWorkTimesRequestBillSub>();
+ }
+ #endregion
+
+ #region 瀛愯〃
+ public class Pay_ErrWorkTimesRequestBillSub
+ {
+ public int HEmpID;
+ public string HEmpNumber;
+ public string HEmpName;
+ public int HWorkTypeID;
+ public string HWorkTypeNumber;
+ public string HWorkTypeName;
+ public double HPayMoney;
+ public string HBTimes;
+ public string HETimes;
+ public double HTimes;
+ public double HRelTimes;
+ public double HRelPay;
+ public string HRemark;
+
+ public int HSourceInterID;
+ public int HSourceEntryID;
+ public string HSourceBillNo;
+ public string HSourceBillType;
+ public double HRelationQty;
+ public double HRelationMoney;
+ public string HCloseMan;
+ public string HEntryCloseDate;
+ }
+ #endregion
+
+ #endregion
+
#endregion
#region 閽夐拤 閫氱敤鎿嶄綔鏂规硶
@@ -722,6 +806,145 @@
}
}
#endregion
+ #endregion
+
+ #region oa 閫氱敤鎿嶄綔鏂规硶
+
+ #region OA 鑾峰彇瀹℃壒瀹炰緥ID鍒楄〃(鍗曢〉)
+ public bool getInstanceIDList_Page_OA(string processCode,DateTime startTime, DateTime endTime,long nextToken, int maxResult, List<string> statuses, ref OA_GetInstanceIDListResponse response, ref string msg)
+ {
+ AlibabaCloud.SDK.Dingtalkworkflow_1_0.Client client = CreateClient1();
+ AlibabaCloud.SDK.Dingtalkworkflow_1_0.Models.ListProcessInstanceIdsHeaders listProcessInstanceIdsHeaders = new AlibabaCloud.SDK.Dingtalkworkflow_1_0.Models.ListProcessInstanceIdsHeaders();
+ listProcessInstanceIdsHeaders.XAcsDingtalkAccessToken = this.accessToken;
+ AlibabaCloud.SDK.Dingtalkworkflow_1_0.Models.ListProcessInstanceIdsRequest listProcessInstanceIdsRequest = new AlibabaCloud.SDK.Dingtalkworkflow_1_0.Models.ListProcessInstanceIdsRequest
+ {
+ Statuses = statuses,
+ StartTime = getTimeMillions(startTime),
+ EndTime = getTimeMillions(endTime),
+ ProcessCode = processCode,
+ NextToken = nextToken,
+ MaxResults = maxResult,
+ };
+ try
+ {
+ ListProcessInstanceIdsResponse listProcessInstanceIdsResponse = client.ListProcessInstanceIdsWithOptions(listProcessInstanceIdsRequest, listProcessInstanceIdsHeaders, new AlibabaCloud.TeaUtil.Models.RuntimeOptions());
+ response.success = listProcessInstanceIdsResponse.Body.Success;
+ response.list = listProcessInstanceIdsResponse.Body.Result.List;
+ response.nextToken = listProcessInstanceIdsResponse.Body.Result.NextToken;
+ return true;
+ }
+ catch (TeaException err)
+ {
+ if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message))
+ {
+ // err 涓惈鏈� code 鍜� message 灞炴�э紝鍙府鍔╁紑鍙戝畾浣嶉棶棰�
+ }
+ msg = "閿欒浠g爜" + err.Code + "锛�" + err.Message;
+ return false;
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message))
+ {
+ // err 涓惈鏈� code 鍜� message 灞炴�э紝鍙府鍔╁紑鍙戝畾浣嶉棶棰�
+ }
+ msg = "閿欒浠g爜" + err.Code + "锛�" + err.Message;
+ return false;
+ }
+ }
+ #endregion
+
+ #region 鑾峰彇 OA鎸囧畾鍗曟嵁鐨勫疄渚婭D鍒楄〃(鍏ㄩ儴)
+ public bool getInstanceIDList_OA(string processCode, DateTime startTime, DateTime endTime, long nextToken, int maxResult, List<string> statuses, ref List<string> IDList, ref string msg)
+ {
+ OA_GetInstanceIDListResponse response = new OA_GetInstanceIDListResponse();
+ response.nextToken = nextToken.ToString();//璧嬪�煎垵濮嬪��
+ do
+ {
+ nextToken = long.Parse(response.nextToken);
+ if (getInstanceIDList_Page_OA(processCode, startTime, endTime, nextToken, maxResult, statuses,ref response, ref msg) == false)
+ {
+ return false;
+ }
+
+ for (int i = 0; i < response.list.Count; i++)
+ {
+ IDList.Add(response.list[i]);
+ }
+
+ } while (response.nextToken!=null);
+ return true;
+ }
+ #endregion
+
+ #region 鑾峰彇 OA 鏍规嵁瀹炰緥ID鑾峰彇瀹炰緥璇︽儏
+ public bool getInstanceDetailByInstanceID_OA(string processinstanceID,ref GetProcessInstanceResponse response, ref string msg)
+ {
+ AlibabaCloud.SDK.Dingtalkworkflow_1_0.Client client = CreateClient1();
+ AlibabaCloud.SDK.Dingtalkworkflow_1_0.Models.GetProcessInstanceHeaders getProcessInstanceHeaders = new AlibabaCloud.SDK.Dingtalkworkflow_1_0.Models.GetProcessInstanceHeaders();
+ getProcessInstanceHeaders.XAcsDingtalkAccessToken = this.accessToken;
+ AlibabaCloud.SDK.Dingtalkworkflow_1_0.Models.GetProcessInstanceRequest getProcessInstanceRequest = new AlibabaCloud.SDK.Dingtalkworkflow_1_0.Models.GetProcessInstanceRequest
+ {
+ ProcessInstanceId = processinstanceID,
+ };
+ try
+ {
+ response = client.GetProcessInstanceWithOptions(getProcessInstanceRequest, getProcessInstanceHeaders, new AlibabaCloud.TeaUtil.Models.RuntimeOptions());
+ return true;
+ }
+ catch (TeaException err)
+ {
+ if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message))
+ {
+ // err 涓惈鏈� code 鍜� message 灞炴�э紝鍙府鍔╁紑鍙戝畾浣嶉棶棰�
+ }
+ msg = "閿欒浠g爜" + err.Code + "锛�" + err.Message;
+ return false;
+ }
+ catch (Exception _err)
+ {
+ TeaException err = new TeaException(new Dictionary<string, object>
+ {
+ { "message", _err.Message }
+ });
+ if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message))
+ {
+ // err 涓惈鏈� code 鍜� message 灞炴�э紝鍙府鍔╁紑鍙戝畾浣嶉棶棰�
+ }
+ msg = "閿欒浠g爜" + err.Code + "锛�" + err.Message;
+ return false;
+ }
+ }
+ #endregion
+
+ #region 鑾峰彇 OA 鏍规嵁瀹炰緥ID鍒楄〃鑾峰彇瀹炰緥璇︽儏鍒楄〃
+ public bool getInstanceDetailListByInstanceIDList_OA(List<string> processinstanceIDList, ref List<GetProcessInstanceResponse> responseList, ref string msg)
+ {
+ GetProcessInstanceResponse getProcessInstanceResponse = new GetProcessInstanceResponse();
+ try
+ {
+ foreach(string processinstanceID in processinstanceIDList)
+ {
+ if(!getInstanceDetailByInstanceID_OA(processinstanceID,ref getProcessInstanceResponse,ref msg))
+ {
+ return false;
+ }
+ responseList.Add(getProcessInstanceResponse);
+ }
+ return true;
+ }
+ catch (Exception e)
+ {
+ msg = e.Message;
+ return false;
+ }
+ }
+ #endregion
+
#endregion
#region 鏁版嵁鍚屾鏂规硶
@@ -2857,6 +3080,272 @@
#endregion
#endregion
+ #region 鏁版嵁鍚屾-寮傚父宸ユ椂鍗昈A閲岃幏鍙�
+
+ #region 绫诲瀷杞崲鎻愬彇response涓殑value瀵硅薄
+ public class StatValue
+ {
+ public string Id { get; set; }
+ public string Label { get; set; }
+ public string Upper { get; set; }
+ public string Num { get; set; }
+ }
+
+ public class ExtValue
+ {
+ public List<StatValue> StatValue { get; set; }
+ public string ComponentName { get; set; }
+ }
+ public class RowValue
+ {
+ public string Label { get; set; }
+ public object Value { get; set; }
+ public string Key { get; set; }
+ // 娉ㄦ剰锛氳繖閲屼笉瀹氫箟extendValue灞炴�э紝鍥犱负鎴戜滑涓嶉渶瑕佸畠
+ // public SomeType ExtendValue { get; set; } // 濡傛灉闇�瑕侊紝鍙互娉ㄩ噴鎺夋垨鍒犻櫎杩欒
+ }
+ public class Row
+ {
+ public List<RowValue> RowValue { get; set; }
+ public string RowNumber { get; set; }
+ // 娉ㄦ剰锛氳繖閲屽亣璁句綘涓嶉渶瑕乧omponentName锛屽洜涓篔SON绀轰緥涓病鏈夌洿鎺ュ寘鍚畠
+ // 浣嗗鏋滀綘鐨勫疄闄匤SON鎴栭渶姹備腑鍖呭惈锛屼綘搴旇娣诲姞杩欎釜灞炴��
+ // public string ComponentName { get; set; }
+ }
+ #endregion
+
+
+ #region OA寮傚父宸ユ椂鐢宠鍗� 瀹炰緥ID鍒楄〃瀵瑰簲鐨勫疄渚嬭鎯�
+ public bool getInstanceDetailList___ErrWorkTimesRequest_OA(List<string> processinstanceIDList, DateTime startTime, DateTime endTime, ref List<Pay_ErrWorkTimesRequestBill> lsmain,ref string msg)
+ {
+ try
+ {
+ List<GetProcessInstanceResponse> getProcessInstanceResponses = new List<GetProcessInstanceResponse>();
+ //鑾峰彇閽夐拤response
+ if (getInstanceDetailListByInstanceIDList_OA(processinstanceIDList,ref getProcessInstanceResponses,ref msg)==false)
+ {
+ return false;
+ }
+ foreach(GetProcessInstanceResponse getProcessInstanceResponse in getProcessInstanceResponses)
+ {
+ Pay_ErrWorkTimesRequestBill oItem = new Pay_ErrWorkTimesRequestBill();
+ //涓昏〃
+ oItem.HDate = getProcessInstanceResponse.Body.Result.FormComponentValues[1].Value;//鍗曟嵁鏃ユ湡璁℃椂鏃堕棿
+ DateTime dateTime1 = DateTime.ParseExact(oItem.HDate + " 00:00:00", "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
+ if (!(DateTime.Compare(dateTime1, startTime)>=0&& DateTime.Compare(dateTime1, endTime) <= 0))//鎺у埗鏃堕棿
+ {
+ continue;
+ }
+ string[] deptNameAndGroupName = getProcessInstanceResponse.Body.Result.OriginatorDeptName.Split('-');//鑾峰彇閮ㄩ棬鎷兼帴瀛楃涓叉暟缁�
+ oItem.HDeptName = deptNameAndGroupName[1];
+ oItem.HGroupName = deptNameAndGroupName[deptNameAndGroupName.Length-1];
+ //涓荤-璐熻矗浜�
+ string HManagerValue = getProcessInstanceResponse.Body.Result.FormComponentValues[9].Value;//鑾峰彇鐨勫悕瀛楀惈鍚庣紑鑻辨枃
+ string pattern = @"[\u4e00-\u9fff]+"; // 涓枃瀛楃鐨刄nicode鑼冨洿
+
+ MatchCollection matches = Regex.Matches(HManagerValue, pattern);
+
+ // 鍒涘缓涓�涓猄tringBuilder鏉ユ嫾鎺ユ墍鏈夊尮閰嶇殑涓枃瀛楃
+ System.Text.StringBuilder chineseChars = new System.Text.StringBuilder();
+ foreach (Match match in matches)
+ {
+ chineseChars.Append(match.Value);
+ }
+ string HManagerName = chineseChars.ToString();
+ DataSet ds = oCN.RunProcReturn("select * from Gy_Employee with(nolock) where HName='" + HManagerName + "'", "Gy_Employee");
+ string HMangerID = "0";
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ HMangerID = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ oItem.HMangerID = int.Parse(HMangerID);
+ //澶勭悊閮ㄩ棬鍜岀彮缁勫悕绉癷d
+ ds = oCN.RunProcReturn("select * from Gy_Department with(nolock) where HName='" + oItem.HDeptName + "'", "Gy_Department");
+ string HDeptID = "0";
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ HDeptID = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ oItem.HDeptID = int.Parse(HDeptID);
+ ds = oCN.RunProcReturn("select * from Gy_Group with(nolock) where HName='" + oItem.HGroupName + "'", "Gy_Group");
+ string HGroupID = "0";
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ HGroupID = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ oItem.HGroupID = int.Parse(HGroupID);
+
+ //鍙嶅簭鍒楀寲鏄庣粏鍐呭
+ string tableFieldValue = getProcessInstanceResponse.Body.Result.FormComponentValues[11].Value;
+ List<Row> rows = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Row>>(tableFieldValue);
+ ExtValue extValue = Newtonsoft.Json.JsonConvert.DeserializeObject<ExtValue>(getProcessInstanceResponse.Body.Result.FormComponentValues[11].ExtValue);
+ oItem.HBatchNo = rows[0].RowValue[1].Value.ToString();//鎵规鍙�-璁㈠崟鍙风爜
+ //浠诲姟鎻忚堪-浠诲姟绫诲瀷+宸ヤ綔鍐呭
+ oItem.HExplanation = getProcessInstanceResponse.Body.Result.FormComponentValues[2].Value + "-" + rows[0].RowValue[0].Value;
+ oItem.HSumRequestTimes = double.Parse(extValue.StatValue[1].Num);//鎬绘椂闀�
+ oItem.HPlanQty = 0;//璁″垝鏁伴噺
+ oItem.HRemark = "閽夐拤瀵煎叆" + getProcessInstanceResponse.Body.Result.Title;//澶囨敞
+ //寰幆閬嶅巻鑾峰彇鑱屽憳鍚嶇Оid锛屽伐鏃�
+ for (int i = 0; i < rows.Count; i++)
+ {
+ string[] nameArray = rows[i].RowValue[4].Value.ToString().Split(',');//鑾峰彇姣忎釜浜虹殑浜哄悕
+ oItem.HPlanQty += double.Parse(rows[i].RowValue[2].Value.ToString());//璁″垝鏁伴噺
+ for (int j = 0; j < int.Parse(rows[i].RowValue[5].Value.ToString()); j++)
+ {
+ Pay_ErrWorkTimesRequestBillSub pay_ErrWorkTimesRequestBillSub = new Pay_ErrWorkTimesRequestBillSub();
+ ds = oCN.RunProcReturn("select * from Gy_Employee with(nolock) where HName='" + nameArray[j] + "'", "Gy_Employee");
+ string HEmpID = "0";
+ //璁剧疆瀛愯〃鑱屽憳id鍚嶇О
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ HEmpID = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ pay_ErrWorkTimesRequestBillSub.HEmpName = nameArray[j];
+ pay_ErrWorkTimesRequestBillSub.HEmpID = int.Parse(HEmpID);
+ pay_ErrWorkTimesRequestBillSub.HRelTimes = double.Parse(rows[i].RowValue[6].Value.ToString());
+ pay_ErrWorkTimesRequestBillSub.HTimes = double.Parse(rows[i].RowValue[6].Value.ToString());
+ pay_ErrWorkTimesRequestBillSub.HRelPay = double.Parse(rows[i].RowValue[10].Value.ToString());
+ pay_ErrWorkTimesRequestBillSub.HPayMoney = pay_ErrWorkTimesRequestBillSub.HRelPay / pay_ErrWorkTimesRequestBillSub.HTimes;
+ pay_ErrWorkTimesRequestBillSub.HRemark = "閽夐拤瀵煎叆";
+ oItem.Pay_ErrWorkTimesRequestBillSub.Add(pay_ErrWorkTimesRequestBillSub);
+
+ }
+ }
+ lsmain.Add(oItem);
+ }
+ return true;
+ }catch(Exception e)
+ {
+ msg = e.Message;
+ return false;
+ }
+
+ }
+ #endregion
+
+ #region 鏁版嵁鍚屾
+ public bool getData_ErrWorkTimesRequest(DateTime startTime, DateTime endTime,ref string msg)
+ {
+ string processCode = "PROC-21371550-FEF1-4EDD-A827-639746E22E43";
+ long nextToken = 1;
+ int maxResult = 20;//鏈�澶�20
+ List<string> statues = new List<string>{"COMPLETED"};
+ this.AppKey = "ding7miekiaqn4rc2ert";
+ this.AppSecret = "81qMrC5SvkgjT9t2A3wUyEEENzyl9jJLeXOpjv2SNULc_HSlFZF4NE21YFCXik4K";
+ getAccessToken();//璁剧疆accessToken
+ //鑾峰彇宸ユ椂鐢宠鐨勫疄渚婭D鍒楄〃
+ List<string> IDList = new List<string>();
+ if (getInstanceIDList_OA(processCode,startTime,endTime,nextToken,maxResult,statues,ref IDList, ref msg) == false)
+ {
+ return false;
+ }
+ //鑾峰彇璇︾粏淇℃伅骞堕檮鍔犲埌鍒楄〃lsmain涓�
+ List<Pay_ErrWorkTimesRequestBill> lsmain = new List<Pay_ErrWorkTimesRequestBill>();
+ if (getInstanceDetailList___ErrWorkTimesRequest_OA(IDList,startTime,endTime, ref lsmain, ref msg) == false)
+ {
+ return false;
+ }
+ try
+ {
+ oCN.BeginTran();
+ //鍒犻櫎鏃堕棿鑼冨洿鍐呯殑瀵煎叆鍗曟嵁
+ DataSet dataSet = oCN.RunProcReturn(@"select HInterID from Pay_ErrWorkTimesRequestBillMain a with(nolock) where a.HRemark like '%閽夐拤瀵煎叆%' and HDate >= '" + startTime + "' and HDate<='" + endTime + "'", "Pay_ErrWorkTimesRequestBillMain");
+ if(dataSet != null && dataSet.Tables[0].Rows.Count > 0)
+ {
+ foreach (DataRow row in dataSet.Tables[0].Rows)
+ {
+ int HInterID = row.Field<int>("HInterID");
+ oCN.RunProc(@"Delete From Pay_ErrWorkTimesRequestBillMain where HInterID = " + HInterID);
+ oCN.RunProc(@"Delete From Pay_ErrWorkTimesRequestBillSub where HInterID = " + HInterID);
+ }
+ }
+ //鎻掑叆鏁版嵁
+ foreach(Pay_ErrWorkTimesRequestBill oItem in lsmain)
+ {
+ if (oItem.Pay_ErrWorkTimesRequestBillSub.Count != 0)
+ {
+ string HBillType = "2231";
+ long HInterID = DBUtility.ClsPub.CreateBillID(HBillType, ref DBUtility.ClsPub.sExeReturnInfo);
+ string HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
+ int HYear = int.Parse(oItem.HDate.Split('-')[0]);
+ int HPeriod = int.Parse(oItem.HDate.Split('-')[1]);
+ //涓昏〃
+ string sql = "insert into Pay_ErrWorkTimesRequestBillMain" +
+ "(HYear,HPeriod,HBillType,HBillSubType,HBillStatus,HInterID,HBillNo,HDate,HInnerBillNo,HDeptID,HGroupID,HMangerID,HICMOInterID,HICMOBillNo,HExplanation,HSumRequestTimes,HMaterID,HUnitID,HPlanQty,HBatchNo,HRemark,HMaker,HMakeDate) " +
+ "values(" +
+ "" + HYear +
+ "," + HPeriod +
+ ",'" + HBillType +
+ "','" + " " +
+ "'," + 1 +
+ "," + HInterID +
+ ",'" + HBillNo +
+ "','" + oItem.HDate +
+ "','" + " " +
+ "'," + oItem.HDeptID +
+ "," + oItem.HGroupID +
+ "," + oItem.HMangerID +
+ "," + "0" +
+ ",'" + " " +
+ "','" + oItem.HExplanation +
+ "'," + oItem.HSumRequestTimes +
+ "," + 0 +
+ "," + 0 +
+ "," + oItem.HPlanQty +
+ ",'" + oItem.HBatchNo +
+ "','" + oItem.HRemark +
+ "','" + "System" +
+ "'," + "GETDATE()" +
+ ")";
+ //涓昏〃
+ LogService.Write(sql);
+ oCN.RunProc(sql);
+ int i = 1;
+ foreach (Pay_ErrWorkTimesRequestBillSub oItem_Detail in oItem.Pay_ErrWorkTimesRequestBillSub)
+ {
+ sql = "insert into Pay_ErrWorkTimesRequestBillSub" +
+ "(HInterID,HEntryID,HEmpID,HWorkTypeID,HPayMoney,HBTimes,HETimes,HTimes,HRelTimes,HRelPay,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo" +
+ ",HSourceBillType,HRelationQty,HRelationMoney) " +
+ "values(" +
+ "" + HInterID +
+ "," + i +
+ "," + oItem_Detail.HEmpID +
+ "," + 0 +
+ "," + oItem_Detail.HPayMoney +
+ ",'" + "" +
+ "','" + "" +
+ "'," + oItem_Detail.HTimes +
+ "," + oItem_Detail.HRelTimes +
+ "," + oItem_Detail.HRelPay +
+ ",'" + oItem_Detail.HRemark +
+ "'," + 0 +
+ "," + 0 +
+ ",'" + " " +
+ "','" + " " +
+ "'," + 0 +
+ "," + 0 +
+ ")";
+ LogService.Write(sql);
+ oCN.RunProc(sql);
+ i += 1;
+ }
+ }
+ }
+ oCN.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ LogService.Write(e.Message);
+ msg = e.Message;
+ oCN.RollBack();
+ return false;
+ }
+ }
+ #endregion
+
+ #endregion
+
#endregion
@@ -2932,5 +3421,39 @@
}
#endregion
+ #region 閽夐拤鏁版嵁鍚屾OA
+ [Route("DD_DataSynchronization/DataSynchronization_DingDing_OA")]
+ [HttpGet]
+ public object DataSynchronization_DingDing_OA(DateTime startTime, DateTime endTime, string user)
+ {
+ string msg = "";
+ try
+ {
+ if (getData_ErrWorkTimesRequest(startTime,endTime,ref msg) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + msg;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
}
}
\ No newline at end of file
--
Gitblit v1.9.1