| | |
| | | @Data |
| | | public static class CombMat { |
| | | |
| | | private String orderNo; |
| | | |
| | | //料想码 |
| | | private String containerCode; |
| | | |
| | |
| | | for (GenerateOrderMatParam matParam : mats) { |
| | | Mat mat = matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr, matParam.getMatnr()).eq(Mat::getHostId, param.getHostId())); |
| | | if (Cools.isEmpty(mat)) { |
| | | orderService.remove(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, order.getOrderNo())); |
| | | throw new CoolException(matParam.getMatnr() + "编号商品检索失败,请先添加商品"); |
| | | } |
| | | OrderDetl orderDetl = new OrderDetl(); |
| | |
| | | LambdaQueryWrapper<StaDesc> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(StaDesc::getTypeNo, typeNo); |
| | | wrapper.eq(StaDesc::getHostId, hostId); |
| | | wrapper.orderByDesc(StaDesc::getStnNo); |
| | | for (StaDesc staDesc : this.list(wrapper)) { |
| | | list.add(staDesc.getStnNo()); |
| | | } |
| | |
| | | @ApiModelProperty(value= "仓库ID") |
| | | private Long hostId; |
| | | |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | @ApiModelProperty(value="订单号") |
| | | private String orderNo; |
| | | |
| | | public AdjDetl() {} |
| | | |
| | | public AdjDetl(String locNo,String matnr,String batch,Double oriCtns,Double oriQty,Double oriWt,Double adjCtns,Double adjQty,Double adjWt,String memo,Long modiUser,Date modiTime,Long appeUser,Date appeTime) { |
| | |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | @ApiModelProperty(value="制令") |
| | | private String decrees; |
| | | |
| | | @ApiModelProperty(value = "訂單號") |
| | | private String orderNo; |
| | | |
| | | public LocInPrintMat() {} |
| | | |
| | | public LocInPrintMat(String uuid,Integer status,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo,String matnr,String batch,Double anfme,String locNo,String maktx) { |
| | |
| | | R WarehouseIn(String locNo, String barcode,Long hostId); |
| | | |
| | | R WarehouseOut(CombParam combParam, Long hostId); |
| | | R WarehouseOutV1(CombParam combParam, Long hostId); |
| | | R WarehouseOutPickMergeV1(WarehouseOutPickMergeParam param, Long hostId); |
| | | R WarehouseOutMergeBoardMany(WarehouseOutMergeBoardManyParam param, Long hostId); |
| | | R WarehouseOutV1(CombParam combParam, Long hostId,Long userId); |
| | | R WarehouseOutPickMergeV1(WarehouseOutPickMergeParam param, Long hostId,Long userId); |
| | | R WarehouseOutMergeBoardMany(WarehouseOutMergeBoardManyParam param, Long hostId,Long userId); |
| | | } |
| | |
| | | import com.zy.asrs.common.openapi.entity.param.CombParam; |
| | | import com.zy.asrs.common.openapi.entity.param.WarehouseOutMergeBoardManyParam; |
| | | import com.zy.asrs.common.openapi.entity.param.WarehouseOutPickMergeParam; |
| | | import com.zy.asrs.common.web.BaseController; |
| | | import com.zy.asrs.common.wms.entity.*; |
| | | import com.zy.asrs.common.wms.mapper.LocDetlMapper; |
| | | import com.zy.asrs.common.wms.service.*; |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public R WarehouseOutV1(CombParam combParam, Long hostId) { |
| | | public R WarehouseOutV1(CombParam combParam, Long hostId,Long userId) { |
| | | //判断库位状态 |
| | | LocMast locMast = locMastService.getOne(new LambdaQueryWrapper<LocMast>().eq(LocMast::getLocNo, combParam.getLocno()).eq(LocMast::getHostId,hostId).eq(LocMast::getWhsType,0L)); |
| | | if (Cools.isEmpty(locMast)){ |
| | |
| | | if (combMat.getAnfme() > locDetl.getAnfme()){ |
| | | return R.error("拣选数量错误,超出库存数量"); |
| | | } |
| | | if (!Cools.isEmpty(combParam.getOrderNo())){ |
| | | Order order = orderService.selectByNo(combParam.getOrderNo(), hostId); |
| | | if (!Cools.isEmpty(combMat.getOrderNo())){ |
| | | Order order = orderService.selectByNo(combMat.getOrderNo(), hostId); |
| | | if (Cools.isEmpty(order)){ |
| | | continue; |
| | | } |
| | |
| | | throw new CoolException("拣选数量出错,订单剩余出库数量小于已出库数量与将拣选数量之和!!!"); |
| | | } |
| | | // 修改订单明细作业数量 |
| | | if (!orderDetlService.increaseWorkQtyByOrderNo(combParam.getOrderNo(), combMat.getMatnr(), combMat.getBatch(), combMat.getAnfme(), hostId)) { |
| | | if (!orderDetlService.increaseWorkQtyByOrderNo(combMat.getOrderNo(), combMat.getMatnr(), combMat.getBatch(), combMat.getAnfme(), hostId)) { |
| | | throw new CoolException("修改单据明细工作数量失败"); |
| | | } |
| | | // 修改订单明细完成数量 |
| | |
| | | throw new CoolException("修改单据明细完成数量失败"); |
| | | } |
| | | // 修改订单状态 作业中 ===>> 已完成 |
| | | orderService.checkComplete(combParam.getOrderNo(), hostId); |
| | | orderService.checkComplete(combMat.getOrderNo(), hostId); |
| | | } |
| | | try { |
| | | //处理库存信息 |
| | |
| | | adjDetl.setBatch(locDetl.getBatch()); |
| | | adjDetl.setOriQty(locDetl.getAnfme()); |
| | | adjDetl.setMemo("WarehouseOutV1-pick"); |
| | | adjDetl.setModiUser(userId); |
| | | adjDetl.setAppeUser(userId); |
| | | adjDetl.setAppeTime(new Date()); |
| | | adjDetl.setModiTime(new Date()); |
| | | |
| | | adjDetl.setOrderNo(combMat.getOrderNo()); |
| | | if (combMat.getAnfme().equals(locDetl.getAnfme())){ |
| | | adjDetl.setAdjQty(0D); |
| | | //库存相等删除数据 |
| | |
| | | int count = locDetlService.count(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getLocNo,combParam.getLocno()).eq(LocDetl::getHostId, hostId)); |
| | | if (count == 0){ |
| | | LocMast locMast1 = locMastService.getOne(new LambdaQueryWrapper<LocMast>().eq(LocMast::getLocNo, combParam.getLocno()).eq(LocMast::getHostId, hostId)); |
| | | locMast1.setLocSts("O"); |
| | | locMastService.updateById(locMast1); |
| | | // locMast1.setLocSts("O"); |
| | | // locMastService.updateById(locMast1); |
| | | } |
| | | } else { |
| | | BigDecimal subtract = BigDecimal.valueOf(locDetl.getAnfme()).subtract(BigDecimal.valueOf(combMat.getAnfme())); |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public R WarehouseOutPickMergeV1(WarehouseOutPickMergeParam param, Long hostId) { |
| | | public R WarehouseOutPickMergeV1(WarehouseOutPickMergeParam param, Long hostId,Long userId) { |
| | | //判断库位状态 |
| | | LocMast locMast = locMastService.getOne(new LambdaQueryWrapper<LocMast>().eq(LocMast::getLocNo, param.getLocNo()).eq(LocMast::getHostId,hostId).eq(LocMast::getWhsType,0L)); |
| | | if (Cools.isEmpty(locMast)){ |
| | |
| | | locDetl.setId(null); |
| | | locDetl.setLocNo(param.getLocNo()); |
| | | locDetl.setBarcode(locMast.getBarcode()); |
| | | Mat mat = matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr,locDetl.getMatnr())); |
| | | locDetl.setHostId(hostId); |
| | | locDetl.setMaktx(mat.getMaktx()); |
| | | if(hostId==1){ |
| | | locDetl.setOwner("宁波仓"); |
| | | }else{ |
| | | locDetl.setOwner("新昌仓"); |
| | | } |
| | | |
| | | String matKey = locDetl.getMatnr(); |
| | | if (!Cools.isEmpty(locDetl.getBatch())) { |
| | |
| | | continue; |
| | | } |
| | | if (orderDetl.getAnfme() < (orderDetl.getWorkQty() + orderDto.getAnfme())) { |
| | | throw new CoolException("拣选数量出错,订单剩余出库数量小于已出库数量与将拣选数量之和!!!"); |
| | | throw new CoolException("并板数量出错,订单剩余出库数量小于已出库数量与将并板数量之和!!!"); |
| | | } |
| | | // 修改订单明细作业数量 |
| | | if (!orderDetlService.increaseWorkQtyByOrderNo(orderDto.getOrderNo(), locDetl.getMatnr(), locDetl.getBatch(), orderDto.getAnfme(), hostId)) { |
| | |
| | | } |
| | | // 修改订单状态 作业中 ===>> 已完成 |
| | | orderService.checkComplete(orderDto.getOrderNo(), hostId); |
| | | } |
| | | } |
| | | |
| | | try { |
| | | //处理库存信息 |
| | |
| | | adjDetl.setOriQty(originAnfme); |
| | | adjDetl.setAdjQty(locDetl.getAnfme()); |
| | | adjDetl.setMemo("WarehouseOutV1-pick"); |
| | | adjDetl.setModiUser(userId); |
| | | adjDetl.setAppeUser(userId); |
| | | adjDetl.setAppeTime(new Date()); |
| | | adjDetl.setModiTime(new Date()); |
| | | |
| | | adjDetl.setOrderNo(order.getOrderNo()); |
| | | if (!adjDetlService.save(adjDetl)) { |
| | | throw new CoolException("保存库存调整记录失败"); |
| | | } |
| | |
| | | throw new CoolException("更新库存数据出错" + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public R WarehouseOutMergeBoardMany(WarehouseOutMergeBoardManyParam param, Long hostId) { |
| | | public R WarehouseOutMergeBoardMany(WarehouseOutMergeBoardManyParam param, Long hostId,Long userId) { |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode(), hostId); |
| | | if (wrkMast == null) { |
| | | throw new CoolException("工作档不存在"); |
| | |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | String matKey = wrkDetl.getMatnr(); |
| | | if (!Cools.isEmpty(wrkDetl.getBatch())) { |
| | | matKey += "_" + wrkDetl.getBatch(); |
| | | matKey += "_" + wrkDetl.getBatch() + "-" +wrkDetl.getOrderNo(); |
| | | } |
| | | |
| | | MergeBoardManyDto dto = new MergeBoardManyDto(); |
| | |
| | | for (OrderDetl orderDetl : param.getCombMats()) { |
| | | String matKey = orderDetl.getMatnr(); |
| | | if (!Cools.isEmpty(orderDetl.getBatch())) { |
| | | matKey += "_" + orderDetl.getBatch(); |
| | | matKey += "_" + orderDetl.getBatch() + "-" +orderDetl.getOrderNo(); |
| | | } |
| | | |
| | | MergeBoardManyDto dto = wrkData.get(matKey); |
| | | if(dto == null){ |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(orderDetl); |
| | | Mat mat=matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr,wrkDetl.getMatnr())); |
| | | wrkDetl.sync(mat); |
| | | wrkDetl.setId(null); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setWrkMastId(wrkMast.getId()); |
| | | wrkDetl.setZpallet(wrkMast.getBarcode()); |
| | | wrkDetl.setIoTime(new Date()); |
| | | |
| | | wrkDetl.setHostId(hostId); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setAppeTime(new Date()); |
| | | wrkDetl.setModiUser(userId); |
| | | wrkDetl.setModiTime(new Date()); |
| | | ArrayList<PickMergeOrderDto> orderDtos = new ArrayList<>(); |
| | | orderDtos.add(new PickMergeOrderDto(orderDetl.getOrderNo(), orderDetl.getAnfme())); |
| | | |
| | |
| | | List<PickMergeOrderDto> orders = dto.getOrders(); |
| | | |
| | | wrkDetl.setAnfme(wrkDetl.getAnfme() + orderDetl.getAnfme()); |
| | | wrkDetl.setIoTime(new Date()); |
| | | wrkDetl.setHostId(hostId); |
| | | wrkDetl.setModiUser(userId); |
| | | wrkDetl.setModiTime(new Date()); |
| | | orders.add(new PickMergeOrderDto(orderDetl.getOrderNo(), orderDetl.getAnfme())); |
| | | |
| | | dto.setWrkDetl(wrkDetl); |
| | | dto.setOrders(orders); |
| | | } |
| | |
| | | } |
| | | // 修改订单状态 作业中 ===>> 已完成 |
| | | orderService.checkComplete(orderDto.getOrderNo(), hostId); |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | <when test="batch != null and batch != ''"> |
| | | and batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (batch IS NULL OR batch = '') |
| | | </otherwise> |
| | | <!-- <otherwise>--> |
| | | <!-- and (batch IS NULL OR batch = '')--> |
| | | <!-- </otherwise>--> |
| | | </choose> |
| | | </select> |
| | | |
| | |
| | | |
| | | @RequestMapping(value = "/locDetl/forlocNo/auth/v1") |
| | | @ManagerAuth |
| | | public R forlocNoV1(@RequestParam String locNo) { |
| | | public R forlocNoV1(@RequestParam String locNo,@RequestParam String matnr) { |
| | | if(Cools.isEmpty(matnr)){ |
| | | LambdaQueryWrapper<LocDetl> locDetlLambdaQueryWrapper = new LambdaQueryWrapper<LocDetl>() |
| | | .eq(LocDetl::getLocNo, locNo) |
| | | .eq(LocDetl::getHostId, getHostId()); |
| | |
| | | return R.error("未查询到库存数据"); |
| | | } |
| | | return R.ok(detls); |
| | | }else{ |
| | | LambdaQueryWrapper<LocDetl> locDetlLambdaQueryWrapper = new LambdaQueryWrapper<LocDetl>() |
| | | .eq(LocDetl::getLocNo, locNo) |
| | | .eq(LocDetl::getHostId, getHostId()) |
| | | .like(LocDetl::getMatnr,matnr); |
| | | List<LocDetl> detls = locDetlService.list(locDetlLambdaQueryWrapper); |
| | | if (Cools.isEmpty(detls)){ |
| | | return R.error("未查询到库存数据"); |
| | | } |
| | | return R.ok(detls); |
| | | } |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/forlocNo/auth") |
| | |
| | | return mobileService.WarehouseOut(combParam,getHostId()); |
| | | } |
| | | |
| | | @RequestMapping("/outBound/mat/list") |
| | | @ManagerAuth |
| | | public R WarehouseMat(@RequestParam String matnr, @RequestParam String orderNo) { |
| | | if (Cools.isEmpty(matnr)) { |
| | | R.error("品号不能为空"); |
| | | } |
| | | ArrayList<PickMatParam> maps = new ArrayList<>(); |
| | | if (Cools.isEmpty(orderNo)) { |
| | | List<OrderDetl> list = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>() |
| | | .eq(OrderDetl::getMatnr, matnr) |
| | | .orderByDesc(OrderDetl::getCreateTime)); |
| | | List<OrderDetl> orderDetls = new ArrayList<OrderDetl>(); |
| | | for (OrderDetl orderDetl : list |
| | | ) { |
| | | Order order = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, orderDetl.getOrderNo())); |
| | | if (!Cools.isEmpty(order)) { |
| | | DocType docType = docTypeService.getOne(new LambdaQueryWrapper<DocType>().eq(DocType::getDocId, order.getDocType())); |
| | | if (!Cools.isEmpty(docType) && docType.getPakout() == 1) { |
| | | double count = orderDetl.getAnfme() - orderDetl.getWorkQty(); |
| | | PickMatParam matParam = new PickMatParam(); |
| | | matParam.setMatnr(orderDetl.getMatnr()); |
| | | matParam.setBatch(orderDetl.getBatch()); |
| | | matParam.setOrderNo(orderDetl.getOrderNo()); |
| | | matParam.setOrderId(orderDetl.getOrderId()); |
| | | matParam.setCount(count); |
| | | matParam.setUseCount(count); |
| | | maps.add(matParam); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | return R.ok(maps); |
| | | } else { |
| | | List<OrderDetl> list = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>() |
| | | .eq(OrderDetl::getMatnr, matnr) |
| | | .like(OrderDetl::getOrderNo, orderNo) |
| | | .orderByDesc(OrderDetl::getCreateTime)); |
| | | for (OrderDetl orderDetl:list |
| | | ) { |
| | | double count = orderDetl.getAnfme() - orderDetl.getWorkQty(); |
| | | PickMatParam matParam = new PickMatParam(); |
| | | matParam.setMatnr(orderDetl.getMatnr()); |
| | | matParam.setBatch(orderDetl.getBatch()); |
| | | matParam.setOrderNo(orderDetl.getOrderNo()); |
| | | matParam.setOrderId(orderDetl.getOrderId()); |
| | | matParam.setCount(count); |
| | | matParam.setUseCount(count); |
| | | maps.add(matParam); |
| | | } |
| | | return R.ok(maps); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 并板途中拣料 |
| | | * |
| | | * @param combParam |
| | | * @return |
| | | */ |
| | | @RequestMapping("/pda/WarehouseOut/v1") |
| | | @ManagerAuth |
| | | public R WarehouseOutV1(@RequestBody CombParam combParam){ |
| | | return mobileService.WarehouseOutV1(combParam,getHostId()); |
| | | return mobileService.WarehouseOutV1(combParam, getHostId(), getUserId()); |
| | | } |
| | | |
| | | /** |
| | | * 拣料途中并板 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/pda/WarehouseOutPickMerge/v1") |
| | | @ManagerAuth |
| | | public R WarehouseOutPickMergeV1(@RequestBody WarehouseOutPickMergeParam param){ |
| | | return mobileService.WarehouseOutPickMergeV1(param, getHostId()); |
| | | return mobileService.WarehouseOutPickMergeV1(param, getHostId(),getUserId()); |
| | | } |
| | | |
| | | /** |
| | | * 多次并板 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/pda/WarehouseOutMergeBoardMany/v1") |
| | | @ManagerAuth |
| | | public R WarehouseOutMergeBoardManyV1(@RequestBody WarehouseOutMergeBoardManyParam param){ |
| | | return mobileService.WarehouseOutMergeBoardMany(param, getHostId()); |
| | | return mobileService.WarehouseOutMergeBoardMany(param, getHostId(),getUserId()); |
| | | } |
| | | |
| | | @RequestMapping("/menu/pda/auth") |
| | |
| | | |
| | | @RequestMapping("/pick/mat/list") |
| | | @ManagerAuth(memo = "获取并板物料") |
| | | public R pickMats(@RequestParam(required = false) String matnr){ |
| | | public R pickMats(@RequestParam(required = false) String matnr, @RequestParam(required = false) String orderNo) { |
| | | List<DocType> docTypes = docTypeService.list(new LambdaQueryWrapper<DocType>().like(DocType::getPakin, 1)); |
| | | ArrayList<Long> typeList = new ArrayList<>(); |
| | | for (DocType docType : docTypes) { |
| | |
| | | wrapper1.eq(OrderDetl::getStatus, 1); |
| | | wrapper1.eq(OrderDetl::getHostId, getHostId()); |
| | | wrapper1.in(OrderDetl::getOrderId, orderIds); |
| | | wrapper1.orderByDesc(OrderDetl::getCreateTime); |
| | | if (!Cools.isEmpty(matnr)) { |
| | | wrapper1.like(OrderDetl::getMatnr, matnr); |
| | | } |
| | | |
| | | if (!Cools.isEmpty(orderNo)) { |
| | | wrapper1.like(OrderDetl::getOrderNo, orderNo); |
| | | } |
| | | List<OrderDetl> list = orderDetlService.list(wrapper1); |
| | | |
| | | ArrayList<PickMatParam> maps = new ArrayList<>(); |
| | |
| | | .eq(WrkMast::getWrkSts, 199L) |
| | | .eq(WrkMast::getIoType, 104)); |
| | | wrkMastArrayList.addAll(wrkMasts); |
| | | List<WrkMast> wrkMasts1 = wrkMastService.list(new LambdaQueryWrapper<WrkMast>() |
| | | .eq(WrkMast::getHostId, getHostId()) |
| | | .eq(WrkMast::getWrkSts, 199L) |
| | | .eq(WrkMast::getIoType, 107)); |
| | | wrkMastArrayList.addAll(wrkMasts1); |
| | | } else { |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new LambdaQueryWrapper<WrkMast>() |
| | | .like(WrkMast::getBarcode, barcode) |
| | | .eq(WrkMast::getHostId, getHostId()) |
| | | .eq(WrkMast::getWrkSts, 199L) |
| | | .eq(WrkMast::getIoType, 104) |
| | | ); |
| | | .eq(WrkMast::getIoType, 104)); |
| | | wrkMastArrayList.addAll(wrkMasts); |
| | | List<WrkMast> wrkMasts1 = wrkMastService.list(new LambdaQueryWrapper<WrkMast>() |
| | | .like(WrkMast::getBarcode, barcode) |
| | | .eq(WrkMast::getHostId, getHostId()) |
| | | .eq(WrkMast::getWrkSts, 199L) |
| | | .eq(WrkMast::getIoType, 107)); |
| | | wrkMastArrayList.addAll(wrkMasts1); |
| | | } |
| | | |
| | | return R.ok().add(wrkMastArrayList); |
| | |
| | | .eq(WrkMast::getWrkSts, 199L) |
| | | .eq(WrkMast::getIoType, 103)); |
| | | wrkMastArrayList.addAll(wrkMasts); |
| | | List<WrkMast> wrkMasts1 = wrkMastService.list(new LambdaQueryWrapper<WrkMast>() |
| | | .eq(WrkMast::getHostId, getHostId()) |
| | | .eq(WrkMast::getWrkSts, 199L) |
| | | .eq(WrkMast::getIoType, 107)); |
| | | wrkMastArrayList.addAll(wrkMasts1); |
| | | } else { |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new LambdaQueryWrapper<WrkMast>() |
| | | .like(WrkMast::getBarcode, barcode) |
| | |
| | | .eq(WrkMast::getIoType, 103) |
| | | ); |
| | | wrkMastArrayList.addAll(wrkMasts); |
| | | List<WrkMast> wrkMasts1 = wrkMastService.list(new LambdaQueryWrapper<WrkMast>() |
| | | .like(WrkMast::getBarcode, barcode) |
| | | .eq(WrkMast::getHostId, getHostId()) |
| | | .eq(WrkMast::getWrkSts, 199L) |
| | | .eq(WrkMast::getIoType, 107)); |
| | | wrkMastArrayList.addAll(wrkMasts1); |
| | | } |
| | | |
| | | return R.ok().add(wrkMastArrayList); |
| | |
| | | import com.zy.asrs.common.domain.dto.WrkTraceVo; |
| | | import com.zy.asrs.common.domain.param.OrderDomainParam; |
| | | import com.zy.asrs.common.wms.entity.*; |
| | | import com.zy.asrs.common.wms.mapper.OrderDetlMapper; |
| | | import com.zy.asrs.common.wms.service.*; |
| | | import com.zy.asrs.framework.annotations.ManagerAuth; |
| | | import com.zy.asrs.framework.common.Cools; |
| | |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | @Autowired |
| | | private LocInPrintMatService locInPrintMatService; |
| | | |
| | | @RequestMapping(value = "/order/list/orderNo") |
| | | public R orderListorderNo(@RequestParam String orderNo) { |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/dy") |
| | | @ManagerAuth(memo = "手动删除订单") |
| | | @Transactional |
| | | public R dy(@RequestParam Long orderId){ |
| | | List<OrderDetl> list = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>().eq(OrderDetl::getOrderId, orderId)); |
| | | for (OrderDetl orderDetl : list) { |
| | | LocInPrintMat locInPrintMat = new LocInPrintMat(); |
| | | locInPrintMat.setMatnr(orderDetl.getMatnr()); |
| | | locInPrintMat.setMaktx(orderDetl.getMaktx()); |
| | | locInPrintMat.setStatus(1); |
| | | locInPrintMat.setOrderNo(orderDetl.getOrderNo()); |
| | | locInPrintMat.setBatch(orderDetl.getBatch()); |
| | | locInPrintMat.setCreateBy(getUserId()); |
| | | locInPrintMat.setCreateTime(new Date()); |
| | | locInPrintMat.setUpdateTime(new Date()); |
| | | // locInPrintMat.setDercees(orderDetl.getDercees); |
| | | locInPrintMatService.save(locInPrintMat); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | |
| | | package com.zy.asrs.wms.task; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.common.wms.entity.LocDetl; |
| | | import com.zy.asrs.common.wms.entity.LocMast; |
| | | import com.zy.asrs.common.wms.entity.WrkMast; |
| | | import com.zy.asrs.common.wms.service.LocDetlService; |
| | | import com.zy.asrs.common.wms.service.LocMastService; |
| | | import com.zy.asrs.common.wms.service.WrkMastService; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.wms.task.core.ReturnT; |
| | | import com.zy.asrs.wms.task.handler.WorkMastHandler; |
| | | import org.slf4j.Logger; |
| | |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WorkMastHandler workMastHandler; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){ |
| | | List<LocDetl> locDetls = locDetlService.list(new LambdaQueryWrapper<LocDetl>()); |
| | | for (LocDetl l:locDetls |
| | | ) { |
| | | if(Cools.isEmpty(l.getZpallet())){ |
| | | LocMast locMast=locMastService.getOne(new LambdaQueryWrapper<LocMast>().eq(LocMast::getLocNo,l.getLocNo())); |
| | | if(!Cools.isEmpty(locMast)&&!Cools.isEmpty(locMast.getBarcode())){ |
| | | l.setZpallet(locMast.getBarcode()); |
| | | locDetlService.updateById(l); |
| | | } |
| | | } |
| | | } |
| | | List<WrkMast> wrkMasts = wrkMastService.selectToBeCompleteData(); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | |
| | | // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | // {field: 'adjId', align: 'center',title: '序号'} |
| | | {field: 'locNo', align: 'center',title: '库位号'} |
| | | ,{field: 'orderNo', align: 'center',title: '订单号'} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号'} |
| | | ,{field: 'batch', align: 'center',title: '序列码'} |
| | | // ,{field: 'oriCtns', align: 'center',title: '原箱数'} |
| | | ,{field: 'oriQty', align: 'center',title: '原数量'} |
| | | // ,{field: 'oriWt', align: 'center',title: '原重量'} |
| | | // ,{field: 'adjCtns', align: 'center',title: '变更箱数'} |
| | |
| | | ,{field: 'uuid', align: 'center',title: '编号',hide: true} |
| | | ,{field: 'status$', align: 'center',title: '打印情况', width:100,hide: false} |
| | | ,{field: 'matnr', align: 'center',title: '品号', width:180,hide: false} |
| | | ,{field: 'orderNo', align: 'center',title: '订单号', width:180,hide: false} |
| | | ,{field: 'decrees', align: 'center',title: '制令', width:180,hide: false} |
| | | // ,{field: 'batch', align: 'center',title: '批次', width:100,hide: false} |
| | | // ,{field: 'anfme', align: 'center',title: '重量(kg)', width:100,hide: false} |
| | | // ,{field: 'locNo', align: 'center',title: '库位号', width:120,hide: false} |
| | |
| | | showWrkTrace(data.id); |
| | | } else if (layEvent === 'del') { |
| | | doDel(data.id); |
| | | } else if (layEvent === 'dy') { |
| | | doDy(data.id); |
| | | } else if (layEvent === 'complete') { |
| | | doModify(data.id, 4); |
| | | } else if (layEvent === 'cancel') { |
| | |
| | | }); |
| | | } |
| | | |
| | | // 打印 |
| | | function doDy(orderId) { |
| | | layer.confirm('确定要打印吗?', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/order/dy", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | orderId: orderId |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll('loading'); |
| | | if (res.code === 200){ |
| | | if (insTbCount === 0) { |
| | | insTb.reload({page: {curr: 1}}); |
| | | } else { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | } |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 修改订单状态 |
| | | function doModify(orderId, settle) { |
| | |
| | | }) |
| | | } |
| | | |
| | | function initB(barcode) { |
| | | http.post(baseUrl + "/locDetl/page/auth", {barcode: barcode,limit: 1000}, function (res) { |
| | | function initB(zpallet) { |
| | | http.post(baseUrl + "/locDetl/page/auth", {zpallet: zpallet,limit: 1000}, function (res) { |
| | | matCodeData = []; |
| | | matCodeData = res.data.records; |
| | | console.log("matCodeData2222") |
| | |
| | | {{# } }} |
| | | {{# } }} |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-delete" lay-event="del">删除</a> |
| | | |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-delete" lay-event="dy">打印</a> |
| | | </script> |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="tbLook"> |