1
zrg
2026-02-10 a20222cae5a8862547d121204396caeb4cf5b1ca
WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -1697,6 +1697,7 @@
                      ") ");
                //同步金蝶
                //访问金蝶
                string sErr = "";
                var loginRet = InvokeHelper.Login();
                var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
                if (isSuccess == 0)
@@ -1707,25 +1708,29 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oSystemParameter.omodel.WMS_CampanyName == "锦隆")
                 {
                    string sql = @"select a.FID,a.FNUMBER Employee,d.FNUMBER Dept from Gy_Employee e
                if (oSystemParameter.ShowBill(ref sErr))
                {
                    if (oSystemParameter.omodel.WMS_CampanyName == "锦隆")
                    {
                        string sql = @"select a.FID,a.FNUMBER Employee,d.FNUMBER Dept from Gy_Employee e
                             join JL20250716203240..T_HR_EMPINFO a on e.HNumber = a.FNUMBER
                             join JL20250716203240..T_BD_STAFFTEMP c on c.FID = a.FID
                             join JL20250716203240..T_BD_DEPARTMENT d on c.FDEPTID = d.FDEPTID
                             where e.HItemID ='" + HKeeperID + "' ";
                    //查询质检员对应质检部门
                    ds = oCN.RunProcReturn(sql, "T_HR_EMPINFO");
                    // LogService.Write("sql" + sql);
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "操作失败,质检员对应质检部门无数据。" + sql;
                        objJsonResult.data = null;
                        return objJsonResult;
                        //查询质检员对应质检部门
                        ds = oCN.RunProcReturn(sql, "T_HR_EMPINFO");
                        // LogService.Write("sql" + sql);
                        if (ds.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "操作失败,质检员对应质检部门无数据。" + sql;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                
@@ -1735,10 +1740,14 @@
                model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //单据日期
                model.Add("FInspectOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //质检组织
                model.Add("FSourceOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //来源组织
                                                                                                    //model.Add("FInspectDepId", new JObject() { ["Fnumber"] = ds.Tables[0].Rows[0]["Dept"].ToString() }); //质检部门
                if (oSystemParameter.omodel.WMS_CampanyName == "锦隆")
                //model.Add("FInspectDepId", new JObject() { ["Fnumber"] = ds.Tables[0].Rows[0]["Dept"].ToString() }); //质检部门
                if (oSystemParameter.ShowBill(ref sErr))
                {
                    model.Add("FInspectorId", new JObject() { ["Fnumber"] = ds.Tables[0].Rows[0]["Employee"].ToString() }); //质检员
                    if (oSystemParameter.omodel.WMS_CampanyName == "锦隆")
                    {
                        model.Add("FInspectorId", new JObject() { ["Fnumber"] = ds.Tables[0].Rows[0]["Employee"].ToString() }); //质检员
                    }
                }
                model.Add("FISSYNCED", "false");//  是否已同步
                model.Add("F_PGKJ_Date", DateTime.Now.ToString("yyyy-MM-dd"));//  报检日期
@@ -1780,20 +1789,25 @@
                FentityModel2.Add("FBasePolicyQty", HRightQty.ToString() == "0" ? HBadQty.ToString() : HRightQty.ToString()); //基本单位数量
                FentityModel2.Add("FUsePolicy", HUseResult.ToString());   //使用决策
                FentityModel2.Add("FIsCheck", false);   //是否抽检
                // 锦隆启用不良处理
                if (string.Equals(oSystemParameter.omodel.WMS_CampanyName, "锦隆"))
                                                        // 锦隆启用不良处理
                if (oSystemParameter.ShowBill(ref sErr))
                {
                    // 判断单据是否合格
                    if (HCheckResult.ToString() == "2")
                    if (string.Equals(oSystemParameter.omodel.WMS_CampanyName, "锦隆"))
                    {
                        FentityModel2.Add("FIsDefectProcess", true);  //不良处理
                    }else
                    {
                        FentityModel2.Add("FIsDefectProcess", false);
                        // 判断单据是否合格
                        if (HCheckResult.ToString() == "2")
                        {
                            FentityModel2.Add("FIsDefectProcess", true);  //不良处理
                        }
                        else
                        {
                            FentityModel2.Add("FIsDefectProcess", false);
                        }
                    }
                }else
                {
                    FentityModel2.Add("FIsDefectProcess", false);  //不良处理
                    else
                    {
                        FentityModel2.Add("FIsDefectProcess", false);  //不良处理
                    }
                }
                FentityModel2.Add("FCanSale", false);   //可销售
                FentityModel2.Add("FIsMRBReview", false);   //MRP评审
@@ -1864,6 +1878,7 @@
                    return objJsonResult;
                }
                //提交审核
                string result0 = string.Empty;
                string result1 = string.Empty;
                string result2 = string.Empty;
                var fID = JObject.Parse(result)["Result"]["Id"].ToString();
@@ -1877,7 +1892,13 @@
                K3CloudApiClient client = new K3CloudApiClient("http://47.96.97.237/k3cloud");
                //        K3CloudApiClient client = new K3CloudApiClient("http://192.168.80.90/k3cloud/");
                if (oSystemParameter.ShowBill(ref sErr))
                {
                    if (string.Equals(oSystemParameter.omodel.WMS_CampanyName, "锦隆"))
                    {
                        result0 = InvokeHelper.Save("QM_InspectBill", JsonConvert.SerializeObject(json));//保存
                    }
                }
                result1 = InvokeHelper.Submit("QM_InspectBill", JsonConvert.SerializeObject(json));//提交
                result2 = InvokeHelper.Audit("QM_InspectBill", JsonConvert.SerializeObject(json));//审核
                if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
@@ -1907,14 +1928,15 @@
                        fs.Read(buffer, 0, (int)len);
                        //文件IO流
                        string a = Convert.ToBase64String(buffer);
                        if(oSystemParameter.omodel.WMS_CampanyName == "锦隆")
                        {
                            ds = oCN.RunProcReturn("select * from  JL20250716203240..T_QM_INSPECTBILL where FBILLNO='" + HBillNo + "'", "T_QM_INSPECTBILL");
                        }
                        else
                        {
                            ds = oCN.RunProcReturn("select * from  AIS20210811135644..T_QM_INSPECTBILL where FBILLNO='" + HBillNo + "'", "T_QM_INSPECTBILL");
                        if (oSystemParameter.ShowBill(ref sErr)) {
                            if (oSystemParameter.omodel.WMS_CampanyName == "锦隆")
                            {
                                ds = oCN.RunProcReturn("select * from  JL20250716203240..T_QM_INSPECTBILL where FBILLNO='" + HBillNo + "'", "T_QM_INSPECTBILL");
                            }
                            else
                            {
                                ds = oCN.RunProcReturn("select * from  AIS20210811135644..T_QM_INSPECTBILL where FBILLNO='" + HBillNo + "'", "T_QM_INSPECTBILL");
                            }
                        }