yxj
2024-03-13 2cc71fec71dd7986691240cd6e536e12c64eb509
WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
@@ -1167,7 +1167,7 @@
                    }
                    UserName = oItem.HMaker;  //制单人
                    oItem.HBillType = "1401";
                    oItem.HBillSubType = "1401";
                    //oItem.HBillSubType = "1401";
                    oItem.HSALEORGID = oItem.HOrgID;
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
@@ -1737,22 +1737,18 @@
                }
                if (IsAudit == 1) //反关闭提交
                {
                    oBill.oCn.BeginTran();
                    ds = oCN.RunProcReturn("exec h_p_Kf_CheckSeOrderBill_CrediControl " + oBill.omodel.HInterID, "h_p_Kf_CheckSeOrderBill_CrediControl");
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        ds = oCN.RunProcReturn("exec h_p_Kf_CheckSeOrderBill_CrediControl " + oBill.omodel.HInterID, "h_p_Kf_CheckSeOrderBill_CrediControl");
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
                            objJsonResult.data = null;
                            oBill.oCn.RollBack();
                            return objJsonResult;
                        }
                        oBill.oCn.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
@@ -1765,7 +1761,6 @@
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        oBill.oCn.RollBack();
                        return objJsonResult;
                    }
                }
@@ -1927,13 +1922,25 @@
                }
                if (IsAudit == 1) //行反关闭提交
                {
                    //oBill.oCn.BeginTran();
                    //行反关闭提交
                    if (oBill.CancelRow(lngBillKey, HEntryID, oBill.omodel.HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        //ds = oCN.RunProcReturn("exec h_p_Kf_CheckSeOrderBill_CrediControl " + oBill.omodel.HInterID, "h_p_Kf_CheckSeOrderBill_CrediControl");
                        //if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1")
                        //{
                        //    objJsonResult.code = "0";
                        //    objJsonResult.count = 0;
                        //    objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
                        //    objJsonResult.data = null;
                        //    oBill.oCn.RollBack();
                        //    return objJsonResult;
                        //}
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        //oBill.oCn.Commit();
                        return objJsonResult;
                    }
                    else
@@ -1942,6 +1949,7 @@
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        //oBill.oCn.RollBack();
                        return objJsonResult;
                    }
                }
@@ -2218,29 +2226,7 @@
                }
                else
                {
                    string sql = "select * from Gy_UserCustomerRelation where HUserID = '" + CurUserID + "'";
                    ds = oCN.RunProcReturn(sql, "Gy_UserCustomerRelation");
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    {
                        sWhere = " and 1 = 0";
                    }
                    else
                    {
                        sWhere = " and HCusID in (";
                        for (var i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            if (i < ds.Tables[0].Rows.Count - 1)
                            {
                                sWhere += ds.Tables[0].Rows[i]["HCusID"].ToString() + ",";
                            }
                            else
                            {
                                sWhere += ds.Tables[0].Rows[i]["HCusID"].ToString() + ")";
                            }
                        }
                    }
                    //sWhere = " and 1=1 ";
                    sWhere = " and HCusID in (select hcusid from Gy_UserCustomerRelation Where HUserID = '" + CurUserID + "') ";
                }
                objJsonResult.code = "1";