From a0f8fee1feea1e1425f7061bbadda9a2f45f0ea1 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期五, 27 三月 2026 10:48:13 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/数据同步/钉钉同步/DD_DataSynchronizationController.cs |   69 +++++++++++++++++++++++++++-------
 1 files changed, 54 insertions(+), 15 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 029323d..de12a8f 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"
@@ -1045,9 +1045,9 @@
                                 oItem.HDate = convertFromMillisecondsToDateString(HDate_Temp, "yyyy-MM-dd");
                             }
 
-                            if (keys.Contains("selectField_ls9ma7h9"))
+                            if (keys.Contains("textField_mc8uekgv"))
                             {
-                                oItem.HArea = response.Body.Result[i].FormData["selectField_ls9ma7h9"].ToString().Replace("'", "");
+                                oItem.HArea = response.Body.Result[i].FormData["textField_mc8uekgv"].ToString().Replace("'", "");
                             }
 
                             if (keys.Contains("selectField_ls9ma7h7"))
@@ -3336,14 +3336,30 @@
                         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;
                     List<Row> rows = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Row>>(tableFieldValue);
@@ -3609,20 +3625,43 @@
             string msg = "";
             try
             {
-                if (getData_ErrWorkTimesRequest(startTime, endTime, ref msg) == false)
+                string sErrMsg = "";
+                if (oSystemParameter.ShowBill(ref sErrMsg) == true)
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "Exception锛�" + msg;
+                    if ( oSystemParameter.omodel.WMS_CampanyName == "娣诲悍绉戞妧")     //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
+                    {
+                        //娣诲悍涓撶敤
+                        if (getData_ErrWorkTimesRequest(startTime, endTime, ref msg) == false)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "Exception锛�" + msg;
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹㈡埛閿欒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-
-                objJsonResult.code = "1";
-                objJsonResult.count = 1;
-                objJsonResult.Message = "Sucess锛�";
-                objJsonResult.data = null;
-                return objJsonResult;
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
             }
             catch (Exception e)
             {

--
Gitblit v1.9.1