预约处理优化
This commit is contained in:
parent
38c3cde726
commit
512f40e3bd
|
@ -232,7 +232,7 @@ public class WxCounselorController extends BaseController {
|
|||
@Log(title = "新增干预记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/intervene")
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysInterveneRecordBo bo) {
|
||||
public R<Void> add(@RequestBody SysInterveneRecordBo bo) {
|
||||
return toAjax(reservationService.insertIntervene(bo));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,12 +125,16 @@ public class ReservationServiceImpl implements IReservationService {
|
|||
|
||||
@Override
|
||||
public Boolean insertIntervene(SysInterveneRecordBo bo) {
|
||||
//todo 订单状态校验
|
||||
Long orderId = bo.getBatchNo();
|
||||
ReservationOrder reservationOrder = reservationOrderMapper.selectById(orderId);
|
||||
if (reservationOrder == null || reservationOrder.getOrderStatus() !=1) {
|
||||
throw new ServiceException("订单状态异常,请确认后再提交");
|
||||
}
|
||||
ReservationOrder orderUpdate = new ReservationOrder();
|
||||
orderUpdate.setDiagnose(bo.getDiagnose());
|
||||
orderUpdate.setAnnex(bo.getDiagnoseAnnex());
|
||||
orderUpdate.setOrderStatus(2);
|
||||
orderUpdate.setId(bo.getBatchNo());
|
||||
orderUpdate.setId(orderId);
|
||||
boolean orderFlag = reservationOrderMapper.updateById(orderUpdate) > 0;
|
||||
ReservationTime timeUpdate = new ReservationTime();
|
||||
timeUpdate.setId(bo.getInterveneId());
|
||||
|
|
|
@ -38,8 +38,9 @@
|
|||
left join m_reservation_day rd on rd.id = rt.day_id
|
||||
left join m_reservation_order ro on ro.time_id = rt.id
|
||||
left join sys_user u on u.user_id = ro.create_by
|
||||
where rt.counselor_id = #{userId}
|
||||
and DATE_FORMAT(rd.day_time, '%Y-%m-%d') = #{time}
|
||||
where DATE_FORMAT(rd.day_time, '%Y-%m-%d') = #{time}
|
||||
and rt.counselor_id = #{userId}
|
||||
and ro.order_status = 1
|
||||
and rt.`status` > 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -18,5 +18,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where rt.counselor_id = #{counselorId}
|
||||
and rt.`status` = 1
|
||||
and ro.order_status = 1
|
||||
order by rt.start_time
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue