zrg
2024-03-27 0bac0eb5526e50e1415cfe476adef8802e5a7543
WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -105,8 +105,8 @@
                    //反写产量汇报单,质量汇报单关联字段,生产订单关联数量
                    Ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_ReverseWriteQty " + omodel.HInterID + "," + oSub.HEntryID + ",'" + omodel.HBillNo + "'," +
                        DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + "," + DetailColl[0].HICMOBillNo + ",'" + DetailColl[0].HSourceID + "','" +
                        "Edit" + "'," + HBackQty
                        DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + ",'" + DetailColl[0].HICMOBillNo + "','" + DetailColl[0].HSourceID + "','" +
                        "Edit" + "'," + HBackQty + "," + DetailColl[0].HICMOTempID
                        , "h_p_Sc_ICMOReportBill_ReverseWriteQty");
                    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBack"]) == "1")
                    {
@@ -262,7 +262,7 @@
                    //反写产量汇报单,质量汇报单关联字段,生产订单关联数量
                    ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_ReverseWriteQty " + omodel.HInterID + "," + oSub.HEntryID + ",'" + omodel.HBillNo + "'," +
                        DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + ",'" + DetailColl[0].HICMOBillNo + "','" + DetailColl[0].HSourceID + "','" +
                        "Add" + "'," + 0
                        "Add" + "'," + 0 + "," + DetailColl[0].HICMOTempID
                        , "h_p_Sc_ICMOReportBill_ReverseWriteQty");
                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1")
                    {
@@ -439,6 +439,7 @@
                }
                else
                {
                    oSystemParameter.ShowBill(ref sReturn);
                    JObject model = new JObject();
                    model.Add("FBillType", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillType"]) }); //单据类型
                    model.Add("FDate", Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDate"])); //单据日期                   
@@ -498,10 +499,10 @@
                                                                                                          //
                        if (oSystemParameter.omodel.WMS_CampanyName == "九菱") //系统参数  客户定制化名称     空白为通用
                        {
                            FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//班组
                            FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// 操作员
                        }
                        FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//班组
                        FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// 操作员
                        FentityModel.Add("FBOMID", new JObject() { ["FNumber"] = item["FBOMID"].ToString() });// BOM版本
@@ -581,17 +582,30 @@
                        //提交审核
                        string result1 = string.Empty;
                        string result2 = string.Empty;
                        var fID = JObject.Parse(result)["Result"]["Id"].ToString();
                        var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString();
                        var json = new
                        {
                            Ids = fID,
                        };
                        if (oSystemParameter.omodel.Sc_ICMOReportBill_AutoCheck == "Y") //系统参数  自动审核 
                        {
                            result1 = InvokeHelper.Submit("PRD_MORPT", JsonConvert.SerializeObject(jsonRoot));//提交
                            result2 = InvokeHelper.Audit("PRD_MORPT", JsonConvert.SerializeObject(jsonRoot));//审核
                            result1 = InvokeHelper.Submit("PRD_MORPT", JsonConvert.SerializeObject(json));//提交
                            result2 = InvokeHelper.Audit("PRD_MORPT", JsonConvert.SerializeObject(json));//审核
                            if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                            {
                                sReturn = "生产汇报单单号:" + HBillNo + ",提交失败" + result;
                                sReturn = "生产汇报单单号:" + HBillNo + ",提交失败" + result1;
                                oCn.RollBack();
                                return false;                              
                            }
                            if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                            {
                                sReturn = "生产汇报单单号:" + HBillNo + ",审核失败" + result2;
                                oCn.RollBack();
                                return false;
                            }
                        }                       
                    }                   
                }