diff --git a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java index 3a30f00..7c12371 100644 --- a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java +++ b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java @@ -65,16 +65,16 @@ @RequestMapping(value = "/syncAndGenerate", method = RequestMethod.POST) public Object synAndGenetate(String beginDate, String endDate, HttpServletResponse response) throws IOException, SQLException, ParseException { // 获取识别记录 - List deviceList = deviceSupportService.selectDeviceByType("2"); // 考勤设备列表 - List deviceIdList = new ArrayList<>(); - for(Device device : deviceList){ - deviceIdList.add(device.getId().longValue()); - } - List error = recordSupportService.syncRecords(deviceIdList,beginDate + " 00:00:00",endDate+ " 23:59:59"); - - if(!error.isEmpty()){ - return ResponseData.error("获取识别记录失败"); - } +// List deviceList = deviceSupportService.selectDeviceByType("2"); // 考勤设备列表 +// List deviceIdList = new ArrayList<>(); +// for(Device device : deviceList){ +// deviceIdList.add(device.getId().longValue()); +// } +// List error = recordSupportService.syncRecords(deviceIdList,beginDate + " 00:00:00",endDate+ " 23:59:59"); +// +// if(!error.isEmpty()){ +// return ResponseData.error("获取识别记录失败"); +// } // 生成报表数据 Long deptId = new Long((long)-1); diff --git a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java index 3a30f00..7c12371 100644 --- a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java +++ b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java @@ -65,16 +65,16 @@ @RequestMapping(value = "/syncAndGenerate", method = RequestMethod.POST) public Object synAndGenetate(String beginDate, String endDate, HttpServletResponse response) throws IOException, SQLException, ParseException { // 获取识别记录 - List deviceList = deviceSupportService.selectDeviceByType("2"); // 考勤设备列表 - List deviceIdList = new ArrayList<>(); - for(Device device : deviceList){ - deviceIdList.add(device.getId().longValue()); - } - List error = recordSupportService.syncRecords(deviceIdList,beginDate + " 00:00:00",endDate+ " 23:59:59"); - - if(!error.isEmpty()){ - return ResponseData.error("获取识别记录失败"); - } +// List deviceList = deviceSupportService.selectDeviceByType("2"); // 考勤设备列表 +// List deviceIdList = new ArrayList<>(); +// for(Device device : deviceList){ +// deviceIdList.add(device.getId().longValue()); +// } +// List error = recordSupportService.syncRecords(deviceIdList,beginDate + " 00:00:00",endDate+ " 23:59:59"); +// +// if(!error.isEmpty()){ +// return ResponseData.error("获取识别记录失败"); +// } // 生成报表数据 Long deptId = new Long((long)-1); diff --git a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/service/impl/GenerateReportServiceImpl.java b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/service/impl/GenerateReportServiceImpl.java index b51f7c6..9ac2981 100644 --- a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/service/impl/GenerateReportServiceImpl.java +++ b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/service/impl/GenerateReportServiceImpl.java @@ -119,7 +119,7 @@ } //得到当前部门所有员工的识别记录 - List> currentRecordByDept = recRecordService.selectRecordByDeptId(dept.getId()+"", beginDate, endDate); + List> currentRecordByDept = recRecordService.selectRecordByDeptId(dept.getId()+"", beginDate+" 00:00:00", endDate+" 23:59:59"); for (PersonDto mStaff : currentStaffList) { String currentID = mStaff.getId().toString(); @@ -133,7 +133,7 @@ SpecialDay kqM = specialDayService.isDateExist(currentDate,currentDate); //如果是周末,且没有设置为考勤日,则跳出继续下一天 String workDay = atdRules.getWorkDay(); - int nowWeekDay = currentDateDate.getDayOfWeek().getValue()+1; + int nowWeekDay = currentDateDate.getDayOfWeek().getValue(); if ( !workDay.contains(nowWeekDay+"") && kqM==null) { continue; } @@ -592,15 +592,18 @@ List deptList = new ArrayList<>(); deptList = commonDeptService.getDeptByTips("");//获取所有部门列表 deptList.remove(0);//去除“顶级”部门 + List deptListNew = deptList; //如果传入的是特定部门id,则只保留该部门 if(deptId != -1) { + deptListNew.clear(); for(Dept dept:deptList){ - if(dept.getId()!=deptId){ - deptList.remove(dept); + if(dept.getId()==deptId){ + deptListNew.add(dept); + break; } } } - return deptList; + return deptListNew; } @Override diff --git a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java index 3a30f00..7c12371 100644 --- a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java +++ b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java @@ -65,16 +65,16 @@ @RequestMapping(value = "/syncAndGenerate", method = RequestMethod.POST) public Object synAndGenetate(String beginDate, String endDate, HttpServletResponse response) throws IOException, SQLException, ParseException { // 获取识别记录 - List deviceList = deviceSupportService.selectDeviceByType("2"); // 考勤设备列表 - List deviceIdList = new ArrayList<>(); - for(Device device : deviceList){ - deviceIdList.add(device.getId().longValue()); - } - List error = recordSupportService.syncRecords(deviceIdList,beginDate + " 00:00:00",endDate+ " 23:59:59"); - - if(!error.isEmpty()){ - return ResponseData.error("获取识别记录失败"); - } +// List deviceList = deviceSupportService.selectDeviceByType("2"); // 考勤设备列表 +// List deviceIdList = new ArrayList<>(); +// for(Device device : deviceList){ +// deviceIdList.add(device.getId().longValue()); +// } +// List error = recordSupportService.syncRecords(deviceIdList,beginDate + " 00:00:00",endDate+ " 23:59:59"); +// +// if(!error.isEmpty()){ +// return ResponseData.error("获取识别记录失败"); +// } // 生成报表数据 Long deptId = new Long((long)-1); diff --git a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/service/impl/GenerateReportServiceImpl.java b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/service/impl/GenerateReportServiceImpl.java index b51f7c6..9ac2981 100644 --- a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/service/impl/GenerateReportServiceImpl.java +++ b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/service/impl/GenerateReportServiceImpl.java @@ -119,7 +119,7 @@ } //得到当前部门所有员工的识别记录 - List> currentRecordByDept = recRecordService.selectRecordByDeptId(dept.getId()+"", beginDate, endDate); + List> currentRecordByDept = recRecordService.selectRecordByDeptId(dept.getId()+"", beginDate+" 00:00:00", endDate+" 23:59:59"); for (PersonDto mStaff : currentStaffList) { String currentID = mStaff.getId().toString(); @@ -133,7 +133,7 @@ SpecialDay kqM = specialDayService.isDateExist(currentDate,currentDate); //如果是周末,且没有设置为考勤日,则跳出继续下一天 String workDay = atdRules.getWorkDay(); - int nowWeekDay = currentDateDate.getDayOfWeek().getValue()+1; + int nowWeekDay = currentDateDate.getDayOfWeek().getValue(); if ( !workDay.contains(nowWeekDay+"") && kqM==null) { continue; } @@ -592,15 +592,18 @@ List deptList = new ArrayList<>(); deptList = commonDeptService.getDeptByTips("");//获取所有部门列表 deptList.remove(0);//去除“顶级”部门 + List deptListNew = deptList; //如果传入的是特定部门id,则只保留该部门 if(deptId != -1) { + deptListNew.clear(); for(Dept dept:deptList){ - if(dept.getId()!=deptId){ - deptList.remove(dept); + if(dept.getId()==deptId){ + deptListNew.add(dept); + break; } } } - return deptList; + return deptListNew; } @Override diff --git a/casic-web/src/main/java/com/casic/missiles/CasicApplication.java b/casic-web/src/main/java/com/casic/missiles/CasicApplication.java index 752da5f..3ef2e8e 100644 --- a/casic-web/src/main/java/com/casic/missiles/CasicApplication.java +++ b/casic-web/src/main/java/com/casic/missiles/CasicApplication.java @@ -33,6 +33,9 @@ SpringApplication.run(CasicApplication.class, args); logger.info("GunsApplication is success!"); + +// GenerateReportTask task = new GenerateReportTask(); +// task.generateTask(); } } diff --git a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java index 3a30f00..7c12371 100644 --- a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java +++ b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/controller/SyncController.java @@ -65,16 +65,16 @@ @RequestMapping(value = "/syncAndGenerate", method = RequestMethod.POST) public Object synAndGenetate(String beginDate, String endDate, HttpServletResponse response) throws IOException, SQLException, ParseException { // 获取识别记录 - List deviceList = deviceSupportService.selectDeviceByType("2"); // 考勤设备列表 - List deviceIdList = new ArrayList<>(); - for(Device device : deviceList){ - deviceIdList.add(device.getId().longValue()); - } - List error = recordSupportService.syncRecords(deviceIdList,beginDate + " 00:00:00",endDate+ " 23:59:59"); - - if(!error.isEmpty()){ - return ResponseData.error("获取识别记录失败"); - } +// List deviceList = deviceSupportService.selectDeviceByType("2"); // 考勤设备列表 +// List deviceIdList = new ArrayList<>(); +// for(Device device : deviceList){ +// deviceIdList.add(device.getId().longValue()); +// } +// List error = recordSupportService.syncRecords(deviceIdList,beginDate + " 00:00:00",endDate+ " 23:59:59"); +// +// if(!error.isEmpty()){ +// return ResponseData.error("获取识别记录失败"); +// } // 生成报表数据 Long deptId = new Long((long)-1); diff --git a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/service/impl/GenerateReportServiceImpl.java b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/service/impl/GenerateReportServiceImpl.java index b51f7c6..9ac2981 100644 --- a/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/service/impl/GenerateReportServiceImpl.java +++ b/casic-iris-atd/src/main/java/com/casic/missiles/modular/system/service/impl/GenerateReportServiceImpl.java @@ -119,7 +119,7 @@ } //得到当前部门所有员工的识别记录 - List> currentRecordByDept = recRecordService.selectRecordByDeptId(dept.getId()+"", beginDate, endDate); + List> currentRecordByDept = recRecordService.selectRecordByDeptId(dept.getId()+"", beginDate+" 00:00:00", endDate+" 23:59:59"); for (PersonDto mStaff : currentStaffList) { String currentID = mStaff.getId().toString(); @@ -133,7 +133,7 @@ SpecialDay kqM = specialDayService.isDateExist(currentDate,currentDate); //如果是周末,且没有设置为考勤日,则跳出继续下一天 String workDay = atdRules.getWorkDay(); - int nowWeekDay = currentDateDate.getDayOfWeek().getValue()+1; + int nowWeekDay = currentDateDate.getDayOfWeek().getValue(); if ( !workDay.contains(nowWeekDay+"") && kqM==null) { continue; } @@ -592,15 +592,18 @@ List deptList = new ArrayList<>(); deptList = commonDeptService.getDeptByTips("");//获取所有部门列表 deptList.remove(0);//去除“顶级”部门 + List deptListNew = deptList; //如果传入的是特定部门id,则只保留该部门 if(deptId != -1) { + deptListNew.clear(); for(Dept dept:deptList){ - if(dept.getId()!=deptId){ - deptList.remove(dept); + if(dept.getId()==deptId){ + deptListNew.add(dept); + break; } } } - return deptList; + return deptListNew; } @Override diff --git a/casic-web/src/main/java/com/casic/missiles/CasicApplication.java b/casic-web/src/main/java/com/casic/missiles/CasicApplication.java index 752da5f..3ef2e8e 100644 --- a/casic-web/src/main/java/com/casic/missiles/CasicApplication.java +++ b/casic-web/src/main/java/com/casic/missiles/CasicApplication.java @@ -33,6 +33,9 @@ SpringApplication.run(CasicApplication.class, args); logger.info("GunsApplication is success!"); + +// GenerateReportTask task = new GenerateReportTask(); +// task.generateTask(); } } diff --git a/casic-web/src/main/resources/config/application-dev.yml b/casic-web/src/main/resources/config/application-dev.yml index 997f4c8..bf4297b 100644 --- a/casic-web/src/main/resources/config/application-dev.yml +++ b/casic-web/src/main/resources/config/application-dev.yml @@ -18,6 +18,7 @@ recServicePort: 20004 sync: cron: "0 0 1 * * ?" #每天凌晨1点执行一次 + interval: 10 generate: cron: "0 08 18 * * ?" #每天凌晨4点执行一次 jdbc: