更新若干功能,今日预定订单改为使用多表查询插件
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
package com.gxwebsoft;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.ParseException;
|
||||
|
||||
/**
|
||||
* Created by WebSoft on 2020-03-23 23:37
|
||||
*/
|
||||
@@ -13,6 +19,9 @@ public class TestMain {
|
||||
*/
|
||||
@Test
|
||||
public void testGenJwtKey() {
|
||||
|
||||
BigDecimal bigDecimal = new BigDecimal(NumberUtil.decimalFormat("0.00", 1 * 0.01));
|
||||
System.out.println("实际付款金额 = " + bigDecimal);
|
||||
// System.out.println(JwtUtil.encodeKey(JwtUtil.randomKey()));
|
||||
|
||||
// final String encrypt = CommonUtil.encrypt("123456");
|
||||
@@ -21,4 +30,20 @@ public class TestMain {
|
||||
// final String decrypt = CommonUtil.decrypt(encrypt);
|
||||
// System.out.println("decrypt = " + decrypt);
|
||||
}
|
||||
|
||||
|
||||
private String fenToYuan(String amount){
|
||||
NumberFormat format = NumberFormat.getInstance();
|
||||
try{
|
||||
Number number = format.parse(amount);
|
||||
double temp = number.doubleValue() / 100.0;
|
||||
format.setGroupingUsed(false);
|
||||
// 设置返回的小数部分所允许的最大位数
|
||||
format.setMaximumFractionDigits(2);
|
||||
amount = format.format(temp);
|
||||
} catch (ParseException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,8 @@ public class BookingGenerator {
|
||||
// "booking_integral",
|
||||
// "booking_integral_log"
|
||||
// "booking_order"
|
||||
// "booking_emergency",
|
||||
"user_coupon"
|
||||
};
|
||||
// 需要去除的表前缀
|
||||
private static final String[] TABLE_PREFIX = new String[]{
|
||||
|
||||
@@ -132,10 +132,10 @@ public class ${table.controllerName} {
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ${entity} ${table.entityPath}) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// ${table.entityPath}.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
${table.entityPath}.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (${serviceIns}.save(${table.entityPath})) {
|
||||
return success("添加成功");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user