| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | private TagService tagService; |
| | | @Autowired |
| | | private TagMapper tagMapper; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | order = new Order( |
| | | String.valueOf(snowflakeIdWorker.nextId()), // 编号[非空] |
| | | param.getOrderNo(), // 订单编号 |
| | | DateUtils.convert(now), // 单据日期 |
| | | param.getInboundDate(), // 单据日期 |
| | | docType.getDocId(), // 单据类型 |
| | | null, // 项目编号 |
| | | null, // |
| | | param.getWarehouse(), //仓库 itemName |
| | | null, // 调拨项目编号 |
| | | null, // 初始票据号 |
| | | null, // 票据号 |
| | | param.getOriginWarehouse(), // 初始票据号 来源仓库 |
| | | param.getDepartment(), // 票据号 |
| | | null, // 客户编号 |
| | | null, // 客户 |
| | | param.getSuppliers(), // 供应商 cstmrName |
| | | null, // 联系方式 |
| | | null, // 操作人员 |
| | | param.getUser(), // 制单人 |
| | | null, // 合计金额 |
| | | null, // 优惠率 |
| | | null, // 优惠金额 |
| | | null, // 销售或采购费用合计 |
| | | null, // 实付金额 |
| | | null, // 付款类型 |
| | | null, // 业务员 |
| | | param.getSalesman(), // 业务员 |
| | | null, // 结算天数 |
| | | null, // 邮费支付类型 |
| | | null, // 邮费 |
| | | null, // 付款时间 |
| | | null, // 发货时间 |
| | | null, // 物流名称 |
| | | param.getBusinessType(), // 物流名称 |
| | | null, // 物流单号 |
| | | 1L, // 订单状态 |
| | | 1, // 状态 |
| | |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | orderDetl.setThreeCode(detlDto.getOrderNo()); |
| | | orderDetl.setSuppCode(detlDto.getFromOrderNo()); |
| | | orderDetl.setMemo(detlDto.getMemo()); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | |
| | | order = new Order( |
| | | String.valueOf(snowflakeIdWorker.nextId()), // 编号[非空] |
| | | param.getOrderNo(), // 订单编号 |
| | | DateUtils.convert(now), // 单据日期 |
| | | param.getInboundDate(), // 单据日期 |
| | | docType.getDocId(), // 单据类型 |
| | | null, // 项目编号 |
| | | null, // |
| | | param.getWarehouse(), //仓库 itemName |
| | | null, // 调拨项目编号 |
| | | null, // 初始票据号 |
| | | null, // 票据号 |
| | | param.getOriginWarehouse(), // 初始票据号 来源仓库 |
| | | param.getDepartment(), // 票据号 |
| | | null, // 客户编号 |
| | | null, // 客户 |
| | | param.getSuppliers(), // 供应商 cstmrName |
| | | null, // 联系方式 |
| | | null, // 操作人员 |
| | | param.getUser(), // 制单人 |
| | | null, // 合计金额 |
| | | null, // 优惠率 |
| | | null, // 优惠金额 |
| | | null, // 销售或采购费用合计 |
| | | null, // 实付金额 |
| | | null, // 付款类型 |
| | | null, // 业务员 |
| | | param.getSalesman(), // 业务员 |
| | | null, // 结算天数 |
| | | null, // 邮费支付类型 |
| | | null, // 邮费 |
| | | null, // 付款时间 |
| | | null, // 发货时间 |
| | | null, // 物流名称 |
| | | param.getBusinessType(), // 物流名称 |
| | | null, // 物流单号 |
| | | 1L, // 订单状态 |
| | | 1, // 状态 |
| | |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | orderDetl.setThreeCode(detlDto.getOrderNo()); |
| | | orderDetl.setSuppCode(detlDto.getFromOrderNo()); |
| | | orderDetl.setMemo(detlDto.getMemo()); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | |
| | | } else { |
| | | tagId = tagService.getTop().getId(); |
| | | } |
| | | mat.sync(param); |
| | | mat.sync(matParam); |
| | | // mat.setMatnr(param.getMatnr()); |
| | | // mat.setMaktx(param.getMaktx()); |
| | | // mat.setSpecs(param.getSpecs()); |
| | |
| | | log.info("同步新物料[商品编号:{}]", mat.getMatnr()); |
| | | } |
| | | } else { |
| | | mat.sync(param); |
| | | mat.sync(matParam); |
| | | if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr",matParam.getMatnr()))) { |
| | | throw new CoolException("更新已存在商品信息失败,请联系管理员"); |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<LocDetlByTimeDTO> selectTimeLocDetl(TimeSelectParam param) { |
| | | ArrayList<LocDetlByTimeDTO> locDetlByTimeDTOS = new ArrayList<>(); |
| | | EntityWrapper<LocDetl> locDetlEntityWrapper = new EntityWrapper<>(); |
| | | locDetlEntityWrapper.ge("appe_time",param.getStartTime()); |
| | | locDetlEntityWrapper.le("appe_time",param.getEndTime()); |
| | | List<LocDetl> locDetls = locDetlService.selectList(locDetlEntityWrapper); |
| | | if (!Cools.isEmpty(locDetls)) { |
| | | for (LocDetl locDetl : locDetls) { |
| | | LocDetlByTimeDTO locDetlByTimeDTO = new LocDetlByTimeDTO(); |
| | | if (!Cools.isEmpty(locDetl.getOrderNo())){ |
| | | Order order = orderService.selectByNo(locDetl.getOrderNo()); |
| | | if (!Cools.isEmpty(order)) { |
| | | locDetlByTimeDTO.setDate(order.getOrderTime()); |
| | | locDetlByTimeDTO.setWarehouse(order.getItemName()); |
| | | locDetlByTimeDTO.setOrderType(order.getDocType().toString()); |
| | | } |
| | | } |
| | | |
| | | locDetlByTimeDTO.setMatnr(locDetl.getMatnr()); |
| | | locDetlByTimeDTO.setLocNo(locDetl.getLocNo()); |
| | | locDetlByTimeDTO.setBatch(locDetl.getBatch()); |
| | | locDetlByTimeDTO.setAnfme(locDetl.getAnfme()); |
| | | locDetlByTimeDTO.setOrderNo(locDetl.getOrderNo()); |
| | | locDetlByTimeDTOS.add(locDetlByTimeDTO); |
| | | } |
| | | } |
| | | return locDetlByTimeDTOS; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public boolean agvHaiKang(String wrkNo) { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", Long.parseLong(wrkNo))); |
| | | wrkMast.setWrkSts(wrkMast.getWrkStsComplete()); |
| | | wrkMastService.updateById(wrkMast); |
| | | return true; |
| | | } |
| | | |
| | | } |