Commit 02c0e5c2 by liangkaiping

copy

parent a039ee34
# caselibrary
案例库
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>caselibrary</artifactId>
<groupId>com.yizhi</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>library-api</artifactId>
<packaging>jar</packaging>
<name>library-api</name>
<dependencies>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-common-api</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-util</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package com.yizhi.library.application.enums;
public enum ProductCoverEnums {
PRODUCT_COVER_ON(80,"作品封面必填"),
PRODUCT_COVER_OFF(40,"作品封面选填"),
;
private Integer type;
private String value;
ProductCoverEnums(Integer type, String value) {
this.type = type;
this.value = value;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
package com.yizhi.library.application.feign;
import com.yizhi.library.application.vo.ClassifyListVO;
import com.yizhi.library.application.vo.ClassifyVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author dingxiaowei123
* @since 2019-07-03
*/
@FeignClient(name = "caselibrary", contextId = "CaseLibraryClassifyClient")
public interface CaseLibraryClassifyClient {
/**
* 插入分类
*
* @param classify
* @return
*/
@PostMapping("/classify/insert")
Integer insertClassify(@RequestBody ClassifyVO classify);
/**
* 删除分类
*
* @param classifyId
* @return
*/
@GetMapping("/classify/delete")
boolean deleteClassify(@RequestParam("classifyId") Long classifyId);
/**
* 分类下架
*
* @param classifyId
* @return
*/
@GetMapping("/classify/putDown")
boolean putDownClassify(@RequestParam("classifyId") Long classifyId);
/**
* 分类上架
*
* @param classifyId
* @return
*/
@GetMapping("/classify/release")
boolean releaseClassify(@RequestParam("classifyId") Long classifyId);
/**
* 获取分类列表
*
* @return
*/
@GetMapping("/classify/list")
List<ClassifyListVO> getClassifyList();
/**
* 修改分类信息
*
* @param classifyId
* @param name
* @param description
* @return
*/
@GetMapping("/classify/update")
boolean updateClassify(@RequestParam(name = "classifyId") Long classifyId,
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "description", required = false) String description);
/**
* 上移下移
* @param classifyId
* @param parentId
* @param sort
* @param type
* @return
*/
@GetMapping("/classify/move")
Integer moveClassify(@RequestParam(name = "classifyId") Long classifyId,
@RequestParam(name = "parentId") Long parentId,
@RequestParam(name = "sort") Integer sort,
@RequestParam(name = "type") Integer type);
}
package com.yizhi.library.application.feign;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.core.application.vo.DroolsVo;
import com.yizhi.library.application.param.RelateProjectParam;
import com.yizhi.library.application.vo.CaseLibraryVO;
import com.yizhi.library.application.vo.CaselibraryAuthorizeVO;
import com.yizhi.library.application.vo.ClassifyVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @author Ding
* @className CaseLibraryClient
* @description TODO
* @date 2019/7/3
**/
@FeignClient(name = "caselibrary", contextId = "CaseLibraryClient")
public interface CaseLibraryClient {
/**
* 获取活动管理列表
*
* @param name
* @param state
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/caseLibrary/list")
Page<CaseLibraryVO> getCaseLibraryList(@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "state", required = false) Integer state,
@RequestParam(name = "pageNo") Integer pageNo,
@RequestParam(name = "pageSize") Integer pageSize);
/**
* 新建案例活动
*
* @param caseLibraryVO
* @return
*/
@PostMapping("/caseLibrary/insert")
Long insertCaseLibrary(@RequestBody CaseLibraryVO caseLibraryVO);
/**
* 新建案例活动获取维度列表
*
* @param caseLibraryId
* @return
*/
@GetMapping("/caseLibrary/getClassify")
List<ClassifyVO> getClassify(@RequestParam(name = "caseLibraryId", required = false) Long caseLibraryId);
/**
* 案例活动审核对象导入
*
* @param caseLibraryId
* @param url
* @return
*/
@GetMapping("/caseLibrary/importAuditor")
String importAuditor(@RequestParam("caseLibraryId") Long caseLibraryId, @RequestParam("url") String url);
/**
* 案例活动必须提交人导入
*
* @param caseLibraryId
* @param url
* @return
*/
@GetMapping("/caseLibrary/importScorer")
String importScorer(@RequestParam("caseLibraryId") Long caseLibraryId, @RequestParam("url") String url);
/**
* 案例活动评分对象导入
*
* @param caseLibraryId
* @param url
* @return
*/
@GetMapping("/caseLibrary/importSubmitter")
String importSubmitter(@RequestParam("caseLibraryId") Long caseLibraryId, @RequestParam("url") String url);
/**
* 案例活动修改获取信息
*
* @param caseLibraryId
* @return
*/
@GetMapping("/caseLibrary/view")
CaseLibraryVO viewCaseLibrary(@RequestParam("caseLibraryId") Long caseLibraryId);
/**
* 更新案例活动
*
* @param caseLibraryVO
* @return
*/
@PostMapping("/caseLibrary/update")
boolean updateCaseLibrary(@RequestBody CaseLibraryVO caseLibraryVO);
/**
* 案例活动移除分类维度
*
* @param id
* @return
*/
@GetMapping("/caseLibrary/relatedClassify/delete")
boolean deleteRelatedClassify(@RequestParam("id") Long id);
/**
* 案例活动发布上架
*
* @param caseLibraryId
* @return
*/
@GetMapping("/caseLibrary/release")
boolean releaseCaseLibrary(@RequestParam("caseLibraryId") Long caseLibraryId);
/**
* 案例活动发布下架
*
* @param caseLibraryId
* @return
*/
@GetMapping("/caseLibrary/putDown")
boolean putDownCaseLibrary(@RequestParam("caseLibraryId") Long caseLibraryId);
/**
* 案例活动草稿状态下删除
*
* @param caseLibraryId
* @return
*/
@GetMapping("/caseLibrary/delete")
boolean deleteCaseLibrary(@RequestParam("caseLibraryId") Long caseLibraryId);
/**
* 案例活动关联培训项目
*
* @param relateProjectParam
* @return
*/
@PostMapping("/caseLibrary/relateProject")
boolean relateProject(@RequestBody RelateProjectParam relateProjectParam);
/**
* 案例活动取消关联培训项目
*
* @param caseLibraryId
* @return
*/
@GetMapping("/caseLibrary/cancelRelateProject")
boolean cancelRelateProject(@RequestParam("caseLibraryId") Long caseLibraryId);
/**
* 培训项目关联案例活动获取列表
*
* @param name
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/caseLibrary/getProjectList")
Page<CaseLibraryVO> getProjectList(@RequestParam(value = "name", required = false) String name,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
@PostMapping("/caseLibrary/insertAuthorizes")
boolean insertAuthorizes(@RequestBody List<CaselibraryAuthorizeVO> caseLibraryAuthorizeList);
@GetMapping("/caseLibrary/getAuthorize")
List<CaselibraryAuthorizeVO> getAuthorize(@RequestParam("caselibraryId") Long caselibraryId);
/**
* 获取案例活动信息
* @param caselibraryId
* @return
*/
@GetMapping("/caseLibrary/getCaseLibrary")
CaseLibraryVO getCaseLibrary(@RequestParam("caselibraryId") Long caselibraryId);
/**
* 管理端首页配置上传案例获取案例活动列表
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/caseLibrary/getHomeList")
Page<CaseLibraryVO> getHomeList(@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
/**
* 规则搜索下拉框分页数据
* @param field
* @param value
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/caseLibrary/getPageByDrools")
Page<DroolsVo> getPageByDrools(@RequestParam("field") String field,
@RequestParam(value = "value", required = false) String value,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
}
package com.yizhi.library.application.feign;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.vo.CommentReplyVO;
import com.yizhi.library.application.vo.CommentVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @author Ding
* @className CommentManageClient
* @description TODO
* @date 2019/7/15
**/
@FeignClient(name = "caselibrary", contextId = "CommentManageClient")
public interface CommentManageClient {
/**
* 获取评论管理列表
*
* @param studentCaseId
* @param name
* @param state
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/comment/manage/list")
Page<CommentVO> getCommentManageList(@RequestParam(name = "studentCaseId", required = true) Long studentCaseId,
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "state", required = false) Integer state,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
/**
* 下载评论信息
*
* @param studentCaseId
* @param name
* @param state
* @return
*/
@GetMapping("/comment/manage/downloadList")
String downloadList(@RequestParam(name = "studentCaseId", required = true) Long studentCaseId,
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "state", required = false) Integer state);
/**
* 获取评论回复列表
*
* @param name
* @param state
* @param commentId
* @return
*/
@GetMapping("/comment/manage/replyList")
List<CommentReplyVO> getCommentReplyList(@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "state", required = false) Integer state,
@RequestParam("commentId") Long commentId);
/**
* 评论/回复下架
*
* @param id
* @param type
* @return
*/
@GetMapping("/comment/manage/putDown")
boolean putDown(@RequestParam(name = "id", required = true) Long id,
@RequestParam(name = "type", required = true) Integer type);
/**
* 评论/回复上架
*
* @param id
* @param type
* @return
*/
@GetMapping("/comment/manage/release")
boolean release(@RequestParam(name = "id", required = true) Long id,
@RequestParam(name = "type", required = true) Integer type);
/**
* 获取评论回复删除
*
* @param id
* @param type
* @return
*/
@GetMapping("/comment/manage/delete")
boolean delete(@RequestParam(name = "id", required = true) Long id,
@RequestParam(name = "type", required = true) Integer type);
}
package com.yizhi.library.application.feign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
@FeignClient(name = "caselibrary", contextId = "StatisticStudentCaseClient")
public interface StatisticStudentCaseClient {
@GetMapping("/statistic/insert/all")
public void insertAll();
}
package com.yizhi.library.application.feign;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.core.application.vo.DroolsVo;
import com.yizhi.library.application.param.*;
import com.yizhi.library.application.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className StudentCaseClient
* @description TODO
* @date 2019/7/9
**/
@FeignClient(name = "caselibrary", contextId = "StudentCaseClient")
public interface StudentCaseClient {
/**
* pc端,移动端我的案例列表
*
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/studentCase/myCaseLibrary/list")
Page<CaseLibraryVO> myCaseLibraryList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize);
/**
* pc端,移动端我的案例记录总数
*
* @return
*/
@GetMapping("/studentCase/myCaseLibrary/total")
Integer myCaseLibraryTotal();
/**
* 学员提交案例获取案例库信息
*
* @param caseLibraryId
* @return
*/
@GetMapping("/studentCase/submit/prepare")
StudentCaseVO prepareStudentCase(@RequestParam("caseLibraryId") Long caseLibraryId);
/**
* 学员提交案例
*
* @param studentCaseParam
* @return
*/
@PostMapping("/studentCase/submit")
boolean submitStudentCase(@RequestBody StudentCaseParam studentCaseParam);
/**
* 获取学员案例提交记录列表
*
* @param caseLibraryId
* @param endTime
* @return
*/
@GetMapping("/studentCase/getSubmitRecords")
StudentCaseRecordListVO getSubmitRecords(@RequestParam("caseLibraryId") Long caseLibraryId,
@RequestParam("endTime") String endTime);
/**
* 学员案例提交记录中提交
*
* @param studentCaseId
* @return
*/
@GetMapping("/studentCase/record/studentCaseRecordSubmit")
boolean studentCaseRecordSubmit(@RequestParam("studentCaseId") Long studentCaseId);
/**
* 学员案例提交记录中撤回
*
* @param studentCaseId
* @return
*/
@GetMapping("/studentCase/record/studentCaseRecall")
boolean studentCaseRecall(@RequestParam("studentCaseId") Long studentCaseId);
/**
* 学员案例记录查看或者编辑获得信息
*
* @param studentCaseId
* @param type
* @return
*/
@GetMapping("/studentCase/record/studentCaseView")
StudentCaseViewVO studentCaseView(@RequestParam(name = "studentCaseId") Long studentCaseId,
@RequestParam(name = "type", required = false) Integer type);
/**
* 学员案例审核,评分获取案例列表
*
* @param type
* @param name
* @param pageSize
* @param pageNo
* @return
*/
@GetMapping("/studentCase/getAuditList")
Page<StudentCaseStudyVO> getAuditList(@RequestParam("type") Integer type,
@RequestParam(value = "name", required = false) String name,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
/**
* 学员案例学习获取案例信息/审核,评分获取案例信息
*
* @param studentCaseId
* @param type
* @return
*/
@GetMapping("/studentCase/studyStudentCase")
StudentCaseStudyVO studyStudentCase(@RequestParam("studentCaseId") Long studentCaseId,
@RequestParam("type") Integer type,
@RequestParam(name = "number", required = false) Integer number,
@RequestParam(name = "name", required = false) String name);
/**
* 学员案例审核提交
*
* @param studentCaseAuditParam
* @return
*/
@PostMapping("/studentCase/audit")
boolean studentCaseAudit(@RequestBody StudentCaseAuditParam studentCaseAuditParam);
/**
* 学员案例批量审核
*
* @param studentCaseAuditParam
* @return
*/
@PostMapping("/studentCase/batchAudit")
boolean studentCaseBatchAudit(@RequestBody StudentCaseAuditParam studentCaseAuditParam);
/**
* 学员案例评分提交
*
* @param studentCaseAuditParam
* @return
*/
@PostMapping("/studentCase/score")
boolean studentCaseScore(@RequestBody StudentCaseAuditParam studentCaseAuditParam);
/**
* 学员案例批量评分
*
* @param studentCaseAuditParam
* @return
*/
@PostMapping("/studentCase/batchScore")
boolean studentCaseBatchScore(@RequestBody StudentCaseAuditParam studentCaseAuditParam);
/**
* 学员案例审核/评分导出案例
*
* @param studentCaseAuditParam
* @return
*/
@PostMapping("/studentCase/batchExport")
String studentCaseBatchExport(@RequestBody StudentCaseAuditParam studentCaseAuditParam);
/**
* 首页配置获取列表
*
* @param homeListParam
* @return
*/
@PostMapping("/studentCase/homeList")
Page<StudentCaseVO> getStudentCaseHomeList(@RequestBody HomeListParam homeListParam);
/**
* 首页配置获取学员案例信息
*
* @param studentCaseId
* @return
*/
@GetMapping("/studentCase/getStudentCaseDetails")
StudentCaseStudyVO getStudentCaseDetails(@RequestParam("studentCaseId") Long studentCaseId);
/**
* 管理端修改学员案例新增可见范围用户,部门
*
* @param studentCaseAuthorizeList
* @return
*/
@PostMapping("/studentCase/insertAuthorizes")
boolean insertAuthorizes(@RequestBody List<StudentCaseAuthorizeVO> studentCaseAuthorizeList);
/**
* 获取指定范围列表
*
* @param studentCaseId
* @return
*/
@GetMapping("/studentCase/getAuthorize")
List<StudentCaseAuthorizeVO> getAuthorize(@RequestParam("studentCaseId") Long studentCaseId);
/**
* 获取我的收藏案例列表
*
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/studentCase/getFavorites")
Page<FavoriteVO> getFavorites(@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize,
@RequestParam(value = "name", required = false) String name);
/**
* 首页获取案例点赞总数
*
* @param companyId
* @param siteId
* @param accountId
* @return
*/
@GetMapping("/studentCase/getFavoritesCount")
Integer getFavoritesCount(@RequestParam("companyId") Long companyId,
@RequestParam("siteId") Long siteId,
@RequestParam("accountId") Long accountId);
/**
* 培训项目关联精选案例获取列表
*
* @param name
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/studentCase/getProjectList")
Page<StudentCaseStudyVO> getProjectList(@RequestParam(value = "name", required = false) String name,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
/**
* 精选案例搜索页获取列表
*
* @param selectionStudentCaseParam
* @return
*/
@PostMapping("/studentCase/selectionList")
Page<FavoriteVO> getSelectionStudentCaseList(@RequestBody SelectionStudentCaseParam selectionStudentCaseParam);
/**
* 首页获取精选案例信息
*
* @param studentCaseId
* @return
*/
@GetMapping("/studentCase/getStudentCaseDetail")
FavoriteVO getStudentCaseDetail(@RequestParam(value = "studentCaseId") Long studentCaseId);
@GetMapping("/studentCase/VisibleRange")
List<StudentCaseAuthorizeVO> VisibleRange(@RequestParam(value = "studentCaseId") Long studentCaseId);
/**
* 学员端审核案例修改关联分类
* @param param
* @return
*/
@PostMapping("/studentCase/updateClassify")
boolean modifyRlatedClassifys(@RequestBody UpdateCaseRelatedClassifyParam param);
/**
* 通知案例微服务该附件是视频/音频文件,等待转码
* @param ids
* @return
*/
@PostMapping("/studentCase/verifyVedio")
boolean verifyVedio(@RequestBody List<Long> ids);
/**
* 更新视频/音频转码url
* @param map
* @return
*/
@PostMapping("/studentCase/updateTranscodeUrl")
public boolean updateTranscodeUrl(@RequestBody Map<String, String> map);
/**
* 规则搜索下拉框分页数据
* @param field
* @param value
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/studentCase/getPageByDrools")
Page<DroolsVo> getPageByDrools(@RequestParam("field") String field,
@RequestParam(value = "value", required = false) String value,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
}
package com.yizhi.library.application.feign;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.param.ExportAuditListParam;
import com.yizhi.library.application.vo.SelectionCaseListVO;
import com.yizhi.library.application.vo.StudentCaseManageListVO;
import com.yizhi.library.application.vo.StudentCaseStudyVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map;
/**
* @author Ding
* @className StudentCaseManageClient
* @description TODO
* @date 2019/7/25
**/
@FeignClient(name = "caselibrary", contextId = "StudentCaseManageClient")
public interface StudentCaseManageClient {
/**
* 所有学员案例管理列表/审核评分管理列表
*
* @param studentCaseName
* @param accountName
* @param state
* @param pageNo
* @param pageSize
* @param caseLibraryId
* @param orgName
* @return
*/
@GetMapping("/manage/studentCase/list")
Page<StudentCaseManageListVO> studentCaseManageList(@RequestParam(name = "caseLibraryId", required = true) Long caseLibraryId,
@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName,
@RequestParam(name = "state", required = false) Integer state,
@RequestParam(name = "orgName", required = false) String orgName,
@RequestParam(name = "pageNo", required = true) Integer pageNo,
@RequestParam(name = "pageSize", required = true) Integer pageSize);
/**
* 审核评分管理列表下载报表
*
* @param caseLibraryName
* @param trainingProjectName
* @param caseLibraryId
* @param studentCaseName
* @param accountName
* @param state
* @return
*/
@GetMapping("/manage/studentCase/list/export")
String exportStudentCaseManageList(@RequestParam(name = "caseLibraryName", required = false) String caseLibraryName,
@RequestParam(name = "trainingProjectName", required = false) String trainingProjectName,
@RequestParam(name = "caseLibraryId", required = true) Long caseLibraryId,
@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName,
@RequestParam(name = "state", required = false) Integer state);
/**
* 学员案例审核/评分获取学员案例信息
*
* @param studentCaseName
* @param accountName
* @param state
* @param number
* @param caseLibraryId
* @param orgName
* @return
*/
@GetMapping("/manage/studentCase/auditOrScore")
StudentCaseStudyVO studentCaseManageAuditOrScoreView(@RequestParam(name = "studentCaseId", required = true) Long studentCaseId,
@RequestParam(name = "caseLibraryId", required = false) Long caseLibraryId,
@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName,
@RequestParam(name = "state", required = false) Integer state,
@RequestParam(name = "orgName", required = false) String orgName,
@RequestParam(name = "number", required = false) Integer number);
/**
* 导出待审核案例
*
* @param param
* @return
*/
@PostMapping("/manage/studentCase/auditList/export")
String exportAuditList(@RequestBody ExportAuditListParam param);
/**
* 导入审核结果
*
* @param ossUrl
* @return
*/
@GetMapping("/manage/studentCase/auditList/import")
String importAuditList(@RequestParam("ossUrl") String ossUrl);
/**
* 导出待评分案例
*
* @param param
* @return
*/
@PostMapping("/manage/studentCase/scoreList/export")
String exportScoreList(@RequestBody ExportAuditListParam param);
/**
* 导入评分结果
*
* @param ossUrl
* @return
*/
@GetMapping("/manage/studentCase/scoreList/import")
String importScoreList(@RequestParam("ossUrl") String ossUrl);
/**
* 精选案例管理列表
*
* @param studentCaseName
* @param accountName
* @param state
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/manage/studentCase/selectionList")
Page<SelectionCaseListVO> getSelectionList(@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName,
@RequestParam(name = "state", required = false) Integer state,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
/**
* 精选案例管理列表下载报表
*
* @param studentCaseName
* @param accountName
* @param state
* @return
*/
@GetMapping("/manage/studentCase/selectionList/export")
String selectionListExport(@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName,
@RequestParam(name = "state", required = false) Integer state);
/**
* 举报记录列表
*
* @param studentCaseName
* @param accountName
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/manage/studentCase/informList")
Page<StudentCaseManageListVO> getInformList(@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
/**
* 举报记录列表导出
*
* @param studentCaseName
* @param accountName
* @return
*/
@GetMapping("/manage/studentCase/informList/export")
String informListExport(@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName);
/**
* 举报记录查看
*
* @param informRecordId
* @return
*/
@GetMapping("/manage/studentCase/informList/view")
StudentCaseStudyVO informListView(@RequestParam("informRecordId") Long informRecordId);
/**
* 案例管理列表获取记录数
*
* @param caseLibraryId
* @return
*/
@GetMapping("/manage/studentCase/list/getCount")
Map<String, Object> getManageListCount(@RequestParam("caseLibraryId") Long caseLibraryId);
/**
* 学员案例下架
*
* @param studentCaseId
* @return
*/
@GetMapping("/manage/studentCase/putDown")
boolean putDown(@RequestParam("studentCaseId") Long studentCaseId);
/**
* 学员案例上架
*
* @param studentCaseId
* @return
*/
@GetMapping("/manage/studentCase/release")
boolean release(@RequestParam("studentCaseId") Long studentCaseId);
/**
* 学员案例删除
* @param studentCaseId
* @return
*/
@GetMapping("/manage/studentCase/delete")
boolean delete(@RequestParam("studentCaseId") Long studentCaseId);
/**
* 举报记录移除
*
* @param informRecordId
* @return
*/
@GetMapping("/manage/studentCase/informRecordRemove")
boolean informRecordRemove(@RequestParam("informRecordId") Long informRecordId);
}
package com.yizhi.library.application.feign;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.vo.StatisticStudentCaseVO;
import com.yizhi.library.application.vo.StudentCaseAccountExportVO;
import com.yizhi.library.application.vo.StudentCaseOrgExportVO;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map;
@FeignClient(name = "caselibrary", contextId = "StudentCaseReportClient")
public interface StudentCaseReportClient {
@GetMapping("/studentCaseReport/list/org")
public Page<StudentCaseOrgExportVO> studentCaseByOrg(
@ApiParam(value = "查询关键字", required = false) @RequestParam(name = "kwd", required = false) String kwd,
@ApiParam(value = "每页条数,默认10", required = false) @RequestParam(name = "pageSize", required = false, defaultValue = "10") Integer pageSize,
@ApiParam(value = "当前页数", required = false) @RequestParam(name = "pageNo", required = false, defaultValue = "1") Integer pageNo);
@GetMapping("/studentCaseReport/list")
public Page<StatisticStudentCaseVO> studentCaseList(
@ApiParam(value = "开始时间(yyyy-mm-dd)", required = false) @RequestParam(name = "startDate", required = false) String startDate,
@ApiParam(value = "结束时间(yyyy-mm-dd)", required = false) @RequestParam(name = "endDate", required = false) String endDate,
@ApiParam(value = "查询关键字", required = false) @RequestParam(name = "kwd", required = false) String kwd,
@ApiParam(value = "每页条数,默认10", required = false) @RequestParam(name = "pageSize", required = false, defaultValue = "10") Integer pageSize,
@ApiParam(value = "当前页数", required = false) @RequestParam(name = "pageNo", required = false, defaultValue = "1") Integer pageNo);
@GetMapping("/studentCaseReport/list/account")
public Page<StudentCaseAccountExportVO> studentCaseByAccount(
@ApiParam(value = "查询关键字", required = false) @RequestParam(name = "kwd", required = false) String kwd,
@ApiParam(value = "每页条数,默认10", required = false) @RequestParam(name = "pageSize", required = false, defaultValue = "10") Integer pageSize,
@ApiParam(value = "当前页数", required = false) @RequestParam(name = "pageNo", required = false, defaultValue = "1") Integer pageNo);
@GetMapping("/studentCaseReport/list/account/export")
public Map<String, Object> studentCaseExportByAccount(@ApiParam(value = "查询关键字", required = false) @RequestParam(name = "kwd", required = false) String kwd);
@GetMapping("/studentCaseReport/list/org/export")
public Map<String, Object> studentCaseExportByOrg(@ApiParam(value = "查询关键字", required = false) @RequestParam(name = "kwd", required = false) String kwd);
@GetMapping("/studentCaseReport/list/export")
public Map<String, Object> studentCaseExport(@ApiParam(value = "开始时间(yyyy-mm-dd)", required = false) @RequestParam(name = "startDate", required = false) String startDate,
@ApiParam(value = "结束时间(yyyy-mm-dd)", required = false) @RequestParam(name = "endDate", required = false) String endDate,
@ApiParam(value = "查询关键字", required = false) @RequestParam(name = "kwd", required = false) String kwd);
}
package com.yizhi.library.application.feign;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.param.CommentParam;
import com.yizhi.library.application.param.InformParam;
import com.yizhi.library.application.vo.CommentReplyVO;
import com.yizhi.library.application.vo.CommentVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author Ding
* @className StudyCaseClient
* @description TODO
* @date 2019/7/12
**/
@FeignClient(name = "caselibrary", contextId = "StudyCaseClient")
public interface StudyCaseClient {
/**
* 学习案例点赞
*
* @param studentCaseId
* @return
*/
@GetMapping("/studentCase/study/admire")
boolean admireStudentCase(@RequestParam("studentCaseId") Long studentCaseId);
/**
* 学习案例取消点赞
*
* @param studentCaseId
* @return
*/
@GetMapping("/studentCase/study/cancelAdmire")
boolean cancelAdmireStudentCase(@RequestParam("studentCaseId") Long studentCaseId);
/**
* 学习案例收藏
*
* @param studentCaseId
* @return
*/
@GetMapping("/studentCase/study/favorite")
boolean favorite(@RequestParam("studentCaseId") Long studentCaseId);
/**
* 学习案例取消收藏
*
* @param studentCaseId
* @return
*/
@GetMapping("/studentCase/study/cancelFavorite")
boolean cancelFavorite(@RequestParam("studentCaseId") Long studentCaseId);
/**
* 学习案例举报
* @param informParam
* @return
*/
@PostMapping("/studentCase/study/inform")
boolean inform(@RequestBody InformParam informParam);
/**
* 发表评论/回复
* @param commentParam
* @return
*/
@PostMapping("/studentCase/study/comment")
boolean comment(@RequestBody CommentParam commentParam);
/**
* 评论点赞
* @param commentId
* @return
*/
@GetMapping("/studentCase/study/comment/admire")
boolean admireComment(@RequestParam("commentId") Long commentId);
/**
* 评论取消点赞
* @param commentId
* @return
*/
@GetMapping("/studentCase/study/comment/cancelAdmire")
boolean cancelAdmireComment(@RequestParam("commentId") Long commentId);
/**
* 获取评论列表
* @param studentCaseId
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/studentCase/study/comment/list")
Page<CommentVO> getCommentList(@RequestParam("studentCaseId") Long studentCaseId,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
/**
* 获取回复列表
* @param commentId
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/studentCase/study/comment/replyList")
Page<CommentReplyVO> getReplyList(@RequestParam("commentId") Long commentId,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize);
}
package com.yizhi.library.application.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Ding
* @className CommentParam
* @description TODO
* @date 2019/7/12
**/
@Data
@ApiModel(value = "CommentParam",description = "评论/回复请求类")
public class CommentParam {
@ApiModelProperty(value = "类型1:评论 2:回复")
private Integer type;
@ApiModelProperty(value = "学员案例id")
private Long studentCaseId;
@ApiModelProperty(value = "评论id")
private Long commentId;
@ApiModelProperty(value = "评论/回复内容")
private String content;
@ApiModelProperty(value = "回复对象id")
private Long replyAccountId;
}
package com.yizhi.library.application.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Ding
* @className InformParam
* @description TODO
* @date 2019/7/12
**/
@Data
@ApiModel(value = "InformParam", description = "学员案例举报param")
public class ExportAuditListParam {
@ApiModelProperty(value = "学员案例id列表")
private List<Long> studentCaseIds;
@ApiModelProperty(value = "案例活动名称")
private String caseLibraryName;
@ApiModelProperty(value = "所属项目名称")
private String trainingProjectName;
}
package com.yizhi.library.application.param;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.List;
/**
* @author Ding
* @className HomeListParam
* @description TODO
* @date 2019/7/15
**/
@Data
@ApiModel(value = "HomeListParam",description = "首页配置请求类")
public class HomeListParam {
private Integer pageNo;
private Integer pageSize;
private String key;
List<Long> studentCaseIds;
}
package com.yizhi.library.application.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Ding
* @className InformParam
* @description TODO
* @date 2019/7/12
**/
@Data
@ApiModel(value = "InformParam",description = "学员案例举报param")
public class InformParam {
@ApiModelProperty(value = "学员案例id")
private Long studentCaseId;
@ApiModelProperty(value = "举报描述")
private String informDescription;
@ApiModelProperty(value = "举报截图")
private List<String> pictureUrlList;
}
package com.yizhi.library.application.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Ding
* @className ProjectDeleteParam
* @description TODO
* @date 2019/8/21
**/
@Data
@ApiModel(value = "ProjectDeleteParam", description = "培训项目删除活动请求类")
public class ProjectDeleteParam {
private List<Long> ids;
@ApiModelProperty(value = "如果是案例活动,传类型11,以便取消案例活动关联项目")
private Integer type;
}
package com.yizhi.library.application.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Ding
* @className RelateProjectParam
* @description TODO
* @date 2019/8/12
**/
@Data
@ApiModel(value = "RelateProjectParam",description = "关联培训项目请求类")
public class RelateProjectParam {
@ApiModelProperty(value = "案例活动id")
List<Long> caseLibraryIds;
@ApiModelProperty(value = "培训项目id")
Long projectId;
}
package com.yizhi.library.application.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Ding
* @className SelectionStudentCaseParam
* @description TODO
* @date 2019/8/13
**/
@Data
@ApiModel(value = "SelectionStudentCaseParam",description = "精选案例搜索请求类")
public class SelectionStudentCaseParam {
@ApiModelProperty(value = "作者或者案例姓名模糊查询")
private String key;
@ApiModelProperty(value = "分类筛选id")
private List<Long> classifyIdList;
@ApiModelProperty("排序类型 1:提交时间由近到远 2:提交时间由远到近 3:学习量由多到少 4:点赞数由多到少 5:评分由高到低")
private Integer sortType;
private Integer pageNo;
private Integer pageSize;
}
package com.yizhi.library.application.param;
import com.yizhi.library.application.vo.StudentCaseDimensionGradeRecordVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Ding
* @className StudentCaseAuditParam
* @description TODO
* @date 2019/7/12
**/
@Data
@ApiModel(value = "StudentCaseAuditParam", description = "学生案例,审核/评分提交param")
public class StudentCaseAuditParam {
@ApiModelProperty("是否是管理员评分 1:管理员 不传为非管理员")
private Integer isAdmin;
@ApiModelProperty(value = "学生案例id")
private Long studentCaseId;
@ApiModelProperty(value = "审核是否通过")
private Integer auditState;
@ApiModelProperty(value = "审核反馈")
private String audiEvaluate;
@ApiModelProperty(value = "评分")
private Integer score;
@ApiModelProperty(value = "批量审核/评分案例id")
private List<Long> idList;
@ApiModelProperty(value = "多维度打分,无值按照以前处理,有值按照多维度打分处理")
private List<StudentCaseDimensionGradeRecordVO> studentCaseDimensionGradeRecordVOS;
}
package com.yizhi.library.application.param;
import com.yizhi.library.application.vo.AccessoryUrlVO;
import com.yizhi.library.application.vo.StudentCaseRelatedClassifyVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author Ding
* @className StudentCaseVO
* @description TODO
* @date 2019/7/9
**/
@Data
@ApiModel(value = "StudentCase", description = "学生案例vo")
public class StudentCaseParam {
@ApiModelProperty("如果是管理端代提交,提交人id")
private Long submitterId;
@ApiModelProperty(value = "关联分类list")
private List<StudentCaseRelatedClassifyVO> relatedClassifyList;
@ApiModelProperty(value = "提交类型 0:保存 1:提交 2:管理端修改保存 3:管理端修改上架")
private Integer type;
@ApiModelProperty(value = "附件url")
private List<AccessoryUrlVO> accessoryUrlList;
@ApiModelProperty(value = "外部文档文件名")
private String pdfFileName;
@ApiModelProperty("关键字数组")
private List<String> keywordsList;
private Long id;
private String title;
@ApiModelProperty(value = "关联案列活动id")
private Long caseLibraryId;
private Long accountId;
@ApiModelProperty(value = "学员案例封面url")
private String logoUrl;
@ApiModelProperty("关键字")
private String keywords;
@ApiModelProperty("得分规则")
private Integer scoreRule;
@ApiModelProperty(value = "文本提交类型 1:富文本编辑 2:附件上传")
private Integer textEditType;
@ApiModelProperty(value = "学员案例内容")
private String content;
@ApiModelProperty(value = "学员案例内容")
private String contentFileName;
@ApiModelProperty(value = "外部文档上传阿里云url")
private String pdfOssUrl;
@ApiModelProperty(value = "附件url")
private String accessoryUrl;
@ApiModelProperty(value = "评分状态 0:待评分 1:已评分")
private Integer scoreState;
@ApiModelProperty(value = "是否完成所有评分 0:未完成 1:已完成")
private Integer isFinishedScore;
@ApiModelProperty(value = "得分")
private Integer score;
@ApiModelProperty(value = "学员端显示类型 1:通过后自动上架, 2:通过需要手动上架")
private Integer examine;
@ApiModelProperty(value = "举报状态 0:未举报 1:被举报")
private Integer informState;
@ApiModelProperty(value = "审核状态0:待审核 1:审核通过 2:审核不通过")
private Integer auditState;
@ApiModelProperty(value = "审核反馈")
private String auditEvaluate;
@ApiModelProperty(value = "审核人是否可修改分类 0:不可修改 1:可修改")
private Integer auditorAuthorize;
@ApiModelProperty(value = "可见范围类型 1:全平台可见 2:指定范围")
private Integer visibleRange;
@ApiModelProperty(value = "0:删除,1:提交待审核,2:上架,3:下架,4草稿")
private Integer state;
@ApiModelProperty(value = "审核时间")
private Date auditTime;
@ApiModelProperty(value = "提交时间")
private Date submitTime;
@ApiModelProperty(value = "最近修改时间")
private Date lastModifyTime;
@ApiModelProperty(value = "代提交人id")
private Long diplomaticAgentId;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
private Long companyId;
private Long siteId;
private Long orgId;
private Long readNum;
private Long admireNum;
}
package com.yizhi.library.application.param;
import com.yizhi.library.application.vo.StudentCaseRelatedClassifyVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Ding
* @className UpdateCaseRelatedClassifyParam
* @description TODO
* @date 2019/12/5
**/
@Data
@ApiModel(value = "StudentCase", description = "修改学生案例关联分类请求类")
public class UpdateCaseRelatedClassifyParam {
@ApiModelProperty("学员案例id")
private Long studentCaseId;
@ApiModelProperty(value = "关联分类list")
private List<StudentCaseRelatedClassifyVO> relatedClassifyList;
}
package com.yizhi.library.application.vo;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Ding
* @className AccessoryUrlVO
* @description TODO
* @date 2019/7/10
**/
@Data
@ApiModel(value = "AccessoryUrlVO", description = "附件VO")
public class AccessoryUrlVO {
@ApiModelProperty(value = "文件大小")
private String fileSize;
@ApiModelProperty(value = "附件url")
private String url;
@ApiModelProperty(value = "前端需要回显")
private String uid;
@ApiModelProperty(value = "pdf图片")
private List<PdfPages> pdfPages;
private Long id;
private String name;
@ApiModelProperty(value = "0:维度, 1:一级分类 2:二级分类")
private Integer level;
@ApiModelProperty(value = "分类描述")
private String description;
@ApiModelProperty(value = "父级id 0为维度没有父级")
private Long parentId;
@ApiModelProperty(value = "分类排序")
private Integer sort;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
private Long companyId;
private Long siteId;
private Long orgId;
@ApiModelProperty(value = "(0:删除, 1:上架, 2:下架)")
private Integer state;
}
package com.yizhi.library.application.vo;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className AccountMapVO
* @description TODO
* @date 2019/7/15
**/
@Data
public class AccountMapVO {
List<Long> accountIds;
Map<Long, ReportAccountRespVO> accountMap;
}
package com.yizhi.library.application.vo;
import com.baomidou.mybatisplus.annotations.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
* 原创活动多维度打分设置
* </p>
*
* @author shengchenglong123
* @since 2020-08-05
*/
@Data
@ApiModel(value = "CaseLibraryDimensionGradeVO", description = "整体不传为删除该条维度")
public class CaseLibraryDimensionGradeVO{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id, 不传为新增,传递为修改")
private Long id;
@ApiModelProperty(value = "维度名称")
private String name;
@ApiModelProperty(value = "分值区间左值")
@TableField("min_score")
private Integer minScore;
@ApiModelProperty(value = "分值区间右值")
@TableField("max_score")
private Integer maxScore;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty("已经获得的分值")
private Integer score;
}
package com.yizhi.library.application.vo;
import com.baomidou.mybatisplus.annotations.TableField;
import com.yizhi.library.application.enums.ProductCoverEnums;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author Ding
* @className CaseLibraryVO
* @description TODO
* @date 2019/7/5
**/
@Data
@ApiModel(value = "CaseLibraryVO", description = "案例活动VO")
public class CaseLibraryVO {
@ApiModelProperty(value = "分类维度列表")
private List<Long> classifyIdList;
@ApiModelProperty(value = "关联项目名称")
private String trainingProjectName;
@ApiModelProperty(value = "案例活动截止时间")
private Date endTime;
@ApiModelProperty(value = "我的列表进行中数量")
private Integer inProgressNum;
@ApiModelProperty(value = "我的列表已完成数量")
private Integer finishNum;
@ApiModelProperty(value = "是否必须提交0:不必须提交 1:必须提交")
private Integer isMustSubmit;
@ApiModelProperty(value = "保存或者上架类型1,不传是下一步")
private Integer type;
@ApiModelProperty(value = "多维度评分VO列表")
private List<CaseLibraryDimensionGradeVO> caseLibraryDimensionGradeVOS;
@ApiModelProperty("是否显示打分:0否,1是")
private Integer showScore;
@ApiModelProperty(value = "评分说明")
private String caseLibraryDimensionGradeDescription;
private Long id;
private String name;
@ApiModelProperty(value = "封面图片url")
@TableField("logo_url")
private String logoUrl;
@ApiModelProperty("开始时间")
private Date startTime;
@ApiModelProperty("可见范围类型 1:全平台可见 2:指定范围")
private Integer visibleRange;
@ApiModelProperty(value = "培训项目id")
private Long trainingProjectId;
@ApiModelProperty(value = "案例要求")
private String explanation;
@ApiModelProperty(value = "文本编辑形式:1文本编辑框, 2导入外部文档格式doc docx pdf")
private Integer textEditType;
@ApiModelProperty(value = "必须提交人导入附件阿里云地址")
private String submitterUrl;
@ApiModelProperty(value = "必须提交人导入附件名称")
private String submitterAccessName;
@ApiModelProperty(value = "审核人导入附件阿里云地址")
private String auditorUrl;
@ApiModelProperty(value = "审核人导入附件名称")
private String auditorAccessName;
@ApiModelProperty("审核人权限 0:不允许修改分类 1:允许修改分类")
private Integer auditorAuthorize;
@ApiModelProperty(value = "评分人导入附件阿里云地址")
private String scorerUrl;
@ApiModelProperty(value = "评分人导入附件名称")
private String scorerAccessName;
@ApiModelProperty(value = "通过审核后 获得积分")
private Integer point;
@ApiModelProperty(value = "学员端显示类型 1:通过后自动上架, 2:通过需要手动上架")
private Integer examine;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
private Long companyId;
private Long siteId;
private Long orgId;
@ApiModelProperty(value = "0:删除,1:草稿,2:上架,3:下架")
private Integer state;
@ApiModelProperty("得分规则 1:平均分 2:最高分 3:任意一人得分 4:多维度打分")
private Integer scoreRule;
@ApiModelProperty("是否可修改得分规则 0:不可修改 1:可修改")
private Integer canModifyScoreRule;
@ApiModelProperty(value = "作品封面是否必填 80:必填 默认; 40:非必填")
private Integer productCover = ProductCoverEnums.PRODUCT_COVER_ON.getType();
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Ding
* @className StudentCaseAuthorizeVO
* @description TODO
* @date 2019/8/5
**/
@Data
@ApiModel(value = "StudentCaseAuthorize", description = "可见范围vo类")
public class CaselibraryAuthorizeVO {
@ApiModelProperty("用户姓名")
private String accountFullName;
@ApiModelProperty("工号")
private String workNum;
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "学员案例_ID,外键")
private Long caseLibraryId;
@ApiModelProperty(value = "1:用户 、2:组织")
private Integer type;
@ApiModelProperty(value = "存放人或组织的ID")
private Long relationId;
@ApiModelProperty(value = "角色名称")
private String name;
@ApiModelProperty(value = "0删除 1有效,默认有效")
private Integer state;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "创建人ID")
private Long createById;
@ApiModelProperty(value = "创建人姓名")
private String createByName;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "修改人ID")
private Long updateById;
@ApiModelProperty(value = "修改人姓名")
private String updateByName;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Ding
* @className ClassifyListVO
* @description TODO
* @date 2019/7/4
**/
@Data
@ApiModel(value = "CaseLibrary", description = "一级分类列表类,包含二级分类列表")
public class ClassifyLevelOneVO extends ClassifyVO{
@ApiModelProperty(value = "是否选择 0:未选中 1:选中")
Integer chooseState;
@ApiModelProperty(value = "二级分类列表")
List<ClassifyVO> children;
@ApiModelProperty(value = "索引")
String key;
@ApiModelProperty(value = "少波需要,跟name值一样")
private String label;
@ApiModelProperty(value = "少波需要,跟id值一样")
private Long value;
@ApiModelProperty(value = "是否可删除 0:不可删除 1:可删除")
private Integer canDelete;
@ApiModelProperty("置灰状态 0:置灰 1:不置灰")
private Integer showState;
private String name;
private Long id;
private Integer state;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author Ding
* @className ClassifyListVO
* @description TODO
* @date 2019/7/4
**/
@Data
@ApiModel(value = "Classify", description = "分类列表vo")
public class ClassifyListVO extends ClassifyVO {
List<ClassifyLevelOneVO> children;
@ApiModelProperty(value = "学员案例每个维度关联分类主体id(修改关联分类id时候用)")
Long studentCaseRelatedClassifyId;
@ApiModelProperty(value = "该维度下选择的分类id 包括一级,二级")
List<Long> selectList;
@ApiModelProperty(value = "是否可删除 0:不可删除 1:可删除")
Integer canDelete;
private Long id;
private String name;
@ApiModelProperty(value = "0:维度, 1:一级分类 2:二级分类")
private Integer level;
@ApiModelProperty(value = "分类描述")
private String description;
@ApiModelProperty(value = "父级id 0为维度没有父级")
private Long parentId;
@ApiModelProperty(value = "分类排序")
private Integer sort;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
private Long companyId;
private Long siteId;
private Long orgId;
@ApiModelProperty(value = "(0:删除, 1:上架, 2:下架)")
private Integer state;
}
package com.yizhi.library.application.vo;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Ding
* @className ClassifyVO
* @description TODO
* @date 2019/7/8
**/
@Data
@ApiModel(value = "CaseLibraryVO", description = "案例活动VO")
public class ClassifyVO {
@ApiModelProperty(value = "是否选择 0:未选中 1:选中")
Integer chooseState;
@ApiModelProperty(value = "临时索引,前端需要")
String key;
@ApiModelProperty(value = "分类id别名,便于前端使用")
Long classifyId;
@ApiModelProperty(value = "分类名称别名,便于前端使用")
String classifyName;
@ApiModelProperty(value = "少波需要,跟name值一样")
private String label;
@ApiModelProperty(value = "少波需要,跟id值一样")
private Long value;
@ApiModelProperty(value = "是否可删除 0:不可删除 1:可删除")
private Integer canDelete;
@ApiModelProperty("置灰状态 0:置灰 1:不置灰")
private Integer showState;
private Long id;
private String name;
@ApiModelProperty(value = "0:维度, 1:一级分类 2:二级分类")
private Integer level;
@ApiModelProperty(value = "分类描述")
private String description;
@ApiModelProperty(value = "父级id 0为维度没有父级")
@TableField("parent_id")
private Long parentId;
@ApiModelProperty(value = "分类排序")
private Integer sort;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
@ApiModelProperty(value = "(0:删除, 1:上架, 2:下架)")
private Integer state;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Ding
* @className CommentReplyVO
* @description TODO
* @date 2019/7/15
**/
@Data
@ApiModel(value = "CommentReply", description = "评论回复vo")
public class CommentReplyVO {
@ApiModelProperty(value = "前端需要key值")
private String key;
@ApiModelProperty(value = "回复人头像")
private String headPortrait;
@ApiModelProperty(value = "回复人用户名")
private String commenterName;
@ApiModelProperty(value = "回复人姓名")
private String commenterFullName;
@ApiModelProperty(value = "被回复人用户名")
private String replyAccountName;
@ApiModelProperty(value = "被回复人姓名")
private String replyAccountFullName;
private Long Id;
@ApiModelProperty(value = "评论id")
private Long commentId;
@ApiModelProperty(value = "回复人id(评论人或者回复人)")
private Long commenterId;
@ApiModelProperty(value = "被回复人id")
private Long replyAccountId;
@ApiModelProperty(value = "回复内容")
private String content;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
@ApiModelProperty(value = "0:删除 1:未删除")
private Integer state;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author Ding
* @className CommentVO
* @description TODO
* @date 2019/7/12
**/
@Data
@ApiModel(value = "CommentVO", description = "评论VO")
public class CommentVO {
@ApiModelProperty(value = "序号")
private Integer index;
@ApiModelProperty(value = "前端需要key值")
private String key;
@ApiModelProperty(value = "是否点赞 0:未点赞 >0已点赞点赞")
private Integer isAdmire;
@ApiModelProperty(value = "评论人头像")
private String headPortrait;
@ApiModelProperty(value = "评论人用户名")
private String commenterUserName;
@ApiModelProperty(value = "评论人姓名")
private String commenterFullName;
@ApiModelProperty(value = "评论回复数")
private Integer replyNum;
@ApiModelProperty(value = "评论点赞数")
private Integer admireNum;
@ApiModelProperty(value = "被回复人id")
private Long replyAccountId;
@ApiModelProperty(value = "被回复人姓名")
private String replyAccountFullName;
@ApiModelProperty(value = "评论回复列表")
private List<CommentReplyVO> children;
private Long Id;
@ApiModelProperty(value = "评论人id")
private Long accountId;
@ApiModelProperty(value = "学员案例id")
private Long studentCaseId;
@ApiModelProperty(value = "评论内容")
private String content;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
private Long companyId;
private Long siteId;
private Long orgId;
@ApiModelProperty(value = "0:删除 1:未删除")
private Integer state;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Ding
* @className FavoriteVO
* @description TODO
* @date 2019/8/7
**/
@Data
@ApiModel(value = "FavoriteVO", description = "我的收藏类")
public class FavoriteVO {
@ApiModelProperty(value = "收藏记录id")
private Long favoriteId;
@ApiModelProperty(value = "学员案例id")
private Long studentCaseId;
@ApiModelProperty(value = "学员案例名称")
private String studentCaseTittle;
@ApiModelProperty(value = "封面logo")
private String studentCaseLogoUrl;
@ApiModelProperty(value = "提交时间")
private Date submitTime;
@ApiModelProperty(value = "作者id")
private Long authorId;
@ApiModelProperty(value = "作者姓名")
private String authorFullName;
@ApiModelProperty(value = "学习量")
private Integer studyNum;
@ApiModelProperty(value = "点赞量")
private Integer admireNum;
@ApiModelProperty(value = "举报数")
private Integer informNum;
@ApiModelProperty(value = "得分")
private Integer score;
@ApiModelProperty(value = "是否是本人")
private boolean self = false;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Ding
* @className ImportVO
* @description TODO
* @date 2019/7/8
**/
@Data
@ApiModel(value = "ImportVO", description = "导入vo类")
public class ImportVO {
@ApiModelProperty("行数")
private Integer rowNum;
@ApiModelProperty("必须提交人用户名/审核人用户名/评分人用户名")
private String name;
@ApiModelProperty("被审核人用户名/被评分人用户名")
private String accountName;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author Ding
* @className InformVO
* @description 案例举报vo
* @date 2019/7/31
**/
@Data
@ApiModel(value = "InformVO",description = "案例举报vo")
public class InformVO {
@ApiModelProperty(value = "举报人id")
private Long informerId;
@ApiModelProperty(value = "举报人姓名")
private String informerFullName;
@ApiModelProperty(value = "举报理由")
private String informDescription;
@ApiModelProperty(value = "举报截图组成一个字符串")
private String pictureUrl;
@ApiModelProperty(value = "举报截图")
private List<String> pictureUrlList;
@ApiModelProperty(value = "举报时间")
private Date informTime;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Date 2020/9/29 7:13 下午
* @Author lvjianhui
**/
@Data
public class PdfPages {
private Long id;
@ApiModelProperty(value = "页数")
private Integer pdfPage;
@ApiModelProperty(value = "业务id")
private Long bizId;
@ApiModelProperty(value = "业务类型")
private Integer bizType;
@ApiModelProperty(value = "图片地址")
private String imageUrl;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className RangeAccountsVO
* @description TODO
* @date 2019/7/25
**/
@Data
@ApiModel(value = "RangeAccountsVO", description = "模糊查询/管辖区查询用户信息返回类")
public class RangeAccountsVO {
@ApiModelProperty(name = "是否是全站点用户")
Boolean isAllAccount;
@ApiModelProperty(name = "筛选出的用户id")
List<Long> accountIds;
@ApiModelProperty(name = "筛选出的用户map")
Map<Long, ReportAccountRespVO> accountMap;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @Date 2020/9/23 9:28 下午
* @Author lvjianhui
**/
@Data
public class ReportAccountRespVO {
@ApiModelProperty("用户id")
private Long userId;
@ApiModelProperty("头像")
private String headPortrait;
@ApiModelProperty("用户名")
private String userName;
@ApiModelProperty("用户姓名")
private String userFullName;
@ApiModelProperty("部门id")
private Long orgId;
@ApiModelProperty("部门名称")
private String orgName;
@ApiModelProperty("部门code")
private String orgCode;
@ApiModelProperty("用户状态:1:启用,0:停用")
private Integer status;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("账户邮箱")
private String email;
@ApiModelProperty("企业id")
private Long companyId;
@ApiModelProperty("父节组织名称")
private List<String> parentOrgNames;
@ApiModelProperty("工号")
private String workNum;
private String mobile;
@ApiModelProperty("职位")
private String position;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.math.NumberUtils;
import java.math.RoundingMode;
import java.util.Date;
/**
* @author Ding
* @className SelectionCaseVO
* @description TODO
* @date 2019/7/30
**/
@Data
@ApiModel(value = "SelectionCaseListVO", description = "精选案例管理列表VO")
public class SelectionCaseListVO {
@ApiModelProperty(value = "学员案例id")
private Long id;
@ApiModelProperty(value = "学员案例名称")
private String tittle;
@ApiModelProperty(value = "案例活动名称")
private String caseLibraryName;
private Long caseLibraryId;
@ApiModelProperty(value = "用户id")
private Long accountId;
@ApiModelProperty(value = "用户名")
private String accountName;
@ApiModelProperty(value = "姓名")
private String accountFullName;
@ApiModelProperty(value = "提交时间")
private Date submitTime;
@ApiModelProperty(value = "得分")
private Integer score;
@ApiModelProperty(value = "状态")
private String state;
private Integer scoreRule;
@ApiModelProperty("多维度评分")
private Double dimensionScore;
@ApiModelProperty(value = "作品封面是否必填 80:必填 默认; 40:非必填")
private Integer productCover;
public Double getDimensionScore() {
if (this.dimensionScore != null) {
this.dimensionScore = NumberUtils.toScaledBigDecimal(dimensionScore, 2, RoundingMode.HALF_UP).doubleValue();
}
return this.dimensionScore;
}
}
package com.yizhi.library.application.vo;
import com.baomidou.mybatisplus.annotations.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class StatisticStudentCaseVO {
private static final long serialVersionUID = 1L;
private Long id;
/**
*学员案例id
*/
@ApiModelProperty(value = "学员案例id")
private Long studentCaseId;
/**
* 标题
*/
@ApiModelProperty(value = "标题")
private String title;
/**
* 用户id
*/
@ApiModelProperty(value = "用户id")
private Long accountId;
/**
* 账号名称
*/
@ApiModelProperty(value = "账号名称")
private String accountName;
/**
* 姓名
*/
@ApiModelProperty(value = "姓名")
private String fullName;
/**
* 提交时间
*/
@ApiModelProperty(value = "提交时间")
private Date time;
/**
* 用户状态
*/
@ApiModelProperty(value = "用户状态")
@TableField("state")
private String state;
/**
* 获赞数
*/
@ApiModelProperty(value = "获赞数")
private Long upNum;
/**
* 举报数
*/
@ApiModelProperty(value = "举报数")
@TableField("inform_num")
private Long informNum;
/**
* 学习量
*/
@ApiModelProperty(value = "学习量")
private Long studyNum;
/**
* 企业id
*/
@ApiModelProperty(value = "企业id")
private Long companyId;
/**
* 站点id
*/
@ApiModelProperty(value = "站点id")
private Long siteId;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
private Long orgId;
@ApiModelProperty(value = "所属部门")
private String orgName;
@ApiModelProperty(value = "所在组织架构")
private String orgNames;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private Date createTime;
}
package com.yizhi.library.application.vo;
import com.baomidou.mybatisplus.annotations.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel(value = "StudentCaseAccountExportVO", description = "按用户统计学 员案例导出报表信息")
public class StudentCaseAccountExportVO {
private Long id;
/**
* 用户id
*/
@ApiModelProperty(value = "用户id")
@TableField("account_id")
private Long accountId;
/**
* 用户名
*/
@ApiModelProperty(value = "用户名")
@TableField("account_name")
private String accountName;
/**
* 姓名
*/
@ApiModelProperty(value = "姓名")
@TableField("full_name")
private String fullName;
/**
*职务
*/
@ApiModelProperty(value = "职务")
@TableField("position")
private String position;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
@TableField("org_id")
private Long orgId;
/**
* 部门名称
*/
@ApiModelProperty(value = "部门名称")
@TableField("org_name")
private String orgName;
/**
* 父部门/当前部门
*/
@ApiModelProperty(value = " 父部门/当前部门")
@TableField("org_names")
private String orgNames;
/**
* 必须提交数
*/
@ApiModelProperty(value = "必须提交数")
@TableField("must_submit_num")
private Long mustSubmitNum;
/**
* 实际提交数
*/
@ApiModelProperty(value = "实际提交数")
@TableField("submit_num")
private Long submitNum;
/**
* 精选案例数
*/
@ApiModelProperty(value = "精选案例数")
@TableField("case_num")
private Long caseNum;
/**
* 点赞数
*/
@ApiModelProperty(value = "点赞数")
@TableField("ups")
private Long ups;
/**
* 获赞数
*/
@ApiModelProperty(value = "获赞数")
@TableField("up_num")
private Long upNum;
/**
* 举报数
*/
@ApiModelProperty(value = "举报数")
@TableField("informs")
private Long informs;
/**
* 举报数
*/
@ApiModelProperty(value = "被举报数")
@TableField("inform_num")
private Long informNum;
/**
* 学习量
*/
@ApiModelProperty(value = "学习量")
@TableField("study_num")
private Long studyNum;
/**
* 用户状态
*/
@ApiModelProperty(value = "用户状态")
@TableField("status")
private String status;
/**
* 待审核数
*/
@ApiModelProperty(value = "待审核数")
@TableField("audit_num")
private Long auditNum;
/**
* 不通过数
*/
@ApiModelProperty(value = "不通过数")
@TableField("no_audit_num")
private Long noAuditNum;
/**
* 待评分数
*/
@ApiModelProperty(value = "待评分数")
@TableField("no_score_num")
private Long noScoreNum;
/**
* 已评分数
*/
@ApiModelProperty(value = "已评分数")
@TableField("score_num")
private Long scoreNum;
/**
*企业id
*/
@ApiModelProperty(value = "企业id")
@TableField("company_id")
private Long companyId;
/**
* 站点id
*/
@ApiModelProperty(value = "站点id")
@TableField("site_id")
private Long siteId;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
/**
* 需提交数
*/
@ApiModelProperty(value = "需提交数")
private Long needSubmitNum;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Ding
* @className StudentCaseAuthorizeVO
* @description TODO
* @date 2019/8/5
**/
@Data
@ApiModel(value = "StudentCaseAuthorize", description = "可见范围vo类")
public class StudentCaseAuthorizeVO {
@ApiModelProperty("用户姓名")
private String accountFullName;
@ApiModelProperty("工号")
private String workNum;
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "学员案例_ID,外键")
private Long studentCaseId;
@ApiModelProperty(value = "1:用户 、2:组织")
private Integer type;
@ApiModelProperty(value = "存放人或组织的ID")
private Long relationId;
@ApiModelProperty(value = "角色名称")
private String name;
@ApiModelProperty(value = "0删除 1有效,默认有效")
private Integer state;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "创建人ID")
private Long createById;
@ApiModelProperty(value = "创建人姓名")
private String createByName;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "修改人ID")
private Long updateById;
@ApiModelProperty(value = "修改人姓名")
private String updateByName;
}
package com.yizhi.library.application.vo;
import com.baomidou.mybatisplus.annotations.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author shengchenglong123
* @since 2020-08-05
*/
@Data
@ApiModel(value = "StudentCaseDimensionGradeRecord", description = "给学员进行维度打分")
public class StudentCaseDimensionGradeRecordVO {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "必传:维度id")
private Long caseLibraryDimensionGradeId;
@ApiModelProperty(value = "维度名称")
private String name;
@ApiModelProperty(value = "评分说明")
private String description;
@ApiModelProperty(value = "分值区间左值")
@TableField("min_score")
private Integer minScore;
@ApiModelProperty(value = "分值区间右值")
@TableField("max_score")
private Integer maxScore;
@ApiModelProperty(value = "必传:得分")
private Integer score;
}
package com.yizhi.library.application.vo;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "StudentCaseExportVO", description = "学员案例导出报表信息")
public class StudentCaseExportVO {
/**
* id
*/
@ApiModelProperty(value = "id")
private Long id;
/**
* 标题
*/
@ApiModelProperty(value = "标题")
private String title;
/**
* 用户id
*/
@ApiModelProperty(value = "用户id")
private Long accountId;
/**
* 用户名
*/
@ApiModelProperty(value = "用户名")
private String accountName;
/**
* 姓名
*/
@ApiModelProperty(value = "姓名")
private String fullName;
/**
* 提交时间
*/
@ApiModelProperty(value = "提交时间")
private Date time;
/**
* 状态
*/
@ApiModelProperty(value = "状态")
private String state;
/**
* 获赞数
*/
@ApiModelProperty(value = "获赞数")
private Long upNum;
/**
* 举报数
*/
@ApiModelProperty(value = "举报数")
private Long informNum;
/**
* 学习量
*/
@ApiModelProperty(value = "学习量")
private Long studyNum;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author Ding
* @className StudentCaseMangeListVO
* @description
* @date 2019/7/25
**/
@Data
@ApiModel(value = "StudentCaseMangeListVO",description = "学员案例管理列表vo")
public class StudentCaseManageListVO {
@ApiModelProperty(value = "学员案例id")
private Long studentCaseId;
@ApiModelProperty(value = "学员案例标题")
private String studentCaseTitle;
@ApiModelProperty(value = "案例活动id")
private Long caseLibraryId;
@ApiModelProperty(value = "案例活动名称")
private String caseLibraryName;
@ApiModelProperty(value = "作者id")
private Long accountId;
@ApiModelProperty(value = "作者用户名")
private String accountName;
@ApiModelProperty(value = "作者姓名")
private String accountFullName;
@ApiModelProperty(value = "作者所属部门id")
private Long orgId;
@ApiModelProperty(value = "作者所属部门")
private String orgName;
@ApiModelProperty(value = "提交时间")
private Date submitTime;
@ApiModelProperty(value = "审核时间")
private Date auditTime;
@ApiModelProperty(value = "审核人id")
private List<Long> auditorIds;
@ApiModelProperty(value = "审核人姓名(前端显示)")
private String auditorFullNames;
@ApiModelProperty(value = "评分人id")
private List<Long> scorerIds;
@ApiModelProperty(value = "得分人姓名(前端显示)")
private String scorerFullNames;
@ApiModelProperty(value = "举报记录id")
private Long informRecordId;
@ApiModelProperty(value = "举报人id")
private Long informerId;
@ApiModelProperty(value = "举报人姓名")
private String informerFullName;
@ApiModelProperty(value = "举报时间")
private Date informTime;
@ApiModelProperty(value = "第几条数据,上一条下一条需要")
private Integer number;
@ApiModelProperty(value = "举报内容")
private String informDescription;
@ApiModelProperty(value = "待审核记录数")
private Integer waitAuditNumber;
@ApiModelProperty(value = "待评分记录数")
private Integer waitScoreNumber;
@ApiModelProperty(value = "审核状态(内部逻辑处理使用)")
private Integer auditState;
@ApiModelProperty(value = "评分状态(内部逻辑处理使用)")
private Integer scoreState;
@ApiModelProperty(value = "案例状态(前端显示)")
private String state;
@ApiModelProperty(value = "操作状态 1:审核,评分 2:审核")
private Integer handleType;
@ApiModelProperty(value = "第几条数据(临时索引,审核,评分需要)")
private Integer Number;
@ApiModelProperty(value = "学员案例关联分类")
private List<StudentRelatedClassifyVO> relatedClassifyList;
private Integer scoreRule;
}
package com.yizhi.library.application.vo;
import com.baomidou.mybatisplus.annotations.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel(value = "StudentCaseOrgExportVO", description = "按部门统计学 员案例导出报表信息")
public class StudentCaseOrgExportVO {
private Long id;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
@TableField("org_id")
private Long orgId;
/**
* 部门名称
*/
@ApiModelProperty(value = "部门名称")
@TableField("org_name")
private String orgName;
/**
* 提交数
*/
@ApiModelProperty(value = "提交数")
@TableField("submit_num")
private Long submitNum;
/**
* 待审核数
*/
@ApiModelProperty(value = "待审核数")
@TableField("audit_num")
private Long auditNum;
/**
* 不通过数
*/
@ApiModelProperty(value = "不通过数")
@TableField("no_audit_num")
private Long noAuditNum;
/**
* 未评分数
*/
@ApiModelProperty(value = "未评分数")
@TableField("no_score_num")
private Long noScoreNum;
/**
* 已评分数
*/
@ApiModelProperty(value = "已评分数")
@TableField("score_num")
private Long scoreNum;
/**
* 精选案例数
*/
@ApiModelProperty(value = "精选案例数")
@TableField("case_num")
private Long caseNum;
/**
* 点赞数
*/
@ApiModelProperty(value = "点赞数")
@TableField("up_num")
private Long upNum;
/**
* 学习量
*/
@ApiModelProperty(value = "学习量")
@TableField("study_num")
private Long studyNum;
/**
* 企业id
*/
@ApiModelProperty(value = "企业id")
@TableField("company_id")
private Long companyId;
/**
* 站点id
*/
@ApiModelProperty(value = "站点id")
@TableField("site_id")
private Long siteId;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author Ding
* @className StudentCaseRecordListVO
* @description TODO
* @date 2019/7/10
**/
@Data
@ApiModel(value = "StudentCaseRecordListVO", description = "案例记录列表VO")
public class StudentCaseRecordListVO {
@ApiModelProperty(value = "案例活动名称")
private String caseLibraryName;
@ApiModelProperty(value = "案例活动要求")
private String explanation;
@ApiModelProperty(value = "学员案例记录列表")
List<StudentCaseRecordVO> studentCaseRecordList;
@ApiModelProperty("学员案例状态 0:已过期 1:待提交 2:待审核 3:(审核通过)待评分 4:(审核通过)已评分 5:审核不通过")
private Integer state;
@ApiModelProperty("案例活动状态 1:未过期 2:已过期")
private Integer caseLibraryState;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Ding
* @className StudentCaseRecordVO
* @description TODO
* @date 2019/7/10
**/
@Data
@ApiModel(value = "StudentCaseRecordVO", description = "案例记录VO")
public class StudentCaseRecordVO {
@ApiModelProperty(value = "学员案例id")
private Long studentCaseId;
@ApiModelProperty(value = "学员案例主题")
private String title;
@ApiModelProperty(value = "学员案例logourl")
private String logoUrl;
@ApiModelProperty(value = "最近修改时间")
private Date lastModifyTime;
@ApiModelProperty("案例活动开始时间")
private Date startTime;
@ApiModelProperty("案例活动截止时间")
private Date endTime;
@ApiModelProperty("学员案例状态 0:已过期 1:待提交 2:待审核 3:(审核通过)待评分 4:(审核通过)已评分 5:审核不通过")
private Integer state;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 学生案例关联分类表
* </p>
*
* @author dingxiaowei123
* @since 2019-07-09
*/
@Data
@ApiModel(value = "StudentCaseRelatedClassify", description = "学生案例关联分类表")
public class StudentCaseRelatedClassifyVO {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "学生案例id")
private Long studentCaseId;
@ApiModelProperty(value = "一级或者二级,分类id")
private Long classifyId;
@ApiModelProperty(value = "1:一级分类 2:二级分类")
private Integer level;
@ApiModelProperty(value = "父级分类id")
private Long classifyParentId;
@ApiModelProperty(value = "维度id")
private Long rootId;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
private Long companyId;
private Long siteId;
private Long orgId;
@ApiModelProperty(value = "0:删除,1:未删除")
private Integer state;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.math.NumberUtils;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
/**
* @author Ding
* @className StudentCaseStudyVO
* @description TODO
* @date 2019/7/11
**/
@Data
@ApiModel(value = "StudentCaseStudyVO", description = "学员案例学习/审核/评分VO")
public class StudentCaseStudyVO {
@ApiModelProperty(value = "学员案例id")
private Long studentCaseId;
@ApiModelProperty(value = "学员案例id")
private Long caseId;
@ApiModelProperty(value = "案例活动名称")
private String caseName;
@ApiModelProperty(value = "logourl")
private String logoUrl;
@ApiModelProperty(value = "学员案例主题")
private String title;
@ApiModelProperty(value = "作者id")
private Long authorId;
@ApiModelProperty(value = "作者用户名")
private String authorUserName;
@ApiModelProperty(value = "作者姓名")
private String authorName;
@ApiModelProperty(value = "部门名称")
private String orgName;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "提交时间")
private Date submitTime;
@ApiModelProperty(value = "举报时间")
private Date auditTime;
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "附件url")
private String accessoryUrl;
@ApiModelProperty(value = "附件list")
private List<AccessoryUrlVO> accessoryUrlList;
@ApiModelProperty(value = "审核状态 0:不通过 1:通过")
private Integer auditState;
@ApiModelProperty(value = "审核反馈内容")
private String auditEvaluate;
@ApiModelProperty(value = "评分")
private Integer score;
@ApiModelProperty(value = "评分状态")
private Integer scoreState;
@ApiModelProperty(value = "学员案例状态")
private Integer state;
@ApiModelProperty(value = "查询结果状态 0:学员案例已经删除")
private Integer resultState;
@ApiModelProperty(value = "点赞状态 0:未点赞 1:已点赞")
private Integer admireState;
@ApiModelProperty(value = "收藏状态 0:取消收藏 1:已收藏")
private Integer favoriteState;
@ApiModelProperty(value = "举报状态 0:未举报 1:已举报")
private Integer informState;
@ApiModelProperty(value = "举报时间")
private Date informTime;
@ApiModelProperty(value = "前一篇id(审核,评分需要)")
private Long prefixId;
@ApiModelProperty(value = "后一篇id(审核,评分需要)")
private Long suffixId;
private Integer scoreRule;
private Long caseLibraryId;
private List<InformVO> informVOList;
@ApiModelProperty("多维度评分")
private Double dimensionScore;
@ApiModelProperty("维度打分的维度vo列表")
private List<CaseLibraryDimensionGradeVO> caseLibraryDimensionGradeVOS;
@ApiModelProperty("是否显示打分:0否,1是")
private Integer showScore;
@ApiModelProperty(value = "评分说明")
private String caseLibraryDimensionGradeDescription;
@ApiModelProperty(value = "作品封面是否必填 80:必填 默认; 40:非必填")
private Integer productCover;
public Double getDimensionScore() {
if (this.dimensionScore != null) {
this.dimensionScore = NumberUtils.toScaledBigDecimal(dimensionScore, 2, RoundingMode.HALF_UP).doubleValue();
}
return this.dimensionScore;
}
}
package com.yizhi.library.application.vo;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.yizhi.library.application.enums.ProductCoverEnums;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author Ding
* @className StudentCaseVO
* @description TODO
* @date 2019/7/9
**/
@Data
@ApiModel(value = "StudentCase", description = "学生案例vo")
public class StudentCaseVO {
@ApiModelProperty(value = "案例活动主题")
private String caseLibraryName;
@ApiModelProperty(value = "案例要求")
private String explanation;
@ApiModelProperty(value = "案例库关联维度及下级分类列表")
private List<ClassifyListVO> classifyListVOList;
@ApiModelProperty(value = "结果状态 0:该活动已下架")
Integer resultState;
private Long id;
private String title;
@ApiModelProperty(value = "关联案列活动id")
@TableField("case_library_id")
private Long caseLibraryId;
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "学员案例封面url")
@TableField("logo_url")
private String logoUrl;
@ApiModelProperty("关键字")
@TableField("keywords")
private String keywords;
@ApiModelProperty("得分规则")
@TableField("score_rule")
private Integer scoreRule;
@ApiModelProperty(value = "文本提交类型 1:富文本编辑 2:附件上传")
@TableField("text_edit_type")
private Integer textEditType;
@ApiModelProperty(value = "学员案例内容")
private String content;
@ApiModelProperty(value = "学员案例内容")
@TableField("content_file_name")
private String contentFileName;
@ApiModelProperty(value = "外部文档上传阿里云url")
@TableField("pdf_oss_url")
private String pdfOssUrl;
@ApiModelProperty(value = "附件url")
@TableField("accessory_url")
private String accessoryUrl;
@ApiModelProperty(value = "评分状态 0:待评分 1:已评分")
@TableField("score_state")
private Integer scoreState;
@ApiModelProperty(value = "是否完成所有评分 0:未完成 1:已完成")
@TableField("is_finished_score")
private Integer isFinishedScore;
@ApiModelProperty(value = "得分")
private Integer score;
@ApiModelProperty(value = "学员端显示类型 1:通过后自动上架, 2:通过需要手动上架")
private Integer examine;
@ApiModelProperty(value = "举报状态 0:未举报 1:被举报")
@TableField("inform_state")
private Integer informState;
@ApiModelProperty(value = "审核状态0:待审核 1:审核通过 2:审核不通过")
@TableField("audit_state")
private Integer auditState;
@ApiModelProperty(value = "审核反馈")
@TableField("audit_evaluate")
private String auditEvaluate;
@ApiModelProperty(value = "审核人是否可修改分类 0:不可修改 1:可修改")
@TableField("auditor_authorize")
private Integer auditorAuthorize;
@ApiModelProperty(value = "可见范围类型 1:全平台可见 2:指定范围")
@TableField("visible_range")
private Integer visibleRange;
@ApiModelProperty(value = "0:删除,1:提交待审核,2:上架,3:下架,4草稿")
private Integer state;
@ApiModelProperty(value = "审核时间")
@TableField("audit_time")
private Date auditTime;
@ApiModelProperty(value = "提交时间")
@TableField("submit_time")
private Date submitTime;
@ApiModelProperty(value = "最近修改时间")
@TableField("last_modify_time")
private Date lastModifyTime;
@ApiModelProperty(value = "代提交人id")
@TableField("diplomatic_agent_id")
private Long diplomaticAgentId;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
@TableField("read_num")
private Long readNum;
@TableField("admire_num")
private Long admireNum;
@ApiModelProperty(value = "作品封面是否必填 80:必填 默认; 40:非必填")
private Integer productCover;
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.math.NumberUtils;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
/**
* @author Ding
* @className StudentCaseViewVO
* @description TODO
* @date 2019/7/10
**/
@Data
@ApiModel(value = "StudentCaseViewVO", description = "学生案例查看VO")
public class StudentCaseViewVO {
private Long id;
private String title;
@ApiModelProperty(value = "关联案列活动id")
private Long caseLibraryId;
@ApiModelProperty(value = "学员案例封面url")
private String logoUrl;
@ApiModelProperty("关键字")
private String keywords;
@ApiModelProperty(value = "文本提交类型 1:富文本编辑 2:附件上传")
private Integer textEditType;
@ApiModelProperty(value = "学员案例内容")
private String content;
@ApiModelProperty(value = "学员案例内容")
private String contentFileName;
@ApiModelProperty(value = "外部文档上传阿里云url")
private String pdfOssUrl;
@ApiModelProperty(value = "附件url")
private String accessoryUrl;
@ApiModelProperty(value = "评分状态 0:待评分 1:已评分")
private Integer scoreState;
@ApiModelProperty(value = "是否完成所有评分 0:未完成 1:已完成")
private Integer isFinishedScore;
@ApiModelProperty(value = "得分")
private Integer score;
@ApiModelProperty(value = "学员端显示类型 1:通过后自动上架, 2:通过需要手动上架")
private Integer examine;
@ApiModelProperty(value = "举报状态 0:未举报 1:被举报")
private Integer informState;
@ApiModelProperty(value = "审核状态0:待审核 1:审核通过 2:审核不通过")
private Integer auditState;
@ApiModelProperty(value = "审核反馈")
private String auditEvaluate;
@ApiModelProperty(value = "审核人是否可修改分类 0:不可修改 1:可修改")
private Integer auditorAuthorize;
@ApiModelProperty(value = "可见范围类型 1:全平台可见 2:指定范围")
private Integer visibleRange;
@ApiModelProperty(value = "0:删除,1:提交待审核,2:上架,3:下架,4草稿")
private Integer state;
@ApiModelProperty(value = "审核时间")
private Date auditTime;
@ApiModelProperty(value = "提交时间")
private Date submitTime;
@ApiModelProperty(value = "最近修改时间")
private Date lastModifyTime;
@ApiModelProperty(value = "代提交人id")
private Long diplomaticAgentId;
private Long createById;
private String createByName;
private Date createTime;
private Long updateById;
private String updateByName;
private Date updateTime;
private Long companyId;
private Long siteId;
private Long orgId;
private Long readNum;
private Long admireNum;
@ApiModelProperty(value = "案例活动主题")
private String caseLibraryName;
@ApiModelProperty(value = "案例要求")
private String explanation;
@ApiModelProperty(value = "附件list")
private List<AccessoryUrlVO> accessoryUrlList;
@ApiModelProperty(value = "案例库关联维度及下级分类列表以及选中的分类")
private List<ClassifyListVO> classifyListVOList;
@ApiModelProperty(value = "学员案例已选择的分类列表")
private List<StudentRelatedClassifyVO> selectedList;
@ApiModelProperty("关键字数组")
private List<String> keywordsList;
@ApiModelProperty(value = "pdf图片")
private List<PdfPages> pdfPages;
@ApiModelProperty("得分规则 1:平均分 2:最高分 3:任意一人得分 4:多维度打分。只有在4的时候,需要单独处理,否则原来逻辑不动")
private Integer scoreRule;
private Long accountId;
@ApiModelProperty("维度打分的维度vo列表")
private List<CaseLibraryDimensionGradeVO> caseLibraryDimensionGradeVOS;
@ApiModelProperty("是否显示打分:0否,1是")
private Integer showScore;
@ApiModelProperty(value = "评分说明")
private String caseLibraryDimensionGradeDescription;
@ApiModelProperty("多维度评分")
private Double dimensionScore;
@ApiModelProperty(value = "作品封面是否必填 80:必填 默认; 40:非必填")
private Integer productCover;
public Double getDimensionScore() {
if (this.dimensionScore != null) {
this.dimensionScore = NumberUtils.toScaledBigDecimal(dimensionScore, 2, RoundingMode.HALF_UP).doubleValue();
}
return this.dimensionScore;
}
}
package com.yizhi.library.application.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Ding
* @className StudentRelatedClassifyVO
* @description TODO
* @date 2019/8/5
**/
@Data
@ApiModel(value = "StudentRelatedClassifyVO", description = "学员案例关联分类VO")
public class StudentRelatedClassifyVO {
private Long id;
@ApiModelProperty(value = "学生案例id")
private Long studentCaseId;
@ApiModelProperty(value = "一级或者二级,分类id")
private Long classifyId;
@ApiModelProperty(value = "一级或者二级,分类名称")
private String classifyName;
@ApiModelProperty(value = "1:一级分类 2:二级分类")
private Integer level;
@ApiModelProperty(value = "父级分类id")
private Long classifyParentId;
@ApiModelProperty("父级分类名称")
private String classifyParentName;
@ApiModelProperty(value = "维度id")
private Long rootId;
@ApiModelProperty(value = "维度名称")
private String rootName;
}
package com.fulan.caselibrary;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>caselibrary</artifactId>
<groupId>com.yizhi</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>library</artifactId>
<packaging>jar</packaging>
<name>library</name>
<dependencies>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>library-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-orm</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-orm</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-system-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-system-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-comment-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-training-project-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-point-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yizhi</groupId>
<artifactId>cloud-orm</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- deploy 时跳过该模块 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.yizhi.library.application;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
/**
* @author Ding
* @className CaseLibraryApplication
* @description TODO
* @date 2019/7/1
**/
@SpringBootApplication
@EnableDiscoveryClient
@EnableCaching
@EnableFeignClients(basePackages = {"com.yizhi"})
@ComponentScan(basePackages = {"com.yizhi"})
public class CaseLibraryApplication {
public static void main(String[] args) {
SpringApplication.run(CaseLibraryApplication.class, args);
}
}
package com.yizhi.library.application.asynchronousTask;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.constant.FileConstant;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.core.application.file.util.OssUpload;
import com.yizhi.library.application.param.ExportAuditListParam;
import com.yizhi.library.application.util.Util;
import com.yizhi.library.application.vo.StudentCaseManageListVO;
import com.yizhi.library.application.service.IStudentCaseService;
import com.yizhi.system.application.system.remote.OrganizationClient;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className ExportAuditList
* @description 导出待审核案例
* @date 2019/7/29
**/
@Component
public class ExportAuditList extends AbstractDefaultTask<Map, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(ExportAuditList.class);
@Autowired
private IStudentCaseService studentCaseService;
@Autowired
private OrganizationClient organizationClient;
@Autowired
private Util util;
@Override
protected Map execute(Map<String, Object> map) {
//从map中取信息
RequestContext res = (RequestContext) map.get("res");
String serialNo = (String) map.get("serialNo");
String taskName = (String) map.get("taskName");
Long taskId = (Long) map.get("taskId");
ExportAuditListParam param = (ExportAuditListParam) map.get("param");
//开始异步任务
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName,
res.getAccountId(), new Date(), res.getSiteId(), res.getCompanyId());
working(taskContext);
List<StudentCaseManageListVO> list = null;
//获取导出数据
try {
list = studentCaseService.exportAuditList(param.getStudentCaseIds(), res);
if (CollectionUtils.isEmpty(list)) {
success(taskContext, "未找到数据", "");
}
} catch (Exception e) {
LOGGER.error("获取数据过程中出现错误", e);
fail(taskContext, "获取数据过程中出现错误");
}
//生成excel,上传阿里云返回url
try {
//获取案例活动及项目活动名称
Map<String, Object> map1 = util.getCaseLibraryAndProjectName(null, param.getStudentCaseIds().get(0));
String caseLibraryName = (String) map1.get("caseLibraryName");
String trainingProjectName = (String) map1.get("trainingProjectName");
//创建excel文件
XSSFWorkbook wb = new XSSFWorkbook();
//创建报表页
XSSFSheet sheet = wb.createSheet("待审核案例列表");
//创建表头
XSSFRow row = sheet.createRow(0);
//设置格式(水平垂直居中,加粗,字体大小14号)
XSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER);
XSSFFont font = wb.createFont();
font.setBold(true);
font.setFontHeightInPoints((short) 14);
style.setFont(font);
CellRangeAddress cra = new CellRangeAddress(0, 0, 0, 7);
//表头合并单元格
sheet.addMergedRegion(cra);
XSSFCell cell = row.createCell(0);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
//填写表头名
cell.setCellValue(caseLibraryName + "案例活动统计");
//表头居中
cell.setCellStyle(style);
cra = new CellRangeAddress(1, 1, 0, 7);
//第二行合并单元格合并单元格
sheet.addMergedRegion(cra);
row = sheet.createRow(1);
row.createCell(0).setCellValue("所属项目: " + trainingProjectName);
row = sheet.createRow(2);
//重新设置格式(只加粗)
style = wb.createCellStyle();
font = wb.createFont();
font.setBold(true);
style.setFont(font);
cell = row.createCell(0);
cell.setCellStyle(style);
cell.setCellValue("案例ID");
cell = row.createCell(1);
cell.setCellStyle(style);
cell.setCellValue("案例标题");
cell = row.createCell(2);
cell.setCellStyle(style);
cell.setCellValue("用户名");
cell = row.createCell(3);
cell.setCellStyle(style);
cell.setCellValue("姓名");
cell = row.createCell(4);
cell.setCellStyle(style);
cell.setCellValue("所在部门");
cell = row.createCell(5);
cell.setCellStyle(style);
cell.setCellValue("提交时间");
cell = row.createCell(6);
cell.setCellStyle(style);
cell.setCellValue("审核人");
cell = row.createCell(7);
style = wb.createCellStyle();
font = wb.createFont();
font.setBold(true);
font.setColor(Font.COLOR_RED);
style.setFont(font);
cell.setCellStyle(style);
cell.setCellValue("审核结果");
//组装数据
if (CollectionUtils.isNotEmpty(list)) {
for (int i = 0; i < list.size(); i++) {
StudentCaseManageListVO listVO = list.get(i);
row = sheet.createRow(i + 3);
row.createCell(0).setCellValue(listVO.getStudentCaseId().toString());
row.createCell(1).setCellValue(listVO.getStudentCaseTitle());
row.createCell(2).setCellValue(listVO.getAccountName());
row.createCell(3).setCellValue(listVO.getAccountFullName() == null ?
"--" : listVO.getAccountFullName());
//获取部门及所有父级部门名称
List<String> orgNames = organizationClient.getChiefOrgNames(listVO.getOrgId(), res.getCompanyId());
if (CollectionUtils.isNotEmpty(orgNames)) {
row.createCell(4).setCellValue(Util.orgNamesToString(orgNames));
} else {
row.createCell(4).setCellValue("--");
}
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/dd HH:mm:ss");
row.createCell(5).setCellValue(sdf1.format(listVO.getSubmitTime()));
//审核人,评分人如果有多个则用逗号隔开
if (StringUtils.isNotBlank(listVO.getAuditorFullNames())) {
row.createCell(6).setCellValue(listVO.getAuditorFullNames());
} else {
row.createCell(6).setCellValue("--");
}
}
}
String fileName = caseLibraryName + "待审核案例列表" + sdf.format(new Date()) + ".xlsx";
// String requestPath = "/Users/dingxiaowei/aaa";
String requestPath = FileConstant.SAVE_PATH;
File fileDir = new File(requestPath);
if (!fileDir.exists()) {
fileDir.mkdir();
}
String path = requestPath + "/" + fileName;
FileOutputStream os = null;
File file = null;
try {
os = new FileOutputStream(path);
wb.write(os);
//阿里云返回url
String uploadUrl = OssUpload.upload(path, fileName);
file = new File(path);
success(taskContext, "成功导出" + list.size() + "条记录", uploadUrl);
} catch (Exception e2) {
e2.printStackTrace();
fail(taskContext, "导出待审核案例写入过程中发生错误");
LOGGER.error("导出待审核案例写入过程中发生错误");
} finally {
if (os != null) {
os.close();
}
if (wb != null) {
wb.close();
}
if (file != null) {
file.delete();
}
}
} catch (Exception e) {
e.printStackTrace();
fail(taskContext, "导出待审核案例下载发生错误");
LOGGER.error("导出待审核案例下载发生错误,请查看日志");
}
return null;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.baomidou.mybatisplus.toolkit.CollectionUtils;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.constant.FileConstant;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.core.application.file.util.OssUpload;
import com.yizhi.library.application.domain.StudentCase;
import com.yizhi.library.application.vo.CommentVO;
import com.yizhi.library.application.service.ICommentService;
import com.yizhi.library.application.service.IStudentCaseService;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className ExportCommentList
* @description TODO
* @date 2019/7/16
**/
@Component
public class ExportCommentList extends AbstractDefaultTask<Map, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(ExportCommentList.class);
@Autowired
private ICommentService commentService;
@Autowired
private IStudentCaseService studentCaseService;
@Override
protected Map execute(Map<String, Object> map) {
//从map中取信息
RequestContext res = (RequestContext) map.get("res");
String serialNo = (String) map.get("serialNo");
String taskName = (String) map.get("taskName");
Long taskId = (Long) map.get("taskId");
Long studentCaseId = (Long) map.get("studentCaseId");
Integer state = (Integer) map.get("state");
String name = (String) map.get("name");
//开始异步任务
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName,
res.getAccountId(), new Date(), res.getSiteId(), res.getCompanyId());
working(taskContext);
List<CommentVO> commentVOList = new ArrayList<>();
StudentCase studentCase = null;
//获取导出数据
try {
studentCase = studentCaseService.selectById(studentCaseId);
commentVOList = commentService.downloadList(res, studentCaseId, name, state);
} catch (Exception e) {
LOGGER.error("获取数据过程中出现错误", e);
fail(taskContext, "获取数据过程中出现错误");
}
//生成excel,上传阿里云返回url
try {
if (null == studentCase || CollectionUtils.isEmpty(commentVOList)) {
success(taskContext, "未找到数据", "");
}
//创建excel文件
XSSFWorkbook wb = new XSSFWorkbook();
//创建报表页
XSSFSheet sheet = wb.createSheet("案例评论记录导出");
//创建表头
XSSFRow row = sheet.createRow(0);
XSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER);
CellRangeAddress cra = new CellRangeAddress(0, 0, 0, 6);
//表头合并单元格
sheet.addMergedRegion(cra);
XSSFCell cell = row.createCell(0);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
//填写表头名
cell.setCellValue(studentCase.getTitle() + "案例评论记录" + sdf.format(new Date()));
//表头居中
cell.setCellStyle(style);
row = sheet.createRow(1);
row.createCell(0).setCellValue("评论/回复人");
row.createCell(1).setCellValue("姓名");
row.createCell(2).setCellValue("评论对象");
row.createCell(3).setCellValue("评论内容");
row.createCell(4).setCellValue("提交时间");
row.createCell(5).setCellValue("点赞数");
row.createCell(6).setCellValue("状态");
if (CollectionUtils.isNotEmpty(commentVOList)) {
for (int i = 0; i < commentVOList.size(); i++) {
CommentVO commentVO = commentVOList.get(i);
row = sheet.createRow(i + 2);
row.createCell(0).setCellValue(commentVO.getCommenterUserName());
row.createCell(1).setCellValue(commentVO.getCommenterFullName());
row.createCell(2).setCellValue(commentVO.getReplyAccountFullName() == null ?
"--" : commentVO.getReplyAccountFullName());
row.createCell(3).setCellValue(commentVO.getContent());
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/dd HH:mm:ss");
row.createCell(4).setCellValue(sdf1.format(commentVO.getCreateTime()));
row.createCell(5).setCellValue(commentVO.getAdmireNum() == null ? "--" : commentVO.getAdmireNum().toString());
row.createCell(6).setCellValue(commentVO.getState() == 1 ? "已上架" : "已下架");
}
}
String fileName = "案例评论记录" + sdf.format(new Date()) + ".xlsx";
// String requestPath = "/Users/dingxiaowei/aaa";
String requestPath = FileConstant.SAVE_PATH;
File fileDir = new File(requestPath);
if (!fileDir.exists()) {
fileDir.mkdir();
}
String path = requestPath + "/" + fileName;
FileOutputStream os = null;
File file = null;
try {
os = new FileOutputStream(path);
wb.write(os);
//阿里云返回url
String uploadUrl = OssUpload.upload(path, fileName);
file = new File(path);
success(taskContext, "成功导出" + commentVOList.size() + "条记录", uploadUrl);
} catch (Exception e2) {
e2.printStackTrace();
fail(taskContext, "案例评论记录写入过程中发生错误");
LOGGER.error("案例评论记录写入过程中发生错误");
} finally {
if (os != null) {
os.close();
}
if (wb != null) {
wb.close();
}
if (file != null) {
file.delete();
}
}
} catch (Exception e) {
e.printStackTrace();
fail(taskContext, "案例评论记录下载发生错误");
LOGGER.error("案例评论记录下载发生错误,请查看日志");
}
return null;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.constant.FileConstant;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.core.application.file.util.OssUpload;
import com.yizhi.library.application.param.ExportAuditListParam;
import com.yizhi.library.application.util.Util;
import com.yizhi.library.application.vo.StudentCaseManageListVO;
import com.yizhi.library.application.mapper.CaseLibraryDimensionGradeMapper;
import com.yizhi.library.application.service.IStudentCaseService;
import com.yizhi.system.application.system.remote.OrganizationClient;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className ExportAuditList
* @description 导出待审核案例
* @date 2019/7/29
**/
@Component
public class ExportScoreList extends AbstractDefaultTask<Map, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(ExportScoreList.class);
@Autowired
private IStudentCaseService studentCaseService;
@Autowired
private OrganizationClient organizationClient;
@Autowired
private CaseLibraryDimensionGradeMapper caseLibraryDimensionGradeMapper;
@Autowired
private Util util;
@Override
protected Map execute(Map<String, Object> map) {
//从map中取信息
RequestContext res = (RequestContext) map.get("res");
String serialNo = (String) map.get("serialNo");
String taskName = (String) map.get("taskName");
Long taskId = (Long) map.get("taskId");
ExportAuditListParam param = (ExportAuditListParam) map.get("param");
//开始异步任务
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName,
res.getAccountId(), new Date(), res.getSiteId(), res.getCompanyId());
working(taskContext);
List<StudentCaseManageListVO> list = null;
//获取导出数据
try {
list = studentCaseService.exportScoreList(param.getStudentCaseIds(), res);
if (CollectionUtils.isEmpty(list)) {
success(taskContext, "未找到数据", "");
}
} catch (Exception e) {
LOGGER.error("获取数据过程中出现错误", e);
fail(taskContext, "获取数据过程中出现错误");
}
//生成excel,上传阿里云返回url
try {
//获取案例活动及项目活动名称
Map<String, Object> map1 = util.getCaseLibraryAndProjectName(null, param.getStudentCaseIds().get(0));
String caseLibraryName = (String) map1.get("caseLibraryName");
String trainingProjectName = (String) map1.get("trainingProjectName");
//创建excel文件
XSSFWorkbook wb = new XSSFWorkbook();
//创建报表页
XSSFSheet sheet = wb.createSheet("待评分案例列表");
//创建表头
XSSFRow row = sheet.createRow(0);
//设置格式(水平垂直居中,加粗,字体大小14号)
XSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER);
XSSFFont font = wb.createFont();
font.setBold(true);
font.setFontHeightInPoints((short) 14);
style.setFont(font);
CellRangeAddress cra = new CellRangeAddress(0, 0, 0, 7);
//表头合并单元格
sheet.addMergedRegion(cra);
XSSFCell cell = row.createCell(0);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
//填写表头名
cell.setCellValue(caseLibraryName + "案例活动统计");
//表头居中
cell.setCellStyle(style);
cra = new CellRangeAddress(1, 1, 0, 7);
//第二行合并单元格合并单元格
sheet.addMergedRegion(cra);
row = sheet.createRow(1);
row.createCell(0).setCellValue("所属项目: " + trainingProjectName);
row = sheet.createRow(2);
//重新设置格式(只加粗)
style = wb.createCellStyle();
font = wb.createFont();
font.setBold(true);
style.setFont(font);
cell = row.createCell(0);
cell.setCellStyle(style);
cell.setCellValue("案例ID");
cell = row.createCell(1);
cell.setCellStyle(style);
cell.setCellValue("案例标题");
cell = row.createCell(2);
cell.setCellStyle(style);
cell.setCellValue("用户名");
cell = row.createCell(3);
cell.setCellStyle(style);
cell.setCellValue("姓名");
cell = row.createCell(4);
cell.setCellStyle(style);
cell.setCellValue("所在部门");
cell = row.createCell(5);
cell.setCellStyle(style);
cell.setCellValue("提交时间");
cell = row.createCell(6);
cell.setCellStyle(style);
cell.setCellValue("评分人");
cell = row.createCell(7);
style = wb.createCellStyle();
font = wb.createFont();
font.setBold(true);
font.setColor(Font.COLOR_RED);
style.setFont(font);
cell.setCellStyle(style);
cell.setCellValue("得分");
//组装数据
if (CollectionUtils.isNotEmpty(list)) {
for (int i = 0; i < list.size(); i++) {
StudentCaseManageListVO listVO = list.get(i);
row = sheet.createRow(i + 3);
row.createCell(0).setCellValue(listVO.getStudentCaseId().toString());
row.createCell(1).setCellValue(listVO.getStudentCaseTitle());
row.createCell(2).setCellValue(listVO.getAccountName());
row.createCell(3).setCellValue(listVO.getAccountFullName() == null ?
"--" : listVO.getAccountFullName());
//获取部门及所有父级部门名称
List<String> orgNames = organizationClient.getChiefOrgNames(listVO.getOrgId(), res.getCompanyId());
if (CollectionUtils.isNotEmpty(orgNames)) {
row.createCell(4).setCellValue(Util.orgNamesToString(orgNames));
} else {
row.createCell(4).setCellValue("--");
}
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/dd HH:mm:ss");
row.createCell(5).setCellValue(sdf1.format(listVO.getSubmitTime()));
//审核人,评分人如果有多个则用逗号隔开
if (StringUtils.isNotBlank(listVO.getScorerFullNames())) {
row.createCell(6).setCellValue(listVO.getScorerFullNames());
} else {
row.createCell(6).setCellValue("--");
}
}
}
String fileName = caseLibraryName + "待评分案例列表" + sdf.format(new Date()) + ".xlsx";
// String requestPath = "/Users/dingxiaowei/aaa";
String requestPath = FileConstant.SAVE_PATH;
File fileDir = new File(requestPath);
if (!fileDir.exists()) {
fileDir.mkdir();
}
String path = requestPath + "/" + fileName;
FileOutputStream os = null;
File file = null;
try {
os = new FileOutputStream(path);
wb.write(os);
//阿里云返回url
String uploadUrl = OssUpload.upload(path, fileName);
file = new File(path);
success(taskContext, "成功导出" + list.size() + "条记录", uploadUrl);
} catch (Exception e2) {
e2.printStackTrace();
fail(taskContext, "导出待评分案例写入过程中发生错误");
LOGGER.error("导出待评分案例写入过程中发生错误");
} finally {
if (os != null) {
os.close();
}
if (wb != null) {
wb.close();
}
if (file != null) {
file.delete();
}
}
} catch (Exception e) {
e.printStackTrace();
fail(taskContext, "导出待评分案例下载发生错误");
LOGGER.error("导出待评分案例下载发生错误,请查看日志");
}
return null;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.constant.FileConstant;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.core.application.file.util.OssUpload;
import com.yizhi.library.application.domain.CaseLibraryRelatedClassify;
import com.yizhi.library.application.util.Util;
import com.yizhi.library.application.vo.StudentCaseManageListVO;
import com.yizhi.library.application.vo.StudentRelatedClassifyVO;
import com.yizhi.library.application.service.IStudentCaseService;
import com.yizhi.system.application.system.remote.OrganizationClient;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className ExportStudentCaseManageList
* @description 审核评分管理列表下载报表
* @date 2019/7/29
**/
@Component
public class ExportStudentCaseManageList extends AbstractDefaultTask<Map, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(ExportStudentCaseManageList.class);
@Autowired
private IStudentCaseService studentCaseService;
@Autowired
private OrganizationClient organizationClient;
@Autowired
private Util util;
@Override
protected Map execute(Map<String, Object> map) {
//从map中取信息
RequestContext res = (RequestContext) map.get("res");
String serialNo = (String) map.get("serialNo");
String taskName = (String) map.get("taskName");
Long taskId = (Long) map.get("taskId");
Long caseLibraryId = (Long) map.get("caseLibraryId");
Integer state = (Integer) map.get("state");
String studentCaseName = (String) map.get("studentCaseName");
String accountName = (String) map.get("accountName");
//开始异步任务
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName,
res.getAccountId(), new Date(), res.getSiteId(), res.getCompanyId());
working(taskContext);
List<StudentCaseManageListVO> list = null;
//获取导出数据
try {
Integer pageNo = 1;
Integer pageSize = Integer.MAX_VALUE;
Page<StudentCaseManageListVO> page = studentCaseService.studentCaseManageList(caseLibraryId, studentCaseName, accountName,
state, null, pageNo, pageSize, res, 2);
if (null != page) {
list = page.getRecords();
}
if (CollectionUtils.isEmpty(list)) {
success(taskContext, "未找到数据", "");
}
} catch (Exception e) {
LOGGER.error("获取数据过程中出现错误", e);
fail(taskContext, "获取数据过程中出现错误");
}
//生成excel,上传阿里云返回url
try {
//获取案例活动及项目活动名称
Map<String, Object> map1 = util.getCaseLibraryAndProjectName(caseLibraryId, null);
String caseLibraryName = (String) map1.get("caseLibraryName");
String trainingProjectName = (String) map1.get("trainingProjectName");
List<CaseLibraryRelatedClassify> relatedClassifyList = (List<CaseLibraryRelatedClassify>) map1.get("relatedClassify");
//创建excel文件
XSSFWorkbook wb = new XSSFWorkbook();
//创建报表页
XSSFSheet sheet = wb.createSheet("案例活动统计");
//创建表头
XSSFRow row = sheet.createRow(0);
//设置格式(水平垂直居中,加粗,字体大小14号)
XSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER);
XSSFFont font = wb.createFont();
font.setBold(true);
font.setFontHeightInPoints((short) 14);
style.setFont(font);
Integer n = 0;
if (CollectionUtils.isNotEmpty(relatedClassifyList)) {
n = relatedClassifyList.size();
}
CellRangeAddress cra = new CellRangeAddress(0, 0, 0, 8 + n);
//表头合并单元格
sheet.addMergedRegion(cra);
XSSFCell cell = row.createCell(0);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
//填写表头名
cell.setCellValue(caseLibraryName + "案例活动统计");
//表头居中
cell.setCellStyle(style);
cra = new CellRangeAddress(1, 1, 0, 8 + n);
//第二行合并单元格合并单元格
sheet.addMergedRegion(cra);
row = sheet.createRow(1);
row.createCell(0).setCellValue("所属项目: " + trainingProjectName);
row = sheet.createRow(2);
//重新设置格式(只加粗)
style = wb.createCellStyle();
font = wb.createFont();
font.setBold(true);
style.setFont(font);
cell = row.createCell(0);
cell.setCellStyle(style);
cell.setCellValue("案例标题");
cell = row.createCell(1);
cell.setCellStyle(style);
cell.setCellValue("用户名");
cell = row.createCell(2);
cell.setCellStyle(style);
cell.setCellValue("姓名");
cell = row.createCell(3);
cell.setCellStyle(style);
cell.setCellValue("所在部门");
cell = row.createCell(4);
cell.setCellStyle(style);
cell.setCellValue("所在组织架构");
cell = row.createCell(5);
cell.setCellStyle(style);
cell.setCellValue("提交时间");
cell = row.createCell(6);
cell.setCellStyle(style);
cell.setCellValue("审核人");
cell = row.createCell(7);
cell.setCellStyle(style);
cell.setCellValue("评分人");
cell = row.createCell(8);
cell.setCellStyle(style);
cell.setCellValue("状态");
if (n > 0) {
for (int i = 0; i < n; i++) {
cell = row.createCell(9 + i);
cell.setCellStyle(style);
cell.setCellValue(relatedClassifyList.get(i).getClassifyName());
}
}
//组装数据
if (CollectionUtils.isNotEmpty(list)) {
for (int i = 0; i < list.size(); i++) {
StudentCaseManageListVO listVO = list.get(i);
row = sheet.createRow(i + 3);
row.createCell(0).setCellValue(listVO.getStudentCaseTitle());
row.createCell(1).setCellValue(listVO.getAccountName());
row.createCell(2).setCellValue(listVO.getAccountFullName() == null ?
"--" : listVO.getAccountFullName());
row.createCell(3).setCellValue(listVO.getOrgName() == null ?
"--" : listVO.getOrgName());
//获取部门及所有父级部门名称
List<String> orgNames = organizationClient.getChiefOrgNames(listVO.getOrgId(), res.getCompanyId());
if (CollectionUtils.isNotEmpty(orgNames)) {
row.createCell(4).setCellValue(Util.orgNamesToString(orgNames));
} else {
row.createCell(4).setCellValue("--");
}
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/dd HH:mm:ss");
row.createCell(5).setCellValue(sdf1.format(listVO.getSubmitTime()));
//审核人,评分人如果有多个则用逗号隔开
if (StringUtils.isNotBlank(listVO.getAuditorFullNames())) {
row.createCell(6).setCellValue(listVO.getAuditorFullNames());
} else {
row.createCell(6).setCellValue("--");
}
if (StringUtils.isNotBlank(listVO.getScorerFullNames())) {
row.createCell(7).setCellValue(listVO.getScorerFullNames());
} else {
row.createCell(7).setCellValue("--");
}
row.createCell(8).setCellValue(listVO.getState() == null ? "--" : listVO.getState());
if (n > 0) {
List<StudentRelatedClassifyVO> studentRelatedClassifyVOS = listVO.getRelatedClassifyList();
for (int j = 0; j < n; j++) {
CaseLibraryRelatedClassify caseLibraryRelatedClassify = relatedClassifyList.get(j);
Long rootId = caseLibraryRelatedClassify.getClassifyId();
String name = null;
if (null!=rootId){
if (CollectionUtils.isNotEmpty(studentRelatedClassifyVOS)){
for (StudentRelatedClassifyVO studentRelatedClassifyVO : studentRelatedClassifyVOS){
if (studentRelatedClassifyVO.getRootId().equals(rootId)){
name = studentRelatedClassifyVO.getClassifyName();
break;
}
}
}
}
row.createCell(9 + j).setCellValue(name==null?"--":name);
}
}
}
}
String fileName = caseLibraryName + "案例活动统计" + sdf.format(new Date()) + ".xlsx";
// String requestPath = "/Users/dingxiaowei/aaa";
String requestPath = FileConstant.SAVE_PATH;
File fileDir = new File(requestPath);
if (!fileDir.exists()) {
fileDir.mkdir();
}
String path = requestPath + "/" + fileName;
FileOutputStream os = null;
File file = null;
try {
os = new FileOutputStream(path);
wb.write(os);
//阿里云返回url
String uploadUrl = OssUpload.upload(path, fileName);
file = new File(path);
success(taskContext, "成功导出" + list.size() + "条记录", uploadUrl);
} catch (Exception e2) {
e2.printStackTrace();
fail(taskContext, "案例活动统计写入过程中发生错误");
LOGGER.error("案例活动统计写入过程中发生错误",e2);
} finally {
if (os != null) {
os.close();
}
if (wb != null) {
wb.close();
}
if (file != null) {
file.delete();
}
}
} catch (Exception e) {
e.printStackTrace();
fail(taskContext, "案例活动统计下载发生错误");
LOGGER.error("案例活动统计下载发生错误,请查看日志",e);
}
return null;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.library.application.domain.StudentCase;
import com.yizhi.library.application.mapper.StudentCaseMapper;
import com.yizhi.library.application.service.IStudentCaseService;
import com.yizhi.library.application.util.DownloadOssUrl;
import com.yizhi.library.application.util.Util;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className ImportAuditList
* @description 导入审核结果
* @date 2019/7/29
**/
@Component
public class ImportAuditList extends AbstractDefaultTask<Map, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(ImportAuditList.class);
@Autowired
private IStudentCaseService studentCaseService;
@Autowired
private StudentCaseMapper studentCaseMapper;
@Override
protected Map execute(Map<String, Object> map) {
RequestContext res = (RequestContext) map.get("res");
Long taskId = (Long) map.get("taskId");
String serialNo = (String) map.get("serialNo");
String taskName = (String) map.get("taskName");
String url = (String) map.get("url");
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName, res.getAccountId(), new Date(), res.getSiteId(), res.getCompanyId());
working(taskContext);
//解析url
Workbook workbook = DownloadOssUrl.getWorkBook(url);
if (null == workbook) {
LOGGER.error("创建workbook对象失败");
fail(taskContext, "创建workbook对象失败");
}
Sheet sheet = workbook.getSheetAt(0);
Row row;
Cell cell0;
Cell cell7;
int lastRowNum = sheet.getLastRowNum();
List<StudentCase> studentCaseList = new ArrayList<>();
Integer errNum = 0;
for (int i = 3; i <= lastRowNum; i++) {
row = sheet.getRow(i);
cell0 = row.getCell(0);
cell7 = row.getCell(7);
Long id = null;
Integer auditState = null;
String result = null;
if (null != cell0) {
id = Util.getLongFromCell(cell0);
}
if (null != cell7) {
result = Util.getStringFromCell(cell7);
}
if (null != id) {
if (null != result) {
if (result.equals("通过")) {
auditState = 1;
} else if (result.equals("不通过")) {
auditState = 2;
}
}
if (null != auditState) {
StudentCase studentCase = new StudentCase();
studentCase.setId(id);
studentCase.setAuditState(auditState);
studentCaseList.add(studentCase);
} else {
taskDetail(taskId, "第" + i + 1 + "行格式有误");
errNum++;
}
} else {
taskDetail(taskId, "第" + i + 1 + "行格式有误");
errNum++;
}
}
Date date = new Date();
//导入数据
if (CollectionUtils.isNotEmpty(studentCaseList)) {
//获取通过审核后上架规则
Map<String, Object> map1 = studentCaseMapper.getExamine(studentCaseList.get(0).getId());
Integer examine = (Integer) map1.get("examine");
for (StudentCase studentCase : studentCaseList) {
if (studentCase.getAuditState() == 1) {
if (examine == 1) {
studentCase.setState(2);
} else if (examine == 2) {
studentCase.setState(3);
}
studentCase.setScoreState(0);
} else if (studentCase.getAuditState() == 2) {
studentCase.setState(3);
}
studentCase.setAuditTime(date);
}
studentCaseService.updateBatchById(studentCaseList);
success(taskContext, "成功导入" + studentCaseList.size() + "条," + "失败" + errNum + "条", url);
} else {
success(taskContext, "成功导入0条", url);
}
return null;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.library.application.domain.Auditor;
import com.yizhi.library.application.util.DownloadOssUrl;
import com.yizhi.library.application.vo.ImportVO;
import com.yizhi.library.application.service.IAuditorService;
import com.yizhi.system.application.model.AccountNameForIdsModel;
import com.yizhi.system.application.system.remote.AccountClient;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
/**
* @author Ding
* @className ImportAuditor
* @description TODO
* @date 2019/7/8
**/
@Component
public class ImportAuditor extends AbstractDefaultTask<String, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(ImportAuditor.class);
@Autowired
private AccountClient accountClient;
@Autowired
private IAuditorService auditorService;
@Override
protected String execute(Map<String, Object> map) {
RequestContext res = (RequestContext) map.get("res");
Long taskId = (Long) map.get("taskId");
String serialNo = (String) map.get("serialNo");
String taskName = (String) map.get("taskName");
Long caseLibraryId = (Long) map.get("caseLibraryId");
String url = (String) map.get("url");
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName, res.getAccountId(), new Date(), res.getSiteId(), res.getCompanyId());
working(taskContext);
//解析url
Workbook workbook = DownloadOssUrl.getWorkBook(url);
if (null == workbook) {
LOGGER.error("创建workbook对象失败");
fail(taskContext, "创建workbook对象失败");
}
Sheet sheet = workbook.getSheetAt(0);
Row row;
Cell cell1;
Cell cell3;
int lastRowNum = sheet.getLastRowNum();
//需要获取用户id的name list
List<String> names = new ArrayList<>();
//需要获取用户id的name list带行数信息
List<ImportVO> importVOList = new ArrayList<>();
//格式有误的行数list
// List<Integer> errorRowList = new ArrayList<>();
//未查找到用户id的行数list
// List<Integer> noIdRowList = new ArrayList<>();
Integer errNum = 0;
for (int i = 2; i <= lastRowNum; i++) {
String auditorName = null;
String userName = null;
row = sheet.getRow(i);
if (null != row) {
//获取第一列
cell1 = row.getCell(0);
cell3 = row.getCell(2);
if (null != cell1 && null != cell3) {
//审核人用户名
if (cell1.getCellTypeEnum().equals(CellType.STRING)) {
auditorName = cell1.getStringCellValue();
} else if (cell1.getCellTypeEnum().equals(CellType.NUMERIC)) {
cell1.setCellType(CellType.STRING);
auditorName = cell1.getStringCellValue();
}
//被审核人用户名
if (cell3.getCellTypeEnum().equals(CellType.STRING)) {
userName = cell3.getStringCellValue();
} else if (cell3.getCellTypeEnum().equals(CellType.NUMERIC)) {
cell3.setCellType(CellType.STRING);
userName = cell3.getStringCellValue();
}
if (StringUtils.isNotBlank(auditorName) && StringUtils.isNotBlank(userName)) {
//审核人和被审核人都放入name list
if (!names.contains(auditorName.trim())) {
names.add(auditorName.trim().toLowerCase());
}
if (!names.contains(userName.trim())) {
names.add(userName.trim().toLowerCase());
}
ImportVO importVO = new ImportVO();
importVO.setRowNum(i + 1);
importVO.setName(auditorName.trim());
importVO.setAccountName(userName.trim());
importVOList.add(importVO);
} else {
//内容为空或者格式有误
// errorRowList.add(i + 1);
errNum++;
Integer rowNum = i + 1;
taskDetail(taskId, "第" + rowNum + "行用户名格式有误");
}
} else {
errNum++;
//内容为空
// errorRowList.add(i + 1);
Integer rowNum = i + 1;
taskDetail(taskId, "第" + rowNum + "行用户名格式有误");
}
}
}
Map<String, Long> nameIdMap = new HashMap<>();
//根据用户名找出对应存在的用户id
if (CollectionUtils.isNotEmpty(names)) {
AccountNameForIdsModel model = new AccountNameForIdsModel(names, res);
nameIdMap = accountClient.getAccountIdByNames(model, res.getCompanyId(), res.getSiteId(), "caseLibrary");
} else {
success(taskContext, "成功导入0条,未检索到用户", url);
}
//准备组装并导入的list
List<Auditor> auditorImportList = new ArrayList<>();
//查询到用户id,组装数据准备导入
if (null != nameIdMap && nameIdMap.size() > 0) {
for (ImportVO importVO : importVOList) {
Long auditorId = nameIdMap.get(importVO.getName().toLowerCase());
Long accountId = nameIdMap.get(importVO.getAccountName().toLowerCase());
if (null != auditorId && null != accountId) {
Auditor auditor = new Auditor();
auditor.setCaseLibraryId(caseLibraryId);
auditor.setAuditorId(auditorId);
auditor.setAccountId(accountId);
// mustSubmit.setState(1);
auditor.setCreateById(res.getAccountId());
auditor.setCreateByName(res.getAccountName());
auditor.setCreateTime(new Date());
auditor.setUpdateById(res.getAccountId());
auditor.setUpdateByName(res.getAccountName());
auditor.setUpdateTime(new Date());
auditorImportList.add(auditor);
} else {
// noIdRowList.add(importVO.getRowNum());
errNum++;
taskDetail(taskId, "第" + importVO.getRowNum() + "行未检索到用户");
}
}
if (CollectionUtils.isNotEmpty(auditorImportList)){
if (auditorService.insertList(auditorImportList)) {
success(taskContext, "成功导入" + auditorImportList.size() + "条" + "失败" + errNum + "条", url);
} else {
fail(taskContext, "导入失败,网络环境有误");
}
}else {
success(taskContext, "成功导入0条,未检索到审核人或者被审核人", url);
}
} else {
success(taskContext, "成功导入0条,未检索到审核人或者被审核人", url);
}
return null;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.library.application.domain.StudentCase;
import com.yizhi.library.application.service.IStudentCaseService;
import com.yizhi.library.application.util.DownloadOssUrl;
import com.yizhi.library.application.util.Util;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className ImportAuditList
* @description 导入审核结果
* @date 2019/7/29
**/
@Component
public class ImportScoreList extends AbstractDefaultTask<Map, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(ImportScoreList.class);
@Autowired
private IStudentCaseService studentCaseService;
@Override
protected Map execute(Map<String, Object> map) {
RequestContext res = (RequestContext) map.get("res");
Long taskId = (Long) map.get("taskId");
String serialNo = (String) map.get("serialNo");
String taskName = (String) map.get("taskName");
String url = (String) map.get("url");
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName, res.getAccountId(), new Date(), res.getSiteId(), res.getCompanyId());
working(taskContext);
//解析url
Workbook workbook = DownloadOssUrl.getWorkBook(url);
if (null == workbook) {
LOGGER.error("创建workbook对象失败");
fail(taskContext, "创建workbook对象失败");
}
Sheet sheet = workbook.getSheetAt(0);
Row row;
Cell cell0;
Cell cell7;
int lastRowNum = sheet.getLastRowNum();
List<StudentCase> studentCaseList = new ArrayList<>();
Integer errNum = 0;
for (int i = 3; i <= lastRowNum; i++) {
row = sheet.getRow(i);
cell0 = row.getCell(0);
cell7 = row.getCell(7);
Long id = null;
Integer result = null;
if (null != cell0) {
id = Util.getLongFromCell(cell0);
}
if (null != cell7) {
result = Util.getIntegerFromCell(cell7);
}
if (null != id) {
if (null != result) {
StudentCase studentCase = new StudentCase();
studentCase.setId(id);
studentCase.setScoreState(1);
//管理端评分后直接是完成所有评分状态
studentCase.setIsFinishedScore(1);
studentCase.setScore(result);
studentCaseList.add(studentCase);
} else {
taskDetail(taskId, "第" + i + 1 + "行格式有误");
errNum++;
}
} else {
taskDetail(taskId, "第" + i + 1 + "行格式有误");
errNum++;
}
}
//导入数据
if (CollectionUtils.isNotEmpty(studentCaseList)) {
studentCaseService.updateBatchById(studentCaseList);
success(taskContext, "成功导入" + studentCaseList.size() + "条," + "失败" + errNum + "条", url);
} else {
success(taskContext, "成功导入0条", url);
}
return null;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.library.application.domain.Scorer;
import com.yizhi.library.application.util.DownloadOssUrl;
import com.yizhi.library.application.vo.ImportVO;
import com.yizhi.library.application.service.IScorerService;
import com.yizhi.system.application.model.AccountNameForIdsModel;
import com.yizhi.system.application.system.remote.AccountClient;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
/**
* @author Ding
* @className ImportScorer
* @description TODO
* @date 2019/7/8
**/
@Component
public class ImportScorer extends AbstractDefaultTask<String, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(ImportAuditor.class);
@Autowired
private AccountClient accountClient;
@Autowired
private IScorerService scorerService;
@Override
protected String execute(Map<String, Object> map) {
RequestContext res = (RequestContext) map.get("res");
Long taskId = (Long) map.get("taskId");
String serialNo = (String) map.get("serialNo");
String taskName = (String) map.get("taskName");
Long caseLibraryId = (Long) map.get("caseLibraryId");
String url = (String) map.get("url");
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName, res.getAccountId(), new Date(), res.getSiteId(), res.getCompanyId());
working(taskContext);
//解析url
Workbook workbook = DownloadOssUrl.getWorkBook(url);
if (null == workbook) {
LOGGER.error("创建workbook对象失败");
fail(taskContext, "创建workbook对象失败");
}
Sheet sheet = workbook.getSheetAt(0);
Row row;
Cell cell1;
Cell cell3;
int lastRowNum = sheet.getLastRowNum();
//需要获取用户id的name list
List<String> names = new ArrayList<>();
//需要获取用户id的name list带行数信息
List<ImportVO> importVOList = new ArrayList<>();
Integer errNum = 0;
//格式有误的行数list
// List<Integer> errorRowList = new ArrayList<>();
//未查找到用户id的行数list
// List<Integer> noIdRowList = new ArrayList<>();
for (int i = 2; i <= lastRowNum; i++) {
String scorerName = null;
String userName = null;
row = sheet.getRow(i);
if (null != row) {
//获取第一列
cell1 = row.getCell(0);
cell3 = row.getCell(2);
if (null != cell1 && null != cell3) {
//审核人用户名
if (cell1.getCellTypeEnum().equals(CellType.STRING)) {
scorerName = cell1.getStringCellValue();
} else if (cell1.getCellTypeEnum().equals(CellType.NUMERIC)) {
cell1.setCellType(CellType.STRING);
scorerName = cell1.getStringCellValue();
}
//被审核人用户名
if (cell3.getCellTypeEnum().equals(CellType.STRING)) {
userName = cell3.getStringCellValue();
} else if (cell3.getCellTypeEnum().equals(CellType.NUMERIC)) {
cell3.setCellType(CellType.STRING);
userName = cell3.getStringCellValue();
}
if (StringUtils.isNotBlank(scorerName) && StringUtils.isNotBlank(userName)) {
//审核人和被审核人都放入name list
if (!names.contains(scorerName.trim())) {
names.add(scorerName.trim().toLowerCase());
}
if (!names.contains(userName.trim())) {
names.add(userName.trim().toLowerCase());
}
ImportVO importVO = new ImportVO();
importVO.setRowNum(i + 1);
importVO.setName(scorerName.trim());
importVO.setAccountName(userName.trim());
importVOList.add(importVO);
} else {
errNum++;
//内容为空或者格式有误
// errorRowList.add(i + 1);
Integer rowNum = i + 1;
taskDetail(taskId, "第" + rowNum + "行用户名格式有误");
}
} else {
errNum++;
//内容为空
// errorRowList.add(i + 1);
Integer rowNum = i + 1;
taskDetail(taskId, "第" + rowNum + "行用户名格式有误");
}
}
}
Map<String, Long> nameIdMap = new HashMap<>();
//根据用户名找出对应存在的用户id
if (CollectionUtils.isNotEmpty(names)) {
AccountNameForIdsModel model = new AccountNameForIdsModel(names, res);
nameIdMap = accountClient.getAccountIdByNames(model, res.getCompanyId(), res.getSiteId(), "caseLibrary");
} else {
success(taskContext, "成功导入0条,未检索到用户", url);
}
//准备组装并导入的list
List<Scorer> scorerImportList = new ArrayList<>();
//查询到用户id,组装数据准备导入
if (null != nameIdMap && nameIdMap.size() > 0) {
for (ImportVO importVO : importVOList) {
Long scorerId = nameIdMap.get(importVO.getName().toLowerCase());
Long accountId = nameIdMap.get(importVO.getAccountName().toLowerCase());
if (null != scorerId && null != accountId) {
Scorer scorer = new Scorer();
scorer.setCaseLibraryId(caseLibraryId);
scorer.setScorerId(scorerId);
scorer.setAccountId(accountId);
// mustSubmit.setState(1);
scorer.setCreateById(res.getAccountId());
scorer.setCreateByName(res.getAccountName());
scorer.setCreateTime(new Date());
scorer.setUpdateById(res.getAccountId());
scorer.setUpdateByName(res.getAccountName());
scorer.setUpdateTime(new Date());
scorerImportList.add(scorer);
} else {
errNum++;
taskDetail(taskId, "第" + importVO.getRowNum() + "行未检索到用户");
}
}
if (CollectionUtils.isNotEmpty(scorerImportList)) {
if (scorerService.insertList(scorerImportList)) {
success(taskContext, "成功导入" + scorerImportList.size() + "条" + "失败" + errNum + "条", url);
} else {
fail(taskContext, "导入失败,网络环境有误");
}
} else {
success(taskContext, "成功导入0条,未检索到评分人或者被评分人", url);
}
} else {
success(taskContext, "成功导入0条,未检索到评分人或者被评分人", url);
}
return null;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.library.application.domain.MustSubmit;
import com.yizhi.library.application.service.IMustSubmitService;
import com.yizhi.library.application.util.DownloadOssUrl;
import com.yizhi.library.application.vo.ImportVO;
import com.yizhi.system.application.model.AccountNameForIdsModel;
import com.yizhi.system.application.system.remote.AccountClient;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
/**
* @author Ding
* @className ImportSubmitter
* @description TODO
* @date 2019/7/8
**/
@Component
public class ImportSubmitter extends AbstractDefaultTask<String, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(ImportSubmitter.class);
@Autowired
private AccountClient accountClient;
@Autowired
private IMustSubmitService mustSubmitService;
@Override
protected String execute(Map<String, Object> map) {
RequestContext res = (RequestContext) map.get("res");
Long taskId = (Long) map.get("taskId");
String serialNo = (String) map.get("serialNo");
String taskName = (String) map.get("taskName");
Long caseLibraryId = (Long) map.get("caseLibraryId");
String url = (String) map.get("url");
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName, res.getAccountId(), new Date(), res.getSiteId(), res.getCompanyId());
working(taskContext);
//解析url
Workbook workbook = DownloadOssUrl.getWorkBook(url);
if (null == workbook) {
LOGGER.error("创建workbook对象失败");
fail(taskContext, "创建workbook对象失败");
}
Sheet sheet = workbook.getSheetAt(0);
Row row;
Cell cell;
int lastRowNum = sheet.getLastRowNum();
//需要获取用户id的name list
List<String> names = new ArrayList<>();
//需要获取用户id的name list带行数信息
List<ImportVO> importVOList = new ArrayList<>();
Integer errNum = 0;
//格式有误的行数list
// List<Integer> errorRowList = new ArrayList<>();
//未查找到用户id的行数list
// List<Integer> noIdRowList = new ArrayList<>();
for (int i = 2; i <= lastRowNum; i++) {
String userName = null;
row = sheet.getRow(i);
if (null != row) {
//获取第一列
cell = row.getCell(0);
if (null != cell) {
if (cell.getCellTypeEnum().equals(CellType.STRING)) {
userName = cell.getStringCellValue();
} else if (cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
cell.setCellType(CellType.STRING);
userName = cell.getStringCellValue();
}
if (StringUtils.isNotBlank(userName)) {
names.add(userName.trim().toLowerCase());
ImportVO importVO = new ImportVO();
importVO.setRowNum(i + 1);
importVO.setName(userName.trim());
importVOList.add(importVO);
} else {
errNum++;
//内容为空或者格式有误
// errorRowList.add(i + 1);
Integer rowNum = i + 1;
taskDetail(taskId, "第" + rowNum + "行用户名格式有误");
}
}
}
}
Map<String, Long> nameIdMap = new HashMap<>();
//根据用户名找出对应存在的用户id
if (CollectionUtils.isNotEmpty(names)) {
AccountNameForIdsModel model = new AccountNameForIdsModel(names, res);
nameIdMap = accountClient.getAccountIdByNames(model, res.getCompanyId(), res.getSiteId(), "caseLibrary");
} else {
success(taskContext, "成功导入0条,未检索到用户", url);
}
//准备组装并导入的list
List<MustSubmit> mustSubmitList = new ArrayList<>();
//查询到用户id,组装数据准备导入
if (null != nameIdMap && nameIdMap.size() > 0) {
for (ImportVO importVO : importVOList) {
Long accountId = nameIdMap.get(importVO.getName().toLowerCase());
if (null != accountId) {
MustSubmit mustSubmit = new MustSubmit();
mustSubmit.setCaseLibraryId(caseLibraryId);
mustSubmit.setAccountId(accountId);
// mustSubmit.setState(1);
mustSubmit.setCreateById(res.getAccountId());
mustSubmit.setCreateByName(res.getAccountName());
mustSubmit.setCreateTime(new Date());
mustSubmit.setUpdateById(res.getAccountId());
mustSubmit.setUpdateByName(res.getAccountName());
mustSubmit.setUpdateTime(new Date());
mustSubmit.setCompanyId(res.getCompanyId());
mustSubmit.setSiteId(res.getSiteId());
mustSubmit.setOrgId(res.getOrgId());
mustSubmitList.add(mustSubmit);
} else {
errNum++;
taskDetail(taskId, "第" + importVO.getRowNum() + "行未检索到用户");
}
}
if (CollectionUtils.isNotEmpty(mustSubmitList)) {
if (mustSubmitService.insertList(mustSubmitList)) {
success(taskContext, "成功导入" + mustSubmitList.size() + "条" + "失败" + errNum + "条", url);
} else {
fail(taskContext, "导入失败,网络环境有误");
}
} else {
success(taskContext, "成功导入0条,未检索到用户", url);
}
} else {
success(taskContext, "成功导入0条,未检索到用户", url);
}
return null;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.constant.FileConstant;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.core.application.file.util.OssUpload;
import com.yizhi.library.application.service.IStudentCaseService;
import com.yizhi.library.application.vo.StudentCaseManageListVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className InformListExport
* @description TODO
* @date 2019/7/31
**/
@Component
public class InformListExport extends AbstractDefaultTask<Map, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(InformListExport.class);
@Autowired
private IStudentCaseService studentCaseService;
@Override
protected Map execute(Map<String, Object> map) {
//从map中取信息
RequestContext res = (RequestContext) map.get("res");
String serialNo = (String) map.get("serialNo");
String taskName = (String) map.get("taskName");
Long taskId = (Long) map.get("taskId");
String studentCaseName = (String) map.get("studentCaseName");
String accountName = (String) map.get("accountName");
//开始异步任务
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName,
res.getAccountId(), new Date(), res.getSiteId(), res.getCompanyId());
working(taskContext);
List<StudentCaseManageListVO> list = null;
//获取导出数据
try {
list = studentCaseService.getInformExportList(studentCaseName, accountName, res);
if (CollectionUtils.isEmpty(list)) {
success(taskContext, "未找到数据", "");
}
} catch (Exception e) {
LOGGER.error("获取数据过程中出现错误", e);
fail(taskContext, "获取数据过程中出现错误");
}
//生成excel,上传阿里云返回url
try {
//创建excel文件
XSSFWorkbook wb = new XSSFWorkbook();
//创建报表页
XSSFSheet sheet = wb.createSheet("案例举报统计");
//创建表头
XSSFRow row = sheet.createRow(0);
//设置格式(水平垂直居中,加粗,字体大小14号)
XSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER);
XSSFFont font = wb.createFont();
font.setBold(true);
font.setFontHeightInPoints((short) 14);
style.setFont(font);
CellRangeAddress cra = new CellRangeAddress(0, 0, 0, 9);
//表头合并单元格
sheet.addMergedRegion(cra);
XSSFCell cell = row.createCell(0);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
//填写表头名
cell.setCellValue("案例举报统计" + sdf.format(date));
//表头居中
cell.setCellStyle(style);
row = sheet.createRow(1);
//重新设置格式(只加粗)
style = wb.createCellStyle();
font = wb.createFont();
font.setBold(true);
style.setFont(font);
cell = row.createCell(0);
cell.setCellStyle(style);
cell.setCellValue("案例标题");
cell = row.createCell(1);
cell.setCellStyle(style);
cell.setCellValue("所属案例活动");
cell = row.createCell(2);
cell.setCellStyle(style);
cell.setCellValue("用户名");
cell = row.createCell(3);
cell.setCellStyle(style);
cell.setCellValue("姓名");
cell = row.createCell(4);
cell.setCellStyle(style);
cell.setCellValue("提交时间");
cell = row.createCell(5);
cell.setCellStyle(style);
cell.setCellValue("审核人");
cell = row.createCell(6);
cell.setCellStyle(style);
cell.setCellValue("评分人");
cell = row.createCell(7);
cell.setCellStyle(style);
cell.setCellValue("举报人");
cell = row.createCell(8);
cell.setCellStyle(style);
cell.setCellValue("举报时间");
cell = row.createCell(9);
cell.setCellStyle(style);
cell.setCellValue("举报内容");
//组装数据
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(list)) {
for (int i = 0; i < list.size(); i++) {
StudentCaseManageListVO listVO = list.get(i);
row = sheet.createRow(i + 2);
row.createCell(0).setCellValue(listVO.getStudentCaseTitle());
row.createCell(1).setCellValue(listVO.getCaseLibraryName());
row.createCell(2).setCellValue(listVO.getAccountName());
row.createCell(3).setCellValue(listVO.getAccountFullName() == null ?
"--" : listVO.getAccountFullName());
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/dd HH:mm:ss");
row.createCell(4).setCellValue(sdf1.format(listVO.getSubmitTime()));
if (StringUtils.isNotBlank(listVO.getAuditorFullNames())){
row.createCell(5).setCellValue(listVO.getAuditorFullNames());
}else {
row.createCell(5).setCellValue("--");
}
if (StringUtils.isNotBlank(listVO.getScorerFullNames())){
row.createCell(6).setCellValue(listVO.getScorerFullNames());
}else {
row.createCell(6).setCellValue("--");
}
row.createCell(7).setCellValue(listVO.getInformerFullName() == null ? "--" : listVO.getInformerFullName());
row.createCell(8).setCellValue(sdf1.format(listVO.getInformTime()));
row.createCell(9).setCellValue(listVO.getInformDescription());
}
}
String fileName = "精选案例记录导出" + sdf.format(new Date()) + ".xlsx";
// String requestPath = "/Users/dingxiaowei/aaa";
String requestPath = FileConstant.SAVE_PATH;
File fileDir = new File(requestPath);
if (!fileDir.exists()) {
fileDir.mkdir();
}
String path = requestPath + "/" + fileName;
FileOutputStream os = null;
File file = null;
try {
os = new FileOutputStream(path);
wb.write(os);
//阿里云返回url
String uploadUrl = OssUpload.upload(path, fileName);
file = new File(path);
success(taskContext, "成功导出" + list.size() + "条记录", uploadUrl);
} catch (Exception e2) {
e2.printStackTrace();
fail(taskContext, "精选案例记录导出写入过程中发生错误");
LOGGER.error("精选案例记录导出写入过程中发生错误");
} finally {
if (os != null) {
os.close();
}
if (wb != null) {
wb.close();
}
if (file != null) {
file.delete();
}
}
} catch (Exception e) {
e.printStackTrace();
fail(taskContext, "精选案例记录导出下载发生错误");
LOGGER.error("精选案例记录导出下载发生错误,请查看日志");
}
return null;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.constant.FileConstant;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.core.application.file.util.OssUpload;
import com.yizhi.library.application.domain.CaseLibraryDimensionGrade;
import com.yizhi.library.application.mapper.CaseLibraryDimensionGradeMapper;
import com.yizhi.library.application.mapper.StudentCaseDimensionGradeRecordMapper;
import com.yizhi.library.application.service.IStudentCaseService;
import com.yizhi.library.application.vo.SelectionCaseListVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileOutputStream;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className SelectionListExport
* @description 精选案例管理列表下载报表
* @date 2019/7/30
**/
@Component
public class SelectionListExport extends AbstractDefaultTask<Map, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(SelectionListExport.class);
@Autowired
private IStudentCaseService studentCaseService;
@Autowired
private CaseLibraryDimensionGradeMapper caseLibraryDimensionGradeMapper;
@Autowired
private StudentCaseDimensionGradeRecordMapper studentCaseDimensionGradeRecordMapper;
@Override
protected Map execute(Map<String, Object> map) {
//从map中取信息
RequestContext res = (RequestContext) map.get("res");
String serialNo = (String) map.get("serialNo");
String taskName = (String) map.get("taskName");
Long taskId = (Long) map.get("taskId");
String studentCaseName = (String) map.get("studentCaseName");
String accountName = (String) map.get("accountName");
Integer state = (Integer) map.get("state");
//开始异步任务
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName,
res.getAccountId(), new Date(), res.getSiteId(), res.getCompanyId());
working(taskContext);
List<SelectionCaseListVO> list = null;
//获取导出数据
try {
Integer pageNo = 1;
Integer pageSize = Integer.MAX_VALUE;
Page<SelectionCaseListVO> page = studentCaseService.getSelectionList(studentCaseName, accountName, state, pageNo, pageSize, res);
if (null != page) {
list = page.getRecords();
}
if (CollectionUtils.isEmpty(list)) {
success(taskContext, "未找到数据", "");
}
} catch (Exception e) {
LOGGER.error("获取数据过程中出现错误", e);
fail(taskContext, "获取数据过程中出现错误");
}
//生成excel,上传阿里云返回url
try {
//创建excel文件
XSSFWorkbook wb = new XSSFWorkbook();
//创建报表页
XSSFSheet sheet = wb.createSheet("精选案例清单");
//创建表头
XSSFRow row = sheet.createRow(0);
//设置格式(水平垂直居中,加粗,字体大小14号)
XSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER);
XSSFFont font = wb.createFont();
font.setBold(true);
font.setFontHeightInPoints((short) 14);
style.setFont(font);
CellRangeAddress cra = new CellRangeAddress(0, 0, 0, 6);
//表头合并单元格
sheet.addMergedRegion(cra);
XSSFCell cell = row.createCell(0);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
//填写表头名
cell.setCellValue("精选案例清单" + sdf.format(date));
//表头居中
cell.setCellStyle(style);
row = sheet.createRow(1);
//重新设置格式(只加粗)
style = wb.createCellStyle();
font = wb.createFont();
font.setBold(true);
style.setFont(font);
cell = row.createCell(0);
cell.setCellStyle(style);
cell.setCellValue("名称");
cell = row.createCell(1);
cell.setCellStyle(style);
cell.setCellValue("所属案例活动");
cell = row.createCell(2);
cell.setCellStyle(style);
cell.setCellValue("用户名");
cell = row.createCell(3);
cell.setCellStyle(style);
cell.setCellValue("作者");
cell = row.createCell(4);
cell.setCellStyle(style);
cell.setCellValue("提交时间");
cell = row.createCell(5);
cell.setCellStyle(style);
cell.setCellValue("得分");
cell = row.createCell(6);
cell.setCellStyle(style);
cell.setCellValue("状态");
// 多维度打分
Integer maxDimensionNum = caseLibraryDimensionGradeMapper.getMaxDimensionGradeNum(res.getSiteId());
int indexNum = 0;
if (maxDimensionNum != null) {
maxDimensionNum = maxDimensionNum * 2;
int x = 0;
for (int i = 1; i <= maxDimensionNum; i++) {
x = i % 2;
cell = row.createCell(6 + i);
cell.setCellStyle(style);
if (x == 0) {
cell.setCellValue("纬度" + indexNum + "得分");
} else {
indexNum++;
cell.setCellValue("纬度" + indexNum + "名称");
}
}
}
//组装数据
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(list)) {
for (int i = 0; i < list.size(); i++) {
SelectionCaseListVO listVO = list.get(i);
LOGGER.info("listVO : + " + JSON.toJSONString(listVO));
row = sheet.createRow(i + 2);
row.createCell(0).setCellValue(listVO.getTittle());
row.createCell(1).setCellValue(listVO.getCaseLibraryName());
row.createCell(2).setCellValue(listVO.getAccountName());
row.createCell(3).setCellValue(listVO.getAccountFullName() == null ?
"--" : listVO.getAccountFullName());
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/dd HH:mm:ss");
row.createCell(4).setCellValue(sdf1.format(listVO.getSubmitTime()));
row.createCell(6).setCellValue(listVO.getState());
if (maxDimensionNum != null) {
// 多维度打分
CaseLibraryDimensionGrade grade = new CaseLibraryDimensionGrade();
grade.setDeleted(0);
grade.setCaseLibraryId(listVO.getCaseLibraryId());
EntityWrapper<CaseLibraryDimensionGrade> ew = new EntityWrapper<>(grade);
ew.orderBy("sort");
Double score;
Double allScore = 0.00;
CaseLibraryDimensionGrade caseLibraryDimensionGrade = null;
int x = 0;
int index = 0;
int num = 0;
int listIndex = 0;
if (listVO.getScoreRule() != null && listVO.getScoreRule() == 4) {
List<CaseLibraryDimensionGrade> dimensionGrades = caseLibraryDimensionGradeMapper.selectList(ew);
if (CollectionUtils.isNotEmpty(dimensionGrades)) {
num = dimensionGrades.size() * 2;
for (int j = 1; j <= num; j++) {
x = j % 2;
if (x == 1) {
caseLibraryDimensionGrade = dimensionGrades.get(listIndex);
listIndex++;
}
score = studentCaseDimensionGradeRecordMapper.getAverageScore(listVO.getAccountId(), caseLibraryDimensionGrade.getId(), listVO.getId());
index = 6 + j;
if (x == 0) {
if (score != null) {
allScore = allScore + score;
}
row.createCell(index).setCellValue(score == null ? "" : String.valueOf(NumberUtils.toScaledBigDecimal(score, 2, RoundingMode.HALF_UP)));
} else {
row.createCell(index).setCellValue(caseLibraryDimensionGrade.getName());
}
}
}
}
row.createCell(5).setCellValue(allScore == null ? "--" : allScore.toString());
} else {
row.createCell(5).setCellValue(listVO.getScore() == null ? "--" : listVO.getScore().toString());
}
}
}
String fileName = "精选案例清单" + sdf.format(new Date()) + ".xlsx";
// String requestPath = "/Users/dingxiaowei/aaa";
String requestPath = FileConstant.SAVE_PATH;
File fileDir = new File(requestPath);
if (!fileDir.exists()) {
fileDir.mkdir();
}
String path = requestPath + "/" + fileName;
FileOutputStream os = null;
File file = null;
try {
os = new FileOutputStream(path);
wb.write(os);
//阿里云返回url
String uploadUrl = OssUpload.upload(path, fileName);
file = new File(path);
success(taskContext, "成功导出" + list.size() + "条记录", uploadUrl);
} catch (Exception e2) {
e2.printStackTrace();
fail(taskContext, "精选案例记录导出写入过程中发生错误");
LOGGER.error("精选案例记录导出写入过程中发生错误");
} finally {
if (os != null) {
os.close();
}
if (wb != null) {
wb.close();
}
if (file != null) {
file.delete();
}
}
} catch (Exception e) {
e.printStackTrace();
fail(taskContext, "精选案例记录导出下载发生错误");
LOGGER.error("精选案例记录导出下载发生错误,请查看日志");
}
return null;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.library.application.domain.StatisticStudentCase;
import com.yizhi.library.application.domain.StudentCase;
import com.yizhi.library.application.mapper.StudentCaseMapper;
import com.yizhi.library.application.service.IStatisticStudentCase;
import com.yizhi.library.application.service.IStatisticStudentCaseAccount;
import com.yizhi.library.application.service.IStudentCaseService;
import com.yizhi.system.application.system.remote.AccountClient;
import com.yizhi.system.application.vo.AccountVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DataSourceUtils;
import org.springframework.stereotype.Component;
import javax.sql.DataSource;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Component
public class StatisticStudentCaseAbs extends AbstractDefaultTask<String, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(StatisticStudentCaseAbs.class);
final SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Autowired
private IStatisticStudentCaseAccount statisticStudentCaseAccount;
@Autowired
private IdGenerator idGenerator;
@Autowired
private IStatisticStudentCase statisticStudentCase;
@Autowired
private AccountClient accountClient;
@Autowired
private IStudentCaseService studentCaseService;
@Autowired
private DataSource dataSource;
@Autowired
private StudentCaseMapper studentCaseMapper;
// 字段分割符
private final static String FIELD_STERMINATED = "','";
// 行分割符
private final static String LINE_STERMINATED = "'\r\n'";
private final static String FENGEFU = ","; // tab键
private final static String HUANHANGFU = "\r\n"; // 换行
private StringBuilder strBuilder = new StringBuilder();
private final static String STUDENT_CASE_DETAIL = "(id,student_case_id,title,account_id,account_name,full_name,time,state,up_num,inform_num,study_num,company_id,site_id,org_id,create_time)";
private final static String STUDENT_CASE_DETAIL_EXECUTE_SQL = "load data local infile '' into table statistic_student_case_detail fields terminated by "
+ FIELD_STERMINATED + "enclosed by '' escaped by 'N'" + " lines terminated by " + LINE_STERMINATED + " "
+ STUDENT_CASE_DETAIL;
@Override
protected String execute(Map<String, Object> param) {
Long taskId = idGenerator.generate();
Long t1 = System.currentTimeMillis();
/**
* 走异步任务
*/
Date curDateWork = new Date();
TaskContext taskContext = new TaskContext(taskId, sim.format(curDateWork) + " 号案例报表分析前一天的数据", 999L, curDateWork);
working(taskContext);
String error=null;
Integer dealSuccess = 0;
List<String> listError = new ArrayList<String>();
List<StudentCase> list = statisticStudentCaseAccount.getStudentCases();
List<StatisticStudentCase> detailList = new ArrayList<StatisticStudentCase>();
//每次跑批校正学员案例表中的点赞数(丁小伟加)
studentCaseService.checkAdmireNum();
for(StudentCase s:list) {
try {
StatisticStudentCase studentCase = new StatisticStudentCase();
studentCase.setStudentCaseId(s.getId());
EntityWrapper<StatisticStudentCase> wrapper = new EntityWrapper<StatisticStudentCase>(studentCase);
statisticStudentCase.delete(wrapper);
taskDetail(taskId, "***** 案例统计 删除:"+s.getId()+" 数据*****");
LOGGER.info("***** 案例统计删除:"+s.getId()+" 数据*****");
if (s.getState()==1||s.getState()==2||s.getState()==3) {
studentCase = statisticStudentCaseAccount.getStudentCase(s.getId());
//每次跑批校正学员案例表中的点赞数(丁小伟加)
// studentCaseService.checkAdmireNum();
Integer num = studentCaseMapper.getAdmireNum(s.getId());
s.setAdmireNum(Long.valueOf(num));
studentCaseService.updateById(s);
taskDetail(taskId, "***** 案例统计开始:"+s.getId()+" *****");
LOGGER.info("***** 案例统计开始:"+s.getId()+" *****");
studentCase.setId(idGenerator.generate());
studentCase.setCreateTime(curDateWork);
if (studentCase.getAccountId()==null) {
continue;
}
AccountVO accountVO = accountClient.findById(studentCase.getAccountId());
studentCase.setAccountName(accountVO.getName());
studentCase.setFullName(null==accountVO.getFullName()||""==accountVO.getFullName()?"——":accountVO.getFullName());
detailList.add(studentCase);
dealSuccess++;
}
} catch (Exception e) {
LOGGER.info("案例按案例统计入库:" + s.getId() + "异常,跳过操作");
error="案例按案例统计入库:" + s.getId() + "异常,跳过操作";
listError.add(error);
e.printStackTrace();
taskDetail(taskId, "案例按案例统计入库处理过程中出现异常" + s.getId());
}
}
insertBatchStatisticsCaseDetail(detailList);
Long t2 = System.currentTimeMillis();
Long t = (t2 - t1) / 1000;
Integer count=dealSuccess+listError.size();
success(taskContext, "执行成功,耗时:" + t + "s", "");
taskDetail(taskId, "总数量:" + count + "。处理时间ms:" + (t2 - t1) + ",处理成功:" + dealSuccess + ",处理失败:" + listError.size());
LOGGER.info("***** 案例按案例统计入库结束 ,数量:" + count + "。处理时间ms:" + (t2 - t1) + ",处理成功:" + dealSuccess + ",处理失败:" + listError.size() + " *****");
return "success";
}
public boolean insertBatchStatisticsCaseDetail(List<StatisticStudentCase> listStatisticsCase) {
Connection conn = null;
InputStream in = null;
PreparedStatement preStatement = null;
com.mysql.jdbc.PreparedStatement mysqlPreStatement = null;
try {
// sql编译
conn = DataSourceUtils.getConnection(dataSource);
preStatement = conn.prepareStatement(STUDENT_CASE_DETAIL_EXECUTE_SQL);
mysqlPreStatement = preStatement.unwrap(com.mysql.jdbc.PreparedStatement.class);
in = switchStreamStatisticsCaseDetail(listStatisticsCase);
mysqlPreStatement.setLocalInfileInputStream(in);
// 执行
preStatement.executeQuery();
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
// 大对象手动显示的设置为空保证GC时被释放
if (in != null) {
in = null;
}
try {
// 关闭数据库连接
if (mysqlPreStatement != null) {
mysqlPreStatement.close();
}
if (preStatement != null) {
preStatement.close();
}
if (conn != null) {
DataSourceUtils.releaseConnection(conn, dataSource);
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
return true;
}
public InputStream switchStreamStatisticsCaseDetail(List<StatisticStudentCase> list) {
for (StatisticStudentCase sc : list) {
strBuilder.append(idGenerator.generate());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getStudentCaseId());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getTitle());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getAccountId());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getAccountName());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getFullName());
strBuilder.append(FENGEFU);
if (sc.getTime() != null) {
strBuilder.append(format.format(sc.getTime()));
}
strBuilder.append(FENGEFU);
strBuilder.append(sc.getState());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getUpNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getInformNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getStudyNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getCompanyId());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getSiteId());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getOrgId());
strBuilder.append(FENGEFU);
if (sc.getCreateTime() != null) {
strBuilder.append(format.format(sc.getCreateTime()));
}
strBuilder.append(FENGEFU);
strBuilder.append(HUANHANGFU);
}
byte[] bytes = strBuilder.toString().getBytes();
InputStream in = new ByteArrayInputStream(bytes);
// 大对象手动显示的设置为空保证GC时被释放
bytes = null;
// 清空之前的内容
strBuilder.delete(0, strBuilder.length());
return in;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.library.application.domain.StatisticStudentCaseAccount;
import com.yizhi.library.application.domain.StatisticStudentCaseOrg;
import com.yizhi.library.application.service.IStatisticStudentCaseAccount;
import com.yizhi.library.application.service.IStatisticStudentCaseOrg;
import com.yizhi.system.application.system.remote.OrganizationClient;
import com.yizhi.system.application.system.remote.ReportClient;
import com.yizhi.system.application.system.remote.SiteClient;
import com.yizhi.system.application.vo.ReportAccountRespVO;
import com.yizhi.system.application.vo.ReportRangeAccountReqVO;
import com.yizhi.system.application.vo.SiteVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DataSourceUtils;
import org.springframework.stereotype.Component;
import javax.sql.DataSource;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.text.SimpleDateFormat;
import java.util.*;
@Component
public class StatisticStudentCaseAccountAbs extends AbstractDefaultTask<String, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(StatisticStudentCaseAccountAbs.class);
final SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Autowired
private ReportClient reportClient;
@Autowired
private IStatisticStudentCaseAccount statisticStudentCaseAccount;
@Autowired
private OrganizationClient organizationClient;
@Autowired
private IdGenerator idGenerator;
@Autowired
private SiteClient siteClient;
@Autowired
private IStatisticStudentCaseOrg statisticStudentCaseOrg;
@Autowired
private DataSource dataSource;
// 字段分割符
private final static String FIELD_STERMINATED = "','";
// 行分割符
private final static String LINE_STERMINATED = "'\r\n'";
private final static String FENGEFU = ","; // tab键
private final static String HUANHANGFU = "\r\n"; // 换行
private StringBuilder strBuilder = new StringBuilder();
private final static String STUDENT_CASE_ACCOUNT = "(id,account_id,account_name,full_name,position,org_id,org_name,org_names,must_submit_num,submit_num,case_num,ups,up_num,informs,inform_num,study_num,status,audit_num,no_audit_num,no_score_num,score_num,create_time,company_id,site_id)";
private final static String STUDENT_CASE_ACCOUNT_EXECUTE_SQL = "load data local infile '' into table statistic_student_case_account fields terminated by "
+ FIELD_STERMINATED + "enclosed by '' escaped by 'N'" + " lines terminated by " + LINE_STERMINATED + " "
+ STUDENT_CASE_ACCOUNT;
private final static String STUDENT_CASE_ORG = "(id,org_id,org_name,submit_num,audit_num,no_audit_num,no_score_num,score_num,case_num,up_num,study_num,create_time,company_id,site_id)";
private final static String STUDENT_CASE_ORG_EXECUTE_SQL = "load data local infile '' into table statistic_student_case_org fields terminated by "
+ FIELD_STERMINATED + "enclosed by '' escaped by 'N'" + " lines terminated by " + LINE_STERMINATED + " "
+ STUDENT_CASE_ORG;
@Override
protected String execute(Map<String, Object> param) {
Long taskId = idGenerator.generate();
Long t1 = System.currentTimeMillis();
/**
* 走异步任务
*/
Date curDateWork = new Date();
TaskContext taskContext = new TaskContext(taskId, sim.format(curDateWork) + " 号案例用户报表分析前一天的数据", 999L, curDateWork);
working(taskContext);
String error = null;
Integer dealSuccess = 0;
List<String> listError = new ArrayList<String>();
List<Long> siteIds = statisticStudentCaseAccount.getSiteIds();
List<StatisticStudentCaseAccount> accountList = new ArrayList<StatisticStudentCaseAccount>();
for (Long siteId : siteIds) {
StatisticStudentCaseAccount entity = new StatisticStudentCaseAccount();
entity.setSiteId(siteId);
EntityWrapper<StatisticStudentCaseAccount> wrapper = new EntityWrapper<StatisticStudentCaseAccount>(entity);
statisticStudentCaseAccount.delete(wrapper);
taskDetail(taskId, "***** 案例统计用户 删除:" + siteId + " 数据*****");
LOGGER.info("***** 案例统计用户 删除:" + siteId + " 数据*****");
ReportRangeAccountReqVO rangeAccountReqVO = new ReportRangeAccountReqVO();
rangeAccountReqVO.setSiteId(siteId);
List<ReportAccountRespVO> accounts = reportClient.getRangeAccounts(rangeAccountReqVO);
Map<Long, String> orgNameMap = new HashMap<>(16);
for (ReportAccountRespVO vo : accounts) {
try {
entity = statisticStudentCaseAccount.getAccountExportVO(vo.getUserId(), siteId);
taskDetail(taskId, "***** 案例统计开始 用户:" + vo.getUserId() + " *****");
LOGGER.info("***** 案例统计开始 用户:" + vo.getUserId() + " *****");
entity.setId(idGenerator.generate());
entity.setAccountId(vo.getUserId());
entity.setAccountName(vo.getUserName());
entity.setFullName(null == vo.getUserFullName() || "" == vo.getUserFullName() ? "——" : vo.getUserFullName());
if (0 == vo.getStatus()) {
entity.setStatus("禁用");
} else {
entity.setStatus("启用");
}
entity.setPosition(null == vo.getPosition() || "" == vo.getPosition() ? "——" : vo.getPosition());
List<Long> orgIds = new ArrayList<Long>();
// orgIds.add(vo.getOrgId());
// Map<Long, String> orgName = organizationClient.getParentNameWithCurrentName(orgIds);
entity.setOrgId(vo.getOrgId());
entity.setOrgName(vo.getOrgName());
String orgNames = "";
if (null != orgNameMap.get(vo.getOrgId())) {
entity.setOrgNames(orgNameMap.get(vo.getOrgId()));
} else {
List<String> orgNameList = new ArrayList<>();
orgNameList = organizationClient.getChiefOrgNames(vo.getOrgId(), vo.getCompanyId());
if (CollectionUtils.isNotEmpty(orgNameList)) {
for (String s : orgNameList) {
if (StringUtils.isBlank(orgNames)) {
orgNames = orgNames + s;
} else {
orgNames = orgNames + "/" + s;
}
}
entity.setOrgNames(orgNames);
orgNameMap.put(vo.getOrgId(), orgNames);
}
}
entity.setSiteId(siteId);
entity.setCompanyId(vo.getCompanyId());
entity.setCreateTime(curDateWork);
accountList.add(entity);
dealSuccess++;
} catch (Exception e) {
LOGGER.info("案例按用户统计入库:" + vo.getUserId() + "异常,跳过操作");
error = "案例按用户统计入库:" + vo.getUserId() + "异常,跳过操作";
listError.add(error);
e.printStackTrace();
taskDetail(taskId, "案例按用户统计处理过程中出现异常" + vo.getUserId());
}
}
}
insertBatchStatisticsCaseAccount(accountList);
try {
Thread.sleep(120000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
List<StatisticStudentCaseOrg> orgList = new ArrayList<StatisticStudentCaseOrg>();
List<SiteVO> list = siteClient.selectByIds(siteIds);
for (SiteVO vo : list) {
StatisticStudentCaseOrg entity = new StatisticStudentCaseOrg();
entity.setSiteId(vo.getId());
EntityWrapper<StatisticStudentCaseOrg> wrapper = new EntityWrapper<StatisticStudentCaseOrg>(entity);
statisticStudentCaseOrg.delete(wrapper);
taskDetail(taskId, "***** 案例统计部门 删除:" + vo.getId() + " 数据*****");
LOGGER.info("***** 案例统计部门删除:" + vo.getId() + " 数据*****");
Set<Long> orgs = organizationClient.getOrgIdsInSite(vo.getId(), vo.getCompanyCode(), vo.getCode());
for (Long orgId : orgs) {
try {
entity = statisticStudentCaseAccount.getOrgExportVO(orgId, vo.getId());
taskDetail(taskId, "***** 案例统计开始 部门:" + orgId + " *****");
LOGGER.info("***** 案例统计开始 部门:" + orgId + " *****");
if (null != entity) {
entity.setId(idGenerator.generate());
entity.setCreateTime(curDateWork);
orgList.add(entity);
dealSuccess++;
}
} catch (Exception e) {
LOGGER.info("案例按部门统计入库:" + orgId + "异常,跳过操作");
error = "案例按部门统计入库:" + orgId + "异常,跳过操作";
listError.add(error);
e.printStackTrace();
taskDetail(taskId, "案例按部门统计处理过程中出现异常" + orgId);
}
}
}
insertBatchStatisticsCaseOrg(orgList);
Long t2 = System.currentTimeMillis();
Long t = (t2 - t1) / 1000;
Integer count = dealSuccess + listError.size();
success(taskContext, "执行成功,耗时:" + t + "s", "");
taskDetail(taskId, "总数量:" + count + "。处理时间ms:" + (t2 - t1) + ",处理成功:" + dealSuccess + ",处理失败:" + listError.size());
LOGGER.info("***** 案例统计入库结束 ,数量:" + count + "。处理时间ms:" + (t2 - t1) + ",处理成功:" + dealSuccess + ",处理失败:" + listError.size() + " *****");
return "success";
}
public boolean insertBatchStatisticsCaseAccount(List<StatisticStudentCaseAccount> listStatisticsCase) {
Connection conn = null;
InputStream in = null;
PreparedStatement preStatement = null;
com.mysql.jdbc.PreparedStatement mysqlPreStatement = null;
try {
// sql编译
conn = DataSourceUtils.getConnection(dataSource);
preStatement = conn.prepareStatement(STUDENT_CASE_ACCOUNT_EXECUTE_SQL);
mysqlPreStatement = preStatement.unwrap(com.mysql.jdbc.PreparedStatement.class);
in = switchStreamStatisticsCaseAccount(listStatisticsCase);
mysqlPreStatement.setLocalInfileInputStream(in);
// 执行
preStatement.executeQuery();
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
// 大对象手动显示的设置为空保证GC时被释放
if (in != null) {
in = null;
}
try {
// 关闭数据库连接
if (mysqlPreStatement != null) {
mysqlPreStatement.close();
}
if (preStatement != null) {
preStatement.close();
}
if (conn != null) {
DataSourceUtils.releaseConnection(conn, dataSource);
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
return true;
}
public InputStream switchStreamStatisticsCaseAccount(List<StatisticStudentCaseAccount> list) {
for (StatisticStudentCaseAccount sc : list) {
strBuilder.append(idGenerator.generate());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getAccountId());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getAccountName());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getFullName());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getPosition());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getOrgId());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getOrgName());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getOrgNames());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getMustSubmitNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getSubmitNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getCaseNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getUps());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getUpNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getInforms());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getInformNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getStudyNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getStatus());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getAuditNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getNoAuditNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getNoScoreNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getScoreNum());
strBuilder.append(FENGEFU);
if (sc.getCreateTime() != null) {
strBuilder.append(format.format(sc.getCreateTime()));
}
strBuilder.append(FENGEFU);
strBuilder.append(sc.getCompanyId());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getSiteId());
strBuilder.append(FENGEFU);
strBuilder.append(HUANHANGFU);
}
byte[] bytes = strBuilder.toString().getBytes();
InputStream in = new ByteArrayInputStream(bytes);
// 大对象手动显示的设置为空保证GC时被释放
bytes = null;
// 清空之前的内容
strBuilder.delete(0, strBuilder.length());
return in;
}
public boolean insertBatchStatisticsCaseOrg(List<StatisticStudentCaseOrg> listStatisticsCase) {
Connection conn = null;
InputStream in = null;
PreparedStatement preStatement = null;
com.mysql.jdbc.PreparedStatement mysqlPreStatement = null;
try {
// sql编译
conn = DataSourceUtils.getConnection(dataSource);
preStatement = conn.prepareStatement(STUDENT_CASE_ORG_EXECUTE_SQL);
mysqlPreStatement = preStatement.unwrap(com.mysql.jdbc.PreparedStatement.class);
in = switchStreamStatisticsCaseOrg(listStatisticsCase);
mysqlPreStatement.setLocalInfileInputStream(in);
// 执行
preStatement.executeQuery();
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
// 大对象手动显示的设置为空保证GC时被释放
if (in != null) {
in = null;
}
try {
// 关闭数据库连接
if (mysqlPreStatement != null) {
mysqlPreStatement.close();
}
if (preStatement != null) {
preStatement.close();
}
if (conn != null) {
DataSourceUtils.releaseConnection(conn, dataSource);
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
return true;
}
public InputStream switchStreamStatisticsCaseOrg(List<StatisticStudentCaseOrg> list) {
for (StatisticStudentCaseOrg sc : list) {
strBuilder.append(idGenerator.generate());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getOrgId());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getOrgName());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getSubmitNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getAuditNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getNoAuditNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getNoScoreNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getScoreNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getCaseNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getUpNum());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getStudyNum());
strBuilder.append(FENGEFU);
if (sc.getCreateTime() != null) {
strBuilder.append(format.format(sc.getCreateTime()));
}
strBuilder.append(FENGEFU);
strBuilder.append(sc.getCompanyId());
strBuilder.append(FENGEFU);
strBuilder.append(sc.getSiteId());
strBuilder.append(FENGEFU);
strBuilder.append(HUANHANGFU);
}
byte[] bytes = strBuilder.toString().getBytes();
InputStream in = new ByteArrayInputStream(bytes);
// 大对象手动显示的设置为空保证GC时被释放
bytes = null;
// 清空之前的内容
strBuilder.delete(0, strBuilder.length());
return in;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.baomidou.mybatisplus.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.toolkit.StringUtils;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.constant.FileConstant;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.core.application.file.util.OssUpload;
import com.yizhi.library.application.util.DownloadOssUrl;
import com.yizhi.library.application.util.Util;
import com.yizhi.library.application.vo.AccessoryUrlVO;
import com.yizhi.library.application.vo.StudentCaseVO;
import com.yizhi.library.application.service.IStudentCaseService;
import com.yizhi.system.application.system.remote.AccountClient;
import com.yizhi.system.application.vo.AccountVO;
import com.yizhi.util.application.zip.ZipUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @author Ding
* @className StudentCaseBatchExport
* @description 学员案例审核/评分导出案例
* @date 2019/7/23
**/
@Component
public class StudentCaseBatchExport extends AbstractDefaultTask<Map, Map<String, Object>> {
private static final Logger LOGGER = LoggerFactory.getLogger(StudentCaseBatchExport.class);
@Autowired
private IStudentCaseService studentCaseService;
@Autowired
private AccountClient accountClient;
@Autowired
private Util util;
@Override
protected Map execute(Map<String, Object> map) {
//从map中取信息
RequestContext res = (RequestContext) map.get("res");
String serialNo = (String) map.get("serialNo");
String taskName = (String) map.get("taskName");
Long taskId = (Long) map.get("taskId");
List<Long> idList = (List<Long>) map.get("idList");
//开始异步任务
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName,
res.getAccountId(), new Date(), res.getSiteId(), res.getCompanyId());
working(taskContext);
List<StudentCaseVO> studentCaseVOList = null;
//获取导出数据
try {
studentCaseVOList = studentCaseService.studentCaseBatchExport(idList);
} catch (Exception e) {
LOGGER.error("获取数据过程中出现错误", e);
fail(taskContext, "获取数据过程中出现错误");
}
//生成excel,上传阿里云返回url
try {
if (CollectionUtils.isEmpty(studentCaseVOList)) {
success(taskContext, "未找到数据", "");
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
//新建压缩文件夹
String zipName = "案例批量导出" + sdf.format(new Date());
// String requestPath = "/Users/dingxiaowei/aaa" + File.separator + zipName;
String requestPath = FileConstant.SAVE_PATH + File.separator + zipName;
// String requestPath = "C:\\Users\\lenovo\\Desktop"+ File.separator + zipName;
File fileDir = new File(requestPath);
if (!fileDir.exists()) {
fileDir.mkdir();
}
//获取用户信息并放入map中
Map<Long, AccountVO> accountVOMap = new HashMap<>(16);
List<Long> accountIds = new ArrayList<>();
for (StudentCaseVO studentCaseVO : studentCaseVOList) {
if (!accountIds.contains(studentCaseVO.getAccountId())) {
accountIds.add(studentCaseVO.getAccountId());
}
}
List<AccountVO> accountVOList = accountClient.idsGet(accountIds);
if (CollectionUtils.isNotEmpty(accountVOList)) {
for (AccountVO accountVO : accountVOList) {
accountVOMap.put(accountVO.getId(), accountVO);
}
}
//得处一共有几个子文件
int maxFileZipNumber= studentCaseVOList.size();
for (StudentCaseVO studentCaseVO : studentCaseVOList) {
//标识是第几个子文件
int index=maxFileZipNumber;
//如果有附件就下载到压缩文件夹中并压缩
if (StringUtils.isNotEmpty(studentCaseVO.getAccessoryUrl())) {
List<AccessoryUrlVO> accessoryUrlVOList = util.getAccessoryUrlList(studentCaseVO.getId());
if (CollectionUtils.isNotEmpty(accessoryUrlVOList)) {
AccountVO accountVO = accountVOMap.get(studentCaseVO.getAccountId());
String name = accountVO.getFullName() == null ? accountVO.getName() : accountVO.getFullName();
//在压缩文件下新建该学生案例的文件夹
String studentCaseDir = requestPath + File.separator + name + studentCaseVO.getTitle() + sdf.format(new Date())+index;
File fileDir1 = new File(studentCaseDir);
if (!fileDir1.exists()) {
fileDir1.mkdir();
}
for (AccessoryUrlVO accessoryUrlVO : accessoryUrlVOList) {
DownloadOssUrl.downLoadFromUrl(accessoryUrlVO.getUrl(), accessoryUrlVO.getName(), studentCaseDir);
}
//子文件不压缩
String childPath = studentCaseDir + ".zip";
ZipUtil.zip(studentCaseDir, childPath);
Util.deleteDir(new File(studentCaseDir));
}
}
maxFileZipNumber--;
}
String zipPath = requestPath + ".zip";
//压缩文件夹
ZipUtil.zip(requestPath, zipPath);
File file = null;
File pathFile = null;
try {
//阿里云返回url
String uploadUrl = OssUpload.upload(zipPath, zipName);
success(taskContext, "导出成功", uploadUrl);
file = new File(zipPath);
pathFile = new File(requestPath);
} catch (Exception e2) {
e2.printStackTrace();
fail(taskContext, "学员案例审核/评分导出案例写入过程中发生错误");
LOGGER.error("学员案例审核/评分导出案例写入过程中发生错误");
} finally {
if (file != null) {
file.delete();
}
if (pathFile != null) {
Util.deleteDir(pathFile);
}
}
} catch (Exception e) {
e.printStackTrace();
fail(taskContext, "学员案例审核/评分导出案例下载发生错误");
LOGGER.error("学员案例审核/评分导出案例下载发生错误,请查看日志");
}
return null;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.constant.FileConstant;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.core.application.file.util.OssUpload;
import com.yizhi.library.application.domain.StatisticStudentCaseAccount;
import com.yizhi.library.application.service.IStatisticStudentCaseAccount;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Component
public class StudentCaseByAccountExport extends AbstractDefaultTask<String, Map<String, Object>> {
private static final Logger logger = LoggerFactory.getLogger(StudentCaseByAccountExport.class);
@Autowired
private IStatisticStudentCaseAccount statisticStudentCaseAccount;
@Override
protected String execute(Map<String, Object> arg0) {
Long accountId=(Long) arg0.get("accountId");
Long siteId=(Long) arg0.get("siteId");
Long companyId=(Long) arg0.get("companyId");
Long taskId=(Long) arg0.get("taskId");
Date submitTime=(Date) arg0.get("submitTime");
String serialNo=(String) arg0.get("serialNo");
String taskName=(String) arg0.get("taskName");
String kwd=(String) arg0.get("kwd");
/**
* 走异步任务
*/
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName, accountId, submitTime, siteId, companyId);
working(taskContext);
String upLoadUrl=null;
String requestPath= FileConstant.SAVE_PATH;
// String requestPath = "/Users/dingxiaowei/aaa";
File fileDir=new File(requestPath);
if(!fileDir.exists()) {
fileDir.mkdir();
}
if (StringUtils.isNotBlank(kwd)) {
kwd = kwd.trim();
}
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss");
StatisticStudentCaseAccount vo = new StatisticStudentCaseAccount();
vo.setSiteId(siteId);
EntityWrapper<StatisticStudentCaseAccount> wrapper = new EntityWrapper<StatisticStudentCaseAccount>(vo);
wrapper.like("account_name", kwd).or().like("full_name", kwd);
List<StatisticStudentCaseAccount> listVO = statisticStudentCaseAccount.selectList(wrapper);
try {
//excel生成过程: excel-->sheet-->row-->cell
// 第一步,创建一个Excel文件
XSSFWorkbook wb = new XSSFWorkbook();
// 第二步,在webbook中添加一个sheet,对应Excel文件中的sheet
XSSFSheet sheet = wb.createSheet();
XSSFFont font = wb.createFont();
font.setFontName("宋体");
font.setFontHeightInPoints((short) 14);
font.setBold(true);
XSSFCellStyle style = wb.createCellStyle();
style.setFont(font);
style.setAlignment(HorizontalAlignment.CENTER); // 创建一个居中格式
style.setVerticalAlignment(VerticalAlignment.CENTER);
// 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
XSSFRow row = sheet.createRow((int) 0);
row.setHeight((short) (20*20));
// 合并单元格
CellRangeAddress cra=new CellRangeAddress(0,0,0,11); // 起始行, 终止行, 起始列, 终止列
sheet.addMergedRegion(cra);
XSSFCell cell = row.createCell((short) 0);
cell.setCellValue("案例统计报表——按用户统计");
cell.setCellStyle(style);
XSSFRow row1 = sheet.createRow((int) 1);
row.setHeight((short) (20*20));
// 合并单元格
CellRangeAddress cra1=new CellRangeAddress(1,1,0,13); // 起始行, 终止行, 起始列, 终止列
sheet.addMergedRegion(cra1);
XSSFCell cell1 = row1.createCell((short) 0);
cell1.setCellValue("统计周期:不限时间");
// 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
XSSFRow row2 = sheet.createRow((int) 2);
row2.setHeight((short) (14*20));
// 第四步,创建单元格
row2.createCell((short) 0).setCellValue("用户名");
row2.createCell((short) 1).setCellValue("姓名");
row2.createCell((short) 2).setCellValue("所在部门");
row2.createCell((short) 3).setCellValue("所在组织架构");
row2.createCell((short) 4).setCellValue("职务");
row2.createCell((short) 5).setCellValue("提交数");
row2.createCell((short) 6).setCellValue("必须提交数");
row2.createCell((short) 7).setCellValue("精选案例数");
row2.createCell((short) 8).setCellValue("点赞数");
row2.createCell((short) 9).setCellValue("被点赞数");
row2.createCell((short) 10).setCellValue("举报");
row2.createCell((short) 11).setCellValue("被举报");
row2.createCell((short) 12).setCellValue("学习次数");
row2.createCell((short) 13).setCellValue("用户状态");
for(int i=0;i<listVO.size();i++) {
font.setBold(false);
row = sheet.createRow(i + 3);
row.setHeight((short) (13*20));
// 第四步,创建单元格,并设置值
vo=listVO.get(i);
if(vo!=null&&vo.getAccountName()!=null) {
row.createCell((short) 0).setCellValue(vo.getAccountName());
}
if(vo!=null&&vo.getFullName()!=null) {
row.createCell((short) 1).setCellValue(vo.getFullName());
}
if(vo!=null&&StringUtils.isNotBlank(vo.getOrgName())) {
row.createCell((short) 2).setCellValue(vo.getOrgName());
}else {
row.createCell((short) 2).setCellValue("--");
}
if(vo!=null&&StringUtils.isNotBlank(vo.getOrgNames())) {
row.createCell((short) 3).setCellValue(vo.getOrgNames());
}else {
row.createCell((short) 3).setCellValue("--");
}
if(vo!=null&&vo.getPosition()!=null) {
row.createCell((short) 4).setCellValue(vo.getPosition());
}
if(vo!=null&&vo.getSubmitNum()!=null) {
row.createCell((short) 5).setCellValue(vo.getSubmitNum());
}
if(vo!=null&&vo.getMustSubmitNum()!=null) {
row.createCell((short) 6).setCellValue(vo.getMustSubmitNum());
}
if (vo!=null&&vo.getCaseNum()!=null) {
row.createCell((short) 7).setCellValue(vo.getCaseNum());
}
if (vo!=null&&vo.getUps()!=null) {
row.createCell((short) 8).setCellValue(vo.getUps());
}
if (vo!=null&&vo.getUpNum()!=null) {
row.createCell((short) 9).setCellValue(vo.getUpNum());
}
if (vo!=null&&vo.getInforms()!=null) {
row.createCell((short) 10).setCellValue(vo.getInforms());
}
if (vo!=null&&vo.getInformNum()!=null) {
row.createCell((short) 11).setCellValue(vo.getInformNum());
}
if (vo!=null&&vo.getStudyNum()!=null) {
row.createCell((short) 12).setCellValue(vo.getStudyNum());
}
if (vo!=null&&vo.getStatus()!=null) {
row.createCell((short) 13).setCellValue(vo.getStatus());
}
}
// 第五步,写入实体数据 实际应用中这些数据从数据库得到,
StringBuffer fileNameSb = new StringBuffer().append("案例统计报表——按用户统计").append(sf.format(submitTime)).append(".xlsx");
String fileName = fileNameSb.toString();
String path = new StringBuffer().append(requestPath).append(fileNameSb).toString();
FileOutputStream os=null;
File file=null;
try {
os= new FileOutputStream(path);
wb.write(os);
//阿里云返回url
upLoadUrl = OssUpload.upload(path, fileName);
file=new File(path);
success(taskContext,"成功", upLoadUrl);
} catch (Exception e1) {
e1.printStackTrace();
fail(taskContext, "写入数据到Excel的过程中或者上传到阿里云中发生错误"+e1.getMessage());
logger.error("写入数据到Excel的过程中或者上传到阿里云中发生错误"+e1.getMessage());
}
finally {
if(os!=null) {
os.close();
}
if(wb!=null) {
wb.close();
}
if(file!=null) {
file.delete();
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
fail(taskContext, "评论信息导出过程中发生错误,请查看日志"+e.getMessage());
logger.error("评论信息导出过程中发生错误,请查看日志"+e.getMessage());
}
return upLoadUrl;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.constant.FileConstant;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.core.application.file.util.OssUpload;
import com.yizhi.library.application.domain.StatisticStudentCaseOrg;
import com.yizhi.library.application.mapper.StatisticStudentCaseOrgMapper;
import com.yizhi.library.application.service.IStatisticStudentCaseOrg;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Component
public class StudentCaseByOrgExport extends AbstractDefaultTask<String, Map<String, Object>> {
private static final Logger logger = LoggerFactory.getLogger(StudentCaseByOrgExport.class);
@Autowired
private IStatisticStudentCaseOrg statisticStudentCaseOrg;
@Autowired
private StatisticStudentCaseOrgMapper statisticStudentCaseOrgMapper;
@Override
protected String execute(Map<String, Object> arg0) {
Long accountId = (Long) arg0.get("accountId");
Long siteId = (Long) arg0.get("siteId");
Long companyId = (Long) arg0.get("companyId");
Long taskId = (Long) arg0.get("taskId");
Date submitTime = (Date) arg0.get("submitTime");
String serialNo = (String) arg0.get("serialNo");
String taskName = (String) arg0.get("taskName");
String kwd = (String) arg0.get("kwd");
/**
* 走异步任务
*/
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName, accountId, submitTime, siteId, companyId);
working(taskContext);
String upLoadUrl = null;
String requestPath = FileConstant.SAVE_PATH;
// String requestPath = "/Users/dingxiaowei/aaa";
File fileDir = new File(requestPath);
if (!fileDir.exists()) {
fileDir.mkdir();
}
if (StringUtils.isNotBlank(kwd)) {
kwd = kwd.trim();
}
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss");
StatisticStudentCaseOrg vo = new StatisticStudentCaseOrg();
vo.setSiteId(siteId);
EntityWrapper<StatisticStudentCaseOrg> wrapper = new EntityWrapper<StatisticStudentCaseOrg>(vo);
wrapper.like("org_name", kwd);
List<StatisticStudentCaseOrg> listVO = statisticStudentCaseOrg.selectList(wrapper);
Map<Long, Map<String, String>> orgNamesMap = statisticStudentCaseOrgMapper.getOrgNamesMap(companyId, siteId);
try {
//excel生成过程: excel-->sheet-->row-->cell
// 第一步,创建一个Excel文件
XSSFWorkbook wb = new XSSFWorkbook();
// 第二步,在webbook中添加一个sheet,对应Excel文件中的sheet
XSSFSheet sheet = wb.createSheet();
XSSFFont font = wb.createFont();
font.setFontName("宋体");
font.setFontHeightInPoints((short) 14);
font.setBold(true);
XSSFCellStyle style = wb.createCellStyle();
style.setFont(font);
style.setAlignment(HorizontalAlignment.CENTER); // 创建一个居中格式
style.setVerticalAlignment(VerticalAlignment.CENTER);
// 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
XSSFRow row = sheet.createRow((int) 0);
row.setHeight((short) (20 * 20));
// 合并单元格
CellRangeAddress cra = new CellRangeAddress(0, 0, 0, 8); // 起始行, 终止行, 起始列, 终止列
sheet.addMergedRegion(cra);
XSSFCell cell = row.createCell((short) 0);
cell.setCellValue("案例统计报表——按部门统计");
cell.setCellStyle(style);
XSSFRow row1 = sheet.createRow((int) 1);
row.setHeight((short) (20 * 20));
// 合并单元格
CellRangeAddress cra1 = new CellRangeAddress(1, 1, 0, 9); // 起始行, 终止行, 起始列, 终止列
sheet.addMergedRegion(cra1);
XSSFCell cell1 = row1.createCell((short) 0);
cell1.setCellValue("统计周期:不限时间");
// 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
XSSFRow row2 = sheet.createRow((int) 2);
row2.setHeight((short) (14 * 20));
// 第四步,创建单元格
row2.createCell((short) 0).setCellValue("部门名称");
row2.createCell((short) 1).setCellValue("所在组织架构");
row2.createCell((short) 2).setCellValue("实际提交数");
row2.createCell((short) 3).setCellValue("待审核");
row2.createCell((short) 4).setCellValue("不通过");
row2.createCell((short) 5).setCellValue("待评分");
row2.createCell((short) 6).setCellValue("已评分");
row2.createCell((short) 7).setCellValue("精选案例数");
row2.createCell((short) 8).setCellValue("获赞数");
row2.createCell((short) 9).setCellValue("学习量");
for (int i = 0; i < listVO.size(); i++) {
font.setBold(false);
row = sheet.createRow(i + 3);
row.setHeight((short) (13 * 20));
// 第四步,创建单元格,并设置值
vo = listVO.get(i);
if (vo != null && vo.getOrgName() != null) {
row.createCell((short) 0).setCellValue(vo.getOrgName());
}
if (null != orgNamesMap && null != orgNamesMap.get(vo.getOrgId())) {
row.createCell((short) 1).setCellValue(orgNamesMap.get(vo.getOrgId()).get("orgNames"));
} else {
row.createCell((short) 1).setCellValue("--");
}
if (vo != null && vo.getSubmitNum() != null) {
row.createCell((short) 2).setCellValue(vo.getSubmitNum());
}
if (vo != null && vo.getAuditNum() != null) {
row.createCell((short) 3).setCellValue(vo.getAuditNum());
}
if (vo != null && vo.getNoAuditNum() != null) {
row.createCell((short) 4).setCellValue(vo.getNoAuditNum());
}
if (vo != null && vo.getScoreNum() != null) {
row.createCell((short) 5).setCellValue(vo.getScoreNum());
}
if (vo != null && vo.getNoScoreNum() != null) {
row.createCell((short) 6).setCellValue(vo.getNoScoreNum());
}
if (vo != null && vo.getCaseNum() != null) {
row.createCell((short) 7).setCellValue(vo.getCaseNum());
}
if (vo != null && vo.getUpNum() != null) {
row.createCell((short) 8).setCellValue(vo.getUpNum());
}
if (vo != null && vo.getStudyNum() != null) {
row.createCell((short) 9).setCellValue(vo.getStudyNum());
}
}
// 第五步,写入实体数据 实际应用中这些数据从数据库得到,
StringBuffer fileNameSb = new StringBuffer().append("案例统计报表——按部门统计").append(sf.format(submitTime)).append(".xlsx");
String fileName = fileNameSb.toString();
String path = new StringBuffer().append(requestPath).append(fileNameSb).toString();
FileOutputStream os = null;
File file = null;
try {
os = new FileOutputStream(path);
wb.write(os);
//阿里云返回url
upLoadUrl = OssUpload.upload(path, fileName);
file = new File(path);
success(taskContext, "成功", upLoadUrl);
} catch (Exception e1) {
e1.printStackTrace();
fail(taskContext, "写入数据到Excel的过程中或者上传到阿里云中发生错误" + e1.getMessage());
logger.error("写入数据到Excel的过程中或者上传到阿里云中发生错误" + e1.getMessage());
} finally {
if (os != null) {
os.close();
}
if (wb != null) {
wb.close();
}
if (file != null) {
file.delete();
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
fail(taskContext, "评论信息导出过程中发生错误,请查看日志" + e.getMessage());
logger.error("评论信息导出过程中发生错误,请查看日志" + e.getMessage());
}
return upLoadUrl;
}
}
package com.yizhi.library.application.asynchronousTask;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.core.application.context.TaskContext;
import com.yizhi.core.application.file.constant.FileConstant;
import com.yizhi.core.application.file.task.AbstractDefaultTask;
import com.yizhi.core.application.file.util.OssUpload;
import com.yizhi.library.application.service.IStudentCaseReportService;
import com.yizhi.library.application.vo.StatisticStudentCaseVO;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Component
public class StudentCaseExport extends AbstractDefaultTask<String, Map<String, Object>> {
private static final Logger logger = LoggerFactory.getLogger(StudentCaseExport.class);
@Autowired
private IStudentCaseReportService studentCaseReportService;
@Override
protected String execute(Map<String, Object> arg0) {
Long accountId = (Long) arg0.get("accountId");
Long siteId = (Long) arg0.get("siteId");
Long companyId = (Long) arg0.get("companyId");
Long taskId = (Long) arg0.get("taskId");
Date submitTime = (Date) arg0.get("submitTime");
String serialNo = (String) arg0.get("serialNo");
String taskName = (String) arg0.get("taskName");
String startDate = (String) arg0.get("startDate");
String endDate = (String) arg0.get("endDate");
String kwd = (String) arg0.get("kwd");
/**
* 走异步任务
*/
TaskContext taskContext = new TaskContext(taskId, serialNo, taskName, accountId, submitTime, siteId, companyId);
working(taskContext);
String upLoadUrl = null;
String requestPath = FileConstant.SAVE_PATH;
// String requestPath = "/Users/dingxiaowei/aaa";
File fileDir = new File(requestPath);
if (!fileDir.exists()) {
fileDir.mkdir();
}
if (StringUtils.isNotBlank(kwd)) {
kwd = kwd.trim();
}
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd dd:HH:ss");
SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss");
// StatisticStudentCase vo = new StatisticStudentCase();
// vo.setSiteId(siteId);
// EntityWrapper<StatisticStudentCase> wrapper = new EntityWrapper<StatisticStudentCase>(vo);
// wrapper.like("title", kwd);
// if (null!=startDate&&null!=endDate) {
// endDate = endDate + " 23:59:59";
// wrapper.between("time", startDate, endDate);
// }
Page<StatisticStudentCaseVO> page = studentCaseReportService.studentCaseList(startDate, endDate, kwd, siteId, Integer.MAX_VALUE, 1);
List<StatisticStudentCaseVO> listVO = null;
if (null != page) {
listVO = page.getRecords();
}
try {
//excel生成过程: excel-->sheet-->row-->cell
// 第一步,创建一个Excel文件
XSSFWorkbook wb = new XSSFWorkbook();
// 第二步,在webbook中添加一个sheet,对应Excel文件中的sheet
XSSFSheet sheet = wb.createSheet();
XSSFFont font = wb.createFont();
font.setFontName("宋体");
font.setFontHeightInPoints((short) 14);
font.setBold(true);
XSSFCellStyle style = wb.createCellStyle();
style.setFont(font);
style.setAlignment(HorizontalAlignment.CENTER); // 创建一个居中格式
style.setVerticalAlignment(VerticalAlignment.CENTER);
// 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
XSSFRow row = sheet.createRow((int) 0);
row.setHeight((short) (20 * 20));
// 合并单元格
CellRangeAddress cra = new CellRangeAddress(0, 0, 0, 9); // 起始行, 终止行, 起始列, 终止列
sheet.addMergedRegion(cra);
XSSFCell cell = row.createCell((short) 0);
cell.setCellValue("案例统计报表——按案例统计");
cell.setCellStyle(style);
XSSFRow row1 = sheet.createRow((int) 1);
row.setHeight((short) (20 * 20));
// 合并单元格
CellRangeAddress cra1 = new CellRangeAddress(1, 1, 0, 9); // 起始行, 终止行, 起始列, 终止列
sheet.addMergedRegion(cra1);
XSSFCell cell1 = row1.createCell((short) 0);
if (null != startDate && "" != startDate && null != endDate && "" != endDate) {
cell1.setCellValue("统计周期:" + startDate + "到" + endDate.substring(0, 10));
} else {
cell1.setCellValue("统计周期:不限时间");
}
// 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制short
XSSFRow row2 = sheet.createRow((int) 2);
row2.setHeight((short) (14 * 20));
// 第四步,创建单元格
row2.createCell((short) 0).setCellValue("案例标题");
row2.createCell((short) 1).setCellValue("用户名");
row2.createCell((short) 2).setCellValue("姓名");
row2.createCell((short) 3).setCellValue("所在部门");
row2.createCell((short) 4).setCellValue("所在组织架构");
row2.createCell((short) 5).setCellValue("提交时间");
row2.createCell((short) 6).setCellValue("状态");
row2.createCell((short) 7).setCellValue("点赞数");
row2.createCell((short) 8).setCellValue("举报数");
row2.createCell((short) 9).setCellValue("学习量");
for (int i = 0; i < listVO.size(); i++) {
font.setBold(false);
row = sheet.createRow(i + 3);
row.setHeight((short) (13 * 20));
// 第四步,创建单元格,并设置值
StatisticStudentCaseVO vo = listVO.get(i);
if (vo != null && vo.getTitle() != null) {
row.createCell((short) 0).setCellValue(vo.getTitle());
}
if (vo != null && vo.getAccountName() != null) {
row.createCell((short) 1).setCellValue(vo.getAccountName());
}
if (vo != null && vo.getFullName() != null) {
row.createCell((short) 2).setCellValue(vo.getFullName());
}
if (vo != null && vo.getOrgName() != null && vo.getOrgName() != "") {
row.createCell((short) 3).setCellValue(vo.getOrgName());
} else {
row.createCell((short) 3).setCellValue("--");
}
if (vo != null && vo.getOrgNames() != null && vo.getOrgNames() != "") {
row.createCell((short) 4).setCellValue(vo.getOrgNames());
} else {
row.createCell((short) 4).setCellValue("--");
}
if (vo != null && vo.getTime() != null) {
row.createCell((short) 5).setCellValue(sdf.format(vo.getTime()));
}
if (vo != null && vo.getState() != null) {
row.createCell((short) 6).setCellValue(vo.getState());
}
if (vo != null && vo.getUpNum() != null) {
row.createCell((short) 7).setCellValue(vo.getUpNum());
}
if (vo != null && vo.getInformNum() != null) {
row.createCell((short) 8).setCellValue(vo.getInformNum());
}
if (vo != null && vo.getStudyNum() != null) {
row.createCell((short) 9).setCellValue(vo.getStudyNum());
}
}
// 第五步,写入实体数据 实际应用中这些数据从数据库得到,
StringBuffer fileNameSb = new StringBuffer().append("案例统计报表——按案例统计").append(sf.format(submitTime)).append(".xlsx");
String fileName = fileNameSb.toString();
String path = new StringBuffer().append(requestPath).append(fileNameSb).toString();
FileOutputStream os = null;
File file = null;
try {
os = new FileOutputStream(path);
wb.write(os);
//阿里云返回url
upLoadUrl = OssUpload.upload(path, fileName);
file = new File(path);
success(taskContext, "成功", upLoadUrl);
} catch (Exception e1) {
e1.printStackTrace();
fail(taskContext, "写入数据到Excel的过程中或者上传到阿里云中发生错误" + e1.getMessage());
logger.error("写入数据到Excel的过程中或者上传到阿里云中发生错误" + e1.getMessage());
} finally {
if (os != null) {
os.close();
}
if (wb != null) {
wb.close();
}
if (file != null) {
file.delete();
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
fail(taskContext, "评论信息导出过程中发生错误,请查看日志" + e.getMessage());
logger.error("评论信息导出过程中发生错误,请查看日志" + e.getMessage());
}
return upLoadUrl;
}
}
package com.yizhi.library.application.constant;
/**
* @author Ding
* @className Constant
* @description TODO
* @date 2019/7/22
**/
public interface Constant {
public final static Integer INSERT_CLASSIFY_SUCCESS = 1;
public final static Integer INSERT_CLASSIFY_FAIL = 2;
/**
* 最多只能有三个维度
*/
public final static Integer INSERT_CLASSIFY_INSUFFICIENT = 3;
public final static Integer INSERT_CLASSIFY_IDENTICAL_NAME = 4;
/**
*案例活动培训项目类型
*/
public final static Integer CASELIBRARY_TRANINNING_TYPE = 11;
/**
* 精选案例培训项目类型
*/
public final static Integer STUDENTCASE_TRANINNING_TYPE = 12;
/**
* 向培训项目发送消息queue
*/
String TRAINING_PROJECT_EVENT_QUEUE = "trainingProjectEvent";
public final static String NAME = "name";
public final static String TITLE = "title";
public final static String CASE_LIBRARY_KEYWORD = "keywords";
public final static Integer UP = 2;
public final static Integer DELETED = 0;
}
package com.yizhi.library.application.constant;
public enum MQqueuesEnum {
/**
* 案例活动积分消息
*/
CASELIBRARY("caseLibrary"),
/**
* 案例活动经验消息
*/
EXPERIENCECASELIBRARY("experienceCaseLibrary");
private String key;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
private MQqueuesEnum(String key) {
this.key = key;
}
}
package com.yizhi.library.application.constant;
public enum PointEventEnum {
/**
* 案例活动
*/
POINTCASELIBRARY("pointCaseLibrary");
private String key;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
private PointEventEnum(String key) {
this.key = key;
}
}
package com.yizhi.library.application.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.vo.DroolsVo;
import com.yizhi.library.application.asynchronousTask.ImportAuditor;
import com.yizhi.library.application.asynchronousTask.ImportScorer;
import com.yizhi.library.application.asynchronousTask.ImportSubmitter;
import com.yizhi.library.application.domain.CaseLibrary;
import com.yizhi.library.application.feign.CaseLibraryClient;
import com.yizhi.library.application.param.RelateProjectParam;
import com.yizhi.library.application.service.ICaseLibraryRelatedClassifyService;
import com.yizhi.library.application.service.ICaseLibraryService;
import com.yizhi.library.application.vo.CaseLibraryVO;
import com.yizhi.library.application.vo.CaselibraryAuthorizeVO;
import com.yizhi.library.application.vo.ClassifyVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
* 前端控制器
* </p>
*
* @author dingxiaowei123
* @since 2019-07-03
*/
@RestController
@RequestMapping("/caseLibrary")
public class CaseLibraryController implements CaseLibraryClient {
@Autowired
private ICaseLibraryService caseLibraryService;
@Autowired
private ICaseLibraryRelatedClassifyService caseLibraryRelatedClassifyService;
@Autowired
private ImportSubmitter importSubmitter;
@Autowired
private ImportAuditor importAuditor;
@Autowired
private ImportScorer importScorer;
@Autowired
private IdGenerator idGenerator;
@Override
@GetMapping("/list")
public Page<CaseLibraryVO> getCaseLibraryList(@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "state", required = false) Integer state,
@RequestParam(name = "pageNo") Integer pageNo,
@RequestParam(name = "pageSize") Integer pageSize) {
return caseLibraryService.getCaseLibraryList(name, state, pageNo, pageSize);
}
@Override
@PostMapping("/insert")
public Long insertCaseLibrary(@RequestBody CaseLibraryVO caseLibraryVO) {
if (null == caseLibraryVO.getId()) {
RequestContext res = ContextHolder.get();
String name = caseLibraryVO.getName();
CaseLibrary caseLibrary = new CaseLibrary();
caseLibrary.setName(name);
caseLibrary.setCompanyId(res.getCompanyId());
caseLibrary.setSiteId(res.getSiteId());
List<CaseLibrary> list = caseLibraryService.selectList(new EntityWrapper<>(caseLibrary));
if (CollectionUtils.isNotEmpty(list)) {
return 0L;
}
}
//判断是否有导入
boolean isImport = false;
if (null != caseLibraryVO.getId()) {
if (StringUtils.isNotBlank(caseLibraryVO.getAuditorUrl())) {
isImport = true;
} else if (StringUtils.isNotBlank(caseLibraryVO.getSubmitterUrl())) {
isImport = true;
} else if (StringUtils.isNotBlank(caseLibraryVO.getScorerUrl())) {
isImport = true;
}
}
if (isImport) {
CaseLibrary caseLibrary = null;
if (null != caseLibraryVO.getId()) {
caseLibrary = caseLibraryService.selectById(caseLibraryVO.getId());
}
if (StringUtils.isNotBlank(caseLibraryVO.getAuditorUrl())) {
// 如果原本没有附件,则导入
if (null == caseLibraryVO.getId() || StringUtils.isBlank(caseLibrary.getAuditorUrl())) {
importAuditor(caseLibraryVO.getId(), caseLibraryVO.getAuditorUrl());
//原本有附件,且附件跟新建附件地址不一样,则导入
} else if (!caseLibrary.getAuditorUrl().equals(caseLibraryVO.getAuditorUrl())) {
importAuditor(caseLibraryVO.getId(), caseLibraryVO.getAuditorUrl());
}
}
if (StringUtils.isNotBlank(caseLibraryVO.getSubmitterUrl())) {
// 如果原本没有附件,则导入
if (null == caseLibraryVO.getId() || StringUtils.isBlank(caseLibrary.getSubmitterUrl())) {
importSubmitter(caseLibraryVO.getId(), caseLibraryVO.getSubmitterUrl());
//原本有附件,且附件跟新建附件地址不一样,则导入
} else if (!caseLibrary.getSubmitterUrl().equals(caseLibraryVO.getSubmitterUrl())) {
importSubmitter(caseLibraryVO.getId(), caseLibraryVO.getSubmitterUrl());
}
}
if (StringUtils.isNotBlank(caseLibraryVO.getScorerUrl())) {
// 如果原本没有附件,则导入
if (null == caseLibraryVO.getId() || StringUtils.isBlank(caseLibrary.getScorerUrl())) {
importScorer(caseLibraryVO.getId(), caseLibraryVO.getScorerUrl());
//原本有附件,且附件跟新建附件地址不一样,则导入
} else if (!caseLibrary.getScorerUrl().equals(caseLibraryVO.getScorerUrl())) {
importScorer(caseLibraryVO.getId(), caseLibraryVO.getScorerUrl());
}
}
}
return caseLibraryService.insertCaseLibrary(caseLibraryVO);
}
@Override
@GetMapping("/getClassify")
public List<ClassifyVO> getClassify(@RequestParam(name = "caseLibraryId", required = false) Long caseLibraryId) {
return caseLibraryService.getClassify(caseLibraryId);
}
@Override
@GetMapping("/importAuditor")
public String importAuditor(Long caseLibraryId, String url) {
Map<String, Object> map = new HashMap<>(16);
RequestContext res = ContextHolder.get();
Long taskId = idGenerator.generate();
String serialNo = "AUDITOR-IMPORT-" + taskId.toString();
String taskName = "审核对象导入-" + taskId.toString();
map.put("res", res);
map.put("taskId", taskId);
map.put("serialNo", serialNo);
map.put("taskName", taskName);
map.put("caseLibraryId", caseLibraryId);
map.put("url", url);
importAuditor.execute(map, true);
return serialNo;
}
@Override
@GetMapping("/importScorer")
public String importScorer(Long caseLibraryId, String url) {
Map<String, Object> map = new HashMap<>(16);
RequestContext res = ContextHolder.get();
Long taskId = idGenerator.generate();
String serialNo = "SCORER-IMPORT-" + taskId.toString();
String taskName = "评分对象导入-" + taskId.toString();
map.put("res", res);
map.put("taskId", taskId);
map.put("serialNo", serialNo);
map.put("taskName", taskName);
map.put("caseLibraryId", caseLibraryId);
map.put("url", url);
importScorer.execute(map, true);
return serialNo;
}
@Override
@GetMapping("/importSubmitter")
public String importSubmitter(Long caseLibraryId, String url) {
Map<String, Object> map = new HashMap<>(16);
RequestContext res = ContextHolder.get();
Long taskId = idGenerator.generate();
String serialNo = "SUBMITTER-IMPORT-" + taskId.toString();
String taskName = "必须提交人导入-" + taskId.toString();
map.put("res", res);
map.put("taskId", taskId);
map.put("serialNo", serialNo);
map.put("taskName", taskName);
map.put("caseLibraryId", caseLibraryId);
map.put("url", url);
importSubmitter.execute(map, true);
return serialNo;
}
@Override
@GetMapping("/view")
public CaseLibraryVO viewCaseLibrary(Long caseLibraryId) {
return caseLibraryService.viewCaseLibrary(caseLibraryId);
}
@Override
@PostMapping("/update")
public boolean updateCaseLibrary(@RequestBody CaseLibraryVO caseLibraryVO) {
return caseLibraryService.updateCaseLibrary(caseLibraryVO);
}
@Override
@GetMapping("/relatedClassify/delete")
public boolean deleteRelatedClassify(Long id) {
return caseLibraryRelatedClassifyService.deleteById(id);
}
@Override
@GetMapping("/release")
public boolean releaseCaseLibrary(Long caseLibraryId) {
return caseLibraryService.releaseCaseLibrary(caseLibraryId);
}
@Override
@GetMapping("/putDown")
public boolean putDownCaseLibrary(Long caseLibraryId) {
return caseLibraryService.putDownCaseLibrary(caseLibraryId);
}
@Override
@GetMapping("/delete")
public boolean deleteCaseLibrary(Long caseLibraryId) {
return caseLibraryService.deleteCaseLibrary(caseLibraryId);
}
@Override
@PostMapping("/relateProject")
public boolean relateProject(@RequestBody RelateProjectParam relateProjectParam) {
return caseLibraryService.relateProject(relateProjectParam);
}
@Override
@GetMapping("/cancelRelateProject")
public boolean cancelRelateProject(Long caseLibraryId) {
return caseLibraryService.cancelRelateProject(caseLibraryId);
}
@Override
@GetMapping("/getProjectList")
public Page<CaseLibraryVO> getProjectList(@RequestParam(value = "name", required = false) String name,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
RequestContext res = ContextHolder.get();
return caseLibraryService.getProjectList(name, res.getCompanyId(), res.getSiteId(), pageNo, pageSize);
}
@Override
@PostMapping("/insertAuthorizes")
public boolean insertAuthorizes(@RequestBody List<CaselibraryAuthorizeVO> caseLibraryAuthorizeList) {
return caseLibraryService.insertAuthorizes(caseLibraryAuthorizeList);
}
@Override
@GetMapping("/getAuthorize")
public List<CaselibraryAuthorizeVO> getAuthorize(Long caselibraryId) {
return caseLibraryService.getAuthorize(caselibraryId);
}
@Override
@GetMapping("/getCaseLibrary")
public CaseLibraryVO getCaseLibrary(Long caselibraryId) {
CaseLibrary caselibrary = caseLibraryService.selectById(caselibraryId);
CaseLibraryVO vo = new CaseLibraryVO();
BeanUtils.copyProperties(caselibrary,vo);
return vo;
}
@Override
@GetMapping("/getHomeList")
public Page<CaseLibraryVO> getHomeList(Integer pageNo, Integer pageSize) {
return caseLibraryService.getHomeList(pageNo, pageSize);
}
@Override
@GetMapping("/getPageByDrools")
public Page<DroolsVo> getPageByDrools(String field, String value, Integer pageNo, Integer pageSize) {
Page<DroolsVo> page = new Page<>(pageNo, pageSize);
return caseLibraryService.getPageByDrools(field, value, page);
}
}
package com.yizhi.library.application.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.library.application.domain.Classify;
import com.yizhi.library.application.feign.CaseLibraryClassifyClient;
import com.yizhi.library.application.service.IClassifyService;
import com.yizhi.library.application.vo.ClassifyListVO;
import com.yizhi.library.application.vo.ClassifyVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author dingxiaowei123
* @since 2019-07-03
*/
@RestController
@RequestMapping("/classify")
public class ClassifyController implements CaseLibraryClassifyClient {
@Autowired
private IClassifyService classifyService;
@Override
@PostMapping("/insert")
public Integer insertClassify(@RequestBody ClassifyVO classify) {
return classifyService.insertClassify(classify);
}
@Override
@GetMapping("/delete")
public boolean deleteClassify(Long classifyId) {
Classify classify = new Classify();
classify.setId(classifyId);
classify.setState(0);
return classifyService.updateById(classify);
}
@Override
@GetMapping("/putDown")
public boolean putDownClassify(Long classifyId) {
Classify classify = new Classify();
classify.setId(classifyId);
classify.setState(2);
return classifyService.updateById(classify);
}
@Override
@GetMapping("/release")
public boolean releaseClassify(Long classifyId) {
Classify classify = new Classify();
classify.setId(classifyId);
classify.setState(1);
return classifyService.updateById(classify);
}
@Override
@GetMapping("/list")
public List<ClassifyListVO> getClassifyList() {
return classifyService.getClassifyList();
}
@Override
@GetMapping("/update")
public boolean updateClassify(@RequestParam(name = "classifyId") Long classifyId,
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "description", required = false) String description) {
RequestContext res = ContextHolder.get();
Classify classify = classifyService.selectById(classifyId);
if (StringUtils.isNotBlank(name)) {
classify.setName(name.trim());
//验证用户名是否重复
Classify classify1 = new Classify();
classify1.setParentId(classify.getParentId());
classify1.setName(name);
classify1.setSiteId(res.getSiteId());
EntityWrapper<Classify> entityWrapper = new EntityWrapper<>(classify1);
entityWrapper.notIn("id", classifyId);
entityWrapper.notIn("state", 0);
List<Classify> classifyList = classifyService.selectList(entityWrapper);
if (CollectionUtils.isNotEmpty(classifyList)) {
return false;
}
}
if (StringUtils.isNotBlank(description)) {
classify.setDescription(description.trim());
}
classify.setUpdateById(res.getAccountId());
classify.setUpdateByName(res.getAccountName());
classify.setUpdateTime(new Date());
classifyService.updateById(classify);
return true;
}
@Override
@GetMapping("/move")
public Integer moveClassify(@RequestParam(name = "classifyId") Long classifyId,
@RequestParam(name = "parentId") Long parentId,
@RequestParam(name = "sort") Integer sort,
@RequestParam(name = "type") Integer type) {
RequestContext res = ContextHolder.get();
//如果是第一个上移,直接不操作
if (type == 1) {
Classify preClassify = classifyService.getPreClassify(classifyId, parentId, sort, res.getCompanyId(), res.getSiteId());
if (null == preClassify) {
//已经是第一条,不能上移
return 3;
} else {
Integer preSort = preClassify.getSort();
preClassify.setSort(sort);
preClassify.setUpdateById(res.getAccountId());
preClassify.setUpdateByName(res.getAccountName());
preClassify.setUpdateTime(new Date());
if (!classifyService.updateById(preClassify)) {
//插入失败
return 2;
}
Classify classify = new Classify();
classify.setId(classifyId);
classify.setSort(preSort);
classify.setUpdateById(res.getAccountId());
classify.setUpdateByName(res.getAccountName());
classify.setUpdateTime(new Date());
if (classifyService.updateById(classify)) {
//插入成功
return 1;
} else {
return 2;
}
}
}
//如果是最后一个下移也不操作
if (type == 2) {
Classify suffixClassify = classifyService.getSuffixClassify(classifyId, parentId, sort, res.getCompanyId(), res.getSiteId());
if (null == suffixClassify) {
//已经是最后一条,不能下移
return 4;
} else {
//下一条的排序
Integer suffixSort = suffixClassify.getSort();
suffixClassify.setSort(sort);
suffixClassify.setUpdateById(res.getAccountId());
suffixClassify.setUpdateByName(res.getAccountName());
suffixClassify.setUpdateTime(new Date());
if (!classifyService.updateById(suffixClassify)) {
return 1;
}
Classify classify = new Classify();
classify.setId(classifyId);
classify.setSort(suffixSort);
classify.setUpdateById(res.getAccountId());
classify.setUpdateByName(res.getAccountName());
classify.setUpdateTime(new Date());
if (classifyService.updateById(classify)) {
return 1;
} else {
return 2;
}
}
}
return 2;
}
}
package com.yizhi.library.application.controller;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.library.application.asynchronousTask.ExportCommentList;
import com.yizhi.library.application.feign.CommentManageClient;
import com.yizhi.library.application.vo.CommentReplyVO;
import com.yizhi.library.application.vo.CommentVO;
import com.yizhi.library.application.service.ICommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className CommentManageController
* @description TODO
* @date 2019/7/15
**/
@RestController
@RequestMapping("/comment/manage")
public class CommentManageController implements CommentManageClient {
@Autowired
private ICommentService commentService;
@Autowired
private ExportCommentList exportCommentList;
@Override
@GetMapping("/list")
public Page<CommentVO> getCommentManageList(@RequestParam(name = "studentCaseId", required = true) Long studentCaseId,
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "state", required = false) Integer state,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
return commentService.getCommentManageList(studentCaseId, name, state, pageNo, pageSize);
}
@Override
@GetMapping("/downloadList")
public String downloadList(@RequestParam(name = "studentCaseId", required = true) Long studentCaseId,
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "state", required = false) Integer state) {
Map<String, Object> map = new HashMap<>(16);
RequestContext res = ContextHolder.get();
Long taskId = System.currentTimeMillis();
String serialNo = "EXPORT-COMMENT-LIST-" + taskId.toString();
String taskName = "评论信息导出-" + taskId.toString();
map.put("res", res);
map.put("taskId", taskId);
map.put("serialNo", serialNo);
map.put("taskName", taskName);
map.put("studentCaseId", studentCaseId);
map.put("name", name);
map.put("state", state);
exportCommentList.execute(map, true);
return serialNo;
}
@Override
@GetMapping("/replyList")
public List<CommentReplyVO> getCommentReplyList(@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "state", required = false) Integer state,
@RequestParam("commentId") Long commentId) {
return commentService.getCommentReplyList(name, state, commentId);
}
@Override
@GetMapping("/putDown")
public boolean putDown(@RequestParam(name = "id", required = true) Long id,
@RequestParam(name = "type", required = true) Integer type) {
return commentService.putDown(id, type);
}
@Override
@GetMapping("/release")
public boolean release(Long id, Integer type) {
return commentService.release(id, type);
}
@Override
@GetMapping("/delete")
public boolean delete(@RequestParam(name = "id", required = true) Long id,
@RequestParam(name = "type", required = true) Integer type) {
return commentService.deleteCommentOrReply(id, type);
}
}
package com.yizhi.library.application.controller;
import java.util.HashMap;
import java.util.Map;
import com.yizhi.library.application.asynchronousTask.StatisticStudentCaseAbs;
import com.yizhi.library.application.asynchronousTask.StatisticStudentCaseAccountAbs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/statistic")
public class StatisticStudentCaseController {
@Autowired
private StatisticStudentCaseAbs statisticStudentCaseAbs;
@Autowired
private StatisticStudentCaseAccountAbs statisticStudentCaseAccountAbs;
@GetMapping("/insert/all")
public void insertAll() {
Map<String,Object> map=new HashMap<String,Object>();
statisticStudentCaseAccountAbs.execute(map, true);
statisticStudentCaseAbs.execute(map, true);
}
}
package com.yizhi.library.application.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.event.EventWrapper;
import com.yizhi.core.application.task.AbstractTaskHandler;
import com.yizhi.core.application.task.TaskExecutor;
import com.yizhi.core.application.vo.DroolsVo;
import com.yizhi.library.application.asynchronousTask.StudentCaseBatchExport;
import com.yizhi.library.application.constant.Constant;
import com.yizhi.library.application.domain.StudentCase;
import com.yizhi.library.application.domain.StudentCaseAuthorize;
import com.yizhi.library.application.domain.StudentCaseRelatedClassify;
import com.yizhi.library.application.feign.StudentCaseClient;
import com.yizhi.library.application.param.*;
import com.yizhi.library.application.service.*;
import com.yizhi.library.application.service.impl.StudentCaseServiceImpl;
import com.yizhi.library.application.vo.*;
import com.yizhi.system.application.system.remote.AccountClient;
import com.yizhi.system.application.vo.AccountVO;
import com.yizhi.util.application.event.TrainingProjectEvent;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;
/**
* <p>
* 学生案例表 前端控制器
* </p>
*
* @author dingxiaowei123
* @since 2019-07-09
*/
@RestController
public class StudentCaseController implements StudentCaseClient {
@Autowired
private IStudentCaseService studentCaseService;
@Autowired
private StudentCaseBatchExport studentCaseBatchExport;
@Autowired
private AccountClient accountClient;
@Autowired
private IStudentCaseAuthorizeService studentCaseAuthorizeService;
@Autowired
private TaskExecutor taskExecutor;
@Autowired
private AmqpTemplate amqpTemplate;
@Autowired
private StudentCaseServiceImpl studentCaseServiceImpl;
@Autowired
private IStudentCaseRelatedClassifyService studentCaseRelatedClassifyService;
@Autowired
private IdGenerator idGenerator;
@Autowired
private IStudentCaseScoreRecordeService studentCaseScoreRecordeService;
@Autowired
private IStudentCaseAccessaryService studentCaseAccessaryService;
@Override
@GetMapping("/studentCase/myCaseLibrary/list")
public Page<CaseLibraryVO> myCaseLibraryList(Integer pageNo, Integer pageSize) {
return studentCaseService.myCaseLibraryList(pageNo, pageSize);
}
@Override
public Integer myCaseLibraryTotal() {
return studentCaseService.myCaseLibraryTotal();
}
@Override
@GetMapping("/studentCase/submit/prepare")
public StudentCaseVO prepareStudentCase(Long caseLibraryId) {
return studentCaseService.prepareStudentCase(caseLibraryId);
}
@Override
@PostMapping("/studentCase/submit")
public boolean submitStudentCase(@RequestBody StudentCaseParam studentCaseParam) {
return studentCaseService.submitStudentCase(studentCaseParam);
}
@Override
@GetMapping("/studentCase/getSubmitRecords")
public StudentCaseRecordListVO getSubmitRecords(Long caseLibraryId, String endTime) {
return studentCaseService.getSubmitRecords(caseLibraryId, endTime);
}
@Override
@GetMapping("/studentCase/record/studentCaseRecordSubmit")
public boolean studentCaseRecordSubmit(Long studentCaseId) {
RequestContext res = ContextHolder.get();
Date date = new Date();
StudentCase studentCase = new StudentCase();
studentCase.setId(studentCaseId);
studentCase.setState(1);
studentCase.setAuditState(0);
studentCase.setUpdateTime(date);
studentCase.setUpdateById(res.getAccountId());
studentCase.setUpdateByName(res.getAccountName());
studentCase.setSubmitTime(date);
studentCaseService.updateById(studentCase);
studentCase = studentCaseService.selectById(studentCaseId);
// //清除之前评分空记录
// StudentCaseScoreRecorde studentCaseScoreRecorde = new StudentCaseScoreRecorde();
// studentCaseScoreRecorde.setStudentCaseId(studentCase.getId());
// studentCaseScoreRecordeService.delete(new EntityWrapper<>(studentCaseScoreRecorde));
//
// //插入评分空记录
// studentCaseServiceImpl.insertScorer(studentCase.getCaseLibraryId(), studentCaseId, studentCase.getAccountId());
Long caseLibraryId = studentCase.getCaseLibraryId();
Long accountId = res.getAccountId();
Date now = new Date();
Long siteId = res.getSiteId();
taskExecutor.asynExecute(new AbstractTaskHandler() {
@Override
public void handle() {
try {
amqpTemplate.convertAndSend(Constant.TRAINING_PROJECT_EVENT_QUEUE,
new EventWrapper<TrainingProjectEvent>(caseLibraryId,
TrainingProjectEvent.getInstance(caseLibraryId, Constant.CASELIBRARY_TRANINNING_TYPE, accountId, now, siteId, false
))
);
} catch (Exception e) {
e.printStackTrace();
}
}
});
return true;
}
@Override
@GetMapping("/studentCase/record/studentCaseRecall")
public boolean studentCaseRecall(Long studentCaseId) {
return studentCaseService.studentCaseRecall(studentCaseId);
}
@Override
@GetMapping("/studentCase/record/studentCaseView")
public StudentCaseViewVO studentCaseView(@RequestParam("studentCaseId") Long studentCaseId,
@RequestParam(name = "type", required = false) Integer type) {
return studentCaseService.studentCaseView(studentCaseId, type);
}
@Override
@GetMapping("/studentCase/getAuditList")
public Page<StudentCaseStudyVO> getAuditList(@RequestParam("type") Integer type,
@RequestParam(value = "name", required = false) String name,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
return studentCaseService.getAuditList(type, name, pageNo, pageSize);
}
@Override
@GetMapping("/studentCase/studyStudentCase")
public StudentCaseStudyVO studyStudentCase(@RequestParam("studentCaseId") Long studentCaseId,
@RequestParam("type") Integer type,
@RequestParam(name = "number", required = false) Integer number,
@RequestParam(name = "name", required = false) String name) {
return studentCaseService.studyStudentCase(studentCaseId, type, number, name);
}
@Override
@PostMapping("/studentCase/audit")
public boolean studentCaseAudit(@RequestBody StudentCaseAuditParam studentCaseAuditParam) {
return studentCaseService.studentCaseAudit(studentCaseAuditParam);
}
@Override
@PostMapping("/studentCase/batchAudit")
public boolean studentCaseBatchAudit(@RequestBody StudentCaseAuditParam studentCaseAuditParam) {
return studentCaseService.batchAudit(studentCaseAuditParam);
}
@Override
@PostMapping("/studentCase/score")
public boolean studentCaseScore(@RequestBody StudentCaseAuditParam studentCaseAuditParam) {
return studentCaseService.studentCaseScore(studentCaseAuditParam);
}
@Override
@PostMapping("/studentCase/batchScore")
public boolean studentCaseBatchScore(@RequestBody StudentCaseAuditParam studentCaseAuditParam) {
return studentCaseService.batchScore(studentCaseAuditParam);
}
@Override
@PostMapping("/studentCase/batchExport")
public String studentCaseBatchExport(@RequestBody StudentCaseAuditParam studentCaseAuditParam) {
Map<String, Object> map = new HashMap<>(16);
RequestContext res = ContextHolder.get();
Long taskId = System.currentTimeMillis();
String serialNo = "AUDIT-OR-SCORE-BATCH-EXPORT-" + taskId.toString();
String taskName = "学员案例审核/评分导出案例" + taskId.toString();
map.put("res", res);
map.put("taskId", taskId);
map.put("serialNo", serialNo);
map.put("taskName", taskName);
map.put("idList", studentCaseAuditParam.getIdList());
studentCaseBatchExport.execute(map, true);
return serialNo;
}
@Override
@PostMapping("/studentCase/homeList")
public Page<StudentCaseVO> getStudentCaseHomeList(@RequestBody HomeListParam homeListParam) {
return studentCaseService.getStudentCaseHomeList(homeListParam);
}
@Override
@GetMapping("/studentCase/getStudentCaseDetails")
public StudentCaseStudyVO getStudentCaseDetails(@RequestParam("studentCaseId") Long studentCaseId) {
StudentCase studentCase = studentCaseService.selectById(studentCaseId);
StudentCaseStudyVO studyVO = new StudentCaseStudyVO();
AccountVO accountVO = accountClient.findById(studentCase.getAccountId());
if (null != accountVO) {
studyVO.setAuthorName(accountVO.getFullName());
}
studyVO.setStudentCaseId(studentCase.getId());
studyVO.setTitle(studentCase.getTitle());
studyVO.setLogoUrl(studentCase.getLogoUrl());
studyVO.setCreateTime(studentCase.getCreateTime());
return studyVO;
}
@Override
public boolean insertAuthorizes(@RequestBody List<StudentCaseAuthorizeVO> studentCaseAuthorizeList) {
return studentCaseAuthorizeService.insertAuthorize(studentCaseAuthorizeList);
}
@Override
@GetMapping("/studentCase/getAuthorize")
public List<StudentCaseAuthorizeVO> getAuthorize(Long studentCaseId) {
return studentCaseAuthorizeService.getAuthorize(studentCaseId);
}
@Override
@GetMapping("/studentCase/getFavorites")
public Page<FavoriteVO> getFavorites(@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize,
@RequestParam(value = "name", required = false) String name) {
return studentCaseService.getFavorites(pageNo, pageSize, name);
}
@Override
public Integer getFavoritesCount(Long companyId, Long siteId, Long accountId) {
return studentCaseService.getFavoritesCount(companyId, siteId, accountId);
}
@Override
@GetMapping("/studentCase/getProjectList")
public Page<StudentCaseStudyVO> getProjectList(@RequestParam(value = "name", required = false) String name, Integer pageNo, Integer pageSize) {
return studentCaseService.getProjectList(name, pageNo, pageSize);
}
@Override
public Page<FavoriteVO> getSelectionStudentCaseList(@RequestBody SelectionStudentCaseParam selectionStudentCaseParam) {
return studentCaseService.getSelectionStudentCaseList(selectionStudentCaseParam);
}
@Override
public FavoriteVO getStudentCaseDetail(Long studentCaseId) {
return studentCaseService.getStudentCaseDetail(studentCaseId);
}
@Override
public List<StudentCaseAuthorizeVO> VisibleRange(Long studentCaseId) {
StudentCaseAuthorize studentCaseAuthorize = new StudentCaseAuthorize();
studentCaseAuthorize.setStudentCaseId(studentCaseId);
studentCaseAuthorize.setState(1);
EntityWrapper<StudentCaseAuthorize> wrapper = new EntityWrapper<StudentCaseAuthorize>(studentCaseAuthorize);
List<StudentCaseAuthorize> list = studentCaseAuthorizeService.selectList(wrapper);
List<StudentCaseAuthorizeVO> vos = new ArrayList<>();
for (StudentCaseAuthorize studentcaseauthorize : list) {
StudentCaseAuthorizeVO vo = new StudentCaseAuthorizeVO();
BeanUtils.copyProperties(studentcaseauthorize,vo);
vos.add(vo);
}
return vos;
}
@Override
public boolean modifyRlatedClassifys(@RequestBody UpdateCaseRelatedClassifyParam param) {
RequestContext res = ContextHolder.get();
List<StudentCaseRelatedClassifyVO> list = param.getRelatedClassifyList();
if (CollectionUtils.isNotEmpty(list)) {
for (StudentCaseRelatedClassifyVO relatedClassify : list) {
relatedClassify.setId(idGenerator.generate());
relatedClassify.setStudentCaseId(param.getStudentCaseId());
relatedClassify.setCreateById(res.getAccountId());
relatedClassify.setCreateByName(res.getAccountName());
relatedClassify.setCreateTime(new Date());
relatedClassify.setUpdateById(res.getAccountId());
relatedClassify.setUpdateByName(res.getAccountName());
relatedClassify.setUpdateTime(new Date());
relatedClassify.setCompanyId(res.getCompanyId());
relatedClassify.setSiteId(res.getSiteId());
relatedClassify.setOrgId(res.getOrgId());
}
//先清除原来记录,再插入记录
StudentCaseRelatedClassify studentCaseRelatedClassify1 = new StudentCaseRelatedClassify();
studentCaseRelatedClassify1.setStudentCaseId(param.getStudentCaseId());
studentCaseRelatedClassifyService.delete(new EntityWrapper<>(studentCaseRelatedClassify1));
List<StudentCaseRelatedClassify> vos = new ArrayList<>();
for (StudentCaseRelatedClassifyVO studentCaseRelatedClassifyVO : list) {
StudentCaseRelatedClassify vo = new StudentCaseRelatedClassify();
BeanUtils.copyProperties(studentCaseRelatedClassifyVO,vo);
vos.add(vo);
}
studentCaseRelatedClassifyService.insertBatch(vos);
return true;
}
return false;
}
@Override
public boolean verifyVedio(@RequestBody List<Long> ids) {
return studentCaseAccessaryService.verifyVedio(ids);
}
@Override
public boolean updateTranscodeUrl(@RequestBody Map<String, String> map) {
return studentCaseAccessaryService.updateTranscodeUrl(map);
}
/**
* 搜素下拉框
* @param field
* @param value
* @param pageNo
* @param pageSize
* @return
*/
@Override
public Page<DroolsVo> getPageByDrools(String field, String value, Integer pageNo, Integer pageSize) {
Page<DroolsVo> page = new Page<>(pageNo, pageSize);
return studentCaseService.getPageByDrools(field, value, page);
}
}
package com.yizhi.library.application.controller;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.library.application.asynchronousTask.*;
import com.yizhi.library.application.domain.StudentCase;
import com.yizhi.library.application.feign.StudentCaseManageClient;
import com.yizhi.library.application.param.ExportAuditListParam;
import com.yizhi.library.application.service.IInformRecordeService;
import com.yizhi.library.application.service.IStudentCaseService;
import com.yizhi.library.application.vo.SelectionCaseListVO;
import com.yizhi.library.application.vo.StudentCaseManageListVO;
import com.yizhi.library.application.vo.StudentCaseStudyVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;
/**
* @author Ding
* @className StudentCaseManageController
* @description TODO
* @date 2019/7/25
**/
@RestController
@RequestMapping("/manage/studentCase")
public class StudentCaseManageController implements StudentCaseManageClient {
@Autowired
private IStudentCaseService studentCaseService;
@Autowired
private ExportStudentCaseManageList exportStudentCaseManageList;
@Autowired
private ExportAuditList exportAuditList;
@Autowired
private ImportAuditList importAuditList;
@Autowired
private ExportScoreList exportScoreList;
@Autowired
private ImportScoreList importScoreList;
@Autowired
private SelectionListExport selectionListExport;
@Autowired
private InformListExport informListExport;
@Autowired
private IInformRecordeService informRecordeService;
@Override
@GetMapping("/list")
public Page<StudentCaseManageListVO> studentCaseManageList(@RequestParam(name = "caseLibraryId", required = false) Long caseLibraryId,
@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName,
@RequestParam(name = "state", required = false) Integer state,
@RequestParam(name = "orgName", required = false) String orgName,
@RequestParam(name = "pageNo", required = true) Integer pageNo,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
RequestContext res = ContextHolder.get();
return studentCaseService.studentCaseManageList(caseLibraryId, studentCaseName, accountName, state, orgName, pageNo, pageSize, res, 1);
}
@Override
@GetMapping("/auditOrScore")
public StudentCaseStudyVO studentCaseManageAuditOrScoreView(@RequestParam(name = "studentCaseId", required = true) Long studentCaseId,
@RequestParam(name = "caseLibraryId", required = false) Long caseLibraryId,
@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName,
@RequestParam(name = "state", required = false) Integer state,
@RequestParam(name = "orgName", required = false) String orgName,
@RequestParam(name = "number", required = false) Integer number) {
return studentCaseService.studentCaseManageAuditOrScoreView(studentCaseId, caseLibraryId, studentCaseName, accountName, state, orgName, number);
}
@Override
@GetMapping("/list/export")
public String exportStudentCaseManageList(@RequestParam(name = "caseLibraryName", required = false) String caseLibraryName,
@RequestParam(name = "trainingProjectName", required = false) String trainingProjectName,
@RequestParam(name = "caseLibraryId", required = true) Long caseLibraryId,
@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName,
@RequestParam(name = "state", required = false) Integer state) {
Map<String, Object> map = new HashMap<>(16);
RequestContext res = ContextHolder.get();
Long taskId = System.currentTimeMillis();
String serialNo = "STUDENT-CASE-MANAGE-EXPORT-" + taskId.toString();
String taskName = "审核评分管理列表下载报表-" + taskId.toString();
map.put("res", res);
map.put("taskId", taskId);
map.put("serialNo", serialNo);
map.put("taskName", taskName);
map.put("caseLibraryId", caseLibraryId);
map.put("caseLibraryName", caseLibraryName);
map.put("trainingProjectName", trainingProjectName);
map.put("studentCaseName", studentCaseName);
map.put("accountName", accountName);
map.put("state", state);
exportStudentCaseManageList.execute(map, true);
return serialNo;
}
@Override
@PostMapping("/auditList/export")
public String exportAuditList(@RequestBody ExportAuditListParam param) {
Map<String, Object> map = new HashMap<>(16);
RequestContext res = ContextHolder.get();
Long taskId = System.currentTimeMillis();
String serialNo = "STUDENT-CASE-AUDIT-EXPORT-" + taskId.toString();
String taskName = "导出待审核案例-" + taskId.toString();
map.put("res", res);
map.put("taskId", taskId);
map.put("serialNo", serialNo);
map.put("taskName", taskName);
map.put("param", param);
exportAuditList.execute(map, true);
return serialNo;
}
@Override
@GetMapping("/auditList/import")
public String importAuditList(@RequestParam("ossUrl") String ossUrl) {
Map<String, Object> map = new HashMap<>(16);
RequestContext res = ContextHolder.get();
Long taskId = System.currentTimeMillis();
String serialNo = "STUDENT-CASE-AUDIT-IMPORT" + taskId.toString();
String taskName = "导入审核结果-" + taskId.toString();
map.put("res", res);
map.put("taskId", taskId);
map.put("serialNo", serialNo);
map.put("taskName", taskName);
map.put("url", ossUrl);
importAuditList.execute(map, true);
return serialNo;
}
@Override
@PostMapping("/scoreList/export")
public String exportScoreList(@RequestBody ExportAuditListParam param) {
Map<String, Object> map = new HashMap<>(16);
RequestContext res = ContextHolder.get();
Long taskId = System.currentTimeMillis();
String serialNo = "STUDENT-CASE-SCORE-EXPORT-" + taskId.toString();
String taskName = "导出待评分案例-" + taskId.toString();
map.put("res", res);
map.put("taskId", taskId);
map.put("serialNo", serialNo);
map.put("taskName", taskName);
map.put("param", param);
exportScoreList.execute(map, true);
return serialNo;
}
@Override
@GetMapping("/scoreList/import")
public String importScoreList(@RequestParam("ossUrl") String ossUrl) {
Map<String, Object> map = new HashMap<>(16);
RequestContext res = ContextHolder.get();
Long taskId = System.currentTimeMillis();
String serialNo = "STUDENT-CASE-SCORE-IMPORT-" + taskId.toString();
String taskName = "导入评分结果-" + taskId.toString();
map.put("res", res);
map.put("taskId", taskId);
map.put("serialNo", serialNo);
map.put("taskName", taskName);
map.put("url", ossUrl);
importScoreList.execute(map, true);
return serialNo;
}
@Override
@GetMapping("/selectionList")
public Page<SelectionCaseListVO> getSelectionList(@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName,
@RequestParam(name = "state", required = false) Integer state,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
RequestContext res = ContextHolder.get();
return studentCaseService.getSelectionList(studentCaseName, accountName, state, pageNo, pageSize, res);
}
@Override
@GetMapping("/selectionList/export")
public String selectionListExport(@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName,
@RequestParam(name = "state", required = false) Integer state) {
Map<String, Object> map = new HashMap<>(16);
RequestContext res = ContextHolder.get();
Long taskId = System.currentTimeMillis();
String serialNo = "SELECTION-LIST-EXPORT-" + taskId.toString();
String taskName = "精选案例管理列表下载报表-" + taskId.toString();
map.put("res", res);
map.put("taskId", taskId);
map.put("serialNo", serialNo);
map.put("taskName", taskName);
map.put("studentCaseName", studentCaseName);
map.put("accountName", accountName);
map.put("state", state);
selectionListExport.execute(map, true);
return serialNo;
}
@Override
@GetMapping("/informList")
public Page<StudentCaseManageListVO> getInformList(@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
RequestContext res = ContextHolder.get();
return studentCaseService.getInformList(studentCaseName, accountName, pageNo, pageSize, res);
}
@Override
@GetMapping("/informList/export")
public String informListExport(@RequestParam(name = "studentCaseName", required = false) String studentCaseName,
@RequestParam(name = "accountName", required = false) String accountName) {
Map<String, Object> map = new HashMap<>(16);
RequestContext res = ContextHolder.get();
Long taskId = System.currentTimeMillis();
String serialNo = "INFORM-LIST-EXPORT-" + taskId.toString();
String taskName = "举报记录列表导出-" + taskId.toString();
map.put("res", res);
map.put("taskId", taskId);
map.put("serialNo", serialNo);
map.put("taskName", taskName);
map.put("studentCaseName", studentCaseName);
map.put("accountName", accountName);
informListExport.execute(map, true);
return serialNo;
}
@Override
@GetMapping("/informList/view")
public StudentCaseStudyVO informListView(@RequestParam("informRecordId") Long informRecordId) {
RequestContext res = ContextHolder.get();
return studentCaseService.informListView(informRecordId, res);
}
@Override
@GetMapping("/list/getCount")
public Map<String, Object> getManageListCount(Long caseLibraryId) {
return studentCaseService.getManageListCount(caseLibraryId);
}
@Override
@GetMapping("/putDown")
public boolean putDown(Long studentCaseId) {
StudentCase studentCase = new StudentCase();
studentCase.setId(studentCaseId);
studentCase.setState(3);
return studentCaseService.updateById(studentCase);
}
@Override
@GetMapping("/release")
public boolean release(Long studentCaseId) {
StudentCase studentCase = new StudentCase();
studentCase.setId(studentCaseId);
studentCase.setState(2);
return studentCaseService.updateById(studentCase);
}
@Override
@GetMapping("/delete")
public boolean delete(Long studentCaseId) {
return studentCaseService.deleteStudentCase(studentCaseId);
}
@Override
@GetMapping("/informRecordRemove")
public boolean informRecordRemove(Long informRecordId) {
return informRecordeService.deleteById(informRecordId);
}
}
package com.yizhi.library.application.controller;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.library.application.asynchronousTask.StudentCaseByAccountExport;
import com.yizhi.library.application.asynchronousTask.StudentCaseByOrgExport;
import com.yizhi.library.application.asynchronousTask.StudentCaseExport;
import com.yizhi.library.application.domain.StatisticStudentCaseAccount;
import com.yizhi.library.application.domain.StatisticStudentCaseOrg;
import com.yizhi.library.application.service.IStudentCaseReportService;
import com.yizhi.library.application.vo.StatisticStudentCaseVO;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/studentCaseReport")
public class StudentCaseReportController {
@Autowired
private IStudentCaseReportService studentCaseReportService;
@Autowired
private StudentCaseByAccountExport studentCaseByAccountExport;
@Autowired
private StudentCaseByOrgExport studentCaseByOrgExport;
@Autowired
private StudentCaseExport studentCaseExport;
@GetMapping("/list/org")
public Page<StatisticStudentCaseOrg> studentCaseByOrg(
@ApiParam(value = "查询关键字", required = false) @RequestParam(name = "kwd", required = false) String kwd,
@ApiParam(value = "每页条数,默认10", required = false) @RequestParam(name = "pageSize", required = false, defaultValue = "10") Integer pageSize,
@ApiParam(value = "当前页数", required = false) @RequestParam(name = "pageNo", required = false, defaultValue = "1") Integer pageNo) {
RequestContext requestContext = ContextHolder.get();
Page<StatisticStudentCaseOrg> page = studentCaseReportService.studentCaseByOrg(kwd, requestContext.getSiteId(), pageSize, pageNo);
return page;
}
@GetMapping("/list")
public Page<StatisticStudentCaseVO> studentCaseList(
@ApiParam(value = "开始时间(yyyy-mm-dd)", required = false) @RequestParam(name = "startDate", required = false) String startDate,
@ApiParam(value = "结束时间(yyyy-mm-dd)", required = false) @RequestParam(name = "endDate", required = false) String endDate,
@ApiParam(value = "查询关键字", required = false) @RequestParam(name = "kwd", required = false) String kwd,
@ApiParam(value = "每页条数,默认10", required = false) @RequestParam(name = "pageSize", required = false, defaultValue = "10") Integer pageSize,
@ApiParam(value = "当前页数", required = false) @RequestParam(name = "pageNo", required = false, defaultValue = "1") Integer pageNo) {
RequestContext requestContext = ContextHolder.get();
Page<StatisticStudentCaseVO> page = studentCaseReportService.studentCaseList(startDate, endDate, kwd,requestContext.getSiteId(), pageSize, pageNo);
return page;
}
@GetMapping("/list/account")
public Page<StatisticStudentCaseAccount> studentCaseByAccount(
@ApiParam(value = "查询关键字", required = false) @RequestParam(name = "kwd", required = false) String kwd,
@ApiParam(value = "每页条数,默认10", required = false) @RequestParam(name = "pageSize", required = false, defaultValue = "10") Integer pageSize,
@ApiParam(value = "当前页数", required = false) @RequestParam(name = "pageNo", required = false, defaultValue = "1") Integer pageNo) {
RequestContext requestContext = ContextHolder.get();
Page<StatisticStudentCaseAccount> page = studentCaseReportService.studentCaseByAccount(kwd, requestContext.getSiteId(), pageSize, pageNo);
return page;
}
@GetMapping("/list/account/export")
public Map<String, Object> studentCaseExportByAccount(@ApiParam(value = "查询关键字", required = false) @RequestParam(name = "kwd", required = false) String kwd) {
RequestContext requestContext = ContextHolder.get();
Date submitTime = new Date();
Long taskId = submitTime.getTime();
String serialNo = "USER-EXPORT-" + taskId;
String taskName = "导出学员案例按用户统计报表-" + taskId;
String result = "任务编号:" + serialNo + "。任务名称:" + taskName;
Map<String, Object> map = new HashMap<String, Object>();
map.put("accountId", requestContext.getAccountId());
map.put("siteId", requestContext.getSiteId());
map.put("companyId", requestContext.getCompanyId());
map.put("serialNo", serialNo);
map.put("taskId", taskId);
map.put("submitTime", submitTime);
map.put("taskName", taskName);
map.put("result", result);
map.put("kwd", kwd);
studentCaseByAccountExport.execute(map, true);
return map;
}
@GetMapping("/list/org/export")
public Map<String, Object> studentCaseExportByOrg(@ApiParam(value = "查询关键字", required = false) @RequestParam(name = "kwd", required = false) String kwd) {
RequestContext requestContext = ContextHolder.get();
Date submitTime = new Date();
Long taskId = submitTime.getTime();
String serialNo = "USER-EXPORT-" + taskId;
String taskName = "导出学员案例按部门统计报表-" + taskId;
String result = "任务编号:" + serialNo + "。任务名称:" + taskName;
Map<String, Object> map = new HashMap<String, Object>();
map.put("accountId", requestContext.getAccountId());
map.put("siteId", requestContext.getSiteId());
map.put("companyId", requestContext.getCompanyId());
map.put("serialNo", serialNo);
map.put("taskId", taskId);
map.put("submitTime", submitTime);
map.put("taskName", taskName);
map.put("result", result);
map.put("kwd", kwd);
studentCaseByOrgExport.execute(map, true);
return map;
}
@GetMapping("/list/export")
public Map<String, Object> studentCaseExport(@ApiParam(value = "开始时间(yyyy-mm-dd)", required = false) @RequestParam(name = "startDate", required = false) String startDate,
@ApiParam(value = "结束时间(yyyy-mm-dd)", required = false) @RequestParam(name = "endDate", required = false) String endDate,
@ApiParam(value = "查询关键字", required = false) @RequestParam(name = "kwd", required = false) String kwd) {
RequestContext requestContext = ContextHolder.get();
Date submitTime = new Date();
Long taskId = submitTime.getTime();
String serialNo = "USER-EXPORT-" + taskId;
String taskName = "导出学员案例按案例统计报表-" + taskId;
String result = "任务编号:" + serialNo + "。任务名称:" + taskName;
Map<String, Object> map = new HashMap<String, Object>();
map.put("accountId", requestContext.getAccountId());
map.put("siteId", requestContext.getSiteId());
map.put("companyId", requestContext.getCompanyId());
map.put("serialNo", serialNo);
map.put("taskId", taskId);
map.put("submitTime", submitTime);
map.put("taskName", taskName);
map.put("result", result);
map.put("startDate", startDate);
map.put("endDate", endDate);
map.put("kwd", kwd);
studentCaseExport.execute(map, true);
return map;
}
}
package com.yizhi.library.application.controller;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.feign.StudyCaseClient;
import com.yizhi.library.application.param.CommentParam;
import com.yizhi.library.application.param.InformParam;
import com.yizhi.library.application.service.*;
import com.yizhi.library.application.vo.CommentReplyVO;
import com.yizhi.library.application.vo.CommentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author Ding
* @className StudyCaseController
* @description TODO
* @date 2019/7/12
**/
@RestController
@RequestMapping("/studentCase/study")
public class StudyCaseController implements StudyCaseClient {
@Autowired
private IAdmireRecordeService admireRecordeService;
@Autowired
private IFavoriteService favoriteService;
@Autowired
private IInformRecordeService informRecordeService;
@Autowired
private ICommentService commentService;
@Autowired
private ICommentReplyService commentReplyService;
@Override
@GetMapping("/admire")
public boolean admireStudentCase(Long studentCaseId) {
return admireRecordeService.admireStudentCase(studentCaseId);
}
@Override
@GetMapping("/cancelAdmire")
public boolean cancelAdmireStudentCase(Long studentCaseId) {
return admireRecordeService.cancelAdmireStudentCase(studentCaseId);
}
@Override
@GetMapping("/favorite")
public boolean favorite(Long studentCaseId) {
return favoriteService.favorite(studentCaseId);
}
@Override
@GetMapping("/cancelFavorite")
public boolean cancelFavorite(Long studentCaseId) {
return favoriteService.cancelFavorite(studentCaseId);
}
@Override
@PostMapping("/inform")
public boolean inform(@RequestBody InformParam informParam) {
return informRecordeService.inform(informParam);
}
@Override
@PostMapping("/comment")
public boolean comment(@RequestBody CommentParam commentParam) {
return commentService.comment(commentParam);
}
@Override
@GetMapping("/comment/admire")
public boolean admireComment(Long commentId) {
return commentService.admireComment(commentId);
}
@Override
@GetMapping("/comment/cancelAdmire")
public boolean cancelAdmireComment(Long commentId) {
return commentService.cancelAdmireComment(commentId);
}
@Override
@GetMapping("/comment/list")
public Page<CommentVO> getCommentList(Long studentCaseId, Integer pageNo, Integer pageSize) {
return commentService.getCommentList(studentCaseId, pageNo, pageSize);
}
@Override
@GetMapping("/comment/replyList")
public Page<CommentReplyVO> getReplyList(Long commentId, Integer pageNo, Integer pageSize) {
return commentReplyService.getReplyList(commentId, pageNo, pageSize);
}
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 点赞记录表
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Data
@ApiModel(value = "AdmireRecorde", description = "点赞记录表")
@TableName("admire_recorde")
public class AdmireRecorde {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "学生案例id")
@TableField("student_case_id")
private Long studentCaseId;
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "0:取消 1:点赞")
@TableLogic
private Integer state;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author dingxiaowei123
* @since 2019-07-08
*/
@Data
@ApiModel(value = "Auditor", description = "")
@TableName("auditor")
public class Auditor {
private static final long serialVersionUID = 1L;
private Long Id;
@TableField("case_library_id")
private Long caseLibraryId;
@ApiModelProperty(value = "审核人")
@TableField("auditor_id")
private Long auditorId;
@ApiModelProperty(value = "被审核人")
@TableField("account_id")
private Long accountId;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@ApiModelProperty(value = "0:删除 1:未删除")
@TableLogic
private Integer state;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author dingxiaowei123
* @since 2019-07-03
*/
@Data
@ApiModel(value = "CaseLibrary", description = "")
@TableName("case_library")
public class CaseLibrary {
private static final long serialVersionUID = 1L;
private Long id;
private String name;
@ApiModelProperty(value = "封面图片url")
@TableField("logo_url")
private String logoUrl;
@ApiModelProperty("开始时间")
@TableField("start_time")
private Date startTime;
@ApiModelProperty("结束时间")
@TableField("end_time")
private Date endTime;
@ApiModelProperty("可见范围类型 1:全平台可见 2:指定范围")
@TableField("visible_range")
private Integer visibleRange;
@ApiModelProperty(value = "培训项目id")
@TableField("training_project_id")
private Long trainingProjectId;
@ApiModelProperty(value = "案例要求")
private String explanation;
@ApiModelProperty(value = "文本编辑形式:1文本编辑框, 2导入外部文档格式doc docx pdf")
@TableField("text_edit_type")
private Integer textEditType;
@ApiModelProperty(value = "必须提交人导入附件阿里云地址")
@TableField("submitter_url")
private String submitterUrl;
@ApiModelProperty(value = "必须提交人导入附件名称")
@TableField("submitter_access_name")
private String submitterAccessName;
@ApiModelProperty(value = "审核人导入附件阿里云地址")
@TableField("auditor_url")
private String auditorUrl;
@ApiModelProperty(value = "审核人导入附件名称")
@TableField("auditor_access_name")
private String auditorAccessName;
@ApiModelProperty("审核人权限 0:不允许修改分类 1:允许修改分类")
@TableField("auditor_authorize")
private Integer auditorAuthorize;
@ApiModelProperty(value = "评分人导入附件阿里云地址")
@TableField("scorer_url")
private String scorerUrl;
@ApiModelProperty(value = "评分人导入附件名称")
@TableField("scorer_access_name")
private String scorerAccessName;
@ApiModelProperty(value = "通过审核后 获得积分")
private Integer point;
@ApiModelProperty(value = "学员端显示类型 1:通过后自动上架, 2:通过需要手动上架")
private Integer examine;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
@ApiModelProperty(value = "0:删除,1:草稿,2:上架,3:下架")
private Integer state;
@ApiModelProperty("得分规则 1:平均分 2:最高分 3:任意一人得分 4:多维度打分")
@TableField("score_rule")
private Integer scoreRule;
@ApiModelProperty("是否可修改得分规则 0:不可修改 1:可修改")
@TableField("can_modify_score_rule")
private Integer canModifyScoreRule;
@ApiModelProperty("是否显示打分:0否,1是")
@TableField("show_score")
private Integer showScore;
@ApiModelProperty(value = "评分说明")
@TableField("case_library_dimension_grade_description")
private String caseLibraryDimensionGradeDescription;
@ApiModelProperty(value = "作品封面是否必填 80:必填 默认; 40:非必填")
@TableField("product_cover")
private Integer productCover;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 考试人员范围
* </p>
*
* @author dingxiaowei123
* @since 2019-11-25
*/
@Data
@ApiModel(value = "CaseLibraryAuthorize", description = "考试人员范围")
@TableName("case_library_authorize")
public class CaseLibraryAuthorize {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "学员案例_ID,外键")
@TableField("case_library_id")
private Long caseLibraryId;
@ApiModelProperty(value = "1:用户 、2:组织")
private Integer type;
@ApiModelProperty(value = "存放人或组织的ID")
@TableField("relation_id")
private Long relationId;
@ApiModelProperty(value = "角色名称")
private String name;
@ApiModelProperty(value = "0删除 1有效,默认有效")
@TableLogic
private Integer state;
@ApiModelProperty(value = "创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "创建人ID")
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@ApiModelProperty(value = "创建人姓名")
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@ApiModelProperty(value = "修改时间")
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@ApiModelProperty(value = "修改人ID")
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@ApiModelProperty(value = "修改人姓名")
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 原创活动多维度打分设置
* </p>
*
* @author shengchenglong123
* @since 2020-08-05
*/
@Data
@Api(tags = "CaseLibraryDimensionGrade", description = "原创活动多维度打分设置")
@TableName("case_library_dimension_grade")
public class CaseLibraryDimensionGrade extends Model<CaseLibraryDimensionGrade> {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键id")
private Long id;
@ApiModelProperty(value = "原创活动id")
@TableField("case_library_id")
private Long caseLibraryId;
@ApiModelProperty(value = "维度名称")
private String name;
@ApiModelProperty(value = "分值区间左值")
@TableField("min_score")
private Integer minScore;
@ApiModelProperty(value = "分值区间右值")
@TableField("max_score")
private Integer maxScore;
@ApiModelProperty(value = "0为删除,1已删除")
private Integer deleted;
@ApiModelProperty(value = "排序")
private Integer sort;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.UPDATE)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.UPDATE)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
@Override
protected Serializable pkVal() {
return this.id;
}
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 案例库关联维度表
* </p>
*
* @author dingxiaowei123
* @since 2019-07-05
*/
@Data
@ApiModel(value = "CaseLibraryRelatedClassify", description = "案例库关联维度表")
@TableName("case_library_related_classify")
public class CaseLibraryRelatedClassify {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "案例活动id")
@TableField("case_lirary_id")
private Long caseLiraryId;
@ApiModelProperty(value = "维度id")
@TableField("classify_id")
private Long classifyId;
@ApiModelProperty(value = "维度名称")
@TableField("classify_name")
private String classifyName;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@ApiModelProperty(value = "0:删除,1:未删除")
@TableLogic
private Integer state;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 案例学习记录表
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Data
@ApiModel(value = "CaseStudyRecode", description = "案例学习记录表")
@TableName("case_study_recode")
public class CaseStudyRecode {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "学生案例id")
@TableField("student_case_id")
private Long studentCaseId;
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "0:未完成 1:已完成")
@TableField("finish_state")
@TableLogic
private Integer finishState;
@ApiModelProperty(value = "完成时间")
@TableField("finish_time")
private Date finishTime;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author dingxiaowei123
* @since 2019-07-03
*/
@Data
@ApiModel(value = "Classify", description = "")
@TableName("classify")
public class Classify {
private static final long serialVersionUID = 1L;
private Long id;
private String name;
@ApiModelProperty(value = "0:维度, 1:一级分类 2:二级分类")
private Integer level;
@ApiModelProperty(value = "分类描述")
private String description;
@ApiModelProperty(value = "父级id 0为维度没有父级")
@TableField("parent_id")
private Long parentId;
@ApiModelProperty(value = "分类排序")
private Integer sort;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
@ApiModelProperty(value = "(0:删除, 1:上架, 2:下架)")
private Integer state;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Data
@ApiModel(value = "Comment", description = "")
@TableName("comment")
public class Comment {
private static final long serialVersionUID = 1L;
private Long Id;
@ApiModelProperty(value = "评论人id")
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "学员案例id")
@TableField("student_case_id")
private Long studentCaseId;
@ApiModelProperty(value = "评论内容")
private String content;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField(value = "company_id")
private Long companyId;
@TableField(value = "site_id")
private Long siteId;
@TableField(value = "org_id")
private Long orgId;
@ApiModelProperty(value = "0:删除 1:未删除")
@TableLogic
private Integer state;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 评论点赞记录表
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Data
@ApiModel(value = "CommentAdmire", description = "评论点赞记录表 ")
@TableName("comment_admire")
public class CommentAdmire {
private static final long serialVersionUID = 1L;
private Long Id;
@ApiModelProperty(value = "点赞人id")
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "评论id")
@TableField("comment_id")
private Long commentId;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@ApiModelProperty(value = "0:取消 1:点赞")
@TableLogic
private Integer state;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Data
@ApiModel(value = "CommentReply", description = "")
@TableName("comment_reply")
public class CommentReply {
private static final long serialVersionUID = 1L;
private Long Id;
@ApiModelProperty(value = "评论id")
@TableField("comment_id")
private Long commentId;
@ApiModelProperty(value = "回复人id(评论人或者回复人)")
@TableField("commenter_id")
private Long commenterId;
@ApiModelProperty(value = "被回复人id")
@TableField("reply_account_id")
private Long replyAccountId;
@ApiModelProperty(value = "回复内容")
private String content;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@ApiModelProperty(value = "0:删除 1:未删除")
@TableLogic
private Integer state;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 收藏记录表
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Data
@ApiModel(value = "Favorite", description = "收藏记录表")
@TableName("favorite")
public class Favorite {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "业务id")
@TableField("biz_id")
private Long bizId;
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "业务类型 1:案例")
private Integer type;
@ApiModelProperty(value = "0:取消 1:收藏")
@TableLogic
private Integer state;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 举报记录表
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Data
@ApiModel(value = "InformRecorde", description = "举报记录表")
@TableName("inform_recorde")
public class InformRecorde {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "学生案例id")
@TableField("student_case_id")
private Long studentCaseId;
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "0:移除 1:举报")
@TableLogic
private Integer state;
@ApiModelProperty(value = "举报时间")
@TableField("inform_time")
private Date informTime;
@ApiModelProperty(value = "举报截图url")
@TableField("picture_url")
private String pictureUrl;
@ApiModelProperty(value = "举报描述")
private String description;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 必须提交人表
* </p>
*
* @author dingxiaowei123
* @since 2019-07-08
*/
@Data
@ApiModel(value = "MustSubmit", description = "必须提交人表")
@TableName("must_submit")
public class MustSubmit {
private static final long serialVersionUID = 1L;
private Long id;
@TableField("case_library_id")
private Long caseLibraryId;
@TableField("account_id")
private Long accountId;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@ApiModelProperty(value = "0:删除 1:未删除")
@TableLogic
private Integer state;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author dingxiaowei123
* @since 2019-07-08
*/
@Data
@ApiModel(value = "Scorer", description = "")
@TableName("scorer")
public class Scorer {
private static final long serialVersionUID = 1L;
private Long Id;
@TableField("case_library_id")
private Long caseLibraryId;
@ApiModelProperty(value = "评分人")
@TableField("scorer_id")
private Long scorerId;
@ApiModelProperty(value = "被评分人")
@TableField("account_id")
private Long accountId;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@ApiModelProperty(value = "0:删除 1:未删除")
@TableLogic
private Integer state;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@TableName("statistic_student_case_detail")
public class StatisticStudentCase {
private static final long serialVersionUID = 1L;
private Long id;
/**
*学员案例id
*/
@ApiModelProperty(value = "学员案例id")
@TableField("student_case_id")
private Long studentCaseId;
/**
* 标题
*/
@ApiModelProperty(value = "标题")
@TableField("title")
private String title;
/**
* 用户id
*/
@ApiModelProperty(value = "用户id")
@TableField("account_id")
private Long accountId;
/**
* 账号名称
*/
@ApiModelProperty(value = "账号名称")
@TableField("account_name")
private String accountName;
/**
* 姓名
*/
@ApiModelProperty(value = "姓名")
@TableField("full_name")
private String fullName;
/**
* 提交时间
*/
@ApiModelProperty(value = "提交时间")
@TableField("time")
private Date time;
/**
* 用户状态
*/
@ApiModelProperty(value = "用户状态")
@TableField("state")
private String state;
/**
* 获赞数
*/
@ApiModelProperty(value = "获赞数")
@TableField("up_num")
private Long upNum;
/**
* 举报数
*/
@ApiModelProperty(value = "举报数")
@TableField("inform_num")
private Long informNum;
/**
* 学习量
*/
@ApiModelProperty(value = "学习量")
@TableField("study_num")
private Long studyNum;
/**
* 企业id
*/
@ApiModelProperty(value = "企业id")
@TableField("company_id")
private Long companyId;
/**
* 站点id
*/
@ApiModelProperty(value = "站点id")
@TableField("site_id")
private Long siteId;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
@TableField("org_id")
private Long orgId;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@TableName("statistic_student_case_account")
public class StatisticStudentCaseAccount {
private static final long serialVersionUID = 1L;
private Long id;
/**
* 用户id
*/
@ApiModelProperty(value = "用户id")
@TableField("account_id")
private Long accountId;
/**
* 用户名
*/
@ApiModelProperty(value = "用户名")
@TableField("account_name")
private String accountName;
/**
* 姓名
*/
@ApiModelProperty(value = "姓名")
@TableField("full_name")
private String fullName;
/**
*职务
*/
@ApiModelProperty(value = "职务")
@TableField("position")
private String position;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
@TableField("org_id")
private Long orgId;
/**
* 部门名称
*/
@ApiModelProperty(value = "部门名称")
@TableField("org_name")
private String orgName;
/**
* 父部门/当前部门
*/
@ApiModelProperty(value = " 父部门/当前部门")
@TableField("org_names")
private String orgNames;
/**
* 必须提交数
*/
@ApiModelProperty(value = "必须提交数")
@TableField("must_submit_num")
private Long mustSubmitNum;
/**
* 实际提交数
*/
@ApiModelProperty(value = "实际提交数")
@TableField("submit_num")
private Long submitNum;
/**
* 精选案例数
*/
@ApiModelProperty(value = "精选案例数")
@TableField("case_num")
private Long caseNum;
/**
* 点赞数
*/
@ApiModelProperty(value = "点赞数")
@TableField("ups")
private Long ups;
/**
* 获赞数
*/
@ApiModelProperty(value = "获赞数")
@TableField("up_num")
private Long upNum;
/**
* 举报数
*/
@ApiModelProperty(value = "举报数")
@TableField("informs")
private Long informs;
/**
* 举报数
*/
@ApiModelProperty(value = "被举报数")
@TableField("inform_num")
private Long informNum;
/**
* 学习量
*/
@ApiModelProperty(value = "学习量")
@TableField("study_num")
private Long studyNum;
/**
* 用户状态
*/
@ApiModelProperty(value = "用户状态")
@TableField("status")
private String status;
/**
* 待审核数
*/
@ApiModelProperty(value = "待审核数")
@TableField("audit_num")
private Long auditNum;
/**
* 不通过数
*/
@ApiModelProperty(value = "不通过数")
@TableField("no_audit_num")
private Long noAuditNum;
/**
* 待评分数
*/
@ApiModelProperty(value = "待评分数")
@TableField("no_score_num")
private Long noScoreNum;
/**
* 已评分数
*/
@ApiModelProperty(value = "已评分数")
@TableField("score_num")
private Long scoreNum;
/**
*企业id
*/
@ApiModelProperty(value = "企业id")
@TableField("company_id")
private Long companyId;
/**
* 站点id
*/
@ApiModelProperty(value = "站点id")
@TableField("site_id")
private Long siteId;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@TableName("statistic_student_case_org")
public class StatisticStudentCaseOrg {
private static final long serialVersionUID = 1L;
private Long id;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
@TableField("org_id")
private Long orgId;
/**
* 部门名称
*/
@ApiModelProperty(value = "部门名称")
@TableField("org_name")
private String orgName;
/**
* 提交数
*/
@ApiModelProperty(value = "提交数")
@TableField("submit_num")
private Long submitNum;
/**
* 待审核数
*/
@ApiModelProperty(value = "待审核数")
@TableField("audit_num")
private Long auditNum;
/**
* 不通过数
*/
@ApiModelProperty(value = "不通过数")
@TableField("no_audit_num")
private Long noAuditNum;
/**
* 未评分数
*/
@ApiModelProperty(value = "未评分数")
@TableField("no_score_num")
private Long noScoreNum;
/**
* 已评分数
*/
@ApiModelProperty(value = "已评分数")
@TableField("score_num")
private Long scoreNum;
/**
* 精选案例数
*/
@ApiModelProperty(value = "精选案例数")
@TableField("case_num")
private Long caseNum;
/**
* 点赞数
*/
@ApiModelProperty(value = "点赞数")
@TableField("up_num")
private Long upNum;
/**
* 学习量
*/
@ApiModelProperty(value = "学习量")
@TableField("study_num")
private Long studyNum;
/**
* 企业id
*/
@ApiModelProperty(value = "企业id")
@TableField("company_id")
private Long companyId;
/**
* 站点id
*/
@ApiModelProperty(value = "站点id")
@TableField("site_id")
private Long siteId;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 学生案例表
* </p>
*
* @author dingxiaowei123
* @since 2019-07-09
*/
@Data
@ApiModel(value = "StudentCase", description = "学生案例表")
@TableName("student_case")
public class StudentCase {
private static final long serialVersionUID = 1L;
private Long id;
private String title;
@ApiModelProperty(value = "关联案列活动id")
@TableField("case_library_id")
private Long caseLibraryId;
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "学员案例封面url")
@TableField("logo_url")
private String logoUrl;
@ApiModelProperty("关键字")
@TableField("keywords")
private String keywords;
@ApiModelProperty("得分规则")
@TableField("score_rule")
private Integer scoreRule;
@ApiModelProperty(value = "文本提交类型 1:富文本编辑 2:附件上传")
@TableField("text_edit_type")
private Integer textEditType;
@ApiModelProperty(value = "学员案例内容")
private String content;
@ApiModelProperty(value = "学员案例内容")
@TableField("content_file_name")
private String contentFileName;
@ApiModelProperty(value = "外部文档上传阿里云url")
@TableField("pdf_oss_url")
private String pdfOssUrl;
@ApiModelProperty(value = "附件url")
@TableField("accessory_url")
private String accessoryUrl;
@ApiModelProperty(value = "评分状态 0:待评分 1:已评分")
@TableField("score_state")
private Integer scoreState;
@ApiModelProperty(value = "是否完成所有评分 0:未完成 1:已完成")
@TableField("is_finished_score")
private Integer isFinishedScore;
@ApiModelProperty(value = "得分")
private Integer score;
@ApiModelProperty(value = "学员端显示类型 1:通过后自动上架, 2:通过需要手动上架")
private Integer examine;
@ApiModelProperty(value = "举报状态 0:未举报 1:被举报")
@TableField("inform_state")
private Integer informState;
@ApiModelProperty(value = "审核状态0:待审核 1:审核通过 2:审核不通过")
@TableField("audit_state")
private Integer auditState;
@ApiModelProperty(value = "审核反馈")
@TableField("audit_evaluate")
private String auditEvaluate;
@ApiModelProperty(value = "审核人是否可修改分类 0:不可修改 1:可修改")
@TableField("auditor_authorize")
private Integer auditorAuthorize;
@ApiModelProperty(value = "可见范围类型 1:全平台可见 2:指定范围")
@TableField("visible_range")
private Integer visibleRange;
@ApiModelProperty(value = "0:删除,1:提交待审核,2:上架,3:下架,4草稿")
private Integer state;
@ApiModelProperty(value = "审核时间")
@TableField("audit_time")
private Date auditTime;
@ApiModelProperty(value = "提交时间")
@TableField("submit_time")
private Date submitTime;
@ApiModelProperty(value = "最近修改时间")
@TableField("last_modify_time")
private Date lastModifyTime;
@ApiModelProperty(value = "代提交人id")
@TableField("diplomatic_agent_id")
private Long diplomaticAgentId;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
@TableField("read_num")
private Long readNum;
@TableField("admire_num")
private Long admireNum;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 学员案例附件类
* </p>
*
* @author dingxiaowei123
* @since 2019-12-19
*/
@Data
@ApiModel(value = "StudentCaseAccessary", description = "学员案例附件类")
@TableName("student_case_accessary")
public class StudentCaseAccessary {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "学员案例id")
@TableField("student_case_id")
private Long studentCaseId;
@ApiModelProperty(value = "附件名称 ")
private String name;
@ApiModelProperty(value = "文件大小")
@TableField("file_size")
private String fileSize;
@ApiModelProperty(value = "附件url")
private String url;
@ApiModelProperty(value = "附件状态 0:已删除、1:未删除")
private Integer state;
@ApiModelProperty(value = "创建者id")
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@ApiModelProperty(value = "创建者名称")
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@ApiModelProperty(value = "创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "更新者id")
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@ApiModelProperty(value = "修改者名称")
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@ApiModelProperty(value = "修改时间")
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@ApiModelProperty(value = "站点id")
@TableField("site_id")
private Long siteId;
@ApiModelProperty(value = "组织id")
@TableField("org_id")
private Long orgId;
@ApiModelProperty(value = "企业id")
@TableField("company_id")
private Long companyId;
@ApiModelProperty(value = "转码MP4/MP3流畅地址")
@TableField("video_ld")
private String videoLd;
@ApiModelProperty(value = "转码MP4/MP3标清地址")
@TableField("video_sd")
private String videoSd;
@ApiModelProperty(value = "转码MP4/MP3高清地址")
@TableField("video_hd")
private String videoHd;
@ApiModelProperty(value = "转换状态,0否,1是")
@TableField("convert_state")
private Integer convertState;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 考试人员范围
* </p>
*
* @author dingxiaowei123
* @since 2019-08-05
*/
@Data
@ApiModel(value = "StudentCaseAuthorize", description = "考试人员范围")
@TableName("student_case_authorize")
public class StudentCaseAuthorize {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "学员案例_ID,外键")
@TableField("student_case_id")
private Long studentCaseId;
@ApiModelProperty(value = "1:用户 、2:组织")
private Integer type;
@ApiModelProperty(value = "存放人或组织的ID")
@TableField("relation_id")
private Long relationId;
@ApiModelProperty(value = "角色名称")
private String name;
@ApiModelProperty(value = "0删除 1有效,默认有效")
@TableLogic
private Integer state;
@ApiModelProperty(value = "创建时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "创建人ID")
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@ApiModelProperty(value = "创建人姓名")
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@ApiModelProperty(value = "修改时间")
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@ApiModelProperty(value = "修改人ID")
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@ApiModelProperty(value = "修改人姓名")
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author shengchenglong123
* @since 2020-08-05
*/
@Data
@Api(tags = "StudentCaseDimensionGradeRecord", description = "")
@TableName("student_case_dimension_grade_record")
public class StudentCaseDimensionGradeRecord extends Model<StudentCaseDimensionGradeRecord> {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键id")
private Long id;
@ApiModelProperty(value = "评分维度id")
@TableField("case_library_dimension_grade_id")
private Long caseLibraryDimensionGradeId;
@ApiModelProperty(value = "学员id")
@TableField("account_id")
private Long accountId;
@ApiModelProperty(value = "评阅人id")
@TableField("scorer_id")
private Long scorerId;
@ApiModelProperty(value = "冗余case_library_id")
@TableField("case_library_id")
private Long caseLibraryId;
@ApiModelProperty(value = "学员提交案例id")
@TableField("student_case_id")
private Long studentCaseId;
@ApiModelProperty(value = "得分")
private Integer score;
@ApiModelProperty(value = "0为删除,1已删除")
private Integer deleted;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.UPDATE)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.UPDATE)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
@Override
protected Serializable pkVal() {
return this.id;
}
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 学生案例关联分类表
* </p>
*
* @author dingxiaowei123
* @since 2019-07-09
*/
@Data
@ApiModel(value = "StudentCaseRelatedClassify", description = "学生案例关联分类表")
@TableName("student_case_related_classify")
public class StudentCaseRelatedClassify {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "学生案例id")
@TableField("student_case_id")
private Long studentCaseId;
@ApiModelProperty(value = "一级或者二级,分类id")
@TableField("classify_id")
private Long classifyId;
@ApiModelProperty(value = "1:一级分类 2:二级分类")
private Integer level;
@ApiModelProperty(value = "父级分类id")
@TableField("classify_parent_id")
private Long classifyParentId;
@ApiModelProperty(value = "维度id")
@TableField("root_id")
private Long rootId;
@TableField(value = "create_by_id", fill = FieldFill.INSERT)
private Long createById;
@TableField(value = "create_by_name", fill = FieldFill.INSERT)
private String createByName;
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@TableField(value = "update_by_id", fill = FieldFill.INSERT)
private Long updateById;
@TableField(value = "update_by_name", fill = FieldFill.INSERT)
private String updateByName;
@TableField(value = "update_time", fill = FieldFill.INSERT)
private Date updateTime;
@TableField("company_id")
private Long companyId;
@TableField("site_id")
private Long siteId;
@TableField("org_id")
private Long orgId;
@ApiModelProperty(value = "0:删除,1:未删除")
@TableLogic
private Integer state;
}
package com.yizhi.library.application.domain;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 案例学习记录表
* </p>
*
* @author dingxiaowei123
* @since 2019-11-19
*/
@Data
@ApiModel(value = "StudentCaseScoreRecorde", description = "案例学习记录表")
@TableName("student_case_score_recorde")
public class StudentCaseScoreRecorde {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty(value = "学生案例id")
@TableField("student_case_id")
private Long studentCaseId;
@ApiModelProperty(value = "评分人id")
@TableField("scorer_id")
private Long scorerId;
@ApiModelProperty(value = "评分时间")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "得分")
private Integer score;
}
package com.yizhi.library.application.enums;
import lombok.Data;
public enum DocumentType {
DOCUMENT(1,"文档"),
PICTURE(2,"图片"),
AUDIO(3,"音频"),
VIDEO(4,"视频"),
OTHER(5,"其他");
private Integer type;
private String typeName;
DocumentType(Integer type, String typeName) {
this.type = type;
this.typeName = typeName;
}
public Integer getType() {
return type;
}
public String getTypeName() {
return typeName;
}
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.AdmireRecorde;
/**
* <p>
* 点赞记录表 Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface AdmireRecordeMapper extends BaseMapper<AdmireRecorde> {
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.Auditor;
/**
* <p>
* Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-08
*/
public interface AuditorMapper extends BaseMapper<Auditor> {
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.CaseLibraryAuthorize;
import com.yizhi.library.application.vo.CaselibraryAuthorizeVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 考试人员范围 Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-11-25
*/
public interface CaseLibraryAuthorizeMapper extends BaseMapper<CaseLibraryAuthorize> {
/**
* 获取该用户指定可见范围的案例活动id
*
* @param accountId
* @param relationIds
* @return
*/
List<Long> getAuthorizeIds(@Param("accountId") Long accountId, @Param("relationIds") List<Long> relationIds);
/**
* 案例活动获取指定范围
* @param caselibraryId
* @return
*/
List<CaselibraryAuthorizeVO> getAuthorize(@Param("caselibraryId") Long caselibraryId);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.CaseLibraryDimensionGrade;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* <p>
* 原创活动多维度打分设置 Mapper 接口
* </p>
*
* @author shengchenglong123
* @since 2020-08-05
*/
public interface CaseLibraryDimensionGradeMapper extends BaseMapper<CaseLibraryDimensionGrade> {
/**
* 获取最多纬度条数
* @param siteId
* @return
*/
@Select("SELECT\n" +
"\tmax( num ) \n" +
"FROM\n" +
"\t( SELECT count( * ) num FROM case_library_dimension_grade WHERE deleted = 0 AND site_id = #{siteId} GROUP BY case_library_id ) a")
Integer getMaxDimensionGradeNum(@Param("siteId") Long siteId);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.domain.CaseLibrary;
import com.yizhi.library.application.vo.CaseLibraryVO;
import com.yizhi.library.application.vo.ClassifyVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-03
*/
public interface CaseLibraryMapper extends BaseMapper<CaseLibrary> {
/**
* 案例活动上架
*
* @param caseLibraryId
* @return
*/
boolean releaseCaseLibrary(@Param("caseLibraryId") Long caseLibraryId);
/**
* 案例活动下架
*
* @param caseLibraryId
* @return
*/
boolean putDownCaseLibrary(@Param("caseLibraryId") Long caseLibraryId);
/**
* 案例活动添加维度 获取列表
*
*
* @param classifyIds
* @param caseLibraryId
* @param companyId
* @param siteId
* @return
*/
List<ClassifyVO> getClassify(@Param("classifyIds") List<Long> classifyIds, @Param("caseLibraryId") Long caseLibraryId, @Param("companyId") Long companyId, @Param("siteId") Long siteId);
/**
* 案例活动修改获取信息
*
* @param caseLibraryId
* @return
*/
CaseLibrary viewCaseLibrary(@Param("caseLibraryId") Long caseLibraryId);
/**
* 案例活动修改获取关联维度列表
*
* @param caseLibraryId
* @return
*/
List<Long> relatedClassify(@Param("caseLibraryId") Long caseLibraryId);
/**
* 获取案例库管理列表
*
* @param name
* @param state
* @param page
* @param companyId
* @param siteId
* @return
*/
List<CaseLibraryVO> getCaseLibraryList(@Param("name") String name, @Param("state") Integer state,
Page<CaseLibraryVO> page,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 案例活动逻辑删除
*
* @param caseLibraryId
* @return
*/
boolean deleteCaseLibrary(@Param("caseLibraryId") Long caseLibraryId);
/**
* 案例活动关联培训项目
*
* @param caseLibraryIds
* @param projectId
* @return
*/
boolean relateProject(@Param("caseLibraryIds") List<Long> caseLibraryIds, @Param("projectId") Long projectId);
/**
* 案例活动解除关联项目
*
* @param projectId
* @param caseLibraryIds
* @return
*/
boolean relieveRelateProject(@Param("projectId") Long projectId, @Param("caseLibraryIds") List<Long> caseLibraryIds);
/**
* 培训项目关联案例活动获取列表
*
* @param name
* @param companyId
* @param siteId
* @param page
* @return
*/
List<CaseLibraryVO> getProjectList(@Param("name") String name,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId,
Page<CaseLibraryVO> page);
/**
* 案例活动取消关联培训项目
*
* @param caseLibraryId
* @return
*/
boolean cancelRelateProject(@Param("caseLibraryId") Long caseLibraryId);
/**
* 管理端首页配置上传案例获取案例活动列表
*
* @param companyId
* @param siteId
* @param page
* @return
*/
List<CaseLibraryVO> getHomeList(@Param("companyId") Long companyId, @Param("siteId") Long siteId, Page<CaseLibraryVO> page);
/**
* 查找有子分类的维度
* @param companyId
* @param siteId
* @return
*/
List<Long> getHasChildrenIds(@Param("companyId") Long companyId, @Param("siteId") Long siteId);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.CaseLibraryRelatedClassify;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 案例库关联维度表 Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-05
*/
public interface CaseLibraryRelatedClassifyMapper extends BaseMapper<CaseLibraryRelatedClassify> {
/**
* 查找分类关联的案例活动
* @param classifyId
* @return
*/
List<CaseLibraryRelatedClassify> getRelatedList(@Param("classifyId") Long classifyId);
/**
* 获取案例活动关联维度列表
* @param caseLibraryId
* @return
*/
List<CaseLibraryRelatedClassify> getRelatedClassify(@Param("caseLibraryId") Long caseLibraryId);
/**
* 删除取消关联的分类
* @param caseLibraryId
* @param notDeleteIdList
*/
void deleteNotClassifyList(@Param("caseLibraryId") Long caseLibraryId,@Param("notDeleteIdList") List<Long> notDeleteIdList);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.CaseStudyRecode;
/**
* <p>
* 案例学习记录表 Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface CaseStudyRecodeMapper extends BaseMapper<CaseStudyRecode> {
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.domain.Classify;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-03
*/
public interface ClassifyMapper extends BaseMapper<Classify> {
/**
* 新建分类获取排序
*
* @param parentId
* @param companyId
* @param siteId
* @return
*/
Integer getSort(@Param("parentId") Long parentId, @Param("companyId") Long companyId, @Param("siteId") Long siteId);
/**
* 上移下移获取上一个分类
* @param parentId
* @param sort
* @param companyId
* @param siteId
* @param page
* @return
*/
List<Classify> getPreClassify(@Param("parentId") Long parentId, @Param("sort") Integer sort,
@Param("companyId") Long companyId, @Param("siteId") Long siteId, Page<Classify> page);
/**
* 上移下移获取下一个分类
* @param parentId
* @param sort
* @param companyId
* @param siteId
* @param page
* @return
*/
List<Classify> getSuffixClassify(@Param("parentId") Long parentId, @Param("sort") Integer sort,
@Param("companyId") Long companyId, @Param("siteId") Long siteId, Page<Classify> page);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.CommentAdmire;
/**
* <p>
* 评论点赞记录表
Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface CommentAdmireMapper extends BaseMapper<CommentAdmire> {
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.domain.Comment;
import com.yizhi.library.application.vo.CommentReplyVO;
import com.yizhi.library.application.vo.CommentVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface CommentMapper extends BaseMapper<Comment> {
/**
* 获取评论列表
*
* @param studentCaseId
* @param accountId
* @param page
* @return
*/
List<CommentVO> getCommentList(@Param("studentCaseId") Long studentCaseId,@Param("accountId") Long accountId, Page<CommentVO> page);
/**
* 获取评论管理列表
*
* @param studentCaseId
* @param accountIds
* @param state
* @param companyId
* @param siteId
* @param page
* @return
*/
List<CommentVO> getCommentManageList(@Param("studentCaseId") Long studentCaseId,
@Param("accountIds") List<Long> accountIds,
@Param("state") Integer state,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId, Page<CommentVO> page);
/**
* 获取评论回复列表
*
* @param accountIds
* @param state
* @param commentId
* @return
*/
List<CommentReplyVO> getCommentReplyList(@Param("accountIds") List<Long> accountIds,
@Param("state") Integer state,
@Param("commentId") Long commentId);
/**
* 评论下架
*
* @param id
* @return
*/
boolean putDown(@Param("id") Long id);
/**
* 评论上架
*
* @param id
* @return
*/
boolean release(@Param("id") Long id);
/**
* 评论信息下载,获取回复列表
* @param commentId
* @param state
* @param accountIds
* @return
*/
List<CommentVO> getCommentReplyDownLoadList(@Param("commentId") Long commentId,@Param("state") Integer state,@Param("accountIds") List<Long> accountIds);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.domain.CommentReply;
import com.yizhi.library.application.vo.CommentReplyVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface CommentReplyMapper extends BaseMapper<CommentReply> {
/**
* 获取回复列表
* @param commentId
* @param page
* @return
*/
List<CommentReplyVO> getReplyList(@Param("commentId") Long commentId, Page<CommentReplyVO> page);
/**
* 回复下架
* @param id
* @return
*/
boolean putDown(@Param("id") Long id);
/**
* 回复上架
* @param id
* @return
*/
boolean release(@Param("id") Long id);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.Favorite;
/**
* <p>
* 收藏记录表 Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface FavoriteMapper extends BaseMapper<Favorite> {
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.InformRecorde;
import com.yizhi.library.application.vo.InformVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 举报记录表 Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface InformRecordeMapper extends BaseMapper<InformRecorde> {
/**
* 获取举报列表
* @param studentCaseId
* @return
*/
List<InformVO> getInformList(@Param("studentCaseId") Long studentCaseId);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.MustSubmit;
/**
* <p>
* 必须提交人表 Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-08
*/
public interface MustSubmitMapper extends BaseMapper<MustSubmit> {
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.Scorer;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-08
*/
public interface ScorerMapper extends BaseMapper<Scorer> {
/**
* 案例活动获取评分人
* @param caseLibraryId
* @param accountId
* @return
*/
List<Long> getScorerList(@Param("caseLibraryId") Long caseLibraryId,@Param("accountId") Long accountId);
}
package com.yizhi.library.application.mapper;
import java.util.List;
import com.yizhi.library.application.domain.StatisticStudentCaseAccount;
import com.yizhi.library.application.domain.StudentCase;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
public interface StatisticStudentCaseAccountMapper extends BaseMapper<StatisticStudentCaseAccount> {
StatisticStudentCaseAccount getAccountExportVO(@Param("accountId") Long accountId,@Param("siteId") Long siteId);
List<Long> getSiteIds();
List<StudentCase> getStudentCases();
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.domain.StatisticStudentCase;
import com.yizhi.library.application.vo.StatisticStudentCaseVO;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
public interface StatisticStudentCaseMapper extends BaseMapper<StatisticStudentCase>{
StatisticStudentCase getStatisticStudentCase(@Param("studentCaseId") Long studentCaseId);
/**
* 学员案例报表(按案例统计)
* @param startDate
* @param endDate
* @param kwd
* @param siteId
* @param page
* @return
*/
List<StatisticStudentCaseVO> studentCaseList(@Param("startDate") String startDate,
@Param("endDate") String endDate,
@Param("kwd") String kwd,
@Param("siteId") Long siteId,
Page<StatisticStudentCaseVO> page);
}
package com.yizhi.library.application.mapper;
import com.yizhi.library.application.domain.StatisticStudentCaseOrg;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.Map;
public interface StatisticStudentCaseOrgMapper extends BaseMapper<StatisticStudentCaseOrg> {
StatisticStudentCaseOrg getStudentCaseOrg(@Param("orgId") Long orgId, @Param("siteId") Long siteId);
/**
* 获取组织架构
*
* @param companyId
* @param siteId
* @return
*/
@MapKey("orgId")
Map<Long, Map<String, String>> getOrgNamesMap(@Param("companyId") Long companyId, @Param("siteId") Long siteId);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.StudentCaseAccessary;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-12-19
*/
public interface StudentCaseAccessaryMapper extends BaseMapper<StudentCaseAccessary> {
/**
* 删除对应附件
* @param studentCaseId
*/
void deleteAccessary(@Param("studentCaseId") Long studentCaseId);
/**
* 通知案例微服务该附件是视频/音频文件,等待转码
* @param ids
* @return
*/
boolean verifyVedio(@Param("ids") List<Long> ids);
/**
* 更新视频/音频转码url
* @param id
* @param videoLd
* @param videoHd
* @param videoSd
* @return
*/
boolean updateTranscodeUrl(@Param("id") Long id,
@Param("videoLd") String videoLd,
@Param("videoHd") String videoHd,
@Param("videoSd") String videoSd);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.StudentCaseAuthorize;
import com.yizhi.library.application.vo.StudentCaseAuthorizeVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 考试人员范围 Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-08-05
*/
public interface StudentCaseAuthorizeMapper extends BaseMapper<StudentCaseAuthorize> {
/**
*获取指定范围列表
* @param studentCaseId
* @return
*/
List<StudentCaseAuthorizeVO> getAuthorize(@Param("studentCaseId") Long studentCaseId);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.StudentCaseDimensionGradeRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
/**
* <p>
* Mapper 接口
* </p>
*
* @author shengchenglong123
* @since 2020-08-05
*/
public interface StudentCaseDimensionGradeRecordMapper extends BaseMapper<StudentCaseDimensionGradeRecord> {
@Select("select AVG(score) from student_case_dimension_grade_record " +
"where " +
"deleted = 0 " +
"and account_id = #{accountId} " +
"and case_library_dimension_grade_id = #{caseLibraryDimensionGradeId} " +
"and student_case_id = #{studentCaseId}")
Double getAverageScore(@Param("accountId") Long accountId, @Param("caseLibraryDimensionGradeId") Long caseLibraryDimensionGradeId, @Param("studentCaseId") Long studentCaseId);
@Update("update student_case_dimension_grade_record set deleted = 1 " +
"where case_library_dimension_grade_id = #{caseLibraryDimensionGradeId}")
Integer deleteNotAdminRecord(@Param("caseLibraryDimensionGradeId") Long caseLibraryDimensionGradeId);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.domain.CaseLibrary;
import com.yizhi.library.application.domain.StudentCase;
import com.yizhi.library.application.vo.StudentCaseViewVO;
import com.yizhi.library.application.vo.*;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* <p>
* 学生案例表 Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-09
*/
public interface StudentCaseMapper extends BaseMapper<StudentCase> {
/**
* pc端,移动端我的案例列表
*
* @param accountId
* @param caseLibraryIds
* @param companyId
* @param siteId
* @param page
* @return
*/
List<CaseLibraryVO> myCaseLibraryList(@Param("accountId") Long accountId, @Param("caseLibraryIds") List<Long> caseLibraryIds, @Param("companyId") Long companyId, @Param("siteId") Long siteId, Page<CaseLibraryVO> page);
/**
* pc端,移动端我的案例记录总数
* @param accountId
* @param caseLibraryIds
* @param companyId
* @param siteId
* @return
*/
Integer myCaseLibraryTotal(@Param("accountId") Long accountId,@Param("caseLibraryIds") List<Long> caseLibraryIds,@Param("companyId") Long companyId,@Param("siteId") Long siteId);
/**
* 学员案例提交记录中撤回
*
* @param studentCaseId
* @return
*/
boolean studentCaseRecall(@Param("studentCaseId") Long studentCaseId);
/**
* 学员案例记录查看或者编辑获得信息
*
* @param studentCaseId
* @return
*/
StudentCaseViewVO studentCaseView(@Param("studentCaseId") Long studentCaseId);
/**
* 学员案例学习获取案例信息/审核,评分获取案例信息
*
* @param studentCaseId
* @param type
* @param accountId
* @return
*/
StudentCaseStudyVO studyStudentCase(@Param("studentCaseId") Long studentCaseId,
@Param("type") Integer type,
@Param("accountId") Long accountId);
/**
* 学员案例评分提交
*
* @param studentCaseId
* @param score
* @return
*/
boolean studentCaseScore(@Param("studentCaseId") Long studentCaseId,
@Param("score") Integer score);
/**
* 学员端审核获得案例信息
*
* @param accountId
* @param companyId
* @param siteId
* @param name
* @param pageSize
* @param page
* @return
*/
List<StudentCaseStudyVO> getAuditCaseVO(@Param("accountId") Long accountId,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId,
@Param("name") String name,
@Param("pageSize") Integer pageSize,
Page<StudentCaseStudyVO> page);
/**
* 学员端评分获得案例信息
*
* @param accountId
* @param companyId
* @param siteId
* @param name
* @param pageSize
* @param page
* @return
*/
List<StudentCaseStudyVO> getScoreCaseVO(@Param("accountId") Long accountId,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId,
@Param("name") String name,
@Param("pageSize") Integer pageSize,
Page<StudentCaseStudyVO> page);
/**
* 获取审核通过后前端显示类型(自动上架/手动上架)
*
* @param studentCaseId
* @return
*/
Map<String, Object> getExamine(@Param("studentCaseId") Long studentCaseId);
/**
* 批量审核(通过)
*
* @param auditState
* @param audiEvaluate
* @param idList
* @return
*/
// boolean batchAuditPass(@Param("auditState") Integer auditState, @Param("audiEvaluate") String audiEvaluate, @Param("idList") List<Long> idList);
//
// /**
// * 批量审核(不通过)
// *
// * @param auditState
// * @param audiEvaluate
// * @param idList
// * @return
// */
boolean batchAuditNoPass(@Param("auditState") Integer auditState, @Param("audiEvaluate") String audiEvaluate, @Param("idList") List<Long> idList);
/**
* 批量评分
*
* @param score
* @param idList
* @return
*/
boolean batchScore(@Param("score") Integer score, @Param("idList") List<Long> idList);
/**
* 管理员批量评分
* @param score
* @param idList
* @return
*/
boolean batchAdminScore(@Param("score") Integer score,@Param("idList") List<Long> idList);
/**
* 学员案例审核/评分导出案例
*
* @param idList
* @return
*/
List<StudentCaseVO> studentCaseBatchExport(@Param("idList") List<Long> idList);
/**
* 首页配置获取列表
*
*
* @param accountIds
* @param key
* @param companyId
* @param siteId
* @param studentCaseIds
* @param page
* @return
*/
List<StudentCaseVO> getStudentCaseHomeList(@Param("accountIds") List<Long> accountIds,
@Param("key") String key,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId,
@Param("studentCaseIds") List<Long> studentCaseIds,
Page<StudentCaseVO> page);
/**
* 所有学员案例管理列表/审核评分管理列表
*
* @param caseLibraryId
* @param accountIds
* @param studentCaseName
* @param auditState
* @param scoreState
* @param companyId
* @param siteId
* @param page
* @return
*/
List<StudentCaseManageListVO> studentCaseManageList(@Param("caseLibraryId") Long caseLibraryId,
@Param("accountIds") List<Long> accountIds, @Param("studentCaseName") String studentCaseName,
@Param("auditState") Integer auditState,
@Param("scoreState") Integer scoreState,
@Param("companyId") Long companyId, @Param("siteId") Long siteId,
Page<StudentCaseManageListVO> page);
/**
* 所有学员案例管理列表/审核评分管理列表导出
* @param caseLibraryId
* @param accountIds
* @param studentCaseName
* @param auditState
* @param scoreState
* @param companyId
* @param siteId
* @param page
* @return
*/
List<StudentCaseManageListVO> studentCaseManageExport(@Param("caseLibraryId") Long caseLibraryId,
@Param("accountIds") List<Long> accountIds, @Param("studentCaseName") String studentCaseName,
@Param("auditState") Integer auditState,
@Param("scoreState") Integer scoreState,
@Param("companyId") Long companyId, @Param("siteId") Long siteId,
Page<StudentCaseManageListVO> page);
/**
* 学员案例审核/评分获取学员案例信息
*
* @param studentCaseId
* @return
*/
StudentCaseStudyVO studentCaseManageAuditOrScoreView(@Param("studentCaseId") Long studentCaseId);
/**
* 导出待审核案例
*
* @param studentCaseIds
* @param companyId
* @param siteId
* @return
*/
List<StudentCaseManageListVO> exportAuditList(@Param("studentCaseIds") List<Long> studentCaseIds,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 导出待评分案例
*
* @param studentCaseIds
* @param companyId
* @param siteId
* @return
*/
List<StudentCaseManageListVO> exportScoreList(@Param("studentCaseIds") List<Long> studentCaseIds,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 精选案例管理列表
*
* @param studentCaseName
* @param state
* @param accountIds
* @param page
* @param companyId
* @param siteId
* @return
*/
List<SelectionCaseListVO> getSelectionList(@Param("studentCaseName") String studentCaseName,
@Param("state") Integer state,
@Param("accountIds") List<Long> accountIds,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId,
Page<SelectionCaseListVO> page);
/**
* 举报记录列表
*
* @param studentCaseName
* @param accountIds
* @param companyId
* @param siteId
* @param page
* @return
*/
List<StudentCaseManageListVO> getInformList(@Param("studentCaseName") String studentCaseName,
@Param("accountIds") List<Long> accountIds,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId, Page<StudentCaseManageListVO> page);
/**
* 举报记录列表导出
*
* @param studentCaseName
* @param accountIds
* @param companyId
* @param siteId
* @return
*/
List<StudentCaseManageListVO> getInformExportList(@Param("studentCaseName") String studentCaseName,
@Param("accountIds") List<Long> accountIds,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 举报记录查看
*
* @param informRecordId
* @return
*/
StudentCaseStudyVO informListView(@Param("informRecordId") Long informRecordId);
/**
* 获取待审核/评分记录数
*
* @param caseLibraryId
* @param accountIds
* @param studentCaseName
* @param auditState
* @param scoreState
* @param companyId
* @param siteId
* @return
*/
Integer getStudentCaseManageCount(@Param("caseLibraryId") Long caseLibraryId,
@Param("accountIds") List<Long> accountIds,
@Param("studentCaseName") String studentCaseName,
@Param("auditState") Integer auditState,
@Param("scoreState") Integer scoreState,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 通过案例活动i获得项目id
*
* @param caseLibraryId
* @return
*/
Map<String, Object> getProjectByCaseLibrary(@Param("caseLibraryId") Long caseLibraryId);
/**
* 通过学员案例获得项目id
*
* @param studentLibraryId
* @return
*/
Map<String, Object> getProjectByStudentCase(@Param("studentLibraryId") Long studentLibraryId);
/**
* 获取案例活动信息
*
* @param caseLibraryId
* @return
*/
CaseLibrary getCaseLibrary(@Param("caseLibraryId") Long caseLibraryId);
/**
* 管理端获取审核,评分上一篇id
*
* @param caseLibraryId
* @param studentCaseId
* @param submitTime
* @param auditState
* @param scoreState
* @param accountIds
* @param companyId
* @param siteId
* @return
*/
List<Long> getManageAuditOrScorePrefix(@Param("caseLibraryId") Long caseLibraryId,
@Param("studentCaseId") Long studentCaseId,
@Param("submitTime") Date submitTime,
@Param("auditState") Integer auditState,
@Param("scoreState") Integer scoreState,
@Param("accountIds") List<Long> accountIds,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 管理端获取审核,评分下一篇id
*
* @param caseLibraryId
* @param studentCaseId
* @param submitTime
* @param auditState
* @param scoreState
* @param accountIds
* @param companyId
* @param siteId
* @return
*/
List<Long> getManageAuditOrScoreSuffix(@Param("caseLibraryId") Long caseLibraryId,
@Param("studentCaseId") Long studentCaseId,
@Param("submitTime") Date submitTime,
@Param("auditState") Integer auditState,
@Param("scoreState") Integer scoreState,
@Param("accountIds") List<Long> accountIds,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 举报记录获取上一条id
*
* @param informRecordId
* @param informTime
* @param accountIds
* @param companyId
* @param siteId
* @return
*/
List<Long> getManageInformPrefix(@Param("informRecordId") Long informRecordId,
@Param("informTime") Date informTime,
@Param("accountIds") List<Long> accountIds,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 举报记录获取下一条id
*
* @param informRecordId
* @param informTime
* @param accountIds
* @param companyId
* @param siteId
* @return
*/
List<Long> getManageInformSuffix(@Param("informRecordId") Long informRecordId,
@Param("informTime") Date informTime,
@Param("accountIds") List<Long> accountIds,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 学员端审核获取上一条
*
* @param studentCaseId
* @param submitTime
* @param accountId
* @param companyId
* @param siteId
* @return
*/
List<Long> getStudentAuditPrefix(@Param("studentCaseId") Long studentCaseId,
@Param("submitTime") Date submitTime,
@Param("accountId") Long accountId,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 学员端审核获取下一条
*
* @param studentCaseId
* @param submitTime
* @param accountId
* @param companyId
* @param siteId
* @return
*/
List<Long> getStudentAuditSuffix(@Param("studentCaseId") Long studentCaseId,
@Param("submitTime") Date submitTime,
@Param("accountId") Long accountId,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 学员端评分获取上一条
*
* @param studentCaseId
* @param submitTime
* @param accountId
* @param companyId
* @param siteId
* @return
*/
List<Long> getStudentScorePrefix(@Param("studentCaseId") Long studentCaseId,
@Param("submitTime") Date submitTime,
@Param("accountId") Long accountId,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 学员端评分获取下一条
*
* @param studentCaseId
* @param submitTime
* @param accountId
* @param companyId
* @param siteId
* @return
*/
List<Long> getStudentScoreSuffix(@Param("studentCaseId") Long studentCaseId,
@Param("submitTime") Date submitTime,
@Param("accountId") Long accountId,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId);
/**
* 学员案例逻辑删除
*
* @param studentCaseId
* @return
*/
boolean deleteStudentCase(@Param("studentCaseId") Long studentCaseId);
/**
* 获取我的收藏案例列表
*
* @param companyId
* @param siteId
* @param name
* @param accountId
* @param page
* @return
*/
List<FavoriteVO> getFavorites(@Param("companyId") Long companyId,
@Param("siteId") Long siteId,
@Param("name") String name,
@Param("accountId") Long accountId,
Page<FavoriteVO> page);
/**
* 培训项目关联精选案例获取列表
*
* @param name
* @param companyId
* @param siteId
* @param page
* @return
*/
List<StudentCaseStudyVO> getProjectList(@Param("name") String name,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId, Page<StudentCaseStudyVO> page);
/**
* 分类筛选获得学员案例id
*
* @param companyId
* @param siteId
* @param classifyIds
* @return
*/
List<Long> getStudentCaseIdsByClassifyIds(@Param("companyId") Long companyId,
@Param("siteId") Long siteId,
@Param("classifyIds") List<Long> classifyIds);
/**
* 精选案例搜索页获取列表
* @param key
* @param rangeIds
* @param accountIds
* @param studentCaseIds
* @param sortType
* @param companyId
* @param siteId
* @param page
* @return
*/
List<FavoriteVO> getSelectionStudentCaseList(@Param("key") String key,
@Param("accountIds") List<Long> accountIds,
@Param("rangeIds") List<Long> rangeIds,
@Param("studentCaseIds") List<Long> studentCaseIds,
@Param("sortType") Integer sortType,
@Param("companyId") Long companyId,
@Param("siteId") Long siteId,
Page<FavoriteVO> page);
/**
* 获取指定范围的该用户可见的学员案例id
* @param relationIds
* @return
*/
List<Long> getRangeIds(@Param("relationIds") List<Long> relationIds);
/**
* 首页获取精选案例信息
* @param studentCaseId
* @return
*/
FavoriteVO getStudentCaseDetail(@Param("studentCaseId") Long studentCaseId);
/**
* 首页获取案例点赞总数
* @param companyId
* @param siteId
* @param accountId
* @return
*/
Integer getFavoritesCount(@Param("companyId") Long companyId,@Param("siteId") Long siteId,@Param("accountId") Long accountId);
/**
* 更新学习数
* @param studentCaseId
*/
void updateStudyNum(@Param("studentCaseId") Long studentCaseId);
/**
* 获取有提交记录的案例活动id
* @param companyId
* @param siteId
* @param accountId
* @return
*/
List<Long> getSubmitCaseLibraryIds(@Param("companyId") Long companyId,@Param("siteId") Long siteId,@Param("accountId") Long accountId);
/**
* 每次跑批初始化学员案例表中的点赞数
*/
void initializeAdmireNum();
/**
* 每次跑批校正学员案例表中的点赞数
*/
void checkAdmireNum();
/**
* 校正点赞数
* @param id
* @return
*/
Integer getAdmireNum(@Param("id") Long id);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.StudentCaseRelatedClassify;
import com.yizhi.library.application.vo.StudentRelatedClassifyVO;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* 学生案例关联分类表 Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-07-09
*/
public interface StudentCaseRelatedClassifyMapper extends BaseMapper<StudentCaseRelatedClassify> {
/**
* 获取学员案例在某个维度下关联的分类名称以及关联主体id
*
* @param rootId
* @param studentCaseId
* @return
*/
StudentRelatedClassifyVO getRelatedClassify(@Param("rootId") Long rootId, @Param("studentCaseId") Long studentCaseId);
/**
* 查找一级或者二级分类是否被学员案例关联
* @param classifyId
* @return
*/
Integer getIsRelated(@Param("classifyId") Long classifyId);
}
package com.yizhi.library.application.mapper;
import java.util.List;
import com.yizhi.library.application.domain.StudentCase;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.vo.StudentCaseAccountExportVO;
import com.yizhi.library.application.vo.StudentCaseExportVO;
public interface StudentCaseReportMapper extends BaseMapper<StudentCase> {
List<StudentCaseExportVO> studentCaseList(@Param("startDate") String startDate,@Param("endDate") String endDate,@Param("kwd") String kwd,@Param("siteId") Long siteId);
List<StudentCaseAccountExportVO> studentCaseByAccount(@Param("siteId") Long siteId,@Param("accountIds") List<Long> accountIds);
}
package com.yizhi.library.application.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yizhi.library.application.domain.StudentCaseScoreRecorde;
import org.apache.ibatis.annotations.Param;
/**
* <p>
* 案例学习记录表 Mapper 接口
* </p>
*
* @author dingxiaowei123
* @since 2019-11-19
*/
public interface
StudentCaseScoreRecordeMapper extends BaseMapper<StudentCaseScoreRecorde> {
/**
* 获取学员案例指定打分人未打分人数
*
* @param studentCaseId
* @return
*/
Integer getUnscoredCount(@Param("studentCaseId") Long studentCaseId);
/**
* 获取平均分
*
*
* @param caseLibraryId
* @param accountId
* @param studentCaseId
* @return
*/
Integer getAverageScore(@Param("caseLibraryId") Long caseLibraryId,@Param("accountId") Long accountId, @Param("studentCaseId") Long studentCaseId);
/**
* 获取最高分
*
*
* @param caseLibraryId
* @param accountId
* @param studentCaseId
* @return
*/
Integer getMaxScore(@Param("caseLibraryId") Long caseLibraryId,@Param("accountId") Long accountId, @Param("studentCaseId") Long studentCaseId);
/**
* 更新评分记录
*
* @param studentCaseId
* @param accountId
* @param score
*
* @return
*/
boolean updateScoreRcorde(@Param("studentCaseId") Long studentCaseId, @Param("accountId") Long accountId, @Param("score") Integer score);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.AdmireRecorde;
/**
* <p>
* 点赞记录表 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface IAdmireRecordeService extends IService<AdmireRecorde> {
/**
* 学习案例点赞
* @param studentCaseId
* @return
*/
boolean admireStudentCase(Long studentCaseId);
/**
* 学习案例点取消赞
* @param studentCaseId
* @return
*/
boolean cancelAdmireStudentCase(Long studentCaseId);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.Auditor;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-08
*/
public interface IAuditorService extends IService<Auditor> {
boolean insertList(List<Auditor> auditorImportList);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.CaseLibraryAuthorize;
import com.yizhi.library.application.vo.CaselibraryAuthorizeVO;
import java.util.List;
/**
* <p>
* 考试人员范围 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-11-25
*/
public interface ICaseLibraryAuthorizeService extends IService<CaseLibraryAuthorize> {
/**
* 获取该用户指定可见范围的案例活动id
*
* @param accountId
* @param relationIds
* @return
*/
List<Long> getAuthorizeIds(Long accountId, List<Long> relationIds);
/**
* 案例活动获取指定范围
* @param caselibraryId
* @return
*/
List<CaselibraryAuthorizeVO> getAuthorize(Long caselibraryId);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.CaseLibraryDimensionGrade;
/**
* <p>
* 原创活动多维度打分设置 服务类
* </p>
*
* @author shengchenglong123
* @since 2020-08-05
*/
public interface ICaseLibraryDimensionGradeService extends IService<CaseLibraryDimensionGrade> {
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.CaseLibraryRelatedClassify;
import java.util.List;
/**
* <p>
* 案例库关联维度表 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-05
*/
public interface ICaseLibraryRelatedClassifyService extends IService<CaseLibraryRelatedClassify> {
/**
* 查看维度分类是否关联了案例活动(案例活动为草稿/上架/下架状态)
* @param id
* @return
*/
boolean getIsRelated(Long id);
/**
* 获取案例活动关联维度列表
* @param caseLibraryId
* @return
*/
List<CaseLibraryRelatedClassify> getRelatedClassify(Long caseLibraryId);
/**
* 删除取消关联的分类
* @param caseLibraryId
* @param notDeleteIdList
*/
void deleteNotClassifyList(Long caseLibraryId,List<Long> notDeleteIdList);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.core.application.vo.DroolsVo;
import com.yizhi.library.application.domain.CaseLibrary;
import com.yizhi.library.application.param.RelateProjectParam;
import com.yizhi.library.application.vo.CaseLibraryVO;
import com.yizhi.library.application.vo.CaselibraryAuthorizeVO;
import com.yizhi.library.application.vo.ClassifyVO;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-03
*/
public interface ICaseLibraryService extends IService<CaseLibrary> {
/**
* 新建案例活动
*
* @param caseLibraryVO
* @return
*/
Long insertCaseLibrary(CaseLibraryVO caseLibraryVO);
/**
* 案例活动修改
*
* @param caseLibraryVO
* @return
*/
boolean updateCaseLibrary(CaseLibraryVO caseLibraryVO);
/**
* 案例活动发布上架
*
* @param caseLibraryId
* @return
*/
boolean releaseCaseLibrary(Long caseLibraryId);
/**
* 案例活动下架
*
* @param caseLibraryId
* @return
*/
boolean putDownCaseLibrary(Long caseLibraryId);
/**
* 新建案例活动获取维度列表
*
* @param caseLibraryId
* @return
*/
List<ClassifyVO> getClassify(Long caseLibraryId);
/**
* 案例活动修改获取信息
*
* @param caseLibraryId
* @return
*/
CaseLibraryVO viewCaseLibrary(Long caseLibraryId);
/**
* 获取案例库管理列表
*
* @param name
* @param state
* @param pageNo
* @param pageSize
* @return
*/
Page<CaseLibraryVO> getCaseLibraryList(String name, Integer state, Integer pageNo, Integer pageSize);
/**
* 逻辑删除案例活动
*
* @param caseLibraryId
* @return
*/
boolean deleteCaseLibrary(Long caseLibraryId);
/**
* 案例活动关联培训项目
*
* @param relateProjectParam
* @return
*/
boolean relateProject(RelateProjectParam relateProjectParam);
/**
* 培训项目关联案例活动获取列表
*
*
* @param name
* @param companyId
* @param siteId
* @param pageNo
* @param pageSize
* @return
*/
Page<CaseLibraryVO> getProjectList(String name, Long companyId, Long siteId, Integer pageNo, Integer pageSize);
/**
* 案例活动取消关联培训项目
* @param caseLibraryId
* @return
*/
boolean cancelRelateProject(Long caseLibraryId);
/**
* 案例活动插入指定范围
* @param caseLibraryAuthorizeList
* @return
*/
boolean insertAuthorizes(List<CaselibraryAuthorizeVO> caseLibraryAuthorizeList);
/**
* 案例活动获取指定范围
* @param caselibraryId
* @return
*/
List<CaselibraryAuthorizeVO> getAuthorize(Long caselibraryId);
/**
* 管理端首页配置上传案例获取案例活动列表
* @param pageNo
* @param pageSize
* @return
*/
Page<CaseLibraryVO> getHomeList(Integer pageNo, Integer pageSize);
Page<DroolsVo> getPageByDrools(String field, String value, Page<DroolsVo> page);
List<Long> getCaseIdsByName(String name);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.CaseStudyRecode;
/**
* <p>
* 案例学习记录表 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface ICaseStudyRecodeService extends IService<CaseStudyRecode> {
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.core.application.vo.DroolsVo;
import com.yizhi.library.application.domain.Classify;
import com.yizhi.library.application.vo.ClassifyListVO;
import com.yizhi.library.application.vo.ClassifyVO;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-03
*/
public interface IClassifyService extends IService<Classify> {
/**
* 新建分类
* @param classify
* @return
*/
Integer insertClassify(ClassifyVO classify);
/**
* 获取分类列表
* @return
*/
List<ClassifyListVO> getClassifyList();
/**
* 上移下移获取上一个分类
* @param classifyId
* @param parentId
* @param sort
* @param companyId
* @param siteId
* @return
*/
Classify getPreClassify(Long classifyId, Long parentId, Integer sort, Long companyId, Long siteId);
/**
* 上移下移获取下一个分类
* @param classifyId
* @param parentId
* @param sort
* @param companyId
* @param siteId
* @return
*/
Classify getSuffixClassify(Long classifyId, Long parentId, Integer sort, Long companyId, Long siteId);
Page<DroolsVo> getClassifyNameByDrools(String field, String value, Page<DroolsVo> page);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.CommentAdmire;
/**
* <p>
* 评论点赞记录表
服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface ICommentAdmireService extends IService<CommentAdmire> {
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.CommentReply;
import com.yizhi.library.application.vo.CommentReplyVO;
/**
* <p>
* 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface ICommentReplyService extends IService<CommentReply> {
/**
* 获取回复列表
* @param commentId
* @param pageNo
* @param pageSize
* @return
*/
Page<CommentReplyVO> getReplyList(Long commentId, Integer pageNo, Integer pageSize);
/**
* 回复下架
* @param id
* @return
*/
boolean putDown(Long id);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.library.application.domain.Comment;
import com.yizhi.library.application.param.CommentParam;
import com.yizhi.library.application.vo.CommentReplyVO;
import com.yizhi.library.application.vo.CommentVO;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface ICommentService extends IService<Comment> {
/**
* 发表评论/回复
*
* @param commentParam
* @return
*/
boolean comment(CommentParam commentParam);
/**
* 评论点赞
*
* @param commentId
* @return
*/
boolean admireComment(Long commentId);
/**
* 评论取消点赞
*
* @param commentId
* @return
*/
boolean cancelAdmireComment(Long commentId);
/**
* 获取评论列表
*
* @param studentCaseId
* @param pageNo
* @param pageSize
* @return
*/
Page<CommentVO> getCommentList(Long studentCaseId, Integer pageNo, Integer pageSize);
/**
* 获取评论管理列表
*
* @param studentCaseId
* @param name
* @param state
* @param pageNo
* @param pageSize
* @return
*/
Page<CommentVO> getCommentManageList(Long studentCaseId, String name, Integer state, Integer pageNo, Integer pageSize);
/**
* 获取评论回复列表
*
* @param name
* @param state
* @param commentId
* @return
*/
List<CommentReplyVO> getCommentReplyList(String name, Integer state, Long commentId);
/**
* 评论/回复下架
*
* @param id
* @param type
* @return
*/
boolean putDown(Long id, Integer type);
/**
* 评论/回复删除
*
* @param id
* @param type
* @return
*/
boolean deleteCommentOrReply(Long id, Integer type);
/**
* 评论/回复上架
*
* @param id
* @param type
* @return
*/
boolean release(Long id, Integer type);
/**
* 案例评论记录下载
* @param res
* @param studentCaseId
* @param name
* @param state
* @return
*/
List<CommentVO> downloadList(RequestContext res, Long studentCaseId, String name, Integer state);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.Favorite;
/**
* <p>
* 收藏记录表 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface IFavoriteService extends IService<Favorite> {
/**
* 学习案例收藏
* @param studentCaseId
* @return
*/
boolean favorite(Long studentCaseId);
/**
* 学习案例取消收藏
* @param studentCaseId
* @return
*/
boolean cancelFavorite(Long studentCaseId);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.InformRecorde;
import com.yizhi.library.application.param.InformParam;
import com.yizhi.library.application.vo.InformVO;
import java.util.List;
/**
* <p>
* 举报记录表 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
public interface IInformRecordeService extends IService<InformRecorde> {
/**
* 举报
* @param informParam
* @return
*/
boolean inform(InformParam informParam);
/**
* 获取举报列表
* @param studentCaseId
* @return
*/
List<InformVO> getInformList(Long studentCaseId);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.MustSubmit;
import java.util.List;
/**
* <p>
* 必须提交人表 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-08
*/
public interface IMustSubmitService extends IService<MustSubmit> {
/**
* 必须提交人导入
* @param mustSubmitList
*/
boolean insertList(List<MustSubmit> mustSubmitList);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.Scorer;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-08
*/
public interface IScorerService extends IService<Scorer> {
boolean insertList(List<Scorer> scorerImportList);
/**
* 获取案例活动评分人
* @param caseLibraryId
* @param accountId
* @return
*/
List<Long> getScorerList(Long caseLibraryId, Long accountId);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.StatisticStudentCase;
public interface IStatisticStudentCase extends IService<StatisticStudentCase> {
}
package com.yizhi.library.application.service;
import java.util.List;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.StatisticStudentCase;
import com.yizhi.library.application.domain.StatisticStudentCaseAccount;
import com.yizhi.library.application.domain.StatisticStudentCaseOrg;
import com.yizhi.library.application.domain.StudentCase;
public interface IStatisticStudentCaseAccount extends IService<StatisticStudentCaseAccount> {
StatisticStudentCaseAccount getAccountExportVO(Long accountId,Long siteId);
StatisticStudentCaseOrg getOrgExportVO(Long orgId, Long siteId);
List<Long> getSiteIds();
StatisticStudentCase getStudentCase(Long studentCaseId);
List<StudentCase> getStudentCases();
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.StatisticStudentCaseOrg;
public interface IStatisticStudentCaseOrg extends IService<StatisticStudentCaseOrg> {
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.StudentCaseAccessary;
import java.util.List;
import java.util.Map;
/**
* <p>
* 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-12-19
*/
public interface IStudentCaseAccessaryService extends IService<StudentCaseAccessary> {
/**
* 删除对应附件
* @param studentCaseId
*/
void deleteAccessary(Long studentCaseId);
/**
* 通知案例微服务该附件是视频/音频文件,等待转码
* @param ids
* @return
*/
boolean verifyVedio(List<Long> ids);
/**
* 更新视频/音频转码url
* @param map
* @return
*/
boolean updateTranscodeUrl(Map<String, String> map);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.StudentCaseAuthorize;
import com.yizhi.library.application.vo.StudentCaseAuthorizeVO;
import java.util.List;
/**
* <p>
* 考试人员范围 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-08-05
*/
public interface IStudentCaseAuthorizeService extends IService<StudentCaseAuthorize> {
/**
* 管理端修改学员案例新增可见范围用户,部门
* @param studentCaseAuthorizeList
* @return
*/
boolean insertAuthorize(List<StudentCaseAuthorizeVO> studentCaseAuthorizeList);
/**
* 获取指定范围列表
* @param studentCaseId
* @return
*/
List<StudentCaseAuthorizeVO> getAuthorize(Long studentCaseId);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.StudentCaseDimensionGradeRecord;
/**
* <p>
* 服务类
* </p>
*
* @author shengchenglong123
* @since 2020-08-05
*/
public interface IStudentCaseDimensionGradeRecordService extends IService<StudentCaseDimensionGradeRecord> {
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.StudentCaseRelatedClassify;
import com.yizhi.library.application.vo.StudentRelatedClassifyVO;
/**
* <p>
* 学生案例关联分类表 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-09
*/
public interface IStudentCaseRelatedClassifyService extends IService<StudentCaseRelatedClassify> {
/**
* 获取学员案例在某个维度下关联的分类名称以及关联主体id
* @param rootId
* @param studentCaseId
* @return
*/
StudentRelatedClassifyVO getRelatedClassify(Long rootId, Long studentCaseId);
/**
* 查找一级或者二级分类是否被学员案例关联
* @param classifyId
* @return
*/
boolean getIsRelated(Long classifyId);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.domain.StatisticStudentCaseAccount;
import com.yizhi.library.application.domain.StatisticStudentCaseOrg;
import com.yizhi.library.application.vo.StatisticStudentCaseVO;
public interface IStudentCaseReportService {
/**
* 学员案例报表
* @param startDate
* @param endDate
* @param kwd
* @param pageSize
* @param pageNo
* @return
*/
Page<StatisticStudentCaseVO> studentCaseList(String startDate, String endDate, String kwd, Long siteId, Integer pageSize, Integer pageNo);
/**
* 学员案例报表按用户统计
* @param kwd
* @param pageSize
* @param pageNo
* @return
*/
Page<StatisticStudentCaseAccount> studentCaseByAccount(String kwd, Long siteId, Integer pageSize, Integer pageNo);
/**
* 学员案例报表按部门统计
* @param kwd
* @param pageSize
* @param pageNo
* @return
*/
Page<StatisticStudentCaseOrg> studentCaseByOrg(String kwd, Long siteId, Integer pageSize, Integer pageNo);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.library.application.domain.StudentCaseScoreRecorde;
/**
* <p>
* 案例学习记录表 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-11-19
*/
public interface IStudentCaseScoreRecordeService extends IService<StudentCaseScoreRecorde> {
/**
* 获取学员案例指定打分人未打分人数
* @param studentCaseId
* @return
*/
Integer getUnscoredCount(Long studentCaseId);
/**
* 获取平均分
*
* @param caseLibraryId
* @param accountId
* @param studentCaseId
* @return
*/
Integer getAverageScore(Long caseLibraryId, Long accountId, Long studentCaseId);
/**
* 获取最高分
*
* @param caseLibraryId
* @param accountId
* @param studentCaseId
* @return
*/
Integer getMaxScore(Long caseLibraryId, Long accountId, Long studentCaseId);
/**
* 更新评分记录
* @param studentCaseId
* @param accountId
* @param score
*/
Boolean updateScoreRcorde(Long studentCaseId, Long accountId, Integer score);
}
package com.yizhi.library.application.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.vo.DroolsVo;
import com.yizhi.library.application.domain.StudentCase;
import com.yizhi.library.application.param.HomeListParam;
import com.yizhi.library.application.param.SelectionStudentCaseParam;
import com.yizhi.library.application.param.StudentCaseAuditParam;
import com.yizhi.library.application.param.StudentCaseParam;
import com.yizhi.library.application.vo.StudentCaseViewVO;
import com.yizhi.library.application.vo.*;
import java.util.List;
import java.util.Map;
/**
* <p>
* 学生案例表 服务类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-09
*/
public interface IStudentCaseService extends IService<StudentCase> {
/**
* pc端,移动端我的案例列表
*
* @param pageNo
* @param pageSize
* @return
*/
Page<CaseLibraryVO> myCaseLibraryList(Integer pageNo, Integer pageSize);
/**
* 学员提交案例获取案例库信息
*
* @param caseLibraryId
* @return
*/
StudentCaseVO prepareStudentCase(Long caseLibraryId);
/**
* 学员提交案例
*
* @param studentCaseParam
* @return
*/
boolean submitStudentCase(StudentCaseParam studentCaseParam);
/**
* 获取学员案例提交记录列表
*
* @param caseLibraryId
* @param endTime
* @return
*/
StudentCaseRecordListVO getSubmitRecords(Long caseLibraryId, String endTime);
/**
* 学员案例提交记录中撤回
*
* @param studentCaseId
* @return
*/
boolean studentCaseRecall(Long studentCaseId);
/**
* 学员案例记录查看或者编辑获得信息
*
* @param studentCaseId
* @return
*/
StudentCaseViewVO studentCaseView(Long studentCaseId, Integer type);
/**
* 学员案例学习获取案例信息/审核,评分获取案例信息
*
* @param studentCaseId
* @param type
* @param name
* @param number
* @return
*/
StudentCaseStudyVO studyStudentCase(Long studentCaseId, Integer type, Integer number, String name);
/**
* 学员案例审核提交
*
* @param studentCaseAuditParam
* @return
*/
boolean studentCaseAudit(StudentCaseAuditParam studentCaseAuditParam);
/**
* 学员案例评分提交
*
* @param studentCaseAuditParam
* @return
*/
boolean studentCaseScore(StudentCaseAuditParam studentCaseAuditParam);
/**
* 学员案例审核,评分获取案例列表
*
* @param type
* @param name
* @param pageNo
* @param pageSize
* @return
*/
Page<StudentCaseStudyVO> getAuditList(Integer type, String name, Integer pageNo, Integer pageSize);
/**
* 学员案例批量审核
*
* @param studentCaseAuditParam
* @return
*/
boolean batchAudit(StudentCaseAuditParam studentCaseAuditParam);
/**
* 学员案例批量评分
*
* @param studentCaseAuditParam
* @return
*/
boolean batchScore(StudentCaseAuditParam studentCaseAuditParam);
/**
* 学员案例审核/评分导出案例
*
* @param idList
* @return
*/
List<StudentCaseVO> studentCaseBatchExport(List<Long> idList);
/**
* 首页配置获取列表
*
* @param homeListParam
* @return
*/
Page<StudentCaseVO> getStudentCaseHomeList(HomeListParam homeListParam);
/**
* 审核评分管理列表
*
* @param caseLibraryId
* @param orgName
* @param studentCaseName
* @param accountName
* @param state
* @param pageNo
* @param pageSize
* @return
*/
Page<StudentCaseManageListVO> studentCaseManageList(Long caseLibraryId, String studentCaseName, String accountName,
Integer state, String orgName, Integer pageNo, Integer pageSize,
RequestContext res, Integer type);
/**
* 学员案例审核/评分获取学员案例信息
*
* @param studentCaseId
* @param caseLibraryId
* @param studentCaseName
* @param accountName
* @param state
* @param orgName
* @param number
* @return
*/
StudentCaseStudyVO studentCaseManageAuditOrScoreView(Long studentCaseId, Long caseLibraryId, String studentCaseName, String accountName, Integer state, String orgName, Integer number);
/**
* 导出待审核案例
*
* @param studentCaseIds
* @param res
* @return
*/
List<StudentCaseManageListVO> exportAuditList(List<Long> studentCaseIds, RequestContext res);
/**
* 导出待评分案例
*
* @param studentCaseIds
* @param res
* @return
*/
List<StudentCaseManageListVO> exportScoreList(List<Long> studentCaseIds, RequestContext res);
/**
* 精选案例管理列表
*
* @param studentCaseName
* @param accountName
* @param state
* @param pageNo
* @param pageSize
* @param res
* @return
*/
Page<SelectionCaseListVO> getSelectionList(String studentCaseName, String accountName, Integer state, Integer pageNo, Integer pageSize, RequestContext res);
/**
* 举报记录列表
*
* @param studentCaseName
* @param accountName
* @param pageNo
* @param pageSize
* @param res
* @return
*/
Page<StudentCaseManageListVO> getInformList(String studentCaseName, String accountName, Integer pageNo, Integer pageSize, RequestContext res);
/**
* 举报记录列表导出
*
* @param studentCaseName
* @param accountName
* @param res
* @return
*/
List<StudentCaseManageListVO> getInformExportList(String studentCaseName, String accountName, RequestContext res);
/**
* 举报记录查看
*
* @param informRecordId
* @param res
* @return
*/
StudentCaseStudyVO informListView(Long informRecordId, RequestContext res);
/**
* 案例管理列表获取记录数
*
* @param caseLibraryId
* @return
*/
Map<String, Object> getManageListCount(Long caseLibraryId);
/**
* 获取案例活动id及项目id
*
* @param caseLibraryId
* @param studentLibraryId
* @return
*/
Map<String, Object> getLibraryProjectName(Long caseLibraryId, Long studentLibraryId);
/**
* 学员案例逻辑删除
*
* @param studentCaseId
* @return
*/
boolean deleteStudentCase(Long studentCaseId);
/**
* 获取我的收藏案例列表
*
* @param pageNo
* @param pageSize
* @param name
* @return
*/
Page<FavoriteVO> getFavorites(Integer pageNo, Integer pageSize, String name);
/**
* 培训项目关联精选案例获取列表
*
* @param name
* @param pageNo
* @param pageSize
* @return
*/
Page<StudentCaseStudyVO> getProjectList(String name, Integer pageNo, Integer pageSize);
/**
* 精选案例搜索页获取列表
*
* @param selectionStudentCaseParam
* @return
*/
Page<FavoriteVO> getSelectionStudentCaseList(SelectionStudentCaseParam selectionStudentCaseParam);
/**
* pc端,移动端我的案例记录总数
*
* @return
*/
Integer myCaseLibraryTotal();
/**
* 首页获取精选案例信息
* @param studentCaseId
* @return
*/
FavoriteVO getStudentCaseDetail(Long studentCaseId);
/**
* 首页获取案例点赞总数
* @param companyId
* @param siteId
* @param accountId
* @return
*/
Integer getFavoritesCount(Long companyId, Long siteId, Long accountId);
Page<DroolsVo> getPageByDrools(String field, String value, Page<DroolsVo> page);
/**
* 每次跑批校正学员案例表中的点赞数
*/
void checkAdmireNum();
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.library.application.domain.AdmireRecorde;
import com.yizhi.library.application.mapper.AdmireRecordeMapper;
import com.yizhi.library.application.service.IAdmireRecordeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* <p>
* 点赞记录表 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Service
public class AdmireRecordeServiceImpl extends ServiceImpl<AdmireRecordeMapper, AdmireRecorde> implements IAdmireRecordeService {
@Autowired
private IdGenerator idGenerator;
@Autowired
AdmireRecordeMapper admireRecordeMapper;
@Override
public boolean admireStudentCase(Long studentCaseId) {
RequestContext res = ContextHolder.get();
AdmireRecorde admireRecorde = new AdmireRecorde();
admireRecorde.setId(idGenerator.generate());
admireRecorde.setStudentCaseId(studentCaseId);
admireRecorde.setAccountId(res.getAccountId());
admireRecorde.setState(1);
admireRecorde.setCreateById(res.getAccountId());
admireRecorde.setCreateByName(res.getAccountName());
admireRecorde.setCreateTime(new Date());
admireRecorde.setUpdateById(res.getAccountId());
admireRecorde.setUpdateByName(res.getAccountName());
admireRecorde.setUpdateTime(new Date());
admireRecorde.setCompanyId(res.getCompanyId());
admireRecorde.setOrgId(res.getOrgId());
admireRecorde.setSiteId(res.getSiteId());
return this.insert(admireRecorde);
}
@Override
public boolean cancelAdmireStudentCase(Long studentCaseId) {
RequestContext res = ContextHolder.get();
AdmireRecorde admireRecorde = new AdmireRecorde();
admireRecorde.setStudentCaseId(studentCaseId);
admireRecorde.setAccountId(res.getAccountId());
return this.delete(new EntityWrapper<>(admireRecorde));
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.library.application.domain.Auditor;
import com.yizhi.library.application.mapper.AuditorMapper;
import com.yizhi.library.application.service.IAuditorService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-08
*/
@Service
public class AuditorServiceImpl extends ServiceImpl<AuditorMapper, Auditor> implements IAuditorService {
@Autowired
private IdGenerator idGenerator;
@Override
public boolean insertList(List<Auditor> auditorImportList) {
if (CollectionUtils.isNotEmpty(auditorImportList)){
Auditor auditor1 = new Auditor();
auditor1.setCaseLibraryId(auditorImportList.get(0).getCaseLibraryId());
this.delete(new EntityWrapper<>(auditor1));
for (Auditor auditor : auditorImportList){
auditor.setId(idGenerator.generate());
}
return this.insertBatch(auditorImportList);
}else {
return false;
}
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.domain.CaseLibraryAuthorize;
import com.yizhi.library.application.vo.CaselibraryAuthorizeVO;
import com.yizhi.library.application.mapper.CaseLibraryAuthorizeMapper;
import com.yizhi.library.application.service.ICaseLibraryAuthorizeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 考试人员范围 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-11-25
*/
@Service
public class CaseLibraryAuthorizeServiceImpl extends ServiceImpl<CaseLibraryAuthorizeMapper, CaseLibraryAuthorize> implements ICaseLibraryAuthorizeService {
@Autowired
private CaseLibraryAuthorizeMapper caseLibraryAuthorizeMapper;
@Override
public List<Long> getAuthorizeIds(Long accountId, List<Long> relationIds) {
return caseLibraryAuthorizeMapper.getAuthorizeIds(accountId, relationIds);
}
@Override
public List<CaselibraryAuthorizeVO> getAuthorize(Long caselibraryId) {
return caseLibraryAuthorizeMapper.getAuthorize(caselibraryId);
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.domain.CaseLibraryDimensionGrade;
import com.yizhi.library.application.mapper.CaseLibraryDimensionGradeMapper;
import com.yizhi.library.application.service.ICaseLibraryDimensionGradeService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* <p>
* 原创活动多维度打分设置 服务实现类
* </p>
*
* @author shengchenglong123
* @since 2020-08-05
*/
@Service
@Transactional
public class CaseLibraryDimensionGradeServiceImpl extends ServiceImpl<CaseLibraryDimensionGradeMapper, CaseLibraryDimensionGrade> implements ICaseLibraryDimensionGradeService {
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.domain.CaseLibraryRelatedClassify;
import com.yizhi.library.application.mapper.CaseLibraryRelatedClassifyMapper;
import com.yizhi.library.application.service.ICaseLibraryRelatedClassifyService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 案例库关联维度表 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-05
*/
@Service
public class CaseLibraryRelatedClassifyServiceImpl extends ServiceImpl<CaseLibraryRelatedClassifyMapper, CaseLibraryRelatedClassify> implements ICaseLibraryRelatedClassifyService {
@Autowired
private CaseLibraryRelatedClassifyMapper caseLibraryRelatedClassifyMapper;
@Override
public boolean getIsRelated(Long classifyId) {
Page<CaseLibraryRelatedClassify> page = new Page<>(1, 1);
List<CaseLibraryRelatedClassify> list = caseLibraryRelatedClassifyMapper.getRelatedList(classifyId);
if (CollectionUtils.isNotEmpty(list)) {
return true;
} else {
return false;
}
}
@Override
public List<CaseLibraryRelatedClassify> getRelatedClassify(Long caseLibraryId) {
return caseLibraryRelatedClassifyMapper.getRelatedClassify(caseLibraryId);
}
@Override
public void deleteNotClassifyList(Long caseLibraryId, List<Long> notDeleteIdList) {
caseLibraryRelatedClassifyMapper.deleteNotClassifyList(caseLibraryId, notDeleteIdList);
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.orm.hierarchicalauthorization.HQueryUtil;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.enums.TaskParamsEnums;
import com.yizhi.core.application.vo.DroolsVo;
import com.yizhi.library.application.constant.Constant;
import com.yizhi.library.application.domain.CaseLibrary;
import com.yizhi.library.application.domain.CaseLibraryAuthorize;
import com.yizhi.library.application.domain.CaseLibraryDimensionGrade;
import com.yizhi.library.application.domain.CaseLibraryRelatedClassify;
import com.yizhi.library.application.mapper.CaseLibraryDimensionGradeMapper;
import com.yizhi.library.application.mapper.CaseLibraryMapper;
import com.yizhi.library.application.param.RelateProjectParam;
import com.yizhi.library.application.service.*;
import com.yizhi.library.application.vo.*;
import com.yizhi.system.application.constant.AuthzConstant;
import com.yizhi.system.application.system.remote.ReportClient;
import com.yizhi.system.application.vo.HQAccountInManageParam;
import com.yizhi.system.application.vo.ReportAccountRespInManageVO;
import com.yizhi.system.application.vo.ReportRangeAccountReqVO;
import com.yizhi.training.application.feign.TpProjectClient;
import com.yizhi.training.application.vo.domain.TrainingProjectVo;
import com.yizhi.util.application.clazz.ClassUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* <p>
* 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-03
*/
@Service
public class CaseLibraryServiceImpl extends ServiceImpl<CaseLibraryMapper, CaseLibrary> implements ICaseLibraryService {
@Autowired
private IdGenerator idGenerator;
@Autowired
private ICaseLibraryRelatedClassifyService caseLibraryRelatedClassifyService;
@Autowired
private CaseLibraryMapper caseLibraryMapper;
@Autowired
private TpProjectClient tpProjectClient;
@Autowired
private ICaseLibraryAuthorizeService caseLibraryAuthorizeService;
@Autowired
ReportClient reportClient;
@Autowired
IClassifyService classifyService;
@Autowired
private CaseLibraryDimensionGradeMapper caseLibraryDimensionGradeMapper;
@Autowired
private ICaseLibraryDimensionGradeService caseLibraryDimensionGradeService;
private Logger logger = LoggerFactory.getLogger(CaseLibraryServiceImpl.class);
@Override
public Long insertCaseLibrary(CaseLibraryVO caseLibraryVO) {
RequestContext res = ContextHolder.get();
if (null != caseLibraryVO) {
if (null != caseLibraryVO.getId()) {
updateCaseLibrary(caseLibraryVO);
// 增加多维度打分设置功能
dealCaseLibraryDimensionGradeInsert(caseLibraryVO, res);
return caseLibraryVO.getId();
}
CaseLibrary caseLibrary = new CaseLibrary();
BeanUtils.copyProperties(caseLibraryVO, caseLibrary);
caseLibrary.setId(idGenerator.generate());
caseLibrary.setCreateById(res.getAccountId());
caseLibrary.setCreateByName(res.getAccountName());
caseLibrary.setCreateTime(new Date());
caseLibrary.setUpdateById(res.getAccountId());
caseLibrary.setUpdateByName(res.getAccountName());
caseLibrary.setUpdateTime(new Date());
caseLibrary.setCompanyId(res.getCompanyId());
caseLibrary.setSiteId(res.getSiteId());
caseLibrary.setOrgId(res.getOrgId());
caseLibrary.setState(1);
caseLibrary.setExamine(1);
caseLibrary.setTextEditType(1);
caseLibrary.setShowScore(caseLibraryVO.getShowScore());
caseLibrary.setCaseLibraryDimensionGradeDescription(caseLibraryVO.getCaseLibraryDimensionGradeDescription());
if (null == caseLibraryVO.getId()) {
if (!this.insert(caseLibrary)) {
// 增加多维度打分设置功能
caseLibraryVO.setId(caseLibrary.getId());
dealCaseLibraryDimensionGradeInsert(caseLibraryVO, res);
return null;
}
} else {
if (!this.updateById(caseLibrary)) {
// 增加多维度打分设置功能
dealCaseLibraryDimensionGradeInsert(caseLibraryVO, res);
return null;
}
}
// //先删除之前关联的分类
// caseLibraryRelatedClassifyService.deleteNotClassifyList(caseLibrary.getId(), null);
if (CollectionUtils.isNotEmpty(caseLibraryVO.getClassifyIdList())) {
List<CaseLibraryRelatedClassify> classifyList = new ArrayList<>();
for (Long classifyId : caseLibraryVO.getClassifyIdList()) {
CaseLibraryRelatedClassify caseLibraryRelatedClassify = new CaseLibraryRelatedClassify();
caseLibraryRelatedClassify.setId(idGenerator.generate());
caseLibraryRelatedClassify.setCaseLiraryId(caseLibrary.getId());
caseLibraryRelatedClassify.setClassifyId(classifyId);
caseLibraryRelatedClassify.setCreateById(res.getAccountId());
caseLibraryRelatedClassify.setCreateByName(res.getAccountName());
caseLibraryRelatedClassify.setCreateTime(new Date());
caseLibraryRelatedClassify.setUpdateById(res.getAccountId());
caseLibraryRelatedClassify.setUpdateByName(res.getAccountName());
caseLibraryRelatedClassify.setUpdateTime(new Date());
classifyList.add(caseLibraryRelatedClassify);
}
if (!caseLibraryRelatedClassifyService.insertBatch(classifyList)) {
return null;
}
}
return caseLibrary.getId();
}
return null;
}
@Override
public boolean updateCaseLibrary(CaseLibraryVO caseLibraryVO) {
RequestContext res = ContextHolder.get();
if (null != caseLibraryVO) {
CaseLibrary caseLibrary = new CaseLibrary();
BeanUtils.copyProperties(caseLibraryVO, caseLibrary);
caseLibrary.setUpdateById(res.getAccountId());
caseLibrary.setUpdateByName(res.getAccountName());
caseLibrary.setUpdateTime(new Date());
//一旦上架,得分规则不可以再修改
if (null != caseLibrary.getState() && caseLibrary.getState() == 2) {
caseLibrary.setCanModifyScoreRule(0);
}
if (!this.updateById(caseLibrary)) {
return false;
}
//将之前的分类关联删除重新关联
CaseLibraryRelatedClassify caseLibraryRelatedClassify1 = new CaseLibraryRelatedClassify();
caseLibraryRelatedClassify1.setCaseLiraryId(caseLibraryVO.getId());
if (caseLibraryVO.getType() == null) {
caseLibraryRelatedClassifyService.delete(new EntityWrapper<>(caseLibraryRelatedClassify1));
}
//关联分类不为空说明是第一步,执行以下
if (CollectionUtils.isNotEmpty(caseLibraryVO.getClassifyIdList())) {
List<CaseLibraryRelatedClassify> classifyList = new ArrayList<>();
for (Long classifyId : caseLibraryVO.getClassifyIdList()) {
CaseLibraryRelatedClassify caseLibraryRelatedClassify = new CaseLibraryRelatedClassify();
caseLibraryRelatedClassify.setId(idGenerator.generate());
caseLibraryRelatedClassify.setCaseLiraryId(caseLibrary.getId());
caseLibraryRelatedClassify.setClassifyId(classifyId);
caseLibraryRelatedClassify.setCreateById(res.getAccountId());
caseLibraryRelatedClassify.setCreateByName(res.getAccountName());
caseLibraryRelatedClassify.setCreateTime(new Date());
caseLibraryRelatedClassify.setUpdateById(res.getAccountId());
caseLibraryRelatedClassify.setUpdateByName(res.getAccountName());
caseLibraryRelatedClassify.setUpdateTime(new Date());
classifyList.add(caseLibraryRelatedClassify);
}
if (!caseLibraryRelatedClassifyService.insertBatch(classifyList)) {
return false;
}
}
return true;
}
return false;
}
@Override
public boolean releaseCaseLibrary(Long caseLibraryId) {
return caseLibraryMapper.releaseCaseLibrary(caseLibraryId);
}
@Override
public boolean putDownCaseLibrary(Long caseLibraryId) {
CaseLibrary caseLibrary = this.selectById(caseLibraryId);
if (null == caseLibrary.getTrainingProjectId()) {
caseLibraryMapper.putDownCaseLibrary(caseLibraryId);
return true;
} else {
List<Long> trainingProjectIds = new ArrayList<>();
trainingProjectIds.add(caseLibrary.getTrainingProjectId());
Map<Long, TrainingProjectVo> map = tpProjectClient.getCaseLibraryProject(trainingProjectIds);
if (null != map) {
TrainingProjectVo trainingProject = map.get(caseLibrary.getTrainingProjectId());
//关联培训项目是上架状态,不能下架
if (trainingProject.getStatus() == 1) {
return false;
//关联培训项目不是上架状态,可以下架
} else {
caseLibraryMapper.putDownCaseLibrary(caseLibraryId);
return true;
}
//没找到关联培训项目直接下架
} else {
caseLibraryMapper.putDownCaseLibrary(caseLibraryId);
return true;
}
}
}
@Override
public List<ClassifyVO> getClassify(Long caseLibraryId) {
RequestContext res = ContextHolder.get();
List<Long> classifyIds = caseLibraryMapper.getHasChildrenIds(res.getCompanyId(), res.getSiteId());
if (CollectionUtils.isEmpty(classifyIds)) {
return null;
}
List<ClassifyVO> list = caseLibraryMapper.getClassify(classifyIds, caseLibraryId, res.getCompanyId(), res.getSiteId());
if (CollectionUtils.isNotEmpty(list)) {
for (ClassifyVO classifyVO : list) {
classifyVO.setKey(classifyVO.getClassifyId().toString());
}
}
return list;
}
@Override
public CaseLibraryVO viewCaseLibrary(Long caseLibraryId) {
CaseLibraryVO caseLibraryVO = new CaseLibraryVO();
CaseLibrary caseLibrary = caseLibraryMapper.selectById(caseLibraryId);
if (null != caseLibrary) {
BeanUtils.copyProperties(caseLibrary, caseLibraryVO);
List<Long> classifyIdList = caseLibraryMapper.relatedClassify(caseLibraryId);
caseLibraryVO.setClassifyIdList(classifyIdList);
}
if (caseLibrary.getScoreRule() != null && caseLibrary.getScoreRule() == 4) {
EntityWrapper<CaseLibraryDimensionGrade> ew = new EntityWrapper<>();
ew.eq("deleted", 0);
ew.eq("case_library_id", caseLibraryId);
ew.orderBy("sort");
List<CaseLibraryDimensionGrade> caseLibraryDimensionGrades = caseLibraryDimensionGradeService.selectList(ew);
if (CollectionUtils.isNotEmpty(caseLibraryDimensionGrades)) {
List<CaseLibraryDimensionGradeVO> voList = new ArrayList<>();
CaseLibraryDimensionGradeVO gradeVO = null;
for (CaseLibraryDimensionGrade caseLibraryDimensionGrade : caseLibraryDimensionGrades) {
gradeVO = new CaseLibraryDimensionGradeVO();
// gradeVO.setDescription(caseLibraryDimensionGrade.getDescription());
gradeVO.setId(caseLibraryDimensionGrade.getId());
gradeVO.setMaxScore(caseLibraryDimensionGrade.getMaxScore());
gradeVO.setMinScore(caseLibraryDimensionGrade.getMinScore());
gradeVO.setName(caseLibraryDimensionGrade.getName());
gradeVO.setSort(caseLibraryDimensionGrade.getSort());
voList.add(gradeVO);
}
caseLibraryVO.setCaseLibraryDimensionGradeVOS(voList);
}
}
return caseLibraryVO;
}
@Override
public Page<CaseLibraryVO> getCaseLibraryList(String name, Integer state, Integer pageNo, Integer pageSize) {
Page<CaseLibraryVO> page = new Page<>(pageNo, pageSize);
HQueryUtil.startHQ(CaseLibrary.class);
RequestContext res = ContextHolder.get();
List<CaseLibraryVO> list = caseLibraryMapper.getCaseLibraryList(name, state, page, res.getCompanyId(), res.getSiteId());
if (CollectionUtils.isNotEmpty(list)) {
// List<Long> trainingProjectIdList = list.stream().map(CaseLibraryVO::getTrainingProjectId).collect(Collectors.toList());
List<Long> trainingProjectIdList = new ArrayList<>();
for (CaseLibraryVO caseLibraryVO : list) {
if (null != caseLibraryVO.getTrainingProjectId()) {
trainingProjectIdList.add(caseLibraryVO.getTrainingProjectId());
}
}
Map<Long, TrainingProjectVo> map = new HashMap<>(16);
if (CollectionUtils.isNotEmpty(trainingProjectIdList)) {
map = tpProjectClient.getCaseLibraryProject(trainingProjectIdList);
}
for (CaseLibraryVO caseLibraryVO : list) {
if (null != caseLibraryVO.getTrainingProjectId() && null != map &&
null != map.get(caseLibraryVO.getTrainingProjectId())) {
caseLibraryVO.setTrainingProjectName(map.get(caseLibraryVO.getTrainingProjectId()).getName());
}
}
page.setRecords(list);
}
return page;
}
@Override
public boolean deleteCaseLibrary(Long caseLibraryId) {
return caseLibraryMapper.deleteCaseLibrary(caseLibraryId);
}
@Override
public boolean relateProject(RelateProjectParam relateProjectParam) {
if (CollectionUtils.isEmpty(relateProjectParam.getCaseLibraryIds())) {
//没有关联活动,将该培训项目关联的案例活动全部解除
return caseLibraryMapper.relieveRelateProject(relateProjectParam.getProjectId(), null);
} else {
//关联活动
caseLibraryMapper.relateProject(relateProjectParam.getCaseLibraryIds(), relateProjectParam.getProjectId());
//除了关联的案例活动之外的全部解除关联
caseLibraryMapper.relieveRelateProject(relateProjectParam.getProjectId(), relateProjectParam.getCaseLibraryIds());
}
return true;
}
@Override
public Page<CaseLibraryVO> getProjectList(String name, Long companyId, Long siteId, Integer pageNo, Integer pageSize) {
Page<CaseLibraryVO> page = new Page<>(pageNo, pageSize);
List<CaseLibraryVO> list = caseLibraryMapper.getProjectList(name, companyId, siteId, page);
if (CollectionUtils.isNotEmpty(list)) {
page.setRecords(list);
}
return page;
}
@Override
public boolean cancelRelateProject(Long caseLibraryId) {
return caseLibraryMapper.cancelRelateProject(caseLibraryId);
}
@Override
public boolean insertAuthorizes(List<CaselibraryAuthorizeVO> caseLibraryAuthorizeList) {
RequestContext res = ContextHolder.get();
//插入之前,先删除之前的指定范围
CaseLibraryAuthorize caseLibraryAuthorize = new CaseLibraryAuthorize();
caseLibraryAuthorize.setCaseLibraryId(caseLibraryAuthorizeList.get(0).getCaseLibraryId());
caseLibraryAuthorizeService.delete(new EntityWrapper<>(caseLibraryAuthorize));
Date date = new Date();
List<CaseLibraryAuthorize> listCaseLibrary = new ArrayList<>();
//插入数据
if (CollectionUtils.isNotEmpty(caseLibraryAuthorizeList)) {
for (CaselibraryAuthorizeVO caseLibraryVO : caseLibraryAuthorizeList) {
CaseLibraryAuthorize caseLibrary = new CaseLibraryAuthorize();
BeanUtils.copyProperties(caseLibraryVO, caseLibrary);
caseLibrary.setId(idGenerator.generate());
caseLibrary.setCreateById(res.getAccountId());
caseLibrary.setCreateByName(res.getAccountName());
caseLibrary.setCreateTime(date);
caseLibrary.setUpdateById(res.getAccountId());
caseLibrary.setUpdateByName(res.getAccountName());
caseLibrary.setUpdateTime(date);
listCaseLibrary.add(caseLibrary);
}
return caseLibraryAuthorizeService.insertBatch(listCaseLibrary);
}
return true;
}
@Override
public List<CaselibraryAuthorizeVO> getAuthorize(Long caselibraryId) {
return caseLibraryAuthorizeService.getAuthorize(caselibraryId);
}
@Override
public Page<CaseLibraryVO> getHomeList(Integer pageNo, Integer pageSize) {
RequestContext res = ContextHolder.get();
Page<CaseLibraryVO> page = new Page<>(pageNo, pageSize);
List<CaseLibraryVO> list = caseLibraryMapper.getHomeList(res.getCompanyId(), res.getSiteId(), page);
if (CollectionUtils.isNotEmpty(list)) {
page.setRecords(list);
}
return page;
}
public AccountMapVO getAccountMapVO(boolean isAdmin, Long accountId, Long siteId, List<Long> accountIds, List<Long> orgIds,
String accountName, String orgName) {
List<Long> ids = new ArrayList<>();
Map<Long, ReportAccountRespVO> accountMap = new HashMap<>(16);
List<ReportAccountRespVO> list = null;
//如果是管理员(肯定是模糊查询)
if (isAdmin) {
list = getRangeAccounts(siteId, accountIds, orgIds, accountName, orgName);
} else {
//非管理员不一定是模糊查询
list = getAccountsInManage(accountId, siteId, accountName, orgName);
}
//如果有用户信息,放入map中,并加用记id放入list中
if (CollectionUtils.isNotEmpty(list)) {
for (ReportAccountRespVO respVO : list) {
ids.add(respVO.getUserId());
accountMap.put(respVO.getUserId(), respVO);
}
AccountMapVO accountMapVO = new AccountMapVO();
accountMapVO.setAccountIds(ids);
accountMapVO.setAccountMap(accountMap);
return accountMapVO;
}
return null;
}
//如果是管理员需要模糊查询内部方法
public List<ReportAccountRespVO> getRangeAccounts(Long siteId, List<Long> accountIds, List<Long> orgIds,
String accountName, String orgName) {
ReportRangeAccountReqVO reqVO = new ReportRangeAccountReqVO();
reqVO.setSiteId(siteId);
if (CollectionUtils.isNotEmpty(accountIds)) {
reqVO.setAccountIds(accountIds);
}
if (CollectionUtils.isNotEmpty(orgIds)) {
reqVO.setOrgIds(orgIds);
}
if (StringUtils.isNotBlank(accountName)) {
reqVO.setAccountName(accountName);
}
if (StringUtils.isNotBlank(orgName)) {
reqVO.setOrgName(orgName);
}
List<com.yizhi.system.application.vo.ReportAccountRespVO> list = reportClient.getRangeAccounts(reqVO);
List<ReportAccountRespVO> vos = new ArrayList<>();
for (com.yizhi.system.application.vo.ReportAccountRespVO it : list) {
ReportAccountRespVO vo = new ReportAccountRespVO();
BeanUtils.copyProperties(it,vo);
vos.add(vo);
}
return vos;
}
//如果是非管理员查询内部方法(不管是不是模糊查询)
public List<ReportAccountRespVO> getAccountsInManage(Long accountId, Long siteId, String accountName, String orgName) {
HQAccountInManageParam reqVO = new HQAccountInManageParam();
reqVO.setSiteId(siteId);
reqVO.setModuleType(AuthzConstant.moduleType.caseLibrary);
reqVO.setSiteId(siteId);
if (StringUtils.isNotBlank(accountName)) {
reqVO.setAccountName(accountName);
}
if (StringUtils.isNotBlank(orgName)) {
reqVO.setOrgName(orgName);
}
ReportAccountRespInManageVO respInManageVO = reportClient.getRangeAccountsInManage(reqVO);
if (null != respInManageVO) {
if (!respInManageVO.getIsAdmin()) {
List<com.yizhi.system.application.vo.ReportAccountRespVO> list = respInManageVO.getList();
List<ReportAccountRespVO> vos = new ArrayList<>();
for (com.yizhi.system.application.vo.ReportAccountRespVO it : list) {
ReportAccountRespVO vo = new ReportAccountRespVO();
BeanUtils.copyProperties(it,vo);
vos.add(vo);
}
return vos;
} else {
return getRangeAccounts(siteId, null, null, accountName, orgName);
}
}
return null;
}
@Override
public Page<DroolsVo> getPageByDrools(String field, String value, Page<DroolsVo> page) {
if (StringUtils.isBlank(field)) {
logger.info("列名不能为空!");
return page;
}
if (field.equalsIgnoreCase(TaskParamsEnums.CLASSIFY.getCode())) {
field = Constant.NAME;
page = classifyService.getClassifyNameByDrools(field, value, page);
} else {
if (field.equalsIgnoreCase(TaskParamsEnums.NAME.getCode())) {
return getPage(field, value, page);
} else if (field.equalsIgnoreCase(TaskParamsEnums.KEYWORD.getCode())) {
field = Constant.NAME;
return getPage(field, value, page);
}
}
return page;
}
public Page getPage(String field, String value, Page<DroolsVo> page) {
RequestContext requestContext = ContextHolder.get();
Long siteId = requestContext.getSiteId();
Long companyId = requestContext.getCompanyId();
CaseLibrary caseLibrary = new CaseLibrary();
caseLibrary.setSiteId(siteId);
caseLibrary.setCompanyId(companyId);
caseLibrary.setState(Constant.UP);
EntityWrapper wrapper = new EntityWrapper(caseLibrary);
wrapper.setSqlSelect("distinct(" + field + ")," + "id ")
.isNotNull(field)
.like(field, value)
.addFilter(field + "!=''")
.orderBy("create_time", false);
//转换为驼峰命名
String upperField = ClassUtil.getFieldName(field);
List<DroolsVo> voList = null;
List<CaseLibrary> list = this.baseMapper.selectPage(page, wrapper);
if (!CollectionUtils.isEmpty(list)) {
voList = new ArrayList<>(list.size());
for (CaseLibrary a : list) {
DroolsVo vo = new DroolsVo();
vo.setTaskId(a.getId());
vo.setTaskFieldValue(ClassUtil.invokeMethod(a, upperField));
vo.setTaskParamsType(field);
voList.add(vo);
}
page.setRecords(voList);
}
return page;
}
@Override
public List<Long> getCaseIdsByName(String name) {
RequestContext requestContext = ContextHolder.get();
Long siteId = requestContext.getSiteId();
Long companyId = requestContext.getCompanyId();
List<Long> ids = null;
CaseLibrary caseLibrary = new CaseLibrary();
caseLibrary.setSiteId(siteId);
caseLibrary.setCompanyId(companyId);
caseLibrary.setState(Constant.UP);
EntityWrapper wrapper = new EntityWrapper(caseLibrary);
wrapper.setSqlSelect("id").like("name", name);
List<CaseLibrary> list = this.baseMapper.selectList(wrapper);
if (CollectionUtils.isNotEmpty(list)) {
ids = new ArrayList<>(list.size());
for (CaseLibrary a : list) {
ids.add(a.getId());
}
}
return ids;
}
/**
* 处理多维度打分功能
*
* @param caseLibraryVO
*/
public void dealCaseLibraryDimensionGradeInsert(CaseLibraryVO caseLibraryVO, RequestContext res) {
// 如果不是 多维度,则删除所有
if (caseLibraryVO.getScoreRule() != null && caseLibraryVO.getScoreRule() != 4) {
CaseLibraryDimensionGrade grade = new CaseLibraryDimensionGrade();
grade.setDeleted(1);
EntityWrapper<CaseLibraryDimensionGrade> ew = new EntityWrapper<>();
ew.eq("case_library_id", caseLibraryVO.getId());
caseLibraryDimensionGradeMapper.update(grade, ew);
return;
}
List<CaseLibraryDimensionGradeVO> vos = caseLibraryVO.getCaseLibraryDimensionGradeVOS();
if (CollectionUtils.isEmpty(vos)) {
return;
}
Date now = new Date();
CaseLibraryDimensionGrade caseLibraryDimensionGrade = null;
List<CaseLibraryDimensionGrade> listToInsert = new ArrayList<>();
List<CaseLibraryDimensionGrade> listToUpdate = new ArrayList<>();
List<Long> idsToKeep = new ArrayList<>();
for (CaseLibraryDimensionGradeVO vo : vos) {
caseLibraryDimensionGrade = new CaseLibraryDimensionGrade();
// caseLibraryDimensionGrade.setDescription(vo.getDescription());
caseLibraryDimensionGrade.setId(vo.getId());
caseLibraryDimensionGrade.setCaseLibraryId(caseLibraryVO.getId());
caseLibraryDimensionGrade.setMaxScore(vo.getMaxScore());
caseLibraryDimensionGrade.setMinScore(vo.getMinScore());
caseLibraryDimensionGrade.setName(vo.getName());
caseLibraryDimensionGrade.setSort(vo.getSort());
caseLibraryDimensionGrade.setCompanyId(res.getCompanyId());
caseLibraryDimensionGrade.setOrgId(res.getOrgId());
caseLibraryDimensionGrade.setSiteId(res.getSiteId());
// 新增 保留
if (vo.getId() == null) {
caseLibraryDimensionGrade.setDeleted(0);
caseLibraryDimensionGrade.setCreateById(res.getAccountId());
caseLibraryDimensionGrade.setCreateByName(res.getAccountName());
caseLibraryDimensionGrade.setCreateTime(now);
listToInsert.add(caseLibraryDimensionGrade);
}
// 修改
else {
caseLibraryDimensionGrade.setUpdateById(res.getAccountId());
caseLibraryDimensionGrade.setUpdateByName(res.getAccountName());
caseLibraryDimensionGrade.setUpdateTime(now);
listToUpdate.add(caseLibraryDimensionGrade);
}
idsToKeep.add(vo.getId());
}
// 删除(除了保留的)
if (CollectionUtils.isNotEmpty(idsToKeep)) {
CaseLibraryDimensionGrade grade = new CaseLibraryDimensionGrade();
grade.setDeleted(1);
EntityWrapper<CaseLibraryDimensionGrade> ew = new EntityWrapper<>();
ew.eq("case_library_id", caseLibraryVO.getId());
ew.notIn("id", idsToKeep);
caseLibraryDimensionGradeMapper.update(grade, ew);
}
// 新增
if (CollectionUtils.isNotEmpty(listToInsert)) {
caseLibraryDimensionGradeService.insertBatch(listToInsert);
}
// 修改
if (CollectionUtils.isNotEmpty(listToUpdate)) {
caseLibraryDimensionGradeService.updateBatchById(listToUpdate);
}
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.domain.CaseStudyRecode;
import com.yizhi.library.application.mapper.CaseStudyRecodeMapper;
import com.yizhi.library.application.service.ICaseStudyRecodeService;
import org.springframework.stereotype.Service;
/**
* <p>
* 案例学习记录表 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Service
public class CaseStudyRecodeServiceImpl extends ServiceImpl<CaseStudyRecodeMapper, CaseStudyRecode> implements ICaseStudyRecodeService {
}
package com.yizhi.library.application.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.core.application.vo.DroolsVo;
import com.yizhi.library.application.constant.Constant;
import com.yizhi.library.application.domain.Classify;
import com.yizhi.library.application.mapper.ClassifyMapper;
import com.yizhi.library.application.service.ICaseLibraryRelatedClassifyService;
import com.yizhi.library.application.service.IClassifyService;
import com.yizhi.library.application.service.IStudentCaseRelatedClassifyService;
import com.yizhi.library.application.vo.ClassifyLevelOneVO;
import com.yizhi.library.application.vo.ClassifyListVO;
import com.yizhi.library.application.vo.ClassifyVO;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-03
*/
@Service
public class ClassifyServiceImpl extends ServiceImpl<ClassifyMapper, Classify> implements IClassifyService {
private Logger logger = LoggerFactory.getLogger(ClassifyServiceImpl.class);
@Autowired
private IdGenerator idGenerator;
@Autowired
private ClassifyMapper classifyMapper;
@Autowired
private ICaseLibraryRelatedClassifyService caseLibraryRelatedClassifyService;
@Autowired
private IStudentCaseRelatedClassifyService studentCaseRelatedClassifyService;
@Override
public Integer insertClassify(ClassifyVO classifyVO) {
if (null != classifyVO) {
Classify classify = new Classify();
BeanUtils.copyProperties(classifyVO,classify);
RequestContext res = ContextHolder.get();
Integer sort = classifyMapper.getSort(classify.getParentId(), res.getCompanyId(), res.getSiteId());
if (sort == null) {
sort = 0;
}
//去除一个站点最多三个站点的限制
// if (classify.getLevel() == 0 && classify.getParentId() == 0) {
// if (sort > 2) {
// return Constant.INSERT_CLASSIFY_INSUFFICIENT;
// }
// }
//同一个站点下,同一级分类不允许重名
Classify classify1 = new Classify();
classify1.setParentId(classify.getParentId());
classify1.setName(classify.getName());
classify1.setSiteId(res.getSiteId());
EntityWrapper<Classify> entityWrapper = new EntityWrapper<>(classify1);
entityWrapper.notIn("state", 0);
List<Classify> list = this.selectList(entityWrapper);
if (CollectionUtils.isNotEmpty(list)) {
return Constant.INSERT_CLASSIFY_IDENTICAL_NAME;
}
classify.setId(idGenerator.generate());
classify.setSort(sort + 1);
if (null == classify.getParentId()) {
classify.setParentId(0L);
}
classify.setCreateById(res.getAccountId());
classify.setCreateByName(res.getAccountName());
classify.setCreateTime(new Date());
classify.setUpdateById(res.getAccountId());
classify.setUpdateByName(res.getAccountName());
classify.setUpdateTime(new Date());
classify.setCompanyId(res.getCompanyId());
classify.setSiteId(res.getSiteId());
classify.setOrgId(res.getOrgId());
// classify.setCreateById(0L);
// classify.setUpdateById(0L);
if (this.insert(classify)) {
return Constant.INSERT_CLASSIFY_SUCCESS;
} else {
return Constant.INSERT_CLASSIFY_FAIL;
}
}
return Constant.INSERT_CLASSIFY_FAIL;
}
@Override
public List<ClassifyListVO> getClassifyList() {
List<ClassifyListVO> classifyListVOList = new ArrayList<>();
RequestContext res = ContextHolder.get();
//获取维度分类
Classify classify = new Classify();
classify.setCompanyId(res.getCompanyId());
classify.setSiteId(res.getSiteId());
classify.setParentId(0L);
EntityWrapper<Classify> entityWrapper = new EntityWrapper<>(classify);
entityWrapper.notIn("state", 0);
entityWrapper.orderBy("sort", true);
List<Classify> classifyList = this.selectList(entityWrapper);
//最多三个维度遍历获取一级以及二级分类
if (CollectionUtils.isNotEmpty(classifyList)) {
for (Classify classify1 : classifyList) {
ClassifyListVO classifyListVO = new ClassifyListVO();
BeanUtils.copyProperties(classify1, classifyListVO);
//所有一级分类
classify = new Classify();
classify.setCompanyId(res.getCompanyId());
classify.setSiteId(res.getSiteId());
classify.setParentId(classify1.getId());
classify.setLevel(1);
EntityWrapper<Classify> entityWrapper1 = new EntityWrapper<>(classify);
entityWrapper1.orderBy("sort", true);
entityWrapper1.notIn("state", 0);
List<Classify> classifyLevelOneVOList = this.selectList(entityWrapper1);
//获取每个一级分类下的二级分类并组装到list中
if (CollectionUtils.isNotEmpty(classifyLevelOneVOList)) {
List<ClassifyLevelOneVO> classifyLevelOneVOList1 = new ArrayList<>();
for (Classify classify2 : classifyLevelOneVOList) {
//新建一级分类并把分类信息copy过来,并获取二级分类列表
ClassifyLevelOneVO classifyLevelOneVO = new ClassifyLevelOneVO();
BeanUtils.copyProperties(classify2, classifyLevelOneVO);
if (classify1.getState() == 2) {
classifyLevelOneVO.setState(2);
classifyLevelOneVO.setShowState(0);
} else {
classifyLevelOneVO.setShowState(1);
}
List<Classify> classifyLevelTwoVOList = null;
classify = new Classify();
classify.setCompanyId(res.getCompanyId());
classify.setSiteId(res.getSiteId());
classify.setParentId(classify2.getId());
classify.setLevel(2);
EntityWrapper<Classify> entityWrapper2 = new EntityWrapper<>(classify);
entityWrapper2.notIn("state", 0);
entityWrapper2.orderBy("sort", true);
classifyLevelTwoVOList = this.selectList(entityWrapper2);
if (CollectionUtils.isNotEmpty(classifyLevelTwoVOList)) {
List<ClassifyVO> classifyVOList = new ArrayList<>();
// BeanUtils.copyProperties(classifyLevelTwoVOList, classifyVOList);
classifyVOList = JSON.parseArray(JSON.toJSONString(classifyLevelTwoVOList), ClassifyVO.class);
for (ClassifyVO classifyVO : classifyVOList) {
classifyVO.setKey(classifyVO.getId().toString());
if (classifyLevelOneVO.getState() == 2) {
classifyVO.setState(2);
classifyVO.setShowState(0);
} else {
classifyVO.setShowState(1);
}
if (studentCaseRelatedClassifyService.getIsRelated(classifyVO.getId())) {
classifyVO.setCanDelete(0);
} else {
classifyVO.setCanDelete(1);
}
}
classifyLevelOneVO.setChildren(classifyVOList);
//如果有子分类,不能删除
classifyLevelOneVO.setCanDelete(0);
} else {
//如果没有子分类,查找是否被提交案例关联,关联了不能被删除,没关联可以被删除
if (studentCaseRelatedClassifyService.getIsRelated(classify2.getId())) {
classifyLevelOneVO.setCanDelete(0);
} else {
classifyLevelOneVO.setCanDelete(1);
}
}
classifyLevelOneVO.setKey(classify2.getId().toString());
//组装一级分类list
classifyLevelOneVOList1.add(classifyLevelOneVO);
}
//如果一级分类list不为空,组装到维度类中
if (CollectionUtils.isNotEmpty(classifyLevelOneVOList1)) {
classifyListVO.setChildren(classifyLevelOneVOList1);
classifyListVO.setCanDelete(0);
}
} else {
if (caseLibraryRelatedClassifyService.getIsRelated(classifyListVO.getId())) {
classifyListVO.setCanDelete(0);
} else {
classifyListVO.setCanDelete(1);
}
}
//将维度类放入结果list中
classifyListVOList.add(classifyListVO);
}
return classifyListVOList;
}
return null;
}
@Override
public Classify getPreClassify(Long classifyId, Long parentId, Integer sort, Long companyId, Long siteId) {
Page<Classify> page = new Page<>(1, 1);
List<Classify> list = classifyMapper.getPreClassify(parentId, sort, companyId, siteId, page);
if (CollectionUtils.isNotEmpty(list)) {
return list.get(0);
}
return null;
}
@Override
public Classify getSuffixClassify(Long classifyId, Long parentId, Integer sort, Long companyId, Long siteId) {
Page<Classify> page = new Page<>(1, 1);
List<Classify> list = classifyMapper.getSuffixClassify(parentId, sort, companyId, siteId, page);
if (CollectionUtils.isNotEmpty(list)) {
return list.get(0);
}
return null;
}
@Override
public Page<DroolsVo> getClassifyNameByDrools(String field, String value, Page<DroolsVo> page) {
if (StringUtils.isEmpty(field)) {
logger.info("列名不能为空!");
return page;
}
RequestContext requestContext = ContextHolder.get();
Long siteId = requestContext.getSiteId();
Long companyId = requestContext.getCompanyId();
List<DroolsVo> voList = null;
Classify classify = new Classify();
classify.setSiteId(siteId);
classify.setCompanyId(companyId);
EntityWrapper wrapper = new EntityWrapper(classify);
wrapper.setSqlSelect("distinct(" + field + "),"+"id ")
.isNotNull(field)
.like(field, value)
.ne("state", Constant.DELETED)
.addFilter(field + "!=''")
.orderBy("create_time", false);
List<Classify> list = this.baseMapper.selectPage(page, wrapper);
if (!CollectionUtils.isEmpty(list)) {
voList = new ArrayList<>(list.size());
for (Classify a : list) {
DroolsVo vo = new DroolsVo();
vo.setTaskId(a.getId());
vo.setTaskFieldValue(a.getName());
vo.setTaskParamsType(field);
voList.add(vo);
}
}
page.setRecords(voList);
return page;
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.domain.CommentAdmire;
import com.yizhi.library.application.mapper.CommentAdmireMapper;
import com.yizhi.library.application.service.ICommentAdmireService;
import org.springframework.stereotype.Service;
/**
* <p>
* 评论点赞记录表
服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Service
public class CommentAdmireServiceImpl extends ServiceImpl<CommentAdmireMapper, CommentAdmire> implements ICommentAdmireService {
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.core.application.cache.CacheNamespace;
import com.yizhi.core.application.cache.RedisCache;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.library.application.domain.CommentReply;
import com.yizhi.library.application.mapper.CommentReplyMapper;
import com.yizhi.library.application.service.ICommentReplyService;
import com.yizhi.library.application.util.Util;
import com.yizhi.library.application.vo.CommentReplyVO;
import com.yizhi.system.application.system.remote.AccountClient;
import com.yizhi.system.application.vo.AccountVO;
import com.yizhi.util.application.json.JsonUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* <p>
* 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Service
public class CommentReplyServiceImpl extends ServiceImpl<CommentReplyMapper, CommentReply> implements ICommentReplyService {
@Autowired
private CommentReplyMapper commentReplyMapper;
@Autowired
private AccountClient accountClient;
@Autowired
private RedisCache redisCache;
@Autowired
private Util util;
@Override
public Page<CommentReplyVO> getReplyList(Long commentId, Integer pageNo, Integer pageSize) {
RequestContext res = ContextHolder.get();
Page<CommentReplyVO> page = new Page<>(pageNo, pageSize);
List<CommentReplyVO> list = commentReplyMapper.getReplyList(commentId, page);
//获取评论人和被评论人id并获取信息放入map中
List<Long> accountIds = new ArrayList<>();
Map<Long, AccountVO> accountVOMap = new HashMap<>(16);
if (CollectionUtils.isNotEmpty(list)) {
for (CommentReplyVO commentReplyVO : list) {
if (!accountIds.contains(commentReplyVO.getCommenterId())) {
accountIds.add(commentReplyVO.getCommenterId());
}
if (!accountIds.contains(commentReplyVO.getReplyAccountId())) {
accountIds.add(commentReplyVO.getReplyAccountId());
}
}
List<AccountVO> accountVOList = accountClient.idsGet(accountIds);
if (CollectionUtils.isNotEmpty(accountVOList)) {
for (AccountVO accountVO : accountVOList) {
accountVOMap.put(accountVO.getId(), accountVO);
}
}
//获取敏感词
Set<String> sensitiveWordList = new HashSet<>();
String sensitiveValues = (String) redisCache.hget(CacheNamespace.REDIS_SENSITIVE_WORD_INFO, res.getCompanyId().toString());
if (StringUtils.isNotBlank(sensitiveValues)) {
sensitiveWordList = JsonUtil.json2Ojbect(sensitiveValues, Set.class);
}
//将用户名放入返回结果中
for (CommentReplyVO commentReplyVO : list) {
//过滤敏感词
if (CollectionUtils.isNotEmpty(sensitiveWordList)) {
if (null != commentReplyVO.getContent()) {
commentReplyVO.setContent(util.filterWord(commentReplyVO.getContent(), sensitiveWordList));
}
}
if (null != accountVOMap.get(commentReplyVO.getCommenterId())) {
commentReplyVO.setCommenterName(accountVOMap.get(commentReplyVO.getCommenterId()).getName());
commentReplyVO.setCommenterFullName(
accountVOMap.get(commentReplyVO.getCommenterId()).getFullName() == null ? accountVOMap.get(commentReplyVO.getCommenterId()).getName() : accountVOMap.get(commentReplyVO.getCommenterId()).getFullName());
commentReplyVO.setHeadPortrait(accountVOMap.get(commentReplyVO.getCommenterId()).getHeadPortrait());
}
if (null != accountVOMap.get(commentReplyVO.getReplyAccountId())) {
commentReplyVO.setReplyAccountName(accountVOMap.get(commentReplyVO.getReplyAccountId()).getName());
commentReplyVO.setReplyAccountFullName(
accountVOMap.get(commentReplyVO.getReplyAccountId()).getFullName() == null ?
accountVOMap.get(commentReplyVO.getReplyAccountId()).getName() : accountVOMap.get(commentReplyVO.getReplyAccountId()).getFullName());
}
}
page.setRecords(list);
}
return page;
}
@Override
public boolean putDown(Long id) {
return commentReplyMapper.putDown(id);
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.core.application.cache.CacheNamespace;
import com.yizhi.core.application.cache.RedisCache;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.library.application.domain.Comment;
import com.yizhi.library.application.domain.CommentAdmire;
import com.yizhi.library.application.domain.CommentReply;
import com.yizhi.library.application.mapper.CommentMapper;
import com.yizhi.library.application.mapper.CommentReplyMapper;
import com.yizhi.library.application.param.CommentParam;
import com.yizhi.library.application.service.ICommentAdmireService;
import com.yizhi.library.application.service.ICommentReplyService;
import com.yizhi.library.application.service.ICommentService;
import com.yizhi.library.application.util.AccountUtil;
import com.yizhi.library.application.util.Util;
import com.yizhi.library.application.vo.*;
import com.yizhi.system.application.system.remote.AccountClient;
import com.yizhi.system.application.vo.AccountVO;
import com.yizhi.util.application.json.JsonUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* <p>
* 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements ICommentService {
@Autowired
private ICommentReplyService commentReplyService;
@Autowired
private ICommentAdmireService commentAdmireService;
@Autowired
private CommentMapper commentMapper;
@Autowired
IdGenerator idGenerator;
@Autowired
private AccountClient accountClient;
@Autowired
private CaseLibraryServiceImpl caseLibraryServiceImpl;
@Autowired
private CommentReplyMapper commentReplyMapper;
@Autowired
private RedisCache redisCache;
@Autowired
private Util util;
@Autowired
private AccountUtil accountUtil;
@Override
public boolean comment(CommentParam commentParam) {
RequestContext res = ContextHolder.get();
//插入评论记录
if (commentParam.getType() == 1) {
Comment comment = new Comment();
comment.setId(idGenerator.generate());
comment.setAccountId(res.getAccountId());
comment.setStudentCaseId(commentParam.getStudentCaseId());
comment.setContent(commentParam.getContent());
comment.setCreateById(res.getAccountId());
comment.setCreateByName(res.getAccountName());
comment.setCreateTime(new Date());
comment.setUpdateById(res.getAccountId());
comment.setUpdateByName(res.getAccountName());
comment.setUpdateTime(new Date());
comment.setCompanyId(res.getCompanyId());
comment.setSiteId(res.getSiteId());
comment.setOrgId(res.getOrgId());
comment.setState(1);
return this.insert(comment);
//插入回复记录
} else if (commentParam.getType() == 2) {
CommentReply commentReply = new CommentReply();
commentReply.setId(idGenerator.generate());
commentReply.setCommentId(commentParam.getCommentId());
commentReply.setCommenterId(res.getAccountId());
commentReply.setReplyAccountId(commentParam.getReplyAccountId());
commentReply.setContent(commentParam.getContent());
commentReply.setCreateById(res.getAccountId());
commentReply.setCreateByName(res.getAccountName());
commentReply.setCreateTime(new Date());
commentReply.setUpdateById(res.getAccountId());
commentReply.setUpdateByName(res.getAccountName());
commentReply.setUpdateTime(new Date());
commentReply.setState(1);
return commentReplyService.insert(commentReply);
}
return false;
}
@Override
public boolean admireComment(Long commentId) {
RequestContext res = ContextHolder.get();
CommentAdmire commentAdmire = new CommentAdmire();
commentAdmire.setId(idGenerator.generate());
commentAdmire.setAccountId(res.getAccountId());
commentAdmire.setCommentId(commentId);
commentAdmire.setCreateById(res.getAccountId());
commentAdmire.setCreateByName(res.getAccountName());
commentAdmire.setCreateTime(new Date());
commentAdmire.setUpdateById(res.getAccountId());
commentAdmire.setUpdateByName(res.getAccountName());
commentAdmire.setUpdateTime(new Date());
commentAdmire.setState(1);
return commentAdmireService.insert(commentAdmire);
}
@Override
public boolean cancelAdmireComment(Long commentId) {
RequestContext res = ContextHolder.get();
CommentAdmire commentAdmire = new CommentAdmire();
commentAdmire.setCommentId(commentId);
commentAdmire.setAccountId(res.getAccountId());
commentAdmire.setState(1);
return commentAdmireService.delete(new EntityWrapper<>(commentAdmire));
}
@Override
public Page<CommentVO> getCommentList(Long studentCaseId, Integer pageNo, Integer pageSize) {
RequestContext res = ContextHolder.get();
Page<CommentVO> page = new Page<>(pageNo, pageSize);
List<CommentVO> list = commentMapper.getCommentList(studentCaseId, res.getAccountId(), page);
List<Long> accountIds = new ArrayList<>();
if (CollectionUtils.isNotEmpty(list)) {
for (CommentVO commentVO : list) {
Page<CommentReplyVO> replyVOPage = new Page<>(1, 5);
//获取5条回复
List<CommentReplyVO> children = commentReplyMapper.getReplyList(commentVO.getId(), replyVOPage);
//需要获得用户信息的评论人id
if (!accountIds.contains(commentVO.getAccountId())) {
accountIds.add(commentVO.getAccountId());
}
//需要获得用户信息的回复人id
if (CollectionUtils.isNotEmpty(children)) {
for (CommentReplyVO commentReplyVO : children) {
if (!accountIds.contains(commentReplyVO.getCommenterId())) {
accountIds.add(commentReplyVO.getCommenterId());
}
}
commentVO.setChildren(children);
}
}
}
//根据用户ids获取用户信息并放到map中
List<AccountVO> accountVOList = accountClient.idsGet(accountIds);
Map<Long, AccountVO> accountVOMap = new HashMap<>(16);
if (CollectionUtils.isNotEmpty(accountVOList)) {
for (AccountVO accountVO : accountVOList) {
accountVOMap.put(accountVO.getId(), accountVO);
}
}
getRecords(page, list, accountVOMap, res.getCompanyId());
return page;
}
@Override
public Page<CommentVO> getCommentManageList(Long studentCaseId, String name, Integer state, Integer pageNo, Integer pageSize) {
RequestContext res = ContextHolder.get();
RangeAccountsVO rangeAccountsVO = accountUtil.getRangeAccounts(res.isAdmin(), res.getAccountId(), res.getSiteId(), name, null);
List<Long> accountIds = rangeAccountsVO.getAccountIds();
Map<Long, ReportAccountRespVO> accountMap = rangeAccountsVO.getAccountMap();
Page<CommentVO> page = new Page<>(pageNo, pageSize);
List<CommentVO> list = commentMapper.getCommentManageList(studentCaseId, accountIds, state, res.getCompanyId(), res.getSiteId(), page);
if (CollectionUtils.isNotEmpty(list)) {
List<Long> accountIds1 = new ArrayList<>();
if (null == accountIds) {
accountIds = new ArrayList<>();
}
if (null == accountMap) {
accountMap = new HashMap<>(16);
}
//获取敏感词
Set<String> sensitiveWordList = new HashSet<>();
String sensitiveValues = (String) redisCache.hget(CacheNamespace.REDIS_SENSITIVE_WORD_INFO, res.getCompanyId().toString());
if (StringUtils.isNotBlank(sensitiveValues)) {
sensitiveWordList = JsonUtil.json2Ojbect(sensitiveValues, Set.class);
}
for (CommentVO commentVO : list) {
//过滤敏感词
if (CollectionUtils.isNotEmpty(sensitiveWordList)) {
if (null != commentVO.getContent()) {
commentVO.setContent(util.filterWord(commentVO.getContent(), sensitiveWordList));
}
}
if (!accountIds.contains(commentVO.getAccountId())) {
accountIds1.add(commentVO.getAccountId());
}
//获取回复列表
List<CommentReplyVO> commentReplyList = commentMapper.getCommentReplyList(accountIds, state, commentVO.getId());
if (CollectionUtils.isNotEmpty(commentReplyList)) {
for (CommentReplyVO commentReplyVO : commentReplyList) {
commentReplyVO.setKey(commentReplyVO.getId().toString());
//过滤敏感词
if (CollectionUtils.isNotEmpty(sensitiveWordList)) {
if (StringUtils.isNotBlank(commentReplyVO.getContent())) {
commentReplyVO.setContent(util.filterWord(commentReplyVO.getContent(), sensitiveWordList));
}
}
//需要获得用户信息的回复人id及被回复人id
if (!accountIds.contains(commentReplyVO.getCommenterId()) && !accountIds1.contains(commentReplyVO.getCommenterId())) {
accountIds1.add(commentReplyVO.getCommenterId());
}
if (!accountIds.contains(commentReplyVO.getReplyAccountId()) && !accountIds1.contains(commentReplyVO.getReplyAccountId())) {
accountIds1.add(commentReplyVO.getReplyAccountId());
}
}
commentVO.setChildren(commentReplyList);
}
}
//获取用户信息
if (CollectionUtils.isNotEmpty(accountIds1)) {
accountMap = accountUtil.getAccountMap(accountMap, accountIds1);
}
//组装用户信息
for (CommentVO commentVO : list) {
commentVO.setKey(commentVO.getId().toString());
Integer index = list.indexOf(commentVO) + 1;
Integer sort = ((pageNo - 1) * pageSize) + index;
commentVO.setIndex(sort);
ReportAccountRespVO commenter = accountMap.get(commentVO.getAccountId());
if (null != commenter) {
commentVO.setCommenterUserName(commenter.getUserName());
commentVO.setCommenterFullName(commenter.getUserFullName());
}
//组装回复用户信息
if (CollectionUtils.isNotEmpty(commentVO.getChildren())) {
for (CommentReplyVO commentReplyVO : commentVO.getChildren()) {
ReportAccountRespVO commenter1 = accountMap.get(commentReplyVO.getCommenterId());
if (null != commenter1) {
commentReplyVO.setCommenterName(commenter1.getUserName());
commentReplyVO.setCommenterFullName(commenter1.getUserFullName() == null ? "--" : commenter1.getUserFullName());
}
ReportAccountRespVO replyAccount = accountMap.get(commentReplyVO.getReplyAccountId());
if (null != replyAccount) {
commentReplyVO.setReplyAccountFullName(replyAccount.getUserFullName() == null ? "--" : replyAccount.getUserFullName());
}
}
}
}
page.setRecords(list);
}
return page;
}
@Override
public List<CommentReplyVO> getCommentReplyList(String name, Integer state, Long commentId) {
RequestContext res = ContextHolder.get();
//获取敏感词
Set<String> sensitiveWordList = new HashSet<>();
String sensitiveValues = (String) redisCache.hget(CacheNamespace.REDIS_SENSITIVE_WORD_INFO, res.getCompanyId().toString());
if (StringUtils.isNotBlank(sensitiveValues)) {
sensitiveWordList = JsonUtil.json2Ojbect(sensitiveValues, Set.class);
}
List<Long> accountIds = new ArrayList<>();
Map<Long, ReportAccountRespVO> accountMap = new HashMap<>(16);
boolean isGetAccountMap = false;
//如果是管理员
if (res.isAdmin()) {
//如果模糊查询,查出用户信息
if (StringUtils.isNotBlank(name)) {
isGetAccountMap = true;
}
} else {
isGetAccountMap = true;
}
if (isGetAccountMap) {
if (StringUtils.isNotBlank(name)) {
name = name.trim();
}
AccountMapVO accountMapVO = caseLibraryServiceImpl.getAccountMapVO(res.isAdmin(), res.getAccountId(),
res.getSiteId(), null, null, name, null);
if (null != accountMapVO) {
accountIds = accountMapVO.getAccountIds();
if (CollectionUtils.isEmpty(accountIds)) {
return null;
}
accountMap = accountMapVO.getAccountMap();
} else {
return null;
}
}
List<CommentReplyVO> list = commentMapper.getCommentReplyList(accountIds, state, commentId);
//管理员非模糊查询需要获得用户信息
if (!isGetAccountMap) {
if (CollectionUtils.isNotEmpty(list)) {
for (CommentReplyVO commentReplyVO : list) {
if (!accountIds.contains(commentReplyVO.getCommenterId())) {
accountIds.add(commentReplyVO.getCommenterId());
}
if (!accountIds.contains(commentReplyVO.getReplyAccountId())) {
accountIds.add(commentReplyVO.getReplyAccountId());
}
}
}
//根据用户ids获取用户信息并放到map中
List<AccountVO> accountVOList = accountClient.idsGet(accountIds);
Map<Long, AccountVO> accountVOMap = new HashMap<>(16);
if (CollectionUtils.isNotEmpty(accountVOList)) {
for (AccountVO accountVO : accountVOList) {
accountVOMap.put(accountVO.getId(), accountVO);
}
}
//将用户信息组装进去
for (CommentReplyVO commentReplyVO : list) {
if (CollectionUtils.isNotEmpty(sensitiveWordList)) {
if (null != commentReplyVO.getContent()) {
commentReplyVO.setContent(util.filterWord(commentReplyVO.getContent(), sensitiveWordList));
}
}
//评论人
AccountVO commentAccount = accountVOMap.get(commentReplyVO.getCommenterId());
//被回复人
AccountVO replyAccount = accountVOMap.get(commentReplyVO.getReplyAccountId());
if (null != commentAccount) {
commentReplyVO.setCommenterName(commentAccount.getName());
commentReplyVO.setCommenterFullName(commentAccount.getFullName());
}
if (null != replyAccount) {
commentReplyVO.setReplyAccountFullName(replyAccount.getFullName());
}
}
//其他已经获得用户信息,直接组装
} else {
if (CollectionUtils.isNotEmpty(list)) {
List<Long> accountIds1 = new ArrayList<>();
//评论人信息已经有了
for (CommentReplyVO commentReplyVO : list) {
if (!accountIds.contains(commentReplyVO.getReplyAccountId())) {
accountIds1.add(commentReplyVO.getReplyAccountId());
}
}
List<AccountVO> accountVOList = accountClient.idsGet(accountIds1);
Map<Long, AccountVO> accountVOMap = new HashMap<>(16);
if (CollectionUtils.isNotEmpty(accountVOList)) {
for (AccountVO accountVO : accountVOList) {
accountVOMap.put(accountVO.getId(), accountVO);
}
}
for (CommentReplyVO commentReplyVO : list) {
if (CollectionUtils.isNotEmpty(sensitiveWordList)) {
if (null != commentReplyVO.getContent()) {
commentReplyVO.setContent(util.filterWord(commentReplyVO.getContent(), sensitiveWordList));
}
}
//评论人
ReportAccountRespVO respVO = accountMap.get(commentReplyVO.getCommenterId());
//回复人
ReportAccountRespVO respVO1 = accountMap.get(commentReplyVO.getReplyAccountId());
//如果回复人没找到,再找一次
AccountVO accountVO = accountVOMap.get(commentReplyVO.getReplyAccountId());
if (null != respVO) {
commentReplyVO.setCommenterName(respVO.getUserName() == null ? "" : respVO.getUserName());
commentReplyVO.setCommenterFullName(respVO.getUserFullName() == null ? "" : respVO.getUserFullName());
}
if (null != respVO1) {
commentReplyVO.setReplyAccountFullName(respVO1.getUserFullName());
} else if (null != accountVO) {
commentReplyVO.setReplyAccountFullName(accountVO.getFullName());
} else {
commentReplyVO.setReplyAccountFullName("--");
}
}
}
}
return list;
}
@Override
public boolean putDown(Long id, Integer type) {
if (type == 1) {
return commentMapper.putDown(id);
} else if (type == 2) {
return commentReplyService.putDown(id);
}
return false;
}
@Override
public boolean deleteCommentOrReply(Long id, Integer type) {
if (type == 1) {
this.deleteById(id);
} else if (type == 2) {
commentReplyService.deleteById(id);
}
return false;
}
@Override
public boolean release(Long id, Integer type) {
if (type == 1) {
return commentMapper.release(id);
} else if (type == 2) {
return commentReplyMapper.release(id);
}
return false;
}
@Override
public List<CommentVO> downloadList(RequestContext res, Long studentCaseId, String name, Integer state) {
//获取敏感词
Set<String> sensitiveWordList = new HashSet<>();
String sensitiveValues = (String) redisCache.hget(CacheNamespace.REDIS_SENSITIVE_WORD_INFO, res.getCompanyId().toString());
if (StringUtils.isNotBlank(sensitiveValues)) {
sensitiveWordList = JsonUtil.json2Ojbect(sensitiveValues, Set.class);
}
List<Long> accountIds = new ArrayList<>();
Map<Long, ReportAccountRespVO> accountMap = new HashMap<>(16);
boolean isGetAccountMap = false;
//如果是管理员
if (res.isAdmin()) {
//如果模糊查询,查出用户信息
if (StringUtils.isNotBlank(name)) {
isGetAccountMap = true;
}
} else {
isGetAccountMap = true;
}
if (isGetAccountMap) {
if (StringUtils.isNotBlank(name)) {
name = name.trim();
}
AccountMapVO accountMapVO = caseLibraryServiceImpl.getAccountMapVO(res.isAdmin(), res.getAccountId(),
res.getSiteId(), null, null, name, null);
if (null != accountMapVO) {
accountIds = accountMapVO.getAccountIds();
if (CollectionUtils.isEmpty(accountIds)) {
return null;
}
accountMap = accountMapVO.getAccountMap();
} else {
return null;
}
}
Page<CommentVO> page = new Page<>(1, Integer.MAX_VALUE);
//评论列表
List<CommentVO> list = commentMapper.getCommentManageList(studentCaseId, accountIds, state, res.getCompanyId(), res.getSiteId(), page);
//管理员非模糊查询需要获得用户信息
if (!isGetAccountMap) {
if (CollectionUtils.isNotEmpty(list)) {
for (CommentVO commentVO : list) {
if (!accountIds.contains(commentVO.getAccountId())) {
accountIds.add(commentVO.getAccountId());
}
}
} else {
return null;
}
//根据用户ids获取用户信息并放到map中
List<AccountVO> accountVOList = accountClient.idsGet(accountIds);
Map<Long, AccountVO> accountVOMap = new HashMap<>(16);
if (CollectionUtils.isNotEmpty(accountVOList)) {
for (AccountVO accountVO : accountVOList) {
accountVOMap.put(accountVO.getId(), accountVO);
}
} else {
return null;
}
for (CommentVO commentVO : list) {
AccountVO accountVO = accountVOMap.get(commentVO.getAccountId());
if (null != accountVO) {
commentVO.setCommenterUserName(accountVO.getName());
commentVO.setCommenterFullName(accountVO.getFullName());
}
}
//其他已经获得用户信息,直接组装
} else {
if (CollectionUtils.isNotEmpty(list)) {
for (CommentVO commentVO : list) {
ReportAccountRespVO respVO = accountMap.get(commentVO.getAccountId());
if (null != respVO) {
commentVO.setCommenterUserName(respVO.getUserName() == null ? "" : respVO.getUserName());
commentVO.setCommenterFullName(respVO.getUserFullName() == null ? "" : respVO.getUserFullName());
}
}
} else {
return null;
}
}
//组装结果
List<CommentVO> resultList = new ArrayList<>();
for (CommentVO commentVO : list) {
//过滤评论敏感词
if (CollectionUtils.isNotEmpty(sensitiveWordList)) {
if (null != commentVO.getContent()) {
commentVO.setContent(util.filterWord(commentVO.getContent(), sensitiveWordList));
}
}
resultList.add(commentVO);
//获取该评论的回复并组装
List<CommentVO> commentReplyList = commentMapper.getCommentReplyDownLoadList(commentVO.getId(), state, accountIds);
if (CollectionUtils.isNotEmpty(commentReplyList)) {
if (!isGetAccountMap) {
List<Long> accountIds1 = new ArrayList<>();
//如果是管理员非模糊查询,
for (CommentVO commentVO1 : commentReplyList) {
if (!accountIds1.contains(commentVO1.getAccountId())) {
accountIds1.add(commentVO1.getAccountId());
}
if (!accountIds1.contains(commentVO1.getReplyAccountId())) {
accountIds1.add(commentVO1.getReplyAccountId());
}
}
List<AccountVO> accountVOList = accountClient.idsGet(accountIds1);
Map<Long, AccountVO> accountVOMap = new HashMap<>(16);
if (CollectionUtils.isNotEmpty(accountVOList)) {
for (AccountVO accountVO : accountVOList) {
accountVOMap.put(accountVO.getId(), accountVO);
}
}
for (CommentVO commentVO1 : commentReplyList) {
//过滤回复敏感词
if (CollectionUtils.isNotEmpty(sensitiveWordList)) {
if (null != commentVO1.getContent()) {
commentVO1.setContent(util.filterWord(commentVO1.getContent(), sensitiveWordList));
}
}
AccountVO commentAccountVO = accountVOMap.get(commentVO1.getAccountId());
AccountVO replyAccountVO = accountVOMap.get(commentVO1.getReplyAccountId());
if (null != commentAccountVO) {
commentVO1.setCommenterUserName(commentAccountVO.getName());
commentVO1.setCommenterFullName(commentAccountVO.getFullName());
}
if (null != replyAccountVO) {
commentVO1.setReplyAccountFullName(replyAccountVO.getFullName());
}
resultList.add(commentVO1);
}
} else {
List<Long> accountIds1 = new ArrayList<>();
for (CommentVO commentVO1 : commentReplyList) {
if (!accountIds.contains(commentVO1.getReplyAccountId())) {
accountIds1.add(commentVO1.getReplyAccountId());
}
}
List<AccountVO> accountList = accountClient.idsGet(accountIds1);
Map<Long, AccountVO> accountVOMap = new HashMap<>(16);
if (CollectionUtils.isNotEmpty(accountList)) {
for (AccountVO accountVO : accountList) {
accountVOMap.put(accountVO.getId(), accountVO);
}
}
for (CommentVO commentVO1 : commentReplyList) {
//过滤回复敏感词
if (CollectionUtils.isNotEmpty(sensitiveWordList)) {
if (null != commentVO1.getContent()) {
commentVO1.setContent(util.filterWord(commentVO1.getContent(), sensitiveWordList));
}
}
ReportAccountRespVO commentAccountVO = accountMap.get(commentVO1.getAccountId());
ReportAccountRespVO replyAccountVO = accountMap.get(commentVO1.getReplyAccountId());
AccountVO replyAccountVO1 = null;
if (null == replyAccountVO) {
replyAccountVO1 = accountVOMap.get(commentVO1.getReplyAccountId());
}
if (null != commentAccountVO) {
commentVO1.setCommenterFullName(commentAccountVO.getUserFullName());
commentVO1.setCommenterUserName(commentAccountVO.getUserName());
}
if (null != replyAccountVO) {
commentVO1.setReplyAccountFullName(replyAccountVO.getUserFullName());
} else if (null != replyAccountVO1) {
commentVO1.setReplyAccountFullName(replyAccountVO1.getFullName());
}
resultList.add(commentVO1);
}
}
}
}
return resultList;
}
private void getRecords(Page<CommentVO> page, List<CommentVO> list, Map<Long, AccountVO> accountVOMap, Long companyId) {
if (CollectionUtils.isNotEmpty(list)) {
Set<String> sensitiveWordList = new HashSet<>();
String sensitiveValues = (String) redisCache.hget(CacheNamespace.REDIS_SENSITIVE_WORD_INFO, companyId.toString());
if (StringUtils.isNotBlank(sensitiveValues)) {
sensitiveWordList = JsonUtil.json2Ojbect(sensitiveValues, Set.class);
}
for (CommentVO commentVO : list) {
AccountVO accountVO = accountVOMap.get(commentVO.getAccountId());
//组装评论人信息
if (null != accountVO) {
commentVO.setCommenterUserName(accountVO.getName());
commentVO.setCommenterFullName(accountVO.getFullName());
commentVO.setHeadPortrait(accountVO.getHeadPortrait() == null ? "--" : accountVO.getHeadPortrait());
}
//敏感词过滤评论内容
if (CollectionUtils.isNotEmpty(sensitiveWordList)) {
if (null != commentVO.getContent()) {
commentVO.setContent(util.filterWord(commentVO.getContent(), sensitiveWordList));
}
}
if (CollectionUtils.isNotEmpty(commentVO.getChildren())) {
for (CommentReplyVO commentReplyVO : commentVO.getChildren()) {
AccountVO commentAccount = accountVOMap.get(commentReplyVO.getCommenterId());
AccountVO replyAccount = accountVOMap.get(commentReplyVO.getReplyAccountId());
//组装回复人信息
if (null != commentAccount) {
commentReplyVO.setCommenterName(commentAccount.getName());
commentReplyVO.setCommenterFullName(commentAccount.getFullName());
}
//组装被回复人信息
if (null != replyAccount) {
commentReplyVO.setReplyAccountName(replyAccount.getName());
commentReplyVO.setReplyAccountFullName(replyAccount.getFullName());
}
//敏感词过滤回复内容
if (null != commentReplyVO.getContent()) {
commentReplyVO.setContent(util.filterWord(commentReplyVO.getContent(), sensitiveWordList));
}
}
}
}
}
page.setRecords(list);
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.library.application.domain.Favorite;
import com.yizhi.library.application.mapper.FavoriteMapper;
import com.yizhi.library.application.service.IFavoriteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* <p>
* 收藏记录表 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Service
public class FavoriteServiceImpl extends ServiceImpl<FavoriteMapper, Favorite> implements IFavoriteService {
@Autowired
private IdGenerator idGenerator;
@Override
public boolean favorite(Long studentCaseId) {
RequestContext res = ContextHolder.get();
Favorite favorite = new Favorite();
favorite.setId(idGenerator.generate());
favorite.setBizId(studentCaseId);
favorite.setAccountId(res.getAccountId());
favorite.setType(1);
favorite.setState(1);
favorite.setCreateById(res.getAccountId());
favorite.setCreateByName(res.getAccountName());
favorite.setCreateTime(new Date());
favorite.setUpdateById(res.getAccountId());
favorite.setUpdateByName(res.getAccountName());
favorite.setUpdateTime(new Date());
favorite.setCompanyId(res.getCompanyId());
favorite.setSiteId(res.getSiteId());
favorite.setOrgId(res.getOrgId());
return this.insert(favorite);
}
@Override
public boolean cancelFavorite(Long studentCaseId) {
RequestContext res = ContextHolder.get();
Favorite favorite = new Favorite();
favorite.setBizId(studentCaseId);
favorite.setAccountId(res.getAccountId());
favorite.setType(1);
return this.delete(new EntityWrapper<>(favorite));
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.library.application.domain.InformRecorde;
import com.yizhi.library.application.mapper.InformRecordeMapper;
import com.yizhi.library.application.param.InformParam;
import com.yizhi.library.application.service.IInformRecordeService;
import com.yizhi.library.application.util.Util;
import com.yizhi.library.application.vo.InformVO;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* <p>
* 举报记录表 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-12
*/
@Service
public class InformRecordeServiceImpl extends ServiceImpl<InformRecordeMapper, InformRecorde> implements IInformRecordeService {
@Autowired
private IdGenerator idGenerator;
@Autowired
private InformRecordeMapper informRecordeMapper;
@Override
public boolean inform(InformParam informParam) {
RequestContext res = ContextHolder.get();
InformRecorde informRecorde = new InformRecorde();
informRecorde.setId(idGenerator.generate());
informRecorde.setStudentCaseId(informParam.getStudentCaseId());
informRecorde.setAccountId(res.getAccountId());
informRecorde.setState(1);
informRecorde.setInformTime(new Date());
informRecorde.setDescription(informParam.getInformDescription());
informRecorde.setCreateById(res.getAccountId());
informRecorde.setCreateByName(res.getAccountName());
informRecorde.setCreateTime(new Date());
informRecorde.setUpdateById(res.getAccountId());
informRecorde.setUpdateByName(res.getAccountName());
informRecorde.setUpdateTime(new Date());
informRecorde.setCompanyId(res.getCompanyId());
informRecorde.setSiteId(res.getSiteId());
informRecorde.setOrgId(res.getOrgId());
//组装截图url
if (CollectionUtils.isNotEmpty(informParam.getPictureUrlList())){
String url = Util.listToString(informParam.getPictureUrlList());
informRecorde.setPictureUrl(url);
}
return this.insert(informRecorde);
}
@Override
public List<InformVO> getInformList(Long studentCaseId) {
return informRecordeMapper.getInformList(studentCaseId);
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.library.application.domain.MustSubmit;
import com.yizhi.library.application.mapper.MustSubmitMapper;
import com.yizhi.library.application.service.IMustSubmitService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 必须提交人表 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-08
*/
@Service
public class MustSubmitServiceImpl extends ServiceImpl<MustSubmitMapper, MustSubmit> implements IMustSubmitService {
@Autowired
private IdGenerator idGenerator;
@Override
public boolean insertList(List<MustSubmit> mustSubmitList) {
if (CollectionUtils.isNotEmpty(mustSubmitList)) {
MustSubmit mustSubmit1 = new MustSubmit();
mustSubmit1.setCaseLibraryId(mustSubmitList.get(0).getCaseLibraryId());
this.delete(new EntityWrapper<>(mustSubmit1));
for (MustSubmit mustSubmit : mustSubmitList) {
mustSubmit.setId(idGenerator.generate());
}
return this.insertBatch(mustSubmitList);
} else {
return false;
}
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.library.application.domain.Scorer;
import com.yizhi.library.application.mapper.ScorerMapper;
import com.yizhi.library.application.service.IScorerService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-08
*/
@Service
public class ScorerServiceImpl extends ServiceImpl<ScorerMapper, Scorer> implements IScorerService {
@Autowired
private IdGenerator idGenerator;
@Autowired
private ScorerMapper scorerMapper;
@Override
public boolean insertList(List<Scorer> scorerImportList) {
if (CollectionUtils.isNotEmpty(scorerImportList)) {
Scorer scorer1 = new Scorer();
scorer1.setCaseLibraryId(scorerImportList.get(0).getCaseLibraryId());
this.delete(new EntityWrapper<>(scorer1));
for (Scorer scorer : scorerImportList) {
scorer.setId(idGenerator.generate());
}
return this.insertBatch(scorerImportList);
} else {
return false;
}
}
@Override
public List<Long> getScorerList(Long caseLibraryId, Long accountId) {
return scorerMapper.getScorerList(caseLibraryId, accountId);
}
}
package com.yizhi.library.application.service.impl;
import java.util.List;
import com.yizhi.library.application.domain.StatisticStudentCase;
import com.yizhi.library.application.domain.StatisticStudentCaseAccount;
import com.yizhi.library.application.domain.StatisticStudentCaseOrg;
import com.yizhi.library.application.domain.StudentCase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.mapper.StatisticStudentCaseAccountMapper;
import com.yizhi.library.application.mapper.StatisticStudentCaseMapper;
import com.yizhi.library.application.mapper.StatisticStudentCaseOrgMapper;
import com.yizhi.library.application.service.IStatisticStudentCaseAccount;
@Service
public class StatisticStudentCaseAccountImpl extends ServiceImpl<StatisticStudentCaseAccountMapper, StatisticStudentCaseAccount> implements IStatisticStudentCaseAccount {
@Autowired
private StatisticStudentCaseOrgMapper statisticStudentCaseOrgMapper;
@Autowired
private StatisticStudentCaseMapper statisticStudentCaseMapper;
@Override
public StatisticStudentCaseAccount getAccountExportVO(Long accountId,Long siteId) {
// TODO Auto-generated method stub
return this.baseMapper.getAccountExportVO(accountId,siteId);
}
@Override
public StatisticStudentCaseOrg getOrgExportVO(Long orgId, Long siteId) {
// TODO Auto-generated method stub
return statisticStudentCaseOrgMapper.getStudentCaseOrg(orgId,siteId);
}
@Override
public List<Long> getSiteIds() {
// TODO Auto-generated method stub
return this.baseMapper.getSiteIds();
}
@Override
public StatisticStudentCase getStudentCase(Long studentCaseId) {
// TODO Auto-generated method stub
return statisticStudentCaseMapper.getStatisticStudentCase(studentCaseId);
}
@Override
public List<StudentCase> getStudentCases() {
// TODO Auto-generated method stub
return this.baseMapper.getStudentCases();
}
}
package com.yizhi.library.application.service.impl;
import com.yizhi.library.application.domain.StatisticStudentCase;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.mapper.StatisticStudentCaseMapper;
import com.yizhi.library.application.service.IStatisticStudentCase;
@Service
public class StatisticStudentCaseImpl extends ServiceImpl<StatisticStudentCaseMapper, StatisticStudentCase> implements IStatisticStudentCase{
}
package com.yizhi.library.application.service.impl;
import com.yizhi.library.application.domain.StatisticStudentCaseOrg;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.mapper.StatisticStudentCaseOrgMapper;
import com.yizhi.library.application.service.IStatisticStudentCaseOrg;
@Service
public class StatisticStudentCaseOrgImpl extends ServiceImpl<StatisticStudentCaseOrgMapper, StatisticStudentCaseOrg> implements IStatisticStudentCaseOrg {
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.domain.StudentCaseAccessary;
import com.yizhi.library.application.mapper.StudentCaseAccessaryMapper;
import com.yizhi.library.application.service.IStudentCaseAccessaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* <p>
* 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-12-19
*/
@Service
public class StudentCaseAccessaryServiceImpl extends ServiceImpl<StudentCaseAccessaryMapper, StudentCaseAccessary> implements IStudentCaseAccessaryService {
@Autowired
private StudentCaseAccessaryMapper studentCaseAccessaryMapper;
@Override
public void deleteAccessary(Long studentCaseId) {
studentCaseAccessaryMapper.deleteAccessary(studentCaseId);
}
@Override
public boolean verifyVedio(List<Long> ids) {
return studentCaseAccessaryMapper.verifyVedio(ids);
}
@Override
public boolean updateTranscodeUrl(Map<String, String> map) {
Long id = Long.valueOf(map.get("id"));
String videoLd = map.get("ld");
String videoHd = map.get("hd");
String videoSd = map.get("sd");
return studentCaseAccessaryMapper.updateTranscodeUrl(id, videoLd, videoHd, videoSd);
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.library.application.domain.StudentCaseAuthorize;
import com.yizhi.library.application.mapper.StudentCaseAuthorizeMapper;
import com.yizhi.library.application.service.IStudentCaseAuthorizeService;
import com.yizhi.library.application.vo.StudentCaseAuthorizeVO;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* <p>
* 考试人员范围 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-08-05
*/
@Service
public class StudentCaseAuthorizeServiceImpl extends ServiceImpl<StudentCaseAuthorizeMapper, StudentCaseAuthorize> implements IStudentCaseAuthorizeService {
@Autowired
private IdGenerator idGenerator;
@Autowired
private StudentCaseAuthorizeMapper studentCaseAuthorizeMapper;
@Override
public boolean insertAuthorize(List<StudentCaseAuthorizeVO> studentCaseAuthorizeList) {
RequestContext res = ContextHolder.get();
//插入之前,先删除之前的指定范围
StudentCaseAuthorize studentCaseAuthorize = new StudentCaseAuthorize();
studentCaseAuthorize.setStudentCaseId(studentCaseAuthorizeList.get(0).getStudentCaseId());
this.delete(new EntityWrapper<>(studentCaseAuthorize));
Date date = new Date();
List<StudentCaseAuthorize> list = new ArrayList<>();
if (CollectionUtils.isEmpty(studentCaseAuthorizeList)) {
return true;
}
//插入数据
for (StudentCaseAuthorizeVO studentCaseAuthorize1 : studentCaseAuthorizeList) {
studentCaseAuthorize1.setId(idGenerator.generate());
studentCaseAuthorize1.setCreateById(res.getAccountId());
studentCaseAuthorize1.setCreateByName(res.getAccountName());
studentCaseAuthorize1.setCreateTime(date);
studentCaseAuthorize1.setUpdateById(res.getAccountId());
studentCaseAuthorize1.setUpdateByName(res.getAccountName());
studentCaseAuthorize1.setUpdateTime(date);
StudentCaseAuthorize stuAut = new StudentCaseAuthorize();
BeanUtils.copyProperties(stuAut,studentCaseAuthorize1);
list.add(stuAut);
}
return this.insertBatch(list);
}
@Override
public List<StudentCaseAuthorizeVO> getAuthorize(Long studentCaseId) {
return studentCaseAuthorizeMapper.getAuthorize(studentCaseId);
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.domain.StudentCaseDimensionGradeRecord;
import com.yizhi.library.application.mapper.StudentCaseDimensionGradeRecordMapper;
import com.yizhi.library.application.service.IStudentCaseDimensionGradeRecordService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author shengchenglong123
* @since 2020-08-05
*/
@Service
public class StudentCaseDimensionGradeRecordServiceImpl extends ServiceImpl<StudentCaseDimensionGradeRecordMapper, StudentCaseDimensionGradeRecord> implements IStudentCaseDimensionGradeRecordService {
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.domain.StudentCaseRelatedClassify;
import com.yizhi.library.application.vo.StudentRelatedClassifyVO;
import com.yizhi.library.application.mapper.StudentCaseRelatedClassifyMapper;
import com.yizhi.library.application.service.IStudentCaseRelatedClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 学生案例关联分类表 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-07-09
*/
@Service
public class StudentCaseRelatedClassifyServiceImpl extends ServiceImpl<StudentCaseRelatedClassifyMapper, StudentCaseRelatedClassify> implements IStudentCaseRelatedClassifyService {
@Autowired
private StudentCaseRelatedClassifyMapper studentCaseRelatedClassifyMapper;
@Override
public StudentRelatedClassifyVO getRelatedClassify(Long rootId, Long studentCaseId) {
return studentCaseRelatedClassifyMapper.getRelatedClassify(rootId, studentCaseId);
}
@Override
public boolean getIsRelated(Long classifyId) {
if (studentCaseRelatedClassifyMapper.getIsRelated(classifyId) > 0) {
return true;
}else {
return false;
}
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.plugins.pagination.PageHelper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.domain.StatisticStudentCaseAccount;
import com.yizhi.library.application.domain.StatisticStudentCaseOrg;
import com.yizhi.library.application.domain.StudentCase;
import com.yizhi.library.application.mapper.StatisticStudentCaseMapper;
import com.yizhi.library.application.mapper.StudentCaseReportMapper;
import com.yizhi.library.application.service.IStatisticStudentCase;
import com.yizhi.library.application.service.IStatisticStudentCaseAccount;
import com.yizhi.library.application.service.IStatisticStudentCaseOrg;
import com.yizhi.library.application.service.IStudentCaseReportService;
import com.yizhi.library.application.vo.StatisticStudentCaseVO;
import com.yizhi.system.application.system.remote.AccountClient;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class StudentCaseReportServiceImpl extends ServiceImpl<StudentCaseReportMapper, StudentCase> implements IStudentCaseReportService {
@Autowired
private AccountClient accountClient;
@Autowired
private IStatisticStudentCaseAccount statisticStudentCaseAccount;
@Autowired
private IStatisticStudentCase statisticStudentCase;
@Autowired
private IStatisticStudentCaseOrg statisticStudentCaseOrg;
@Autowired
private StatisticStudentCaseMapper studentCaseMapper;
@Override
public Page<StatisticStudentCaseVO> studentCaseList(String startDate, String endDate, String kwd, Long siteId,
Integer pageSize, Integer pageNo) {
// if (StringUtils.isNotBlank(kwd)) {
//// kwd = kwd.trim();
//// }
//// Page<StatisticStudentCase> page = new Page<>();
//// if (null != pageSize && null != pageNo) {
//// PageHelper.startPage(pageNo, pageSize);
//// }
//// StatisticStudentCase vo = new StatisticStudentCase();
//// vo.setSiteId(siteId);
//// EntityWrapper<StatisticStudentCase> wrapper = new EntityWrapper<StatisticStudentCase>(vo);
//// wrapper.like("title", kwd);
//// if (null!=startDate&&""!=startDate&&""!=endDate&&null!=endDate) {
//// endDate = endDate + " 23:59:59";
//// wrapper.between("time", startDate, endDate);
//// }
//// List<StatisticStudentCase> list = statisticStudentCase.selectList(wrapper);
//// if (pageSize != null && pageNo != null) {
//// page.setTotal(PageHelper.getTotal());
//// page.setSize(pageSize);
//// page.setCurrent(pageNo);
//// PageHelper.remove();
//// }
//// page.setRecords(list);
//需要加部门名称和所属部门机构,重写sql(ding改)
if (StringUtils.isNotBlank(kwd)) {
kwd = kwd.trim();
}
Page<StatisticStudentCaseVO> page = new Page<>(pageNo, pageSize);
List<StatisticStudentCaseVO> list = studentCaseMapper.studentCaseList(startDate, endDate, kwd, siteId, page);
if (CollectionUtils.isNotEmpty(list)) {
page.setRecords(list);
}
return page;
}
@Override
public Page<StatisticStudentCaseAccount> studentCaseByAccount(String kwd,
Long siteId, Integer pageSize, Integer pageNo) {
Page<StatisticStudentCaseAccount> page = new Page<>();
if (StringUtils.isNotBlank(kwd)) {
kwd = kwd.trim();
}
if (null != pageSize && null != pageNo) {
PageHelper.startPage(pageNo, pageSize);
}
StatisticStudentCaseAccount vo = new StatisticStudentCaseAccount();
vo.setSiteId(siteId);
EntityWrapper<StatisticStudentCaseAccount> wrapper = new EntityWrapper<StatisticStudentCaseAccount>(vo);
wrapper.like("account_name", kwd).or().like("full_name", kwd);
List<StatisticStudentCaseAccount> list = statisticStudentCaseAccount.selectList(wrapper);
if (pageSize != null && pageNo != null) {
page.setTotal(PageHelper.getTotal());
page.setSize(pageSize);
page.setCurrent(pageNo);
PageHelper.remove();
}
page.setRecords(list);
return page;
}
@Override
public Page<StatisticStudentCaseOrg> studentCaseByOrg(String kwd, Long siteId, Integer pageSize,
Integer pageNo) {
Page<StatisticStudentCaseOrg> page = new Page<>();
if (StringUtils.isNotBlank(kwd)) {
kwd = kwd.trim();
}
if (null != pageSize && null != pageNo) {
PageHelper.startPage(pageNo, pageSize);
}
StatisticStudentCaseOrg vo = new StatisticStudentCaseOrg();
vo.setSiteId(siteId);
EntityWrapper<StatisticStudentCaseOrg> wrapper = new EntityWrapper<StatisticStudentCaseOrg>(vo);
wrapper.like("org_name", kwd);
List<StatisticStudentCaseOrg> list = statisticStudentCaseOrg.selectList(wrapper);
if (pageSize != null && pageNo != null) {
page.setTotal(PageHelper.getTotal());
page.setSize(pageSize);
page.setCurrent(pageNo);
PageHelper.remove();
}
page.setRecords(list);
return page;
}
}
package com.yizhi.library.application.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.library.application.domain.StudentCaseScoreRecorde;
import com.yizhi.library.application.mapper.StudentCaseScoreRecordeMapper;
import com.yizhi.library.application.service.IStudentCaseScoreRecordeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 案例学习记录表 服务实现类
* </p>
*
* @author dingxiaowei123
* @since 2019-11-19
*/
@Service
public class StudentCaseScoreRecordeServiceImpl extends ServiceImpl<StudentCaseScoreRecordeMapper, StudentCaseScoreRecorde> implements IStudentCaseScoreRecordeService {
@Autowired
private StudentCaseScoreRecordeMapper scoreRecordeMapper;
@Override
public Integer getUnscoredCount(Long studentCaseId) {
return scoreRecordeMapper.getUnscoredCount(studentCaseId);
}
@Override
public Integer getAverageScore(Long caseLibraryId, Long accountId, Long studentCaseId) {
return scoreRecordeMapper.getAverageScore(caseLibraryId, accountId, studentCaseId);
}
@Override
public Integer getMaxScore(Long caseLibraryId, Long accountId, Long studentCaseId) {
return scoreRecordeMapper.getMaxScore(caseLibraryId, accountId, studentCaseId);
}
@Override
public Boolean updateScoreRcorde(Long studentCaseId, Long accountId, Integer score) {
return scoreRecordeMapper.updateScoreRcorde(studentCaseId, accountId, score);
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
package com.yizhi.library.application.util;
import com.yizhi.library.application.vo.RangeAccountsVO;
import com.yizhi.library.application.vo.StudentCaseManageListVO;
import com.yizhi.system.application.constant.AuthzConstant;
import com.yizhi.system.application.system.remote.AccountClient;
import com.yizhi.system.application.system.remote.ReportClient;
import com.yizhi.system.application.vo.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Ding
* @className AccountUtil
* @description TODO
* @date 2019/7/25
**/
@Component
public class AccountUtil {
@Autowired
private ReportClient reportClient;
@Autowired
private AccountClient accountClient;
/**
* 获取管辖区/管理员模糊查询人员信息
*
* @param isAdmin
* @param accountId
* @param siteId
* @param accountName
* @param orgName
* @return
*/
public RangeAccountsVO getRangeAccounts(Boolean isAdmin, Long accountId, Long siteId, String accountName, String orgName) {
Boolean isAllAccounts = false;
//返回实体类
RangeAccountsVO rangeAccountsVO = new RangeAccountsVO();
List<com.yizhi.system.application.vo.ReportAccountRespVO> accountList = null;
List<Long> accountIds = null;
Map<Long, com.yizhi.library.application.vo.ReportAccountRespVO> accountMap = new HashMap<>(16);
if (isAdmin) {
//管理员模糊查询
if (StringUtils.isNotBlank(accountName) || StringUtils.isNotBlank(orgName)) {
ReportRangeAccountReqVO reqVO = new ReportRangeAccountReqVO();
if (StringUtils.isNotBlank(accountName)) {
reqVO.setAccountName(accountName.trim());
}
if (StringUtils.isNotBlank(orgName)) {
reqVO.setAccountName(orgName.trim());
}
reqVO.setSiteId(siteId);
accountList = reportClient.getRangeAccounts(reqVO);
//如果人员不为空,装入map中,并返回
if (CollectionUtils.isNotEmpty(accountList)) {
accountIds = new ArrayList<>();
for (ReportAccountRespVO respVO : accountList) {
accountIds.add(respVO.getUserId());
com.yizhi.library.application.vo.ReportAccountRespVO vo = new com.yizhi.library.application.vo.ReportAccountRespVO();
BeanUtils.copyProperties(respVO,vo);
accountMap.put(respVO.getUserId(), vo);
}
rangeAccountsVO.setAccountIds(accountIds);
rangeAccountsVO.setAccountMap(accountMap);
rangeAccountsVO.setIsAllAccount(false);
return rangeAccountsVO;
} else {
rangeAccountsVO.setIsAllAccount(false);
return rangeAccountsVO;
}
} else {
rangeAccountsVO.setIsAllAccount(true);
return rangeAccountsVO;
}
} else {
//一般管理员
HQAccountInManageParam reqVO = new HQAccountInManageParam();
reqVO.setModuleType(AuthzConstant.moduleType.caseLibrary);
reqVO.setAccountId(accountId);
reqVO.setSiteId(siteId);
if (StringUtils.isNotBlank(accountName)) {
reqVO.setAccountName(accountName.trim());
}
if (StringUtils.isNotBlank(orgName)) {
reqVO.setAccountName(orgName.trim());
}
ReportAccountRespInManageVO resp = reportClient.getRangeAccountsInManage(reqVO);
//如果不是管理的根目录
if (!resp.getIsAdmin()) {
rangeAccountsVO.setIsAllAccount(false);
if (CollectionUtils.isNotEmpty(resp.getList())) {
accountList = resp.getList();
accountIds = new ArrayList<>();
for (ReportAccountRespVO respVO : accountList) {
accountIds.add(respVO.getUserId());
com.yizhi.library.application.vo.ReportAccountRespVO vo = new com.yizhi.library.application.vo.ReportAccountRespVO();
BeanUtils.copyProperties(respVO,vo);
accountMap.put(respVO.getUserId(), vo);
accountMap.put(respVO.getUserId(), vo);
}
rangeAccountsVO.setAccountMap(accountMap);
rangeAccountsVO.setAccountIds(accountIds);
}
return rangeAccountsVO;
} else {
//如果是根目录,按管理员处理
return getRangeAccounts(true, accountId, siteId, accountName, orgName);
}
}
}
/**
* 查询用户信息并放入用户map中
*
* @param map
* @param accountIds
* @return
*/
public Map<Long, com.yizhi.library.application.vo.ReportAccountRespVO> getAccountMap(Map<Long, com.yizhi.library.application.vo.ReportAccountRespVO> map, List<Long> accountIds) {
List<AccountVO> list = accountClient.idsGet(accountIds);
if (CollectionUtils.isNotEmpty(list)) {
for (AccountVO accountVO : list) {
com.yizhi.library.application.vo.ReportAccountRespVO respVO = new com.yizhi.library.application.vo.ReportAccountRespVO();
respVO.setUserId(accountVO.getId());
respVO.setUserName(accountVO.getName());
respVO.setUserFullName(accountVO.getFullName());
respVO.setOrgId(accountVO.getOrgId());
respVO.setOrgName(accountVO.getOrgName());
map.put(respVO.getUserId(), respVO);
}
}
return map;
}
/**
* 组装所有学员案例管理列表信息
*
* @return
*/
public List<StudentCaseManageListVO> assembleStudentCaseManageList(Map<Long, com.yizhi.library.application.vo.ReportAccountRespVO> accountMap, List<StudentCaseManageListVO> list) {
for (StudentCaseManageListVO studentCaseManageListVO : list) {
com.yizhi.library.application.vo.ReportAccountRespVO account = accountMap.get(studentCaseManageListVO.getAccountId());
//案例状态判断 以及操作状态判断
if (null != studentCaseManageListVO.getScoreState()) {
if (studentCaseManageListVO.getScoreState() == 0) {
studentCaseManageListVO.setState("待评分");
} else if (studentCaseManageListVO.getScoreState() == 1) {
studentCaseManageListVO.setState("已评分");
}
studentCaseManageListVO.setHandleType(1);
} else if (null != studentCaseManageListVO.getAuditState()) {
if (studentCaseManageListVO.getAuditState() == 0) {
studentCaseManageListVO.setState("待审核");
} else if (studentCaseManageListVO.getAuditState() == 2) {
studentCaseManageListVO.setState("不通过");
}
studentCaseManageListVO.setHandleType(2);
}
//作者信息组装
if (null != account) {
studentCaseManageListVO.setAccountName(account.getUserName());
studentCaseManageListVO.setAccountFullName(account.getUserFullName() == null ? "" : account.getUserFullName());
studentCaseManageListVO.setOrgId(account.getOrgId());
studentCaseManageListVO.setOrgName(account.getOrgName() == null ? "" : account.getOrgName());
}
//审核人信息组装
if (CollectionUtils.isNotEmpty(studentCaseManageListVO.getAuditorIds())) {
String auditorString = "";
for (int i = 0; i < studentCaseManageListVO.getAuditorIds().size(); i++) {
Long auditorId = studentCaseManageListVO.getAuditorIds().get(i);
com.yizhi.library.application.vo.ReportAccountRespVO auditor = accountMap.get(auditorId);
if (null != auditor) {
if (StringUtils.isNotBlank(auditor.getUserFullName())) {
if (StringUtils.isBlank(auditorString)) {
auditorString += auditor.getUserFullName();
} else {
auditorString += "," + auditor.getUserFullName();
}
}
}
}
studentCaseManageListVO.setAuditorFullNames(auditorString);
}
//评论人信息组装
if (CollectionUtils.isNotEmpty(studentCaseManageListVO.getScorerIds())) {
String scorerNames = "";
for (int i = 0; i < studentCaseManageListVO.getScorerIds().size(); i++) {
Long scorerId = studentCaseManageListVO.getScorerIds().get(i);
com.yizhi.library.application.vo.ReportAccountRespVO scorer = accountMap.get(scorerId);
if (null != scorer) {
if (StringUtils.isNotBlank(scorer.getUserFullName())) {
if (StringUtils.isBlank(scorerNames)) {
scorerNames += scorer.getUserFullName();
} else {
scorerNames += "," + scorer.getUserFullName();
}
}
}
}
studentCaseManageListVO.setScorerFullNames(scorerNames);
}
}
return list;
}
}
package com.yizhi.library.application.util;
import com.alibaba.fastjson.JSON;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
/**
* @author Ding
* @className DownloadOssUrl
* @description TODO
* @date 2019/7/8
**/
public class DownloadOssUrl {
private static final Logger LOGGER = LoggerFactory.getLogger(DownloadOssUrl.class);
public static Workbook getWorkBook(String ossUrl) {
try {
URL url = null;
HttpURLConnection connection = null;
InputStream inputStream = null;
Workbook workbook = null;
//解析url
String fileName = ossUrl.substring(ossUrl.lastIndexOf("/") + 1);
String ossUrlPrefix = ossUrl.substring(0, ossUrl.lastIndexOf("/") + 1);
ossUrl = ossUrlPrefix + URLEncoder.encode(fileName, "utf-8");
url = new URL(ossUrl);
connection = (HttpURLConnection) url.openConnection();
//防止屏蔽程序抓取而返回403错误
connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
inputStream = connection.getInputStream();
workbook = WorkbookFactory.create(inputStream);
return workbook;
} catch (MalformedURLException e) {
LOGGER.error("创建ossurl 连接错误", e);
return null;
} catch (IOException e) {
LOGGER.error("创建ossurl 连接错误", e);
return null;
} catch (InvalidFormatException e) {
LOGGER.error("创建Workbook 对象错误", e);
return null;
}
}
public static String downLoadFromUrl(String urlStr, String fileName, String outputFilePath) {
File file = null;
// FileInfo fileInfo = new FileInfo();
try {
URL url = new URL(urlStr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
//防止屏蔽程序抓取而返回403错误
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
conn.setRequestProperty("Charsert", "UTF-8");
conn.setRequestProperty("Accept-Charset", "UTF-8");
//得到输入流
InputStream inputStream = conn.getInputStream();
//获取自己数组
byte[] buffer = new byte[1024];
int len = 0;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
while ((len = inputStream.read(buffer)) != -1) {
bos.write(buffer, 0, len);
}
bos.close();
byte[] getData = bos.toByteArray();
//文件保存位置
File saveDir = new File(outputFilePath);
if (!saveDir.exists()) {
saveDir.mkdirs();
}
file = new File(saveDir + File.separator + fileName);
FileOutputStream fos = new FileOutputStream(file);
fos.write(getData);
if (fos != null) {
fos.close();
}
if (inputStream != null) {
inputStream.close();
}
} catch (Exception e) {
LOGGER.info("fileName={},outputFilePath={}", fileName, outputFilePath);
LOGGER.info("urlStr={},异常={}", urlStr, JSON.toJSONString(e));
}
return file.getAbsolutePath();
}
}
package com.yizhi.library.application.util;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.yizhi.application.orm.id.IdGenerator;
import com.yizhi.comment.application.feign.PdfPagesClient;
import com.yizhi.comment.application.vo.PdfVO;
import com.yizhi.comment.application.vo.domain.PdfPagesVo;
import com.yizhi.core.application.event.EventWrapper;
import com.yizhi.core.application.publish.CloudEventPublisher;
import com.yizhi.core.application.task.AbstractTaskHandler;
import com.yizhi.core.application.task.TaskExecutor;
import com.yizhi.library.application.domain.CaseLibraryRelatedClassify;
import com.yizhi.library.application.domain.StudentCaseAccessary;
import com.yizhi.library.application.enums.DocumentType;
import com.yizhi.library.application.vo.AccessoryUrlVO;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.library.application.service.IStudentCaseAccessaryService;
import com.yizhi.library.application.service.IStudentCaseService;
import com.yizhi.training.application.feign.TpProjectClient;
import com.yizhi.training.application.vo.domain.TrainingProjectVo;
import com.yizhi.util.application.constant.TpActivityType;
import com.yizhi.util.application.event.AssignmentMediaTranscodingEvent;
import com.yizhi.util.application.sensitive.SensitivewordFilter;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.util.*;
/**
* @author Ding
* @className Util
* @description TODO
* @date 2019/7/12
**/
@Component
public class Util {
@Autowired
private IStudentCaseService studentCaseService;
@Autowired
private TpProjectClient tpProjectClient;
@Autowired
private IdGenerator idGenerator;
@Autowired
private IStudentCaseAccessaryService studentCaseAccessaryService;
@Autowired
private TaskExecutor taskExecutor;
@Autowired
private WorkUtil workUtil;
@Autowired
private CloudEventPublisher cloudEventPublisher;
@Autowired
private PdfPagesClient pdfPagesClient;
/**
* 内部封装截取url组装成附件类list
*
* @param studentCaseId
* @return
*/
public List<AccessoryUrlVO> getAccessoryUrlList(Long studentCaseId) {
// String[] strings = url.split(";");
List<AccessoryUrlVO> accessoryUrlVOList = new ArrayList<>();
Long time = System.currentTimeMillis();
StudentCaseAccessary studentCaseAccessary = new StudentCaseAccessary();
studentCaseAccessary.setStudentCaseId(studentCaseId);
studentCaseAccessary.setState(1);
List<StudentCaseAccessary> accessaryList = studentCaseAccessaryService.selectList(new EntityWrapper<>(studentCaseAccessary));
if (CollectionUtils.isNotEmpty(accessaryList)) {
for (StudentCaseAccessary studentCaseAccessary1 : accessaryList) {
List<PdfPagesVo> list = pdfPagesClient.list(studentCaseAccessary1.getId(), TpActivityType.TYPE_SELECTED_CASE);
Integer i = accessaryList.indexOf(studentCaseAccessary1);
AccessoryUrlVO accessoryUrlVO = new AccessoryUrlVO();
//如果有转码url用转码url
if (null != studentCaseAccessary1.getVideoSd()) {
accessoryUrlVO.setUrl(studentCaseAccessary1.getVideoSd());
} else {
//没有转码url就用原文件url
accessoryUrlVO.setUrl(studentCaseAccessary1.getUrl());
}
accessoryUrlVO.setFileSize(studentCaseAccessary1.getFileSize());
accessoryUrlVO.setName(studentCaseAccessary1.getName());
accessoryUrlVO.setUid(time + "a" + i);
List<com.yizhi.library.application.vo.PdfPages> vos = new ArrayList<>();
for (PdfPagesVo pdfPages : list) {
com.yizhi.library.application.vo.PdfPages vo = new com.yizhi.library.application.vo.PdfPages();
BeanUtils.copyProperties(pdfPages,vo);
vos.add(vo);
}
accessoryUrlVO.setPdfPages(vos);
accessoryUrlVOList.add(accessoryUrlVO);
}
}
return accessoryUrlVOList;
}
/**
* 将多个附件url组成一个字符串
*
* @param accessoryUrlVOList
* @return
*/
public String getAccessoryUrl(Long studentCaseId, List<AccessoryUrlVO> accessoryUrlVOList) {
RequestContext res = ContextHolder.get();
Date date = new Date();
String accessoryUrl = "";
List<StudentCaseAccessary> accessaryList = new ArrayList<>();
List<PdfVO> pdfVOs = new ArrayList<PdfVO>();
for (int i = 0; i < accessoryUrlVOList.size(); i++) {
PdfVO pdfVO = new PdfVO();
//组装附件类,并入库
StudentCaseAccessary studentCaseAccessary = new StudentCaseAccessary();
studentCaseAccessary.setId(idGenerator.generate());
studentCaseAccessary.setStudentCaseId(studentCaseId);
studentCaseAccessary.setName(accessoryUrlVOList.get(i).getName());
studentCaseAccessary.setFileSize(accessoryUrlVOList.get(i).getFileSize());
studentCaseAccessary.setUrl(accessoryUrlVOList.get(i).getUrl());
studentCaseAccessary.setCreateById(res.getAccountId());
studentCaseAccessary.setCreateByName(res.getAccountName());
studentCaseAccessary.setCreateTime(date);
studentCaseAccessary.setUpdateById(res.getAccountId());
studentCaseAccessary.setUpdateByName(res.getAccountName());
studentCaseAccessary.setUpdateTime(date);
studentCaseAccessary.setCompanyId(res.getCompanyId());
studentCaseAccessary.setSiteId(res.getSiteId());
studentCaseAccessary.setOrgId(res.getOrgId());
pdfVO.setBizId(studentCaseAccessary.getId());
pdfVO.setBizType(TpActivityType.TYPE_SELECTED_CASE);
pdfVO.setCompanyId(studentCaseAccessary.getCompanyId());
pdfVO.setSiteId(studentCaseAccessary.getSiteId());
pdfVO.setCreateById(studentCaseAccessary.getCreateById());
pdfVO.setOriginalFile(studentCaseAccessary.getName());
pdfVO.setOriginalFileUrl(studentCaseAccessary.getUrl());
pdfVOs.add(pdfVO);
accessaryList.add(studentCaseAccessary);
if (StringUtils.isEmpty(accessoryUrl)) {
accessoryUrl += accessoryUrlVOList.get(i).getName() + ",";
accessoryUrl += accessoryUrlVOList.get(i).getFileSize() + ",";
accessoryUrl += accessoryUrlVOList.get(i).getUrl();
} else {
accessoryUrl += ";" + accessoryUrlVOList.get(i).getName() + ",";
accessoryUrl += accessoryUrlVOList.get(i).getFileSize() + ",";
accessoryUrl += accessoryUrlVOList.get(i).getUrl();
}
}
studentCaseAccessaryService.insertBatch(accessaryList);
try {
if (CollectionUtils.isNotEmpty(pdfVOs)) {
cloudEventPublisher.publish("pdfToPng",
new EventWrapper(0L, pdfVOs));
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
taskExecutor.asynExecute(new AbstractTaskHandler() {
@Override
public void handle() {
try {
if (CollectionUtils.isNotEmpty(accessaryList)) {
for (StudentCaseAccessary studentCaseAccessary : accessaryList) {
String suffixName = studentCaseAccessary.getName().substring(studentCaseAccessary.getName().lastIndexOf(".") + 1);
if (workUtil.documentType(suffixName).equals(DocumentType.VIDEO.getType()) || workUtil.documentType(suffixName).equals(DocumentType.AUDIO.getType())) {
AssignmentMediaTranscodingEvent event = new AssignmentMediaTranscodingEvent();
List<AssignmentMediaTranscodingEvent.FileDTO> fileDTOS = new ArrayList<>();
fileDTOS.add(event.new FileDTO(studentCaseAccessary.getId(), studentCaseAccessary.getUrl()));
event.setType(TpActivityType.TYPE_SELECTED_CASE);
event.setFiles(fileDTOS);
cloudEventPublisher.publish("assignmentMediaTranscoding",
new EventWrapper(0L, event));
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
return accessoryUrl;
}
/**
* 过滤敏感词
*
* @param content 评论内容
* @param sensitiveWordList 已设置的敏感词集合
* @return
*/
public String filterWord(String content, Set<String> sensitiveWordList) {
if (sensitiveWordList != null) {
if (!StringUtils.isBlank(content)) {
return SensitivewordFilter.sensitiveFilter(content, sensitiveWordList);
}
}
return content;
}
//删除法目录方法
public static boolean deleteDir(File dir) {
if (dir.isDirectory()) {
String[] children = dir.list();
//递归删除目录中的子目录下
for (int i = 0; i < children.length; i++) {
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
return false;
}
}
}
// 目录此时为空,可以删除
return dir.delete();
}
//多个审核人,评分人转成字符串
public static String listToString(List<String> stringList) {
String resultString = "";
for (int i = 0; i < stringList.size(); i++) {
String s = stringList.get(i);
if (i == 0) {
resultString += s;
} else {
resultString += "," + s;
}
}
return resultString;
}
//所属部门及上级部门转成字符串
public static String orgNamesToString(List<String> orgNames) {
String resultString = "";
for (int i = 0; i < orgNames.size(); i++) {
String s = orgNames.get(i);
if (i == 0) {
resultString += s;
} else {
resultString += "/" + s;
}
}
return resultString;
}
public static Long getLongFromCell(Cell cell) {
Long id = null;
if (cell.getCellTypeEnum().equals(CellType.STRING)) {
id = Long.valueOf(cell.getStringCellValue());
} else if (cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
cell.setCellType(CellType.STRING);
id = Long.valueOf(cell.getStringCellValue());
}
return id;
}
public static Integer getIntegerFromCell(Cell cell) {
Integer result = null;
if (cell.getCellTypeEnum().equals(CellType.STRING)) {
result = Integer.valueOf(cell.getStringCellValue());
} else if (cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
cell.setCellType(CellType.STRING);
result = Integer.valueOf(cell.getStringCellValue());
}
return result;
}
public static String getStringFromCell(Cell cell) {
String result = null;
if (cell.getCellTypeEnum().equals(CellType.STRING)) {
result = cell.getStringCellValue();
} else if (cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
cell.setCellType(CellType.STRING);
result = cell.getStringCellValue();
}
return result;
}
public Map<String, Object> getCaseLibraryAndProjectName(Long caseLibraryId, Long studentCaseId) {
//获取案例活动及项目活动名称
Map<String, Object> map1 = studentCaseService.getLibraryProjectName(caseLibraryId, studentCaseId);
String caseLibraryName = (String) map1.get("caseLibraryName");
List<CaseLibraryRelatedClassify> caseLibraryRelatedClassifyList = (List<CaseLibraryRelatedClassify>) map1.get("relatedClassify");
Long trainingProjectId = (Long) map1.get("trainingProjectId");
String trainingProjectName = null;
if (null != trainingProjectId) {
List<Long> idList = new ArrayList<>();
idList.add(trainingProjectId);
Map<Long, TrainingProjectVo> trainingProjectMap = tpProjectClient.getCaseLibraryProject(idList);
trainingProjectName = trainingProjectMap.get(trainingProjectId).getName();
}
map1 = new HashMap<>(2);
map1.put("caseLibraryName", caseLibraryName == null ? "" : caseLibraryName);
map1.put("trainingProjectName", trainingProjectName == null ? "" : trainingProjectName);
map1.put("relatedClassify", caseLibraryRelatedClassifyList);
return map1;
}
}
package com.yizhi.library.application.util;
import com.yizhi.library.application.enums.DocumentType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@Component
public class WorkUtil {
private Logger LOGGER = LoggerFactory.getLogger(WorkUtil.class);
public Integer documentType(String suffixName) {
if (suffixName.equalsIgnoreCase("pdf") || suffixName.equalsIgnoreCase("doc") || suffixName.equalsIgnoreCase("xlsx")
|| suffixName.equalsIgnoreCase("xls") || suffixName.equalsIgnoreCase("ppt")
|| suffixName.equalsIgnoreCase("pptx") || suffixName.equalsIgnoreCase("docx")) {
return DocumentType.DOCUMENT.getType();
}
if (suffixName.equalsIgnoreCase("bmp") || suffixName.equalsIgnoreCase("jpg") || suffixName.equalsIgnoreCase("png") || suffixName.equalsIgnoreCase("tif")
|| suffixName.equalsIgnoreCase("gif") || suffixName.equalsIgnoreCase("pcx") || suffixName.equalsIgnoreCase("tga")
|| suffixName.equalsIgnoreCase("exif") || suffixName.equalsIgnoreCase("fpx") || suffixName.equalsIgnoreCase("svg")
|| suffixName.equalsIgnoreCase("psd") || suffixName.equalsIgnoreCase("cdr") || suffixName.equalsIgnoreCase("pcd")
|| suffixName.equalsIgnoreCase("dxf") || suffixName.equalsIgnoreCase("ufo") || suffixName.equalsIgnoreCase("eps")
|| suffixName.equalsIgnoreCase("ai") || suffixName.equalsIgnoreCase("raw") || suffixName.equalsIgnoreCase("WMF")
|| suffixName.equalsIgnoreCase("webp")|| suffixName.equalsIgnoreCase("jpeg")) {
return DocumentType.PICTURE.getType();
}
if (suffixName.equalsIgnoreCase("mp3") || suffixName.equalsIgnoreCase("wma") || suffixName.equalsIgnoreCase("wav")
|| suffixName.equalsIgnoreCase("mp3pro") || suffixName.equalsIgnoreCase("cd") || suffixName.equalsIgnoreCase("wave")
|| suffixName.equalsIgnoreCase("aiff") || suffixName.equalsIgnoreCase("mpeg") || suffixName.equalsIgnoreCase("mpeg-4")
|| suffixName.equalsIgnoreCase("midi") || suffixName.equalsIgnoreCase("RealAudio") || suffixName.equalsIgnoreCase("VQF")
|| suffixName.equalsIgnoreCase("OggVorbis") || suffixName.equalsIgnoreCase("AMR") || suffixName.equalsIgnoreCase("APE")
|| suffixName.equalsIgnoreCase("FLAC") || suffixName.equalsIgnoreCase("AAC") || suffixName.equalsIgnoreCase("ogg")
|| suffixName.equalsIgnoreCase("flac") || suffixName.equalsIgnoreCase("aac")) {
return DocumentType.AUDIO.getType();
}
if (suffixName.equalsIgnoreCase("mp4") || suffixName.equalsIgnoreCase("avi") || suffixName.equalsIgnoreCase("mov") || suffixName.equalsIgnoreCase("flv")
|| suffixName.equalsIgnoreCase("mvb") || suffixName.equalsIgnoreCase("MPEG") || suffixName.equalsIgnoreCase("ASF")
|| suffixName.equalsIgnoreCase("3GP") || suffixName.equalsIgnoreCase("MKV") || suffixName.equalsIgnoreCase("F4V")
|| suffixName.equalsIgnoreCase("RMVB") || suffixName.equalsIgnoreCase("RM") || suffixName.equalsIgnoreCase("MOV")
|| suffixName.equalsIgnoreCase("QT") || suffixName.equalsIgnoreCase("NAVI") || suffixName.equalsIgnoreCase("DivX")
|| suffixName.equalsIgnoreCase("MPG") || suffixName.equalsIgnoreCase("DAT") || suffixName.equalsIgnoreCase("rm")
|| suffixName.equalsIgnoreCase("vob") || suffixName.equalsIgnoreCase("rmvb") || suffixName.equalsIgnoreCase("mkv")
|| suffixName.equalsIgnoreCase("f4v") || suffixName.equalsIgnoreCase("3gp") || suffixName.equalsIgnoreCase("wmv")
|| suffixName.equalsIgnoreCase("vob")) {
return DocumentType.VIDEO.getType();
}
return DocumentType.OTHER.getType();
}
}
#case_library 表新增 作品封面必填选项字段
ALTER TABLE case_library add product_cover1 INT(11) DEFAULT '80' COMMENT "作品封面必填80,默认;非必填40";
\ No newline at end of file
server.port=34666
spring.application.name=caselibrary
ACTIVE=${spring.profiles.active}
spring.profiles.active=dev
# nacos
spring.cloud.nacos.config.shared-dataids=common-${spring.profiles.active}.properties
spring.cloud.nacos.config.namespace=${spring.profiles.active}
spring.cloud.nacos.config.prefix=${spring.application.name}
spring.cloud.nacos.config.file-extension=properties
spring.cloud.nacos.config.server-addr=192.168.1.22:3333,192.168.1.22:4444,192.168.1.22:5555
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.AdmireRecordeMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.AuditorMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.CaseLibraryAuthorizeMapper">
<select id="getAuthorizeIds" resultType="java.lang.Long">
SELECT
case_library_id
FROM
case_library_authorize
WHERE
(
(relation_id = #{accountId} and type = 2)
<if test="relationIds != null and relationIds.size()>0">
or
(relation_id IN
<foreach item="item" index="index" collection="relationIds" open="(" separator="," close=")">#{item}
</foreach>
and type = 1)
</if>
)
AND state = 1
</select>
<select id="getAuthorize" resultType="com.yizhi.library.application.vo.CaselibraryAuthorizeVO">
SELECT
case_library_id,
relation_id,
type,
`name`
FROM
case_library_authorize
WHERE
case_library_id = #{caselibraryId}
AND state = 1
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.CaseLibraryMapper">
<update id="releaseCaseLibrary">
UPDATE case_library
SET state = 2,
can_modify_score_rule = 0
WHERE
id = #{caseLibraryId}
</update>
<update id="putDownCaseLibrary">
UPDATE case_library
SET state = 3
WHERE
id = #{caseLibraryId}
</update>
<update id="deleteCaseLibrary">
UPDATE case_library
SET state = 0
WHERE
id = #{caseLibraryId}
</update>
<update id="relateProject">
UPDATE case_library
SET training_project_id = #{projectId}
WHERE
id IN
<foreach item="item" index="index" collection="caseLibraryIds" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<update id="relieveRelateProject">
UPDATE case_library
SET training_project_id = null
WHERE
1 = 1
and training_project_id = #{projectId}
<if test="caseLibraryIds!=null and caseLibraryIds.size()>0">
and id not IN
<foreach item="item" index="index" collection="caseLibraryIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</update>
<update id="cancelRelateProject">
UPDATE case_library
SET training_project_id = null
WHERE id = #{caseLibraryId}
</update>
<select id="getClassify" resultType="com.yizhi.library.application.vo.ClassifyVO">
SELECT
a.id as classifyId,
a.NAME as classifyName,
<if test="caseLibraryId==null">
0
</if>
<if test="caseLibraryId!=null">
CASE
WHEN b.id IS NULL THEN
0 ELSE 1
END
</if>
AS chooseState
FROM
classify a
<if test="caseLibraryId!=null">
LEFT JOIN case_library_related_classify b ON b.case_lirary_id = #{caseLibraryId}
AND a.id = b.classify_id
</if>
WHERE
1 = 1
<if test="classifyIds!=null and classifyIds.size()>0">
and a.id IN
<foreach item="item" index="index" collection="classifyIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
and a.company_id = #{companyId}
AND a.site_id = #{siteId}
AND a.LEVEL = 0
AND a.state = 1
</select>
<select id="viewCaseLibrary" resultType="com.yizhi.library.application.domain.CaseLibrary">
SELECT
id,
`name`,
logo_url,
explanation,
text_edit_type,
start_time,
end_time,
score_rule,
auditor_authorize,
visible_range,
submitter_url,
submitter_access_name,
auditor_url,
auditor_access_name,
scorer_url,
scorer_access_name,
point,
examine,
can_modify_score_rule,
produce_conver
FROM
case_library
WHERE
id = #{caseLibraryId}
</select>
<select id="relatedClassify" resultType="java.lang.Long">
SELECT
a.classify_id
FROM
case_library_related_classify a
LEFT JOIN classify b on a.classify_id = b.id
WHERE
a.case_lirary_id = #{caseLibraryId}
and a.state = 1 and b.state = 1
</select>
<select id="getCaseLibraryList" resultType="com.yizhi.library.application.vo.CaseLibraryVO">
SELECT
id,
NAME,
training_project_id,
create_time,
visible_range,
state
FROM
case_library
WHERE
state != 0
<if test="name!=null and name!=''">
AND NAME LIKE CONCAT( '%', #{name}, '%')
</if>
<if test="state!=null">
AND state = #{state}
</if>
and company_id = #{companyId}
and site_id = #{siteId}
ORDER BY
create_time DESC,
id
</select>
<select id="getProjectList" resultType="com.yizhi.library.application.vo.CaseLibraryVO">
SELECT
*
FROM
case_library
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND state = 2
<if test="name!=null and name!=''">
AND `name` like CONCAT('%',#{name},'%')
</if>
AND training_project_id IS NULL
ORDER BY create_time DESC,id
</select>
<select id="getHomeList" resultType="com.yizhi.library.application.vo.CaseLibraryVO">
SELECT
id,NAME
FROM
case_library
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND state = 2
AND visible_range = 1
</select>
<select id="getHasChildrenIds" resultType="java.lang.Long">
SELECT DISTINCT(parent_id)
FROM
classify
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND state = 1
AND LEVEL = 1
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.CaseLibraryRelatedClassifyMapper">
<delete id="deleteNotClassifyList">
delete from case_library_related_classify where case_lirary_id = #{caseLibraryId}
<if test="notDeleteIdList!=null and notDeleteIdList.size()>0">
<if test="classifyIds!=null and classifyIds.size()>0">
AND
classify_id not in
<foreach item="item" index="index" collection="notDeleteIdList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</if>
</delete>
<select id="getRelatedList" resultType="com.yizhi.library.application.domain.CaseLibraryRelatedClassify">
SELECT
a.case_lirary_id
FROM
case_library_related_classify a
LEFT JOIN case_library b ON a.state = 1
AND a.case_lirary_id = b.id
AND b.state != 0
AND a.classify_id = #{classifyId}
WHERE a.state = 1
AND b.state != 0
AND a.classify_id = #{classifyId}
GROUP BY a.case_lirary_id
</select>
<select id="getRelatedClassify" resultType="com.yizhi.library.application.domain.CaseLibraryRelatedClassify">
SELECT
a.classify_id,b.`name` as classifyName
FROM
case_library_related_classify a
LEFT JOIN classify b ON a.classify_id = b.id
WHERE
a.case_lirary_id = #{caseLibraryId}
AND a.state = 1
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.CaseStudyRecodeMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yizhi.library.application.mapper.ClassifyMapper">
<select id="getSort" resultType="java.lang.Integer">
SELECT
MAX(sort)
FROM
classify
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND state = 1
AND parent_id = #{parentId}
</select>
<select id="getPreClassify" resultType="com.yizhi.library.application.domain.Classify">
SELECT
*
FROM
classify
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND parent_id = #{parentId}
AND state = 1
AND <![CDATA[ sort < #{sort} ]]>
ORDER BY sort desc
</select>
<select id="getSuffixClassify" resultType="com.yizhi.library.application.domain.Classify">
SELECT
*
FROM
classify
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND parent_id = #{parentId}
AND state = 1
AND sort > #{sort}
ORDER BY sort
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.CommentAdmireMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.CommentMapper">
<update id="putDown">
UPDATE `comment` SET state = 2
WHERE
id = #{id}
</update>
<update id="release">
UPDATE `comment` SET state = 1
WHERE
id = #{id}
</update>
<select id="getCommentList" resultType="com.yizhi.library.application.vo.CommentVO">
SELECT
a.id,a.account_id,a.content,a.create_time,
COUNT(DISTINCT(b.id)) as admireNum,COUNT(DISTINCT(c.id)) as replyNum,
CASE
WHEN COUNT(DISTINCT d.id)>0 THEN
1
ELSE
0
END as isAdmire
FROM
comment a
LEFT JOIN comment_admire b on a.id = b.comment_id and b.state = 1
LEFT JOIN comment_reply c on a.id = c.comment_id and c.state = 1
LEFT JOIN comment_admire d on a.id = d.comment_id and d.state = 1 and d.account_id = #{accountId}
WHERE
a.student_case_id = #{studentCaseId}
AND a.state = 1
GROUP BY a.id
ORDER BY a.create_time
</select>
<select id="getCommentManageList" resultType="com.yizhi.library.application.vo.CommentVO">
SELECT
a.id,a.account_id,a.content,a.create_time,a.state,
COUNT(DISTINCT(b.id)) as admireNum,COUNT(DISTINCT(c.id)) as replyNum
FROM
comment a
LEFT JOIN comment_admire b on a.id = b.comment_id and b.state = 1
LEFT JOIN comment_reply c on a.id = c.comment_id and c.state = 1
WHERE
a.company_id = #{companyId}
AND site_id = #{siteId}
AND student_case_id = #{studentCaseId}
<if test="accountIds!=null and accountIds.size()>0">
AND a.account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="state!=null">
and a.state = #{state}
</if>
AND a.state != 0
GROUP BY a.id
ORDER BY a.create_time DESC
</select>
<select id="getCommentReplyList" resultType="com.yizhi.library.application.vo.CommentReplyVO">
SELECT
id,
comment_id,
commenter_id,
reply_account_id,
content,
create_time,
state
FROM
comment_reply
WHERE
comment_id = #{commentId}
<if test="state!=null">
and state = #{state}
</if>
<if test="accountIds!=null and accountIds.size()>0">
AND commenter_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND state != 0
ORDER BY
create_time DESC
</select>
<select id="getCommentReplyDownLoadList" resultType="com.yizhi.library.application.vo.CommentVO">
SELECT
id,
commenter_id as accountId,
reply_account_id as replyAccountId,
content,
create_time,
state
FROM
comment_reply
WHERE
comment_id = #{commentId}
<if test="state!=null">
and state = #{state}
</if>
<if test="accountIds!=null and accountIds.size()>0">
AND commenter_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND state != 0
ORDER BY
create_time DESC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.CommentReplyMapper">
<update id="putDown">
UPDATE comment_reply SET state = 2
WHERE
id = #{id}
</update>
<update id="release">
UPDATE comment_reply SET state = 1
WHERE
id = #{id}
</update>
<select id="getReplyList" resultType="com.yizhi.library.application.vo.CommentReplyVO">
SELECT
comment_id,
commenter_id,
reply_account_id,
content,
create_time
FROM
comment_reply
WHERE
comment_id = #{commentId}
AND state = 1
ORDER BY
create_time
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.FavoriteMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.InformRecordeMapper">
<select id="getInformList" resultType="com.yizhi.library.application.vo.InformVO">
SELECT
account_id AS informerId,
description AS informDescription,
picture_url AS pictureUrl,
inform_time
FROM
inform_recorde
WHERE
student_case_id = #{studentCaseId}
AND state = 1
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.MustSubmitMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.ScorerMapper">
<select id="getScorerList" resultType="java.lang.Long">
SELECT
scorer_id
FROM
scorer
WHERE
case_library_id = #{caseLibraryId}
AND account_id = #{accountId}
AND state = 1
GROUP BY scorer_id
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace="com.yizhi.library.application.mapper.StatisticStudentCaseAccountMapper">
<select id="getAccountExportVO"
resultType="com.yizhi.library.application.domain.StatisticStudentCaseAccount">
SELECT
mustSubmitNum.mustSubmitNum,
submitNum.submitNum,
caseNum.caseNum,
ups.ups,
upNum.upNum,
informs.informs,
informNum.informNum,
studyNum.studyNum,
auditNum.auditNum,
noAuditNum.noAuditNum,
noScoreNum.noScoreNum,
scoreNum.scoreNum
FROM
(
SELECT
COUNT(*) mustSubmitNum
FROM
must_submit m
WHERE
m.account_id =
#{accountId} and m.site_id=#{siteId} ) mustSubmitNum,(
SELECT
COUNT(*)
submitNum
FROM
student_case s
WHERE
s.account_id = #{accountId} and
s.site_id=#{siteId}
AND s.state IN ( 1, 2, 3 )) submitNum,(
SELECT
COUNT(*) caseNum
FROM
student_case s
WHERE
s.state = 2
AND s.account_id =
#{accountId} and s.site_id=#{siteId}
) caseNum,(
SELECT
COUNT(*) ups
FROM
admire_recorde ar
WHERE
ar.account_id = #{accountId} and
ar.site_id=#{siteId}
) ups,(
SELECT
COUNT(*) upNum
FROM
admire_recorde ar
WHERE
ar.student_case_id IN ( SELECT id FROM student_case WHERE
account_id =
#{accountId} and site_id=#{siteId})) upNum,(
SELECT
COUNT(*) informs FROM inform_recorde ir WHERE ir.account_id =
#{accountId} and ir.site_id=#{siteId}
) informs,(
SELECT
COUNT(*)
informNum
FROM
inform_recorde ir
WHERE
ir.student_case_id IN ( SELECT id
FROM student_case WHERE account_id = #{accountId} and
site_id=#{siteId} )) informNum,(
SELECT COUNT(*) studyNum FROM
case_study_recode cs WHERE cs.account_id =
#{accountId} and
cs.site_id=#{siteId}
) studyNum,(
SELECT
count(*) auditNum
FROM
student_case s
WHERE
s.account_id = #{accountId} and s.site_id=#{siteId}
AND s.state = 1
AND s.audit_state = 0
) auditNum,(
SELECT
COUNT(*)
noAuditNum
FROM
student_case s
WHERE
s.account_id = #{accountId} and
s.site_id=#{siteId}
AND s.audit_state = 2
) noAuditNum,(
SELECT
COUNT(*) noScoreNum
FROM
student_case s
WHERE
s.account_id =
#{accountId} and s.site_id=#{siteId}
AND s.state IN ( 2, 3 )
AND
s.score_state = 0
) noScoreNum,(
SELECT
count(*) scoreNum
FROM
student_case s
WHERE
s.account_id = #{accountId} and s.site_id=#{siteId}
AND s.state IN ( 2, 3 )
AND s.score_state = 1
) scoreNum
</select>
<select id="getSiteIds" resultType="java.lang.Long">
SELECT
c.site_id
FROM
case_library c
WHERE
c.state IN ( 2, 3 )
GROUP BY
c.site_id
</select>
<select id="getStudentCases" resultType="com.yizhi.library.application.domain.StudentCase">
select id ,state from
student_case
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace="com.yizhi.library.application.mapper.StatisticStudentCaseMapper">
<select id="getStatisticStudentCase"
resultType="com.yizhi.library.application.domain.StatisticStudentCase">
SELECT
c.id studentCaseId,
c.accountId,
c.title,
c.state,
c.submit_time time,
c.upNum,
c.informNum,
COUNT( cs.id ) studyNum,
c.siteId siteId,
c.companyId companyId,
c.orgId orgId
FROM
(
SELECT
b.id,
b.accountId,
b.title,
b.state,
b.submit_time,
b.upNum,
COUNT( ir.id )
informNum,
b.siteId siteId,
b.companyId companyId,
b.orgId orgId
FROM
(
SELECT
a.id,
a.accountId,
a.title,
a.submit_time,
a.state,
COUNT( ar.id ) upNum,
a.siteId siteId,
a.companyId companyId,
a.orgId orgId
FROM
(
SELECT
s.id id,
s.title title,
s.account_id accountId,
s.site_id siteId,
s.company_id companyId,
s.org_id orgId,
CASE
s.state
WHEN 1 THEN
'待审核'
WHEN 2 THEN
(
CASE
s.audit_state
WHEN 0 THEN
'待审核'
WHEN 1 THEN
( CASE s.score_state WHEN 0 THEN '待评分' ELSE '已评分' END )
WHEN 2 THEN
'不通过'
END
)
WHEN 3 THEN
(
CASE
s.audit_state
WHEN 0 THEN
'待审核'
WHEN 1 THEN
( CASE s.score_state WHEN 1 THEN '已评分' ELSE '待评分' END )
WHEN 2 THEN
'不通过'
END
)
END AS state,
s.submit_time submit_time
FROM
student_case s
WHERE
s.state IN ( 1, 2, 3 )
AND s.id = #{studentCaseId}
) a
LEFT JOIN admire_recorde ar ON a.id = ar.student_case_id
) b
LEFT JOIN inform_recorde ir ON b.id = ir.student_case_id
) c
LEFT JOIN case_study_recode cs ON cs.student_case_id = c.id
</select>
<select id="studentCaseList" resultType="com.yizhi.library.application.vo.StatisticStudentCaseVO">
SELECT
a.*,b.org_name as orgName,b.org_names as orgNames
FROM
statistic_student_case_detail a
LEFT JOIN statistic_student_case_account b ON a.account_id = b.account_id
WHERE a.site_id = #{siteId}
<if test="kwd!=null and kwd!=''">
AND a.title like concat("%",#{kwd},"%")
</if>
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
AND
<![CDATA[ DATE_FORMAT(a.time,'%Y-%m-%d')<=DATE_FORMAT(#{endDate},'%Y-%m-%d') AND
DATE_FORMAT(a.time,'%Y-%m-%d')>=DATE_FORMAT(#{startDate},'%Y-%m-%d') ]]>
</if>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace="com.yizhi.library.application.mapper.StatisticStudentCaseOrgMapper">
<select id="getStudentCaseOrg"
resultType="com.yizhi.library.application.domain.StatisticStudentCaseOrg">
SELECT
s.org_id orgId,
s.org_name orgName,
s.company_id companyId,
s.site_id siteId,
SUM( s.submit_num ) submitNum,
SUM( s.audit_num ) auditNum,
SUM( s.no_audit_num ) noAuditNum,
SUM( s.no_score_num ) noScoreNum,
SUM( s.score_num ) scoreNum,
SUM( s.case_num ) caseNum,
SUM( s.up_num ) upNum,
SUM( s.study_num ) studyNum
FROM
statistic_student_case_account s
WHERE
s.org_id = #{orgId} and s.site_id=#{siteId}
</select>
<select id="getOrgNamesMap" resultType="java.util.Map">
SELECT
org_id AS orgId,
org_names AS orgNames
FROM
statistic_student_case_account
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
GROUP BY org_id
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.StudentCaseAccessaryMapper">
<update id="deleteAccessary">
UPDATE student_case_accessary
SET state = 0
WHERE
student_case_id = #{studentCaseId}
</update>
<update id="verifyVedio">
UPDATE student_case_accessary
SET convert_state = 1
WHERE
1 = 1
<if test="ids!=null and ids.size()>0">
AND id IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</update>
<update id="updateTranscodeUrl">
UPDATE student_case_accessary
SET video_ld = #{videoLd},video_sd = #{videoSd},video_hd = #{videoHd}
WHERE
id = #{id}
</update>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.StudentCaseAuthorizeMapper">
<select id="getAuthorize" resultType="com.yizhi.library.application.vo.StudentCaseAuthorizeVO">
SELECT
student_case_id,
relation_id,
type,
`name`
FROM
student_case_authorize
WHERE
student_case_id = #{studentCaseId}
AND state = 1
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.StudentCaseMapper">
<resultMap type="com.yizhi.library.application.vo.StudentCaseManageListVO" id="listMap">
<id column="id" property="studentCaseId"/>
<result column="title" property="studentCaseTitle"/>
<result column="account_id" property="accountId"/>
<result column="case_library_id" property="caseLibraryId"/>
<result column="submit_time" property="submitTime"/>
<result column="audit_state" property="auditState"/>
<result column="audit_time" property="auditTime"/>
<result column="score_state" property="scoreState"/>
<collection property="auditorIds" ofType="java.lang.Long" select="getAuditorIds"
column="{account_id=account_id,case_library_id=case_library_id}">
</collection>
<collection property="scorerIds" ofType="java.lang.Long" select="getScorerIds"
column="{account_id=account_id,case_library_id=case_library_id}">
</collection>
</resultMap>
<resultMap type="com.yizhi.library.application.vo.StudentCaseManageListVO" id="exportMap">
<id column="id" property="studentCaseId"/>
<result column="title" property="studentCaseTitle"/>
<result column="account_id" property="accountId"/>
<result column="case_library_id" property="caseLibraryId"/>
<result column="submit_time" property="submitTime"/>
<result column="audit_state" property="auditState"/>
<result column="audit_time" property="auditTime"/>
<result column="score_state" property="scoreState"/>
<collection property="auditorIds" ofType="java.lang.Long" select="getAuditorIds"
column="{account_id=account_id,case_library_id=case_library_id}">
</collection>
<collection property="scorerIds" ofType="java.lang.Long" select="getScorerIds"
column="{account_id=account_id,case_library_id=case_library_id}">
</collection>
<collection property="relatedClassifyList" ofType="com.yizhi.library.application.vo.StudentRelatedClassifyVO"
select="getRelatedClassify"
column="{student_case_id=id}">
</collection>
</resultMap>
<resultMap type="com.yizhi.library.application.vo.StudentCaseManageListVO" id="auditExportMap">
<id column="id" property="studentCaseId"/>
<result column="title" property="studentCaseTitle"/>
<result column="account_id" property="accountId"/>
<result column="case_library_id" property="caseLibraryId"/>
<result column="submit_time" property="submitTime"/>
<collection property="auditorIds" ofType="java.lang.Long" select="getAuditorIds"
column="{account_id=account_id,case_library_id=case_library_id}">
</collection>
</resultMap>
<resultMap type="com.yizhi.library.application.vo.StudentCaseManageListVO" id="scoreExportMap">
<id column="id" property="studentCaseId"/>
<result column="title" property="studentCaseTitle"/>
<result column="account_id" property="accountId"/>
<result column="case_library_id" property="caseLibraryId"/>
<result column="submit_time" property="submitTime"/>
<collection property="scorerIds" ofType="java.lang.Long" select="getScorerIds"
column="{account_id=account_id,case_library_id=case_library_id}">
</collection>
</resultMap>
<resultMap type="com.yizhi.library.application.vo.StudentCaseManageListVO" id="informListExportMap">
<id column="id" property="studentCaseId"/>
<result column="title" property="studentCaseTitle"/>
<result column="account_id" property="accountId"/>
<result column="submit_time" property="submitTime"/>
<result column="informDescription" property="informDescription"/>
<result column="informerId" property="informerId"/>
<result column="inform_time" property="informTime"/>
<result column="caseLibraryName" property="caseLibraryName"/>
<collection property="auditorIds" ofType="java.lang.Long" select="getAuditorIds"
column="{account_id=account_id,case_library_id=case_library_id}">
</collection>
<collection property="scorerIds" ofType="java.lang.Long" select="getScorerIds"
column="{account_id=account_id,case_library_id=case_library_id}">
</collection>
</resultMap>
<update id="studentCaseRecall">
UPDATE student_case
SET state = 4,
audit_state = NULL
WHERE
id = #{studentCaseId}
</update>
<update id="studentCaseScore">
UPDATE student_case
SET score = #{score},score_state=1,is_finished_score = 1
WHERE
id = #{studentCaseId}
</update>
<update id="batchAuditNoPass">
UPDATE student_case a
SET a.audit_state = #{auditState},
a.audit_evaluate = #{audiEvaluate},
a.audit_time = NOW(),
a.score = null,
a.score_state = null,
a.state = 3
WHERE
1 = 1
<if test="idList!=null and idList.size()>0">
AND a.id IN
<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</update>
<update id="batchScore">
UPDATE student_case a
SET a.score = #{score},
a.score_state = 1
WHERE
1=1
<if test="idList!=null and idList.size()>0">
AND a.id IN
<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</update>
<update id="deleteStudentCase">
UPDATE student_case
SET state = 0
WHERE
id = #{studentCaseId}
</update>
<update id="batchAdminScore">
UPDATE student_case a
SET a.score = #{score},
a.score_state = 1,
a.is_finished_score = 1
WHERE
1=1
<if test="idList!=null and idList.size()>0">
AND a.id IN
<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</update>
<update id="updateStudyNum">
UPDATE student_case
SET read_num = read_num + 1
WHERE
id = #{studentCaseId}
</update>
<update id="initializeAdmireNum">
UPDATE student_case
SET admire_num = 0
</update>
<update id="checkAdmireNum">
UPDATE
student_case a,
(SELECT COUNT(1) AS num, student_case_id FROM admire_recorde WHERE state = 1 GROUP BY student_case_id) b
SET a.admire_num = b.num
WHERE
a.id = b.student_case_id
</update>
<!--这样写法有问题mybatis不支持-->
<!--<update id="batchAuditPass">-->
<!--UPDATE student_case a-->
<!--LEFT JOIN case_library b on a.case_library_id = b.id-->
<!--SET a.audit_state = #{auditState},-->
<!--a.audit_evaluate = #{audiEvaluate},-->
<!--a.audit_time = NOW(),-->
<!--a.score_state = 0,-->
<!--a.state =-->
<!--CASE-->
<!--b.examine-->
<!--WHEN 1 THEN-->
<!--2-->
<!--ELSE 3-->
<!--END-->
<!--WHERE-->
<!--a.case_library_id = b.id-->
<!--<if test="idList!=null and idList.size()>0">-->
<!--AND a.id IN-->
<!--<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">-->
<!--#{item}-->
<!--</foreach>-->
<!--</if>-->
<!--</update>-->
<!--旧版本-->
<!--<select id="myCaseLibraryList" resultType="CaseLibraryVO">-->
<!--SELECT-->
<!--library.id,-->
<!--library.NAME,-->
<!--library.logo_url,-->
<!--library.training_project_id,-->
<!--COUNT(progress.id) as inProgressNum,-->
<!--COUNT(finish.id) as finishNum,-->
<!--CASE-->
<!--when COUNT(submit.id) > 0-->
<!--then 1-->
<!--else 0-->
<!--end-->
<!--as isMustSubmit-->
<!--FROM-->
<!--case_library library-->
<!--LEFT JOIN must_submit submit ON library.id = submit.case_library_id and submit.account_id = #{accountId} and-->
<!--submit.state = 1-->
<!--LEFT JOIN student_case progress on library.id = progress.case_library_id and progress.account_id = #{accountId}-->
<!--and (progress.audit_state is null or progress.audit_state != 1) and progress.state != 0-->
<!--LEFT JOIN student_case finish on library.id = finish.case_library_id and finish.account_id = #{accountId}-->
<!--and finish.audit_state =1 and finish.state != 0-->
<!--where library.company_id = #{companyId} and library.site_id = #{siteId}-->
<!--and library.state = 2-->
<!--and library.training_project_id is not null-->
<!--<if test="projectIds!=null and projectIds.size()>0">-->
<!--AND library.training_project_id IN-->
<!--<foreach item="item" index="index" collection="caseLibraryIds" open="(" separator="," close=")">-->
<!--#{item}-->
<!--</foreach>-->
<!--</if>-->
<!--GROUP BY library.id-->
<!--ORDER BY library.update_time desc-->
<!--</select>-->
<select id="myCaseLibraryList" resultType="com.yizhi.library.application.vo.CaseLibraryVO">
SELECT
library.id,
library.NAME,
library.start_time,
library.end_time,
library.logo_url,
library.training_project_id,
(SELECT COUNT(1) FROM student_case WHERE case_library_id = library.id and account_id = #{accountId}
and (audit_state is null or audit_state != 1) and state != 0) as inProgressNum,
(SELECT COUNT(1) FROM student_case WHERE case_library_id = library.id and account_id = #{accountId}
and audit_state =1 and state != 0) as finishNum,
CASE
when COUNT(submit.id) > 0
then 1
else 0
end
as isMustSubmit
FROM
case_library library
LEFT JOIN must_submit submit ON library.id = submit.case_library_id and submit.account_id = #{accountId} and
submit.state = 1
where library.company_id = #{companyId} and library.site_id = #{siteId}
and (library.visible_range = 1
<if test="caseLibraryIds!=null and caseLibraryIds.size()>0">
or library.id IN
<foreach item="item" index="index" collection="caseLibraryIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
)
and library.state = 2
GROUP BY library.id
ORDER BY library.update_time desc
</select>
<select id="studentCaseView" resultType="com.yizhi.library.application.vo.StudentCaseViewVO">
SELECT
a.id,
a.case_library_id,
a.keywords,
b.NAME AS caseLibraryName,
b.explanation,
a.text_edit_type as textEditType,
a.title,
a.logo_url,
a.content,
a.pdf_oss_url,
a.content_file_name,
a.visible_range,
a.accessory_url,
a.state,
a.audit_state,
a.score_state,
a.audit_evaluate,
a.score,
b.auditor_authorize,
a.account_id as accountId,
b.show_score as showScore,
b.score_rule as scoreRule,
b.case_library_dimension_grade_description as caseLibraryDimensionGradeDescription,
b.product_cover productCover
FROM
student_case a
LEFT JOIN case_library b ON a.case_library_id = b.id
WHERE
a.id = #{studentCaseId}
</select>
<select id="studyStudentCase" resultType="com.yizhi.library.application.vo.StudentCaseStudyVO">
SELECT
a.id AS studentCaseId,
a.logo_url,
a.title,
a.account_id AS authorId,
a.submit_time as createTime,
a.content,
a.accessory_url,
a.audit_state,
a.audit_evaluate,
a.state,
cl.show_score as showScore,
cl.score_rule as scoreRule,
cl.id as caseLibraryId,
<if test="type==0">
CASE
WHEN ISNULL(c.id) THEN
0 ELSE 1
END AS admireState,
CASE
WHEN ISNULL(d.id) THEN
0 ELSE 1
END AS favoriteState,
CASE
WHEN ISNULL(e.id) THEN
0 ELSE 1
END AS informState,
</if>
a.score
FROM
student_case a
<if test="type==0">
LEFT JOIN admire_recorde c ON a.id = c.student_case_id and c.account_id = #{accountId} and c.state = 1
LEFT JOIN favorite d ON a.id = d.biz_id and d.account_id = #{accountId} and d.state = 1
LEFT JOIN inform_recorde e ON a.id = e.student_case_id and e.account_id = #{accountId} and e.state = 1
left join case_library cl on cl.id = a.case_library_id
</if>
WHERE
a.id = #{studentCaseId}
group by a.id
</select>
<select id="getAuditCaseVO" resultType="com.yizhi.library.application.vo.StudentCaseStudyVO">
SELECT
a.id AS studentCaseId,
a.case_library_id caseId,
a.title,
a.account_id AS authorId,
a.create_time,
<if test="pageSize==1">
a.logo_url,
a.content,
a.accessory_url,
a.audit_evaluate,
</if>
a.audit_state,
cl.show_score as showScore,
cl.score_rule as scoreRule
FROM
student_case a
LEFT JOIN auditor b on b.auditor_id = #{accountId}
AND a.case_library_id = b.case_library_id
AND a.account_id = b.account_id
AND b.state = 1
left join case_library cl on cl.id = a.case_library_id
WHERE
a.audit_state = 0
and a.state != 0
AND a.company_id = #{companyId}
AND a.site_id = #{siteId}
AND b.auditor_id = #{accountId}
AND a.case_library_id = b.case_library_id
AND a.account_id = b.account_id
AND b.state = 1
<if test="name!=null and name!=''">
AND a.title LIKE CONCAT('%',#{name},'%')
</if>
group by a.id
ORDER BY a.submit_time desc,a.id DESC
</select>
<select id="getScoreCaseVO" resultType="com.yizhi.library.application.vo.StudentCaseStudyVO">
SELECT
a.id AS studentCaseId,
a.case_library_id caseId,
a.title,
a.account_id AS authorId,
a.create_time,
a.audit_time as auditTime,
<if test="pageSize==1">
a.logo_url,
a.content,
a.accessory_url,
a.audit_evaluate,
</if>
a.is_finished_score as scoreState,
a.score,
cl.show_score as showScore,
cl.score_rule as scoreRule
FROM
student_case a
LEFT JOIN
scorer c ON c.scorer_id = #{accountId}
AND c.case_library_id = a.case_library_id
AND c.account_id = a.account_id
LEFT JOIN
student_case_score_recorde b on b.scorer_id = #{accountId}
AND a.id = b.student_case_id
left join case_library cl on cl.id = a.case_library_id
WHERE
a.is_finished_score = 0
and a.audit_state = 1
and a.state != 0
AND a.company_id = #{companyId}
AND a.site_id = #{siteId}
AND c.scorer_id = #{accountId}
AND c.case_library_id = a.case_library_id
AND c.account_id = a.account_id
AND c.state = 1
AND b.score IS NULL
<if test="name!=null and name!=''">
AND a.title LIKE CONCAT('%',#{name},'%')
</if>
group by a.id
ORDER BY a.submit_time desc,a.id DESC
</select>
<select id="getExamine" resultType="java.util.Map">
SELECT
b.examine,a.account_id as accountId,b.point,b.training_project_id as trainingProjectId,
a.state,a.score_state as scoreState,b.id as caseLibraryId,b.name
FROM
student_case a
LEFT JOIN case_library b ON a.case_library_id = b.id
WHERE
a.id = #{studentCaseId}
</select>
<select id="studentCaseBatchExport" resultType="com.yizhi.library.application.vo.StudentCaseVO">
SELECT
a.id,
b.`name` as caseLibraryName,
a.account_id,
a.accessory_url
FROM
student_case a
LEFT JOIN case_library b ON a.case_library_id = b.id
WHERE
a.id IN
<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="getStudentCaseHomeList" resultType="com.yizhi.library.application.vo.StudentCaseVO">
SELECT
*
FROM
student_case
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND state = 2
<if test="studentCaseIds!=null and studentCaseIds.size()>0">
AND id not IN
<foreach item="item" index="index" collection="studentCaseIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="key!=null and key!=''">
AND (title LIKE CONCAT('%',#{key},'%')
<if test="accountIds!=null and accountIds.size()>0">
or account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
)
</if>
ORDER BY
create_time DESC
</select>
<select id="studentCaseManageList" resultMap="listMap">
SELECT
id,title,account_id,submit_time,audit_state,score_state,case_library_id,audit_time
FROM
student_case
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND case_library_id = #{caseLibraryId}
<if test="auditState!=null">
AND audit_state = #{auditState}
</if>
<if test="scoreState!=null">
AND score_state =#{scoreState}
</if>
<if test="studentCaseName!=null and studentCaseName!=''">
AND title LIKE CONCAT('%',#{studentCaseName},'%')
</if>
<if test="accountIds!=null and accountIds.size()>0">
AND account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND state not in(0,4)
ORDER BY submit_time DESC,id DESC
</select>
<select id="studentCaseManageExport" resultMap="exportMap">
SELECT
id,title,account_id,submit_time,audit_state,score_state,case_library_id,audit_time
FROM
student_case
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND case_library_id = #{caseLibraryId}
<if test="auditState!=null">
AND audit_state = #{auditState}
</if>
<if test="scoreState!=null">
AND score_state =#{scoreState}
</if>
<if test="studentCaseName!=null and studentCaseName!=''">
AND title LIKE CONCAT('%',#{studentCaseName},'%')
</if>
<if test="accountIds!=null and accountIds.size()>0">
AND account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND state not in(0,4)
ORDER BY submit_time DESC,id DESC
</select>
<select id="getAuditorIds" resultType="java.lang.Long">
SELECT
auditor_id
FROM
auditor
WHERE
case_library_id = #{case_library_id}
AND account_id = #{account_id}
AND state = 1
</select>
<select id="getScorerIds" resultType="java.lang.Long">
SELECT
scorer_id
FROM
scorer
WHERE
case_library_id = #{case_library_id}
AND account_id = #{account_id}
AND state = 1
</select>
<select id="getRelatedClassify" resultType="com.yizhi.library.application.vo.StudentRelatedClassifyVO">
SELECT
a.root_id as rootId,
b.`name` as classifyName
FROM
student_case_related_classify a
LEFT JOIN classify b ON a.classify_id = b.id
WHERE
a.student_case_id = #{student_case_id}
AND a.state = 1
AND b.state = 1
</select>
<select id="studentCaseManageAuditOrScoreView" resultType="com.yizhi.library.application.vo.StudentCaseStudyVO">
SELECT
sc.id AS studentCaseId,
sc.logo_url as logoUrl,
sc.title as title,
sc.account_id AS authorId,
sc.create_time as createTime,
sc.submit_time as submitTime,
sc.content as content,
sc.accessory_url as accessoryUrl,
sc.audit_state as auditState,
sc.audit_evaluate as auditEvaluate,
sc.score,
cl.show_score as showScore,
cl.score_rule as scoreRule,
cl.id as caseLibraryId,
cl.case_library_dimension_grade_description as caseLibraryDimensionGradeDescription,
cl.product_cover as productCover
FROM
student_case sc
left join case_library cl on sc.case_library_id = cl.id
WHERE
sc.id = #{studentCaseId}
</select>
<select id="exportAuditList" resultMap="auditExportMap">
SELECT
id,title,account_id,submit_time,case_library_id
FROM
student_case
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
<if test="studentCaseIds!=null and studentCaseIds.size()>0">
AND id in
<foreach item="item" index="index" collection="studentCaseIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
ORDER BY submit_time DESC,id DESC
</select>
<select id="exportScoreList" resultMap="scoreExportMap">
SELECT
id,title,account_id,submit_time,case_library_id
FROM
student_case
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
<if test="studentCaseIds!=null and studentCaseIds.size()>0">
AND id in
<foreach item="item" index="index" collection="studentCaseIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
ORDER BY submit_time DESC,id DESC
</select>
<select id="getSelectionList" resultType="com.yizhi.library.application.vo.SelectionCaseListVO">
SELECT
a.id,
a.title as tittle,
b.`name` AS caseLibraryName,
a.account_id,
a.submit_time,
b.score_rule as scoreRule,
b.id as caseLibraryId,
a.score,
CASE
a.state
WHEN 2 THEN
'已上架' ELSE '已下架'
END AS state,
b.product_cover as productCover
FROM
student_case a
LEFT JOIN case_library b ON a.case_library_id = b.id
WHERE
a.state IN ( 2, 3 )
and a.audit_state = 1
and a.company_id = #{companyId}
and a.site_id = #{siteId}
<if test="accountIds!=null and accountIds.size()>0">
AND a.account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="null!=state">
AND a.state = #{state}
</if>
<if test="null!=studentCaseName">
AND a.title LIKE CONCAT('%',#{studentCaseName},'%')
</if>
ORDER BY a.submit_time DESC,a.id DESC
</select>
<select id="getInformList" resultType="com.yizhi.library.application.vo.StudentCaseManageListVO">
SELECT
b.id AS studentCaseId,
b.title AS studentCaseTitle,
b.account_id,
b.submit_time,
a.description as informDescription,
a.account_id AS informerId,
a.Inform_time,
a.id as informRecordId
FROM
inform_recorde a
LEFT JOIN student_case b ON a.student_case_id = b.id
AND b.state = 2
WHERE
b.state = 2
AND a.state = 1
AND b.company_id = #{companyId}
AND b.site_id = #{siteId}
<if test="studentCaseName!=null">
AND b.title LIKE CONCAT('%',#{studentCaseName},'%')
</if>
<if test="accountIds!=null and accountIds.size()>0">
AND b.account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
ORDER BY
a.Inform_time DESC,
a.id DESC
</select>
<select id="getInformExportList" resultMap="informListExportMap">
SELECT
b.id,
b.title,
b.account_id,
b.submit_time,
b.case_library_id,
a.description AS informDescription,
a.account_id AS informerId,
a.inform_time,
c.`name` as caseLibraryName
FROM
inform_recorde a
LEFT JOIN student_case b ON a.student_case_id = b.id
LEFT JOIN case_library c on b.case_library_id = c.id
AND b.state = 2
WHERE
b.state = 2
AND a.state = 1
AND b.company_id = #{companyId}
AND b.site_id = #{siteId}
<if test="studentCaseName!=null">
AND b.title LIKE CONCAT('%',#{studentCaseName},'%')
</if>
<if test="accountIds!=null and accountIds.size()>0">
AND b.account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
ORDER BY
a.Inform_time DESC,
a.id DESC
</select>
<select id="informListView" resultType="com.yizhi.library.application.vo.StudentCaseStudyVO">
SELECT
b.id AS studentCaseId,
b.logo_url as logoUrl,
b.title AS title,
b.account_id AS authorId,
b.create_time AS createTime,
inform_time,
b.content,
b.accessory_url
FROM
inform_recorde a
LEFT JOIN student_case b ON a.student_case_id = b.id
WHERE
a.id = #{informRecordId}
</select>
<select id="getStudentCaseManageCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM
student_case
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND case_library_id = #{caseLibraryId}
<if test="auditState!=null">
AND audit_state = #{auditState}
</if>
<if test="scoreState!=null">
AND score_state =#{scoreState}
</if>
<if test="accountIds!=null and accountIds.size()>0">
AND account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND state not in(0,4)
ORDER BY submit_time,id DESC
</select>
<select id="getProjectByCaseLibrary" resultType="java.util.Map">
SELECT
`name` AS caseLibraryName,
training_project_id as trainingProjectId
FROM
case_library
WHERE
id = #{caseLibraryId}
</select>
<select id="getProjectByStudentCase" resultType="java.util.Map">
SELECT
a.`name` AS caseLibraryName,
a.training_project_id
FROM
student_case b
LEFT JOIN case_library a ON a.id = b.case_library_id
WHERE
b.id = #{studentLibraryId}
</select>
<select id="getCaseLibrary" resultType="com.yizhi.library.application.domain.CaseLibrary">
select * from case_library
where id = #{caseLibraryId}
</select>
<select id="getManageAuditOrScorePrefix" resultType="java.lang.Long">
SELECT
id
FROM
student_case
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND case_library_id = #{caseLibraryId}
<if test="auditState!=null">
AND audit_state = #{auditState}
</if>
<if test="scoreState!=null">
AND score_state =#{scoreState}
</if>
<if test="accountIds!=null and accountIds.size()>0">
AND account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND state not in(0,4)
AND <![CDATA[ DATE_FORMAT(submit_time,'%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{submitTime},'%Y-%m-%d %H:%i:%S') ]]>
AND id != #{studentCaseId}
ORDER BY submit_time,id
limit 0,1
</select>
<select id="getManageAuditOrScoreSuffix" resultType="java.lang.Long">
SELECT
id
FROM
student_case
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND case_library_id = #{caseLibraryId}
<if test="auditState!=null">
AND audit_state = #{auditState}
</if>
<if test="scoreState!=null">
AND score_state =#{scoreState}
</if>
<if test="accountIds!=null and accountIds.size()>0">
AND account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND state not in(0,4)
AND <![CDATA[ DATE_FORMAT(submit_time,'%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{submitTime},'%Y-%m-%d %H:%i:%S') ]]>
AND id != #{studentCaseId}
ORDER BY submit_time desc,id desc
limit 0,1
</select>
<select id="getManageInformPrefix" resultType="java.lang.Long">
SELECT
a.id
FROM
inform_recorde a
LEFT JOIN student_case b ON a.student_case_id = b.id
AND b.state = 2
WHERE
b.state = 2
AND a.state = 1
AND b.company_id = #{companyId}
AND b.site_id = #{siteId}
<if test="accountIds!=null and accountIds.size()>0">
AND b.account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND (<![CDATA[ DATE_FORMAT(inform_time,'%Y-%m-%d %H:%i:%S')>DATE_FORMAT(#{informTime},'%Y-%m-%d %H:%i:%S') ]]>
OR (
DATE_FORMAT(inform_time,'%Y-%m-%d %H:%i:%S')=DATE_FORMAT(#{informTime},'%Y-%m-%d %H:%i:%S')
AND a.id > #{informRecordId}
)
)
ORDER BY
a.Inform_time,a.id
limit 0,1
</select>
<select id="getManageInformSuffix" resultType="java.lang.Long">
SELECT
a.id
FROM
inform_recorde a
LEFT JOIN student_case b ON a.student_case_id = b.id
AND b.state = 2
WHERE
b.state = 2
AND a.state = 1
AND b.company_id = #{companyId}
AND b.site_id = #{siteId}
<if test="accountIds!=null and accountIds.size()>0">
AND b.account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND (<![CDATA[ DATE_FORMAT(inform_time,'%Y-%m-%d %H:%i:%S')<DATE_FORMAT(#{informTime},'%Y-%m-%d %H:%i:%S') ]]>
OR (
DATE_FORMAT(inform_time,'%Y-%m-%d %H:%i:%S')=DATE_FORMAT(#{informTime},'%Y-%m-%d %H:%i:%S')
<![CDATA[ AND a.id < #{informRecordId} ]]>
)
)
AND a.id != #{informRecordId}
ORDER BY
a.Inform_time desc,a.id desc
limit 0,1
</select>
<select id="getStudentAuditPrefix" resultType="java.lang.Long">
SELECT
a.id
FROM
student_case a LEFT JOIN auditor b on b.auditor_id = #{accountId}
AND a.case_library_id = b.case_library_id
AND a.account_id = b.account_id
WHERE
a.audit_state = 0
AND a.state not in(0,4)
and b.state = 1
AND a.company_id = #{companyId}
AND a.site_id = #{siteId}
AND b.auditor_id = #{accountId}
AND a.case_library_id = b.case_library_id
AND a.account_id = b.account_id
AND (<![CDATA[ DATE_FORMAT(a.submit_time,'%Y-%m-%d %H:%i:%S')>DATE_FORMAT(#{submitTime},'%Y-%m-%d %H:%i:%S') ]]>
OR (
DATE_FORMAT(a.submit_time,'%Y-%m-%d %H:%i:%S')=DATE_FORMAT(#{submitTime},'%Y-%m-%d %H:%i:%S')
<![CDATA[ AND a.id > #{studentCaseId} ]]>
)
)
group by a.id
ORDER BY a.submit_time ,a.id
limit 0,1
</select>
<select id="getStudentAuditSuffix" resultType="java.lang.Long">
SELECT
a.id
FROM
student_case a LEFT JOIN auditor b on b.auditor_id = #{accountId}
AND a.case_library_id = b.case_library_id
AND a.account_id = b.account_id
WHERE
a.audit_state = 0
AND a.state not in(0,4)
and b.state = 1
AND a.company_id = #{companyId}
AND a.site_id = #{siteId}
AND b.auditor_id = #{accountId}
AND a.case_library_id = b.case_library_id
AND a.account_id = b.account_id
AND (<![CDATA[ DATE_FORMAT(a.submit_time,'%Y-%m-%d %H:%i:%S')<DATE_FORMAT(#{submitTime},'%Y-%m-%d %H:%i:%S') ]]>
OR (
DATE_FORMAT(a.submit_time,'%Y-%m-%d %H:%i:%S')=DATE_FORMAT(#{submitTime},'%Y-%m-%d %H:%i:%S')
<![CDATA[ AND a.id < #{studentCaseId} ]]>
)
)
group by a.id
ORDER BY a.submit_time desc,a.id desc
limit 0,1
</select>
<select id="getStudentScorePrefix" resultType="java.lang.Long">
SELECT
a.id
FROM
student_case a LEFT JOIN scorer b on b.scorer_id = #{accountId}
AND a.case_library_id = b.case_library_id
AND a.account_id = b.account_id
WHERE
a.score_state = 0
AND a.state not in(0,4)
and b.state = 1
AND a.company_id = #{companyId}
AND a.site_id = #{siteId}
AND b.scorer_id = #{accountId}
AND a.case_library_id = b.case_library_id
AND a.account_id = b.account_id
AND (<![CDATA[ DATE_FORMAT(a.submit_time,'%Y-%m-%d %H:%i:%S')>DATE_FORMAT(#{submitTime},'%Y-%m-%d %H:%i:%S') ]]>
OR (
DATE_FORMAT(a.submit_time,'%Y-%m-%d %H:%i:%S')=DATE_FORMAT(#{submitTime},'%Y-%m-%d %H:%i:%S')
<![CDATA[ AND a.id > #{studentCaseId} ]]>
)
)
group by a.id
ORDER BY a.submit_time,a.id
limit 0,1
</select>
<select id="getStudentScoreSuffix" resultType="java.lang.Long">
SELECT
a.id
FROM
student_case a LEFT JOIN scorer b on b.scorer_id = #{accountId}
AND a.case_library_id = b.case_library_id
AND a.account_id = b.account_id
WHERE
a.score_state = 0
AND a.state not in(0,4)
and b.state = 1
AND a.company_id = #{companyId}
AND a.site_id = #{siteId}
AND b.scorer_id = #{accountId}
AND a.case_library_id = b.case_library_id
AND a.account_id = b.account_id
AND (<![CDATA[ DATE_FORMAT(a.submit_time,'%Y-%m-%d %H:%i:%S')<DATE_FORMAT(#{submitTime},'%Y-%m-%d %H:%i:%S') ]]>
OR (
DATE_FORMAT(a.submit_time,'%Y-%m-%d %H:%i:%S')=DATE_FORMAT(#{submitTime},'%Y-%m-%d %H:%i:%S')
<![CDATA[ AND a.id < #{studentCaseId} ]]>
)
)
group by a.id
ORDER BY a.submit_time desc,a.id desc
limit 0,1
</select>
<select id="getFavorites" resultType="com.yizhi.library.application.vo.FavoriteVO">
SELECT
b.id AS studentCaseId,
b.logo_url AS studentCaseLogoUrl,
b.title AS studentCaseTittle,
b.account_id AS authorId,
b.submit_time AS submitTime,
IFNULL(b.read_num,0) AS studyNum,
IFNULL(b.admire_num,0) AS admireNum
FROM
favorite a
LEFT JOIN student_case b ON a.biz_id = b.id
WHERE
a.account_id = #{accountId}
<if test="name!=null and name!=''">
AND b.title like CONCAT('%',#{name},'%')
</if>
AND a.company_id = #{companyId}
AND a.site_id = #{siteId}
AND a.state = 1
AND a.type = 1
ORDER BY
a.create_time DESC,a.id
</select>
<select id="getProjectList" resultType="com.yizhi.library.application.vo.StudentCaseStudyVO">
SELECT
id AS studentCaseId,
title,
logo_url,
account_id AS authorId,
audit_time,
score
FROM
student_case
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
<if test="name!=null and name!=''">
AND title like CONCAT('%',#{name},'%')
</if>
AND state = 2
ORDER BY
audit_time DESC,id
</select>
<select id="getStudentCaseIdsByClassifyIds" resultType="java.lang.Long">
SELECT
student_case_id
FROM
student_case_related_classify
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
<if test="classifyIds!=null and classifyIds.size()>0">
AND
(classify_id in
<foreach item="item" index="index" collection="classifyIds" open="(" separator="," close=")">
#{item}
</foreach>
OR classify_parent_id IN
<foreach item="item" index="index" collection="classifyIds" open="(" separator="," close=")">
#{item}
</foreach>
OR root_id IN
<foreach item="item" index="index" collection="classifyIds" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
AND state = 1
</select>
<select id="getSelectionStudentCaseList" resultType="com.yizhi.library.application.vo.FavoriteVO">
SELECT
a.id AS studentCaseId,
a.title AS studentCaseTittle,
a.logo_url AS studentCaseLogoUrl,
a.account_id AS authorId,
a.submit_time,
a.read_num as studyNum,
IFNULL( a.score, 0 ) AS score,
IFNULL( a.admire_num, 0 ) AS admireNum
FROM
student_case a
WHERE
a.company_id = #{companyId}
AND a.site_id = #{siteId}
-- 关键字查询
<if test="key!=null and key!=''">
AND (a.title like CONCAT('%',#{key},'%')
or a.keywords like CONCAT('%',#{key},'%')
<if test="accountIds!=null and accountIds.size()>0">
or a.account_id in
<foreach item="item" index="index" collection="accountIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
)
</if>
-- 可见范围筛选
AND (a.visible_range = 1
<if test="rangeIds!=null and rangeIds.size()>0">
OR a.id in
<foreach item="item" index="index" collection="rangeIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
)
-- 分类筛选
<if test="studentCaseIds!=null and studentCaseIds.size()>0">
AND a.id in
<foreach item="item" index="index" collection="studentCaseIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND a.state = 2
-- 提交时间从近到远
<if test="sortType!=null and sortType==1">
ORDER BY a.submit_time DESC,a.id
</if>
-- 提交时间从远到近
<if test="sortType!=null and sortType==2">
ORDER BY a.submit_time,a.id
</if>
-- 学习量由多到少
<if test="sortType!=null and sortType==3">
ORDER BY a.read_num DESC,a.submit_time DESC,a.id
</if>
-- 点赞数由多到少
<if test="sortType!=null and sortType==4">
ORDER BY admireNum DESC,a.submit_time DESC,a.id
</if>
-- 评分由高到低
<if test="sortType!=null and sortType==5">
ORDER BY a.score DESC,a.submit_time DESC,a.id
</if>
</select>
<select id="getRangeIds" resultType="java.lang.Long">
SELECT
student_case_id
FROM
student_case_authorize
WHERE 1=1
<if test="relationIds!=null and relationIds.size()>0">
AND relation_id in
<foreach item="item" index="index" collection="relationIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND state = 1
</select>
<select id="myCaseLibraryTotal" resultType="java.lang.Integer">
SELECT
COUNT(1)
FROM
case_library library
where library.company_id = #{companyId} and library.site_id = #{siteId}
and (library.visible_range = 1
<if test="caseLibraryIds!=null and caseLibraryIds.size()>0">
or library.id IN
<foreach item="item" index="index" collection="caseLibraryIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
)
and library.state = 2
</select>
<select id="getStudentCaseDetail" resultType="com.yizhi.library.application.vo.FavoriteVO">
SELECT
a.id AS studentCaseId,
a.title AS studentCaseTittle,
a.logo_url AS studentCaseLogoUrl,
a.account_id AS authorId,
a.submit_time as submitTime,
IFNULL(a.read_num,0) as studyNum,
IFNULL(a.admire_num,0) as admireNum
FROM
student_case a
WHERE
a.id = #{studentCaseId}
</select>
<select id="getFavoritesCount" resultType="java.lang.Integer">
SELECT
COUNT(1)
FROM
favorite a
WHERE
a.account_id = #{accountId}
AND a.company_id = #{companyId}
AND a.site_id = #{siteId}
AND a.state = 1
AND a.type = 1
</select>
<select id="getSubmitCaseLibraryIds" resultType="java.lang.Long">
SELECT
case_library_id
FROM
student_case
WHERE
company_id = #{companyId}
AND site_id = #{siteId}
AND account_id = #{accountId}
GROUP BY
case_library_id
</select>
<select id="getAdmireNum" resultType="java.lang.Integer">
SELECT COUNT(1) FROM admire_recorde
WHERE state = 1 AND student_case_id = #{id}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.StudentCaseRelatedClassifyMapper">
<select id="getRelatedClassify" resultType="com.yizhi.library.application.vo.StudentRelatedClassifyVO">
SELECT
a.id,
a.student_case_id,
a.classify_id,
b.`name` AS classifyName,
c.`name` AS classifyParentName,
a.`level`,
a.classify_parent_id,
a.root_id
FROM
student_case_related_classify a
LEFT JOIN classify b ON a.classify_id = b.id
AND b.state = 1
LEFT JOIN classify c ON a.classify_parent_id = c.id
AND c.state = 1
WHERE
a.student_case_id = #{studentCaseId}
AND a.root_id = #{rootId}
AND a.state = 1 AND b.state = 1 AND c.state = 1
</select>
<select id="getIsRelated" resultType="java.lang.Integer">
select COUNT(1) from
(select a.id from student_case_related_classify a LEFT JOIN student_case b
on a.student_case_id = b.id
where a.classify_id =#{classifyId} and a.state = 1 and b.state !=0
GROUP BY a.id)a
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace="com.yizhi.library.application.mapper.StudentCaseReportMapper">
<select id="studentCaseList"
resultType="com.yizhi.library.application.vo.StudentCaseExportVO">
SELECT
c.id id,
c.title title,
c.accountId accountId,
c.state state,
c.create_time create_time,
c.ups upNum,
c.informs informNum,
COUNT( cs.id
) studyNum
FROM
(
SELECT
b.id id,
b.title title,
b.accountId accountId,
b.state state,
b.create_time create_time,
b.ups ups,
COUNT( ir.id )
informs
FROM
(
SELECT
a.id id,
a.title title,
a.accountId accountId,
a.state
state,
a.create_time create_time,
count( ar.id ) ups
FROM
(
SELECT
s.id id,
s.title title,
s.account_id accountId,
CASE
s.state
WHEN 1 THEN
'待审核'
WHEN 2
THEN
(
CASE
s.audit_state
WHEN 0 THEN
'待审核'
WHEN 1 THEN
( CASE s.score_state
WHEN 0 THEN '待评分' ELSE '已评分' END )
WHEN 2 THEN
'不通过'
END
)
WHEN 3 THEN
(
CASE
s.audit_state
WHEN 0 THEN
'待审核'
WHEN 1 THEN
( CASE s.score_state WHEN
1 THEN '已评分' ELSE '待评分' END )
WHEN 2 THEN
'不通过'
END
)
END AS state,
s.create_time create_time
FROM
student_case s
WHERE
s.state != 0
AND
s.site_id=#{siteId}
AND s.submit_time BETWEEN str_to_date(
#{startDate}, '%Y-%m-%d %H:%i:%s' )
AND str_to_date( #{endDate}, '%Y-%m-%d
%H:%i:%s' )
<if test='kwd != null'>
AND s.title LIKE #{kwd}
</if>
) a
LEFT JOIN admire_recorde ar ON ar.student_case_id = a.id
GROUP BY
a.id
) b
LEFT JOIN inform_recorde ir ON b.id = ir.student_case_id
GROUP
BY
b.id
) c
LEFT JOIN case_study_recode cs ON c.id = cs.student_case_id
GROUP BY
c.id
ORDER BY
c.create_time DESC
</select>
<select id="studentCaseByAccount"
resultType="com.yizhi.library.application.vo.StudentCaseAccountExportVO">
SELECT
f.accountId accountId,
f.submitNum submitNum,
f.upNum upNum,
f.informNum informNum,
f.studyNum studyNum,
f.mustNum mustSubmitNum,
f.caseNum caseNum,
f.ups ups,
IFNULL( ir2.informs, 0 ) informs
FROM
(
SELECT
e.accountId accountId,
e.submitNum submitNum,
e.upNum upNum,
e.informNum
informNum,
e.studyNum studyNum,
e.mustNum mustNum,
e.caseNum
caseNum,
IFNULL( ar2.ups, 0 ) ups
FROM
(
SELECT
d.accountId accountId,
d.submitNum
submitNum,
d.upNum upNum,
d.informNum informNum,
d.studyNum
studyNum,
d.mustNum mustNum,
IFNULL( s2.caseNum, 0 ) caseNum
FROM
(
SELECT
c.accountId accountId,
c.submitNum submitNum,
c.upNum upNum,
c.informNum
informNum,
COUNT( cs.id ) studyNum,
0 mustNum
FROM
(
SELECT
b.accountId
accountId,
b.submitNum submitNum,
b.upNum upNum,
COUNT( ir.id ) informNum
FROM
(
SELECT
a.accountId accountId,
a.submitNum submitNum,
COUNT( ar.id )
upNum
FROM
(
SELECT
s.account_id accountId,
COUNT( s.id ) submitNum,
s.submit_time,
s.site_id
FROM
student_case s
WHERE s.submit_time BETWEEN
str_to_date( #{startDate}, '%Y-%m-%d %H:%i:%s' )
AND
str_to_date( #{endDate},
'%Y-%m-%d %H:%i:%s' )
AND s.site_id =
#{siteId}
<if test="accountIds != null and accountIds.size() > 0 ">
AND s.account_id in
<foreach collection="accountIds" item="accountId"
index="index" open="(" close=")" separator=",">
#{accountId}
</foreach>
</if>
GROUP BY
s.account_id
) a
LEFT JOIN admire_recorde ar ON a.accountId =
ar.account_id
GROUP BY
a.accountId
) b
LEFT JOIN inform_recorde ir ON
b.accountId =
ir.account_id
GROUP BY
b.accountId
) c
LEFT JOIN
case_study_recode cs ON
c.accountId = cs.account_id
GROUP BY
c.accountId
UNION
SELECT
m.account_id,
0,
0,
0,
0,
count( m.id ) mustNum
FROM
must_submit m
<if test="accountIds != null and accountIds.size() > 0 ">
WHERE m.account_id in
<foreach collection="accountIds" item="accountId"
index="index" open="(" close=")" separator=",">
#{accountId}
</foreach>
</if>
GROUP BY
m.account_id
) d
LEFT JOIN ( SELECT count( s1.id ) caseNum,
s1.account_id accountId
FROM
student_case s1 WHERE s1.state IN ( 2, 3 )
) s2 ON s2.accountId =
d.accountId
GROUP BY
d.accountId
) e
LEFT JOIN (
SELECT COUNT( ar1.id )
ups, ar1.account_id accountId
FROM admire_recorde
ar1 ) ar2 ON
e.accountId = ar2.accountId
GROUP BY
e.accountId
) f
LEFT JOIN
( SELECT
count( ir1.id ) informs, ir1.account_id accountId FROM
inform_recorde
ir1 ) ir2 ON f.accountId = ir2.accountId
GROUP BY
f.accountId
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yizhi.library.application.mapper.StudentCaseScoreRecordeMapper">
<update id="updateScoreRcorde">
UPDATE student_case_score_recorde
SET create_time = NOW( ),
score = #{score}
WHERE
student_case_id = #{studentCaseId}
AND scorer_id = #{accountId}
</update>
<select id="getUnscoredCount" resultType="java.lang.Integer">
SELECT
COUNT(1)
FROM
student_case_score_recorde
WHERE
student_case_id = #{studentCaseId}
AND score IS NULL
</select>
<select id="getAverageScore" resultType="java.lang.Integer">
SELECT
IFNULL(ROUND(AVG(score)),0)
FROM
student_case_score_recorde
WHERE
student_case_id = #{studentCaseId}
AND scorer_id IN ( SELECT scorer_id FROM scorer WHERE account_id = #{accountId} AND case_library_id = #{caseLibraryId} )
AND score IS NOT NULL
</select>
<select id="getMaxScore" resultType="java.lang.Integer">
SELECT
IFNULL(MAX(score),0)
FROM
student_case_score_recorde
WHERE
student_case_id = #{studentCaseId}
AND scorer_id IN ( SELECT scorer_id FROM scorer WHERE account_id = #{accountId} AND case_library_id = #{caseLibraryId} )
</select>
</mapper>
package com.fulan.caselibrary;
import com.baomidou.mybatisplus.plugins.Page;
import com.yizhi.library.application.CaseLibraryApplication;
import com.yizhi.library.application.param.SelectionStudentCaseParam;
import com.yizhi.library.application.service.IStudentCaseService;
import com.yizhi.library.application.service.impl.CaseLibraryServiceImpl;
import com.yizhi.library.application.vo.CaseLibraryVO;
import com.yizhi.library.application.vo.FavoriteVO;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.sound.midi.Soundbank;
/**
* Unit test for simple App.
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {CaseLibraryApplication.class})
public class AppTest {
@Autowired
private CaseLibraryServiceImpl caseLibraryService;
@Test
public void shouldAnswerWithTrue() {
// CaseLibraryVO json = JSON.parseObject("{\"type\":1,\"state\":1,\"id\":\"1291322046399131648\",\"textEditType\":1,\"auditorAuthorize\":0,\"visibleRange\":1,\"point\":\"\",\"examine\":1,\"scoreRule\":4,\"showScore\":1,\"caseLibraryDimensionGradeVOS\":[{\"id\":\"\",\"name\":\"最多支持输入50个字符以内\",\"minScore\":1,\"maxScore\":3,\"sort\":0},{\"minScore\":2,\"maxScore\":8,\"name\":\"12222\",\"sort\":1},{\"minScore\":1,\"maxScore\":20,\"name\":\"一一\",\"sort\":2}],\"caseLibraryDimensionGradeDescription\":\"最多支持输入50个字符以内\"}", CaseLibraryVO.class);
// RequestContext req = new RequestContext();
// caseLibraryService.dealCaseLibraryDimensionGradeInsert(json, req);
caseLibraryService.viewCaseLibrary(1291322046399131648L);
}
@Autowired
private IStudentCaseService studentCaseService;
@Test
public void test(){
SelectionStudentCaseParam selectionStudentCaseParam = new SelectionStudentCaseParam();
selectionStudentCaseParam.setSortType(4);
selectionStudentCaseParam.setPageNo(1);
selectionStudentCaseParam.setPageSize(10);
Page<FavoriteVO> selectionStudentCaseList = studentCaseService.getSelectionStudentCaseList(selectionStudentCaseParam);
System.out.println();
}
@Test
public void caseLibraryVeiw(){
Long caseLibraryId = 1320574038365270016L;
CaseLibraryVO caseLibraryVO = caseLibraryService.viewCaseLibrary(caseLibraryId);
System.out.println(caseLibraryVO);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<parent>
<groupId>com.yizhi</groupId>
<artifactId>wmy-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modules>
<module>library-api</module>
<module>library</module>
</modules>
<groupId>com.yizhi</groupId>
<artifactId>caselibrary</artifactId>
<version>1.0-SNAPSHOT</version>
<name>caselibrary</name>
<description>Demo project for Spring Boot</description>
<repositories>
<repository>
<id>wmy4.0</id>
<url>http://mvn.km365.pw/nexus/content/groups/wmy4.0-group/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
</project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment