自动化立体仓库 - WMS系统
skyouc
昨天 a167c1ba9816896114debe769b8247a72f3a1a99
缓冲区功能调整
10个文件已修改
1个文件已添加
206 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/entity/LocCache.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkMast.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkMastLog.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/WrkMastLogMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WrkMastLogServiceImpl.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/common.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locCache/locCache.js 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/locCache/locCache.html 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/locCache/locDetail.html 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/LocCache.java
@@ -156,6 +156,9 @@
    @TableField("area_name")
    private String areaName;
    @ApiModelProperty("优先级")
    private Integer sort;
    /**
     * 是否冻结,0.未冻结,1.已冻结
     */
src/main/java/com/zy/asrs/entity/WrkMast.java
@@ -22,11 +22,12 @@
    private static final long serialVersionUID = 1L;
    private Long id;
    /**
     * 工作号
     */
    @ApiModelProperty(value= "工作号")
    @TableId(value = "wrk_no", type = IdType.INPUT)
    @TableField("wrk_no")
    private Integer wrkNo;
src/main/java/com/zy/asrs/entity/WrkMastLog.java
@@ -29,6 +29,9 @@
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty("日志ID")
    private Long logId;
    /**
     * 工作号
     */
@@ -324,7 +327,8 @@
    @TableField("take_none")
    private String takeNone;
    public WrkMastLog() {}
    public WrkMastLog() {
    }
    public String getWrkNo$(){
        WrkMastService service = SpringUtils.getBean(WrkMastService.class);
@@ -352,6 +356,9 @@
    }
    public long getWrkSts(){
        if (wrkSts == null) {
            return 0;
        }
        return (long)this.wrkSts;
    }
src/main/java/com/zy/asrs/mapper/WrkMastLogMapper.java
@@ -15,7 +15,7 @@
@Repository
public interface WrkMastLogMapper extends BaseMapper<WrkMastLog> {
    @Insert("insert into asr_wrk_mast_log select * from asr_wrk_mast where wrk_no=#{workNo}")
    @Insert("insert into asr_wrk_mast_log select *, id as log_id from asr_wrk_mast where wrk_no=#{workNo}")
    int save(Integer workNo);
    /**
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -572,7 +572,6 @@
        // 无单组托
        if (Cools.isEmpty(param.getOrderNo())) {
            // 生成入库通知档
            List<DetlDto> detlDtos = new ArrayList<>();
            param.getCombMats().forEach(elem -> {
@@ -1202,7 +1201,7 @@
        wrkMast.setFullPlt("Y"); // 满板:Y
        wrkMast.setPicking("N"); // 拣料
        wrkMast.setExitMk("N"); // 退出
        wrkMast.setSourceStaNo(orgSite);
        wrkMast.setSourceLocNo(orgSite);
        wrkMast.setEmptyMk(loc.getLocSts().equals("D") ? "Y" : "N"); // 空板
        wrkMast.setBarcode(barcode); // 托盘码
        wrkMast.setLinkMis("N");
src/main/java/com/zy/asrs/service/impl/WrkMastLogServiceImpl.java
@@ -1,22 +1,48 @@
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.R;
import com.core.exception.CoolException;
import com.zy.asrs.entity.InventoryFlowDto;
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.entity.WrkMastLog;
import com.zy.asrs.mapper.WrkMastLogMapper;
import com.zy.asrs.service.WrkMastLogService;
import com.zy.asrs.service.WrkMastService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;
import java.util.Objects;
@Service("wrkMastLogService")
public class WrkMastLogServiceImpl extends ServiceImpl<WrkMastLogMapper, WrkMastLog> implements WrkMastLogService {
    @Autowired
    private WrkMastService wrkMastService;
    @Autowired
    private WrkMastLogService wrkMastLogService;
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean save(Integer workNo) {
        return this.baseMapper.save(workNo) > 0;
        WrkMast mast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", workNo));
        if (Objects.isNull(mast)) {
            throw new CoolException("数据错误:任务不存在!!");
        }
        WrkMastLog mastLog = new WrkMastLog();
        BeanUtils.copyProperties(mast, mastLog);
        mastLog.setLogId(mast.getId());
        if (!wrkMastLogService.insert(mastLog)) {
            throw new CoolException("任务日志保存失败!!");
        }
        return true;
    }
    @Override
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -59,7 +59,6 @@
        return SUCCESS;
    }
    @Transactional(rollbackFor = Exception.class)
    public ReturnT<String> doIn(WrkMast wrkMast) {
        if (wrkMast.getTaskType().equals("agv")) {
            Date now = new Date();
@@ -67,12 +66,11 @@
            if (Objects.isNull(locCache)) {
                throw new CoolException("数据错误,库位不存在!!");
            }
            List<WaitPakin> apallet = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("apallet", wrkMast.getBarcode()));
            List<WaitPakin> apallet = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode()));
            if (Objects.isNull(apallet)) {
                throw new CoolException("数据错误:组托数据不存在!!");
            }
            List<LocDetl> detls = new ArrayList<>();
            apallet.forEach(pakin -> {
                LocDetl detl = new LocDetl();
                BeanUtils.copyProperties(pakin, detl);
@@ -88,19 +86,25 @@
                        .setAreaName(locCache.getAreaName())
                        .setUnit(pakin.getUnit())
                        .setBatch(pakin.getBatch());
                detls.add(detl);
            });
            if (!locDetlService.insertBatch(detls)) {
                if (!locDetlService.insert(detl)) {
                throw new CoolException("库位明细保存失败!!");
            }
            });
            locCache.setLocSts(LocStsType.LOC_STS_TYPE_F.type);
            locCache.setModiTime(new Date());
            locCache.setBarcode("");
            locCache.setModiTime(new Date());
            locCache.setIoTime(new Date());
            if (!locCacheService.updateById(locCache)) {
                throw new CoolException("库位状态修改失败!");
            }
            wrkMast.setWrkSts(5L);
            wrkMast.setModiTime(new Date());
            if (!wrkMastService.updateById(wrkMast)) {
                throw new CoolException("任务状态修改失败!!");
            }
        } else {
            Date now = new Date();
            LocMast locMast = locMastService.selectById(wrkMast.getLocNo());
src/main/webapp/static/js/common.js
@@ -218,6 +218,28 @@
    ,{field: 'updateBy$', align: 'center',title: '修改人员', hide: true}
    ,{field: 'updateTime$', align: 'center',title: '修改时间', hide: true}
    ,{field: 'memo', align: 'center',title: '备注', hide: true}
]
var cacheCols = [
    {field: 'matnr', align: 'center',title: '商品编号(品号)', sort:true}
    ,{field: 'maktx', align: 'center',title: '商品名称(品名)', sort:true}
    ,{field: 'batch', align: 'center',title: '货品特征', sort:true}
    ,{field: 'anfme', align: 'center',title: '数量', hide: false}
    ,{field: 'specs', align: 'center',title: '规格', hide: false}
    ,{field: 'model', align: 'center',title: '代码', hide: true}
    ,{field: 'color', align: 'center',title: '颜色', hide: true}
    ,{field: 'brand', align: 'center',title: '品牌', hide: true}
    ,{field: 'unit', align: 'center',title: '单位', hide: false}
    ,{field: 'frozen$', align: 'center',title: '冻结否',hide: true,
        templet: function(d) {
            // 根据条件判断字体颜色
            if (d.frozen$ === '已冻结') {
                return '<span style="color: #34a8de;">' +d.frozen$ + '</span>';
            } else {
                return '<span">' +d.frozen$ + '</span>';
            }
        }}
]
var detlCols = [
src/main/webapp/static/js/locCache/locCache.js
@@ -36,10 +36,9 @@
            field: 'lev1',
            align: 'center',
            title: '层'
        }, {field: 'locType', align: 'center', title: '库位类型'}, {
            field: 'modiUser$',
            align: 'center',
            title: '修改人员'
        }, {field: 'locType', align: 'center', title: '库位类型'}
            ,{field: 'sort', align: 'center', title: '优先级'}
            ,{field: 'modiUser$', align: 'center', title: '修改人员'
        }, {field: 'modiTime$', align: 'center', title: '修改时间'}, {
            field: 'appeUser$',
            align: 'center',
@@ -133,7 +132,22 @@
    // 监听行工具事件
    table.on('tool(locCache)', function (obj) {
        var data = obj.data;
        console.log(data)
        switch (obj.event) {
            case 'showDetl':
                locNo = data?.locNo;
                // 弹层显示
                layer.open({
                    type: 2,
                    title: '库位明细',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: true,
                    content: 'locDetail.html',
                    success: function(layero, index){
                    }
                });
                break;
            case 'edit':
                showEditModel(data);
                break;
src/main/webapp/views/locCache/locCache.html
@@ -193,7 +193,8 @@
</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-xs btn-detlShow" lay-event="showDetl">明细</a>
<!--    <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>
src/main/webapp/views/locCache/locDetail.html
New file
@@ -0,0 +1,93 @@
<!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">
    <style>
    </style>
</head>
<body>
<div class="layui-inline" style="width:31%;margin-top: 20px">
    <label class="layui-form-label">库 位 号:</label>
    <div class="layui-input-inline">
        <input id="locNo" class="layui-input" type="text" disabled="disabled">
    </div>
</div>
<table class="layui-hide" id="locCacheDetls" lay-filter="locCacheDetls"></table>
</body>
<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/locMast/locMast.js" charset="utf-8"></script>
<script type="text/javascript">
    var pageCur;
    function getCol() {
        var cols = [
            {field: 'locNo', align: 'center', title: '库位号'}
            , {field: 'ioTime$', align: 'center', title: '工作时间'}
        ];
        cols.push.apply(cols, cacheCols);
        return cols;
    }
    layui.use(['table', 'laydate', 'form'], function () {
        table = layui.table;
        var $ = layui.jquery;
        var form = layui.form;
        $('#locNo').val(parent.locNo);
        // 数据渲染
        tableIns1 = table.render({
            elem: '#locCacheDetls',
            headers: {token: localStorage.getItem('token')},
            url: baseUrl + '/locDetl/list/auth',
            where: {loc_no: parent.locNo},
            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 + "/";
                }
                pageCur = curr;
                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';
                    }
                });
            }
        });
    });
</script>
</html>