From 0f97c5a757e2f0ffd5a98f276508e90924c70200 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期二, 05 十二月 2023 21:10:29 +0800
Subject: [PATCH] App个人计件工资(不包含班组,只核算个人报工)
---
VueWebCoreApi/ApiGroup/OpenApiGroup.cs | 4 +
VueWebCoreApi/DLL/DAL/AppPersonalDAL.cs | 67 ++++++++++++++++++++++
VueWebCoreApi/DLL/BLL/AppPersonalBLL.cs | 20 ++++++
VueWebCoreApi/Controllers/AppPersonalController.cs | 46 +++++++++++++++
4 files changed, 136 insertions(+), 1 deletions(-)
diff --git a/VueWebCoreApi/ApiGroup/OpenApiGroup.cs b/VueWebCoreApi/ApiGroup/OpenApiGroup.cs
index 2f2f7ea..76370c8 100644
--- a/VueWebCoreApi/ApiGroup/OpenApiGroup.cs
+++ b/VueWebCoreApi/ApiGroup/OpenApiGroup.cs
@@ -39,6 +39,8 @@
[Description("鍗曟嵁鎵撳嵃")]
鍗曟嵁鎵撳嵃 = 15,
[Description("鐪嬫澘绠$悊")]
- 鐪嬫澘绠$悊=16
+ 鐪嬫澘绠$悊=16,
+ [Description("App涓汉涓績")]
+ App涓汉涓績 = 20
}
}
diff --git a/VueWebCoreApi/Controllers/AppPersonalController.cs b/VueWebCoreApi/Controllers/AppPersonalController.cs
new file mode 100644
index 0000000..4c576a3
--- /dev/null
+++ b/VueWebCoreApi/Controllers/AppPersonalController.cs
@@ -0,0 +1,46 @@
+锘縰sing Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using VueWebCoreApi.DLL.BLL;
+using VueWebCoreApi.Models;
+using VueWebCoreApi.Tools;
+
+namespace VueWebCoreApi.Controllers
+{
+ [ApiExplorerSettings(GroupName = "App涓汉涓績")]
+ [ApiController]
+ [Route("api/[controller]")]
+ public class AppPersonalController : Controller
+ {
+ //瀹氫箟鍏ㄥ眬淇℃伅杩斿洖鍙橀噺
+ ToMessage mes = new ToMessage();
+ RedisHelper redis = new RedisHelper();
+
+ #region[App涓汉璁′欢宸ヨ祫]
+ /// <summary>
+ /// App涓汉璁′欢宸ヨ祫
+ /// </summary>
+ /// <param name="compute">璁$畻鏂瑰紡:鏈亾璁$畻銆侀�愰亾璁$畻</param>
+ /// <param name="Ratetime">鏃堕棿</param>
+ /// <returns></returns>
+ [Route(template: "PieceRateWage")]
+ [HttpGet]
+ public JsonResult PieceRateWage(string compute, string Ratetime)
+ {
+ var token = HttpContext.Request.Headers["Token"].ToString();
+ User us = JwtTools.Denocode(token.ToString());
+ string startopendate = ""; //寮�濮嬫椂闂�
+ string endclosedate = ""; //缁撴潫鏃堕棿
+ if (Ratetime != "" && Ratetime != null)
+ {
+ startopendate = Ratetime.Split('~')[0].ToString();
+ endclosedate = Ratetime.Split('~')[1].ToString();
+ }
+ mes = AppPersonalBLL.PieceRateWage(compute, us, startopendate, endclosedate);
+ return Json(mes);
+ }
+ #endregion
+ }
+}
diff --git a/VueWebCoreApi/DLL/BLL/AppPersonalBLL.cs b/VueWebCoreApi/DLL/BLL/AppPersonalBLL.cs
new file mode 100644
index 0000000..4f2c534
--- /dev/null
+++ b/VueWebCoreApi/DLL/BLL/AppPersonalBLL.cs
@@ -0,0 +1,20 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using VueWebCoreApi.DLL.DAL;
+using VueWebCoreApi.Models;
+using VueWebCoreApi.Tools;
+
+namespace VueWebCoreApi.DLL.BLL
+{
+ public class AppPersonalBLL
+ {
+ #region[App涓汉璁′欢宸ヨ祫]
+ public static ToMessage PieceRateWage(string compute, User us, string startopendate, string endclosedate)
+ {
+ return AppPersonalDAL.PieceRateWage(compute, us, startopendate, endclosedate);
+ }
+ #endregion
+ }
+}
diff --git a/VueWebCoreApi/DLL/DAL/AppPersonalDAL.cs b/VueWebCoreApi/DLL/DAL/AppPersonalDAL.cs
new file mode 100644
index 0000000..4c080d7
--- /dev/null
+++ b/VueWebCoreApi/DLL/DAL/AppPersonalDAL.cs
@@ -0,0 +1,67 @@
+锘縰sing Dapper;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Globalization;
+using System.Linq;
+using System.Threading.Tasks;
+using VueWebCoreApi.Models;
+using VueWebCoreApi.Tools;
+
+namespace VueWebCoreApi.DLL.DAL
+{
+ public class AppPersonalDAL
+ {
+ public static DataTable dt; //瀹氫箟鍏ㄥ眬鍙橀噺dt
+ public static bool res; //瀹氫箟鍏ㄥ眬鍙橀噺dt
+
+ public static ToMessage mes = new ToMessage(); //瀹氫箟鍏ㄥ眬杩斿洖淇℃伅瀵硅薄
+ public static string strProcName = ""; //瀹氫箟鍏ㄥ眬sql鍙橀噺
+ public static List<SqlParameter> listStr = new List<SqlParameter>(); //瀹氫箟鍏ㄥ眬鍙傛暟闆嗗悎
+ public static SqlParameter[] parameters; //瀹氫箟鍏ㄥ眬SqlParameter鍙傛暟鏁扮粍
+
+
+ #region[App涓汉璁′欢宸ヨ祫]
+ public static ToMessage PieceRateWage(string compute, User us, string startopendate, string endclosedate)
+ {
+ Dictionary<object, object> dList = new Dictionary<object, object>();
+ var dynamicParams = new DynamicParameters();
+ string search = "";
+ string sql = "";
+ try
+ {
+ //瀛樺偍杩囩▼鍚�
+ // --------------鏌ヨ鎶ュ伐鏁般�佽壇鍝佹墸闄ゃ�佽绠楀伐璧勬敹鍏�--------------
+ sql = @"h_p_JLApp_PieceRateWageSummary";
+ dynamicParams.Add("@compute", compute);
+ dynamicParams.Add("@usercode", "998");
+ dynamicParams.Add("@startopendate", startopendate + " 00:00:00");
+ dynamicParams.Add("@endclosedate", endclosedate + " 23:59:59");
+ var data0 = DapperHelper.selectProcedure(sql, dynamicParams);
+ dList.Add("dt0", data0);
+
+ // --------------鏌ヨ鎶ュ伐鏄庣粏(鎸夌収宸ュ崟銆佷骇鍝併�佸伐搴忓垎缁�)--------------
+ sql = @"h_p_JLApp_PieceRateWageDetailed";
+ dynamicParams.Add("@compute", compute);
+ dynamicParams.Add("@usercode", "998");
+ dynamicParams.Add("@startopendate", startopendate + " 00:00:00");
+ dynamicParams.Add("@endclosedate", endclosedate + " 23:59:59");
+ var data1 = DapperHelper.selectProcedure(sql, dynamicParams);
+ dList.Add("dt1", data1);
+ mes.code = "200";
+ mes.message = "鏌ヨ鎴愬姛!";
+ mes.data = dList;
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.count = 0;
+ mes.message = e.Message;
+ mes.data = null;
+ }
+ return mes;
+ }
+ #endregion
+ }
+}
--
Gitblit v1.9.3