Merge remote-tracking branch 'origin/master'

master
xhj 5 months ago
commit f634feb572

@ -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,

@ -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;

@ -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;
}

@ -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();

@ -76,47 +76,64 @@ public class ZyjhController {
.eq("dc_fd", item.getDcFd())
.eq("tzbh", item.getTlth())
);
zyjhService.update(Wrappers.<DmYdjh>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.<YcldwInfo>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.<YcldwInfo>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.<DmYdjh>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.<YcldwInfo>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<DmYdjh> list = zyjhService.list(Wrappers.<DmYdjh>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);
}

@ -10,5 +10,6 @@ public class SljhSearch {
private String dcPl;
private String kw;
private String sljhrq;
private String sllsh;
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.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<DmSygdMxMapper, DmSygdMx> {
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<DmSygdMxMapper, DmSygdMx> {
.eq("dc_ch", item.getDcCh())
.eq("dc_pl", dcPl)
);
// ljService.remove(new QueryWrapper<DmSygdMxLj>()
// .eq("dcch", item.getDcCh())
// .eq("pl", dcPl)
// );
});
// List<YdjhImport> qwb = ydjhImports.stream()
// .filter(YdjhImport::isAvailable)
@ -84,26 +90,39 @@ public class YdjhImportService extends ServiceImpl<DmSygdMxMapper, DmSygdMx> {
String yhms= (String) request.getAttribute("yhms");
String date= DateUtil.date().toString("yyyy/MM/dd");
List<PgdTzjh> tzjhList = new ArrayList<>();
HashMap<String, YdjhImport> 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.<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);
@ -170,8 +189,11 @@ public class YdjhImportService extends ServiceImpl<DmSygdMxMapper, DmSygdMx> {
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<DmSygdMxMapper, DmSygdMx> {
List<DmSygdxq> dmSygdxqs = sygdxqMapper.selectList(Wrappers.<DmSygdxq>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<Object, DmSygdxq> map = new HashMap<>();
for (DmSygdxq xq : dmSygdxqs) {
String pl = xq.getDcPl();
@ -319,6 +347,8 @@ public class YdjhImportService extends ServiceImpl<DmSygdMxMapper, DmSygdMx> {
}
}
this.saveBatch(addList);
// ljService.saveBatch(ljList);
});
}

@ -213,7 +213,9 @@
</select>
<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 id="zrcpcsl" resultType="java.util.Map">

Loading…
Cancel
Save