Merge branch 'master-高质量运营2' into uat_code
# Conflicts: # src/main/java/com/chinaunicom/mall/ebtp/extend/highquality/controller/HighQualityClientController.java # src/main/java/com/chinaunicom/mall/ebtp/extend/highquality/controller/HighQualityMaintainController.java # src/main/java/com/chinaunicom/mall/ebtp/extend/highquality/dao/mapper/HighQualityCommentMapper.xml # src/main/java/com/chinaunicom/mall/ebtp/extend/highquality/entity/HighQualityComment.java # src/main/java/com/chinaunicom/mall/ebtp/extend/highquality/service/impl/HighQualityCommentServiceImpl.java # src/main/java/com/chinaunicom/mall/ebtp/extend/uploadOss/service/impl/UploadOssServiceImpl.java
This commit is contained in:
@ -1,14 +1,19 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.highquality.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.entity.*;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.service.*;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.vo.HighQualityQueryInVO;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventContactSuggestion;
|
||||
import com.chinaunicom.mall.ebtp.extend.signature.entity.ExpertSignature;
|
||||
import com.chinaunicom.mall.ebtp.extend.uploadOss.service.IUploadOssService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@ -35,7 +40,8 @@ public class HighQualityClientController {
|
||||
private HighQualityCommentService highQualityCommentService;
|
||||
@Resource
|
||||
private IUploadOssService iUploadOssService;
|
||||
|
||||
@Resource
|
||||
private IHighQualityContactSuggestionService highQualityContactSuggestionService;
|
||||
|
||||
@ApiOperation("右侧专业线数据")
|
||||
@GetMapping("/data/list")
|
||||
@ -86,11 +92,22 @@ public class HighQualityClientController {
|
||||
return highQualityLikesService.saveLikes(inVO);
|
||||
}
|
||||
|
||||
@ApiOperation("评论")
|
||||
@ApiOperation("保存评论")
|
||||
@PostMapping("/saveComment")
|
||||
public BaseResponse saveComment(@RequestBody HighQualityComment inVO) {
|
||||
return highQualityCommentService.saveComment(inVO);
|
||||
}
|
||||
@ApiOperation("查询评论")
|
||||
@PostMapping("/findComments")
|
||||
public BaseResponse findComments(@RequestBody HighQualityComment inVO) {
|
||||
if(StringUtils.isBlank(inVO.getReId())){
|
||||
BaseResponse.fail("查询不能为空");
|
||||
}
|
||||
inVO.setDeleteFlag(0);
|
||||
LambdaQueryWrapper<HighQualityComment> queryWrapper= Wrappers.lambdaQuery(inVO);
|
||||
queryWrapper.orderByDesc(HighQualityComment::getCreateTime);
|
||||
return BaseResponse.success(highQualityCommentService.list(queryWrapper));
|
||||
}
|
||||
|
||||
@ApiOperation("oss文件下载")
|
||||
@PostMapping("/download")
|
||||
@ -98,4 +115,10 @@ public class HighQualityClientController {
|
||||
iUploadOssService.download(response,key);
|
||||
}
|
||||
|
||||
@ApiOperation("我要提意见")
|
||||
@PostMapping("/submitSuggestion")
|
||||
public BaseResponse<Boolean> submitSuggestion(@ApiParam(value = "对象数据", required = true) @RequestBody HighQualityContactSuggestion inVO) {
|
||||
return BaseResponse.success(highQualityContactSuggestionService.submitSuggestion(inVO));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,8 @@ import com.chinaunicom.mall.ebtp.extend.highquality.service.*;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.vo.HighQualityMaintainInVO;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.vo.HighQualityMaintainOutVO;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.vo.HighQualityRightDataVO;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventContactSuggestion;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventMaintainInVO;
|
||||
import com.chinaunicom.mall.ebtp.extend.uploadOss.service.IUploadOssService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -42,6 +44,8 @@ public class HighQualityMaintainController {
|
||||
private HighQualityContactService highQualityContactService;
|
||||
@Resource
|
||||
private IUploadOssService iUploadOssService;
|
||||
@Resource
|
||||
private IHighQualityContactSuggestionService highQualityContactSuggestionService;
|
||||
|
||||
@ApiOperation("保存联系人")
|
||||
@PostMapping("/save/contact")
|
||||
@ -106,7 +110,20 @@ public class HighQualityMaintainController {
|
||||
public BaseResponse upload(@RequestParam("file") MultipartFile file) throws IOException {
|
||||
return BaseResponse.success(iUploadOssService.uploadFile(file,"oss/highquality"));
|
||||
}
|
||||
@ApiOperation("后台查询列表")
|
||||
@PostMapping("/suggestion/list")
|
||||
public BasePageResponse<HighQualityContactSuggestion> querySuggestion(@RequestBody(required = false) EventMaintainInVO inVO) {
|
||||
return BasePageResponse.success(highQualityContactSuggestionService.querySuggestion(inVO));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/suggestion/export/")
|
||||
public BaseResponse<Boolean> export(@RequestParam(value = "ids",required = false) List<String> ids) {
|
||||
ExcelTable table = highQualityContactSuggestionService.export(ids);
|
||||
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletResponse response = requestAttributes.getResponse();
|
||||
this.exportGetlist(response, table);
|
||||
return BaseResponse.success(true);
|
||||
}
|
||||
|
||||
public void exportGetlist(HttpServletResponse response, ExcelTable table) {
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.highquality.dao;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.entity.HighQualityContactSuggestion;
|
||||
|
||||
/**
|
||||
* @auto.generated
|
||||
*/
|
||||
public interface HighQualityContactSuggestionMapper extends BaseMapper<HighQualityContactSuggestion> {
|
||||
|
||||
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
<result column="creater_id" jdbcType="VARCHAR" property="createrId"/>
|
||||
<result column="creater_name" jdbcType="VARCHAR" property="createrName"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag"/>
|
||||
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag"/>
|
||||
</resultMap>
|
||||
|
||||
<!--逻辑删除方法 此方法为代码生成器生成 不允许修改 如有特殊需求 请自行新建SQL语句-->
|
||||
|
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.chinaunicom.mall.ebtp.extend.highquality.dao.HighQualityContactSuggestionMapper">
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.chinaunicom.mall.ebtp.extend.highquality.entity.HighQualityContactSuggestion">
|
||||
<result column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="contact_name" jdbcType="VARCHAR" property="contactName"/>
|
||||
<result column="contact_id" jdbcType="VARCHAR" property="contactId"/>
|
||||
<result column="suggestion_type" jdbcType="VARCHAR" property="suggestionType"/>
|
||||
<result column="suggestion_content" jdbcType="VARCHAR" property="suggestionContent"/>
|
||||
<result column="instructions" jdbcType="VARCHAR" property="instructions"/>
|
||||
<result column="suggestion_sponsor" jdbcType="VARCHAR" property="suggestionSponsor"/>
|
||||
<result column="suggestion_sponsor_id" jdbcType="VARCHAR" property="suggestionSponsorId"/>
|
||||
<result column="suggestion_sponsor_unit" jdbcType="VARCHAR" property="suggestionSponsorUnit"/>
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="attachment_image" jdbcType="VARCHAR" property="attachmentImage"/>
|
||||
<result column="company" jdbcType="VARCHAR" property="company"/>
|
||||
</resultMap>
|
||||
|
||||
<!--逻辑删除方法 此方法为代码生成器生成 不允许修改 如有特殊需求 请自行新建SQL语句-->
|
||||
<update id="deleteOff" parameterType="java.lang.Long">
|
||||
update high_quality_contact_suggestion
|
||||
set
|
||||
delete_flag="deleted"
|
||||
where ID=#{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
@ -1,6 +1,7 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.highquality.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.chinaunicom.mall.ebtp.common.config.CustomLocalDateTimeTypeHandler;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
@ -65,6 +66,7 @@ public class HighQualityComment implements Serializable {
|
||||
@TableField(typeHandler = CustomLocalDateTimeTypeHandler.class)
|
||||
private java.time.LocalDateTime createTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "删除标识")
|
||||
private Integer deleteFlag;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,111 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.highquality.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.chinaunicom.mall.ebtp.common.config.CustomLocalDateTimeTypeHandler;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 实体类 HighQualityContactSuggestion
|
||||
*
|
||||
* @auto.generated
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "high_quality_contact_suggestion", autoResultMap = true)
|
||||
public class HighQualityContactSuggestion implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 联系人名称
|
||||
*/
|
||||
@ApiModelProperty(value = "联系人名称")
|
||||
private String contactName;
|
||||
|
||||
/**
|
||||
* 联系人id event_contact表id
|
||||
*/
|
||||
@ApiModelProperty(value = "联系人id event_contact表id")
|
||||
private String contactId;
|
||||
|
||||
/**
|
||||
* 意见类型:1-指导型 2-建设型 3-规划型 4-政策型
|
||||
*/
|
||||
@ApiModelProperty(value = "意见类型:1-指导型 2-建设型 3-规划型 4-政策型")
|
||||
private String suggestionType;
|
||||
|
||||
/**
|
||||
* 意见内容
|
||||
*/
|
||||
@ApiModelProperty(value = "意见内容")
|
||||
private String suggestionContent;
|
||||
|
||||
/**
|
||||
* 补充说明
|
||||
*/
|
||||
@ApiModelProperty(value = "补充说明")
|
||||
private String instructions;
|
||||
|
||||
/**
|
||||
* 意见提出人
|
||||
*/
|
||||
@ApiModelProperty(value = "意见提出人")
|
||||
private String suggestionSponsor;
|
||||
|
||||
/**
|
||||
* 意见提出人id
|
||||
*/
|
||||
@ApiModelProperty(value = "意见提出人id")
|
||||
private String suggestionSponsorId;
|
||||
|
||||
/**
|
||||
* 意见提出人组织机构
|
||||
*/
|
||||
@ApiModelProperty(value = "意见提出人组织机构")
|
||||
private String suggestionSponsorUnit;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(typeHandler = CustomLocalDateTimeTypeHandler.class)
|
||||
private java.time.LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 附件id
|
||||
*/
|
||||
@ApiModelProperty(value = "附件id")
|
||||
private String attachmentImage;
|
||||
|
||||
/**
|
||||
* 公司
|
||||
*/
|
||||
@ApiModelProperty(value = "公司")
|
||||
private String company;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.highquality.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.entity.HighQualityComment;
|
||||
|
||||
/**
|
||||
* 对数据表 high_quality_comment 操作的 service
|
||||
* @author Auto create
|
||||
*
|
||||
*/
|
||||
public interface IHighQualityCommentService extends IService<HighQualityComment>{
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.highquality.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.chinaunicom.mall.ebtp.common.poiExport.entity.ExcelTable;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.entity.HighQualityContactSuggestion;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventMaintainInVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 对数据表 high_quality_contact_suggestion 操作的 service
|
||||
* @author Auto create
|
||||
*
|
||||
*/
|
||||
public interface IHighQualityContactSuggestionService extends IService<HighQualityContactSuggestion>{
|
||||
|
||||
|
||||
Boolean submitSuggestion(HighQualityContactSuggestion suggestion);
|
||||
|
||||
IPage<HighQualityContactSuggestion> querySuggestion(EventMaintainInVO inVO);
|
||||
|
||||
ExcelTable export(List<String> ids);
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.highquality.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.entity.HighQualityLikes;
|
||||
|
||||
/**
|
||||
* 对数据表 high_quality_likes 操作的 service
|
||||
* @author Auto create
|
||||
*
|
||||
*/
|
||||
public interface IHighQualityLikesService extends IService<HighQualityLikes>{
|
||||
|
||||
|
||||
|
||||
}
|
@ -36,6 +36,7 @@ public class HighQualityCommentServiceImpl extends ServiceImpl<HighQualityCommen
|
||||
inVo.setCreaterId(cacheUser.getUserId());
|
||||
inVo.setCreaterName(cacheUser.getFullName());
|
||||
inVo.setCreateTime(LocalDateTime.now());
|
||||
inVo.setDeleteFlag(0);
|
||||
if(this.save(inVo)){
|
||||
return BaseResponse.success("评论成功");
|
||||
}
|
||||
|
@ -0,0 +1,130 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.highquality.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseCacheUser;
|
||||
import com.chinaunicom.mall.ebtp.common.base.service.IBaseCacheUserService;
|
||||
import com.chinaunicom.mall.ebtp.common.poiExport.entity.ExcelTable;
|
||||
import com.chinaunicom.mall.ebtp.common.poiExport.entity.ExcelTd;
|
||||
import com.chinaunicom.mall.ebtp.common.poiExport.entity.ExcelTr;
|
||||
import com.chinaunicom.mall.ebtp.common.util.PropertyUtils;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.dao.HighQualityContactSuggestionMapper;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.entity.HighQualityContactSuggestion;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.service.IHighQualityContactSuggestionService;
|
||||
import com.chinaunicom.mall.ebtp.extend.partyMemberEvent.entity.EventMaintainInVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* 对数据表 high_quality_contact_suggestion 操作的 serviceImpl
|
||||
* @auto.generated
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class HighQualityContactSuggestionServiceImpl extends ServiceImpl<HighQualityContactSuggestionMapper,HighQualityContactSuggestion> implements IHighQualityContactSuggestionService {
|
||||
|
||||
@Resource
|
||||
private IBaseCacheUserService iBaseCacheUserService;
|
||||
|
||||
@Override
|
||||
public Boolean submitSuggestion(HighQualityContactSuggestion suggestion) {
|
||||
BaseCacheUser cacheUser = iBaseCacheUserService.getCacheUser();
|
||||
suggestion.setId(PropertyUtils.getSnowflakeId());
|
||||
suggestion.setSuggestionSponsor(cacheUser.getFullName());
|
||||
suggestion.setSuggestionSponsorId(cacheUser.getUserId());
|
||||
suggestion.setSuggestionSponsorUnit(cacheUser.getOrganizationId());
|
||||
suggestion.setCreateTime(LocalDateTime.now());
|
||||
if (StrUtil.isBlank(suggestion.getCompany())) {
|
||||
suggestion.setCompany(cacheUser.getOrganizationName());
|
||||
}
|
||||
return this.save(suggestion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<HighQualityContactSuggestion> querySuggestion(EventMaintainInVO inVO) {
|
||||
|
||||
Page<HighQualityContactSuggestion> page = new Page<>(inVO.getPageNo(), inVO.getPageSize());
|
||||
|
||||
LambdaQueryWrapper<HighQualityContactSuggestion> query = Wrappers.lambdaQuery();
|
||||
if (ObjectUtil.isNotNull(inVO.getStartTime())) {
|
||||
query.gt(HighQualityContactSuggestion::getCreateTime, inVO.getStartTime());
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotNull(inVO.getEndTime())) {
|
||||
query.lt(HighQualityContactSuggestion::getCreateTime, inVO.getEndTime());
|
||||
}
|
||||
if (StrUtil.isNotBlank(inVO.getSuggestionType())) {
|
||||
query.eq(HighQualityContactSuggestion::getSuggestionType, inVO.getSuggestionType());
|
||||
}
|
||||
query.orderByDesc(HighQualityContactSuggestion::getCreateTime);
|
||||
return this.page(page, query);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ExcelTable export(List<String> ids) {
|
||||
LambdaQueryWrapper<HighQualityContactSuggestion> query = Wrappers.lambdaQuery();
|
||||
if (ids != null) {
|
||||
query.in(HighQualityContactSuggestion::getId, ids);
|
||||
}
|
||||
List<HighQualityContactSuggestion> list = this.list(query);
|
||||
Map<String, String> titleMap = new LinkedHashMap<>(16);
|
||||
titleMap.put("num", "序号");
|
||||
titleMap.put("contactName", "联系人名称");
|
||||
titleMap.put("suggestionType", "意见类型");
|
||||
titleMap.put("suggestionContent", "意见内容");
|
||||
titleMap.put("instructions", "补充说明");
|
||||
titleMap.put("suggestionSponsor", "意见提出人");
|
||||
titleMap.put("suggestionSponsorId", "意见提出人id");
|
||||
titleMap.put("suggestionSponsorUnit", "意见提出人组织机构");
|
||||
titleMap.put("createTime", "创建时间");
|
||||
titleMap.put("company", "公司");
|
||||
//制作表格
|
||||
ExcelTable table = new ExcelTable("第一页");
|
||||
DateFormat df = new SimpleDateFormat("yyyyMMddhhmmss");
|
||||
table.setFileName(df.format(new Date()));
|
||||
|
||||
|
||||
|
||||
/*第4行开始投递数据表头*/
|
||||
ExcelTr tr4 = new ExcelTr();
|
||||
tr4.setHeight(480);
|
||||
for (String key : titleMap.keySet()) {
|
||||
tr4.add(new ExcelTd().setTdValue(titleMap.get(key)).setCellStyleKey("title1").setWidth(6000));
|
||||
}
|
||||
table.add(tr4);
|
||||
AtomicInteger num = new AtomicInteger(1);
|
||||
List<Map<String, Object>> mapList = JSON.parseObject(JSON.toJSONString(list), List.class);
|
||||
mapList.forEach(info -> {
|
||||
ExcelTr tr5 = new ExcelTr();
|
||||
for (String key : titleMap.keySet()) {
|
||||
String tValue = "";
|
||||
if ("num".equals(key)) {
|
||||
tValue = num.toString();
|
||||
} else {
|
||||
tValue = info.get(key) != null ? String.valueOf(info.get(key)) : "";
|
||||
}
|
||||
tr5.add(new ExcelTd().setTdValue(tValue).setCellStyleKey("title1").setWidth(6000));
|
||||
}
|
||||
num.addAndGet(1);
|
||||
table.add(tr5);
|
||||
});
|
||||
|
||||
return table;
|
||||
}
|
||||
}
|
@ -10,14 +10,8 @@ import com.aliyun.oss.model.PutObjectRequest;
|
||||
import com.chinaunicom.mall.ebtp.extend.uploadOss.service.IUploadOssService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedInputStream;
|
||||
|
Reference in New Issue
Block a user