08d10a37b35eddbd38d2823209c5ab731bd34f30.svn-base 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package cn.com.goldenwater.dcproj.controller.ducha;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.param.BisInspRsvrPblmMendParam;
  5. import cn.com.goldenwater.dcproj.service.BisInspRsvrPblmMendService;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import org.apache.commons.lang3.StringUtils;
  9. import org.slf4j.Logger;
  10. import org.slf4j.LoggerFactory;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.scheduling.annotation.EnableScheduling;
  13. import org.springframework.scheduling.annotation.Scheduled;
  14. import org.springframework.web.bind.annotation.GetMapping;
  15. import org.springframework.web.bind.annotation.RequestBody;
  16. import org.springframework.web.bind.annotation.RequestMapping;
  17. import org.springframework.web.bind.annotation.RestController;
  18. @Api(value = "水利部整改问题下载k", tags = "水利部整改问题下载")
  19. @RestController
  20. @RequestMapping("/mwr/data/down/load")
  21. @EnableScheduling
  22. public class MwrDataDownLoadController extends BaseController {
  23. private Logger logger = LoggerFactory.getLogger(getClass());
  24. @Autowired
  25. private BisInspRsvrPblmMendService bisInspRsvrPblmMendService;
  26. /**
  27. * 定时导入小水库问题数据
  28. * @throws Exception
  29. */
  30. /* @Scheduled(cron = "0 0/2 * * * ? ")*/
  31. /*@Scheduled(cron = "0 0 0-4 1/1 * ?")*/
  32. /* @Scheduled(cron = "0 0 0/4 * * ?")*/
  33. public void getQuanguo(){
  34. bisInspRsvrPblmMendService.getQuanguo();
  35. }
  36. @ApiOperation(value = "手动导入小水库问题数据")
  37. @GetMapping("/importRsvr")
  38. public BaseResponse importRsvrData(@RequestBody BisInspRsvrPblmMendParam param){
  39. if(StringUtils.isBlank(param.getStartTime()) && StringUtils.isBlank(param.getEndTime())){
  40. return buildFailResponse("必传参数不可为空!");
  41. }
  42. bisInspRsvrPblmMendService.importRsvrData(param);
  43. return buildSuccessResponse();
  44. }
  45. /**
  46. * 定时更新省级复核情况
  47. */
  48. @Scheduled(cron = "0 0 23 * * ?")
  49. public void updRevwInfo(){
  50. bisInspRsvrPblmMendService.updRevwInfo();
  51. }
  52. }