From 10055d6178a0c7533686c52828048666eaca10da Mon Sep 17 00:00:00 2001 From: lSun <15893999301@qq.com> Date: Tue, 3 Dec 2024 19:53:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86-=E5=87=BA?= =?UTF-8?q?=E5=B7=AE=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 | 57 +++++- .../controller/WechatEvectionController.java | 62 ++++++ .../WechatLeaveReportingController.java | 4 +- .../system/wechat/dao/WechatEvectionDao.java | 22 +++ .../wechat/entity/WechatEvectionBean.java | 177 ++++++++++++++++++ .../wechat/service/WechatEvectionService.java | 29 +++ .../service/WechatEvectionServiceImpl.java | 43 +++++ .../mapper/evection/EvectionMapper.xml | 2 +- .../mapper/wechat/WechatEvectionMapper.xml | 130 +++++++++++++ .../wechat/WechatLeaveReportingMapper.xml | 7 - 10 files changed, 519 insertions(+), 14 deletions(-) create mode 100644 bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatEvectionController.java create mode 100644 bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/dao/WechatEvectionDao.java create mode 100644 bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/entity/WechatEvectionBean.java create mode 100644 bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatEvectionService.java create mode 100644 bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatEvectionServiceImpl.java create mode 100644 bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatEvectionMapper.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 2ee8f19..3769cdd 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,7 +26,9 @@ 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.WechatEvectionBean; import com.bonus.system.wechat.entity.WechatLeaveReportingBean; +import com.bonus.system.wechat.service.WechatEvectionService; import com.bonus.system.wechat.service.WechatLeaveReportingService; import com.bonus.system.wechat.service.WechatService; import lombok.extern.slf4j.Slf4j; @@ -95,6 +97,14 @@ public class ExportFileController { */ @Resource(name = "EvectionService") private EvectionService evectionService; + + /** + * 数据管理-出差报备 + */ + @Resource(name = "WechatEvectionService") + private WechatEvectionService wechatevectionService; + + /** * 考勤明细导出 */ @@ -542,14 +552,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"); @@ -705,4 +715,43 @@ public class ExportFileController { } } + + /** + * 数据管理-出差报备 + * @param response + * @param bean + * @return void + */ + @GetMapping("/exportWechatEvection") + public void exportWechatEvection(HttpServletResponse response, WechatEvectionBean bean) { + try { + List personExportVoList = new ArrayList<>(); + List personLists = wechatevectionService.getEvectionList(bean); + for (int i = 0; i < personLists.size(); i++) { + WechatEvectionBean 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, WechatEvectionBean.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/WechatEvectionController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatEvectionController.java new file mode 100644 index 0000000..7e1e0d5 --- /dev/null +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatEvectionController.java @@ -0,0 +1,62 @@ +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.evection.service.EvectionService; +import com.bonus.system.wechat.entity.WechatEvectionBean; +import com.bonus.system.wechat.service.WechatEvectionService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; + +/** + * 数据管理->出差报备 + * + * @author lsun + */ +@RestController +@RequestMapping("/wechatEvection") +@Slf4j +public class WechatEvectionController extends BaseController { + + @Resource(name = "WechatEvectionService") + private WechatEvectionService wechatevectionService; + + /** + * 获取数据管理出差报备列表(表格) + */ + @RequiresPermissions("flow:wechatEvection:list") + @GetMapping("/list") + @Log(title = "流程管理->数据管理->出差报备->列表查询", businessType = BusinessType.QUERY) + public TableDataInfo list(WechatEvectionBean bean) { + try{ + startPage(); + return getDataTable(wechatevectionService.getEvectionList(bean)); + }catch (Exception e){ + log.error(e.toString(),e); + } + return getDataTableError(new ArrayList<>()); + } + + /** + * 根据id获取详细信息 + */ + @RequiresPermissions("flow:wechatEvection:list") + @GetMapping(value = "/{id}") + @Log(title = "流程管理->数据管理->出差报备->查询单个出差报备", businessType = BusinessType.QUERY) + public AjaxResult getInfo(@PathVariable String id) { + try{ + return success(wechatevectionService.selectEvectionById(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/controller/WechatLeaveReportingController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatLeaveReportingController.java index 0500db2..7c9c9a5 100644 --- 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 @@ -15,7 +15,7 @@ import javax.annotation.Resource; import java.util.ArrayList; /** - * 休假报备 + * 数据管理-休假报备 * * @author lsun */ @@ -48,7 +48,7 @@ public class WechatLeaveReportingController extends BaseController { */ @RequiresPermissions("flow:wechatLeaveReporting:list") @GetMapping(value = "/{id}") - @Log(title = "流程管理->休假报备->查询单个休假报备", businessType = BusinessType.QUERY) + @Log(title = "流程管理->数据管理->休假报备->查询单个休假报备", businessType = BusinessType.QUERY) public AjaxResult getInfo(@PathVariable Long id) { try{ return success(wechatLeaveReportingService.selectLeaveReportingById(id)); diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/dao/WechatEvectionDao.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/dao/WechatEvectionDao.java new file mode 100644 index 0000000..6f17dc2 --- /dev/null +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/dao/WechatEvectionDao.java @@ -0,0 +1,22 @@ +package com.bonus.system.wechat.dao; + + +import com.bonus.system.evection.entity.EvectionBean; +import com.bonus.system.wechat.entity.WechatEvectionBean; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * 出差报备-数据访问层 + * @author lsun + */ +@Repository("WechatEvectionDao") +public interface WechatEvectionDao { + + List getEvectionList(@Param("bean")WechatEvectionBean bean); + + WechatEvectionBean selectEvectionById(String id); +} diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/entity/WechatEvectionBean.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/entity/WechatEvectionBean.java new file mode 100644 index 0000000..186eb65 --- /dev/null +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/entity/WechatEvectionBean.java @@ -0,0 +1,177 @@ +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 WechatEvectionBean 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 remark; + + /** + * 代理主持工作人员(多个自动隔开) + */ + private String hostUserId; + + /** + * 地点 + */ + private String location; + + /** + * 出差类型 + */ + private String type; + + /** + * 请假单的uuid + */ + private String uuId; + + /** + * 出行人Travelers + */ + private String travelers; + + /** + * 出行人名称 + */ + @Excel(name = "出行人", width = 10.0,height = 20.0, orderNum = "5") + private String travelersName; + + /** + * 自己项目部所在分公司下的所有项目部id + */ + private List orgList; +} diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatEvectionService.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatEvectionService.java new file mode 100644 index 0000000..ee0e9be --- /dev/null +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatEvectionService.java @@ -0,0 +1,29 @@ +package com.bonus.system.wechat.service; + +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.system.evection.entity.EvectionBean; +import com.bonus.system.wechat.entity.WechatEvectionBean; + +import java.util.List; + +/** + * 出差报备-角色业务层 + * @author lsun + */ +public interface WechatEvectionService { + + /** + * 获取出差报备 + * @param bean 参数 + * @return list bean + */ + List getEvectionList(WechatEvectionBean bean); + + + /** + * 查询出差报备 + * @param id + * @return + */ + WechatEvectionBean selectEvectionById(String id); +} diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatEvectionServiceImpl.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatEvectionServiceImpl.java new file mode 100644 index 0000000..1937fcd --- /dev/null +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/service/WechatEvectionServiceImpl.java @@ -0,0 +1,43 @@ +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.evection.dao.EvectionDao; +import com.bonus.system.evection.entity.EvectionBean; +import com.bonus.system.evection.service.EvectionService; +import com.bonus.system.wechat.dao.WechatEvectionDao; +import com.bonus.system.wechat.entity.WechatEvectionBean; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * 出差报备-业务层 + * + * @author lsun + */ +@Service("WechatEvectionService") +@Log4j2 +public class WechatEvectionServiceImpl implements WechatEvectionService { + + @Resource(name = "WechatEvectionDao") + private WechatEvectionDao wechatEvectionDao; + + @Override + public List getEvectionList(WechatEvectionBean bean) { + return wechatEvectionDao.getEvectionList(bean); + } + + + @Override + public WechatEvectionBean selectEvectionById(String id) { + return wechatEvectionDao.selectEvectionById(id); + } + +} diff --git a/bonus-modules/bonus-system/src/main/resources/mapper/evection/EvectionMapper.xml b/bonus-modules/bonus-system/src/main/resources/mapper/evection/EvectionMapper.xml index b41ffc4..54ba407 100644 --- a/bonus-modules/bonus-system/src/main/resources/mapper/evection/EvectionMapper.xml +++ b/bonus-modules/bonus-system/src/main/resources/mapper/evection/EvectionMapper.xml @@ -95,7 +95,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/WechatEvectionMapper.xml b/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatEvectionMapper.xml new file mode 100644 index 0000000..f48b522 --- /dev/null +++ b/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatEvectionMapper.xml @@ -0,0 +1,130 @@ + + + + + + + + + \ No newline at end of file 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 index 867fccf..9c8227e 100644 --- a/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatLeaveReportingMapper.xml +++ b/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatLeaveReportingMapper.xml @@ -32,13 +32,6 @@ 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') - - and org_id in ( - - #{item} - - ) - and date_format(l.leave_start_date,'%y%m%d') >= date_format(#{params.params.beginTime},'%y%m%d')