| | |
| | | package com.ltkj.web.controller.app; |
| | | |
| | | import cn.hutool.core.date.DateUnit; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson2.JSON; |
| | |
| | | import com.google.common.base.Joiner; |
| | | import com.ltkj.common.core.controller.BaseController; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.common.task.TaskService; |
| | | import com.ltkj.common.utils.StringUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.framework.config.UserHoder; |
| | |
| | | import com.ltkj.mall.service.IMallTimeConfigService; |
| | | import com.ltkj.system.service.ISysConfigService; |
| | | import com.ltkj.web.config.redis.OrderDelayService; |
| | | import com.ltkj.web.config.task.TjReservationTask; |
| | | import com.ltkj.web.wxUtils.WxUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private IMallTimeConfigService mallTimeConfigService; |
| | | @Resource |
| | | private ISysConfigService configService; |
| | | @Resource |
| | | private OrderDelayService delayService; |
| | | // @Resource |
| | | // private OrderDelayService delayService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "个人预约") |
| | |
| | | tjReservation.setProIds(join); |
| | | } |
| | | if (reservationService.save(tjReservation)) { |
| | | delayService.reservation(tjReservation.getId()); |
| | | |
| | | taskService.addTask(new TjReservationTask(tjReservation.getId(), |
| | | DateUtil.between(new Date(),DateUtil.endOfDay(tjReservation.getReservationTime()), DateUnit.MS))); |
| | | |
| | | TjCustomer one = customerService.getOne(new LambdaQueryWrapper<TjCustomer>().eq(TjCustomer::getCusIdcard,tjReservation.getIdCard())); |
| | | if(null !=one){ |
| | |
| | | if (reservation.getId()==null){ |
| | | return AjaxResult.success("出错了,请联系工作人员!"); |
| | | } |
| | | taskService.removeTask(new TjReservationTask(reservation.getId())); |
| | | TjReservation one = reservationService.getById(reservation.getId()); |
| | | if (null != one) { |
| | | String isPays = configService.selectConfigByKey("isPay"); |
| | |
| | | |
| | | transitionService.deletedTbTransitionByCusId(reservation.getIdCard()); |
| | | reservationService.removeById(one); |
| | | |
| | | |
| | | //发订单信息给wx订阅服务消息————————————————start———————————————————————————————————————— |
| | | Map<String, Object> res = new HashMap<>(); |
| | |
| | | mallTimeConfigService.updateById(config1); |
| | | |
| | | one.setReservationTime(tjReservation.getReservationTime()); |
| | | reservationService.updateById(one); |
| | | if (reservationService.updateById(one)) { |
| | | taskService.removeTask(new TjReservationTask(tjReservation.getId())); |
| | | taskService.addTask(new TjReservationTask(tjReservation.getId(), |
| | | DateUtil.between(new Date(),DateUtil.endOfDay(tjReservation.getReservationTime()), DateUnit.MS))); |
| | | } |
| | | |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | return AjaxResult.error("预约不存在或已超时 不可修改!"); |