| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | if (order.getSettle() == 4L) { |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | throw new CoolException("订单状态修改(4-6)失败"); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | throw new CoolException("订单状态修改(4-6)失败"); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (order.getSettle() == 4L) { |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | throw new CoolException("订单状态修改(4-6)失败"); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | throw new CoolException("订单状态修改(4-6)失败"); |
| | | } |
| | | } |
| | | } |
| | |
| | | null // 备注 |
| | | ); |
| | | if (!packService.insert(pack)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | throw new CoolException("打包失败"); |
| | | } |
| | | |
| | | Mat mat = matService.selectByMatnr(analyse.getMatnr()); |
| | |
| | | null // 备注 |
| | | ); |
| | | if (tagMapper.insert(priTag) == 0) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | throw new CoolException("分类添加失败"); |
| | | } |
| | | } |
| | | // 二级分类 |
| | |
| | | null // 备注 |
| | | ); |
| | | if (tagMapper.insert(secTag) == 0) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | throw new CoolException("分类添加失败"); |
| | | } |
| | | } |
| | | tagId = secTag.getId(); |
| | |
| | | mat.setCreateTime(now); |
| | | mat.setUpdateTime(now); |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | throw new CoolException("物料添加失败"); |
| | | } else { |
| | | log.info("打包上线添加新物料[物料号:{}]", mat.getMatnr()); |
| | | } |
| | |
| | | } |
| | | Date now = new Date(); |
| | | Order order = orderMapping(param, now, pakin, docName); |
| | | StringBuffer tel = new StringBuffer(); |
| | | Set<String> set = new HashSet<>(); |
| | | for (OrderSyncParam.OrderDetl child : param.getChildren()) { |
| | | tel.append(child.getCDefine22()).append(";"); |
| | | set.add(child.getCDefine22()); |
| | | } |
| | | order.setTel(tel.toString()); |
| | | order.setTel(JSON.toJSONString(set)); |
| | | orderService.insert(order); |
| | | param.getChildren().forEach(od -> { |
| | | OrderDetl orderDetl = orderDetlMapping(order, od, now); |
| | |
| | | od.setSource(order.getDocType().intValue()); |
| | | od.setStatus(1); |
| | | od.setQty(0.0D); |
| | | od.setReportQty(0.0D); |
| | | od.setCreateBy(9999L); |
| | | od.setCreateTime(now); |
| | | od.setUpdateBy(9999L); |