Commit 150d91a4e8fe9ea8dc767290f1311ebc2bc1e1d8
1 parent
0136e0cd
1.新增获取当天排班中变更过的排班数据接口
Showing
2 changed files
with
12 additions
and
2 deletions
src/main/java/com/bsth/repository/ScheduleRealInfoRepository.java
| ... | ... | @@ -6,6 +6,7 @@ import org.springframework.data.jpa.repository.Query; |
| 6 | 6 | import org.springframework.data.repository.PagingAndSortingRepository; |
| 7 | 7 | import org.springframework.stereotype.Repository; |
| 8 | 8 | |
| 9 | +import java.util.Date; | |
| 9 | 10 | import java.util.List; |
| 10 | 11 | |
| 11 | 12 | @Repository |
| ... | ... | @@ -47,5 +48,5 @@ public interface ScheduleRealInfoRepository extends PagingAndSortingRepository<S |
| 47 | 48 | */ |
| 48 | 49 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 49 | 50 | @Query("select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr=?1 and s.gsBm=?2 and s.updateDate>=?3") |
| 50 | - List<ScheduleRealInfo> findByDateAndCompany(String schDate, String companyCode, long timestamp); | |
| 51 | + List<ScheduleRealInfo> findByDateAndCompany(String schDate, String companyCode, Date timestamp); | |
| 51 | 52 | } | ... | ... |
src/main/java/com/bsth/server_rs/schedule/real/ScheduleRealService.java
| ... | ... | @@ -17,6 +17,10 @@ import com.bsth.util.ConfigUtil; |
| 17 | 17 | import com.bsth.util.HttpClientUtils; |
| 18 | 18 | import com.google.common.base.Splitter; |
| 19 | 19 | import org.apache.commons.lang3.StringUtils; |
| 20 | +import org.joda.time.DateTime; | |
| 21 | +import org.joda.time.DateTimeZone; | |
| 22 | +import org.joda.time.format.DateTimeFormat; | |
| 23 | +import org.joda.time.format.DateTimeFormatter; | |
| 20 | 24 | import org.slf4j.Logger; |
| 21 | 25 | import org.slf4j.LoggerFactory; |
| 22 | 26 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -208,7 +212,12 @@ public class ScheduleRealService { |
| 208 | 212 | @GET |
| 209 | 213 | @Path("/sch_jk4modify/{company}/{rq}") |
| 210 | 214 | public List<ScheduleRealInfoDTO_JK> sch_jk4modify(@PathParam("company") String company, @PathParam("rq") String rq) { |
| 211 | - List<ScheduleRealInfoDTO_JK> result = ScheduleRealInfoDTO_JK.getMultiInstance(scheduleRealInfoRepository.findByDateAndCompany(rq, company, timestamp)); | |
| 215 | + DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyyMMdd"); | |
| 216 | + DateTime dateTime = fmt.parseDateTime(rq); | |
| 217 | + logger.error("--------------" + company); | |
| 218 | + logger.error("--------------" + rq); | |
| 219 | + logger.error("--------------" + timestamp); | |
| 220 | + List<ScheduleRealInfoDTO_JK> result = ScheduleRealInfoDTO_JK.getMultiInstance(scheduleRealInfoRepository.findByDateAndCompany(dateTime.toString("yyyy-MM-dd"), company, new Date(timestamp))); | |
| 212 | 221 | timestamp = System.currentTimeMillis(); |
| 213 | 222 | |
| 214 | 223 | return result; | ... | ... |