add:木箱类型
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package org.nl.b_lms.storage_manage.database.controller;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.database.service.IMdpbBoxtypeService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.MdpbBoxtype;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 木箱规格信息前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-06-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/boxtype")
|
||||
@Slf4j
|
||||
public class MdpbBoxtypeController {
|
||||
|
||||
@Autowired
|
||||
private IMdpbBoxtypeService iMdpbBoxtypeService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询木箱类型")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdpbBoxtypeService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增木箱类型")
|
||||
public ResponseEntity<Object> query(@Validated @RequestBody MdpbBoxtype dao) {
|
||||
iMdpbBoxtypeService.create(dao);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.nl.b_lms.storage_manage.database.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.MdpbBoxtype;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 木箱规格信息服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-06-28
|
||||
*/
|
||||
public interface IMdpbBoxtypeService extends IService<MdpbBoxtype> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param whereJson : {查询参数}
|
||||
* @param pageable : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<MdpbBoxtype> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param dao : {实体对象}
|
||||
*/
|
||||
void create(MdpbBoxtype dao);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package org.nl.b_lms.storage_manage.database.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 木箱规格信息表
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-06-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("mdpb_boxtype")
|
||||
@Builder
|
||||
public class MdpbBoxtype implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 木箱类型
|
||||
*/
|
||||
@TableId(value = "box_type")
|
||||
private String box_type;
|
||||
|
||||
/**
|
||||
* 木箱描述
|
||||
*/
|
||||
private String box_name;
|
||||
|
||||
/**
|
||||
* 捆扎模版
|
||||
*/
|
||||
private String lash_num;
|
||||
|
||||
/**
|
||||
* 一次捆扎次数
|
||||
*/
|
||||
private String lash_num_one;
|
||||
|
||||
/**
|
||||
* 二次捆扎次数
|
||||
*/
|
||||
private String lash_num_tow;
|
||||
|
||||
/**
|
||||
* 是否一次捆扎
|
||||
*/
|
||||
private String need_lash_one;
|
||||
|
||||
/**
|
||||
* 是否二次捆扎
|
||||
*/
|
||||
private String need_lash_two;
|
||||
|
||||
/**
|
||||
* 叉车取货宽度
|
||||
*/
|
||||
private String expend_width;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.b_lms.storage_manage.database.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.MdpbBoxtype;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 木箱规格信息表Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-06-28
|
||||
*/
|
||||
public interface MdpbBoxtypeMapper extends BaseMapper<MdpbBoxtype> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.b_lms.storage_manage.database.service.dao.mapper.MdpbBoxtypeMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,46 @@
|
||||
package org.nl.b_lms.storage_manage.database.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.b_lms.storage_manage.database.service.IMdpbBoxtypeService;
|
||||
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.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 木箱规格信息服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-06-28
|
||||
*/
|
||||
@Service
|
||||
public class MdpbBoxtypeServiceImpl extends ServiceImpl<MdpbBoxtypeMapper, MdpbBoxtype> implements IMdpbBoxtypeService {
|
||||
|
||||
@Override
|
||||
public IPage<MdpbBoxtype> queryAll(Map whereJson, PageQuery page) {
|
||||
return this.baseMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()), new QueryWrapper<MdpbBoxtype>()
|
||||
.lambda());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(MdpbBoxtype dao) {
|
||||
// 判断当前木箱类型是否存在
|
||||
MdpbBoxtype mdpbBoxtype = this.baseMapper.selectById(dao.getBox_type());
|
||||
if (ObjectUtil.isNotEmpty(mdpbBoxtype)) {
|
||||
throw new BadRequestException("当前木箱类型已存在:"+mdpbBoxtype.getBox_type());
|
||||
}
|
||||
this.baseMapper.insert(dao);
|
||||
}
|
||||
}
|
||||
27
lms/nladmin-ui/src/views/wms/basedata/st/boxType/boxtype.js
Normal file
27
lms/nladmin-ui/src/views/wms/basedata/st/boxType/boxtype.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/boxtype',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/boxtype/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/boxtype',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
202
lms/nladmin-ui/src/views/wms/basedata/st/boxType/index.vue
Normal file
202
lms/nladmin-ui/src/views/wms/basedata/st/boxType/index.vue
Normal file
@@ -0,0 +1,202 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="木箱类型">
|
||||
<el-input
|
||||
v-model="query.box_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="木箱类型"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="木箱描述">
|
||||
<el-input
|
||||
v-model="query.box_name"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="木箱描述"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="800px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="木箱类型:" prop="box_type">
|
||||
<el-input v-model="form.box_type" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="木箱描述:" prop="box_name">
|
||||
<el-input v-model="form.box_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="捆扎模版:" prop="lash_num">
|
||||
<el-input v-model="form.lash_num" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="叉车取货宽度:" prop="expend_width">
|
||||
<el-input-number :precision="2" :step="0.1" :min="0" :max="100" v-model="form.expend_width" size="mini" :controls="false" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="一次捆扎次数:" prop="lash_num_one">
|
||||
<el-input-number :precision="0" :step="1" :min="0" :max="9" v-model="form.lash_num_one" size="mini" :controls="false" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="二次捆扎次数:" prop="lash_num_tow">
|
||||
<el-input-number :precision="0" :step="1" :min="0" :max="9" v-model="form.lash_num_tow" size="mini" :controls="false" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否一次捆扎:" prop="need_lash_one">
|
||||
<el-radio v-model="form.need_lash_one" label="1" style="width: 79px;" border>是</el-radio>
|
||||
<el-radio v-model="form.need_lash_one" label="0" style="width: 79px;" border>否</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否二次捆扎:" prop="need_lash_two">
|
||||
<el-radio v-model="form.need_lash_two" label="1" style="width: 79px;" border>是</el-radio>
|
||||
<el-radio v-model="form.need_lash_two" label="0" style="width: 79px;" border>否</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="box_type" sortable label="木箱类型" />
|
||||
<el-table-column prop="box_name" 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_tow" label="二次捆扎次数" width="150" />
|
||||
<el-table-column prop="need_lash_one" label="是否一次捆扎" width="150" />
|
||||
<el-table-column prop="need_lash_two" label="是否二次捆扎" width="150" />
|
||||
<el-table-column prop="expend_width" label="叉车取货宽度" width="150" />
|
||||
<el-table-column
|
||||
v-permission="['admin','sectattr:edit','sectattr:del']"
|
||||
label="操作"
|
||||
width="120px"
|
||||
fixed="right"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudBoxtype from '@/views/wms/basedata/st/boxType/boxtype'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
box_type: null,
|
||||
box_name: null,
|
||||
lash_num: null,
|
||||
lash_num_one: null,
|
||||
lash_num_tow: null,
|
||||
need_lash_one: '0',
|
||||
need_lash_two: '0',
|
||||
expend_width: null
|
||||
}
|
||||
export default {
|
||||
name: 'BoxType',
|
||||
dicts: [],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '木箱类型信息',
|
||||
optShow: { add: true, reset: true },
|
||||
url: 'api/boxtype',
|
||||
idField: 'box_type',
|
||||
sort: 'box_type,desc',
|
||||
crudMethod: { ...crudBoxtype }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
stors: [],
|
||||
permission: {
|
||||
add: ['admin', 'user:add'],
|
||||
edit: ['admin', 'user:edit'],
|
||||
del: ['admin', 'user:del']
|
||||
},
|
||||
rules: {
|
||||
box_type: [
|
||||
{ required: true, message: '木箱类型不能为空!', trigger: 'blur' }
|
||||
],
|
||||
box_name: [
|
||||
{ required: true, message: '木箱描述不能为空!', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user