Commit 31a39f1b authored by mengmeng's avatar mengmeng

merge

parent 32bf4407
This diff is collapsed.
...@@ -100,13 +100,14 @@ public class AppointmentOrderController { ...@@ -100,13 +100,14 @@ public class AppointmentOrderController {
return new Result<List<ReservationOrderInfoDTO>>().ok(data); return new Result<List<ReservationOrderInfoDTO>>().ok(data);
} }
@Login
@PostMapping @PostMapping
@ApiOperation("预约保存") @ApiOperation("预约保存")
public Result<ReservationSuccessDTO> save(@RequestBody ReservationDTO dto){ public Result<ReservationSuccessDTO> save(@RequestBody ReservationDTO dto,@ApiIgnore @LoginUser UserEntity userEntity){
//校验数据 //校验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
AppointmentOrderDTO appointmentOrderDTO = new AppointmentOrderDTO().assembleAppointmentOrderDTO(dto); AppointmentOrderDTO appointmentOrderDTO = new AppointmentOrderDTO().assembleAppointmentOrderDTO(dto,userEntity);
appointmentOrderService.save(appointmentOrderDTO); appointmentOrderService.save(appointmentOrderDTO);
......
package io.hmit.modules.appointment.dto; package io.hmit.modules.appointment.dto;
import io.hmit.common.utils.SerialNumberTool; import io.hmit.common.utils.SerialNumberTool;
import io.hmit.entity.UserEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -95,7 +96,7 @@ public class AppointmentOrderDTO implements Serializable { ...@@ -95,7 +96,7 @@ public class AppointmentOrderDTO implements Serializable {
private YynumberDTO yynumberDTO; private YynumberDTO yynumberDTO;
public AppointmentOrderDTO assembleAppointmentOrderDTO(ReservationDTO reservationDTO){ public AppointmentOrderDTO assembleAppointmentOrderDTO(ReservationDTO reservationDTO, UserEntity userEntity){
AppointmentOrderDTO dto = new AppointmentOrderDTO(); AppointmentOrderDTO dto = new AppointmentOrderDTO();
// 当天程序重启后标识位会重置,此处可以设置开始的标识位,4标识下一个生成的会是Y00004 // 当天程序重启后标识位会重置,此处可以设置开始的标识位,4标识下一个生成的会是Y00004
...@@ -111,16 +112,17 @@ public class AppointmentOrderDTO implements Serializable { ...@@ -111,16 +112,17 @@ public class AppointmentOrderDTO implements Serializable {
dto.setServiceName(reservationDTO.getServiceName()); dto.setServiceName(reservationDTO.getServiceName());
dto.setIsApp(reservationDTO.getIsApp()); dto.setIsApp(reservationDTO.getIsApp());
dto.setOrderQueueId(reservationDTO.getOrderQueueId()); dto.setOrderQueueId(reservationDTO.getOrderQueueId());
dto.setAppointmentPerson(reservationDTO.getAppointmentPerson()); dto.setAppointmentPerson(userEntity.getUsername());
dto.setAppointmentPhone(reservationDTO.getAppointmentPhone()); dto.setAppointmentPhone(userEntity.getMobile());
dto.setAppointmentIdCard(reservationDTO.getAppointmentIdCard()); dto.setAppointmentIdCard(userEntity.getIdCardNo());
dto.setAppointmentTime(reservationDTO.getAppointmentTime()); dto.setAppointmentTime(reservationDTO.getAppointmentTime());
dto.setServiceWindow(reservationDTO.getServiceWindow()); dto.setServiceWindow(reservationDTO.getServiceWindow());
dto.setRemark(reservationDTO.getRemark()); dto.setRemark(reservationDTO.getRemark());
dto.setCreator(Long.parseLong(userEntity.getUserId()) );
dto.setUpdater(Long.parseLong(userEntity.getUserId()) );
dto.setCreateDate(new Date()); dto.setCreateDate(new Date());
dto.setUpdateDate(new Date()); dto.setUpdateDate(new Date());
return dto; return dto;
} }
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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