From ffad0d0136452fe876702bdd92969b8ef5d49c20 Mon Sep 17 00:00:00 2001 From: lSun <15893999301@qq.com> Date: Tue, 3 Dec 2024 17:49:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86-=E4=BC=91?= =?UTF-8?q?=E5=81=87=E6=8A=A5=E5=A4=87=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/download/ExportFileController.java | 55 +++++- .../WechatLeaveReportingController.java | 60 +++++++ .../wechat/dao/WechatLeaveReportingDao.java | 21 +++ .../entity/WechatLeaveReportingBean.java | 163 ++++++++++++++++++ .../service/WechatLeaveReportingService.java | 27 +++ .../WechatLeaveReportingServiceImpl.java | 39 +++++ .../LeaveReporting/LeaveReportingMapper.xml | 2 +- .../wechat/WechatLeaveReportingMapper.xml | 94 ++++++++++ 8 files changed, 456 insertions(+), 5 deletions(-) create mode 100644 bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatLeaveReportingController.java create mode 100644 bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/dao/WechatLeaveReportingDao.java create mode 100644 bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/entity/WechatLeaveReportingBean.java create mode 100644 bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatLeaveReportingService.java create mode 100644 bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatLeaveReportingServiceImpl.java create mode 100644 bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatLeaveReportingMapper.xml diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/download/ExportFileController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/download/ExportFileController.java index 00be0a4..2ee8f19 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/download/ExportFileController.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/download/ExportFileController.java @@ -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 personExportVoList = new ArrayList<>(); + List 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); + } + } + } diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatLeaveReportingController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatLeaveReportingController.java new file mode 100644 index 0000000..0500db2 --- /dev/null +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatLeaveReportingController.java @@ -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("系统异常"); + } +} \ No newline at end of file diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/dao/WechatLeaveReportingDao.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/dao/WechatLeaveReportingDao.java new file mode 100644 index 0000000..f1702e0 --- /dev/null +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/dao/WechatLeaveReportingDao.java @@ -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 getLeaveReportingList(@Param("params")WechatLeaveReportingBean bean); + + WechatLeaveReportingBean selectLeaveReportingById(Long id); + +} diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/entity/WechatLeaveReportingBean.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/entity/WechatLeaveReportingBean.java new file mode 100644 index 0000000..8697f7b --- /dev/null +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/entity/WechatLeaveReportingBean.java @@ -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 orgList; + +} diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatLeaveReportingService.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatLeaveReportingService.java new file mode 100644 index 0000000..f8d085b --- /dev/null +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatLeaveReportingService.java @@ -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 getLeaveReportingList(WechatLeaveReportingBean bean); + + /** + * 查询休假报备 + * @param id + * @return + */ + WechatLeaveReportingBean selectLeaveReportingById(Long id); + +} diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatLeaveReportingServiceImpl.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatLeaveReportingServiceImpl.java new file mode 100644 index 0000000..33e6e6e --- /dev/null +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatLeaveReportingServiceImpl.java @@ -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 getLeaveReportingList(WechatLeaveReportingBean bean) { + return wechatLeaveReportingDao.getLeaveReportingList(bean); + } + + @Override + public WechatLeaveReportingBean selectLeaveReportingById(Long id) { + return wechatLeaveReportingDao.selectLeaveReportingById(id); + } +} diff --git a/bonus-modules/bonus-system/src/main/resources/mapper/LeaveReporting/LeaveReportingMapper.xml b/bonus-modules/bonus-system/src/main/resources/mapper/LeaveReporting/LeaveReportingMapper.xml index 2ff030d..37a7dfd 100644 --- a/bonus-modules/bonus-system/src/main/resources/mapper/LeaveReporting/LeaveReportingMapper.xml +++ b/bonus-modules/bonus-system/src/main/resources/mapper/LeaveReporting/LeaveReportingMapper.xml @@ -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' and org_id in ( diff --git a/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatLeaveReportingMapper.xml b/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatLeaveReportingMapper.xml new file mode 100644 index 0000000..867fccf --- /dev/null +++ b/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatLeaveReportingMapper.xml @@ -0,0 +1,94 @@ + + + + + + + + + \ No newline at end of file