he2802 před 4 roky
rodič
revize
2cfc277ff4

+ 19 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/DateUtils.java

@@ -3,7 +3,11 @@ package com.zhongzheng.common.utils;
 import java.lang.management.ManagementFactory;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.Date;
+
+import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.commons.lang3.time.DateFormatUtils;
 
 /**
@@ -157,4 +161,19 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     {
         return System.currentTimeMillis()/1000;
     }
+
+
+    /**
+     * 获取日期格式订单号
+     * @return
+     */
+    public static String getDateOrderSn()
+    {
+        DateTimeFormatter ofPattern = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");
+        String localDate = LocalDateTime.now().format(ofPattern);
+        //随机数
+        String randomNumeric = RandomStringUtils.randomNumeric(8);
+        return randomNumeric;
+    }
+
 }

+ 3 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/SnowflakeIdUtils.java

@@ -122,4 +122,7 @@ public class SnowflakeIdUtils {
 
 
 
+
+
+
 }

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -2,6 +2,7 @@ package com.zhongzheng.modules.order.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.order.bo.OrderAddBo;
 import com.zhongzheng.modules.order.bo.OrderEditBo;
 import com.zhongzheng.modules.order.bo.OrderQueryBo;
@@ -102,7 +103,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         return this.removeByIds(ids);
     }
 
-    private OrderAddBo dealOrder(){
+    private OrderAddBo dealOrder(Order add){
+        add.setOderSn(DateUtils.getDateOrderSn());
+        add.setPayType(1);
+        add.setOrderStatus(0);
         return null;
     }
 

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserBankQuestionRecordMapper.xml

@@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         GROUP BY
         ubqr.question_id
         HAVING
-        ubqr.is_right = 0
+        max(ubqr.is_right) = 0
 
     </select>