发料校验增加校验

This commit is contained in:
lihao 2025-09-25 08:58:43 +08:00
parent b40d1ef9fa
commit 2b1f68640a
1 changed files with 42 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import java.util.Map;
import nc.bs.dao.BaseDAO;
import nc.bs.framework.common.InvocationInfoProxy;
import nc.bs.trade.business.HYPubBO;
import nc.itf.mmpac.pickm.IPickmBusinessService;
import nc.jdbc.framework.processor.ColumnProcessor;
import nc.jdbc.framework.processor.MapProcessor;
@ -93,15 +94,55 @@ public class PickmDeliverAction implements ICommonAction {
List<String> pks = new ArrayList();
String errormessage="";
HYPubBO hybo = new HYPubBO();
for(AggPickmVO agg : aggVOs) {
Object GSDM = hybo.findColValue("org_factory", "code", " pk_factory = '" +agg.getParentVO().getPk_org() + "' ");
if(!GSDM.equals("C013")){
continue;
}
for(PickmItemVO item : (PickmItemVO[])agg.getChildrenVO()) {
// Á÷³ÌÉú²ú©µ¥Ã÷ϸ±í
String id=agg.getParentVO().getVfirstmorowid();
// ¸ù¾ÝÊÇ·ñ·¢»õ¼þ
String firstSql = " select cmaterialvid from mm_pickm where cpickmid='" + item.getCpickmid() + "' and dr=0";
BaseDAO dao = new BaseDAO();
String hmateral = (String) dao.executeQuery(firstSql, new ColumnProcessor());
firstSql="SELECT bd_bom_b.vdef27 FROM bd_bom_b " +
"LEFT JOIN bd_defdoc ON bd_bom_b.vdef1 = bd_defdoc.pk_defdoc " +
"WHERE bd_bom_b.cbomid in (select distinct bd_bom.cbomid from bd_bom bd_bom " +
"where ( bd_bom.pk_org = '"+item.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 ) " +
"AND bd_bom_b.dr = 0 and bd_bom_b.cmaterialvid='" + item.getCbmaterialvid() + "'";
String bomcode = (String) dao.executeQuery(firstSql, new ColumnProcessor());
if(null==bomcode){
String secondsql=" SELECT bd_bom_b.vdef27 FROM bd_bom_b " +
"LEFT JOIN bd_defdoc ON bd_bom_b.vdef1 = bd_defdoc.pk_defdoc " +
"WHERE bd_bom_b.cbomid in (select bd_bom.cbomid from bd_bom bd_bom " +
"WHERE bd_bom.pk_org = '"+item.getPk_org()+"' and bd_bom.hcmaterialid in " +
"(SELECT bd_bom_b.cmaterialvid FROM bd_bom_b " +
"LEFT JOIN bd_defdoc ON bd_bom_b.vdef1 = bd_defdoc.pk_defdoc " +
"WHERE bd_bom_b.cbomid in (select distinct bd_bom.cbomid from bd_bom bd_bom " +
"where ( bd_bom.pk_org = '"+item.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 ) " +
"AND bisvirtual='Y') 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 ) " +
"AND bd_bom_b.dr = 0 and bd_bom_b.cmaterialvid='"+item.getCbmaterialvid()+"'";
bomcode = (String) dao.executeQuery(secondsql, new ColumnProcessor());
}
if(null == bomcode || "N".equals(bomcode) ){
continue;
}
if(null != id &&!id.isEmpty()){
String sql = "SELECT m.tplanendtime from mm_mo m "+
"WHERE\n" +
"\tm.cmoid = '"+id+"' ";
BaseDAO dao = new BaseDAO();
String data =(String) dao.executeQuery(sql, new ColumnProcessor());
data=data.substring(0,10);
UFDate now=new UFDate();