Commit b41e4c1a2ef16ae4113a506a626409dd8554e64e
1 parent
c49536a5
up
Showing
3 changed files
with
13 additions
and
3 deletions
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
| @@ -3,6 +3,7 @@ package com.bsth.entity.schedule; | @@ -3,6 +3,7 @@ package com.bsth.entity.schedule; | ||
| 3 | import com.bsth.entity.Line; | 3 | import com.bsth.entity.Line; |
| 4 | import com.bsth.entity.sys.SysUser; | 4 | import com.bsth.entity.sys.SysUser; |
| 5 | import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output; | 5 | import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output; |
| 6 | +import com.fasterxml.jackson.annotation.JsonIgnore; | ||
| 6 | 7 | ||
| 7 | import javax.persistence.*; | 8 | import javax.persistence.*; |
| 8 | import java.util.Date; | 9 | import java.util.Date; |
src/main/java/com/bsth/repository/schedule/SchedulePlanInfoRepository.java
| @@ -3,6 +3,7 @@ package com.bsth.repository.schedule; | @@ -3,6 +3,7 @@ package com.bsth.repository.schedule; | ||
| 3 | import com.bsth.entity.schedule.SchedulePlanInfo; | 3 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| 4 | import com.bsth.repository.BaseRepository; | 4 | import com.bsth.repository.BaseRepository; |
| 5 | 5 | ||
| 6 | +import java.util.Date; | ||
| 6 | import java.util.List; | 7 | import java.util.List; |
| 7 | 8 | ||
| 8 | import org.springframework.data.domain.Page; | 9 | import org.springframework.data.domain.Page; |
| @@ -17,7 +18,7 @@ import org.springframework.stereotype.Repository; | @@ -17,7 +18,7 @@ import org.springframework.stereotype.Repository; | ||
| 17 | @Repository | 18 | @Repository |
| 18 | public interface SchedulePlanInfoRepository extends BaseRepository<SchedulePlanInfo, Long> { | 19 | public interface SchedulePlanInfoRepository extends BaseRepository<SchedulePlanInfo, Long> { |
| 19 | 20 | ||
| 20 | - @Query(value = "select * from bsth_c_s_sp_info where DATE_FORMAT(schedule_date, '%Y-%m-%d')=?1", nativeQuery = true) | ||
| 21 | - List<SchedulePlanInfo> findByDate(String dateformat); | 21 | + @Query(value = "select s from SchedulePlanInfo s where scheduleDate=?1") |
| 22 | + List<SchedulePlanInfo> findByDate(Date date); | ||
| 22 | 23 | ||
| 23 | } | 24 | } |
src/main/java/com/bsth/service/realcontrol/buffer/GetSchedulePlanThread.java
| @@ -16,6 +16,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo; | @@ -16,6 +16,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo; | ||
| 16 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 16 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 17 | import com.bsth.repository.schedule.SchedulePlanInfoRepository; | 17 | import com.bsth.repository.schedule.SchedulePlanInfoRepository; |
| 18 | import com.bsth.util.BatchSaveUtils; | 18 | import com.bsth.util.BatchSaveUtils; |
| 19 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 19 | 20 | ||
| 20 | /** | 21 | /** |
| 21 | * | 22 | * |
| @@ -36,6 +37,9 @@ public class GetSchedulePlanThread extends Thread{ | @@ -36,6 +37,9 @@ public class GetSchedulePlanThread extends Thread{ | ||
| 36 | @Autowired | 37 | @Autowired |
| 37 | ScheduleRealInfoRepository scheduleRealInfoRepository; | 38 | ScheduleRealInfoRepository scheduleRealInfoRepository; |
| 38 | 39 | ||
| 40 | + @Autowired | ||
| 41 | + ObjectMapper objectMapper; | ||
| 42 | + | ||
| 39 | SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"); | 43 | SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"); |
| 40 | 44 | ||
| 41 | @Override | 45 | @Override |
| @@ -53,7 +57,11 @@ public class GetSchedulePlanThread extends Thread{ | @@ -53,7 +57,11 @@ public class GetSchedulePlanThread extends Thread{ | ||
| 53 | realList = scheduleRealInfoRepository.findByDate(cDate); | 57 | realList = scheduleRealInfoRepository.findByDate(cDate); |
| 54 | } | 58 | } |
| 55 | else{ | 59 | else{ |
| 56 | - List<SchedulePlanInfo> list = schedulePlanInfoRepository.findByDate(dateStr); | 60 | + List<SchedulePlanInfo> list = schedulePlanInfoRepository.findByDate(cDate); |
| 61 | + | ||
| 62 | + for(SchedulePlanInfo sp : list){ | ||
| 63 | + sp.setSchedulePlan(null); | ||
| 64 | + } | ||
| 57 | 65 | ||
| 58 | //实际排班计划 | 66 | //实际排班计划 |
| 59 | realList = JSONArray.parseArray(JSON.toJSONString(list), ScheduleRealInfo.class); | 67 | realList = JSONArray.parseArray(JSON.toJSONString(list), ScheduleRealInfo.class); |