From 6d4179872a0ae89997ba47be162d53f600731c0d Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期五, 27 五月 2022 19:14:18 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/SCGL/Sc_MESStopWorkBillController.cs | 134 ++++++++++++++++++++++++++++++++++++++------
1 files changed, 116 insertions(+), 18 deletions(-)
diff --git a/WebAPI/Controllers/SCGL/Sc_MESStopWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESStopWorkBillController.cs
index c0eb485..0e0a441 100644
--- a/WebAPI/Controllers/SCGL/Sc_MESStopWorkBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_MESStopWorkBillController.cs
@@ -13,11 +13,17 @@
//鐢熶骇鍋滃伐鍗旵ontroller
public class Sc_MESStopWorkBillController : ApiController
{
- public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+
+ public DBUtility.ClsPub.Enum_BillStatus BillStatus;//鍗曟嵁鐘舵�侊紙鏂板锛屼慨鏀癸紝娴忚锛屾洿鏂板崟浠凤紝鍙樻洿锛�
private json objJsonResult = new json();
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
DataSet ds;
+ //鑾峰彇绯荤粺鍙傛暟
+ Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+
+ public DAL.ClsSc_MESStopWorkBill BillNew = new DAL.ClsSc_MESStopWorkBill(); //瀵瑰簲鍗曟嵁绫�
+ public DAL.ClsSc_MESStopWorkBill BillOld = new DAL.ClsSc_MESStopWorkBill(); //瀵瑰簲鍗曟嵁绫�
#region 鍋滃伐鍗�
@@ -182,17 +188,18 @@
/// <returns></returns>
[Route("Sc_MESStopWorkBill/DeltetMESStopWorkBill")]
[HttpGet]
- public object DeltetMESStopWorkBill(string HInterID)
+ public object DeltetMESStopWorkBill(string HInterID,string UserName)
{
+ DBUtility.ClsPub.CurUserName = UserName;
//缂栬緫鏉冮檺
- //if (!DBUtility.ClsPub.Security_Log("Sc_MESStopWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
- //{
- // objJsonResult.code = "0";
- // objJsonResult.count = 0;
- // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
- // objJsonResult.data = null;
- // return objJsonResult;
- //}
+ if (!DBUtility.ClsPub.Security_Log_second("MES_MESStopWorkBill_Delete", 1, false, DBUtility.ClsPub.CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
Int64 lngBillKey = 0;
@@ -273,7 +280,7 @@
try
{
//瀹℃牳鏉冮檺
- if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+ if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -355,8 +362,8 @@
}
else
{
- objJsonResult.code = "1";
- objJsonResult.count = 1;
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
objJsonResult.data = null;
return objJsonResult;
@@ -375,8 +382,8 @@
}
else
{
- objJsonResult.code = "1";
- objJsonResult.count = 1;
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
objJsonResult.data = null;
return objJsonResult;
@@ -413,10 +420,34 @@
string msg1 = _value.ToString();
string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
string msg2 = sArray[0].ToString();
+ string UserName = sArray[1].ToString();
+ string refSav = sArray[2].ToString();
+ DBUtility.ClsPub.CurUserName = UserName;
+
+ //淇濆瓨鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("MES_MESStopWorkBill_Edit", 1, false, DBUtility.ClsPub.CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+ string s = "";
+ int sYear = 0;
+ int sPeriod = 0;
+ if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DateTime.Now, ref sYear, ref sPeriod, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = s;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
- string UserName = "";
ListModels oListModels = new ListModels();
try
{
@@ -427,7 +458,57 @@
lsmain = oListModels.getObjectByJson_Gy_MESStopWorkBillMain(msg2);
foreach (Models.ClsSc_MESStopWorkBillMain oItem in lsmain)
{
+ if (refSav == "Add")
+ {
+ //鍗曟嵁鍙锋槸鍚﹂噸澶�
+ if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ if (refSav == "Update")
+ {
+ if (BillOld.ShowBill(oItem.HInterID, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹湁璇紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //鍒ゆ柇鏄惁鍙紪杈�
+ if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (BillOld.omodel.HBillStatus > 1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹浜庝笉鍙紪杈戠姸鎬侊紝涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = s + "锛屼笉鍏佽淇敼";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+
//oItem.HMaker = "";
+ DBUtility.ClsPub.CurUserName = oItem.HMaker;
UserName = oItem.HMaker; //鍒跺崟浜�
oItem.HBillType = "3789";
oItem.HBillSubType = "3789";
@@ -452,16 +533,33 @@
bool bResult;
if (oBill.omodel.HInterID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ if (bResult)
+ {
+ objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //杩斿洖涓籌D
+ //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ string sReturn = "";
+ if (oSystemParameter.ShowBill(ref sReturn) == true)
+ {
+ if (oSystemParameter.omodel.Sc_MESStopWorkBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ {
+ objJsonResult.Verify = "Y";
+ }
+ else
+ {
+ objJsonResult.Verify = "N";
+ }
+ }
+ }
}
else
{
bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ objJsonResult.Verify = "N";
}
if (bResult)
{
- objJsonResult.code = "0";
+ objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
//WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
--
Gitblit v1.9.1