瀏覽代碼

fix 回复

he2802 3 年之前
父節點
當前提交
7aba960b09

+ 14 - 10
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/poi/ExcelUtil.java

@@ -229,15 +229,19 @@ public class ExcelUtil<T>
                         }
                         else
                         {
-                            String dateFormat = field.getAnnotation(Excel.class).dateFormat();
-                            if (Validator.isNotEmpty(dateFormat))
+                            if (val instanceof Double)
                             {
-                                val = DateUtils.parseDateToStr(dateFormat, (Date) val);
-                            }
-                            else
-                            {
-                                val = Convert.toStr(val);
+                                String dateFormat = field.getAnnotation(Excel.class).dateFormat();
+                                if (Validator.isNotEmpty(dateFormat))
+                                {
+                                    val = DateUtils.parseDateToStr(dateFormat, (Date) val);
+                                }
+                                else
+                                {
+                                    val = Convert.toStr(val);
+                                }
                             }
+
                         }
                     }
                     else if ((Integer.TYPE == fieldType || Integer.class == fieldType) && Validator.isNumber(Convert.toStr(val)))
@@ -1097,12 +1101,12 @@ public class ExcelUtil<T>
                 if (cell.getCellType() == CellType.NUMERIC || cell.getCellType() == CellType.FORMULA)
                 {
                     val = cell.getNumericCellValue();
-                    System.out.println(val);
                     if (DateUtil.isCellDateFormatted(cell))
                     {
-                        SimpleDateFormat sdf  = new SimpleDateFormat("yyyy/MM/dd");
+                       /* SimpleDateFormat sdf  = new SimpleDateFormat("yyyy/MM/dd");
                         Date date = DateUtil.getJavaDate((Double) val);// POI Excel 日期格式转换
-                        val = sdf.format(date);
+                        val = sdf.format(date);*/
+                        val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换
                     }
                     else
                     {

+ 8 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java

@@ -196,6 +196,7 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
         int i=10;
         int Index = 0;
         for (CourseSectionImport sectionImport : sectionList) {
+
             Index++;
             CourseSectionAddBo bo = new CourseSectionAddBo();
             if(!Validator.isNotEmpty(sectionImport.getName())){
@@ -255,12 +256,15 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
             bo.setStatus(1);
             bo.setCoverUrl("oss/images/avatar/20211013/1634097664410_1397766697");
             if(Validator.isNotEmpty(sectionImport.getLiveStartTime())){
-                Long startTime = sectionImport.getLiveStartTime().getTime()/1000;
-                bo.setLiveStartTime(startTime);
+
+                System.out.println(sectionImport.getLiveStartTime());
+                System.out.println("开始时间");
+        /*        Long startTime = sectionImport.getLiveStartTime().getTime()/1000;
+                bo.setLiveStartTime(startTime);*/
             }
             if(Validator.isNotEmpty(sectionImport.getLiveEndTime())){
-                Long endTime = sectionImport.getLiveEndTime().getTime()/1000;
-                bo.setLiveEndTime(endTime);
+                /*Long endTime = sectionImport.getLiveEndTime().getTime()/1000;
+                bo.setLiveEndTime(endTime);*/
             }
             errorLog = insertByAddBoImport(bo,errorLog,Index);
             i++;

+ 4 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseSectionImport.java

@@ -59,13 +59,13 @@ public class CourseSectionImport {
     @ApiModelProperty("直播流地址")
     private String liveUrl;
     /** 直播开始时间 */
-    @Excel(name = "直播开始时间")
+    @Excel(name = "直播开始时间",dateFormat="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty("直播开始时间")
-    private Date liveStartTime;
+    private String liveStartTime;
     /** 直播结束时间 */
-    @Excel(name = "直播结束时间")
+    @Excel(name = "直播结束时间",dateFormat="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty("直播结束时间")
-    private Date liveEndTime;
+    private String liveEndTime;
     /** 录播和回放的url地址 */
     @Excel(name = "URL地址")
     @ApiModelProperty("录播和回放的url地址")

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java

@@ -537,6 +537,8 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
                 userSubscribeImports.add(userSubscribeImport);
                 continue;
             }
+            System.out.println(userSubscribeImport.getApplySiteExamTime());
+            System.out.println("考试日期");
             //查询商品
             if (StringUtils.isEmpty(userSubscribeImport.getCode())) {
                 userSubscribeImport.setCause("未填商品编码");

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserCourseAnswerVo.java

@@ -101,4 +101,6 @@ public class UserCourseAnswerVo {
 	@Excel(name = "回复ID")
 	@ApiModelProperty("回复ID")
 	private Long assignAnswerId;
+	@ApiModelProperty("提问内容")
+	private String assignAnswerText;
 }

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserSubscribeImport.java

@@ -32,7 +32,7 @@ public class UserSubscribeImport {
 	@Excel(name = "*考试标题")
 	private String applyName;
 
-	@Excel(name = "*考试日期")
+	@Excel(name = "*考试日期",dateFormat="yyyy/MM/dd")
 	private String applySiteExamTime;
 
 	/** 考试地点 */
@@ -65,7 +65,7 @@ public class UserSubscribeImport {
 	@Excel(name = "*考培地点")
 	private String applySiteAddressTrain;
 
-	@Excel(name = "*考培日期")
+	@Excel(name = "*考培日期",dateFormat="yyyy/MM/dd")
 	private String applySiteExamTrainTime;
 
 	@Excel(name = "*考培时间段")

+ 7 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserCourseAnswerMapper.xml

@@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="goodsName" column="goods_name"/>
         <result property="courseName" column="course_name"/>
         <result property="assignAnswerId" column="assign_answer_id"/>
+        <result property="assignAnswerText" column="assign_answer_text"/>
     </resultMap>
 
     <select id="selectAnswer" parameterType="com.zhongzheng.modules.user.bo.UserCourseAnswerQueryBo"  resultMap="UserCourseAnswerVo">
@@ -49,6 +50,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         u.avatar,
         u2.realname assign_realname,
         u2.avatar assign_avatar
+        <if test="msgType == 2">
+            ,uca1.answer_text as assign_answer_text
+        </if>
         <if test="msgType != null">
         ,g.goods_name,
         c.course_name,
@@ -58,6 +62,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
         FROM
         user_course_answer uca
+        <if test="msgType == 2">
+        LEFT JOIN user_course_answer uca1 ON uca.assign_answer_id = uca1.answer_id
+        </if>
         LEFT JOIN `user` u ON uca.user_id = u.user_id
         LEFT JOIN `user` u2 ON uca.assign_user_id = u2.user_id
         <if test="msgType != null">

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

@@ -272,6 +272,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE
         1 =1
           AND us.user_id = #{userId}
+          AND us.subscribe_status = 1
           AND LEFT(us.apply_site_start_time,2)*3600+RIGHT(us.apply_site_start_time,2)*60+us.apply_site_exam_time >  unix_timestamp(now())
         ORDER by us.apply_site_exam_time  limit 1
     </select>