|
@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import io.netty.util.internal.StringUtil;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
+import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
@@ -28,10 +29,7 @@ import org.jeecg.modules.system.entity.SysDepart;
|
|
|
import org.jeecg.modules.system.entity.SysUser;
|
|
|
import org.jeecg.modules.system.service.ISysUserService;
|
|
|
import org.jeecg.modules.system.util.DateUtils2;
|
|
|
-import org.jeecg.modules.viewClockIn.entity.BdClose;
|
|
|
-import org.jeecg.modules.viewClockIn.entity.BdErrorInfo;
|
|
|
-import org.jeecg.modules.viewClockIn.entity.ViewClockIn;
|
|
|
-import org.jeecg.modules.viewClockIn.entity.bdClockinMonth;
|
|
|
+import org.jeecg.modules.viewClockIn.entity.*;
|
|
|
import org.jeecg.modules.viewClockIn.service.IBdErrorInfoService;
|
|
|
import org.jeecg.modules.viewClockIn.service.IbdClockinMonthService;
|
|
|
import org.jeecg.modules.viewClockIn.service.IviewClockInService;
|
|
@@ -42,7 +40,11 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
|
|
|
import org.jeecg.modules.workOvertime.mapper.workOvertimeMapper;
|
|
|
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
+import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -76,7 +78,8 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
|
|
|
@Autowired
|
|
|
private IStatutoryLeaveService statutoryLeaveService;
|
|
|
|
|
|
-
|
|
|
+ @Value("${jeecg.path.upload}")
|
|
|
+ private String upLoadPath;
|
|
|
/**
|
|
|
* 批量人员考勤页面,1付薪,2累计调休,3忽略
|
|
|
* @param jsonObject
|
|
@@ -378,6 +381,11 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
|
|
|
if(!bdClockinMonthService.ifClose(nowDate)){
|
|
|
return Result.error("当前月份已关账,无法此操作");
|
|
|
}
|
|
|
+ DateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
|
|
+
|
|
|
+ if(new Date().before(sdf.parse(nowDate))){
|
|
|
+ return Result.error("不能操作未发生的考勤月份");
|
|
|
+ }
|
|
|
|
|
|
String[] date = nowDate.split("-");
|
|
|
String userIds = jsonObject.getString("userIds");
|
|
@@ -640,14 +648,48 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 导出excel
|
|
|
+ * 导出excel 员工考勤信息
|
|
|
*
|
|
|
* @param request
|
|
|
* @param viewClockIn
|
|
|
*/
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
- public ModelAndView exportXls(HttpServletRequest request, ViewClockIn viewClockIn) {
|
|
|
- return super.exportXls(request, viewClockIn, ViewClockIn.class, "员工考勤日报");
|
|
|
+ public ModelAndView exportXls(HttpServletRequest request, ViewClockIn viewClockIn,String userName,String mDate,String userType) {
|
|
|
+ List<ExportClockInfo> list = viewClockInService.exportErrotInfo(userName,mDate,userType);
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
+ mv.addObject(NormalExcelConstants.FILE_NAME, "员工考勤信息"); //此处设置的filename无效 ,前端会重更新设置一下
|
|
|
+ mv.addObject(NormalExcelConstants.CLASS, ExportClockInfo.class);
|
|
|
+ //update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
|
|
+ ExportParams exportParams=new ExportParams("员工考勤信息", "导出人:" + sysUser.getRealname(), "员工考勤信息");
|
|
|
+ exportParams.setImageBasePath(upLoadPath);
|
|
|
+ //update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
|
|
+ mv.addObject(NormalExcelConstants.PARAMS,exportParams);
|
|
|
+ mv.addObject(NormalExcelConstants.DATA_LIST, list);
|
|
|
+ return mv;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出excel 考勤日报
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param viewClockIn
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/exportXlsDay")
|
|
|
+ public ModelAndView exportXlsDay(HttpServletRequest request, ExportClockDay viewClockIn) {
|
|
|
+
|
|
|
+ List<ExportClockDay> list = viewClockInService.exportXlsDay(viewClockIn);
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
+ mv.addObject(NormalExcelConstants.FILE_NAME, "员工考勤信息"); //此处设置的filename无效 ,前端会重更新设置一下
|
|
|
+ mv.addObject(NormalExcelConstants.CLASS, ExportClockDay.class);
|
|
|
+ //update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
|
|
+ ExportParams exportParams=new ExportParams("员工考勤信息", "导出人:" + sysUser.getRealname(), "员工考勤信息");
|
|
|
+ exportParams.setImageBasePath(upLoadPath);
|
|
|
+ //update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
|
|
+ mv.addObject(NormalExcelConstants.PARAMS,exportParams);
|
|
|
+ mv.addObject(NormalExcelConstants.DATA_LIST, list);
|
|
|
+ return mv;
|
|
|
}
|
|
|
|
|
|
/**
|