自动化立体仓库 - WMS系统
#
whycq
2024-01-03 e6a69e6cb7eca546ff97cc8e604a0e06421fbd78
#
3个文件已修改
9个文件已添加
946 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/MatController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MatV2Controller.java 151 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/MatV2.java 253 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/MatV2Mapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/MatV2Service.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MatV2ServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/CodeBuilder.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/properties/SystemProperties.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/matV2.sql 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/MatV2Mapper.xml 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/matV2/matV2.js 289 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/matV2/matV2.html 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MatController.java
@@ -64,6 +64,17 @@
        return R.ok().add(mats);
    }
    @RequestMapping(value = "/mat/list/pda/page/auth")
    @ManagerAuth
    public R pdaPageList(@RequestParam(required = true)Long tagId,
                         @RequestParam(defaultValue = "1")Integer curr,
                         @RequestParam(defaultValue = "10")Integer limit){
        EntityWrapper<Mat> wrapper = new EntityWrapper<>();
        wrapper.eq("tag_id", tagId);
        wrapper.orderBy("create_time", false);
        return R.ok().add(matService.selectPage(new Page<>(curr, limit), wrapper));
    }
    @RequestMapping(value = "/mat/search/pda/auth")
    @ManagerAuth
    public R pdaSearch(@RequestParam(required = false)String condition){
src/main/java/com/zy/asrs/controller/MatV2Controller.java
New file
@@ -0,0 +1,151 @@
package com.zy.asrs.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.core.common.DateUtils;
import com.zy.asrs.entity.Mat;
import com.zy.asrs.entity.MatV2;
import com.zy.asrs.service.MatV2Service;
import com.core.annotations.ManagerAuth;
import com.core.common.BaseRes;
import com.core.common.Cools;
import com.core.common.R;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;
@RestController
public class MatV2Controller extends BaseController {
    @Autowired
    private MatV2Service matV2Service;
    @RequestMapping(value = "/matV2/{id}/auth")
    @ManagerAuth
    public R get(@PathVariable("id") String id) {
        return R.ok(matV2Service.selectById(String.valueOf(id)));
    }
    @RequestMapping(value = "/matV2/list/auth")
    @ManagerAuth
    public R list(@RequestParam(defaultValue = "1")Integer curr,
                  @RequestParam(defaultValue = "10")Integer limit,
                  @RequestParam(required = false)String orderByField,
                  @RequestParam(required = false)String orderByType,
                  @RequestParam Map<String, Object> param){
        EntityWrapper<MatV2> wrapper = new EntityWrapper<>();
        excludeTrash(param);
        convert(param, wrapper);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        Page<MatV2> page = matV2Service.selectPage(new Page<>(curr, limit), wrapper);
        return R.ok(page);
    }
    @RequestMapping(value = "/matV2/list/pda/auth")
    @ManagerAuth
    public R pdaList(@RequestParam(defaultValue = "1")Integer curr,
                  @RequestParam(defaultValue = "10")Integer limit,
                  @RequestParam(required = false)String orderByField,
                  @RequestParam(required = false)String orderByType,
                  @RequestParam Map<String, Object> param){
        EntityWrapper<MatV2> wrapper = new EntityWrapper<>();
        excludeTrash(param);
        convert(param, wrapper);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        Page<MatV2> page = matV2Service.selectPage(new Page<>(curr, limit), wrapper);
        return R.ok(page);
    }
    @RequestMapping(value = "/matV2/list/pda/page/auth")
    @ManagerAuth
    public R pdaPageList(@RequestParam(required = true)String tagId,
                         @RequestParam(defaultValue = "1")Integer curr,
                         @RequestParam(defaultValue = "10")Integer limit){
        EntityWrapper<MatV2> wrapper = new EntityWrapper<>();
        wrapper.eq("uuid", tagId);
        wrapper.orderBy("create_time", false);
        return R.ok().add(matV2Service.selectPage(new Page<>(curr, limit), wrapper));
    }
    private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
        for (Map.Entry<String, Object> entry : map.entrySet()){
            String val = String.valueOf(entry.getValue());
            if (val.contains(RANGE_TIME_LINK)){
                String[] dates = val.split(RANGE_TIME_LINK);
                wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
                wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
            } else {
                wrapper.like(entry.getKey(), val);
            }
        }
    }
    @RequestMapping(value = "/matV2/add/auth")
    @ManagerAuth
    public R add(MatV2 matV2) {
        matV2Service.insert(matV2);
        return R.ok();
    }
    @RequestMapping(value = "/matV2/update/auth")
    @ManagerAuth
    public R update(MatV2 matV2){
        if (Cools.isEmpty(matV2) || null==matV2.getId()){
            return R.error();
        }
        matV2Service.updateById(matV2);
        return R.ok();
    }
    @RequestMapping(value = "/matV2/delete/auth")
    @ManagerAuth
    public R delete(@RequestParam(value="ids[]") Long[] ids){
         for (Long id : ids){
            matV2Service.deleteById(id);
        }
        return R.ok();
    }
    @RequestMapping(value = "/matV2/export/auth")
    @ManagerAuth
    public R export(@RequestBody JSONObject param){
        EntityWrapper<MatV2> wrapper = new EntityWrapper<>();
        List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
        Map<String, Object> map = excludeTrash(param.getJSONObject("matV2"));
        convert(map, wrapper);
        List<MatV2> list = matV2Service.selectList(wrapper);
        return R.ok(exportSupport(list, fields));
    }
    @RequestMapping(value = "/matV2Query/auth")
    @ManagerAuth
    public R query(String condition) {
        EntityWrapper<MatV2> wrapper = new EntityWrapper<>();
        wrapper.like("id", condition);
        Page<MatV2> page = matV2Service.selectPage(new Page<>(0, 10), wrapper);
        List<Map<String, Object>> result = new ArrayList<>();
        for (MatV2 matV2 : page.getRecords()){
            Map<String, Object> map = new HashMap<>();
            map.put("id", matV2.getId());
            map.put("value", matV2.getId());
            result.add(map);
        }
        return R.ok(result);
    }
    @RequestMapping(value = "/matV2/check/column/auth")
    @ManagerAuth
    public R query(@RequestBody JSONObject param) {
        Wrapper<MatV2> wrapper = new EntityWrapper<MatV2>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
        if (null != matV2Service.selectOne(wrapper)){
            return R.parse(BaseRes.REPEAT).add(getComment(MatV2.class, String.valueOf(param.get("key"))));
        }
        return R.ok();
    }
}
src/main/java/com/zy/asrs/entity/MatV2.java
New file
@@ -0,0 +1,253 @@
package com.zy.asrs.entity;
import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableField;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
@Data
@TableName("man_mat_v2")
public class MatV2 implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    @ApiModelProperty(value= "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty(value= "")
    private String uuid;
    @ApiModelProperty(value= "")
    @TableField("tag_id")
    private String tagId;
    @ApiModelProperty(value= "")
    private String matnr;
    @ApiModelProperty(value= "")
    private String maktx;
    @ApiModelProperty(value= "")
    private String name;
    @ApiModelProperty(value= "")
    private String specs;
    @ApiModelProperty(value= "")
    private String model;
    @ApiModelProperty(value= "")
    private String color;
    @ApiModelProperty(value= "")
    private String brand;
    @ApiModelProperty(value= "")
    private String unit;
    @ApiModelProperty(value= "")
    private Double price;
    @ApiModelProperty(value= "")
    private String sku;
    @ApiModelProperty(value= "")
    private Double units;
    @ApiModelProperty(value= "")
    private String barcode;
    @ApiModelProperty(value= "")
    private String origin;
    @ApiModelProperty(value= "")
    private String manu;
    @ApiModelProperty(value= "")
    @TableField("manu_date")
    private String manuDate;
    @ApiModelProperty(value= "")
    @TableField("item_num")
    private String itemNum;
    @ApiModelProperty(value= "")
    @TableField("safe_qty")
    private Double safeQty;
    @ApiModelProperty(value= "")
    private Double weight;
    @ApiModelProperty(value= "")
    private Double length;
    @ApiModelProperty(value= "")
    private Double volume;
    @ApiModelProperty(value= "")
    @TableField("three_code")
    private String threeCode;
    @ApiModelProperty(value= "")
    private String supp;
    @ApiModelProperty(value= "")
    @TableField("supp_code")
    private String suppCode;
    @ApiModelProperty(value= "")
    @TableField("be_batch")
    private Integer beBatch;
    @ApiModelProperty(value= "")
    @TableField("dead_time")
    private String deadTime;
    @ApiModelProperty(value= "")
    @TableField("dead_warn")
    private Integer deadWarn;
    @ApiModelProperty(value= "")
    private Integer source;
    @ApiModelProperty(value= "")
    private Integer inspect;
    @ApiModelProperty(value= "")
    private Integer danger;
    @ApiModelProperty(value= "")
    private Integer status;
    @ApiModelProperty(value= "")
    @TableField("create_by")
    private Long createBy;
    @ApiModelProperty(value= "")
    @TableField("create_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @ApiModelProperty(value= "")
    @TableField("update_by")
    private Long updateBy;
    @ApiModelProperty(value= "")
    @TableField("update_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    @ApiModelProperty(value= "")
    private String memo;
    public MatV2() {}
    public MatV2(String uuid,String tagId,String matnr,String maktx,String name,String specs,String model,String color,String brand,String unit,Double price,String sku,Double units,String barcode,String origin,String manu,String manuDate,String itemNum,Double safeQty,Double weight,Double length,Double volume,String threeCode,String supp,String suppCode,Integer beBatch,String deadTime,Integer deadWarn,Integer source,Integer inspect,Integer danger,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) {
        this.uuid = uuid;
        this.tagId = tagId;
        this.matnr = matnr;
        this.maktx = maktx;
        this.name = name;
        this.specs = specs;
        this.model = model;
        this.color = color;
        this.brand = brand;
        this.unit = unit;
        this.price = price;
        this.sku = sku;
        this.units = units;
        this.barcode = barcode;
        this.origin = origin;
        this.manu = manu;
        this.manuDate = manuDate;
        this.itemNum = itemNum;
        this.safeQty = safeQty;
        this.weight = weight;
        this.length = length;
        this.volume = volume;
        this.threeCode = threeCode;
        this.supp = supp;
        this.suppCode = suppCode;
        this.beBatch = beBatch;
        this.deadTime = deadTime;
        this.deadWarn = deadWarn;
        this.source = source;
        this.inspect = inspect;
        this.danger = danger;
        this.status = status;
        this.createBy = createBy;
        this.createTime = createTime;
        this.updateBy = updateBy;
        this.updateTime = updateTime;
        this.memo = memo;
    }
//    MatV2 matV2 = new MatV2(
//            null,    //
//            null,    //
//            null,    // [非空]
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    // [非空]
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null    //
//    );
    public String getCreateTime$(){
        if (Cools.isEmpty(this.createTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
    }
    public String getUpdateTime$(){
        if (Cools.isEmpty(this.updateTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
    }
}
src/main/java/com/zy/asrs/mapper/MatV2Mapper.java
New file
@@ -0,0 +1,12 @@
package com.zy.asrs.mapper;
import com.zy.asrs.entity.MatV2;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface MatV2Mapper extends BaseMapper<MatV2> {
}
src/main/java/com/zy/asrs/service/MatV2Service.java
New file
@@ -0,0 +1,8 @@
package com.zy.asrs.service;
import com.zy.asrs.entity.MatV2;
import com.baomidou.mybatisplus.service.IService;
public interface MatV2Service extends IService<MatV2> {
}
src/main/java/com/zy/asrs/service/impl/MatV2ServiceImpl.java
New file
@@ -0,0 +1,12 @@
package com.zy.asrs.service.impl;
import com.zy.asrs.mapper.MatV2Mapper;
import com.zy.asrs.entity.MatV2;
import com.zy.asrs.service.MatV2Service;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service("matV2Service")
public class MatV2ServiceImpl extends ServiceImpl<MatV2Mapper, MatV2> implements MatV2Service {
}
src/main/java/com/zy/common/CodeBuilder.java
@@ -17,10 +17,10 @@
//        generator.table="sys_host";
        // sqlserver
        generator.sqlOsType = SqlOsType.SQL_SERVER;
        generator.url="192.168.4.15:1433;databasename=hylyasrs";
        generator.url="127.0.0.1:1433;databasename=phpsasrs";
        generator.username="sa";
        generator.password="sa@123";
        generator.table="man_loc_check";
        generator.table="man_mat_v2";
        generator.packagePath="com.zy.asrs";
        generator.build();
    }
src/main/java/com/zy/common/properties/SystemProperties.java
@@ -63,7 +63,7 @@
    // 生成激活码
    public static void main(String[] args) {
        String timeStr = "2021-08-01 17:48:35";
        String timeStr = "2024-06-03 12:00:00";
        Date exprTime = DateUtils.convert(timeStr);
        String code = AesUtils.encrypt(DateUtils.convert(exprTime, DateUtils.yyyyMMddHHmmss), SystemProperties.SALT);
        System.out.println("激活码:"+code);
src/main/java/matV2.sql
New file
@@ -0,0 +1,18 @@
-- save matV2 record
-- mysql
insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'matV2/matV2.html', 'matV2管理', null , '2', null , '1');
insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'matV2#view', '查询', '', '3', '0', '1');
insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'matV2#btn-add', '新增', '', '3', '1', '1');
insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'matV2#btn-edit', '编辑', '', '3', '2', '1');
insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'matV2#btn-delete', '删除', '', '3', '3', '1');
insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'matV2#btn-export', '导出', '', '3', '4', '1');
-- sqlserver
insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'matV2/matV2.html', N'matV2管理', null, '2', null, '1');
insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'matV2#view', N'查询', '', '3', '0', '1');
insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'matV2#btn-add', N'新增', '', '3', '1', '1');
insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'matV2#btn-edit', N'编辑', '', '3', '2', '1');
insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'matV2#btn-delete', N'删除', '', '3', '3', '1');
insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'matV2#btn-export', N'导出', '', '3', '4', '1');
src/main/resources/mapper/MatV2Mapper.xml
New file
@@ -0,0 +1,48 @@
<?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="com.zy.asrs.mapper.MatV2Mapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.MatV2">
        <id column="id" property="id" />
        <result column="uuid" property="uuid" />
        <result column="tag_id" property="tagId" />
        <result column="matnr" property="matnr" />
        <result column="maktx" property="maktx" />
        <result column="name" property="name" />
        <result column="specs" property="specs" />
        <result column="model" property="model" />
        <result column="color" property="color" />
        <result column="brand" property="brand" />
        <result column="unit" property="unit" />
        <result column="price" property="price" />
        <result column="sku" property="sku" />
        <result column="units" property="units" />
        <result column="barcode" property="barcode" />
        <result column="origin" property="origin" />
        <result column="manu" property="manu" />
        <result column="manu_date" property="manuDate" />
        <result column="item_num" property="itemNum" />
        <result column="safe_qty" property="safeQty" />
        <result column="weight" property="weight" />
        <result column="length" property="length" />
        <result column="volume" property="volume" />
        <result column="three_code" property="threeCode" />
        <result column="supp" property="supp" />
        <result column="supp_code" property="suppCode" />
        <result column="be_batch" property="beBatch" />
        <result column="dead_time" property="deadTime" />
        <result column="dead_warn" property="deadWarn" />
        <result column="source" property="source" />
        <result column="inspect" property="inspect" />
        <result column="danger" property="danger" />
        <result column="status" property="status" />
        <result column="create_by" property="createBy" />
        <result column="create_time" property="createTime" />
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="updateTime" />
        <result column="memo" property="memo" />
    </resultMap>
</mapper>
src/main/webapp/static/js/matV2/matV2.js
New file
@@ -0,0 +1,289 @@
var pageCurr;
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).extend({
    dropdown: 'dropdown/dropdown',
}).use(['table','laydate', 'form','dropdown', 'admin'], function(){
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var layDate = layui.laydate;
    var form = layui.form;
    var admin = layui.admin;
    // 数据渲染
    tableIns = table.render({
        elem: '#matV2',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/matV2/list/auth',
        page: true,
        limit: 15,
        limits: [15, 30, 50, 100, 200, 500],
        toolbar: '#toolbar',
        cellMinWidth: 50,
        height: 'full-120',
        cols: [[
            {type: 'checkbox'}
            ,{field: 'id', align: 'center',title: 'ID',hide: true}
            ,{field: 'uuid', align: 'center',title: '上级序号',hide: false}
            ,{field: 'tagId', align: 'center',title: '当前序号',hide: false}
            ,{field: 'matnr', align: 'center',title: '商品编码',hide: false}
            ,{field: 'maktx', align: 'center',title: '商品名称',hide: false}
            ,{field: 'name', align: 'center',title: '',hide: true}
            ,{field: 'specs', align: 'center',title: '规格',hide: false}
            ,{field: 'model', align: 'center',title: '',hide: true}
            ,{field: 'color', align: 'center',title: '',hide: true}
            ,{field: 'brand', align: 'center',title: '',hide: true}
            ,{field: 'unit', align: 'center',title: '单位',hide: false}
            ,{field: 'price', align: 'center',title: '',hide: true}
            ,{field: 'sku', align: 'center',title: '',hide: true}
            ,{field: 'units', align: 'center',title: '',hide: true}
            ,{field: 'barcode', align: 'center',title: '',hide: true}
            ,{field: 'origin', align: 'center',title: '',hide: true}
            ,{field: 'manu', align: 'center',title: '',hide: true}
            ,{field: 'manuDate', align: 'center',title: '',hide: true}
            ,{field: 'itemNum', align: 'center',title: '',hide: true}
            ,{field: 'safeQty', align: 'center',title: '',hide: true}
            ,{field: 'weight', align: 'center',title: '',hide: true}
            ,{field: 'length', align: 'center',title: '',hide: true}
            ,{field: 'volume', align: 'center',title: '',hide: true}
            ,{field: 'threeCode', align: 'center',title: '',hide: true}
            ,{field: 'supp', align: 'center',title: '',hide: true}
            ,{field: 'suppCode', align: 'center',title: '',hide: true}
            ,{field: 'beBatch', align: 'center',title: '组成数量',hide: false}
            ,{field: 'deadTime', align: 'center',title: '',hide: true}
            ,{field: 'deadWarn', align: 'center',title: '',hide: true}
            ,{field: 'source', align: 'center',title: '',hide: true}
            ,{field: 'inspect', align: 'center',title: '',hide: true}
            ,{field: 'danger', align: 'center',title: '',hide: true}
            ,{field: 'status', align: 'center',title: '',hide: true}
            ,{field: 'createBy', align: 'center',title: '',hide: true}
            ,{field: 'createTime$', align: 'center',title: '',hide: true}
            ,{field: 'updateBy', align: 'center',title: '',hide: true}
            ,{field: 'updateTime$', align: 'center',title: '',hide: true}
            ,{field: 'memo', align: 'center',title: '备注',hide: false}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120}
        ]],
        request: {
            pageName: 'curr',
            pageSize: 'limit'
        },
        parseData: function (res) {
            return {
                'code': res.code,
                'msg': res.msg,
                'count': res.data.total,
                'data': res.data.records
            }
        },
        response: {
            statusCode: 200
        },
        done: function(res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            limit();
        }
    });
    // 监听排序事件
    table.on('sort(matV2)', function (obj) {
        var searchData = {};
        $.each($('#search-box [name]').serializeArray(), function() {
            searchData[this.name] = this.value;
        });
        searchData['orderByField'] = obj.field;
        searchData['orderByType'] = obj.type;
        tableIns.reload({
            where: searchData,
            page: {curr: 1}
        });
    });
    // 监听头工具栏事件
    table.on('toolbar(matV2)', function (obj) {
        var checkStatus = table.checkStatus(obj.config.id).data;
        switch(obj.event) {
            case 'addData':
                showEditModel();
                break;
            case 'deleteData':
               if (checkStatus.length === 0) {
                   layer.msg('请选择要删除的数据', {icon: 2});
                   return;
               }
               del(checkStatus.map(function (d) {
                   return d.id;
               }));
               break;
            case 'exportData':
                admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){
                    var titles=[];
                    var fields=[];
                    obj.config.cols[0].map(function (col) {
                        if (col.type === 'normal' && col.hide === false && col.toolbar == null) {
                            titles.push(col.title);
                            fields.push(col.field);
                        }
                    });
                    var exportData = {};
                    $.each($('#search-box [name]').serializeArray(), function() {
                        exportData[this.name] = this.value;
                    });
                    var param = {
                        'matV2': exportData,
                        'fields': fields
                    };
                    $.ajax({
                        url: baseUrl+"/matV2/export/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: JSON.stringify(param),
                        dataType:'json',
                        contentType:'application/json;charset=UTF-8',
                        method: 'POST',
                        success: function (res) {
                            layer.closeAll();
                            if (res.code === 200) {
                                table.exportFile(titles,res.data,'xls');
                            } else if (res.code === 403) {
                                top.location.href = baseUrl+"/";
                            } else {
                                layer.msg(res.msg, {icon: 2})
                            }
                        }
                    });
                });
                break;
        }
    });
    // 监听行工具事件
    table.on('tool(matV2)', function(obj){
        var data = obj.data;
        switch (obj.event) {
            case 'edit':
                showEditModel(data);
                break;
            case "del":
                del([data.id]);
                break;
        }
    });
    /* 弹窗 - 新增、修改 */
    function showEditModel(mData) {
        admin.open({
            type: 1,
            area: '600px',
            title: (mData ? '修改' : '添加') + '订单状态',
            content: $('#editDialog').html(),
            success: function (layero, dIndex) {
                layDateRender(mData);
                form.val('detail', mData);
                form.on('submit(editSubmit)', function (data) {
                    var loadIndex = layer.load(2);
                    $.ajax({
                        url: baseUrl+"/matV2/"+(mData?'update':'add')+"/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: data.field,
                        method: 'POST',
                        success: function (res) {
                            layer.close(loadIndex);
                            if (res.code === 200){
                                layer.close(dIndex);
                                layer.msg(res.msg, {icon: 1});
                                tableReload();
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            }else {
                                layer.msg(res.msg, {icon: 2});
                            }
                        }
                    })
                    return false;
                });
                $(layero).children('.layui-layer-content').css('overflow', 'visible');
                layui.form.render('select');
            }
        });
    }
    /* 删除 */
    function del(ids) {
        layer.confirm('确定要删除选中数据吗?', {
            skin: 'layui-layer-admin',
            shade: .1
        }, function (i) {
            layer.close(i);
            var loadIndex = layer.load(2);
            $.ajax({
                url: baseUrl+"/matV2/delete/auth",
                headers: {'token': localStorage.getItem('token')},
                data: {ids: ids},
                method: 'POST',
                success: function (res) {
                    layer.close(loadIndex);
                    if (res.code === 200){
                        layer.msg(res.msg, {icon: 1});
                        tableReload();
                    } else if (res.code === 403){
                        top.location.href = baseUrl+"/";
                    } else {
                        layer.msg(res.msg, {icon: 2});
                    }
                }
            })
        });
    }
    // 搜索
    form.on('submit(search)', function (data) {
        pageCurr = 1;
        tableReload(false);
    });
    // 重置
    form.on('submit(reset)', function (data) {
        pageCurr = 1;
        clearFormVal($('#search-box'));
        tableReload(false);
    });
    // 时间选择器
    function layDateRender(data) {
        setTimeout(function () {
            layDate.render({
                elem: '#createTime\\$',
                type: 'datetime',
                value: data!==undefined?data['createTime\\$']:null
            });
            layDate.render({
                elem: '#updateTime\\$',
                type: 'datetime',
                value: data!==undefined?data['updateTime\\$']:null
            });
        }, 300);
    }
    layDateRender();
});
// 关闭动作
$(document).on('click','#data-detail-close', function () {
    parent.layer.closeAll();
});
function tableReload(child) {
    var searchData = {};
    $.each($('#search-box [name]').serializeArray(), function() {
        searchData[this.name] = this.value;
    });
    tableIns.reload({
        where: searchData,
        page: {curr: pageCurr}
     });
}
src/main/webapp/views/matV2/matV2.html
New file
@@ -0,0 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all">
    <link rel="stylesheet" href="../../static/css/cool.css" media="all">
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-form toolbar" id="search-box">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">编号:</label>
                        <div class="layui-input-inline">
                            <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off">
                        </div>
                    </div>
                    <div class="layui-inline">&emsp;
                        <button class="layui-btn icon-btn" lay-filter="search" lay-submit>
                            <i class="layui-icon">&#xe615;</i>搜索
                        </button>
                        <button class="layui-btn icon-btn" lay-filter="reset" lay-submit>
                            <i class="layui-icon">&#xe666;</i>重置
                        </button>
                    </div>
                </div>
            </div>
            <table class="layui-hide" id="matV2" lay-filter="matV2"></table>
        </div>
    </div>
</div>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button>
        <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button>
        <!-- 商品/物料 数据中心 -->
            <div class="dropdown-menu" style="float: right">
                <button class="layui-btn layui-btn-primary layui-border-black icon-btn layui-btn-sm">&nbsp;数据同步 <i class="layui-icon layui-icon-drop"></i></button>
                <ul class="dropdown-menu-nav dark">
                    <div class="dropdown-anchor"></div>
                    <li class="title">1st menu</li>
                    <li><a onclick="excelMouldDownload()" style="font-size: 12px"><i class="layui-icon layui-icon-template-1"></i>模板下载</a></li>
                    <li><a onclick="importExcel()" style="font-size: 12px"><i class="layui-icon layui-icon-upload"></i>导入 Excel</a></li>
                    <li style="display: none"><input id="importExcel" type="file" onchange="upload(this)" ></li>
                    <hr>
                    <li class="title">2nd menu</li>
                    <li><a onclick="exportExcel()" style="font-size: 12px"><i class="layui-icon layui-icon-export"></i>导出 Excel</a></li>
                </ul>
            </div>
    </div>
</script>
<script type="text/html" id="operate">
    <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a>
</script>
<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/matV2/matV2.js" charset="utf-8"></script>
</body>
<!-- 表单弹窗 -->
<script type="text/html" id="editDialog">
    <form id="detail" lay-filter="detail" class="layui-form admin-form model-form">
        <input name="id" type="hidden">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">上级序号: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="uuid" placeholder="请输入">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">当前序号: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="tagId" placeholder="请输入">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">商品编码: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="matnr" placeholder="请输入" lay-vertype="tips" lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商品名称: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="maktx" placeholder="请输入">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">规格: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="specs" placeholder="请输入">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">单位: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="unit" placeholder="请输入">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">组成数量: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="beBatch" placeholder="请输入">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="memo" placeholder="请输入">
                    </div>
                </div>
             </div>
        </div>
        <hr class="layui-bg-gray">
        <div class="layui-form-item text-right">
            <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button>
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
        </div>
    </form>
</script>
</html>