From b649aa3767a678bb4b7b12069464a2929503b9e2 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 23 十月 2024 18:34:11 +0800
Subject: [PATCH] 2.0bug修改
---
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java | 36 ++++++++++++++++++++++--------------
1 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java
index 111aee9..0a8a7dd 100644
--- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java
+++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java
@@ -6,12 +6,8 @@
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.util.SinataUtil;
import com.stylefeng.guns.core.util.ToolUtil;
-import com.stylefeng.guns.modular.system.model.TEmail;
-import com.stylefeng.guns.modular.system.model.TOrderCharter;
-import com.stylefeng.guns.modular.system.model.TUser;
-import com.stylefeng.guns.modular.system.service.ITUserService;
-import com.stylefeng.guns.modular.system.service.IUserService;
-import com.stylefeng.guns.modular.system.service.TEmailService;
+import com.stylefeng.guns.modular.system.model.*;
+import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.EmailUtil;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
@@ -25,8 +21,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import com.stylefeng.guns.core.log.LogObjectHolder;
import org.springframework.web.bind.annotation.RequestParam;
-import com.stylefeng.guns.modular.system.model.TIntegralOrder;
-import com.stylefeng.guns.modular.system.service.ITIntegralOrderService;
import javax.annotation.Resource;
import java.io.File;
@@ -57,6 +51,12 @@
@Resource
private TEmailService emailService;
+
+ @Resource
+ private ITSystemNoticeService systemNoticeService;
+
+ @Resource
+ private ITIntegralGoodsService integralGoodsService;
@@ -121,13 +121,21 @@
tIntegralOrder.setState(2);
tIntegralOrder.setManageRemark(tIntegralOrder.getRemark());
tIntegralOrder.setRemark(null);
-
tIntegralOrderService.updateById(tIntegralOrder);
-
+ TIntegralOrder tIntegralOrder1 = tIntegralOrderService.selectById(tIntegralOrder.getId());
+ TUser tUser = userService.selectById(tIntegralOrder1.getUserId());
+ TIntegralGoods tIntegralGoods = integralGoodsService.selectById(tIntegralOrder1.getGoodsId());
+ try {
+ Integer language = tUser.getLanguage();
+ systemNoticeService.addSystemNotice(1, language == 1 ? "您使用" + tIntegralOrder1.getIntegral() + "积分成功兑换" + tIntegralGoods.getName() :
+ language == 2 ? "You redeemed " + tIntegralOrder1.getIntegral() + " points for the " + tIntegralGoods.getName() + " successfully" :
+ "Vous avez échangé " + tIntegralOrder1.getIntegral() + " points avec succès contre le " + tIntegralGoods.getName() + "", tIntegralOrder1.getUserId());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
new Thread(new Runnable() {
@Override
public void run() {
- TUser tUser = userService.selectById(tIntegralOrder.getUserId());
if(ToolUtil.isNotEmpty(tUser.getEmail())){
try {
Integer language = tUser.getLanguage();
@@ -160,12 +168,12 @@
EmailUtil.send(email, language == 1 ? "积分兑换已通过审核" : language == 2 ? "Points redemption approved" : "Approbation de l’échange de points", document.html());
//开始生成pdf收据和html收据
- File file = new File("/usr/local/nginx/html/files/html/");
+ File file = new File("/home/igotechgh/nginx/html/files/html/");
if(!file.exists()){
file.mkdirs();
}
String randomString = ToolUtil.getRandomString(10);
- file = new File("/usr/local/nginx/html/files/html/complaint_" + randomString + ".html");
+ file = new File("/home/igotechgh/nginx/html/files/html/complaint_" + randomString + ".html");
if(!file.exists()){
file.createNewFile();
}
@@ -174,7 +182,7 @@
fileWriter.flush();
fileWriter.close();
- String link ="http://182.160.16.251:81/files/html/complaint_" + randomString + ".html";
+ String link ="https://igo.i-go.group/files/html/complaint_" + randomString + ".html";
TEmail tEmail = new TEmail();
tEmail.setLink(link);
tEmail.setUserId(tUser.getId());
--
Gitblit v1.7.1