yangle
2023-12-12 73cbdf04e8acc8fd13db8e6a5dd3c31424a8c9b4
斯莫尔单品过站优化
1个文件已修改
34 ■■■■ 已修改文件
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -502,7 +502,7 @@
,HSourceBillType,HMaterID,HSourceID,HEquipID,HUnitID,HQty
,HGroupID,HWorkerID,HScanDate,HBarCode,HBarCode_P,HSNNumber)
values({HInterID1},'{HBillNo1}',{(i + 1)},0,0,''
,'',{sub[i].HMaterID},0,0,0,{sub[i].HQty}
,'',{sub[i].HMaterID},0,0,0,1
,0,0,getdate(),'{sub[i].HBarCode}','{omodel.HBarCode_P}','') ";
                    oCN.RunProc(sq2);
                }
@@ -939,7 +939,7 @@
        #region  工序单品过站 查询不良记录
        [Route("Cj_SingleStation/BadRecordsList")]
        [HttpGet]
        public object BadRecordsList(string HBarCode, string user)
        public object BadRecordsList(string HProcExchInterID, string HProcExchEntryID, string user)
        {
            try
            {
@@ -953,12 +953,12 @@
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn(@"select * from h_v_Gy_BadRecordsList where HProcExchBillNo='" + HBarCode + "'", "h_v_Gy_BadRecordsList");
                ds = oCN.RunProcReturn(@"exec h_p_Gy_BadRecordsList " + HProcExchInterID + "," + HProcExchEntryID, "h_p_Gy_BadRecordsList");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.data = ds;
                return objJsonResult;
            }
            catch (Exception e)
@@ -1392,24 +1392,24 @@
                    if (HResult == "OK")
                    {
                        ds = oCN.RunProcReturn("select  * from Sc_SourceLineRepairBillSub where HInterID=" + model.HInterID, "Sc_SourceLineRepairBillSub");
//                        ds = oCN.RunProcReturn("select  * from Sc_SourceLineRepairBillSub where HInterID=" + model.HInterID, "Sc_SourceLineRepairBillSub");
                        if (ds.Tables[0].Rows[0]["HRepairResult"].ToString() == "OK")
                        {
//                        if (ds.Tables[0].Rows[0]["HRepairResult"].ToString() == "OK")
//                        {
                            //生产工序出站SN数据
                            ds = oCN.RunProcReturn("select top 1  HInterID,HBillNo from Sc_StationOutBillMain where HProcExchInterID=" + model.HProcExchInterID + " and HProcExchEntryID=" + model.HProcExchEntryID + " and HBadCount<>0  order by  HInterID desc", "Sc_StationOutBillMain");
//                            //生产工序出站SN数据
//                            ds = oCN.RunProcReturn("select top 1  HInterID,HBillNo from Sc_StationOutBillMain where HProcExchInterID=" + model.HProcExchInterID + " and HProcExchEntryID=" + model.HProcExchEntryID + " and HBadCount<>0  order by  HInterID desc", "Sc_StationOutBillMain");
                            string HInterIDSN = ds.Tables[0].Rows[0]["HInterID"].ToString();
                            string HBillNoSN = ds.Tables[0].Rows[0]["HBillNo"].ToString();
//                            string HInterIDSN = ds.Tables[0].Rows[0]["HInterID"].ToString();
//                            string HBillNoSN = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                            ds = oCN.RunProcReturn("select *  from Sc_StationOutBillSub_SN where HInterID=" + HInterIDSN, "Sc_StationOutBillSub_SN");
//                            ds = oCN.RunProcReturn("select *  from Sc_StationOutBillSub_SN where HInterID=" + HInterIDSN, "Sc_StationOutBillSub_SN");
                            oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney)
values({HInterIDSN}, '{HBillNoSN}', {ds.Tables[0].Rows.Count + 1}, '{model.HBarCode}', 1, GETDATE(), '', " + model.HProcExchInterID + "," + model.HProcExchEntryID + ", '" + model.HProcExchBillNo + "', '', 0, 0)");
                            //反写工序出站单 主表 不良数量 和 合格数量
                            oCN.RunProc("update Sc_StationOutBillMain set HQty+=1,HBadCount-=1  where HInterID='" + HInterIDSN + "'");
                        }
//                            oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney)
//values({HInterIDSN}, '{HBillNoSN}', {ds.Tables[0].Rows.Count + 1}, '{model.HBarCode}', 1, GETDATE(), '', " + model.HProcExchInterID + "," + model.HProcExchEntryID + ", '" + model.HProcExchBillNo + "', '', 0, 0)");
//                            //反写工序出站单 主表 不良数量 和 合格数量
//                            oCN.RunProc("update Sc_StationOutBillMain set HQty+=1,HBadCount-=1  where HInterID='" + HInterIDSN + "'");
//                        }
                        oCN.RunProc("update Gy_BarCodeBill set HStatus='' where HBarCode='" + model.HBarCode + "'");
                    }