he2802 3 年 前
コミット
b642f2d755

+ 11 - 9
zhongzheng-api/src/main/java/com/zhongzheng/controller/order/OrderController.java

@@ -130,6 +130,16 @@ public class OrderController extends BaseController {
         return AjaxResult.success(iOrderService.queryByOrderSn(orderSn));
     }
 
+    /**
+     * 通过单号查询详情
+     */
+    @ApiOperation("通过单号查询详情")
+    @PreAuthorize("@ss.hasPermi('system:order:query')")
+    @GetMapping("/detail/{orderSn}")
+    public AjaxResult<OrderListVo> getOrderDetail(@PathVariable("orderSn" ) String orderSn) {
+        return AjaxResult.success(iOrderService.queryDetailByOrderSn(orderSn));
+    }
+
     @ApiOperation("继续支付PC订单")
     @PostMapping("/resumePCOrder")
     public AjaxResult resumePCOrder(@RequestBody OrderAddBo bo) {
@@ -157,13 +167,5 @@ public class OrderController extends BaseController {
         return AjaxResult.success(iOrderGoodsService.selectDetail(bo));
     }
 
-    /**
-     * 获取订单详细信息
-     */
-    @ApiOperation("获取订单详细信息")
-    @PreAuthorize("@ss.hasPermi('system:order:query')")
-    @GetMapping("/{orderId}")
-    public AjaxResult<OrderVo> getInfo(@PathVariable("orderId" ) Long orderId) {
-        return AjaxResult.success(iOrderService.queryById(orderId));
-    }
+
 }

+ 70 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/ToolsUtils.java

@@ -5,6 +5,8 @@ import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
 import com.aliyun.teaopenapi.models.Config;
 import io.micrometer.core.lang.NonNull;
 
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.Iterator;
 import java.util.Random;
 
@@ -43,4 +45,72 @@ public class ToolsUtils {
     public static final int emuToPx(double emu) {
         return DoubleUtils.div(emu, EMU_PER_PX).intValue();
     }
+
+    public static String getEncoding(String str) {
+        String encode = "GB2312";
+        try {
+            if (str.equals(new String(str.getBytes(encode), encode))) {
+                String s = encode;
+                return s;
+            }
+        } catch (Exception exception) {
+        }
+        encode = "ISO-8859-1";
+        try {
+            if (str.equals(new String(str.getBytes(encode), encode))) {
+                String s1 = encode;
+                return s1;
+            }
+        } catch (Exception exception1) {
+        }
+        encode = "UTF-8";
+        try {
+            if (str.equals(new String(str.getBytes(encode), encode))) {
+                String s2 = encode;
+                return s2;
+            }
+        } catch (Exception exception2) {
+        }
+        encode = "GBK";
+        try {
+            if (str.equals(new String(str.getBytes(encode), encode))) {
+                String s3 = encode;
+                return s3;
+            }
+        } catch (Exception exception3) {
+        }
+        return "";
+    }
+
+    /**
+     * 字符串转换UTF-8编码
+     *
+     * @param string 字符串
+     * @return java.lang.String
+     * @date 2022/4/14.
+     */
+    public static String toUtf8String(String string) {
+        StringBuilder stringBuffer = new StringBuilder();
+        for (int i = 0; i < string.length(); i++) {
+            char c = string.charAt(i);
+            if (c <= 255) {
+                stringBuffer.append(c);
+            } else {
+                byte[] b;
+                try {
+                    b = Character.toString(c).getBytes(StandardCharsets.UTF_8);
+                } catch (Exception ex) {
+                    b = new byte[0];
+                }
+                for (int value : b) {
+                    int k = value;
+                    if (k < 0) k += 256;
+                    stringBuffer.append("%").append(Integer.toHexString(k).toUpperCase());
+                }
+            }
+        }
+        return stringBuffer.toString();
+    }
+
+
 }

+ 24 - 19
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -58,6 +58,8 @@ import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
+import static com.zhongzheng.common.utils.ToolsUtils.getEncoding;
+
 /**
  * 题库题目Service业务层处理
  *
@@ -850,7 +852,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
 
     private boolean isLineStart(String content) {
         if (Validator.isNotEmpty(content)) {
-            if(isQuestionStart(content)||content.startsWith("A.")||content.startsWith("B.")||content.startsWith("C.")||content.startsWith("D.")||content.startsWith("E.")
+            if(isQuestionStart(content)||content.startsWith("А.")||content.startsWith("A.")||content.startsWith("B.")||content.startsWith("C.")||content.startsWith("D.")||content.startsWith("E.")
                     ||content.startsWith("F.")||content.startsWith("正确答案")||content.startsWith("解题思路")||content.startsWith("考查考点")||content.startsWith("老师解答")
                     ||content.startsWith("单选题模板")||content.startsWith("判读题模板")||content.startsWith("问答题模板")||content.startsWith("多选题题模板")){
                 return true;
@@ -929,11 +931,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                 boolean hasQuestion = false;
                 for (XWPFParagraph paragraph : paragraphList) {
                     content = paragraph.getText();
-                    System.out.println(content);
-                    System.out.println("EEE");
-                    if(content.startsWith("2")){
-                        System.out.println("EEE");
-                    }
                     content = dealTxt(content);
                     List<XWPFRun> runs = paragraph.getRuns();
                     imgUrl = null;
@@ -992,7 +989,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             QuestionAddBo addBo = new QuestionAddBo();
                             qContent = removeNo(qContent);
                             if (Validator.isEmpty(qContent)) {
-                                errorLog += "第" + index + "条题目内容空白\n";
+                                errorLog += "第" + index + "条题目内容错误\n";
                                 continue;
                             }
                             QuestionAddBo bo = new QuestionAddBo();
@@ -1053,10 +1050,10 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                         //新题开头
                         qContent = qContent +   content +"<br />";
                     }
-                    //第一个选项
-                    if(content.startsWith("A.")||(nowPart==1&&!isLineStart(content))) {
+                    //第一个选项(包含西里尔字母А)
+                    if(content.startsWith("А.")||content.startsWith("A.")||(nowPart==1&&!isLineStart(content))) {
                         if (Validator.isEmpty(qContent)) {
-                            errorLog += "第" + index + "条题目内容空白\n";
+                            errorLog += "第" + index + "条题目内容错误\n";
                             continue;
                         }
                         if(nowPart!=1){
@@ -1069,17 +1066,21 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                         if(optionsList.size()<1){
                             bo1 = new QuestionChildAddBo();
                             bo1.setOptionsId(1L);
-                            bo1.setContent(strContent.replace("A.", ""));
+                            bo1.setContent(strContent.replace("A.", "").replace("А.", ""));
                             bo1.setImgUrl(imgUrl);
                             optionsList.add(bo1);
                         }else{
                             bo1 = optionsList.get(0);
                             bo1.setImgUrl(imgUrl);
-                            bo1.setContent(strContent.replace("A.", ""));
+                            bo1.setContent(strContent.replace("A.", "").replace("А.", ""));
                         }
                     }
                     //第二个选项
                     if (content.startsWith("B.")||(nowPart==2&&!isLineStart(content))) {
+                        if (optionsList.size()<1) {
+                            errorLog += "第" + index + "条题目选项A错误\n";
+                            continue;
+                        }
                         if(nowPart!=2){
                             strContent = "";
                         }
@@ -1181,7 +1182,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                     //答案和题型
                     if (content.startsWith("正确答案:")||(nowPart==7&&!isLineStart(content))) {
                         if (Validator.isEmpty(qContent)) {
-                            errorLog += "第" + index + "条题目内容空白\n";
+                            errorLog += "第" + index + "条题目内容错误\n";
                             continue;
                         }
                         if(nowPart!=7){
@@ -1363,7 +1364,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             QuestionAddBo addBo = new QuestionAddBo();
                             qContent = removeNo(qContent);
                             if (Validator.isEmpty(qContent)) {
-                                errorLog += "第" + index + "条题目内容空白\n";
+                                errorLog += "第" + index + "条题目内容错误\n";
                                 continue;
                             }
                             QuestionAddBo bo = new QuestionAddBo();
@@ -1426,9 +1427,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                         qContent = qContent +   content +"<br />";
                     }
                     //第一个选项
-                    if(content.startsWith("A.")||(nowPart==1&&!isLineStart(content))) {
+                    if(content.startsWith("А.")||content.startsWith("A.")||(nowPart==1&&!isLineStart(content))) {
                         if (Validator.isEmpty(qContent)) {
-                            errorLog += "第" + index + "条题目内容空白\n";
+                            errorLog += "第" + index + "条题目内容错误\n";
                             continue;
                         }
                         if(nowPart!=1){
@@ -1442,16 +1443,20 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             bo1 = new QuestionChildAddBo();
                             bo1.setOptionsId(1L);
                             bo1.setImgUrl(imgUrl);
-                            bo1.setContent(strContent.replace("A.", ""));
+                            bo1.setContent(strContent.replace("A.", "").replace("А.", ""));
                             optionsList.add(bo1);
                         }else{
                             bo1 = optionsList.get(0);
                             bo1.setImgUrl(imgUrl);
-                            bo1.setContent(strContent.replace("A.", ""));
+                            bo1.setContent(strContent.replace("A.", "").replace("А.", ""));
                         }
                     }
                     //第二个选项
                     if (content.startsWith("B.")||(nowPart==2&&!isLineStart(content))) {
+                        if (optionsList.size()<1) {
+                            errorLog += "第" + index + "条题目选项A错误\n";
+                            continue;
+                        }
                         if(nowPart!=2){
                             strContent = "";
                         }
@@ -1553,7 +1558,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                     //答案和题型
                     if (content.startsWith("正确答案:")||(nowPart==7&&!isLineStart(content))) {
                         if (Validator.isEmpty(qContent)) {
-                            errorLog += "第" + index + "条题目内容空白\n";
+                            errorLog += "第" + index + "条题目内容错误\n";
                             continue;
                         }
                         if(nowPart!=7){

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderMapper.java

@@ -27,6 +27,7 @@ public interface OrderMapper extends BaseMapper<Order> {
 
     Integer queryByOrderSn(String orderSn);
 
+
     List<OrderListVo> selectRebuyList(OrderQueryBo bo);
 
     Integer getConsoleStudentNum(ConsoleQueryBo bo);
@@ -36,4 +37,7 @@ public interface OrderMapper extends BaseMapper<Order> {
     List<OrderListVo> getConsoleOrder(ConsoleQueryBo bo);
 
     Integer getConsoleRebuyNum(ConsoleQueryBo bo);
+
+    OrderListVo queryDetailByOrderSn(String orderSn);
+
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderService.java

@@ -83,6 +83,8 @@ public interface IOrderService extends IService<Order> {
 
 	Integer queryByOrderSn(String orderSn);
 
+	OrderListVo queryDetailByOrderSn(String orderSn);
+
 	Map<String, String> resumePcOrder(OrderAddBo bo);
 
 	Integer getConsoleStudentNum(ConsoleQueryBo bo);

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

@@ -979,6 +979,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         return baseMapper.queryByOrderSn(orderSn);
     }
 
+    @Override
+    public OrderListVo queryDetailByOrderSn(String orderSn) {
+        return baseMapper.queryDetailByOrderSn(orderSn);
+    }
+
     @Override
     public Map<String, String> resumePcOrder(OrderAddBo bo) {
         if (bo.getOrderSn() == null) {

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserExamRecordAddBo.java

@@ -43,7 +43,7 @@ public class UserExamRecordAddBo {
     private Integer reportStatus;
     /** 分数 */
     @ApiModelProperty("分数")
-    private Long performance;
+    private BigDecimal performance;
 
     /** 历史做题JSON */
     @ApiModelProperty("历史做题JSON")

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserExamRecordEditBo.java

@@ -50,7 +50,7 @@ public class UserExamRecordEditBo {
 
     /** 分数 */
     @ApiModelProperty("分数")
-    private Long performance;
+    private BigDecimal performance;
 
     /** 历史做题JSON */
     @ApiModelProperty("历史做题JSON")

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/UserExamRecord.java

@@ -43,7 +43,7 @@ private static final long serialVersionUID=1L;
     /** 1及格 0不及格 */
     private Integer reportStatus;
     /** 分数 */
-    private Long performance;
+    private BigDecimal performance;
     /** 历史做题JSON */
     private String historyExamJson;
     /** 试卷总题数 */

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/SectionStudyRecordVo.java

@@ -79,4 +79,7 @@ public class SectionStudyRecordVo {
     private Long gradeId;
     @ApiModelProperty("订单商品ID")
     private Long orderGoodsId;
+    /** 节类型 1录播 2直播 3回放 */
+    @ApiModelProperty("节类型 1录播 2直播 3回放")
+    private Integer sectionType;
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserExamRecordVo.java

@@ -51,7 +51,7 @@ public class UserExamRecordVo {
 	/** 分数 */
 	@Excel(name = "分数")
 	@ApiModelProperty("分数")
-	private Long performance;
+	private BigDecimal performance;
 	/** 历史做题JSON */
 	@Excel(name = "历史做题JSON")
 	@ApiModelProperty("历史做题JSON")

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionModuleChapterMapper.xml

@@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 LEFT JOIN question_chapter qc ON mc.chapter_exam_id = qc.chapter_exam_id
         WHERE
             mc.module_exam_id = #{moduleExamId}
+        ORDER BY mc.sort
 
     </select>
 

+ 8 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsAttachedMapper.xml

@@ -228,6 +228,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 				WHEN ga.type = 3 THEN
 					uer.status
 				END record_status,
+			CASE
+				WHEN ga.type = 1 THEN
+					-1
+				WHEN ga.type = 2 THEN
+					-1
+				WHEN ga.type = 3 THEN
+					e.do_type
+				END do_type,
 			uer.total_question_num,
 			uer.right_question_num,
 			uer.do_question_num

+ 5 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderMapper.xml

@@ -439,4 +439,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
     </select>
 
+
+    <select id="queryDetailByOrderSn" parameterType="String" resultMap="OrderResultVo">
+        SELECT * from `order` where order_sn = #{orderSn}
+    </select>
+
 </mapper>

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -61,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="moduleName" column="module_name"/>
         <result property="chapterName" column="chapter_name"/>
         <result property="sectionName" column="section_name"/>
+        <result property="sectionType" column="section_type"/>
         <result property="durationTime" column="duration_time"/>
         <result property="startTime" column="start_time"/>
         <result property="endTime" column="end_time"/>
@@ -1192,6 +1193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             cs.`name` as section_name,
             cs.cover_url,
             cs.duration_time,
+            cs.section_type,
             r.*,
             g.goods_name,
             cgu.order_goods_id