|
|
|
@ -20,6 +20,7 @@ import com.spring.modules.production.entity.ShopOrder; |
|
|
|
import com.spring.modules.production.mapper.ShopOrderMapper; |
|
|
|
import com.spring.modules.production.vo.ShopOrderVo; |
|
|
|
import com.spring.modules.report.dao.ProcedureDao; |
|
|
|
import com.spring.modules.schedule.utils.DateUtils; |
|
|
|
import com.spring.modules.sys.entity.SysUserEntity; |
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@ -170,6 +171,17 @@ public class IssureSoServiceImpl implements IssureSoService { |
|
|
|
if(InventoryStockRollList.size()==0){ |
|
|
|
throw new RuntimeException("卷号不存在或者不在库!"); |
|
|
|
} |
|
|
|
if("Y".equals(InventoryStockRollList.get(0).getFreezeFlag())){ |
|
|
|
throw new RuntimeException("该卷被冻结无法出库!"); |
|
|
|
} |
|
|
|
//用物料和site去查询最早的生产日期来实现先进先出 |
|
|
|
List<InventoryStockRoll> newInNewOut= normalSearchMapper.newInNewOutWithSitePart(InventoryStockRollList.get(0).getSite(),InventoryStockRollList.get(0).getPartNo()); |
|
|
|
if(newInNewOut.size()==0){ |
|
|
|
throw new RuntimeException("物料库存不足!"); |
|
|
|
} |
|
|
|
if(InventoryStockRollList.get(0).getManufactureDate().after(newInNewOut.get(0).getManufactureDate())){ |
|
|
|
throw new RuntimeException("请按照先进先出规则!最早生产日期为:"+ DateUtils.getStringDate(newInNewOut.get(0).getManufactureDate())); |
|
|
|
} |
|
|
|
ShopOrderVo shopOrder=new ShopOrderVo(); |
|
|
|
shopOrder.setSite(inData.getSite()); |
|
|
|
shopOrder.setOrderNo(inData.getOrderNo()); |
|
|
|
|