YL
2022-02-21 a905b3df0d0c9ae045b51d1299fbb2f2dcbc2e2d
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
1个文件已删除
4个文件已修改
252 ■■■■■ 已修改文件
DAL/仓库管理/条码管理/ClsGy_BarCodeBill_ChaiMa.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LMES/bin/x86/Debug.zip 补丁 | 查看 | 原始文档 | blame | 历史
WarM/仓库管理/Gy_BarCodeBill_ChaiMa.Designer.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/仓库管理/Gy_BarCodeBill_ChaiMa.cs 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/仓存管理/条码出入库记录/Kf_ICStockInOutBillController.cs 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/²Ö¿â¹ÜÀí/ÌõÂë¹ÜÀí/ClsGy_BarCodeBill_ChaiMa.cs
@@ -1,4 +1,5 @@
using System;
using DBUtility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -18,7 +19,7 @@
            {
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                string sql = "delete Gy_BarCodeBill where HBarCode='" + HBillNo + "'";
                string sql = "update Gy_BarCodeBill set HStopflag=1,HStopMan='"+ ClsPub.CurUserName + "',HStopManDate=getdate() where HBarCode='" + HBillNo + "'";
                oCn.RunProc(sql);
                ////插入子表
                foreach (Model.ClsGy_BarCodeEdit_Model oSub in DetailColl_Mater)
LMES/bin/x86/Debug.zip
Binary files differ
WarM/²Ö¿â¹ÜÀí/Gy_BarCodeBill_ChaiMa.Designer.cs
@@ -300,6 +300,7 @@
            this.dy.Text = "打印";
            this.dy.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.dy.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.dy.Click += new System.EventHandler(this.dy_Click);
            // 
            // tc
            // 
@@ -327,6 +328,7 @@
            this.yl.Text = "预览";
            this.yl.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
            this.yl.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            this.yl.Click += new System.EventHandler(this.yl_Click);
            // 
            // timer1
            // 
WarM/²Ö¿â¹ÜÀí/Gy_BarCodeBill_ChaiMa.cs
@@ -1,4 +1,5 @@
using Pub_Class;
using gregn6Lib;
using Pub_Class;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -6,6 +7,7 @@
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace WarM
@@ -40,7 +42,7 @@
        public const Int16 HMaterMould2 = 8;
        public const Int16 HBatchNo2 = 9;
        public const string ModName = "";                   //单据类型
        public const string ModName = "3302";                   //单据类型
        public const string ModCaption = "条码拆码";          //单据名称
        public const string ModRightName = "Gy_BarCodeBill_ChaiMa";
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;     //单据状态(新增,修改,浏览,更新单价,变更)
@@ -99,7 +101,14 @@
            ////隐藏列
            grdMain.Columns[HTagCol].Visible = false;
            grdMain.Columns[HInterID].Visible = false;
            //置灰
            grdMain.Columns[HSnoCol].ReadOnly = true;
            grdMain.Columns[HBarCode].ReadOnly = true;
            grdMain.Columns[HQty].ReadOnly = true;
            grdMain.Columns[HMaterCol].ReadOnly = true;
            grdMain.Columns[HMaterName].ReadOnly = true;
            grdMain.Columns[HMaterMould].ReadOnly = true;
            grdMain.Columns[HBatchNo].ReadOnly = true;
            //intoDate();
            //格式化网格
            //DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid_Mater);
@@ -123,6 +132,14 @@
            ////隐藏列
            grdMain_Pay.Columns[HTagCol].Visible = false;
            grdMain_Pay.Columns[HInterID].Visible = false;
            //置灰
            grdMain_Pay.Columns[HSnoCol].ReadOnly = true;
            grdMain_Pay.Columns[HBarCode].ReadOnly = true;
            grdMain_Pay.Columns[HQty].ReadOnly = true;
            grdMain_Pay.Columns[HMaterCol].ReadOnly = true;
            grdMain_Pay.Columns[HMaterName].ReadOnly = true;
            grdMain_Pay.Columns[HMaterMould].ReadOnly = true;
            grdMain_Pay.Columns[HBatchNo].ReadOnly = true;
            //设置可编辑列
            string sAllowCol = HNum2.ToString();
            //设置合计列
@@ -316,5 +333,118 @@
        {
            this.Close();
        }
        GridppReport Report;
        private void yl_Click(object sender, EventArgs e)
        {
            //选择打印模板
            BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp();
            oFrm.sBillName = ModName;
            oFrm.sBillModel = "条码档案列表";
            oFrm.ShowDialog();
            if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
            {
                Sub_SetReport(oFrm.sOpenTmp);
                Report.PrintPreview(false);
                Thread.Sleep(1000);
            }
        }
        private void dy_Click(object sender, EventArgs e)
        {
            //打印前判断条码是否已打印过
            string sBarCode = "";
            string sRelQty = "";
            int i = 0;
            DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl();
            if (ClsPub.isLong(grdMain_Pay.Rows[0].Cells[HSnoCol2].Value) == 0)
            {
                MessageBox.Show("请先生成拆码条码!");
            }
            while (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0)
            {
                sBarCode = sBarCode + "," + DBUtility.ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HBarCode2].Value);
                i++;
            }
            //选择打印模板
            BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp();
            oFrm.sBillName = ModName;
            oFrm.sBillModel = "条码档案列表";
            oFrm.ShowDialog();
            if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
            {
                Sub_SetReport(oFrm.sOpenTmp);
                Report.Print(false);
                //oBar.Set_PrintQty(DBUtility.ClsPub.isStrNull(grdMain.Rows[CurRows].Cells[Fun_GetCol("条码编号")].Value));
                Thread.Sleep(1000);
            }
            //批量更新条码打印次数
            oBar.Set_EPrintQty(sBarCode.Substring(1));
        }
        private void Sub_SetReport(string sOpenTmp)
        {
            //判断行数
            for (int i = 0; i < grdMain_Pay.Rows.Count; i++)
            {
                grdMain_Pay.Rows[i].Cells[0].Value = "";
            }
            for (int i = 0; i < grdMain_Pay.SelectedRows.Count; i++)
            {
                grdMain_Pay.Rows[grdMain_Pay.SelectedRows[i].Index].Cells[0].Value = "*";
            }
            //
            Report = new GridppReport();
            Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf");  //here .
            Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord);
            Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable);
        }
        //填入单据表头信息
        private void ReportBeforePostRecord()//your report?kao
        {
            try
            {
                //Report.FieldByName("物料代码").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("物料代码")].Value.ToString();
                //Report.FieldByName("物料名称").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("物料名称")].Value.ToString();
                //Report.FieldByName("规格型号").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("规格型号")].Value.ToString();
                //Report.FieldByName("自定义规格").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("自定义规格")].Value.ToString();
                //Report.FieldByName("条码编号").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("条码编号")].Value.ToString();
                //Report.FieldByName("数量").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("数量")].Value.ToString();
                //Report.FieldByName("批次").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("批号")].Value.ToString();
                //Report.FieldByName("源单单号").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("源单单号")].Value.ToString();
                //Report.FieldByName("销售订单号").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("销售订单号")].Value.ToString();
                //Report.FieldByName("采购订单号").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("采购订单号")].Value.ToString();
                //Report.FieldByName("供应商").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("往来单位")].Value.ToString();
                //Report.FieldByName("生产车间").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("生产车间")].Value.ToString();
                //Report.FieldByName("备注").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("备注")].Value.ToString();
                //Report.FieldByName("总托数").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("总托数")].Value.ToString();
                //Report.FieldByName("托号").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("托号")].Value.ToString();
            }
            catch (Exception e)
            {
                MessageBox.Show("打印失败!表头:" + e.Message);
            }
            //CurRows = CurRows + 1;
        }
        private void ReportFetchRecordByDataTable()
        {
            try
            {
                DataTable ds = new DataTable();
                BLL.Utility.FillRecordToReport_Sel(Report, grdMain_Pay, ds, Fun_GetCol("序号"));
            }
            catch (Exception e)
            {
                MessageBox.Show("打印失败!表体:" + e.Message);
            }
        }
        private Int32 Fun_GetCol(string sCol)
        {
            return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain_Pay);
        }
    }
}
WebAPI/Controllers/²Ö´æ¹ÜÀí/ÌõÂë³öÈë¿â¼Ç¼/Kf_ICStockInOutBillController.cs
@@ -93,5 +93,114 @@
            return objJsonResult;
        }
        #endregion
        #region æ¡ç å‡ºå…¥åº“缓存
        #region æ¡ç å‡ºå…¥åº“缓存列表
        [Route("Kf_ICStockInOutBill/GetPonderationBillMain_Temp")]
        [HttpGet]
        public object GetPonderationBillMain_Temp(string sWhere,string user)
        {
            try
            {
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_BarCodeBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DataSet ds = new DataSet();
                string sql1 = string.Format(@"select * from h_v_KF_PonderationBillMain_Temp2 where 1=1 ");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds= oCN.RunProcReturn(sql1 + "order by HInterID desc", "h_v_KF_PonderationBillMain_Temp2");
                }
                else
                {
                    ds = oCN.RunProcReturn(sql1 + sWhere + "order by HInterID desc", "h_v_KF_PonderationBillMain_Temp2");
                }
                if (ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查询数据异常,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = e.Message.ToString();
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #endregion
        #region æ¡ç å‡ºå…¥åº“缓存删除
        [Route("Kf_ICStockInOutBill/DelectPonderationBillMain_TempByID")]
        [HttpGet]
        public object DelectPonderationBillMain_TempByID(string HInterID, string user)
        {
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log_second("Gy_BarCodeBillList_Delete", 1, false, user))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无删除权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            string s = "";
            Int64 lngBillKey = 0;
            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
            if (lngBillKey == 0)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据ID为空!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            DataSet ds = new DataSet();
            DataSet ds1 = new DataSet();
            ds = oCN.RunProcReturn("select * from KF_PonderationBillMain_Temp where HInterID="+ HInterID, "KF_PonderationBillMain_Temp");
            if (ds.Tables[0].Rows.Count!=0)
            {
                oCN.BeginTran();
                oCN.RunProc("delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功";
                objJsonResult.data = null;
                oCN.Commit();
                return objJsonResult;
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据未找到";
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
    }
}