From 4bf3ca7fc8e3cceba62d6617724cac3cbc919746 Mon Sep 17 00:00:00 2001
From: ch <37327@LLOOCCY>
Date: 星期一, 15 八月 2022 21:53:14 +0800
Subject: [PATCH] 工资系统部署测试
---
WebAPI/Controllers/生产管理/报工台工序/Sc_MESReturnStepWorkBillController.cs | 250 ++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 232 insertions(+), 18 deletions(-)
diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_MESReturnStepWorkBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_MESReturnStepWorkBillController.cs"
index df6ff46..4e7ab44 100644
--- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_MESReturnStepWorkBillController.cs"
+++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\346\212\245\345\267\245\345\217\260\345\267\245\345\272\217/Sc_MESReturnStepWorkBillController.cs"
@@ -1,4 +1,6 @@
-锘縰sing System;
+锘縰sing DBUtility;
+using Newtonsoft.Json.Linq;
+using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
@@ -38,6 +40,7 @@
{
ds = Sc_GetMESReturnStepWorkBill(sWhere);
+
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
@@ -58,12 +61,12 @@
{
if (sWhere == null || sWhere.Equals(""))
{
- return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MESReturnWorkBillList_NEW ", "h_v_Sc_MESReturnWorkBillList_NEW");
+ return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MESReturnWorkBillList_NEW order by hmainid desc ", "h_v_Sc_MESReturnWorkBillList_NEW");
}
else
{
string sql1 = "select * from h_v_Sc_MESReturnWorkBillList_NEW where 1 = 1 ";
- string sql = sql1 + sWhere;
+ string sql = sql1 + sWhere+ " order by hmainid desc ";
return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MESReturnWorkBillList_NEW");
}
@@ -71,18 +74,53 @@
#endregion
- #region[杩斿伐鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁]
- [Route("Sc_MESBeginStepWorkBill/Sc_MESBeginStepWorkBillListCheckDetai")]
+ #region 鑾峰彇杩斿伐宸ュ簭涓嬫媺妗嗘暟鎹�(鎵�鏈夊伐搴�)
+ [Route("Sc_MESReturnStepWorkBill/GetMESReturnStepSelectBill")]
[HttpGet]
- public ApiResult<DataSet> Sc_MESBeginStepWorkBillListCheckDetai(string HID)
+ public object GetMESReturnStepSelectBill()
+ {
+ try
+ {
+ ds = oCN.RunProcReturn("select HItemID,宸ュ簭浠g爜,宸ュ簭鍚嶇О from h_v_Gy_ProcessList ", "h_v_Gy_ProcessList");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犲伐搴忔暟鎹�,璇风淮鎶わ紒";
+ objJsonResult.data =null;
+ }
+ return objJsonResult;
+ }
+ catch (Exception ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region[杩斿伐鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁]
+ [Route("Sc_MESReturnStepWorkBill/Sc_MESReturnStepWorkBillListCheckDetai")]
+ [HttpGet]
+ public ApiResult<DataSet> Sc_MESReturnStepWorkBillListCheckDetai(string HID)
{
if (string.IsNullOrEmpty(HID))
return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MESBeginWorkBillList_NEW where hmainid= " + HID + " ", "h_v_Sc_MESBeginWorkBillList_NEW");
+ var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MESReturnWorkBillList where hmainid= " + HID + " ", "h_v_Sc_MESReturnWorkBillList");
if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
- return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄥ紑宸ュ崟鍙�" };
+ return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄨ繑宸ュ崟鍙�" };
return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
}
@@ -99,7 +137,7 @@
{
DBUtility.ClsPub.CurUserName = UserName;
//缂栬緫鏉冮檺
- if (!DBUtility.ClsPub.Security_Log_second("MES_MESReturnWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
+ if (!DBUtility.ClsPub.Security_Log_second("Sc_ProcessPlan_Drop", 1, false, DBUtility.ClsPub.CurUserName))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -181,19 +219,19 @@
[HttpGet]
public object AuditReturnStepProcessReportList(int HInterID, int IsAudit, string CurUserName)
{
- string ModRightNameCheck = "MES_MESReturnWorkBill_Check";
+ string ModRightNameCheck = "Sc_ReturnStepProcess_Check";
DBUtility.ClsPub.CurUserName = CurUserName;
try
{
//瀹℃牳鏉冮檺
- if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, true, CurUserName))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
+ //if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
if (HInterID <= 0)
{
objJsonResult.code = "0";
@@ -308,6 +346,182 @@
}
#endregion
+ #region 杩斿伐鍗曚繚瀛�/缂栬緫
+ /// <summary>
+ /// 杩斿伐鍗�
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ [Route("Sc_MESReturnStepWorkBill/SaveGetMESReturnStepWorkFrom")]
+ [HttpPost]
+ public object SaveGetMESReturnStepWorkFrom([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 UserName = sArray[1].ToString();
+ string refSav = sArray[2].ToString();
+ DBUtility.ClsPub.CurUserName = UserName;
+
+ //淇濆瓨鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Sc_ProcessPlan_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;
+ }
+
+ ListModels oListModels = new ListModels();
+ try
+ {
+ DLL.ClsSc_MESReturnStepWorkBill oBill = new DLL.ClsSc_MESReturnStepWorkBill();
+ List<Model.ClsSc_ProcessPlanMain> lsmain = new List<Model.ClsSc_ProcessPlanMain>();
+ msg2 = msg2.Replace("\\", "");
+ msg2 = msg2.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_Gy_MESReturnWorkFrom(msg2);
+ foreach (Model.ClsSc_ProcessPlanMain 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;
+ }
+ }
+
+ DBUtility.ClsPub.CurUserName = oItem.HMaker;
+ oItem.HBillType = "3718";
+ oItem.HBillSubType = "3718";
+ oItem.HBillStatus = 1; //鍗曟嵁鐘舵�侊紙1鏈锛�2瀹℃牳閫氳繃锛�3鍏抽棴锛�4浣滃簾锛�5瀹℃牳閫�鍥�,6瀹℃牳涓�,7宸查槄锛�8宸插洖澶嶏紝9缁撴锛�10楠岃瘉,11涓嬭揪锛�12寮�宸�,13鐢宠瀹℃壒,15鐢宠妫�楠岋紝16 鍒ゅ畾鍚堟牸锛�17鍒ゅ畾涓嶅悎鏍硷級
+ oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+ oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+ if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ oBill.omodel = oItem;
+ }
+
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ if (oBill.omodel.HInterID == 0)
+ {
+
+ 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_MESReturnWorkBill_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.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ 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.Message;
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ #endregion
#endregion
}
}
--
Gitblit v1.9.1