导出添加
This commit is contained in:
11
pom.xml
11
pom.xml
@ -71,7 +71,16 @@
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<version>2.2.3.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>5.2.5</version> <!-- 可选最新版 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>3.3.2</version> <!-- 推荐使用最新版或与Spring Boot兼容的稳定版本 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.chinaunicom.zyhy.ebtp.supplier.coscoEvaluate.controller;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.chinaunicom.mall.ebtp.common.base.controller.BaseController;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
@ -11,6 +12,9 @@ import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@ -35,6 +39,24 @@ public class CoscoEvaluateTaskSupplierController extends BaseController {
|
||||
return BaseResponse.success(coscoEvaluateTaskSupplierService.getPage(taskListVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出供应商评价
|
||||
* @param taskListVo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void export(HttpServletResponse response, CoscoEvaluateTaskSupplier taskListVo) throws Exception {
|
||||
List<CoscoEvaluateTaskSupplier> list=coscoEvaluateTaskSupplierService.export(taskListVo);
|
||||
String fileName = URLEncoder.encode("供应商信息.xlsx", "UTF-8");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
||||
response.setCharacterEncoding("utf-8");
|
||||
|
||||
EasyExcel.write(response.getOutputStream(), CoscoEvaluateTaskSupplier.class)
|
||||
.sheet("供应商列表")
|
||||
.doWrite(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getScoreResult")
|
||||
public BaseResponse getScoreResult(String id) {
|
||||
|
@ -99,4 +99,11 @@ public interface CoscoEvaluateTaskSupplierMapper {
|
||||
* @return
|
||||
*/
|
||||
IPage<SupplierEvaluateStatisticsVo> getSupplierEvaluateStatistics(IPage<CoscoEvaluateTaskListVo> p,@Param("vo") SupplierEvaluateStatisticsVo vo);
|
||||
|
||||
/**
|
||||
* 获取导出列表
|
||||
* @param taskListVo
|
||||
* @return
|
||||
*/
|
||||
List<CoscoEvaluateTaskSupplier> exportList(CoscoEvaluateTaskSupplier taskListVo);
|
||||
}
|
||||
|
@ -41,6 +41,46 @@
|
||||
from cosco_evaluate_task_supplier
|
||||
</sql>
|
||||
|
||||
<select id="exportList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscoEvaluate.entity.CoscoEvaluateTaskSupplier" resultMap="CoscoEvaluateTaskSupplierResult">
|
||||
select cets.id,
|
||||
cets.evaluate_task_id,
|
||||
cets.level_name,
|
||||
cets.rating_name,
|
||||
cets.supplier_id,
|
||||
cets.review_score,
|
||||
cets.review_result,
|
||||
cets.del_flag,
|
||||
cet.dept_id,
|
||||
cets.create_by,
|
||||
cets.create_time,
|
||||
cets.update_by,
|
||||
cets.update_time,
|
||||
cc.category_name ,
|
||||
cets.last_update_time,
|
||||
csb.name as supplier_name
|
||||
from cosco_evaluate_task_supplier cets
|
||||
left join cosco_supplier_base csb on csb.id = cets.supplier_id
|
||||
left join cosco_evaluate_task cet on cet.id = cets.evaluate_task_id
|
||||
left join cosco_category cc on cc.id = cet.category_id
|
||||
<where>
|
||||
and cets.del_flag = 'normal'
|
||||
<if test="evaluateTaskId != null and evaluateTaskId != ''">
|
||||
and cets.evaluate_task_id = #{evaluateTaskId}
|
||||
</if>
|
||||
<if test="supplierId != null and supplierId != ''">
|
||||
and cets.supplier_id = #{supplierId}
|
||||
</if>
|
||||
<if test="reviewScore != null ">
|
||||
and cets.review_score = #{reviewScore}
|
||||
</if>
|
||||
<if test="reviewResult != null ">
|
||||
and cets.review_result = #{reviewResult}
|
||||
</if>
|
||||
<if test="lastUpdateTime != null ">
|
||||
and cets.last_update_time = #{lastUpdateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getPage"
|
||||
parameterType="map"
|
||||
|
@ -3,6 +3,7 @@ package com.chinaunicom.zyhy.ebtp.supplier.coscoEvaluate.entity;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseEntity;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BasePageRequest;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@ -25,7 +26,27 @@ public class CoscoEvaluateTaskSupplier extends BaseEntity {
|
||||
* 主键ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
@ExcelProperty("供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
/**
|
||||
* 类目名称
|
||||
*/
|
||||
@ExcelProperty("品类")
|
||||
private String categoryName;
|
||||
/**
|
||||
* 年审最终评价得分
|
||||
*/
|
||||
@ExcelProperty("评价得分")
|
||||
private BigDecimal reviewScore;
|
||||
/**
|
||||
* 年审最终结果(评价等级A、B、C)
|
||||
*/
|
||||
@ExcelProperty("评价等级")
|
||||
private String reviewResult;
|
||||
/**
|
||||
* 评价任务id(cosco_evaluate_task表主键)
|
||||
*/
|
||||
@ -36,15 +57,6 @@ public class CoscoEvaluateTaskSupplier extends BaseEntity {
|
||||
*/
|
||||
private String supplierId;
|
||||
|
||||
/**
|
||||
* 年审最终评价得分
|
||||
*/
|
||||
private BigDecimal reviewScore;
|
||||
|
||||
/**
|
||||
* 年审最终结果(评价等级A、B、C)
|
||||
*/
|
||||
private String reviewResult;
|
||||
/**
|
||||
* 等级名称(A级、B级、C级、D级)
|
||||
*/
|
||||
@ -62,14 +74,8 @@ public class CoscoEvaluateTaskSupplier extends BaseEntity {
|
||||
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supplierName;
|
||||
/**
|
||||
* 类目名称
|
||||
*/
|
||||
private String categoryName;
|
||||
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
|
@ -71,4 +71,11 @@ public interface ICoscoEvaluateTaskSupplierService {
|
||||
IPage<CoscoEvaluateTaskSupplier> getPage(CoscoEvaluateTaskSupplier taskListVo);
|
||||
|
||||
Object getScoreResult(String id);
|
||||
|
||||
/**
|
||||
* 获取供应商审批导出
|
||||
* @param taskListVo
|
||||
* @return
|
||||
*/
|
||||
List<CoscoEvaluateTaskSupplier> export(CoscoEvaluateTaskSupplier taskListVo);
|
||||
}
|
||||
|
@ -137,6 +137,18 @@ public class CoscoEvaluateTaskSupplierServiceImpl implements ICoscoEvaluateTaskS
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商审批导出
|
||||
* @param taskListVo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CoscoEvaluateTaskSupplier> export(CoscoEvaluateTaskSupplier taskListVo){
|
||||
return coscoEvaluateTaskSupplierMapper.exportList(taskListVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public TaskIndicatorBaseVo getScoreResult(String id) {
|
||||
CoscoEvaluateTaskSupplier coscoEvaluateTaskSupplier = coscoEvaluateTaskSupplierMapper.selectCoscoEvaluateTaskSupplierById(id);
|
||||
|
Reference in New Issue
Block a user