ReCalcDataController.java
1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.bsth.controller.realcontrol.calc;
import com.bsth.common.ResponseCode;
import com.bsth.util.HttpClientUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
/**
* 重新统计(数据汇总)
* Created by panzhao on 2018/1/25.
*/
@RestController
@RequestMapping("/sch/reCalc")
public class ReCalcDataController {
private static String reCalcUrl = "http://10.10.150.24:30571/reCalc/scheduleDetail";
Logger logger = LoggerFactory.getLogger(this.getClass());
/**
* 重新统计班次明细
* @param date
* @param line
* @return
*/
@RequestMapping(value = "/scheduleDetail", method = RequestMethod.POST)
public Map<String, Object> reCalcScheduleDetail(@RequestParam String date, @RequestParam String line){
Map<String, Object> rs = new HashMap();
try{
HttpClientUtils.post(reCalcUrl + "?rq=" + date + "&lineCode=" + line, "");
}catch (Exception e){
logger.error("", e);
rs.put("status", ResponseCode.ERROR);
rs.put("msg", e.getMessage());
}
return rs;
}
}