diff --git a/admin-hanhai-vue/.env.development b/admin-hanhai-vue/.env.development
index 888fbbf..2ad6386 100644
--- a/admin-hanhai-vue/.env.development
+++ b/admin-hanhai-vue/.env.development
@@ -1,5 +1,5 @@
NODE_ENV=development
-VUE_APP_API_BASE_URL=http://dev.java996.icu/clockin-api
+VUE_APP_API_BASE_URL=http://127.0.0.1:8081/clockin-api
VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview
VUE_APP_MAP_KEY=WPKBZ-OKICI-ZAIGE-U6TQ4-RPQIV-OXBJO
diff --git a/admin-hanhai-vue/src/views/xcx/ClockinLogList.vue b/admin-hanhai-vue/src/views/xcx/ClockinLogList.vue
index d34ed09..8cde1fa 100644
--- a/admin-hanhai-vue/src/views/xcx/ClockinLogList.vue
+++ b/admin-hanhai-vue/src/views/xcx/ClockinLogList.vue
@@ -11,7 +11,7 @@
-
+
@@ -22,7 +22,7 @@
-
导出
+
导出
@@ -119,23 +119,23 @@
},
data () {
return {
- description: 'clockin_log管理页面',
+ description: '打卡管理页面',
// 表头
columns: [
+ // {
+ // title: '#',
+ // dataIndex: '',
+ // key:'rowIndex',
+ // width:60,
+ // align:"center",
+ // customRender:function (t,r,index) {
+ // return parseInt(index)+1;
+ // }
+ // },
{
- title: '#',
- dataIndex: '',
- key:'rowIndex',
- width:60,
+ title:'用户',
align:"center",
- customRender:function (t,r,index) {
- return parseInt(index)+1;
- }
- },
- {
- title:'用户编号',
- align:"center",
- dataIndex: 'userId'
+ dataIndex: 'userId_dictText'
},
{
title:'照片',
@@ -143,6 +143,11 @@
dataIndex: 'pic',
scopedSlots: {customRender: 'imgSlot'}
},
+ {
+ title:'打卡时间',
+ align:"center",
+ dataIndex: 'clockInTime'
+ },
{
title:'打卡地址',
align:"center",
diff --git a/jeecg-boot-base/jeecg-boot-base-core/pom.xml b/jeecg-boot-base/jeecg-boot-base-core/pom.xml
index 8ff7738..9064ab5 100644
--- a/jeecg-boot-base/jeecg-boot-base-core/pom.xml
+++ b/jeecg-boot-base/jeecg-boot-base-core/pom.xml
@@ -73,7 +73,7 @@
commons-io
commons-io
- ${commons.version}
+ ${commons-io.version}
commons-lang
@@ -273,6 +273,26 @@
3.1.978
+
+ org.apache.poi
+ poi-ooxml
+ ${poi-ooxml.version}
+
+
+ org.apache.poi
+ poi
+ ${poi-ooxml.version}
+
+
+ org.apache.xmlbeans
+ xmlbeans
+ 5.1.1
+
+
+ org.apache.poi
+ poi-ooxml-schemas
+ 4.1.2
+
diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils2.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils2.java
index 1e42c79..3217a6e 100644
--- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils2.java
+++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils2.java
@@ -95,6 +95,17 @@ public class DateUtils2 {
return dateTimeFormatter.format(localDateTime);
}
+ /**
+ * 获取当前日期 yyyymmdd
+ * @return
+ */
+ public static String getNowDateString4(String zoneId){
+
+ ZonedDateTime zonedDateTime = ZonedDateTime.now(ZoneId.of(zoneId));
+ DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(YYYYMMDD);
+ return dateTimeFormatter.format(zonedDateTime);
+ }
+
/**
* 获取当前日期 yyyymmdd
* @return
diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/ExcelStyleUtil.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/ExcelStyleUtil.java
new file mode 100644
index 0000000..f6fa8ac
--- /dev/null
+++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/ExcelStyleUtil.java
@@ -0,0 +1,39 @@
+package org.jeecg.common.util;
+
+import org.apache.poi.ss.usermodel.*;
+import org.jeecgframework.poi.excel.export.styler.ExcelExportStylerDefaultImpl;
+
+public class ExcelStyleUtil extends ExcelExportStylerDefaultImpl {
+
+ public ExcelStyleUtil(Workbook workbook) {
+ super(workbook);
+ }
+
+ @Override
+ public CellStyle getHeaderStyle(short color) {
+ CellStyle style = workbook.createCellStyle();
+ style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
+ style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+ Font font = workbook.createFont();
+ font.setBold(true);
+ font.setColor(IndexedColors.WHITE.getIndex());
+ style.setFont(font);
+ style.setAlignment(HorizontalAlignment.CENTER);
+ style.setVerticalAlignment(VerticalAlignment.CENTER);
+ return style;
+ }
+
+ @Override
+ public CellStyle getTitleStyle(short color) {
+ CellStyle style = workbook.createCellStyle();
+ Font font = workbook.createFont();
+ font.setBold(true);
+ font.setFontHeightInPoints((short) 14);
+ font.setColor(IndexedColors.DARK_BLUE.getIndex());
+ style.setFont(font);
+ style.setAlignment(HorizontalAlignment.CENTER);
+ style.setVerticalAlignment(VerticalAlignment.CENTER);
+ return style;
+ }
+
+}
diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockInproject/controller/ClockInProjectController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockInproject/controller/ClockInProjectController.java
index 68635d8..64b3e33 100644
--- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockInproject/controller/ClockInProjectController.java
+++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockInproject/controller/ClockInProjectController.java
@@ -9,7 +9,10 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.clockInproject.entity.ClockInProject;
@@ -82,6 +85,16 @@ public class ClockInProjectController extends JeecgController
add(@RequestBody ClockInProject clockInProject) {
+ if(StringUtils.isNotBlank(clockInProject.getTeamId())){
+ List clockInProjects = clockInProjectService.lambdaQuery()
+ .eq(ClockInProject::getDelFlag, 0)
+ .eq(ClockInProject::getTeamId, clockInProject.getTeamId())
+ .list();
+
+ if(clockInProjects!= null && clockInProjects.size()!=0){
+ throw new JeecgBootException("该团队已有绑定项目");
+ }
+ }
clockInProjectService.save(clockInProject);
return Result.OK("添加成功!");
}
@@ -96,6 +109,23 @@ public class ClockInProjectController extends JeecgController edit(@RequestBody ClockInProject clockInProject) {
+ if(StringUtils.isNotBlank(clockInProject.getTeamId())){
+ List clockInProjects = clockInProjectService.lambdaQuery()
+ .eq(ClockInProject::getDelFlag, 0)
+ .eq(ClockInProject::getTeamId, clockInProject.getTeamId())
+ .list();
+
+ if(clockInProjects!= null && clockInProjects.size()!=0){
+ for (ClockInProject clockInProject1:clockInProjects){
+ if(StringUtils.equals(clockInProject.getId(),clockInProject1.getId())){
+ break;
+ }else{
+ throw new JeecgBootException("该团队已有绑定项目");
+ }
+ }
+
+ }
+ }
clockInProjectService.updateById(clockInProject);
return Result.OK("编辑成功!");
}
diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockInprojectitem/entity/ClockInProjectItem.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockInprojectitem/entity/ClockInProjectItem.java
index 376ffd3..535bda3 100644
--- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockInprojectitem/entity/ClockInProjectItem.java
+++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockInprojectitem/entity/ClockInProjectItem.java
@@ -73,4 +73,6 @@ public class ClockInProjectItem implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private java.util.Date updateTime;
+ /**类型 0正常 1周末 2加班*/
+ private Integer type;
}
diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java
index ef5508a..9325578 100644
--- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java
+++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java
@@ -10,13 +10,20 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateUtils2;
+import org.jeecg.common.util.ExcelStyleUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.clockInproject.entity.ClockInProject;
import org.jeecg.modules.clockInproject.service.IClockInProjectService;
@@ -25,6 +32,7 @@ import org.jeecg.modules.clockinauth.service.IClockinAuthService;
import org.jeecg.modules.clockinlog.entity.ClockinLog;
import org.jeecg.modules.clockinlog.mapper.ClockinLogMapper;
import org.jeecg.modules.clockinlog.ressp.ClockInLogExportResp;
+import org.jeecg.modules.clockinlog.ressp.ClockInLogExportResp2;
import org.jeecg.modules.clockinlog.ressp.ClockInLogResp;
import org.jeecg.modules.clockinlog.service.IClockinLogService;
@@ -35,12 +43,15 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.clockinteamlog.entity.ClockinTeamLog;
import org.jeecg.modules.clockinteamlog.service.IClockinTeamLogService;
+import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecgframework.poi.excel.view.JeecgMapExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
@@ -185,7 +196,7 @@ public class ClockinLogController extends JeecgController parameterMap = request.getParameterMap();
String[] clockStartTimes = parameterMap.get("clockStartTime");
+ String[] userIds = parameterMap.get("userId");
// QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(object, request.getParameterMap());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
- List clockinTeamLogs = clockinTeamLogService.lambdaQuery()
- .eq(ClockinTeamLog::getDelFlag, 0)
-// .eq(ClockinTeamLog::getStatus,1)
- .list();
+ LambdaQueryChainWrapper queryChainWrapper = clockinTeamLogService.lambdaQuery()
+ .eq(ClockinTeamLog::getDelFlag, 0);
+// List clockinTeamLogs = clockinTeamLogService.lambdaQuery()
+// .eq(ClockinTeamLog::getDelFlag, 0)
+// .list();
+ if(userIds!=null && userIds.length!=0 && StringUtils.isNotBlank(userIds[0])){
+ queryChainWrapper.eq(ClockinTeamLog::getUserId,userIds[0]);
+ }
+ List clockinTeamLogs = queryChainWrapper.list();
// int day = Integer.parseInt(DateUtils2.getNowMonthMaxDay());
@@ -229,6 +246,9 @@ public class ClockinLogController extends JeecgController clockInLogExportResp2s = new ArrayList<>();
+ ClockInLogExportResp clockInLogExportResp = new ClockInLogExportResp();
+ clockInLogExportResp.setName(clockinAuth.getName());
+ clockInLogExportResp.setDate(nowYearMonth);
for (int n= 1;n<=day;n++){
- ClockInLogExportResp clockInLogExportResp = new ClockInLogExportResp();
- clockInLogExportResp.setName(clockinAuth.getName());
- clockInLogExportResp.setDate(nowYearMonth);
- clockInLogExportResp.setDay(n+"");
- yearMonthDay = nowYearMonth+"-"+n;
+ ClockInLogExportResp2 clockInLogExportResp2 = new ClockInLogExportResp2();
+
+
+ clockInLogExportResp2.setDay(n+"");
+ yearMonthDay = nowYearMonth+"-"+n;
+ if(n < 10){
+ yearMonthDay = nowYearMonth+"-0"+n;
+ }
+
List clockInLogExpeort = clockinLogMapper.getClockInLogExpeort(yearMonthDay, clockInProject.getId(), clockinTeamLog.getUserId());
String clockInTime = "";
for (ClockInLogResp clockInLogResp:clockInLogExpeort) {
@@ -253,10 +280,12 @@ public class ClockinLogController extends JeecgController clazz, String title) {
+ // Step.1 组装查询条件
+ Map parameterMap = request.getParameterMap();
+ String[] clockStartTimes = parameterMap.get("clockStartTime");
+ String[] userIds = parameterMap.get("userId");
+
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+ LambdaQueryChainWrapper queryChainWrapper = clockinTeamLogService.lambdaQuery()
+ .eq(ClockinTeamLog::getDelFlag, 0);
+
+ if (userIds != null && userIds.length != 0 && StringUtils.isNotBlank(userIds[0])) {
+ queryChainWrapper.eq(ClockinTeamLog::getUserId, userIds[0]);
+ }
+ List clockinTeamLogs = queryChainWrapper.list();
+
+ // 确定导出月份
+ String nowYearMonth = DateUtils2.getNowYearMonth();
+ if (clockStartTimes != null && clockStartTimes.length != 0 && StringUtils.isNotBlank(clockStartTimes[0])) {
+ nowYearMonth = clockStartTimes[0];
+ }
+ YearMonth yearMonth = YearMonth.parse(nowYearMonth);
+ int daysInMonth = yearMonth.lengthOfMonth(); // 当前月份的天数
+
+ // Step.2 获取导出数据
+ List