From 487c4921b481da06d485182aaaa94297c70f149a Mon Sep 17 00:00:00 2001 From: lige <bestlige@outlook.com> Date: 星期一, 20 十一月 2023 13:52:09 +0800 Subject: [PATCH] 通知 --- ltkj-admin/src/main/java/com/ltkj/web/controller/app/ReservationController.java | 102 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 93 insertions(+), 9 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/app/ReservationController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/app/ReservationController.java index 40e6f00..17b0d98 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/app/ReservationController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/app/ReservationController.java @@ -1,6 +1,7 @@ package com.ltkj.web.controller.app; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson2.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.google.common.base.Joiner; @@ -15,6 +16,7 @@ import com.ltkj.mall.service.IMallTimeConfigService; import com.ltkj.system.service.ISysConfigService; import com.ltkj.web.config.redis.OrderDelayService; +import com.ltkj.web.wxUtils.WxUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -24,10 +26,7 @@ import javax.annotation.Resource; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; +import java.util.*; /** * @Author: 瑗垮畨璺嘲绉戞妧鏈夐檺鍏徃 @@ -153,6 +152,47 @@ config.setNowNum(config.getNowNum()-1); mallTimeConfigService.updateById(config); } + + //鍙戣鍗曚俊鎭粰wx璁㈤槄鏈嶅姟娑堟伅鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�攕tart鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�� + Map<String, Object> res = new HashMap<>(); + res.put("touser",wxuser.getOpenid()); + res.put("template_id","M4K_BNVG7g4hOAcrIDO18ux8KOTneHeNide5GdPW3kc"); + res.put("page","pages/mine/index"); + res.put("miniprogram_state","trial"); + //璁㈤槄娑堟伅鍙傛暟鍊� + JSONObject data = new JSONObject(); + + JSONObject name1 = new JSONObject(); + name1.put("value",tjReservation.getName()); + data.put("thing1", name1); + + JSONObject amount3 = new JSONObject(); + amount3.put("value", "浣撴涓績"); + data.put("thing2", amount3); + + JSONObject time4 = new JSONObject(); + String dateFormat = DateUtil.format(tjReservation.getReservationTime(), "yyyy-MM-dd"); + time4.put("value", dateFormat); + data.put("time4", time4); + + final TjPackage byId = packageService.getById(tjReservation.getPacId()); + if (byId!=null){ + JSONObject thing5 = new JSONObject(); + thing5.put("value",byId.getPacName()); + data.put("thing5", thing5); + }else { + JSONObject thing5 = new JSONObject(); + thing5.put("value","鏈煡"); + data.put("thing5", thing5); + } + + + JSONObject thing6 = new JSONObject(); + thing6.put("value", "浣撴鍓嶄竴澶╄鎮ㄨ繘娓呮贰楗,鍕块ギ閰掞紒"); + data.put("thing6", thing6); + WxUtil.sendCommonSubscribeMessage(res,data); + //鍙戣鍗曚俊鎭粰wx璁㈤槄鏈嶅姟娑堟伅鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�攅nd鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�� + return AjaxResult.success("棰勭害鎴愬姛!!!",tjReservation.getId()); } return AjaxResult.error("棰勭害澶辫触"); @@ -162,10 +202,15 @@ @ApiOperation(value = "鎾ら攢涓汉棰勭害") @Transactional public AjaxResult cusDeletedReservation(@RequestBody TjReservation reservation) { - LambdaQueryWrapper<TjReservation> wq = new LambdaQueryWrapper<>(); - wq.eq(TjReservation::getIdCard, reservation.getIdCard()); - wq.eq(TjReservation::getIsExpire, 2); - TjReservation one = reservationService.getOne(wq); + Wxuser wxuser = UserHoder.getWxuser(); +// LambdaQueryWrapper<TjReservation> wq = new LambdaQueryWrapper<>(); +// wq.eq(TjReservation::getIdCard, reservation.getIdCard()); +// wq.eq(TjReservation::getIsExpire, 2); +// TjReservation one = reservationService.getOne(wq); + if (reservation.getId()==null){ + return AjaxResult.success("鍑洪敊浜嗭紝璇疯仈绯诲伐浣滀汉鍛橈紒"); + } + TjReservation one = reservationService.getById(reservation.getId()); if (null != one) { String isPays = configService.selectConfigByKey("isPay"); if(null !=isPays && isPays.equals("true") ){ @@ -181,7 +226,46 @@ transitionService.deletedTbTransitionByCusId(reservation.getIdCard()); reservationService.removeById(one); - return AjaxResult.success(); + + //鍙戣鍗曚俊鎭粰wx璁㈤槄鏈嶅姟娑堟伅鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�攕tart鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�� + Map<String, Object> res = new HashMap<>(); + res.put("touser",wxuser.getOpenid()); + res.put("template_id","X467Xtd8HnFDNk-IoT0ChcdoBnClLZJQQwP7DMztYQ8"); + res.put("page","pages/mine/index"); + res.put("miniprogram_state","trial"); + //璁㈤槄娑堟伅鍙傛暟鍊� + JSONObject data = new JSONObject(); + + JSONObject amount3 = new JSONObject(); + amount3.put("value", "浣撴涓績"); + data.put("thing3", amount3); + + JSONObject name1 = new JSONObject(); + name1.put("value",reservation.getName()); + data.put("name1", name1); + + final TjPackage byId = packageService.getById(reservation.getPacId()); + if (byId!=null){ + JSONObject thing5 = new JSONObject(); + thing5.put("value",byId.getPacName()); + data.put("thing4", thing5); + }else { + JSONObject thing5 = new JSONObject(); + thing5.put("value","鏈煡"); + data.put("thing4", thing5); + } + + JSONObject time4 = new JSONObject(); + String dateFormat = DateUtil.format(reservation.getReservationTime(), "yyyy-MM-dd"); + time4.put("value", dateFormat); + data.put("date2", time4); + + JSONObject thing6 = new JSONObject(); + thing6.put("value", "鎮ㄥ凡鎴愬姛鍙栨秷鏈棰勭害锛屾杩庡啀娆′娇鐢紒"); + data.put("thing5", thing6); + WxUtil.sendCommonSubscribeMessage(res,data); + //鍙戣鍗曚俊鎭粰wx璁㈤槄鏈嶅姟娑堟伅鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�攅nd鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�� + return AjaxResult.success("鍙栨秷鎴愬姛"); } return AjaxResult.success("鏆傛棤棰勭害淇℃伅"); } -- Gitblit v1.8.0