From 7172e929b5c9f348552335922acf1fe7c865be49 Mon Sep 17 00:00:00 2001 From: haha Date: Wed, 12 Jun 2024 22:45:37 +0800 Subject: [PATCH] update code --- .../src/views/project/attendance/index.vue | 33 ++++++++++++++++++- ruoyi-ui/vue.config.js | 1 + .../SurProjectAttendanceDataController.java | 5 +++ .../project/SurProjectAuditinfoMapper.xml | 2 +- 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/views/project/attendance/index.vue b/ruoyi-ui/src/views/project/attendance/index.vue index bcfa44bb..d5e563d7 100644 --- a/ruoyi-ui/src/views/project/attendance/index.vue +++ b/ruoyi-ui/src/views/project/attendance/index.vue @@ -433,10 +433,41 @@ export default { }, /** 导出按钮操作 */ handleExport() { + let postData = {}; + if (this.queryParams.attendanceTime) { + postData.attendanceTime = this.$dt(this.queryParams.attendanceTime).format( + "YYYY-MM-DD" + ); + } + if (this.queryParams.attendanceOutTime) { + postData.attendanceOutTime = this.$dt(this.queryParams.attendanceOutTime).format( + "YYYY-MM-DD" + ); + } + let tmps = this.cfgList.filter( + (d) => + d.projectId == this.queryParams.projectId && + d.subDeptId == this.queryParams.deptId + ); + if (tmps.length > 0) { + postData.cfgid = tmps[0].id; + } else { + postData.projectId = this.queryParams.projectId; + postData.deptId = this.queryParams.deptId; + } + postData.pageNum = this.queryParams.pageNum; + postData.pageSize = this.queryParams.pageSize; + if (this.queryParams.workerName) { + postData.workerName = this.queryParams.workerName; + } + if (this.queryParams.companyTypeId && this.queryParams.companyTypeId > 0) { + postData.companyTypeId = this.queryParams.companyTypeId; + } + this.download( "project/attendance/export", { - ...this.queryParams, + ...postData, }, `attendance_${new Date().getTime()}.xlsx` ); diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index fc8aec57..7e435c78 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -36,6 +36,7 @@ module.exports = { [process.env.VUE_APP_BASE_API]: { target: `http://127.0.0.1:8090/jhapi`, //target: `http://192.168.126.20:808/jhapi`, + //target: `http://szgc.jhncidg.com/jhapi`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '' diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/project/controller/SurProjectAttendanceDataController.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/project/controller/SurProjectAttendanceDataController.java index d7112ba1..5962960b 100644 --- a/yanzhu-jh/src/main/java/com/yanzhu/jh/project/controller/SurProjectAttendanceDataController.java +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/project/controller/SurProjectAttendanceDataController.java @@ -66,6 +66,11 @@ public class SurProjectAttendanceDataController extends BaseController @PostMapping("/export") public void export(HttpServletResponse response, SurProjectAttendanceData surProjectAttendanceData) { + String tmp=surProjectAttendanceData.getAttendanceTime(); + if(StrUtil.isNotEmpty(tmp)){ + int year= DateUtil.parse(tmp).year(); + surProjectAttendanceData.setYear(year); + } List list = surProjectAttendanceDataService.selectSurProjectAttendanceDataList(surProjectAttendanceData); ExcelUtil util = new ExcelUtil(SurProjectAttendanceData.class); util.exportExcel(response, list, "劳务实名制管理数据"); diff --git a/yanzhu-jh/src/main/resources/mapper/project/SurProjectAuditinfoMapper.xml b/yanzhu-jh/src/main/resources/mapper/project/SurProjectAuditinfoMapper.xml index fc6be592..8f253e2d 100644 --- a/yanzhu-jh/src/main/resources/mapper/project/SurProjectAuditinfoMapper.xml +++ b/yanzhu-jh/src/main/resources/mapper/project/SurProjectAuditinfoMapper.xml @@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.witness_user like concat('%', #{nowUserName}, '%') and a.approve_status='1' - and a.approve_status in ('1','3') or a.approve_status is null + and (a.approve_status in ('1','3') or a.approve_status is null) and a.approve_status in ('3','4') and sp.id = #{businessKey} and sp.projectName like concat('%', #{businessKeyName}, '%')