| | |
| | | @TableField("area_name") |
| | | private String areaName; |
| | | |
| | | @ApiModelProperty("优先级") |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 是否冻结,0.未冻结,1.已冻结 |
| | | */ |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工作号 |
| | | */ |
| | | @ApiModelProperty(value= "工作号") |
| | | @TableId(value = "wrk_no", type = IdType.INPUT) |
| | | @TableField("wrk_no") |
| | | private Integer wrkNo; |
| | | |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("日志ID") |
| | | private Long logId; |
| | | |
| | | /** |
| | | * 工作号 |
| | | */ |
| | |
| | | @TableField("take_none") |
| | | private String takeNone; |
| | | |
| | | public WrkMastLog() {} |
| | | public WrkMastLog() { |
| | | } |
| | | |
| | | public String getWrkNo$(){ |
| | | WrkMastService service = SpringUtils.getBean(WrkMastService.class); |
| | |
| | | } |
| | | |
| | | public long getWrkSts(){ |
| | | if (wrkSts == null) { |
| | | return 0; |
| | | } |
| | | return (long)this.wrkSts; |
| | | } |
| | | |
| | |
| | | @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); |
| | | |
| | | /** |
| | |
| | | |
| | | // 无单组托 |
| | | if (Cools.isEmpty(param.getOrderNo())) { |
| | | |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getCombMats().forEach(elem -> { |
| | |
| | | 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"); |
| | |
| | | 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 |
| | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ReturnT<String> doIn(WrkMast wrkMast) { |
| | | if (wrkMast.getTaskType().equals("agv")) { |
| | | Date now = new Date(); |
| | |
| | | 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); |
| | |
| | | .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()); |
| | |
| | | ,{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 = [ |
| | |
| | | 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', |
| | |
| | | // 监听行工具事件 |
| | | 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; |
| | |
| | | </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> |
| | | |
New file |
| | |
| | | <!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> |
| | | |