| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.mapper.BasDevpMapper; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.MatUtils; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | |
| | | @Resource |
| | | private BasDevpMapper basDevpMapper; |
| | | |
| | | @Override |
| | | public R inLocCallAgv(String sta, String inSta) { |
| | | // 判断入库站点有无出库任务过滤盘点捡料 |
| | | int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("sta_no", inSta).ne("wrk_sts",15).notIn("io_type",103,107)); |
| | | if (count > 0) { |
| | | return R.parse(inSta + "站点存在出库任务"); |
| | | |
| | | BasDevp basDevp = basDevpMapper.selectById(inSta); |
| | | // 0.出库模式,1.agv入库中,2.生成入库任务 |
| | | if (basDevp.getDevMk().equals("0")) { // 是出库 |
| | | // 判断是否有出库任务 |
| | | int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>() |
| | | .eq("sta_no", inSta).lt("wrk_sts",14).in("io_type",101,103,107,110)); |
| | | if (count == 0) { |
| | | // 没有出库任务,更改为入库模式 |
| | | basDevp.setDevMk("1"); |
| | | basDevpMapper.updateById(basDevp); |
| | | } else { |
| | | return R.parse(inSta + "站点存在出库任务"); |
| | | } |
| | | } |
| | | |
| | | // 先绑定 |
| | |
| | | public void leftoversOut(Map<String, Object> map,Long userId) { |
| | | String barcode = map.get("barcode").toString(); |
| | | String barcode2 = map.get("barcode2").toString(); |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",barcode2)); |
| | | int countWrk = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("zpallet",barcode2).ne("io_type",200)); |
| | | int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",barcode2)); |
| | | if (countLoc > 0 || countWrk > 0 || countwait > 0) { |
| | | throw new CoolException("该条码已被使用===>>" + barcode2); |
| | | } |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", barcode).eq("io_type", 103)); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException("未查询到拣料任务"); |