Przeglądaj źródła

生产总订单生成其它出入库优化

zthwr 10 miesięcy temu
rodzic
commit
ce4ceb3ea2

+ 185 - 30
mmpac/mmpac/src/client/u8c/ui/mmpac/action/PushOtherInAction.java

@@ -2,12 +2,14 @@ package u8c.ui.mmpac.action;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import nc.bs.framework.common.NCLocator;
 import nc.hr.utils.PubEnv;
 import nc.itf.uap.IUAPQueryBS;
 import nc.itf.uap.IVOPersistence;
 import nc.jdbc.framework.processor.ColumnProcessor;
+import nc.jdbc.framework.processor.MapProcessor;
 import nc.ui.hr.frame.FrameUI;
 import nc.ui.hr.frame.action.AbstractAction;
 import nc.ui.hr.frame.impl.MainBillMgrPanel;
@@ -85,12 +87,27 @@ public class PushOtherInAction extends AbstractAction{
 				icheadvo.setFbillflag(2);
 				icheadvo.setFreplenishflag(UFBoolean.FALSE);
 				icheadvo.setCoperatoridnow(PubEnv.getPk_user());
-				//项目编码 pk_defdoc9
-				icheadvo.setAttributeValue("pk_defdoc9", prjcode);
+				
+//				//项目编码 pk_defdoc9
+//				icheadvo.setAttributeValue("pk_defdoc9", prjcode);
+//				//项目名称pk_defdoc10
+//				icheadvo.setAttributeValue("pk_defdoc10", prjcode);
+//				//加工单号pk_defdoc1
+//				icheadvo.setAttributeValue("pk_defdoc2", headvo.getDef1());
+				
+				
+				Map<String,String> mapcodename=getprojectmap(prjcode);
+				//项目名称
+				icheadvo.setAttributeValue("vuserdef10", mapcodename.get("jobname"));
 				//项目名称pk_defdoc10
-				icheadvo.setAttributeValue("pk_defdoc10", prjcode);
-				//加工单号pk_defdoc1
-				icheadvo.setAttributeValue("pk_defdoc2", headvo.getDef1());
+				icheadvo.setAttributeValue("pk_defdoc10", prjcode);						
+				//加工单号
+				icheadvo.setAttributeValue("vuserdef1", headvo.getDef1());
+				//业务类型
+				icheadvo.setAttributeValue("vuserdef7", billtype.trim());
+				
+				icheadvo.setAttributeValue("pk_defdoc7",getpkdefdoc(billtype.trim()));
+				
 				//收发类别
 				icheadvo.setCdispatcherid(getpkrdcl("06"));
 				aggvo.setParentVO(icheadvo);
@@ -161,38 +178,85 @@ public class PushOtherInAction extends AbstractAction{
 					itemvo.setFchecked(0);
 					itemvo.setFlargess(UFBoolean.FALSE);
 					itemvo.setIsok(UFBoolean.FALSE);
-					itemvo.setNbarcodenum(new UFDouble(0));
-					itemvo.setNinnum(invo.getNum());//实入数量
+					itemvo.setNbarcodenum(new UFDouble(0));//条码数量 
+					String vbatcode=invo.getVbatchcode()==null?"":invo.getVbatchcode();
+					itemvo.setVfree1(invo.getColor());//颜色
+					itemvo.setVfree2(invo.getAlloy());//合金
+					itemvo.setVfree3(invo.getSizing());//定尺
+					itemvo.setVfree4(invo.getStandard());//标准
+					String bdef6=invo.getBdef6();
+					//MA开头的型材没有主数量
+					if(cmaterialcode.startsWith("MA")) {
+						InvbasdocVO  invbasvo = GetBaseDAOUtil.getInvVO(cmaterialcode);
+					    String pk_invbasdoc2 = invbasvo.getPrimaryKey();
+					    Object objbdef6 =getHandNum("1001", billtype, pk_invbasdoc2, vbatcode, 
+					    		invo.getColor(), invo.getSizing(), invo.getAlloy(), invo.getStandard());//现存量换算率
+					    if(null==objbdef6 || "".equals(objbdef6.toString())) {
+							MessageDialog.showErrorDlg(frameUI, "错误", "MA开头的现存量未查询到!无法计算换算率!");
+							return;
+						}
+					    UFDouble mahsl=new UFDouble(objbdef6.toString());
+					    itemvo.setHsl(mahsl);//换算率  
+					    UFDouble nshnum=invo.getNastnum().multiply(mahsl).setScale(2, UFDouble.ROUND_HALF_UP);
+					    itemvo.setNshouldinnum(nshnum);//应入数量
+						itemvo.setNinnum(nshnum);//实入数量
+						
+					}else {
+					   if(null==bdef6 || "".equals(bdef6)) {
+							MessageDialog.showErrorDlg(frameUI, "错误", "请检查换算率不能为空!");
+							return;
+						}
+					    itemvo.setNshouldinnum(invo.getNum());//应入数量
+						itemvo.setNinnum(invo.getNum());//实入数量
+						itemvo.setHsl(new UFDouble(invo.getBdef6()));//换算率
+					}
+					
 					itemvo.setNinassistnum (invo.getNastnum());//实入辅数量
-					itemvo.setNshouldinnum(invo.getNum());//应入数量
 					itemvo.setNneedinassistnum(invo.getNastnum());//应入辅数量
 					String pkdw=getpkmeasdoc(invo.getCastunitid());
 					itemvo.setCastunitid(pkdw);//辅计量单位ID 
-					itemvo.setHsl(new UFDouble(invo.getBdef6()));//换算率
 					itemvo.setAttributeValue("processcost", invo.getNmny());
 					itemvo.setPk_calbody(icheadvo.getPk_calbody());
-					String vbatcode=invo.getVbatchcode()==null?"":invo.getVbatchcode();
 					itemvo.setVbatchcode(vbatcode);
 					itemvo.setVfirstbillcode(headvo.getVbillno());
-					itemvo.setVfree1(invo.getColor());//颜色
-					itemvo.setVfree2(invo.getAlloy());//合金
-					itemvo.setVfree3(invo.getSizing());//定尺
-					itemvo.setVfree4(invo.getStandard());//标准
 					itemvo.setVsourcebillcode(headvo.getVbillno());
-					itemvo.setAttributeValue("pk_defdoc1", invo.getBdef11());//楼号楼层
-					itemvo.setAttributeValue("pk_defdoc2", invo.getBdef12());//樘数(数量)
-					itemvo.setAttributeValue("pk_defdoc3", invo.getBdef13());//框统计
-					itemvo.setAttributeValue("pk_defdoc4", invo.getBdef14());//扇统计
-					itemvo.setAttributeValue("pk_defdoc5", invo.getBdef15());//半成品分类
-					itemvo.setAttributeValue("pk_defdoc6", invo.getBdef16());//面积
-					itemvo.setAttributeValue("pk_defdoc7", invo.getBdef17());//切割长度
-					itemvo.setAttributeValue("pk_defdoc8", invo.getBdef18());//切割角度左下
-					itemvo.setAttributeValue("pk_defdoc9", invo.getBdef19());//切割角度右上
-					itemvo.setAttributeValue("pk_defdoc10", invo.getBdef2());//备注
-					itemvo.setAttributeValue("pk_defdoc11", invo.getWidth());//宽度
-					itemvo.setAttributeValue("pk_defdoc12", invo.getHeight());//高度
-					itemvo.setAttributeValue("pk_defdoc13", invo.getBdef20());//系列
-					itemvo.setAttributeValue("pk_defdoc14", invo.getBdef3());//玻璃编号
+//					itemvo.setAttributeValue("pk_defdoc1", invo.getBdef11());//楼号楼层
+//					itemvo.setAttributeValue("pk_defdoc2", invo.getBdef12());//樘数(数量)
+//					itemvo.setAttributeValue("pk_defdoc3", invo.getBdef13());//框统计
+//					itemvo.setAttributeValue("pk_defdoc4", invo.getBdef14());//扇统计
+//					itemvo.setAttributeValue("pk_defdoc5", invo.getBdef15());//半成品分类
+//					itemvo.setAttributeValue("pk_defdoc6", invo.getBdef16());//面积
+//					itemvo.setAttributeValue("pk_defdoc7", invo.getBdef17());//切割长度
+//					itemvo.setAttributeValue("pk_defdoc8", invo.getBdef18());//切割角度左下
+//					itemvo.setAttributeValue("pk_defdoc9", invo.getBdef19());//切割角度右上
+//					itemvo.setAttributeValue("pk_defdoc10", invo.getBdef2());//备注
+//					itemvo.setAttributeValue("pk_defdoc11", invo.getWidth());//宽度
+//					itemvo.setAttributeValue("pk_defdoc12", invo.getHeight());//高度
+//					itemvo.setAttributeValue("pk_defdoc13", invo.getBdef20());//系列
+//					itemvo.setAttributeValue("pk_defdoc14", invo.getBdef3());//玻璃编号
+					
+					itemvo.setAttributeValue("vuserdef1", invo.getBdef11());//楼号楼层
+					itemvo.setAttributeValue("vuserdef2", invo.getBdef12());//樘数(数量)
+					itemvo.setAttributeValue("vuserdef3", invo.getBdef13());//框统计
+					itemvo.setAttributeValue("vuserdef4", invo.getBdef14());//扇统计
+					itemvo.setAttributeValue("vuserdef5", invo.getBdef15());//半成品分类
+					itemvo.setAttributeValue("vuserdef6", invo.getBdef16());//面积
+					itemvo.setAttributeValue("vuserdef7", invo.getBdef17());//切割长度
+					itemvo.setAttributeValue("vuserdef8", invo.getBdef18());//切割角度左下
+					itemvo.setAttributeValue("vuserdef9", invo.getBdef19());//切割角度右上
+					itemvo.setAttributeValue("vuserdef10",invo.getBdef2());//备注
+					itemvo.setAttributeValue("vuserdef11",invo.getWidth());//宽度
+					itemvo.setAttributeValue("vuserdef12",invo.getHeight());//高度
+					itemvo.setAttributeValue("vuserdef13",invo.getBdef20());//系列
+					itemvo.setAttributeValue("vuserdef14",invo.getBdef3());//玻璃编号
+//					itemvo.setAttributeValue("vuserdef15",vector.get()==null?null:vector.get().toString());//开票类型
+					itemvo.setAttributeValue("vuserdef17",invo.getConf());//窗号
+					itemvo.setAttributeValue("vuserdef18",invo.getWeight());//米重
+					itemvo.setAttributeValue("vuserdef19",invo.getRound());//装饰面周长
+					itemvo.setAttributeValue("vuserdef20",invo.getPrjtypecode());//专用区
+					itemvo.setAttributeValue("pk_defdoc20",getzyqpk("专用区",invo.getPrjtypecode()));//专用区
+					
+					
 					itemvos[i] = itemvo;
 //					lisbillvos.add(itemvo);
 				}
@@ -280,7 +344,6 @@ public class PushOtherInAction extends AbstractAction{
 	 //收发类别
 	 private String getpkrdcl(String rdcode ) throws BusinessException {
 	  String sql="select pk_rdcl from bd_rdcl where rdcode='"+rdcode+"'  ";
-	  IUAPQueryBS iuap=(IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
 	  
 	  String pk_rdcl = (String) iuap.executeQuery(sql, new ColumnProcessor());
       if (pk_rdcl == null) {
@@ -293,7 +356,7 @@ public class PushOtherInAction extends AbstractAction{
 	 //计量单位
 	 private String getpkmeasdoc(String measname ) throws BusinessException {
 	    String sql="select pk_measdoc from bd_measdoc where measname='"+measname+"'  ";
-	    IUAPQueryBS iuap=(IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
+	   
 	    String pk_measdoc = (String) iuap.executeQuery(sql, new ColumnProcessor());
         if (pk_measdoc == null) {
           return "";
@@ -301,5 +364,97 @@ public class PushOtherInAction extends AbstractAction{
         return pk_measdoc;
 		
 	}
+	 
+	  //项目管理档案-编码和名称
+	    public  Map<String,String> getprojectmap(String pk_jobmngfil ) throws Exception {
+	        String sql = "select jobcode,jobname  from   bd_jobbasfil where  "
+	        		+ "pk_jobbasfil = (select pk_jobbasfil from bd_jobmngfil where pk_jobmngfil ='"+pk_jobmngfil+"' and dr = 0) "
+	        		+ "and dr=0";
+	        Map<String,String> map = (Map<String, String>) iuap.executeQuery(sql, new MapProcessor());
+	        if (map == null || map.size()==0) {
+	        	throw new Exception("项目管理档案"+pk_jobmngfil+"未查到,请检查"); 
+	        }
+	        return map;
+	    }
+	    
+	  //业务类型自定义档案查询
+  	  private String getpkdefdoc(String docname ) throws Exception {
+  	    String sql="select pk_defdoc from bd_defdoc  where pk_defdoclist = "
+  	  		+ "(select pk_defdoclist from bd_defdef where defname = '业务类型' and dr=0 ) and dr=0 "
+  	  		+ "and docname='"+docname+"'";
+  	  
+  	    Object pkdefdoc =  iuap.executeQuery(sql, new ColumnProcessor());
+  	    if(pkdefdoc == null ||  "".equals(pkdefdoc)) {
+    		throw new Exception("业务类型【"+docname+"】未查到,请检查");
+    	  }
+
+        return pkdefdoc.toString();
+  		
+  	 }
+  	  
+  	 private String getzyqpk(String doclistname,String docname) throws BusinessException {
+      	
+      	if(null==docname || "".equals(docname)) {
+      		return "";
+      	}
+      	
+      	//取到自定义档案列表主键
+      	String sql = "select pk_defdoclist from bd_defdoclist where doclistname = '"+doclistname+"'";
+      	Object pk_defdoclist = iuap.executeQuery(sql, new ColumnProcessor());
+      	if(pk_defdoclist == null) {
+      		throw new BusinessException("以下档案在U8cloud系统中根据公司或者账簿信息找不到,请检查!详细信息:1、档案类型:自定义档案列表,档案名称:"+doclistname);
+      	}
+          String sql1 = "select pk_defdoc  from bd_defdoc where pk_defdoclist = '"+pk_defdoclist.toString()+"' and docname ='"+docname+"'";
+          String pk_defdoc = (String) iuap.executeQuery(sql1, new ColumnProcessor());
+          
+  		return pk_defdoc;
+      	
+      }
+  	 
+ 	/**
+ 	 * 查询现存量物料换算率
+ 	 * @param pk_corp
+ 	 * @param storcode
+ 	 * @param cinvbasid
+ 	 * @param vbatchcode
+ 	 * @param color    颜色
+ 	 * @param sizing   定尺
+ 	 * @param alloy    合金
+ 	 * @param standard 标准
+ 	 * @return
+ 	 * @throws Exception
+ 	 */
+    	public  Object  getHandNum(String pk_corp,String storcode,String cinvbasid,String vbatchcode, String color ,String sizing,String alloy,String standard)throws Exception {
+    		StringBuffer sql = new StringBuffer();
+    		sql.append("SELECT ");
+    		sql.append(" nonhandnum/nonhandastnum as hsl");
+    		sql.append(" FROM");
+    		sql.append(" ic_onhandnum");
+    		sql.append(" WHERE");
+    		sql.append(" pk_corp = '"+pk_corp+"'");
+    		sql.append(" AND cwarehouseid = ( SELECT pk_stordoc FROM bd_stordoc WHERE storcode = '"+storcode+"' and sealflag = 'N' and dr = 0)");
+    		sql.append(" AND cinvbasid = '"+cinvbasid+"'  ");
+    		if(vbatchcode != null && !"".equals(vbatchcode)) {
+    			sql.append(" AND vlot = '"+vbatchcode+"' ");
+    		}
+    		
+    		if(color != null && !"".equals(color)) {
+    			sql.append(" AND vfree1='"+color+"' ");
+    		}
+    		
+    		if(alloy != null && !"".equals(alloy)) {
+    			sql.append(" AND vfree2='"+alloy+"' ");
+    		}
+    		
+    		if(sizing != null && !"".equals(sizing)) {
+    			sql.append(" AND vfree3='"+sizing+"' ");
+    		}
+    		
+    		if(standard != null && !"".equals(standard)) {
+    			sql.append("  AND vfree4='"+standard+"' ");
+    		}
+    		
+    		return  iuap.executeQuery(sql.toString(), new ColumnProcessor());
+    	}
 		
 }

+ 194 - 30
mmpac/mmpac/src/client/u8c/ui/mmpac/action/PushOtherOutAction.java

@@ -2,12 +2,14 @@ package u8c.ui.mmpac.action;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import nc.bs.framework.common.NCLocator;
 import nc.hr.utils.PubEnv;
 import nc.itf.uap.IUAPQueryBS;
 import nc.itf.uap.IVOPersistence;
 import nc.jdbc.framework.processor.ColumnProcessor;
+import nc.jdbc.framework.processor.MapProcessor;
 import nc.ui.hr.frame.FrameUI;
 import nc.ui.hr.frame.action.AbstractAction;
 import nc.ui.hr.frame.impl.MainBillMgrPanel;
@@ -37,6 +39,7 @@ public class PushOtherOutAction extends AbstractAction{
 	OrderTestUI frameUI = null;
 	private  IOtherOutMaintainAPI iotherout = NCLocator.getInstance().lookup(IOtherOutMaintainAPI.class);
 	private  IVOPersistence ivo = NCLocator.getInstance().lookup(IVOPersistence.class);
+	private  IUAPQueryBS iuap=(IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
 	public PushOtherOutAction(FrameUI frameUI1) {
 		super(frameUI1);
 		this.frameUI = (OrderTestUI) frameUI1;
@@ -88,12 +91,27 @@ public class PushOtherOutAction extends AbstractAction{
 				//收发类别
 				icheadvo.setCdispatcherid(getpkrdcl("07"));
 				
-				//项目编码 pk_defdoc9
-				icheadvo.setAttributeValue("pk_defdoc9", prjcode);
+//				//项目编码 pk_defdoc9
+//				icheadvo.setAttributeValue("pk_defdoc9", prjcode);
+//				//项目名称pk_defdoc10
+//				icheadvo.setAttributeValue("pk_defdoc10", prjcode);
+//				//加工单号pk_defdoc1
+//				icheadvo.setAttributeValue("pk_defdoc2", headvo.getDef1());
+				
+				
+				Map<String,String> mapcodename=getprojectmap(prjcode);
+				//项目名称
+				icheadvo.setAttributeValue("vuserdef10", mapcodename.get("jobname"));
 				//项目名称pk_defdoc10
-				icheadvo.setAttributeValue("pk_defdoc10", prjcode);
-				//加工单号pk_defdoc1
-				icheadvo.setAttributeValue("pk_defdoc2", headvo.getDef1());
+				icheadvo.setAttributeValue("pk_defdoc10", prjcode);						
+				//加工单号
+				icheadvo.setAttributeValue("vuserdef1", headvo.getDef1());
+				//业务类型
+				icheadvo.setAttributeValue("vuserdef7", billtype.trim());
+				
+				icheadvo.setAttributeValue("pk_defdoc7",getpkdefdoc(billtype.trim()));
+				
+				
 				aggvo.setParentVO(icheadvo);
 				GeneralBillItemVO[] itemvos = new GeneralBillItemVO[outvos.length];
 				for(int i = 0;i < outvos.length;i++) {
@@ -163,9 +181,44 @@ public class PushOtherOutAction extends AbstractAction{
 					itemvo.setIsok(UFBoolean.FALSE);
 					
 					itemvo.setNbarcodenum(new UFDouble(0));//条码数量 
-					itemvo.setNoutnum(outvo.getNum());//实出数量
-					itemvo.setNshouldoutnum(outvo.getNum());//应出数量
-					itemvo.setHsl(new UFDouble(outvo.getBdef6()));//换算率	
+					
+					String vbatcode=outvo.getVbatchcode()==null?"":outvo.getVbatchcode();
+					itemvo.setVfirstbillcode(headvo.getVbillno());
+					itemvo.setVfree1(outvo.getColor());//颜色
+					itemvo.setVfree2(outvo.getAlloy());//合金
+					itemvo.setVfree3(outvo.getSizing());//定尺
+					itemvo.setVfree4(outvo.getStandard());//标准
+					String bdef6=outvo.getBdef6();
+					
+					//MA开头的型材没有主数量
+					if(cmaterialcode.startsWith("MA")) {
+						InvbasdocVO  invbasvo = GetBaseDAOUtil.getInvVO(cmaterialcode);
+					    String pk_invbasdoc2 = invbasvo.getPrimaryKey();
+					    Object objbdef6 =getHandNum("1001", billtype, pk_invbasdoc2, vbatcode, 
+					    		outvo.getColor(), outvo.getSizing(), outvo.getAlloy(), outvo.getStandard());//现存量换算率
+					    if(null==objbdef6 || "".equals(objbdef6.toString())) {
+							MessageDialog.showErrorDlg(frameUI, "错误", "MA开头的现存量未查询到!无法计算换算率!");
+							return;
+						}
+					    UFDouble mahsl=new UFDouble(objbdef6.toString());
+					    itemvo.setHsl(mahsl);//换算率  
+					    UFDouble nshnum=outvo.getNastnum().multiply(mahsl).setScale(2, UFDouble.ROUND_HALF_UP);
+					    itemvo.setNshouldinnum(nshnum);//应入数量
+						itemvo.setNinnum(nshnum);//实入数量
+						
+					}else {
+					    if(null==bdef6 || "".equals(bdef6)) {
+							MessageDialog.showErrorDlg(frameUI, "错误", "请检查换算率不能为空!");
+							return;
+						}
+					    itemvo.setNshouldinnum(outvo.getNum());//应入数量
+						itemvo.setNinnum(outvo.getNum());//实入数量
+						itemvo.setHsl(new UFDouble(outvo.getBdef6()));//换算率
+					}
+					
+//					itemvo.setNoutnum(outvo.getNum());//实出数量
+//					itemvo.setNshouldoutnum(outvo.getNum());//应出数量
+//					itemvo.setHsl(new UFDouble(outvo.getBdef6()));//换算率	
 					itemvo.setNoutassistnum(outvo.getNastnum());//实出辅数量
 					itemvo.setNshouldoutassistnum(outvo.getNastnum());//应出辅数量
 					
@@ -174,27 +227,47 @@ public class PushOtherOutAction extends AbstractAction{
 					itemvo.setCastunitname(castunitid==null?"":castunitid.toString());//辅计量单位名称
 					
 					itemvo.setPk_calbody(icheadvo.getPk_calbody());
-					itemvo.setVbatchcode(outvo.getVbatchcode()==null?"":outvo.getVbatchcode());
-					itemvo.setVfirstbillcode(headvo.getVbillno());
-					itemvo.setVfree1(outvo.getColor());//颜色
-					itemvo.setVfree2(outvo.getAlloy());//合金
-					itemvo.setVfree3(outvo.getSizing());//定尺
-					itemvo.setVfree4(outvo.getStandard());//标准
+					itemvo.setVbatchcode(vbatcode);//批次号
+					
 					itemvo.setVsourcebillcode(headvo.getVbillno());
-					itemvo.setAttributeValue("pk_defdoc1", outvo.getBdef11());//楼号楼层
-					itemvo.setAttributeValue("pk_defdoc2", outvo.getBdef12());//樘数(数量)
-					itemvo.setAttributeValue("pk_defdoc3", outvo.getBdef13());//框统计
-					itemvo.setAttributeValue("pk_defdoc4", outvo.getBdef14());//扇统计
-					itemvo.setAttributeValue("pk_defdoc5", outvo.getBdef15());//半成品分类
-					itemvo.setAttributeValue("pk_defdoc6", outvo.getBdef16());//面积
-					itemvo.setAttributeValue("pk_defdoc7", outvo.getBdef17());//切割长度
-					itemvo.setAttributeValue("pk_defdoc8", outvo.getBdef18());//切割角度左下
-					itemvo.setAttributeValue("pk_defdoc9", outvo.getBdef19());//切割角度右上
-					itemvo.setAttributeValue("pk_defdoc10", outvo.getBdef2());//备注
-					itemvo.setAttributeValue("pk_defdoc11", outvo.getWidth());//宽度
-					itemvo.setAttributeValue("pk_defdoc12", outvo.getHeight());//高度
-					itemvo.setAttributeValue("pk_defdoc13", outvo.getBdef20());//系列
-					itemvo.setAttributeValue("pk_defdoc14", outvo.getBdef3());//玻璃编号
+					
+//					itemvo.setAttributeValue("pk_defdoc1", outvo.getBdef11());//楼号楼层
+//					itemvo.setAttributeValue("pk_defdoc2", outvo.getBdef12());//樘数(数量)
+//					itemvo.setAttributeValue("pk_defdoc3", outvo.getBdef13());//框统计
+//					itemvo.setAttributeValue("pk_defdoc4", outvo.getBdef14());//扇统计
+//					itemvo.setAttributeValue("pk_defdoc5", outvo.getBdef15());//半成品分类
+//					itemvo.setAttributeValue("pk_defdoc6", outvo.getBdef16());//面积
+//					itemvo.setAttributeValue("pk_defdoc7", outvo.getBdef17());//切割长度
+//					itemvo.setAttributeValue("pk_defdoc8", outvo.getBdef18());//切割角度左下
+//					itemvo.setAttributeValue("pk_defdoc9", outvo.getBdef19());//切割角度右上
+//					itemvo.setAttributeValue("pk_defdoc10", outvo.getBdef2());//备注
+//					itemvo.setAttributeValue("pk_defdoc11", outvo.getWidth());//宽度
+//					itemvo.setAttributeValue("pk_defdoc12", outvo.getHeight());//高度
+//					itemvo.setAttributeValue("pk_defdoc13", outvo.getBdef20());//系列
+//					itemvo.setAttributeValue("pk_defdoc14", outvo.getBdef3());//玻璃编号
+					
+					itemvo.setAttributeValue("vuserdef1", outvo.getBdef11());//楼号楼层
+					itemvo.setAttributeValue("vuserdef2", outvo.getBdef12());//樘数(数量)
+					itemvo.setAttributeValue("vuserdef3", outvo.getBdef13());//框统计
+					itemvo.setAttributeValue("vuserdef4", outvo.getBdef14());//扇统计
+					itemvo.setAttributeValue("vuserdef5", outvo.getBdef15());//半成品分类
+					itemvo.setAttributeValue("vuserdef6", outvo.getBdef16());//面积
+					itemvo.setAttributeValue("vuserdef7", outvo.getBdef17());//切割长度
+					itemvo.setAttributeValue("vuserdef8", outvo.getBdef18());//切割角度左下
+					itemvo.setAttributeValue("vuserdef9", outvo.getBdef19());//切割角度右上
+					itemvo.setAttributeValue("vuserdef10",outvo.getBdef2());//备注
+					itemvo.setAttributeValue("vuserdef11",outvo.getWidth());//宽度
+					itemvo.setAttributeValue("vuserdef12",outvo.getHeight());//高度
+					itemvo.setAttributeValue("vuserdef13",outvo.getBdef20());//系列
+					itemvo.setAttributeValue("vuserdef14",outvo.getBdef3());//玻璃编号
+//					itemvo.setAttributeValue("vuserdef15",vector.get()==null?null:vector.get().toString());//开票类型
+					itemvo.setAttributeValue("vuserdef17",outvo.getConf());//窗号
+					itemvo.setAttributeValue("vuserdef18",outvo.getWeight());//米重
+					itemvo.setAttributeValue("vuserdef19",outvo.getRound());//装饰面周长
+					itemvo.setAttributeValue("vuserdef20",outvo.getPrjtypecode());//专用区
+					itemvo.setAttributeValue("pk_defdoc20",getzyqpk("专用区",outvo.getPrjtypecode()));//专用区
+					
+					
 					itemvos[i] = itemvo;
 				}
 				aggvo.setChildrenVO(itemvos);
@@ -245,7 +318,6 @@ public class PushOtherOutAction extends AbstractAction{
 	//收发类别
 	private String getpkrdcl(String rdcode ) throws BusinessException {
 	  String sql="select pk_rdcl from bd_rdcl where rdcode='"+rdcode+"'  ";
-	  IUAPQueryBS iuap=(IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
 	  
 	  String pk_rdcl = (String) iuap.executeQuery(sql, new ColumnProcessor());
       if (pk_rdcl == null) {
@@ -258,7 +330,6 @@ public class PushOtherOutAction extends AbstractAction{
 	//计量单位 
 	private String getpk(String shortname) throws BusinessException {
 	  String sql="select pk_measdoc from bd_measdoc where measname='"+shortname+"'  ";
-	  IUAPQueryBS iuap=(IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
 	  
 	  String pk_measdoc = (String) iuap.executeQuery(sql, new ColumnProcessor());
       if (pk_measdoc == null) {
@@ -267,4 +338,97 @@ public class PushOtherOutAction extends AbstractAction{
       return pk_measdoc;
 		
 	}
+	
+    //项目管理档案-编码和名称
+    public  Map<String,String> getprojectmap(String pk_jobmngfil ) throws Exception {
+        String sql = "select jobcode,jobname  from   bd_jobbasfil where  "
+        		+ "pk_jobbasfil = (select pk_jobbasfil from bd_jobmngfil where pk_jobmngfil ='"+pk_jobmngfil+"' and dr = 0) "
+        		+ "and dr=0";
+        Map<String,String> map = (Map<String, String>) iuap.executeQuery(sql, new MapProcessor());
+        if (map == null || map.size()==0) {
+        	throw new Exception("项目管理档案"+pk_jobmngfil+"未查到,请检查"); 
+        }
+        return map;
+    }
+    
+    //业务类型自定义档案查询
+  	private String getpkdefdoc(String docname ) throws Exception {
+  	  String sql="select pk_defdoc from bd_defdoc  where pk_defdoclist = "
+  	  		+ "(select pk_defdoclist from bd_defdef where defname = '业务类型' and dr=0 ) and dr=0 "
+  	  		+ "and docname='"+docname+"'";
+  	  
+  	  Object pkdefdoc =  iuap.executeQuery(sql, new ColumnProcessor());
+  	  if(pkdefdoc == null ||  "".equals(pkdefdoc)) {
+    		throw new Exception("业务类型【"+docname+"】未查到,请检查");
+    	  }
+
+        return pkdefdoc.toString();
+  		
+  	}
+  	
+  	 private String getzyqpk(String doclistname,String docname) throws BusinessException {
+     	
+     	if(null==docname || "".equals(docname)) {
+     		return "";
+     	}
+     	
+     	//取到自定义档案列表主键
+     	String sql = "select pk_defdoclist from bd_defdoclist where doclistname = '"+doclistname+"'";
+     	Object pk_defdoclist = iuap.executeQuery(sql, new ColumnProcessor());
+     	if(pk_defdoclist == null) {
+     		throw new BusinessException("以下档案在U8cloud系统中根据公司或者账簿信息找不到,请检查!详细信息:1、档案类型:自定义档案列表,档案名称:"+doclistname);
+     	}
+         String sql1 = "select pk_defdoc  from bd_defdoc where pk_defdoclist = '"+pk_defdoclist.toString()+"' and docname ='"+docname+"'";
+         String pk_defdoc = (String) iuap.executeQuery(sql1, new ColumnProcessor());
+         
+ 		return pk_defdoc;
+     	
+     }
+  	 
+ 	/**
+  	 * 查询现存量物料换算率
+  	 * @param pk_corp
+  	 * @param storcode
+  	 * @param cinvbasid
+  	 * @param vbatchcode
+  	 * @param color    颜色
+  	 * @param sizing   定尺
+  	 * @param alloy    合金
+  	 * @param standard 标准
+  	 * @return
+  	 * @throws Exception
+  	 */
+     	public  Object  getHandNum(String pk_corp,String storcode,String cinvbasid,String vbatchcode, String color ,String sizing,String alloy,String standard)throws Exception {
+     		StringBuffer sql = new StringBuffer();
+     		sql.append("SELECT ");
+     		sql.append(" nonhandnum/nonhandastnum as hsl");
+     		sql.append(" FROM");
+     		sql.append(" ic_onhandnum");
+     		sql.append(" WHERE");
+     		sql.append(" pk_corp = '"+pk_corp+"'");
+     		sql.append(" AND cwarehouseid = ( SELECT pk_stordoc FROM bd_stordoc WHERE storcode = '"+storcode+"' and sealflag = 'N' and dr = 0)");
+     		sql.append(" AND cinvbasid = '"+cinvbasid+"'  ");
+     		if(vbatchcode != null && !"".equals(vbatchcode)) {
+     			sql.append(" AND vlot = '"+vbatchcode+"' ");
+     		}
+     		
+     		if(color != null && !"".equals(color)) {
+     			sql.append(" AND vfree1='"+color+"' ");
+     		}
+     		
+     		if(alloy != null && !"".equals(alloy)) {
+     			sql.append(" AND vfree2='"+alloy+"' ");
+     		}
+     		
+     		if(sizing != null && !"".equals(sizing)) {
+     			sql.append(" AND vfree3='"+sizing+"' ");
+     		}
+     		
+     		if(standard != null && !"".equals(standard)) {
+     			sql.append("  AND vfree4='"+standard+"' ");
+     		}
+     		
+     		return  iuap.executeQuery(sql.toString(), new ColumnProcessor());
+     	}
+ 		
 }