|
@@ -1,11 +1,15 @@
|
|
|
package com.ruoyi.web.H5Api.api;
|
|
package com.ruoyi.web.H5Api.api;
|
|
|
|
|
|
|
|
|
|
+import java.io.StringWriter;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
|
|
+import org.apache.velocity.Template;
|
|
|
|
|
+import org.apache.velocity.VelocityContext;
|
|
|
|
|
+import org.apache.velocity.app.Velocity;
|
|
|
import org.redisson.api.RLock;
|
|
import org.redisson.api.RLock;
|
|
|
import org.redisson.api.RedissonClient;
|
|
import org.redisson.api.RedissonClient;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -17,12 +21,16 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
+import com.linecorp.bot.client.LineMessagingClient;
|
|
|
|
|
+import com.linecorp.bot.model.PushMessage;
|
|
|
|
|
+import com.linecorp.bot.model.message.TextMessage;
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
import com.ruoyi.common.enums.OperatorType;
|
|
import com.ruoyi.common.enums.OperatorType;
|
|
|
|
|
+import com.ruoyi.generator.util.VelocityInitializer;
|
|
|
import com.ruoyi.web.line.LineCallBankParam;
|
|
import com.ruoyi.web.line.LineCallBankParam;
|
|
|
import com.ruoyi.web.line.LinePay;
|
|
import com.ruoyi.web.line.LinePay;
|
|
|
import com.ruoyi.web.line.LinePayAPOD;
|
|
import com.ruoyi.web.line.LinePayAPOD;
|
|
@@ -97,7 +105,9 @@ public class H5OrderController extends BaseController {
|
|
|
private ITCustomerIntegralSetService customerIntegralSetService;
|
|
private ITCustomerIntegralSetService customerIntegralSetService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private LinePay linePay;
|
|
private LinePay linePay;
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private LineMessagingClient lineMessagingClient;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 增加收藏
|
|
* 增加收藏
|
|
|
*
|
|
*
|
|
@@ -439,6 +449,29 @@ public class H5OrderController extends BaseController {
|
|
|
orderManageTotal.setStatus("1");
|
|
orderManageTotal.setStatus("1");
|
|
|
orderManageTotalService.updateTOrderManageTotal(orderManageTotal);
|
|
orderManageTotalService.updateTOrderManageTotal(orderManageTotal);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //
|
|
|
|
|
+ VelocityInitializer.initVelocity();
|
|
|
|
|
+ //Velocityの初期化
|
|
|
|
|
+ Velocity.init();
|
|
|
|
|
+ //Velocityコンテキストに値を設定
|
|
|
|
|
+ VelocityContext context = new VelocityContext();
|
|
|
|
|
+
|
|
|
|
|
+ StringWriter sw = new StringWriter();
|
|
|
|
|
+ //テンプレートの作成
|
|
|
|
|
+ Template template = Velocity.getTemplate("vm/orderAlertMsg.vm", "UTF-8");
|
|
|
|
|
+
|
|
|
|
|
+ List<TOrderManage> list = orderManageService.selectByManagerTotalId(orderManageTotal.getId());
|
|
|
|
|
+
|
|
|
|
|
+ context.put("orders", list);
|
|
|
|
|
+
|
|
|
|
|
+ //テンプレートとマージ
|
|
|
|
|
+ template.merge(context, sw);
|
|
|
|
|
+ //マージしたデータはWriterオブジェクトであるswが持っているのでそれを文字列として出力
|
|
|
|
|
+ System.out.println(sw.toString());
|
|
|
|
|
+
|
|
|
|
|
+ lineMessagingClient.pushMessage(new PushMessage(list.get(0).getPhone(), new TextMessage(sw.toString())));
|
|
|
|
|
+
|
|
|
return AjaxResult.success("支払成功");
|
|
return AjaxResult.success("支払成功");
|
|
|
} else {
|
|
} else {
|
|
|
return AjaxResult.success("支払失敗した");
|
|
return AjaxResult.success("支払失敗した");
|