清单项公有私有新增
This commit is contained in:
parent
23d467e4e9
commit
784d5f92d8
|
|
@ -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 +
|
||||
"listId='" + listId + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", sortId=" + sortId +
|
||||
", delState=" + delState +
|
||||
", createTime=" + createTime +
|
||||
", createBy=" + createBy +
|
||||
", createBy='" + createBy + '\'' +
|
||||
", modifyTime=" + modifyTime +
|
||||
", modifyBy=" + modifyBy +
|
||||
"}";
|
||||
", modifyBy='" + modifyBy + '\'' +
|
||||
", industryId='" + industryId + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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<Pager<String>> industryListItemSelect(@RequestBody InListPageDto inListPageDto){
|
||||
// SingleResult<Pager<String>> result = new SingleResult<>();
|
||||
// Pager<String> pager = new Pager<>();
|
||||
// PageHelper.startPage(inListPageDto.getPage(),inListPageDto.getPageSize());
|
||||
// Page<String> page = (Page<String>)inListItemMapper.SelectContents();
|
||||
// getDatePage(pager,page);
|
||||
// result.setData(pager);
|
||||
// return result;
|
||||
// }
|
||||
@ApiOperation(value = "所属清单项列表", notes = "所属清单项列表")
|
||||
@ApiOperation(value = "所属清单项列表分页", notes = "所属清单项列表分页")
|
||||
@GetMapping("/industryListItemSelect")
|
||||
@ResponseBody
|
||||
public MultiResult<String> industryListItemSelect(@RequestBody InListDto inListDto)throws Exception{
|
||||
MultiResult<String> result = new MultiResult<>();
|
||||
ArrayList<String> contentList = new ArrayList<>();
|
||||
LambdaQueryWrapper<InListItem> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
LambdaQueryWrapper<InListItem> queryWrapper = lambdaQueryWrapper
|
||||
.eq(InListItem::getListId, inListDto.getListId());
|
||||
List<InListItem> inListItems = inListItemMapper.selectList(queryWrapper);
|
||||
|
||||
//取出对象的content字段放入集合
|
||||
for (InListItem inListItem : inListItems) {
|
||||
String itemContent = inListItem.getItemContent();
|
||||
contentList.add(itemContent);
|
||||
}
|
||||
result.setData(contentList);
|
||||
public SingleResult<Pager<String>> industryListItemSelect(@RequestBody InListPageDto inListPageDto) throws Exception {
|
||||
SingleResult<Pager<String>> result = new SingleResult<>();
|
||||
Pager<String> pager = new Pager<>();
|
||||
PageHelper.startPage(inListPageDto.getPage(),inListPageDto.getPageSize());
|
||||
Page<String> page = (Page<String>)inListItemMapper.SelectContents();
|
||||
getDatePage(pager,page);
|
||||
result.setData(pager);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user