ch
2022-07-27 aefedbd83773db8b0ed7af35f08e474bc97be351
WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -331,6 +331,7 @@
                //创建临时表
                DataTable tb2 = new DataTable("dt2");
                DataTable tb3 = new DataTable("dt3");
                //添加列名
                for (int i = 0; i < ExcelDs.Tables[0].Columns.Count; i++)
@@ -595,6 +596,7 @@
            public string HPeriod;
            public string DataAppend;
            public string HOrgID;
            public Int64 HTProcessFlag;
        }
        [Route("Gy_RoutingBill/Gy_RoutingBill_btnSave")]
@@ -716,7 +718,7 @@
                    ds = oCN.RunProcReturn("select * from Gy_WorkCenter Where HName='" + list[i]["工作中心"].ToString() + "'", "Gy_WorkCenter");
                    var HCenterID = "0";
                    if (ds.Tables[0].Rows.Count > 0)
                        HCenterID = ds.Tables[0].Rows[0]["HItemID"].ToString();
                    HCenterID = ds.Tables[0].Rows[0]["HItemID"].ToString();
                    var HProcNo = list[i]["工序序号"].ToString();
                    var HTimeUnit = list[i]["时间单位"].ToString();
@@ -739,16 +741,38 @@
                    var HProcWorkNum = list[i]["程序号"].ToString();
                    //物料分类
                    oCN.RunProc("Insert into Gy_RoutingBillSub (HInterID,HEntryID,HSupID,HProcID,HCenterID,HProcNO,HTimeUnit" +
                                ", hworkqty, HFixPrice, HBadPrice, HWasterPrice, HBeginFixQty, HBeginDayQty, HFixWorkDays" +
                                ", HTrunWorkDays, HAutoTrunFlag, HSupFlag, HTechnologyParameter, HPicNum, HProcCheckNote" +
                                ", hpassrate, hremark, HMouldNo, HProcWorkNum, HReadyTime, HQueueTime, HMoveTime, HUnitTime)values" +
                                $"({HInterID}, {num[0]}, {HSupID}, {HProcID},{HCenterID}, '{HProcNo}', '{HTimeUnit}'" +
                                $", {hworkqty}, {(HFixPrice==""?"0": HFixPrice)}, {(HBadPrice == "" ? "0": HBadPrice)}, {(HWasterPrice == "" ? "0": HWasterPrice)}, {(HBeginFixQty == "" ? "0": HBeginFixQty)}, {(HBeginDayQty == "" ? "0": HBeginDayQty)}, {(HFixWorkDays == "" ? "0": HFixWorkDays)}" +
                                $", {(HTrunWorkDays == "" ? "0": HTrunWorkDays)},{(HAutoTrunFlag == "True" ? "1": "0")},{(HSupFlag == "True" ? "1" : "0")}, '{HTechnologyParameter}', '{HPicNum}', '{HProcCheckNote}'" +
                                $", {hpassrate}, '{hremark}', '{HMouldNo}', '{HProcWorkNum}', 0, 0, 0, 0)");
                    //自增次数
                    num[0]++;
                        oCN.RunProc("Insert into Gy_RoutingBillSub (HInterID,HEntryID,HSupID,HProcID,HCenterID,HProcNO,HTimeUnit" +
                                    ", hworkqty, HFixPrice, HBadPrice, HWasterPrice, HBeginFixQty, HBeginDayQty, HFixWorkDays" +
                                    ", HTrunWorkDays, HAutoTrunFlag, HSupFlag, HTechnologyParameter, HPicNum, HProcCheckNote" +
                                    ", hpassrate, hremark, HMouldNo, HProcWorkNum, HReadyTime, HQueueTime, HMoveTime, HUnitTime)values" +
                                    $"({HInterID}, {num[0]}, {HSupID}, {HProcID},{HCenterID}, '{HProcNo}', '{HTimeUnit}'" +
                                    $", {hworkqty}, {(HFixPrice == "" ? "0" : HFixPrice)}, {(HBadPrice == "" ? "0" : HBadPrice)}, {(HWasterPrice == "" ? "0" : HWasterPrice)}, {(HBeginFixQty == "" ? "0" : HBeginFixQty)}, {(HBeginDayQty == "" ? "0" : HBeginDayQty)}, {(HFixWorkDays == "" ? "0" : HFixWorkDays)}" +
                                    $", {(HTrunWorkDays == "" ? "0" : HTrunWorkDays)},{(HAutoTrunFlag == "True" ? "1" : "0")},{(HSupFlag == "True" ? "1" : "0")}, '{HTechnologyParameter}', '{HPicNum}', '{HProcCheckNote}'" +
                                    $", {hpassrate}, '{hremark}', '{HMouldNo}', '{HProcWorkNum}', 0, 0, 0, 0)");
                        //自增次数
                        num[0]++;
                    if(omdelMian.HTProcessFlag == 1 )
                    {
                        if ((i == list.Count - 1) || (list[i]["产品代码"].ToString() != list[i + 1]["产品代码"].ToString()))
                        {
                            ds = oCN.RunProcReturn("select * from Gy_Process Where HTProcessFlag = 1", "Gy_Process");
                            if (ds.Tables[0].Rows.Count > 0)
                            HProcID = ds.Tables[0].Rows[0]["HItemID"].ToString();
                            HProcNo = ds.Tables[0].Rows[0]["HSno"].ToString();
                            oCN.RunProc("Insert into Gy_RoutingBillSub (HInterID,HEntryID,HSupID,HProcID,HCenterID,HProcNO,HTimeUnit" +
                                       ", hworkqty, HFixPrice, HBadPrice, HWasterPrice, HBeginFixQty, HBeginDayQty, HFixWorkDays" +
                                       ", HTrunWorkDays, HAutoTrunFlag, HSupFlag, HTechnologyParameter, HPicNum, HProcCheckNote" +
                                       ", hpassrate, hremark, HMouldNo, HProcWorkNum, HReadyTime, HQueueTime, HMoveTime, HUnitTime)values" +
                                       $"({HInterID}, {num[0]}, {HSupID}, {HProcID},{HCenterID}, '{HProcNo}', '{HTimeUnit}'" +
                                       $", {hworkqty}, {(HFixPrice == "" ? "0" : HFixPrice)}, {(HBadPrice == "" ? "0" : HBadPrice)}, {(HWasterPrice == "" ? "0" : HWasterPrice)}, {(HBeginFixQty == "" ? "0" : HBeginFixQty)}, {(HBeginDayQty == "" ? "0" : HBeginDayQty)}, {(HFixWorkDays == "" ? "0" : HFixWorkDays)}" +
                                       $", {(HTrunWorkDays == "" ? "0" : HTrunWorkDays)},{(HAutoTrunFlag == "True" ? "1" : "0")},{(HSupFlag == "True" ? "1" : "0")}, '{HTechnologyParameter}', '{HPicNum}', '{HProcCheckNote}'" +
                                       $", {hpassrate}, '{hremark}', '{HMouldNo}', '{HProcWorkNum}', 0, 0, 0, 0)");
                        }
                        num[0]++;
                    }
                }
                objJsonResult.code = "1";