| | |
| | | |
| | | |
| | | #region[班组工资报表记录查询] |
| | | public static ToMessage GroupSalaryReportSearch(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 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 A.step_code not in @s1"; |
| | | dynamicParams.Add("@s1", s1); |
| | | } |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | |
| | | isnull(S.unprice,0) as unprice,A.good_qty*isnull(S.unprice,0) as usermoney,U.username as lm_user,A.lm_date,B.report_date |
| | | 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 and P.isend='Y' |
| | | inner join TK_Wrk_Step P on A.wo_code=P.wo_code and A.step_code=P.step_code |
| | | left join TK_Wrk_Man K on A.wo_code=K.wo_code |
| | | left join TGroup G on B.usergroup_code=G.group_code |
| | | left join TPrteEqp_Stad S on A.materiel_code=S.materiel_code and A.eqp_code=S.eqp_code and A.step_code=S.step_code and K.route_code=S.route_code and K.wkshp_code=S.wkspcode |
| | | left join TMateriel_Info M on A.materiel_code=M.partcode |
| | | left join TPrteEqp_Stad S on A.materiel_code=S.materiel_code and A.eqp_code=S.eqp_code and A.step_code=S.step_code and K.route_code=S.route_code |
| | | left join TStep T on A.step_code=T.stepcode |
| | | left join TUser U on A.lm_user=U.usercode |
| | | where " + search; |
| | |
| | | #endregion |
| | | |
| | | #region[班组工资报表记录导出] |
| | | public static ToMessage GroupSalaryReportExcelSearch(string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string username, string operopendate, string operclosedate) |
| | | public static ToMessage GroupSalaryReportExcelSearch(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 A.step_code not in @s1"; |
| | | dynamicParams.Add("@s1", s1); |
| | | } |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | |
| | | A.good_qty as 报工数量,isnull(S.unprice,0) as 工序单价,A.good_qty*isnull(S.unprice,0) as 计件工资,U.username as 操作人员,A.lm_date as 操作时间,B.report_date as 报工时间 |
| | | 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 and P.isend='Y' |
| | | inner join TK_Wrk_Step P on A.wo_code=P.wo_code and A.step_code=P.step_code |
| | | left join TK_Wrk_Man K on A.wo_code=K.wo_code |
| | | left join TGroup G on B.usergroup_code=G.group_code |
| | | left join TPrteEqp_Stad S on A.materiel_code=S.materiel_code and A.eqp_code=S.eqp_code and A.step_code=S.step_code and K.route_code=S.route_code and K.wkshp_code=S.wkspcode |
| | | left join TPrteEqp_Stad S on A.materiel_code=S.materiel_code and A.eqp_code=S.eqp_code and A.step_code=S.step_code and K.route_code=S.route_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 A.lm_user=U.usercode |
| | |
| | | (select distinct count(*) from TK_Wrk_RecordSub S where S.m_id=B.m_id) as colum |
| | | 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 and P.isend='Y' |
| | | inner join TK_Wrk_Step P on A.wo_code=P.wo_code and A.step_code=P.step_code |
| | | left join TK_Wrk_Man K on A.wo_code=K.wo_code |
| | | left join TGroup G on B.usergroup_code=G.group_code |
| | | left join TPrteEqp_Stad S on A.materiel_code=S.materiel_code and A.eqp_code=S.eqp_code and A.step_code=S.step_code and K.route_code=S.route_code and K.wkshp_code=S.wkspcode |
| | | left join TPrteEqp_Stad S on A.materiel_code=S.materiel_code and A.eqp_code=S.eqp_code and A.step_code=S.step_code and K.route_code=S.route_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 |
| | |
| | | (select distinct count(*) from TK_Wrk_RecordSub S where S.m_id=B.m_id) as colum |
| | | 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 and P.isend='Y' |
| | | inner join TK_Wrk_Step P on A.wo_code=P.wo_code and A.step_code=P.step_code |
| | | left join TK_Wrk_Man K on A.wo_code=K.wo_code |
| | | left join TGroup G on B.usergroup_code=G.group_code |
| | | left join TPrteEqp_Stad S on A.materiel_code=S.materiel_code and A.eqp_code=S.eqp_code and A.step_code=S.step_code and K.route_code=S.route_code and K.wkshp_code=S.wkspcode |
| | | left join TPrteEqp_Stad S on A.materiel_code=S.materiel_code and A.eqp_code=S.eqp_code and A.step_code=S.step_code and K.route_code=S.route_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 |