diff --git a/inventory-dao/src/main/java/com/rzyc/model/ent/InList.java b/inventory-dao/src/main/java/com/rzyc/model/ent/InList.java index 197cbcd..2705979 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/ent/InList.java +++ b/inventory-dao/src/main/java/com/rzyc/model/ent/InList.java @@ -54,6 +54,18 @@ public class InList implements Serializable { @TableField("modify_by") private String modifyBy; + @ApiModelProperty(value = "父级id") + @TableField("industry_id") + private String industryId; + + public String getIndustryId() { + return industryId; + } + + public void setIndustryId(String industryId) { + this.industryId = industryId; + } + public Integer getDelState() { return delState; } @@ -115,13 +127,15 @@ public class InList implements Serializable { @Override public String toString() { return "InList{" + - "listId=" + listId + - ", name=" + name + - ", sortId=" + sortId + - ", createTime=" + createTime + - ", createBy=" + createBy + - ", modifyTime=" + modifyTime + - ", modifyBy=" + modifyBy + - "}"; + "listId='" + listId + '\'' + + ", name='" + name + '\'' + + ", sortId=" + sortId + + ", delState=" + delState + + ", createTime=" + createTime + + ", createBy='" + createBy + '\'' + + ", modifyTime=" + modifyTime + + ", modifyBy='" + modifyBy + '\'' + + ", industryId='" + industryId + '\'' + + '}'; } } diff --git a/inventory-gov/src/main/java/com/rzyc/controller/IndustryListController.java b/inventory-gov/src/main/java/com/rzyc/controller/IndustryListController.java index 218bcd0..f0d499e 100644 --- a/inventory-gov/src/main/java/com/rzyc/controller/IndustryListController.java +++ b/inventory-gov/src/main/java/com/rzyc/controller/IndustryListController.java @@ -1,17 +1,14 @@ package com.rzyc.controller; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.common.utils.DateUtils; import com.common.utils.RandomNumber; import com.common.utils.StringUtils; -import com.common.utils.TypeConversion; import com.common.utils.model.MultiResult; import com.common.utils.model.Pager; import com.common.utils.model.SingleResult; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; -import com.rzyc.mapper.ent.InListMapper; import com.rzyc.model.dto.*; import com.rzyc.model.ent.BaseInClass; import com.rzyc.model.ent.InList; @@ -21,9 +18,6 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.BeanUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import springfox.documentation.service.ApiListing; - -import javax.swing.*; import javax.validation.Valid; import java.io.File; import java.io.FileOutputStream; @@ -92,7 +86,7 @@ public class IndustryListController extends BaseController{ return result; } - @ApiOperation(value = "新增行业清单分类", notes = "新增行业清单分类") + @ApiOperation(value = "新增行业清单分类", notes = "新增行业清单分类") @PostMapping("/industryListAdd") @ResponseBody public MultiResult industryListAdd(@Valid @RequestBody InListAddDto inListAddDto){ @@ -101,54 +95,46 @@ public class IndustryListController extends BaseController{ InList inList = new InList(); //前端数据拷贝至对象 BeanUtils.copyProperties(inListAddDto,inList); + //industryId设null表示共有清单 if(StringUtils.isBlank(inList.getListId())){ //补全对象其余字段 inList.setListId(RandomNumber.getUUid()); inList.setDelState(1); inList.setCreateTime(new Date()); - //TODO:创建人取父级id,但是行业父级表与清单表未关联 + inList.setIndustryId(null); } - return null; + //industryId不设Null表示公有清单 + if(StringUtils.isBlank(inList.getListId())){ + //补全对象其余字段 + inList.setListId(RandomNumber.getUUid()); + inList.setDelState(1); + inList.setCreateTime(new Date()); + //暂时设定危化品父级下 + inList.setIndustryId("01c2afc4-cb18-4ac1-9560-b4708877db26"); + + } + return result; } /** - * 查询行业清单的所属清单项 - * @param inListDto + * 查询行业清单的所属清单项分页 + * @param inListPageDto * @return * @throws Exception */ -// @ApiOperation(value = "所属清单项列表", notes = "所属清单项列表") -// @GetMapping("/industryListItemSelect") -// @ResponseBody -// public SingleResult> industryListItemSelect(@RequestBody InListPageDto inListPageDto){ -// SingleResult> result = new SingleResult<>(); -// Pager pager = new Pager<>(); -// PageHelper.startPage(inListPageDto.getPage(),inListPageDto.getPageSize()); -// Page page = (Page)inListItemMapper.SelectContents(); -// getDatePage(pager,page); -// result.setData(pager); -// return result; -// } - @ApiOperation(value = "所属清单项列表", notes = "所属清单项列表") + @ApiOperation(value = "所属清单项列表分页", notes = "所属清单项列表分页") @GetMapping("/industryListItemSelect") @ResponseBody - public MultiResult industryListItemSelect(@RequestBody InListDto inListDto)throws Exception{ - MultiResult result = new MultiResult<>(); - ArrayList contentList = new ArrayList<>(); - LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper(); - LambdaQueryWrapper queryWrapper = lambdaQueryWrapper - .eq(InListItem::getListId, inListDto.getListId()); - List inListItems = inListItemMapper.selectList(queryWrapper); - - //取出对象的content字段放入集合 - for (InListItem inListItem : inListItems) { - String itemContent = inListItem.getItemContent(); - contentList.add(itemContent); - } - result.setData(contentList); + public SingleResult> industryListItemSelect(@RequestBody InListPageDto inListPageDto) throws Exception { + SingleResult> result = new SingleResult<>(); + Pager pager = new Pager<>(); + PageHelper.startPage(inListPageDto.getPage(),inListPageDto.getPageSize()); + Page page = (Page)inListItemMapper.SelectContents(); + getDatePage(pager,page); + result.setData(pager); return result; }