|
|
|
@ -20,17 +20,16 @@ import com.dsic.gj_erp.service.jcsj.DmCbxxpService;
|
|
|
|
|
import com.dsic.gj_erp.service.jhgk.DmSygdMxService;
|
|
|
|
|
import com.dsic.gj_erp.service.jhgk.DmYdjhService;
|
|
|
|
|
import com.dsic.gj_erp.service.pgd.PgdTzjhService;
|
|
|
|
|
import lombok.AccessLevel;
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
import lombok.experimental.FieldDefaults;
|
|
|
|
|
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.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
@ -64,11 +63,12 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
);
|
|
|
|
|
list.stream().filter(item->StrUtil.isNotEmpty(item.getDcPl()))
|
|
|
|
|
.forEach(item->{
|
|
|
|
|
String dcPl = item.getDcPl();
|
|
|
|
|
TmpDcPl tmpDcPl = getDcPl(item);
|
|
|
|
|
String dcPl=tmpDcPl.dcPl;
|
|
|
|
|
String rowType=tmpDcPl.rowType;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
dcPl = String.format("%03d", Integer.parseInt(dcPl));
|
|
|
|
|
item.setDcPl(dcPl);
|
|
|
|
|
} catch (Exception ignored) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -76,13 +76,13 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
//一垮龙门和一垮数控
|
|
|
|
|
if (item.get切割完成1() != null) {
|
|
|
|
|
item.set一垮龙门板数("0");
|
|
|
|
|
this.getBomSize(item, "7",(size)->{
|
|
|
|
|
this.getBomSize(item, "7"+rowType,(size)->{
|
|
|
|
|
item.set一垮龙门板数(size+"");
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
item.set一垮数控板数("0");
|
|
|
|
|
this.getBomSize(item, "8",(size)->{
|
|
|
|
|
this.getBomSize(item, "8"+rowType,(size)->{
|
|
|
|
|
item.set一垮数控板数(size+"");
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
@ -90,7 +90,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成2() != null) {
|
|
|
|
|
item.set二跨面板板数("0");
|
|
|
|
|
this.getBomSize(item, "5",(size)->{
|
|
|
|
|
this.getBomSize(item, "5"+rowType,(size)->{
|
|
|
|
|
item.set二跨面板板数(size+"");
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
@ -99,17 +99,17 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
if (item.get切割完成3() != null) {
|
|
|
|
|
AtomicInteger atomicInteger = new AtomicInteger(0);
|
|
|
|
|
|
|
|
|
|
this.getBomSize(item, "9",(size)->{
|
|
|
|
|
this.getBomSize(item, "9"+rowType,(size)->{
|
|
|
|
|
atomicInteger.addAndGet(size);
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.getBomSize(item, "10",(size)->{
|
|
|
|
|
this.getBomSize(item, "10"+rowType,(size)->{
|
|
|
|
|
atomicInteger.addAndGet(size);
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.getBomSize(item, "12",(size)->{
|
|
|
|
|
this.getBomSize(item, "12"+rowType,(size)->{
|
|
|
|
|
atomicInteger.addAndGet(size);
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
@ -120,11 +120,11 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
if (item.get切割完成4() != null) {
|
|
|
|
|
item.set三跨平铁板数("0");
|
|
|
|
|
AtomicInteger atomicInteger = new AtomicInteger(0);
|
|
|
|
|
this.getBomSize(item, "6",(size)->{
|
|
|
|
|
this.getBomSize(item, "6"+rowType,(size)->{
|
|
|
|
|
atomicInteger.addAndGet(size);
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
|
this.getBomSize(item, "13", (size)->{
|
|
|
|
|
this.getBomSize(item, "13"+rowType, (size)->{
|
|
|
|
|
atomicInteger.addAndGet(size);
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
@ -134,7 +134,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成5() != null||item.get三跨数控板数()!=null) {
|
|
|
|
|
item.set三跨数控板数("0");
|
|
|
|
|
this.getBomSize(item, "14",(size)->{
|
|
|
|
|
this.getBomSize(item, "14"+rowType,(size)->{
|
|
|
|
|
item.set三跨数控板数(size+"");
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
@ -142,7 +142,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成6() != null) {
|
|
|
|
|
item.set四区腹板板数("0");
|
|
|
|
|
this.getBomSize(item, "11",(size)->{
|
|
|
|
|
this.getBomSize(item, "11"+rowType,(size)->{
|
|
|
|
|
item.set四区腹板板数(size+"");
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
@ -151,7 +151,7 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
if (item.get切割完成7() != null) {
|
|
|
|
|
AtomicInteger atomicInteger = new AtomicInteger(0);
|
|
|
|
|
|
|
|
|
|
this.getBomSize(item, "15",(size)->{
|
|
|
|
|
this.getBomSize(item, "15"+rowType,(size)->{
|
|
|
|
|
atomicInteger.addAndGet(size);
|
|
|
|
|
板数.addAndGet(size);
|
|
|
|
|
});
|
|
|
|
@ -198,7 +198,8 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
List<DmYdjh> updateList=new ArrayList<>();
|
|
|
|
|
list.stream().filter(item->StrUtil.isAllNotEmpty(item.getDcCh(),item.getDcPl()))
|
|
|
|
|
.forEach(item->{
|
|
|
|
|
String dcPl = item.getDcPl();
|
|
|
|
|
TmpDcPl tmpDcPl = getDcPl(item);
|
|
|
|
|
String dcPl=tmpDcPl.dcPl;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
dcPl = String.format("%03d", Integer.parseInt(dcPl));
|
|
|
|
@ -214,115 +215,153 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
.collect(Collectors.groupingBy(DmYdjh::getKw));
|
|
|
|
|
//一垮龙门和一垮数控
|
|
|
|
|
if (item.get切割完成1() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("7")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成1());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
if (!StrUtil.isAllEmpty(item.get上料完成(),item.get抛丸完成(),item.get切割完成1(),item.get小组配送完成())){
|
|
|
|
|
Optional.ofNullable(collect.get("7")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成1());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
dmYdjh.setJssj(item.get小组配送完成());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("8")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成1());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StrUtil.isAllEmpty(item.get上料完成(),item.get抛丸完成(),item.get切割完成1(),item.get小组配送完成())){
|
|
|
|
|
Optional.ofNullable(collect.get("8")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成1());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
dmYdjh.setJssj(item.get小组配送完成());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成2() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("5")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成2());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
if (!StrUtil.isAllEmpty(item.get上料完成(),item.get抛丸完成(),item.get切割完成2(),item.get小组配送完成())){
|
|
|
|
|
Optional.ofNullable(collect.get("5")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成2());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
dmYdjh.setJssj(item.get小组配送完成());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成3() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("9")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成3());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
if (!StrUtil.isAllEmpty(item.get上料完成(),item.get抛丸完成(),item.get切割完成3(),item.get小组配送完成())){
|
|
|
|
|
Optional.ofNullable(collect.get("9")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成3());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
dmYdjh.setJssj(item.get小组配送完成());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("10")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成3());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StrUtil.isAllEmpty(item.get上料完成(),item.get抛丸完成(),item.get切割完成3(),item.get小组配送完成())){
|
|
|
|
|
Optional.ofNullable(collect.get("10")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成3());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
dmYdjh.setJssj(item.get小组配送完成());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Optional.ofNullable(collect.get("12")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成3());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StrUtil.isAllEmpty(item.get上料完成(),item.get抛丸完成(),item.get切割完成3(),item.get小组配送完成())){
|
|
|
|
|
Optional.ofNullable(collect.get("12")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成3());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
dmYdjh.setJssj(item.get小组配送完成());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成4() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("6")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成4());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
if (!StrUtil.isAllEmpty(item.get上料完成(),item.get抛丸完成(),item.get切割完成4(),item.get小组配送完成())){
|
|
|
|
|
Optional.ofNullable(collect.get("6")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成4());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
dmYdjh.setJssj(item.get小组配送完成());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Optional.ofNullable(collect.get("13")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成4());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StrUtil.isAllEmpty(item.get上料完成(),item.get抛丸完成(),item.get切割完成4(),item.get小组配送完成())){
|
|
|
|
|
Optional.ofNullable(collect.get("13")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成4());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
dmYdjh.setJssj(item.get小组配送完成());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成5() != null||item.get三跨数控板数()!=null) {
|
|
|
|
|
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());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
if (!StrUtil.isAllEmpty(item.get上料完成(),item.get抛丸完成(),item.get切割完成5(),item.get小组配送完成())){
|
|
|
|
|
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());
|
|
|
|
|
dmYdjh.setJssj(item.get小组配送完成());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成6() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("11")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成6());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
if (!StrUtil.isAllEmpty(item.get上料完成(),item.get抛丸完成(),item.get切割完成6(),item.get小组配送完成())){
|
|
|
|
|
Optional.ofNullable(collect.get("11")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成6());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
dmYdjh.setJssj(item.get小组配送完成());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成7() != null) {
|
|
|
|
|
Optional.ofNullable(collect.get("15")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成7());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
if (!StrUtil.isAllEmpty(item.get上料完成(),item.get抛丸完成(),item.get切割完成7(),item.get小组配送完成())){
|
|
|
|
|
Optional.ofNullable(collect.get("15")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成7());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
dmYdjh.setJssj(item.get小组配送完成());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
if (!StrUtil.isAllEmpty(item.get上料完成(),item.get抛丸完成(),item.get光电完成(),item.get小组配送完成())){
|
|
|
|
|
Optional.ofNullable(collect.get("17")).ifPresent(ydjhs -> {
|
|
|
|
|
ydjhs.forEach(ydjh->{
|
|
|
|
|
DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get光电完成());
|
|
|
|
|
dmYdjh.setId(ydjh.getId());
|
|
|
|
|
dmYdjh.setJssj(item.get小组配送完成());
|
|
|
|
|
updateList.add(dmYdjh);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -355,14 +394,16 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
list.stream()
|
|
|
|
|
.filter(item -> !item.getDcPl().contains("-"))//批次范围的数据暂不处理
|
|
|
|
|
.forEach(item -> {
|
|
|
|
|
String dcPl = item.getDcPl();
|
|
|
|
|
TmpDcPl tmpDcPl = getDcPl(item);
|
|
|
|
|
String dcPl=tmpDcPl.dcPl;
|
|
|
|
|
String rowType=tmpDcPl.rowType;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
dcPl = String.format("%03d", Integer.parseInt(dcPl));
|
|
|
|
|
} catch (Exception ignored) {
|
|
|
|
|
}
|
|
|
|
|
item.setDcPl(dcPl);
|
|
|
|
|
List<DmSygdMx> sygdmx = (List<DmSygdMx>) redisTemplate.opsForHash().get(GJSCGK_SYGDMX_KEY + fileName, item.getDcCh() + "_" + dcPl);
|
|
|
|
|
List<DmSygdMx> sygdmx = (List<DmSygdMx>) redisTemplate.opsForHash().get(GJSCGK_SYGDMX_KEY + fileName, item.getDcCh() + "_" + dcPl+rowType);
|
|
|
|
|
if (ObjUtil.isNotEmpty(sygdmx)) {
|
|
|
|
|
sygdMxList.addAll(sygdmx);
|
|
|
|
|
}
|
|
|
|
@ -471,12 +512,9 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
.forEach(item -> {
|
|
|
|
|
|
|
|
|
|
List<DmSygdMx> addList = new ArrayList<>();
|
|
|
|
|
String dcPl = item.getDcPl();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
dcPl = String.format("%03d", Integer.parseInt(dcPl));
|
|
|
|
|
} catch (Exception ignored) {
|
|
|
|
|
}
|
|
|
|
|
TmpDcPl tmpDcPl = getDcPl(item);
|
|
|
|
|
String dcPl=tmpDcPl.dcPl;
|
|
|
|
|
String rowType=tmpDcPl.rowType;
|
|
|
|
|
|
|
|
|
|
List<DmBom> bomList = bomService.getBomUni(item.getDcCh(), dcPl,null);
|
|
|
|
|
|
|
|
|
@ -500,14 +538,13 @@ 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());
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), item.getDcPl() +"_7"+rowType,boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setDcPl(dcPl);
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成1());
|
|
|
|
|
dmSygdMx.setJssj(item.get小组配送完成());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
@ -517,11 +554,11 @@ 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());
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), item.getDcPl() +"_8"+rowType,boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setDcPl(dcPl);
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成1());
|
|
|
|
|
dmSygdMx.setJssj(item.get小组配送完成());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
@ -533,11 +570,11 @@ 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());
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), item.getDcPl() +"_5"+rowType,boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setDcPl(dcPl);
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成2());
|
|
|
|
|
dmSygdMx.setJssj(item.get小组配送完成());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
@ -549,11 +586,11 @@ 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());
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), item.getDcPl() +"_9"+rowType,boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setDcPl(dcPl);
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成3());
|
|
|
|
|
dmSygdMx.setJssj(item.get小组配送完成());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
@ -563,11 +600,11 @@ 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());
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), item.getDcPl() +"_10"+rowType,boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setDcPl(dcPl);
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成3());
|
|
|
|
|
dmSygdMx.setJssj(item.get小组配送完成());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
@ -577,11 +614,11 @@ 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());
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), item.getDcPl() +"_12"+rowType,boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setDcPl(dcPl);
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成3());
|
|
|
|
|
dmSygdMx.setJssj(item.get小组配送完成());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
@ -593,11 +630,11 @@ 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());
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), item.getDcPl() +"_6"+rowType,boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setDcPl(dcPl);
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成4());
|
|
|
|
|
dmSygdMx.setJssj(item.get小组配送完成());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
@ -606,11 +643,11 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
Optional.ofNullable(collect.get("13")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_13",boms.size());
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), item.getDcPl() +"_13"+rowType,boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setDcPl(dcPl);
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成4());
|
|
|
|
|
dmSygdMx.setQbs("1");
|
|
|
|
|
dmSygdMx.setQjgrq(item.get曲平铁曲完成());
|
|
|
|
@ -625,11 +662,11 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
|
|
|
|
|
if (item.get切割完成5() != null||item.get三跨数控板数()!=null) {
|
|
|
|
|
Optional.ofNullable(collect.get("14")).ifPresent(boms -> {
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_14",boms.size());
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), item.getDcPl() +"_14"+rowType,boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setDcPl(dcPl);
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成5());
|
|
|
|
|
dmSygdMx.setJssj(item.get小组配送完成());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
@ -657,11 +694,11 @@ 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());
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), item.getDcPl() +"_11"+rowType,boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setDcPl(dcPl);
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成6());
|
|
|
|
|
dmSygdMx.setJssj(item.get小组配送完成());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
@ -673,11 +710,11 @@ 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());
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), item.getDcPl() +"_15"+rowType,boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setDcPl(dcPl);
|
|
|
|
|
dmSygdMx.setQgrq(item.get切割完成7());
|
|
|
|
|
dmSygdMx.setJssj(item.get小组配送完成());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
@ -690,11 +727,11 @@ 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());
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), item.getDcPl() +"_17"+rowType,boms.size());
|
|
|
|
|
boms.forEach(bom -> {
|
|
|
|
|
DmSygdMx dmSygdMx = new DmSygdMx();
|
|
|
|
|
dmSygdMx.setDcCh(item.getDcCh());
|
|
|
|
|
dmSygdMx.setDcPl(item.getDcPl());
|
|
|
|
|
dmSygdMx.setDcPl(dcPl);
|
|
|
|
|
dmSygdMx.setQgrq(item.get光电完成());
|
|
|
|
|
dmSygdMx.setJssj(item.get小组配送完成());
|
|
|
|
|
dmSygdMx.setGjjsDz(item.getQfxqrqdz());
|
|
|
|
@ -704,7 +741,51 @@ public class YdjhImportNewService extends ServiceImpl<YdjhImportNewMapper, YdjhI
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_SYGDMX_KEY + fileName, item.getDcCh() + "_" + dcPl, addList);
|
|
|
|
|
redisTemplate.opsForHash().put(GJSCGK_SYGDMX_KEY + fileName, item.getDcCh() + "_" + dcPl+rowType, addList);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private TmpDcPl getDcPl(YdjhImportNew item) {
|
|
|
|
|
String dcPl = item.getDcPl();
|
|
|
|
|
|
|
|
|
|
String rowType="";
|
|
|
|
|
|
|
|
|
|
if (dcPl!=null&&dcPl.toUpperCase(Locale.ROOT).contains("XT")){
|
|
|
|
|
dcPl=dcPl.toUpperCase(Locale.ROOT).replace("XT","");
|
|
|
|
|
rowType="XT";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dcPl!=null&&dcPl.toUpperCase(Locale.ROOT).contains("DT")){
|
|
|
|
|
dcPl=dcPl.toUpperCase(Locale.ROOT).replace("DT","");
|
|
|
|
|
rowType="DT";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dcPl!=null&&dcPl.toUpperCase(Locale.ROOT).contains("T")){
|
|
|
|
|
dcPl=dcPl.toUpperCase(Locale.ROOT).replace("T","");
|
|
|
|
|
rowType="T";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dcPl!=null&&dcPl.toUpperCase(Locale.ROOT).contains("Q")){
|
|
|
|
|
dcPl=dcPl.toUpperCase(Locale.ROOT).replace("Q","");
|
|
|
|
|
rowType="Q";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
assert dcPl != null;
|
|
|
|
|
dcPl = String.format("%03d", Integer.parseInt(dcPl));
|
|
|
|
|
} catch (Exception ignored) {}
|
|
|
|
|
|
|
|
|
|
return new TmpDcPl(dcPl,rowType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@FieldDefaults(level = AccessLevel.PUBLIC)
|
|
|
|
|
private static class TmpDcPl{
|
|
|
|
|
String dcPl;
|
|
|
|
|
String rowType;
|
|
|
|
|
|
|
|
|
|
public TmpDcPl(String dcpl, String rowType) {
|
|
|
|
|
this.dcPl=dcpl;
|
|
|
|
|
this.rowType=rowType;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|