SchedulePlanInfoController.java
1.72 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
46
47
package com.bsth.controller.schedule;
import com.bsth.common.ResponseCode;
import com.bsth.controller.BaseController;
import com.bsth.entity.schedule.SchedulePlanInfo;
import com.bsth.service.schedule.SchedulePlanInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by xu on 16/6/16.
*/
@RestController
@RequestMapping("spic")
public class SchedulePlanInfoController extends BaseController<SchedulePlanInfo, Long> {
@Autowired
private SchedulePlanInfoService schedulePlanInfoService;
@RequestMapping(value = "/groupinfos/{xlid}/{date}", method = RequestMethod.GET)
public List<SchedulePlanInfoService.GroupInfo> findGroupInfo(
@PathVariable(value = "xlid") Integer xlid,
@PathVariable(value = "date") Date scheduleDate) {
return schedulePlanInfoService.findGroupInfo(xlid, scheduleDate);
}
@RequestMapping(value = "/groupinfos/update", method = RequestMethod.POST)
public Map<String, Object> updateGroupInfo(@RequestBody SchedulePlanInfoService.GroupInfoUpdate groupInfoUpdate) {
Map<String, Object> resultMap = new HashMap<>();
try {
schedulePlanInfoService.updateGroupInfo(groupInfoUpdate);
resultMap.put("status", ResponseCode.SUCCESS);
resultMap.put("msg", "更新成功");
} catch (Exception exp) {
exp.printStackTrace();
resultMap.put("status", ResponseCode.ERROR);
resultMap.put("msg", exp.getLocalizedMessage());
}
return resultMap;
}
}