|
@@ -460,21 +460,10 @@ public class DatadetailController {
|
|
|
@XjrLog(value = "教职工详情数据统计之教职工变动情况", saveResponseData = true)
|
|
|
public RT<TeacherChangeStatisticsDetailVo> teacherChangeStatisticsDetail(@Valid TeacherChangeStatisticsDetailDto dto){
|
|
|
TeacherChangeStatisticsDetailVo teacherChangeStatisticsDetailVo = new TeacherChangeStatisticsDetailVo();
|
|
|
- if(ObjectUtils.isEmpty(dto.getStatus())){
|
|
|
- LocalDate yearLocalDate = LocalDate.now();
|
|
|
- LocalDate lastDayOfLastYear = yearLocalDate.minusYears(1).with(TemporalAdjusters.lastDayOfYear());
|
|
|
- LocalDateTime startTime = lastDayOfLastYear.atTime(23, 59, 59);
|
|
|
-
|
|
|
- LocalDate firstDayOfNextYear = yearLocalDate.plusYears(1).with(TemporalAdjusters.firstDayOfYear());
|
|
|
- LocalDateTime endTime = firstDayOfNextYear.atStartOfDay();
|
|
|
-
|
|
|
- dto.setStartTime(startTime);
|
|
|
- dto.setEndTime(endTime);
|
|
|
- }
|
|
|
|
|
|
|
|
|
if(ObjectUtils.isNotEmpty(dto.getStatus()) && dto.getStatus() == 1 && StringUtils.isNotEmpty(dto.getYearMonth())){
|
|
|
- String yearMonthStr = dto.getYearMonth() + "01";
|
|
|
+ String yearMonthStr = dto.getYearMonth() + "-01";
|
|
|
LocalDate yearMonthLocalDate = LocalDate.parse(yearMonthStr);
|
|
|
|
|
|
|
|
@@ -515,11 +504,23 @@ public class DatadetailController {
|
|
|
dto.setEndTime(endTime);
|
|
|
}
|
|
|
|
|
|
+ if(ObjectUtils.isEmpty(dto.getStatus())){
|
|
|
+ LocalDate yearLocalDate = LocalDate.now();
|
|
|
+ LocalDate lastDayOfLastYear = yearLocalDate.minusYears(1).with(TemporalAdjusters.lastDayOfYear());
|
|
|
+ LocalDateTime startTime = lastDayOfLastYear.atTime(23, 59, 59);
|
|
|
+
|
|
|
+ LocalDate firstDayOfNextYear = yearLocalDate.plusYears(1).with(TemporalAdjusters.firstDayOfYear());
|
|
|
+ LocalDateTime endTime = firstDayOfNextYear.atStartOfDay();
|
|
|
+
|
|
|
+ dto.setStartTime(startTime);
|
|
|
+ dto.setEndTime(endTime);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
String sql = "select t.user_id,\n" +
|
|
|
" t.new_job_state,\n" +
|
|
|
- " t3.name\n" +
|
|
|
+ " t1.employ_type\n" +
|
|
|
"from base_teacher_change_record t\n" +
|
|
|
" inner join (SELECT user_id,\n" +
|
|
|
" MAX(id) AS max_id\n" +
|
|
@@ -528,27 +529,38 @@ public class DatadetailController {
|
|
|
" and a.create_date between '" +dto.getStartTime() + "' and '" + dto.getEndTime()+ "'\n" +
|
|
|
" GROUP BY user_id) t2 on t2.max_id = t.id\n" +
|
|
|
" left join base_teacher t1 on t1.user_id = t.user_id\n" +
|
|
|
- " left join xjr_dictionary_detail t3 on t3.code = t1.employ_type\n" +
|
|
|
"where t.delete_mark = 0\n" +
|
|
|
" and t1.delete_mark = 0"
|
|
|
;
|
|
|
List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
Map<String, Map<String, Object>> statics = new LinkedHashMap<>();
|
|
|
for (Map<String, Object> oneRecord : list){
|
|
|
- String job_state = oneRecord.get("new_job_state").toString();
|
|
|
- String name = oneRecord.get("name").toString();
|
|
|
- if(statics.containsKey(job_state)){
|
|
|
- Map<String, Object> oneMap = statics.get(job_state);
|
|
|
- if(oneMap.containsKey(name)){
|
|
|
- oneMap.put(name, (int)oneMap.get(name) + 1);
|
|
|
- }else {
|
|
|
- oneMap.put(name, 1);
|
|
|
+ String jobState = oneRecord.get("new_job_state").toString();
|
|
|
+ String employType = oneRecord.get("employ_type").toString();
|
|
|
+ if(!employType.equals("FB1601") && !employType.equals("FB1605")){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(statics.containsKey(jobState)){
|
|
|
+ Map<String, Object> oneMap = statics.get(jobState);
|
|
|
+ if(employType.equals("FB1601")){
|
|
|
+ oneMap.put("count", (int)oneMap.get("count") + 1);
|
|
|
+ }
|
|
|
+ if(employType.equals("FB1605")){
|
|
|
+ oneMap.put("count1", (int)oneMap.get("count1") + 1);
|
|
|
}
|
|
|
}else {
|
|
|
Map<String, Object> oneMap = new LinkedHashMap<>();
|
|
|
- oneMap.put("item", job_state);
|
|
|
- oneMap.put(name, 1);
|
|
|
- statics.put(job_state, oneMap);
|
|
|
+ oneMap.put("item", jobState);
|
|
|
+ oneMap.put("count", 0);
|
|
|
+ oneMap.put("count1", 0);
|
|
|
+ if(employType.equals("FB1601")){
|
|
|
+ oneMap.put("count", (int)oneMap.get("count") + 1);
|
|
|
+ }
|
|
|
+ if(employType.equals("FB1605")){
|
|
|
+ oneMap.put("count1", (int)oneMap.get("count1") + 1);
|
|
|
+ }
|
|
|
+ statics.put(jobState, oneMap);
|
|
|
}
|
|
|
}
|
|
|
teacherChangeStatisticsDetailVo.setTeacherChangeItemVoList(new ArrayList<>(statics.values()));
|