余料管理,增加退回功能和手工上料功能

master
董哲奇 1 month ago
parent 64fa99b6e5
commit 6f9d3a7214

@ -412,6 +412,9 @@ public class DmYdjh implements Serializable {
return StrUtil.format("{}_{}_{}_{}",this.dcCh,this.dcPl,this.dcFd,this.tzbh);
}
public boolean 使(){
return false;
}
public void setZtForSl(){
this.zt=ZyjhzxEnum.SLFK.code;

@ -94,13 +94,41 @@ public class DmYlInfo {
使=UseStatus.使.ordinal();
}
public void 退(){
使="";
使="";
使="";
使="";
使="";
使=UseStatus.使.ordinal();
}
public static DmYlInfo of(DmBchxylp bchxylp, DmYdjh ydjh){
DmYlInfo dmYlInfo = new DmYlInfo();
dmYlInfo.=bchxylp.getYlbh();
String _=null;
if(StrUtil.isNotEmpty(ydjh.getWpgg())){
String[] _split=ydjh.getWpgg().split("\\*");
if (_split.length>=3){
_=_split[0];
}
}
dmYlInfo.=bchxylp.getYlgg();
//兼容余料规格两种模式:带板厚和不带板厚
if (dmYlInfo.!=null){
String[] split = dmYlInfo..split("\\*");
if (split.length==2){
if(StrUtil.isNotEmpty(_)){
dmYlInfo.=new BigDecimal(_);
dmYlInfo.=_+"\\*"+dmYlInfo.;
}
dmYlInfo.=new BigDecimal(split[0]);
dmYlInfo.=new BigDecimal(split[1]);
}
if (split.length>=3){
dmYlInfo.=new BigDecimal(split[0]);
dmYlInfo.=new BigDecimal(split[1]);

@ -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<>();
}
}

Loading…
Cancel
Save