|
|
|
@ -23,6 +23,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
@ -149,6 +150,14 @@ public class PoReceiveServiceImpl implements PoReceiveService { |
|
|
|
if(checkPartNo.size()==0){ |
|
|
|
throw new RuntimeException("物料不存在或者不在用"); |
|
|
|
} |
|
|
|
Date currentDate = new Date(); |
|
|
|
if(currentDate.after(inData.getExpiredDate())){ |
|
|
|
throw new RuntimeException("该物料已过期,失效日期为"+DateUtil.getStringDate(inData.getExpiredDate())); |
|
|
|
} |
|
|
|
Date futureDate = new Date(currentDate.getTime() - (45 * 24 * 60 * 60 * 1000)); |
|
|
|
if(futureDate.after(inData.getManufactureDate())){ |
|
|
|
throw new RuntimeException("该物料生产日期在45天以前,生产日期为"+DateUtil.getStringDate(inData.getExpiredDate())); |
|
|
|
} |
|
|
|
for (int i = 0; i < inData.getRollNumber(); i++) { |
|
|
|
String rollNo= transNoControlService.transNo(inData.getSite(), "RollNo"); |
|
|
|
inData.setRollNo(rollNo); |
|
|
|
|