Commit 630da36ac33b01f72f748984ccc60aec0ff7d961
1 parent
cf2081a8
配置dubbo,添加前世验证时刻表服务。
Showing
2 changed files
with
32 additions
and
0 deletions
src/main/java/com/bsth/controller/schedule/core/SchedulePlanController_dubbo.java
| 1 | package com.bsth.controller.schedule.core; | 1 | package com.bsth.controller.schedule.core; |
| 2 | 2 | ||
| 3 | +import com.bsth.common.ResponseCode; | ||
| 3 | import com.bsth.control_v2.plan_module.common.dto.schedule.PlanDto; | 4 | import com.bsth.control_v2.plan_module.common.dto.schedule.PlanDto; |
| 5 | +import com.bsth.control_v2.plan_module.common.service.schedule.validate.PlanPreValidateFacade; | ||
| 4 | import com.bsth.controller.schedule.BController_facade; | 6 | import com.bsth.controller.schedule.BController_facade; |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 8 | +import org.springframework.web.bind.annotation.PathVariable; | ||
| 5 | import org.springframework.web.bind.annotation.RequestMapping; | 9 | import org.springframework.web.bind.annotation.RequestMapping; |
| 10 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 6 | import org.springframework.web.bind.annotation.RestController; | 11 | import org.springframework.web.bind.annotation.RestController; |
| 7 | 12 | ||
| 13 | +import java.util.Date; | ||
| 14 | +import java.util.HashMap; | ||
| 15 | +import java.util.Map; | ||
| 16 | + | ||
| 8 | @RestController | 17 | @RestController |
| 9 | @RequestMapping("spc") | 18 | @RequestMapping("spc") |
| 10 | public class SchedulePlanController_dubbo extends BController_facade<Long, PlanDto> { | 19 | public class SchedulePlanController_dubbo extends BController_facade<Long, PlanDto> { |
| 20 | + @Autowired | ||
| 21 | + private PlanPreValidateFacade planPreValidateFacade; | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 创建指定线路,指定时间范围内的排班计划,使用的时刻表情况 | ||
| 25 | + * @param xlid 线路id | ||
| 26 | + * @param from 开始时间 | ||
| 27 | + * @param to 结束时间 | ||
| 28 | + * @return | ||
| 29 | + * @throws Exception | ||
| 30 | + */ | ||
| 31 | + @RequestMapping(value = "/valttinfo/{xlid}/{from}/{to}", method = RequestMethod.GET) | ||
| 32 | + public Map<String, Object> validateTTInfo( | ||
| 33 | + @PathVariable(value = "xlid") Integer xlid, | ||
| 34 | + @PathVariable(value = "from") Date from, | ||
| 35 | + @PathVariable(value = "to") Date to | ||
| 36 | + ) throws Exception { | ||
| 37 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 38 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 39 | + rtn.put("data", planPreValidateFacade.validateTTInfo(xlid, from, to)); | ||
| 40 | + return rtn; | ||
| 41 | + } | ||
| 11 | 42 | ||
| 12 | // TODO | 43 | // TODO |
| 13 | } | 44 | } |
src/main/resources/dubbo/applicationContext_dubbo_consumer.xml
| @@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
| 15 | <!-- 计划排班服务接口 --> | 15 | <!-- 计划排班服务接口 --> |
| 16 | <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.PlanServiceFacade" id="planServiceFacadeImpl" check="false" /> | 16 | <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.PlanServiceFacade" id="planServiceFacadeImpl" check="false" /> |
| 17 | <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.PlanInfoServiceFacade" id="planInfoServiceFacadeImpl" check="false" /> | 17 | <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.PlanInfoServiceFacade" id="planInfoServiceFacadeImpl" check="false" /> |
| 18 | + <dubbo:reference interface="com.bsth.control_v2.plan_module.common.service.schedule.validate.PlanPreValidateFacade" id="planPreValidateFacadeImpl" check="false" /> | ||
| 18 | 19 | ||
| 19 | 20 | ||
| 20 | </beans> | 21 | </beans> |
| 21 | \ No newline at end of file | 22 | \ No newline at end of file |