| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.third.entity.ExdInstockTarget; |
| | | import com.zy.third.entity.ExdvYanbu; |
| | | import com.zy.third.mapper.ExdMaterialMapper; |
| | | import com.zy.third.service.ExdInstockTargetService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | @Autowired |
| | | private ExdInstockTargetService exdInstockTargetService; |
| | | |
| | | @Autowired |
| | | private ExdMaterialMapper exdMaterialMapper; |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start(WrkMast wrkMast) { |
| | | // 4.入库完成 |
| | | if (wrkMast.getWrkSts() == 4) { |
| | |
| | | return FAIL.setMsg("全板入库 ===>> 更新订单完成数量失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]"); |
| | | } |
| | | } |
| | | } catch (Exception ignore){} |
| | | } catch (Exception ignore) { |
| | | } |
| | | |
| | | } |
| | | // 写入中间表数据 |
| | | write(wrkMast, wrkDetls); |
| | | // 修改库位状态 S ====>> F |
| | | if (locMast.getLocSts().equals("S")) { |
| | | locMast.setLocSts("F"); |
| | |
| | | return FAIL.setMsg("拣料入库 ===>> 更新订单完成数量失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]"); |
| | | } |
| | | } |
| | | } catch (Exception ignore){} |
| | | } catch (Exception ignore) { |
| | | } |
| | | |
| | | } |
| | | // 修改库位状态 Q ====>> F |
| | |
| | | return FAIL.setMsg("全板出库 ===>> 更新订单完成数量失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getSourceLocNo() + "]"); |
| | | } |
| | | } |
| | | } catch (Exception ignore){} |
| | | } catch (Exception ignore) { |
| | | } |
| | | } |
| | | // 删除工作档源库位的库存明细 |
| | | if (!locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getSourceLocNo()))) { |
| | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | |
| | | private void write(WrkMast wrkMast, List<WrkDetl> wrkDetls) { |
| | | ExdInstockTarget exdInstockTarge; |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | ExdvYanbu bacode = exdMaterialMapper.getBacode(wrkDetl.getBatch()); |
| | | exdInstockTarge = new ExdInstockTarget(); |
| | | exdInstockTarge.setFtrantype(21); |
| | | exdInstockTarge.setFdate(new Date()); |
| | | exdInstockTarge.setFrob(1); |
| | | |
| | | exdInstockTarge.setFqty(wrkDetl.getAnfme()); |
| | | exdInstockTarge.setFbatchno(bacode.getBatchno()); |
| | | exdInstockTarge.setFsourcebillno(bacode.getIcmono()); |
| | | |
| | | exdInstockTarge.setBarcode(wrkDetl.getBatch()); |
| | | exdInstockTarge.setGross(bacode.getGross()); |
| | | exdInstockTarge.setWidth(bacode.getWidth()); |
| | | exdInstockTarge.setDefects(bacode.getDefects()); |
| | | exdInstockTarge.setBackcode(bacode.getBackcode()); |
| | | exdInstockTarge.setWritetime(new Date()); |
| | | exdInstockTarge.setWritor("WMS"); |
| | | exdInstockTarge.setStatus(0); |
| | | exdInstockTargetService.insert(exdInstockTarge); |
| | | } |
| | | } |
| | | |
| | | } |