| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.AgvMobileStartPakin; |
| | | import com.zy.asrs.entity.param.OrderDomainParam; |
| | | import com.zy.asrs.entity.result.WrkTraceVo; |
| | | import com.zy.asrs.service.*; |
| | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | |
| | | EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } else { |
| | | wrapper.orderBy("settle").orderBy("create_time", false); |
| | | } |
| | | wrapper.eq("status", 1); |
| | |
| | | EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } else { |
| | | wrapper.orderBy("settle").orderBy("create_time", false); |
| | | } |
| | | wrapper.eq("status", 1); |
| | |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/backStocks/detls/pakin/page/auth") |
| | | @ManagerAuth |
| | | public R backStocksOrderDetls(@RequestParam(defaultValue = "1")Integer curr, |
| | |
| | | } |
| | | Date now = new Date(); |
| | | Long userId = getUserId(); |
| | | StringBuffer tel = new StringBuffer(); |
| | | for (OrderDetl orderDetl : param.getOrderDetlList()) { |
| | | tel.append(orderDetl.getThreeCode().trim()).append(";"); |
| | | } |
| | | // 修改主档 |
| | | if (!param.getDocType().equals(order.getDocType())) { |
| | | order.setDocType(param.getDocType()); |
| | | order.setUpdateBy(userId); |
| | | order.setUpdateTime(now); |
| | | order.setTel(tel.toString()); |
| | | if (!orderService.updateById(order)) { |
| | | throw new CoolException("修改订单类型失败"); |
| | | } |
| | |
| | | } |
| | | // 2.重组数据 |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | |
| | | for (OrderDetl orderDetl : param.getOrderDetlList()) { |
| | | DetlDto dto = new DetlDto(orderDetl.getMatnr(), orderDetl.getAnfme(), orderDetl.getProcessSts()); |
| | | if (DetlDto.has(list, dto)) { |
| | |
| | | EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } |
| | | return R.ok(orderService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | try { |
| | | if (excelVersion == 2003) { |
| | | book = new HSSFWorkbook(inStream); |
| | | } |
| | | else { // 当 excel 是 2007 时 |
| | | } else { // 当 excel 是 2007 时 |
| | | book = new XSSFWorkbook(inStream); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | try { |
| | | if (excelVersion == 2003) { |
| | | book = new HSSFWorkbook(inStream); |
| | | } |
| | | else { // 当 excel 是 2007 时 |
| | | } else { // 当 excel 是 2007 时 |
| | | book = new XSSFWorkbook(inStream); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | return R.ok("导入成功").add(strs); |
| | | } |
| | | |
| | | |
| | | // @RequestMapping(value = "/order/sync") |
| | | // @Transactional |
| | | // public R sync() { |
| | | // List<Order> orders = orderService.selectList(new EntityWrapper<Order>().isNull("tel")); |
| | | // for (Order order : orders) { |
| | | // List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | // if (orderDetls.isEmpty()) { |
| | | // return R.ok(); |
| | | // } |
| | | // Set<String> collect = orderDetls.stream().map(x -> x.getThreeCode()).collect(Collectors.toSet()); |
| | | // if (!collect.isEmpty() && collect.size() > 0) { |
| | | // log.info("订单号{},同步数据{}", order.getId(), collect); |
| | | // orderService.updateTel(order.getId(), JSON.toJSONString(collect)); |
| | | // } |
| | | // } |
| | | // return R.ok(); |
| | | // } |
| | | } |