@@ -2,6 +2,13 @@ package cn.com.taiji.core.repo.jpa.managew; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.managew.KnowledgeAfterSaleAudit; | |||
import org.springframework.data.jpa.repository.Query; | |||
import java.util.List; | |||
public interface KnowledgeAfterSaleAuditRepo extends AbstractJpaRepo<KnowledgeAfterSaleAudit, String> { | |||
@Query("select distinct category from KnowledgeAfterSaleAudit") | |||
List<String> findAllCategory(); | |||
} |
@@ -2,6 +2,13 @@ package cn.com.taiji.core.repo.jpa.managew; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.managew.KnowledgeBusinessInfo; | |||
import org.springframework.data.jpa.repository.Query; | |||
import java.util.List; | |||
public interface KnowledgeBusinessInfoRepo extends AbstractJpaRepo<KnowledgeBusinessInfo, String> { | |||
@Query("select distinct businessType from KnowledgeBusinessInfo") | |||
List<String> findAllBusinessType(); | |||
} |
@@ -2,6 +2,21 @@ package cn.com.taiji.core.repo.jpa.managew; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.managew.KnowledgeWorkOrderProcess; | |||
import org.springframework.data.jpa.repository.Query; | |||
import javax.persistence.Column; | |||
import java.util.List; | |||
public interface KnowledgeWorkOrderProcessRepo extends AbstractJpaRepo<KnowledgeWorkOrderProcess, String> { | |||
@Query("select distinct level1 from KnowledgeWorkOrderProcess") | |||
List<String> findAllLevel1(); | |||
@Query("select distinct level2 from KnowledgeWorkOrderProcess where level1 = ?1") | |||
List<String> findAllLevel2(String level1); | |||
@Query("select distinct level3 from KnowledgeWorkOrderProcess where level1 = ?1 and level2 = ?2") | |||
List<String> findAllLevel3(String level1, String level2); | |||
} |
@@ -84,4 +84,11 @@ public class KnowledgeBaseController extends MyValidController { | |||
return ApiResponse.of(res); | |||
} | |||
@ApiOperation(value = "知识库-类型查询") | |||
@PostMapping(value = "/typeQuery") | |||
public ApiResponse<KnowledgeTypeResponseDTO> typeQuery(@Valid @RequestBody KnowledgeTypeRequestDTO reqDto) throws ManagerException { | |||
KnowledgeTypeResponseDTO res = manager.typeQuery(reqDto); | |||
return ApiResponse.of(res); | |||
} | |||
} |
@@ -22,5 +22,6 @@ public class AfterSalesOrderReviewQueryRequestDTO extends AbstractBizRequestDTO | |||
private String level1; | |||
@ApiModelProperty(value = "搜索") | |||
private String other; | |||
private int pageNo; | |||
private int pageSize; | |||
} |
@@ -21,4 +21,7 @@ public class BusinessProcessQueryRequestDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "搜索内容") | |||
private String other; | |||
private int pageNo; | |||
private int pageSize; | |||
} |
@@ -0,0 +1,22 @@ | |||
package cn.com.taiji.iaw.dto.ass.knowledgeBase; | |||
import org.springframework.validation.annotation.Validated; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
@ApiModel(description = "知识库") | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
@Validated | |||
public class KnowledgeTypeRequestDTO extends AbstractBizRequestDTO { | |||
@ApiModelProperty(value = "ID",required = true) | |||
private int type; | |||
} |
@@ -0,0 +1,21 @@ | |||
package cn.com.taiji.iaw.dto.ass.knowledgeBase; | |||
import java.util.List; | |||
import org.springframework.validation.annotation.Validated; | |||
import io.swagger.annotations.ApiModel; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
@ApiModel(description = "知识库返回") | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
@Validated | |||
public class KnowledgeTypeResponseDTO { | |||
private List<String> typeList; | |||
} |
@@ -28,5 +28,8 @@ public class WorkOrderProcessQueryRequestDTO extends AbstractBizRequestDTO { | |||
private String line1; | |||
@ApiModelProperty(value = "二线搜索") | |||
private String line2; | |||
private int pageNo; | |||
private int pageSize; | |||
} |
@@ -22,6 +22,6 @@ public interface KnowledgeBaseManager { | |||
Pagination afterSalesOrderReviewQuery(@Valid AfterSalesOrderReviewQueryRequestDTO reqDto) throws ManagerException; | |||
AfterSalesOrderReviewViewResponseDTO afterSalesOrderReviewView(@Valid KnowledgeBaseViewRequestDTO reqDto) throws ManagerException; | |||
KnowledgeBaseResponseDTO afterSalesOrderReviewFeedback(@Valid KnowledgeBaseFeedbackRequestDTO reqDto) throws ManagerException; | |||
// 查询类型 | |||
KnowledgeTypeResponseDTO typeQuery(KnowledgeTypeRequestDTO requestDTO); | |||
} |
@@ -1,41 +1,18 @@ | |||
package cn.com.taiji.iaw.manager.ass; | |||
import java.io.FileNotFoundException; | |||
import java.io.IOException; | |||
import java.io.InputStream; | |||
import java.net.MalformedURLException; | |||
import java.net.URL; | |||
import java.net.URLEncoder; | |||
import java.time.LocalDate; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import cn.com.taiji.iaw.dto.ass.knowledgeBase.*; | |||
import cn.com.taiji.iaw.manager.AbstractCommManager; | |||
import org.apache.poi.hssf.usermodel.HSSFWorkbook; | |||
import org.apache.poi.ss.usermodel.*; | |||
import org.apache.poi.xssf.usermodel.XSSFWorkbook; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import com.google.common.collect.Lists; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.pub.BeanTools; | |||
import cn.com.taiji.common.pub.StringTools; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import cn.com.taiji.core.entity.dict.KnowlegdeType; | |||
import cn.com.taiji.core.entity.dict.basic.SourceType; | |||
import cn.com.taiji.core.entity.managew.KnowledgeAfterSaleAudit; | |||
import cn.com.taiji.core.entity.managew.KnowledgeBusinessInfo; | |||
import cn.com.taiji.core.entity.managew.KnowledgeFileInfo; | |||
import cn.com.taiji.core.entity.managew.KnowledgeWorkOrderProcess; | |||
import cn.com.taiji.core.model.comm.protocol.valid.GlyServiceError; | |||
import cn.com.taiji.core.repo.jpa.managew.KnowledgeAfterSaleAuditRepo; | |||
import cn.com.taiji.core.repo.jpa.managew.KnowledgeBusinessInfoRepo; | |||
import cn.com.taiji.core.repo.jpa.managew.KnowledgeFileInfoRepo; | |||
@@ -43,6 +20,8 @@ import cn.com.taiji.core.repo.jpa.managew.KnowledgeWorkOrderProcessRepo; | |||
import cn.com.taiji.core.repo.request.managew.KnowledgeAfterSaleAuditPageRequest; | |||
import cn.com.taiji.core.repo.request.managew.KnowledgeBusinessInfoPageRequest; | |||
import cn.com.taiji.core.repo.request.managew.KnowledgeWorkOrderProcessPageRequest; | |||
import cn.com.taiji.iaw.dto.ass.knowledgeBase.*; | |||
import cn.com.taiji.iaw.manager.AbstractCommManager; | |||
@Service | |||
public class KnowledgeBaseManagerImpl extends AbstractCommManager implements KnowledgeBaseManager { | |||
@@ -176,5 +155,19 @@ public class KnowledgeBaseManagerImpl extends AbstractCommManager implements Kno | |||
} | |||
} | |||
@Override | |||
public KnowledgeTypeResponseDTO typeQuery(KnowledgeTypeRequestDTO requestDTO) { | |||
int type = requestDTO.getType(); | |||
KnowledgeTypeResponseDTO res = new KnowledgeTypeResponseDTO(); | |||
if (type == 1){ | |||
res.setTypeList(workOrderProcessRepo.findAllLevel1()); | |||
}else if (type == 2){ | |||
res.setTypeList(businessInfoRepo.findAllBusinessType()); | |||
}else if (type == 3){ | |||
res.setTypeList(afterSaleAuditRepo.findAllCategory()); | |||
} | |||
return res; | |||
} | |||
} |