he2802 1 рік тому
батько
коміт
92b1eeebbf

+ 1 - 1
.drone-pre.yml

@@ -17,7 +17,7 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
       - cp /drone/src/zhongzheng-admin/target/zhongzheng-admin.jar /app/build/zhongzheng-admin.jar
       - cp /drone/src/zhongzheng-admin-data/target/zhongzheng-admin-data.jar /app/build/zhongzheng-admin-data.jar
       - cp Dockerfile /app/build/Dockerfile
-      - cp Dockerfile /app/build/Dockerfile-data
+      - cp Dockerfile-data /app/build/Dockerfile-data
       - cp run-pre.sh /app/build/run-pre.sh
 
   - name: build-start

+ 2 - 31
run-pre.sh

@@ -1,33 +1,4 @@
-#!/usr/bin/env bash
-# 定义应用组名
-group_name='zhongzheng-pre'
-# 定义应用名称
-app_name='zhongzheng-saas-attach-pre'
-# 定义应用版本
-app_version='1.0-SNAPSHOT'
-# 定义应用环境
-profile_active='pre'
-echo '----copy jar----'
-docker stop ${app_name}
-echo '----stop container----'
-docker rm ${app_name}
-echo '----rm container----'
-docker rmi ${group_name}/${app_name}:${app_version}
-echo '----rm image----'
-# 打包编译docker镜像
-docker build -f /mydata-pre/maven/build/Dockerfile -t ${group_name}/${app_name}:${app_version} .
-echo '----build image----'
-docker run -p 9090:9090 --name ${app_name} \
---restart=always \
---link mysql:db \
--e 'spring.profiles.active'=${profile_active} \
--e TZ="Asia/Shanghai" \
--v /etc/localtime:/etc/localtime \
--v /usr/share/fonts:/usr/share/fonts \
--v /data/logs/pre_api:/logs \
--v /mydata-pre/app/${app_name}/logs:/var/logs \
--d ${group_name}/${app_name}:${app_version}
-echo '----start container----'
+
 
 #!/usr/bin/env bash
 # 定义应用组名
@@ -49,7 +20,7 @@ echo '----rm image admin top----'
 docker build -f /mydata-pre/maven/build/Dockerfile-data -t ${group_admin_name}/${app_admin_name}:${app_admin_version} .
 echo '----build image admin data----'
 docker run \
--p 9077:9099 \
+-p 9088:9099 \
 --name ${app_admin_name} \
 --restart=always \
 --log-opt max-size=50m \

+ 1 - 0
zhongzheng-admin-data/src/main/java/com/zhongzheng/controller/ExamSubscribeController.java

@@ -78,6 +78,7 @@ public class ExamSubscribeController extends BaseController {
     @GetMapping("/subscribe/list")
     public TableDataInfo<CdUserExamSubscribeVo> getExamSubscribeList(CdUserExamSubscribeQueryBo bo) {
         startPage();
+
         List<CdUserExamSubscribeVo> list = examRoomService.getExamSubscribeList(bo);
         return getDataTable(list);
     }

+ 2 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/CommonController.java

@@ -187,7 +187,7 @@ public class CommonController extends BaseController {
             throws Exception {
         try {
             if (!FileUtils.checkAllowDownload(resource)) {
-                throw new Exception(StrUtil.format("资源文件({})非法不允许下载。 ", resource));
+                throw new Exception(StrUtil.format("资源文件({})非法,不允许下载。 ", resource));
             }
             // 本地资源路径
             String localPath = RuoYiConfig.getProfile();
@@ -198,6 +198,7 @@ public class CommonController extends BaseController {
             response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
             FileUtils.setAttachmentResponseHeader(response, downloadName);
             FileUtils.writeBytes(downloadPath, response.getOutputStream());
+
         } catch (Exception e) {
             log.error("下载文件失败", e);
         }

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

@@ -124,4 +124,7 @@ public class ExamStudyRecordVo {
     private String idCard;
     @ApiModelProperty("状态")
     private Integer goodsStatus;
+
+    @ApiModelProperty("准确率")
+    private BigDecimal rightRate;
 }

+ 7 - 4
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -132,6 +132,7 @@
         <result property="realname" column="realname"/>
         <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
         <result property="goodsStatus" column="goods_status"/>
+        <result property="rightRate" column="right_rate"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.user.vo.ExamSonStudyRecordVo" id="ExamSonStudyRecordVoResult">
@@ -762,12 +763,14 @@
         JOIN question_module_chapter a on e.major_id = a.module_exam_id LEFT JOIN question_chapter_exam h on
         a.chapter_exam_id = h.chapter_exam_id where e.goods_id = g.goods_id and e.type=1) FROM goods_attached a where
         a.goods_id=g.goods_id and a.type = 3) as exam_num,
-        (SELECT create_time FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
+        (SELECT create_time FROM user_exam_record r where r.order_goods_id=s.order_goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
         create_time ASC LIMIT 1) as start_time,
-        (SELECT create_time FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
+        (SELECT create_time FROM user_exam_record r where r.order_goods_id=s.order_goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
         create_time DESC LIMIT 1) as end_time,
-        (SELECT COUNT(DISTINCT exam_id) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId})
-        as stu_all_num
+        (SELECT COUNT(DISTINCT exam_id) FROM user_exam_record r where r.order_goods_id=s.order_goods_id AND r.do_mode = 1 AND r.user_id = #{userId})
+        as stu_all_num,
+        (SELECT MAX(right_rate) FROM user_exam_record r where r.order_goods_id=s.order_goods_id AND r.do_mode = 1 AND r.user_id = #{userId})
+        as right_rate
         FROM
         goods g
         LEFT JOIN order_goods s ON g.goods_id = s.goods_id AND s.pay_status in (2,3,4)