1
duhe
2024-01-24 72eb8c99e94428d2ea03c7cb71636bb09aa5546b
1
3个文件已修改
158 ■■■■ 已修改文件
WebAPI/Controllers/CJGL/Sc_ProcExchWorkBackBillController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/项目管理/报表分析/PM_ReportController.cs 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSc_ICMOReportBill.cs 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Sc_ProcExchWorkBackBillController.cs
@@ -665,7 +665,7 @@
                DataTable dt2 = new DataTable("DataColor");
                List<object> columnNameList = new List<object>();
                string sql = "exec h_p_SingleRowWall  "+ sWhere;
                string sql = "exec h_p_Sc_SingleRowWall  " + sWhere;
                ds = oCN.RunProcReturn(sql, "DataSouce");
                //添加列名
@@ -766,7 +766,7 @@
                                }
                            }
                        }
                        if (num == ds.Tables[0].Columns.Count||i==3)
                        if (num == ds.Tables[0].Columns.Count)
                        {
                            break;
                        }
WebAPI/Controllers/ÏîÄ¿¹ÜÀí/±¨±í·ÖÎö/PM_ReportController.cs
@@ -180,6 +180,66 @@
        #endregion
        #region æˆ‘的项目 æŸ¥è¯¢
        /// <summary>
        /// æˆ‘的项目查询
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("PM_ReportController/PM_ProjectBillMYList")]
        [HttpGet]
        public object PM_ProjectBillMYList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("PM_ProjectBillMainMy_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCn.RunProcReturn("select * from h_v_PM_ProjectBillMYList order by å•据号 desc", "h_v_PM_ProjectBillMYList");
                }
                else
                {
                    string sql1 = "select * from h_v_PM_ProjectBillMYList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by å•据号 desc";
                    ds = oCn.RunProcReturn(sql, "h_v_PM_ProjectBillMYList");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -68,6 +68,15 @@
                ",HGroupID=" + omodel.HGroupID.ToString() +
                ",HCheckType='" + omodel.HCheckType + "'" +
                " where HInterID=" + lngBillKey.ToString());
                //获取明细行修改前数量
                Int64 HBackQty = 0;
                Ds = oCn.RunProcReturn("select isnull(sum(isnull(HQty,0)),0) + isnull(sum(isnull(HWasterQty,0)),0) as HBackQty from Sc_ICMOReportBillSub where HInterID = " + lngBillKey, "Sc_ICMOReportBillSub");
                if (Ds != null && Ds.Tables[0].Rows.Count > 0)
                {
                    HBackQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HBackQty"]);
                }
                //删除关联
                DeleteRelation(lngBillKey);
                //删除子表
@@ -93,6 +102,18 @@
                      "," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
                      "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "','" + oSub.HBarCode + "'," + oSub.HICMOEntryID +
                      ") ");
                    //反写产量汇报单,质量汇报单关联字段,生产订单关联数量
                    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
                        , "h_p_Sc_ICMOReportBill_ReverseWriteQty");
                    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBack"]) == "1")
                    {
                        sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBackRemark"]);
                        oCn.RollBack();
                        return false;
                    }
                }
                if (omodel.HCheckType == "合格")
                {
@@ -100,6 +121,16 @@
                        "from Sc_ICMOReportBillSub a inner join Gy_BarCodeBill b on a.HBarCode=b.HBarCode  " +
                        "Where a.HInterID=" + lngBillKey.ToString() + " ");
                }
                //保存后控制=========================================
                Ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_AfterSaveCtrl_New " + omodel.HInterID + "," + DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + ",'" + DetailColl[0].HICMOBillNo + "'", "h_p_Sc_ICMOReportBill_AfterSaveCtrl_New");
                if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBack"]) == "1")
                {
                    sReturn = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //=========================================================
                //审核单据
                Ds = oCn.RunProcReturn("EXEC h_p_Sc_ICMOReportBill_Check  " + omodel.HInterID.ToString() + ",'" + omodel.HMaker+ "'", "h_p_Sc_ICMOReportBill_Check");
                if (Ds == null)
@@ -213,20 +244,32 @@
                      oSub.HREQENTRYSEQ + "," + oSub.HREQENTRYID + "," + oSub.HMOMAINENTRYID + "," + oSub.HSTOCKINQUASELQTY + "," + oSub.HPRODUCTTYPE + ",'" + oSub.HPROJECTNO + "'," + oSub.HICMOENTRYSEQ + "," + oSub.HSEQ + ",'" + oSub.HPRODUCEDATE + "','" + oSub.HEXPIRYDATE + "'," + oSub.HBASEUNITID + "," + oSub.HDEPTID + "," + oSub.HGroupID + ",'" + oSub.HDESCRIPTION + "','" + oSub.HSourceNumber + "'," + oSub.HQPQty + ","  + oSub.HICMOEntryID + ","  +  oSub.HWhID + "," + oSub.HSPID + ",'" + oSub.HBatChNo + "'," + oSub.HAuxPropID + ",'" + oSub.HMTONo + "'," + oSub.HPlanMode + "," + oSub.HERPInterID + "," + oSub.HERPEntryID +
                      ") ");
                    //反写产量汇报单临时表关联字段信息
                    string sql = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp  set " +
                                                                   " HICMOReportBillNo ='" + omodel.HBillNo +
                                                                   "', HRelationInterID='" + omodel.HInterID +
                                                                   "', HRelationEntryID='" + oSub.HEntryID +
                                                                   "' from Sc_ICMOBillWorkQtyStatus_Tmp a where a.HICMOBillNo='" + DetailColl[0].HICMOBillNo + "' and a.HSourceID='" + DetailColl[0].HSourceID + "' and  HICMOInterID='" + DetailColl[0].HICMOInterID + "' and a.HICMOEntryID='" + DetailColl[0].HICMOEntryID + "'  and HRelationInterID='0'");
                    oCn.RunProc(sql);
                    ////反写产量汇报单临时表关联字段信息
                    //string sql = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp  set " +
                    //                                               " HICMOReportBillNo ='" + omodel.HBillNo +
                    //                                               "', HRelationInterID='" + omodel.HInterID +
                    //                                               "', HRelationEntryID='" + oSub.HEntryID +
                    //                                               "' from Sc_ICMOBillWorkQtyStatus_Tmp a where a.HICMOBillNo='" + DetailColl[0].HICMOBillNo + "' and a.HSourceID='" + DetailColl[0].HSourceID + "' and  HICMOInterID='" + DetailColl[0].HICMOInterID + "' and a.HICMOEntryID='" + DetailColl[0].HICMOEntryID + "'  and HRelationInterID='0'");
                    //oCn.RunProc(sql);
                    //反写质量汇报单临时表关联字段信息
                    string sql2 = string.Format(@"update Sc_ICMOBillQualityStatus_Tmp  set " +
                                                                   " HRelationBillNo ='" + omodel.HBillNo +
                                                                   "', HRelationInterID='" + omodel.HInterID +
                                                                   "' from Sc_ICMOBillQualityStatus_Tmp a where a.HICMOBillNo='" + DetailColl[0].HICMOBillNo + "' and a.HSourceID='" + DetailColl[0].HSourceID + "' and  HICMOInterID='" + DetailColl[0].HICMOInterID + "' and a.HICMOEntryID='" + DetailColl[0].HICMOEntryID + "'  and HRelationInterID='0'");
                    oCn.RunProc(sql2);
                    ////反写质量汇报单临时表关联字段信息
                    //string sql2 = string.Format(@"update Sc_ICMOBillQualityStatus_Tmp  set " +
                    //                                               " HRelationBillNo ='" + omodel.HBillNo +
                    //                                               "', HRelationInterID='" + omodel.HInterID +
                    //                                               "' from Sc_ICMOBillQualityStatus_Tmp a where a.HICMOBillNo='" + DetailColl[0].HICMOBillNo + "' and a.HSourceID='" + DetailColl[0].HSourceID + "' and  HICMOInterID='" + DetailColl[0].HICMOInterID + "' and a.HICMOEntryID='" + DetailColl[0].HICMOEntryID + "'  and HRelationInterID='0'");
                    //oCn.RunProc(sql2);
                    //反写产量汇报单,质量汇报单关联字段,生产订单关联数量
                    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
                        , "h_p_Sc_ICMOReportBill_ReverseWriteQty");
                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1")
                    {
                        sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                        oCn.RollBack();
                        return false;
                    }
                }
                //
                //foreach (Model.ClsSc_ICMOReportBillSub oSub in DetailColl)
@@ -243,7 +286,7 @@
                //
                //       
                //保存后控制=========================================
                ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_AfterSaveCtrl_New " + omodel.HInterID + "," + oSub.HICMOInterID + "," + oSub.HICMOEntryID + ",'" + oSub.HICMOBillNo + "'", "h_p_Sc_ICMOReportBill_AfterSaveCtrl_New");
                ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_AfterSaveCtrl_New " + omodel.HInterID + "," + DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + ",'" + DetailColl[0].HICMOBillNo + "'", "h_p_Sc_ICMOReportBill_AfterSaveCtrl_New");
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1")
                {
@@ -592,13 +635,22 @@
                string HICMOInterID = ds.Tables[0].Rows[0]["HICMOInterID"].ToString();
                string HICMOEntryID = ds.Tables[0].Rows[0]["HICMOEntryID"].ToString();
                //
                //更新产量汇报临时表是否报检申请状态
                string sql1 = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set HRelationInterID='0',HRelationEntryID='0',HICMOReportBillNo=null where HICMOReportBillNo='" + HBillNo + "' and HICMOInterID='"+ HICMOInterID + "' and HICMOEntryID='"+ HICMOEntryID + "'");
                oCn.RunProc(sql1);
                //更新质量汇报临时表是否报检申请状态
                string sql2 = string.Format(@"update Sc_ICMOBillQualityStatus_Tmp set HRelationInterID='0',HRelationBillNo='' where HRelationBillNo='" + HBillNo + "' and HRelationInterID='" + lngBillKey + "'");
                oCn.RunProc(sql2);
                ////更新产量汇报临时表是否报检申请状态
                //string sql1 = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set HRelationInterID='0',HRelationEntryID='0',HICMOReportBillNo=null where HICMOReportBillNo='" + HBillNo + "' and HICMOInterID='"+ HICMOInterID + "' and HICMOEntryID='"+ HICMOEntryID + "'");
                //oCn.RunProc(sql1);
                ////更新质量汇报临时表是否报检申请状态
                //string sql2 = string.Format(@"update Sc_ICMOBillQualityStatus_Tmp set HRelationInterID='0',HRelationBillNo='' where HRelationBillNo='" + HBillNo + "' and HRelationInterID='" + lngBillKey + "'");
                //oCn.RunProc(sql2);
                //更新产量/质量汇报临时表是否报检申请状态,撤回生产订单关联数量
                ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_BeforeDel " + lngBillKey + ",'" + HBillNo + "'," + HICMOInterID + "," + HICMOEntryID , "h_p_Sc_ICMOReportBill_BeforeDel");
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1")
                {
                    sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除明细表