package com.zy.common.model; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.core.common.SpringUtils; import com.zy.asrs.entity.LocDetl; import com.zy.asrs.service.LocDetlService; import java.util.List; /** * Created by vincent on 2020/6/17 */ public class OutLocDto { private String locNo; private List locDetlDtos; public OutLocDto() { } public OutLocDto(String locNo, List locDetlDtos) { this.locNo = locNo; this.locDetlDtos = locDetlDtos; } public String getLocNo() { return locNo; } public void setLocNo(String locNo) { this.locNo = locNo; } public List getLocDetlDtos() { return locDetlDtos; } public void setLocDetlDtos(List locDetlDtos) { this.locDetlDtos = locDetlDtos; } public boolean isAll(){ // 查询当前库位号所有的库存明细 LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class); List locDetls = locDetlService.selectList(new EntityWrapper().eq("loc_no", this.locNo)); if (locDetls == null || locDetls.isEmpty()){ return true; } int sameNumber = 0; for (LocDetl locDetl : locDetls) { for (LocDetlDto dto : this.locDetlDtos) { if (dto.getLocDetl().getMatnr().equals(locDetl.getMatnr()) && dto.getCount().equals(locDetl.getAnfme())) { sameNumber++; break; } } } return sameNumber == locDetls.size(); } }