This commit is contained in:
lihao 2025-08-13 14:13:41 +08:00
parent e4278e30cb
commit b93cbb0ec4
2 changed files with 36 additions and 9 deletions

View File

@ -174,20 +174,47 @@ public class PickmToBuyingreqAction implements ICommonAction {
if(null == materalType){ if(null == materalType){
// MR=制造件; // MR=制造件;
// PR=采购件; // PR=采购件;
String sql = " select martype from bd_materialstock where pk_material='" + child.getCbmaterialvid() + "' and pk_org='"+child.getPk_org()+"' and dr=0"; // 1=制造件;
// 2=采购件;
String sql = " select cmaterialvid from mm_pickm where cpickmid='" + child.getCpickmid() + "' and dr=0";
BaseDAO dao = new BaseDAO(); BaseDAO dao = new BaseDAO();
materalType = (String) dao.executeQuery(sql, new ColumnProcessor()); String hmateral = (String) dao.executeQuery(sql, new ColumnProcessor());
if(null == materalType || "MR".equals(materalType) || "".equals(materalType) ){
sql="SELECT\n" +
"\n" +
" bd_defdoc.code \n" +
"FROM\n" +
" bd_bom_b \n" +
" LEFT JOIN bd_defdoc ON bd_bom_b.vdef1 = bd_defdoc.pk_defdoc\n" +
"WHERE\n" +
" bd_bom_b.cbomid in (select distinct bd_bom.cbomid from bd_bom bd_bom where ( bd_bom.pk_org = '"+child.getPk_org()+"' AND bd_bom.hcmaterialid = '"+hmateral+"' AND bd_bom.hfbomcategory = 1 AND bd_bom.hbcustomized = 'N' ) and bd_bom.dr = 0 and bd_bom.hbcustomized = 'N' and bd_bom.fbomtype != 3 ) \n" +
" AND bd_bom_b.dr = 0 and bd_bom_b.cmaterialvid='" + child.getCbmaterialvid() + "'";
String bomcode = (String) dao.executeQuery(sql, new ColumnProcessor());
// MR=制造件;
// PR=采购件;
if(null != bomcode && "2".equals(bomcode) ){
sql = " select martype from bd_materialstock where pk_material='" + child.getCbmaterialvid() + "' and pk_org='"+child.getPk_org()+"' and dr=0";
String matType = (String) dao.executeQuery(sql, new ColumnProcessor());
if(null == matType || "PR".equals(matType) || "".equals(matType)){
continue;
}
}else if(null != bomcode && "1".equals(bomcode)){
continue;
}else{
continue; continue;
} }
}else if("2".equals(materalType)){ }else if("2".equals(materalType)){
continue; continue;
} }
//只合并项目专用料数据 //只合并项目专用料数据
// if(child.getBprojectmaterial().booleanValue()){ if(child.getBprojectmaterial().booleanValue()){
mergedChildren.add(child); mergedChildren.add(child);
// } }
// CircularlyAccessibleValueObject 实现了 ISuperVO // CircularlyAccessibleValueObject 实现了 ISuperVO
} }
} }

View File

@ -174,7 +174,7 @@ public class PickmToPmo implements ICommonAction {
// 未下达子表 若物料类型为制造件则备料计划中所有制造件件生成一张开立状态的流程生产订单 // 未下达子表 若物料类型为制造件则备料计划中所有制造件件生成一张开立状态的流程生产订单
if(null != child.getVbdef13() && child.getVbdef13().equals("Y") ){ if(null != child.getVbdef13() && child.getVbdef13().equals("Y") ){
// continue; continue;
} }
String rowno=child.getVrowno(); String rowno=child.getVrowno();
String materalType = child.getVbdef14(); String materalType = child.getVbdef14();
@ -194,7 +194,7 @@ public class PickmToPmo implements ICommonAction {
" bd_bom_b \n" + " bd_bom_b \n" +
" LEFT JOIN bd_defdoc ON bd_bom_b.vdef1 = bd_defdoc.pk_defdoc\n" + " LEFT JOIN bd_defdoc ON bd_bom_b.vdef1 = bd_defdoc.pk_defdoc\n" +
"WHERE\n" + "WHERE\n" +
" bd_bom_b.cbomid = (select distinct bd_bom.cbomid from bd_bom bd_bom where ( bd_bom.pk_org = '"+child.getPk_org()+"' AND bd_bom.hcmaterialid = '"+hmateral+"' AND bd_bom.hfbomcategory = 1 AND bd_bom.hbcustomized = 'N' ) and bd_bom.dr = 0 and bd_bom.hbcustomized = 'N' and bd_bom.fbomtype != 3 ) \n" + " bd_bom_b.cbomid in (select distinct bd_bom.cbomid from bd_bom bd_bom where ( bd_bom.pk_org = '"+child.getPk_org()+"' AND bd_bom.hcmaterialid = '"+hmateral+"' AND bd_bom.hfbomcategory = 1 AND bd_bom.hbcustomized = 'N' ) and bd_bom.dr = 0 and bd_bom.hbcustomized = 'N' and bd_bom.fbomtype != 3 ) \n" +
" AND bd_bom_b.dr = 0 and bd_bom_b.cmaterialvid='" + child.getCbmaterialvid() + "'"; " AND bd_bom_b.dr = 0 and bd_bom_b.cmaterialvid='" + child.getCbmaterialvid() + "'";
String bomcode = (String) dao.executeQuery(sql, new ColumnProcessor()); String bomcode = (String) dao.executeQuery(sql, new ColumnProcessor());
@ -202,13 +202,13 @@ public class PickmToPmo implements ICommonAction {
// MR=制造件; // MR=制造件;
// PR=采购件; // PR=采购件;
if(null == bomcode || "".equals(bomcode) ){ if(null != bomcode && "1".equals(bomcode) ){
sql = " select martype from bd_materialstock where pk_material='" + child.getCbmaterialvid() + "' and pk_org='"+child.getPk_org()+"' and dr=0"; sql = " select martype from bd_materialstock where pk_material='" + child.getCbmaterialvid() + "' and pk_org='"+child.getPk_org()+"' and dr=0";
String matType = (String) dao.executeQuery(sql, new ColumnProcessor()); String matType = (String) dao.executeQuery(sql, new ColumnProcessor());
if(null == matType || "PR".equals(matType) || "".equals(matType)){ if(null == matType || "PR".equals(matType) || "".equals(matType)){
continue; continue;
} }
}else if("2".equals(bomcode)){ }else if(null != bomcode && "2".equals(bomcode)){
continue; continue;
} }
}else { }else {