feat(personnelMatters): 添加按日期查询请假记录功能并优化相关模块

- 在 IRzLeaveService 接口中添加 selectRzLeaveListByDate 方法
- 在 RzLeaveMapper.xml 中添加 holiday_type 字段的映射
- 修改 RzLeave 类,使用 Lombok 的 EqualsAndHashCode 注解
- 更新 RzLeaveController 中的 export 方法,使用新的按日期查询功能- 实现 RzLeaveServiceImpl 中的 selectRzLeaveListByDate 方法
- 优化 RzRestaurantStatisticsServiceImpl 中的公司名称获取逻辑
- 更新 SysStaff 类,调整字段顺序并添加公司名称字段
This commit is contained in:
tzy 2025-06-05 09:02:10 +08:00
parent c4a661c281
commit 5769b67686
12 changed files with 87 additions and 49 deletions

View File

@ -14,6 +14,8 @@ import com.evo.personnelMatters.service.IRzLeaveService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -28,7 +30,7 @@ import java.util.stream.Collectors;
@RequestMapping("/personnelMatters/leave") @RequestMapping("/personnelMatters/leave")
public class RzLeaveController extends BaseController public class RzLeaveController extends BaseController
{ {
@Autowired @Resource
private IRzLeaveService rzLeaveService; private IRzLeaveService rzLeaveService;
/** /**
@ -57,7 +59,7 @@ public class RzLeaveController extends BaseController
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, RzLeave rzLeave) public void export(HttpServletResponse response, RzLeave rzLeave)
{ {
List<RzLeave> list = rzLeaveService.selectRzLeaveList(rzLeave); List<RzLeave> list = rzLeaveService.selectRzLeaveListByDate(rzLeave);
ExcelUtil<RzLeave> util = new ExcelUtil<RzLeave>(RzLeave.class); ExcelUtil<RzLeave> util = new ExcelUtil<RzLeave>(RzLeave.class);
util.exportExcel(response, list, "请假数据"); util.exportExcel(response, list, "请假数据");
} }

View File

@ -4,6 +4,7 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.evo.common.annotation.Excel; import com.evo.common.annotation.Excel;
@ -15,6 +16,7 @@ import com.evo.common.core.domain.BaseEntity;
* @author evo * @author evo
* @date 2025-03-15 * @date 2025-03-15
*/ */
@EqualsAndHashCode(callSuper = true)
@Data @Data
public class RzLeave extends BaseEntity public class RzLeave extends BaseEntity
{ {
@ -37,44 +39,44 @@ public class RzLeave extends BaseEntity
private String name; private String name;
/** 请假月份(到月) */ /** 请假月份(到月) */
// @Excel(name = "请假月份", readConverterExp = "到=月", dateFormat = "yyyy-MM") @Excel(name = "请假月份", dateFormat = "yyyy-MM")
// @JsonFormat(pattern = "yyyy-MM") @JsonFormat(pattern = "yyyy-MM")
// private Date leaveDate; private Date leaveDate;
/** 病假时长(小时) */ /** 病假时长(小时) */
@Excel(name = "病假时长", readConverterExp = "小=时") @Excel(name = "病假时长")
private Integer sickHours; private Integer sickHours;
/** 事假时长(小时) */ /** 事假时长(小时) */
@Excel(name = "事假时长", readConverterExp = "小=时") @Excel(name = "事假时长")
private Integer absenceHours; private Integer absenceHours;
/** 调休假时长(小时) */ /** 调休假时长(小时) */
@Excel(name = "调休假时长", readConverterExp = "小=时") @Excel(name = "调休假时长")
private Integer compensatoryHours; private Integer compensatoryHours;
/** 婚假时长(小时) */ /** 婚假时长(小时) */
@Excel(name = "婚假时长", readConverterExp = "小=时") @Excel(name = "婚假时长")
private Integer marriageHours; private Integer marriageHours;
/** 年休假时长(小时) */ /** 年休假时长(小时) */
@Excel(name = "年休假时长", readConverterExp = "小=时") @Excel(name = "年休假时长")
private Integer annualHours; private Integer annualHours;
/** 产假时长(小时) */ /** 产假时长(小时) */
@Excel(name = "产假时长", readConverterExp = "小=时") @Excel(name = "产假时长")
private Integer maternityHours; private Integer maternityHours;
/** 陪产假时长(小时) */ /** 陪产假时长(小时) */
@Excel(name = "陪产假时长", readConverterExp = "小=时") @Excel(name = "陪产假时长")
private Integer paternityHours; private Integer paternityHours;
/** 丧假时长(小时) */ /** 丧假时长(小时) */
@Excel(name = "丧假时长", readConverterExp = "小=时") @Excel(name = "丧假时长")
private Integer funeralHours; private Integer funeralHours;
/** 工伤假时长(小时) */ /** 工伤假时长(小时) */
@Excel(name = "工伤假时长", readConverterExp = "小=时") @Excel(name = "工伤假时长")
private Integer workHours; private Integer workHours;
/** 删除标识 */ /** 删除标识 */

View File

@ -3,6 +3,7 @@ package com.evo.personnelMatters.domain;
import com.evo.common.annotation.Excel; import com.evo.common.annotation.Excel;
import com.evo.common.core.domain.BaseEntity; import com.evo.common.core.domain.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
@ -16,6 +17,7 @@ import java.math.BigDecimal;
* @author: andy.shi * @author: andy.shi
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步 * @remark: 开发人员联系方式 1042025947@qq.com/微信同步
*/ */
@EqualsAndHashCode(callSuper = true)
@Data @Data
public class RzSubsidyInfo extends BaseEntity public class RzSubsidyInfo extends BaseEntity
{ {

View File

@ -1,5 +1,6 @@
package com.evo.personnelMatters.mapper; package com.evo.personnelMatters.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.evo.personnelMatters.domain.RzLeave; import com.evo.personnelMatters.domain.RzLeave;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date; import java.util.Date;
@ -11,7 +12,7 @@ import java.util.List;
* @author chenyj * @author chenyj
* @date 2024-08-03 * @date 2024-08-03
*/ */
public interface RzLeaveMapper public interface RzLeaveMapper extends BaseMapper<RzLeave>
{ {
/** /**
* 查询请假管理 * 查询请假管理

View File

@ -58,4 +58,5 @@ public interface IRzLeaveService
*/ */
public List<RzLeaveDetail> listLeaveDetails(RzLeave rzLeave); public List<RzLeaveDetail> listLeaveDetails(RzLeave rzLeave);
List<RzLeave> selectRzLeaveListByDate(RzLeave rzLeave);
} }

View File

@ -1,5 +1,7 @@
package com.evo.personnelMatters.service.impl; package com.evo.personnelMatters.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.evo.common.annotation.DataScope; import com.evo.common.annotation.DataScope;
import com.evo.common.constant.Constants; import com.evo.common.constant.Constants;
import com.evo.common.core.domain.AjaxResult; import com.evo.common.core.domain.AjaxResult;
@ -150,4 +152,12 @@ public class RzLeaveServiceImpl implements IRzLeaveService
// res_list = rzLeaveDetailMapper.selectRzLeaveDetailByLeaveId(leave.getId()); // res_list = rzLeaveDetailMapper.selectRzLeaveDetailByLeaveId(leave.getId());
return res_list; return res_list;
} }
@Override
public List<RzLeave> selectRzLeaveListByDate(RzLeave rzLeave) {
LambdaQueryWrapper<RzLeave> wa = new LambdaQueryWrapper<>();
wa.like(StringUtils.isNotBlank(rzLeave.getName()),RzLeave::getName,rzLeave.getName());
wa.like(StringUtils.isNotBlank(rzLeave.getDeptName()),RzLeave::getDeptName,rzLeave.getDeptName());
return rzLeaveMapper.selectList(wa);
}
} }

View File

@ -49,7 +49,7 @@ public class RzRestaurantStatisticsController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('restaurant:statistics:export')") @PreAuthorize("@ss.hasPermi('restaurant:statistics:export')")
@Log(title = "餐饮统计", businessType = BusinessType.EXPORT) @Log(title = "餐饮统计", businessType = BusinessType.EXPORT)
@GetMapping("/export") @PostMapping ("/export")
public AjaxResult export(RzRestaurantStatistics rzRestaurantStatistics) public AjaxResult export(RzRestaurantStatistics rzRestaurantStatistics)
{ {
ExcelUtilCy<RzRestaurantStatistics> util = new ExcelUtilCy<RzRestaurantStatistics>(RzRestaurantStatistics.class); ExcelUtilCy<RzRestaurantStatistics> util = new ExcelUtilCy<RzRestaurantStatistics>(RzRestaurantStatistics.class);
@ -62,7 +62,7 @@ public class RzRestaurantStatisticsController extends BaseController
List<RzRestaurantStatistics> res_list = rzRestaurantStatisticsService.selectRzRestaurantStatisticsList(rzRestaurantStatistics); List<RzRestaurantStatistics> res_list = rzRestaurantStatisticsService.selectRzRestaurantStatisticsList(rzRestaurantStatistics);
//先找到有多少个公司部门 //先找到有多少个公司部门
for (RzRestaurantStatistics restaurantStatistics : res_list) { for (RzRestaurantStatistics restaurantStatistics : res_list) {
if(sheetNameList == null || sheetNameList.size() == 0){ if(sheetNameList.isEmpty()){
sheetNameList.add(restaurantStatistics.getCompanyName()); sheetNameList.add(restaurantStatistics.getCompanyName());
continue; continue;
} }
@ -82,7 +82,7 @@ public class RzRestaurantStatisticsController extends BaseController
for (RzRestaurantStatistics restaurantStatistics : res_list) { for (RzRestaurantStatistics restaurantStatistics : res_list) {
if(s.equals(restaurantStatistics.getCompanyName())){ if(s.equals(restaurantStatistics.getCompanyName())){
if(null == vo_obj.getBreakfastNumber()){ if(null == vo_obj.getBreakfastNumber()){
vo_obj.setBreakfastNumber(0l); vo_obj.setBreakfastNumber(0L);
} }
vo_obj.setBreakfastNumber(vo_obj.getBreakfastNumber() + restaurantStatistics.getBreakfastNumber()); vo_obj.setBreakfastNumber(vo_obj.getBreakfastNumber() + restaurantStatistics.getBreakfastNumber());
if(null == vo_obj.getBreakfastExpend()){ if(null == vo_obj.getBreakfastExpend()){

View File

@ -167,7 +167,9 @@ public class RzRestaurantImagesServiceImpl extends ServiceImpl<RzRestaurantImage
return AjaxResult.error(); return AjaxResult.error();
} }
//下发照片 //下发照片
eqSnDetailService.sendPhoto(Collections.asList(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE), Collections.asList(Collections.asMap("userId", String.valueOf(rzRestaurantImages.getId()), "name", name, "photoUrl", com.evo.equipment.constant.Constants.STAFF_IMAGE_URL+originalFilename))); eqSnDetailService.sendPhoto(Collections.asList(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE),
Collections.asList(Collections.asMap("userId", String.valueOf(rzRestaurantImages.getId()),
"name", name, "photoUrl", com.evo.equipment.constant.Constants.STAFF_IMAGE_URL+originalFilename)));
return AjaxResult.success(); return AjaxResult.success();
} }
} }

View File

@ -2,6 +2,7 @@ package com.evo.restaurant.service.impl;
import com.evo.common.constant.Constants; import com.evo.common.constant.Constants;
import com.evo.common.core.domain.AjaxResult; import com.evo.common.core.domain.AjaxResult;
import com.evo.common.core.domain.entity.SysDept;
import com.evo.common.core.domain.entity.SysDictData; import com.evo.common.core.domain.entity.SysDictData;
import com.evo.common.utils.DateUtils; import com.evo.common.utils.DateUtils;
import com.evo.common.utils.StringUtils; import com.evo.common.utils.StringUtils;
@ -64,8 +65,19 @@ public class RzRestaurantStatisticsServiceImpl implements IRzRestaurantStatistic
public List<RzRestaurantStatistics> selectRzRestaurantStatisticsList(RzRestaurantStatistics rzRestaurantStatistics) public List<RzRestaurantStatistics> selectRzRestaurantStatisticsList(RzRestaurantStatistics rzRestaurantStatistics)
{ {
List<RzRestaurantStatistics> res_list = rzRestaurantStatisticsMapper.selectRzRestaurantStatisticsList(rzRestaurantStatistics); List<RzRestaurantStatistics> res_list = rzRestaurantStatisticsMapper.selectRzRestaurantStatisticsList(rzRestaurantStatistics);
try{
for (RzRestaurantStatistics restaurantStatistics : res_list) { for (RzRestaurantStatistics restaurantStatistics : res_list) {
SysDept sysDept = deptMapper.selectDeptById(restaurantStatistics.getDeptId());
if (sysDept !=null){
restaurantStatistics.setCompanyName(deptMapper.selectDeptById(restaurantStatistics.getDeptId()).getDeptName()); restaurantStatistics.setCompanyName(deptMapper.selectDeptById(restaurantStatistics.getDeptId()).getDeptName());
}else {
restaurantStatistics.setCompanyName("1");
}
}
} catch (Exception e) {
throw new RuntimeException(e);
} }
return res_list; return res_list;
} }

View File

@ -21,21 +21,27 @@ import com.evo.common.core.domain.BaseEntity;
public class SysStaff extends BaseEntity public class SysStaff extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 姓名 */
@Excel(name = "姓名")
private String name;
/** 编号 */
@Excel(name = "编号")
private String code;
/** 公司 */
@Excel(name = "公司")
private String companyName;
/** 主键ID */ /** 主键ID */
private Long userId; private Long userId;
/** 部门ID */ /** 部门ID */
private Long deptId; private Long deptId;
@Excel(name = "部门") @Excel(name = "部门")
@TableField(exist = false) @TableField(exist = false)
private String deptName; private String deptName;
/** 编号 */
@Excel(name = "编号")
private String code;
/** 姓名 */
@Excel(name = "姓名")
private String name;
/** 身份证号 */ /** 身份证号 */
@Excel(name = "身份证号") @Excel(name = "身份证号")
@ -57,38 +63,39 @@ public class SysStaff extends BaseEntity
@Excel(name = "住址") @Excel(name = "住址")
private String address; private String address;
/** 学历 */ /** 毕业学校 */
@Excel(name = "学历") @Excel(name = "毕业学校")
private String level; private String school;
/** 专业 */ /** 专业 */
@Excel(name = "专业") @Excel(name = "专业")
private String major; private String major;
/** 毕业学校 */ /** 学历 */
@Excel(name = "毕业学校") @Excel(name = "学历")
private String school; private String level;
/** 银行卡号 */
@Excel(name = "银行卡号")
private String bankNumber;
/** 开户行 */ /** 开户行 */
@Excel(name = "开户行") @Excel(name = "开户行")
private String bank; private String bank;
/** 银行卡号 */
@Excel(name = "银行卡号")
private String bankNumber;
/** 入职时间 */ /** 入职时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入职时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "入职时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date employmentDate; private Date employmentDate;
/** 试用期限 */
@Excel(name = "试用期限")
private Long workerTerm;
/** 履历 */ /** 履历 */
@Excel(name = "履历") @Excel(name = "履历")
private String experience; private String experience;
/** 试用期限 */
@Excel(name = "试用期限")
private Long workerTerm;
/** 转正日期 */ /** 转正日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@ -117,6 +124,7 @@ public class SysStaff extends BaseEntity
/** 社保 */ /** 社保 */
@Excel(name = "社保") @Excel(name = "社保")
private String socialType; private String socialType;
@Excel(name = "是否新农合") @Excel(name = "是否新农合")
private String socialSubsidy; private String socialSubsidy;
@ -161,10 +169,6 @@ public class SysStaff extends BaseEntity
@Excel(name = "全额工资时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "全额工资时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date wagesRatioDate; private Date wagesRatioDate;
/** 公司 */
@Excel(name = "公司")
private String companyName;
/** 备注 */ /** 备注 */
@Excel(name = "备注") @Excel(name = "备注")
private String remarks; private String remarks;

View File

@ -6,14 +6,14 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
public class SysStaffVo { public class SysStaffVo {
/** 姓名 */
@Excel(name = "* 姓名")
private String name;
@Excel(name = "* 部门") @Excel(name = "* 部门")
private String deptName; private String deptName;
/** 编号 */ /** 编号 */
@Excel(name = "编号") @Excel(name = "编号")
private String code; private String code;
/** 姓名 */
@Excel(name = "* 姓名")
private String name;
/** 身份证号 */ /** 身份证号 */
@Excel(name = "* 身份证号") @Excel(name = "* 身份证号")
private String idCard; private String idCard;

View File

@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="workHours" column="work_hours" /> <result property="workHours" column="work_hours" />
<result property="nightNumber" column="night_number" /> <result property="nightNumber" column="night_number" />
<result property="middleShiftNumber" column="middle_shift_number" /> <result property="middleShiftNumber" column="middle_shift_number" />
<result property="holidayType" column="holiday_type" />
<result property="remarks" column="remarks" /> <result property="remarks" column="remarks" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
@ -28,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectRzAttendanceVo"> <sql id="selectRzAttendanceVo">
select id, staff_id, name, dept_id, attendance_date, rules, work_start_time,ycs_flag,ycx_flag, work_end_time, work_sum,work_hours,night_number,middle_shift_number,remarks, del_flag, create_by, create_time, update_by, update_time from rz_attendance select id, staff_id, name, dept_id, attendance_date, rules, work_start_time,ycs_flag,ycx_flag, work_end_time, work_sum,work_hours,night_number,middle_shift_number,holiday_type,remarks, del_flag, create_by, create_time, update_by, update_time from rz_attendance
</sql> </sql>
<select id="selectRzAttendanceList" parameterType="RzAttendance" resultMap="RzAttendanceResult"> <select id="selectRzAttendanceList" parameterType="RzAttendance" resultMap="RzAttendanceResult">
@ -69,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="workSum != null">work_sum = #{workSum},</if> <if test="workSum != null">work_sum = #{workSum},</if>
<if test="nightNumber != null">night_number = #{nightNumber},</if> <if test="nightNumber != null">night_number = #{nightNumber},</if>
<if test="middleShiftNumber != null">middle_shift_number = #{middleShiftNumber},</if> <if test="middleShiftNumber != null">middle_shift_number = #{middleShiftNumber},</if>
<if test="holidayType != null">holiday_type = #{holidayType},</if>
<if test="remarks != null">remarks = #{remarks},</if> <if test="remarks != null">remarks = #{remarks},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if> <if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>