From 59d429fd2caa1ecb879abfd21e9be17d42a39ee0 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期四, 22 九月 2022 17:38:22 +0800
Subject: [PATCH] 点检记录导出接口报错优化、不良明细查询接口优化 安灯系统PC端接口开发
---
VueWebApi/DLL/DAL/AppDeviceManageDAL.cs | 70 ++++++++++++++++++++++++++++++----
1 files changed, 61 insertions(+), 9 deletions(-)
diff --git a/VueWebApi/DLL/DAL/AppDeviceManageDAL.cs b/VueWebApi/DLL/DAL/AppDeviceManageDAL.cs
index e238c5c..7f77c18 100644
--- a/VueWebApi/DLL/DAL/AppDeviceManageDAL.cs
+++ b/VueWebApi/DLL/DAL/AppDeviceManageDAL.cs
@@ -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)
{
--
Gitblit v1.9.3