清单项公有私有新增
This commit is contained in:
parent
23d467e4e9
commit
784d5f92d8
|
|
@ -54,6 +54,18 @@ public class InList implements Serializable {
|
||||||
@TableField("modify_by")
|
@TableField("modify_by")
|
||||||
private String modifyBy;
|
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() {
|
public Integer getDelState() {
|
||||||
return delState;
|
return delState;
|
||||||
}
|
}
|
||||||
|
|
@ -115,13 +127,15 @@ public class InList implements Serializable {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "InList{" +
|
return "InList{" +
|
||||||
"listId=" + listId +
|
"listId='" + listId + '\'' +
|
||||||
", name=" + name +
|
", name='" + name + '\'' +
|
||||||
", sortId=" + sortId +
|
", sortId=" + sortId +
|
||||||
|
", delState=" + delState +
|
||||||
", createTime=" + createTime +
|
", createTime=" + createTime +
|
||||||
", createBy=" + createBy +
|
", createBy='" + createBy + '\'' +
|
||||||
", modifyTime=" + modifyTime +
|
", modifyTime=" + modifyTime +
|
||||||
", modifyBy=" + modifyBy +
|
", modifyBy='" + modifyBy + '\'' +
|
||||||
"}";
|
", industryId='" + industryId + '\'' +
|
||||||
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,14 @@
|
||||||
package com.rzyc.controller;
|
package com.rzyc.controller;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.common.utils.DateUtils;
|
import com.common.utils.DateUtils;
|
||||||
import com.common.utils.RandomNumber;
|
import com.common.utils.RandomNumber;
|
||||||
import com.common.utils.StringUtils;
|
import com.common.utils.StringUtils;
|
||||||
import com.common.utils.TypeConversion;
|
|
||||||
import com.common.utils.model.MultiResult;
|
import com.common.utils.model.MultiResult;
|
||||||
import com.common.utils.model.Pager;
|
import com.common.utils.model.Pager;
|
||||||
import com.common.utils.model.SingleResult;
|
import com.common.utils.model.SingleResult;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.rzyc.mapper.ent.InListMapper;
|
|
||||||
import com.rzyc.model.dto.*;
|
import com.rzyc.model.dto.*;
|
||||||
import com.rzyc.model.ent.BaseInClass;
|
import com.rzyc.model.ent.BaseInClass;
|
||||||
import com.rzyc.model.ent.InList;
|
import com.rzyc.model.ent.InList;
|
||||||
|
|
@ -21,9 +18,6 @@ import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import springfox.documentation.service.ApiListing;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
|
@ -101,54 +95,46 @@ public class IndustryListController extends BaseController{
|
||||||
InList inList = new InList();
|
InList inList = new InList();
|
||||||
//前端数据拷贝至对象
|
//前端数据拷贝至对象
|
||||||
BeanUtils.copyProperties(inListAddDto,inList);
|
BeanUtils.copyProperties(inListAddDto,inList);
|
||||||
|
//industryId设null表示共有清单
|
||||||
if(StringUtils.isBlank(inList.getListId())){
|
if(StringUtils.isBlank(inList.getListId())){
|
||||||
//补全对象其余字段
|
//补全对象其余字段
|
||||||
inList.setListId(RandomNumber.getUUid());
|
inList.setListId(RandomNumber.getUUid());
|
||||||
inList.setDelState(1);
|
inList.setDelState(1);
|
||||||
inList.setCreateTime(new Date());
|
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
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
// @ApiOperation(value = "所属清单项列表", notes = "所属清单项列表")
|
@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 = "所属清单项列表")
|
|
||||||
@GetMapping("/industryListItemSelect")
|
@GetMapping("/industryListItemSelect")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public MultiResult<String> industryListItemSelect(@RequestBody InListDto inListDto)throws Exception{
|
public SingleResult<Pager<String>> industryListItemSelect(@RequestBody InListPageDto inListPageDto) throws Exception {
|
||||||
MultiResult<String> result = new MultiResult<>();
|
SingleResult<Pager<String>> result = new SingleResult<>();
|
||||||
ArrayList<String> contentList = new ArrayList<>();
|
Pager<String> pager = new Pager<>();
|
||||||
LambdaQueryWrapper<InListItem> lambdaQueryWrapper = new LambdaQueryWrapper();
|
PageHelper.startPage(inListPageDto.getPage(),inListPageDto.getPageSize());
|
||||||
LambdaQueryWrapper<InListItem> queryWrapper = lambdaQueryWrapper
|
Page<String> page = (Page<String>)inListItemMapper.SelectContents();
|
||||||
.eq(InListItem::getListId, inListDto.getListId());
|
getDatePage(pager,page);
|
||||||
List<InListItem> inListItems = inListItemMapper.selectList(queryWrapper);
|
result.setData(pager);
|
||||||
|
|
||||||
//取出对象的content字段放入集合
|
|
||||||
for (InListItem inListItem : inListItems) {
|
|
||||||
String itemContent = inListItem.getItemContent();
|
|
||||||
contentList.add(itemContent);
|
|
||||||
}
|
|
||||||
result.setData(contentList);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user