|  |  |  | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.Iterator; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 移动端服务核心类 | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); | 
|---|
|  |  |  | int countLoc2 =  manLocDetlMapper.selectCount(new EntityWrapper<ManLocDetl>().eq("zpallet",param.getBarcode())); | 
|---|
|  |  |  | WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); | 
|---|
|  |  |  | if (wrkMast != null && wrkMast.getIoType() < 100){ | 
|---|
|  |  |  | throw new CoolException("工作档/库存条码数据已存在===>>" + param.getBarcode()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (countLoc > 0 ) { | 
|---|
|  |  |  | throw new CoolException("工作档/库存条码数据已存在===>>" + param.getBarcode()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (countLoc2 > 0 ) { | 
|---|
|  |  |  | throw new CoolException("工作档/库存条码数据已存在===>>" + param.getBarcode()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | // 关联组托 | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | for (CombParam.CombMat combMat : param.getCombMats()) { | 
|---|
|  |  |  | OrderDetl orderDetl = orderDetlService.selectItem(param.getOrderNo(), combMat.getMatnr(), combMat.getBatch()); | 
|---|
|  |  |  | OrderDetl orderDetl = orderDetlService.selectItem(combMat.getOrderNo(), combMat.getMatnr(), combMat.getBatch()); | 
|---|
|  |  |  | if (orderDetl == null) { | 
|---|
|  |  |  | throw new CoolException("找不到组托的单据明细"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Double anfme = orderDetl.getAnfme(); | 
|---|
|  |  |  | Double workQty = orderDetl.getWorkQty(); | 
|---|
|  |  |  | if ( anfme - (workQty+combMat.getAnfme()) < 0) { | 
|---|
|  |  |  | BigDecimal a1 = new BigDecimal(orderDetl.getAnfme()).setScale(2,BigDecimal.ROUND_HALF_UP); | 
|---|
|  |  |  | BigDecimal b1 = new BigDecimal(orderDetl.getWorkQty()).setScale(2,BigDecimal.ROUND_HALF_UP); | 
|---|
|  |  |  | BigDecimal c1 = new BigDecimal(combMat.getAnfme()).setScale(2,BigDecimal.ROUND_HALF_UP); | 
|---|
|  |  |  | double e1 = b1.add(c1).doubleValue(); | 
|---|
|  |  |  | BigDecimal f1 = new BigDecimal(e1).setScale(2,BigDecimal.ROUND_HALF_UP); | 
|---|
|  |  |  | Double d1 = a1.subtract(f1).doubleValue(); | 
|---|
|  |  |  | if ( d1 < 0.0) { | 
|---|
|  |  |  | throw new CoolException("组托数量已超出订单需求量,请检查是否有其他的组托已完成"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Order order = orderService.selectByNo(param.getOrderNo()); | 
|---|
|  |  |  | if (order.getSettle() > 2) { | 
|---|
|  |  |  | throw new CoolException("单据编号已过期"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 生成入库通知档 | 
|---|
|  |  |  | List<DetlDto> detlDtos = new ArrayList<>(); | 
|---|
|  |  |  | for (CombParam.CombMat elem : param.getCombMats()) { | 
|---|
|  |  |  | Order order = orderService.selectByNo(elem.getOrderNo()); | 
|---|
|  |  |  | if (order.getSettle() > 2) { | 
|---|
|  |  |  | throw new CoolException("单据编号已过期"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 订单明细数量校验 | 
|---|
|  |  |  | OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch()); | 
|---|
|  |  |  | if(orderDetl == null){ | 
|---|
|  |  |  | 
|---|
|  |  |  | detlDtos.add(detlDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int i=0; | 
|---|
|  |  |  | for (DetlDto detlDto : detlDtos) { | 
|---|
|  |  |  | Order order = orderService.selectByNo(param.getCombMats().get(i).getOrderNo()); | 
|---|
|  |  |  | i++; | 
|---|
|  |  |  | String uuid = String.valueOf(System.currentTimeMillis()); | 
|---|
|  |  |  | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); | 
|---|
|  |  |  | if (Cools.isEmpty(mat)) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | WaitPakin waitPakin = new WaitPakin(); | 
|---|
|  |  |  | waitPakin.sync(mat); | 
|---|
|  |  |  | waitPakin.setOrderNo(order.getOrderNo());   // 单据编号 | 
|---|
|  |  |  | waitPakin.setOrderNo(order.getOrderNo()); // 单据编号 | 
|---|
|  |  |  | waitPakin.setBatch(detlDto.getBatch());     // 序列码 | 
|---|
|  |  |  | waitPakin.setZpallet(param.getBarcode());   // 托盘码 | 
|---|
|  |  |  | waitPakin.setIoStatus("N");     // 入出状态 | 
|---|
|  |  |  | 
|---|
|  |  |  | if (!waitPakinService.insert(waitPakin)) { | 
|---|
|  |  |  | throw new CoolException("保存入库通知档失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderService.updateSettle(order.getId(), 2L, userId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderService.updateSettle(order.getId(), 2L, userId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (orderDetl.getAnfme() - (jsonOrderDetl.getAnfme() + orderDetl.getWorkQty()) < 0) { | 
|---|
|  |  |  | return R.error("入库数量大于可入数量"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //查询平库中是否有一样的物料号,有的话直接增加数量 | 
|---|
|  |  |  | ManLocDetl checkManLocDetl = manLocDetlService.selectInventory(jsonLocNo,orderDetl.getMatnr(),jsonOrderDetl.getBatch()); | 
|---|
|  |  |  | if (checkManLocDetl == null) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ManLocDetl manLocDetl = new ManLocDetl(); | 
|---|
|  |  |  | Synchro.Copy(orderDetl, manLocDetl); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BigDecimal decimal = BigDecimal.valueOf(jsonOrderDetl.getAnfme()).subtract(BigDecimal.valueOf(jsonOrderDetl.getAnfme()).setScale(0,BigDecimal.ROUND_DOWN)); | 
|---|
|  |  |  | if (decimal.doubleValue() > 0){ | 
|---|
|  |  |  | manLocDetl.setPrice(1.0); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | manLocDetl.setPrice(2.0); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | manLocDetl.setLocNo(node.getName()); | 
|---|
|  |  |  | manLocDetl.setNodeId(node.getId()); | 
|---|
|  |  |  | manLocDetl.setMatnr(orderDetl.getMatnr()); | 
|---|
|  |  |  | 
|---|
|  |  |  | //            if (jsonOrderDetl.getAnfme() > manPakOut.getAnfme()) { //判断工作数量是否大于拣货单的数量 | 
|---|
|  |  |  | //                return R.error("出库数量大于拣货单总数量"); | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | if (jsonOrderDetl.getAnfme() > (manPakOut.getAnfme()-manPakOut.getCount())) { //判断工作数量是否大于拣货单剩余可出的数量 | 
|---|
|  |  |  | BigDecimal a1 = new BigDecimal(manPakOut.getAnfme()).setScale(2,BigDecimal.ROUND_HALF_UP); | 
|---|
|  |  |  | BigDecimal b1 = new BigDecimal(manPakOut.getCount()).setScale(2,BigDecimal.ROUND_HALF_UP); | 
|---|
|  |  |  | Double c1 = a1.subtract(b1).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue(); | 
|---|
|  |  |  | if (jsonOrderDetl.getAnfme() > c1) { //判断工作数量是否大于拣货单剩余可出的数量 | 
|---|
|  |  |  | return R.error("出库数量大于拣货单剩余可出数量"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (orderDetl.getWorkQty() - orderDetl.getQty() <jsonOrderDetl.getAnfme() ){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BigDecimal e1 = new BigDecimal(orderDetl.getWorkQty()).setScale(2,BigDecimal.ROUND_HALF_UP); | 
|---|
|  |  |  | BigDecimal f1 = new BigDecimal(orderDetl.getQty()).setScale(2,BigDecimal.ROUND_HALF_UP); | 
|---|
|  |  |  | Double g1 = e1.subtract(f1).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue(); | 
|---|
|  |  |  | if ( g1  <jsonOrderDetl.getAnfme() ){ | 
|---|
|  |  |  | return R.error("出库数量大于单据剩余可出数量"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //查询平库中是否有一样的物料号 | 
|---|
|  |  |  | 
|---|
|  |  |  | if(jsonOrderDetl.getWeight() == null){ | 
|---|
|  |  |  | jsonOrderDetl.setWeight(0.0); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Double finalQty = checkManLocDetl.getAnfme() - jsonOrderDetl.getAnfme(); | 
|---|
|  |  |  | Double weight = checkManLocDetl.getWeight() - jsonOrderDetl.getWeight(); | 
|---|
|  |  |  | Double finalQty =  new BigDecimal(checkManLocDetl.getAnfme()).setScale(2,BigDecimal.ROUND_HALF_UP).subtract(new BigDecimal(jsonOrderDetl.getAnfme()).setScale(2,BigDecimal.ROUND_HALF_UP)).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue() ; | 
|---|
|  |  |  | Double weight =  new BigDecimal(checkManLocDetl.getWeight()).setScale(2,BigDecimal.ROUND_HALF_UP).subtract(new BigDecimal(jsonOrderDetl.getWeight()).setScale(2,BigDecimal.ROUND_HALF_UP)).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue() ; | 
|---|
|  |  |  | checkManLocDetl.setAnfme(finalQty); | 
|---|
|  |  |  | checkManLocDetl.setWeight(weight); | 
|---|
|  |  |  | if (weight < 0){ | 
|---|
|  |  |  | 
|---|
|  |  |  | return R.error("修改平库物料失败!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderDetl.setQty(orderDetl.getQty() + jsonOrderDetl.getAnfme()); | 
|---|
|  |  |  | orderDetl.setQty( new BigDecimal(orderDetl.getQty()).setScale(2,BigDecimal.ROUND_HALF_UP).add(new BigDecimal(jsonOrderDetl.getAnfme()).setScale(2,BigDecimal.ROUND_HALF_UP)).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue() ); | 
|---|
|  |  |  | orderDetl.setUpdateTime(date); | 
|---|
|  |  |  | orderDetlService.updateById(orderDetl); | 
|---|
|  |  |  | //更新订单状态 | 
|---|
|  |  |  | 
|---|
|  |  |  | boolean log=true; | 
|---|
|  |  |  | for (OrderDetl orderDetl1: orderDetls) { | 
|---|
|  |  |  | //工作中的数量小于总订单数时,订单状态改为2,作业中 | 
|---|
|  |  |  | if(orderDetl1.getQty() < orderDetl.getAnfme()){ | 
|---|
|  |  |  | if(orderDetl1.getQty() < orderDetl1.getAnfme()){ | 
|---|
|  |  |  | log=false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if(manPakOut.getCount() == null){ | 
|---|
|  |  |  | manPakOut.setCount(0.0); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | manPakOut.setCount(manPakOut.getCount()+jsonOrderDetl.getAnfme().intValue()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | manPakOut.setCount(new BigDecimal(manPakOut.getCount()).setScale(2,BigDecimal.ROUND_HALF_UP).add(new BigDecimal(jsonOrderDetl.getAnfme()).setScale(2,BigDecimal.ROUND_HALF_UP)).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()); | 
|---|
|  |  |  | if (!manPakOutService.update(manPakOut,manPakOutEntityWrapper)){ | 
|---|
|  |  |  | return R.error("更新拣货单完成数目失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (manPakOut.getAnfme().intValue() == manPakOut.getCount()){ | 
|---|
|  |  |  | if (manPakOut.getAnfme().equals(manPakOut.getCount())){ | 
|---|
|  |  |  | manPakOut.setStatus(1); | 
|---|
|  |  |  | if (!manPakOutService.update(manPakOut,manPakOutEntityWrapper)){ | 
|---|
|  |  |  | return R.error("更新拣货单状态失败"); | 
|---|
|  |  |  | 
|---|
|  |  |  | List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", jsonBarNo)); //获取对应组托信息 | 
|---|
|  |  |  | if (Cools.isEmpty(waitPakins)){ | 
|---|
|  |  |  | return R.error("未查询到组托"); | 
|---|
|  |  |  | } else if (waitPakins.get(0).getIoStatus() == "Y") { | 
|---|
|  |  |  | } else if (waitPakins.get(0).getIoStatus().equals("Y")) { | 
|---|
|  |  |  | return R.error("组托已经生成工作档"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (WaitPakin waitPakin: waitPakins) { | 
|---|
|  |  |  | List<ManLocDetl> manLocDetls = manLocDetlService.selectList(new EntityWrapper<ManLocDetl>().eq("zpallet", waitPakin.getZpallet())); | 
|---|
|  |  |  | if (!Cools.isEmpty(manLocDetls) || manLocDetls.size()>0){ | 
|---|
|  |  |  | return R.error("所在库位已存在明细"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //判断订单是否完成 | 
|---|
|  |  |  | boolean log =true; | 
|---|
|  |  |  | 
|---|
|  |  |  | if (node.equals(null)){ | 
|---|
|  |  |  | return R.error("未查询到库位信息"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Date date = new Date(); | 
|---|
|  |  |  | ManLocDetl manLocDetl = new ManLocDetl();  //初始化库存实体类 | 
|---|
|  |  |  | //获取组托小数位 | 
|---|
|  |  |  | BigDecimal decimal = BigDecimal.valueOf(waitPakin.getAnfme()).subtract(BigDecimal.valueOf(waitPakin.getAnfme()).setScale(0,BigDecimal.ROUND_DOWN)); | 
|---|
|  |  |  | if (decimal.doubleValue() > 0){ | 
|---|
|  |  |  | manLocDetl.setPrice(1.0); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | manLocDetl.setPrice(2.0); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Date date = new Date(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | manLocDetl.setLocNo(node.getName()); | 
|---|
|  |  |  | manLocDetl.setNodeId(node.getId()); | 
|---|
|  |  |  | manLocDetl.setZpallet(waitPakin.getZpallet()); | 
|---|
|  |  |  | 
|---|
|  |  |  | waitPakinLog.setZpallet(waitPakin.getZpallet()); | 
|---|
|  |  |  | waitPakinLog.setAnfme(waitPakin.getAnfme()); | 
|---|
|  |  |  | waitPakinLog.setMatnr(waitPakin.getMatnr()); | 
|---|
|  |  |  | waitPakinLog.setLocNo(waitPakin.getLocNo()); | 
|---|
|  |  |  | waitPakinLog.setLocNo(jsonLocNo); | 
|---|
|  |  |  | waitPakinLog.setMaktx(waitPakin.getMaktx()); | 
|---|
|  |  |  | waitPakinLog.setOrderNo(waitPakin.getOrderNo()); | 
|---|
|  |  |  | waitPakinLog.setWeight(waitPakin.getWeight()); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok("上架成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public R barcodeDelete(JSONObject json, User user) { | 
|---|
|  |  |  | String jsonBarcode = (String) json.get("barcode"); | 
|---|
|  |  |  | String jsonOrderNo = (String) json.get("orderNo"); | 
|---|
|  |  |  | JSONArray combMats = json.getJSONArray("combMats"); | 
|---|
|  |  |  | for (int i = 0; i < combMats.size(); i++) { | 
|---|
|  |  |  | ManLocDetl jsonManLocDetl = combMats.getObject(i, ManLocDetl.class); | 
|---|
|  |  |  | Wrapper<OrderDetl> orderDetlWrapper = new EntityWrapper<OrderDetl>() | 
|---|
|  |  |  | .eq("order_no", jsonOrderNo) | 
|---|
|  |  |  | .eq("matnr", jsonManLocDetl.getMatnr()); | 
|---|
|  |  |  | OrderDetl orderDetl = orderDetlService.selectOne(orderDetlWrapper); | 
|---|
|  |  |  | if (Cools.isEmpty(orderDetl)){ | 
|---|
|  |  |  | return R.error("订单中未查询到下架数据"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | EntityWrapper<ManLocDetl> manLocDetlWrapper = new EntityWrapper<>(); | 
|---|
|  |  |  | manLocDetlWrapper.eq("zpallet",jsonBarcode); | 
|---|
|  |  |  | manLocDetlWrapper.eq("matnr",jsonManLocDetl.getMatnr()); | 
|---|
|  |  |  | ManLocDetl manLocDetl = manLocDetlService.selectOne(manLocDetlWrapper); | 
|---|
|  |  |  | if (Cools.isEmpty(manLocDetl)){ | 
|---|
|  |  |  | return R.error("托盘码未查询到库存信息"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | BigDecimal orderQty = new BigDecimal(orderDetl.getQty()); | 
|---|
|  |  |  | BigDecimal orderWorkQty = new BigDecimal(orderDetl.getWorkQty()); | 
|---|
|  |  |  | BigDecimal anfme = new BigDecimal(jsonManLocDetl.getAnfme()); | 
|---|
|  |  |  | BigDecimal diffQty = orderQty.add(anfme); | 
|---|
|  |  |  | BigDecimal diffWorkQty = orderWorkQty.add(anfme); | 
|---|
|  |  |  | if (diffQty.doubleValue() > orderDetl.getAnfme()){ | 
|---|
|  |  |  | return R.error("完成数量大于订单数量"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (diffWorkQty.doubleValue() > orderDetl.getAnfme()){ | 
|---|
|  |  |  | return R.error("工作数量大于订单数量"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | BigDecimal locDetlAnfme = new BigDecimal(manLocDetl.getAnfme()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BigDecimal diffAnfme = locDetlAnfme.subtract(anfme); | 
|---|
|  |  |  | if (diffAnfme.doubleValue() <0){ | 
|---|
|  |  |  | return R.error("出库数量大于库存数量"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (diffAnfme.doubleValue() == 0){ | 
|---|
|  |  |  | if (!manLocDetlService.delete(manLocDetlWrapper)){ | 
|---|
|  |  |  | throw new RuntimeException("删除库存明细失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (diffAnfme.doubleValue() > 0) { | 
|---|
|  |  |  | manLocDetl.setAnfme(diffAnfme.doubleValue()); | 
|---|
|  |  |  | if (!manLocDetlService.update(manLocDetl,manLocDetlWrapper)){ | 
|---|
|  |  |  | throw new RuntimeException("更新库存明细失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderDetl.setQty(diffQty.doubleValue()); | 
|---|
|  |  |  | orderDetl.setWorkQty(diffWorkQty.doubleValue()); | 
|---|
|  |  |  | if (!orderDetlService.updateById(orderDetl)){ | 
|---|
|  |  |  | return R.error("订单明细更新失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Order order = orderService.selectByNo(jsonOrderNo); | 
|---|
|  |  |  | if (IsOrderStatus(jsonOrderNo)){ | 
|---|
|  |  |  | order.setSettle(4L); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | order.setSettle(2L); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(!orderService.update(order,new EntityWrapper<Order>().eq("order_no", jsonOrderNo))){ | 
|---|
|  |  |  | throw new RuntimeException("更新订单状态失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Boolean IsOrderStatus(String order){ | 
|---|
|  |  |  | //判断订单是否完成 | 
|---|
|  |  |  | boolean log =true; | 
|---|
|  |  |  | //订单是否完成 | 
|---|
|  |  |  | List<OrderDetl> or = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_no", order)); | 
|---|
|  |  |  | for (OrderDetl o: or) { | 
|---|
|  |  |  | if(o.getAnfme()-o.getQty()>0){ | 
|---|
|  |  |  | log=false; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return log; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|