自动化立体仓库 - WMS系统
zyx
2023-09-19 3c1e34e86e18224acf34883039f7c31cab5a3d4d
平库增加
15个文件已修改
39个文件已添加
7327 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/ManLocDetlController.java 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MobileController.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/NodeController.java 474 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/AdjDetl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/ManLocDetl.java 346 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/Node.java 437 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/OrderDetl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/InitPakoutParam.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/LocDetlAdjustParam.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/MatnrDto.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/NodeInitPatam.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/PakinParam.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/ManLocDetlMapper.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/NodeMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/ManLocDetlService.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/MobileService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/NodeService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/ManLocDetlServiceImpl.java 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/NodeServiceImpl.java 227 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/SaasUtils.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/entity/NodeExcel.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/entity/NodeExcelListener.java 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/utils/NodeUtils.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/utils/TreeUtils.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/web/BaseController.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/system/controller/SaasLogController.java 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/system/entity/SaasLog.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/system/entity/UserLogin.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/system/mapper/SaasLogMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/system/service/SaasLogService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/system/service/impl/SaasLogServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ManLocDetlMapper.xml 377 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/adjDetl/adjDetl.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/common.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/manLocDetl/manLocDetl.js 578 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/node/node.js 370 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/nodeLoc/nodeLoc.js 488 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/nodeLoc/nodeLocTree.js 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pakStore/stockAdjust.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/saas/locDetl.js 557 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/saas/locMove.js 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/saas/stockAdjust.js 243 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/saasLog/saasLog.js 252 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/manLocDetl/manLocDetl.html 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/node/node.html 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/nodeLoc/nodeLoc.html 430 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/saas/locDetl.html 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/saas/locMove.html 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/saas/matQuery.html 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/saas/stockAdjust.html 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/saasLog/saasLog.html 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/ManLocDetlController.java
New file
@@ -0,0 +1,115 @@
package com.zy.asrs.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.core.annotations.ManagerAuth;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.R;
import com.zy.asrs.entity.ManLocDetl;
import com.zy.asrs.entity.param.LocDetlAdjustParam;
import com.zy.asrs.service.ManLocDetlService;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
public class ManLocDetlController extends BaseController {
    @Autowired
    private ManLocDetlService manLocDetlService;
    @RequestMapping(value = "/manLocDetl/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){
        Long hostId = getHostId();
        if (hostId != null) {
            param.put("host_id", hostId);
        }
        Object nodeId = param.get("node_id");
        if (Cools.isEmpty(nodeId)) {
            nodeId = getOriginNode().getId();
            param.put("node_id", String.valueOf(nodeId));
        }
        Object tagId = param.get("tag_id");
        if (Cools.isEmpty(tagId)) {
            tagId = getOriginTag().getId();
            param.put("tag_id", String.valueOf(tagId));
        }
        if (!Cools.isEmpty(param.get("update_time"))){
            String val = String.valueOf(param.get("update_time"));
            if (val.contains(RANGE_TIME_LINK)) {
                String[] dates = val.split(RANGE_TIME_LINK);
                param.put("startTime", DateUtils.convert(dates[0]));
                param.put("endTime", DateUtils.convert(dates[1]));
                param.remove("update_time");
            }
        }
        Page<ManLocDetl> page = manLocDetlService.getPage(toPage(curr, limit, param, ManLocDetl.class));
        return R.ok(page);
    }
    @RequestMapping("/manLocDetl/list")
    public R outList(@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){
        Page<ManLocDetl> manLocDetlPage = toPage(curr, limit, param, ManLocDetl.class);
        Page<ManLocDetl> outPage = manLocDetlService.getOutPage(manLocDetlPage);
//        Page<ManLocDetl> page = manLocDetlService.getPage(manLocDetlPage);
        return R.ok(outPage);
    }
    @RequestMapping("/manLocDetl/adjust/start")
    @ManagerAuth(memo = "库存调整")
    public R locDetlAdjustStart(@RequestBody LocDetlAdjustParam param) {
        manLocDetlService.adjustLocDetl(param, getUserId(),getUser());
        return R.ok("库存调整成功");
    }
    @RequestMapping(value = "/manLocDetl/asrsAndSaas/list")
    @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){
        Page<ManLocDetl> manLocDetlPage = toPage(curr, limit, param, ManLocDetl.class);
        Page<ManLocDetl> all = manLocDetlService.selectAllPage(manLocDetlPage);
        return R.ok().add(all);
    }
    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 {
                if (entry.getKey().equals("locNo")) {
                    wrapper.eq("loc_no", String.valueOf(entry.getValue()));
                } else {
                    wrapper.like(entry.getKey(), String.valueOf(entry.getValue()));
                }
            }
        }
    }
}
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -47,6 +47,8 @@
    private BasDevpService basDevpService;
    @Autowired
    private PackService packService;
    @Autowired
    private ManLocDetlService manLocDetlService;
    // 组托 ----------------------------------------------------------------------------------------------------
@@ -320,5 +322,32 @@
        return R.ok("盘点成功");
    }
    /*
    平库 库位推荐
     */
    @RequestMapping("/node/recommend/loc")
    @ManagerAuth(memo = "库位推荐")
    public R recommendNodeLoc(){
        return R.ok();
    }
    /*
    平库 订单上架
     */
    @RequestMapping("/node/puttway")
    @ManagerAuth(memo = "订单上架")
    public R putway(@RequestBody HashMap<String,String> params){
        String zpallet = params.get("zpallet");
        String locNo = params.get("locNo");
        mobileService.nodePutway(zpallet,locNo,getUser());
        return R.ok();
    }
}
src/main/java/com/zy/asrs/controller/NodeController.java
New file
@@ -0,0 +1,474 @@
package com.zy.asrs.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
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.annotations.ManagerAuth;
import com.core.common.BaseRes;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.R;
import com.core.exception.CoolException;
import com.zy.asrs.entity.Node;
import com.zy.asrs.entity.param.InitPakoutParam;
import com.zy.asrs.entity.param.NodeInitPatam;
import com.zy.asrs.entity.param.PakinParam;
import com.zy.asrs.entity.result.KeyValueVo;
import com.zy.asrs.mapper.ManLocDetlMapper;
import com.zy.asrs.service.NodeService;
import com.zy.common.entity.NodeExcel;
import com.zy.common.entity.NodeExcelListener;
import com.zy.common.entity.Parameter;
import com.zy.common.utils.ListUtils;
import com.zy.common.utils.NodeUtils;
import com.zy.common.utils.TreeUtils;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.*;
@RestController
public class NodeController extends BaseController {
    @Autowired
    private NodeService nodeService;
    @Autowired
    private TreeUtils treeUtils;
    @Autowired
    private ManLocDetlMapper manLocDetlMapper;
    @RequestMapping(value = "/node/{id}/auth")
    @ManagerAuth
    public R get(@PathVariable("id") String id) {
        return R.ok(nodeService.selectById(String.valueOf(id)));
    }
    @RequestMapping(value = "/node/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<Node> wrapper = new EntityWrapper<>();
        wrapper.eq("type",3);
        excludeTrash(param);
        convert(param, wrapper);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        return R.ok(nodeService.selectPage(new Page<>(curr, limit), wrapper));
    }
    @RequestMapping(value = "/node/list/tree/auth")
    @ManagerAuth
    public R listTree(@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<Node> wrapper = new EntityWrapper<>();
        wrapper.ne("type",3);
        excludeTrash(param);
        convert(param, wrapper);
        hostEq(wrapper);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        return R.parse("0-操作成功").add(nodeService.selectList(wrapper));
    }
    @RequestMapping(value = "/node/tree/auth")
    @ManagerAuth
    public R tree(@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<Node> wrapper = new EntityWrapper<>();
        excludeTrash(param);
        convert(param, wrapper);
        hostEq(wrapper);
        if (!Cools.isEmpty(orderByField)){
            wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));
        }
        return R.parse("0-成功").add(nodeService.selectList(wrapper));
    }
    private void convert(Map<String, Object> map, EntityWrapper 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 = "/node/add/auth")
    @ManagerAuth
    public R add(Node node) {
        Node node1 = nodeService.selectByUuid(node.getName());
        if (!Cools.isEmpty(node1)) {
            throw new CoolException("该编号/名称已存在");
        }
        if (node.getType() != 1) {
            Node parentNode = nodeService.selectById(node.getParentId());
            if (parentNode == null || parentNode.getStatus() == 0) {
                return R.error(node.getType()==2?"所属仓库不存在":"所属库区不存在");
            }
            node.setParentName(parentNode.getName());
            node.setLevel(parentNode.getLevel() + 1);
        }
        // path
        NodeUtils nodeUtils = new NodeUtils();
        nodeUtils.executePath(node);
        node.setHostId(getHostId());
        node.setUuid(node.getName().toString());
        node.setPath(nodeUtils.path.toString());
        node.setNamePath(nodeUtils.pathName.toString());
        node.setLevel(node.getType());
        node.setCreateBy(getUserId());
        node.setCreateTime(new Date());
        node.setUpdateBy(getUserId());
        node.setUpdateTime(new Date());
        node.setStatus(1);
        nodeService.insert(node);
        return R.ok();
    }
    @RequestMapping(value = "/node/update/auth")
    @ManagerAuth
    public R update(Node node){
        Node node1 = nodeService.selectByUuid(node.getName());
        if (!Cools.isEmpty(node1)) {
            throw new CoolException("该编号/名称已存在");
        }
        if (Cools.isEmpty(node) || null==node.getId()){
            return R.error();
        }
        if (node.getType() != 1) {
            Node parentNode = nodeService.selectById(node.getParentId());
            if (parentNode == null || parentNode.getStatus() == 0) {
                return R.error(node.getType()==2?"所属仓库不存在":"所属库区不存在");
            }
            node.setParentName(parentNode.getName());
            node.setLevel(parentNode.getLevel() + 1);
        }
        // path
        NodeUtils nodeUtils = new NodeUtils();
        nodeUtils.executePath(node);
        node.setPath(nodeUtils.path.toString());
        node.setNamePath(nodeUtils.pathName.toString());
        node.setUuid(node.getName());
        manLocDetlMapper.updateLocNo0(node.getId(),node.getName());
        node.setUpdateBy(getUserId());
        node.setUpdateTime(new Date());
        nodeService.updateById(node);
        return R.ok();
    }
    @RequestMapping(value = "/node/delete/auth")
    @ManagerAuth
    public R delete(@RequestParam String param){
        List<Node> list = JSONArray.parseArray(param, Node.class);
        if (Cools.isEmpty(list)){
            return R.error();
        }
        for (Node entity : list){
            nodeService.delete(new EntityWrapper<>(entity));
        }
        return R.ok();
    }
    @RequestMapping(value = "/node/delete0/auth")
    @ManagerAuth
    public R delete(@RequestParam(value="ids[]") Long[] ids){
        for (Long id : ids){
            nodeService.deleteById(id);
        }
        return R.ok();
    }
    @RequestMapping(value = "/node/export/auth")
    @ManagerAuth
    public R export(@RequestBody JSONObject param){
        EntityWrapper<Node> wrapper = new EntityWrapper<>();
        List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
        Map<String, Object> map = excludeTrash(param.getJSONObject("node"));
        convert(map, wrapper);
        List<Node> list = nodeService.selectList(wrapper);
        return R.ok(exportSupport(list, fields));
    }
    @RequestMapping(value = "/nodeQuery/auth")
    @ManagerAuth
    public R query(String condition) {
        EntityWrapper<Node> wrapper = new EntityWrapper<>();
        wrapper.like("name", condition).or().like("uuid", condition).eq("type", 3);
        hostEq(wrapper);
        Page<Node> page = nodeService.selectPage(new Page<>(0, 10), wrapper);
        List<Map<String, Object>> result = new ArrayList<>();
        for (Node node : page.getRecords()){
            Map<String, Object> map = new HashMap<>();
            map.put("id", node.getId());
            map.put("value", node.getUuid() + "(" +node.getName()+ ")");
            result.add(map);
        }
        return R.ok(result);
    }
    @RequestMapping(value = "/node/check/column/auth")
    @ManagerAuth
    public R query(@RequestBody JSONObject param) {
        Wrapper<Node> wrapper = new EntityWrapper<Node>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
        if (null != nodeService.selectOne(wrapper)){
            return R.parse(BaseRes.REPEAT).add(getComment(Node.class, String.valueOf(param.get("key"))));
        }
        return R.ok();
    }
    @PostMapping(value = "/parent/node/group")
    @ManagerAuth
    public R getParentNodeGroup(@RequestParam(required = false) String condition,
                                @RequestParam Integer type) {
        EntityWrapper<Node> wrapper = new EntityWrapper<>();
        wrapper.eq("type", type).eq("status", 1);
        hostEq(wrapper);
        List<Node> nodes = nodeService.selectList(wrapper);
        List<Map<String, Object>> result = new ArrayList<>();
        for (Node node : nodes) {
            Map<String, Object> map = new HashMap<>();
            map.put("key", node.getId());
            map.put("val", node.getName());
            result.add(map);
        }
        return R.ok().add(result);
    }
    @PostMapping(value = "/node/tree/auth")
    @ManagerAuth
    public R tree(@RequestParam(required = false, defaultValue = "") String condition) throws IOException, ClassNotFoundException {
        ArrayList<Map> tree = treeUtils.getNodeTree(String.valueOf(getOriginNode().getId()), getHostId());
        // 深拷贝
        List<Map> result = ListUtils.deepCopy(tree);
        if (!Cools.isEmpty(condition)) {
            treeUtils.remove(condition, result);
            treeUtils.remove(condition, result);
        }
        return R.ok(result);
    }
    /*************************************** 数据相关 ***********************************************/
    /**
     * excel导入模板下载
     */
    @RequestMapping(value = "/node/excel/import/mould")
    public void nodeExcelImportMould(HttpServletResponse response) throws IOException {
        List<NodeExcel> excels = new ArrayList<>();
        response.setContentType("application/vnd.ms-excel");
        response.setCharacterEncoding("utf-8");
        String fileName = URLEncoder.encode("货位档案Excel导入模板", "UTF-8");
        response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
        EasyExcel.write(response.getOutputStream(), NodeExcel.class)
                .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
                .sheet("sheet1")
                .doWrite(excels);
    }
    // excel导入
    @PostMapping(value = "/node/excel/import/auth")
    @ManagerAuth(memo = "货位档案数据导入")
    @Transactional
    public R nodeExcelImport(MultipartFile file) throws IOException {
        NodeExcelListener listener = new NodeExcelListener(getUserId(), getHostId());
        EasyExcel.read(file.getInputStream(), NodeExcel.class, listener).sheet().doRead();
        return R.ok("成功同步"+listener.getTotal()+"个货位");
    }
    /*************************************** 入库出相关 ***********************************************/
    @RequestMapping("/work/stock/pakin")
    @ManagerAuth(memo = "入库")
    public R stockPakin(@RequestBody PakinParam number) {
        Node node = nodeService.selectOne(new EntityWrapper<Node>()
                .eq("id", number.getNodeId()));
        if (node.getType() != 3) {
          return R.error("仅可选择货位");
        }
        return nodeService.stockPakin(number, getUserId(), getHostId(),getUser());
    }
    @RequestMapping("/work/stock/pakout")
    @ManagerAuth(memo = "出库")
    public R initPakout(@RequestBody List<InitPakoutParam> params) {
        return nodeService.initPakout(params, getUserId(), getHostId(),getUser());
    }
    @PostMapping(value = "/work/empty/stock")
    public R getGroupEmptyStock(@RequestParam(required = false) String sourceLocNo) {
        List<Node> allEmptys = nodeService.selectList(new EntityWrapper<Node>()
                .eq("type","3"));
        return R.ok().add(allEmptys);
    }
    @RequestMapping("/work/move/start")
    @ManagerAuth(memo = "库位移转")
    public R locMoveStart(@RequestParam String sourceLocNo,
                          @RequestParam String targetLocNo) {
        nodeService.locMove(sourceLocNo, targetLocNo, getUserId(),getUser());
        return R.ok("移库启动成功");
    }
    @RequestMapping(value = "/node/select/{id}/auth")
    @ManagerAuth
    public R getById(@PathVariable("id") String id) {
        Node node = nodeService.selectOne(new EntityWrapper<Node>()
                .eq("uuid",id));
        return R.ok(node);
    }
    @RequestMapping(value = "/node/init/auth")
    @ManagerAuth(memo = "平库库位初始化")
    @Transactional
    public R init(NodeInitPatam param) {
        List<Node> list = new ArrayList<>();
        EntityWrapper<Node> nodeEntityWrapper = new EntityWrapper<>();
        nodeEntityWrapper.eq("id",param.getValue());
        nodeEntityWrapper.eq("name",param.getName());
 //       nodeService.delete(new EntityWrapper<Node>().eq("parent_id",param.getValue()));
        Node node = nodeService.selectOne(nodeEntityWrapper);
        String[] string = node.getNamePath().split(",");
        int tno=1; int no=1;
        for (int b=param.getStartBay(); b<=param.getEndBay(); b++) {
            for (int r=param.getStartRow(); r<=param.getEndRow(); r++){
                for (int l=param.getStartLev(); l<=param.getEndLev(); l++) {
                    // 获取库位号
                    String locNo;
                    if (param.getName().equals("DT-B")){
                        if (b == 2 || b ==4 || b == 7){
                            if (l == 1){
                                locNo = param.getName()+"T-" +String.format("%02d", tno) + String.format("%02d", r) + String.format("%02d", l);
                            }else {
                                locNo = null;
                            }
                        }else {
                            locNo = param.getName()+"-" +String.format("%02d", no) + String.format("%02d", r) + String.format("%02d", l);
                        }
                    }else if (param.getName().equals("DT-C") || param.getName().equals("DT-D")){
                        if (b == 3 || b ==6 || b == 9 || b == 12 || b == 15 || b == 17 || b == 20 || b == 23){
                            if (l == 1){
                                locNo = param.getName()+"T-" +String.format("%02d", tno) + String.format("%02d", r) + String.format("%02d", l);
                            }else {
                                locNo = null;
                            }
                        }else {
                            locNo = param.getName()+"-" +String.format("%02d", no) + String.format("%02d", r) + String.format("%02d", l);
                        }
                    }else {
                        locNo = param.getName()+"-" +String.format("%02d", r) + String.format("%02d", b) + String.format("%02d", l);
                    }
                    if (locNo == null){
                        continue;
                    }
                    Date now =  new Date();
                    Node node1 = new Node();
                    node1.setUuid(locNo);
                    node1.setName(locNo);
                    node1.setParentId(node.getId());
                    node1.setParentName(node.getName());
                    node1.setType(3);
                    node1.setPath(node.getPath()+","+node.getId());
                    node1.setNamePath(node.getNamePath()+","+node.getName());
                    node1.setLevel(3);
                    node1.setStatus(1);
                    node1.setCreateBy(getUserId());
                    node1.setCreateTime(now);
                    node1.setUpdateBy(getUserId());
                    node1.setUpdateTime(now);
                    node1.setRow1(r);
                    node1.setBay1(b);
                    node1.setLev1(l);
                    if (!nodeService.insert(node1)){
                        return R.error("数据插入失败");
                    }
                }
            }
            if (param.getName().equals("DT-B")){
                if (b == 2 || b ==4 || b == 7){
                    tno++;
                }else {
                    no++;
                }
            }else if (param.getName().equals("DT-C") || param.getName().equals("DT-D")){
                if (b == 3 || b ==6 || b == 9 || b == 12 || b == 15 || b == 17 || b == 20 || b == 23){
                    tno++;
                }else {
                    no++;
                }
            }
        }
//
//        nodeService.delete(new EntityWrapper<Node>().eq("parent_id",param.getValue()));
//        if (nodeService.insertBatch(list)){
//            return R.error("数据插入失败");
//        }
        return R.ok("初始化成功");
    }
    @RequestMapping(value = "/node/init/pwd")
    public R locMastInitPwd(@RequestParam(required = false) String pwd) {
        if (Cools.isEmpty(pwd)) {
            return R.error("请输入口令");
        }
        return R.ok().add(Parameter.get().getLocMastInitPwd().equals(pwd));
    }
    @RequestMapping(value = "/node/all/get/loc")
    public R getarea(){
        EntityWrapper<Node> nodeEntityWrapper = new EntityWrapper<>();
        nodeEntityWrapper.eq("type",2);
        List<Node> list = nodeService.selectList(nodeEntityWrapper);
        List<KeyValueVo> keyValueVoList = new ArrayList<>();
        for (Node node : list){
            KeyValueVo vo = new KeyValueVo();
            vo.setName(node.getName());
            vo.setValue(node.getId());
            keyValueVoList.add(vo);
        }
        return R.ok(keyValueVoList);
    }
}
src/main/java/com/zy/asrs/entity/AdjDetl.java
@@ -125,6 +125,21 @@
    @TableField("appe_time")
    private Date appeTime;
    /*
    订单号
     */
    private String orderNo;
    /*
    销售订单号
     */
    private String csocode;
    /*
    销售订单行号
     */
    private String isoseq;
    public AdjDetl() {}
    public AdjDetl(String locNo, String matnr, String batch, Double oriCtns, Double oriQty, Double oriWt, Double adjCtns, Double adjQty, Double adjWt, String memo, Long modiUser, Date modiTime, Long appeUser, Date appeTime) {
src/main/java/com/zy/asrs/entity/ManLocDetl.java
New file
@@ -0,0 +1,346 @@
package com.zy.asrs.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import com.zy.system.entity.Host;
import com.zy.system.entity.User;
import com.zy.system.service.HostService;
import com.zy.system.service.UserService;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
@Data
@TableName("man_loc_detl")
public class ManLocDetl implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 所属项目
     */
    @ApiModelProperty(value= "所属项目")
    @TableField("host_id")
    private Long hostId;
    /**
     * 货位编号
     */
    @ApiModelProperty(value= "货位编号")
    @TableField("loc_no")
    private String locNo;
    /**
     * 所属货位
     */
    @ApiModelProperty(value= "所属货位")
    @TableField("node_id")
    private Long nodeId;
    /**
     * 托盘码
     */
    @ApiModelProperty(value= "托盘码")
    private String zpallet;
    /**
     * 库存余量
     */
    @ApiModelProperty(value= "库存余量")
    @ExcelProperty(value = "库存总量")
    private Double anfme;
    /**
     * 商品编号
     */
    @ApiModelProperty(value= "商品编号")
    @TableId(value = "matnr", type = IdType.INPUT)
    @ExcelProperty(value = "商品编号")
    private String matnr;
    /**
     * 商品名称
     */
    @ApiModelProperty(value= "商品名称")
    @ExcelProperty(value = "商品名称")
    private String maktx;
    /**
     * 名称
     */
    @ApiModelProperty(value= "名称")
    private String name;
    /**
     * 规格
     */
    @ApiModelProperty(value= "规格")
    @ExcelProperty(value = "规格")
    private String specs;
    /**
     * 型号
     */
    @ApiModelProperty(value= "型号")
    private String model;
    /**
     * 批号
     */
    @ApiModelProperty(value= "批号")
    @TableId(value = "batch", type = IdType.INPUT)
    private String batch;
    /**
     * 单位
     */
    @ApiModelProperty(value= "单位")
    @ExcelProperty(value = "单位")
    private String unit;
    /**
     * SKC
     */
    @ApiModelProperty(value= "SKC")
    @ExcelProperty(value = "SKC")
    private String barcode;
    /**
     * 单据类型
     */
    @ApiModelProperty(value= "单据类型")
    @TableField("doc_id")
    private Long docId;
    /**
     * 单据编号
     */
    @ApiModelProperty(value= "单据编号")
    @TableField("doc_num")
    private String docNum;
    /**
     * 客户名称
     */
    @ApiModelProperty(value= "客户名称")
    @TableField("cust_name")
    private String custName;
    /**
     * 品项数
     */
    @ApiModelProperty(value= "品项数")
    @TableField("item_num")
    private Integer itemNum;
    /**
     * 数量
     */
    @ApiModelProperty(value= "数量")
    private Integer count;
    /**
     * 单价
     */
    @ApiModelProperty(value= "单价")
    private Double price;
    /**
     * 重量
     */
    @ApiModelProperty(value= "重量")
    private Double weight;
    /**
     * 状态 1: 正常  0: 禁用
     */
    @ApiModelProperty(value= "状态 1: 正常  0: 禁用  ")
    private Integer status;
    /**
     * 添加人员
     */
    @ApiModelProperty(value= "添加人员")
    @TableField("create_by")
    private Long createBy;
    /**
     * 添加时间
     */
    @ApiModelProperty(value= "添加时间")
    @TableField("create_time")
    private Date createTime;
    /**
     * 修改人员
     */
    @ApiModelProperty(value= "修改人员")
    @TableField("update_by")
    private Long updateBy;
    /**
     * 修改时间
     */
    @ApiModelProperty(value= "修改时间")
    @TableField("modi_time")
    private Date modiTime;
    /**
     * 备注
     */
    @ApiModelProperty(value= "备注")
    private String memo;
    /**
     * 拥有者
     */
    @ApiModelProperty(value= "拥有者 1: 杰克   ")
    private Integer owner;
    /**
     * 货物形态:0:代采、1:仓储
     */
    @ApiModelProperty(value= "货物形态:0:代采、1:仓储")
    private Integer payment;
    @ApiModelProperty(value= "添加时间")
    @TableField("real_anfme")
    private Date realAnfme;
    @ApiModelProperty(value= "订单号")
    @TableField("order_no")
    private String orderNo;
    @TableField("container_code")
    private String containerCode;
    private String csocode;
    private String isoseq;
//    LocDetl locDetl = new LocDetl(
//            null,    // 货位编号[非空]
//            null,    // 所属货位
//            null,    // 托盘码
//            null,    // 库存余量[非空]
//            null,    // 商品编号[非空]
//            null,    // 商品名称
//            null,    // 名称
//            null,    // 规格
//            null,    // 型号
//            null,    // 批号
//            null,    // 单位
//            null,    // SKC
//            null,    // 单据类型
//            null,    // 单据编号
//            null,    // 客户名称
//            null,    // 品项数
//            null,    // 数量
//            null,    // 重量
//            null,    // 状态
//            null,    // 添加人员
//            null,    // 添加时间
//            null,    // 修改人员
//            null,    // 修改时间
//            null    // 备注
//    );
//    public String getOwner$(){
//        LocOwnerService service = SpringUtils.getBean(LocOwnerService.class);
//        LocOwner locOwner = service.selectById(this.owner);
//        if (!Cools.isEmpty(locOwner)){
//            return String.valueOf(locOwner.getOwner());
//        }
//        return null;
//    }
    public String getPayment$(){
        if (null == this.payment){ return null; }
        switch (this.payment){
            case 1:
                return "仓储";
            case 0:
                return "代采";
            default:
                return String.valueOf(this.payment);
        }
    }
    public String getHostId$(){
        HostService service = SpringUtils.getBean(HostService.class);
        Host host = service.selectById(this.hostId);
        if (!Cools.isEmpty(host)){
            return String.valueOf(host.getName());
        }
        return null;
    }
    public Long getNodeId() {
        return nodeId;
    }
//    public String getNodeId$(){
//        NodeService service = SpringUtils.getBean(NodeService.class);
//        Node node = service.selectById(this.nodeId);
//        if (!Cools.isEmpty(node)){
//            return String.valueOf(node.getName());
//        }
//        return null;
//    }
    public String getStatus$(){
        if (null == this.status){ return null; }
        switch (this.status){
            case 1:
                return "正常";
            case 0:
                return "禁用";
            default:
                return String.valueOf(this.status);
        }
    }
    public String getCreateBy$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.selectById(this.createBy);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getNickname());
        }
        return null;
    }
    public String getCreateTime$(){
        if (Cools.isEmpty(this.createTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
    }
    public String getUpdateBy$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.selectById(this.updateBy);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getNickname());
        }
        return null;
    }
    public String getModiTime$(){
        if (Cools.isEmpty(this.modiTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime);
    }
}
src/main/java/com/zy/asrs/entity/Node.java
New file
@@ -0,0 +1,437 @@
package com.zy.asrs.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import com.zy.system.entity.Host;
import com.zy.system.entity.User;
import com.zy.system.service.HostService;
import com.zy.system.service.UserService;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
@Data
@TableName("man_node")
public class Node implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    @ApiModelProperty(value= "ID")
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 所属项目
     */
    @ApiModelProperty(value= "所属项目")
    @TableField("host_id")
    private Long hostId;
    /**
     * 编号
     */
    @ApiModelProperty(value= "编号")
    private String uuid;
    /**
     * 名称
     */
    @ApiModelProperty(value= "名称")
    private String name;
    /**
     * 父级
     */
    @ApiModelProperty(value= "父级")
    @TableField("parent_id")
    private Long parentId;
    /**
     * 父级名称
     */
    @ApiModelProperty(value= "父级名称")
    @TableField("parent_name")
    private String parentName;
    /**
     * 类型 1: 仓库  2: 库区  3: 货位
     */
    @ApiModelProperty(value= "类型 1: 仓库  2: 库区  3: 货位  ")
    private Integer type;
    /**
     * 关联路径
     */
    @ApiModelProperty(value= "关联路径")
    private String path;
    /**
     * 关联路径名
     */
    @ApiModelProperty(value= "关联路径名")
    @TableField("name_path")
    private String namePath;
    /**
     * 等级
     */
    @ApiModelProperty(value= "等级")
    private Integer level;
    /**
     * 负责人
     */
    @ApiModelProperty(value= "负责人")
    private String leading;
    /**
     * 排序
     */
    @ApiModelProperty(value= "排序")
    private Integer sort;
    /**
     * 排
     */
    @ApiModelProperty(value= "排")
    private Integer row1;
    /**
     * 列
     */
    @ApiModelProperty(value= "列")
    private Integer bay1;
    /**
     * 层
     */
    @ApiModelProperty(value= "层")
    private Integer lev1;
    /**
     * 条码
     */
    @ApiModelProperty(value= "条码")
    private String barcode;
    /**
     * 推荐位
     */
    @ApiModelProperty(value= "推荐位")
    private Integer major;
    /**
     * 状态 1: 正常  0: 禁用
     */
    @ApiModelProperty(value= "状态 1: 正常  0: 禁用  ")
    private Integer status;
    /**
     * 添加时间
     */
    @ApiModelProperty(value= "添加时间")
    @TableField("create_time")
    private Date createTime;
    /**
     * 添加人员
     */
    @ApiModelProperty(value= "添加人员")
    @TableField("create_by")
    private Long createBy;
    /**
     * 修改时间
     */
    @ApiModelProperty(value= "修改时间")
    @TableField("update_time")
    private Date updateTime;
    /**
     * 修改人员
     */
    @ApiModelProperty(value= "修改人员")
    @TableField("update_by")
    private Long updateBy;
    /**
     * 备注
     */
    @ApiModelProperty(value= "备注")
    private String memo;
//    Node node = new Node(
//            null,    // 编号
//            null,    // 名称
//            null,    // 父级
//            null,    // 父级名称
//            null,    // 类型
//            null,    // 关联路径
//            null,    // 关联路径名
//            null,    // 等级
//            null,    // 负责人
//            null,    // 排序
//            null,    // 条码
//            null,    // 推荐位
//            null,    // 状态
//            null,    // 添加时间
//            null,    // 添加人员
//            null,    // 修改时间
//            null,    // 修改人员
//            null    // 备注
//    );
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getHostId() {
        return hostId;
    }
    public void setHostId(Long hostId) {
        this.hostId = hostId;
    }
    public String getHostId$(){
        HostService service = SpringUtils.getBean(HostService.class);
        Host host = service.selectById(this.hostId);
        if (!Cools.isEmpty(host)){
            return String.valueOf(host.getName());
        }
        return null;
    }
    public String getUuid() {
        return uuid;
    }
    public void setUuid(String uuid) {
        this.uuid = uuid;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Long getParentId() {
        return parentId;
    }
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    public String getParentName() {
        return parentName;
    }
    public void setParentName(String parentName) {
        this.parentName = parentName;
    }
    public Integer getType() {
        return type;
    }
    public String getType$(){
        if (null == this.type){ return null; }
        switch (this.type){
            case 1:
                return "仓库";
            case 2:
                return "库区";
            case 3:
                return "货位";
            default:
                return String.valueOf(this.type);
        }
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getPath() {
        return path;
    }
    public void setPath(String path) {
        this.path = path;
    }
    public String getNamePath() {
        return namePath;
    }
    public void setNamePath(String namePath) {
        this.namePath = namePath;
    }
    public Integer getLevel() {
        return level;
    }
    public void setLevel(Integer level) {
        this.level = level;
    }
    public String getLeading() {
        return leading;
    }
    public void setLeading(String leading) {
        this.leading = leading;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public String getBarcode() {
        return barcode;
    }
    public void setBarcode(String barcode) {
        this.barcode = barcode;
    }
    public Integer getMajor() {
        return major;
    }
    public void setMajor(Integer major) {
        this.major = major;
    }
    public Integer getStatus() {
        return status;
    }
    public String getStatus$(){
        if (null == this.status){ return null; }
        switch (this.status){
            case 1:
                return "正常";
            case 0:
                return "禁用";
            default:
                return String.valueOf(this.status);
        }
    }
    public String getRow1$(){
        if (null == this.row1){ return null; }
        return String.valueOf(this.row1);
    }
    public String getBay1$(){
        if (null == this.lev1){ return null; }
        return String.valueOf(this.lev1);
    }
    public String getLev1$(){
        if (null == this.bay1){ return null; }
        return String.valueOf(this.bay1);
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public String getCreateTime$(){
        if (Cools.isEmpty(this.createTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Long getCreateBy() {
        return createBy;
    }
    public String getCreateBy$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.selectById(this.createBy);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getUsername());
        }
        return null;
    }
    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public String getUpdateTime$(){
        if (Cools.isEmpty(this.updateTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public Long getUpdateBy() {
        return updateBy;
    }
    public String getUpdateBy$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.selectById(this.updateBy);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getUsername());
        }
        return null;
    }
    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }
    public String getMemo() {
        return memo;
    }
    public void setMemo(String memo) {
        this.memo = memo;
    }
}
src/main/java/com/zy/asrs/entity/OrderDetl.java
@@ -285,13 +285,6 @@
    @ApiModelProperty(value= "备注")
    private String memo;
    //待出库数量
    private Double amount;
    public Double getAmount() {
        return anfme - qty;
    }
    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/param/InitPakoutParam.java
New file
@@ -0,0 +1,17 @@
package com.zy.asrs.entity.param;
import lombok.Data;
/**
 * Created by vincent on 2021/3/10
 */
@Data
public class InitPakoutParam {
    private Long nodeId;
    private String matnr;
    private Double count;
}
src/main/java/com/zy/asrs/entity/param/LocDetlAdjustParam.java
@@ -30,10 +30,18 @@
        // 变更数量
        private Double count;
        public LocDetlAdjust(String matnr, String batch, Double count) {
        // 销售订单号
        private String threeCode;
        //销售订单行号
        private String deadTime;
        public LocDetlAdjust(String matnr, String batch, Double count, String threeCode, String deadTime) {
            this.matnr = matnr;
            this.batch = batch;
            this.count = count;
            this.threeCode = threeCode;
            this.deadTime = deadTime;
        }
    }
@@ -52,7 +60,7 @@
                }
            }
            if (!exit) {
                copyList.add(new LocDetlAdjustParam.LocDetlAdjust(adjust.getMatnr(), adjust.getBatch(), adjust.getCount()));
                copyList.add(new LocDetlAdjustParam.LocDetlAdjust(adjust.getMatnr(), adjust.getBatch(), adjust.getCount(), adjust.getThreeCode(), adjust.getDeadTime()));
            }
        }
        list = copyList;
src/main/java/com/zy/asrs/entity/param/MatnrDto.java
New file
@@ -0,0 +1,19 @@
package com.zy.asrs.entity.param;
import lombok.Data;
/**
 * Created by vincent on 2021/3/31
 */
@Data
public class MatnrDto {
    private String matnr;
    private Double count;
    private String orderNo;
}
src/main/java/com/zy/asrs/entity/param/NodeInitPatam.java
New file
@@ -0,0 +1,29 @@
package com.zy.asrs.entity.param;
import lombok.Data;
@Data
public class NodeInitPatam {
    private Integer startRow;
    // 终止排
    private Integer endRow;
    // 起始列
    private Integer startBay;
    // 终止列
    private Integer endBay;
    // 起始层
    private Integer startLev;
    // 终止层
    private Integer endLev;
    private Integer value;
    private String name;
}
src/main/java/com/zy/asrs/entity/param/PakinParam.java
New file
@@ -0,0 +1,19 @@
package com.zy.asrs.entity.param;
import lombok.Data;
import java.util.List;
/**
 * Created by vincent on 2021/3/26
 */
@Data
public class PakinParam {
    private String nodeId;
    private List<MatnrDto> mats;
    private Integer docType;
}
src/main/java/com/zy/asrs/mapper/ManLocDetlMapper.java
New file
@@ -0,0 +1,92 @@
package com.zy.asrs.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zy.asrs.entity.ManLocDetl;
import com.zy.asrs.entity.result.StockVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Mapper
@Repository
public interface ManLocDetlMapper extends BaseMapper<ManLocDetl> {
    List<ManLocDetl> listByPage(Map<String, Object> map);
    Integer listByPageCount(Map<String, Object> map);
    ManLocDetl selectItem(@Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch);
    int deleteItem(@Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch);
    int updateAnfme(@Param("anfme")Double anfme, @Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch);
    List<ManLocDetl> getStockOutPage(Map<String, Object> map);
    Integer getStockOutPageCount(Map<String, Object> map);
    @Update("update asr_loc_detl set loc_no = #{newLocNo}, modi_time=getDate() where loc_no = #{oldLocNo}")
    int updateLocNo(String newLocNo, String oldLocNo);
    @Select("SELECT ld.loc_no FROM asr_loc_detl ld LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no WHERE (1 = 1 AND ld.matnr = #{matnr} AND (lm.row1 >= #{start} AND lm.row1 <= #{end})  AND lm.loc_sts = 'F' AND DateDiff(dd, lm.appe_time, getdate()) = 0) ORDER BY lm.appe_time ASC")
    List<String> selectSameDetlToday(@Param("matnr") String matnr, @Param("start") Integer start, @Param("end") Integer end);
    List<ManLocDetl> getStockStatis(Map<String, Object> map);
    Integer getStockStatisCount(Map<String, Object> map);
    List<ManLocDetl> getStockStatisExcel();
    @Select("select sum(a.anfme) as sum from asr_loc_detl a left join asr_loc_mast b on a.loc_no = b.loc_no where b.loc_sts = 'F' and a.matnr = #{matnr}")
    Double selectSumAnfmeByMatnr(@Param("matnr") String matnr);
    List<ManLocDetl> selectPakoutByRule(String matnr);
    List<ManLocDetl> getAsrsLocDetl(String matnr);
    Integer countLocNoNum(String locNo);
    // -------------------------------------------------
    List<ManLocDetl> queryStock(@Param("matnr")String matnr, @Param("batch")String batch, @Param("orderNo")String orderNo, @Param("locNos") Set<String> locNos);
    Double queryStockAnfme(String matnr, String batch);
    List<StockVo> queryStockTotal();
    Integer sum();
    List<ManLocDetl> unreason();
    Double selectLocDetlSumQty(String locNo);
    int updateLocNo0(Long nodeId, String locNo);
    ManLocDetl selectLocNo0(String locNo, String matnr);
    List<ManLocDetl> selectItem0(String locNo, String matnr);
    int deleteLocNo0(String locNo, String matnr);
    int updateAnfme0(double anfme, Long nodeId);
    List<ManLocDetl> listByOutPage(Map<String, Object> condition);
    long listByOutPageCount(Map<String, Object> condition);
    List<ManLocDetl> selectAllPage(Map<String, Object> condition);
    long selectAllPageSize(Map<String, Object> condition);
    ManLocDetl selectInventory(String LocNo, String Matnr, String batch);
    int deleteDatailed (String locNo, String matnr,String batch);
    int increase(Double anfme,String locNo, String matnr,String batch,Double weight);
}
src/main/java/com/zy/asrs/mapper/NodeMapper.java
New file
@@ -0,0 +1,20 @@
package com.zy.asrs.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zy.asrs.entity.Node;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
@Mapper
@Repository
public interface NodeMapper extends BaseMapper<Node> {
    Node selectByUuid(@Param("uuid") String uuid, @Param("hostId") Long hostId);
    List<Node> listByPage(Map<String, Object> map);
    Integer listByPageCount(Map<String, Object> map);
}
src/main/java/com/zy/asrs/service/ManLocDetlService.java
New file
@@ -0,0 +1,72 @@
package com.zy.asrs.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.zy.asrs.entity.ManLocDetl;
import com.zy.asrs.entity.param.LocDetlAdjustParam;
import com.zy.asrs.entity.result.StockVo;
import com.zy.system.entity.User;
import java.util.List;
import java.util.Set;
public interface ManLocDetlService  extends IService<ManLocDetl> {
    Page<ManLocDetl> getPage(Page<ManLocDetl> page);
    ManLocDetl selectItem(String locNo, String matnr, String batch);
    Page<ManLocDetl> getStockOut(Page<ManLocDetl> page);
    /**
     * 修改库存明细数量,如果数量为0,则删除记录
     */
    boolean updateAnfme(Double anfme, String locNo, String matnr, String batch);
    boolean updateLocNo(String newLocNo, String oldLocNo);
    /**
     * 获取当天相同规格货物的深库位号
     * @param matnr 商品编号
     * @return locNo 库位号
     */
    List<String> getSameDetlToday(String matnr, Integer start, Integer end);
    Page<ManLocDetl> getStockStatis(Page<ManLocDetl> page);
    Double getSumAnfme(String matnr);
    List<ManLocDetl> selectPakoutByRule(String matnr);
    List<ManLocDetl> getAsrsLocDetl(String matnr);
    Integer countLocNoNum(String locNo);
    // --------------------------------------------------
    List<ManLocDetl> queryStock(String matnr, String batch, String orderNo, Set<String> locNos);
    Double queryStockAnfme(String matnr, String batch);
    List<StockVo> queryStockTotal();
    Integer sum();
    List<ManLocDetl> unreason();
    Double getLocDetlSumQty(String locNo);
    Page<ManLocDetl> getOutPage(Page<ManLocDetl> manLocDetlPage);
    void adjustLocDetl(LocDetlAdjustParam param, Long userId ,User user);
    Page<ManLocDetl> selectAllPage(Page<ManLocDetl> param);
    ManLocDetl selectInventory(String LocNo,String Matnr,String batch);
    int deleteDatailed (String locNo, String matnr,String batch);
    int increase(Double anfme,String locNo, String matnr,String batch,Double weight);
}
src/main/java/com/zy/asrs/service/MobileService.java
@@ -2,6 +2,7 @@
import com.zy.asrs.entity.param.CombParam;
import com.zy.asrs.entity.param.MobileAdjustParam;
import com.zy.system.entity.User;
public interface MobileService {
@@ -17,4 +18,5 @@
    void packComb(CombParam param, Long userId);
    void nodePutway(String zpallet, String locNo, User user);
}
src/main/java/com/zy/asrs/service/NodeService.java
New file
@@ -0,0 +1,32 @@
package com.zy.asrs.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.core.common.R;
import com.zy.asrs.entity.Node;
import com.zy.asrs.entity.param.InitPakoutParam;
import com.zy.asrs.entity.param.PakinParam;
import com.zy.system.entity.User;
import java.util.List;
public interface NodeService extends IService<Node> {
        Node getTop();
        Node selectByUuid(String uuid);
        Node selectByUuid(String uuid, Long hostId);
        Node selectByUuid(String uuid, Long hostId, Integer type);
        Node selectByUuid(String uuid, Long hostId, Integer type, Long parentId);
    R stockPakin(PakinParam number, Long userId, Long hostId, User user);
        R initPakout(List<InitPakoutParam> params, Long userId, Long hostId,User user);
    void locMove(String sourceLocNo, String targetLocNo, Long userId,User user);
    Page<Node> getPage(Page<Node> page);
}
src/main/java/com/zy/asrs/service/impl/ManLocDetlServiceImpl.java
New file
@@ -0,0 +1,203 @@
package com.zy.asrs.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.core.exception.CoolException;
import com.zy.asrs.entity.ManLocDetl;
import com.zy.asrs.entity.Mat;
import com.zy.asrs.entity.Node;
import com.zy.asrs.entity.param.LocDetlAdjustParam;
import com.zy.asrs.entity.result.StockVo;
import com.zy.asrs.mapper.ManLocDetlMapper;
import com.zy.asrs.service.ManLocDetlService;
import com.zy.asrs.service.MatService;
import com.zy.asrs.service.NodeService;
import com.zy.asrs.service.WaitPakinService;
import com.zy.asrs.utils.SaasUtils;
import com.zy.system.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Service("manLocDetlService")
public class ManLocDetlServiceImpl extends ServiceImpl<ManLocDetlMapper, ManLocDetl> implements ManLocDetlService {
    @Autowired
    private MatService matService;
    @Autowired
    private NodeService nodeService;
    @Autowired
    private WaitPakinService waitPakinService;
    @Override
    public Page<ManLocDetl> getPage(Page<ManLocDetl> page) {
        Map<String, Object> condition = page.getCondition();
        List<ManLocDetl> manLocDetls = baseMapper.listByPage(condition);
        page.setRecords(manLocDetls);
        page.setTotal(baseMapper.listByPageCount(page.getCondition()));
        return page;
    }
    @Override
    public Page<ManLocDetl> getStockOut(Page<ManLocDetl> page) {
        page.setRecords(baseMapper.getStockOutPage(page.getCondition()));
        page.setTotal(baseMapper.getStockOutPageCount(page.getCondition()));
        return page;
    }
    @Override
    public boolean updateAnfme(Double anfme, String locNo, String matnr, String batch) {
        if (anfme <= 0) {
            return this.baseMapper.deleteItem(locNo, matnr, batch) > 0;
        } else {
            return baseMapper.updateAnfme(anfme, locNo, matnr, batch) > 0;
        }
    }
    @Override
    public boolean updateLocNo(String newLocNo, String oldLocNo) {
        return baseMapper.updateLocNo(newLocNo, oldLocNo) > 0;
    }
    @Override
    public List<String> getSameDetlToday(String matnr, Integer start, Integer end) {
        return this.baseMapper.selectSameDetlToday(matnr, start, end);
    }
    @Override
    public Page<ManLocDetl> getStockStatis(Page<ManLocDetl> page) {
        page.setRecords(baseMapper.getStockStatis(page.getCondition()));
        page.setTotal(baseMapper.getStockStatisCount(page.getCondition()));
        return page;
    }
    @Override
    public Double getSumAnfme(String matnr) {
        return this.baseMapper.selectSumAnfmeByMatnr(matnr);
    }
    @Override
    public List<ManLocDetl> selectPakoutByRule(String matnr) {
        return this.baseMapper.selectPakoutByRule(matnr);
    }
    @Override
    public List<ManLocDetl> getAsrsLocDetl(String matnr) {
        return this.baseMapper.getAsrsLocDetl(matnr);
    }
    @Override
    public Integer countLocNoNum(String locNo) {
        return this.baseMapper.countLocNoNum(locNo);
    }
    @Override
    public List<ManLocDetl> queryStock(String matnr, String batch, String orderNo, Set<String> locNos) {
        return this.baseMapper.queryStock(matnr, batch, orderNo, locNos);
    }
    @Override
    public Double queryStockAnfme(String matnr, String batch) {
        return this.baseMapper.queryStockAnfme(matnr, batch);
    }
    @Override
    public List<StockVo> queryStockTotal() {
        return this.baseMapper.queryStockTotal();
    }
    /**
     * 获取库存总数
     *
     * @return
     */
    @Override
    public Integer sum() {
        return this.baseMapper.sum();
    }
    @Override
    public List<ManLocDetl> unreason() {
        return this.baseMapper.unreason();
    }
    @Override
    public ManLocDetl selectItem(String locNo, String matnr, String batch) {
        return this.baseMapper.selectItem(locNo, matnr, batch);
    }
    @Override
    public Double getLocDetlSumQty(String locNo) {
        return this.baseMapper.selectLocDetlSumQty(locNo);
    }
    @Override
    public Page<ManLocDetl> getOutPage(Page<ManLocDetl> manLocDetlPage) {
        Map<String, Object> condition = manLocDetlPage.getCondition();
        List<ManLocDetl> manLocDetls = baseMapper.listByOutPage(condition);
        manLocDetlPage.setRecords(manLocDetls);
        manLocDetlPage.setTotal(baseMapper.listByOutPageCount(manLocDetlPage.getCondition()));
        return manLocDetlPage;
    }
    @Transactional
    @Override
    public void adjustLocDetl(LocDetlAdjustParam param, Long userId, User user) {
        Date now = new Date();
        for (LocDetlAdjustParam.LocDetlAdjust locDetlAdjust : param.getList()) {
            ManLocDetl manLocDetl = this.baseMapper.selectItem(param.getLocNo(), locDetlAdjust.getMatnr(), locDetlAdjust.getBatch());
            this.baseMapper.delete(new EntityWrapper<ManLocDetl>()
                    .eq("loc_no", param.getLocNo()).eq("matnr",locDetlAdjust.getMatnr()));
            Mat mat = matService.selectOne(new EntityWrapper<Mat>()
                    .eq("matnr", locDetlAdjust.getMatnr()));
            if (mat == null) {
                throw new CoolException("无法找到需要调整的物料,请联系管理员");
            }
            Node node = nodeService.selectOne(new EntityWrapper<Node>()
                    .eq("uuid", param.getLocNo()));
            if (node == null) {
                throw new CoolException("无法找到需要调整的库位,请联系管理员");
            }
            manLocDetl.setAnfme(locDetlAdjust.getCount());
            manLocDetl.setUpdateBy(userId);
            manLocDetl.setModiTime(now);
            SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme(),user.getUsername());
            this.baseMapper.insert(manLocDetl);
        }
    }
    @Override
    public Page<ManLocDetl> selectAllPage(Page<ManLocDetl> param) {
        Map<String, Object> condition = param.getCondition();
        List<ManLocDetl> manLocDetls = baseMapper.selectAllPage(condition);
        param.setRecords(manLocDetls);
        param.setTotal(baseMapper.selectAllPageSize(condition));
        return param;
    }
    @Override
    public ManLocDetl selectInventory(String LocNo, String Matnr, String batch) {
        return baseMapper.selectInventory(LocNo,Matnr,batch);
    }
    @Override
    public int deleteDatailed(String locNo, String matnr, String batch) {
        return baseMapper.deleteDatailed(locNo,matnr,batch);
    }
    @Override
    public int increase(Double anfme,String locNo, String matnr, String batch,Double weight) {
        return baseMapper.increase(anfme,locNo,matnr,batch,weight);
    }
}
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -16,12 +16,15 @@
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.task.handler.WorkLogHandler;
import com.zy.asrs.utils.MatUtils;
import com.zy.asrs.utils.SaasUtils;
import com.zy.common.constant.MesConstant;
import com.zy.common.entity.Parameter;
import com.zy.common.model.DetlDto;
import com.zy.common.model.MesCombParam;
import com.zy.common.utils.HttpHandler;
import com.zy.system.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -63,6 +66,10 @@
    private ApiLogService apiLogService;
    @Autowired
    private WorkLogHandler workLogHandler;
    @Autowired
    private ManLocDetlService manLocDetlService;
    @Autowired
    private WaitPakinLogService waitPakinLogService;
    @Override
    @Transactional
@@ -125,7 +132,7 @@
                waitPakin.setThreeCode(detlDto.getCsocode());
                waitPakin.setDeadTime(detlDto.getIsoseq());
                waitPakin.setSuppCode(detlDto.getCsocode());
                waitPakin.setSuppCode(detlDto.getContainerCode());
                if (!waitPakinService.insert(waitPakin)) {
                    throw new CoolException("保存入库通知档失败");
                }
@@ -181,7 +188,7 @@
                waitPakin.setThreeCode(detlDto.getCsocode());
                waitPakin.setDeadTime(detlDto.getIsoseq());
                waitPakin.setSuppCode(detlDto.getCsocode());
                waitPakin.setSuppCode(detlDto.getContainerCode());
                if (!waitPakinService.insert(waitPakin)) {
                    throw new CoolException("保存入库通知档失败");
@@ -433,4 +440,53 @@
        }
    }
    @Transactional
    public void nodePutway(String zpallet, String locNo, User user) {
        Date now = new Date();
        //增加平库库存
        List<WaitPakin> waitPakinList = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", zpallet));
        waitPakinList.forEach(waitPakin -> {
            //料想码
            String containerCode = waitPakin.getSuppCode();
            //如果当前料想码已存在,则修改该料想的物料数量
            ManLocDetl manLocDetl = manLocDetlService.selectOne(new EntityWrapper<ManLocDetl>().eq("container_code", containerCode));
            if(Cools.isEmpty(manLocDetl)){
                saveManlocDetl(manLocDetl,waitPakin,now,locNo);
            }else{
                if(Cools.eq(manLocDetl.getMatnr(),waitPakin.getMatnr())
                        && Cools.eq(manLocDetl.getCsocode(),waitPakin.getThreeCode())
                        && Cools.eq(manLocDetl.getIsoseq(),waitPakin.getDeadTime())){
                    manLocDetl.setAnfme(manLocDetl.getAnfme() + waitPakin.getAnfme());
                    manLocDetlService.update(manLocDetl,new EntityWrapper<ManLocDetl>()
                            .eq("loc_no",manLocDetl.getLocNo())
                            .eq("container_code",manLocDetl.getContainerCode()));
                }else{
                    saveManlocDetl(manLocDetl,waitPakin,now,locNo);
                }
            }
            //生成平库入出库日志
            SaasUtils.insertLog(0,locNo,waitPakin.getMatnr(), waitPakin.getAnfme(),user.getUsername());
        });
        //生成入库通知历史档
        waitPakinLogService.save(zpallet);
        //删除入库通知档
        waitPakinService.delete(new EntityWrapper<WaitPakin>().eq("zpallet", zpallet));
    }
    private void saveManlocDetl(ManLocDetl manLocDetl, WaitPakin waitPakin, Date now, String locNo){
        manLocDetl = new ManLocDetl();
        BeanUtils.copyProperties(waitPakin,manLocDetl);
        manLocDetl.setContainerCode(waitPakin.getSuppCode());
        manLocDetl.setCsocode(waitPakin.getThreeCode());
        manLocDetl.setIsoseq(waitPakin.getDeadTime());
        manLocDetl.setCreateTime(now);
        manLocDetl.setModiTime(now);
        manLocDetl.setLocNo(locNo);
        manLocDetlService.insert(manLocDetl);
    }
}
src/main/java/com/zy/asrs/service/impl/NodeServiceImpl.java
New file
@@ -0,0 +1,227 @@
package com.zy.asrs.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.core.common.Cools;
import com.core.common.R;
import com.core.common.SnowflakeIdWorker;
import com.core.exception.CoolException;
import com.zy.asrs.entity.ManLocDetl;
import com.zy.asrs.entity.Mat;
import com.zy.asrs.entity.Node;
import com.zy.asrs.entity.OrderDetl;
import com.zy.asrs.entity.param.InitPakoutParam;
import com.zy.asrs.entity.param.MatnrDto;
import com.zy.asrs.entity.param.PakinParam;
import com.zy.asrs.mapper.NodeMapper;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.SaasUtils;
import com.zy.system.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service("nodeService")
public class NodeServiceImpl extends ServiceImpl<NodeMapper, Node> implements NodeService {
    @Autowired
    private NodeService nodeService;
    @Autowired
    private MatService matService;
    @Autowired
    private SnowflakeIdWorker snowflakeIdWorker;
    @Autowired
    private ManLocDetlService manLocDetlService;
    @Autowired
    private OrderDetlService orderDetlService;
    @Autowired
    private OrderService orderService;
    @Override
    public Node getTop() {
        Node top = this.selectOne(new EntityWrapper<Node>().eq("type", 0).eq("level", 0));
        if (top == null) {
            top = new Node();
            top.setName("全部");
            top.setUuid("全部");
            top.setType(0);
            top.setLevel(0);
            top.setSort(0);
            top.setStatus(1);
            top.setCreateTime(new Date());
            top.setUpdateTime(new Date());
            Integer insert = this.baseMapper.insert(top);
            if (insert == 0) {
                throw new CoolException("服务器异常");
            }
        }
        return top;
    }
    @Override
    public Node selectByUuid(String uuid) {
        return selectOne(new EntityWrapper<Node>().eq("uuid", uuid));
    }
    @Override
    public Node selectByUuid(String uuid, Long hostId) {
        return this.baseMapper.selectByUuid(uuid, hostId);
    }
    @Override
    public Node selectByUuid(String uuid, Long hostId, Integer type) {
        return selectOne(new EntityWrapper<Node>().eq("host_id", hostId).eq("uuid", uuid).eq("type", type));
    }
    @Override
    public Node selectByUuid(String uuid, Long hostId, Integer type, Long parentId) {
        return selectOne(new EntityWrapper<Node>().eq("host_id", hostId).eq("uuid", uuid).eq("type", type).eq("parent_id", parentId));
    }
    @Override
    public R stockPakin(PakinParam param, Long userId, Long hostId, User user) {
        Node node = nodeService.selectByUuid(param.getNodeId(), hostId);
        if (node == null) {
            node = nodeService.selectById(param.getNodeId());
        }
        if (node == null) {
            return R.error("货位不存在");
        }
        if (Cools.isEmpty(param.getMats())) {
            return R.error("入库物料不能为空");
        }
        Date now = new Date();
        for (MatnrDto dto : param.getMats()) {
            Mat mat = matService.selectByMatnr(dto.getMatnr());
            if (mat == null) {
                throw new CoolException("物料数据错误,请联系管理员");
            }
            ManLocDetl check = manLocDetlService.selectOne(new EntityWrapper<ManLocDetl>()
                    .eq("loc_no", node.getUuid())
                    .eq("matnr", dto.getMatnr()));
            if (check == null) {
                ManLocDetl manLocDetl = new ManLocDetl();
                manLocDetl.setLocNo(node.getUuid());
                manLocDetl.setNodeId(node.getId());
                manLocDetl.setZpallet(node.getUuid());
                manLocDetl.setAnfme(dto.getCount());
                manLocDetl.setMatnr(mat.getMatnr());
                manLocDetl.setMaktx(mat.getMaktx());
                manLocDetl.setName(mat.getName());
                manLocDetl.setBatch(null);
                manLocDetl.setSpecs(mat.getSpecs());
                manLocDetl.setModel(mat.getModel());
                manLocDetl.setCreateTime(now);
                manLocDetl.setModiTime(now);
                manLocDetl.setCreateBy(userId);
                manLocDetl.setStatus(1);
                manLocDetl.setPayment(1);
                SaasUtils.insertLog(0,manLocDetl.getLocNo(),manLocDetl.getMatnr(), manLocDetl.getAnfme(),user.getUsername());
                manLocDetlService.insert(manLocDetl);
            }else {
//                check.setAnfme(dto.getCount() + check.getAnfme());
//                manLocDetlService.update(check,new EntityWrapper<ManLocDetl>()
//                        .eq("loc_no", node.getUuid())
//                        .eq("matnr", dto.getMatnr()));
                return R.error("库位存在物料,请勿重复入库");
            }
            if (!Cools.isEmpty(dto.getOrderNo())) {
                OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>()
                        .eq("order_no", dto.getOrderNo())
                        .eq("matnr", dto.getMatnr()));
                orderDetl.setQty(orderDetl.getQty() + dto.getCount());
                orderDetlService.updateById(orderDetl);
                //orderService.checkSettleUpdate(orderDetl.getOrderId());
            }
        }
        return R.ok("入库成功");
    }
    @Transactional
    @Override
    public R initPakout(List<InitPakoutParam> params, Long userId, Long hostId,User user) {
        if (!Cools.isEmpty(params)) {
            Date now = new Date();
            for (InitPakoutParam param : params) {
                ManLocDetl manLocDetl = manLocDetlService.selectOne(new EntityWrapper<ManLocDetl>()
                        .eq("node_id", param.getNodeId())
                        .eq("matnr", param.getMatnr()));
                Node node = nodeService.selectOne(new EntityWrapper<Node>()
                        .eq("id", param.getNodeId()));
                if (node == null) {
                    return R.error("找不到该库位,请联系管理员:" + param.getNodeId() );
                }
                if (manLocDetl == null) {
                    return R.error("物料:"+ param.getMatnr() + " 在库位中不存在");
                }
                if (manLocDetl.getAnfme() - param.getCount() < 0) {
                    return R.error("物料:"+ param.getMatnr() + " 在库位中数量不足");
                } else if (manLocDetl.getAnfme() - param.getCount() == 0) {
                    SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount(),user.getUsername());
                    manLocDetlService.delete(new EntityWrapper<ManLocDetl>()
                            .eq("loc_no",node.getUuid())
                            .eq("matnr",param.getMatnr()));
                } else {
                    manLocDetl.setAnfme(manLocDetl.getAnfme() - param.getCount());
                    manLocDetlService.update(manLocDetl,new EntityWrapper<ManLocDetl>()
                            .eq("loc_no",node.getUuid())
                            .eq("matnr",param.getMatnr()));
                    SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount(),user.getUsername());
                }
            }
        }
        return R.ok("出库成功");
    }
    @Transactional
    @Override
    public void locMove(String sourceLocNo, String targetLocNo, Long userId,User user) {
        List<ManLocDetl> sourceManDetl = manLocDetlService.selectList(new EntityWrapper<ManLocDetl>()
                .eq("loc_no", sourceLocNo));
        for (ManLocDetl source : sourceManDetl) {
            Node targetNode = nodeService.selectOne(new EntityWrapper<Node>()
                    .eq("uuid", targetLocNo));
            Node sourceNode = nodeService.selectOne(new EntityWrapper<Node>()
                    .eq("uuid", sourceLocNo));
            if (targetNode == null || targetNode.equals("")) {
                throw new RuntimeException("无法查询到移库的目标库位");
            }
            ManLocDetl check = manLocDetlService.selectOne(new EntityWrapper<ManLocDetl>()
                    .eq("loc_no", targetNode.getUuid())
                    .eq("matnr", source.getMatnr()));
            if (check == null) {
                manLocDetlService.delete(new EntityWrapper<ManLocDetl>().eq("loc_no", source.getLocNo())
                        .eq("matnr", source.getMatnr()));
                source.setLocNo(targetNode.getUuid());
                source.setNodeId(targetNode.getId());
                SaasUtils.insertLog(2,source.getLocNo(), source.getMatnr(), source.getAnfme(),user.getUsername());
                manLocDetlService.insert(source);
            }else {
//                check.setAnfme(check.getAnfme() + source.getAnfme());
//                manLocDetlService.update(check,new EntityWrapper<ManLocDetl>()
//                        .eq("loc_no", targetNode.getUuid())
//                        .eq("matnr", check.getMatnr()));
//                manLocDetlService.delete(new EntityWrapper<ManLocDetl>()
//                        .eq("loc_no", sourceNode.getUuid())
//                        .eq("matnr", source.getMatnr()));
                throw new RuntimeException("目标库位有物");
            }
        }
    }
    @Override
    public Page<Node> getPage(Page<Node> page) {
        Map<String, Object> condition = page.getCondition();
        List<Node> manLocDetls = baseMapper.listByPage(condition);
        page.setRecords(manLocDetls);
        page.setTotal(baseMapper.listByPageCount(page.getCondition()));
        return page;
    }
}
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -823,6 +823,12 @@
                        adjDetl.setModiUser(userId);
                        adjDetl.setAppeTime(now);
                        adjDetl.setAppeUser(userId);
                        UUID uuid = UUID.randomUUID();
                        adjDetl.setOrderNo(uuid.toString());
                        adjDetl.setCsocode(locDetl.getThreeCode());
                        adjDetl.setIsoseq(locDetl.getDeadTime());
                        adjDetlService.save(adjDetl, userId);
                    }
                    iterator.remove();
@@ -848,6 +854,7 @@
            adjDetl.setModiUser(userId);
            adjDetl.setAppeTime(now);
            adjDetl.setAppeUser(userId);
            adjDetlService.save(adjDetl, userId);
        }
@@ -864,6 +871,8 @@
            locDetl.setModiTime(now);
            locDetl.setAppeUser(userId);
            locDetl.setAppeTime(now);
            locDetl.setThreeCode(adjust.getThreeCode());
            locDetl.setDeadTime(adjust.getDeadTime());
            if (!locDetlService.insert(locDetl)) {
                throw new CoolException("添加" + locDetl.getLocNo() + "库位," + locDetl.getMatnr() + "商品," + locDetl.getBatch() + "序列码库存明细失败");
            }
@@ -878,6 +887,12 @@
            adjDetl.setModiUser(userId);
            adjDetl.setAppeTime(now);
            adjDetl.setAppeUser(userId);
            UUID uuid = UUID.randomUUID();
            adjDetl.setOrderNo(uuid.toString());
            adjDetl.setCsocode(locDetl.getThreeCode());
            adjDetl.setIsoseq(locDetl.getDeadTime());
            adjDetlService.save(adjDetl, userId);
        }
        // 修改库位状态
src/main/java/com/zy/asrs/utils/SaasUtils.java
New file
@@ -0,0 +1,22 @@
package com.zy.asrs.utils;
import com.core.common.SpringUtils;
import com.zy.system.entity.SaasLog;
import com.zy.system.service.SaasLogService;
import java.util.Date;
public class SaasUtils {
    public static void insertLog(Integer type, String locNo, String matnr,Double anfme,String user){
        SaasLogService bean = SpringUtils.getBean(SaasLogService.class);
        SaasLog saasLog = new SaasLog();
        saasLog.setType(type);
        saasLog.setLocNo(locNo);
        saasLog.setMatnr(matnr);
        saasLog.setIoTime(new Date());
        saasLog.setAnfme(anfme);
        saasLog.setCreateBy(1L);
        saasLog.setCreateByName(user);
        bean.insert(saasLog);
    }
}
src/main/java/com/zy/common/entity/NodeExcel.java
New file
@@ -0,0 +1,18 @@
package com.zy.common.entity;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
@ExcelIgnoreUnannotated
public class NodeExcel {
    @ExcelProperty(index = 0, value = "仓库")
    private String warehouse;
    @ExcelProperty(index = 1, value = "库区")
    private String area;
    @ExcelProperty(index = 2, value = "货位")
    private String allo;
}
src/main/java/com/zy/common/entity/NodeExcelListener.java
New file
@@ -0,0 +1,146 @@
package com.zy.common.entity;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.Node;
import com.zy.asrs.mapper.NodeMapper;
import com.zy.asrs.service.NodeService;
import com.zy.common.utils.NodeUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
public class NodeExcelListener extends AnalysisEventListener<NodeExcel> {
    private int total = 0;
    private Long userId;
    private Long hostId;
    public NodeExcelListener() {
    }
    public NodeExcelListener(Long userId, Long hostId) {
        this.userId = userId;
        this.hostId = hostId;
    }
    /**
     * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收
     */
    private static final int BATCH_COUNT = 50;
    private final List<NodeExcel> list = new ArrayList<>();
    /**
     * 这里会一行行的返回头
     */
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
    }
    /**
     * 这个每一条数据解析都会来调用
     */
    @Override
    public void invoke(NodeExcel excel, AnalysisContext ctx) {
        NodeService nodeService = SpringUtils.getBean(NodeService.class);
        NodeMapper nodeMapper = SpringUtils.getBean(NodeMapper.class);
        Date now = new Date();
        Node top = nodeService.getTop();
        // 仓库
        if (!Cools.isEmpty(excel.getWarehouse())) {
            Node wareHouse = nodeService.selectByUuid(excel.getWarehouse(), hostId, 1, top.getId());
            if (wareHouse == null) {
                wareHouse = new Node();
                wareHouse.setHostId(this.hostId);
                wareHouse.setUuid(excel.getWarehouse());
                wareHouse.setName(excel.getWarehouse());
                wareHouse.setType(1);
                wareHouse.setParentId(top.getId());
                wareHouse.setParentName(top.getName());
                wareHouse.setLevel(top.getLevel() + 1);
                NodeUtils nodeUtils = new NodeUtils();
                nodeUtils.executePath(wareHouse);
                wareHouse.setPath(nodeUtils.path.toString());
                wareHouse.setNamePath(nodeUtils.pathName.toString());
                wareHouse.setStatus(1);
                wareHouse.setCreateTime(now);
                wareHouse.setUpdateTime(now);
                if (nodeMapper.insert(wareHouse) == 0) {
                    throw new CoolException("保存仓库数据失败");
                }
                total ++;
            }
            // 库区
            if (!Cools.isEmpty(excel.getArea())) {
                Node area = nodeService.selectByUuid(excel.getArea(), hostId, 2, wareHouse.getId());
                if (area == null) {
                    area = new Node();
                    area.setHostId(this.hostId);
                    area.setUuid(excel.getArea());
                    area.setName(excel.getArea());
                    area.setType(2);
                    area.setParentId(wareHouse.getId());
                    area.setParentName(wareHouse.getName());
                    area.setLevel(wareHouse.getLevel() + 1);
                    NodeUtils nodeUtils = new NodeUtils();
                    nodeUtils.executePath(area);
                    area.setPath(nodeUtils.path.toString());
                    area.setNamePath(nodeUtils.pathName.toString());
                    area.setStatus(1);
                    area.setCreateTime(now);
                    area.setUpdateTime(now);
                    if (nodeMapper.insert(area) == 0) {
                        throw new CoolException("保存库区数据失败");
                    }
                    total ++;
                }
                // 货位
                if (!Cools.isEmpty(excel.getAllo())) {
                    Node allo = nodeService.selectByUuid(excel.getAllo(), hostId, 3);
                    if (allo == null) {
                        allo = new Node();
                        allo.setHostId(this.hostId);
                        allo.setUuid(excel.getAllo());
                        allo.setName(excel.getAllo());
                        allo.setType(3);
                        allo.setParentId(area.getId());
                        allo.setParentName(area.getName());
                        allo.setLevel(area.getLevel() + 1);
                        NodeUtils nodeUtils = new NodeUtils();
                        nodeUtils.executePath(allo);
                        allo.setPath(nodeUtils.path.toString());
                        allo.setNamePath(nodeUtils.pathName.toString());
                        allo.setStatus(1);
                        allo.setCreateTime(now);
                        allo.setUpdateTime(now);
                        if (nodeMapper.insert(allo) == 0) {
                            throw new CoolException("保存货位数据失败");
                        }
                        total ++;
                    }
                }
            }
        }
    }
    /**
     * 所有数据解析完成了调用
     * 适合事务
     */
    @Override
    public void doAfterAllAnalysed(AnalysisContext ctx) {
        //log.info("新增{}条物料信息!", total);
    }
    public int getTotal() {
        return total;
    }
}
src/main/java/com/zy/common/utils/NodeUtils.java
@@ -1,7 +1,9 @@
package com.zy.common.utils;
import com.core.common.SpringUtils;
import com.zy.asrs.entity.Node;
import com.zy.asrs.entity.Tag;
import com.zy.asrs.service.NodeService;
import com.zy.asrs.service.TagService;
/**
@@ -43,4 +45,19 @@
        }
    }
    public void executePath(Node node) {
        NodeService bean = SpringUtils.getBean(NodeService.class);
        Node parent = bean.selectById(node.getParentId());
        if (null != parent) {
            path.insert(0, parent.getId()).insert(0,",");
            pathName.insert(0, parent.getName()).insert(0,",");
            if (parent.getParentId() != null) {
                executePath(parent);
            } else {
                path.deleteCharAt(0);
                pathName.deleteCharAt(0);
            }
        }
    }
}
src/main/java/com/zy/common/utils/TreeUtils.java
@@ -1,7 +1,10 @@
package com.zy.common.utils;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.zy.asrs.entity.Node;
import com.zy.asrs.entity.Tag;
import com.zy.asrs.service.NodeService;
import com.zy.asrs.service.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
@@ -18,6 +21,8 @@
    @Autowired
    private TagService tagService;
    @Autowired
    private NodeService nodeService;
    /******************************** 归类树 *********************************/
@@ -86,4 +91,51 @@
        }
    }
    /**
     * 获取树图数据结构
     */
    @Cacheable(cacheNames="nodeTree",key="#id")
    public ArrayList<Map> getNodeTree(String id, Long hostId){
        ArrayList<Map> result = new ArrayList<>();
        Node node = nodeService.selectById(id);
        // 主节点
        Map<String, Object> map = new HashMap<>();
        map.put("title", node.getName());
        map.put("id", node.getId());
        map.put("spread", true);
        List<Map> childrens = new ArrayList<>();
        map.put("children", childrens);
        dealNode(node, childrens, hostId);
        result.add(map);
        // 开始处理字节点
//        deal(tag, childrens);
        return result;
    }
    /**
     * 递归获取子节点数据
     */
    public void dealNode(Node parent, List<Map> list, Long hostId) {
        Wrapper<Node> wrapper = new EntityWrapper<Node>()
                .eq("parent_id", parent.getId())
                .eq("status", "1")
                .ne("type",3);
        if (hostId != null) {
            wrapper.eq("host_id", hostId);
        }
        List<Node> nodes = nodeService.selectList(wrapper);
        for (Node node : nodes) {
            Map<String, Object> map = new HashMap<>();
            map.put("title", node.getName());
            map.put("id", node.getId());
            map.put("spread", true);
            List<Map> childrens = new ArrayList<>();
            map.put("children", childrens);
            dealNode(node, childrens, hostId);
            list.add(map);
        }
    }
}
src/main/java/com/zy/common/web/BaseController.java
@@ -1,6 +1,5 @@
package com.zy.common.web;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
@@ -8,9 +7,13 @@
import com.core.common.Cools;
import com.core.controller.AbstractBaseController;
import com.core.exception.CoolException;
import com.zy.asrs.entity.Node;
import com.zy.asrs.entity.Tag;
import com.zy.asrs.service.NodeService;
import com.zy.asrs.service.TagService;
import com.zy.system.entity.User;
import com.zy.system.entity.UserLogin;
import com.zy.system.service.UserLoginService;
import com.zy.system.service.UserService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
@@ -33,6 +36,11 @@
    private UserService userService;
    @Autowired
    private TagService tagService;
    @Autowired
    private NodeService nodeService;
    @Autowired
    private UserLoginService userLoginService;
    protected Long getUserId(){
        return Long.parseLong(String.valueOf(request.getAttribute("userId")));
@@ -58,6 +66,14 @@
    protected Tag getOriginTag(){
        return tagService.getTop();
    }
    protected Node getOriginNode(){
        Node node = nodeService.getTop();
        if (node == null) {
            throw new CoolException("库区数据错误");
        }
        return node;
    }
    /**
@@ -158,4 +174,32 @@
            }
        }
    }
    protected <T> void hostEq(EntityWrapper<T> wrapper){
        Long hostId = getHostId();
        if (hostId != null) {
            wrapper.eq("host_id", hostId);
        }
    }
    protected Long getHostId(){
        if (getUserId() == 9527) {
            return null;
        }
        User user = getUser();
        if (user.getRoleId() == 1) {
            String hostId = String.valueOf(request.getAttribute("hostId"));
            if (Cools.isEmpty(hostId)) {
                UserLogin userLogin = userLoginService.selectOne(new EntityWrapper<UserLogin>().eq("user_id", user.getId()));
                if (userLogin != null) {
                    //return userLogin.getHostId();
                    return 1L;
                }
            }
            return Long.parseLong(hostId);
        } else {
            return user.getHostId();
        }
    }
}
src/main/java/com/zy/system/controller/SaasLogController.java
New file
@@ -0,0 +1,126 @@
package com.zy.system.controller;
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.annotations.ManagerAuth;
import com.core.common.BaseRes;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.R;
import com.zy.common.web.BaseController;
import com.zy.system.entity.SaasLog;
import com.zy.system.service.SaasLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
public class SaasLogController extends BaseController {
    @Autowired
    private SaasLogService saasLogService;
    @RequestMapping(value = "/saasLog/{id}/auth")
    @ManagerAuth
    public R get(@PathVariable("id") String id) {
        return R.ok(saasLogService.selectById(String.valueOf(id)));
    }
    @RequestMapping(value = "/saasLog/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<SaasLog> wrapper = new EntityWrapper<>();
        excludeTrash(param);
        convert(param, wrapper);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        wrapper.orderBy("io_time",false);
        return R.ok(saasLogService.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 = "/saasLog/add/auth")
    @ManagerAuth
    public R add(SaasLog saasLog) {
        saasLogService.insert(saasLog);
        return R.ok();
    }
    @RequestMapping(value = "/saasLog/update/auth")
    @ManagerAuth
    public R update(SaasLog saasLog){
        if (Cools.isEmpty(saasLog) || null==saasLog.getId()){
            return R.error();
        }
        saasLogService.updateById(saasLog);
        return R.ok();
    }
    @RequestMapping(value = "/saasLog/delete/auth")
    @ManagerAuth
    public R delete(@RequestParam(value="ids[]") Long[] ids){
         for (Long id : ids){
            saasLogService.deleteById(id);
        }
        return R.ok();
    }
    @RequestMapping(value = "/saasLog/export/auth")
    @ManagerAuth
    public R export(@RequestBody JSONObject param){
        EntityWrapper<SaasLog> wrapper = new EntityWrapper<>();
        List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
        Map<String, Object> map = excludeTrash(param.getJSONObject("saasLog"));
        convert(map, wrapper);
        List<SaasLog> list = saasLogService.selectList(wrapper);
        return R.ok(exportSupport(list, fields));
    }
    @RequestMapping(value = "/saasLogQuery/auth")
    @ManagerAuth
    public R query(String condition) {
        EntityWrapper<SaasLog> wrapper = new EntityWrapper<>();
        wrapper.like("id", condition);
        Page<SaasLog> page = saasLogService.selectPage(new Page<>(0, 10), wrapper);
        List<Map<String, Object>> result = new ArrayList<>();
        for (SaasLog saasLog : page.getRecords()){
            Map<String, Object> map = new HashMap<>();
            map.put("id", saasLog.getId());
            map.put("value", saasLog.getId());
            result.add(map);
        }
        return R.ok(result);
    }
    @RequestMapping(value = "/saasLog/check/column/auth")
    @ManagerAuth
    public R query(@RequestBody JSONObject param) {
        Wrapper<SaasLog> wrapper = new EntityWrapper<SaasLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
        if (null != saasLogService.selectOne(wrapper)){
            return R.parse(BaseRes.REPEAT).add(getComment(SaasLog.class, String.valueOf(param.get("key"))));
        }
        return R.ok();
    }
}
src/main/java/com/zy/system/entity/SaasLog.java
New file
@@ -0,0 +1,101 @@
package com.zy.system.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.core.common.Cools;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
@Data
@TableName("sys_saas_log")
public class SaasLog implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    @ApiModelProperty(value= "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * {0:入库,1:出库}
     */
    @ApiModelProperty(value= "{0:入库,1:出库}")
    private Integer type;
    @ApiModelProperty(value= "")
    @TableField("loc_no")
    private String locNo;
    @ApiModelProperty(value= "")
    private String matnr;
    @ApiModelProperty(value= "")
    @TableField("io_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date ioTime;
    @ApiModelProperty(value= "")
    @TableField("create_by")
    private Long createBy;
    @TableField("anfme")
    private Double anfme;
    @ApiModelProperty(value= "")
    @TableField("create_by_name")
    private String createByName;
    public SaasLog() {}
    public SaasLog(Long id, Integer type, String locNo, String matnr, Date ioTime, Long createBy) {
        this.id = id;
        this.type = type;
        this.locNo = locNo;
        this.matnr = matnr;
        this.ioTime = ioTime;
        this.createBy = createBy;
    }
//    SaasLog saasLog = new SaasLog(
//            null,    // id[非空]
//            null,    // {0:入库,1:出库}
//            null,    //
//            null,    //
//            null,    //
//            null    //
//    );
    public String getIoTime$(){
        if (Cools.isEmpty(this.ioTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ioTime);
    }
    public String getType$(){
        if (this.type ==0) {
            return "入库";
           } else if (this.type == 1) {
            return "出库";
        } else if (this.type == 2) {
            return "库位移转";
        } else if (this.type == 3) {
            return "库存调整";
        }else {
            return "";
        }
    }
}
src/main/java/com/zy/system/entity/UserLogin.java
@@ -7,12 +7,14 @@
import com.zy.system.service.UserService;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import lombok.Data;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
@TableName("sys_user_login")
@Data
public class UserLogin implements Serializable {
    private static final long serialVersionUID = 1L;
src/main/java/com/zy/system/mapper/SaasLogMapper.java
New file
@@ -0,0 +1,12 @@
package com.zy.system.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zy.system.entity.SaasLog;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface SaasLogMapper extends BaseMapper<SaasLog> {
}
src/main/java/com/zy/system/service/SaasLogService.java
New file
@@ -0,0 +1,8 @@
package com.zy.system.service;
import com.baomidou.mybatisplus.service.IService;
import com.zy.system.entity.SaasLog;
public interface SaasLogService extends IService<SaasLog> {
}
src/main/java/com/zy/system/service/impl/SaasLogServiceImpl.java
New file
@@ -0,0 +1,12 @@
package com.zy.system.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zy.system.entity.SaasLog;
import com.zy.system.mapper.SaasLogMapper;
import com.zy.system.service.SaasLogService;
import org.springframework.stereotype.Service;
@Service("saasLogService")
public class SaasLogServiceImpl extends ServiceImpl<SaasLogMapper, SaasLog> implements SaasLogService {
}
src/main/resources/application.yml
@@ -10,8 +10,8 @@
    enabled: false
  datasource:
    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
    #url: jdbc:sqlserver://192.168.4.15:1433;databasename=tzskasrs
    url: jdbc:sqlserver://localhost:1433;databasename=tzskasrs
    url: jdbc:sqlserver://192.168.4.15:1433;databasename=tzskasrs
    #url: jdbc:sqlserver://localhost:1433;databasename=tzskasrs
    username: sa
    password: sa@123
  mvc:
src/main/resources/mapper/ManLocDetlMapper.xml
New file
@@ -0,0 +1,377 @@
<?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.ManLocDetlMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.ManLocDetl">
        <result column="host_id" property="hostId" />
        <result column="loc_no" property="locNo" />
        <result column="node_id" property="nodeId" />
        <result column="zpallet" property="zpallet" />
        <result column="anfme" property="anfme" />
        <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="batch" property="batch" />
        <result column="unit" property="unit" />
        <result column="barcode" property="barcode" />
        <result column="doc_id" property="docId" />
        <result column="doc_num" property="docNum" />
        <result column="cust_name" property="custName" />
        <result column="item_num" property="itemNum" />
        <result column="count" property="count" />
        <result column="price" property="price" />
        <result column="weight" property="weight" />
        <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="modi_time" property="modiTime" />
        <result column="memo" property="memo" />
        <result column="owner" property="owner" />
        <result column="payment" property="payment" />
        <result column="real_anfme" property="realAnfme" />
        <result column="order_no" property="orderNo" />
    </resultMap>
    <sql id="locDetlCondition">
        <if test="host_id != null and host_id != ''">
            and mld.host_id = #{host_id}
        </if>
        <if test="loc_no != null and loc_no != ''">
            and mld.loc_no like concat('%',#{loc_no},'%')
        </if>
        <if test="locNo != null and locNo != ''">
            and mld.loc_no like concat('%',#{loc_no},'%')
        </if>
        <if test="matnr != null and matnr != ''">
            and mld.matnr like concat('%',#{matnr},'%')
        </if>
        <if test="maktx != null and maktx != ''">
            and mld.maktx like concat('%',#{maktx},'%')
        </if>
        <if test="zpallet != null and zpallet != ''">
            and mld.zpallet like concat('%',#{zpallet},'%')
        </if>
        <if test="startTime!=null and endTime!=null">
            and mld.update_time between #{startTime} and #{endTime}
        </if>
    </sql>
    <sql id="locDetlCondition2">
        <if test="host_id != null and host_id != ''">
            and v.host_id = #{host_id}
        </if>
        <if test="loc_no != null and loc_no != ''">
            and v.loc_no like concat('%',#{loc_no},'%')
        </if>
        <if test="locNo != null and locNo != ''">
            and v.loc_no like concat('%',#{loc_no},'%')
        </if>
        <if test="matnr != null and matnr != ''">
            and v.matnr like concat('%',#{matnr},'%')
        </if>
        <if test="maktx != null and maktx != ''">
            and v.maktx like concat('%',#{maktx},'%')
        </if>
        <if test="startTime!=null and endTime!=null">
            and v.update_time between #{startTime} and #{endTime}
        </if>
    </sql>
    <select id="listByPage" resultMap="BaseResultMap" parameterType="java.util.Map">
        select * from
        (
        SELECT
        ROW_NUMBER() over (order by mld.create_time desc) as row,
        mld.*
        FROM man_loc_detl mld
        LEFT JOIN man_node mn ON mld.node_id = mn.id
        LEFT JOIN man_mat mm ON mld.matnr = mm.matnr
        LEFT JOIN man_tag mt ON mm.tag_id = mt.id
        WHERE 1=1
         AND (CHARINDEX(#{node_id}, mn.path) > 0 OR mn.id = #{node_id})
        <include refid="locDetlCondition"></include>
        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
    </select>
    <select id="listByPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
        select
        count(1)
        FROM man_loc_detl mld
        LEFT JOIN man_node mn ON mld.node_id = mn.id
        LEFT JOIN man_mat mm ON mld.matnr = mm.matnr
        LEFT JOIN man_tag mt ON mm.tag_id = mt.id
        WHERE 1=1
        AND (CHARINDEX(#{node_id}, mn.path) > 0 OR mn.id = #{node_id})
        <include refid="locDetlCondition"></include>
    </select>
    <select id="selectByLocNoAndMatnr" resultMap="BaseResultMap">
        select top 1 *
        from man_loc_detl
        where 1=1
        and anfme > 0
        <if test="nodeId != null and nodeId != ''">
            and node_id = #{nodeId}
        </if>
        <if test="matnr != null and matnr != ''">
            and matnr = #{matnr}
        </if>
        order by create_time asc
    </select>
    <select id="selectCountByMatnr" resultType="java.lang.Double">
       select sum(anfme) as count from man_loc_detl where 1=1 and matnr = #{matnr} and host_id = #{hostId}
    </select>
    <update id="reduceStock">
        update man_loc_detl
        set anfme = anfme - #{anfme}
        , update_time = getdate()
        where 1=1
        and node_id = #{nodeId}
        and matnr = #{matnr}
    </update>
    <update id="incrementStock">
        update man_loc_detl
        set anfme = anfme + #{anfme}
        , update_time = getdate()
        where 1=1
        and node_id = #{nodeId}
        and matnr = #{matnr}
    </update>
    <update id="removeStock">
        delete from man_loc_detl
        where 1=1
        and node_id = #{nodeId}
        and matnr = #{matnr}
    </update>
    <select id="selectByPrior" resultMap="BaseResultMap">
        select
        mld.*
        from man_loc_detl mld
        left join man_prior mp on mld.node_id = mp.node_id and mld.matnr = mp.matnr
        where 1=1
        <if test="hostId != null and hostId != ''">
            and mld.host_id = #{hostId}
        </if>
        <if test="nodeId != null and nodeId != ''">
            and mld.node_id = #{nodeId}
        </if>
        <if test="matnr != null and matnr != ''">
            and mld.matnr = #{matnr}
        </if>
        and mld.anfme > 0
        and mp.status = 1
        order by mp.prio desc, mld.create_time asc
    </select>
    <select id="getLocDetlStatis" resultMap="BaseResultMap">
        select
        ROW_NUMBER() over (order by sum(a.anfme) desc) as row
        , a.matnr
        , sum(a.anfme) as anfme
        from man_loc_detl a
        where 1=1
        group by a.matnr
    </select>
    <select id="selectByNodeUuid" resultMap="BaseResultMap">
        select * from man_loc_detl mld left join man_node mn on mld.node_id = mn.id
        where 1=1
        and mn.uuid = #{uuid}
        and mld.hostId = #{hostId}
        and mld.status = 1
        order by mld.create_time
    </select>
    <select id="getStockStatis" resultMap="BaseResultMap">
        select * from
        (
        select
        ROW_NUMBER() over (order by a.matnr, sum(a.anfme) desc) as row
        , a.matnr
        , sum(a.anfme) as anfme
        from man_loc_detl a
        where 1=1
        <include refid="stockOutCondition"></include>
        group by a.matnr
        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
    </select>
    <select id="getStockStatisCount" parameterType="java.util.Map" resultType="java.lang.Integer">
        select count(1) as count from
        (
        select
        a.matnr
        from man_loc_detl a
        where 1=1
        <include refid="stockOutCondition"></include>
        group by a.matnr
        ) b
    </select>
    <sql id="stockOutCondition">
        <if test="host_id!=null and host_id!='' ">
            and a.host_id = #{host_id}
        </if>
        <if test="node_id!=null and node_id!='' ">
            and a.node_id like '%' + #{node_id} + '%'
        </if>
        <if test="loc_no!=null and loc_no!='' ">
            and a.loc_no like '%' + #{loc_no} + '%'
        </if>
        <if test="matnr!=null and matnr!='' ">
            and a.matnr like '%' + #{matnr} + '%'
        </if>
        <if test="maktx!=null and maktx!='' ">
            and a.maktx like '%' + #{maktx} + '%'
        </if>
    </sql>
    <select id="getStockStatisExcel" resultMap="BaseResultMap">
        select
        ROW_NUMBER() over (order by a.matnr, sum(a.anfme) desc) as row
        , a.matnr
        , sum(a.anfme) as anfme
        from man_loc_detl a
        where 1=1
        and a.host_id = #{hostId}
        group by a.matnr
    </select>
    <select id="selectLocDetlSumQty" resultType="java.lang.Double"></select>
    <select id="selectLocNo0" resultMap="BaseResultMap">
        select * from man_loc_detl
        where loc_no = #{locNo}
        and matnr = #{matnr}
    </select>
    <select id="selectItem" resultMap="BaseResultMap">
        select top 1 * from man_loc_detl
        where loc_no = #{locNo}
        and matnr = #{matnr}
        <if test="batch!=null and batch!='' ">
            and batch = #{batch}
        </if>
        <!--        <choose>-->
        <!--            <when test="batch != null and batch != ''">-->
        <!--                and batch = #{batch}-->
        <!--            </when>-->
        <!--            <otherwise>-->
        <!--                and (batch IS NULL OR batch = '')-->
        <!--            </otherwise>-->
        <!--        </choose>-->
    </select>
    <select id="listByOutPage" resultMap="BaseResultMap">
        select * from
        (
        SELECT
        ROW_NUMBER() over (order by mld.create_time desc) as row,
        mld.*
        FROM man_loc_detl mld
        LEFT JOIN man_node mn ON mld.node_id = mn.id
        LEFT JOIN man_mat mm ON mld.matnr = mm.matnr
        LEFT JOIN man_tag mt ON mm.tag_id = mt.id
        WHERE 1=1
        <include refid="locDetlCondition"></include>
        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
    </select>
    <select id="listByOutPageCount" resultType="java.lang.Long">
        select
        count(1)
        FROM man_loc_detl mld
        LEFT JOIN man_node mn ON mld.node_id = mn.id
        LEFT JOIN man_mat mm ON mld.matnr = mm.matnr
        LEFT JOIN man_tag mt ON mm.tag_id = mt.id
        WHERE 1=1
        <include refid="locDetlCondition"></include>
    </select>
    <select id="selectAllPage" resultMap="BaseResultMap">
        select * from
        (
        SELECT
        ROW_NUMBER() over (order by v.loc_no desc) as row,
            v.*
        FROM [dbo].[man_view_asrs_saas] v
        WHERE 1=1
        <include refid="locDetlCondition2"></include>
        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
    </select>
    <select id="selectAllPageSize" resultType="java.lang.Long">
        select
        count(1)
        FROM [dbo].[man_view_asrs_saas] v
        WHERE 1=1
        <include refid="locDetlCondition2"></include>
    </select>
    <update id="updateLocNo0">
        update man_loc_detl set loc_no = #{locNo}
        where node_id = #{nodeId}
    </update>
    <delete id="deleteLocNo0">
        delete from man_loc_detl
        where loc_no = #{locNo}
        and matnr = #{matnr}
    </delete>
    <update id="updateAnfme0">
        update man_loc_detl set anfme = #{anfme}
        where node_id = #{nodeId} ;
    </update>
    <select id="selectInventory" resultMap="BaseResultMap">
        select top 1 * from man_loc_detl
        where loc_no=#{LocNo}
        and 1=1
        and matnr=#{Matnr}
        <choose>
            <when test="batch != null and batch != ''">
                and batch = #{batch}
            </when>
            <otherwise>
                and (batch IS NULL OR batch = '')
            </otherwise>
        </choose>
    </select>
    <delete id="deleteDatailed">
        delete from man_loc_detl
        where loc_no = #{locNo}
        and matnr = #{matnr}
        <choose>
            <when test="batch != null and batch != ''">
                and batch = #{batch}
            </when>
            <otherwise>
                and (batch IS NULL OR batch = '')
            </otherwise>
        </choose>
    </delete>
    <update id="increase">
        update man_loc_detl
        set  anfme= #{anfme}
        , modi_time = getdate()
        ,weight=#{weight}
        where 1=1
        and loc_no = #{locNo}
        and matnr = #{matnr}
<!--        <choose>-->
<!--            <when test="batch != null and batch!=''  ">-->
<!--                and batch = #{batch}-->
<!--            </when>-->
<!--            <otherwise>-->
<!--                and (batch IS NULL OR batch = '')-->
<!--            </otherwise>-->
<!--        </choose>-->
    </update>
</mapper>
src/main/webapp/static/js/adjDetl/adjDetl.js
@@ -21,9 +21,12 @@
            // {type: 'checkbox'}
//            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
//             {field: 'adjId', align: 'center',title: '序号'}
            {field: 'locNo', align: 'center',title: '库位号'}
            {field: 'orderNo', align: 'center',title: '订单号'}
            ,{field: 'locNo', align: 'center',title: '库位号'}
            ,{field: 'matnr', align: 'center',title: '物料号'}
            ,{field: 'batch', align: 'center',title: '序列码'}
            ,{field: 'csocode', align: 'center',title: '销售订单号'}
            ,{field: 'isoseq', align: 'center',title: '销售订单行号'}
            ,{field: 'batch', align: 'center',title: '序列码',hide: true}
            // ,{field: 'oriCtns', align: 'center',title: '原箱数'}
            ,{field: 'oriQty', align: 'center',title: '原数量'}
            // ,{field: 'oriWt', align: 'center',title: '原重量'}
src/main/webapp/static/js/common.js
@@ -229,8 +229,9 @@
    ,{field: 'matnr', align: 'center',title: '存货编码'}
    ,{field: 'batch', align: 'center',title: '序列码', width: 300, sort:true, hide: true}
    ,{field: 'maktx', align: 'center',title: '存货名称'}
    ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false}
    ,{field: 'threeCode', align: 'center',title: '销售订单号'}
    ,{field: 'dead_time', align: 'center',title: '销售订单行号'}
    ,{field: 'deadTime', align: 'center',title: '销售订单行号'}
    ,{field: 'specs', align: 'center',title: '规格型号', hide: false}
    ,{field: 'model', align: 'center',title: '通用型号', hide: false}
src/main/webapp/static/js/manLocDetl/manLocDetl.js
New file
@@ -0,0 +1,578 @@
var pageCurr;
function getCol() {
    var cols = [
        {field: 'locNo', align: 'center',title: '库位号'}
        ,{field: 'suppCode', align: 'center',title: '料想码', sort:true}
        ,{field: 'matnr', align: 'center',title: '存货编码', sort:true}
        ,{field: 'maktx', align: 'center',title: '存货名称', sort:true}
        ,{field: 'docNum', align: 'center',title: '单据编号', hide: true}
        ,{field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'threeCode', align: 'center',title: '销售订单号'}
        ,{field: 'dead_time', align: 'center',title: '销售订单行号'}
        ,{field: 'specs', align: 'center',title: '规格型号', hide: false}
        ,{field: 'model', align: 'center',title: '通用型号', hide: false}
        ,{field: 'brand', align: 'center',title: '存货分类编码', hide: true}
        ,{field: 'color', align: 'center',title: '存货分类名称', hide: true}
        ,{field: 'unit', align: 'center',title: '计量单位', hide: true}
        ,{field: 'price', align: 'center',title: '进项税', hide: true}
        ,{field: 'units', align: 'center',title: '销项税', hide: true}
        ,{field: 'dsDate', align: 'center',title: '启用日期', hide: true}
        ,{field: 'supp', align: 'center',title: '建档人', hide: true}
        ,{field: 'dInvCreateDatetime', align: 'center',title: '建档日期', hide: true}
        // ,{field: 'specs', align: 'center',title: '规格'}
        // ,{field: 'weight', align: 'center',title: '库位总重量', hide: false}
        //
        // ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true, hide: true}
        // ,{field: 'anfme', align: 'center',title: '数量'}
        // ,{field: 'zpallet', align: 'center',title: '托盘条码'}
        // ,{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: true}
        // ,{field: 'price', align: 'center',title: '单价', hide: true}
        // ,{field: 'sku', align: 'center',title: 'sku', 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: '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: true}
        // ,{field: 'deadTime', align: 'center',title: '保质期', hide: true}
        // ,{field: 'deadWarn', align: 'center',title: '预警天数', hide: true}
        // ,{field: 'source$', align: 'center',title: '制购', hide: true}
        // ,{field: 'check$', align: 'center',title: '要求检验', hide: true}
        // ,{field: 'danger$', align: 'center',title: '危险品', hide: true}
        // ,{field: 'owner$', align: 'center',title: '货主', hide: false}
        // ,{field: 'status$', align: 'center',title: '明细锁', hide: false}
        // ,{field: 'payment$', align: 'center',title: '货物形态', hide: false}
    ];
    // cols.push.apply(cols, detlCols);
    cols.push({field: 'modiUser$', align: 'center',title: '修改人员',hide: true}
        ,{field: 'modiTime$', align: 'center',title: '修改时间'}
    )
    return cols;
}
layui.use(['table','laydate', 'form'], function(){
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var layDate = layui.laydate;
    var form = layui.form;
    // 数据渲染
    tableIns = table.render({
        elem: '#locDetl',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/manLocDetl/list/auth',
        page: true,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
        even: true,
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cols: [getCol()],
        request: {
            pageName: 'curr',
            pageSize: 'limit'
        },
        parseData: function (res) {
            console.log(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();
            form.on('checkbox(tableCheckbox)', function (data) {
                var _index = $(data.elem).attr('table-index')||0;
                if(data.elem.checked){
                    res.data[_index][data.value] = 'Y';
                }else{
                    res.data[_index][data.value] = 'N';
                }
            });
        }
    });
    // 监听排序事件
    table.on('sort(locDetl)', 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
            },
            done: function (res, curr, count) {
                if (res.code === 403) {
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                limit();
            }
        });
    });
    // 监听头工具栏事件
    table.on('toolbar(locDetl)', function (obj) {
        var checkStatus = table.checkStatus(obj.config.id);
        switch(obj.event) {
            case 'addData':
                layer.open({
                    type: 2,
                    title: '新增',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
                    content: 'locDetl_detail.html',
                    success: function(layero, index){
                        layer.getChildFrame('#data-detail-submit-edit', index).hide();
                        clearFormVal(layer.getChildFrame('#detail', index));
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                    }
                });
                break;
            case 'refreshData':
                tableIns.reload({
                    page: {
                        curr: pageCurr
                    }
                });
                limit();
                break;
            case 'deleteData':
                var data = checkStatus.data;
                if (data.length === 0){
                    layer.msg('请选择数据');
                } else {
                    layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){
                        $.ajax({
                            url: baseUrl+"/locDetl/delete/auth",
                            headers: {'token': localStorage.getItem('token')},
                            data: {param: JSON.stringify(data)},
                            method: 'POST',
                            traditional:true,
                            success: function (res) {
                                if (res.code === 200){
                                    layer.closeAll();
                                    tableReload(false);
                                } else if (res.code === 403){
                                    top.location.href = baseUrl+"/";
                                } else {
                                    layer.msg(res.msg)
                                }
                            }
                        })
                    });
                }
                break;
            case 'exportData':
                layer.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 = {
                        'locDetl': exportData,
                        'fields': fields
                    };
                    var loadIndex = layer.msg('正在导出...', {icon: 16, shade: 0.01, time: false});
                    $.ajax({
                        url: baseUrl+"/locDetl/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.close(loadIndex);
                            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)
                            }
                        }
                    });
                });
                break;
        }
    });
    // 监听行工具事件
    table.on('tool(locDetl)', function(obj){
        var data = obj.data;
        switch (obj.event) {
            // 详情
            case 'detail':
                layer.open({
                    type: 2,
                    title: '详情',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
                    content: 'locDetl_detail.html',
                    success: function(layero, index){
                        setFormVal(layer.getChildFrame('#detail', index), data, true);
                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                    }
                });
                break;
            // 编辑
            case 'edit':
                layer.open({
                    type: 2,
                    title: '修改',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
                    content: 'locDetl_detail.html',
                    success: function(layero, index){
                        layer.getChildFrame('#data-detail-submit-save', index).hide();
                        setFormVal(layer.getChildFrame('#detail', index), data, false);
                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false);
                        top.convertDisabled(layer.getChildFrame('#locNo,#matnr', index), true);
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                    }
                });
                break;
            case 'locNo':
                var param = top.reObject(data).locNo;
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                    layer.open({
                        type: 2,
                        title: '库位号详情',
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
                        content: '../locMast/locMast_detail.html',
                        success: function(layero, index){
                            $.ajax({
                                url: baseUrl+"/locMast/"+ param +"/auth",
                                headers: {'token': localStorage.getItem('token')},
                                method: 'GET',
                                success: function (res) {
                                    if (res.code === 200){
                                        setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                    } else if (res.code === 403){
                                        parent.location.href = "/";
                                    }else {
                                        layer.msg(res.msg)
                                    }
                                }
                            })
                        }
                    });
                }
                break;
            case 'modiUser':
                var param = top.reObject(data).modiUser;
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                    layer.open({
                        type: 2,
                        title: '修改人员详情',
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
                        content: '../user/user_detail.html',
                        success: function(layero, index){
                            $.ajax({
                                url: baseUrl+"/user/"+ param +"/auth",
                                headers: {'token': localStorage.getItem('token')},
                                method: 'GET',
                                success: function (res) {
                                    if (res.code === 200){
                                        setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                    } else if (res.code === 403){
                                        parent.location.href = "/";
                                    }else {
                                        layer.msg(res.msg)
                                    }
                                }
                            })
                        }
                    });
                }
                break;
            case 'appeUser':
                var param = top.reObject(data).appeUser;
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                    layer.open({
                        type: 2,
                        title: '创建者详情',
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
                        content: '../user/user_detail.html',
                        success: function(layero, index){
                            $.ajax({
                                url: baseUrl+"/user/"+ param +"/auth",
                                headers: {'token': localStorage.getItem('token')},
                                method: 'GET',
                                success: function (res) {
                                    if (res.code === 200){
                                        setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                    } else if (res.code === 403){
                                        parent.location.href = "/";
                                    }else {
                                        layer.msg(res.msg)
                                    }
                                }
                            })
                        }
                    });
                }
                break;
        }
    });
    // 数据保存动作
    form.on('submit(save)', function () {
        if (banMsg != null){
            layer.msg(banMsg);
            return;
        }
        method("add");
    });
    // 数据修改动作
    form.on('submit(edit)', function () {
        method("update")
    });
    function method(name){
        var index = layer.load(1, {
            shade: [0.5,'#000'] //0.1透明度的背景
        });
        var data = {
//            id: $('#id').val(),
            locNo: $('#locNo').val(),
            matnr: $('#matnr').val(),
            lgnum: $('#lgnum').val(),
            tbnum: $('#tbnum').val(),
            tbpos: $('#tbpos').val(),
            zmatid: $('#zmatid').val(),
            maktx: $('#maktx').val(),
            werks: $('#werks').val(),
            anfme: $('#anfme').val(),
            altme: $('#altme').val(),
            zpallet: $('#zpallet').val(),
            bname: $('#bname').val(),
            memo: $('#memo').val(),
            modiUser: $('#modiUser').val(),
            modiTime: top.strToDate($('#modiTime\\$').val()),
            appeUser: $('#appeUser').val(),
            appeTime: top.strToDate($('#appeTime\\$').val()),
        };
        $.ajax({
            url: baseUrl+"/locDetl/"+name+"/auth",
            headers: {'token': localStorage.getItem('token')},
            data: top.reObject(data),
            method: 'POST',
            success: function (res) {
                if (res.code === 200){
                    parent.layer.closeAll();
                    parent.$(".layui-laypage-btn")[0].click();
                    $("#data-detail :input").each(function () {
                        $(this).val("");
                    });
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                }else {
                    layer.msg(res.msg)
                }
                layer.close(index);
            }
        })
    }
    // 复选框事件
    form.on('checkbox(detailCheckbox)', function (data) {
        var el = data.elem;
        if (el.checked) {
            $(el).val('Y');
        } else {
            $(el).val('N');
        }
    });
    // 搜索栏搜索事件
    form.on('submit(search)', function (data) {
        pageCurr = 1;
        tableReload(false);
    });
    // 搜索栏重置事件
    form.on('submit(reset)', function (data) {
        pageCurr = 1;
        clearFormVal($('#search-box'));
        tableReload(false);
    });
    // 时间选择器
    layDate.render({
        elem: '#modiTime\\$',
        type: 'datetime'
    });
    layDate.render({
        elem: '#appeTime\\$',
        type: 'datetime'
    });
});
// 关闭动作
$(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;
    });
    (child ? parent.tableIns : tableIns).reload({
        where: searchData,
        page: {
            curr: pageCurr
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({
                    where: searchData,
                    page: {
                        curr: pageCurr-1
                    }
                });
                pageCurr -= 1;
            }
            limit(child);
        }
    });
}
function setFormVal(el, data, showImg) {
    for (var val in data) {
        var find = el.find(":input[id='" + val + "']");
        if (find[0]!=null){
            if (find[0].type === 'checkbox'){
                if (data[val]==='Y'){
                    find.attr("checked","checked");
                    find.val('Y');
                } else {
                    find.remove("checked");
                    find.val('N');
                }
                continue;
            }
        }
        find.val(data[val]);
        if (showImg){
            var next = find.next();
            if (next.get(0)){
                if (next.get(0).localName === "img") {
                    find.hide();
                    next.attr("src", data[val]);
                    next.show();
                }
            }
        }
    }
}
function clearFormVal(el) {
    $(':input', el)
        .val('')
        .removeAttr('checked')
        .removeAttr('selected');
}
function detailScreen(index) {
    var detail = layer.getChildFrame('#data-detail', index);
    var height = detail.height()+60;
    if (height > ($(window).height()*0.9)) {
        height = ($(window).height()*0.8);
    }
    layer.style(index, {
//        top: (($(window).height()-height)/3)+"px",
        height: height+'px'
    });
}
$('body').keydown(function () {
    if (event.keyCode === 13) {
        $("#search").click();
    }
});
src/main/webapp/static/js/node/node.js
New file
@@ -0,0 +1,370 @@
var insTb;
var admin;
var areas;
var matXmSelect;
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).extend({
    dropdown: 'dropdown/dropdown',
}).use(['form','treeTable', 'admin', 'xmSelect', 'dropdown', 'element','layer'], function() {
    var $ = layui.jquery;
    var layer = layui.layer;
    var form = layui.form;
    admin = layui.admin;
    var treeTable = layui.treeTable;
    var xmSelect = layui.xmSelect;
    var tbDataList = [];
    insTb = treeTable.render({
        elem: '#node',
        url: baseUrl+'/node/list/tree/auth',
        headers: {token: localStorage.getItem('token')},
        height: 'full-200',
        toolbar: '#toolbar',
        treeLinkage:false,
        tree: {
            iconIndex: 2,           // 折叠图标显示在第几列
            isPidData: true,        // 是否是id、pid形式数据
            idName: 'id',           // id字段名称
            pidName: 'parentId'     // pid字段名称
        },
        cols: [[
            {type: 'checkbox'},
            {type: 'numbers'}
            ,{field: 'name', align: 'left',title: '编号/名称', minWidth: 150}
            // ,{field: 'uuid', left: 'center',title: '编号/名称', minWidth: 150}
            ,{field: 'type$', align: 'center',title: '类型', templet: '#typeTpl'}
            // ,{field: 'leading', align: 'center',title: '负责人'}
            // ,{field: 'img', align: 'center',title: '图片', hide: true}
            // ,{field: 'brief', align: 'center',title: '简要描述'}
            // ,{field: 'count', align: 'center',title: '数量'}
            // ,{field: 'sort', align: 'center',title: '排序'}
            ,{field: 'status$', align: 'center',title: '状态', hide: true}
            ,{field: 'row1$', align: 'center',title: '排'}
            ,{field: 'bay1$', align: 'center',title: '列'}
            ,{field: 'lev1$', align: 'center',title: '层'}
            ,{field: 'updateTime$', align: 'center',title: '修改时间'}
            ,{field: 'updateBy$', align: 'center',title: '修改人员'}
            ,{field: 'memo', align: 'center',title: '备注', hide: true}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150}
        ]],
        done: function (data) {
            console.log(data)
            $('.ew-tree-table-box').css('height', '100%');
            insTb.expandAll();
            tbDataList = data;
        }
    });
    /* 表格头工具栏点击事件 */
    treeTable.on('toolbar(node)', function (obj) {
        var checkRows = insTb.checkStatus();
        if (obj.event === 'add') { // 添加
            showEditModel();
        } else if (obj.event === 'del') { // 删除
            if (checkRows.length === 0) {
                layer.msg('请选择要删除的数据', {icon: 2});
                return;
            }
            var ids = checkRows.map(function (d) {
                if (!d.LAY_INDETERMINATE) {
                    return d.id;
                } else {
                    return null;
                }
            });
            doDel({ids: ids});
        } else if (obj.event === 'printBatch') {
            if (checkRows.length === 0) {
                layer.msg('请选择要打印的数据', {icon: 2});
                return;
            }
            var printContent = checkRows.map(function (d) {
                if (!d.LAY_INDETERMINATE && d.type === 3) {
                    return d.name;
                } else {
                    return null;
                }
            });
            printBatch(printContent, 1);
        }else if (obj.event === 'nodeInit'){
            nodeInit();
        }
    });
    /* 表格操作列点击事件 */
    treeTable.on('tool(node)', function (obj) {
        if (obj.event === 'edit') { // 修改
            showEditModel(obj.data);
        } else if (obj.event === 'del') { // 删除
            doDel(obj);
        }
    });
    /* 显示表单弹窗 */
    function showEditModel(mData) {
        admin.open({
            type: 1,
            area: '600px',
            title: (mData ? '修改' : '添加') + '货位',
            content: $('#editDialog').html(),
            success: function (layero, dIndex) {
                // 回显表单数据
                form.val('detail', mData);
                // 表单提交事件
                form.on('submit(editSubmit)', function (data) {
                    data.field.parentId = insXmSel.getValue('valueStr');
                    var loadIndex = layer.load(2);
                    $.ajax({
                        url: baseUrl+"/node/"+(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});
                                insTb.refresh();
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            }else {
                                layer.msg(res.msg, {icon: 2});
                            }
                        }
                    })
                    return false;
                });
                // 渲染下拉树
                var insXmSel = xmSelect.render({
                    el: '#nodeParentSel',
                    height: '250px',
                    data: insTb.options.data,
                    initValue: mData ? [mData.parentId] : [],
                    model: {label: {type: 'text'}},
                    prop: {
                        name: 'name',
                        value: 'id'
                    },
                    radio: true,
                    clickClose: true,
                    tree: {
                        show: true,
                        indent: 15,
                        strict: false,
                        expandedKeys: true
                    }
                });
                // 弹窗不出现滚动条
                $(layero).children('.layui-layer-content').css('overflow', 'visible');
                layui.form.render('select');
            }
        });
    }
    /* 删除 */
    function doDel(obj) {
        layer.confirm('确定要删除选中数据吗?', {
            skin: 'layui-layer-admin',
            shade: .1
        }, function (i) {
            layer.close(i);
            var loadIndex = layer.load(2);
            var ids;
            if (obj.data) {
                ids = [];
                ids[0] = obj.data.id;
            } else {
                ids = obj.ids;
            }
            $.ajax({
                url: baseUrl+"/node/delete0/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});
                        insTb.refresh();
                    } else if (res.code === 403){
                        top.location.href = baseUrl+"/";
                    } else {
                        layer.msg(res.msg, {icon: 2});
                    }
                }
            })
        });
    }
    // 批量打印
    function printBatch(printMsgList, type) {
        var data = [];
        for (var i = 0; i<printMsgList.length; i ++) {
            if (printMsgList[i] != null && printMsgList[i] !== '') {
                var barcodeUrl;
                if (type === 1) {
                    barcodeUrl = baseUrl+"/barcode/qrcode/auth?type="+type+"&param="+printMsgList[i]+"&width="+200+"&height="+70;
                } else {
                    barcodeUrl = baseUrl+"/barcode/qrcode/auth?type="+type+"&param="+printMsgList[i]+"&width="+400+"&height="+180;
                }
                data.push({
                    item: printMsgList[i],
                    barcodeUrl: barcodeUrl
                })
            }
        }
        var tpl = $('#locPrintTpl').html();
        var template = Handlebars.compile(tpl);
        var html = template({data: data});
        var box = $("#printBox");
        box.html(html);
        box.show();
        box.print({mediaPrint:true});
        box.hide();
    }
    function nodeInit(){
        layer.prompt({title: '请输入口令,并重置库位', formType: 1,   shadeClose: true}, function(pass, idx){
            http.get(baseUrl+"/node/init/pwd", {pwd: pass}, function (res) {
                if (res.data) {
                    layer.open({
                        type: 1,
                        title: '初始化库位',
                        area: ["400px"],
                        maxmin: true,
                        shadeClose: true,
                        content: $("#resetLocDiv"),
                        success: function (layero, index) {
                            // 渲染物料选择
                            matXmSelect = xmSelect.render({
                                el: '#mat',
                                style: {
                                    width: '200px'                                    ,
                                    height: 'auto'
                                },
                                autoRow: true,
                                toolbar: { show: true },
                                filterable: true,
                                remoteSearch: true,
                                radio: true,
                                clickClose: true,
                                remoteMethod: function(val, cb, show){
                                    $.ajax({
                                        url: baseUrl+"/node/all/get/loc",
                                        headers: {'token': localStorage.getItem('token')},
                                        method: 'POST',
                                        success: function (res) {
                                            if (res.code === 200){
                                                cb(res.data)
                                            } else {
                                                cb([]);
                                                layer.msg(res.msg, {icon: 2});
                                            }
                                        }
                                    });
                                }
                            })
                        }
                    })
                } else {
                    layer.msg("口令错误");
                }
                layer.close(idx);
            })
        });
    }
    // 初始化保存
    form.on('submit(initDo)', function (data) {
        areas =  matXmSelect.getValue();
        data.field.value = areas[0].value;
        data.field.name = areas[0].name;
        console.log(data.field);
        $.ajax({
            url: baseUrl+"/node/init/auth",
            headers: {'token': localStorage.getItem('token')},
            data: data.field,
            method: 'POST',
            async: false,
            success: function (res) {
                if (res.code === 200){
                    layer.msg(res.msg);
                    layer.closeAll();
                    // tableReload(false);
                } else if (res.code === 403){
                    parent.location.href = "/";
                }else {
                    layer.msg(res.msg)
                }
            }
        })
    });
});
// excel导入模板下载
function excelMouldDownload(){
    layer.load(1, {shade: [0.1,'#fff']});
    location.href = baseUrl + "/node/excel/import/mould";
    layer.closeAll('loading');
}
// excel导入
function importExcel() {
    $("#importExcel").trigger("click");
}
function upload(obj){
    if(!obj.files) {
        return;
    }
    var file = obj.files[0];
    admin.confirm('确认同步 [' + file.name +'] 文件吗?', function (index) {
        layer.load(1, {shade: [0.1,'#fff']});
        var url = baseUrl + "/node/excel/import/auth";
        var form = new FormData();
        form.append("file", file);
        xhr = new XMLHttpRequest();
        xhr.open("post", url, true); //post方式,url为服务器请求地址,true 该参数规定请求是否异步处理。
        xhr.setRequestHeader('token', localStorage.getItem('token'));
        xhr.onload = uploadComplete; //请求完成
        xhr.onerror =  uploadFailed; //请求失败
        xhr.onloadend = function () { // // 上传完成重置文件流
            layer.closeAll('loading');
            $("#importExcel").val("");
        };
        // xhr.upload.onprogress = progressFunction;//【上传进度调用方法实现】
        xhr.upload.onloadstart = function(){//上传开始执行方法
            ot = new Date().getTime();   //设置上传开始时间
            oloaded = 0;//设置上传开始时,以上传的文件大小为0
        };
        xhr.send(form);
    }, function(index){
        $("#importExcel").val("");
    });
}
function uploadComplete(evt) {
    var res = JSON.parse(evt.target.responseText);
    if(res.code === 200) {
        layer.msg(res.msg, {icon: 1});
        insTb.refresh();
    } else {
        layer.msg(res.msg, {icon: 2});
    }
}
function uploadFailed(evt) {
    var res = JSON.parse(evt.target.responseText);
    layer.msg(res.msg, {icon: 2});
}
// excel导出
function exportExcel() {
}
src/main/webapp/static/js/nodeLoc/nodeLoc.js
New file
@@ -0,0 +1,488 @@
var pageCurr;
var printMatCodeNos = [];
var admin;
function getCol() {
    var cols = [
        {type: 'checkbox'}
        ,{field: 'tagId$', align: 'center',title: '归类', templet: '#tagTpl'}
    ];
    cols.push.apply(cols, matCols);
    cols.push(
        {fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150}
    )
    return cols;
}
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).extend({
    dropdown: 'dropdown/dropdown',
}).use(['table','laydate', 'form', 'treeTable', 'admin', 'xmSelect', 'dropdown', 'element'], function(){
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var layDate = layui.laydate;
    var form = layui.form;
    admin = layui.admin;
    var treeTable = layui.treeTable;
    var xmSelect = layui.xmSelect;
    // 商品分类数据
    var insTb = treeTable.render({
        elem: '#tag',
        url: baseUrl+'/node/list/auth',
        headers: {token: localStorage.getItem('token')},
        tree: {
            iconIndex: 2,           // 折叠图标显示在第几列
            isPidData: true,        // 是否是id、pid形式数据
            idName: 'id',           // id字段名称
            pidName: 'parentId'     // pid字段名称
        },
        cols: [],
        done: function (data) {
            $('.ew-tree-table-box').css('height', '100%');
            insTb.expandAll();
        }
    });
    // 数据渲染
    tableIns = table.render({
        elem: '#mat',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/node/list/auth',
        page: true,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
        toolbar: '#toolbar',
        cellMinWidth: 50,
        height: 'full-105',
        cols: [[
            {type: 'checkbox'},
            {field: 'name', align: 'center',title: '库位名', hide: false},
            {field: 'parentName', align: 'center',title: '库区', hide: false},
            {field: 'createBy$', align: 'center',title: '创建人', hide: false},
            {field: 'createTime$', align: 'center',title: '创建时间', hide: false},
            {field: 'type$', align: 'center',title: '类型', templet: '#tagTpl', hide: false}
        ]],
        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();
            form.on('checkbox(tableCheckbox)', function (data) {
                var _index = $(data.elem).attr('table-index')||0;
                if(data.elem.checked){
                    res.data[_index][data.value] = 'Y';
                }else{
                    res.data[_index][data.value] = 'N';
                }
            });
        }
    });
    // 监听排序事件
    table.on('sort(locMast)', 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
            },
            done: function (res, curr, count) {
                if (res.code === 403) {
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                limit();
            }
        });
    });
    // 监听头工具栏事件
    table.on('toolbar(mat)', function (obj) {
        var checkStatus = table.checkStatus(obj.config.id);
        switch(obj.event) {
            case 'addData':
                showEditModel()
                break;
            case 'deleteData':
                var data = checkStatus.data;
                if (data.length === 0){
                    layer.msg('请选择数据');
                } else {
                    layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){
                        $.ajax({
                            url: baseUrl+"/node/delete/auth",
                            headers: {'token': localStorage.getItem('token')},
                            data: {param: JSON.stringify(data)},
                            method: 'POST',
                            traditional:true,
                            success: function (res) {
                                if (res.code === 200){
                                    layer.closeAll();
                                    tableReload(false);
                                } else if (res.code === 403){
                                    top.location.href = baseUrl+"/";
                                } else {
                                    layer.msg(res.msg)
                                }
                            }
                        })
                    });
                }
                break;
            case 'exportData':
                layer.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 = {
                        'mat': exportData,
                        'fields': fields
                    };
                    $.ajax({
                        url: baseUrl+"/node/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)
                            }
                        }
                    });
                });
                break;
            // 批量打印
            case "btnPrintBatch":
                printMatCodeNos = [];
                var data = checkStatus.data;
                if (data.length === 0){
                    layer.msg('请选择打印数据');
                } else {
                    layer.open({
                        type: 1,
                        title: '批量打印 [数量'+ data.length +']',
                        area: ['500px'],
                        shadeClose: true,
                        content: $('#printDataDiv'),
                        success: function(layero, index){
                            for (var i = 0; i<data.length;i++) {
                                printMatCodeNos.push(data[i].matnr);
                            }
                        },
                        end: function () {
                        }
                    });
                }
                break;
        }
    });
    // 监听行工具事件
    table.on('tool(mat)', function(obj){
        var data = obj.data;
        switch (obj.event) {
            // 打印
            case "btnPrint":
                printMatCodeNos = [];
                layer.open({
                    type: 1,
                    title: data.matnr + ' [数量:1]',
                    area: ['500px'],
                    shadeClose: true,
                    content: $('#printDataDiv'),
                    success: function(layero, index){
                        layer.iframeAuto(index);
                        printMatCodeNos.push(data.matnr);
                    },
                    end: function () {
                    }
                });
                break;
            // 编辑
            case 'edit':
                showEditModel(data)
                break;
        }
    });
    /* 显示表单弹窗 */
    function showEditModel(mData) {
        admin.open({
            type: 1,
            area: '600px',
            title: (mData ? '修改' : '添加') + '商品',
            content: $('#editDialog').html(),
            success: function (layero, dIndex) {
                // 回显表单数据
                form.val('detail', mData);
                // 新增自动生成商品编号
                if (!mData) {
                    http.get(baseUrl + "/node/auto/matnr/auth", null, function (res) {
                        $('#matnr').val(res.data);
                    })
                }
                // 表单提交事件
                form.on('submit(editSubmit)', function (data) {
                    console.log(data)
                    data.field.tagId = insXmSel.getValue('valueStr');
                    if (isEmpty(data.field.tagId)) {
                        layer.msg('分类不能为空', {icon: 2});
                        return false;
                    }
                    var loadIndex = layer.load(2);
                    $.ajax({
                        url: baseUrl+"/node/"+(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});
                                $(".layui-laypage-btn")[0].click();
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            }else {
                                layer.msg(res.msg, {icon: 2});
                            }
                        }
                    })
                    return false;
                });
                // 渲染下拉树
                var insXmSel = xmSelect.render({
                    el: '#tagSel',
                    height: '250px',
                    data: insTb.options.data,
                    initValue: mData ? [mData.tagId] : [],
                    model: {label: {type: 'text'}},
                    prop: {
                        name: 'name',
                        value: 'id'
                    },
                    radio: true,
                    clickClose: true,
                    tree: {
                        show: true,
                        indent: 15,
                        strict: false,
                        expandedKeys: true
                    }
                });
                // 弹窗不出现滚动条
                $(layero).children('.layui-layer-content').css('overflow', 'visible');
                layui.form.render('select');
            }
        });
    }
    // 模板选择
    form.on('radio(selectTemplateRadio)', function (data) {
        $('.template-preview').hide();
        $('#template-preview-'+data.value).show();
    });
    // 开始打印
    form.on('submit(doPrint)', function (data) {
        var templateNo = data.field.selectTemplate;
        $.ajax({
            url: baseUrl+"/node/print/auth",
            headers: {'token': localStorage.getItem('token')},
            data: {param: printMatCodeNos},
            method: 'POST',
            async: false,
            success: function (res) {
                if (res.code === 200){
                    layer.closeAll();
                    for (let i=0;i<res.data.length;i++){
                        var templateDom = $("#templatePreview"+templateNo);
                        var className = templateDom.attr("class");
                        if (className === 'template-barcode') {
                            res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=1&param="+res.data[i].matnr;
                        } else {
                            res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=2&param="+res.data[i].matnr;
                        }
                    }
                    var tpl = templateDom.html();
                    var template = Handlebars.compile(tpl);
                    var html = template(res);
                    var box = $("#box");
                    box.html(html);box.show();
                    box.print({mediaPrint:true});
                    box.hide();
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                }else {
                    layer.msg(res.msg)
                }
            }
        })
    });
    // 搜索栏搜索事件
    form.on('submit(search)', function (data) {
        pageCurr = 1;
        tableReload(false);
    });
    // 搜索栏重置事件
    form.on('submit(reset)', function (data) {
        pageCurr = 1;
        clearFormVal($('#search-box'));
        tableReload(false);
    });
    // 时间选择器
    layDate.render({
        elem: '#createTime\\$',
        type: 'datetime'
    });
    layDate.render({
        elem: '#updateTime\\$',
        type: 'datetime'
    });
});
// excel导入模板下载
function excelMouldDownload(){
    layer.load(1, {shade: [0.1,'#fff']});
    location.href = baseUrl + "/node/excel/import/mould";
    layer.closeAll('loading');
}
// excel导入
function importExcel() {
    $("#importExcel").trigger("click");
}
function upload(obj){
    if(!obj.files) {
        return;
    }
    var file = obj.files[0];
    admin.confirm('确认同步 [' + file.name +'] 文件吗?', function (index) {
        layer.load(1, {shade: [0.1,'#fff']});
        var url = baseUrl + "/node/excel/import/auth";
        var form = new FormData();
        form.append("file", file);
        xhr = new XMLHttpRequest();
        xhr.open("post", url, true); //post方式,url为服务器请求地址,true 该参数规定请求是否异步处理。
        xhr.setRequestHeader('token', localStorage.getItem('token'));
        xhr.onload = uploadComplete; //请求完成
        xhr.onerror =  uploadFailed; //请求失败
        xhr.onloadend = function () { // // 上传完成重置文件流
            layer.closeAll('loading');
            $("#importExcel").val("");
        };
        // xhr.upload.onprogress = progressFunction;//【上传进度调用方法实现】
        xhr.upload.onloadstart = function(){//上传开始执行方法
            ot = new Date().getTime();   //设置上传开始时间
            oloaded = 0;//设置上传开始时,以上传的文件大小为0
        };
        xhr.send(form);
    }, function(index){
        $("#importExcel").val("");
    });
}
function uploadComplete(evt) {
    var res = JSON.parse(evt.target.responseText);
    if(res.code === 200) {
        layer.msg(res.msg, {icon: 1});
        loadTree("");
    } else {
        layer.msg(res.msg, {icon: 2});
    }
}
function uploadFailed(evt) {
    var res = JSON.parse(evt.target.responseText);
    layer.msg(res.msg, {icon: 2});
}
// excel导出
function exportExcel() {
}
function tableReload(child) {
    var searchData = {};
    $.each($('#search-box [name]').serializeArray(), function() {
        searchData[this.name] = this.value;
    });
    (child ? parent.tableIns : tableIns).reload({
        where: searchData,
        page: {
            curr: pageCurr
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({
                    where: searchData,
                    page: {
                        curr: pageCurr-1
                    }
                });
                pageCurr -= 1;
            }
            limit(child);
        }
    });
}
function clearFormVal(el) {
    $(':input', el)
        .val('')
        .removeAttr('checked')
        .removeAttr('selected');
}
$('body').keydown(function () {
    if (event.keyCode === 13) {
        $("#search").click();
    }
});
src/main/webapp/static/js/nodeLoc/nodeLocTree.js
New file
@@ -0,0 +1,86 @@
var currentTemId;
var currentTemName;
var currentTemSsbm;
var init = false;
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"  // 配置模块所在的目录
}).use(['table','laydate', 'form', 'tree', 'xmSelect'], function() {
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var layDate = layui.laydate;
    var form = layui.form;
    var tree = layui.tree;
    var xmSelect = layui.xmSelect;
    var selObj, treeData;  // 左树选中数据
    var organizationTree;
    window.loadTree = function(condition){
        var loadIndex = layer.load(2);
        $.ajax({
            url: baseUrl+"/node/tree/auth",
            headers: {'token': localStorage.getItem('token')},
            data: {
                'condition': condition
            },
            method: 'POST',
            success: function (res) {
                if (res.code === 200){
                    layer.close(loadIndex);
                    // 树形图
                    organizationTree = tree.render({
                        elem: '#organizationTree',
                        id: 'organizationTree',
                        onlyIconControl: true,
                        data: res.data,
                        click: function (obj) {
                            currentTemId = obj.data.id;
                            currentTemName = obj.data.title.split(" - ")[0];
                            currentTemSsbm = obj.data.title.split(" - ")[1];
                            selObj = obj;
                            $('#organizationTree').find('.ew-tree-click').removeClass('ew-tree-click');
                            $(obj.elem).children('.layui-tree-entry').addClass('ew-tree-click');
                            tableIns.reload({
                                where: {parent_id: obj.data.id},
                                page: {curr: 1}
                            });
                        }
                    });
                    treeData = res.data;
                    if (isEmpty(condition) && init) {
                        tableIns.reload({
                            where: {parent_id: ""},
                            page: {curr: 1}
                        });
                    }
                    if (!init) {
                        init = true;
                    }
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                } else {
                    layer.msg(res.msg)
                }
            }
        })
    }
    loadTree();
    /* 树形图重置 */
    $('#treeReset').click(function () {
        $("#condition").val("");
        loadTree("");
    })
})
function closeDialog() {
    layer.closeAll();
}
/* 树形图搜索 */
function findData(el) {
    var condition = $(el).val();
    loadTree(condition)
}
src/main/webapp/static/js/pakStore/stockAdjust.js
@@ -7,10 +7,15 @@
    var cols = [
        {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'}
        ,{field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'batch', align: 'center',title: '序列码(编辑)', edit: true, style: 'font-weight:bold'}
        ,{field: 'batch', align: 'center',title: '序列码', edit: true, style: 'font-weight:bold'}
        ,{field: 'threeCode', align: 'center',title: '销售订单号', edit: true, style: 'font-weight:bold'}
        ,{field: 'deadTime', align: 'center',title: '销售订单行号', edit: true, style: 'font-weight:bold'}
    ];
    arrRemove(detlCols, "field", "zpallet");
    arrRemove(detlCols, "field", "anfme");
    arrRemove(detlCols, "field", "batch");
    arrRemove(detlCols, "field", "threeCode");
    arrRemove(detlCols, "field", "dead_time");
    cols.push.apply(cols, detlCols);
    cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80})
    return cols;
src/main/webapp/static/js/saas/locDetl.js
New file
@@ -0,0 +1,557 @@
var pageCurr;
function getCol() {
    var cols = [
        {field: 'locNo', align: 'center',title: '库位号'},
        {field: 'matnr', align: 'center',title: '商品编号', sort:true}
        ,{field: 'maktx', align: 'center',title: '商品名称', sort:true}
        ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false, hide: true}
        ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true , hide: true}
        ,{field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'zpallet', align: 'center',title: '托盘条码', hide: true}
        ,{field: 'specs', align: 'center',title: '配置' , hide: true}
        ,{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: true}
        ,{field: 'price', align: 'center',title: '单价', hide: true}
        ,{field: 'sku', align: 'center',title: 'sku', 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: true}
        ,{field: 'deadTime', align: 'center',title: '保质期', hide: true}
        ,{field: 'deadWarn', align: 'center',title: '预警天数', hide: true}
        ,{field: 'source$', align: 'center',title: '制购', hide: true}
        ,{field: 'check$', align: 'center',title: '要求检验', hide: true}
        ,{field: 'danger$', align: 'center',title: '危险品', hide: true}
    ];
    // cols.push.apply(cols, detlCols);
    cols.push({field: 'modiUser$', align: 'center',title: '修改人员',hide: true}
        ,{field: 'modiTime$', align: 'center',title: '修改时间', hide: true}
    )
    return cols;
}
layui.use(['table','laydate', 'form'], function(){
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var layDate = layui.laydate;
    var form = layui.form;
    // 数据渲染
    tableIns = table.render({
        elem: '#locDetl',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/manLocDetl/asrsAndSaas/list',
        page: true,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
        even: true,
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cols: [getCol()],
        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();
            form.on('checkbox(tableCheckbox)', function (data) {
                var _index = $(data.elem).attr('table-index')||0;
                if(data.elem.checked){
                    res.data[_index][data.value] = 'Y';
                }else{
                    res.data[_index][data.value] = 'N';
                }
            });
        }
    });
    // 监听排序事件
    table.on('sort(locDetl)', 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
            },
            done: function (res, curr, count) {
                if (res.code === 403) {
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                limit();
            }
        });
    });
    // 监听头工具栏事件
    table.on('toolbar(locDetl)', function (obj) {
        var checkStatus = table.checkStatus(obj.config.id);
        switch(obj.event) {
            case 'addData':
                layer.open({
                    type: 2,
                    title: '新增',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
                    content: 'locDetl_detail.html',
                    success: function(layero, index){
                        layer.getChildFrame('#data-detail-submit-edit', index).hide();
                        clearFormVal(layer.getChildFrame('#detail', index));
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                    }
                });
                break;
            case 'refreshData':
                tableIns.reload({
                    page: {
                        curr: pageCurr
                    }
                });
                limit();
                break;
            case 'deleteData':
                var data = checkStatus.data;
                if (data.length === 0){
                    layer.msg('请选择数据');
                } else {
                    layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){
                        $.ajax({
                            url: baseUrl+"/locDetl/delete/auth",
                            headers: {'token': localStorage.getItem('token')},
                            data: {param: JSON.stringify(data)},
                            method: 'POST',
                            traditional:true,
                            success: function (res) {
                                if (res.code === 200){
                                    layer.closeAll();
                                    tableReload(false);
                                } else if (res.code === 403){
                                    top.location.href = baseUrl+"/";
                                } else {
                                    layer.msg(res.msg)
                                }
                            }
                        })
                    });
                }
                break;
            case 'exportData':
                layer.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 = {
                        'locDetl': exportData,
                        'fields': fields
                    };
                    var loadIndex = layer.msg('正在导出...', {icon: 16, shade: 0.01, time: false});
                    $.ajax({
                        url: baseUrl+"/locDetl/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.close(loadIndex);
                            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)
                            }
                        }
                    });
                });
                break;
        }
    });
    // 监听行工具事件
    table.on('tool(locDetl)', function(obj){
        var data = obj.data;
        switch (obj.event) {
            // 详情
            case 'detail':
                layer.open({
                    type: 2,
                    title: '详情',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
                    content: 'locDetl_detail.html',
                    success: function(layero, index){
                        setFormVal(layer.getChildFrame('#detail', index), data, true);
                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                    }
                });
                break;
            // 编辑
            case 'edit':
                layer.open({
                    type: 2,
                    title: '修改',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
                    content: 'locDetl_detail.html',
                    success: function(layero, index){
                        layer.getChildFrame('#data-detail-submit-save', index).hide();
                        setFormVal(layer.getChildFrame('#detail', index), data, false);
                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false);
                        top.convertDisabled(layer.getChildFrame('#locNo,#matnr', index), true);
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                    }
                });
                break;
            case 'locNo':
                var param = top.reObject(data).locNo;
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                   layer.open({
                       type: 2,
                       title: '库位号详情',
                       maxmin: true,
                       area: [top.detailWidth, top.detailHeight],
                       shadeClose: false,
                       content: '../locMast/locMast_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: baseUrl+"/locMast/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
                                   if (res.code === 200){
                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                   } else if (res.code === 403){
                                       parent.location.href = "/";
                                   }else {
                                       layer.msg(res.msg)
                                   }
                               }
                           })
                       }
                   });
                }
                break;
            case 'modiUser':
                var param = top.reObject(data).modiUser;
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                   layer.open({
                       type: 2,
                       title: '修改人员详情',
                       maxmin: true,
                       area: [top.detailWidth, top.detailHeight],
                       shadeClose: false,
                       content: '../user/user_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: baseUrl+"/user/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
                                   if (res.code === 200){
                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                   } else if (res.code === 403){
                                       parent.location.href = "/";
                                   }else {
                                       layer.msg(res.msg)
                                   }
                               }
                           })
                       }
                   });
                }
                break;
            case 'appeUser':
                var param = top.reObject(data).appeUser;
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                   layer.open({
                       type: 2,
                       title: '创建者详情',
                       maxmin: true,
                       area: [top.detailWidth, top.detailHeight],
                       shadeClose: false,
                       content: '../user/user_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: baseUrl+"/user/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
                                   if (res.code === 200){
                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                   } else if (res.code === 403){
                                       parent.location.href = "/";
                                   }else {
                                       layer.msg(res.msg)
                                   }
                               }
                           })
                       }
                   });
                }
                break;
        }
    });
    // 数据保存动作
    form.on('submit(save)', function () {
        if (banMsg != null){
            layer.msg(banMsg);
            return;
        }
        method("add");
    });
    // 数据修改动作
    form.on('submit(edit)', function () {
        method("update")
    });
    function method(name){
        var index = layer.load(1, {
            shade: [0.5,'#000'] //0.1透明度的背景
        });
        var data = {
//            id: $('#id').val(),
            locNo: $('#locNo').val(),
            matnr: $('#matnr').val(),
            lgnum: $('#lgnum').val(),
            tbnum: $('#tbnum').val(),
            tbpos: $('#tbpos').val(),
            zmatid: $('#zmatid').val(),
            maktx: $('#maktx').val(),
            werks: $('#werks').val(),
            anfme: $('#anfme').val(),
            altme: $('#altme').val(),
            zpallet: $('#zpallet').val(),
            bname: $('#bname').val(),
            memo: $('#memo').val(),
            modiUser: $('#modiUser').val(),
            modiTime: top.strToDate($('#modiTime\\$').val()),
            appeUser: $('#appeUser').val(),
            appeTime: top.strToDate($('#appeTime\\$').val()),
        };
        $.ajax({
            url: baseUrl+"/locDetl/"+name+"/auth",
            headers: {'token': localStorage.getItem('token')},
            data: top.reObject(data),
            method: 'POST',
            success: function (res) {
                if (res.code === 200){
                    parent.layer.closeAll();
                    parent.$(".layui-laypage-btn")[0].click();
                    $("#data-detail :input").each(function () {
                        $(this).val("");
                    });
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                }else {
                    layer.msg(res.msg)
                }
                layer.close(index);
            }
        })
    }
    // 复选框事件
    form.on('checkbox(detailCheckbox)', function (data) {
        var el = data.elem;
        if (el.checked) {
            $(el).val('Y');
        } else {
            $(el).val('N');
        }
    });
    // 搜索栏搜索事件
    form.on('submit(search)', function (data) {
        pageCurr = 1;
        tableReload(false);
    });
    // 搜索栏重置事件
    form.on('submit(reset)', function (data) {
        pageCurr = 1;
        clearFormVal($('#search-box'));
        tableReload(false);
    });
    // 时间选择器
    layDate.render({
        elem: '#modiTime\\$',
        type: 'datetime'
    });
    layDate.render({
        elem: '#appeTime\\$',
        type: 'datetime'
    });
});
// 关闭动作
$(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;
    });
    (child ? parent.tableIns : tableIns).reload({
        where: searchData,
        page: {
            curr: pageCurr
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({
                    where: searchData,
                    page: {
                        curr: pageCurr-1
                    }
                });
                pageCurr -= 1;
            }
            limit(child);
        }
    });
}
function setFormVal(el, data, showImg) {
    for (var val in data) {
        var find = el.find(":input[id='" + val + "']");
        if (find[0]!=null){
            if (find[0].type === 'checkbox'){
                if (data[val]==='Y'){
                    find.attr("checked","checked");
                    find.val('Y');
                } else {
                    find.remove("checked");
                    find.val('N');
                }
                continue;
            }
        }
        find.val(data[val]);
        if (showImg){
            var next = find.next();
            if (next.get(0)){
                if (next.get(0).localName === "img") {
                    find.hide();
                    next.attr("src", data[val]);
                    next.show();
                }
            }
        }
    }
}
function clearFormVal(el) {
    $(':input', el)
        .val('')
        .removeAttr('checked')
        .removeAttr('selected');
}
function detailScreen(index) {
    var detail = layer.getChildFrame('#data-detail', index);
    var height = detail.height()+60;
    if (height > ($(window).height()*0.9)) {
        height = ($(window).height()*0.8);
    }
    layer.style(index, {
//        top: (($(window).height()-height)/3)+"px",
        height: height+'px'
    });
}
$('body').keydown(function () {
    if (event.keyCode === 13) {
        $("#search").click();
    }
});
src/main/webapp/static/js/saas/locMove.js
New file
@@ -0,0 +1,135 @@
var pageCurr = 0;
var tableIns;
function getCol() {
    var cols = [
        {field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'}
    ];
    cols.push.apply(cols, detlCols);
    return cols;
}
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).use(['table','laydate', 'form', 'tableMerge'], function() {
    var table = layui.table;
    var $ = layui.jquery;
    var form = layui.form;
    var tableMerge = layui.tableMerge;
    // 数据渲染
    tableIns = table.render({
        elem: '#locMatCode',
        headers: {token: localStorage.getItem('token')},
        // url: baseUrl+'/locDetl/list/auth',
        data:[],
        page: true,
        limit: 16,
        limits: [16, 50, 100, 200, 500],
        even: true,
        cellMinWidth: 50,
        cols: [getCol()],
        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) {
            tableMerge.render(this);
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            limit();
            clearSelect();
        }
    });
});
// 搜索库位物料
function getLoc(el) {
    tableIns.reload({
        url: baseUrl+'/manLocDetl/list'
        , where: {loc_no: el.value}
        , done:function (res) {
            limit();
            clearSelect();
            // 获取同一堆垛机的空库位
            http.post(baseUrl + "/work/empty/stock", {sourceLocNo: el.value}, function (res) {
                if (res.data != null) {
                    var tpl = $("#emptyLocStock").html();
                    var template = Handlebars.compile(tpl);
                    var html = template(res);
                    $('#targetLocNo').append(html);
                    layui.form.render('select');
                }
            });
        }
    });
}
// 移库启动
function locMove() {
    var sourceLocNo = $("#sourceLocNo").val();
    var targetLocNo = $("#targetLocNo").val();
    if (sourceLocNo === null || sourceLocNo === ""){
        $("#sourceLocNo").css("border-color", "red");
        setTimeout(function () {
            $("#sourceLocNo").css("border-color", "#b8b8b8");
        }, 1000);
        layer.msg("请输入源库位");
        return;
    }
    if (targetLocNo === null || targetLocNo === "") {
        $(".layui-select-title .layui-input").css("border-color", "red");
        setTimeout(function () {
            $(".layui-select-title .layui-input").css("border-color", "#b8b8b8");
        }, 1000);
        layer.msg("请输入目标库位");
        return;
    }
    $.ajax({
        url: baseUrl + "/work/move/start",
        headers: {'token': localStorage.getItem('token')},
        dataType: 'json',
        data: {
            sourceLocNo: sourceLocNo,
            targetLocNo: targetLocNo
        },
        method: 'POST',
        success: function (res) {
            if (res.code === 200) {
                $("#sourceLocNo").val("");
                $("#targetLocNo").empty();
                layui.form.render('select');
                tableIns.reload({
                    data: [],
                    url: '',
                    done:function (res) {
                        limit();clearSelect();
                    }
                });
                layer.msg(res.msg);
            } else if (res.code === 403) {
                top.location.href = baseUrl + "/";
            } else {
                layer.msg(res.msg);
            }
        }
    })
}
function clearSelect() {
    $("#targetLocNo").empty();
    layui.form.render('select');
}
src/main/webapp/static/js/saas/stockAdjust.js
New file
@@ -0,0 +1,243 @@
var initCountVal = 0;
var initAnfmeVal = "-";
var matCodeData = [];
var currLocNo;
var matCodeLayerIdx;
function getCol() {
    var cols = [
        {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'}
        ,{field: 'anfme', align: 'center',title: '数量'}
        ,{field: 'batch', align: 'center',title: '批号(编辑)', edit: true, style: 'font-weight:bold'}
    ];
    arrRemove(detlCols, "field", "anfme");
    arrRemove(detlCols, "field", "batch");
    cols.push.apply(cols, detlCols);
    cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80})
    return cols;
}
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: '#chooseData',
        data: [],
        even: true,
        limit: 500,
        cellMinWidth: 50,
        toolbar: '#toolbar',
        cols: [getCol()],
        done: function (res, curr, count) {
            limit();
        }
    });
    // 页面修改
    table.on('edit(chooseData)', function (obj) {
        let index = obj.tr.attr("data-index");
        let data = matCodeData[index];
        let modify = true;
        if (obj.field === 'count'){
            let vle = Number(obj.value);
            if (isNaN(vle)) {
                layer.msg("请输入数字", {icon: 2});
                modify = false;
            } else {
                if (vle <= 0) {
                    layer.msg("数量必须大于零", {icon: 2});
                    modify = false;
                }
            }
        }
        if (modify) {
            data[obj.field] = obj.value;
        }
        tableIns.reload({data: matCodeData});
    });
    // 监听头工具栏事件
    table.on('toolbar(chooseData)', function (obj) {
        switch(obj.event) {
            case 'adjust':
                if (isEmpty(currLocNo)) {
                    layer.msg("请先检索库位", {icon: 2})
                    inputTip($("#searchLocNo"));
                    return;
                }
                if (matCodeData.length === 0) {
                    layer.msg("请先添加明细", {icon: 2});
                    return;
                }
                for (var i=0;i<matCodeData.length;i++){
                    if (isNaN(matCodeData[i].count)) {
                        layer.msg("请输入数字", {icon: 2});
                        return;
                    }
                    if (matCodeData[i].count < 0){
                        layer.msg("数量不能小于零", {icon: 2});
                        return;
                    }
                }
                layer.confirm('确定调整'+currLocNo+'库位的明细吗?', {shadeClose: true}, function(){
                    $.ajax({
                        url: baseUrl+"/manLocDetl/adjust/start",
                        headers: {'token': localStorage.getItem('token')},
                        data: JSON.stringify({
                            locNo: currLocNo,
                            list: matCodeData
                        }),
                        contentType:'application/json;charset=UTF-8',
                        method: 'POST',
                        async: false,
                        success: function (res) {
                            if (res.code === 200){
                                layer.msg(currLocNo + res.msg, {icon: 1});
                                init(currLocNo)
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            }else {
                                layer.msg(res.msg, {icon: 2})
                            }
                        }
                    })
                });
                break;
        }
    });
    // 监听行工具事件
    table.on('tool(chooseData)', function(obj){
        var data = obj.data;
        switch (obj.event) {
            case 'remove':
                let index = obj.tr.attr("data-index");
                matCodeData.splice(index, 1);
                tableIns.reload({data: matCodeData});
                break;
        }
    });
    // 检索事件
    form.on('submit(search)', function (data) {
        let loc_no = data.field.loc_no;
        if (loc_no === "") {
            inputTip($("#searchLocNo"));
            layer.msg("请输入库位号");
            return;
        }
        init(loc_no);
    });
    // 重置事件
    form.on('submit(reset)', function (data) {
        reset();
    });
    function init(locNo) {
        http.post(baseUrl + "/manLocDetl/list", {loc_no: locNo,limit: 1000}, function (res) {
            matCodeData = [];
            matCodeData = res.data.records;
            for (var i = 0; i<matCodeData.length; i++) {
                matCodeData[i]["count"] = matCodeData[i]["anfme"];
            }
            locTips(true, locNo);
            tableReload();
        })
    }
    function reset() {
        clearFormVal($('#search-box'));
        matCodeData = [];
        tableReload();
        locTips(false);
    }
    // 重载表格
    function tableReload() {
        tableIns.reload({data: matCodeData});
    }
    // 库位提示框
    function locTips(retrieve, locNo) {
        if (retrieve) {
            http.post(baseUrl+"/node/select/"+locNo+"/auth", null, function (res) {
                console.log(res);
                let data = res.data;
                if (data != null) {
                    $(".retrieve").show();
                    // $("#locMsg").html(locNo + "&nbsp;,库位状态:" + data.locSts$);
                    $("#locMsg").html(locNo + "&nbsp;");
                    $('.not-retrieve').hide();
                    currLocNo = locNo;
                } else {
                    layer.msg("请输入有效库位号", {icon: 2});
                    $('.not-retrieve').show();
                    $("#locMsg").html("");
                    $(".retrieve").hide();
                    currLocNo = null;
                    inputTip($("#searchLocNo"));
                }
            })
        } else {
            $('.not-retrieve').show();
            $("#locMsg").html("");
            $(".retrieve").hide();
            currLocNo = null;
        }
    }
    $(document).on('click','#mat-query', function () {
        if (isEmpty(currLocNo)) {
            layer.msg("请先检索库位")
            inputTip($("#searchLocNo"));
            return;
        }
        let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false});
        matCodeLayerIdx = admin.open({
            type: 2,
            title: false,
            closeBtn: false,
            maxmin: false,
            area: ['90%', '85%'],
            shadeClose: true,
            content: 'matQuery.html',
            success: function(layero, index){
                layer.close(loadIndex);
            }
        });
    })
})
// 搜索框空值提示
function inputTip(el) {
    el.css("border-color", "red");
    setTimeout(function () {
        el.css("border-color", "#b8b8b8");
    }, 1000);
}
// 添加表格数据
function addTableData(data) {
    for (let i=0;i<data.length;i++){
        for (let j=0;j<matCodeData.length;j++){
            if (data[i].matnr === matCodeData[j].matnr && data[i].batch === matCodeData[j].batch) {
                data.splice(i, 1);
                break;
            } else {
                data[i]['anfme'] = initAnfmeVal;
                data[i]['count'] = initCountVal;
            }
        }
    }
    matCodeData.push.apply(matCodeData, data);
    tableIns.reload({data: matCodeData});
    layer.close(matCodeLayerIdx);
}
src/main/webapp/static/js/saasLog/saasLog.js
New file
@@ -0,0 +1,252 @@
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: '#saasLog',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/saasLog/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: 'locNo', align: 'center',title: '库位'}
            ,{field: 'type$', align: 'center',title: '操作类型'}
            ,{field: 'matnr', align: 'center',title: '物料号'}
            ,{field: 'anfme', align: 'center',title: '数量'}
            ,{field: 'createByName', align: 'center',title: '操作人'}
            ,{field: 'ioTime$', align: 'center',title: '操作时间'}
            ,{field: 'createBy', align: 'center',title: '', hide:true}
        ]],
        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(saasLog)', 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(saasLog)', 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 = {
                        'saasLog': exportData,
                        'fields': fields
                    };
                    $.ajax({
                        url: baseUrl+"/saasLog/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(saasLog)', 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+"/saasLog/"+(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+"/saasLog/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: '#ioTime\\$',
                type: 'datetime',
                value: data!==undefined?data['ioTime\\$']: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/manLocDetl/manLocDetl.html
New file
@@ -0,0 +1,136 @@
<!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">
    <link rel="stylesheet" href="../../static/css/tree.css" media="all">
    <style>
        body {
            color: #595959;
            background-color: #f5f7f9;
        }
        .layui-fluid {
            padding: 15px;
        }
        .layui-form.layui-border-box.layui-table-view {
            /*margin: 15px 0 35px 0;*/
            width: 100%;
            border-width: 1px;
        }
        .layui-form.layui-border-box.layui-table-view {
            height: calc(100vh - 160px);
        }
        .layui-form.layui-border-box.layui-table-view {
            margin: 0;
        }
        #search-box {
            padding: 30px 30px 10px 0px;
            margin-left: 0px;
        }
        .layui-form.layui-border-box.layui-table-view {
            height: 100%;
        }
    </style>
</head>
<body>
<div class="layui-fluid">
    <!-- 左 -->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-body" style="padding: 10px;">
                    <!-- 树工具栏 -->
                    <div class="layui-form toolbar" id="organizationTreeBar">
                        <div class="layui-inline" style="max-width: 200px;">
                            <input id="condition" onkeyup="findData(this)" type="text" class="layui-input" placeholder="请输入关键字" autocomplete="off">
                        </div>
                        <div class="layui-inline">
                            <button class="layui-btn icon-btn  layui-btn-sm" id="treeReset" style="padding: 0 10px;">
                                <i class="layui-icon layui-icon-close"></i>
                            </button>
                        </div>
                    </div>
                    <!-- 树 -->
                    <div class="layui-form toolbar" id="organizationTree"></div>
                </div>
            </div>
        </div>
        <!-- 右 -->
        <div class="layui-col-md9">
            <div class="layui-card">
                <div class="layui-card-body" style="padding: 10px;">
                    <!-- 表格工具栏2 -->
                    <div id="search-box" class="layui-form toolbar"  style="padding-top: 5px">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="padding: 8px 15px 8px 15px">货位:</label>
                            <div class="layui-input-inline">
                                <input name="loc_no" style="width: 120px" class="layui-input" placeholder="输入货位"/>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="padding: 8px 15px 8px 15px">商品编号:</label>
                            <div class="layui-input-inline">
                                <input name="matnr" style="width: 120px" class="layui-input" placeholder="输入商品编号"/>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="padding: 8px 15px 8px 15px">商品名称:</label>
                            <div class="layui-input-inline">
                                <input name="maktx" style="width: 120px" class="layui-input" placeholder="输入商品名称"/>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="padding: 8px 15px 8px 15px">托盘码:</label>
                            <div class="layui-input-inline">
                                <input name="zpallet" style="width: 120px" class="layui-input" placeholder="输入托盘码"/>
                            </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>
                    <table class="layui-hide" id="locDetl" lay-filter="locDetl"></table>
                </div>
            </div>
        </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;margin-right: -10px">导出</button>
    </div>
</script>
<script type="text/html" id="locNoTpl">
    <span name="locNo" class="layui-badge layui-badge-gray">{{d.locNo}}</span>
</script>
<script type="text/html" id="operate">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a>
    <!--    <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</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/manLocDetl/manLocDetl.js" charset="utf-8"></script>
<!--<script type="text/javascript" src="../../static/js/tagTree.js" charset="utf-8"></script>-->
<script type="text/javascript" src="../../static/js/nodeTree.js" charset="utf-8"></script>
</body>
</html>
src/main/webapp/views/node/node.html
New file
@@ -0,0 +1,203 @@
<!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">
    <style>
        #detail {
            padding: 25px 30px 0 0;
        }
        .ew-tree-table-box {
            height: 100%;
        }
    </style>
</head>
<body>
<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <!-- 数据表格 -->
            <table id="node"></table>
        </div>
    </div>
</div>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container" style="width: 100%">
        <button lay-event="add" class="layui-btn layui-btn-sm layui-btn-normal icon-btn"><i class="layui-icon">&#xe654;</i>添加</button>&nbsp;
        <button lay-event="del" class="layui-btn layui-btn-sm layui-btn-danger icon-btn"><i class="layui-icon">&#xe640;</i>删除</button>
        <button class="layui-btn layui-btn-sm" id="btn-print-batch" lay-event="printBatch">批量打印</button>
        <button class="layui-btn layui-btn-sm layui-btn-warm" id="btn-node-init" lay-event="nodeInit">库位初始化</button>
    </div>
</script>
<script type="text/html" id="typeTpl">
    {{# if( d.type === 1){ }}
    <span name="type" class="layui-badge layui-badge-red" ><span style="display: none">{{d.number}}</span>仓库</span>
    {{# } else if(d.type === 2){ }}
    <span name="type" class="layui-badge layui-badge-blue" ><span style="display: none">{{d.number}}</span>库区</span>
    {{# } else if(d.type === 3){ }}
    <span name="type" class="layui-badge layui-badge-green" ><span style="display: none">{{d.number}}</span>货位</span>
    {{# } else { }}
    <span name="type" class="layui-badge layui-badge-gray" ><span style="display: none">{{d.number}}</span>其他</span>
    {{# } }}
</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-del" lay-event="del">删除</a>
</script>
<!-- 表单弹窗 -->
<script type="text/html" id="editDialog">
    <form id="detail" lay-filter="detail" class="layui-form">
        <input name="id" type="hidden">
        <input name="uuid" type="hidden">
        <input name="path" type="hidden">
        <input name="pathName" type="hidden">
        <input name="level" type="hidden">
        <input name="sort" type="hidden">
        <input name="leading" type="hidden">
        <input name="barcode" type="hidden">
        <input name="major" type="hidden">
        <input name="createTime$" type="hidden">
        <input name="createBy" type="hidden">
        <input name="updateTime$" type="hidden">
        <input name="updateBy" type="hidden">
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">上级菜单</label>
                    <div class="layui-input-block">
                        <div id="nodeParentSel" class="ew-xmselect-tree"></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">类型</label>
                    <div class="layui-input-block">
                        <select name="type" lay-vertype="tips" lay-verify="required" required="">
                            <option value="">请选择类型</option>
                            <option value="1">仓库</option>
                            <option value="2">库区</option>
                            <option value="3">货位</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">编号/名称</label>
                    <div class="layui-input-block">
                        <input name="name" placeholder="请输入编号/名称" class="layui-input" lay-vertype="tips" lay-verify="required" required="">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <input name="memo" placeholder="请输入备注" class="layui-input">
                    </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>
<!-- 打印模板 -->
<script type="text/template" id="locPrintTpl">
    {{#each data}}
    <img class="template-code" src="{{this.barcodeUrl}}" width="100%">
    <div style="letter-spacing: 2px;margin-top: 1px; text-align: center">
        <span>{{this.item}}</span>
    </div>
    {{/each}}
</script>
<div id="printBox" style="display: none;"></div>
<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../static/js/jquery/jQuery.print.js"></script>
<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.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/node/node.js" charset="utf-8"></script>
<!-- 重置库位弹窗 -->
<div id="resetLocDiv" style="margin: 20px 0 10px 30px; display: none">
    <div class="layui-form layui-form-pane">
        <!-- 库位类型 -->
        <div class="layui-form-item">
            <label class="layui-form-label">库区</label>
            <div class="layui-input-inline">
                    <div id="mat" name="areaId">
                    </div>
            </div>
        </div>
        <!-- 排 -->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起止排</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="startRow" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
                <div class="layui-form-mid">-</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="endRow" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
            </div>
        </div>
        <!-- 列 -->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起止列</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="startBay" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
                <div class="layui-form-mid">-</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="endBay" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
            </div>
        </div>
        <!-- 层 -->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起止层</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="startLev" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
                <div class="layui-form-mid">-</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="endLev" autocomplete="off" class="layui-input" lay-verify="required|number">
                </div>
            </div>
        </div>
        <div id="prompt" style="text-indent: 10px;">
            <span class="not-null">初始化库位后将删除库存明细,请谨慎操作!</span>
        </div>
        <!-- 按钮 -->
        <div style="text-align: center; margin-top: 20px">
            <button class="layui-btn layui-btn-radius layui-btn-normal" id="initDo" lay-submit lay-filter="initDo">确定</button>
        </div>
    </div>
</div>
</body>
</html>
src/main/webapp/views/nodeLoc/nodeLoc.html
New file
@@ -0,0 +1,430 @@
<!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">
    <link rel="stylesheet" href="../../static/css/tree.css" media="all">
    <style>
        body {
            color: #595959;
            background-color: #f5f7f9;
        }
        .layui-fluid {
            padding: 15px;
        }
        .layui-form.layui-border-box.layui-table-view {
            /*margin: 15px 0 35px 0;*/
            width: 100%;
            border-width: 1px;
        }
        .layui-form.layui-border-box.layui-table-view {
            height: calc(100vh - 160px);
        }
        .layui-form.layui-border-box.layui-table-view {
            margin: 0;
        }
        #search-box {
            padding: 30px 30px 10px 0px;
            margin-left: 0px;
        }
        .layui-form.layui-border-box.layui-table-view {
            height: 100%;
        }
        .admin-form {
            padding: 25px 30px 0 0 !important;
            margin: 0 !important;
        }
        /* ------------------------- 打印表格 -----------------------  */
        .template-preview {
            height: 200px;
            display: inline-block;
        }
        .contain td {
            border: 1px solid #000;
            /*font-family: 黑体;*/
            /*font-weight: bold;*/
            /*color: #000000;*/
        }
    </style>
</head>
<body>
<div class="layui-fluid">
    <!-- 左 -->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-body" style="padding: 10px;">
                    <!-- 树工具栏 -->
                    <div class="layui-form toolbar" id="organizationTreeBar">
                        <div class="layui-inline" style="max-width: 200px;">
                            <input id="condition" onkeyup="findData(this)" type="text" class="layui-input" placeholder="请输入关键字" autocomplete="off">
                        </div>
                        <div class="layui-inline">
                            <button class="layui-btn icon-btn layui-btn-sm" id="treeReset" style="padding: 0 10px">
                                <i class="layui-icon layui-icon-close"></i>
                            </button>
                        </div>
                    </div>
                    <!-- 树 -->
                    <div class="layui-form toolbar" id="organizationTree"></div>
                </div>
            </div>
        </div>
        <!-- 右 -->
        <div class="layui-col-md9">
            <div class="layui-card">
                <div class="layui-card-body" style="padding: 10px;">
                    <!-- 表格工具栏2 -->
                    <div id="search-box" class="layui-form toolbar"  style="padding-top: 5px">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="padding: 8px 15px 8px 15px">库区:</label>
                            <div class="layui-input-inline">
                                <input name="parent_name" class="layui-input" placeholder="输入商品编号"/>
                            </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>
                    <table class="layui-hide" id="mat" lay-filter="mat"></table>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/html" id="tagTpl">
    <span name="tagId" class="layui-badge layui-badge-blue">{{d.type$}}</span>
</script>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <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>-->
        <!--        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right;margin-right: -10px">导出</button>-->
    </div>
</script>
<script type="text/html" id="operate">
    <a class="layui-btn layui-btn-xs btn-edit layui-btn-primary" lay-event="edit">修改</a>
    <button class="layui-btn layui-btn-xs btn-print" lay-event="btnPrint">打印</button>
</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/jquery/jQuery.print.js"></script>
<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></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/nodeLoc/nodeLoc.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/nodeLoc/nodeLocTree.js" charset="utf-8"></script>
<!-- 表单弹窗 -->
<script type="text/html" id="editDialog">
    <form id="detail" lay-filter="detail" class="layui-form admin-form">
        <input name="id" type="hidden">
        <input name="uuid" type="hidden">
        <input name="nodeId" type="hidden">
        <input name="tag_id" type="hidden">
        <input name="model" type="hidden">
        <input name="name" type="hidden">
        <input name="batch" type="hidden">
        <input name="docId" type="hidden">
        <input name="docNum" type="hidden">
        <input name="custName" type="hidden">
        <input name="itemNum" type="hidden">
        <input name="count" type="hidden">
        <input name="weight" type="hidden">
        <input name="status" type="hidden">
        <input name="createBy" type="hidden">
        <input name="updateTime$" type="hidden">
        <input name="updateBy" type="hidden">
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">分类</label>
                    <div class="layui-input-block">
                        <div id="tagSel" class="ew-xmselect-tree"></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">商品名称</label>
                    <div class="layui-input-block">
                        <input name="maktx" placeholder="请输入商品名称" class="layui-input" lay-vertype="tips" lay-verify="required" required="">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">配置</label>
                    <div class="layui-input-block">
                        <input name="specs" placeholder="请输入配置" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">单箱净重</label>
                    <div class="layui-input-block">
                        <input name="weight" placeholder="请输入单箱净重格" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">单箱体积</label>
                    <div class="layui-input-block">
                        <input name="volume" placeholder="请输入单箱体积" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">商品编号</label>
                    <div class="layui-input-block">
                        <input id="matnr" name="matnr" placeholder="请输入商品编号" class="layui-input" lay-vertype="tips" lay-verify="required" required="">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">规格</label>
                    <div class="layui-input-block">
                        <input name="specs" placeholder="请输入代码" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <input name="memo" placeholder="请输入备注" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">单箱毛重</label>
                    <div class="layui-input-block">
                        <input name="length" placeholder="请输入单箱毛重" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">单箱体积</label>
                    <div class="layui-input-block">
                        <input name="threeCode" placeholder="请输入箱子尺寸" class="layui-input">
                    </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>
<!-- 打印操作弹窗 -->
<div id="printDataDiv" style="display: none;padding: 20px">
    <div class="layui-form" style="text-align: center">
        <hr>
        <!--单选框-->
        <div class="layui-form-item" style="display: inline-block; margin-bottom: 10px">
            <input type="radio" name="selectTemplate" value="1" title="模板一"  lay-filter="selectTemplateRadio" checked="">
            <input type="radio" name="selectTemplate" value="2" title="模板二" lay-filter="selectTemplateRadio">
            <input type="radio" name="selectTemplate" value="3" title="模板三" lay-filter="selectTemplateRadio">
        </div>
        <fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;text-align: left;">
            <legend>打印预览</legend>
            <div id="template-container" style="margin: 20px;text-align: center">
                <!-- 预览图 1 -->
                <div id="template-preview-1" class="template-preview" style="display: inline-block">
                    <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;">
                        <tr style="height: 74px">
                            <td colspan="3" align="center" scope="col">商品编码</td>
                            <td class="barcode" colspan="9" align="center" scope="col">
                                <img class="template-code template-barcode" src="" width="90%;">
                                <div style="letter-spacing: 2px;margin-top: 1px; text-align: center;">
                                    <span>xxxxxx</span>
                                </div>
                            </td>
                        </tr>
                        <tr style="height: 74px">
                            <td align="center" colspan="3">商品</td>
                            <td align="center" colspan="5">xxxxxx-xx/xx</td>
                            <td align="center" colspan="2">备注</td>
                            <td align="center" colspan="2">xx</td>
                        </tr>
                    </table>
                </div>
                <!-- 预览图 2 -->
                <div id="template-preview-2" class="template-preview" style="display: none">
                    <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;">
                        <tr style="height: 30px">
                            <td align="center" width="20%">商品</td>
                            <td align="center" width="80%" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">xxxxxxx</td>
                        </tr>
                        <tr style="height: 30px">
                            <td align="center" width="20%">备注</td>
                            <td align="center" width="80%">xxxxxxxx</td>
                        </tr>
                        <tr style="height: 75px;">
                            <td align="center" colspan="2" width="100%" style="border: none">
                                <img class="template-code template-barcode" src="" width="80%">
                                <div style="letter-spacing: 2px;margin-top: 1px; text-align: center">
                                    <span>xxxxxx</span>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
                <!-- 预览图 3 -->
                <div id="template-preview-3" class="template-preview" style="display: none">
                    <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;">
                        <tr style="height: 74px">
                            <td align="center" scope="col" colspan="1">商品</td>
                            <td align="center" scope="col" colspan="1" style="">xxxxxx-xx/xx</td>
                            <td align="center" scope="col" colspan="2" rowspan="2">
                                <img class="template-code template-qrcode" src="" width="80%">
                                <div style="letter-spacing: 1px;margin-top: 1px; text-align: center">
                                    <span>xxxxxx</span>
                                </div>
                            </td>
                        </tr>
                        <tr style="height: 74px">
                            <td align="center" colspan="1">备注</td>
                            <td align="center" colspan="1" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">xxxxxxx</td>
                        </tr>
                    </table>
                </div>
            </div>
        </fieldset>
        <button class="layui-btn" id="doPrint" lay-submit lay-filter="doPrint" style="margin-top: 20px">确定</button>
    </div>
</div>
<div id="box" style="display: block"></div>
<!-- 初始化打印模板的条形码 -->
<script type="text/javascript">
    $('.template-barcode').attr("src", baseUrl+"/mac/code/auth?type=1&param=123");
    $('.template-qrcode').attr("src", baseUrl+"/mac/code/auth?type=2&param=123");
</script>
<!-- 模板引擎 -->
<!-- 模板1 -->
<script type="text/template" id="templatePreview1" class="template-barcode">
    {{#each data}}
    <table class="contain" width="280" style="overflow: hidden;font-size: small;table-layout: fixed;">
        <tr style="height: 74px">
            <td align="center" colspan="3" scope="col">商品编码</td>
            <td align="center" class="barcode" colspan="9" scope="col">
                <img class="template-code" src="{{this.barcodeUrl}}" width="90%">
                <div style="letter-spacing: 2px;margin-top: 1px; text-align: center">
                    <span>{{this.matnr}}</span>
                </div>
            </td>
        </tr>
        <tr style="height: 74px">
            <td align="center" colspan="3">商品</td>
            <td align="center" colspan="5" style="overflow: hidden; white-space: nowrap;text-overflow: ellipsis;">{{this.maktx}}</td>
            <td align="center" colspan="2">备注</td>
            <td align="center" colspan="2">{{this.memo}}</td>
        </tr>
    </table>
    {{/each}}
</script>
<!-- 模板2 -->
<script type="text/template" id="templatePreview2" class="template-barcode">
    {{#each data}}
    <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;">
        <tr style="height: 35px">
            <td align="center" width="20%">商品</td>
            <td align="center" width="80%" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{this.maktx}}</td>
        </tr>
        <tr style="height: 35px">
            <td align="center" width="20%">备注</td>
            <td align="center" width="80%">{{this.memo}}</td>
        </tr>
        <tr style="height: 79px;">
            <td align="center" colspan="2" width="100%" style="border: none">
                <img class="template-code" src="{{this.barcodeUrl}}" width="80%">
                <div style="letter-spacing: 2px;margin-top: 1px; text-align: center">
                    <span>{{this.matnr}}</span>
                </div>
            </td>
        </tr>
    </table>
    {{/each}}
</script>
<!-- 模板3 -->
<script type="text/template" id="templatePreview3" class="template-qrcode">
    {{#each data}}
    <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;">
        <tr style="height: 74px" >
            <td align="center" scope="col" colspan="1">商品</td>
            <td align="center" scope="col" colspan="1" style="
                display: inline-block;
                line-height: 20px;
                vertical-align: middle;
                border: none;
                border-top: 1px solid #000;
                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-line-clamp: 3;
                -webkit-box-orient: vertical;
                    ">
                {{this.maktx}}
            </td>
            <td align="center" scope="col" colspan="2" rowspan="2">
                <img class="template-code template-qrcode" src="{{this.barcodeUrl}}" width="80%">
                <div style="letter-spacing: 1px;margin-top: 1px; text-align: center">
                    <span>{{this.matnr}}</span>
                </div>
            </td>
        </tr>
        <tr style="height: 74px">
            <td align="center" colspan="1">备注</td>
            <td align="center" colspan="1" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{this.memo}}</td>
        </tr>
    </table>
    {{/each}}
</script>
</body>
</html>
src/main/webapp/views/saas/locDetl.html
New file
@@ -0,0 +1,77 @@
<!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/cool.css" media="all">
    <link rel="stylesheet" href="../../static/css/common.css" media="all">
</head>
<body>
<!-- 搜索栏 -->
<div id="search-box" class="layui-form layui-card-header">
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off">
        </div>
    </div>
<!--    <div class="layui-inline">-->
<!--        <div class="layui-input-inline">-->
<!--            <input class="layui-input" type="text" name="zpallet" placeholder="托盘码" autocomplete="off">-->
<!--        </div>-->
<!--    </div>-->
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="matnr" placeholder="商品编号" autocomplete="off">
        </div>
    </div>
<!--    <div class="layui-inline">-->
<!--        <div class="layui-input-inline">-->
<!--            <input class="layui-input" type="text" name="row" placeholder="排数" autocomplete="off">-->
<!--        </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 id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block">
        <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button>
        <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button>
<!--        <button id="unreason" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="unreason">查看异常数据</button>-->
    </div>
</div>
<!-- 表格 -->
<div class="layui-form">
    <table class="layui-hide" id="locDetl" lay-filter="locDetl"></table>
</div>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">导出</button>
    </div>
</script>
<script type="text/html" id="operate">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</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/saas/locDetl.js" charset="utf-8"></script>
<iframe id="detail-iframe" scrolling="auto" style="display:none;"></iframe>
</body>
</html>
src/main/webapp/views/saas/locMove.html
New file
@@ -0,0 +1,130 @@
<!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">
    <link rel="stylesheet" href="../../static/css/common.css" media="all">
    <style>
        html {
            height: 100%;
            padding: 10px;
            background-color: #f1f1f1;
            box-sizing: border-box;
        }
        body {
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 0 3px rgba(0,0,0,.3);
            padding-bottom: 20px;
        }
        .function-area {
            padding: 50px 80px 50px 70px;
            display: inline-block;
        }
        .cool-auto-complete-div {
            height: 40px;
            border-radius: 5px;
            border: 1px solid #b8b8b8;
            color: #888;
            box-shadow: inset 0 1px 2px #ECECEC;
            -moz-box-shadow: inset 0 1px 2px #ECECEC;
            -webkit-box-shadow: inset 0 1px 2px #ECECEC;
        }
        .function-btn {
            margin-left: 15px;
            background: #E27575;
            border: none;
            padding: 10px 25px 10px 25px;
            color: #FFF;
            box-shadow: 1px 1px 5px #B6B6B6;
            border-radius: 3px;
            text-shadow: 1px 1px 1px #9E3F3F;
            cursor: pointer;
        }
        .function-btn:hover {
            opacity: 0.8
        }
        .layui-layer-lan .layui-layer-btn a {
            background: #4476A7;
            border-color: #4476A7;
            color: #fff;
        }
        .layui-layer-lan .layui-layer-btn .layui-layer-btn1 {
            background: #fff;
            color: #333;
            border-color: #E9E7E7;
        }
        .layui-layer-lan .layui-layer-btn .layui-layer-btn1:hover {
            background-color: #f7f7f7;
        }
        #loc-move-btn {
            /*display: none;*/
        }
    </style>
</head>
<body>
<div class="function-area layui-form">
    <!-- 源库位 -->
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input id="sourceLocNo" class="layui-input" onkeyup="getLoc(this)" type="text" placeholder="源库位" autocomplete="off">
        </div>
    </div>
    <div class="layui-form-mid" style="float: none; display: inline-block; margin-left: 10px">-</div>
    <div class="layui-input-inline">
        <select id="targetLocNo" name="modules" lay-verify="required" lay-search="">
            <option value="">目标空库位</option>
        </select>
    </div>
    <button id="loc-move-btn" class="function-btn" onclick="locMove()" style="background: #4476A7;text-shadow: inherit;height: 45px;font-size: 15px;margin-left: 20px">库位移转</button>
</div>
<hr>
<table class="layui-table" id="locMatCode" lay-filter="locMatCode"></table>
<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/handlebars/handlebars-v4.5.3.js"></script>
<script type="text/javascript" src="../../static/js/saas/locMove.js" charset="utf-8"></script>
<script type="text/template" id="emptyLocStock">
    <option value="">请输入并选择</option>
    {{#each data}}
    <option value="{{this.uuid}}">{{this.uuid}}</option>
    {{/each}}
</script>
<div id="locMoveWindow" style="height: 100%;display: none">
    <div style="float: left;width: 35%;height: 100%">
        <div>
            <span style="display: block">源库位</span>
            <input type="text">
        </div>
    </div>
    <div style="float: left;width: 30%;height: 100%;position: relative;">
        <span style="position:absolute;top: 45%;left: 50%;color: #666;transform: translateX(-50%);;display: block">移转至</span>
        <hr style="position: absolute; top: 50%;width: 100%;border: none;height: 1px;background-color: #666">
    </div>
    <div style="float: right;width: 35%;height: 100%">
        <div>
            <span style="display: block">目标库位</span>
            <input type="text">
        </div>
    </div>
</div>
</body>
</html>
src/main/webapp/views/saas/matQuery.html
New file
@@ -0,0 +1,194 @@
<!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">
    <link rel="stylesheet" href="../../static/css/common.css" media="all">
    <style>
        body {
            padding: 0 20px;
        }
        .layui-table-box {
            border-right: 1px solid #9F9F9F;
            border-left: 1px solid #9F9F9F;
        }
    </style>
</head>
<body>
<!-- 搜索栏 -->
<fieldset class="layui-elem-field site-demo-button" style="margin: 20px;">
    <legend>搜索栏</legend>
    <div id="search-box" class="layui-form layui-card-header">
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="matnr" placeholder="商品编码" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="maktx" 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="update_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px">
            </div>
        </div>
        <!-- 待添加 -->
        <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block">
            <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button>
            <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button>
        </div>
    </div>
</fieldset>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <button class="layui-btn" id="btn-confirm" lay-event="confirm" style="">提取</button>
    </div>
</script>
<div class="layui-form">
    <table class="layui-hide" id="matCode" lay-filter="matCode"></table>
</div>
<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/handlebars/handlebars-v4.5.3.js"></script>
</body>
<script>
    function getCol() {
        var cols = [
            {type: 'checkbox', fixed: 'left'}
        ];
        cols.push.apply(cols, matCols);
        cols.push(
            {field: 'updateBy$', align: 'center',title: '修改人员', hide: true},
            {field: 'updateTime$', align: 'center',title: '修改时间'}
        )
        return cols;
    }
    var pageCurr;
    layui.use(['table','laydate', 'form'], function() {
        var table = layui.table;
        var $ = layui.jquery;
        var layer = layui.layer;
        var layDate = layui.laydate;
        var form = layui.form;
        // 物料查询数据表
        matQueryTable = table.render({
            elem: '#matCode',
            headers: {token: localStorage.getItem('token')},
            url: baseUrl + '/mat/list/auth',
            page: true,
            limit: 7,
            limits: [7, 10, 30,50,100],
            even: true,
            cellMinWidth: 50,
            toolbar: '#toolbar',
            cols: [getCol()],
            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 + "/";
                }
            }
        });
        // 监听头工具栏事件
        table.on('toolbar(matCode)', function (obj) {
            var checkStatus = table.checkStatus(obj.config.id);
            var data = checkStatus.data;
            switch(obj.event) {
                case 'confirm':
                    if (data.length === 0){
                        layer.msg("请选择数据");
                        return;
                    }
                    parent.addTableData(data);
                    break;
            }
        });
        // 搜索栏搜索事件
        form.on('submit(search)', function (data) {
            pageCurr = 1;
            tableReload(false);
        });
        // 搜索栏重置事件
        form.on('submit(reset)', function (data) {
            pageCurr = 1;
            clearFormVal($('#search-box'));
            tableReload();
        });
        layDate.render({
            elem: '.layui-laydate-range'
            ,type: 'datetime'
            ,range: true
        });
    })
    function tableReload(child) {
        var searchData = {};
        $.each($('#search-box [name]').serializeArray(), function() {
            searchData[this.name] = this.value;
        });
        matQueryTable.reload({
            where: searchData,
            page: {
                curr: pageCurr
            },
            done: function (res, curr, count) {
                if (res.code === 403) {
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                if (res.data.length === 0 && count !== 0) {
                    tableIns.reload({
                        where: searchData,
                        page: {
                            curr: pageCurr-1
                        }
                    });
                    pageCurr -= 1;
                }
            }
        });
    }
    function clearFormVal(el) {
        $(':input', el)
            .val('')
            .removeAttr('checked')
            .removeAttr('selected');
    }
</script>
</html>
src/main/webapp/views/saas/stockAdjust.html
New file
@@ -0,0 +1,133 @@
<!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">
    <link rel="stylesheet" href="../../static/css/common.css" media="all">
    <style>
        html {
            height: 100%;
            padding: 10px;
            background-color: #f1f1f1;
            box-sizing: border-box;
        }
        body {
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 0 3px rgba(0,0,0,.3);
        }
        /* search */
        .layui-card-header {
            border-bottom: none;
        }
        #search-box {
            padding: 30px 0 10px 0;
        }
        #search-box .layui-inline:first-child {
            margin-left: 30px;
        }
        #search-box .layui-inline {
            margin-right: 5px;
        }
        #data-search-btn {
            margin-left: 10px;
            display: inline-block;
        }
        #data-search-btn.layui-btn-container .layui-btn {
            margin-right: 20px;
        }
        /* add */
        .function-area {
            padding: 15px 0 20px 40px;
        }
        .function-btn {
            font-size: 16px;
            padding: 1px 1px 1px 1px;
            width: 120px;
            height: 40px;
            border-color: #2b425b;
            border-radius: 4px;
            border-width: 1px;
            background: none;
            border-style: solid;
            transition: 0.4s;
            cursor: pointer;
        }
        .function-btn:hover {
            background-color: #2b425b;
            color: #fff;
        }
        #mat-query {
            /*display: none;*/
        }
        #btn-adjust {
            /*display: none;*/
        }
    </style>
</head>
<body style="padding-bottom: 30px">
<!-- 搜索栏 -->
<div id="search-box" class="layui-form layui-card-header">
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input id="searchLocNo" class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"  style="height: 45px;border-color: #b8b8b8">
        </div>
    </div>
    <!-- 待添加 -->
    <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block">
        <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">检索</button>
        <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button>
    </div>
    <!-- 库位提示 -->
    <div style="display: inline-block; font-size: 20px;font-weight: 300">
        <div class="not-retrieve" style="color: #ff0000;font-family: '黑体';">
            请先检索库位
        </div>
        <div class="retrieve" style="display: none;color: #0097ff;font-family: '黑体';">
            当前检索库位:&nbsp; <span id="locMsg" style=""></span>
        </div>
    </div>
</div>
<hr>
<!-- 功能区 -->
<div class="function-area">
    <button id="mat-query" class="function-btn">新增库存</button>
</div>
<!-- 头部 -->
<script type="text/html" id="toolbar">
    <button class="layui-btn layui-btn-lg" id="btn-adjust" lay-event="adjust" style="">调整库存</button>
</script>
<!-- 行 -->
<script type="text/html" id="operate">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a>
</script>
<!-- 表格 -->
<table class="layui-table" id="chooseData" lay-filter="chooseData"></table>
<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/handlebars/handlebars-v4.5.3.js"></script>
<script type="text/javascript" src="../../static/js/saas/stockAdjust.js" charset="utf-8"></script>
</body>
</html>
src/main/webapp/views/saasLog/saasLog.html
New file
@@ -0,0 +1,113 @@
<!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="saasLog" lay-filter="saasLog"></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/saasLog/saasLog.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">id: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="id" placeholder="请输入id" lay-vertype="tips" lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">{0:入库,1:出库}: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="type" placeholder="请输入{0:入库,1:出库}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="locNo" placeholder="请输入">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="matnr" placeholder="请输入">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="ioTime" id="ioTime$" placeholder="请输入">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="createBy" 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>