| | |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse; |
| | |
| | | import com.google.common.base.Joiner; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.common.exception.user.DataNotFoundException; |
| | | import com.ltkj.common.task.TaskService; |
| | | import com.ltkj.common.utils.IpUtil; |
| | | import com.ltkj.common.utils.JacksonUtil; |
| | | import com.ltkj.framework.config.UserHoder; |
| | |
| | | import com.ltkj.mall.mallOrderUtils.OrderUtil; |
| | | 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 lombok.extern.slf4j.Slf4j; |
| | |
| | | private WxPayService wxPayService; |
| | | @Resource |
| | | private ITbTransitionService transitionService; |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Resource |
| | | private OrderDelayService delayService; |
| | | |
| | |
| | | /** |
| | | * 微信付款成功或失败回调接口 |
| | | * <p> |
| | | * TODO |
| | | * 注意,这里pay-notify是示例地址,建议开发者应该设立一个隐蔽的回调地址 |
| | | * |
| | | * @param request 请求内容 |
| | |
| | | // final MallTimeConfig one = mallTimeConfigService.getOne(wq); |
| | | // one.setNowNum(one.getNowNum()-1); |
| | | // mallTimeConfigService.updateById(one); |
| | | //发订单信息给wx订阅服务消息————————————————start———————————————————————————————————————— |
| | | |
| | | Map<String, Object> res = new HashMap<>(); |
| | | res.put("touser",UserHoder.getWxuser().getOpenid()); |
| | | res.put("template_id","Gzc2BgzSsEY9uki6FThNQRLD1_An6uqpSve3PaU58PQ"); |
| | | res.put("page","pages/mine/index"); |
| | | res.put("miniprogram_state","formal"); |
| | | //订阅消息参数值 |
| | | JSONObject data = new JSONObject(); |
| | | |
| | | JSONObject amount3 = new JSONObject(); |
| | | amount3.put("value", order.getOrderSn()); |
| | | data.put("character_string2", amount3); |
| | | |
| | | JSONObject time4 = new JSONObject(); |
| | | String dateFormat = DateUtil.format(order.getCreateTime(), "yyyy-MM-dd HH:mm:ss"); |
| | | time4.put("value", dateFormat); |
| | | data.put("time1", time4); |
| | | |
| | | final TjPackage byId = packageService.getById(order.getPacId()); |
| | | if (byId!=null){ |
| | | JSONObject thing5 = new JSONObject(); |
| | | thing5.put("value",byId.getPacName()); |
| | | data.put("thing3", thing5); |
| | | }else { |
| | | JSONObject thing5 = new JSONObject(); |
| | | thing5.put("value","体检项目"); |
| | | data.put("thing3", thing5); |
| | | } |
| | | |
| | | JSONObject name1 = new JSONObject(); |
| | | name1.put("value",order.getActualPrice()+"元"); |
| | | data.put("amount4", name1); |
| | | |
| | | if (order.getPayId()!=null){ |
| | | JSONObject thing6 = new JSONObject(); |
| | | thing6.put("value", "已付款"); |
| | | data.put("phrase8", thing6); |
| | | }else { |
| | | JSONObject thing6 = new JSONObject(); |
| | | thing6.put("value", "未付款"); |
| | | data.put("phrase8", thing6); |
| | | } |
| | | |
| | | WxUtil.sendCommonSubscribeMessage(res,data); |
| | | //发订单信息给wx订阅服务消息————————————————end———————————————————————————————————————— |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | return AjaxResult.error("订单退款失败"); |
| | | } |
| | | } |
| | | //TODO 发送邮件和短信通知,这里采用异步发送 |
| | | // 退款成功通知用户, 例如“您申请的订单退款 [ 单号:{1} ] 已成功,请耐心等待到账。” |
| | | // 注意订单号只发后6位 |
| | | /*notifyService.notifySmsTemplate(order.getMobile(), NotifyType.REFUND, |
| | | new String[]{order.getOrderSn().substring(8, 14)});*/ |
| | | orderService.updateById(order); |