| | |
| | | @TableField("b_loc_no") |
| | | private String bLocNo; |
| | | |
| | | @ApiModelProperty("是否默认") |
| | | @TableField("is_default") |
| | | private Integer isDefault; |
| | | |
| | | public LocAroundBind() {} |
| | | |
| | | public LocAroundBind(Long devId,String devNo,Long bLocId,String bLocNo) { |
| | |
| | | this.bLocNo = bLocNo; |
| | | } |
| | | |
| | | public String getDef$() { |
| | | if (this.isDefault == 0) { |
| | | return "否"; |
| | | } else { |
| | | return "是"; |
| | | } |
| | | } |
| | | |
| | | // LocAroundBind locAroundBind = new LocAroundBind( |
| | | // null, // 机台ID[非空] |
| | | // null, // 机台号[非空] |
| | |
| | | * 体积 |
| | | */ |
| | | @ApiModelProperty(value= "体积") |
| | | @ExcelProperty(value = "体积") |
| | | @ExcelProperty(value = "每公斤长度") |
| | | private Double volume; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "安全库存量") |
| | | @TableField("safe_qty") |
| | | @ExcelProperty(value = "归零阀值") |
| | | private Double safeQty; |
| | | |
| | | /** |
| | |
| | | * 体积 |
| | | */ |
| | | @ApiModelProperty(value= "体积") |
| | | @ExcelProperty(value = "kg/cm") |
| | | private Double volume; |
| | | |
| | | /** |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Slf4j |
| | | public class OrderExcelListener extends AnalysisEventListener<OrderExcel> { |
| | | public class OrderExcelListener extends AnalysisEventListener<OrderExcel> { |
| | | |
| | | private int total = 0; |
| | | private Long userId; |
| | |
| | | |
| | | /** |
| | | * 单据导入实现 |
| | | * |
| | | * @param data |
| | | * @param context |
| | | * @author Ryan |
| | | * @date 2026/1/8 17:25 |
| | | * @param data |
| | | * @param context |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void invoke(OrderExcel data, AnalysisContext context) { |
| | | OrderService orderService = (OrderService) SpringUtils.getBean(OrderService.class); |
| | | OrderDetlService detlService = (OrderDetlService) SpringUtils.getBean(OrderDetlService.class); |
| | | OrderService orderService = SpringUtils.getBean(OrderService.class); |
| | | OrderDetlService detlService = SpringUtils.getBean(OrderDetlService.class); |
| | | MatService matService = SpringUtils.getBean(MatService.class); |
| | | DocTypeService docTypeService = SpringUtils.getBean(DocTypeService.class); |
| | | Date now = new Date(); |
| | |
| | | |
| | | Order order = new Order(); |
| | | order.setOrderNo(data.getOrderNo()); |
| | | order.setDocType(docType.getDocId()); |
| | | order.setUuid(UUID.randomUUID().toString()); |
| | | order.setCreateTime(now); |
| | | order.setUpdateTime(now); |
| | | order.setSettle(1L); |
| | | order.setStatus(1); |
| | | order.setCreateBy(userId); |
| | | order.setUpdateBy(userId); |
| | | order.setPakinPakoutStatus(docType.getPakin() == 1 ? 1 : 2); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("订单创建失败!!"); |
| | | if (Objects.isNull(data.getOrderNo())) { |
| | | throw new CoolException("单据编码不能为空!!"); |
| | | } |
| | | order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", data.getOrderNo())); |
| | | if (!Objects.isNull(order)) { |
| | | //订单已存在,只添加明细 |
| | | } else { |
| | | order = new Order(); |
| | | order.setOrderNo(data.getOrderNo()); |
| | | order.setDocType(docType.getDocId()); |
| | | order.setUuid(UUID.randomUUID().toString()); |
| | | order.setCreateTime(now); |
| | | order.setUpdateTime(now); |
| | | order.setSettle(1L); |
| | | order.setStatus(1); |
| | | order.setCreateBy(userId); |
| | | order.setUpdateBy(userId); |
| | | order.setPakinPakoutStatus(docType.getPakin() == 1 ? 1 : 2); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("订单创建失败!!"); |
| | | } |
| | | } |
| | | if (Objects.isNull(data.getMatnr())) { |
| | | throw new CoolException("物料编码不能为空!"); |
| | |
| | | if (Objects.isNull(mat)) { |
| | | throw new CoolException("物料[" + data.getMatnr() + "]不存在!!"); |
| | | } |
| | | |
| | | OrderDetl orderDetl = detlService.selectOne(new EntityWrapper<OrderDetl>() |
| | | .eq("matnr", data.getMatnr()) |
| | | .eq("batch", data.getBatch()) |
| | | .eq("barcode", data.getBarcode()) |
| | | .eq("order_no", order.getOrderNo())); |
| | | if (!Objects.isNull(orderDetl)) { |
| | | return; |
| | | } |
| | | OrderDetl detl = new OrderDetl(); |
| | | detl.setOrderNo(data.getOrderNo()); |
| | | detl.setOrderId(order.getId()); |
| | | detl.setMatnr(data.getMatnr()); |
| | | detl.setMaktx(mat.getMaktx()); |
| | | detl.setQty(data.getQty()); |
| | | detl.setUnit(data.getUnit()); |
| | | detl.setBrand(data.getBrand()); |
| | | detl.setSpecs(data.getSpecs()); |
| | | detl.setBatch(Objects.isNull(data.getBatch()) ? "1" : data.getBatch()); |
| | | detl.setVolume(data.getVolume()); |
| | | detl.setSafeQty(data.getSafeQty()); |
| | | detl.setVolume(mat.getVolume()); |
| | | detl.setSafeQty(mat.getSafeQty()); |
| | | detl.setAnfme(data.getAnfme()); |
| | | detl.setBarcode(data.getBarcode()); |
| | | detl.setUpdateTime(now); |
| | |
| | | if (!detlService.insert(detl)) { |
| | | throw new CoolException("订单详情创建失败!!"); |
| | | } |
| | | total ++ ; |
| | | total++; |
| | | } |
| | | |
| | | @Override |
| | |
| | | , {field: 'weight', align: 'center', title: '单箱净重', hide: true} |
| | | , {field: 'length', align: 'center', title: '单箱毛重', hide: true} |
| | | , { |
| | | field: 'volume', align: 'center', title: 'kg/cm', templet: function (d) { |
| | | field: 'volume', align: 'center', title: '每公斤长度', templet: function (d) { |
| | | var raw = d.volume; |
| | | if (raw === null || raw === undefined) return ''; |
| | | if (typeof raw === 'string' && raw.trim() === '') return ''; |
| | |
| | | ] |
| | | |
| | | var detlCols = [ |
| | | {field: 'matnr', align: 'center', title: '商品编号(品号)', sort: true} |
| | | , {field: 'maktx', align: 'center', title: '商品名称(品名)', sort: true} |
| | | , {field: 'orderNo', align: 'center', title: '单据编号', hide: false} |
| | | , {field: 'batch', align: 'center', title: '货品特征', sort: true} |
| | | {field: 'matnr', align: 'center', title: '商品编号', sort: true, width: 160} |
| | | , {field: 'maktx', align: 'center', title: '商品名称', sort: true, width: 120} |
| | | , {field: 'orderNo', align: 'center', title: '单据编号', hide: false, width: 120} |
| | | , {field: 'batch', align: 'center', title: '批次', sort: false} |
| | | , { |
| | | field: 'anfme', align: 'center', title: '数量', hide: false, templet: function (d) { |
| | | var raw = d.anfme; |
| | |
| | | , {field: 'zpallet', align: 'center', title: '托盘条码', hide: false} |
| | | , {field: 'specs', align: 'center', title: '规格', hide: false} |
| | | , { |
| | | field: 'safeQty', align: 'center', title: '归零阀值', hide: false, templet: function (d) { |
| | | field: 'safeQty', align: 'center', title: '归零阀值', hide: true, templet: function (d) { |
| | | var raw = d.safeQty; |
| | | if (raw === null || raw === undefined) return ''; |
| | | if (typeof raw === 'string' && raw.trim() === '') return ''; |
| | |
| | | } |
| | | } |
| | | , { |
| | | field: 'volume', align: 'center', title: 'km/cm', hide: false, templet: function (d) { |
| | | field: 'volume', align: 'center', title: '每公斤长度', hide: true, templet: function (d) { |
| | | var raw = d.volume; |
| | | if (raw === null || raw === undefined) return ''; |
| | | if (typeof raw === 'string' && raw.trim() === '') return ''; |
| | |
| | | } |
| | | , {field: 'model', align: 'center', title: '代码', hide: true} |
| | | , {field: 'color', align: 'center', title: '颜色', hide: true} |
| | | , {field: 'brand', align: 'center', title: '品牌', hide: true} |
| | | , {field: 'brand', align: 'center', title: '品牌', hide: false} |
| | | , {field: 'unit', align: 'center', title: '单位', hide: false} |
| | | , {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: 'barcode', align: 'center', title: 'SN', hide: false} |
| | | , {field: 'origin', align: 'center', title: '产地', hide: true} |
| | | , {field: 'manu', align: 'center', title: '厂家', hide: true} |
| | | , {field: 'manuDate', align: 'center', title: '生产日期', hide: true} |
| | |
| | | , { field: 'devNo', align: 'center', title: '机台号' } |
| | | , { field: 'blocId', align: 'center', title: '库位ID', hide: true } |
| | | , { field: 'blocNo', align: 'center', title: '库位码' } |
| | | , { field: 'def$', align: 'center', title: '是否默认' } |
| | | , { fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 120 } |
| | | ]], |
| | | request: { |
| | |
| | | { type: 'numbers' }, |
| | | { field: 'matnr', title: '商品编码', width: 160 }, |
| | | { field: 'maktx', title: '商品名称', width: 160 }, |
| | | { field: 'specs', title: '规格' }, |
| | | {field: 'barcode', title: 'SN' }, |
| | | {field: 'brand', title: '品牌' }, |
| | | { field: 'batch', title: '批号' }, |
| | | { field: 'specs', title: '规格' }, |
| | | { field: 'unit', title: '单位' }, |
| | | { field: 'anfme', title: '待完结数量' }, |
| | | { field: 'qty', title: '待上报数量', style: 'font-weight: bold' }, |
| | | { field: 'workQty', title: '已上报数量' }, |
| | |
| | | page: true, |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'barcode', title: 'SN'}, |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'workQty', title: '作业数量'}, |
| | | {field: 'qty', title: '完成数量', style: 'font-weight: bold'}, |
| | | { type: 'numbers' }, |
| | | { field: 'matnr', title: '商品编码', width: 160 }, |
| | | { field: 'maktx', title: '商品名称', width: 160 }, |
| | | {field: 'barcode', title: 'SN', width: 140 }, |
| | | {field: 'brand', title: '品牌' }, |
| | | { field: 'batch', title: '批号' }, |
| | | { field: 'specs', title: '规格' }, |
| | | { field: 'unit', title: '单位' }, |
| | | { field: 'anfme', title: '待完结数量' }, |
| | | { field: 'qty', title: '待上报数量', style: 'font-weight: bold' }, |
| | | { field: 'workQty', title: '已上报数量' } |
| | | |
| | | // {field: 'unit', title: '单位'}, |
| | | // { |
| | | // field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { |
| | |
| | | // }, |
| | | // {field: 'inQty', title: '已入库量'}, |
| | | // {field: 'color', title: '颜色'}, |
| | | {field: 'specs', title: '规格'} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | <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="bLocId" placeholder="请输入库位ID" lay-vertype="tips" lay-verify="required"> |
| | | <input class="layui-input" name="blocId" placeholder="请输入库位ID" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">库位码: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="bLocNo" placeholder="请输入库位码" lay-vertype="tips" lay-verify="required"> |
| | | <input class="layui-input" name="blocNo" placeholder="请输入库位码" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">是否默认:</label> |
| | | <div class="layui-input-block"> |
| | | <select id="isDefault" name="isDefault" lay-filter="isDefault"> |
| | | <option value="1" selected="">是</option> |
| | | <option value="0">否</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | |
| | | <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> |
| | | <label class="·layui-form-label">机台号</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="devNo" autocomplete="off" class="layui-input"> |
| | | </div> |