WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -157,6 +157,7 @@
                int HIsTimeFlag = list[0].HIsTimeFlag;//是否计时
                string HRelBeginTime = list[0].HRelBeginTime;//开工时间
                string HRelEndTime = list[0].HRelEndTime;//完工时间
                double HWeight = list[0].HWeight;//重量
                LogService.Write($"1.字段赋值,用时" + sw.Elapsed );
                //单据完整性判断
@@ -417,7 +418,7 @@
                    ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HLastSubProc" +
                    ",HEmpID2,HEmpID3,HEmpID4,HEmpID5,HDSQty,HChongQty,HPriceRate,HWorkTimes,HQCCheckID,HMainInterID,HPRDOrgID" +
                    ",HmaterOutqty,HProcPriceRate,HTemporaryAreaID,HWasterQty_Work,HWasterQty_Mater,HBackWorkQty,HShiftsID" +
                    ",HToCheckQty,HLossQty,HBackWorkByMaterQty,HMouldID,HMachineWorkTimes,HIsTimeFlag,HRelBeginTime,HRelEndTime " +
                    ",HToCheckQty,HLossQty,HBackWorkByMaterQty,HMouldID,HMachineWorkTimes,HIsTimeFlag,HRelBeginTime,HRelEndTime,HWeight " +
                    ") " +
                    " values('" + BillType + "','" + (OperationType == "5" ? "SUB" : HBillSubType)  + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",'"+ HDate + "','" + HMaker + "',getdate(),'" + HMouldNum + "'" +
                    "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL +
@@ -428,7 +429,7 @@
                    "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + Convert.ToString(HLastSubProc ? 1 : 0) +
                    "," + HEmpID2 + "," + HEmpID3 + "," + HEmpID4 + "," + HEmpID5 + "," + HDSQty + "," + HChongQty + "," + HPriceRate + "," + HWorkTimes + "," + HQCCheckID + "," + HMainInterID + "," + HPRDOrgID +
                    "," + HmaterOutqty + "," + HProcPriceRate + "," + HTemporaryAreaID + "," + HWasterQty_Work + "," + HWasterQty_Mater + "," + HBackWorkQty +
                    "," + HShiftsID + "," + HToCheckQty + "," + HLossQty + ","+ HBackWorkByMaterQty + "," + HMouldID + ",'" + HMachineWorkTimes + "',"+ HIsTimeFlag + ",'" + HRelBeginTime + "','" + HRelEndTime +  "') ");
                    "," + HShiftsID + "," + HToCheckQty + "," + HLossQty + ","+ HBackWorkByMaterQty + "," + HMouldID + ",'" + HMachineWorkTimes + "',"+ HIsTimeFlag + ",'" + HRelBeginTime + "','" + HRelEndTime + "','" + HWeight + "') ");
                    LogService.Write($"4.新增结束,用时" + sw.Elapsed);
                    LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",新增工序出站单据:" + HBillNo);
@@ -476,9 +477,7 @@
                    ",HBackWorkByMaterQty=" + HBackWorkByMaterQty +
                    ",HMouldID=" + HMouldID +
                    ",HMachineWorkTimes=" + HMachineWorkTimes +
                    //",HIsTimeFlag=" + HIsTimeFlag +
                    //",HRelBeginTime='" + HRelBeginTime + "'" +
                    //",HRelEndTime='" + HRelEndTime + "'" +
                    ",HWeight=" + HWeight +
                    " from Sc_StationOutBillMain a with(nolock)" +
                    " where HInterID=" + HInterID);
@@ -641,29 +640,16 @@
                    {
                        object objResult = set_SaveStationOutBill_CLD_Json(HInterID, HBillNo, user);
                    }
                    //判断客户为华舟包装 生成条码主档
                    else if (oSystemParameter.omodel.WMS_CampanyName == "华舟")
                    {
                        var objResult = Cj_StationOutBarCode_Save(HInterID);
                    }
                }
                sw.Stop();//结束计时
                LogService.Write($"11.参数查询结束,新增结束,用时" + sw.Elapsed);
                LogService.Write("END--出站单据保存结束,出站单号:" + HBillNo);
                //测试语句===========================================================================================================
                string msg_str = "";
                string sql_str = "select a.HQty HQty_Main,b.HQty HQty_Sub " +
                            "from Sc_ProcessExchangeBillMain as a with(nolock)" +
                            "inner join Sc_ProcessExchangeBillSub as b with(nolock) on a.HInterID = b.HInterID " +
                            "where a.HInterID = " + HProcExchInterID;
                DataSet ds_str = oCN.RunProcReturn(sql_str, "Sc_ProcessExchangeBillMain");
                if (ds_str.Tables[0].Rows.Count > 0)
                {
                    msg_str = "HQty_Main:" + ds_str.Tables[0].Rows[0]["HQty_Main"].ToString() + ";HQty_Sub:";
                    for (int j = 0; j < ds_str.Tables[0].Rows.Count; j++)
                    {
                        msg_str += ds_str.Tables[0].Rows[j]["HQty_Sub"].ToString() + ",";
                    }
                }
                oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "修改工序出站单据:" + HBillNo + "[工序流转卡号:" + HProcExchBillNo + "]" + msg_str + "','LMES-工序出站模块','" + DBUtility.ClsPub.IPAddress + "','新增或修改单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                //==============================================================================================================
                objJsonResult.code = "1";
@@ -1366,7 +1352,114 @@
        }
        #endregion
        #region [出站单生成条码主档]
        [Route("Cj_StationOutBill/Cj_StationOutBarCode_Save")]
        [HttpPost]
        public object Cj_StationOutBarCode_Save(long HInterID)
        {
            try
            {
                ListModels oListModels = new ListModels();
                DAL.ClsGy_BarCodeBill_ChaiMa BillNew = new DAL.ClsGy_BarCodeBill_ChaiMa();
                oCN.BeginTran();
                ds = oCN.RunProcReturn("select  * from Sc_StationOutBillMain where HInterID='" + HInterID + "'", "Sc_StationOutBillMain");
                if (ds != null || ds.Tables[0].Rows.Count > 0)
                {
                    string sql = "insert into Gy_BarCodeBill (HInterID, HEntryID, HBarCode, HBarCodeType, HBarCodeSubType, HMaterID, HUnitID, HQty, HBatchNo, HSupID, HGroupID, HMaker, HMakeDate, " +
                  "HPrintQty, HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType, HinitQty, HEndQty, HBarcodeQtys, HBarcodeNo, HDeptID, HWhID, HSPID, HRemark, " +
                  "HCusID, HCusType, HEndDate, HWorkLineName, HBarCodeDate, HSTOCKORGID, HOWNERID, HSeOrderBillNo, HGiveAwayFlag, HMaterName, HMaterModel, " +
                  "HPinfan, HAuxPropID, HMTONo, HInnerBillNo, HCoilNO, HFurnaceNO, HFactory, HAuxQty, HheatNO, HEmpID, HCusModel, HCusMaterName, HCheckEmpName, HZZRQ,HSupMaterNumber,HSupBatchNo" +
                  ") values (" +
                  "'" + ds.Tables[0].Rows[0]["HInterID"].ToString() + "', " +
                  "'1', " +
                  "'" + ds.Tables[0].Rows[0]["HBillNO"].ToString() + "', " +
                  "'唯一条码', " +
                  "'', " +
                  "'" + ds.Tables[0].Rows[0]["HMaterID"].ToString() + "', " +
                  "'0', " +
                  "'" + ds.Tables[0].Rows[0]["HQty"].ToString() + "', " +
                  "'', " +
                  "'', " +
                  "'" + ds.Tables[0].Rows[0]["HGroupID"].ToString() + "', " +
                  "'" + ds.Tables[0].Rows[0]["HMaker"].ToString() + "', getdate(), " +
                  "'0', " +
                  "'" + ds.Tables[0].Rows[0]["HProcExchInterID"].ToString() + "', " +
                  "'" + ds.Tables[0].Rows[0]["HProcExchEntryID"].ToString() + "', " +
                  "'" + ds.Tables[0].Rows[0]["HProcExchBillNo"].ToString() + "', " +
                  "'3772', " +
                  "'0', " +
                  "'0', " +
                  "'1', " +
                  "'1', " +
                  "'" + ds.Tables[0].Rows[0]["HDeptID"].ToString() + "', " +
                  "'0', " +
                  "'0', " +
                  "'" + ds.Tables[0].Rows[0]["HRemark"].ToString() + "', " +
                  "'0', " +
                  "'', " +
                  "getdate(), " +
                  "'', " +
                  "getdate(), " +
                  "'" + ds.Tables[0].Rows[0]["HPRDORGID"].ToString() + "', " +
                  "'" + ds.Tables[0].Rows[0]["HPRDORGID"].ToString() + "', " +
                  "'', " +
                  "'0', " +
                  "'', " +
                  "'', " +
                  "'', " +
                  "'0', " +
                  "'', " +
                  "'', " +
                  "'', " +
                  "'', " +
                  "'', " +
                  "'0', " +
                  "'', " +
                  "'" + ds.Tables[0].Rows[0]["HEmpID"].ToString() + "', " +
                  "'', " +
                  "'', " +
                  "'', " +
                  "'', " +
                  "'', " +
                  "''" +
                  ")";
                    //插入拆分条码
                    oCN.RunProc(sql);
                    oCN.Commit();
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!未查询到条码信息";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                oCN.RollBack();
                oCN.RunProc("update Sc_StationOutBillMain set HInterFaceRemark =" + e.ToString() + ", HInterFaceStatus ='未生成' where HInterID=" + HInterID);
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
@@ -3106,7 +3199,7 @@
                    sReturn = "单据未找到!";
                    return false;
                }
                oCN.RunProc(" Update a set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' from Sc_StationOutBillMain with(nolock) Where HInterID=" + lngBillKey.ToString());
                oCN.RunProc(" Update a set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' from Sc_StationOutBillMain a with(nolock) Where HInterID=" + lngBillKey.ToString());
                oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Check_In " + lngBillKey.ToString() + ",1");
                //判断是否是 末道工序
                DataSet ds1;