diff --git a/src/main/java/com/dsic/gj_erp/bean/jhgk/YdjhImport.java b/src/main/java/com/dsic/gj_erp/bean/jhgk/YdjhImport.java index af1523c..3ee11e7 100644 --- a/src/main/java/com/dsic/gj_erp/bean/jhgk/YdjhImport.java +++ b/src/main/java/com/dsic/gj_erp/bean/jhgk/YdjhImport.java @@ -112,6 +112,9 @@ public class YdjhImport { @TableField(exist = false) private Boolean qwbBs; + @TableField(exist = false) + private String qgrq; + public boolean isAvailable(){ return !StrUtil.isAllEmpty(this.sl,this.xcpw,this.pw,this.dbqgks,this.ykpkjs,this.lmqgks,this.lmqgjs, this.ekskks,this.ekpkjs,this.skskqgks,this.skpkjs,this.ptks,this.ptjs,this.qpt_zjs,this.qptjs, diff --git a/src/main/java/com/dsic/gj_erp/bean/pgd/PgdTzjh.java b/src/main/java/com/dsic/gj_erp/bean/pgd/PgdTzjh.java index f49b25d..3a0d357 100644 --- a/src/main/java/com/dsic/gj_erp/bean/pgd/PgdTzjh.java +++ b/src/main/java/com/dsic/gj_erp/bean/pgd/PgdTzjh.java @@ -80,13 +80,13 @@ public class PgdTzjh implements Serializable { private String fkry; - public static PgdTzjh of(YdjhImport jh,String pl,String fd){ + public static PgdTzjh of(YdjhImport jh,String pl){ PgdTzjh tzjh = new PgdTzjh(); tzjh.setCzbh(jh.getDcCh()); tzjh.setPl(pl); tzjh.setQfxqrqxz(jh.getQfxqrqxz()); tzjh.setQfxqrqdz(jh.getQfxqrqdz()); - tzjh.setFd(fd); +// tzjh.setFd(fd); tzjh.setZt("01"); // tzjh.setTzzt("0"); return tzjh; diff --git a/src/main/java/com/dsic/gj_erp/bean/zyjh/PwExcel.java b/src/main/java/com/dsic/gj_erp/bean/zyjh/PwExcel.java index bdb47dd..270bbdd 100644 --- a/src/main/java/com/dsic/gj_erp/bean/zyjh/PwExcel.java +++ b/src/main/java/com/dsic/gj_erp/bean/zyjh/PwExcel.java @@ -14,7 +14,7 @@ public class PwExcel { @ExcelProperty(value = "批量") public String dcPl; - @ExcelProperty(value = "分段",index = 5) + @ExcelProperty(value = "分段") public String dcFd; @ExcelProperty(value = "套料图号") @@ -26,7 +26,10 @@ public class PwExcel { @ExcelProperty(value = "理料垛位") public String lldw; - @ExcelProperty(value = "层数") + @ExcelProperty(value = "理料层数") private String llcs; + @ExcelProperty(value = "状态") + private String zt; + } diff --git a/src/main/java/com/dsic/gj_erp/config/JapConfig.java b/src/main/java/com/dsic/gj_erp/config/JapConfig.java index a4433cf..c564f88 100644 --- a/src/main/java/com/dsic/gj_erp/config/JapConfig.java +++ b/src/main/java/com/dsic/gj_erp/config/JapConfig.java @@ -91,7 +91,7 @@ public class JapConfig { public DataSourceInitializer manDataSourceInitializer() {//6 DataSourceInitializer dsInitializer = new DataSourceInitializer(); HikariDataSource dataSource = (HikariDataSource) jpaDataSource(); - dataSource.setMaximumPoolSize(30); + dataSource.setMaximumPoolSize(9999); dataSource.setLeakDetectionThreshold(2000); dsInitializer.setDataSource(dataSource); ResourceDatabasePopulator dbPopulator = new ResourceDatabasePopulator(); diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java index 0766792..14560bf 100644 --- a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java @@ -76,47 +76,64 @@ public class ZyjhController { .eq("dc_fd", item.getDcFd()) .eq("tzbh", item.getTlth()) ); - zyjhService.update(Wrappers.lambdaUpdate() - .set(DmYdjh::getPwfkrq,date).set(DmYdjh::getPwfkry,yhdm) - .set(DmYdjh::getLldw,dwId).set(DmYdjh::getLlcs,item.getLlcs()) - .eq(DmYdjh::getDcCh, item.getDcCh()) - .eq(DmYdjh::getDcPl, item.getDcPl()) - .eq(DmYdjh::getDcFd, item.getDcFd()) - .eq(DmYdjh::getTzbh, item.getTlth())); - - ycldwInfoService.remove(Wrappers.lambdaQuery() - .eq(YcldwInfo::getCzbh, item.getDcCh()) - .eq(YcldwInfo::getPl, item.getDcPl()) - .eq(YcldwInfo::getFd, item.getDcFd()) - .eq(YcldwInfo::getTlth, item.getTlth()) - ); - - YcldwInfo ycldwInfo = new YcldwInfo(); - ycldwInfo.setDwId(dwId); - try { - ycldwInfo.setCeng(Integer.parseInt(item.getLlcs())); - }catch (Exception ignored){} - try { - ycldwInfo.setYdid(ydjh.getId()); - ycldwInfo.setKw(ydjh.getKw()); - ycldwInfo.setZl(ydjh.getZl()); - ycldwInfo.setWph(ydjh.getWpxh()); - ycldwInfo.setWlh(ydjh.getSlwlh()); - ycldwInfo.setLph(ydjh.getSllph()); - ycldwInfo.setWpgg(ydjh.getWpgg()); - ycldwInfo.setNbsbm(ydjh.getNbsbm()); - ycldwInfo.setSljhrq(ydjh.getSljhrq()); - ycldwInfo.setQgjhrq(ydjh.getQgjhrq()); - ycldwInfo.setBfr(yhms); - ycldwInfo.setBfrq(date); - }catch (Exception ignored){} - ycldwInfo.setCzbh(item.getDcCh()); - ycldwInfo.setPl(item.getDcPl()); - ycldwInfo.setFd(item.getDcFd()); - ycldwInfo.setTlth(item.getTlth()); - ycldwInfo.baifang(); - ycldwInfoService.save(ycldwInfo); + if ("返库".equals(item.getDcCh())) { + try { + DmYdjh dmYdjh = new DmYdjh(); + dmYdjh.setId(ydjh.getId()); + dmYdjh.setZt("11"); + zyjhService.updateById(dmYdjh); + + ycldwInfoService.remove(Wrappers.lambdaQuery() + .eq(YcldwInfo::getCzbh, item.getDcCh()) + .eq(YcldwInfo::getPl, item.getDcPl()) + .eq(YcldwInfo::getFd, item.getDcFd()) + .eq(YcldwInfo::getTlth, item.getTlth()) + ); + }catch (Exception ignored){} + }else { + zyjhService.update(Wrappers.lambdaUpdate() + .set(DmYdjh::getPwfkrq,date).set(DmYdjh::getPwfkry,yhdm) + .set(DmYdjh::getZt,"32") + .set(DmYdjh::getLldw,dwId).set(DmYdjh::getLlcs,item.getLlcs()) + .eq(DmYdjh::getDcCh, item.getDcCh()) + .eq(DmYdjh::getDcPl, item.getDcPl()) + .eq(DmYdjh::getDcFd, item.getDcFd()) + .eq(DmYdjh::getTzbh, item.getTlth())); + + ycldwInfoService.remove(Wrappers.lambdaQuery() + .eq(YcldwInfo::getCzbh, item.getDcCh()) + .eq(YcldwInfo::getPl, item.getDcPl()) + .eq(YcldwInfo::getFd, item.getDcFd()) + .eq(YcldwInfo::getTlth, item.getTlth()) + ); + + YcldwInfo ycldwInfo = new YcldwInfo(); + ycldwInfo.setDwId(dwId); + try { + ycldwInfo.setCeng(Integer.parseInt(item.getLlcs())); + }catch (Exception ignored){} + try { + ycldwInfo.setYdid(ydjh.getId()); + ycldwInfo.setKw(ydjh.getKw()); + ycldwInfo.setZl(ydjh.getZl()); + ycldwInfo.setWph(ydjh.getWpxh()); + ycldwInfo.setWlh(ydjh.getSlwlh()); + ycldwInfo.setLph(ydjh.getSllph()); + ycldwInfo.setWpgg(ydjh.getWpgg()); + ycldwInfo.setNbsbm(ydjh.getNbsbm()); + ycldwInfo.setSljhrq(ydjh.getSljhrq()); + ycldwInfo.setQgjhrq(ydjh.getQgjhrq()); + ycldwInfo.setBfr(yhms); + ycldwInfo.setBfrq(date); + }catch (Exception ignored){} + ycldwInfo.setCzbh(item.getDcCh()); + ycldwInfo.setPl(item.getDcPl()); + ycldwInfo.setFd(item.getDcFd()); + ycldwInfo.setTlth(item.getTlth()); + ycldwInfo.baifang(); + ycldwInfoService.save(ycldwInfo); + } }); return new ResultBean<>(); @@ -378,9 +395,11 @@ public class ZyjhController { List list = zyjhService.list(Wrappers.lambdaQuery() // .le(DmYdjh::getSljhrq, date) .eq(StrUtil.isNotEmpty(search.getZt()),DmYdjh::getZt, search.getZt()) + .eq(StrUtil.isNotEmpty(search.getSllsh()),DmYdjh::getSllsh, search.getSllsh()) .eq(StrUtil.isNotEmpty(search.getDcch()),DmYdjh::getDcCh, search.getDcch()) .eq(StrUtil.isNotEmpty(search.getDcPl()),DmYdjh::getDcPl, search.getDcPl()) .eq(StrUtil.isNotEmpty(search.getKw()),DmYdjh::getKw, search.getKw()) + ); return new ResultBean<>(list); } diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/dto/SljhSearch.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/dto/SljhSearch.java index 20c9d6b..17ad843 100644 --- a/src/main/java/com/dsic/gj_erp/controller/zyjh/dto/SljhSearch.java +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/dto/SljhSearch.java @@ -10,5 +10,6 @@ public class SljhSearch { private String dcPl; private String kw; private String sljhrq; + private String sllsh; private String zt="2"; } diff --git a/src/main/java/com/dsic/gj_erp/service/jhgk/impl/YdjhImportService.java b/src/main/java/com/dsic/gj_erp/service/jhgk/impl/YdjhImportService.java index 08be70b..fd986c1 100644 --- a/src/main/java/com/dsic/gj_erp/service/jhgk/impl/YdjhImportService.java +++ b/src/main/java/com/dsic/gj_erp/service/jhgk/impl/YdjhImportService.java @@ -16,6 +16,7 @@ import com.dsic.gj_erp.mapper.jhgk.DmSygdMxMapper; import com.dsic.gj_erp.mapper.jhgk.DmSygdxqMapper; import com.dsic.gj_erp.service.jcsj.DmBomService; import com.dsic.gj_erp.service.jcsj.DmCbxxpService; +import com.dsic.gj_erp.service.jhgk.DmSygdMxLjService; import com.dsic.gj_erp.service.pgd.PgdTzjhService; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; @@ -32,6 +33,7 @@ public class YdjhImportService extends ServiceImpl { private final DmSygdxqMapper sygdxqMapper; private final IYdjhImportService importService; private final DmBomService bomService; + private final DmSygdMxLjService ljService; private final DmCbxxpService dmCbxxpService; private final PgdTzjhService tzjhService; @@ -61,6 +63,10 @@ public class YdjhImportService extends ServiceImpl { .eq("dc_ch", item.getDcCh()) .eq("dc_pl", dcPl) ); +// ljService.remove(new QueryWrapper() +// .eq("dcch", item.getDcCh()) +// .eq("pl", dcPl) +// ); }); // List qwb = ydjhImports.stream() // .filter(YdjhImport::isAvailable) @@ -84,26 +90,39 @@ public class YdjhImportService extends ServiceImpl { String yhms= (String) request.getAttribute("yhms"); String date= DateUtil.date().toString("yyyy/MM/dd"); List tzjhList = new ArrayList<>(); + + HashMap map = new HashMap<>(); ydjhImports.stream() - .filter(item -> !StrUtil.equals(item.getExtData(), "1")) + .filter(item -> !StrUtil.equals(item.getExtData(), "1")||item.getExtData()!=null) .forEach(item->{ - String dcPl=item.getDcPl(); - if (item.getDcPl().contains("Q")) { - dcPl=item.getDcPl().replace("Q", ""); - } + YdjhImport ydjhImport = map.get(item.getDcCh() + item.getDcPl()); + if (ydjhImport==null){ + map.put(item.getDcCh() + item.getDcPl(),item); + String dcPl=item.getDcPl(); + if (item.getDcPl().contains("Q")) { + dcPl=item.getDcPl().replace("Q", ""); + } - try { - dcPl = String.format("%03d", Integer.parseInt(dcPl)); - } catch (Exception ignored) { - } - if (StrUtil.isNotEmpty(item.getDcFd())){ - String[] dcfd=item.getDcFd().split("\\."); - for(String dcFd:dcfd){ - PgdTzjh dmTzjh = PgdTzjh.of(item,dcPl, dcFd); - dmTzjh.setBzry(yhms); - dmTzjh.setBzrq(date); - tzjhList.add(dmTzjh); + try { + dcPl = String.format("%03d", Integer.parseInt(dcPl)); + } catch (Exception ignored) { } + + tzjhService.remove(Wrappers.lambdaQuery() + .eq(PgdTzjh::getCzbh,item.getDcCh()) + .eq(PgdTzjh::getPl,dcPl) + .and(it->it.isNull(PgdTzjh::getFkrq).or().eq(PgdTzjh::getFkrq,"")) + ); + + PgdTzjh dmTzjh = PgdTzjh.of(item,dcPl); + dmTzjh.setBzry(yhms); + dmTzjh.setBzrq(date); + dmTzjh.setXfry(yhms); + dmTzjh.setXfrq(date); + dmTzjh.setQfxqrqxz(item.getQfxqrqxz()); + dmTzjh.setQfxqrqdz(item.getQfxqrqdz()); + dmTzjh.setQgxqrq(item.getQgrq()); + tzjhList.add(dmTzjh); } }); tzjhService.saveBatch(tzjhList); @@ -170,8 +189,11 @@ public class YdjhImportService extends ServiceImpl { Object o = _map.get(item.getDcCh() + item.getDcPl()); if(o==null){ - _map.put(item.getDcCh() + item.getDcPl(),1); + _map.put(item.getDcCh() + item.getDcPl(),item); }else{ + item.setExtData(item.getExtData()); + item.setQfxqrqxz(item.getQfxqrqxz()); + item.setQfxqrqdz(item.getQfxqrqdz()); return; } @@ -207,6 +229,12 @@ public class YdjhImportService extends ServiceImpl { List dmSygdxqs = sygdxqMapper.selectList(Wrappers.lambdaQuery() .eq(DmSygdxq::getDcCh, item.getDcCh()).eq(DmSygdxq::getDcPl, dcPl)); + if (ObjUtil.isNotEmpty(dmSygdxqs)){ + DmSygdxq dmSygdxq = dmSygdxqs.get(0); + item.setQfxqrqxz(dmSygdxq.getXzglxq()); + item.setQfxqrqdz(dmSygdxq.getDzglxq()); + } + HashMap map = new HashMap<>(); for (DmSygdxq xq : dmSygdxqs) { String pl = xq.getDcPl(); @@ -319,6 +347,8 @@ public class YdjhImportService extends ServiceImpl { } } this.saveBatch(addList); + +// ljService.saveBatch(ljList); }); } diff --git a/src/main/resources/mappers/kban/KbanMapper.xml b/src/main/resources/mappers/kban/KbanMapper.xml index e0db5d6..c1c2785 100644 --- a/src/main/resources/mappers/kban/KbanMapper.xml +++ b/src/main/resources/mappers/kban/KbanMapper.xml @@ -213,7 +213,9 @@