| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | return R.ok(); |
| | | } |
| | | List<OrderDetl> orderDetls = orderService.selectWorkingDetls(order.getId()); |
| | | if (Cools.isEmpty(orderDetls)) { |
| | | ArrayList<OrderDetl> orderDetls2 = new ArrayList<>(); |
| | | for (OrderDetl orderDetl : orderDetls){ |
| | | orderDetl.setAnfme(new BigDecimal(orderDetl.getAnfme()).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); |
| | | orderDetl.setWorkQty(new BigDecimal(orderDetl.getWorkQty()).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); |
| | | orderDetl.setQty(new BigDecimal(orderDetl.getQty()).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); |
| | | orderDetls2.add(orderDetl); |
| | | } |
| | | if (Cools.isEmpty(orderDetls) || Cools.isEmpty(orderDetls2)) { |
| | | return R.ok(); |
| | | } |
| | | return R.ok().add(orderDetls); |
| | | return R.ok().add(orderDetls2); |
| | | } |
| | | |
| | | @RequestMapping("/comb/auth") |
| | | @ManagerAuth(memo = "组托") |
| | | // @ManagerAuth(memo = "组托") |
| | | public R comb(@RequestBody CombParam combParam){ |
| | | mobileService.comb(combParam, getUserId()); |
| | | mobileService.comb(combParam, 9527L); |
| | | return R.ok("组托成功"); |
| | | } |
| | | |
| | |
| | | |
| | | //平库pda上架 |
| | | @RequestMapping("/manDetl/in") |
| | | @ManagerAuth(memo = "订单上架") |
| | | public R manDetlAdd(@RequestBody JSONObject json){ |
| | | if (json == null){ |
| | | return R.error("传入数据为空"); |
| | | } |
| | | return mobileService.manDetlIn(json); |
| | | return mobileService.manDetlIn(json, getUser()); |
| | | } |
| | | |
| | | //平库pda下架 |
| | | @RequestMapping("/manDetl/out") |
| | | @ManagerAuth(memo = "订单下架") |
| | | public R manDetlDelete(@RequestBody JSONObject json){ |
| | | if (json == null){ |
| | | return R.error("传入数据为空"); |
| | | } |
| | | return mobileService.manDetlOut(json); |
| | | return mobileService.manDetlOut(json , getUser()); |
| | | } |
| | | @RequestMapping("/manDetl/barcode/out") |
| | | @ManagerAuth(memo = "订单下架(托盘码)") |
| | | public R barcodeDelete(@RequestBody JSONObject json){ |
| | | if (json == null){ |
| | | return R.error("传入数据为空"); |
| | | } |
| | | return mobileService.barcodeDelete(json , getUser()); |
| | | } |
| | | |
| | | @RequestMapping("/manDetl/in/barcode") |
| | | @ManagerAuth(memo = "订单上架(托盘码)") |
| | | public R manDetlAddbarcode(@RequestBody JSONObject json){ |
| | | if (json == null){ |
| | | return R.error("传入数据为空"); |
| | | } |
| | | return mobileService.manDetlInBarcode(json,getUser()); |
| | | } |
| | | |
| | | @RequestMapping("/piking/auth") |
| | | @ManagerAuth |
| | | @Transactional |
| | | public R pikingAuth(String barcode) { |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(barcode); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(barcode + "暂无工作档"); |
| | | } |
| | | if (wrkMast.getIoType() != 103 && wrkMast.getIoType() != 107){ |
| | | throw new CoolException(barcode + "不为拣料/盘点出库"); |
| | | } |
| | | |
| | | if (wrkMast.getIoType() == 107){ |
| | | wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("zpallet",barcode)); |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("zpallet", barcode)); |
| | | for (LocDetl locDetl : locDetls) { |
| | | String uuid = String.valueOf(System.currentTimeMillis()); |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | Date now = new Date(); |
| | | wrkDetl.sync(locDetl); |
| | | wrkDetl.setZpallet(wrkMast.getBarcode()); |
| | | wrkDetl.setIoTime(now); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setBatch(locDetl.getBatch()); |
| | | wrkDetl.setOrderNo(locDetl.getOrderNo()); |
| | | wrkDetl.setAnfme(locDetl.getAnfme()); // 数量 |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setAppeUser(9527L); |
| | | wrkDetl.setModiTime(now); |
| | | wrkDetl.setModiUser(9527L); |
| | | wrkDetl.setUuid(uuid); |
| | | wrkDetl.setOwner(locDetl.getOwner()); |
| | | wrkDetl.setPayment(locDetl.getPayment()); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | } |
| | | } |
| | | wrkMast.setIoType(101); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,"); |
| | | } |
| | | LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | locMast.setLocSts("R"); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("预约库位状态失败,库位号:"+locMast.getLocNo()); |
| | | } |
| | | |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |