数据管理-休假报备数据
This commit is contained in:
parent
5e14cf0b29
commit
ffad0d0136
|
|
@ -26,6 +26,8 @@ import com.bonus.system.holiday.service.HolidayService;
|
|||
import com.bonus.system.leaveReporting.entity.LeaveReportingBean;
|
||||
import com.bonus.system.leaveReporting.service.LeaveReportingService;
|
||||
import com.bonus.system.wechat.entity.WechatBean;
|
||||
import com.bonus.system.wechat.entity.WechatLeaveReportingBean;
|
||||
import com.bonus.system.wechat.service.WechatLeaveReportingService;
|
||||
import com.bonus.system.wechat.service.WechatService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
|
@ -82,6 +84,12 @@ public class ExportFileController {
|
|||
@Resource(name = "LeaveReportingService")
|
||||
private LeaveReportingService leaveReportingService;
|
||||
|
||||
/**
|
||||
* 数据管理-休假报备
|
||||
*/
|
||||
@Resource(name = "WechatLeaveReportingService")
|
||||
private WechatLeaveReportingService wechatLeaveReportingService;
|
||||
|
||||
/**
|
||||
* 出差报备
|
||||
*/
|
||||
|
|
@ -495,14 +503,14 @@ public class ExportFileController {
|
|||
vo.setId((i + 1));
|
||||
//事件处理
|
||||
if("1".equals(vo.getLeaveStartInterval())){
|
||||
vo.setLeaveStartInterval(vo.getLeaveStartDate()+" 上午");
|
||||
vo.setLeaveStartInterval(vo.getLeaveStartDate()+" ");
|
||||
}else{
|
||||
vo.setLeaveStartInterval(vo.getLeaveStartDate()+" 下午");
|
||||
vo.setLeaveStartInterval(vo.getLeaveStartDate()+" ");
|
||||
}
|
||||
if("1".equals(vo.getLeaveEndInterval())){
|
||||
vo.setLeaveEndInterval(vo.getLeaveEndDate()+" 上午");
|
||||
vo.setLeaveEndInterval(vo.getLeaveEndDate()+" ");
|
||||
}else{
|
||||
vo.setLeaveEndInterval(vo.getLeaveEndDate()+" 下午");
|
||||
vo.setLeaveEndInterval(vo.getLeaveEndDate()+" ");
|
||||
}
|
||||
// 创建一个 SimpleDateFormat 对象,用于格式化日期
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
|
@ -658,4 +666,43 @@ public class ExportFileController {
|
|||
return attStatus;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据管理-休假报备
|
||||
* @param response
|
||||
* @param bean
|
||||
* @return void
|
||||
*/
|
||||
@GetMapping("/exportWechatLeaveReporting")
|
||||
public void exportWechatLeaveReporting(HttpServletResponse response, WechatLeaveReportingBean bean) {
|
||||
try {
|
||||
List<WechatLeaveReportingBean> personExportVoList = new ArrayList<>();
|
||||
List<WechatLeaveReportingBean> personLists = wechatLeaveReportingService.getLeaveReportingList(bean);
|
||||
for (int i = 0; i < personLists.size(); i++) {
|
||||
WechatLeaveReportingBean vo = personLists.get(i);
|
||||
vo.setId((i + 1));
|
||||
//事件处理
|
||||
if("1".equals(vo.getLeaveStartInterval())){
|
||||
vo.setLeaveStartInterval(vo.getLeaveStartDate()+" ");
|
||||
}else{
|
||||
vo.setLeaveStartInterval(vo.getLeaveStartDate()+" ");
|
||||
}
|
||||
if("1".equals(vo.getLeaveEndInterval())){
|
||||
vo.setLeaveEndInterval(vo.getLeaveEndDate()+" ");
|
||||
}else{
|
||||
vo.setLeaveEndInterval(vo.getLeaveEndDate()+" ");
|
||||
}
|
||||
// 创建一个 SimpleDateFormat 对象,用于格式化日期
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// 将 Date 转换为 String
|
||||
String dateString = formatter.format(vo.getCreateTime());
|
||||
vo.setLeaveDate(dateString);
|
||||
personExportVoList.add(vo);
|
||||
}
|
||||
extracted(personExportVoList, WechatLeaveReportingBean.class, "数据管理-休假报备导出", "数据管理-休假报备导出", "数据管理-休假报备导出", response);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
package com.bonus.system.wechat.controller;
|
||||
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.Log;
|
||||
import com.bonus.common.log.enums.BusinessType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.system.wechat.entity.WechatLeaveReportingBean;
|
||||
import com.bonus.system.wechat.service.WechatLeaveReportingService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 休假报备
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wechatLeaveReporting")
|
||||
@Slf4j
|
||||
public class WechatLeaveReportingController extends BaseController {
|
||||
|
||||
@Resource(name = "WechatLeaveReportingService")
|
||||
private WechatLeaveReportingService wechatLeaveReportingService;
|
||||
|
||||
/**
|
||||
* 获取休假报备列表(表格)
|
||||
*/
|
||||
@RequiresPermissions("flow:wechatLeaveReporting:list")
|
||||
@GetMapping("/list")
|
||||
@Log(title = "流程管理->数据管理->休假报备->列表查询", businessType = BusinessType.QUERY)
|
||||
public TableDataInfo list(WechatLeaveReportingBean bean) {
|
||||
try{
|
||||
startPage();
|
||||
return getDataTable(wechatLeaveReportingService.getLeaveReportingList(bean));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取详细信息
|
||||
*/
|
||||
@RequiresPermissions("flow:wechatLeaveReporting:list")
|
||||
@GetMapping(value = "/{id}")
|
||||
@Log(title = "流程管理->休假报备->查询单个休假报备", businessType = BusinessType.QUERY)
|
||||
public AjaxResult getInfo(@PathVariable Long id) {
|
||||
try{
|
||||
return success(wechatLeaveReportingService.selectLeaveReportingById(id));
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.bonus.system.wechat.dao;
|
||||
|
||||
import com.bonus.system.leaveReporting.entity.LeaveReportingBean;
|
||||
import com.bonus.system.wechat.entity.WechatLeaveReportingBean;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 休假报备-数据访问层
|
||||
* @author lsun
|
||||
*/
|
||||
@Repository("WechatLeaveReportingDao")
|
||||
public interface WechatLeaveReportingDao {
|
||||
|
||||
List<WechatLeaveReportingBean> getLeaveReportingList(@Param("params")WechatLeaveReportingBean bean);
|
||||
|
||||
WechatLeaveReportingBean selectLeaveReportingById(Long id);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
package com.bonus.system.wechat.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseBean;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
@Data
|
||||
public class WechatLeaveReportingBean extends BaseBean {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Excel(name = "序号", width = 10.0,height = 20.0, orderNum = "0")
|
||||
private long id;
|
||||
|
||||
/**
|
||||
* 所属部门编号
|
||||
*/
|
||||
private Long orgId;
|
||||
|
||||
|
||||
/**
|
||||
* 请假人用户编号
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 请假人姓名
|
||||
*/
|
||||
@Excel(name = "姓名", width = 10.0,height = 20.0, orderNum = "1")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 职务
|
||||
*/
|
||||
@Excel(name = "职务", width = 20.0,height = 20.0, orderNum = "2")
|
||||
private String postName;
|
||||
|
||||
/**
|
||||
* 所属部门名称
|
||||
*/
|
||||
@Excel(name = "所属部门", width = 20.0,height = 20.0, orderNum = "3")
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 休假类型
|
||||
*/
|
||||
private String leaveType;
|
||||
|
||||
/**
|
||||
* 休假开始时间1上午2下午
|
||||
*/
|
||||
@Excel(name = "休假开始时间", width = 20.0,height = 20.0, orderNum = "6")
|
||||
private String leaveStartInterval;
|
||||
|
||||
|
||||
/**
|
||||
* 休假结束时间1上午2下午
|
||||
*/
|
||||
@Excel(name = "休假结束时间", width = 20.0,height = 20.0, orderNum = "7")
|
||||
private String leaveEndInterval;
|
||||
|
||||
/**
|
||||
* 休假时长(天)
|
||||
*/
|
||||
@Excel(name = "休假时长(天)", width = 20.0,height = 20.0, orderNum = "8")
|
||||
private Double leaveDuration;
|
||||
|
||||
/**
|
||||
* 请假开始日期
|
||||
*/
|
||||
private LocalDate leaveStartDate;
|
||||
|
||||
/**
|
||||
* 请假结束日期
|
||||
*/
|
||||
private LocalDate leaveEndDate;
|
||||
|
||||
/**
|
||||
* 请假事由
|
||||
*/
|
||||
private String leaveReason;
|
||||
|
||||
/**
|
||||
* 请假日期
|
||||
*/
|
||||
private String leaveDate;
|
||||
|
||||
/**
|
||||
* 数据来源1新增2导入
|
||||
*/
|
||||
@Excel(name = "数据来源", width = 10.0,height = 20.0, orderNum = "4")
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
private String examineOpinion;
|
||||
/**
|
||||
* 审批状态0审核中1通过2不通过
|
||||
*/
|
||||
private String examineStatus;
|
||||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date examineTime;
|
||||
/**
|
||||
* 审批人编号
|
||||
*/
|
||||
private Long examineUserId;
|
||||
|
||||
/**
|
||||
* 导出类型 1 查询 2 审批
|
||||
*/
|
||||
private String exportType;
|
||||
|
||||
/**
|
||||
* 是否干部 1是 0不是
|
||||
*/
|
||||
private String isCadre;
|
||||
|
||||
/**
|
||||
* 是否请示领导 1 是 0 否
|
||||
*/
|
||||
private String isAgree;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String breamks;
|
||||
|
||||
/**
|
||||
* 代理主持工作人员(多个自动隔开)
|
||||
*/
|
||||
private String hostUserId;
|
||||
|
||||
/**
|
||||
* 地点
|
||||
*/
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 休假类型
|
||||
*/
|
||||
@Excel(name = "休假类型", width = 10.0,height = 20.0, orderNum = "5")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 自己项目部所在分公司下的所有项目部id
|
||||
*/
|
||||
private List<String> orgList;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.bonus.system.wechat.service;
|
||||
|
||||
import com.bonus.system.wechat.entity.WechatLeaveReportingBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 休假报备-角色业务层
|
||||
* @author lsun
|
||||
*/
|
||||
public interface WechatLeaveReportingService {
|
||||
|
||||
/**
|
||||
* 获取休假报备
|
||||
* @param bean 参数
|
||||
* @return list bean
|
||||
*/
|
||||
List<WechatLeaveReportingBean> getLeaveReportingList(WechatLeaveReportingBean bean);
|
||||
|
||||
/**
|
||||
* 查询休假报备
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
WechatLeaveReportingBean selectLeaveReportingById(Long id);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.bonus.system.wechat.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.MapVo;
|
||||
import com.bonus.system.leaveReporting.dao.LeaveReportingDao;
|
||||
import com.bonus.system.leaveReporting.entity.LeaveReportingBean;
|
||||
import com.bonus.system.leaveReporting.service.LeaveReportingService;
|
||||
import com.bonus.system.wechat.dao.WechatLeaveReportingDao;
|
||||
import com.bonus.system.wechat.entity.WechatLeaveReportingBean;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 休假报备-业务层
|
||||
*
|
||||
* @author lsun
|
||||
*/
|
||||
@Service("WechatLeaveReportingService")
|
||||
@Log4j2
|
||||
public class WechatLeaveReportingServiceImpl implements WechatLeaveReportingService {
|
||||
|
||||
@Resource(name = "WechatLeaveReportingDao")
|
||||
private WechatLeaveReportingDao wechatLeaveReportingDao;
|
||||
|
||||
@Override
|
||||
public List<WechatLeaveReportingBean> getLeaveReportingList(WechatLeaveReportingBean bean) {
|
||||
return wechatLeaveReportingDao.getLeaveReportingList(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WechatLeaveReportingBean selectLeaveReportingById(Long id) {
|
||||
return wechatLeaveReportingDao.selectLeaveReportingById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
LEFT JOIN sys_user_post p ON p.user_id = l.user_id
|
||||
LEFT JOIN sys_dict_data d on d.dict_code = p.post_id
|
||||
WHERE
|
||||
l.is_active = '1' AND l.leave_type = '休假报备'
|
||||
l.is_active = '1' AND l.leave_type = '休假报备' AND l.source = '1'
|
||||
<if test='params.orgList != null and params.orgList.size() > 0'>
|
||||
and org_id in (
|
||||
<foreach collection="params.orgList" item="item" separator=",">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.system.wechat.dao.WechatLeaveReportingDao">
|
||||
|
||||
<select id="getLeaveReportingList" resultType="com.bonus.system.wechat.entity.WechatLeaveReportingBean">
|
||||
SELECT
|
||||
l.id,
|
||||
l.user_id,
|
||||
l.user_name,
|
||||
l.org_id,
|
||||
l.org_name,
|
||||
l.create_time,
|
||||
l.leave_type,
|
||||
l.type,
|
||||
l.leave_reason,
|
||||
l.leave_start_date,
|
||||
l.leave_start_interval,
|
||||
l.leave_end_date,
|
||||
l.leave_end_interval,
|
||||
l.leave_duration,
|
||||
GROUP_CONCAT(d.dict_label SEPARATOR ', ') AS postName,
|
||||
CASE
|
||||
WHEN l.source = '1' THEN '系统'
|
||||
WHEN l.source = '3' THEN '小程序'
|
||||
ELSE ''
|
||||
END AS source
|
||||
FROM
|
||||
leave_apply l
|
||||
LEFT JOIN sys_user_post p ON p.user_id = l.user_id
|
||||
LEFT JOIN sys_dict_data d on d.dict_code = p.post_id
|
||||
WHERE
|
||||
l.is_active = '1' AND l.leave_type = '休假报备' AND (l.source = '1' OR l.source = '3')
|
||||
<if test='params.orgList != null and params.orgList.size() > 0'>
|
||||
and org_id in (
|
||||
<foreach collection="params.orgList" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="params.params.beginTime != null and params.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(l.leave_start_date,'%y%m%d') >= date_format(#{params.params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.params.endTime != null and params.params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(l.leave_end_date,'%y%m%d') <= date_format(#{params.params.endTime},'%y%m%d')
|
||||
</if>
|
||||
GROUP BY
|
||||
l.id,
|
||||
l.user_id,
|
||||
l.user_name,
|
||||
l.org_id,
|
||||
l.org_name,
|
||||
l.create_time,
|
||||
l.leave_type,
|
||||
l.leave_reason,
|
||||
l.leave_start_date,
|
||||
l.leave_start_interval,
|
||||
l.leave_end_date,
|
||||
l.leave_end_interval,
|
||||
l.leave_duration,
|
||||
l.examine_status
|
||||
ORDER BY l.leave_start_date DESC
|
||||
</select>
|
||||
|
||||
<select id="selectLeaveReportingById"
|
||||
resultType="com.bonus.system.wechat.entity.WechatLeaveReportingBean">
|
||||
SELECT l.id,
|
||||
l.user_id,
|
||||
l.user_name,
|
||||
l.org_id,
|
||||
l.org_name,
|
||||
l.create_time,
|
||||
l.leave_type,
|
||||
l.type,
|
||||
l.leave_reason,
|
||||
l.leave_start_date,
|
||||
l.leave_start_interval,
|
||||
l.leave_end_date,
|
||||
l.leave_end_interval,
|
||||
l.leave_duration,
|
||||
GROUP_CONCAT(d.dict_label SEPARATOR ', ') AS postName,
|
||||
l.host_user_id,
|
||||
l.is_agree,
|
||||
l.location,
|
||||
l. remark as remark
|
||||
FROM
|
||||
leave_apply l
|
||||
LEFT JOIN sys_user_post p ON p.user_id = l.user_id
|
||||
LEFT JOIN sys_dict_data d on d.dict_code = p.post_id
|
||||
WHERE l.id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue