From 3f32fa98d6d3e4e7800a931b222fe269e68d0dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 11 Mar 2022 10:18:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AddUpDeductionGetDetailListCmd.java | 11 ++++--- .../AddUpSituationGetDetailListCmd.java | 29 +++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/cmd/datacollection/AddUpDeductionGetDetailListCmd.java b/src/com/engine/salary/cmd/datacollection/AddUpDeductionGetDetailListCmd.java index 92715a12c..4796b1722 100644 --- a/src/com/engine/salary/cmd/datacollection/AddUpDeductionGetDetailListCmd.java +++ b/src/com/engine/salary/cmd/datacollection/AddUpDeductionGetDetailListCmd.java @@ -5,8 +5,10 @@ import com.engine.common.biz.AbstractCommonCommand; import com.engine.common.entity.BizLogContext; import com.engine.core.interceptor.CommandContext; import com.engine.salary.biz.AddUpDeductionBiz; +import com.engine.salary.biz.EmployBiz; import com.engine.salary.component.SalaryWeaTable; import com.engine.salary.entity.datacollection.AddUpDeduction; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam; import com.engine.salary.exception.SalaryRunTimeException; @@ -32,6 +34,7 @@ public class AddUpDeductionGetDetailListCmd extends AbstractCommonCommand execute(CommandContext commandContext) { + EmployBiz employBiz = new EmployBiz(); AddUpDeductionBiz biz = new AddUpDeductionBiz(); AddUpDeductionQueryParam queryParam = (AddUpDeductionQueryParam) params.get("queryParam"); @@ -49,10 +52,10 @@ public class AddUpDeductionGetDetailListCmd extends AbstractCommonCommand employeeList = employeeService.getEmployeeByIds(Collections.singletonList(po.getEmployeeId()), tenantKey); -// if (CollectionUtils.isEmpty(employeeList)) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100340, "员工信息不存在")); -// } + List employeeList = employBiz.getEmployeeByIds(Collections.singletonList(po.getEmployeeId())); + if (CollectionUtils.isEmpty(employeeList)) { + throw new SalaryRunTimeException("员工信息不存在"); + } queryParam.setEmployeeId(po.getEmployeeId()); diff --git a/src/com/engine/salary/cmd/datacollection/AddUpSituationGetDetailListCmd.java b/src/com/engine/salary/cmd/datacollection/AddUpSituationGetDetailListCmd.java index 22ac82f71..f9c42c179 100644 --- a/src/com/engine/salary/cmd/datacollection/AddUpSituationGetDetailListCmd.java +++ b/src/com/engine/salary/cmd/datacollection/AddUpSituationGetDetailListCmd.java @@ -4,9 +4,14 @@ import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.biz.AbstractCommonCommand; import com.engine.common.entity.BizLogContext; import com.engine.core.interceptor.CommandContext; +import com.engine.salary.biz.AddUpSituationBiz; +import com.engine.salary.biz.EmployBiz; import com.engine.salary.component.SalaryWeaTable; +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO; import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam; +import com.engine.salary.exception.SalaryRunTimeException; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; @@ -29,6 +34,30 @@ public class AddUpSituationGetDetailListCmd extends AbstractCommonCommand execute(CommandContext commandContext) { + EmployBiz employBiz = new EmployBiz(); + AddUpSituationBiz biz = new AddUpSituationBiz(); + + AddUpSituationQueryParam queryParam = (AddUpSituationQueryParam) params.get("queryParam"); + if (queryParam == null) { + throw new SalaryRunTimeException("参数异常"); + } + + Long id = queryParam.getAccumulatedSituationId(); + if (id == null) { + throw new SalaryRunTimeException("累计情况id不能为空"); + } + + AddUpSituation po = biz.getById(id); + if (po == null) { + throw new SalaryRunTimeException(String.format("累计情况不存在[id:%s]", id)); + } + + List employeeList = employBiz.getEmployeeByIds(Collections.singletonList(po.getEmployeeId())); + if (CollectionUtils.isEmpty(employeeList)) { + throw new SalaryRunTimeException("员工信息不存在"); + } + + String fields = " t1.id," + " t1.tax_year_month," + " t1.employee_id as employeeId," + From 96761028943b0a59ca93525e9eb6df92962ca7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 11 Mar 2022 11:08:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=B4=AF=E8=AE=A1bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/salary/web/AttendQuoteController.java | 8 + .../datacollection/AttendQuoteListCmd.java | 152 ++++++++++++++++++ .../dto/AttendQuoteListDTO.java | 64 ++++++++ .../param/AttendQuoteQueryParam.java | 29 ++++ .../entity/datacollection/po/AttendQuote.java | 79 +++++++++ .../entity/datacollection/po/SalarySob.java | 83 ++++++++++ .../salary/service/AttendQuoteService.java | 44 +++++ .../service/impl/AttendQuoteServiceImpl.java | 15 ++ .../salary/web/AddUpSituationController.java | 2 +- .../salary/web/AttendQuoteController.java | 41 +++++ 10 files changed, 516 insertions(+), 1 deletion(-) create mode 100644 src/com/api/salary/web/AttendQuoteController.java create mode 100644 src/com/engine/salary/cmd/datacollection/AttendQuoteListCmd.java create mode 100644 src/com/engine/salary/entity/datacollection/dto/AttendQuoteListDTO.java create mode 100644 src/com/engine/salary/entity/datacollection/param/AttendQuoteQueryParam.java create mode 100644 src/com/engine/salary/entity/datacollection/po/AttendQuote.java create mode 100644 src/com/engine/salary/entity/datacollection/po/SalarySob.java create mode 100644 src/com/engine/salary/service/AttendQuoteService.java create mode 100644 src/com/engine/salary/service/impl/AttendQuoteServiceImpl.java create mode 100644 src/com/engine/salary/web/AttendQuoteController.java diff --git a/src/com/api/salary/web/AttendQuoteController.java b/src/com/api/salary/web/AttendQuoteController.java new file mode 100644 index 000000000..799720f98 --- /dev/null +++ b/src/com/api/salary/web/AttendQuoteController.java @@ -0,0 +1,8 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +@Path("/bs/hrmsalary/attendQuote") +public class AttendQuoteController extends com.engine.salary.web.AddUpDeductionController{ + +} diff --git a/src/com/engine/salary/cmd/datacollection/AttendQuoteListCmd.java b/src/com/engine/salary/cmd/datacollection/AttendQuoteListCmd.java new file mode 100644 index 000000000..60f942e74 --- /dev/null +++ b/src/com/engine/salary/cmd/datacollection/AttendQuoteListCmd.java @@ -0,0 +1,152 @@ +package com.engine.salary.cmd.datacollection; + +import com.cloudstore.eccom.result.WeaResultMsg; +import com.engine.common.biz.AbstractCommonCommand; +import com.engine.common.entity.BizLogContext; +import com.engine.core.interceptor.CommandContext; +import com.engine.salary.component.SalaryWeaTable; +import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO; +import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam; +import com.engine.salary.entity.datacollection.param.AttendQuoteQueryParam; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import weaver.hrm.User; + +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class AttendQuoteListCmd extends AbstractCommonCommand> { + + public AttendQuoteListCmd(Map params, User user) { + this.user = user; + this.params = params; + } + + @Override + public BizLogContext getLogContext() { + return null; + } + + @Override + public Map execute(CommandContext commandContext) { + + AttendQuoteQueryParam queryParam = (AttendQuoteQueryParam) params.get("queryParam"); + List declareMonth = queryParam.getSalaryYearMonth(); + if (CollectionUtils.isNotEmpty(declareMonth)) { + queryParam.setSalaryYearMonth(declareMonth.stream().map(e -> e + "-01 00:00:00").collect(Collectors.toList())); + } + + + + + String fields = " t1.id," + + " t1.declare_month as declareMonth," + + " t1.employee_id as employeeId," + + " e.lastname as username," + + " d.departmentname AS departmentName," + + " e.mobile," + + " e.workcode as jobNum," + + " e.companystartdate as hiredate," + + " t2.name AS taxAgentName," + + " t1.add_up_child_education as addUpChildEducation," + + " t1.add_up_continuing_education as addUpContinuingEducation," + + " t1.add_up_housing_loan_interest as addUpHousingLoanInterest," + + " t1.add_up_housing_rent as addUpHousingRent," + + " t1.add_up_support_elderly as addUpSupportElderly"; + + String fromSql = " FROM" + + " hrsa_add_up_deduction t1" + + " LEFT JOIN hrsa_tax_agent t2 ON t1.tax_agent_id = t2.id" + + " LEFT JOIN hrmresource e ON t1.employee_id = e.id" + + " LEFT JOIN hrmdepartment d ON e.departmentid = d.id"; + + SalaryWeaTable table = new SalaryWeaTable(user, AddUpDeductionDTO.class); + table.setBackfields(fields); + table.setSqlform(fromSql); + table.setSqlwhere(makeSqlWhere()); + table.setSqlorderby("t1.id DESC"); + table.setSqlprimarykey("t1.id"); + table.setSqlisdistinct("false"); + + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + return result.getResultMap(); + } + + + private String makeSqlWhere() { + + AddUpDeductionQueryParam queryParam = (AddUpDeductionQueryParam) params.get("queryParam"); + //申报月份 + List declareMonth = queryParam.getDeclareMonth(); + if (CollectionUtils.isNotEmpty(declareMonth)) { + queryParam.setDeclareMonth(declareMonth.stream().map(e -> e + "-01 00:00:00").collect(Collectors.toList())); + } + + String sqlWhere = "t1.delete_type = 0 AND t2.delete_type = 0"; + Collection ids = queryParam.getIds(); + if (CollectionUtils.isNotEmpty(ids)) { + String idsStr = ids.stream().map(String::valueOf).collect(Collectors.joining(",")); + sqlWhere += " AND t1.id IN (" + idsStr + ")"; + } + Long employeeId = queryParam.getEmployeeId(); + if (employeeId != null) { + sqlWhere += " AND t1.employee_id =" + employeeId; + } + String keyword = queryParam.getKeyword(); + if (StringUtils.isNotBlank(keyword)) { + sqlWhere += " AND (" + + " e.lastname like '%" + keyword + "%'" + + " OR d.departmentname like '%" + keyword + "%'" + + " OR e.workcode like ''%" + keyword + "%'" + + " )"; + } + // 申报月份 + List declareMonths = queryParam.getDeclareMonth(); + if (CollectionUtils.isNotEmpty(declareMonths)) { + if (declareMonths.size() == 1) { + sqlWhere += " AND t1.declare_month = '" + declareMonths.get(0) + "'"; + } + if (declareMonths.size() == 2) { + sqlWhere += " AND (t1.declare_month BETWEEN '" + declareMonths.get(0) + "' AND '" + declareMonths.get(1) + "')"; + } + } + //姓名 + String username = queryParam.getUsername(); + if (StringUtils.isNotBlank(username)) { + sqlWhere += " AND e.lastname like '%" + username + "%'"; + } + //个税扣缴义务人 + Long taxAgentId = queryParam.getTaxAgentId(); + if (taxAgentId != null) { + sqlWhere += " AND t1.tax_agent_id = " + taxAgentId; + } + //部门 + List departmentIds = queryParam.getDepartmentIds(); + if (CollectionUtils.isNotEmpty(departmentIds)) { + String departmentStrIds = departmentIds.stream().map(String::valueOf).collect(Collectors.joining(",")); + sqlWhere += " AND d.id IN (" + departmentStrIds + ")"; + } + //工号 + String jobNum = queryParam.getJobNum(); + if (StringUtils.isNotBlank(jobNum)) { + sqlWhere += " AND e.workcode like '%" + jobNum + "%'"; + } + //入职日期 + List hiredate = queryParam.getHiredate(); + if (CollectionUtils.isNotEmpty(hiredate) && hiredate.size() == 2) { + sqlWhere += " AND (e.companystartdate BETWEEN '" + hiredate.get(0) + "' AND '" + hiredate.get(1) + "')"; + } + //手机号 + String mobile = queryParam.getMobile(); + if (StringUtils.isNotBlank(mobile)) { + sqlWhere += " AND e.mobile like '%" + mobile + "%'"; + } + + return sqlWhere; + } +} diff --git a/src/com/engine/salary/entity/datacollection/dto/AttendQuoteListDTO.java b/src/com/engine/salary/entity/datacollection/dto/AttendQuoteListDTO.java new file mode 100644 index 000000000..4fb184bb3 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/AttendQuoteListDTO.java @@ -0,0 +1,64 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.SalaryTable; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.SalaryTableOperate; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 数据采集-考勤引用列表 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@SalaryTable(pageId = "a4f852o1-e3f9-7841-adn9-7d06e54y6rj8", operates = { + @SalaryTableOperate(text = "查看", index = "0"), + @SalaryTableOperate(text = "删除", index = "1") +}) +public class AttendQuoteListDTO { + + @SalaryTableColumn(column = "id", display = false) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + @SalaryTableColumn(text = "薪资所属月", width = "10%", column = "salaryYearMonth", transmethod = "com.engine.salary.transmethod.TransMethod.timeToMoth") + @JsonFormat(pattern = "yyyy-MM") + private Date salaryYearMonth; + + @SalaryTableColumn(text = "关联账套", width = "10%", column = "salarySobName") + private String salarySobName; + + @SalaryTableColumn(text = "考勤周期", width = "10%", column = "attendCycle") + private String attendCycle; + + @SalaryTableColumn(text = "来源", width = "10%", column = "sourceType") + private String sourceType; + + @SalaryTableColumn(text = "薪资周期", width = "10%", column = "salaryCycle") + private String salaryCycle; + + @SalaryTableColumn(text = "操作人", width = "10%", column = "creator") + private String creator; + + @SalaryTableColumn(text = "备注", width = "10%", column = "description") + private String description; + + /** + * 薪资核算状态。0:未核算、1:已核算 + */ + private Integer salaryAccountingStatus; +} diff --git a/src/com/engine/salary/entity/datacollection/param/AttendQuoteQueryParam.java b/src/com/engine/salary/entity/datacollection/param/AttendQuoteQueryParam.java new file mode 100644 index 000000000..4f34680f6 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/AttendQuoteQueryParam.java @@ -0,0 +1,29 @@ +package com.engine.salary.entity.datacollection.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.List; + +/** + * 数据采集-考勤引用查询参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AttendQuoteQueryParam { + + private Collection ids; + + //薪资所属月 + private List salaryYearMonth; +} diff --git a/src/com/engine/salary/entity/datacollection/po/AttendQuote.java b/src/com/engine/salary/entity/datacollection/po/AttendQuote.java new file mode 100644 index 000000000..52a69872a --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/AttendQuote.java @@ -0,0 +1,79 @@ +package com.engine.salary.entity.datacollection.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 考勤引用表 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AttendQuote { + /** + * 主键 + */ + private Long id; + /** + * 税款所属期 + */ + private Date salaryYearMonth; + /** + * 年份 + */ + private Integer year; + /** + * 月份 + */ + private Integer month; + /** + * 薪资账套表的主键id + */ + private Long salarySobId; + /** + * 来源。1:引用、2:导入 + */ + private Integer sourceType; + /** + * 薪资核算状态。0:未核算、1:已核算 + */ + private Integer salaryAccountingStatus; + /** + * 考勤周期 + */ + private String attendCycle; + /** + * 薪资周期 + */ + private String salaryCycle; + /** + * 备注 + */ + private String description; + /** + * 创建时间 + */ + private Date createTime; + /** + * 更新时间 + */ + private Date updateTime; + /** + * 创建人 + */ + private Long creator; + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + /** + * 租户ID + */ + private String tenantKey; + +} \ No newline at end of file diff --git a/src/com/engine/salary/entity/datacollection/po/SalarySob.java b/src/com/engine/salary/entity/datacollection/po/SalarySob.java new file mode 100644 index 000000000..54bd63a76 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/po/SalarySob.java @@ -0,0 +1,83 @@ +package com.engine.salary.entity.datacollection.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 薪资帐套表 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalarySob { + /** + * 主键id + */ + private Long id; + /** + * 名称 + */ + private String name; + /** + * 应税项目。1:正常工资薪金所得 + */ + private Byte incomeCategory; + /** + * 薪资周期。1:上上月、2:上月、3:本月、4:下月 + */ + private Byte salaryCycleType; + /** + * 薪资周期的起始日期 + */ + private Byte salaryCycleFromDay; + /** + * 税款所属期。1:上上月、2:上月、3:本月、4:下月 + */ + private Byte taxCycleType; + /** + * 考勤周期。1:上上月、2:上月、3:本月、4:下月 + */ + private Byte attendCycleType; + /** + * 考勤周期的起始日期 + */ + private Byte attendCycleFromDay; + /** + * 社保福利所属期。1:上上月、2:上月、3:本月、4:下月 + */ + private Byte socialSecurityCycleType; + /** + * 是否禁用。0:正常使用、1:禁用 + */ + private Byte disable; + /** + * 描述 + */ + private String description; + /** + * 创建人 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createTime; + /** + * 更新时间 + */ + private Date updateTime; + /** + * 是否已删除。0:未删除、1:已删除 + */ + private Integer deleteType; + /** + * 租户ID + */ + private String tenantKey; + +} \ No newline at end of file diff --git a/src/com/engine/salary/service/AttendQuoteService.java b/src/com/engine/salary/service/AttendQuoteService.java new file mode 100644 index 000000000..96507f1fc --- /dev/null +++ b/src/com/engine/salary/service/AttendQuoteService.java @@ -0,0 +1,44 @@ +package com.engine.salary.service; + +import java.util.Map; + +public interface AttendQuoteService { + /** + * 数据采集-考勤引用列表 + */ + Map list(Map params); + +// /** +// * 删除数据采集-考勤引用 +// * @param ids +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// WeaResult delete(Collection ids, Long employeeId, String tenantKey); +// +// /** +// * 获取引用考勤表单 +// * @param currentEmployeeId +// * @param currentTenantKey +// * @return +// */ +// WeaForm getSyncForm(Long currentEmployeeId, String currentTenantKey); +// +// /** +// * 获取薪资周期和考勤周期 +// * @param salaryYearMonth +// * @param salarySobId +// * @param currentTenantKey +// * @return +// */ +// Map getSalaryCycleAndAttendCycle(YearMonth salaryYearMonth, Long salarySobId, Long currentEmployeeId, String currentTenantKey); +// +// /** +// * 获取薪资账套下拉列表 +// * @param currentEmployeeId +// * @param currentTenantKey +// * @return +// */ +// List> selectSalarySobList(Long currentEmployeeId, String currentTenantKey); +} diff --git a/src/com/engine/salary/service/impl/AttendQuoteServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteServiceImpl.java new file mode 100644 index 000000000..f3b724672 --- /dev/null +++ b/src/com/engine/salary/service/impl/AttendQuoteServiceImpl.java @@ -0,0 +1,15 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.cmd.datacollection.AttendQuoteListCmd; +import com.engine.salary.service.AttendQuoteService; + +import java.util.Map; + +public class AttendQuoteServiceImpl extends Service implements AttendQuoteService { + + @Override + public Map list(Map params) { + return commandExecutor.execute(new AttendQuoteListCmd(params, user)); + } +} diff --git a/src/com/engine/salary/web/AddUpSituationController.java b/src/com/engine/salary/web/AddUpSituationController.java index 7cb00e799..0993826d7 100644 --- a/src/com/engine/salary/web/AddUpSituationController.java +++ b/src/com/engine/salary/web/AddUpSituationController.java @@ -63,7 +63,7 @@ public class AddUpSituationController { User user = HrmUserVarify.getUser(request, response); Map map = ParamUtil.request2Map(request); map.put("queryParam", queryParam); - return ResponseResult.run(getService(user)::list, ParamUtil.request2Map(request)); + return ResponseResult.run(getService(user)::list, map); } diff --git a/src/com/engine/salary/web/AttendQuoteController.java b/src/com/engine/salary/web/AttendQuoteController.java new file mode 100644 index 000000000..e7aad407f --- /dev/null +++ b/src/com/engine/salary/web/AttendQuoteController.java @@ -0,0 +1,41 @@ +package com.engine.salary.web; + +import com.engine.common.util.ParamUtil; +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.datacollection.param.AttendQuoteQueryParam; +import com.engine.salary.service.AttendQuoteService; +import com.engine.salary.service.impl.AttendQuoteServiceImpl; +import com.engine.salary.util.ResponseResult; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.Map; + +public class AttendQuoteController { + + private AttendQuoteService getService(User user) { + return (AttendQuoteService) ServiceUtil.getService(AttendQuoteServiceImpl.class, user); + } + + /** + * 考勤数据列表 + */ + @GET + @Path("/list") + @Produces(MediaType.APPLICATION_JSON) + public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AttendQuoteQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + Map map = ParamUtil.request2Map(request); + map.put("queryParam", queryParam); + return ResponseResult.run(getService(user)::list, map); + } + +}