From 6d29ebf5ea086e862a5a7ca513e45af2be69a011 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 10 四月 2026 15:09:57 +0800
Subject: [PATCH] 添康钉钉同步维护
---
WebAPI/Controllers/数据同步/钉钉同步/DD_DataSynchronizationController.cs | 28 ++++++++++++++++++++++------
1 files changed, 22 insertions(+), 6 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 0a6bfe8..c2f8691 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"
@@ -3309,7 +3309,7 @@
oItem.HDeptName = deptNameAndGroupName[1];
oItem.HGroupName = deptNameAndGroupName[deptNameAndGroupName.Length-1];
//涓荤-璐熻矗浜�
- string HManagerValue = getProcessInstanceResponse.Body.Result.FormComponentValues[9].Value;//鑾峰彇鐨勫悕瀛楀惈鍚庣紑鑻辨枃
+ string HManagerValue = getProcessInstanceResponse.Body.Result.FormComponentValues[5].Value;//鑾峰彇鐨勫悕瀛楀惈鍚庣紑鑻辨枃
string pattern = @"[\u4e00-\u9fff]+"; // 涓枃瀛楃鐨刄nicode鑼冨洿
MatchCollection matches = Regex.Matches(HManagerValue, pattern);
@@ -3336,18 +3336,34 @@
HDeptID = ds.Tables[0].Rows[0]["HDeptID"].ToString();
}
oItem.HDeptID = int.Parse(HDeptID);
- ds = oCN.RunProcReturn("select * from Gy_Group with(nolock) where HName='" + oItem.HGroupName + "'", "Gy_Group");
+ //鐝粍涓烘彁浜や汉鐨勭彮缁�
+ //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 input = getProcessInstanceResponse.Body.Result.Title;
+ int index = input.IndexOf("鎻愪氦");
+ string HGroupEmpName = "";
+ if (index > 0)
+ {
+ HGroupEmpName = input.Substring(0, index).Trim();//鎴彇鎻愪氦浜哄悕绉板嵆鐝粍闀垮悕绉�
+ }
+ ds = oCN.RunProcReturn("select * from Gy_Employee with(nolock) where HName='" + HGroupEmpName + "'", "Gy_Employee");
string HGroupID = "0";
if (ds.Tables[0].Rows.Count > 0)
{
- HGroupID = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ HGroupID = ds.Tables[0].Rows[0]["HGroupID"].ToString();
}
oItem.HGroupID = int.Parse(HGroupID);
-
+
+
//鍙嶅簭鍒楀寲鏄庣粏鍐呭
- string tableFieldValue = getProcessInstanceResponse.Body.Result.FormComponentValues[11].Value;
+ string tableFieldValue = getProcessInstanceResponse.Body.Result.FormComponentValues[7].Value;
List<Row> rows = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Row>>(tableFieldValue);
- ExtValue extValue = Newtonsoft.Json.JsonConvert.DeserializeObject<ExtValue>(getProcessInstanceResponse.Body.Result.FormComponentValues[11].ExtValue);
+ ExtValue extValue = Newtonsoft.Json.JsonConvert.DeserializeObject<ExtValue>(getProcessInstanceResponse.Body.Result.FormComponentValues[7].ExtValue);
oItem.HBatchNo = rows[0].RowValue[1].Value.ToString();//鎵规鍙�-璁㈠崟鍙风爜
//浠诲姟鎻忚堪-浠诲姟绫诲瀷+宸ヤ綔鍐呭
oItem.HExplanation = getProcessInstanceResponse.Body.Result.FormComponentValues[2].Value + "-" + rows[0].RowValue[0].Value;
--
Gitblit v1.9.1