|
@@ -49,6 +49,7 @@ import java.io.UnsupportedEncodingException;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.net.URLDecoder;
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
@@ -345,7 +346,6 @@ public class TOrderController {
|
|
|
orderDetails.setCompanyType(companyType);
|
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
|
|
|
|
-// String client6 = clientId.substring(clientId.length() - 6);
|
|
|
String productName1 = productName + "-" + equipment.getName() + "-" + client6;
|
|
|
String result = null;
|
|
|
if (StringUtils.isNotEmpty(payPlatform) && payPlatform.equals("1")) {
|
|
@@ -353,22 +353,29 @@ public class TOrderController {
|
|
|
order.setAcctSplitBunch(acctSplitBunch.toString());
|
|
|
if (frpCode.equals("WEIXIN_NATIVE")) {
|
|
|
//添加到汇付临时表
|
|
|
- THuifuTempOrder tHuifuTempOrder = new THuifuTempOrder();
|
|
|
- String[] ignoreProperties = {"id"};
|
|
|
- String id = HuifuUtils.inithuifuTempId();
|
|
|
- tHuifuTempOrder.setId(id);
|
|
|
- BeanUtil.copyProperties(order, tHuifuTempOrder, ignoreProperties);
|
|
|
- huifuTempOrderService.save(tHuifuTempOrder);
|
|
|
+// THuifuTempOrder tHuifuTempOrder = new THuifuTempOrder();
|
|
|
+// String[] ignoreProperties = {"id"};
|
|
|
+// String id = HuifuUtils.inithuifuTempId();
|
|
|
+// tHuifuTempOrder.setId(id);
|
|
|
+// BeanUtil.copyProperties(order, tHuifuTempOrder, ignoreProperties);
|
|
|
+// huifuTempOrderService.save(tHuifuTempOrder);
|
|
|
+// if (StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
+// result = HuifuConstant.SC_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+// } else {
|
|
|
+// result = HuifuConstant.SZ_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+// }
|
|
|
+// log.info("返回链接:{}", result);
|
|
|
if (StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
- result = HuifuConstant.SC_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+ result = HuifuConstant.SC_WECHAT_URL + "?price=" + price + "&sn=" + sn;
|
|
|
} else {
|
|
|
- result = HuifuConstant.SZ_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+ result = HuifuConstant.SZ_WECHAT_URL + "?price=" + price + "&sn=" + sn;
|
|
|
}
|
|
|
- log.info("返回链接:{}", result);
|
|
|
String qrcode = toQrcode(result);
|
|
|
JSONObject kindData = new JSONObject();
|
|
|
kindData.put("sn", sn);
|
|
|
kindData.put("rd_Pic", qrcode);
|
|
|
+ orderService.save(order);
|
|
|
+ orderDetailsService.save(orderDetails);
|
|
|
return JsonMessage.success(kindData.toString());
|
|
|
}
|
|
|
// 汇付支付
|
|
@@ -951,18 +958,30 @@ public class TOrderController {
|
|
|
order.setAcctSplitBunch(acctSplitBunch.toString());
|
|
|
order2.setAcctSplitBunch(acctSplitBunch.toString());
|
|
|
//添加到汇付临时表,微信
|
|
|
- THuifuTempOrder tHuifuTempOrder = new THuifuTempOrder();
|
|
|
- String[] ignoreProperties = {"id"};
|
|
|
- String id = HuifuUtils.inithuifuTempId();
|
|
|
- tHuifuTempOrder.setId(id);
|
|
|
- BeanUtil.copyProperties(order, tHuifuTempOrder, ignoreProperties);
|
|
|
- huifuTempOrderService.save(tHuifuTempOrder);
|
|
|
+// THuifuTempOrder tHuifuTempOrder = new THuifuTempOrder();
|
|
|
+// String[] ignoreProperties = {"id"};
|
|
|
+// String id = HuifuUtils.inithuifuTempId();
|
|
|
+// tHuifuTempOrder.setId(id);
|
|
|
+// BeanUtil.copyProperties(order, tHuifuTempOrder, ignoreProperties);
|
|
|
+// huifuTempOrderService.save(tHuifuTempOrder);
|
|
|
+// if (StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
+// result1 = HuifuConstant.SC_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+// } else {
|
|
|
+// result1 = HuifuConstant.SZ_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+// }
|
|
|
String result1 = "";
|
|
|
if (StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
- result1 = HuifuConstant.SC_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+ result1 = HuifuConstant.SC_WECHAT_URL + "?price=" + price + "&sn=" + sn1;
|
|
|
} else {
|
|
|
- result1 = HuifuConstant.SZ_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+ result1 = HuifuConstant.SZ_WECHAT_URL + "?price=" + price + "&sn=" + sn1;
|
|
|
}
|
|
|
+ // URL编码
|
|
|
+ try {
|
|
|
+ result1 = URLEncoder.encode(result1, "UTF-8");
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
// 支付宝
|
|
|
try {
|
|
|
result = huifuMchService.uniPay(
|
|
@@ -978,10 +997,15 @@ public class TOrderController {
|
|
|
}
|
|
|
// 汇聚支付支付申请返回支付二维码图片
|
|
|
String code1 = "http://sz.sunzee.com.cn/PAY-SERVER/tOrder/aliPay?zfb=" + result + "&wx=" + result1;
|
|
|
+ System.out.println(code1);
|
|
|
String qrcode = toQrcode(code1);
|
|
|
JSONObject kindData = new JSONObject();
|
|
|
kindData.put("sn", sn1 + "-" + sn2);
|
|
|
kindData.put("rd_Pic", qrcode);
|
|
|
+ orderService.save(order);
|
|
|
+ orderDetails.setOrderSn(sn1);
|
|
|
+ orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
+ orderDetailsService.save(orderDetails);
|
|
|
orderDetails.setOrderSn(sn2);
|
|
|
orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
orderDetailsService.save(orderDetails);
|
|
@@ -1405,8 +1429,6 @@ public class TOrderController {
|
|
|
orderDetails.setCompanyType(companyType);
|
|
|
orderDetails.setRefundStatus("0");
|
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
|
-
|
|
|
-// String client6 = clientId.substring(clientId.length() - 6);
|
|
|
String productName1 = "";
|
|
|
if (productNumber > 1) {
|
|
|
if (equipment.getMachineType() == null || equipment.getMachineType().equals("0")) {
|
|
@@ -1435,17 +1457,27 @@ public class TOrderController {
|
|
|
order.setAcctSplitBunch(acctSplitBunch.toString());
|
|
|
order2.setAcctSplitBunch(acctSplitBunch.toString());
|
|
|
//添加到汇付临时表,微信
|
|
|
- THuifuTempOrder tHuifuTempOrder = new THuifuTempOrder();
|
|
|
- String[] ignoreProperties = {"id"};
|
|
|
- String id = HuifuUtils.inithuifuTempId();
|
|
|
- tHuifuTempOrder.setId(id);
|
|
|
- BeanUtil.copyProperties(order, tHuifuTempOrder, ignoreProperties);
|
|
|
- huifuTempOrderService.save(tHuifuTempOrder);
|
|
|
+// THuifuTempOrder tHuifuTempOrder = new THuifuTempOrder();
|
|
|
+// String[] ignoreProperties = {"id"};
|
|
|
+// String id = HuifuUtils.inithuifuTempId();
|
|
|
+// tHuifuTempOrder.setId(id);
|
|
|
+// BeanUtil.copyProperties(order, tHuifuTempOrder, ignoreProperties);
|
|
|
+// huifuTempOrderService.save(tHuifuTempOrder);
|
|
|
+// if (StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
+// result1 = HuifuConstant.SC_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+// } else {
|
|
|
+// result1 = HuifuConstant.SZ_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+// }
|
|
|
String result1 = "";
|
|
|
if (StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
- result1 = HuifuConstant.SC_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+ result1 = HuifuConstant.SC_WECHAT_URL + "?price=" + price + "&sn=" + sn1;
|
|
|
} else {
|
|
|
- result1 = HuifuConstant.SZ_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+ result1 = HuifuConstant.SZ_WECHAT_URL + "?price=" + price + "&sn=" + sn1;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ result1 = URLEncoder.encode(result1, "UTF-8");
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
// 支付宝
|
|
|
try {
|
|
@@ -1466,18 +1498,6 @@ public class TOrderController {
|
|
|
JSONObject kindData = new JSONObject();
|
|
|
kindData.put("sn", sn1 + "-" + sn2);
|
|
|
kindData.put("rd_Pic", qrcode);
|
|
|
-// for (String key : productMap.keySet()) {
|
|
|
-// Integer productNum = productMap.get(key);
|
|
|
-// TProduct product = R.getDataIfSuccess(szwlFeign.getProduct(String.valueOf(equipment.getId()), key));
|
|
|
-// orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
-// orderDetails.setProductNo(product.getNo());
|
|
|
-// orderDetails.setProductName(key);
|
|
|
-// orderDetails.setPrice(product.getRmbPrice());
|
|
|
-// orderDetails.setProductNumber(productNum);
|
|
|
-// orderDetails.setAmount(product.getRmbPrice().multiply(new BigDecimal(productNum)));
|
|
|
-// orderDetails.setOrderSn(sn2);
|
|
|
-// orderDetailsService.save(orderDetails);
|
|
|
-// }
|
|
|
for (String key : map.keySet()) {
|
|
|
// key:"玫瑰精灵-A01",value:"0.50-1"
|
|
|
String value = map.get(key);
|
|
@@ -1489,9 +1509,14 @@ public class TOrderController {
|
|
|
orderDetails.setPrice(new BigDecimal(GoodsValue[0]).divide(new BigDecimal(GoodsValue[1])).setScale(2));
|
|
|
orderDetails.setProductNumber(Integer.valueOf(GoodsValue[1]));
|
|
|
orderDetails.setAmount(new BigDecimal(GoodsValue[0]).setScale(2));
|
|
|
+ orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
+ orderDetails.setOrderSn(sn1);
|
|
|
+ orderDetailsService.save(orderDetails);
|
|
|
+ orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
orderDetails.setOrderSn(sn2);
|
|
|
orderDetailsService.save(orderDetails);
|
|
|
}
|
|
|
+ orderService.save(order);
|
|
|
orderService.save(order2);
|
|
|
return JsonMessage.success(kindData.toString());
|
|
|
} else {
|
|
@@ -1530,22 +1555,6 @@ public class TOrderController {
|
|
|
JSONObject kindData = new JSONObject();
|
|
|
kindData.put("sn", sn1 + "-" + sn2);
|
|
|
kindData.put("rd_Pic", rd_Pic);
|
|
|
- // 添加到订单明细表
|
|
|
-// for (String key : productMap.keySet()) {
|
|
|
-// Integer productNum = productMap.get(key);
|
|
|
-// TProduct product = R.getDataIfSuccess(szwlFeign.getProduct(String.valueOf(equipment.getId()), key));
|
|
|
-// orderDetails.setProductNo(product.getNo());
|
|
|
-// orderDetails.setProductName(key);
|
|
|
-// orderDetails.setPrice(product.getRmbPrice());
|
|
|
-// orderDetails.setProductNumber(productNum);
|
|
|
-// orderDetails.setAmount(product.getRmbPrice().multiply(new BigDecimal(productNum)));
|
|
|
-// orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
-// orderDetails.setOrderSn(sn1);
|
|
|
-// orderDetailsService.save(orderDetails);
|
|
|
-// orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
-// orderDetails.setOrderSn(sn2);
|
|
|
-// orderDetailsService.save(orderDetails);
|
|
|
-// }
|
|
|
for (String key : map.keySet()) {
|
|
|
// key:"玫瑰精灵-A01",value:"0.50-1"
|
|
|
String value = map.get(key);
|
|
@@ -2306,17 +2315,27 @@ public class TOrderController {
|
|
|
order.setAcctSplitBunch(acctSplitBunch.toString());
|
|
|
order2.setAcctSplitBunch(acctSplitBunch.toString());
|
|
|
//添加到汇付临时表,微信
|
|
|
- THuifuTempOrder tHuifuTempOrder = new THuifuTempOrder();
|
|
|
- String[] ignoreProperties = {"id"};
|
|
|
- String id = HuifuUtils.inithuifuTempId();
|
|
|
- tHuifuTempOrder.setId(id);
|
|
|
- BeanUtil.copyProperties(order, tHuifuTempOrder, ignoreProperties);
|
|
|
- huifuTempOrderService.save(tHuifuTempOrder);
|
|
|
+// THuifuTempOrder tHuifuTempOrder = new THuifuTempOrder();
|
|
|
+// String[] ignoreProperties = {"id"};
|
|
|
+// String id = HuifuUtils.inithuifuTempId();
|
|
|
+// tHuifuTempOrder.setId(id);
|
|
|
+// BeanUtil.copyProperties(order, tHuifuTempOrder, ignoreProperties);
|
|
|
+// huifuTempOrderService.save(tHuifuTempOrder);
|
|
|
+// if (StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
+// result1 = HuifuConstant.SC_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+// } else {
|
|
|
+// result1 = HuifuConstant.SZ_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+// }
|
|
|
String result1 = "";
|
|
|
if (StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
- result1 = HuifuConstant.SC_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+ result1 = HuifuConstant.SC_WECHAT_URL + "?price=" + price + "&sn=" + sn1;
|
|
|
} else {
|
|
|
- result1 = HuifuConstant.SZ_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+ result1 = HuifuConstant.SZ_WECHAT_URL + "?price=" + price + "&sn=" + sn1;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ result1 = URLEncoder.encode(result1, "UTF-8");
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
// 支付宝
|
|
|
try {
|
|
@@ -2337,6 +2356,10 @@ public class TOrderController {
|
|
|
JSONObject kindData = new JSONObject();
|
|
|
kindData.put("sn", sn1 + "-" + sn2);
|
|
|
kindData.put("rd_Pic", qrcode);
|
|
|
+ orderService.save(order);
|
|
|
+ orderDetails.setOrderSn(sn1);
|
|
|
+ orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
+ orderDetailsService.save(orderDetails);
|
|
|
orderDetails.setOrderSn(sn2);
|
|
|
orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
orderDetailsService.save(orderDetails);
|
|
@@ -2796,13 +2819,7 @@ public class TOrderController {
|
|
|
orderDetails.setRefundStatus("0");
|
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
|
|
|
|
-// String client6 = clientId.substring(clientId.length() - 6);
|
|
|
String productName1 = "雪糕x" + productNumber + "-" + equipment.getName() + "-" + client6;
|
|
|
-// if(productNumber > 1) {
|
|
|
-// productName1 = "雪糕-" + equipment.getName() + "-" + client6;
|
|
|
-// } else {
|
|
|
-// productName1 = productName + "-" + equipment.getName() + "-" + client6;
|
|
|
-// }
|
|
|
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
String[] products = order.getNote().split(",");
|
|
@@ -2821,17 +2838,27 @@ public class TOrderController {
|
|
|
order.setAcctSplitBunch(acctSplitBunch.toString());
|
|
|
order2.setAcctSplitBunch(acctSplitBunch.toString());
|
|
|
//添加到汇付临时表,微信
|
|
|
- THuifuTempOrder tHuifuTempOrder = new THuifuTempOrder();
|
|
|
- String[] ignoreProperties = {"id"};
|
|
|
- String id = HuifuUtils.inithuifuTempId();
|
|
|
- tHuifuTempOrder.setId(id);
|
|
|
- BeanUtil.copyProperties(order, tHuifuTempOrder, ignoreProperties);
|
|
|
- huifuTempOrderService.save(tHuifuTempOrder);
|
|
|
+// THuifuTempOrder tHuifuTempOrder = new THuifuTempOrder();
|
|
|
+// String[] ignoreProperties = {"id"};
|
|
|
+// String id = HuifuUtils.inithuifuTempId();
|
|
|
+// tHuifuTempOrder.setId(id);
|
|
|
+// BeanUtil.copyProperties(order, tHuifuTempOrder, ignoreProperties);
|
|
|
+// huifuTempOrderService.save(tHuifuTempOrder);
|
|
|
+// if (StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
+// result1 = HuifuConstant.SC_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+// } else {
|
|
|
+// result1 = HuifuConstant.SZ_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+// }
|
|
|
String result1 = "";
|
|
|
if (StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
- result1 = HuifuConstant.SC_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+ result1 = HuifuConstant.SC_WECHAT_URL + "?price=" + price + "&sn=" + sn1;
|
|
|
} else {
|
|
|
- result1 = HuifuConstant.SZ_JUMP_URL + "/#/weChatPay?id=" + id;
|
|
|
+ result1 = HuifuConstant.SZ_WECHAT_URL + "?price=" + price + "&sn=" + sn1;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ result1 = URLEncoder.encode(result1, "UTF-8");
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
// 支付宝
|
|
|
try {
|
|
@@ -2852,21 +2879,7 @@ public class TOrderController {
|
|
|
JSONObject kindData = new JSONObject();
|
|
|
kindData.put("sn", sn1 + "-" + sn2);
|
|
|
kindData.put("rd_Pic", qrcode);
|
|
|
-// for (String key : productMap.keySet()) {
|
|
|
-// Integer productNum = productMap.get(key);
|
|
|
-// String[] split = key.split("-");
|
|
|
-// BigDecimal unitPrice = new BigDecimal(split[1]);
|
|
|
-// orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
-// orderDetails.setProductNo(productNo);
|
|
|
-// orderDetails.setProductName(split[0]);
|
|
|
-// orderDetails.setPrice(unitPrice);
|
|
|
-// orderDetails.setProductNumber(productNum);
|
|
|
-// orderDetails.setAmount(unitPrice.multiply(new BigDecimal(productNum)));
|
|
|
-// orderDetails.setOrderSn(sn2);
|
|
|
-// orderDetailsService.save(orderDetails);
|
|
|
-// }
|
|
|
for (String key : map.keySet()) {
|
|
|
- // key:"玫瑰精灵-A01",value:"0.50-1"
|
|
|
String value = map.get(key);
|
|
|
String[] GoodsInfo = key.split("-");
|
|
|
String[] GoodsValue = value.split("-");
|
|
@@ -2876,9 +2889,14 @@ public class TOrderController {
|
|
|
orderDetails.setPrice(new BigDecimal(GoodsValue[0]).divide(new BigDecimal(GoodsValue[1])).setScale(2));
|
|
|
orderDetails.setProductNumber(Integer.valueOf(GoodsValue[1]));
|
|
|
orderDetails.setAmount(new BigDecimal(GoodsValue[0]).setScale(2));
|
|
|
+ orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
+ orderDetails.setOrderSn(sn1);
|
|
|
+ orderDetailsService.save(orderDetails);
|
|
|
+ orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
orderDetails.setOrderSn(sn2);
|
|
|
orderDetailsService.save(orderDetails);
|
|
|
}
|
|
|
+ orderService.save(order);
|
|
|
orderService.save(order2);
|
|
|
return JsonMessage.success(kindData.toString());
|
|
|
} else {
|
|
@@ -2918,22 +2936,6 @@ public class TOrderController {
|
|
|
kindData.put("sn", sn1 + "-" + sn2);
|
|
|
kindData.put("rd_Pic", rd_Pic);
|
|
|
// 添加到订单明细表
|
|
|
-// for (String key : productMap.keySet()) {
|
|
|
-// Integer productNum = productMap.get(key);
|
|
|
-// String[] split = key.split("-");
|
|
|
-// BigDecimal unitPrice = new BigDecimal(split[1]);
|
|
|
-// orderDetails.setProductNo(productNo);
|
|
|
-// orderDetails.setProductName(split[0]);
|
|
|
-// orderDetails.setPrice(unitPrice);
|
|
|
-// orderDetails.setProductNumber(productNum);
|
|
|
-// orderDetails.setAmount(unitPrice.multiply(new BigDecimal(productNum)));
|
|
|
-// orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
-// orderDetails.setOrderSn(sn1);
|
|
|
-// orderDetailsService.save(orderDetails);
|
|
|
-// orderDetails.setId(HuifuUtils.initDetailsId());
|
|
|
-// orderDetails.setOrderSn(sn2);
|
|
|
-// orderDetailsService.save(orderDetails);
|
|
|
-// }
|
|
|
for (String key : map.keySet()) {
|
|
|
// key:"玫瑰精灵-A01",value:"0.50-1"
|
|
|
String value = map.get(key);
|