| | |
| | | EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | // wrapper.like("matnr", condition).or().like("maktx", condition); |
| | | wrapper.like("matnr", condition).or().like("maktx", condition); |
| | | wrapper.like("matnr", condition).or().like("maktx", condition).or().like("model", condition); |
| | | } |
| | | wrapper.orderBy("create_time", false); |
| | | List<Mat> mats = matService.selectList(wrapper); |
| | |
| | | @ManagerAuth |
| | | public R getMatDataKV(@RequestParam(required = false) String condition) { |
| | | Wrapper<Mat> wrapper = new EntityWrapper<Mat>() |
| | | .andNew().like("matnr", condition).or().like("maktx", condition) |
| | | .andNew().like("matnr", condition).or().like("maktx", condition).or().like("model",condition) |
| | | .orderBy("create_time", false); |
| | | List<Mat> mats = matService.selectPage(new Page<>(1, 30), wrapper).getRecords(); |
| | | List<KeyValueVo> valueVos = new ArrayList<>(); |
| | |
| | | return R.ok().add(orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_id", orderId))); |
| | | } |
| | | |
| | | /*@RequestMapping(value = "/order/form/add/auth") |
| | | @RequestMapping(value = "/order/form/add/auth") |
| | | @ManagerAuth(memo = "手动添加订单") |
| | | @Transactional |
| | | public R formAdd(@RequestBody OrderDomainParam param){ |
| | |
| | | for (OrderDetl orderDetl : param.getOrderDetlList()) { |
| | | DetlDto dto = new DetlDto(orderDetl.getMatnr(), orderDetl.getBatch()); |
| | | if (DetlDto.has(list, dto)) { |
| | | OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getAnfme()); |
| | | item.setAnfme(item.getAnfme() + orderDetl.getAnfme()); |
| | | if (!orderDetlService.updateById(item)) { |
| | | // OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getAnfme()); |
| | | // item.setAnfme(item.getAnfme() + orderDetl.getAnfme()); |
| | | // if (!orderDetlService.updateById(item)) { |
| | | throw new CoolException("保存订单明细档失败"); |
| | | } |
| | | // } |
| | | } else { |
| | | list.add(dto); |
| | | orderDetl.setOrderId(order.getId()); |
| | |
| | | } |
| | | } |
| | | return R.ok("订单添加成功"); |
| | | }*/ |
| | | } |
| | | |
| | | // @RequestMapping(value = "/order/form/modify/auth") |
| | | // @ManagerAuth(memo = "手动修改订单") |
| | | // @Transactional |
| | | // public R formModify(@RequestBody OrderDomainParam param){ |
| | | // Order order = orderService.selectById(param.getOrderId()); |
| | | // if (order == null || order.getStatus() == 0) { |
| | | // return R.error("订单不存在"); |
| | | // } |
| | | // Date now = new Date(); |
| | | // Long userId = getUserId(); |
| | | // // 修改主档 |
| | | // if (!param.getDocType().equals(order.getDocType())) { |
| | | // order.setDocType(param.getDocType()); |
| | | // order.setUpdateBy(userId); |
| | | // order.setUpdateTime(now); |
| | | // if (!orderService.updateById(order)) { |
| | | // throw new CoolException("修改订单类型失败"); |
| | | // } |
| | | // } |
| | | // // 修改明细档 |
| | | //// List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | // // 1.清空明细档 |
| | | // if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId()))) { |
| | | // throw new CoolException("清空订单明细失败"); |
| | | // } |
| | | // // 2.重组数据 |
| | | // List<DetlDto> list = new ArrayList<>(); |
| | | // for (OrderDetl orderDetl : param.getOrderDetlList()) { |
| | | // DetlDto dto = new DetlDto(orderDetl.getMatnr(), orderDetl.getBatch()); |
| | | // if (DetlDto.has(list, dto)) { |
| | | @RequestMapping(value = "/order/form/modify/auth") |
| | | @ManagerAuth(memo = "手动修改订单") |
| | | @Transactional |
| | | public R formModify(@RequestBody OrderDomainParam param){ |
| | | Order order = orderService.selectById(param.getOrderId()); |
| | | if (order == null || order.getStatus() == 0) { |
| | | return R.error("订单不存在"); |
| | | } |
| | | Date now = new Date(); |
| | | Long userId = getUserId(); |
| | | // 修改主档 |
| | | if (!param.getDocType().equals(order.getDocType())) { |
| | | order.setDocType(param.getDocType()); |
| | | order.setUpdateBy(userId); |
| | | order.setUpdateTime(now); |
| | | if (!orderService.updateById(order)) { |
| | | throw new CoolException("修改订单类型失败"); |
| | | } |
| | | } |
| | | // 修改明细档 |
| | | // List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | // 1.清空明细档 |
| | | if (!orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId()))) { |
| | | throw new CoolException("清空订单明细失败"); |
| | | } |
| | | // 2.重组数据 |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | for (OrderDetl orderDetl : param.getOrderDetlList()) { |
| | | DetlDto dto = new DetlDto(orderDetl.getMatnr(), orderDetl.getBatch()); |
| | | if (DetlDto.has(list, dto)) { |
| | | // OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getAnfme()); |
| | | // item.setAnfme(item.getAnfme() + orderDetl.getAnfme()); |
| | | // if (!orderDetlService.updateById(item)) { |
| | | // throw new CoolException("保存订单明细档失败"); |
| | | // } |
| | | // } else { |
| | | // list.add(dto); |
| | | // orderDetl.setOrderId(order.getId()); |
| | | // orderDetl.setOrderNo(order.getOrderNo()); |
| | | // orderDetl.setCreateBy(getUserId()); |
| | | // orderDetl.setCreateTime(now); |
| | | // orderDetl.setUpdateBy(getUserId()); |
| | | // orderDetl.setUpdateTime(now); |
| | | // orderDetl.setStatus(1); |
| | | // orderDetl.setQty(0.0D); |
| | | // if (!orderDetlService.insert(orderDetl)) { |
| | | // throw new CoolException("保存订单明细档失败"); |
| | | // } |
| | | // } |
| | | // } |
| | | // return R.ok("订单修改成功"); |
| | | // } |
| | | } else { |
| | | list.add(dto); |
| | | orderDetl.setOrderId(order.getId()); |
| | | orderDetl.setOrderNo(order.getOrderNo()); |
| | | orderDetl.setCreateBy(getUserId()); |
| | | orderDetl.setCreateTime(now); |
| | | orderDetl.setUpdateBy(getUserId()); |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("保存订单明细档失败"); |
| | | } |
| | | } |
| | | } |
| | | return R.ok("订单修改成功"); |
| | | } |
| | | |
| | | // @PostMapping(value = "/order/wrk/trace/auth") |
| | | // @ManagerAuth |
| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.param.FullStoreParam; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.WorkService; |
| | | import com.zy.common.model.StartupDto; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 工作流接口控制器 |
| | |
| | | return R.ok("入库启动成功").add(workService.startupFullPutStore(fullStoreParam,getUserId())); |
| | | } |
| | | |
| | | // @RequestMapping("/plate/out/start") |
| | | // @ManagerAuth(memo = "出库作业") |
| | | // public R fullStoreTakeStart(@RequestBody StockOutParam param) { |
| | | // workService.startupFullTakeStore(param, getUserId()); |
| | | // return R.ok("出库启动成功"); |
| | | // } |
| | | |
| | | @RequestMapping("/plate/out/start") |
| | | @ManagerAuth(memo = "出库作业") |
| | | public R fullStoreTakeStart(@RequestBody StockOutParam param) { |
| | | public R fullStoreTakeStart(@RequestBody StockOutFloorParam param) { |
| | | if (param.getFloor() != null) { |
| | | List<Integer> siteIdList = new ArrayList<>(); |
| | | |
| | | // 第一步:根据楼层选择站点集合 |
| | | switch (param.getFloor()) { |
| | | case 1: // 一楼(东区) |
| | | siteIdList = Arrays.asList(121, 124, 125, 126); |
| | | break; |
| | | case 2: // 二楼(东区) |
| | | siteIdList = Arrays.asList(221, 224, 226, 229); |
| | | break; |
| | | case 3: // 四楼(东区) |
| | | siteIdList = Arrays.asList(411, 412, 413, 414); |
| | | break; |
| | | case 4: // 一楼(西区) |
| | | siteIdList = Arrays.asList(103); // 只有一个站点 |
| | | break; |
| | | case 5: // 二楼(西区) |
| | | siteIdList = Arrays.asList(201, 204, 206, 209); |
| | | break; |
| | | case 6: // 四楼(西区) |
| | | siteIdList = Arrays.asList(401, 402, 403, 404); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | // 第二步:根据 locNo 的排号,给每个 locDetl 设置 siteId |
| | | if (param.getLocDetls() != null) { |
| | | for (StockOutFloorParam.LocDetl locDetl : param.getLocDetls()) { |
| | | String locNo = locDetl.getLocNo(); // 如:0312001 |
| | | if (locNo != null && locNo.length() >= 2) { |
| | | String rowStr = locNo.substring(0, 2); // 前两位为排号 |
| | | int row = Integer.parseInt(rowStr); |
| | | |
| | | Integer siteId = null; |
| | | |
| | | // 站点分布规则 |
| | | if (row == 1 || row == 2) { |
| | | siteId = siteIdList.size() > 0 ? siteIdList.get(0) : null; |
| | | } else if (row == 3 || row == 4) { |
| | | siteId = siteIdList.size() > 1 ? siteIdList.get(1) : null; |
| | | } else if (row == 5 || row == 6) { |
| | | siteId = siteIdList.size() > 2 ? siteIdList.get(2) : null; |
| | | } else if (row == 7 || row == 8) { |
| | | siteId = siteIdList.size() > 3 ? siteIdList.get(3) : null; |
| | | } |
| | | |
| | | // 设置 siteId |
| | | locDetl.setSiteId(siteId); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | workService.startupFullTakeStore(param, getUserId()); |
| | | return R.ok("出库启动成功"); |
| | | } |
| | |
| | | return R.ok("出库启动成功"); |
| | | } |
| | | |
| | | // @RequestMapping("/locCheck/out/start") |
| | | // @ManagerAuth(memo = "盘点出库") |
| | | // public R locCheckOutStart(@RequestBody StockOutParam param) { |
| | | // |
| | | // workService.locCheckOut(param, getUserId()); |
| | | // return R.ok("出库启动成功"); |
| | | // } |
| | | |
| | | @RequestMapping("/locCheck/out/start") |
| | | @ManagerAuth(memo = "盘点出库") |
| | | public R locCheckOutStart(@RequestBody StockOutParam param) { |
| | | public R locCheckOutStart(@RequestBody StockOutFloorParam param) { |
| | | if (param.getFloor() != null) { |
| | | List<Integer> siteIdList = new ArrayList<>(); |
| | | |
| | | // 第一步:根据楼层选择站点集合 |
| | | switch (param.getFloor()) { |
| | | case 1: // 一楼(东区) |
| | | siteIdList = Arrays.asList(121, 124, 125, 126); |
| | | break; |
| | | case 2: // 二楼(东区) |
| | | siteIdList = Arrays.asList(221, 224, 226, 229); |
| | | break; |
| | | case 3: // 四楼(东区) |
| | | siteIdList = Arrays.asList(411, 412, 413, 414); |
| | | break; |
| | | case 4: // 一楼(西区) |
| | | siteIdList = Arrays.asList(103); // 只有一个站点 |
| | | break; |
| | | case 5: // 二楼(西区) |
| | | siteIdList = Arrays.asList(201, 204, 206, 209); |
| | | break; |
| | | case 6: // 四楼(西区) |
| | | siteIdList = Arrays.asList(401, 402, 403, 404); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | // 第二步:根据 locNo 的排号,给每个 locDetl 设置 siteId |
| | | if (param.getLocDetls() != null) { |
| | | for (StockOutFloorParam.LocDetl locDetl : param.getLocDetls()) { |
| | | String locNo = locDetl.getLocNo(); // 如:0312001 |
| | | if (locNo != null && locNo.length() >= 2) { |
| | | String rowStr = locNo.substring(0, 2); // 前两位为排号 |
| | | int row = Integer.parseInt(rowStr); |
| | | |
| | | Integer siteId = null; |
| | | |
| | | // 站点分布规则 |
| | | if (row == 1 || row == 2) { |
| | | siteId = siteIdList.size() > 0 ? siteIdList.get(0) : null; |
| | | } else if (row == 3 || row == 4) { |
| | | siteId = siteIdList.size() > 1 ? siteIdList.get(1) : null; |
| | | } else if (row == 5 || row == 6) { |
| | | siteId = siteIdList.size() > 2 ? siteIdList.get(2) : null; |
| | | } else if (row == 7 || row == 8) { |
| | | siteId = siteIdList.size() > 3 ? siteIdList.get(3) : null; |
| | | } |
| | | |
| | | // 设置 siteId |
| | | locDetl.setSiteId(siteId); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | workService.locCheckOut(param, getUserId()); |
| | | return R.ok("出库启动成功"); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | @Data |
| | | public class StockOutFloorParam { |
| | | // 出站口 |
| | | private Integer floor; |
| | | |
| | | // 物料编号集合 |
| | | private List<LocDetl> locDetls; |
| | | |
| | | @Data |
| | | public static class LocDetl { |
| | | private Integer siteId; |
| | | |
| | | // 库位号 |
| | | private String locNo; |
| | | |
| | | // 商品编号 |
| | | private String matnr; |
| | | |
| | | // 序列码 |
| | | private String batch; |
| | | |
| | | // 数量 |
| | | private Double count; |
| | | |
| | | private String sPgNO; |
| | | |
| | | private String outOrderNo; |
| | | |
| | | private String luHao; |
| | | private Double weight; |
| | | |
| | | private String packing; |
| | | |
| | | private String proType; |
| | | |
| | | |
| | | private String color; |
| | | } |
| | | } |
| | |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.StockStatisDTO; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.param.StockOutFloorParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | |
| | |
| | | LocDetl selectItem(String locNo, WrkDetl wrkDetl); |
| | | |
| | | LocDetl selectItem(String locNo, StockOutParam.LocDetl locDetl); |
| | | |
| | | LocDetl selectItem(String locNo, StockOutFloorParam.LocDetl locDetl); |
| | | Page<LocDetl> getStockOut(Page<LocDetl> page); |
| | | |
| | | /** |
| | |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.param.FullStoreParam; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.common.model.LocDetlDto; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.model.TaskDto; |
| | |
| | | */ |
| | | String startupFullPutStore(FullStoreParam param, Long userId); |
| | | |
| | | // /** |
| | | // * 出库作业 |
| | | // */ |
| | | // void startupFullTakeStore(StockOutParam param, Long userId); |
| | | |
| | | /** |
| | | * 出库作业 |
| | | */ |
| | | void startupFullTakeStore(StockOutParam param, Long userId); |
| | | void startupFullTakeStore(StockOutFloorParam param, Long userId); |
| | | |
| | | |
| | | /** |
| | | * 出库作业 |
| | |
| | | */ |
| | | public WrkMast emptyPlateOut(EmptyPlateOutParam param); |
| | | |
| | | // /** |
| | | // * 盘点出库 |
| | | // */ |
| | | // void locCheckOut(StockOutParam param, Long userId); |
| | | |
| | | /** |
| | | * 盘点出库 |
| | | */ |
| | | void locCheckOut(StockOutParam param, Long userId); |
| | | void locCheckOut(StockOutFloorParam param, Long userId); |
| | | |
| | | /** |
| | | * 库位移转 |
| | |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.StockStatisDTO; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.param.StockOutFloorParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | |
| | | } |
| | | return null; |
| | | } |
| | | @Override |
| | | public LocDetl selectItem(String locNo, StockOutFloorParam.LocDetl locDetl) { |
| | | List<LocDetl> locDetls = this.baseMapper.selectItem3(locNo, locDetl.getMatnr()); |
| | | if (locDetls != null) { |
| | | for (LocDetl detl : locDetls) { |
| | | if (MatCompareUtils.compare(locDetl, detl)) { |
| | | return detl; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.param.FullStoreParam; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.*; |
| | |
| | | return null; |
| | | } |
| | | |
| | | // @Override |
| | | // @Transactional |
| | | // public void startupFullTakeStore(StockOutFloorParam param, Long userId) { |
| | | // // 目标站点状态检测 |
| | | // BasDevp staNo = null; |
| | | // // 获取库位明细 |
| | | // List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | // for (StockOutFloorParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | // staNo = basDevpService.checkSiteStatus(paramLocDetl.getSiteId()); |
| | | // |
| | | // if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | // LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl); |
| | | // if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | // } |
| | | // } |
| | | // if (!locDetlDtos.isEmpty()) { |
| | | // LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | // if (locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D")) { |
| | | // // 启动出库开始 101.出库 |
| | | // stockOut(staNo, locDetlDtos, null, userId); |
| | | // } else { |
| | | // throw new CoolException("所选库位存在状态不为F、D的库位,库位号:" + locMast.getLocNo() + " 、当前状态:" + locMast.getLocSts() + "-" + locMast.getLocSts$()); |
| | | // } |
| | | // } else { |
| | | // throw new CoolException("库存不存在"); |
| | | // } |
| | | // } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void startupFullTakeStore(StockOutParam param, Long userId) { |
| | | // 目标站点状态检测 |
| | | BasDevp staNo = basDevpService.checkSiteStatus(param.getOutSite()); |
| | | // 获取库位明细 |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | public void startupFullTakeStore(StockOutFloorParam param, Long userId) { |
| | | // 按 siteId 分组 |
| | | Map<Integer, List<LocDetlDto>> siteIdToLocDetlsMap = new HashMap<>(); |
| | | |
| | | for (StockOutFloorParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl); |
| | | if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | if (one != null) { |
| | | LocDetlDto dto = new LocDetlDto(one, paramLocDetl.getCount()); |
| | | Integer siteId = paramLocDetl.getSiteId(); |
| | | |
| | | if (siteId != null) { |
| | | siteIdToLocDetlsMap.computeIfAbsent(siteId, k -> new ArrayList<>()).add(dto); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (!locDetlDtos.isEmpty()) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | if (locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D")) { |
| | | // 启动出库开始 101.出库 |
| | | stockOut(staNo, locDetlDtos, null, userId); |
| | | } else { |
| | | throw new CoolException("所选库位存在状态不为F、D的库位,库位号:" + locMast.getLocNo() + " 、当前状态:" + locMast.getLocSts() + "-" + locMast.getLocSts$()); |
| | | } |
| | | } else { |
| | | |
| | | if (siteIdToLocDetlsMap.isEmpty()) { |
| | | throw new CoolException("库存不存在"); |
| | | } |
| | | |
| | | // 遍历分组后的每个 siteId,逐个出库 |
| | | for (Map.Entry<Integer, List<LocDetlDto>> entry : siteIdToLocDetlsMap.entrySet()) { |
| | | Integer siteId = entry.getKey(); |
| | | List<LocDetlDto> locDetlDtos = entry.getValue(); |
| | | |
| | | // 校验库位状态 |
| | | LocMast locMast = locMastService.selectOne( |
| | | new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo()) |
| | | ); |
| | | |
| | | if (locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D")) { |
| | | // 校验目标站点 |
| | | BasDevp staNo = basDevpService.checkSiteStatus(siteId); |
| | | |
| | | // 执行出库 |
| | | stockOut(staNo, locDetlDtos, null, userId); |
| | | } else { |
| | | throw new CoolException("所选库位存在状态不为F、D的库位,库位号:" + |
| | | locMast.getLocNo() + " 、当前状态:" + locMast.getLocSts() + "-" + locMast.getLocSts$()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | return wrkMast; |
| | | } |
| | | |
| | | // @Override |
| | | // @Transactional |
| | | // public void locCheckOut(StockOutParam param, Long userId) { |
| | | // // 目标站点状态检测 |
| | | // BasDevp staNo = basDevpService.checkSiteStatus(param.getOutSite()); |
| | | // // 获取库位明细 |
| | | // List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | // for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | // if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | // LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl); |
| | | // if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | // } |
| | | // } |
| | | // if (!locDetlDtos.isEmpty()) { |
| | | // LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | // if (locMast.getLocSts().equals("F")) { |
| | | // // 启动出库开始 107.盘点出库 |
| | | // stockOut(staNo, locDetlDtos, IoWorkType.CHECK_OUT, userId); |
| | | // } else { |
| | | // throw new CoolException("所选库位存在状态不为F的库位,库位号:" + locMast.getLocNo() + " 、当前状态:" + locMast.getLocSts() + "-" + locMast.getLocSts$()); |
| | | // } |
| | | // } else { |
| | | // throw new CoolException("库位物料不存在"); |
| | | // } |
| | | // } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void locCheckOut(StockOutParam param, Long userId) { |
| | | // 目标站点状态检测 |
| | | BasDevp staNo = basDevpService.checkSiteStatus(param.getOutSite()); |
| | | // 获取库位明细 |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | public void locCheckOut(StockOutFloorParam param, Long userId) { |
| | | |
| | | // 按 siteId 分组 |
| | | Map<Integer, List<LocDetlDto>> siteIdToLocDetlsMap = new HashMap<>(); |
| | | |
| | | for (StockOutFloorParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl); |
| | | if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | if (one != null) { |
| | | LocDetlDto dto = new LocDetlDto(one, paramLocDetl.getCount()); |
| | | Integer siteId = paramLocDetl.getSiteId(); |
| | | |
| | | if (siteId != null) { |
| | | siteIdToLocDetlsMap.computeIfAbsent(siteId, k -> new ArrayList<>()).add(dto); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (!locDetlDtos.isEmpty()) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | if (locMast.getLocSts().equals("F")) { |
| | | // 启动出库开始 107.盘点出库 |
| | | |
| | | if (siteIdToLocDetlsMap.isEmpty()) { |
| | | throw new CoolException("库存不存在"); |
| | | } |
| | | |
| | | // 遍历分组后的每个 siteId,逐个出库 |
| | | for (Map.Entry<Integer, List<LocDetlDto>> entry : siteIdToLocDetlsMap.entrySet()) { |
| | | Integer siteId = entry.getKey(); |
| | | List<LocDetlDto> locDetlDtos = entry.getValue(); |
| | | |
| | | // 校验库位状态 |
| | | LocMast locMast = locMastService.selectOne( |
| | | new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo()) |
| | | ); |
| | | |
| | | if (locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D")) { |
| | | // 校验目标站点 |
| | | BasDevp staNo = basDevpService.checkSiteStatus(siteId); |
| | | |
| | | // 执行出库 |
| | | stockOut(staNo, locDetlDtos, IoWorkType.CHECK_OUT, userId); |
| | | } else { |
| | | throw new CoolException("所选库位存在状态不为F的库位,库位号:" + locMast.getLocNo() + " 、当前状态:" + locMast.getLocSts() + "-" + locMast.getLocSts$()); |
| | | throw new CoolException("所选库位存在状态不为F、D的库位,库位号:" + |
| | | locMast.getLocNo() + " 、当前状态:" + locMast.getLocSts() + "-" + locMast.getLocSts$()); |
| | | } |
| | | } else { |
| | | throw new CoolException("库位物料不存在"); |
| | | } |
| | | } |
| | | |
| | |
| | | {field: 'proType', title: '属性'}, |
| | | {field: 'outOrderNo', title: '合同号'}, |
| | | {field: 'temp1',title: '名称总称'}, |
| | | {field:'temp2', title: '客户图号'}, |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'workQty', title: '作业数量'}, |
| | | {field: 'qty', title: '完成数量', style: 'font-weight: bold'}, |
| | |
| | | {field: 'proType', title: '属性', edit: true}, |
| | | {field: 'model', title: '代码', edit: true}, |
| | | {field: 'outOrderNo', title: '合同号', edit: true}, |
| | | |
| | | {field: 'threeCode', title: '第三方代码'}, |
| | | {field: 'temp2', title: '客户图号',edit:true}, |
| | | // {field: 'threeCode', title: '第三方代码'}, |
| | | {field: 'specs', title: '规格'}, |
| | | {field: 'anfme', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110}, |
| | | {field: 'workQty', title: '作业数量', minWidth: 100, width: 100}, |
| | |
| | | return; |
| | | } |
| | | let param = { |
| | | outSite: staNo, |
| | | floor: staNo, |
| | | locDetls: locDetlData |
| | | } |
| | | $.ajax({ |
| | |
| | | return; |
| | | } |
| | | let param = { |
| | | outSite: staNo, |
| | | floor: staNo, |
| | | locDetls: locDetlData |
| | | } |
| | | $.ajax({ |
| | |
| | | <span id="staNoSpan">盘点站:</span> |
| | | <select id="staNoSelect" lay-verify="required"> |
| | | <option value="">请选择站点</option> |
| | | </select> |
| | | <!-- <option value="1">一楼(东区)</option>--> |
| | | <!-- <option value="2">二楼(东区)</option>--> |
| | | <option value="3">四楼(东区)</option> |
| | | <!-- <option value="4">一楼(西区)</option>--> |
| | | <!-- <option value="5">二楼(西区)</option>--> |
| | | <option value="6">四楼(西区)</option> </select> |
| | | <!-- 2.启动出库 --> |
| | | <button class="layui-btn layui-btn-lg" id="btn-outbound" lay-event="outbound">盘点出库</button> |
| | | </div> |
| | |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </div> |
| | | |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{this}}">{{this}}</option> |
| | | {{/each}} |
| | | </script> |
| | | <!--<script type="text/template" id="takeSiteSelectTemplate">--> |
| | | <!-- {{#each data}}--> |
| | | <!-- <option value="{{this}}">{{this}}</option>--> |
| | | <!-- {{/each}}--> |
| | | <!--</script>--> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | |
| | | <span id="staNoSpan">出库口:</span> |
| | | <select id="staNoSelect" lay-verify="required"> |
| | | <option value="">请选择站点</option> |
| | | <option value="1">一楼(东区)</option> |
| | | <option value="2">二楼(东区)</option> |
| | | <!-- <option value="3">四楼(东区)</option>--> |
| | | <option value="4">一楼(西区)</option> |
| | | <option value="5">二楼(西区)</option> |
| | | <!-- <option value="6">四楼(西区)</option>--> |
| | | </select> |
| | | |
| | | <!-- 2.启动出库 --> |
| | | <button class="layui-btn layui-btn-lg" id="btn-outbound" lay-event="outbound">启动出库</button> |
| | | </div> |
| | |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/pakStore/stockOut.js" charset="utf-8"></script> |
| | | |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{siteId}}">{{desc}}</option> |
| | | {{/each}} |
| | | </script> |
| | | <!--<script type="text/template" id="takeSiteSelectTemplate">--> |
| | | <!-- {{#each data}}--> |
| | | <!-- <option value="{{siteId}}">{{desc}}</option>--> |
| | | <!-- {{/each}}--> |
| | | <!--</script>--> |
| | | </body> |
| | | </html> |
| | | |