瀏覽代碼

删除蓝图组卷不必要的类

宋悦 7 年之前
父節點
當前提交
b18493841f
共有 23 個文件被更改,包括 1 次插入1957 次删除
  1. 1 1
      cqb-gen-paper/src/main/java/com/qmth/cqb/genpaper/service/GenPaperService.java
  2. 0 20
      cqb-paper/src/main/java/com/qmth/cqb/paper/dao/PaperDetailInfoStructBlueprintRepo.java
  3. 0 27
      cqb-paper/src/main/java/com/qmth/cqb/paper/dao/PaperDetailInfoUnitStructBlueprintRepo.java
  4. 0 21
      cqb-paper/src/main/java/com/qmth/cqb/paper/dao/PaperDetailStructBlueprintRepo.java
  5. 0 18
      cqb-paper/src/main/java/com/qmth/cqb/paper/dao/PaperStructBlueprintRepo.java
  6. 0 174
      cqb-paper/src/main/java/com/qmth/cqb/paper/dto/PaperDetailInfoStructBlueprintDto.java
  7. 0 120
      cqb-paper/src/main/java/com/qmth/cqb/paper/dto/PaperDetailInfoUnitStructBlueprintDto.java
  8. 0 184
      cqb-paper/src/main/java/com/qmth/cqb/paper/model/PaperDetailInfoStructBlueprint.java
  9. 0 113
      cqb-paper/src/main/java/com/qmth/cqb/paper/model/PaperDetailInfoUnitStructBlueprint.java
  10. 0 109
      cqb-paper/src/main/java/com/qmth/cqb/paper/model/PaperDetailStructBlueprint.java
  11. 0 188
      cqb-paper/src/main/java/com/qmth/cqb/paper/model/PaperStructBlueprint.java
  12. 0 1
      cqb-paper/src/main/java/com/qmth/cqb/paper/service/ImportPaperService.java
  13. 0 44
      cqb-paper/src/main/java/com/qmth/cqb/paper/service/PaperDetailInfoStructBlueprintService.java
  14. 0 33
      cqb-paper/src/main/java/com/qmth/cqb/paper/service/PaperDetailInfoUnitStructBlueprintService.java
  15. 0 41
      cqb-paper/src/main/java/com/qmth/cqb/paper/service/PaperDetailStructBlueprintService.java
  16. 0 51
      cqb-paper/src/main/java/com/qmth/cqb/paper/service/PaperStructBlueprintService.java
  17. 0 314
      cqb-paper/src/main/java/com/qmth/cqb/paper/service/impl/PaperDetailInfoStructBlueprintServiceImpl.java
  18. 0 42
      cqb-paper/src/main/java/com/qmth/cqb/paper/service/impl/PaperDetailInfoUnitStructBlueprintServiceImpl.java
  19. 0 72
      cqb-paper/src/main/java/com/qmth/cqb/paper/service/impl/PaperDetailStructBlueprintServiceImpl.java
  20. 0 129
      cqb-paper/src/main/java/com/qmth/cqb/paper/service/impl/PaperStructBlueprintServiceImpl.java
  21. 0 55
      cqb-paper/src/main/java/com/qmth/cqb/paper/web/PaperDetailInfoStructBlueprintController.java
  22. 0 95
      cqb-paper/src/main/java/com/qmth/cqb/paper/web/PaperDetailStructBlueprintController.java
  23. 0 105
      cqb-paper/src/main/java/com/qmth/cqb/paper/web/PaperStructBlueprintController.java

+ 1 - 1
cqb-gen-paper/src/main/java/com/qmth/cqb/genpaper/service/GenPaperService.java

@@ -567,7 +567,7 @@ public class GenPaperService {
             paper.setUnitCount(this.getTotalQuesNum(paperDetailunits));
             paper.setPaperType(PaperType.GENERATE);
             // 数据入库
-            paper = this.persistentPaper(paperDetailunits, paperDetails, paper);
+            paper = this.persistentPaper(PaperStructType.BLUEPRINT,paperDetailunits, paperDetails, paper);
             msg = "success";
             paperMsgMap.put("paper", paper);
             paperMsgMap.put("msg", msg);

+ 0 - 20
cqb-paper/src/main/java/com/qmth/cqb/paper/dao/PaperDetailInfoStructBlueprintRepo.java

@@ -1,20 +0,0 @@
-package com.qmth.cqb.paper.dao;
-
-import java.util.List;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-
-import com.qmth.cqb.paper.model.PaperDetailInfoStructBlueprint;
-
-/**
- * @describle 蓝图试卷结构大题详情repo
- * @author weiwenhai
- * @date   2017.11.20
- */
-public interface PaperDetailInfoStructBlueprintRepo extends JpaRepository<PaperDetailInfoStructBlueprint, Long>,QueryByExampleExecutor<PaperDetailInfoStructBlueprint>,JpaSpecificationExecutor<PaperDetailInfoStructBlueprint>{
-
-	PaperDetailInfoStructBlueprint findByPaperDetailStructBlueprintId(Long paperDetailStructBlueprintId);
-	
-}

+ 0 - 27
cqb-paper/src/main/java/com/qmth/cqb/paper/dao/PaperDetailInfoUnitStructBlueprintRepo.java

@@ -1,27 +0,0 @@
-package com.qmth.cqb.paper.dao;
-
-import java.util.List;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-
-import com.qmth.cqb.paper.model.PaperDetailInfoUnitStructBlueprint;
-
-/**
- * @describle 蓝图试卷结构大题详情属性数量repo
- * @author weiwenhai
- * @date   2017.11.20
- */
-public interface PaperDetailInfoUnitStructBlueprintRepo extends JpaRepository<PaperDetailInfoUnitStructBlueprint, Long>,QueryByExampleExecutor<PaperDetailInfoUnitStructBlueprint>,JpaSpecificationExecutor<PaperDetailInfoUnitStructBlueprint>{
-
-	@Query("select s from PaperDetailInfoUnitStructBlueprint s where s.paperDetailInfoStructBlueprintId =?1 and s.paperDetailStructBlueprintId = ?2 group by s.propertyId order by s.id")
-	List<PaperDetailInfoUnitStructBlueprint> findGroupByPropertyId(Long paperDetailInfoStructBlueprintId, Long paperDetailStructBlueprintId);
-	
-	List<PaperDetailInfoUnitStructBlueprint> findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintId(Long paperDetailInfoStructBlueprintId, Long paperDetailStructBlueprintId);
-	
-	PaperDetailInfoUnitStructBlueprint findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty(Long paperDetailInfoStructBlueprintId, Long paperDetailStructBlueprintId, Long propertyId, Boolean isPublic, String propertyDifficulty);
-	
-	List<PaperDetailInfoUnitStructBlueprint> findByPropertyIdAndIsPublicAndPropertyDifficulty(Long propertyId, Boolean isPublic, String propertyDifficulty);
-}

+ 0 - 21
cqb-paper/src/main/java/com/qmth/cqb/paper/dao/PaperDetailStructBlueprintRepo.java

@@ -1,21 +0,0 @@
-package com.qmth.cqb.paper.dao;
-
-import java.util.List;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-
-import com.qmth.cqb.paper.model.PaperDetailStructBlueprint;
-
-/**
- * @describle 蓝图试卷结构大题repo
- * @author weiwenhai
- * @date   2017.11.20
- */
-public interface PaperDetailStructBlueprintRepo extends JpaRepository<PaperDetailStructBlueprint, Long>,QueryByExampleExecutor<PaperDetailStructBlueprint>,JpaSpecificationExecutor<PaperDetailStructBlueprint>{
-	
-	List<PaperDetailStructBlueprint> findByPaperStructBlueprintId(Long paperStructBlueprintId);
-	
-	List<PaperDetailStructBlueprint> findByUserIdAndPaperStructBlueprintId(Long userId, Long paperStructBlueprintId);
-}

+ 0 - 18
cqb-paper/src/main/java/com/qmth/cqb/paper/dao/PaperStructBlueprintRepo.java

@@ -1,18 +0,0 @@
-package com.qmth.cqb.paper.dao;
-
-import java.util.List;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-
-import com.qmth.cqb.paper.model.PaperStructBlueprint;
-/**
- * @describle 蓝图试卷结构repo
- * @author weiwenhai
- * @date   2017.11.20
- */
-public interface PaperStructBlueprintRepo extends JpaRepository<PaperStructBlueprint, Long>,QueryByExampleExecutor<PaperStructBlueprint>,JpaSpecificationExecutor<PaperStructBlueprint>{
-		
-	List<PaperStructBlueprint> findByCourseNo(String courseNo);
-}

+ 0 - 174
cqb-paper/src/main/java/com/qmth/cqb/paper/dto/PaperDetailInfoStructBlueprintDto.java

@@ -1,174 +0,0 @@
-package com.qmth.cqb.paper.dto;
-
-import java.util.List;
-
-import com.qmth.cqb.paper.model.PaperDetailInfoStructBlueprint;
-import com.qmth.cqb.paper.model.PaperDetailInfoUnitStructBlueprint;
-/**
- * @describle 蓝图试卷结构大题详情 dto
- * @author Administrator
- * @date   2017.11.20
- */
-public class PaperDetailInfoStructBlueprintDto {
-
-	private Long id; //大题详情id
-	
-    private String questionType; //小题类型
-    
-    private Integer count; //小题数量
-	
-	private Double score; //小题分数
-	
-	private Double totalScore; //小题总分
-	
-	private Integer publicSimpleCount; //公开简单总数
-	
-	private Integer publicMediumCount; //公开中等总数
-	
-	private Integer publicDifficultyCount; //公开困难总数
-	
-	private Integer noPublicSimpleCount; //非公开简单总数
-	
-	private Integer noPublicMediumCount; //非公开中等总数
-	
-	private Integer noPublicDifficultyCount; //非公开困难总数
-	
-	private List<String> quesNames; //来源大题
-	
-	private Long paperDetailStructBlueprintId; //大题id
-	
-	private List<PaperDetailInfoUnitStructBlueprintDto> paperDetailInfoUnitStructBlueprintDtos; //蓝图试卷结构大题详情属性
-	
-	public PaperDetailInfoStructBlueprintDto(){
-		
-	}
-
-	public PaperDetailInfoStructBlueprintDto(PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint){
-		this.id = paperDetailInfoStructBlueprint.getId();
-		this.questionType = paperDetailInfoStructBlueprint.getQuestionType();
-		this.count = paperDetailInfoStructBlueprint.getCount();
-		this.score = paperDetailInfoStructBlueprint.getScore();
-		this.totalScore = paperDetailInfoStructBlueprint.getTotalScore();
-		this.paperDetailStructBlueprintId = paperDetailInfoStructBlueprint.getPaperDetailStructBlueprintId();
-		this.publicSimpleCount = paperDetailInfoStructBlueprint.getPublicSimpleCount();
-		this.publicMediumCount = paperDetailInfoStructBlueprint.getPublicMediumCount();
-		this.publicDifficultyCount = paperDetailInfoStructBlueprint.getPublicDifficultyCount();
-		this.noPublicSimpleCount = paperDetailInfoStructBlueprint.getNoPublicSimpleCount();
-		this.noPublicMediumCount = paperDetailInfoStructBlueprint.getNoPublicMediumCount();
-		this.noPublicDifficultyCount = paperDetailInfoStructBlueprint.getNoPublicDifficultyCount();
-	}
-	
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public String getQuestionType() {
-		return questionType;
-	}
-
-	public void setQuestionType(String questionType) {
-		this.questionType = questionType;
-	}
-
-	public Integer getCount() {
-		return count;
-	}
-
-	public void setCount(Integer count) {
-		this.count = count;
-	}
-
-	public Double getScore() {
-		return score;
-	}
-
-	public void setScore(Double score) {
-		this.score = score;
-	}
-
-	public Double getTotalScore() {
-		return totalScore;
-	}
-
-	public void setTotalScore(Double totalScore) {
-		this.totalScore = totalScore;
-	}
-
-	public List<String> getQuesNames() {
-		return quesNames;
-	}
-
-	public void setQuesNames(List<String> quesNames) {
-		this.quesNames = quesNames;
-	}
-
-	public Long getPaperDetailStructBlueprintId() {
-		return paperDetailStructBlueprintId;
-	}
-	
-	public Integer getPublicSimpleCount() {
-		return publicSimpleCount;
-	}
-
-	public void setPublicSimpleCount(Integer publicSimpleCount) {
-		this.publicSimpleCount = publicSimpleCount;
-	}
-
-	public Integer getPublicMediumCount() {
-		return publicMediumCount;
-	}
-
-	public void setPublicMediumCount(Integer publicMediumCount) {
-		this.publicMediumCount = publicMediumCount;
-	}
-
-	public Integer getPublicDifficultyCount() {
-		return publicDifficultyCount;
-	}
-
-	public void setPublicDifficultyCount(Integer publicDifficultyCount) {
-		this.publicDifficultyCount = publicDifficultyCount;
-	}
-
-	public Integer getNoPublicSimpleCount() {
-		return noPublicSimpleCount;
-	}
-
-	public void setNoPublicSimpleCount(Integer noPublicSimpleCount) {
-		this.noPublicSimpleCount = noPublicSimpleCount;
-	}
-
-	public Integer getNoPublicMediumCount() {
-		return noPublicMediumCount;
-	}
-
-	public void setNoPublicMediumCount(Integer noPublicMediumCount) {
-		this.noPublicMediumCount = noPublicMediumCount;
-	}
-
-	public Integer getNoPublicDifficultyCount() {
-		return noPublicDifficultyCount;
-	}
-
-	public void setNoPublicDifficultyCount(Integer noPublicDifficultyCount) {
-		this.noPublicDifficultyCount = noPublicDifficultyCount;
-	}
-
-	public void setPaperDetailStructBlueprintId(Long paperDetailStructBlueprintId) {
-		this.paperDetailStructBlueprintId = paperDetailStructBlueprintId;
-	}
-
-	public List<PaperDetailInfoUnitStructBlueprintDto> getPaperDetailInfoUnitStructBlueprintDtos() {
-		return paperDetailInfoUnitStructBlueprintDtos;
-	}
-
-	public void setPaperDetailInfoUnitStructBlueprintDtos(
-			List<PaperDetailInfoUnitStructBlueprintDto> paperDetailInfoUnitStructBlueprintDtos) {
-		this.paperDetailInfoUnitStructBlueprintDtos = paperDetailInfoUnitStructBlueprintDtos;
-	}
-
-}

+ 0 - 120
cqb-paper/src/main/java/com/qmth/cqb/paper/dto/PaperDetailInfoUnitStructBlueprintDto.java

@@ -1,120 +0,0 @@
-package com.qmth.cqb.paper.dto;
-
-/**
- * @describle 蓝图试卷结构大题详情属性数量  dto
- * @author Administrator
- * @date   2017.11.20
- */
-public class PaperDetailInfoUnitStructBlueprintDto {
-
-	private Long propertyId; //属性id
-	
-	private String propertyName; //属性名称
-	
-	private Long propertyParentId; //属性父id
-	
-	private Integer number; //数量
-	
-	private Integer publicSimple; //公开简单
-	
-	private Integer publicMedium; //公开中等
-	
-	private Integer publicDifficulty; //公开困难
-	
-	private Integer noPublicSimple; //非公开简单
-	
-	private Integer noPublicMedium; //非公开中等
-	
-	private Integer noPublicDifficulty; //非公开困难
-	
-	private boolean disable; //是否置灰
-
-	public Long getPropertyId() {
-		return propertyId;
-	}
-
-	public void setPropertyId(Long propertyId) {
-		this.propertyId = propertyId;
-	}
-
-	public String getPropertyName() {
-		return propertyName;
-	}
-
-	public void setPropertyName(String propertyName) {
-		this.propertyName = propertyName;
-	}
-
-	public Integer getNumber() {
-		return number;
-	}
-
-	public void setNumber(Integer number) {
-		this.number = number;
-	}
-
-	public Integer getPublicSimple() {
-		return publicSimple;
-	}
-
-	public void setPublicSimple(Integer publicSimple) {
-		this.publicSimple = publicSimple;
-	}
-
-	public Integer getPublicMedium() {
-		return publicMedium;
-	}
-
-	public void setPublicMedium(Integer publicMedium) {
-		this.publicMedium = publicMedium;
-	}
-
-	public Integer getPublicDifficulty() {
-		return publicDifficulty;
-	}
-
-	public void setPublicDifficulty(Integer publicDifficulty) {
-		this.publicDifficulty = publicDifficulty;
-	}
-
-	public Integer getNoPublicSimple() {
-		return noPublicSimple;
-	}
-
-	public void setNoPublicSimple(Integer noPublicSimple) {
-		this.noPublicSimple = noPublicSimple;
-	}
-
-	public Integer getNoPublicMedium() {
-		return noPublicMedium;
-	}
-
-	public void setNoPublicMedium(Integer noPublicMedium) {
-		this.noPublicMedium = noPublicMedium;
-	}
-
-	public Integer getNoPublicDifficulty() {
-		return noPublicDifficulty;
-	}
-
-	public void setNoPublicDifficulty(Integer noPublicDifficulty) {
-		this.noPublicDifficulty = noPublicDifficulty;
-	}
-
-	public boolean isDisable() {
-		return disable;
-	}
-
-	public void setDisable(boolean disable) {
-		this.disable = disable;
-	}
-
-	public Long getPropertyParentId() {
-		return propertyParentId;
-	}
-
-	public void setPropertyParentId(Long propertyParentId) {
-		this.propertyParentId = propertyParentId;
-	}
-	
-}

+ 0 - 184
cqb-paper/src/main/java/com/qmth/cqb/paper/model/PaperDetailInfoStructBlueprint.java

@@ -1,184 +0,0 @@
-package com.qmth.cqb.paper.model;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
-
-import com.qmth.cqb.paper.dto.PaperDetailInfoStructBlueprintDto;
-
-import cn.com.qmth.examcloud.common.dto.question.enums.QuesStructType;
-
-/**
- * @describle 蓝图试卷结构大题详情
- * @author weiwenhai
- * @date   2017.11.16
- */
-@Entity
-@Table(name = "ecs_ques_paper_detail_info_struct_blueprint")
-public class PaperDetailInfoStructBlueprint implements Serializable{
-
-	private static final long serialVersionUID = -4313551116694332009L;
-	
-	@Id
-	@GeneratedValue
-	private Long id; //id
-	
-	@NotNull
-	private String questionType; //小题类型
-	
-	private Integer count; //小题数量
-	
-	private Double score; //小题分数
-	
-	private Double totalScore; //小题总分
-	
-	private Integer publicSimpleCount; //公开简单总数
-	
-	private Integer publicMediumCount; //公开中等总数
-	
-	private Integer publicDifficultyCount; //公开困难总数
-	
-	private Integer noPublicSimpleCount; //非公开简单总数
-	
-	private Integer noPublicMediumCount; //非公开中等总数
-	
-	private Integer noPublicDifficultyCount; //非公开困难总数
-	
-	@NotNull
-	private String quesNames; //来源大题
-	
-	private Long paperDetailStructBlueprintId; //大题id
-	
-	public PaperDetailInfoStructBlueprint(){
-		
-	}
-	
-	public PaperDetailInfoStructBlueprint(PaperDetailInfoStructBlueprintDto paperDetailInfoStructBlueprintDto){
-		this.id = paperDetailInfoStructBlueprintDto.getId();
-		this.count = paperDetailInfoStructBlueprintDto.getCount();
-		this.score = paperDetailInfoStructBlueprintDto.getScore();
-		this.totalScore = paperDetailInfoStructBlueprintDto.getTotalScore();
-		this.paperDetailStructBlueprintId = paperDetailInfoStructBlueprintDto.getPaperDetailStructBlueprintId();
-		this.publicSimpleCount = paperDetailInfoStructBlueprintDto.getPublicSimpleCount();
-		this.publicMediumCount = paperDetailInfoStructBlueprintDto.getPublicMediumCount();
-		this.publicDifficultyCount = paperDetailInfoStructBlueprintDto.getPublicDifficultyCount();
-		this.noPublicSimpleCount = paperDetailInfoStructBlueprintDto.getNoPublicSimpleCount();
-		this.noPublicMediumCount = paperDetailInfoStructBlueprintDto.getNoPublicMediumCount();
-		this.noPublicDifficultyCount = paperDetailInfoStructBlueprintDto.getNoPublicDifficultyCount();
-	}
-	
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public String getQuestionType() {
-		return questionType;
-	}
-
-	public void setQuestionType(String questionType) {
-		this.questionType = questionType;
-	}
-
-	public Integer getCount() {
-		return count;
-	}
-
-	public void setCount(Integer count) {
-		this.count = count;
-	}
-
-	public Double getScore() {
-		return score;
-	}
-
-	public void setScore(Double score) {
-		this.score = score;
-	}
-
-	public Double getTotalScore() {
-		return totalScore;
-	}
-
-	public void setTotalScore(Double totalScore) {
-		this.totalScore = totalScore;
-	}
-	
-	public Integer getPublicSimpleCount() {
-		return publicSimpleCount;
-	}
-
-	public void setPublicSimpleCount(Integer publicSimpleCount) {
-		this.publicSimpleCount = publicSimpleCount;
-	}
-
-	public Integer getPublicMediumCount() {
-		return publicMediumCount;
-	}
-
-	public void setPublicMediumCount(Integer publicMediumCount) {
-		this.publicMediumCount = publicMediumCount;
-	}
-
-	public Integer getPublicDifficultyCount() {
-		return publicDifficultyCount;
-	}
-
-	public void setPublicDifficultyCount(Integer publicDifficultyCount) {
-		this.publicDifficultyCount = publicDifficultyCount;
-	}
-
-	public Integer getNoPublicSimpleCount() {
-		return noPublicSimpleCount;
-	}
-
-	public void setNoPublicSimpleCount(Integer noPublicSimpleCount) {
-		this.noPublicSimpleCount = noPublicSimpleCount;
-	}
-
-	public Integer getNoPublicMediumCount() {
-		return noPublicMediumCount;
-	}
-
-	public void setNoPublicMediumCount(Integer noPublicMediumCount) {
-		this.noPublicMediumCount = noPublicMediumCount;
-	}
-
-	public Integer getNoPublicDifficultyCount() {
-		return noPublicDifficultyCount;
-	}
-
-	public void setNoPublicDifficultyCount(Integer noPublicDifficultyCount) {
-		this.noPublicDifficultyCount = noPublicDifficultyCount;
-	}
-
-	public String getQuesNames() {
-		return quesNames;
-	}
-
-	public void setQuesNames(String quesNames) {
-		this.quesNames = quesNames;
-	}
-
-	public Long getPaperDetailStructBlueprintId() {
-		return paperDetailStructBlueprintId;
-	}
-
-	public void setPaperDetailStructBlueprintId(Long paperDetailStructBlueprintId) {
-		this.paperDetailStructBlueprintId = paperDetailStructBlueprintId;
-	}
-
-	public static long getSerialversionuid() {
-		return serialVersionUID;
-	}
-	
-}

+ 0 - 113
cqb-paper/src/main/java/com/qmth/cqb/paper/model/PaperDetailInfoUnitStructBlueprint.java

@@ -1,113 +0,0 @@
-package com.qmth.cqb.paper.model;
-
-import java.io.Serializable;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
-
-import com.qmth.cqb.paper.dto.PaperDetailInfoUnitStructBlueprintDto;
-import com.qmth.cqb.utils.enums.PropertyDifficulty;
-
-/**
- * @describle 蓝图试卷结构大题详情属性数量
- * @author weiwenhai
- * @date   2017.11.16
- */
-@Entity
-@Table(name = "ecs_ques_paper_detail_info_unit_struct_blueprint")
-public class PaperDetailInfoUnitStructBlueprint implements Serializable {
-
-	private static final long serialVersionUID = -8398385820281426872L;
-
-	@Id
-	@GeneratedValue
-	private Long id; //id
-	
-	@NotNull
-	private Long propertyId; //属性id
-	
-	private Integer number; //属性数量
-	
-	private boolean isPublic; //是否公开
-	
-	private String propertyDifficulty; //属性难度
-	
-	private Long paperDetailInfoStructBlueprintId; //大题详情id
-	
-	private Long paperDetailStructBlueprintId; //大题id
-	
-	public PaperDetailInfoUnitStructBlueprint(){
-		
-	}
-	
-	public PaperDetailInfoUnitStructBlueprint(PaperDetailInfoUnitStructBlueprintDto paperDetailInfoUnitStructBlueprintDto, PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint){
-		this.propertyId = paperDetailInfoUnitStructBlueprintDto.getPropertyId();
-		this.paperDetailInfoStructBlueprintId = paperDetailInfoStructBlueprint.getId();
-		this.paperDetailStructBlueprintId = paperDetailInfoStructBlueprint.getPaperDetailStructBlueprintId();
-	}
-	
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Long getPropertyId() {
-		return propertyId;
-	}
-
-	public void setPropertyId(Long propertyId) {
-		this.propertyId = propertyId;
-	}
-
-	public Integer getNumber() {
-		return number;
-	}
-
-	public void setNumber(Integer number) {
-		this.number = number;
-	}
-
-	public Long getPaperDetailInfoStructBlueprintId() {
-		return paperDetailInfoStructBlueprintId;
-	}
-
-	public void setPaperDetailInfoStructBlueprintId(
-			Long paperDetailInfoStructBlueprintId) {
-		this.paperDetailInfoStructBlueprintId = paperDetailInfoStructBlueprintId;
-	}
-
-	public Long getPaperDetailStructBlueprintId() {
-		return paperDetailStructBlueprintId;
-	}
-
-	public void setPaperDetailStructBlueprintId(Long paperDetailStructBlueprintId) {
-		this.paperDetailStructBlueprintId = paperDetailStructBlueprintId;
-	}
-
-	public static long getSerialversionuid() {
-		return serialVersionUID;
-	}
-
-	public boolean isPublic() {
-		return isPublic;
-	}
-
-	public void setIsPublic(boolean isPublic) {
-		this.isPublic = isPublic;
-	}
-
-	public String getPropertyDifficulty() {
-		return propertyDifficulty;
-	}
-
-	public void setPropertyDifficulty(String propertyDifficulty) {
-		this.propertyDifficulty = propertyDifficulty;
-	}
-	
-}

+ 0 - 109
cqb-paper/src/main/java/com/qmth/cqb/paper/model/PaperDetailStructBlueprint.java

@@ -1,109 +0,0 @@
-package com.qmth.cqb.paper.model;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
-/**
- * @describle 蓝图试卷结构大题
- * @author weiwenhai
- * @date   2017.11.15
- */
-@Entity
-@Table(name = "ecs_ques_paper_detail_struct_blueprint")
-public class PaperDetailStructBlueprint implements Serializable{
-
-	private static final long serialVersionUID = 3227452501178462722L;
-	
-	@Id
-	@GeneratedValue
-	private Long id; //id
-	
-	@NotNull
-	private String name; //大题名称
-	
-	private String remark; //大题描述
-	
-	private Integer detailUnitCount; //小题数量
-	
-	private Double score; //大题分数
-	
-	private String type; //大题类型
-	
-	private Long userId; //登录人
-	
-	private Long paperStructBlueprintId; //试卷结构id
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public Integer getDetailUnitCount() {
-		return detailUnitCount;
-	}
-
-	public void setDetailUnitCount(Integer detailUnitCount) {
-		this.detailUnitCount = detailUnitCount;
-	}
-
-	public Double getScore() {
-		return score;
-	}
-
-	public void setScore(Double score) {
-		this.score = score;
-	}
-
-	public Long getPaperStructBlueprintId() {
-		return paperStructBlueprintId;
-	}
-
-	public void setPaperStructBlueprintId(Long paperStructBlueprintId) {
-		this.paperStructBlueprintId = paperStructBlueprintId;
-	}
-
-	public static long getSerialversionuid() {
-		return serialVersionUID;
-	}
-
-	public String getType() {
-		return type;
-	}
-
-	public void setType(String type) {
-		this.type = type;
-	}
-
-	public Long getUserId() {
-		return userId;
-	}
-
-	public void setUserId(Long userId) {
-		this.userId = userId;
-	}
-	
-}

+ 0 - 188
cqb-paper/src/main/java/com/qmth/cqb/paper/model/PaperStructBlueprint.java

@@ -1,188 +0,0 @@
-package com.qmth.cqb.paper.model;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
-
-import com.qmth.cqb.paper.dto.PaperStructBlueprintDto;
-
-/**
- * @describle 蓝图试卷结构
- * @author weiwenhai
- * @date   2017.11.15
- */
-@Entity
-@Table(name = "ecs_ques_paper_struct_blueprint")
-public class PaperStructBlueprint implements Serializable{
-
-	private static final long serialVersionUID = -5738577530345514442L;
-	
-	@Id
-	@GeneratedValue
-	private Long id; //id
-	
-	@NotNull
-	private String name; //蓝图结构名称
-	
-	@NotNull
-	private String courseNo; //制定课程
-	
-	private Long coursePropertyId; //课程属性
-	
-	private Integer detailCount; //大题数量
-	
-	private Double totalScore; //总分
-	
-	private Double difficulty; //难度 
-	
-	@NotNull
-	private String type; //设置类型
-	
-	@NotNull
-	private Long orgId; //机构ID
-	
-	@NotNull
-	private String creator; //创建人id
-	
-	private String updateCreator; //修改人
-	
-    private Date createTime; //创建时间
-    
-    private Date updateTime; //修改时间
-
-    public PaperStructBlueprint(){}
-    
-    public PaperStructBlueprint(PaperStructBlueprintDto paperStructBlueprintDto){
-    	this.id = paperStructBlueprintDto.getId();
-    	this.name = paperStructBlueprintDto.getName();
-    	this.courseNo = paperStructBlueprintDto.getCourseCode();
-    	this.coursePropertyId = paperStructBlueprintDto.getCoursePropertyId();
-    	this.totalScore = paperStructBlueprintDto.getTotalScore();
-    	this.type = paperStructBlueprintDto.getType();
-    	this.creator = paperStructBlueprintDto.getCreator();
-    	this.orgId = paperStructBlueprintDto.getOrgId();
-    }
-    
-    public Double getDifficulty() {
-		return difficulty;
-	}
-
-	public void setDifficulty(Double difficulty) {
-		this.difficulty = difficulty;
-	}
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public Integer getDetailCount() {
-		return detailCount;
-	}
-
-	public void setDetailCount(Integer detailCount) {
-		this.detailCount = detailCount;
-	}
-
-	public Double getTotalScore() {
-		return totalScore;
-	}
-
-	public void setTotalScore(Double totalScore) {
-		this.totalScore = totalScore;
-	}
-
-	public String getType() {
-		return type;
-	}
-
-	public void setType(String type) {
-		this.type = type;
-	}
-	
-	public String getCreator() {
-		return creator;
-	}
-
-	public void setCreator(String creator) {
-		this.creator = creator;
-	}
-
-	public static long getSerialversionuid() {
-		return serialVersionUID;
-	}
-
-	public Long getOrgId() {
-		return orgId;
-	}
-
-	public void setOrgId(Long orgId) {
-		this.orgId = orgId;
-	}
-
-	public Date getCreateTime() {
-		return createTime;
-	}
-
-	public void setCreateTime(Date createTime) {
-		this.createTime = createTime;
-	}
-
-	public String getUpdateCreator() {
-		return updateCreator;
-	}
-
-	public void setUpdateCreator(String updateCreator) {
-		this.updateCreator = updateCreator;
-	}
-
-	public Date getUpDateTime() {
-		return updateTime;
-	}
-
-	public void setUpDateTime(Date updateTime) {
-		this.updateTime = updateTime;
-	}
-
-	public String getCourseNo() {
-		return courseNo;
-	}
-
-	public void setCourseNo(String courseNo) {
-		this.courseNo = courseNo;
-	}
-
-	public Long getCoursePropertyId() {
-		return coursePropertyId;
-	}
-
-	public void setCoursePropertyId(Long coursePropertyId) {
-		this.coursePropertyId = coursePropertyId;
-	}
-
-	public Date getUpdateTime() {
-		return updateTime;
-	}
-
-	public void setUpdateTime(Date updateTime) {
-		this.updateTime = updateTime;
-	}
-    
-}

+ 0 - 1
cqb-paper/src/main/java/com/qmth/cqb/paper/service/ImportPaperService.java

@@ -14,7 +14,6 @@ import java.util.Set;
 import java.util.UUID;
 import java.util.regex.Pattern;
 
-import com.netflix.infix.lang.infix.antlr.EventFilterParser.null_predicate_return;
 import com.qmth.cqb.base.dao.CourseRepo;
 import com.qmth.cqb.base.model.Course;
 import com.qmth.cqb.question.dao.CoursePropertyRepo;

+ 0 - 44
cqb-paper/src/main/java/com/qmth/cqb/paper/service/PaperDetailInfoStructBlueprintService.java

@@ -1,44 +0,0 @@
-package com.qmth.cqb.paper.service;
-
-import com.qmth.cqb.paper.dto.PaperDetailInfoStructBlueprintDto;
-import com.qmth.cqb.paper.model.PaperDetailInfoStructBlueprint;
-
-/**
- * @describle 蓝图试卷结构大题详情
- * @author weiwenhai
- * @date   2017.11.20
- */
-public interface PaperDetailInfoStructBlueprintService {
-
-	/**
-	 * 保存新增的单个大题详情
-	 * @param paperDetailInfoStructBlueprint
-	 */
-	public PaperDetailInfoStructBlueprint saveSingle(PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint);
-	
-	/**
-	 * 保存蓝图试卷结构大题详情dto
-	 * @param paperDetailInfoStructBlueprintDto
-	 */
-	public void saveDto(PaperDetailInfoStructBlueprintDto paperDetailInfoStructBlueprintDto);
-	
-	/**
-	 * 根据大题id,查询大题详情dto
-	 * @param paperDetailStructBlueprintId
-	 * @return
-	 */
-	public PaperDetailInfoStructBlueprintDto findByPaperDetailStructBlueprintId(Long paperDetailStructBlueprintId);
-	
-	/**
-	 * 根据大题id,查询大题详情
-	 * @param paperDetailStructBlueprintId
-	 * @return
-	 */
-	public PaperDetailInfoStructBlueprint getPaperDetailInfoStructBlueprint(Long paperDetailStructBlueprintId);
-	
-	/**
-	 * 删除单个大题详情
-	 * @param paperDetailInfoStructBlueprint
-	 */
-	public void deleteSingle(PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint);
-}

+ 0 - 33
cqb-paper/src/main/java/com/qmth/cqb/paper/service/PaperDetailInfoUnitStructBlueprintService.java

@@ -1,33 +0,0 @@
-package com.qmth.cqb.paper.service;
-
-import java.util.List;
-
-import com.qmth.cqb.paper.model.PaperDetailInfoUnitStructBlueprint;
-
-/**
- * @describle 蓝图试卷结构大题详情属性数量 service
- * @author weiwenhai
- * @date   2017.11.20
- */
-public interface PaperDetailInfoUnitStructBlueprintService {
-
-	/**
-	 * 保存新增的单个大题详情属性
-	 * @param paperDetailInfoUnitStructBlueprint
-	 */
-	public void saveSingle(PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint);
-	
-	/**
-	 * 根据大题详情id和大题id查询  大题详情属性集合
-	 * @param paperDetailInfoStructBlueprintId
-	 * @param paperDetailStructBlueprintId
-	 * @return
-	 */
-	public List<PaperDetailInfoUnitStructBlueprint> getPaperDetailInfoUnitStructBlueprint(Long paperDetailInfoStructBlueprintId, Long paperDetailStructBlueprintId);
-	
-	/**
-	 * 删除单个大题详情属性集合
-	 * @param paperDetailInfoUnitStructBlueprint
-	 */
-	public void deleteSingle(PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint);
-}

+ 0 - 41
cqb-paper/src/main/java/com/qmth/cqb/paper/service/PaperDetailStructBlueprintService.java

@@ -1,41 +0,0 @@
-package com.qmth.cqb.paper.service;
-
-import java.util.List;
-
-import com.qmth.cqb.paper.model.PaperDetailStructBlueprint;
-
-/**
- * @describle 蓝图试卷结构大题 service
- * @author weiwenhai
- * @date   2017.11.20
- */
-public interface PaperDetailStructBlueprintService {
-	
-	/**
-	 * 根据试卷结构id
-	 * 查询所有大题,不带分页
-	 * @param paperStructBlueprintId
-	 * @return
-	 */
-	public List<PaperDetailStructBlueprint> findAll(Long paperStructBlueprintId);
-	
-	/**
-	 * 查询新增的大题,无试卷结构id
-	 * @param userId
-	 * @param paperStructBlueprintId
-	 * @return
-	 */
-	public List<PaperDetailStructBlueprint> findSaveAll(Long userId, Long paperStructBlueprintId);
-	
-	/**
-	 * 保存新增的单个大题
-	 * @param paperDetailStructBlueprint
-	 */
-	public void saveSingle(PaperDetailStructBlueprint paperDetailStructBlueprint);
-	
-	/**
-	 * 删除单个大题
-	 * @param id
-	 */
-	public void deleteSingle(Long id);
-}

+ 0 - 51
cqb-paper/src/main/java/com/qmth/cqb/paper/service/PaperStructBlueprintService.java

@@ -1,51 +0,0 @@
-package com.qmth.cqb.paper.service;
-
-import java.util.List;
-
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Pageable;
-
-import com.qmth.cqb.paper.dto.PaperStructBlueprintDto;
-import com.qmth.cqb.paper.model.PaperStructBlueprint;
-
-/**
- * @describle 蓝图试卷结构 service
- * @author weiwenhai
- * @date   2017.11.17
- */
-public interface PaperStructBlueprintService {
-
-	/**
-	 * 查询所有蓝图试卷结构带分页
-	 * @param paperStructBlueprintDto
-	 * @return
-	 */
-	public Page<PaperStructBlueprint> findAll(PaperStructBlueprintDto paperStructBlueprintDto, Pageable pageable);
-	
-	/**
-	 * 保存试卷结构
-	 * @param paperStructBlueprintDto
-	 * @param PaperDetailIds
-	 */
-	public void saveSingle(PaperStructBlueprintDto paperStructBlueprintDto, String PaperDetailIds);
-	
-	/**
-	 * 计算试卷结构难度
-	 * @param ids 试卷结构大题的ids
-	 * @return
-	 */
-	public Double getDifficulty(List<Long> ids);
-	
-	/**
-	 * 根据id删除试卷结构
-	 * @param id
-	 */
-	public void deleteSingle(Long id);
-	
-	/**
-	 * 根据课程查询查询试卷结构
-	 * @param courseNo
-	 * @return
-	 */
-	public List<PaperStructBlueprint> findByCourseNo(String courseNo);
-}

+ 0 - 314
cqb-paper/src/main/java/com/qmth/cqb/paper/service/impl/PaperDetailInfoStructBlueprintServiceImpl.java

@@ -1,314 +0,0 @@
-package com.qmth.cqb.paper.service.impl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
-
-import cn.com.qmth.examcloud.common.dto.question.enums.QuesStructType;
-
-import com.qmth.cqb.paper.dao.PaperDetailInfoStructBlueprintRepo;
-import com.qmth.cqb.paper.dao.PaperDetailInfoUnitStructBlueprintRepo;
-import com.qmth.cqb.paper.dao.PaperDetailStructBlueprintRepo;
-import com.qmth.cqb.paper.dto.PaperDetailInfoStructBlueprintDto;
-import com.qmth.cqb.paper.dto.PaperDetailInfoUnitStructBlueprintDto;
-import com.qmth.cqb.paper.model.PaperDetailInfoStructBlueprint;
-import com.qmth.cqb.paper.model.PaperDetailInfoUnitStructBlueprint;
-import com.qmth.cqb.paper.model.PaperDetailStructBlueprint;
-import com.qmth.cqb.paper.service.PaperDetailInfoStructBlueprintService;
-import com.qmth.cqb.question.dao.PropertyRepo;
-import com.qmth.cqb.question.model.Property;
-import com.qmth.cqb.utils.enums.PropertyDifficulty;
-
-/**
- * @describle 蓝图试卷结构大题详情 paperDetailInfoStructBlueprintServiceImpl
- * @author weiwenhai
- * @date   2017.11.20
- */
-@Service("paperDetailInfoStructBlueprintService")
-public class PaperDetailInfoStructBlueprintServiceImpl implements PaperDetailInfoStructBlueprintService{
-
-	@Autowired
-	private PaperDetailInfoStructBlueprintRepo paperDetailInfoStructBlueprintRepo;
-	
-	@Autowired
-	private PaperDetailInfoUnitStructBlueprintRepo paperDetailInfoUnitStructBlueprintRepo;
-	
-	@Autowired
-	private PropertyRepo propertyRepo;
-	
-	@Autowired
-	private PaperDetailStructBlueprintRepo paperDetailStructBlueprintRepo;
-	
-	@Override
-	public PaperDetailInfoStructBlueprint saveSingle(PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint) {
-		if(!StringUtils.isEmpty(paperDetailInfoStructBlueprint.getQuestionType()) && !StringUtils.isEmpty(paperDetailInfoStructBlueprint.getQuesNames())){
-			PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint2 = paperDetailInfoStructBlueprintRepo.save(paperDetailInfoStructBlueprint);
-			return paperDetailInfoStructBlueprint2;
-		}
-		return null;
-	}
-
-	@Override
-	public void saveDto(PaperDetailInfoStructBlueprintDto paperDetailInfoStructBlueprintDto) {
-		//保存   蓝图试卷结构大题详情     paperDetailInfoStructBlueprint 对象
-		PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint = new PaperDetailInfoStructBlueprint(paperDetailInfoStructBlueprintDto);
-		paperDetailInfoStructBlueprint.setQuestionType(paperDetailInfoStructBlueprintDto.getQuestionType());
-		paperDetailInfoStructBlueprint.setQuesNames(org.apache.commons.lang.StringUtils.join(paperDetailInfoStructBlueprintDto.getQuesNames(), ","));//集合转换成字符串
-		paperDetailInfoStructBlueprint = saveSingle(paperDetailInfoStructBlueprint);
-		List<PaperDetailInfoUnitStructBlueprintDto> paperDetailInfoUnitStructBlueprintDtos = paperDetailInfoStructBlueprintDto.getPaperDetailInfoUnitStructBlueprintDtos();
-		if(paperDetailInfoUnitStructBlueprintDtos != null && paperDetailInfoUnitStructBlueprintDtos.size() >0){
-			for(PaperDetailInfoUnitStructBlueprintDto paperDetailInfoUnitStructBlueprintDto:paperDetailInfoUnitStructBlueprintDtos){
-				if(paperDetailInfoStructBlueprintDto != null && paperDetailInfoStructBlueprintDto.getId() != null){
-					//修改保存
-					updatePaperDetailInfoUnitStructBlueprint(paperDetailInfoUnitStructBlueprintDto,paperDetailInfoStructBlueprint);
-				}else{
-					//新增保存   蓝图试卷结构大题详情属性数量  paperDetailInfoUnitStructBlueprint 对象
-					savePaperDetailInfoUnitStructBlueprint(paperDetailInfoUnitStructBlueprintDto,paperDetailInfoStructBlueprint);
-				}
-			}
-		}
-		//保存完整的大题
-		PaperDetailStructBlueprint paperDetailStructBlueprint = paperDetailStructBlueprintRepo.findOne(paperDetailInfoStructBlueprintDto.getPaperDetailStructBlueprintId());
-		paperDetailStructBlueprint.setDetailUnitCount(paperDetailInfoStructBlueprintDto.getCount());
-		paperDetailStructBlueprint.setScore(paperDetailInfoStructBlueprintDto.getTotalScore());
-		paperDetailStructBlueprint.setType(paperDetailInfoStructBlueprintDto.getQuestionType());
-		paperDetailStructBlueprintRepo.save(paperDetailStructBlueprint);
-	}
-
-	/** 跟新
-	 * 根据蓝图试卷结构大题详情属性数量  dto保存多个小题详情对象
-	 * @param paperDetailInfoUnitStructBlueprintDto
-	 * @param paperDetailInfoStructBlueprint
-	 */
-	private void updatePaperDetailInfoUnitStructBlueprint(PaperDetailInfoUnitStructBlueprintDto paperDetailInfoUnitStructBlueprintDto,PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint) {
-		//查询已经保存的六个对象,并更新
-		//公开简单
-		if(paperDetailInfoUnitStructBlueprintDto.getPublicSimple() != null){
-			PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint = paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty
-					(paperDetailInfoStructBlueprint.getId(), paperDetailInfoStructBlueprint.getPaperDetailStructBlueprintId(), paperDetailInfoUnitStructBlueprintDto.getPropertyId(), true, PropertyDifficulty.SIMPLE.name());
-			paperDetailInfoUnitStructBlueprint.setNumber(paperDetailInfoUnitStructBlueprintDto.getPublicSimple());
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-		//公开中等
-		if(paperDetailInfoUnitStructBlueprintDto.getPublicMedium() != null){
-			PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint = paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty
-					(paperDetailInfoStructBlueprint.getId(), paperDetailInfoStructBlueprint.getPaperDetailStructBlueprintId(), paperDetailInfoUnitStructBlueprintDto.getPropertyId(), true, PropertyDifficulty.MEDIUM.name());
-			paperDetailInfoUnitStructBlueprint.setNumber(paperDetailInfoUnitStructBlueprintDto.getPublicMedium());
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-		//公开困难
-		if(paperDetailInfoUnitStructBlueprintDto.getPublicDifficulty() != null){
-			PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint = paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty
-					(paperDetailInfoStructBlueprint.getId(), paperDetailInfoStructBlueprint.getPaperDetailStructBlueprintId(), paperDetailInfoUnitStructBlueprintDto.getPropertyId(), true, PropertyDifficulty.DIFFICULTY.name());
-			paperDetailInfoUnitStructBlueprint.setNumber(paperDetailInfoUnitStructBlueprintDto.getPublicDifficulty());
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-		//非公开简单
-		if(paperDetailInfoUnitStructBlueprintDto.getNoPublicSimple() != null){
-			PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint = paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty
-					(paperDetailInfoStructBlueprint.getId(), paperDetailInfoStructBlueprint.getPaperDetailStructBlueprintId(), paperDetailInfoUnitStructBlueprintDto.getPropertyId(), false, PropertyDifficulty.SIMPLE.name());
-			paperDetailInfoUnitStructBlueprint.setNumber(paperDetailInfoUnitStructBlueprintDto.getNoPublicSimple());
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-		//非公开中等
-		if(paperDetailInfoUnitStructBlueprintDto.getNoPublicMedium() != null){
-			PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint = paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty
-					(paperDetailInfoStructBlueprint.getId(), paperDetailInfoStructBlueprint.getPaperDetailStructBlueprintId(), paperDetailInfoUnitStructBlueprintDto.getPropertyId(), false, PropertyDifficulty.MEDIUM.name());
-			paperDetailInfoUnitStructBlueprint.setNumber(paperDetailInfoUnitStructBlueprintDto.getNoPublicMedium());
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-		//非公开困难
-		if(paperDetailInfoUnitStructBlueprintDto.getNoPublicDifficulty() != null){
-			PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint = paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty
-					(paperDetailInfoStructBlueprint.getId(), paperDetailInfoStructBlueprint.getPaperDetailStructBlueprintId(), paperDetailInfoUnitStructBlueprintDto.getPropertyId(), false, PropertyDifficulty.DIFFICULTY.name());
-			paperDetailInfoUnitStructBlueprint.setNumber(paperDetailInfoUnitStructBlueprintDto.getNoPublicDifficulty());
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-	}
-
-	/**新增
-	 * 根据蓝图试卷结构大题详情属性数量  dto保存多个小题详情对象
-	 * @param paperDetailInfoUnitStructBlueprintDto
-	 */
-	private void savePaperDetailInfoUnitStructBlueprint(PaperDetailInfoUnitStructBlueprintDto paperDetailInfoUnitStructBlueprintDto, PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint) {
-		//公开简单
-		if(paperDetailInfoUnitStructBlueprintDto.getPublicSimple() != null){
-			PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint = new PaperDetailInfoUnitStructBlueprint(paperDetailInfoUnitStructBlueprintDto, paperDetailInfoStructBlueprint);
-			paperDetailInfoUnitStructBlueprint.setIsPublic(true);
-			paperDetailInfoUnitStructBlueprint.setPropertyDifficulty(PropertyDifficulty.SIMPLE.name());
-			paperDetailInfoUnitStructBlueprint.setNumber(paperDetailInfoUnitStructBlueprintDto.getPublicSimple());
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-		//公开中等
-		if(paperDetailInfoUnitStructBlueprintDto.getPublicMedium() != null){
-			PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint = new PaperDetailInfoUnitStructBlueprint(paperDetailInfoUnitStructBlueprintDto, paperDetailInfoStructBlueprint);
-			paperDetailInfoUnitStructBlueprint.setIsPublic(true);
-			paperDetailInfoUnitStructBlueprint.setPropertyDifficulty(PropertyDifficulty.MEDIUM.name());
-			paperDetailInfoUnitStructBlueprint.setNumber(paperDetailInfoUnitStructBlueprintDto.getPublicMedium());
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-		//公开困难
-		if(paperDetailInfoUnitStructBlueprintDto.getPublicDifficulty() != null){
-			PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint = new PaperDetailInfoUnitStructBlueprint(paperDetailInfoUnitStructBlueprintDto, paperDetailInfoStructBlueprint);
-			paperDetailInfoUnitStructBlueprint.setIsPublic(true);
-			paperDetailInfoUnitStructBlueprint.setPropertyDifficulty(PropertyDifficulty.DIFFICULTY.name());
-			paperDetailInfoUnitStructBlueprint.setNumber(paperDetailInfoUnitStructBlueprintDto.getPublicDifficulty());
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-		//非公开简单
-		if(paperDetailInfoUnitStructBlueprintDto.getNoPublicSimple() != null){
-			PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint = new PaperDetailInfoUnitStructBlueprint(paperDetailInfoUnitStructBlueprintDto, paperDetailInfoStructBlueprint);
-			paperDetailInfoUnitStructBlueprint.setIsPublic(false);
-			paperDetailInfoUnitStructBlueprint.setPropertyDifficulty(PropertyDifficulty.SIMPLE.name());
-			paperDetailInfoUnitStructBlueprint.setNumber(paperDetailInfoUnitStructBlueprintDto.getNoPublicSimple());
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-		//非公开中等
-		if(paperDetailInfoUnitStructBlueprintDto.getNoPublicMedium() != null){
-			PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint = new PaperDetailInfoUnitStructBlueprint(paperDetailInfoUnitStructBlueprintDto, paperDetailInfoStructBlueprint);
-			paperDetailInfoUnitStructBlueprint.setIsPublic(false);
-			paperDetailInfoUnitStructBlueprint.setPropertyDifficulty(PropertyDifficulty.MEDIUM.name());
-			paperDetailInfoUnitStructBlueprint.setNumber(paperDetailInfoUnitStructBlueprintDto.getNoPublicMedium());
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-		//非公开困难
-		if(paperDetailInfoUnitStructBlueprintDto.getNoPublicDifficulty() != null){
-			PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint = new PaperDetailInfoUnitStructBlueprint(paperDetailInfoUnitStructBlueprintDto, paperDetailInfoStructBlueprint);
-			paperDetailInfoUnitStructBlueprint.setIsPublic(false);
-			paperDetailInfoUnitStructBlueprint.setPropertyDifficulty(PropertyDifficulty.DIFFICULTY.name());
-			paperDetailInfoUnitStructBlueprint.setNumber(paperDetailInfoUnitStructBlueprintDto.getNoPublicDifficulty());
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-	}
-
-	@Override
-	public PaperDetailInfoStructBlueprintDto findByPaperDetailStructBlueprintId(Long paperDetailStructBlueprintId) {
-		//查询蓝图试卷结构大题详情
-		PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint = paperDetailInfoStructBlueprintRepo.findByPaperDetailStructBlueprintId(paperDetailStructBlueprintId);
-		if(paperDetailInfoStructBlueprint == null){
-			return null;
-		}
-		PaperDetailInfoStructBlueprintDto paperDetailInfoStructBlueprintDto = new PaperDetailInfoStructBlueprintDto(paperDetailInfoStructBlueprint);
-		String[] strsStrings = paperDetailInfoStructBlueprint.getQuesNames().split(",");
-		List<String> quesNames = Arrays.asList(strsStrings);
-		paperDetailInfoStructBlueprintDto.setQuesNames(quesNames);
-		//查询蓝图试卷结构大题详情属性数量
-		List<PaperDetailInfoUnitStructBlueprintDto> paperDetailInfoUnitStructBlueprintDtos = new ArrayList<PaperDetailInfoUnitStructBlueprintDto>();
-		//查询属性树
-		List<PaperDetailInfoUnitStructBlueprint> paperDetailInfoUnitStructBlueprints = paperDetailInfoUnitStructBlueprintRepo.findGroupByPropertyId(paperDetailInfoStructBlueprint.getId(), paperDetailInfoStructBlueprint.getPaperDetailStructBlueprintId());
-		for(PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint:paperDetailInfoUnitStructBlueprints){
-			//根据属性树包装成 PaperDetailInfoUnitStructBlueprintDto 对象
-			PaperDetailInfoUnitStructBlueprintDto paperDetailInfoUnitStructBlueprintDto = buildPaperDetailInfoUnitStructBlueprintDto(paperDetailInfoUnitStructBlueprint);
-			paperDetailInfoUnitStructBlueprintDtos.add(paperDetailInfoUnitStructBlueprintDto);
-		}
-		paperDetailInfoStructBlueprintDto.setPaperDetailInfoUnitStructBlueprintDtos(paperDetailInfoUnitStructBlueprintDtos);
-		return paperDetailInfoStructBlueprintDto;
-	}
-
-	/**
-	 * 根据蓝图试卷结构大题详情属性数量包装成前端需要对象
-	 * @param paperDetailInfoUnitStructBlueprint
-	 */
-	private PaperDetailInfoUnitStructBlueprintDto buildPaperDetailInfoUnitStructBlueprintDto(PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint) {
-		Property property = propertyRepo.findOne(paperDetailInfoUnitStructBlueprint.getPropertyId());
-		PaperDetailInfoUnitStructBlueprintDto paperDetailInfoUnitStructBlueprintDto = new PaperDetailInfoUnitStructBlueprintDto();
-		paperDetailInfoUnitStructBlueprintDto.setPropertyId(property.getId());
-		paperDetailInfoUnitStructBlueprintDto.setPropertyName(property.getName());
-		paperDetailInfoUnitStructBlueprintDto.setPropertyParentId(property.getParentId());
-		//公开简单
-		paperDetailInfoUnitStructBlueprintDto.setPublicSimple(paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty
-				(paperDetailInfoUnitStructBlueprint.getPaperDetailInfoStructBlueprintId(), paperDetailInfoUnitStructBlueprint.getPaperDetailStructBlueprintId(), paperDetailInfoUnitStructBlueprint.getPropertyId(), 
-						true, PropertyDifficulty.SIMPLE.name()).getNumber());
-		//公开中等
-		paperDetailInfoUnitStructBlueprintDto.setPublicMedium(paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty
-				(paperDetailInfoUnitStructBlueprint.getPaperDetailInfoStructBlueprintId(), paperDetailInfoUnitStructBlueprint.getPaperDetailStructBlueprintId(), paperDetailInfoUnitStructBlueprint.getPropertyId(), 
-						true, PropertyDifficulty.MEDIUM.name()).getNumber());
-		//公开困难
-		paperDetailInfoUnitStructBlueprintDto.setPublicDifficulty(paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty
-				(paperDetailInfoUnitStructBlueprint.getPaperDetailInfoStructBlueprintId(), paperDetailInfoUnitStructBlueprint.getPaperDetailStructBlueprintId(), paperDetailInfoUnitStructBlueprint.getPropertyId(), 
-						true, PropertyDifficulty.DIFFICULTY.name()).getNumber());
-		//非公开简单
-		paperDetailInfoUnitStructBlueprintDto.setNoPublicSimple(paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty
-				(paperDetailInfoUnitStructBlueprint.getPaperDetailInfoStructBlueprintId(), paperDetailInfoUnitStructBlueprint.getPaperDetailStructBlueprintId(), paperDetailInfoUnitStructBlueprint.getPropertyId(), 
-						false, PropertyDifficulty.SIMPLE.name()).getNumber());
-		//非公开中等
-		paperDetailInfoUnitStructBlueprintDto.setNoPublicMedium(paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty
-				(paperDetailInfoUnitStructBlueprint.getPaperDetailInfoStructBlueprintId(), paperDetailInfoUnitStructBlueprint.getPaperDetailStructBlueprintId(), paperDetailInfoUnitStructBlueprint.getPropertyId(), 
-						false, PropertyDifficulty.MEDIUM.name()).getNumber());
-		//非公开困难
-		paperDetailInfoUnitStructBlueprintDto.setNoPublicDifficulty(paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintIdAndPropertyIdAndIsPublicAndPropertyDifficulty
-				(paperDetailInfoUnitStructBlueprint.getPaperDetailInfoStructBlueprintId(), paperDetailInfoUnitStructBlueprint.getPaperDetailStructBlueprintId(), paperDetailInfoUnitStructBlueprint.getPropertyId(), 
-						false, PropertyDifficulty.DIFFICULTY.name()).getNumber());
-		paperDetailInfoUnitStructBlueprintDto.setNumber(paperDetailInfoUnitStructBlueprintDto.getPublicSimple() + paperDetailInfoUnitStructBlueprintDto.getPublicMedium()
-				+paperDetailInfoUnitStructBlueprintDto.getPublicDifficulty() + paperDetailInfoUnitStructBlueprintDto.getNoPublicSimple() 
-				+paperDetailInfoUnitStructBlueprintDto.getNoPublicMedium() + paperDetailInfoUnitStructBlueprintDto.getNoPublicDifficulty());
-		//判断这条记录在页面上是否置灰
-		boolean disable = setDisable(property);
-		paperDetailInfoUnitStructBlueprintDto.setDisable(disable);
-		return paperDetailInfoUnitStructBlueprintDto;
-	}
-
-	/**
-	 * 如果父节点下面没有子节点,就置灰
-	 * @param property
-	 * @return
-	 */
-	private boolean setDisable(Property property) {
-		//如果是父节点
-		if(property.getParentId() == 0L){
-			//取到子节点
-			List<Property> propertySonsList = propertyRepo.findByParentIdOrderByNumber(property.getId());
-			if(propertySonsList != null && propertySonsList.size() >0){
-				return true;
-			}else{
-				return false;
-			}
-		}
-		return false;
-	}
-
-	@Override
-	public PaperDetailInfoStructBlueprint getPaperDetailInfoStructBlueprint(Long paperDetailStructBlueprintId) {
-		PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint = paperDetailInfoStructBlueprintRepo.findByPaperDetailStructBlueprintId(paperDetailStructBlueprintId);
-		return paperDetailInfoStructBlueprint;
-	}
-
-	@Override
-	public void deleteSingle(PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint) {
-		paperDetailInfoStructBlueprintRepo.delete(paperDetailInfoStructBlueprint);
-	}
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 42
cqb-paper/src/main/java/com/qmth/cqb/paper/service/impl/PaperDetailInfoUnitStructBlueprintServiceImpl.java

@@ -1,42 +0,0 @@
-package com.qmth.cqb.paper.service.impl;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
-
-import com.qmth.cqb.paper.dao.PaperDetailInfoUnitStructBlueprintRepo;
-import com.qmth.cqb.paper.model.PaperDetailInfoUnitStructBlueprint;
-import com.qmth.cqb.paper.service.PaperDetailInfoUnitStructBlueprintService;
-
-/**
- * @describle 蓝图试卷结构大题详情属性数量  paperDetailInfoUnitStructBlueprintServiceImpl
- * @author weiwenhai
- * @date   2017.11.20
- */
-@Service("paperDetailInfoUnitStructBlueprintService")
-public class PaperDetailInfoUnitStructBlueprintServiceImpl implements PaperDetailInfoUnitStructBlueprintService{
-	
-	@Autowired
-	private PaperDetailInfoUnitStructBlueprintRepo paperDetailInfoUnitStructBlueprintRepo;
-
-	@Override
-	public void saveSingle(PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint) {
-		if(!StringUtils.isEmpty(paperDetailInfoUnitStructBlueprint.getPropertyId())){
-			paperDetailInfoUnitStructBlueprintRepo.save(paperDetailInfoUnitStructBlueprint);
-		}
-	}
-
-	@Override
-	public List<PaperDetailInfoUnitStructBlueprint> getPaperDetailInfoUnitStructBlueprint(Long paperDetailInfoStructBlueprintId, Long paperDetailStructBlueprintId) {
-		List<PaperDetailInfoUnitStructBlueprint> paperDetailInfoUnitStructBlueprints = paperDetailInfoUnitStructBlueprintRepo.findByPaperDetailInfoStructBlueprintIdAndPaperDetailStructBlueprintId(paperDetailInfoStructBlueprintId, paperDetailStructBlueprintId);
-		return paperDetailInfoUnitStructBlueprints;
-	}
-
-	@Override
-	public void deleteSingle(PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint) {
-		paperDetailInfoUnitStructBlueprintRepo.delete(paperDetailInfoUnitStructBlueprint);
-	}
-
-}

+ 0 - 72
cqb-paper/src/main/java/com/qmth/cqb/paper/service/impl/PaperDetailStructBlueprintServiceImpl.java

@@ -1,72 +0,0 @@
-package com.qmth.cqb.paper.service.impl;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
-
-import com.qmth.cqb.paper.dao.PaperDetailStructBlueprintRepo;
-import com.qmth.cqb.paper.model.PaperDetailInfoStructBlueprint;
-import com.qmth.cqb.paper.model.PaperDetailInfoUnitStructBlueprint;
-import com.qmth.cqb.paper.model.PaperDetailStructBlueprint;
-import com.qmth.cqb.paper.service.PaperDetailInfoStructBlueprintService;
-import com.qmth.cqb.paper.service.PaperDetailInfoUnitStructBlueprintService;
-import com.qmth.cqb.paper.service.PaperDetailStructBlueprintService;
-
-/**
- * @describle 蓝图试卷结构大题 paperDetailStructBlueprintServiceImpl
- * @author weiwenhai
- * @date   2017.11.20
- */
-@Service("paperDetailStructBlueprintService")
-public class PaperDetailStructBlueprintServiceImpl implements PaperDetailStructBlueprintService{
-
-	@Autowired
-	private PaperDetailStructBlueprintRepo paperDetailStructBlueprintRepo;
-	
-	@Autowired
-	private PaperDetailInfoStructBlueprintService paperDetailInfoStructBlueprintService;
-	
-	@Autowired
-	private PaperDetailInfoUnitStructBlueprintService paperDetailInfoUnitStructBlueprintService;
-	
-	@Override
-	public List<PaperDetailStructBlueprint> findAll(Long paperStructBlueprintId) {
-		List<PaperDetailStructBlueprint> paperDetailStructBlueprints = paperDetailStructBlueprintRepo.findByPaperStructBlueprintId(paperStructBlueprintId);
-		return paperDetailStructBlueprints;
-	}
-
-	@Override
-	public List<PaperDetailStructBlueprint> findSaveAll(Long userId, Long paperStructBlueprintId) {
-		List<PaperDetailStructBlueprint> paperDetailStructBlueprints = paperDetailStructBlueprintRepo.findByUserIdAndPaperStructBlueprintId(userId, paperStructBlueprintId);
-		return paperDetailStructBlueprints;
-	}
-	
-	@Override
-	public void saveSingle(PaperDetailStructBlueprint paperDetailStructBlueprint) {
-		if(!StringUtils.isEmpty(paperDetailStructBlueprint.getName())){
-			paperDetailStructBlueprintRepo.save(paperDetailStructBlueprint);
-		}
-	}
-
-	@Override
-	public void deleteSingle(Long id) {
-		//查询大题
-		PaperDetailStructBlueprint paperDetailStructBlueprint = paperDetailStructBlueprintRepo.findOne(id);
-		//查询大题详情
-		PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint = paperDetailInfoStructBlueprintService.getPaperDetailInfoStructBlueprint(id);
-		//查询大题详情属性
-		List<PaperDetailInfoUnitStructBlueprint> paperDetailInfoUnitStructBlueprints = paperDetailInfoUnitStructBlueprintService.getPaperDetailInfoUnitStructBlueprint(paperDetailInfoStructBlueprint.getId(), id);
-		if(paperDetailInfoUnitStructBlueprints != null && paperDetailInfoUnitStructBlueprints.size() >0){
-			for(PaperDetailInfoUnitStructBlueprint paperDetailInfoUnitStructBlueprint:paperDetailInfoUnitStructBlueprints){
-				paperDetailInfoUnitStructBlueprintService.deleteSingle(paperDetailInfoUnitStructBlueprint);
-			}
-		}
-		if(paperDetailInfoStructBlueprint != null){
-			paperDetailInfoStructBlueprintService.deleteSingle(paperDetailInfoStructBlueprint);
-		}
-		paperDetailStructBlueprintRepo.delete(paperDetailStructBlueprint);
-	}
-
-}

+ 0 - 129
cqb-paper/src/main/java/com/qmth/cqb/paper/service/impl/PaperStructBlueprintServiceImpl.java

@@ -1,129 +0,0 @@
-package com.qmth.cqb.paper.service.impl;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import javax.persistence.criteria.Predicate;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.Pageable;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
-
-import com.qmth.cqb.paper.dao.PaperDetailInfoStructBlueprintRepo;
-import com.qmth.cqb.paper.dao.PaperDetailStructBlueprintRepo;
-import com.qmth.cqb.paper.dao.PaperStructBlueprintRepo;
-import com.qmth.cqb.paper.dto.PaperStructBlueprintDto;
-import com.qmth.cqb.paper.model.PaperDetailInfoStructBlueprint;
-import com.qmth.cqb.paper.model.PaperDetailStructBlueprint;
-import com.qmth.cqb.paper.model.PaperStructBlueprint;
-import com.qmth.cqb.paper.service.PaperDetailStructBlueprintService;
-import com.qmth.cqb.paper.service.PaperStructBlueprintService;
-
-/**
- * @describle 蓝图试卷结构  coursePropertyServiceImpl
- * @author weiwenhai
- * @date   2017.11.17
- */
-@Service("paperStructBlueprintService")
-public class PaperStructBlueprintServiceImpl implements PaperStructBlueprintService {
-
-	@Autowired
-	private PaperStructBlueprintRepo paperStructBlueprintRepo;
-	
-	@Autowired
-	private PaperDetailStructBlueprintRepo paperDetailStructBlueprintRepo;
-	
-	@Autowired
-	private PaperDetailInfoStructBlueprintRepo paperDetailInfoStructBlueprintRepo;
-	
-	@Autowired
-	private PaperDetailStructBlueprintService paperDetailStructBlueprintService;
-	
-	@Override
-	public Page<PaperStructBlueprint> findAll(PaperStructBlueprintDto paperStructBlueprintDto, Pageable pageable) {
-		Specification<PaperStructBlueprint> specification = getSpecification(paperStructBlueprintDto);
-		Page<PaperStructBlueprint> paperStructBlueprintsPage = paperStructBlueprintRepo.findAll(specification, pageable);
-		return paperStructBlueprintsPage;
-	}
-
-	private Specification<PaperStructBlueprint> getSpecification(PaperStructBlueprintDto paperStructBlueprintDto) {
-		PaperStructBlueprint paperStructBlueprint = new PaperStructBlueprint(paperStructBlueprintDto);
-		Specification<PaperStructBlueprint> specification = (root, query, cb) -> {
-			List<Predicate> predicates = new ArrayList<>();
-			if(!StringUtils.isEmpty(paperStructBlueprint.getId())){
-				predicates.add(cb.equal(root.get("orgId"),paperStructBlueprint.getOrgId()));
-			}
-			if(!StringUtils.isEmpty(paperStructBlueprint.getName())){
-		    	predicates.add(cb.like(root.get("name"),"%"+paperStructBlueprint.getName()+"%"));
-		    }
-			if(!StringUtils.isEmpty(paperStructBlueprint.getCourseNo())){
-		    	predicates.add(cb.equal(root.get("courseNo"),paperStructBlueprint.getCourseNo()));
-		    }
-			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
-		};
-		return specification;
-	}
-
-	@Override
-	public void saveSingle(PaperStructBlueprintDto paperStructBlueprintDto, String PaperDetailIds) {
-		PaperStructBlueprint paperStructBlueprint = new PaperStructBlueprint(paperStructBlueprintDto);
-		List<Long> ids = Stream.of(PaperDetailIds.split(",")).map(s->Long.parseLong(s.trim())).collect(Collectors.toList());
-		if(ids == null || ids.size()<0){
-			paperStructBlueprint.setDetailCount(0);
-		}else{
-			paperStructBlueprint.setDetailCount(ids.size());
-			//计算试卷结构难度
-			Double difficulty = getDifficulty(ids);
-			paperStructBlueprint.setDifficulty(difficulty);
-			paperStructBlueprint.setCreateTime(new Date());
-			paperStructBlueprint = paperStructBlueprintRepo.save(paperStructBlueprint);
-			for(Long id:ids){
-				PaperDetailStructBlueprint paperDetailStructBlueprint = paperDetailStructBlueprintRepo.findOne(id);
-				paperDetailStructBlueprint.setPaperStructBlueprintId(paperStructBlueprint.getId());
-				paperDetailStructBlueprintRepo.save(paperDetailStructBlueprint);
-			}
-		}
-	}
-
-	@Override
-	public Double getDifficulty(List<Long> ids) {
-		if(ids != null && ids.size() >0){
-			Integer simpleCount = 0;
-			Integer mediumCount = 0;
-			Integer difficultyCount = 0;
-			for(Long id:ids){
-				PaperDetailInfoStructBlueprint paperDetailInfoStructBlueprint = paperDetailInfoStructBlueprintRepo.findByPaperDetailStructBlueprintId(id);
-				simpleCount = paperDetailInfoStructBlueprint.getPublicSimpleCount() + paperDetailInfoStructBlueprint.getNoPublicSimpleCount();
-				mediumCount = paperDetailInfoStructBlueprint.getPublicMediumCount() + paperDetailInfoStructBlueprint.getNoPublicMediumCount();
-				difficultyCount = paperDetailInfoStructBlueprint.getPublicDifficultyCount() + paperDetailInfoStructBlueprint.getNoPublicDifficultyCount();
-			}
-			Double difficulty = ((simpleCount * 0.8) + (mediumCount * 0.5) + (difficultyCount * 0.2))/(simpleCount + mediumCount + difficultyCount);
-			return difficulty;
-		}
-		return (double)0;
-	}
-
-	@Override
-	public void deleteSingle(Long id) {
-		//查询大题数量
-		List<PaperDetailStructBlueprint> paperDetailStructBlueprints = paperDetailStructBlueprintRepo.findByPaperStructBlueprintId(id);
-		for(PaperDetailStructBlueprint paperDetailStructBlueprint:paperDetailStructBlueprints){
-			//删除每个大题下面的小题
-			paperDetailStructBlueprintService.deleteSingle(paperDetailStructBlueprint.getId());
-		}
-		paperStructBlueprintRepo.delete(id);
-	}
-
-	@Override
-	public List<PaperStructBlueprint> findByCourseNo(String courseNo) {
-		List<PaperStructBlueprint> paperStructBlueprints = paperStructBlueprintRepo.findByCourseNo(courseNo);
-		return paperStructBlueprints;
-	}
-
-}

+ 0 - 55
cqb-paper/src/main/java/com/qmth/cqb/paper/web/PaperDetailInfoStructBlueprintController.java

@@ -1,55 +0,0 @@
-package com.qmth.cqb.paper.web;
-
-import javax.servlet.http.HttpServletRequest;
-
-import io.swagger.annotations.ApiOperation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
-
-import com.qmth.cqb.paper.dto.PaperDetailInfoStructBlueprintDto;
-import com.qmth.cqb.paper.service.PaperDetailInfoStructBlueprintService;
-
-/**
- * @describle 蓝图试卷结构大题详情 controller
- * @author Administrator
- * @date   2017.11.20
- */
-@Controller
-@RequestMapping("${api_cqb}/")
-public class PaperDetailInfoStructBlueprintController {
-	
-	@Autowired
-	private PaperDetailInfoStructBlueprintService paperDetailInfoStructBlueprintService;
-
-	@ApiOperation(value="保存蓝图试卷结构大题详情" , notes="保存蓝图试卷结构大题详情")
-	@PostMapping(value="/paperDetailInfoStructBlueprint/save")
-	public ResponseEntity<Object> saveDto(HttpServletRequest request,@RequestBody PaperDetailInfoStructBlueprintDto paperDetailInfoStructBlueprintDto){
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if(accessUser == null){
-			return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-		}
-		paperDetailInfoStructBlueprintService.saveDto(paperDetailInfoStructBlueprintDto);
-		return new ResponseEntity<Object>(HttpStatus.OK);
-	}
-	
-	@ApiOperation(value="根据蓝图试卷结构大题Id查询大题详情", notes="不带分页")
-	@GetMapping(value="/paperDetailInfoStructBlueprint/{paperDetailStructBlueprintId}")
-	public ResponseEntity<Object> findByPaperDetailStructBlueprintId(HttpServletRequest request,@PathVariable Long paperDetailStructBlueprintId){
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if(accessUser == null){
-			return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-		}
-		PaperDetailInfoStructBlueprintDto paperDetailInfoStructBlueprintDto = paperDetailInfoStructBlueprintService.findByPaperDetailStructBlueprintId(paperDetailStructBlueprintId);
-		return new ResponseEntity<Object>(paperDetailInfoStructBlueprintDto,HttpStatus.OK);
-	}
-}

+ 0 - 95
cqb-paper/src/main/java/com/qmth/cqb/paper/web/PaperDetailStructBlueprintController.java

@@ -1,95 +0,0 @@
-package com.qmth.cqb.paper.web;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import io.swagger.annotations.ApiOperation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
-
-import com.qmth.cqb.paper.model.PaperDetailStructBlueprint;
-import com.qmth.cqb.paper.service.PaperDetailStructBlueprintService;
-
-/**
- * @describle 蓝图试卷结构大题 PaperDetailStructBlueprintController
- * @author weiwenhai
- * @date   2017.11.20
- */
-@Controller
-@RequestMapping("${api_cqb}/")
-public class PaperDetailStructBlueprintController {
-
-	@Autowired
-	private PaperDetailStructBlueprintService paperDetailStructBlueprintService;
-	
-	@ApiOperation(value="根据蓝图试卷结构id查询所有大题", notes="不带分页")
-	@GetMapping(value="/paperDetailStructBlueprint/all/{paperStructBlueprintId}")
-	public ResponseEntity<Object> findAll(HttpServletRequest request, @PathVariable Long paperStructBlueprintId){
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if(accessUser == null){
-			return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-		}
-		List<PaperDetailStructBlueprint> paperDetailStructBlueprints = paperDetailStructBlueprintService.findAll(paperStructBlueprintId);
-		return new ResponseEntity<Object>(paperDetailStructBlueprints,HttpStatus.OK);
-	}
-	
-	@ApiOperation(value="查询新增的大题,无试卷结构id", notes="不带分页")
-	@GetMapping(value="/paperDetailStructBlueprint/all")
-	public ResponseEntity<Object> findSaveAll(HttpServletRequest request){
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if(accessUser == null){
-			return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-		}
-		List<PaperDetailStructBlueprint> paperDetailStructBlueprints = paperDetailStructBlueprintService.findSaveAll(accessUser.getUserId(), null);
-		return new ResponseEntity<Object>(paperDetailStructBlueprints,HttpStatus.OK);
-	}
-	
-	@ApiOperation(value="保存新增的单个大题", notes="保存新增的单个大题")
-	@PostMapping(value="/paperDetailStructBlueprint/save")
-	public ResponseEntity<Object> saveSingle(HttpServletRequest request,@RequestBody PaperDetailStructBlueprint paperDetailStructBlueprint){
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if(accessUser == null){
-			return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-		}
-		//paperDetailStructBlueprint.setType("specifics");//细节
-		paperDetailStructBlueprint.setUserId(accessUser.getUserId());
-		paperDetailStructBlueprintService.saveSingle(paperDetailStructBlueprint);
-		return new ResponseEntity<Object>(HttpStatus.OK);
-	}
-	
-	@ApiOperation(value="保存修改的单个大题", notes="保存修改的单个大题")
-	@PutMapping(value="/paperDetailStructBlueprint/update")
-	public ResponseEntity<Object> updateSingle(HttpServletRequest request,@RequestBody PaperDetailStructBlueprint paperDetailStructBlueprint){
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if(accessUser == null){
-			return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-		}
-		paperDetailStructBlueprint.setUserId(accessUser.getUserId());
-		paperDetailStructBlueprintService.saveSingle(paperDetailStructBlueprint);
-		return new ResponseEntity<Object>(HttpStatus.OK);
-	}
-	
-	@ApiOperation(value="删除单个大题", notes="删除单个大题")
-	@DeleteMapping(value="/paperDetailStructBlueprint/delete/{id}")
-	public ResponseEntity<Object> deleteSingle(HttpServletRequest request,@PathVariable Long id){
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if(accessUser == null){
-			return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-		}
-		paperDetailStructBlueprintService.deleteSingle(id);
-		return new ResponseEntity<Object>(HttpStatus.OK);
-	}
-}

+ 0 - 105
cqb-paper/src/main/java/com/qmth/cqb/paper/web/PaperStructBlueprintController.java

@@ -1,105 +0,0 @@
-package com.qmth.cqb.paper.web;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import io.swagger.annotations.ApiOperation;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
-
-import com.qmth.cqb.paper.dao.PaperStructBlueprintRepo;
-import com.qmth.cqb.paper.dto.PaperStructBlueprintDto;
-import com.qmth.cqb.paper.model.PaperStructBlueprint;
-import com.qmth.cqb.paper.service.PaperStructBlueprintService;
-
-/**
- * @describle 蓝图试卷结构controller
- * @author weiwenhai
- * @date   2017.11.17
- */
-@Controller
-@RequestMapping("${api_cqb}/")
-public class PaperStructBlueprintController {
-	
-	@Autowired
-	private PaperStructBlueprintService paperStructBlueprintService;
-	
-	@Autowired
-	private PaperStructBlueprintRepo paperStructBlueprintRepo;
-
-	@ApiOperation(value="查询所有蓝图试卷结构", notes="带分页")
-	@GetMapping(value="/paperStructBlueprint/all/{curPage}/{pageSize}")
-	public ResponseEntity<Object> findAll(@ModelAttribute PaperStructBlueprintDto paperStructBlueprintDto,
-										  @PathVariable Integer curPage,
-										  @PathVariable Integer pageSize,
-										  HttpServletRequest request){
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if(accessUser == null){
-			 return new ResponseEntity(HttpStatus.NOT_FOUND);
-		 }
-		paperStructBlueprintDto.setOrgId(accessUser.getRootOrgId());
-		Page<PaperStructBlueprint> paperStructBlueprintPage = paperStructBlueprintService.findAll(paperStructBlueprintDto, new PageRequest(curPage-1, pageSize));
-		return new ResponseEntity<Object>(paperStructBlueprintPage,HttpStatus.OK);
-	}
-	
-	@ApiOperation(value="保存试卷结构", notes="保存试卷结构")
-	@PostMapping(value="/paperStructBlueprint/save/{ids}")
-	public ResponseEntity<Object> saveSingle(HttpServletRequest request, @PathVariable String ids, @RequestBody PaperStructBlueprintDto paperStructBlueprintDto){
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if(accessUser != null){
-			paperStructBlueprintDto.setCreator(accessUser.getName());
-			paperStructBlueprintDto.setOrgId(accessUser.getRootOrgId());
-			paperStructBlueprintService.saveSingle(paperStructBlueprintDto, ids);
-			return new ResponseEntity<Object>(HttpStatus.OK);
-		}
-		return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-	}
-	
-	@ApiOperation(value="根据id查询试卷结构", notes="根据id查询试卷结构")
-	@GetMapping(value="/paperStructBlueprint/findOne/{id}")
-	public ResponseEntity<Object> findOne(HttpServletRequest request,@PathVariable Long id){
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if(accessUser != null){
-			PaperStructBlueprint paperStructBlueprint = paperStructBlueprintRepo.findOne(id);
-			return new ResponseEntity<Object>(paperStructBlueprint,HttpStatus.OK);
-		}
-		return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-	}
-	
-	@ApiOperation(value="根据id删除试卷结构", notes="根据id删除试卷结构")
-	@DeleteMapping(value="/paperStructBlueprint/delete/{id}")
-	public ResponseEntity<Object> deleteSingle(HttpServletRequest request,@PathVariable Long id){
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if(accessUser != null){
-			paperStructBlueprintService.deleteSingle(id);
-			return new ResponseEntity<Object>(HttpStatus.OK);
-		}
-		return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-	}
-	
-	@ApiOperation(value="根据课程代码查询试卷结构", notes="根据课程代码查询试卷结构")
-	@GetMapping(value="/paperStructBlueprint/findByCourseNo/{courseNo}")
-	public ResponseEntity<Object> findByCourseNo(HttpServletRequest request, @PathVariable String courseNo){
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if(accessUser != null){
-			List<PaperStructBlueprint> paperStructBlueprints = paperStructBlueprintService.findByCourseNo(courseNo);
-			return new ResponseEntity<Object>(paperStructBlueprints,HttpStatus.OK);
-		}
-		return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-	}
-}