|
|
@ -1149,7 +1149,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String jgProductionIsScrap(String abnormalNo,String site,String sfc) {
|
|
|
|
public Map<String, String> jgProductionIsScrap(String abnormalNo, String site, String sfc) {
|
|
|
|
//查询该sfc在质量异常异常方案是否是报废,如果是,则大于1
|
|
|
|
//查询该sfc在质量异常异常方案是否是报废,如果是,则大于1
|
|
|
|
String abnormalBo = null;
|
|
|
|
String abnormalBo = null;
|
|
|
|
if(!StringUtils.isBlank(abnormalNo)){
|
|
|
|
if(!StringUtils.isBlank(abnormalNo)){
|
|
|
@ -1164,7 +1164,13 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
site = CommonMethods.getSite();
|
|
|
|
site = CommonMethods.getSite();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//根据用户提报上来的sfc和异常单查找主SFC
|
|
|
|
//根据用户提报上来的sfc和异常单查找主SFC
|
|
|
|
String mainSfc = this.jgProductionIsScrap(abnormalNo, site, sfc);
|
|
|
|
Map<String, String> map = this.jgProductionIsScrap(abnormalNo, site, sfc);
|
|
|
|
|
|
|
|
String mainSfc = null;
|
|
|
|
|
|
|
|
String abnormalBo = null;
|
|
|
|
|
|
|
|
if(map != null){
|
|
|
|
|
|
|
|
mainSfc = map.get("SFC");
|
|
|
|
|
|
|
|
abnormalBo = map.get("HANDLE");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<SplitSfc> splitSfcs = null;
|
|
|
|
List<SplitSfc> splitSfcs = null;
|
|
|
|
SplitSfc splitSfc = new SplitSfc();
|
|
|
|
SplitSfc splitSfc = new SplitSfc();
|
|
|
@ -1181,7 +1187,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
splitSfc.setSplitSfc(sfc);
|
|
|
|
splitSfc.setSplitSfc(sfc);
|
|
|
|
splitSfcs = splitSfcService.selectList(splitSfc);
|
|
|
|
splitSfcs = splitSfcService.selectList(splitSfc);
|
|
|
|
if(splitSfcs.size()>0){
|
|
|
|
if(splitSfcs.size()>0){
|
|
|
|
mainSfc = this.jgProductionIsScrap(abnormalNo, site, splitSfcs.get(0).getSfc());
|
|
|
|
Map<String, String> map1 = this.jgProductionIsScrap(abnormalNo, site, splitSfcs.get(0).getSfc());
|
|
|
|
|
|
|
|
mainSfc = map1.get("SFC");
|
|
|
|
|
|
|
|
abnormalBo = map1.get("HANDLE");
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
if(!StringUtil.isBlank(sfc) && !StringUtil.isBlank(abnormalNo)){
|
|
|
|
if(!StringUtil.isBlank(sfc) && !StringUtil.isBlank(abnormalNo)){
|
|
|
|
throw new BaseException("该异常单下的产品条码不是报废");
|
|
|
|
throw new BaseException("该异常单下的产品条码不是报废");
|
|
|
@ -1194,18 +1202,31 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
splitSfcs = splitSfcService.selectList(splitSfc);
|
|
|
|
splitSfcs = splitSfcService.selectList(splitSfc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<ScrapDto> scrapDtoBySfc = abnormalBillMapper.findScrapDtoBySfc(site, mainSfc,splitSfcs);
|
|
|
|
List<ScrapDto> scrapDtoBySfc = abnormalBillMapper.findScrapDtoBySfc(site, mainSfc,splitSfcs);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//如果用户提报上来的sfc不为空,并且不是主sfc,则把主sfc从scrapDtoBySfc去掉
|
|
|
|
//如果用户提报上来的sfc不为空,并且不是主sfc,则把主sfc从scrapDtoBySfc去掉
|
|
|
|
if(!StringUtil.isBlank(sfc) && !sfc.equals(mainSfc)){
|
|
|
|
if(!StringUtil.isBlank(sfc) && !sfc.equals(mainSfc)){
|
|
|
|
for(ScrapDto scrap:scrapDtoBySfc){
|
|
|
|
for (int i = 0; i < scrapDtoBySfc.size(); i++) {
|
|
|
|
if(scrap.getSfc().equals(mainSfc)){
|
|
|
|
if(scrapDtoBySfc.get(i).getSfc().equals(mainSfc)){
|
|
|
|
scrapDtoBySfc.remove(scrap);
|
|
|
|
scrapDtoBySfc.remove(scrapDtoBySfc.get(i));
|
|
|
|
break;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(scrapDtoBySfc.size() <= 0){
|
|
|
|
if(scrapDtoBySfc.size() <= 0){
|
|
|
|
throw new BaseException("该产品条码的异常方案不是报废");
|
|
|
|
throw new BaseException("该产品条码的异常方案不是报废");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查找到责任人,放到表里
|
|
|
|
|
|
|
|
AbnormalBillDispose abnormalBillDispose = new AbnormalBillDispose();
|
|
|
|
|
|
|
|
abnormalBillDispose.setAbnormalBillBo(abnormalBo);
|
|
|
|
|
|
|
|
List<AbnormalBillDispose> abnormalBillDisposes = abnormalBillDisposeService.selectList(abnormalBillDispose);
|
|
|
|
|
|
|
|
if(abnormalBillDisposes.size() > 0){
|
|
|
|
|
|
|
|
for (int i = 0; i < scrapDtoBySfc.size(); i++) {
|
|
|
|
|
|
|
|
scrapDtoBySfc.get(i).setDutyUser(abnormalBillDisposes.get(0).getPrincipalUser());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return scrapDtoBySfc;
|
|
|
|
return scrapDtoBySfc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|