diff --git a/jeecg-boot-module/jeecg-module-service/src/main/java/org/jeecg/modules/service/controller/GroupRecordController.java b/jeecg-boot-module/jeecg-module-service/src/main/java/org/jeecg/modules/service/controller/GroupRecordController.java index e3d89a5..3d3ff9b 100644 --- a/jeecg-boot-module/jeecg-module-service/src/main/java/org/jeecg/modules/service/controller/GroupRecordController.java +++ b/jeecg-boot-module/jeecg-module-service/src/main/java/org/jeecg/modules/service/controller/GroupRecordController.java @@ -15,16 +15,21 @@ import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.service.dto.ReservationTimeDTO; import org.jeecg.modules.service.dto.SubmitReservationDTO; import org.jeecg.modules.service.entity.GroupRecord; import org.jeecg.modules.service.service.IGroupRecordService; import org.jeecg.modules.service.vo.GroupRecordVO; import org.jeecg.modules.service.vo.ReservationSuccessVO; +import org.jeecg.modules.system.entity.CardApplicationCustomers; +import org.jeecg.modules.system.service.ICardApplicationCustomersService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; import java.util.Arrays; +import java.util.Date; + /** * @Description: 成团记录 * @Author: jeecg-boot @@ -38,7 +43,8 @@ public class GroupRecordController extends JeecgController { @Autowired private IGroupRecordService groupRecordService; - + @Autowired + private ICardApplicationCustomersService cardApplicationCustomersService; /** * 获取当前操作人成团记录 @@ -75,4 +81,21 @@ ReservationSuccessVO vo = groupRecordService.submitReservation(dto); return Result.OK(vo); } + + @RequestMapping(value = "/updateTime", method = RequestMethod.POST) + public Result updateTime(@RequestBody ReservationTimeDTO dto){ + if (StringUtils.isBlank(dto.getId())){ + return Result.error("预约id不能为空"); + } + if (dto.getReservationTime() == null){ + return Result.error("预约时间不能为空"); + } + CardApplicationCustomers entry = cardApplicationCustomersService.getById(dto.getId()); + if (entry == null){ + return Result.error("预约单不存在"); + } + entry.setReservationTime(new Date(dto.getReservationTime())); + cardApplicationCustomersService.updateById(entry); + return Result.OK("预约时间修改成功!"); + } }