|
|
|
@ -67,11 +67,10 @@ public class BomUploadServiceImpl {
|
|
|
|
|
DmCzplpNewService dmCzplpNewService;
|
|
|
|
|
@Autowired
|
|
|
|
|
DmTzjhService dmTzjhService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
DmBomService dmBomService;
|
|
|
|
|
|
|
|
|
|
public synchronized ResultBean uploadZ(MultipartFile[] file, String czbh,String pl, String isupload, HttpServletRequest req) throws IOException, CustomException, ScriptException {
|
|
|
|
|
public synchronized ResultBean uploadZ(MultipartFile[] file, String czbh, String pl, String isupload, HttpServletRequest req) throws IOException, CustomException, ScriptException {
|
|
|
|
|
String savePath = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
|
//dezt="00";
|
|
|
|
|
File destFile = null;
|
|
|
|
@ -82,19 +81,31 @@ public class BomUploadServiceImpl {
|
|
|
|
|
int xctjdel = 1;
|
|
|
|
|
int tld = 1;
|
|
|
|
|
int ldpt = 1;
|
|
|
|
|
String czbh1="";
|
|
|
|
|
String pl1="";
|
|
|
|
|
|
|
|
|
|
List<DmBom> list = dmBomService.list(new QueryWrapper<DmBom>().eq("sjch", czbh)
|
|
|
|
|
.eq(StrUtil.isNotEmpty((String) pl), "pl",pl)
|
|
|
|
|
);
|
|
|
|
|
if(list.size()>0){
|
|
|
|
|
throw new CustomException(10201, "船号"+czbh+"批量"+pl +"已经提交bom数据 不可修改");
|
|
|
|
|
String czbh1 = "";
|
|
|
|
|
String pl1 = "";
|
|
|
|
|
// List<DmBom> list = dmBomService.list(new QueryWrapper<DmBom>().eq("sjch", czbh)
|
|
|
|
|
// .eq(StrUtil.isNotEmpty((String) pl), "pl",pl)
|
|
|
|
|
// );
|
|
|
|
|
// if(list.size()>0){
|
|
|
|
|
// throw new CustomException(10201, "船号"+czbh+"批量"+pl +"已经提交bom数据 不可修改");
|
|
|
|
|
// }
|
|
|
|
|
// 判断是否导入过
|
|
|
|
|
if (isupload.equals("01")) {
|
|
|
|
|
List<DmBclqjbp> bclqmxpListOld = bclqjbpService.list(new QueryWrapper<DmBclqjbp>().eq("DC_CH", czbh)
|
|
|
|
|
.eq("DC_PL", pl)
|
|
|
|
|
);
|
|
|
|
|
if (bclqmxpListOld.size() > 0) {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
map.put("zt", "02");
|
|
|
|
|
return new ResultBean(map);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
boolean fbom = false;
|
|
|
|
|
Integer cs = null;
|
|
|
|
|
for (MultipartFile f : file) {
|
|
|
|
|
String fname = f.getOriginalFilename();
|
|
|
|
|
;
|
|
|
|
|
fname= fname.substring(fname.lastIndexOf('/') + 1);
|
|
|
|
|
fname = fname.substring(fname.lastIndexOf('/') + 1);
|
|
|
|
|
System.out.println("fname = " + fname);
|
|
|
|
|
System.out.println(f.getOriginalFilename());
|
|
|
|
|
destFile = FileUtil.file(savePath, fname);
|
|
|
|
@ -106,17 +117,12 @@ public class BomUploadServiceImpl {
|
|
|
|
|
System.out.println("lines = " + e);
|
|
|
|
|
});
|
|
|
|
|
// String delzt="00";
|
|
|
|
|
|
|
|
|
|
if (fname.contains("板材领取表")) {
|
|
|
|
|
|
|
|
|
|
int indexOfUnderscore = fname.indexOf('_');
|
|
|
|
|
|
|
|
|
|
czbh1 = fname.substring(0, indexOfUnderscore);
|
|
|
|
|
// 2. 第一个_后面批前面的字符
|
|
|
|
|
int indexOfSecondUnderscore = fname.lastIndexOf('_');
|
|
|
|
|
|
|
|
|
|
pl = fname.substring(indexOfUnderscore + 1, fname.lastIndexOf('批'));
|
|
|
|
|
|
|
|
|
|
Map map = this.bclqbUpload(lines, fname, req, isupload, bcdel);
|
|
|
|
|
bcdel++;
|
|
|
|
|
if (map.get("zt").equals("02")) {
|
|
|
|
@ -124,13 +130,10 @@ public class BomUploadServiceImpl {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (fname.contains("型材领取表")) {
|
|
|
|
|
|
|
|
|
|
int indexOfUnderscore = fname.indexOf('_');
|
|
|
|
|
|
|
|
|
|
czbh1 = fname.substring(0, indexOfUnderscore);
|
|
|
|
|
// 2. 第一个_后面批前面的字符
|
|
|
|
|
int indexOfSecondUnderscore = fname.lastIndexOf('_');
|
|
|
|
|
|
|
|
|
|
pl = fname.substring(indexOfUnderscore + 1, fname.lastIndexOf('批'));
|
|
|
|
|
Map map = this.xclqbUpload(lines, fname, req, isupload, xcdel);
|
|
|
|
|
xcdel++;
|
|
|
|
@ -139,13 +142,10 @@ public class BomUploadServiceImpl {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (fname.contains("板材统计数据")) {
|
|
|
|
|
|
|
|
|
|
int indexOfUnderscore = fname.indexOf('_');
|
|
|
|
|
|
|
|
|
|
czbh1 = fname.substring(0, indexOfUnderscore);
|
|
|
|
|
// 2. 第一个_后面批前面的字符
|
|
|
|
|
int indexOfSecondUnderscore = fname.lastIndexOf('_');
|
|
|
|
|
|
|
|
|
|
pl = fname.substring(indexOfUnderscore + 1, fname.lastIndexOf('批'));
|
|
|
|
|
Map map = this.bctjUpload(lines, fname, req, isupload, bctjdel);
|
|
|
|
|
bctjdel++;
|
|
|
|
@ -154,13 +154,10 @@ public class BomUploadServiceImpl {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (fname.contains("型材统计数据")) {
|
|
|
|
|
|
|
|
|
|
int indexOfUnderscore = fname.indexOf('_');
|
|
|
|
|
|
|
|
|
|
czbh1 = fname.substring(0, indexOfUnderscore);
|
|
|
|
|
// 2. 第一个_后面批前面的字符
|
|
|
|
|
int indexOfSecondUnderscore = fname.lastIndexOf('_');
|
|
|
|
|
|
|
|
|
|
pl = fname.substring(indexOfUnderscore + 1, fname.lastIndexOf('批'));
|
|
|
|
|
Map map = this.xctjUpload(lines, fname, req, isupload, xctjdel);
|
|
|
|
|
xctjdel++;
|
|
|
|
@ -168,15 +165,11 @@ public class BomUploadServiceImpl {
|
|
|
|
|
return new ResultBean(map);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (fname.contains("套料图")) {
|
|
|
|
|
|
|
|
|
|
int indexOfUnderscore = fname.indexOf('_');
|
|
|
|
|
|
|
|
|
|
czbh1 = fname.substring(0, indexOfUnderscore);
|
|
|
|
|
// 2. 第一个_后面批前面的字符
|
|
|
|
|
int indexOfSecondUnderscore = fname.lastIndexOf('_');
|
|
|
|
|
|
|
|
|
|
pl = fname.substring(indexOfUnderscore + 1, fname.lastIndexOf('套'));
|
|
|
|
|
Map map = this.bctltUpload(lines, fname, req, isupload, tld);
|
|
|
|
|
tld++;
|
|
|
|
@ -185,7 +178,6 @@ public class BomUploadServiceImpl {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this.ssum(fname, '-') == 3) {
|
|
|
|
|
|
|
|
|
|
int firstDashIndex = fname.indexOf("-");
|
|
|
|
|
if (firstDashIndex != -1) {
|
|
|
|
|
// 找到第二个短划线的位置,从第一个短划线的下一个位置开始搜索
|
|
|
|
@ -204,11 +196,30 @@ public class BomUploadServiceImpl {
|
|
|
|
|
}
|
|
|
|
|
// del++;
|
|
|
|
|
}
|
|
|
|
|
for (MultipartFile f : file) {
|
|
|
|
|
String fname = f.getOriginalFilename();
|
|
|
|
|
fname = fname.substring(fname.lastIndexOf('/') + 1);
|
|
|
|
|
if (fname.contains("板材统计数据")) {
|
|
|
|
|
fbom = true;
|
|
|
|
|
cs = 2;
|
|
|
|
|
}
|
|
|
|
|
if (fname.contains("型材统计数据")) {
|
|
|
|
|
fbom = true;
|
|
|
|
|
cs = 2;
|
|
|
|
|
}
|
|
|
|
|
if (fname.contains("套料图")) {
|
|
|
|
|
fbom = true;
|
|
|
|
|
cs = 3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
FileUtil.del(new File(savePath));
|
|
|
|
|
List<BomVO> dmBoms = this.insertBom( req,czbh, pl,"01");
|
|
|
|
|
Map map =new HashMap();
|
|
|
|
|
map.put("zt","01");
|
|
|
|
|
map.put("data",dmBoms);
|
|
|
|
|
List<BomVO> dmBoms = this.insertBom(req, czbh, pl, "01");
|
|
|
|
|
if (fbom) {
|
|
|
|
|
this.saveBom(req, dmBoms, czbh, pl, cs);
|
|
|
|
|
}
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
map.put("zt", "01");
|
|
|
|
|
map.put("data", dmBoms);
|
|
|
|
|
return new ResultBean(map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -277,7 +288,7 @@ public class BomUploadServiceImpl {
|
|
|
|
|
List<DmBclqmxp> bclqmxpListOld = bclqmxpService.list(new QueryWrapper<DmBclqmxp>().eq("DC_CH_z", bclqjbp.getDcCh())
|
|
|
|
|
.eq("DC_PL_z", bclqjbp.getDcPl()).eq("DELX_z", "B")
|
|
|
|
|
);
|
|
|
|
|
if (bclqmxpListOld.size() > 0 && "01".equals(zt)) {
|
|
|
|
|
if (bclqmxpListOld.size() > 0 && "01".equals(zt) && bcdel == 1) {
|
|
|
|
|
// 提示是否覆盖
|
|
|
|
|
map.put("zt", "02");
|
|
|
|
|
return map;
|
|
|
|
@ -297,7 +308,7 @@ public class BomUploadServiceImpl {
|
|
|
|
|
dezt = "01";
|
|
|
|
|
if (bclqmxpListOld.size() <= 0) {
|
|
|
|
|
} else {
|
|
|
|
|
cs = null==bclqmxpListOld.get(0).getDrcs()?0:bclqmxpListOld.get(0).getDrcs();
|
|
|
|
|
cs = null == bclqmxpListOld.get(0).getDrcs() ? 0 : bclqmxpListOld.get(0).getDrcs();
|
|
|
|
|
}
|
|
|
|
|
map.put("zt", "01");
|
|
|
|
|
} else {
|
|
|
|
@ -416,7 +427,7 @@ public class BomUploadServiceImpl {
|
|
|
|
|
// .eq("DC_ZL_z", bclqjbp.getDcZl()).eq("DC_PL_z", bclqjbp.getDcPl()).eq("DELX_z", "X"));
|
|
|
|
|
List<DmBclqmxp> bclqmxpListOld = bclqmxpService.list(new QueryWrapper<DmBclqmxp>().eq("DC_CH_z", bclqjbp.getDcCh())
|
|
|
|
|
.eq("DC_PL_z", bclqjbp.getDcPl()).eq("DELX_z", "X"));
|
|
|
|
|
if (bclqmxpListOld.size() > 0 && "01".equals(zt)) {
|
|
|
|
|
if (bclqmxpListOld.size() > 0 && "01".equals(zt) && xcdel == 1) {
|
|
|
|
|
// 提示是否覆盖
|
|
|
|
|
map.put("zt", "02");
|
|
|
|
|
return map;
|
|
|
|
@ -435,7 +446,7 @@ public class BomUploadServiceImpl {
|
|
|
|
|
);
|
|
|
|
|
if (bclqmxpListOld.size() <= 0) {
|
|
|
|
|
} else {
|
|
|
|
|
cs = null==bclqmxpListOld.get(0).getDrcs()?0:bclqmxpListOld.get(0).getDrcs();
|
|
|
|
|
cs = null == bclqmxpListOld.get(0).getDrcs() ? 0 : bclqmxpListOld.get(0).getDrcs();
|
|
|
|
|
}
|
|
|
|
|
map.put("zt", "01");
|
|
|
|
|
} else {
|
|
|
|
@ -508,15 +519,14 @@ public class BomUploadServiceImpl {
|
|
|
|
|
bclqmxp.setShmsZ(bclqjbp.getShms());
|
|
|
|
|
xh++;
|
|
|
|
|
List<DmWpjbp> list = dmWpjbpServicel.list(new QueryWrapper<DmWpjbp>().eq("WPGG", bclqmxp.getWpxh()).eq("WPXH", bclqmxp.getWpgg()).eq("WPMC", bclqmxp.getWpmc()));
|
|
|
|
|
if(list.size()<=0){
|
|
|
|
|
if (list.size() <= 0) {
|
|
|
|
|
List<DmWpjbp> list1 = dmWpjbpServicel.list(new QueryWrapper<DmWpjbp>().eq("WPGG", bclqmxp.getWpxh()).eq("WPXH", bclqmxp.getWpgg()));
|
|
|
|
|
if(list.size()<=0){
|
|
|
|
|
|
|
|
|
|
this.insertwpjbbByxcLq(bclqmxp.getWpmc(),bclqmxp.getWpgg(),bclqmxp.getWpxh(),bclqmxp.getDcChZ(),bclqmxp.getZdrZ());
|
|
|
|
|
}else{
|
|
|
|
|
if (list.size() <= 0) {
|
|
|
|
|
this.insertwpjbbByxcLq(bclqmxp.getWpmc(), bclqmxp.getWpgg(), bclqmxp.getWpxh(), bclqmxp.getDcChZ(), bclqmxp.getZdrZ());
|
|
|
|
|
} else {
|
|
|
|
|
bclqmxp.setWph(list1.get(0).getWph());
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
bclqmxp.setWph(list.get(0).getWph());
|
|
|
|
|
}
|
|
|
|
|
addmx.add(bclqmxp);
|
|
|
|
@ -538,7 +548,6 @@ public class BomUploadServiceImpl {
|
|
|
|
|
String czbh = fileName.substring(0, indexOfUnderscore);
|
|
|
|
|
// List<Dm_zhbmp> zllbs = dm_zhbmpRepository.findByBMLB("ZLLB");
|
|
|
|
|
// Map<String, String> zllbMap = zllbs.stream().collect(Collectors.toMap(Dm_zhbmp::getBmsm, Dm_zhbmp::getBM));
|
|
|
|
|
|
|
|
|
|
List<Dm_zhbmp> zllbs = dm_zhbmpRepository.findByBMLB("ZLLB");
|
|
|
|
|
List<Dm_zhbmp> kwxxs = dm_zhbmpRepository.findByBMLB("KWXX");
|
|
|
|
|
List<Dm_zhbmp> qgkws = dm_zhbmpRepository.findByBMLB("QGKW");
|
|
|
|
@ -571,7 +580,7 @@ public class BomUploadServiceImpl {
|
|
|
|
|
int cs = 0;
|
|
|
|
|
//select count(*) into:li_zl from dm_bchxylp where dc_ch =:dc_ch and dc_pl =:dc_pl and zzcj =:ls_zzcj and hxfl ='B' and tzbh = :ls_import[1];
|
|
|
|
|
List<DmBchxylp> tjListOld = bchxylpService.list(new QueryWrapper<DmBchxylp>().eq("dc_ch", czbh).eq("dc_pl", pl).eq("hxfl", "B"));
|
|
|
|
|
if (tjListOld.size() > 0 && "01".equals(zt)) {
|
|
|
|
|
if (tjListOld.size() > 0 && "01".equals(zt) && bctjdel == 1) {
|
|
|
|
|
// 提示是否覆盖
|
|
|
|
|
map.put("zt", "02");
|
|
|
|
|
return map;
|
|
|
|
@ -579,7 +588,7 @@ public class BomUploadServiceImpl {
|
|
|
|
|
bchxylpService.remove(new QueryWrapper<DmBchxylp>().eq("dc_ch", czbh).eq("dc_pl", pl).eq("hxfl", "B"));
|
|
|
|
|
if (tjListOld.size() <= 0) {
|
|
|
|
|
} else {
|
|
|
|
|
cs = null==tjListOld.get(0).getDrcs()?0:tjListOld.get(0).getDrcs();
|
|
|
|
|
cs = null == tjListOld.get(0).getDrcs() ? 0 : tjListOld.get(0).getDrcs();
|
|
|
|
|
}
|
|
|
|
|
map.put("zt", "01");
|
|
|
|
|
} else {
|
|
|
|
@ -616,24 +625,24 @@ public class BomUploadServiceImpl {
|
|
|
|
|
bchxylp.setYlzd1(ls_jgdm);
|
|
|
|
|
bchxylp.setZzcj(kw);
|
|
|
|
|
bchxylp.setDrcs(cs + 1);
|
|
|
|
|
String tzbh=splitLine[0];
|
|
|
|
|
String hxlx="";
|
|
|
|
|
if(tzbh.substring(4,5).equals("S")){
|
|
|
|
|
String tzbh = splitLine[0];
|
|
|
|
|
String hxlx = "";
|
|
|
|
|
if (tzbh.substring(4, 5).equals("S")) {
|
|
|
|
|
hxlx = "1030";
|
|
|
|
|
}else if (tzbh.substring(4,5).equals("N")){
|
|
|
|
|
} else if (tzbh.substring(4, 5).equals("N")) {
|
|
|
|
|
hxlx = "1020";
|
|
|
|
|
}
|
|
|
|
|
// 跨位
|
|
|
|
|
String s = kwxxMap.get(tzbh.substring(4,7));
|
|
|
|
|
if(StringUtils.isBlank(s)){
|
|
|
|
|
String s = kwxxMap.get(tzbh.substring(4, 7));
|
|
|
|
|
if (StringUtils.isBlank(s)) {
|
|
|
|
|
throw new CustomException(10106, fileName + "跨位信息不存在");
|
|
|
|
|
}
|
|
|
|
|
String zl = this.getZL(tzbh);
|
|
|
|
|
if(StringUtils.isBlank(zl)){
|
|
|
|
|
if (StringUtils.isBlank(zl)) {
|
|
|
|
|
throw new CustomException(10106, fileName + "组立信息不存在");
|
|
|
|
|
}
|
|
|
|
|
String zlbm = zllbMap.get(zl);
|
|
|
|
|
String zzcj = qgKwMap.get(s);
|
|
|
|
|
String zzcj = qgKwMap.get(s); //xhj
|
|
|
|
|
bchxylp.setYlzd1(hxlx);
|
|
|
|
|
bchxylp.setZzcj(zzcj);
|
|
|
|
|
bchxylp.setDcZl(zlbm);
|
|
|
|
@ -677,24 +686,24 @@ public class BomUploadServiceImpl {
|
|
|
|
|
bchxylp.setYlbh(splitLine[0].substring(1) + "S_" + i);
|
|
|
|
|
bchxylp.setYlgg(splitLine[5 + i]);
|
|
|
|
|
bchxylp.setYlggs(ylggs);
|
|
|
|
|
String tzbh=splitLine[0];
|
|
|
|
|
String hxlx="";
|
|
|
|
|
if(tzbh.substring(4,5).equals("S")){
|
|
|
|
|
String tzbh = splitLine[0];
|
|
|
|
|
String hxlx = "";
|
|
|
|
|
if (tzbh.substring(4, 5).equals("S")) {
|
|
|
|
|
hxlx = "1030";
|
|
|
|
|
}else if (tzbh.substring(4,5).equals("N")){
|
|
|
|
|
} else if (tzbh.substring(4, 5).equals("N")) {
|
|
|
|
|
hxlx = "1020";
|
|
|
|
|
}
|
|
|
|
|
// 跨位
|
|
|
|
|
String s = kwxxMap.get(tzbh.substring(4,7));
|
|
|
|
|
if(StringUtils.isBlank(s)){
|
|
|
|
|
String s = kwxxMap.get(tzbh.substring(4, 7));
|
|
|
|
|
if (StringUtils.isBlank(s)) {
|
|
|
|
|
throw new CustomException(10106, fileName + "跨位信息不存在");
|
|
|
|
|
}
|
|
|
|
|
String zl = this.getZL(tzbh);
|
|
|
|
|
if(StringUtils.isBlank(zl)){
|
|
|
|
|
if (StringUtils.isBlank(zl)) {
|
|
|
|
|
throw new CustomException(10106, fileName + "组立信息不存在");
|
|
|
|
|
}
|
|
|
|
|
String zlbm = zllbMap.get(zl);
|
|
|
|
|
String zzcj = qgKwMap.get(s);
|
|
|
|
|
String zzcj = qgKwMap.get(s); //xhj
|
|
|
|
|
bchxylp.setYlzd1(hxlx);
|
|
|
|
|
bchxylp.setZzcj(zzcj);
|
|
|
|
|
bchxylp.setDcZl(zlbm);
|
|
|
|
@ -737,7 +746,7 @@ public class BomUploadServiceImpl {
|
|
|
|
|
int cs = 0;
|
|
|
|
|
//select count(*) into:li_zl from dm_bchxylp where dc_ch =:dc_ch and dc_pl =:dc_pl and zzcj =:ls_zzcj and hxfl ='B' and tzbh = :ls_import[1];
|
|
|
|
|
List<DmBchxylp> tjListOld = bchxylpService.list(new QueryWrapper<DmBchxylp>().eq("dc_ch", czbh).eq("dc_pl", pl).eq("hxfl", "X"));
|
|
|
|
|
if (tjListOld.size() > 0 && "01".equals(zt)) {
|
|
|
|
|
if (tjListOld.size() > 0 && "01".equals(zt) && xctjdel == 1) {
|
|
|
|
|
// 提示是否覆盖
|
|
|
|
|
map.put("zt", "02");
|
|
|
|
|
return map;
|
|
|
|
@ -745,7 +754,7 @@ public class BomUploadServiceImpl {
|
|
|
|
|
bchxylpService.remove(new QueryWrapper<DmBchxylp>().eq("dc_ch", czbh).eq("dc_pl", pl).eq("hxfl", "X"));
|
|
|
|
|
if (tjListOld.size() <= 0) {
|
|
|
|
|
} else {
|
|
|
|
|
cs = null==tjListOld.get(0).getDrcs()?0:tjListOld.get(0).getDrcs();
|
|
|
|
|
cs = null == tjListOld.get(0).getDrcs() ? 0 : tjListOld.get(0).getDrcs();
|
|
|
|
|
}
|
|
|
|
|
map.put("zt", "01");
|
|
|
|
|
dezt = "01";
|
|
|
|
@ -789,27 +798,24 @@ public class BomUploadServiceImpl {
|
|
|
|
|
bchxylp.setZdrq(DateUtil.format(DateUtil.date(), "yyyy/MM/dd"));
|
|
|
|
|
bchxylp.setDrcs(cs + 1);
|
|
|
|
|
ii++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String tzbh=splitLine[0];
|
|
|
|
|
String hxlx="";
|
|
|
|
|
if(tzbh.substring(4,5).equals("S")){
|
|
|
|
|
String tzbh = splitLine[0];
|
|
|
|
|
String hxlx = "";
|
|
|
|
|
if (tzbh.substring(4, 5).equals("S")) {
|
|
|
|
|
hxlx = "1030";
|
|
|
|
|
}else if (tzbh.substring(4,5).equals("N")){
|
|
|
|
|
} else if (tzbh.substring(4, 5).equals("N")) {
|
|
|
|
|
hxlx = "1020";
|
|
|
|
|
}
|
|
|
|
|
// 跨位
|
|
|
|
|
String s = kwxxMap.get(tzbh.substring(4,7));
|
|
|
|
|
if(StringUtils.isBlank(s)){
|
|
|
|
|
String s = kwxxMap.get(tzbh.substring(4, 7));
|
|
|
|
|
if (StringUtils.isBlank(s)) {
|
|
|
|
|
throw new CustomException(10106, fileName + "跨位信息不存在");
|
|
|
|
|
}
|
|
|
|
|
String zl = this.getZL(tzbh);
|
|
|
|
|
if(StringUtils.isBlank(zl)){
|
|
|
|
|
if (StringUtils.isBlank(zl)) {
|
|
|
|
|
throw new CustomException(10106, fileName + "组立信息不存在");
|
|
|
|
|
}
|
|
|
|
|
String zlbm = zllbMap.get(zl);
|
|
|
|
|
String zzcj = qgKwMap.get(s);
|
|
|
|
|
|
|
|
|
|
String zzcj = qgKwMap.get(s); //xhj
|
|
|
|
|
bchxylp.setZzcj(zzcj);
|
|
|
|
|
bchxylp.setDcZl(zlbm);
|
|
|
|
|
adds.add(bchxylp);
|
|
|
|
@ -837,7 +843,7 @@ public class BomUploadServiceImpl {
|
|
|
|
|
Map<String, String> kwxxMap = kwxxs.stream().collect(Collectors.toMap(Dm_zhbmp::getBM, Dm_zhbmp::getBmsm));
|
|
|
|
|
Map<String, String> qgKwMap = qgkws.stream().collect(Collectors.toMap(Dm_zhbmp::getBmsm, Dm_zhbmp::getBM));
|
|
|
|
|
int cs = 0;
|
|
|
|
|
if (tltListOld.size() > 0 && "01".equals(zt)) {
|
|
|
|
|
if (tltListOld.size() > 0 && "01".equals(zt) && tld == 1) {
|
|
|
|
|
// 提示是否覆盖
|
|
|
|
|
map.put("zt", "02");
|
|
|
|
|
return map;
|
|
|
|
@ -846,7 +852,7 @@ public class BomUploadServiceImpl {
|
|
|
|
|
bchxjbpService.remove(new QueryWrapper<DmBchxjbp>().eq("dc_ch", czbh).eq("dc_pl", pl));
|
|
|
|
|
if (tltListOld.size() <= 0) {
|
|
|
|
|
} else {
|
|
|
|
|
cs = null==tltListOld.get(0).getDrcs()?0:tltListOld.get(0).getDrcs();
|
|
|
|
|
cs = null == tltListOld.get(0).getDrcs() ? 0 : tltListOld.get(0).getDrcs();
|
|
|
|
|
}
|
|
|
|
|
map.put("zt", "01");
|
|
|
|
|
} else {
|
|
|
|
@ -868,22 +874,22 @@ public class BomUploadServiceImpl {
|
|
|
|
|
hxlx = "1020";
|
|
|
|
|
}
|
|
|
|
|
// 根据图纸编号获取 手工,数控 跨位,组立,、
|
|
|
|
|
if(tzbh.substring(4,5).equals("S")){
|
|
|
|
|
if (tzbh.substring(4, 5).equals("S")) {
|
|
|
|
|
hxlx = "1030";
|
|
|
|
|
}else if(tzbh.substring(4,5).equals("N")){
|
|
|
|
|
} else if (tzbh.substring(4, 5).equals("N")) {
|
|
|
|
|
hxlx = "1020";
|
|
|
|
|
}
|
|
|
|
|
// 跨位
|
|
|
|
|
String s = kwxxMap.get(tzbh.substring(4,7));
|
|
|
|
|
if(StringUtils.isBlank(s)){
|
|
|
|
|
String s = kwxxMap.get(tzbh.substring(4, 7));
|
|
|
|
|
if (StringUtils.isBlank(s)) {
|
|
|
|
|
throw new CustomException(10106, fileName + "跨位信息不存在");
|
|
|
|
|
}
|
|
|
|
|
String zl = this.getZL(tzbh);
|
|
|
|
|
if(StringUtils.isBlank(zl)){
|
|
|
|
|
if (StringUtils.isBlank(zl)) {
|
|
|
|
|
throw new CustomException(10106, fileName + "组立信息不存在");
|
|
|
|
|
}
|
|
|
|
|
String zlbm = zllbMap.get(zl);
|
|
|
|
|
String zzcj = qgKwMap.get(s);
|
|
|
|
|
String zzcj = qgKwMap.get(s); //xhj
|
|
|
|
|
for (int i = 1; i <= ggsl; i++) {
|
|
|
|
|
DmBchxjbp bchxjbp = new DmBchxjbp();
|
|
|
|
|
String id = syService.f_getpjh("DM", "SYSTEM", "BCHX");
|
|
|
|
@ -898,7 +904,7 @@ public class BomUploadServiceImpl {
|
|
|
|
|
ll_ii++;
|
|
|
|
|
bchxjbp.setTzbh(tzbh + ll_ii);
|
|
|
|
|
}
|
|
|
|
|
if (tzbh.substring(4,5).equals("X")) {
|
|
|
|
|
if (tzbh.substring(4, 5).equals("X")) {
|
|
|
|
|
//todo
|
|
|
|
|
// li_nu = 0
|
|
|
|
|
// li_number = 0
|
|
|
|
@ -1021,7 +1027,6 @@ public class BomUploadServiceImpl {
|
|
|
|
|
public Map ljptbUpload(List<String> lines, String fileName, HttpServletRequest req, String zt, int ldpt) throws CustomException {
|
|
|
|
|
List<DmWlqd> adds = new ArrayList<>();
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
|
|
|
|
|
String czbh = "";
|
|
|
|
|
String pl = "";
|
|
|
|
|
String fd = "";
|
|
|
|
@ -1050,17 +1055,16 @@ public class BomUploadServiceImpl {
|
|
|
|
|
wlqdService.remove(new QueryWrapper<DmWlqd>().eq("dc_ch", czbh).eq("dc_pl", pl));
|
|
|
|
|
if (wlqdListOld.size() <= 0) {
|
|
|
|
|
} else {
|
|
|
|
|
cs = null==wlqdListOld.get(0).getDrcs()?0:wlqdListOld.get(0).getDrcs();
|
|
|
|
|
cs = null == wlqdListOld.get(0).getDrcs() ? 0 : wlqdListOld.get(0).getDrcs();
|
|
|
|
|
}
|
|
|
|
|
map.put("zt", "01");
|
|
|
|
|
} else {
|
|
|
|
|
map.put("zt", "01");
|
|
|
|
|
}
|
|
|
|
|
List<Dm_zhbmp> sjlxs = dm_zhbmpRepository.findByBMLB("SJLX");
|
|
|
|
|
|
|
|
|
|
Map<String, String> sjlxMap = sjlxs.stream().collect(Collectors.toMap(Dm_zhbmp::getBmsm, Dm_zhbmp::getBM));
|
|
|
|
|
wlqdService.remove(new QueryWrapper<DmWlqd>().eq("dc_ch", czbh).eq("dc_fd", fd));
|
|
|
|
|
List<Dm_zhbmp> zllbs=null;
|
|
|
|
|
List<Dm_zhbmp> zllbs = null;
|
|
|
|
|
zllbs = dm_zhbmpRepository.findByBMLB("ZLLB");
|
|
|
|
|
System.out.println("zllbs = " + zllbs);
|
|
|
|
|
Map<String, String> zllbMap1 = zllbs.stream().collect(Collectors.toMap(Dm_zhbmp::getBmsm, Dm_zhbmp::getBM));
|
|
|
|
@ -1195,9 +1199,9 @@ public class BomUploadServiceImpl {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void insertwpjbbByxcLq(String wpmc,String wpxh,String wpgg,String ch,String username){
|
|
|
|
|
String wpid= syService.f_getpjh("SS","SYSTEM","WPH");
|
|
|
|
|
DmWpjbp wpjbp= new DmWpjbp();
|
|
|
|
|
public void insertwpjbbByxcLq(String wpmc, String wpxh, String wpgg, String ch, String username) {
|
|
|
|
|
String wpid = syService.f_getpjh("SS", "SYSTEM", "WPH");
|
|
|
|
|
DmWpjbp wpjbp = new DmWpjbp();
|
|
|
|
|
wpjbp.setWph(wpid);
|
|
|
|
|
wpjbp.setWpmc(wpmc);
|
|
|
|
|
wpjbp.setWpflm("X");
|
|
|
|
@ -1223,91 +1227,94 @@ public class BomUploadServiceImpl {
|
|
|
|
|
return count;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<BomVO> insertBom( HttpServletRequest request,String dcch,String dcpl,String type ) throws CustomException {
|
|
|
|
|
|
|
|
|
|
List<DmBom> list = dmBomService.list(new QueryWrapper<DmBom>().eq("sjch", dcch)
|
|
|
|
|
.eq(StrUtil.isNotEmpty((String) dcpl), "pl",dcpl)
|
|
|
|
|
);
|
|
|
|
|
if(list.size()>0){
|
|
|
|
|
throw new CustomException(10201, "船号"+dcch+"批量"+dcpl +"已经提交bom数据 不可在此生成");
|
|
|
|
|
}
|
|
|
|
|
public List<BomVO> insertBom(HttpServletRequest request, String dcch, String dcpl, String type) throws CustomException {
|
|
|
|
|
// List<DmBom> list = dmBomService.list(new QueryWrapper<DmBom>().eq("sjch", dcch)
|
|
|
|
|
// .eq(StrUtil.isNotEmpty((String) dcpl), "pl",dcpl)
|
|
|
|
|
// );
|
|
|
|
|
// if(list.size()>0){
|
|
|
|
|
// throw new CustomException(10201, "船号"+dcch+"批量"+dcpl +"已经提交bom数据 不可在此生成");
|
|
|
|
|
// }
|
|
|
|
|
// dmBomService.remove(new QueryWrapper<DmBom>().eq("sjch",dcch).eq("pl",dcpl));
|
|
|
|
|
Map querMap= new HashMap();
|
|
|
|
|
querMap.put("dcch",dcch);
|
|
|
|
|
querMap.put("dcpl",dcpl);
|
|
|
|
|
Map querMap = new HashMap();
|
|
|
|
|
querMap.put("dcch", dcch);
|
|
|
|
|
querMap.put("dcpl", dcpl);
|
|
|
|
|
// querMap.put("delx","B");
|
|
|
|
|
// querMap.put("hxfl","B");
|
|
|
|
|
List<DmBclqmxp> bcLQlList = bclqmxpService.getBcLQlList(querMap);
|
|
|
|
|
List<DmBchxmxp> tltList = bchxmxpService.getTLTList(querMap);
|
|
|
|
|
List<DmBchxylp> bcTJlList = bchxylpService.getBcTJlList(querMap);
|
|
|
|
|
|
|
|
|
|
List<Dm_zhbmp> zllbs = dm_zhbmpRepository.findByBMLB("ZLLB");
|
|
|
|
|
List<Dm_zhbmp> kwxxs = dm_zhbmpRepository.findByBMLB("KWXX");
|
|
|
|
|
List<Dm_zhbmp> qgkws = dm_zhbmpRepository.findByBMLB("QGKW");
|
|
|
|
|
Map<String, String> zllbMap = zllbs.stream().collect(Collectors.toMap(Dm_zhbmp::getBmsm, Dm_zhbmp::getBM));
|
|
|
|
|
Map<String, String> kwxxMap = kwxxs.stream().collect(Collectors.toMap(Dm_zhbmp::getBM, Dm_zhbmp::getBmsm));
|
|
|
|
|
Map<String, String> qgKwMap = qgkws.stream().collect(Collectors.toMap(Dm_zhbmp::getBmsm, Dm_zhbmp::getBM));
|
|
|
|
|
List<BomVO> adds =new ArrayList<>();
|
|
|
|
|
for (int i = 0; i <bcLQlList.size() ; i++) {
|
|
|
|
|
BomVO bomVO=new BomVO();
|
|
|
|
|
List<BomVO> adds = new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < bcLQlList.size(); i++) {
|
|
|
|
|
BomVO bomVO = new BomVO();
|
|
|
|
|
bomVO.setBclq(bcLQlList.get(i));
|
|
|
|
|
// bomVO.setBclqs(i);
|
|
|
|
|
adds.add(bomVO);
|
|
|
|
|
bomVO.setCs(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <bcTJlList.size() ; i++) {
|
|
|
|
|
if(i==adds.size()){
|
|
|
|
|
BomVO bomVO=new BomVO();
|
|
|
|
|
for (int i = 0; i < bcTJlList.size(); ) {
|
|
|
|
|
if (i == adds.size()) {
|
|
|
|
|
BomVO bomVO = new BomVO();
|
|
|
|
|
bomVO.setTjb(bcTJlList.get(i));
|
|
|
|
|
bomVO.setCs(2);
|
|
|
|
|
adds.add(bomVO);
|
|
|
|
|
}else{
|
|
|
|
|
for(BomVO v: adds){
|
|
|
|
|
i++;
|
|
|
|
|
} else {
|
|
|
|
|
for (BomVO v : adds) {
|
|
|
|
|
v.setTjb(bcTJlList.get(i));
|
|
|
|
|
v.setCs(2);
|
|
|
|
|
i++;
|
|
|
|
|
if (i == bcTJlList.size()) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i <tltList.size() ; i++) {
|
|
|
|
|
if(i==adds.size()){
|
|
|
|
|
BomVO bomVO=new BomVO();
|
|
|
|
|
for (int i = 0; i < tltList.size(); ) {
|
|
|
|
|
if (i == adds.size()) {
|
|
|
|
|
BomVO bomVO = new BomVO();
|
|
|
|
|
bomVO.setTlt(tltList.get(i));
|
|
|
|
|
bomVO.setCs(3);
|
|
|
|
|
adds.add(bomVO);
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
for(BomVO v: adds){
|
|
|
|
|
i++;
|
|
|
|
|
} else {
|
|
|
|
|
for (BomVO v : adds) {
|
|
|
|
|
v.setTlt(tltList.get(i));
|
|
|
|
|
v.setCs(3);
|
|
|
|
|
i++;
|
|
|
|
|
if (i == tltList.size()) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
System.out.println(" = " +"tlt over" );
|
|
|
|
|
if(type.equals("01")){
|
|
|
|
|
System.out.println(" = " + "tlt over");
|
|
|
|
|
if (type.equals("01")) {
|
|
|
|
|
List<DmWlqd> ljbList = wlqdService.getLJQDList(querMap);
|
|
|
|
|
for (int i = 0; i <ljbList.size() ; i++) {
|
|
|
|
|
if(i==adds.size()){
|
|
|
|
|
BomVO bomVO=new BomVO();
|
|
|
|
|
for (int i = 0; i < ljbList.size(); ) {
|
|
|
|
|
if (i == adds.size()) {
|
|
|
|
|
BomVO bomVO = new BomVO();
|
|
|
|
|
bomVO.setLjb(ljbList.get(i));
|
|
|
|
|
bomVO.setCs(4);
|
|
|
|
|
adds.add(bomVO);
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
for(BomVO v: adds){
|
|
|
|
|
i++;
|
|
|
|
|
} else {
|
|
|
|
|
for (BomVO v : adds) {
|
|
|
|
|
v.setLjb(ljbList.get(i));
|
|
|
|
|
v.setCs(4);
|
|
|
|
|
i++;
|
|
|
|
|
if (i == ljbList.size()) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// tltList.forEach(e->{
|
|
|
|
|
// if(StringUtils.isNotBlank(e.getWpggZ())){
|
|
|
|
|
//
|
|
|
|
@ -1365,106 +1372,97 @@ public class BomUploadServiceImpl {
|
|
|
|
|
// dmBomService.insertBoms(adds);
|
|
|
|
|
return adds;
|
|
|
|
|
}
|
|
|
|
|
public List<DmBom> saveBom( HttpServletRequest request,List<BomVO>list) throws CustomException {
|
|
|
|
|
|
|
|
|
|
// List<DmBom> list = dmBomService.list(new QueryWrapper<DmBom>().eq("sjch", dcch)
|
|
|
|
|
// .eq(StrUtil.isNotEmpty((String) dcpl), "pl",dcpl)
|
|
|
|
|
// );
|
|
|
|
|
// if(list.size()>0){
|
|
|
|
|
// throw new CustomException(10201, "船号"+dcch+"批量"+dcpl +"已经提交bom数据 不可在此生成");
|
|
|
|
|
// }
|
|
|
|
|
//// dmBomService.remove(new QueryWrapper<DmBom>().eq("sjch",dcch).eq("pl",dcpl));
|
|
|
|
|
public List<DmBom> saveBom(HttpServletRequest request, List<BomVO> list, String czbh, String pl, Integer cs1) throws CustomException {
|
|
|
|
|
if (StringUtils.isNotBlank(czbh) && StringUtils.isNotBlank(pl)) {
|
|
|
|
|
List<DmBom> oloList = dmBomService.list(new QueryWrapper<DmBom>().eq("dcch", czbh)
|
|
|
|
|
.eq("pl", pl)
|
|
|
|
|
);
|
|
|
|
|
if (oloList.size() > 0) {
|
|
|
|
|
dmBomService.remove(new QueryWrapper<DmBom>().eq("dcch", czbh).eq("pl", pl));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Map querMap= new HashMap();
|
|
|
|
|
// querMap.put("dcch",dcch);
|
|
|
|
|
// querMap.put("dcpl",dcpl);
|
|
|
|
|
// querMap.put("delx","B");
|
|
|
|
|
// querMap.put("hxfl","B");
|
|
|
|
|
|
|
|
|
|
List<Dm_zhbmp> zllbs = dm_zhbmpRepository.findByBMLB("ZLLB");
|
|
|
|
|
List<Dm_zhbmp> kwxxs = dm_zhbmpRepository.findByBMLB("KWXX");
|
|
|
|
|
List<Dm_zhbmp> qgkws = dm_zhbmpRepository.findByBMLB("QGKW");
|
|
|
|
|
Map<String, String> zllbMap = zllbs.stream().collect(Collectors.toMap(Dm_zhbmp::getBmsm, Dm_zhbmp::getBM));
|
|
|
|
|
Map<String, String> kwxxMap = kwxxs.stream().collect(Collectors.toMap(Dm_zhbmp::getBM, Dm_zhbmp::getBmsm));
|
|
|
|
|
Map<String, String> qgKwMap = qgkws.stream().collect(Collectors.toMap(Dm_zhbmp::getBmsm, Dm_zhbmp::getBM));
|
|
|
|
|
List<DmBom> adds =new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
int cs= list.get(0).getCs();
|
|
|
|
|
if(2==cs){
|
|
|
|
|
|
|
|
|
|
List<DmBom> adds = new ArrayList<>();
|
|
|
|
|
int cs = list.get(0).getCs();
|
|
|
|
|
if (2 == cs) {
|
|
|
|
|
ArrayList<BomVO> collect = list.stream().collect(
|
|
|
|
|
Collectors.collectingAndThen(
|
|
|
|
|
Collectors.toCollection(
|
|
|
|
|
() -> new TreeSet<>(
|
|
|
|
|
Comparator.comparing(
|
|
|
|
|
tc -> tc.getTjb().getWpgg() + ";" + tc.getTjb().getWpxh() + ";" + tc.getTjb().getTzbh() ))), ArrayList::new));
|
|
|
|
|
collect.forEach(i->{
|
|
|
|
|
DmBchxylp e =i.getTjb();
|
|
|
|
|
if(StringUtils.isNotBlank(e.getWpgg())){
|
|
|
|
|
|
|
|
|
|
DmBom dmBom=new DmBom();
|
|
|
|
|
tc -> tc.getTjb().getWpgg() + ";" + tc.getTjb().getWpxh() + ";" + tc.getTjb().getTzbh()))), ArrayList::new));
|
|
|
|
|
collect.forEach(i -> {
|
|
|
|
|
DmBchxylp e = i.getTjb();
|
|
|
|
|
if (StringUtils.isNotBlank(e.getWpgg())) {
|
|
|
|
|
DmBom dmBom = new DmBom();
|
|
|
|
|
dmBom.setCs(2);
|
|
|
|
|
// dmBom.setQgcd(e.getYlzd4Z());
|
|
|
|
|
// dmBom.setQgcd(e.getYlzd4Z());
|
|
|
|
|
//dmBom.setHxcd(e.getHxcdZ());
|
|
|
|
|
dmBom.setTzbh(e.getTzbh());
|
|
|
|
|
// dmBom.setTlsl(e.getSl());
|
|
|
|
|
// dmBom.setTlsl(e.getSl());
|
|
|
|
|
//dmBom.setLjbh(e.getWph());
|
|
|
|
|
//dmBom.setLjsl(e.getLjslZ());
|
|
|
|
|
dmBom.setDcch(e.getDcCh());
|
|
|
|
|
dmBom.setPl(e.getDcPl());
|
|
|
|
|
//dmBom.setFd(e.getWph().substring(0,4));
|
|
|
|
|
|
|
|
|
|
dmBom.setSjch(e.getDcCh());
|
|
|
|
|
dmBom.setWpcz(e.getWpxh());
|
|
|
|
|
dmBom.setWpgg(e.getWpgg());
|
|
|
|
|
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpgg().split("\\*")[0]);
|
|
|
|
|
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpgg());
|
|
|
|
|
dmBom.setBh( new BigDecimal(e.getWpgg().split("\\*")[0]));
|
|
|
|
|
dmBom.setBh(new BigDecimal(e.getWpgg().split("\\*")[0]));
|
|
|
|
|
dmBom.setBc(new BigDecimal(e.getWpgg().split("\\*")[2]));
|
|
|
|
|
String tzbh=e.getTzbh();
|
|
|
|
|
String hxlx="";
|
|
|
|
|
String tzbh = e.getTzbh();
|
|
|
|
|
String hxlx = "";
|
|
|
|
|
// 根据图纸编号获取 手工,数控 跨位,组立,、
|
|
|
|
|
if(tzbh.substring(4,5).equals("S")){
|
|
|
|
|
if (tzbh.substring(4, 5).equals("S")) {
|
|
|
|
|
hxlx = "1030";
|
|
|
|
|
}else if(tzbh.substring(4,5).equals("N")){
|
|
|
|
|
} else if (tzbh.substring(4, 5).equals("N")) {
|
|
|
|
|
hxlx = "1020";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 跨位
|
|
|
|
|
String s = kwxxMap.get(tzbh.substring(4,7));
|
|
|
|
|
|
|
|
|
|
String s = kwxxMap.get(tzbh.substring(4, 7));
|
|
|
|
|
String zl = this.getZL(tzbh);
|
|
|
|
|
|
|
|
|
|
String zlbm = zllbMap.get(zl);
|
|
|
|
|
String zzcj = qgKwMap.get(s);
|
|
|
|
|
dmBom.setZl(zlbm);
|
|
|
|
|
dmBom.setKw(zzcj);
|
|
|
|
|
dmBom.setLqlb(hxlx);
|
|
|
|
|
// 领取表找打 fds
|
|
|
|
|
if(e.getHxfl().equals("B")){
|
|
|
|
|
if (e.getHxfl().equals("B")) {
|
|
|
|
|
List<BomVO> collect11 = list.stream().filter(fst -> fst.getBclq().getWpgg().equals(e.getWpgg()) &&
|
|
|
|
|
fst.getBclq().getWpxh().equals(e.getWpxh())
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
if(collect11.size()>0){
|
|
|
|
|
if (collect11.size() > 0) {
|
|
|
|
|
dmBom.setFds(collect11.get(0).getBclq().getDcFdZ());
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
List<BomVO> collect11 = list.stream().filter(fst -> fst.getBclq().getWpxh().equals(e.getWpgg()) &&
|
|
|
|
|
fst.getBclq().getWpgg().equals(e.getWpxh())
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
if(collect11.size()>0){
|
|
|
|
|
if (collect11.size() > 0) {
|
|
|
|
|
dmBom.setFds(collect11.get(0).getBclq().getDcFdZ());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
adds.add(dmBom);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
list.forEach(i->{
|
|
|
|
|
DmBchxmxp e =i.getTlt();
|
|
|
|
|
if(StringUtils.isNotBlank(e.getWpggZ())){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DmBom dmBom=new DmBom();
|
|
|
|
|
} else {
|
|
|
|
|
list.forEach(i -> {
|
|
|
|
|
DmBchxmxp e = i.getTlt();
|
|
|
|
|
if (StringUtils.isNotBlank(e.getWpggZ())) {
|
|
|
|
|
DmBom dmBom = new DmBom();
|
|
|
|
|
dmBom.setCs(3);
|
|
|
|
|
dmBom.setQgcd(e.getYlzd4Z());
|
|
|
|
|
dmBom.setHxcd(e.getHxcdZ());
|
|
|
|
@ -1474,29 +1472,26 @@ public class BomUploadServiceImpl {
|
|
|
|
|
dmBom.setLjsl(e.getLjslZ());
|
|
|
|
|
dmBom.setDcch(e.getDcChZ());
|
|
|
|
|
dmBom.setPl(e.getDcPlZ());
|
|
|
|
|
dmBom.setFd(e.getWph().substring(0,4));
|
|
|
|
|
|
|
|
|
|
dmBom.setFd(e.getWph().substring(0, 4));
|
|
|
|
|
dmBom.setSjch(e.getDcChZ());
|
|
|
|
|
dmBom.setWpcz(e.getWpxhZ());
|
|
|
|
|
dmBom.setWpgg(e.getWpggZ());
|
|
|
|
|
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpggZ().split("\\*")[0]);
|
|
|
|
|
System.out.println("e.getWpggZ().split(\"\\\\*\")[0] = " + e.getWpggZ());
|
|
|
|
|
dmBom.setBh( new BigDecimal(e.getWpggZ().split("\\*")[0]));
|
|
|
|
|
dmBom.setBh(new BigDecimal(e.getWpggZ().split("\\*")[0]));
|
|
|
|
|
dmBom.setBc(new BigDecimal(e.getWpggZ().split("\\*")[2]));
|
|
|
|
|
String tzbh=e.getTzbhZ();
|
|
|
|
|
String hxlx="";
|
|
|
|
|
String tzbh = e.getTzbhZ();
|
|
|
|
|
String hxlx = "";
|
|
|
|
|
// 根据图纸编号获取 手工,数控 跨位,组立,、
|
|
|
|
|
if(tzbh.substring(4,5).equals("S")){
|
|
|
|
|
if (tzbh.substring(4, 5).equals("S")) {
|
|
|
|
|
hxlx = "1030";
|
|
|
|
|
}else if(tzbh.substring(4,5).equals("N")){
|
|
|
|
|
} else if (tzbh.substring(4, 5).equals("N")) {
|
|
|
|
|
hxlx = "1020";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 跨位
|
|
|
|
|
System.out.println("tzbh = " + tzbh);
|
|
|
|
|
String s = kwxxMap.get(tzbh.substring(4,7));
|
|
|
|
|
|
|
|
|
|
String s = kwxxMap.get(tzbh.substring(4, 7));
|
|
|
|
|
String zl = this.getZL(tzbh);
|
|
|
|
|
|
|
|
|
|
String zlbm = zllbMap.get(zl);
|
|
|
|
|
String zzcj = qgKwMap.get(s);
|
|
|
|
|
dmBom.setZl(zlbm);
|
|
|
|
@ -1506,44 +1501,34 @@ public class BomUploadServiceImpl {
|
|
|
|
|
adds.add(dmBom);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dmBomService.insertBoms(adds);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return adds;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 根据套料图号得到组立信息。
|
|
|
|
|
public String getZL(String tzbh){
|
|
|
|
|
String bh=tzbh.substring(6,8);
|
|
|
|
|
if (tzbh.substring(4,5).equals("X")) {
|
|
|
|
|
if("XX".equalsIgnoreCase(bh)){
|
|
|
|
|
return "小组立";
|
|
|
|
|
}else if ("XD".equalsIgnoreCase(bh)){
|
|
|
|
|
return "中大组立";
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if("XX".equalsIgnoreCase(bh)){
|
|
|
|
|
public String getZL(String tzbh) {
|
|
|
|
|
String bh = tzbh.substring(6, 8);
|
|
|
|
|
if (tzbh.substring(4, 5).equals("X")) {
|
|
|
|
|
if ("XX".equalsIgnoreCase(bh)) {
|
|
|
|
|
return "小组立";
|
|
|
|
|
} else if ("XD".equalsIgnoreCase(bh)) {
|
|
|
|
|
return "中大组立";
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if ("XX".equalsIgnoreCase(bh)) {
|
|
|
|
|
return "焊接机器人肘板";
|
|
|
|
|
}else if ("GX".equalsIgnoreCase(bh)){
|
|
|
|
|
} else if ("GX".equalsIgnoreCase(bh)) {
|
|
|
|
|
return "光电";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
String bh1=tzbh.substring(7,8);
|
|
|
|
|
if("X".equalsIgnoreCase(bh1)){
|
|
|
|
|
return"小组立";
|
|
|
|
|
String bh1 = tzbh.substring(7, 8);
|
|
|
|
|
if ("X".equalsIgnoreCase(bh1)) {
|
|
|
|
|
return "小组立";
|
|
|
|
|
}
|
|
|
|
|
if("D".equalsIgnoreCase(bh1)){
|
|
|
|
|
return"中大组立";
|
|
|
|
|
if ("D".equalsIgnoreCase(bh1)) {
|
|
|
|
|
return "中大组立";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|