From 9c634fd767aec36ef97c3a814bf7a29c67d20ee1 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期五, 29 三月 2024 10:57:35 +0800
Subject: [PATCH] 修改单据重复显示问题,增加工单源单id关联
---
VueWebApi/DLL/DAL/SystemSettingDAL.cs | 292 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 288 insertions(+), 4 deletions(-)
diff --git a/VueWebApi/DLL/DAL/SystemSettingDAL.cs b/VueWebApi/DLL/DAL/SystemSettingDAL.cs
index 0f1d7f0..5f13705 100644
--- a/VueWebApi/DLL/DAL/SystemSettingDAL.cs
+++ b/VueWebApi/DLL/DAL/SystemSettingDAL.cs
@@ -5,6 +5,7 @@
using System.Data.SqlClient;
using System.Linq;
using System.Web;
+using VueWebApi.Models;
using VueWebApi.Tools;
namespace VueWebApi.DLL.DAL
@@ -43,9 +44,9 @@
//search = search.Substring(3);//鎴彇绱㈠紩2鍚庨潰鐨勫瓧绗�
// --------------鏌ヨ鎸囧畾鏁版嵁--------------
var total = 0; //鎬绘潯鏁�
- var sql = @"select A.right_code,A.right_name,B.prefix,B.filingdate,B.incbit from TRight A
+ var sql = @"select A.right_code,A.right_name,B.prefix,B.filingdate,B.incbit,A.Type from TRight A
left join T_CodeRules B on A.right_code=B.rightcode
- where "+search+" and A.Type='PC' and A.parent_id<>'0' order by A.right_code,A.right_seq ";
+ where A.parent_id<>'0' and A.is_delete<>'1' and A.is_rcode<>'N' " + search + "";
var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total);
mes.code = "200";
mes.Message = "鏌ヨ鎴愬姛!";
@@ -71,15 +72,25 @@
var dynamicParams = new DynamicParameters();
try
{
- sql = @"select rightcode from T_CodeRules where rightcode=@rightcode";
+ sql = @"select rightcode,value from T_CodeRules where rightcode=@rightcode";
dynamicParams.Add("@rightcode", rightcode);
var data = DapperHelper.selectdata(sql, dynamicParams);
if (data.Rows.Count > 0)
{
- sql = @"update T_CodeRules set prefix=@prefix,filingdate=@filingdate,incbit=@incbit,lm_user=@lm_user,lm_date=@CreateDate where right_code=@rightcode";
+ string value = data.Rows[0]["value"].ToString();
+ if (decimal.Parse(incbit) > value.Length)
+ {
+ decimal cnum = decimal.Parse(incbit) - value.Length;
+ for (int i = 0; i < cnum; i++)
+ {
+ value = "0" + value;
+ }
+ }
+ sql = @"update T_CodeRules set prefix=@prefix,filingdate=@filingdate,incbit=@incbit,value=@value,lm_user=@lm_user,lm_date=@CreateDate where rightcode=@rightcode";
dynamicParams.Add("@prefix", prefix);
dynamicParams.Add("@filingdate", filingdate);
dynamicParams.Add("@incbit", incbit);
+ dynamicParams.Add("@value", value);
dynamicParams.Add("@lm_user", lm_user);
dynamicParams.Add("@CreateDate", DateTime.Now.ToString());
dynamicParams.Add("@rightcode", rightcode);
@@ -153,5 +164,278 @@
return mes;
}
#endregion
+
+
+
+ #region[鐢熸垚绯荤粺鏉$爜(鑷畾涔�)]
+ public static ToMessage LabelBarCode(string rightcode, string partcode, string qty, string onelabqty)
+ {
+ mes = AppLableBarCode.EncodingSeach(rightcode, partcode, qty, onelabqty);
+ return mes;
+ }
+ #endregion
+
+
+
+ #region[杞﹂棿鍏憡鍒楄〃]
+ public static ToMessage SystemAnnouncementSearch(string wkspcode, string ancetitle, string ancecont, string cancel, string level, int startNum, int endNum, string prop, string order)
+ {
+ var dynamicParams = new DynamicParameters();
+ string search = "";
+ try
+ {
+ if (wkspcode != "" && wkspcode != null)
+ {
+ search += "and A.wksp_code=@wkspcode ";
+ dynamicParams.Add("@wkspcode", wkspcode);
+ }
+ if (ancetitle != "" && ancetitle != null)
+ {
+ search += "and A.title like '%'+@ancetitle+'%' ";
+ dynamicParams.Add("@ancetitle", ancetitle);
+ }
+ if (ancecont != "" && ancecont != null)
+ {
+ search += "and A.contents like '%'+@ancecont+'%' ";
+ dynamicParams.Add("@ancecont", ancecont);
+ }
+ if (cancel != "" && cancel != null)
+ {
+ search += "and A.if_cancel=@cancel ";
+ dynamicParams.Add("@cancel", cancel);
+ }
+ if (level != "" && level != null)
+ {
+ search += "and A.priority=@level ";
+ dynamicParams.Add("@level", level);
+ }
+ if (search == "")
+ {
+ search = "and 1=1 ";
+ }
+ //search = search.Substring(3);//鎴彇绱㈠紩2鍚庨潰鐨勫瓧绗�
+ // --------------鏌ヨ鎸囧畾鏁版嵁--------------
+ var total = 0; //鎬绘潯鏁�
+ var sql = @"select A.id,A.wksp_code,T.org_name as wksp_name,A.title,A.contents,U.username as lm_user,A.lm_date,A.if_cancel,A.cancel_date,A.priority
+ from TSystemAnnouncement A
+ left join TOrganization T on A.wksp_code=T.org_code
+ left join TUser U on A.lm_user=U.usercode
+ where T.description='W' and A.is_delete='0' " + search + "";
+ var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total);
+ mes.code = "200";
+ mes.Message = "鏌ヨ鎴愬姛!";
+ mes.count = total;
+ mes.data = data.ToList();
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = e.Message;
+ mes.data = null;
+ }
+ return mes;
+ }
+ #endregion
+
+ #region[杞﹂棿鍏憡鏂板缂栬緫鎻愪氦]
+ public static ToMessage SystemAnnouncementAddUpdate(string id,DataTable dt, string ancetitle, string ancecont, string cancel, string level,string username, string opertype)
+ {
+ var sql = "";
+ var dynamicParams = new DynamicParameters();
+ List<object> list = new List<object>();
+ string cancel_date = "";
+ try
+ {
+ if (cancel == "Y")
+ {
+ cancel_date = DateTime.Now.ToString();
+ }
+ if (opertype == "Add")
+ {
+ for (int i = 0; i < dt.Rows.Count; i++)
+ {
+ //鍐欏叆宸ュ崟琛�
+ sql = @"insert into TSystemAnnouncement(wksp_code,title,contents,if_cancel,cancel_date,lm_user,lm_date,priority)
+ values(@wksp_code,@title,@contents,@if_cancel,@cancel_date,@lm_user,@lm_date,@priority)";
+ list.Add(new
+ {
+ str = sql,
+ parm = new
+ {
+ wksp_code = dt.Rows[i]["WKSP_CODE"].ToString(),
+ title = ancetitle,
+ contents = ancecont,
+ if_cancel = cancel,
+ cancel_date = cancel_date,
+ lm_user = username,
+ lm_date = DateTime.Now.ToString(),
+ priority = level
+ }
+ });
+ }
+
+ bool aa = DapperHelper.DoTransaction(list);
+ if (aa)
+ {
+ mes.code = "200";
+ mes.count = 0;
+ mes.Message = "鎿嶄綔鎴愬姛!";
+ mes.data = null;
+ }
+ else
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = "鎿嶄綔澶辫触!";
+ mes.data = null;
+ }
+ }
+ if (opertype == "Update")
+ {
+ sql = @"update TSystemAnnouncement set wksp_code=@wksp_code,title=@title,contents=@contents,if_cancel=@if_cancel,cancel_date=@cancel_date,lm_user=@lm_user,lm_date=@lm_date,priority=@priority where id=@id";
+ list.Add(new
+ {
+ str = sql,
+ parm = new
+ {
+ id=id,
+ wksp_code = dt.Rows[0]["WKSP_CODE"].ToString(),
+ title = ancetitle,
+ contents = ancecont,
+ if_cancel = cancel,
+ cancel_date = cancel_date,
+ lm_user = username,
+ lm_date = DateTime.Now.ToString(),
+ priority = level
+ }
+ });
+ bool aa = DapperHelper.DoTransaction(list);
+ if (aa)
+ {
+ mes.code = "200";
+ mes.count = 0;
+ mes.Message = "淇敼鎿嶄綔鎴愬姛!";
+ mes.data = null;
+ }
+ else
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = "淇敼鎿嶄綔澶辫触!";
+ mes.data = null;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = e.Message;
+ mes.data = null;
+ }
+ return mes;
+ }
+ #endregion
+
+ #region[杞﹂棿鍏憡鍒犻櫎]
+ public static ToMessage SystemAnnouncementDelete(string id)
+ {
+ var sql = "";
+ List<object> list = new List<object>();
+ var dynamicParams = new DynamicParameters();
+ try
+ {
+ list.Clear();
+ sql = @"delete TSystemAnnouncement where id=@id";
+ list.Add(new { str = sql, parm = new { id = id } });
+
+ bool aa = DapperHelper.DoTransaction(list);
+ if (aa)
+ {
+ mes.code = "200";
+ mes.count = 0;
+ mes.Message = "鎿嶄綔鎴愬姛!";
+ mes.data = null;
+ }
+ else
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = "鎿嶄綔澶辫触!";
+ mes.data = null;
+ }
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = e.Message;
+ mes.data = null;
+ }
+ return mes;
+ }
+ #endregion
+
+
+ #region[App鐗堟湰鍗囩骇鎺ュ彛]
+ public static ToMessage AppUpgrade(string rid, string vision)
+ {
+ var sql = "";
+ List<object> list = new List<object>();
+ List<AppVersion> obj = new List<AppVersion>();
+ var dynamicParams = new DynamicParameters();
+ try
+ {
+ list.Clear();
+ sql = @"select * from TSystemAppUser where rid=@rid and appvesion=@vision";
+ dynamicParams.Add("@rid", rid);
+ dynamicParams.Add("@vision", vision);
+ var data = DapperHelper.selectdata(sql, dynamicParams);
+ if (data.Rows.Count <= 0) //涓嶅瓨鍦�
+ {
+ //鍐欏叆鏈増鐢ㄦ埛鍏宠仈琛�
+ sql = @"insert into TSystemAppUser(rid,appvesion,lm_date)
+ values(@rid,@appvesion,@lm_date)";
+ list.Add(new
+ {
+ str = sql,
+ parm = new
+ {
+ rid = rid,
+ appvesion = vision,
+ lm_date = DateTime.Now.ToString()
+ }
+ });
+ bool aa = DapperHelper.DoTransaction(list);
+ list.Clear();
+ }
+ //鏌ヨ鎺у埗鍗囩骇琛ㄧ増鏈暟鎹�
+ sql = @"select * from TSystemApp";
+ var data1 = DapperHelper.selecttable(sql);
+ AppVersion vn = new AppVersion();
+ vn.path = data1.Rows[0]["path"].ToString();
+ vn.version = data1.Rows[0]["version"].ToString();
+ vn.dispyversion = vision;
+ vn.activeversion = data1.Rows[0]["activeversion"].ToString();
+ vn.mustupgrade = data1.Rows[0]["mustupgrade"].ToString();
+ list.Add(vn);
+
+ mes.code = "200";
+ mes.count = 0;
+ mes.Message = "鏌ヨ鎴愬姛!";
+ mes.data = list;
+
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.Message = e.Message;
+ mes.data = null;
+ }
+ return mes;
+ }
+ #endregion
}
}
\ No newline at end of file
--
Gitblit v1.9.3