自动化立体仓库 - WMS系统
LSH
2023-09-26 851a69962e7febe20c70e57fe60ced663269a03c
#客户信息
18个文件已修改
9个文件已添加
621 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/LocOwnerController.java 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MobileController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/LocDetl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/LocOwner.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/OrderDetl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/OrderDetlLog.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WaitPakin.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WaitPakinLog.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkDetl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkDetlLog.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/CombParam.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/LocOwnerMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/LocOwnerService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocOwnerServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/model/DetlDto.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/locOwner.sql 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocDetlMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocOwnerMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/OrderDetlLogMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/OrderDetlMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WaitPakinLogMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WaitPakinMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkDetlLogMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkDetlMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locOwner/locOwner.js 246 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/locOwner/locOwner.html 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocOwnerController.java
New file
@@ -0,0 +1,125 @@
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.LocOwner;
import com.zy.asrs.service.LocOwnerService;
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 LocOwnerController extends BaseController {
    @Autowired
    private LocOwnerService locOwnerService;
    @RequestMapping(value = "/locOwner/{id}/auth")
    @ManagerAuth
    public R get(@PathVariable("id") String id) {
        return R.ok(locOwnerService.selectById(String.valueOf(id)));
    }
    @RequestMapping(value = "/locOwner/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(required = false)String condition,
                  @RequestParam Map<String, Object> param){
        EntityWrapper<LocOwner> wrapper = new EntityWrapper<>();
        excludeTrash(param);
        convert(param, wrapper);
        allLike(LocOwner.class, param.keySet(), wrapper, condition);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        return R.ok(locOwnerService.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 = "/locOwner/add/auth")
    @ManagerAuth
    public R add(LocOwner locOwner) {
        locOwnerService.insert(locOwner);
        return R.ok();
    }
    @RequestMapping(value = "/locOwner/update/auth")
    @ManagerAuth
    public R update(LocOwner locOwner){
        if (Cools.isEmpty(locOwner) || null==locOwner.getId()){
            return R.error();
        }
        locOwnerService.updateById(locOwner);
        return R.ok();
    }
    @RequestMapping(value = "/locOwner/delete/auth")
    @ManagerAuth
    public R delete(@RequestParam(value="ids[]") Long[] ids){
         for (Long id : ids){
            locOwnerService.deleteById(id);
        }
        return R.ok();
    }
    @RequestMapping(value = "/locOwner/export/auth")
    @ManagerAuth
    public R export(@RequestBody JSONObject param){
        EntityWrapper<LocOwner> wrapper = new EntityWrapper<>();
        List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
        Map<String, Object> map = excludeTrash(param.getJSONObject("locOwner"));
        convert(map, wrapper);
        List<LocOwner> list = locOwnerService.selectList(wrapper);
        return R.ok(exportSupport(list, fields));
    }
    @RequestMapping(value = "/locOwnerQuery/auth")
    @ManagerAuth
    public R query(String condition) {
        EntityWrapper<LocOwner> wrapper = new EntityWrapper<>();
        wrapper.like("id", condition);
        Page<LocOwner> page = locOwnerService.selectPage(new Page<>(0, 10), wrapper);
        List<Map<String, Object>> result = new ArrayList<>();
        for (LocOwner locOwner : page.getRecords()){
            Map<String, Object> map = new HashMap<>();
            map.put("id", locOwner.getId());
            map.put("value", locOwner.getId());
            result.add(map);
        }
        return R.ok(result);
    }
    @RequestMapping(value = "/locOwner/check/column/auth")
    @ManagerAuth
    public R query(@RequestBody JSONObject param) {
        Wrapper<LocOwner> wrapper = new EntityWrapper<LocOwner>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
        if (null != locOwnerService.selectOne(wrapper)){
            return R.parse(BaseRes.REPEAT).add(getComment(LocOwner.class, String.valueOf(param.get("key"))));
        }
        return R.ok();
    }
}
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -110,6 +110,7 @@
            wrkDetl.setWrkNo(wrkMast.getWrkNo());
            wrkDetl.setModiTime(now);
            wrkDetl.setMatType(locDetl.getMatType());
            wrkDetl.setOwner(locDetl.getOwner());
            wrkDetl.sync(locDetl);
            wrkDetlService.insert(wrkDetl);
src/main/java/com/zy/asrs/entity/LocDetl.java
@@ -159,6 +159,9 @@
    @ApiModelProperty(value = "备注")
    private String memo;
    @ApiModelProperty(value= "客户信息ID")
    private Long owner;
    public String getLocNo$() {
        LocMastService service = SpringUtils.getBean(LocMastService.class);
src/main/java/com/zy/asrs/entity/LocOwner.java
New file
@@ -0,0 +1,36 @@
package com.zy.asrs.entity;
import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
@Data
@TableName("bas_loc_owner")
public class LocOwner implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value= "")
    private String owner;
    @ApiModelProperty(value= "")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    public LocOwner() {}
    public LocOwner(String owner) {
        this.owner = owner;
    }
//    LocOwner locOwner = new LocOwner(
//            null,    // [非空]
//    );
}
src/main/java/com/zy/asrs/entity/OrderDetl.java
@@ -293,6 +293,9 @@
    @TableField(exist=false)
    private Double sum;
    @ApiModelProperty(value= "客户信息ID")
    private Long owner;
    public OrderDetl() {}
    public OrderDetl(Long orderId, String orderNo, Double anfme, Double qty, String matnr, String maktx, String batch, 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) {
src/main/java/com/zy/asrs/entity/OrderDetlLog.java
@@ -283,6 +283,9 @@
    @ApiModelProperty(value= "备注")
    private String memo;
    @ApiModelProperty(value= "客户信息ID")
    private Long owner;
    public OrderDetlLog() {}
    public OrderDetlLog(Long id,Long orderId,String orderNo,Double anfme,Double qty,String matnr,String maktx,String batch,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) {
src/main/java/com/zy/asrs/entity/WaitPakin.java
@@ -162,6 +162,9 @@
    @TableField("mat_type")
    private Integer matType;
    @ApiModelProperty(value= "客户信息ID")
    private Long owner;
    public String getBeBatch$(){
        if (null == this.beBatch){ return null; }
        switch (this.beBatch){
src/main/java/com/zy/asrs/entity/WaitPakinLog.java
@@ -158,6 +158,9 @@
    @TableField("mat_type")
    private Integer matType;
    @ApiModelProperty(value= "客户信息ID")
    private Long owner;
    public String getBeBatch$(){
        if (null == this.beBatch){ return null; }
        switch (this.beBatch){
src/main/java/com/zy/asrs/entity/WrkDetl.java
@@ -281,6 +281,9 @@
    @TableField("mat_type")
    private Integer matType;
    @ApiModelProperty(value= "客户信息ID")
    private Long owner;
    public String getIoTime$(){
        if (Cools.isEmpty(this.ioTime)){
            return "";
src/main/java/com/zy/asrs/entity/WrkDetlLog.java
@@ -275,6 +275,9 @@
    @TableField("mat_type")
    private Integer matType;
    @ApiModelProperty(value= "客户信息ID")
    private Long owner;
    public String getIoTime$(){
        if (Cools.isEmpty(this.ioTime)){
            return "";
src/main/java/com/zy/asrs/entity/param/CombParam.java
@@ -36,6 +36,8 @@
        // 备注
        private String memo;
        private Long owner;
        private String cstmr;
    }
src/main/java/com/zy/asrs/mapper/LocOwnerMapper.java
New file
@@ -0,0 +1,12 @@
package com.zy.asrs.mapper;
import com.zy.asrs.entity.LocOwner;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface LocOwnerMapper extends BaseMapper<LocOwner> {
}
src/main/java/com/zy/asrs/service/LocOwnerService.java
New file
@@ -0,0 +1,8 @@
package com.zy.asrs.service;
import com.zy.asrs.entity.LocOwner;
import com.baomidou.mybatisplus.service.IService;
public interface LocOwnerService extends IService<LocOwner> {
}
src/main/java/com/zy/asrs/service/impl/LocOwnerServiceImpl.java
New file
@@ -0,0 +1,12 @@
package com.zy.asrs.service.impl;
import com.zy.asrs.mapper.LocOwnerMapper;
import com.zy.asrs.entity.LocOwner;
import com.zy.asrs.service.LocOwnerService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service("locOwnerService")
public class LocOwnerServiceImpl extends ServiceImpl<LocOwnerMapper, LocOwner> implements LocOwnerService {
}
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -114,11 +114,15 @@
            List<DetlDto> detlDtos = new ArrayList<>();
            param.getCombMats().forEach(elem -> {
//                elem.setBatch("");
                DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(), elem.getMemo(), elem.getCstmr());
                DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(), elem.getMemo(), elem.getCstmr(),elem.getOwner());
                if (Cools.isEmpty(detlDto.getBatch())){
                    String batch = DateUtils.convert(new Date(),DateUtils.yyyyMMdd);
                    detlDto.setBatch(batch);
                }
                if (Cools.isEmpty(detlDto.getOwner())){
                    detlDto.setOwner(0L);
                }
                if (DetlDto.has(detlDtos, detlDto)) {
@@ -148,6 +152,7 @@
                waitPakin.setAppeTime(now);
                waitPakin.setModiUser(userId);
                waitPakin.setModiTime(now);
                waitPakin.setOwner(detlDto.getOwner());
                waitPakin.setMemo(detlDto.getMemo());
                waitPakin.setFrozen(param.getFrozen()); // 是否冻结
                waitPakin.setManu(detlDto.getCstmr());
@@ -185,7 +190,12 @@
                    throw new CoolException("修改单据明细数量失败");
                }
                DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme());
                DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(),elem.getOwner());
                if (Cools.isEmpty(detlDto.getOwner())){
                    detlDto.setOwner(0L);
                }
                if (DetlDto.has(detlDtos, detlDto)) {
                    DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch());
                    assert one != null;
@@ -211,6 +221,7 @@
                waitPakin.setAppeTime(now);
                waitPakin.setModiUser(userId);
                waitPakin.setModiTime(now);
                waitPakin.setOwner(detlDto.getOwner());
                waitPakin.setMatType(mat.getMatType());//物料类型
//                if (Cools.isEmpty(mat.getMatType())){
//                    throw new CoolException("物料类型异常"+mat.getMatnr());
src/main/java/com/zy/common/model/DetlDto.java
@@ -25,6 +25,8 @@
    private String cstmr;
    private Long owner;
    public DetlDto() {
    }
@@ -39,10 +41,11 @@
        this.batch = batch;
    }
    public DetlDto(String matnr, String batch, Double anfme) {
    public DetlDto(String matnr, String batch, Double anfme,Long owner) {
        this.matnr = matnr;
        this.batch = batch;
        this.anfme = anfme;
        this.owner = owner;
    }
@@ -61,6 +64,15 @@
        this.cstmr = cstmr;
    }
    public DetlDto(String matnr, String batch, Double anfme, String memo, String cstmr,Long owner) {
        this.matnr = matnr;
        this.batch = batch;
        this.anfme = anfme;
        this.memo = memo;
        this.cstmr = cstmr;
        this.owner = owner;
    }
    public static boolean hasList(Set<DetlDto> detlDtos, OrderDetl orderDetl) {
        for (DetlDto dto : detlDtos) {
src/main/java/locOwner.sql
New file
@@ -0,0 +1,18 @@
-- save locOwner record
-- mysql
insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locOwner/locOwner.html', 'locOwner管理', null , '2', null , '1');
insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locOwner#view', '查询', '', '3', '0', '1');
insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locOwner#btn-add', '新增', '', '3', '1', '1');
insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locOwner#btn-edit', '编辑', '', '3', '2', '1');
insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locOwner#btn-delete', '删除', '', '3', '3', '1');
insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locOwner#btn-export', '导出', '', '3', '4', '1');
-- sqlserver
insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locOwner/locOwner.html', N'locOwner管理', null, '2', null, '1');
insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locOwner#view', N'查询', '', '3', '0', '1');
insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locOwner#btn-add', N'新增', '', '3', '1', '1');
insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locOwner#btn-edit', N'编辑', '', '3', '2', '1');
insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locOwner#btn-delete', N'删除', '', '3', '3', '1');
insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locOwner#btn-export', N'导出', '', '3', '4', '1');
src/main/resources/mapper/LocDetlMapper.xml
@@ -44,6 +44,7 @@
        <result column="appe_user" property="appeUser" />
        <result column="appe_time" property="appeTime" />
        <result column="memo" property="memo" />
        <result column="owner" property="owner" />
    </resultMap>
    <sql id="batchSeq">
src/main/resources/mapper/LocOwnerMapper.xml
New file
@@ -0,0 +1,12 @@
<?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.LocOwnerMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.LocOwner">
        <id column="id" property="id" />
        <result column="owner" property="owner" />
    </resultMap>
</mapper>
src/main/resources/mapper/OrderDetlLogMapper.xml
@@ -44,6 +44,7 @@
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="updateTime" />
        <result column="memo" property="memo" />
        <result column="owner" property="owner" />
    </resultMap>
src/main/resources/mapper/OrderDetlMapper.xml
@@ -46,6 +46,7 @@
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="updateTime" />
        <result column="memo" property="memo" />
        <result column="owner" property="owner" />
    </resultMap>
src/main/resources/mapper/WaitPakinLogMapper.xml
@@ -48,6 +48,7 @@
        <result column="appe_user" property="appeUser" />
        <result column="memo" property="memo" />
        <result column="mat_type" property="matType" />
        <result column="owner" property="owner" />
    </resultMap>
</mapper>
src/main/resources/mapper/WaitPakinMapper.xml
@@ -48,6 +48,7 @@
        <result column="appe_user" property="appeUser" />
        <result column="memo" property="memo" />
        <result column="mat_type" property="matType" />
        <result column="owner" property="owner" />
    </resultMap>
</mapper>
src/main/resources/mapper/WrkDetlLogMapper.xml
@@ -46,6 +46,7 @@
        <result column="appe_time" property="appeTime" />
        <result column="memo" property="memo" />
        <result column="mat_type" property="matType" />
        <result column="owner" property="owner" />
    </resultMap>
</mapper>
src/main/resources/mapper/WrkDetlMapper.xml
@@ -46,6 +46,7 @@
        <result column="appe_time" property="appeTime" />
        <result column="memo" property="memo" />
        <result column="mat_type" property="matType" />
        <result column="owner" property="owner" />
    </resultMap>
    <sql id="batchSeq">
src/main/webapp/static/js/locOwner/locOwner.js
New file
@@ -0,0 +1,246 @@
var pageCurr;
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).use(['table','laydate', 'form', '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: '#locOwner',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/locOwner/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',width: 80,title: 'ID'}
            ,{field: 'owner', align: 'center',title: '信息'}
            ,{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(locOwner)', 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(locOwner)', 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 = {
                        'locOwner': exportData,
                        'fields': fields
                    };
                    $.ajax({
                        url: baseUrl+"/locOwner/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(locOwner)', 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+"/locOwner/"+(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+"/locOwner/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: '.layui-laydate-range'
                ,type: 'datetime'
                ,range: true
            });
        }, 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/locOwner/locOwner.html
New file
@@ -0,0 +1,92 @@
<!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">
                        <div class="layui-input-inline">
                            <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off">
                        </div>
                    </div>
<!--                     <div class="layui-inline" style="width: 300px">-->
<!--                        <div class="layui-input-inline">-->
<!--                            <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px">-->
<!--                        </div>-->
<!--                    </div>-->
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <input class="layui-input" type="text" name="condition" 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="locOwner" lay-filter="locOwner"></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>
        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button>
    </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/locOwner/locOwner.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 layui-form-required">: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="owner" placeholder="请输入" lay-vertype="tips" lay-verify="required">
                    </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>