yangle
2023-08-30 75fa0fb23f1e1a51df578c758feb0f4c2a5b4810
对色记录单,试样记录单pda新增
3个文件已修改
2个文件已添加
421 ■■■■■ 已修改文件
Model/Model.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_FirstPieceCheckBillMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/车间管理/ClsQC_TestSampleCheckBillMain.cs 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/车间管理/ClsQC_TestSampleCheckBillSub.cs 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs 298 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj
@@ -717,7 +717,9 @@
    <Compile Include="车间管理\ClsSc_StationEntrustOutBillSub_Item.cs" />
    <Compile Include="车间管理\ClsSc_StationInBillMain.cs" />
    <Compile Include="车间管理\ClsSc_StationInBillSub.cs" />
    <Compile Include="车间管理\ClsQC_TestSampleCheckBillMain.cs" />
    <Compile Include="车间管理\ClsSc_StationOutBillMain.cs" />
    <Compile Include="车间管理\ClsQC_TestSampleCheckBillSub.cs" />
    <Compile Include="车间管理\ClsSc_StationOutBillSub.cs" />
    <Compile Include="车间管理\ClsSc_StationOutBillSub_Emp.cs" />
    <Compile Include="车间管理\ClsSc_StationOutBillSub_Item.cs" />
Model/Öʼì¹ÜÀí/ClsQC_FirstPieceCheckBillMain.cs
@@ -21,6 +21,8 @@
        public Int64 HPrintQty;
        public Int64 HICMOEntryID;
        public Int64 HQCSchemeID;
        public Int64 HUnitID;
        public Int64 HProcID;
    }
}
Model/³µ¼ä¹ÜÀí/ClsQC_TestSampleCheckBillMain.cs
New file
@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsQC_TestSampleCheckBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public Int64 HPrintQty;
        public Int64 HICMOInterID;
        public Int64 HICMOEntryID;
        public String HICMOBillNo;
        public Int64 HProcPlanInterID;
        public Int64 HProcPlanEntryID;
        public String HProcPlanBillNo;
        public Int64 HProcExchInterID;
        public Int64 HProcExchEntryID;
        public String HProcExchBillNo;
        public Int64 HMaterID;
        public Int64 HUnitID;
        public Int64 HProcID;
        public Int64 HPayProcID;
        public double HICMOQty;
        public double HPlanQty;
        public double HDSQty;
        public DateTime HStationOutTime;
        public Int64 HSourceID;
        public Int64 HGroupID;
        public Int64 HDeptID;
        public Int64 HEmpID;
        public String HReportType;
        public String HBarCode;
        public String HAddr;
        public String HBarCodeMaker;
        public DateTime HBarCodeMakeDate;
        public Int64 HSupID;
        public double HQty;
        public double HPieceQty;
        public double HPrice;
        public double HMoney;
        public double HBadCount;
        public double HWasterQty;
        public String HSourceName;
        public double HPlanPieceQty;
        public double HBadPNL;
        public Int64 HCenterID;
        public int HProcNo;
        public string HOrderProcNO;
        public bool HLastSubProc;
        public double HChongQty;
        public double HPriceRate;
        public string HMouldNum;//模穴号
        public string HBarCode_Cus;//客户条码编码
        public Single HWorkTimes;//工时
        public Int64 HQCCheckID;//检验员
        public string HSourceNameList;//设备清单
        public Int64 HPersonNums;       //人员数
        public Int64 HMachineNums;      //机器数
        public string HEmpNum; //职员代码
        public string eventType { get; set; }
        public Int64 HLastResult;//试样结论
    }
}
Model/³µ¼ä¹ÜÀí/ClsQC_TestSampleCheckBillSub.cs
New file
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsQC_TestSampleCheckBillSub : DBUtility.ClsXt_BaseBillSub
    {
        public string HBillNo_bak;//        varchar(50)    --单据号(备份,以免内码丢失,找不到对应主表)
        public Int64 HProcID;//        int            --工序
        public Int64 HMaterID;//        int            --物料
        public Int64 HEmpID;//        int            --操作工
        public Int64 HSourceID;//    int            --生产资源ID(Gy_Source)
        public Int64 HSourceID2;//    int            --生产资源ID(Gy_Source)
        public Int64 HSourceID3;//    int            --生产资源ID(Gy_Source)
        public Int64 HSourceID4;//    int            --生产资源ID(Gy_Source)
        public Int64 HSourceID5;//    int            --生产资源ID(Gy_Source)
        public DateTime HRelBeginDate;//   datetime             --实际开工日期
        public DateTime HRelEndDate;//    datetime                   --实际完工日期
        public double HTimes;//    money        --实作时间
        public double HQty;//    dec        --实作数量
        public double HPieceQty;//    dec        --板数
        public double HCheckQty;    //dec(18,8)    --合格数量
        public double HBadCount;  //不良品数
        public double HWasterQty;// å› å·¥æŠ¥åºŸæ•°é‡
        public double HWasterQty2;// å› æ–™æŠ¥åºŸæ•°é‡
        public double HWeight;//        dec(18,8)    --重量
        public double HPrice;//          dec(18,8)    --工序工价
        public double HMoney;//         money      -- è®¡ä»¶é‡‘额
        public double HOtherDeduct;//    money        --其他扣款
        public double HRelPay;//        money        --实得工资
        public string HOtherItem1;//    varchar(50)    --其他属性1
        public string HOtherItem2;//    varchar(50)    --其他属性2
        public long HCheckEmpID;//    int        --检验员(gy_employee)
        public Int64 HProcPlanInterID;//    int            --工序计划单ID
        public Int64 HProcPlanEntryID;//    int            --工序计划单子ID
        public string HProcPlanBillNo;//    varchar(50)        --工序计划单号
        public Int64 HICMOInterID;//    int                 --任务单ID
        public string HICMOBillNo;//        varchar(50)          --任务单号
        public Int64 HSeOrderInterID;//    int                --销售订单主ID
        public Int64 HSeOrderEntryID;//   int                 --销售子ID
        public string HSeOrderBillNo;//    varchar(50)             --销售订单号
        public Int64 HWWOrderInterID;//    int            --委外订单内码
        public Int64 HWWOrderEntryID;//    int            --委外订单子内码
        public string HWWOrderBillNo;//    varchar(50)        --委外订单号
        public Int64 HProcExchInterID;//    int            --工序流转卡ID
        public Int64 HProcExchEntryID;//    int            --工序流转卡子ID
        public string HProcExchBillNo;//    varchar(50)        --工序流转卡号
        public Int64 HProcNo;//        int            --工序号
        public string HSourceName;// æœºå°
    }
}
WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
@@ -316,6 +316,304 @@
        }
        #endregion
        #region æŒ‡å¼•卡扫码获取信息
        [Route("MES_SampleRecordBill_PDA/SampleRecordBillHBarCode_KeyDown")]
        [HttpGet]
        public object SampleRecordBillHBarCode_KeyDown(string HBarCode, string HInterID, string UserID, string HBillType)
        {
            try
            {
                if (HBarCode == null || HBarCode.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "空白码,条形码不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //拆分条形码
                string sBillBarCode = HBarCode.Trim();
                string[] NewBarCode;
                if (sBillBarCode.CompareTo("#") > 0)
                {
                    NewBarCode = sBillBarCode.Split(Convert.ToChar("#"));
                    sBillBarCode = NewBarCode[0];
                }
                string sBillNo = sBillBarCode; //条形码
                string[] arr = sBillNo.Split('&'); //以符号‘&’分割条形码
                string BillNo_PGD = arr[0]; //单据号
                string entryid_PGD = "";//子id
                if (arr.Length > 1)
                {
                    entryid_PGD = arr[1];
                }
                //截取条码类型2 å‰å››ä½
                string BillNoType2 = BillNo_PGD.Substring(0, Math.Min(4, BillNo_PGD.Length));
                switch (BillNoType2)
                {
                    case "GXLX"://流转卡
                        string sErr = "";
                        if (oSystemParameter.ShowBill(ref sErr))
                        {
                            if (oSystemParameter.omodel.WMS_CampanyName == "乔一")
                            { //系统参数是否为只显示当前登录用户关联的工序信息,N为否,Y为是
                                ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where å•据号= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList");
                            }
                            else
                            {
                                ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where å•据号= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList");
                            }
                        }
                        break;
                    default:
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "条码错误!";
                        objJsonResult.data = null;
                        return objJsonResult;
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region è¯•样记录新增保存
        [Route("MES_SampleRecordBill_PDA/SampleRecordAddBill")]
        [HttpPost]
        public object ColorRecordAddBill([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            try
            {
                //反序列化
                string msg2 = "[" + sArray[0].ToString() + "]";
                string user = sArray[1].ToString();//用户名
                string OperationType = sArray[2].ToString();//类型
                //判断是否有编辑权限
                if (!DBUtility.ClsPub.Security_Log("QC_TestSampleCheckBill_Edit", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无编辑权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                List<Model.ClsQC_TestSampleCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_TestSampleCheckBillMain>>(msg2);
                string BillType = "7510";
                string HBillSubType = "7510";
                string eventType = list[0].eventType;
                long HInterID = list[0].HInterID;//递入type得到的单据ID
                string HBillNo = list[0].HBillNo;//递入type得到的单据号
                int HBillStatus = 1;
                string HMaker = user;//制单人
                int HYear = DateTime.Now.Year;
                double HPeriod = DateTime.Now.Month;
                long HSourceID = list[0].HSourceID;//生产资源
                long HICMOInterID = list[0].HICMOInterID;//任务单ID
                string HICMOBillNo = list[0].HICMOBillNo;//任务单
                string HProcExchBillNo = list[0].HProcExchBillNo;//指引卡
                long HMaterID = list[0].HMaterID;//产品ID
                long HUnitID = list[0].HUnitID;//计量单位
                long HProcID = list[0].HProcID;//工序ID
                long HPRDORGID = list[0].HPRDORGID;//组织ID
                long HLastResult = list[0].HLastResult;//试样结论
                //单据完整性判断
                if (HProcExchBillNo =="")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "流转卡没有选择!请扫描条形码或输入条形码后回车";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var num = 0;
                oCN.BeginTran();
                if ("Add".Equals(eventType))
                {
                    num = 1;
                    ds = oCN.RunProcReturn("select * from QC_TestSampleCheckBillMain where HBillNo='" + HBillNo + "'", "QC_TestSampleCheckBillMain");
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据号重复!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    oCN.RunProc("Insert Into QC_TestSampleCheckBillMain " +
                    "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
                    ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOBillNo,HProcExchBillNo,HUnitID" +
                    ",HPRDORGID,HLastResult)" +
                    " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" +
                    "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'," + HUnitID +
                    "," + HPRDORGID + ",'" + HLastResult + "') ");
                }
                else
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "操作类型无效!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "新增单据成功!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å¯¹è‰²è®°å½•新增保存
        [Route("MES_SampleRecordBill_PDA/ColorRecordAddBill")]
        [HttpPost]
        public object SampleRecordAddBill([FromBody] JObject oMain)
        {
            var _value = oMain["oMain"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            try
            {
                //反序列化
                string msg2 = "[" + sArray[0].ToString() + "]";
                string user = sArray[1].ToString();//用户名
                string OperationType = sArray[2].ToString();//类型
                //判断是否有编辑权限
                if (!DBUtility.ClsPub.Security_Log("QC_FirstPieceCheckBill_Edit", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无编辑权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                List<Model.ClsQC_FirstPieceCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillMain>>(msg2);
                string BillType = "7505";
                string HBillSubType = "7505";
                long HInterID = list[0].HInterID;//递入type得到的单据ID
                string HBillNo = list[0].HBillNo;//递入type得到的单据号
                int HBillStatus = 1;
                string HMaker = user;//制单人
                int HYear = DateTime.Now.Year;
                double HPeriod = DateTime.Now.Month;
                long HSourceID = list[0].HSourceID;//生产资源
                long HICMOInterID = list[0].HICMOInterID;//任务单ID
                string HICMOBillNo = list[0].HICMOBillNo;//任务单
                string HProcExchBillNo = list[0].HProcExchBillNo;//指引卡
                long HMaterID = list[0].HMaterID;//产品ID
                //long HUnitID = list[0].HUnitID;//计量单位
                long HProcID = list[0].HProcID;//工序ID
                long HPRDORGID = list[0].HPRDORGID;//组织ID
                bool HLastResult = list[0].HLastResult;//试样结论
                //单据完整性判断
                if (HProcExchBillNo == "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "流转卡没有选择!请扫描条形码或输入条形码后回车";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var num = 0;
                oCN.BeginTran();
                if (OperationType=="1")
                {
                    num = 1;
                    ds = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillMain where HBillNo='" + HBillNo + "'", "QC_FirstPieceCheckBillMain");
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据号重复!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    oCN.RunProc("Insert Into QC_FirstPieceCheckBillMain " +
                    "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
                    ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOBillNo,HProcExchBillNo" +
                    ",HPRDORGID,HLastResult)" +
                    " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" +
                    "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" +
                    "," + HPRDORGID + ",'" + HLastResult + "') ");
                }
                else
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "操作类型无效!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "新增单据成功!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ ¹æ®ç™»å½•用户获取工序
        [Route("Sc_StationInBill/autoGetProcNo")]
        [HttpGet]