From b6df3c3b0da45b6a70dd8ea152e8ea4293740a64 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期三, 16 二月 2022 08:50:16 +0800
Subject: [PATCH] 拆码打印
---
WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs | 165 +++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 149 insertions(+), 16 deletions(-)
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs
index 0f5157b..0a4fd5c 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs
@@ -1,4 +1,5 @@
-锘縰sing System;
+锘縰sing Newtonsoft.Json.Linq;
+using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
@@ -22,10 +23,19 @@
#region 璁惧鐐规瑙勭▼鍗曞垪琛�
[Route("Sb_EquipDotCheckRuleBill/GetEquipDotCheckRuleList")]
[HttpGet]
- public object GetEquipDotCheckRuleList(string sWhere)
+ public object GetEquipDotCheckRuleList(string sWhere,string user)
{
try
{
+ if (!DBUtility.ClsPub.Security_Log("Sb_EquipDotCheckRuleBillList", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
if (sWhere == null || sWhere.Equals(""))
{
ds = oCN.RunProcReturn("select * from h_v_Sb_EquipDotCheckRuleList " + sWhere + " order by hmainid desc", "h_v_Sb_EquipDotCheckRuleList");
@@ -67,8 +77,16 @@
#region 璁惧鐐规瑙勭▼璁板綍鍒犻櫎鍔熻兘
[Route("Sb_EquipDotCheckRuleBill/DeleteEquipDotCheckRuleBillList")]
[HttpGet]
- public object DeleteEquipDotCheckRuleBillList(string HInterID)
+ public object DeleteEquipDotCheckRuleBillList(string HInterID,string user)
{
+ if (!DBUtility.ClsPub.Security_Log("Sb_EquipDotCheckRuleBill_Delete", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
Int64 lngBillKey = 0;
lngBillKey = DBUtility.ClsPub.isLong(HInterID);
if (lngBillKey == 0)
@@ -86,20 +104,12 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�";
+ objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵�侊紒";
objJsonResult.data = null;
return objJsonResult;
}
- if (oBill.omodel.HChecker != "")
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
-
- bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+ bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo);
if (IsDete)
{
objJsonResult.code = "0";
@@ -154,7 +164,7 @@
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
if (sqlWhere == null || sqlWhere.Equals(""))
{
- ds = oCN.RunProcReturn("select 鐐规椤圭洰ID,鐐规椤圭洰,鐐规閮ㄤ綅,鍏蜂綋瑕佹眰,璐熻矗浜篒D,璐熻矗浜轰唬鐮�,璐熻矗浜�,瀛愬娉� from h_v_Sb_EquipDotCheckRuleList", "h_v_Sb_EquipDotCheckRuleList");
+ ds = oCN.RunProcReturn("select 鐐规椤圭洰ID HDotCheckItemID,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,瀛愬娉� HRemark from h_v_Sb_EquipDotCheckRuleList", "h_v_Sb_EquipDotCheckRuleList");
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
@@ -162,7 +172,7 @@
}
else
{
- string sql1 = "select 鐐规椤圭洰ID,鐐规椤圭洰,鐐规閮ㄤ綅,鍏蜂綋瑕佹眰,璐熻矗浜篒D,璐熻矗浜轰唬鐮�,璐熻矗浜�,瀛愬娉� from h_v_Sb_EquipDotCheckRuleList where 1 = 1 ";
+ string sql1 = "select 鐐规椤圭洰ID HDotCheckItemID,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,瀛愬娉� HRemark from h_v_Sb_EquipDotCheckRuleList where 1 = 1 ";
string sql = sql1 + sqlWhere;
ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckRuleList");
objJsonResult.code = "0";
@@ -181,5 +191,128 @@
return objJsonResult;
}
#endregion
+
+ #region 璁惧鐐规瑙勭▼鍗� 淇濆瓨/缂栬緫
+ /// <summary>
+ /// 璁惧鐐规瑙勭▼鍗� 淇濆瓨
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ [Route("Sb_EquipDotCheckRuleBill/SaveEquipDotCheckRuleBill")]
+ [HttpPost]
+ public object SaveEquipDotCheckRuleBill([FromBody] JObject msg)
+ {
+ var _value = msg["msg"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString();
+ string msg3 = sArray[1].ToString();
+ string msg4 = sArray[2].ToString();
+
+
+ string UserName = "";
+ ListModels oListModels = new ListModels();
+ try
+ {
+ if (!DBUtility.ClsPub.Security_Log("Sb_EquipDotCheckRuleBill_Edit", 1, false, msg4))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ DLL.ClsSb_EquipDotCheckRuleBill oBill = new DLL.ClsSb_EquipDotCheckRuleBill();
+ List<Models.ClsSb_EquipDotCheckRuleBillMain> lsmain = new List<Models.ClsSb_EquipDotCheckRuleBillMain>();
+ msg2 = msg2.Replace("\\", "");
+ msg2 = msg2.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_Sb_EquipDotCheckRuleBillMain(msg2);
+ foreach (Models.ClsSb_EquipDotCheckRuleBillMain oItem in lsmain)
+ {
+ UserName = oItem.HMaker; //鍒跺崟浜�
+ oItem.HBillType = "3913";
+ oItem.HBillSubType = "3913";
+ DBUtility.ClsPub.CurUserName = UserName;
+ oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
+ oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+
+ if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ oBill.omodel = oItem;
+ }
+
+ //琛ㄤ綋鏁版嵁 鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+ msg3 = msg3.Substring(1, msg3.Length - 2);
+ msg3 = msg3.Replace("\\", "");
+ msg3 = msg3.Replace("\n", ""); //\n
+ //msg2 = msg2.Replace("'", "鈥�");
+ List<Models.ClsSb_EquipDotCheckRuleBillSub> ls = new List<Models.ClsSb_EquipDotCheckRuleBillSub>();
+ ls = oListModels.getObjectByJson_Sb_EquipDotCheckRuleBillSub(msg3);
+ int i = 0;
+ foreach (Models.ClsSb_EquipDotCheckRuleBillSub oItemSub in ls)
+ {
+
+ i++;
+ oItemSub.HEntryID = i;
+ //oItemSub.HCloseMan = ""; //琛屽叧闂�
+ oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+ oItemSub.HCloseType = false; //鍏抽棴绫诲瀷
+ //oItemSub.HRemark = ""; //澶囨敞
+ oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮�
+ oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮�
+ //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿
+ //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
+ oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺
+
+ oBill.DetailColl_Mater.Add(oItemSub);
+
+ }
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ if (oBill.omodel.HInterID == 0)
+ {
+ // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ else
+ {
+ bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ if (bResult)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ #endregion
}
}
--
Gitblit v1.9.1