| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.enums.SqlLike; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.*; |
| | |
| | | } |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode())); |
| | | // int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode())); |
| | | int countWrk = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("barcode",param.getBarcode()).ne("wrk_sts",15)); |
| | | int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | if (countLoc > 0 || countWrk > 0 || countwait > 0) { |
| | | throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + param.getBarcode()); |
| | |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); |
| | | } |
| | | if (mat.getUpQty().compareTo(detlDto.getAnfme()) < 0) { |
| | | throw new CoolException("物料:" + detlDto.getMatnr() + "单次最大组托上限为:" + mat.getUpQty()); |
| | | } |
| | | // if (mat.getUpQty().compareTo(detlDto.getAnfme()) < 0) { |
| | | // throw new CoolException("物料:" + detlDto.getMatnr() + "单次最大组托上限为:" + mat.getUpQty()); |
| | | // } |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | BeanUtils.copyProperties(mat, waitPakin); |
| | | waitPakin.setBatch(detlDto.getBatch()); |
| | |
| | | @Transactional |
| | | public R callEmptyBinOutBound(MesOutApply mesOutApply, String staNo, String locType,int count, Long userId) { |
| | | List<LocMast> locMastList = locMastService.selectList(new EntityWrapper<LocMast>().setSqlSelect("TOP " + count + " *") |
| | | .eq("loc_sts", "D").eq("frozen", 0).eq("loc_type2", locType).orderBy("lev1").orderBy("bay1").orderBy("row1")); |
| | | .eq("loc_sts", "D").eq("frozen", 0).like("barcode", locType, SqlLike.RIGHT).orderBy("lev1").orderBy("bay1").orderBy("row1")); |
| | | if (locMastList.size() < count) { |
| | | return R.parse("空托数量不足(或冻结),剩余数量:" + locMastList.size()); |
| | | } |
| | |
| | | // 获取路径 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", 110) |
| | | .eq("stn_no", 204) |
| | | .eq("stn_no", staNo.startsWith("B") ? 204 : staNo) |
| | | .eq("crn_no", 1); |
| | | StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | if (staDesc == null) { |
| | |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setBarcode(locMast.getBarcode()); |
| | | if (mesOutApply != null) { |
| | | wrkMast.setTaskNo(mesOutApply.getTaskno()); |
| | | wrkMast.setAgvSta(mesOutApply.getStationId()); |