|
|
|
@ -33,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.Optional;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
|
@ -160,6 +161,12 @@ public class ZyjhService extends ServiceImpl<DmYdjhMapper,DmYdjh> {
|
|
|
|
if (_strArr.length>8){
|
|
|
|
if (_strArr.length>8){
|
|
|
|
_lj.setTz(_strArr[7]);
|
|
|
|
_lj.setTz(_strArr[7]);
|
|
|
|
_lj.setLx(_strArr[8]);
|
|
|
|
_lj.setLx(_strArr[8]);
|
|
|
|
|
|
|
|
String sl0=_strArr[4];
|
|
|
|
|
|
|
|
String sl1=_strArr[5];
|
|
|
|
|
|
|
|
String sl2=_strArr[6];
|
|
|
|
|
|
|
|
//用于修正bom生成零件数量时取值错误
|
|
|
|
|
|
|
|
_lj.setSl(0d);
|
|
|
|
|
|
|
|
this.ofStr(sl0,sl1,sl2).ifPresent(_lj::setSl);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (_strArr.length>9){
|
|
|
|
if (_strArr.length>9){
|
|
|
|
_lj.setXj(_strArr[9]);
|
|
|
|
_lj.setXj(_strArr[9]);
|
|
|
|
@ -174,26 +181,21 @@ public class ZyjhService extends ServiceImpl<DmYdjhMapper,DmYdjh> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//如果零件已报工,不可以删除,取消整图删除零件,改为修正
|
|
|
|
//修正已报工零件
|
|
|
|
List<DmYdjhLj> list = ljService.list(Wrappers.<DmYdjhLj>lambdaQuery()
|
|
|
|
List<DmYdjhLj> list = ljService.list(Wrappers.<DmYdjhLj>lambdaQuery()
|
|
|
|
.eq(DmYdjhLj::getCzbh, dcCh)
|
|
|
|
.eq(DmYdjhLj::getCzbh, dcCh)
|
|
|
|
.eq(DmYdjhLj::getPl, dcPl)
|
|
|
|
.eq(DmYdjhLj::getPl, dcPl)
|
|
|
|
.eq(DmYdjhLj::getTlth, tzbh)
|
|
|
|
.eq(DmYdjhLj::getTlth, tzbh)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
if (!list.isEmpty()){
|
|
|
|
if (!list.isEmpty()){
|
|
|
|
list.forEach(item->{
|
|
|
|
list.forEach(item->
|
|
|
|
//清理错误数据
|
|
|
|
|
|
|
|
if (StrUtil.isEmpty(item.getLjbh())){
|
|
|
|
|
|
|
|
ljService.removeById(item);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ljInfo.forEach(lj->{
|
|
|
|
ljInfo.forEach(lj->{
|
|
|
|
if (lj.tmpEq(item)){
|
|
|
|
if (lj.tmpEq(item)){
|
|
|
|
//修正零件状态信息
|
|
|
|
//修正零件状态信息
|
|
|
|
lj.updateZtWithDb(item);
|
|
|
|
lj.updateZtWithDb(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
});
|
|
|
|
);
|
|
|
|
ljService.saveOrUpdateBatch(ljInfo);
|
|
|
|
ljService.saveOrUpdateBatch(ljInfo);
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
ljService.remove(Wrappers.<DmYdjhLj>lambdaQuery()
|
|
|
|
ljService.remove(Wrappers.<DmYdjhLj>lambdaQuery()
|
|
|
|
@ -374,4 +376,40 @@ public class ZyjhService extends ServiceImpl<DmYdjhMapper,DmYdjh> {
|
|
|
|
return redisTemplate.opsForValue().get(KEY);
|
|
|
|
return redisTemplate.opsForValue().get(KEY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Optional<Double> ofStr(String str0,String str1,String str2){
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(str0)){
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
double v = Double.parseDouble(str0);
|
|
|
|
|
|
|
|
if (v>0){
|
|
|
|
|
|
|
|
return Optional.of(v);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(str1)){
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
double v = Double.parseDouble(str1);
|
|
|
|
|
|
|
|
if (v>0){
|
|
|
|
|
|
|
|
return Optional.of(v);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(str2)){
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
double v = Double.parseDouble(str2);
|
|
|
|
|
|
|
|
if (v>0){
|
|
|
|
|
|
|
|
return Optional.of(v);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return Optional.empty();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|