|
@@ -14,12 +14,15 @@ import com.xjrsoft.module.courseTable.entity.CourseTable;
|
|
|
import com.xjrsoft.module.courseTable.service.ICourseTableService;
|
|
import com.xjrsoft.module.courseTable.service.ICourseTableService;
|
|
|
import com.xjrsoft.module.databoard.dto.StatisticsDetailDto;
|
|
import com.xjrsoft.module.databoard.dto.StatisticsDetailDto;
|
|
|
import com.xjrsoft.module.databoard.dto.StatisticsDto;
|
|
import com.xjrsoft.module.databoard.dto.StatisticsDto;
|
|
|
|
|
+import com.xjrsoft.module.databoard.vo.AttendanceStatisticsVo;
|
|
|
import com.xjrsoft.module.databoard.vo.CourseStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.CourseStatisticsVo;
|
|
|
import com.xjrsoft.module.databoard.vo.HealthStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.HealthStatisticsVo;
|
|
|
|
|
+import com.xjrsoft.module.databoard.vo.ItemCountAmountVo;
|
|
|
import com.xjrsoft.module.databoard.vo.MeetingStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.MeetingStatisticsVo;
|
|
|
import com.xjrsoft.module.databoard.vo.PersonStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.PersonStatisticsVo;
|
|
|
import com.xjrsoft.module.databoard.vo.ProcessStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.ProcessStatisticsVo;
|
|
|
import com.xjrsoft.module.databoard.vo.ReimbursementStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.ReimbursementStatisticsVo;
|
|
|
|
|
+import com.xjrsoft.module.databoard.vo.RepairStatisticsVo;
|
|
|
import com.xjrsoft.module.databoard.vo.VisitorStatisticsVo;
|
|
import com.xjrsoft.module.databoard.vo.VisitorStatisticsVo;
|
|
|
import com.xjrsoft.module.outint.entity.VisitorOutInRecord;
|
|
import com.xjrsoft.module.outint.entity.VisitorOutInRecord;
|
|
|
import com.xjrsoft.module.outint.service.IVisitorOutInRecordService;
|
|
import com.xjrsoft.module.outint.service.IVisitorOutInRecordService;
|
|
@@ -364,7 +367,7 @@ public class DataboardController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@GetMapping(value = "/reimbursement-statistics")
|
|
@GetMapping(value = "/reimbursement-statistics")
|
|
|
- @ApiOperation(value="会议统计")
|
|
|
|
|
|
|
+ @ApiOperation(value="差旅费报销申请")
|
|
|
@SaCheckPermission("databoard:detail")
|
|
@SaCheckPermission("databoard:detail")
|
|
|
public RT<ReimbursementStatisticsVo> reimbursementStatistics(@Valid StatisticsDetailDto dto){
|
|
public RT<ReimbursementStatisticsVo> reimbursementStatistics(@Valid StatisticsDetailDto dto){
|
|
|
LocalDateTime startTime = null;
|
|
LocalDateTime startTime = null;
|
|
@@ -390,8 +393,6 @@ public class DataboardController {
|
|
|
int completeCount = 0;
|
|
int completeCount = 0;
|
|
|
int uncompleteCount = 0;
|
|
int uncompleteCount = 0;
|
|
|
|
|
|
|
|
- int cityIn = 0;
|
|
|
|
|
- int cityOut = 0;
|
|
|
|
|
for (Map<String, Object> objectMap : list) {
|
|
for (Map<String, Object> objectMap : list) {
|
|
|
Object statusObj = objectMap.get("status");
|
|
Object statusObj = objectMap.get("status");
|
|
|
if(statusObj == null){
|
|
if(statusObj == null){
|
|
@@ -399,18 +400,143 @@ public class DataboardController {
|
|
|
}else{
|
|
}else{
|
|
|
completeCount ++;
|
|
completeCount ++;
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ result.setCompleteCount(completeCount);
|
|
|
|
|
+ result.setUncompleteCount(uncompleteCount);
|
|
|
|
|
|
|
|
|
|
+ sql = "select city_in,sum(total_amount) as total_amount from billing_reimbursement where status = 1";
|
|
|
|
|
+ if(startTime != null && endTime != null){
|
|
|
|
|
+ sql += " and aply_time between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ sql += " group by city_in ";
|
|
|
|
|
+ list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
|
+ List<ItemCountAmountVo> amountList = new ArrayList<>();
|
|
|
|
|
+ for (Map<String, Object> objectMap : list) {
|
|
|
Object cityInObj = objectMap.get("city_in");
|
|
Object cityInObj = objectMap.get("city_in");
|
|
|
|
|
+ String item = "";
|
|
|
if(cityInObj != null && Integer.parseInt(cityInObj.toString()) == 1){
|
|
if(cityInObj != null && Integer.parseInt(cityInObj.toString()) == 1){
|
|
|
|
|
+ item = "市外";
|
|
|
|
|
+ }else if(cityInObj != null && Integer.parseInt(cityInObj.toString()) == 0){
|
|
|
|
|
+ item = "室内";
|
|
|
|
|
+ }
|
|
|
|
|
+ ItemCountAmountVo amountVo = new ItemCountAmountVo();
|
|
|
|
|
+ amountVo.setItem(item);
|
|
|
|
|
+ amountVo.setAmount(Double.parseDouble(objectMap.get("total_amount").toString()));
|
|
|
|
|
+ amountList.add(amountVo);
|
|
|
|
|
+ }
|
|
|
|
|
+ result.setAmountList(amountList);
|
|
|
|
|
+ return RT.ok(result);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ @GetMapping(value = "/repair-statistics")
|
|
|
|
|
+ @ApiOperation(value="维修申报")
|
|
|
|
|
+ @SaCheckPermission("databoard:detail")
|
|
|
|
|
+ public RT<RepairStatisticsVo> repairStatistics(@Valid StatisticsDetailDto dto){
|
|
|
|
|
+ LocalDateTime startTime = null;
|
|
|
|
|
+ LocalDateTime endTime = null;
|
|
|
|
|
+ if(dto.getStartDate() != null){
|
|
|
|
|
+ startTime = dto.getStartDate().atStartOfDay();
|
|
|
|
|
+ }
|
|
|
|
|
+ if(dto.getEndDate() != null){
|
|
|
|
|
+ endTime = dto.getEndDate().atStartOfDay().plusDays(1).plusNanos(-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ RepairStatisticsVo result = new RepairStatisticsVo();
|
|
|
|
|
+ String sql = "SELECT * FROM wf_repair_declaration where 1 = 1";
|
|
|
|
|
+ if(startTime != null && endTime != null){
|
|
|
|
|
+ sql += " and application_time between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
|
+ result.setAllCount(list.size());
|
|
|
|
|
+ int completeCount = 0;
|
|
|
|
|
+ int uncompleteCount = 0;
|
|
|
|
|
+ int personCount = 0;
|
|
|
|
|
+
|
|
|
|
|
+ for (Map<String, Object> objectMap : list) {
|
|
|
|
|
+ Object statusObj = objectMap.get("status");
|
|
|
|
|
+ if(statusObj == null){
|
|
|
|
|
+ uncompleteCount ++;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ completeCount ++;
|
|
|
}
|
|
}
|
|
|
|
|
+ if(objectMap.get("status") != null && "是".equals(objectMap.get("status").toString())){
|
|
|
|
|
+ personCount ++;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
result.setCompleteCount(completeCount);
|
|
result.setCompleteCount(completeCount);
|
|
|
result.setUncompleteCount(uncompleteCount);
|
|
result.setUncompleteCount(uncompleteCount);
|
|
|
|
|
+ result.setPersonCount(personCount);
|
|
|
|
|
+
|
|
|
|
|
+ sql = "SELECT ifnull(SUM(indemnity), 0) as indemnity FROM wf_repair_declaration";
|
|
|
|
|
+ list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
|
+ result.setTotalAmount(Double.parseDouble(list.get(0).get("indemnity").toString()));
|
|
|
|
|
+
|
|
|
|
|
+ return RT.ok(result);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ @GetMapping(value = "/attendance-statistics")
|
|
|
|
|
+ @ApiOperation(value="个人考勤")
|
|
|
|
|
+ @SaCheckPermission("databoard:detail")
|
|
|
|
|
+ public RT<AttendanceStatisticsVo> attendanceStatistics(@Valid StatisticsDetailDto dto){
|
|
|
|
|
+ LocalDateTime startTime = null;
|
|
|
|
|
+ LocalDateTime endTime = null;
|
|
|
|
|
+ if(dto.getStartDate() != null){
|
|
|
|
|
+ startTime = dto.getStartDate().atStartOfDay();
|
|
|
|
|
+ }
|
|
|
|
|
+ if(dto.getEndDate() != null){
|
|
|
|
|
+ endTime = dto.getEndDate().atStartOfDay().plusDays(1).plusNanos(-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ AttendanceStatisticsVo result = new AttendanceStatisticsVo();
|
|
|
|
|
+
|
|
|
|
|
+ String sql = " SELECT ifnull(sum(leave_days), 0) as leave_days FROM wf_teacherleave WHERE status = 1";
|
|
|
|
|
+
|
|
|
|
|
+ if(startTime != null && endTime != null){
|
|
|
|
|
+ String startTimeStr = startTime.format(formatter);
|
|
|
|
|
+ String endTimeStr = endTime.format(formatter);
|
|
|
|
|
+ sql +=" AND (" +
|
|
|
|
|
+ " (leave_start_time BETWEEN '" + startTimeStr + "' and '" + endTimeStr + "')" +
|
|
|
|
|
+ " OR (leave_end_time BETWEEN '" + startTimeStr + "' and '" + endTimeStr + "')" +
|
|
|
|
|
+ " OR (leave_start_time > '" + startTimeStr + "' and '" + endTimeStr + "' > leave_end_time)" +
|
|
|
|
|
+ " OR ('" + startTimeStr + "' > leave_start_time and leave_end_time > '" + endTimeStr + "')" +
|
|
|
|
|
+ ")";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(dto.getUserId() != null){
|
|
|
|
|
+ sql += " and user_id = " + dto.getUserId();
|
|
|
|
|
+ }
|
|
|
|
|
+ List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
|
+ result.setLeaveDays(Double.parseDouble(list.get(0).get("leave_days").toString()));
|
|
|
|
|
|
|
|
|
|
+ sql = "SELECT COUNT(*) AS a_count FROM teacher_out_in_record WHERE delete_mark = 0 and attendance_status = '迟到'";
|
|
|
|
|
+ if(startTime != null && endTime != null){
|
|
|
|
|
+ sql +=" AND record_time between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(dto.getUserId() != null){
|
|
|
|
|
+ sql += " and user_id = " + dto.getUserId();
|
|
|
|
|
+ }
|
|
|
|
|
+ list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
|
+ result.setLateCount(Integer.parseInt(list.get(0).get("a_count").toString()));
|
|
|
|
|
|
|
|
|
|
+ sql = "select COUNT(*) AS a_count from wf_course_adjust where status = 1";
|
|
|
|
|
+ if(startTime != null && endTime != null){
|
|
|
|
|
+ sql +=" AND adjust_date between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(dto.getUserId() != null){
|
|
|
|
|
+ sql += " and user_id = " + dto.getUserId();
|
|
|
|
|
+ }
|
|
|
|
|
+ list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
|
+ result.setAdjustCount(Integer.parseInt(list.get(0).get("a_count").toString()));
|
|
|
|
|
|
|
|
|
|
+ sql = "select COUNT(*) AS a_count from wf_course_adjust where status = 1";
|
|
|
|
|
+ if(startTime != null && endTime != null){
|
|
|
|
|
+ sql +=" AND exchange_date between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if(dto.getUserId() != null){
|
|
|
|
|
+ sql += " and user_id = " + dto.getUserId();
|
|
|
|
|
+ }
|
|
|
|
|
+ list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
|
|
+ result.setExchangeCount(Integer.parseInt(list.get(0).get("a_count").toString()));
|
|
|
return RT.ok(result);
|
|
return RT.ok(result);
|
|
|
}
|
|
}
|
|
|
|
|
|