rev:木箱类型
This commit is contained in:
@@ -8,13 +8,13 @@ import org.nl.common.TableDataInfo;
|
|||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
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 java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -40,9 +40,23 @@ public class MdpbBoxtypeController {
|
|||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@Log("新增木箱类型")
|
@Log("新增木箱类型")
|
||||||
public ResponseEntity<Object> query(@Validated @RequestBody MdpbBoxtype dao) {
|
public ResponseEntity<Object> create(@Validated @RequestBody MdpbBoxtype dao) {
|
||||||
iMdpbBoxtypeService.create(dao);
|
iMdpbBoxtypeService.create(dao);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改木箱类型")
|
||||||
|
public ResponseEntity<Object> update(@Validated @RequestBody MdpbBoxtype dao) {
|
||||||
|
iMdpbBoxtypeService.update(dao);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@Log("删除木箱类型")
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||||
|
iMdpbBoxtypeService.delete(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import org.nl.b_lms.storage_manage.database.service.dao.MdpbBoxtype;
|
|||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -30,4 +31,16 @@ public interface IMdpbBoxtypeService extends IService<MdpbBoxtype> {
|
|||||||
* @param dao : {实体对象}
|
* @param dao : {实体对象}
|
||||||
*/
|
*/
|
||||||
void create(MdpbBoxtype dao);
|
void create(MdpbBoxtype dao);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param dao: {实体对象}
|
||||||
|
*/
|
||||||
|
void update(MdpbBoxtype dao);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param ids : {集合}
|
||||||
|
*/
|
||||||
|
void delete(Set<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import java.io.Serializable;
|
|||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@TableName("mdpb_boxtype")
|
@TableName("mdpb_boxtype")
|
||||||
@Builder
|
|
||||||
public class MdpbBoxtype implements Serializable {
|
public class MdpbBoxtype implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package org.nl.b_lms.storage_manage.database.service.impl;
|
package org.nl.b_lms.storage_manage.database.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -10,11 +12,11 @@ import org.nl.b_lms.storage_manage.database.service.dao.MdpbBoxtype;
|
|||||||
import org.nl.b_lms.storage_manage.database.service.dao.mapper.MdpbBoxtypeMapper;
|
import org.nl.b_lms.storage_manage.database.service.dao.mapper.MdpbBoxtypeMapper;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -29,8 +31,21 @@ public class MdpbBoxtypeServiceImpl extends ServiceImpl<MdpbBoxtypeMapper, MdpbB
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<MdpbBoxtype> queryAll(Map whereJson, PageQuery page) {
|
public IPage<MdpbBoxtype> queryAll(Map whereJson, PageQuery page) {
|
||||||
return this.baseMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()), new QueryWrapper<MdpbBoxtype>()
|
// 查询条件
|
||||||
.lambda());
|
LambdaQueryWrapper<MdpbBoxtype> queryWrapper = new QueryWrapper<MdpbBoxtype>().lambda();
|
||||||
|
String box_type = MapUtil.getStr(whereJson, "box_type");
|
||||||
|
String box_name = MapUtil.getStr(whereJson, "box_name");
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(box_type)) {
|
||||||
|
queryWrapper.likeRight(MdpbBoxtype::getBox_type, box_type);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(box_name)) {
|
||||||
|
queryWrapper.likeRight(MdpbBoxtype::getBox_name, box_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.baseMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||||
|
queryWrapper
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -43,4 +58,15 @@ public class MdpbBoxtypeServiceImpl extends ServiceImpl<MdpbBoxtypeMapper, MdpbB
|
|||||||
}
|
}
|
||||||
this.baseMapper.insert(dao);
|
this.baseMapper.insert(dao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void update(MdpbBoxtype dao) {
|
||||||
|
this.baseMapper.updateById(dao);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(Set<String> ids) {
|
||||||
|
this.baseMapper.deleteBatchIds(ids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,12 +46,12 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="木箱类型:" prop="box_type">
|
<el-form-item label="木箱类型:" prop="box_type">
|
||||||
<el-input v-model="form.box_type" style="width: 200px;" />
|
<el-input v-model="form.box_type" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="木箱描述:" prop="box_name">
|
<el-form-item label="木箱描述:" prop="box_name">
|
||||||
<el-input v-model="form.box_name" style="width: 200px;" />
|
<el-input v-model="form.box_name" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -113,8 +113,8 @@
|
|||||||
<el-table-column prop="lash_num" label="捆扎模版" width="150" />
|
<el-table-column prop="lash_num" label="捆扎模版" width="150" />
|
||||||
<el-table-column prop="lash_num_one" label="一次捆扎次数" width="150" />
|
<el-table-column prop="lash_num_one" label="一次捆扎次数" width="150" />
|
||||||
<el-table-column prop="lash_num_tow" label="二次捆扎次数" width="150" />
|
<el-table-column prop="lash_num_tow" label="二次捆扎次数" width="150" />
|
||||||
<el-table-column prop="need_lash_one" label="是否一次捆扎" width="150" />
|
<el-table-column prop="need_lash_one" label="是否一次捆扎" width="150" :formatter="formatOne" />
|
||||||
<el-table-column prop="need_lash_two" label="是否二次捆扎" width="150" />
|
<el-table-column prop="need_lash_two" label="是否二次捆扎" width="150" :formatter="formatTwo" />
|
||||||
<el-table-column prop="expend_width" label="叉车取货宽度" width="150" />
|
<el-table-column prop="expend_width" label="叉车取货宽度" width="150" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-permission="['admin','sectattr:edit','sectattr:del']"
|
v-permission="['admin','sectattr:edit','sectattr:del']"
|
||||||
@@ -157,7 +157,7 @@ const defaultForm = {
|
|||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'BoxType',
|
name: 'BoxType',
|
||||||
dicts: [],
|
dicts: ['IS_OR_NOT'],
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
@@ -192,6 +192,12 @@ export default {
|
|||||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
return true
|
return true
|
||||||
|
},
|
||||||
|
formatOne(row) {
|
||||||
|
return this.dict.label.IS_OR_NOT[row.need_lash_one]
|
||||||
|
},
|
||||||
|
formatTwo(row) {
|
||||||
|
return this.dict.label.IS_OR_NOT[row.need_lash_two]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user