| | |
| | | |
| | | |
| | | #region[班组工资报表记录查询] |
| | | public static ToMessage GroupSalaryReportSearch(string compute, string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string username, string operopendate, string operclosedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage GroupSalaryReportSearch(string compute, string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string username, string operopendate, string operclosedate,string rejectstepcode, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | dynamicParams.Add("@operopendate", operopendate + " 00:00:00"); |
| | | dynamicParams.Add("@operclosedate", operclosedate + " 23:59:59"); |
| | | } |
| | | if (rejectstepcode != "" && rejectstepcode != null) |
| | | { |
| | | string[] s1 = Array.ConvertAll<string, string>(rejectstepcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string分割转string[] |
| | | search += "and E.wksp_code not in @s1"; |
| | | dynamicParams.Add("@s1", s1); |
| | | } |
| | | |
| | | if (search == "") |
| | | { |
| | |
| | | left join TMateriel_Info M on A.materiel_code=M.partcode |
| | | left join TStep T on A.step_code=T.stepcode |
| | | left join TUser U on A.lm_user=U.usercode |
| | | left join TEqpInfo E on A.eqp_code=E.code |
| | | where G.group_code<>'' " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | |
| | | #endregion |
| | | |
| | | #region[班组工资报表记录导出] |
| | | public static ToMessage GroupSalaryReportExcelSearch(string compute, string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string username, string operopendate, string operclosedate) |
| | | public static ToMessage GroupSalaryReportExcelSearch(string compute, string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string username, string operopendate, string operclosedate,string rejectstepcode) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | dynamicParams.Add("@operopendate", operopendate + " 00:00:00"); |
| | | dynamicParams.Add("@operclosedate", operclosedate + " 23:59:59"); |
| | | } |
| | | if (rejectstepcode != "" && rejectstepcode != null) |
| | | { |
| | | string[] s1 = Array.ConvertAll<string, string>(rejectstepcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string分割转string[] |
| | | search += "and E.wksp_code not in @s1"; |
| | | dynamicParams.Add("@s1", s1); |
| | | } |
| | | |
| | | if (search == "") |
| | | { |
| | |
| | | left join TMateriel_Info M on A.materiel_code=M.partcode |
| | | left join TStep T on A.step_code=T.stepcode |
| | | left join TUser U on A.lm_user=U.usercode |
| | | left join TEqpInfo E on A.eqp_code=E.code |
| | | where G.group_code<>'' " + search; |
| | | DataTable data = DapperHelper.selectdata(sql, dynamicParams); |
| | | data.TableName = "Table"; //设置DataTable的名称 |
| | |
| | | |
| | | |
| | | #region[人员工资明细报表] |
| | | public static ToMessage PeopleSalaryReportSearch(string compute, string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string reportname, string reportopendate, string reportclosedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage PeopleSalaryReportSearch(string compute, string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string reportname, string reportopendate, string reportclosedate,string rejectstepcode, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | dynamicParams.Add("@reportopendate", reportopendate + " 00:00:00"); |
| | | dynamicParams.Add("@reportclosedate", reportclosedate + " 23:59:59"); |
| | | } |
| | | |
| | | if (rejectstepcode != "" && rejectstepcode != null) |
| | | { |
| | | string[] s1 = Array.ConvertAll<string, string>(rejectstepcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string分割转string[] |
| | | search += "and AA.wksp_code not in @s1"; |
| | | dynamicParams.Add("@s1", s1); |
| | | } |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | |
| | | var total = 0; //总条数 |
| | | var sql = @"select AA.wo_code,AA.partcode,AA.partname,AA.partspec,AA.stepcode,AA.stepname, |
| | | AA.task_qty,AA.group_code,AA.group_name,AA.report_qty,AA.unprice,AA.ratio,AA.isend, |
| | | AA.moneys as usermoney,AA.username,AA.report_date |
| | | AA.moneys as usermoney,AA.username,AA.report_date,AA.wksp_code |
| | | from ( |
| | | select distinct A.wo_code,M.partcode,M.partname,M.partspec,T.stepcode,T.stepname, |
| | | A.task_qty,G.group_code,G.group_name,B.report_qty,isnull(S.unprice,0) as unprice,B.ratio,P.isend, |
| | | (B.report_qty*isnull(S.unprice,0))*(B.ratio/100) as moneys,U.username,B.report_date |
| | | (B.report_qty*isnull(S.unprice,0))*(B.ratio/100) as moneys,U.username,B.report_date,E.wksp_code |
| | | from TK_Wrk_Record A |
| | | inner join TK_Wrk_RecordSub B on A.id=B.m_id |
| | | inner join TK_Wrk_Step P on A.wo_code=P.wo_code and A.step_code=P.step_code |
| | |
| | | left join TMateriel_Info M on A.materiel_code=M.partcode |
| | | left join TStep T on A.step_code=T.stepcode |
| | | left join TUser U on B.report_person=U.usercode |
| | | left join TEqpInfo E on A.eqp_code=E.code |
| | | ) as AA |
| | | where " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | |
| | | #endregion |
| | | |
| | | #region[人员工资明细报表导出] |
| | | public static ToMessage PeopleSalaryReportExcelSearch(string compute, string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string reportname, string reportopendate, string reportclosedate) |
| | | public static ToMessage PeopleSalaryReportExcelSearch(string compute, string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string reportname, string reportopendate, string reportclosedate,string rejectstepcode) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | dynamicParams.Add("@reportopendate", reportopendate + " 00:00:00"); |
| | | dynamicParams.Add("@reportclosedate", reportclosedate + " 23:59:59"); |
| | | } |
| | | |
| | | if (rejectstepcode != "" && rejectstepcode != null) |
| | | { |
| | | string[] s1 = Array.ConvertAll<string, string>(rejectstepcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string分割转string[] |
| | | search += "and AA.stepcode not in @s1"; |
| | | dynamicParams.Add("@s1", s1); |
| | | } |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | |
| | | var total = 0; //总条数 |
| | | var sql = @"select AA.wo_code as 工单编号,AA.partcode as 产品编码,AA.partname as 产品名称,AA.partspec as 产品规格,AA.stepcode as 工序编码,AA.stepname as 工序名称,AA.isend as 是否末道工序, |
| | | AA.task_qty as 任务数量,AA.group_code as 生产班组编码,AA.group_name as 生产班组名称,AA.report_qty as 报工数量,AA.unprice as 工序单价,AA.ratio as 分配比例, |
| | | AA.moneys as 计件工资,AA.username as 报工人员,AA.report_date as 报工时间 |
| | | AA.moneys as 计件工资,AA.username as 报工人员,AA.report_date as 报工时间,AA.wksp_code as 车间编码 |
| | | from ( |
| | | select distinct A.wo_code,M.partcode,M.partname,M.partspec,T.stepcode,T.stepname, |
| | | A.task_qty,G.group_code,G.group_name,B.report_qty,isnull(S.unprice,0) as unprice,B.ratio,P.isend, |
| | | (B.report_qty*isnull(S.unprice,0))*(B.ratio/100) as moneys,U.username,B.report_date |
| | | (B.report_qty*isnull(S.unprice,0))*(B.ratio/100) as moneys,U.username,B.report_date,E.wksp_code |
| | | from TK_Wrk_Record A |
| | | inner join TK_Wrk_RecordSub B on A.id=B.m_id |
| | | inner join TK_Wrk_Step P on A.wo_code=P.wo_code and A.step_code=P.step_code |
| | |
| | | left join TMateriel_Info M on A.materiel_code=M.partcode |
| | | left join TStep T on A.step_code=T.stepcode |
| | | left join TUser U on B.report_person=U.usercode |
| | | left join TEqpInfo E on A.eqp_code=E.code |
| | | ) as AA |
| | | where " + search; |
| | | DataTable data = DapperHelper.selectdata(sql, dynamicParams); |