he2802 1 éve
szülő
commit
2e7f05d20c

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

@@ -444,9 +444,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
                 timeStr = "00:"+unitFormat(minute) + ":" + unitFormat(second);
             } else {
                 hour = minute / 60;
-                if (hour > 99){
+                /*if (hour > 99){
                     return "99:59:59";
-                }
+                }*/
                 minute = minute % 60;
                 second = time - hour * 3600 - minute * 60;
                 timeStr = unitFormat(hour) + ":" + unitFormat(minute) + ":" + unitFormat(second);

+ 28 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -37,6 +37,7 @@ import com.zhongzheng.modules.base.service.IUserProfileService;
 import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.bo.CourseProjectTypeQueryBo;
 import com.zhongzheng.modules.course.domain.Major;
+import com.zhongzheng.modules.course.mapper.CourseMenuMapper;
 import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.course.vo.CourseBusinessVo;
 import com.zhongzheng.modules.course.vo.CourseChapterVo;
@@ -228,6 +229,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     @Autowired
     private IUserCertificateService iUserCertificateService;
 
+    @Autowired
+    private CourseMenuMapper courseMenuMapper;
+
 
     private String SEVEN_OFFICIALPUSH_INFOACCOUNT;
     private String SEVEN_OFFICIALPUSH_TOKEN;
@@ -4380,6 +4384,27 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 dir.mkdirs();
             }
             ossService.fileDownloadLocal(vo.getCertificatePath(),imgDirPath+"/"+vo.getCertificateCode()+".jpg");
+
+            ClassGradeUserQueryBo bo = new ClassGradeUserQueryBo();
+            bo.setGoodsId(vo.getGoodsId());
+            //获取章列表
+            List<CourseChapterVo> chapterList =  iClassGradeUserService.findChapterList(bo);
+            BigDecimal totalTime = new BigDecimal(0);
+            BigDecimal publicTotalTime = new BigDecimal(0);
+            List<DangAnCertificateItemExportVo> exportItemList = new ArrayList<>();
+            for(CourseChapterVo chapterVo : chapterList){
+                DangAnCertificateItemExportVo itemExportVo = BeanUtil.toBean(vo, DangAnCertificateItemExportVo.class);
+                if(Validator.isEmpty(chapterVo.getCommonSign())||chapterVo.getCommonSign()==0){
+                    totalTime=totalTime.add(new BigDecimal(courseMenuMapper.countChapterTotalTime(chapterVo.getChapterId())));
+                }else if(chapterVo.getCommonSign()==1){
+                    publicTotalTime=publicTotalTime.add(new BigDecimal(courseMenuMapper.countChapterTotalTime(chapterVo.getChapterId())));
+                }
+                itemExportVo.setChapterName(chapterVo.getName()+"(学时:"+totalTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP)+")");
+                exportItemList.add(itemExportVo);
+            }
+            ExcelUtil<DangAnCertificateItemExportVo> util = new ExcelUtil<DangAnCertificateItemExportVo>(DangAnCertificateItemExportVo.class);
+            String filePath2 = dirPath+"/"+vo.getCertificateCode()+"/培训内容.xlsx";
+            util.exportEasyExcelUtil(exportItemList,DangAnCertificateItemExportVo.class,filePath2);
         }
         ExcelUtil<DangAnCertificateExportVo> util2 = new ExcelUtil<DangAnCertificateExportVo>(DangAnCertificateExportVo.class);
         String filePath2 = dirPath+"/证书证明.xlsx";
@@ -4507,8 +4532,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             item.setServiceTimeTxt(DateUtils.timestampToDateFormat(vo.getServiceStartTime(),"yyyy-MM-dd HH:mm:ss")+"至"+DateUtils.timestampToDateFormat(vo.getServiceEndTime(),"yyyy-MM-dd HH:mm:ss"));
             item.setProcess(vo.getStuAllNum()+"/"+vo.getExamNum());
             item.setStudyTimeTxt(DateUtils.timestampToDateFormat(vo.getStartTime(),"yyyy-MM-dd HH:mm:ss")+"至"+DateUtils.timestampToDateFormat(vo.getEndTime(),"yyyy-MM-dd HH:mm:ss"));
-            if(Validator.isNotEmpty(vo.getStatus())&&vo.getStatus()==1){
-                item.setStatus("有效");
+            if(Validator.isNotEmpty(vo.getGoodsStatus())&&vo.getGoodsStatus()==1){
+                item.setStatus("正常");
             }else{
                 item.setStatus("无效");
             }
@@ -4544,7 +4569,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                         item.setRate(itemExportVo.getRightRate()+"");
                     }
                     if(ObjectUtils.isNull(itemExportVo.getFromPlat())){
-                        item.setPlat("PC");
+                        item.setPlat(null);
                     }
                     else if(itemExportVo.getFromPlat()==1){
                         item.setPlat("小程序");

+ 31 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/DangAnCertificateItemExportVo.java

@@ -0,0 +1,31 @@
+package com.zhongzheng.modules.grade.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * 学员记录视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2021-11-10
+ */
+@Data
+public class DangAnCertificateItemExportVo {
+	private static final long serialVersionUID = 1L;
+	/** 学员编码 */
+	@Excel(name = "姓名")
+	@ApiModelProperty("姓名")
+	private String realname;
+
+	/** 学员编码 */
+	@Excel(name = "身份证号码")
+	@ApiModelProperty("身份证号码")
+	private String idCard;
+
+	@Excel(name = "章名称")
+	@ApiModelProperty("章名称")
+	private String chapterName;
+
+}