|
@@ -27,6 +27,37 @@ public class DutyscheduleController {
|
|
@Resource
|
|
@Resource
|
|
private IDutyscheduleService dutyscheduleService;
|
|
private IDutyscheduleService dutyscheduleService;
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @PostMapping("/saveplus")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ @CrossOrigin(origins = "*", maxAge = 3600)
|
|
|
|
+ public void saveplus(@RequestBody List<DutyVo> dutys){
|
|
|
|
+ String begin = null;
|
|
|
|
+ String end = null;
|
|
|
|
+ for (DutyVo duty : dutys) {
|
|
|
|
+
|
|
|
|
+ if (duty.getBc().equals("上午")){
|
|
|
|
+ begin = "8:00";
|
|
|
|
+ end = "13:59";
|
|
|
|
+ }else if (duty.getBc().equals("下午")){
|
|
|
|
+ begin = "14:00";
|
|
|
|
+ end = "19:59";
|
|
|
|
+ }else{
|
|
|
|
+ begin = "0:00,20:00";
|
|
|
|
+ end = "7:59,23:59";
|
|
|
|
+ }
|
|
|
|
+ Date theday = DateUtils.parseDate(duty.getRq());
|
|
|
|
+ Dutyschedule dutyschedule = new Dutyschedule();
|
|
|
|
+ dutyschedule.setBegin(begin);
|
|
|
|
+ dutyschedule.setEnd(end);
|
|
|
|
+ dutyschedule.setCreatedate(theday);
|
|
|
|
+ dutyschedule.setName(duty.getZj());
|
|
|
|
+ dutyscheduleService.save(dutyschedule);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
@GetMapping("/save")
|
|
@GetMapping("/save")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@CrossOrigin(origins = "*", maxAge = 3600)
|
|
@CrossOrigin(origins = "*", maxAge = 3600)
|
|
@@ -69,8 +100,8 @@ public class DutyscheduleController {
|
|
List<Dutyschedule> dutyschedulesList=dutyscheduleService.list(wrapper);
|
|
List<Dutyschedule> dutyschedulesList=dutyscheduleService.list(wrapper);
|
|
dutyschedulesList.stream().forEach(i -> {
|
|
dutyschedulesList.stream().forEach(i -> {
|
|
DutyVo vo = new DutyVo();
|
|
DutyVo vo = new DutyVo();
|
|
- vo.setName(i.getName());
|
|
|
|
- vo.setDate(DateUtils.toDate(i.getCreatedate()));
|
|
|
|
|
|
+ vo.setZj(i.getName());
|
|
|
|
+ vo.setRq(DateUtils.toDate(i.getCreatedate()));
|
|
if (i.getBegin().equals("8:00")){
|
|
if (i.getBegin().equals("8:00")){
|
|
vo.setBc("上午");
|
|
vo.setBc("上午");
|
|
}else if(i.getBegin().equals("14:00")){
|
|
}else if(i.getBegin().equals("14:00")){
|