|
|
|
@ -1,21 +1,19 @@
|
|
|
|
|
package com.dsic.gj_erp.service.jhgk.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.dsic.gj_erp.bean.jcsj.DmBom;
|
|
|
|
|
import com.dsic.gj_erp.bean.jcsj.DmCbxxp;
|
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.*;
|
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.excel.JhxfExcel;
|
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
|
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmSygdxq;
|
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
|
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.YdjhImportNew;
|
|
|
|
|
import com.dsic.gj_erp.bean.pgd.PgdTzjh;
|
|
|
|
|
import com.dsic.gj_erp.mapper.jhgk.DmSygdxqMapper;
|
|
|
|
|
import com.dsic.gj_erp.mapper.jhgk.YdjhImportMapper;
|
|
|
|
|
import com.dsic.gj_erp.mapper.jhgk.YdjhImportNewMapper;
|
|
|
|
|
import com.dsic.gj_erp.service.jcsj.DmBomService;
|
|
|
|
|
import com.dsic.gj_erp.service.jcsj.DmCbxxpService;
|
|
|
|
@ -25,10 +23,14 @@ import com.dsic.gj_erp.service.pgd.PgdTzjhService;
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.transaction.support.TransactionTemplate;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
@ -48,100 +50,143 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
|
|
|
|
|
private static final String GJSCGK_SYGDMX_KEY = "GJSCGK::SYGDMX::";
|
|
|
|
|
private static final String GJSCGK_TZJH_KEY = "GJSCGK::TZJH::";
|
|
|
|
|
private static final String GJSCGK_BOM_COUNT_KEY="GJSCGK::BOM::COUNT::";
|
|
|
|
|
|
|
|
|
|
public List<String> getFileNameList() {
|
|
|
|
|
return baseMapper.getFileNameList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<YdjhImportNew> listByFileName(String fileName) {
|
|
|
|
|
public List<YdjhImportNew> listByFileName(String fileName,String zt) {
|
|
|
|
|
List<YdjhImportNew> list = this.list(Wrappers.<YdjhImportNew>lambdaQuery()
|
|
|
|
|
.eq(StrUtil.isNotEmpty(fileName), YdjhImportNew::get文件名, fileName)
|
|
|
|
|
.eq(StrUtil.isNotEmpty(zt),YdjhImportNew::getZt,zt)
|
|
|
|
|
.orderByAsc(YdjhImportNew::getId)
|
|
|
|
|
);
|
|
|
|
|
list.stream().filter(item->StrUtil.isNotEmpty(item.getDcPl()))
|
|
|
|
|
.forEach(item->{
|
|
|
|
|
List<DmBom> bomList = bomService.getBomUni(item.getDcCh(),item.getDcPl());
|
|
|
|
|
if (ObjUtil.isNotEmpty(bomList)){
|
|
|
|
|
item.set板数(bomList.size()+"");
|
|
|
|
|
Map<String, List<DmBom>> collect = bomList.stream().collect(Collectors.groupingBy(DmBom::getKw));
|
|
|
|
|
//一垮龙门和一垮数控
|
|
|
|
|
if (item.get切割完成1() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("7")).ifPresent(bom -> {
|
|
|
|
|
item.set一垮龙门板数(bom.size()+"");
|
|
|
|
|
});
|
|
|
|
|
String dcPl = item.getDcPl();
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("8")).ifPresent(bom -> {
|
|
|
|
|
item.set一垮数控板数(bom.size()+"");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
dcPl = String.format("%03d", Integer.parseInt(dcPl));
|
|
|
|
|
item.setDcPl(dcPl);
|
|
|
|
|
} catch (Exception ignored) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成2() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("5")).ifPresent(bom -> {
|
|
|
|
|
item.set二跨面板板数(bom.size()+"");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
AtomicInteger 板数 = new AtomicInteger(0);
|
|
|
|
|
//一垮龙门和一垮数控
|
|
|
|
|
if (item.get切割完成1() != null) {
|
|
|
|
|
this.getBomSize(item, "7",(size)->{
|
|
|
|
|
item.set二跨面板板数(size+"");
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成3() != null) {
|
|
|
|
|
AtomicInteger atomicInteger = new AtomicInteger(0);
|
|
|
|
|
Optional.ofNullable(collect.get("9")).ifPresent(bom -> {
|
|
|
|
|
atomicInteger.addAndGet(bom.size());
|
|
|
|
|
});
|
|
|
|
|
this.getBomSize(item, "8",(size)->{
|
|
|
|
|
item.set二跨面板板数(size+"");
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("10")).ifPresent(bom -> {
|
|
|
|
|
atomicInteger.addAndGet(bom.size());
|
|
|
|
|
});
|
|
|
|
|
if (item.get切割完成2() != null) {
|
|
|
|
|
this.getBomSize(item, "5",(size)->{
|
|
|
|
|
item.set二跨面板板数(size+"");
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("12")).ifPresent(bom -> {
|
|
|
|
|
atomicInteger.addAndGet(bom.size());
|
|
|
|
|
});
|
|
|
|
|
item.set二跨数控板数(atomicInteger.toString());
|
|
|
|
|
}
|
|
|
|
|
if (item.get切割完成3() != null) {
|
|
|
|
|
AtomicInteger atomicInteger = new AtomicInteger(0);
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成4() != null) {
|
|
|
|
|
AtomicInteger atomicInteger = new AtomicInteger(0);
|
|
|
|
|
Optional.ofNullable(collect.get("6")).ifPresent(bom -> {
|
|
|
|
|
atomicInteger.addAndGet(bom.size());
|
|
|
|
|
});
|
|
|
|
|
this.getBomSize(item, "9",(size)->{
|
|
|
|
|
atomicInteger.addAndGet(size);
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("14")).ifPresent(bom -> {
|
|
|
|
|
atomicInteger.addAndGet(bom.size());
|
|
|
|
|
});
|
|
|
|
|
item.set三跨平铁板数(atomicInteger.toString());
|
|
|
|
|
}
|
|
|
|
|
this.getBomSize(item, "10",(size)->{
|
|
|
|
|
atomicInteger.addAndGet(size);
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成5() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("13")).ifPresent(bom -> {
|
|
|
|
|
item.set三跨数控板数(bom.size()+"");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.getBomSize(item, "12",(size)->{
|
|
|
|
|
atomicInteger.addAndGet(size);
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成6() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("11")).ifPresent(bom -> {
|
|
|
|
|
item.set四区腹板板数(bom.size()+"");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
item.set二跨数控板数(atomicInteger.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成7() != null) {
|
|
|
|
|
AtomicInteger atomicInteger = new AtomicInteger(0);
|
|
|
|
|
Optional.ofNullable(collect.get("15")).ifPresent(bom -> {
|
|
|
|
|
atomicInteger.addAndGet(bom.size());
|
|
|
|
|
});
|
|
|
|
|
if (item.get切割完成4() != null) {
|
|
|
|
|
this.getBomSize(item, "6",(size)->{
|
|
|
|
|
item.set三跨平铁板数(size.toString());
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("16")).ifPresent(bom -> {
|
|
|
|
|
atomicInteger.addAndGet(bom.size());
|
|
|
|
|
});
|
|
|
|
|
item.set四区数控板数(atomicInteger.toString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(item.get曲平铁曲完成()!=null){
|
|
|
|
|
this.getBomSize(item, "13", 板数::addAndGet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成5() != null) {
|
|
|
|
|
this.getBomSize(item, "14",(size)->{
|
|
|
|
|
item.set三跨数控板数(size+"");
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成6() != null) {
|
|
|
|
|
this.getBomSize(item, "11",(size)->{
|
|
|
|
|
item.set四区腹板板数(size+"");
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成7() != null) {
|
|
|
|
|
AtomicInteger atomicInteger = new AtomicInteger(0);
|
|
|
|
|
|
|
|
|
|
this.getBomSize(item, "15",(size)->{
|
|
|
|
|
atomicInteger.addAndGet(size);
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.getBomSize(item, "16",(size)->{
|
|
|
|
|
atomicInteger.addAndGet(size);
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
item.set四区数控板数(atomicInteger.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(item.get光电完成()!=null){
|
|
|
|
|
this.getBomSize(item, "17", 板数::addAndGet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
item.set板数(板数.toString());
|
|
|
|
|
});
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void sh(String fileName) {
|
|
|
|
|
private void getBomSize(YdjhImportNew item, String kw, Consumer<Integer> handler){
|
|
|
|
|
Integer o = (Integer) redisTemplate.opsForHash().get(GJSCGK_BOM_COUNT_KEY + item.getDcCh(), item.getDcPl() + "_"+kw);
|
|
|
|
|
// if (o==null||o==0){
|
|
|
|
|
// List<DmBom> bomUni = bomService.getBomUni(item.getDcCh(), item.getDcPl(), kw);
|
|
|
|
|
// if (bomUni!=null){
|
|
|
|
|
// o=bomUni.size();
|
|
|
|
|
// redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY + item.getDcCh(), item.getDcPl() + "_"+kw,o);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
Optional.ofNullable(o).ifPresent(handler);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void sh(String fileName,String shr) {
|
|
|
|
|
LambdaQueryWrapper<YdjhImportNew> wrapper = Wrappers.<YdjhImportNew>lambdaQuery()
|
|
|
|
|
.eq(YdjhImportNew::get文件名, fileName)
|
|
|
|
|
.eq(YdjhImportNew::getZt, YdjhImportNew.ZtEnum.TJ.ordinal());
|
|
|
|
|
List<YdjhImportNew> list = this.updateData(wrapper, YdjhImportNew::sh);
|
|
|
|
|
String shrq=DateUtil.date().toString("yyyy/MM/dd");
|
|
|
|
|
List<YdjhImportNew> list = this.updateData(wrapper, (item)->{
|
|
|
|
|
item.updateToSh(shr,shrq);
|
|
|
|
|
item.sh();
|
|
|
|
|
});
|
|
|
|
|
if (ObjUtil.isEmpty(list)){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -154,9 +199,14 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
dcPl = String.format("%03d", Integer.parseInt(dcPl));
|
|
|
|
|
} catch (Exception ignored) {
|
|
|
|
|
}
|
|
|
|
|
List<DmYdjh> ydjhList = dmYdjhService.list(Wrappers.<DmYdjh>lambdaQuery().eq(DmYdjh::getDcCh, dcPl));
|
|
|
|
|
List<DmYdjh> ydjhList = dmYdjhService.list(Wrappers.<DmYdjh>lambdaQuery()
|
|
|
|
|
.eq(DmYdjh::getDcCh, item.getDcCh())
|
|
|
|
|
.eq(DmYdjh::getDcPl, dcPl)
|
|
|
|
|
);
|
|
|
|
|
if (ObjUtil.isNotEmpty(ydjhList)){
|
|
|
|
|
Map<String, List<DmYdjh>> collect = ydjhList.stream().collect(Collectors.groupingBy(DmYdjh::getKw));
|
|
|
|
|
Map<String, List<DmYdjh>> collect = ydjhList.stream()
|
|
|
|
|
.filter(ydjh->StrUtil.isNotEmpty(ydjh.getKw()))
|
|
|
|
|
.collect(Collectors.groupingBy(DmYdjh::getKw));
|
|
|
|
|
//一垮龙门和一垮数控
|
|
|
|
|
if (item.get切割完成1() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("7")).ifPresent(ydjhs -> {
|
|
|
|
@ -221,9 +271,12 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("14")).ifPresent(ydjhs -> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(item.get曲平铁曲完成()!=null){
|
|
|
|
|
Optional.ofNullable(collect.get("13")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成4());
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get曲平铁曲完成());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
@ -231,7 +284,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成5() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("13")).ifPresent(ydjhs -> {
|
|
|
|
|
Optional.ofNullable(collect.get("14")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成5());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
@ -268,6 +321,16 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(item.get光电完成()!=null){
|
|
|
|
|
Optional.ofNullable(collect.get("17")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get光电完成());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -294,7 +357,9 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
if (ObjUtil.isEmpty(list)){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
list.forEach(item -> {
|
|
|
|
|
list.stream()
|
|
|
|
|
.filter(item -> !item.getDcPl().contains("-"))//批次范围的数据暂不处理
|
|
|
|
|
.forEach(item -> {
|
|
|
|
|
String dcPl = item.getDcPl();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
@ -316,7 +381,9 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
transactionTemplate.execute((status)->{
|
|
|
|
|
list.stream().filter(item -> StrUtil.isAllNotEmpty(item.getDcCh(),item.getDcPl()))
|
|
|
|
|
list.stream()
|
|
|
|
|
.filter(item -> !item.getDcPl().contains("-"))//批次范围的数据暂不处理
|
|
|
|
|
.filter(item -> StrUtil.isAllNotEmpty(item.getDcCh(),item.getDcPl()))
|
|
|
|
|
.forEach(item->{
|
|
|
|
|
sygdMxService.remove(new QueryWrapper<DmSygdMx>()
|
|
|
|
|
.eq("dc_ch", item.getDcCh())
|
|
|
|
@ -342,6 +409,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
|
|
|
|
|
private List<YdjhImportNew> updateData(LambdaQueryWrapper<YdjhImportNew> wrapper, Consumer<YdjhImportNew> handler) {
|
|
|
|
|
List<YdjhImportNew> list = this.list(wrapper);
|
|
|
|
|
|
|
|
|
|
list.forEach(item -> {
|
|
|
|
|
YdjhImportNew ydjhImportNew = new YdjhImportNew();
|
|
|
|
|
ydjhImportNew.setId(item.getId());
|
|
|
|
@ -353,16 +421,21 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void handler(List<YdjhImportNew> list, String fileName, HttpServletRequest request) {
|
|
|
|
|
|
|
|
|
|
String yhms = (String) request.getAttribute("yhms");
|
|
|
|
|
//三月滚动明细
|
|
|
|
|
this.createSygdmx(list, fileName);
|
|
|
|
|
|
|
|
|
|
//没有基础数据的计划生成图纸计划
|
|
|
|
|
this.createTzjh(list, fileName, request);
|
|
|
|
|
this.createTzjh(list, fileName, yhms);
|
|
|
|
|
|
|
|
|
|
String date = DateUtil.date().toString("yyyy/MM/dd");
|
|
|
|
|
transactionTemplate.execute((status) -> {
|
|
|
|
|
list.stream().filter(item -> StrUtil.isAllNotEmpty(item.getDcCh(), item.getDcPl()))
|
|
|
|
|
list.stream()
|
|
|
|
|
.filter(item -> StrUtil.isAllNotEmpty(item.getDcCh(), item.getDcPl()))
|
|
|
|
|
.forEach(item -> {
|
|
|
|
|
item.set文件名(fileName);
|
|
|
|
|
item.updateToBz(yhms,date);
|
|
|
|
|
this.remove(new QueryWrapper<YdjhImportNew>()
|
|
|
|
|
.eq("dc_ch", item.getDcCh())
|
|
|
|
|
.eq("dc_pl", item.getDcPl())
|
|
|
|
@ -374,11 +447,11 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void createTzjh(List<YdjhImportNew> list, String fileName, HttpServletRequest request) {
|
|
|
|
|
String yhms = (String) request.getAttribute("yhms");
|
|
|
|
|
private void createTzjh(List<YdjhImportNew> list, String fileName,String yhms) {
|
|
|
|
|
String date = DateUtil.date().toString("yyyy/MM/dd");
|
|
|
|
|
|
|
|
|
|
list.stream()
|
|
|
|
|
.filter(item -> !item.getDcPl().contains("-"))//批次范围的数据暂不处理
|
|
|
|
|
.filter(YdjhImportNew::isNonBom)
|
|
|
|
|
.forEach(item -> {
|
|
|
|
|
String dcPl = item.getDcPl();
|
|
|
|
@ -412,7 +485,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
} catch (Exception ignored) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<DmBom> bomList = bomService.getBomUni(item.getDcCh(), dcPl);
|
|
|
|
|
List<DmBom> bomList = bomService.getBomUni(item.getDcCh(), dcPl,null);
|
|
|
|
|
|
|
|
|
|
if (ObjUtil.isEmpty(bomList)) {
|
|
|
|
|
//无bom,明细数据使用目标船只替代,切在作业计划中生成一条(按照kw进行区分)数据
|
|
|
|
@ -434,8 +507,10 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
|
|
|
|
|
Map<String, List<DmBom>> collect = bomList.stream().collect(Collectors.groupingBy(DmBom::getKw));
|
|
|
|
|
//一垮龙门和一垮数控
|
|
|
|
|
String finalDcPl = dcPl;
|
|
|
|
|
if (item.get切割完成1() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("7")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_7",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
@ -449,6 +524,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("8")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_8",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
@ -464,6 +540,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成2() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("5")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_5",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
@ -479,6 +556,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成3() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("9")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_9",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
@ -492,6 +570,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("10")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_10",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
@ -505,6 +584,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("12")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_12",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
@ -520,13 +600,12 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成4() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("6")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_6",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成4());
|
|
|
|
|
dmSygdMx.setQbs("1");
|
|
|
|
|
dmSygdMx.setQjgrq(item.get曲平铁曲完成());
|
|
|
|
|
dmSygdMx.setJssj(item.getQfxqrqxz());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
|
dmSygdMx.setBomData(bom);
|
|
|
|
@ -534,32 +613,34 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("14")).ifPresent(boms -> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(item.get曲平铁曲完成()!=null){
|
|
|
|
|
Optional.ofNullable(collect.get("13")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_13",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成4());
|
|
|
|
|
dmSygdMx.setQgrq(item.get曲平铁曲完成());
|
|
|
|
|
dmSygdMx.setQbs("1");
|
|
|
|
|
dmSygdMx.setQjgrq(item.get曲平铁曲完成());
|
|
|
|
|
dmSygdMx.setQjgrq(item.get曲外板曲完成());
|
|
|
|
|
dmSygdMx.setJssj(item.getQfxqrqxz());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
|
dmSygdMx.setBomData(bom);
|
|
|
|
|
addList.add(dmSygdMx);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成5() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("13")).ifPresent(boms -> {
|
|
|
|
|
Optional.ofNullable(collect.get("14")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_14",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成5());
|
|
|
|
|
dmSygdMx.setQbs("1");
|
|
|
|
|
dmSygdMx.setQjgrq(item.get曲外板曲完成());
|
|
|
|
|
dmSygdMx.setJssj(item.getQfxqrqxz());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
|
dmSygdMx.setBomData(bom);
|
|
|
|
@ -570,6 +651,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成6() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("11")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_11",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
@ -585,6 +667,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成7() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("15")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_15",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
@ -598,6 +681,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("16")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_16",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
@ -610,6 +694,23 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(item.get光电完成()!=null){
|
|
|
|
|
Optional.ofNullable(collect.get("17")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_17",boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setQgrq(item.get光电完成());
|
|
|
|
|
dmSygdMx.setJssj(item.getQfxqrqxz());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
|
dmSygdMx.setBomData(bom);
|
|
|
|
|
addList.add(dmSygdMx);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_SYGDMX_KEY + fileName, item.getDcCh() + "_" + dcPl, addList);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|