|
@@ -22,8 +22,11 @@ import org.jeecg.modules.geke.attendance.entity.Attendance;
|
|
|
import org.jeecg.modules.geke.attendance.service.IAttendanceService;
|
|
|
import org.jeecg.modules.geke.shift.entity.Shift;
|
|
|
import org.jeecg.modules.geke.shift.service.IShiftService;
|
|
|
+import org.jeecg.modules.geke.statutoryleave.entity.StatutoryLeave;
|
|
|
+import org.jeecg.modules.geke.statutoryleave.service.IStatutoryLeaveService;
|
|
|
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;
|
|
@@ -68,7 +71,10 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
|
|
|
private workOvertimeMapper overtimeMapper;
|
|
|
@Autowired
|
|
|
private IBdErrorInfoService bdErrorInfoService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService iSysUserService;
|
|
|
+ @Autowired
|
|
|
+ private IStatutoryLeaveService statutoryLeaveService;
|
|
|
|
|
|
/**
|
|
|
* 人员考勤页面,1付薪,2累计调休,3忽略
|
|
@@ -80,6 +86,40 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
|
|
|
public Result<?> fuXinInfo(@RequestBody JSONObject jsonObject) throws ParseException {
|
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
String st = jsonObject.get("st").toString();
|
|
|
+ String w = jsonObject.get("w").toString();
|
|
|
+ String userId = jsonObject.get("userId").toString();
|
|
|
+ SysUser sysUser = iSysUserService.getUserByName(userId);
|
|
|
+ if(sysUser != null){
|
|
|
+ //正式工 101
|
|
|
+ //实习生 103
|
|
|
+// 劳务工 104
|
|
|
+// 劳务外包5+2 105
|
|
|
+// 劳务外包6+1 106
|
|
|
+// 顾问 102
|
|
|
+ // 员工为正式,实习,劳务加班付薪时,如果没匹配到工资倍数,则默认两倍;匹配到工资倍数则按照倍数算薪;其他员工除非能匹配到工资倍数,否则不能付薪只能调休
|
|
|
+ int userType = sysUser.getCategory();
|
|
|
+ if(userType != 101 && userType != 103 && userType != 104){
|
|
|
+ DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ String thisDate = null;
|
|
|
+ if(w.equals("1")){
|
|
|
+ thisDate = jsonObject.get("viewDate1").toString();
|
|
|
+ }else{
|
|
|
+ thisDate = jsonObject.get("viewDate").toString();
|
|
|
+ }
|
|
|
+ List<StatutoryLeave> list = statutoryLeaveService.list();
|
|
|
+ for(StatutoryLeave o:list){
|
|
|
+ if(o.getType().equals("1")){//班
|
|
|
+ Date begin = o.getStartDate();
|
|
|
+ Date end = o.getEndDate();
|
|
|
+ if(!isEffectiveDate(sdf.parse(thisDate),begin,end) ){
|
|
|
+ return Result.error("当前用户的加班,只能用于累计调休");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
if(st.equals("1")){
|
|
|
st = "付薪";
|
|
|
}else if(st.equals("2")){
|
|
@@ -87,7 +127,7 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
|
|
|
}else{
|
|
|
st = "忽略";
|
|
|
}
|
|
|
- String w = jsonObject.get("w").toString();
|
|
|
+
|
|
|
if(w.equals("1")){
|
|
|
|
|
|
String viewDate1 = jsonObject.get("viewDate1").toString();
|
|
@@ -100,7 +140,7 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
|
|
|
}else{
|
|
|
|
|
|
String viewDate = jsonObject.get("viewDate").toString();
|
|
|
- String userId = jsonObject.get("userId").toString();
|
|
|
+
|
|
|
//校验是否关账
|
|
|
if(!bdClockinMonthService.ifClose(viewDate)){
|
|
|
return Result.error("当前月份已关账,无法此操作");
|
|
@@ -318,6 +358,38 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
|
|
|
o.setMonths(date[1]);
|
|
|
|
|
|
o.setWorkDay("21.75");
|
|
|
+
|
|
|
+
|
|
|
+ //正式工 101
|
|
|
+ //实习生 103
|
|
|
+// 劳务工 104
|
|
|
+// 劳务外包5+2 105
|
|
|
+// 劳务外包6+1 106
|
|
|
+// 顾问 102
|
|
|
+ // 员工为正式,实习,劳务加班付薪时,如果没匹配到工资倍数,则默认两倍;匹配到工资倍数则按照倍数算薪;其他员工除非能匹配到工资倍数,否则不能付薪只能调休
|
|
|
+// String cate = o.getCategory();
|
|
|
+// if(!cate.equals("101") && !cate.equals("103") && !cate.equals("104")){
|
|
|
+// DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+// String thisDate = null;
|
|
|
+// if(w.equals("1")){
|
|
|
+// thisDate = jsonObject.get("viewDate1").toString();
|
|
|
+// }else{
|
|
|
+// thisDate = jsonObject.get("viewDate").toString();
|
|
|
+// }
|
|
|
+// List<StatutoryLeave> list = statutoryLeaveService.list();
|
|
|
+// for(StatutoryLeave o:list){
|
|
|
+// if(o.getType().equals("1")){//班
|
|
|
+// Date begin = o.getStartDate();
|
|
|
+// Date end = o.getEndDate();
|
|
|
+// if(!isEffectiveDate(sdf.parse(thisDate),begin,end) ){
|
|
|
+// return Result.error("当前用户的加班,只能用于累计调休");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+
|
|
|
//是否免打卡 1免打卡
|
|
|
if(StringUtil.isNullOrEmpty(o.getIsAttendance()) && o.getIsAttendance().equals("1")){
|
|
|
o.setWorkDayReal("21.75");//真实考勤天数
|
|
@@ -491,27 +563,57 @@ public class viewClockInController extends JeecgController<ViewClockIn, IviewClo
|
|
|
return Result.OK(viewClockIn);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 导出excel
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param viewClockIn
|
|
|
- */
|
|
|
- @RequestMapping(value = "/exportXls")
|
|
|
- public ModelAndView exportXls(HttpServletRequest request, ViewClockIn viewClockIn) {
|
|
|
- return super.exportXls(request, viewClockIn, ViewClockIn.class, "员工考勤日报");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过excel导入数据
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param response
|
|
|
- * @return
|
|
|
- */
|
|
|
- @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
- public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
- return super.importExcel(request, response, ViewClockIn.class);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 导出excel
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param viewClockIn
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/exportXls")
|
|
|
+ public ModelAndView exportXls(HttpServletRequest request, ViewClockIn viewClockIn) {
|
|
|
+ return super.exportXls(request, viewClockIn, ViewClockIn.class, "员工考勤日报");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过excel导入数据
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
+ public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ return super.importExcel(request, response, ViewClockIn.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断当前时间是否在[startTime, endTime]区间,注意时间格式要一致
|
|
|
+ *
|
|
|
+ * @param nowTime 当前时间
|
|
|
+ * @param startTime 开始时间
|
|
|
+ * @param endTime 结束时间
|
|
|
+ * @return
|
|
|
+ * @author jqlin
|
|
|
+ */
|
|
|
+ public static boolean isEffectiveDate(Date nowTime, Date startTime, Date endTime) {
|
|
|
+ if (nowTime.getTime() == startTime.getTime()
|
|
|
+ || nowTime.getTime() == endTime.getTime()) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ Calendar date = Calendar.getInstance();
|
|
|
+ date.setTime(nowTime);
|
|
|
+
|
|
|
+ Calendar begin = Calendar.getInstance();
|
|
|
+ begin.setTime(startTime);
|
|
|
|
|
|
+ Calendar end = Calendar.getInstance();
|
|
|
+ end.setTime(endTime);
|
|
|
+
|
|
|
+ if (date.after(begin) && date.before(end)) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|