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 | 3 | import com.bsth.entity.Line; |
| 4 | 4 | import com.bsth.entity.sys.SysUser; |
| 5 | 5 | import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output; |
| 6 | +import com.fasterxml.jackson.annotation.JsonIgnore; | |
| 6 | 7 | |
| 7 | 8 | import javax.persistence.*; |
| 8 | 9 | import java.util.Date; | ... | ... |
src/main/java/com/bsth/repository/schedule/SchedulePlanInfoRepository.java
| ... | ... | @@ -3,6 +3,7 @@ package com.bsth.repository.schedule; |
| 3 | 3 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| 4 | 4 | import com.bsth.repository.BaseRepository; |
| 5 | 5 | |
| 6 | +import java.util.Date; | |
| 6 | 7 | import java.util.List; |
| 7 | 8 | |
| 8 | 9 | import org.springframework.data.domain.Page; |
| ... | ... | @@ -17,7 +18,7 @@ import org.springframework.stereotype.Repository; |
| 17 | 18 | @Repository |
| 18 | 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 | 16 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 17 | 17 | import com.bsth.repository.schedule.SchedulePlanInfoRepository; |
| 18 | 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 | 37 | @Autowired |
| 37 | 38 | ScheduleRealInfoRepository scheduleRealInfoRepository; |
| 38 | 39 | |
| 40 | + @Autowired | |
| 41 | + ObjectMapper objectMapper; | |
| 42 | + | |
| 39 | 43 | SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"); |
| 40 | 44 | |
| 41 | 45 | @Override |
| ... | ... | @@ -53,7 +57,11 @@ public class GetSchedulePlanThread extends Thread{ |
| 53 | 57 | realList = scheduleRealInfoRepository.findByDate(cDate); |
| 54 | 58 | } |
| 55 | 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 | 67 | realList = JSONArray.parseArray(JSON.toJSONString(list), ScheduleRealInfo.class); | ... | ... |