VueWebApi/DLL/DAL/AppDeviceManageDAL.cs
@@ -45,7 +45,7 @@
                else
                {
                    mes.code = "300";
                    mes.Message = "当前设备异常!";
                    mes.Message = "当前设备/工位不存在或异常!";
                    mes.data = data;
                }
            }
@@ -104,7 +104,7 @@
        public static ToMessage AppDeviceCheckSave(string username, AppDevicecCheck json)
        {
            var sql = "";
            string djwo = "";
            string djwo = "",numvalue="";
            List<object> list = new List<object>();
            try
            {
@@ -118,7 +118,7 @@
                {
                    List<string> wo = (List<string>)mes.data;
                    djwo = wo[0].ToString(); //获取单号
                    numvalue= wo[1].ToString(); //获取流水号
                }
                if (json == null || json.children.Count <= 0)
                {
@@ -164,6 +164,9 @@
                        }
                    }); ;
                }
                //回写字典表,更新当前流水号
                sql = @"update T_CodeRules set value=@cunm2  where rightcode=@RightCode";
                list.Add(new { str = sql, parm = new { cunm2 = numvalue, RightCode = "1027" } });
                bool aa = DapperHelper.DoTransaction(list);
                if (aa)
@@ -279,7 +282,7 @@
        public static ToMessage AppDeviceRepairSave(string username,string maintcyc, AppDevicecCheck json)
        {
            var sql = "";
            string djwo = "";
            string bywo = "", numvalue = "";
            List<object> list = new List<object>();
            try
            {
@@ -291,7 +294,9 @@
                }
                else
                {
                    djwo = mes.data.GetType().GetProperty("Encode").GetValue(mes.data, null).ToString(); //获取单号
                    List<string> wo = (List<string>)mes.data;
                    bywo = wo[0].ToString(); //获取单号
                    numvalue = wo[1].ToString(); //获取流水号
                }
                if (json == null || json.children.Count <= 0)
                {
@@ -304,13 +309,13 @@
                //写入保养记录主表
                sql = @"insert into TEqpmaint_Proc_Main(bywo,eqp_code,eqpmaint_code,maint_cyc,maint_result,maint_user,maint_date) 
                        values(@djwo,@eqp_code,@eqpmaint_code,@maintcyc,@maint_result,@lm_user,@lm_date)";
                        values(@bywo,@eqp_code,@eqpmaint_code,@maintcyc,@maint_result,@lm_user,@lm_date)";
                list.Add(new
                {
                    str = sql,
                    parm = new
                    {
                        djwo = djwo,
                        bywo = bywo,
                        eqp_code = json.code,
                        eqpmaint_code = json.standcode,
                        maintcyc= maintcyc,
@@ -323,14 +328,14 @@
                for (int i = 0; i < json.children.Count; i++)
                {
                    sql = @"insert into TEqpmaint_Proc_Deta(seq,bywo,eqpmaideta_code,result,maint_cyc,maint_value) 
                            values(@seq,@djwo,@eqpmaideta_code,@maint_cyc,@result,@maint_value)";
                            values(@seq,@bywo,@eqpmaideta_code,@maint_cyc,@result,@maint_value)";
                    list.Add(new
                    {
                        str = sql,
                        parm = new
                        {
                            seq = json.children[i].seq,
                            djwo = djwo,
                            bywo = bywo,
                            eqpmaideta_code = json.children[i].itemcode,
                            maint_cyc = json.children[i].cycle,
                            result = json.children[i].result,
@@ -338,7 +343,9 @@
                        }
                    }); ;
                }
                //回写字典表,更新当前流水号
                sql = @"update T_CodeRules set value=@cunm2  where rightcode=@RightCode";
                list.Add(new { str = sql, parm = new { cunm2 = numvalue, RightCode = "1028" } });
                bool aa = DapperHelper.DoTransaction(list);
                if (aa)
                {
@@ -368,6 +375,51 @@
        #region[设备维修,扫描工位/设备二维码]
        public static ToMessage MaintainScanDeviceQrCodeData(string eqpcode)
        {
            string sql = "";
            var dynamicParams = new DynamicParameters();
            try
            {
                //获取对应设备及所属车间
                sql = @"select A.code,A.name,T.org_code as wksp_code,T.org_name as wksp_name,E.eqpchkmain_code
                        from TEqpInfo A
                        left join TOrganization T on A.wksp_code=T.org_code
                        left join TEqpchk_Eqp E on A.code=E.eqp_code
                        where A.code=@eqpcode and A.enable='Y' and T.description='W'";
                dynamicParams.Add("@eqpcode", eqpcode);
                var data = DapperHelper.selectdata(sql, dynamicParams);
                if (data.Rows.Count > 0)
                {
                    mes.code = "200";
                    mes.Message = "查询成功!";
                    mes.data = data;
                }
                else
                {
                    mes.code = "300";
                    mes.Message = "当前设备/工位不存在或异常!";
                    mes.data = data;
                }
            }
            catch (Exception e)
            {
                mes.code = "300";
                mes.count = 0;
                mes.Message = e.Message;
                mes.data = null;
            }
            return mes;
        }
        #endregion
        #region[测试安灯呼叫]
        public static ToMessage AppDeviceAnDengCallSave(string eqpcode)
        {