|
|
|
@ -17,8 +17,6 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -38,6 +36,8 @@ public class YlController {
|
|
|
|
|
ylInfoService.list(Wrappers.<DmYlInfo>lambdaQuery()
|
|
|
|
|
.eq(DmYlInfo::get来源船号,dto.getDcCh())
|
|
|
|
|
.eq(DmYlInfo::get使用状态,dto.getStatus())
|
|
|
|
|
//查询结果使用最小匹配原则为按规格匹配上料提供匹配顺序
|
|
|
|
|
.orderByAsc(DmYlInfo::get板宽,DmYlInfo::get板长)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
@ -95,23 +95,19 @@ public class YlController {
|
|
|
|
|
.eq(DmYdjh::getDcCh, item.get使用船号())
|
|
|
|
|
.eq(DmYdjh::getTzbh,item.get使用图纸())
|
|
|
|
|
);
|
|
|
|
|
//防止手动编辑错误时的校验
|
|
|
|
|
if (ObjectUtil.isEmpty(ydjhList)){
|
|
|
|
|
String str=StrUtil.format("使用船号:{},使用图号{}错误,请核对修正后再打印", item.get使用船号(), item.get使用图纸());
|
|
|
|
|
throw new ServiceException(99999,str);
|
|
|
|
|
}
|
|
|
|
|
List<DmYdjh> collect = ydjhList.stream().peek(it -> {
|
|
|
|
|
//fixme 确定以下方法具体算法
|
|
|
|
|
List<DmYdjh> collect = ydjhList.stream().map(it -> {
|
|
|
|
|
//防止手动编辑错误时的校验
|
|
|
|
|
if (it.图纸已使用()){
|
|
|
|
|
String str=StrUtil.format("作业计划船号:{},图号{}已使用,请核对修正后再打印", item.get使用船号(), item.get使用图纸());
|
|
|
|
|
String str=StrUtil.format("作业计划船号:{},图号{}已占用,请核对修正后再打印", item.get使用船号(), item.get使用图纸());
|
|
|
|
|
throw new ServiceException(99999,str);
|
|
|
|
|
}
|
|
|
|
|
it.setSllph(item.get炉批号());
|
|
|
|
|
it.setSlfkrq(date);
|
|
|
|
|
//fixme 不确定是否还需要抛丸,先执行到上料
|
|
|
|
|
it.setZtForPwfk();
|
|
|
|
|
if ("17".equals(it.getKw())){//光电直接切割
|
|
|
|
|
it.setZtForHXFK();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return it.ofPrintForSl(item,date);
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
updateList.addAll(collect);
|
|
|
|
@ -125,7 +121,7 @@ public class YlController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据语料库存数据选择结果匹配作业计划
|
|
|
|
|
* 根据余料库存数据选择结果匹配作业计划
|
|
|
|
|
* 匹配成功后返回匹配结果并显示到
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("sl")
|
|
|
|
@ -140,14 +136,18 @@ public class YlController {
|
|
|
|
|
List<DmYdjh> list = ydjhService.list(Wrappers.<DmYdjh>lambdaQuery()
|
|
|
|
|
.eq(DmYdjh::getDcCh, dto.getDcCh())
|
|
|
|
|
.eq(DmYdjh::getDcPl, dto.getDcPl())
|
|
|
|
|
.eq(DmYdjh::getYlbs,"Y")
|
|
|
|
|
.and(item->item.isNull(DmYdjh::getYlCh).or().eq(DmYdjh::getYlCh,""))
|
|
|
|
|
.eq(StrUtil.isNotEmpty(dto.getTzbh()),DmYdjh::getTzbh,dto.getTzbh())
|
|
|
|
|
.orderByDesc(DmYdjh::getWpgg)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
List<DmYlInfo> 匹配成功的余料信息=new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
out:
|
|
|
|
|
for (DmYdjh ydjh:list){
|
|
|
|
|
for(DmYlInfo ylInfo:dto.getYlList()){
|
|
|
|
|
if (ylInfo.指定余料编号的上料匹配(ydjh.getYlbhgg())&&ylInfo.上料匹配(ydjh)){//暂时不支持,仅保留分支流程
|
|
|
|
|
if (ylInfo.指定余料编号的上料匹配(ydjh.getYlbhgg())){//暂时不支持,仅保留分支流程
|
|
|
|
|
ylInfo.修正上料信息(ydjh);
|
|
|
|
|
匹配成功的余料信息.add(ylInfo);
|
|
|
|
|
continue out;
|
|
|
|
|