Merge remote-tracking branch 'origin/master'

master
xhj 5 months ago
commit f634feb572

@ -112,6 +112,9 @@ public class YdjhImport {
@TableField(exist = false) @TableField(exist = false)
private Boolean qwbBs; private Boolean qwbBs;
@TableField(exist = false)
private String qgrq;
public boolean isAvailable(){ public boolean isAvailable(){
return !StrUtil.isAllEmpty(this.sl,this.xcpw,this.pw,this.dbqgks,this.ykpkjs,this.lmqgks,this.lmqgjs, 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, this.ekskks,this.ekpkjs,this.skskqgks,this.skpkjs,this.ptks,this.ptjs,this.qpt_zjs,this.qptjs,

@ -80,13 +80,13 @@ public class PgdTzjh implements Serializable {
private String fkry; 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(); PgdTzjh tzjh = new PgdTzjh();
tzjh.setCzbh(jh.getDcCh()); tzjh.setCzbh(jh.getDcCh());
tzjh.setPl(pl); tzjh.setPl(pl);
tzjh.setQfxqrqxz(jh.getQfxqrqxz()); tzjh.setQfxqrqxz(jh.getQfxqrqxz());
tzjh.setQfxqrqdz(jh.getQfxqrqdz()); tzjh.setQfxqrqdz(jh.getQfxqrqdz());
tzjh.setFd(fd); // tzjh.setFd(fd);
tzjh.setZt("01"); tzjh.setZt("01");
// tzjh.setTzzt("0"); // tzjh.setTzzt("0");
return tzjh; return tzjh;

@ -14,7 +14,7 @@ public class PwExcel {
@ExcelProperty(value = "批量") @ExcelProperty(value = "批量")
public String dcPl; public String dcPl;
@ExcelProperty(value = "分段",index = 5) @ExcelProperty(value = "分段")
public String dcFd; public String dcFd;
@ExcelProperty(value = "套料图号") @ExcelProperty(value = "套料图号")
@ -26,7 +26,10 @@ public class PwExcel {
@ExcelProperty(value = "理料垛位") @ExcelProperty(value = "理料垛位")
public String lldw; public String lldw;
@ExcelProperty(value = "层数") @ExcelProperty(value = "理料层数")
private String llcs; private String llcs;
@ExcelProperty(value = "状态")
private String zt;
} }

@ -91,7 +91,7 @@ public class JapConfig {
public DataSourceInitializer manDataSourceInitializer() {//6 public DataSourceInitializer manDataSourceInitializer() {//6
DataSourceInitializer dsInitializer = new DataSourceInitializer(); DataSourceInitializer dsInitializer = new DataSourceInitializer();
HikariDataSource dataSource = (HikariDataSource) jpaDataSource(); HikariDataSource dataSource = (HikariDataSource) jpaDataSource();
dataSource.setMaximumPoolSize(30); dataSource.setMaximumPoolSize(9999);
dataSource.setLeakDetectionThreshold(2000); dataSource.setLeakDetectionThreshold(2000);
dsInitializer.setDataSource(dataSource); dsInitializer.setDataSource(dataSource);
ResourceDatabasePopulator dbPopulator = new ResourceDatabasePopulator(); ResourceDatabasePopulator dbPopulator = new ResourceDatabasePopulator();

@ -76,47 +76,64 @@ public class ZyjhController {
.eq("dc_fd", item.getDcFd()) .eq("dc_fd", item.getDcFd())
.eq("tzbh", item.getTlth()) .eq("tzbh", item.getTlth())
); );
zyjhService.update(Wrappers.<DmYdjh>lambdaUpdate() if ("返库".equals(item.getDcCh())) {
.set(DmYdjh::getPwfkrq,date).set(DmYdjh::getPwfkry,yhdm) try {
.set(DmYdjh::getLldw,dwId).set(DmYdjh::getLlcs,item.getLlcs()) DmYdjh dmYdjh = new DmYdjh();
.eq(DmYdjh::getDcCh, item.getDcCh()) dmYdjh.setId(ydjh.getId());
.eq(DmYdjh::getDcPl, item.getDcPl()) dmYdjh.setZt("11");
.eq(DmYdjh::getDcFd, item.getDcFd()) zyjhService.updateById(dmYdjh);
.eq(DmYdjh::getTzbh, item.getTlth()));
ycldwInfoService.remove(Wrappers.<YcldwInfo>lambdaQuery()
ycldwInfoService.remove(Wrappers.<YcldwInfo>lambdaQuery() .eq(YcldwInfo::getCzbh, item.getDcCh())
.eq(YcldwInfo::getCzbh, item.getDcCh()) .eq(YcldwInfo::getPl, item.getDcPl())
.eq(YcldwInfo::getPl, item.getDcPl()) .eq(YcldwInfo::getFd, item.getDcFd())
.eq(YcldwInfo::getFd, item.getDcFd()) .eq(YcldwInfo::getTlth, item.getTlth())
.eq(YcldwInfo::getTlth, item.getTlth()) );
); }catch (Exception ignored){}
}else {
YcldwInfo ycldwInfo = new YcldwInfo(); zyjhService.update(Wrappers.<DmYdjh>lambdaUpdate()
ycldwInfo.setDwId(dwId); .set(DmYdjh::getPwfkrq,date).set(DmYdjh::getPwfkry,yhdm)
try { .set(DmYdjh::getZt,"32")
ycldwInfo.setCeng(Integer.parseInt(item.getLlcs())); .set(DmYdjh::getLldw,dwId).set(DmYdjh::getLlcs,item.getLlcs())
}catch (Exception ignored){} .eq(DmYdjh::getDcCh, item.getDcCh())
try { .eq(DmYdjh::getDcPl, item.getDcPl())
ycldwInfo.setYdid(ydjh.getId()); .eq(DmYdjh::getDcFd, item.getDcFd())
ycldwInfo.setKw(ydjh.getKw()); .eq(DmYdjh::getTzbh, item.getTlth()));
ycldwInfo.setZl(ydjh.getZl());
ycldwInfo.setWph(ydjh.getWpxh()); ycldwInfoService.remove(Wrappers.<YcldwInfo>lambdaQuery()
ycldwInfo.setWlh(ydjh.getSlwlh()); .eq(YcldwInfo::getCzbh, item.getDcCh())
ycldwInfo.setLph(ydjh.getSllph()); .eq(YcldwInfo::getPl, item.getDcPl())
ycldwInfo.setWpgg(ydjh.getWpgg()); .eq(YcldwInfo::getFd, item.getDcFd())
ycldwInfo.setNbsbm(ydjh.getNbsbm()); .eq(YcldwInfo::getTlth, item.getTlth())
ycldwInfo.setSljhrq(ydjh.getSljhrq()); );
ycldwInfo.setQgjhrq(ydjh.getQgjhrq());
ycldwInfo.setBfr(yhms); YcldwInfo ycldwInfo = new YcldwInfo();
ycldwInfo.setBfrq(date); ycldwInfo.setDwId(dwId);
}catch (Exception ignored){} try {
ycldwInfo.setCzbh(item.getDcCh()); ycldwInfo.setCeng(Integer.parseInt(item.getLlcs()));
ycldwInfo.setPl(item.getDcPl()); }catch (Exception ignored){}
ycldwInfo.setFd(item.getDcFd()); try {
ycldwInfo.setTlth(item.getTlth()); ycldwInfo.setYdid(ydjh.getId());
ycldwInfo.baifang(); ycldwInfo.setKw(ydjh.getKw());
ycldwInfoService.save(ycldwInfo); 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<>(); return new ResultBean<>();
@ -378,9 +395,11 @@ public class ZyjhController {
List<DmYdjh> list = zyjhService.list(Wrappers.<DmYdjh>lambdaQuery() List<DmYdjh> list = zyjhService.list(Wrappers.<DmYdjh>lambdaQuery()
// .le(DmYdjh::getSljhrq, date) // .le(DmYdjh::getSljhrq, date)
.eq(StrUtil.isNotEmpty(search.getZt()),DmYdjh::getZt, search.getZt()) .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.getDcch()),DmYdjh::getDcCh, search.getDcch())
.eq(StrUtil.isNotEmpty(search.getDcPl()),DmYdjh::getDcPl, search.getDcPl()) .eq(StrUtil.isNotEmpty(search.getDcPl()),DmYdjh::getDcPl, search.getDcPl())
.eq(StrUtil.isNotEmpty(search.getKw()),DmYdjh::getKw, search.getKw()) .eq(StrUtil.isNotEmpty(search.getKw()),DmYdjh::getKw, search.getKw())
); );
return new ResultBean<>(list); return new ResultBean<>(list);
} }

@ -10,5 +10,6 @@ public class SljhSearch {
private String dcPl; private String dcPl;
private String kw; private String kw;
private String sljhrq; private String sljhrq;
private String sllsh;
private String zt="2"; private String zt="2";
} }

@ -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.mapper.jhgk.DmSygdxqMapper;
import com.dsic.gj_erp.service.jcsj.DmBomService; import com.dsic.gj_erp.service.jcsj.DmBomService;
import com.dsic.gj_erp.service.jcsj.DmCbxxpService; 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 com.dsic.gj_erp.service.pgd.PgdTzjhService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -32,6 +33,7 @@ public class YdjhImportService extends ServiceImpl<DmSygdMxMapper, DmSygdMx> {
private final DmSygdxqMapper sygdxqMapper; private final DmSygdxqMapper sygdxqMapper;
private final IYdjhImportService importService; private final IYdjhImportService importService;
private final DmBomService bomService; private final DmBomService bomService;
private final DmSygdMxLjService ljService;
private final DmCbxxpService dmCbxxpService; private final DmCbxxpService dmCbxxpService;
private final PgdTzjhService tzjhService; private final PgdTzjhService tzjhService;
@ -61,6 +63,10 @@ public class YdjhImportService extends ServiceImpl<DmSygdMxMapper, DmSygdMx> {
.eq("dc_ch", item.getDcCh()) .eq("dc_ch", item.getDcCh())
.eq("dc_pl", dcPl) .eq("dc_pl", dcPl)
); );
// ljService.remove(new QueryWrapper<DmSygdMxLj>()
// .eq("dcch", item.getDcCh())
// .eq("pl", dcPl)
// );
}); });
// List<YdjhImport> qwb = ydjhImports.stream() // List<YdjhImport> qwb = ydjhImports.stream()
// .filter(YdjhImport::isAvailable) // .filter(YdjhImport::isAvailable)
@ -84,26 +90,39 @@ public class YdjhImportService extends ServiceImpl<DmSygdMxMapper, DmSygdMx> {
String yhms= (String) request.getAttribute("yhms"); String yhms= (String) request.getAttribute("yhms");
String date= DateUtil.date().toString("yyyy/MM/dd"); String date= DateUtil.date().toString("yyyy/MM/dd");
List<PgdTzjh> tzjhList = new ArrayList<>(); List<PgdTzjh> tzjhList = new ArrayList<>();
HashMap<String, YdjhImport> map = new HashMap<>();
ydjhImports.stream() ydjhImports.stream()
.filter(item -> !StrUtil.equals(item.getExtData(), "1")) .filter(item -> !StrUtil.equals(item.getExtData(), "1")||item.getExtData()!=null)
.forEach(item->{ .forEach(item->{
String dcPl=item.getDcPl(); YdjhImport ydjhImport = map.get(item.getDcCh() + item.getDcPl());
if (item.getDcPl().contains("Q")) { if (ydjhImport==null){
dcPl=item.getDcPl().replace("Q", ""); map.put(item.getDcCh() + item.getDcPl(),item);
} String dcPl=item.getDcPl();
if (item.getDcPl().contains("Q")) {
dcPl=item.getDcPl().replace("Q", "");
}
try { try {
dcPl = String.format("%03d", Integer.parseInt(dcPl)); dcPl = String.format("%03d", Integer.parseInt(dcPl));
} catch (Exception ignored) { } 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);
} }
tzjhService.remove(Wrappers.<PgdTzjh>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); tzjhService.saveBatch(tzjhList);
@ -170,8 +189,11 @@ public class YdjhImportService extends ServiceImpl<DmSygdMxMapper, DmSygdMx> {
Object o = _map.get(item.getDcCh() + item.getDcPl()); Object o = _map.get(item.getDcCh() + item.getDcPl());
if(o==null){ if(o==null){
_map.put(item.getDcCh() + item.getDcPl(),1); _map.put(item.getDcCh() + item.getDcPl(),item);
}else{ }else{
item.setExtData(item.getExtData());
item.setQfxqrqxz(item.getQfxqrqxz());
item.setQfxqrqdz(item.getQfxqrqdz());
return; return;
} }
@ -207,6 +229,12 @@ public class YdjhImportService extends ServiceImpl<DmSygdMxMapper, DmSygdMx> {
List<DmSygdxq> dmSygdxqs = sygdxqMapper.selectList(Wrappers.<DmSygdxq>lambdaQuery() List<DmSygdxq> dmSygdxqs = sygdxqMapper.selectList(Wrappers.<DmSygdxq>lambdaQuery()
.eq(DmSygdxq::getDcCh, item.getDcCh()).eq(DmSygdxq::getDcPl, dcPl)); .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<Object, DmSygdxq> map = new HashMap<>(); HashMap<Object, DmSygdxq> map = new HashMap<>();
for (DmSygdxq xq : dmSygdxqs) { for (DmSygdxq xq : dmSygdxqs) {
String pl = xq.getDcPl(); String pl = xq.getDcPl();
@ -319,6 +347,8 @@ public class YdjhImportService extends ServiceImpl<DmSygdMxMapper, DmSygdMx> {
} }
} }
this.saveBatch(addList); this.saveBatch(addList);
// ljService.saveBatch(ljList);
}); });
} }

@ -213,7 +213,9 @@
</select> </select>
<select id="getProjects" resultType="java.util.Map"> <select id="getProjects" resultType="java.util.Map">
SELECT dcch dcCh,pl dcPl from (SELECT dcch ,pl ,ROW_NUMBER() over(PARTITION by dcch,pl order by dcch,pl) rn from dm_bom ) a where a.rn=1 SELECT dcch dcCh,pl dcPl
from (SELECT dcch ,pl ,ROW_NUMBER() over(PARTITION by dcch,pl order by dcch,pl) rn from dm_bom ) a
where a.rn=1
</select> </select>
<select id="zrcpcsl" resultType="java.util.Map"> <select id="zrcpcsl" resultType="java.util.Map">

Loading…
Cancel
Save