Commit 77927ee7 by huluobin

update

parent 30df99a6
......@@ -36,6 +36,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import java.security.InvalidParameterException;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
......@@ -211,8 +212,22 @@ public class ScheduleManageController {
@ApiOperation("更新预约")
@PostMapping("/technician/schedule/updateSchedule")
public JsonResult<Void> updateSchedule(@RequestBody SubmitScheduleCommand cmd) throws ParseException, ExecutionException, InterruptedException {
cmd.getScheduleManageDTO().setDepartmentId(SessionUtils.getTechnicianToken().getDepartmentId());
scheduleManageService.updateSchedule(cmd);
ScheduledLock scheduledLock = ScheduledLock.getInstance();
try {
log.info("店员更新预约:{}", cmd);
if (cmd.getScheduleManageDTO().getId() == null) {
throw new InvalidParameterException();
}
scheduledLock.lock(cmd.getScheduleManageDTO().getId());
cmd.getScheduleManageDTO().setDepartmentId(SessionUtils.getTechnicianToken().getDepartmentId());
scheduleManageService.updateSchedule(cmd);
} finally {
scheduledLock.unlock(cmd.getScheduleManageDTO().getId());
}
return JsonResult.success();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment