手动导入订单和mes下发订单,增加客户名称和备注字段
| | |
| | | |
| | | private String orderType; // 订单类型 |
| | | |
| | | private String customerName; // 客户名称 |
| | | |
| | | private String memo; // 订单备注 |
| | | |
| | | List<String> groups; // 包装组号列表 |
| | | |
| | | // private List<Rolls> matDetails; |
| | |
| | | @ExcelProperty(value = "包装组号/源库位",index = 0) |
| | | private String column1; |
| | | |
| | | @ExcelProperty(value = "出库单号/单据类型/目标库位",index = 1) |
| | | @ExcelProperty(value = "出库单号/单据类型/客户名称/备注/目标库位",index = 1) |
| | | private String column2; |
| | | |
| | | @ExcelProperty(value = "目标巷道",index = 2) |
| | |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelAnalysisException; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.zy.asrs.entity.DocType; |
| | |
| | | public void invoke(ImportOrderDto data, AnalysisContext context) { |
| | | log.info("解析到第 {} 条数据:{}", ++count, JSON.toJSONString(data)); |
| | | list.add(data); |
| | | if (context.getCurrentRowNum() == 3) { |
| | | if (context.getCurrentRowNum() == 5) { |
| | | String time = DateUtils.convert(new Date(),DateUtils.yyyyMMddHHmmss_F); |
| | | Order order2 = orderService.selectByNo(list.get(0).getColumn2()); |
| | | Order order2 = orderService.selectByNo(list.get(0).getColumn2()); // 订单号 |
| | | if(order2 != null) { |
| | | throw new ExcelAnalysisException("单据已存在!"); |
| | | } |
| | | DocType docType = docTypeService.selectOrAdd(list.get(1).getColumn2(), Boolean.FALSE); |
| | | DocType docType = docTypeService.selectOrAdd(list.get(1).getColumn2(), Boolean.FALSE); // 订单类型 |
| | | if (docType == null) { |
| | | throw new ExcelAnalysisException("单据类型错误:" + list.get(1).getColumn2()); |
| | | } |
| | |
| | | order.setOrderNo(orderNo); |
| | | order.setOrderTime(time); |
| | | order.setDocType(docType.getDocId()); |
| | | order.setCstmrName(Cools.isEmpty(list.get(2).getColumn2()) ? "" : list.get(2).getColumn2()); // 客户名称 |
| | | order.setMemo(Cools.isEmpty(list.get(3).getColumn2()) ? "" : list.get(3).getColumn2()); // 备注 |
| | | order.setSettle(1L); |
| | | order.setStatus(1); |
| | | order.setCreateBy(userId); |
| | |
| | | null, // 初始票据号 |
| | | null, // 票据号 |
| | | null, // 客户编号 |
| | | null, // 客户 |
| | | param.getCustomerName(), // 客户 |
| | | null, // 联系方式 |
| | | null, // 操作人员 |
| | | null, // 合计金额 |
| | |
| | | now, // 添加时间 |
| | | 9527L, // 修改人员 |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | param.getMemo() // 备注 |
| | | ); |
| | | |
| | | if (!orderService.insert(order)) { |
| | |
| | | |
| | | // 根据托盘码获取任务主档 |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", barcode)); |
| | | if (wrkMast == null) { |
| | | return R.parse("该条码无正在执行任务:" + barcode); |
| | | } |
| | | // 根据任务主档获取工作档明细 |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | // 提取包装组号 |
| | |
| | | {align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160, width: 160}, |
| | | {field: 'createTime$', title: '创建时间', minWidth: 200, width: 200}, |
| | | {field: 'settle$', align: 'center', title: '状态', templet: '#settleTpl', minWidth: 160, width: 160}, |
| | | {field: 'memo', align: 'center',title: '备注', hide: true}, |
| | | {field: 'cstmrName', align: 'center',title: '客户名称'}, |
| | | {field: 'memo', align: 'center',title: '备注'}, |
| | | {align: 'center', title: '操作', toolbar: '#operate', width: 240} |
| | | ]], |
| | | request: { |
| | |
| | | <input name="order_no" class="layui-input" type="text" placeholder="输入单据编号"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline mr0"> |
| | | <input name="cstmr_name" class="layui-input" type="text" placeholder="请输入客户名称"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |