提交 cb94092e authored 作者: zhouzhigang's avatar zhouzhigang

资源导入添加字段:目录、简介、分类

上级 7e7320fa
......@@ -19,7 +19,7 @@ import java.util.List;
public interface PhyResourceMapper extends BaseMapper<PhyResource> {
@Select(" <script> "
+ " SELECT a.id, a.type, NAME, author, isbn, price, a.createTime, a.updateTime, a.STATUS "
+ " SELECT a.id, a.type, NAME, author, isbn, price, a.createTime, a.updateTime, a.STATUS,a.introduction, a.menu "
+ " FROM res_physical_resource a "
// 自定义分类
+ " <if test = '" + NOTBLANK + "(query.diyTypeCode)'> "
......
......@@ -772,10 +772,33 @@ public class PhyResourceServiceImpl extends BaseModelServiceImpl<PhyResource, St
phyResourcePageVos.parallelStream().forEach(phyResourcePageVo -> {
phyResourcePageVo.setStatusZh(GoodsStatusEnum.getName(phyResourcePageVo.getStatus()));
//获取图书的自定义分类
GoodsDiyTypeRelation entity = new GoodsDiyTypeRelation();
entity.setGoodsid(phyResourcePageVo.getId());
List<GoodsDiyTypeRelation> voList = goodsDiyTypeRelationMapper.select(entity);
if(voList != null && voList.size() > 0){
String diyTypes = this.getDiyTypes(voList.get(0).getDiytypeid(), new StringBuffer());
phyResourcePageVo.setDiyTypes(diyTypes);
}
});
return phyResourcePageVos;
}
public String getDiyTypes(Integer diyTypeId, StringBuffer sb){
DiyType diyType = diyTypeMapper.selectByPrimaryKey(diyTypeId);
if(diyType == null || diyType.getParentId() == null){
return null;
}
if(diyType.getParentId() != 0){
sb.insert(0,"-" + diyType.getShowName());
}
if(diyType.getParentId() == 0){
sb.insert(0, diyType.getShowName() + "");
return new String(sb);
}
return getDiyTypes(diyType.getParentId(), sb);
}
......
package com.zrqx.core.vo.resource.bg.goods.phyresource;
import com.zrqx.core.util.excelutil.ExcelResources;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
......@@ -50,6 +51,15 @@ public class PhyResourcePageVo {
private String isRelation;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("简介")
private String introduction;
@ApiModelProperty("目录")
private String menu;
@ApiModelProperty("分类")
private String diyTypes;
......
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.zrqx.core.util.excelutil.ExcelResources;
......@@ -41,4 +42,15 @@ public class PhyResourcePageVoExcelVo {
@ExcelResources(title="状态")
private String statusZh;
@ExcelResources(title="简介")
private String introduction;
@ExcelResources(title="目录")
private String menu;
@ExcelResources(title = "分类")
private String diyTypes;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论