yl
2025-10-30 8d7c6ffe00e5b05017c426a4cb97d59a3a95a20d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using 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", us.usercode);
                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", us.usercode);
                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
    }
}