|
|
|
@ -17,7 +17,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -45,11 +46,39 @@ public class YlController {
|
|
|
|
|
* 保存功能
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("edit")
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public ResultBean<?> edit(@RequestBody List<DmYlInfo> list){
|
|
|
|
|
ylInfoService.updateBatchById(list);
|
|
|
|
|
return new ResultBean<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 退回
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("rollback")
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public ResultBean<?> rollback(@RequestBody List<DmYlInfo> list){
|
|
|
|
|
List<DmYdjh> updateList=new ArrayList<>();
|
|
|
|
|
list.stream()
|
|
|
|
|
.filter(item->item.get使用状态()<=2)
|
|
|
|
|
.forEach(item->{
|
|
|
|
|
DmYdjh one = ydjhService.getOne(Wrappers.<DmYdjh>lambdaQuery()
|
|
|
|
|
.eq(DmYdjh::getDcCh, item.get使用船号())
|
|
|
|
|
.eq(DmYdjh::getTzbh, item.get使用图纸())
|
|
|
|
|
);
|
|
|
|
|
//退回作业计划
|
|
|
|
|
//fixme 修正作业计划,余料上料相关属性
|
|
|
|
|
if (ObjectUtil.isNotEmpty(one)){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//退回余料库存信息
|
|
|
|
|
item.修正退回信息();
|
|
|
|
|
});
|
|
|
|
|
ydjhService.updateBatchById(updateList);
|
|
|
|
|
this.edit(list);
|
|
|
|
|
return new ResultBean<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 打印
|
|
|
|
|
*/
|
|
|
|
@ -58,27 +87,40 @@ public class YlController {
|
|
|
|
|
public ResultBean<?> print(@RequestBody List<DmYlInfo> list){
|
|
|
|
|
ArrayList<DmYdjh> updateList = new ArrayList<>();
|
|
|
|
|
list.forEach(item->{
|
|
|
|
|
String date = DateUtil.date().toString("yyyy/MM/dd");
|
|
|
|
|
item.set使用日期(date);
|
|
|
|
|
item.set使用状态(2);//已打印
|
|
|
|
|
List<DmYdjh> ydjhList = ydjhService.list(Wrappers.<DmYdjh>lambdaQuery()
|
|
|
|
|
.eq(DmYdjh::getDcCh, item.get使用船号())
|
|
|
|
|
.eq(DmYdjh::getTzbh,item.get使用图纸())
|
|
|
|
|
);
|
|
|
|
|
List<DmYdjh> collect = ydjhList.stream().peek(it -> {
|
|
|
|
|
it.setSllph(item.get炉批号());
|
|
|
|
|
it.setSlfkrq(date);
|
|
|
|
|
//fixme 不确定是否还需要抛丸,先执行到上料
|
|
|
|
|
it.setZtForPwfk();
|
|
|
|
|
if ("17".equals(it.getKw())){//光电直接切割
|
|
|
|
|
it.setZtForHXFK();
|
|
|
|
|
if (StrUtil.isAllNotEmpty(item.get使用船号(),item.get使用船号())){
|
|
|
|
|
String date = DateUtil.date().toString("yyyy/MM/dd");
|
|
|
|
|
item.set使用日期(date);
|
|
|
|
|
item.set使用状态(2);//已打印
|
|
|
|
|
List<DmYdjh> ydjhList = ydjhService.list(Wrappers.<DmYdjh>lambdaQuery()
|
|
|
|
|
.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);
|
|
|
|
|
}
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
List<DmYdjh> collect = ydjhList.stream().peek(it -> {
|
|
|
|
|
//fixme 确定以下方法具体算法
|
|
|
|
|
if (it.图纸已使用()){
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
updateList.addAll(collect);
|
|
|
|
|
updateList.addAll(collect);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ydjhService.updateBatchById(updateList);
|
|
|
|
|
ylInfoService.updateBatchById(list);
|
|
|
|
|
|
|
|
|
|
return new ResultBean<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -120,8 +162,6 @@ public class YlController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new ResultBean<>(匹配成功的余料信息);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|