فهرست منبع

生产总订单更新

zthwr 9 ماه پیش
والد
کامیت
83aa33c7af

+ 217 - 60
mmpac/mmpac/src/client/u8c/ui/mmpac/action/GenOtheroutinAction.java

@@ -8,14 +8,20 @@ import nc.hr.utils.PubEnv;
 import nc.itf.uap.IUAPQueryBS;
 import nc.itf.uap.IVOPersistence;
 import nc.jdbc.framework.processor.BeanListProcessor;
+import nc.jdbc.framework.processor.ColumnListProcessor;
+import nc.md.model.impl.Container;
 import nc.ui.hr.frame.FrameUI;
 import nc.ui.hr.frame.action.AbstractAction;
 import nc.ui.hr.frame.button.AbstractBtnReg;
 import nc.ui.hr.frame.impl.MainBillMgrPanel;
-import nc.ui.uapde.dialog.MessageDialog;
+import nc.ui.hr.frame.state.StateRegister;
+import nc.ui.hr.global.Global;
+import nc.ui.pub.beans.MessageDialog;
+import nc.ui.pub.tools.BannerDialog;
 import nc.vo.hr.tools.pub.HRAggVO;
 import nc.vo.pub.BusinessException;
 import nc.vo.pub.CircularlyAccessibleValueObject;
+import nc.vo.pubapp.pattern.pub.SqlBuilder;
 import u8c.ui.mmpac.panel.OrderMainPanel;
 import u8c.ui.mmpac.panel.OrderTestUI;
 import u8c.vo.OrderIssueVO;
@@ -26,20 +32,26 @@ import u8c.vo.OrderOtheroutVO;
 public class GenOtheroutinAction extends AbstractAction{
 	OrderTestUI frameUI = null;
 	IVOPersistence ivo = NCLocator.getInstance().lookup(IVOPersistence.class);
-
+	IUAPQueryBS iuap = NCLocator.getInstance().lookup(IUAPQueryBS.class);
 	public GenOtheroutinAction(FrameUI frameUI1) {
 		super(frameUI1);
-		this.frameUI = (OrderTestUI) frameUI;
+		this.frameUI = (OrderTestUI) frameUI1;
 	}
 
 	@Override
 	public void execute() throws Exception {
+		OrderTestUI ui = (OrderTestUI)this.getFrameUI();
 		MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
 		int selectedRow = ((OrderMainPanel) getMainPanel()).getSelectedRow();
 		HRAggVO s = (HRAggVO) mainMgrPanel.getMainBillCardPanel().getData();
+		
+	//	CircularlyAccessibleValueObject[] chulidvos=s.getAllChildrenVO();
+		
+		String pk_order="";
 		if (null != s ){
 			OrderMainVO headvo = (OrderMainVO) s.getParentVO();
 			String vbillno = headvo.getVbillno();
+			pk_order= headvo.getPk_order();
 			CircularlyAccessibleValueObject[] oldchildvos = s.getAllChildrenVO();
 			OrderIssueVO[] issueArrays = getIssueVOs(oldchildvos);
 			List<OrderIssueVO> execList = new ArrayList<>();
@@ -55,12 +67,45 @@ public class GenOtheroutinAction extends AbstractAction{
 				}
 				
 			}
-			delICVos(oldchildvos);
+	//		delICVos(oldchildvos);
+			delICVos(s);
+		
 			if(execList.size() != 0) {
-				AddICVos(execList);
+				AddICVosout(execList);
+				AddICVosin(execList);
+			}
+			
+			
+			//查询数据库
+			String sqlin="select * from  mmpac_order_otherin where pk_order='"+pk_order+"' ";
+			ArrayList<OrderOtherinVO> invoslis= (ArrayList<OrderOtherinVO>) iuap.executeQuery(sqlin, new BeanListProcessor(OrderOtherinVO.class));
+			String sqlout="select * from  mmpac_order_otherout where pk_order='"+pk_order+"' ";
+			ArrayList<OrderOtheroutVO> outvoslis= (ArrayList<OrderOtheroutVO>) iuap.executeQuery(sqlout, new BeanListProcessor(OrderOtheroutVO.class));
+			
+			
+			s.setTableVO("mmpac_order_otherin", invoslis.toArray(new OrderOtherinVO[0]));
+			s.setTableVO("mmpac_order_otherout", outvoslis.toArray(new OrderOtheroutVO[0]));
+			
+			//修改是否委外数据到数据库
+			ivo.updateVOArray(issueArrays);
+			
+			boolean boo = mainMgrPanel.getBillCardPanel().isShowing();
+			if(boo) {
+				mainMgrPanel.getBillCardPanel().setBillValueVO(s);
+				
+				ui.getBillCardPanel().getBodyTabbedPane().setSelectedIndex(2);//默认显示哪个页签
+			}else {
+				getFrameUI().getBtnManager().getCmdByID(AbstractBtnReg.SYSBTN_REFRESH).execute();
 			}
-			getFrameUI().getBtnManager().getCmdByID(AbstractBtnReg.SYSBTN_REFRESH).execute();
+			
+			
+			getDataModel().setCurrentState(StateRegister.STATE_NOTEDIT); 
+			
+//			getFrameUI().getBtnManager().getCmdByID(AbstractBtnReg.USERBTN_Refresh).execute();
 		}
+		
+		
+		MessageDialog.showHintDlg(frameUI, "提示", "出入库更新成功!");
 	}
 	
 	//根据aggvo获取issuevo数组
@@ -92,64 +137,69 @@ public class GenOtheroutinAction extends AbstractAction{
 			}
 		} catch (BusinessException e) {
 			// TODO Auto-generated catch block
-			MessageDialog.showErrorDlg(e);
+			MessageDialog.showErrorDlg(frameUI, "错误", e.getMessage());
 			return;
 		}
 	}
 	
-	//材料出库单勾选是否委外生成出库页签
-	private void AddICVos(List<OrderIssueVO> execList) {
+	
+	private void delICVos(HRAggVO s) {
+		
+	try {	
+		OrderOtherinVO[] criavinbhects= (OrderOtherinVO[]) s.getTableVO("mmpac_order_otherin");
+		
+//		OrderOtheroutVO[] criavoutbhects= (OrderOtheroutVO[]) s.getTableVO("mmpac_order_otherout");
+		
+		if(null!=criavinbhects && criavinbhects.length>0) {
+			String pk_order=criavinbhects[0].getPk_order();
+		    ivo.deleteByClause(OrderOtherinVO.class, " pk_order='"+pk_order+"' and  execnum is null  ");
+		    ivo.deleteByClause(OrderOtheroutVO.class, " pk_order='"+pk_order+"' and execnum is null   ");
+		}
+		
+	    
+	} catch (BusinessException e) {
+		// TODO Auto-generated catch block
+		MessageDialog.showErrorDlg(frameUI, "错误", e.getMessage());
+		return;
+	}
+	}
+	
+	//材料出库单勾选是否委外生成出库页签--入
+	private void AddICVosin(List<OrderIssueVO> execList) {
 		try {
+			//查询是否存生成了出入库页签数据,防止重复生成
+//			String sqlin="select * from  mmpac_order_otherin where pk_order='"+execList.get(0).getPk_order()+"' ";
+//			ArrayList<OrderOtherinVO> invoslis= (ArrayList<OrderOtherinVO>) iuap.executeQuery(sqlin, new BeanListProcessor(OrderOtherinVO.class));
+//			String sqlout="select * from  mmpac_order_otherout where pk_order='"+execList.get(0).getPk_order()+"' ";
+//			ArrayList<OrderOtheroutVO> outvoslis= (ArrayList<OrderOtheroutVO>) iuap.executeQuery(sqlout, new BeanListProcessor(OrderOtheroutVO.class));
+//			
+//			List<String> lisinpk=new ArrayList<String>();
+//			List<String> outinpk=new ArrayList<String>();
+//			
+//			if(null!=invoslis &&  invoslis.size()>0) {
+//				for(OrderOtherinVO invo: invoslis) {
+//					lisinpk.add(invo.getBdef1());//材料明细主键
+//				}
+//			}
+//			
+//			if(null!=outvoslis &&  outvoslis.size()>0) {
+//				for(OrderOtheroutVO outvo: outvoslis) {
+//					outinpk.add(outvo.getBdef1());//材料明细主键
+//				}
+//			}
+			
+			String sqlin="select bdef1 from  mmpac_order_otherin where pk_order='"+execList.get(0).getPk_order()+"' ";
+			ArrayList<String> invoslis= (ArrayList<String>) iuap.executeQuery(sqlin, new ColumnListProcessor());
+			
 			for(OrderIssueVO issuevo : execList) {
-				OrderOtheroutVO outvo = new OrderOtheroutVO();
-				outvo.setPk_order(issuevo.getPk_order());
-				outvo.setPrjtypecode(issuevo.getPrjtypecode());
-				outvo.setStandard(issuevo.getStandard());
-				outvo.setNum(issuevo.getNum());
-				outvo.setCmaterialname(issuevo.getCmaterialname());
-				outvo.setConf(issuevo.getConf());
-				outvo.setExecnum(issuevo.getExecnum());
-				outvo.setDr(issuevo.getDr());
-				outvo.setSpec(issuevo.getSpec());
-				outvo.setNprice(issuevo.getNprice());
-				outvo.setTaxprice(issuevo.getTaxprice());
-				outvo.setModel(issuevo.getModel());
-				outvo.setHeight(issuevo.getHeight());
-				outvo.setTax(issuevo.getTax());
-				outvo.setCastunitid(issuevo.getCastunitid());
-				outvo.setWeight(issuevo.getWeight());
-				outvo.setPrjtypename(issuevo.getPrjtypename());
-				outvo.setExecnastnum(issuevo.getExecnastnum());
-				outvo.setSizing(issuevo.getSizing());
-				outvo.setAlloy(issuevo.getAlloy());
-				outvo.setColor(issuevo.getColor());
-				outvo.setNastnum(issuevo.getNastnum());
-				outvo.setPrjcode(issuevo.getPrjcode());
-				outvo.setTaxmny(issuevo.getTaxmny());
-				outvo.setCmaterialcode(issuevo.getCmaterialcode());
-				outvo.setRound(issuevo.getRound());
-				outvo.setPrjname(issuevo.getPrjname());
-				outvo.setVbatchcode(issuevo.getVbatchcode());
-				outvo.setWidth(issuevo.getWidth());
-				outvo.setNmny(issuevo.getNmny());
-				outvo.setUnitid(issuevo.getUnitid());
-				outvo.setTs(PubEnv.getServerTime());
-				outvo.setBdef1(issuevo.getPk_order_issue());
-				outvo.setBdef6(issuevo.getBdef6());//换算率
-				outvo.setBdef11(issuevo.getBdef11());//楼号楼层
-				outvo.setBdef12(issuevo.getBdef12());//樘数(数量)
-				outvo.setBdef13(issuevo.getBdef13());//框统计
-				outvo.setBdef14(issuevo.getBdef14());//扇统计
-				outvo.setBdef15(issuevo.getBdef15());//半成品分类
-				outvo.setBdef16(issuevo.getBdef16());//面积
-				outvo.setBdef17(issuevo.getBdef17());//切割长度
-				outvo.setBdef18(issuevo.getBdef18());//切割角度左下
-				outvo.setBdef19(issuevo.getBdef19());//切割角度右上
-				outvo.setBdef20(issuevo.getBdef20());//系列
-				outvo.setBdef2(issuevo.getBdef2());//备注
-				outvo.setBdef3(issuevo.getBdef3());//玻璃编号
-				ivo.insertVO(outvo);
-				
+				String pk_order_issue =issuevo.getPk_order_issue();//材料明细主键
+				if(null!=invoslis &&  invoslis.size()>0) {
+					
+					if(invoslis.contains(pk_order_issue)) {
+						continue;
+					}
+					
+				}
 				OrderOtherinVO invo = new OrderOtherinVO();
 				invo.setPk_order(issuevo.getPk_order());
 				invo.setPrjtypecode(issuevo.getPrjtypecode());
@@ -202,9 +252,116 @@ public class GenOtheroutinAction extends AbstractAction{
 			}
 		} catch (BusinessException e) {
 			// TODO Auto-generated catch block
-			MessageDialog.showErrorDlg(e);
+			MessageDialog.showErrorDlg(frameUI, "错误", e.getMessage());
 			return;
 		}
-	}
+		
+	}	
+		
+		//材料出库单勾选是否委外生成出库页签--出
+		private void AddICVosout(List<OrderIssueVO> execList) {
+			try {
+				//查询是否存生成了出入库页签数据,防止重复生成
+//				String sqlin="select * from  mmpac_order_otherin where pk_order='"+execList.get(0).getPk_order()+"' ";
+//				ArrayList<OrderOtherinVO> invoslis= (ArrayList<OrderOtherinVO>) iuap.executeQuery(sqlin, new BeanListProcessor(OrderOtherinVO.class));
+//				String sqlout="select * from  mmpac_order_otherout where pk_order='"+execList.get(0).getPk_order()+"' ";
+//				ArrayList<OrderOtheroutVO> outvoslis= (ArrayList<OrderOtheroutVO>) iuap.executeQuery(sqlout, new BeanListProcessor(OrderOtheroutVO.class));
+//				
+//				List<String> lisinpk=new ArrayList<String>();
+//				List<String> outinpk=new ArrayList<String>();
+//				
+//				if(null!=invoslis &&  invoslis.size()>0) {
+//					for(OrderOtherinVO invo: invoslis) {
+//						lisinpk.add(invo.getBdef1());//材料明细主键
+//					}
+//				}
+//				
+//				if(null!=outvoslis &&  outvoslis.size()>0) {
+//					for(OrderOtheroutVO outvo: outvoslis) {
+//						outinpk.add(outvo.getBdef1());//材料明细主键
+//					}
+//				}
+				
+				String sqlin="select bdef1 from  mmpac_order_otherout where pk_order='"+execList.get(0).getPk_order()+"' ";
+				ArrayList<String> outvoslis= (ArrayList<String>) iuap.executeQuery(sqlin, new ColumnListProcessor());
+				
+				for(OrderIssueVO issuevo : execList) {
+					String pk_order_issue =issuevo.getPk_order_issue();//材料明细主键
+					if(null!=outvoslis &&  outvoslis.size()>0) {
+						
+						if(outvoslis.contains(pk_order_issue)) {
+							continue;
+						}
+						
+					}
+					OrderOtheroutVO outvo = new OrderOtheroutVO();
+					outvo.setPk_order(issuevo.getPk_order());
+					outvo.setPrjtypecode(issuevo.getPrjtypecode());
+					outvo.setStandard(issuevo.getStandard());
+					outvo.setNum(issuevo.getNum());
+					outvo.setCmaterialname(issuevo.getCmaterialname());
+					outvo.setConf(issuevo.getConf());
+					outvo.setExecnum(issuevo.getExecnum());
+					outvo.setDr(issuevo.getDr());
+					outvo.setSpec(issuevo.getSpec());
+					outvo.setNprice(issuevo.getNprice());
+					outvo.setTaxprice(issuevo.getTaxprice());
+					outvo.setModel(issuevo.getModel());
+					outvo.setHeight(issuevo.getHeight());
+					outvo.setTax(issuevo.getTax());
+					outvo.setCastunitid(issuevo.getCastunitid());
+					outvo.setWeight(issuevo.getWeight());
+					outvo.setPrjtypename(issuevo.getPrjtypename());
+					outvo.setExecnastnum(issuevo.getExecnastnum());
+					outvo.setSizing(issuevo.getSizing());
+					outvo.setAlloy(issuevo.getAlloy());
+					outvo.setColor(issuevo.getColor());
+					outvo.setNastnum(issuevo.getNastnum());
+					outvo.setPrjcode(issuevo.getPrjcode());
+					outvo.setTaxmny(issuevo.getTaxmny());
+					outvo.setCmaterialcode(issuevo.getCmaterialcode());
+					outvo.setRound(issuevo.getRound());
+					outvo.setPrjname(issuevo.getPrjname());
+					outvo.setVbatchcode(issuevo.getVbatchcode());
+					outvo.setWidth(issuevo.getWidth());
+					outvo.setNmny(issuevo.getNmny());
+					outvo.setUnitid(issuevo.getUnitid());
+					outvo.setTs(PubEnv.getServerTime());
+					outvo.setBdef1(issuevo.getPk_order_issue());
+					outvo.setBdef6(issuevo.getBdef6());//换算率
+					outvo.setBdef11(issuevo.getBdef11());//楼号楼层
+					outvo.setBdef12(issuevo.getBdef12());//樘数(数量)
+					outvo.setBdef13(issuevo.getBdef13());//框统计
+					outvo.setBdef14(issuevo.getBdef14());//扇统计
+					outvo.setBdef15(issuevo.getBdef15());//半成品分类
+					outvo.setBdef16(issuevo.getBdef16());//面积
+					outvo.setBdef17(issuevo.getBdef17());//切割长度
+					outvo.setBdef18(issuevo.getBdef18());//切割角度左下
+					outvo.setBdef19(issuevo.getBdef19());//切割角度右上
+					outvo.setBdef20(issuevo.getBdef20());//系列
+					outvo.setBdef2(issuevo.getBdef2());//备注
+					outvo.setBdef3(issuevo.getBdef3());//玻璃编号
+					ivo.insertVO(outvo);
+
+				}
+			} catch (BusinessException e) {
+				// TODO Auto-generated catch block
+				MessageDialog.showErrorDlg(frameUI, "错误", e.getMessage());
+				return;
+			}
+		
+     	}
+		
 
 }
+
+
+
+
+
+
+
+
+
+
+

+ 71 - 13
mmpac/mmpac/src/client/u8c/ui/mmpac/action/OrderApproveAction.java

@@ -1,5 +1,9 @@
 package u8c.ui.mmpac.action;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
 import nc.bs.framework.common.InvocationInfoProxy;
 import nc.hr.frame.persistence.BaseDAOManager;
 import nc.hr.utils.PubEnv;
@@ -8,11 +12,16 @@ import nc.ui.hr.frame.action.AbstractAction;
 import nc.ui.hr.frame.button.AbstractBtnReg;
 import nc.ui.hr.frame.impl.MainBillMgrPanel;
 import nc.ui.hr.frame.state.StateRegister;
+import nc.ui.pub.beans.MessageDialog;
+import nc.ui.pub.beans.UIDialog;
 import nc.vo.hr.tools.pub.HRAggVO;
 import nc.vo.pub.ValidationException;
 import nc.vo.trade.pub.IBillStatus;
 import u8c.ui.mmpac.panel.OrderTestUI;
+import u8c.vo.OrderIssueVO;
 import u8c.vo.OrderMainVO;
+import u8c.vo.OrderOtherinVO;
+import u8c.vo.OrderOtheroutVO;
 import u8c.ui.mmpac.datamodel.OrderDataModel;
 import u8c.ui.mmpac.panel.OrderMainPanel;
 import u8c.ui.mmpac.panel.OrderTestUI;
@@ -31,23 +40,72 @@ public class OrderApproveAction extends AbstractAction{
 		MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
 		//int selectedRow = ((OrderMainPanel) getMainPanel()).getSelectedRow();
 		//HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
-		HRAggVO [] s = new HRAggVO[] {this.getSelection(mainMgrPanel)};
-		//if (null != s && s[selectedRow] != null){
-			//OrderMainVO headvo = (OrderMainVO) s[selectedRow].getParentVO();
-			OrderMainVO headvo = (OrderMainVO) s[0].getParentVO();
-			if (headvo.getBillstatus() != IBillStatus.FREE){
-				throw new ValidationException("非自由态单据不允许审批");
-			}
-			headvo.setBillstatus(IBillStatus.CHECKPASS);
-			headvo.setPk_approver(PubEnv.getPk_user());
-		//}
-		//((OrderDataModel)this.frameUI.getDataModel()).execApprove(s[selectedRow]);
-		((OrderDataModel)this.frameUI.getDataModel()).execApprove(s[0]);
+	//	HRAggVO [] s = new HRAggVO[] {this.getSelection(mainMgrPanel)};
+		
 		boolean boo = this.frameUI.getBillCardPanel().isShowing();
+		HRAggVO [] s = null;
+		if(boo) {
+			HRAggVO	aggvo=(HRAggVO) mainMgrPanel.getMainBillCardPanel().getDeleteData();
+			s=new HRAggVO[]{aggvo};
+		}else {
+			s=(HRAggVO[]) mainMgrPanel.getMainBillListPanel().getDeleteData();
+		}
+		
+		if(s != null) {
+			for (int i = 0; i < s.length; i++) {
+				OrderMainVO headvo = (OrderMainVO) s[i].getParentVO();
+				//检查出入库页签数据和材料明细选择条数一样
+				
+				OrderIssueVO[] issuervos=  (OrderIssueVO[]) s[i].getTableVO("mmpac_order_issue");
+				List<OrderIssueVO> execList = new ArrayList<OrderIssueVO>();
+				for(OrderIssueVO issuervo:issuervos) {
+					Object bdef5 = issuervo.getBdef5();//是否委外
+					if(bdef5 != null && bdef5.equals("Y") ) {
+						execList.add(issuervo);
+					}
+				}
+				List<OrderOtherinVO> invoslis=new ArrayList<OrderOtherinVO>();
+				List<OrderOtheroutVO> outvoslis=new ArrayList<OrderOtheroutVO>();
+				
+				OrderOtherinVO[] invos=  (OrderOtherinVO[]) s[i].getTableVO("mmpac_order_otherin");
+		
+				OrderOtheroutVO[] outvos=  (OrderOtheroutVO[]) s[i].getTableVO("mmpac_order_otherout");
+				
+				if(null!=invos) {
+					invoslis=Arrays.asList(invos);
+				}
+				
+				if(null!=outvos) {
+					outvoslis=Arrays.asList(outvos);
+				}
+				
+				
+				if(execList.size()!=invoslis.size() || execList.size()!=outvoslis.size()) {
+				  //	throw new ValidationException("【委外出入库】和【材料明细】所选不一样,请重新生成出入库页签!");
+					
+				  int answer = MessageDialog.showYesNoDlg(this.frameUI, "提示", "【委外出入库】和【材料明细】选择条数不一样,是否继续?");
+				    if (UIDialog.ID_NO == answer) {
+				                   return;
+				       }
+				
+				}
+				
+				
+				if (headvo.getBillstatus() != IBillStatus.FREE){
+					throw new ValidationException("非自由态单据不允许审批");
+				}
+				headvo.setBillstatus(IBillStatus.CHECKPASS);
+				headvo.setPk_approver(PubEnv.getPk_user());
+				((OrderDataModel)this.frameUI.getDataModel()).execApprove(s[i]);
+			}
+		}
+
 		if(boo) {
-			this.frameUI.getBillCardPanel().setBillValueVO(s[0]);
+			this.frameUI.getBillCardPanel().setBillValueVO(s[0]);//卡片界面就1条数据
 		}else {
 			getFrameUI().getBtnManager().getCmdByID(AbstractBtnReg.SYSBTN_REFRESH).execute();
 		}
+		
+		
 	}
 }

+ 30 - 8
mmpac/mmpac/src/client/u8c/ui/mmpac/action/OrderEditAction.java

@@ -7,18 +7,28 @@ import nc.ui.hr.frame.impl.MainBillMgrPanel;
 import nc.ui.hr.frame.state.StateRegister;
 
 import nc.vo.hr.tools.pub.HRAggVO;
+import nc.vo.pub.CircularlyAccessibleValueObject;
 import nc.vo.pub.ValidationException;
 import nc.vo.trade.pub.IBillStatus;
 import u8c.ui.mmpac.panel.OrderMainPanel;
 import u8c.ui.mmpac.panel.OrderTestUI;
 import u8c.vo.OrderMainVO;
+import u8c.vo.OrderOtherinVO;
 
 public class OrderEditAction extends BrowseFromListToCardAction{
+	OrderTestUI frameUI = null;
 	public OrderEditAction(FrameUI frameUI) {
 		super(frameUI);
+		this.frameUI = (OrderTestUI) frameUI;
 	}
 
 	public void execute() throws Exception {
+		
+		frameUI.getBillCardPanel().getBillModel("mmpac_order_in").setEnabledAllItems(true);
+		frameUI.getBillCardPanel().getBillModel("mmpac_order_issue").setEnabledAllItems(true);
+		frameUI.getBillCardPanel().getBillModel("mmpac_order_otherin").setEnabledAllItems(true);
+		frameUI.getBillCardPanel().getBillModel("mmpac_order_otherout").setEnabledAllItems(true);
+		
 		MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
 		//int selectedRow = ((OrderMainPanel) getMainPanel()).getSelectedRow();
 		//HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
@@ -30,15 +40,27 @@ public class OrderEditAction extends BrowseFromListToCardAction{
 			}
 		//}
 		
-		super.execute();
-		
-		OrderTestUI ui = (OrderTestUI)this.getFrameUI();
-		ui.getBillCardPanel().setHeadItem(OrderMainVO.PK_CORP, PubEnv.getPk_corp());
+		    for(int i=0; i<frameUI.getBillCardPanel().getHeadItems().length;i++) {
+	            //表头不可编辑
+		    	frameUI.getBillCardPanel().getHeadItems()[i].setEdit(true);
+	        	
+	        }
+
+			
+		//    setNotEditAllowedRows(null); //清除不可编辑行
+		    
+	    super.execute();
 		
-		getDataModel().setRollBackState(getDataModel().getCurrentState());
-        
+//		OrderTestUI ui = (OrderTestUI)this.getFrameUI();
+//		
+//		ui.getBillCardPanel().setHeadItem(OrderMainVO.PK_CORP, PubEnv.getPk_corp());
+	    
+//		getDataModel().setRollBackState(getDataModel().getCurrentState());
+	    
+	    getDataModel().setRollBackData(getDataModel().getRollBackState());
+	 
         getDataModel().setCurrentState(StateRegister.STATE_EDIT);
-        
-        getMainPanel().setMainPanelEnabled(true);
+      
+      
 	}
 }

+ 1 - 1
mmpac/mmpac/src/client/u8c/ui/mmpac/action/OrderQueryAction.java

@@ -4,7 +4,7 @@ import nc.ui.hr.frame.FrameUI;
 import nc.ui.hr.frame.action.QueryAction;
 import nc.ui.hr.global.Global;
 
-public class OrderQueryAction extends QueryAction{
+public class OrderQueryAction extends MmpacQueryAction{
 	public OrderQueryAction(FrameUI frameUI) {
 		super(frameUI);
 	}

+ 1 - 1
mmpac/mmpac/src/client/u8c/ui/mmpac/action/OrderSaveAction.java

@@ -55,7 +55,7 @@ public class OrderSaveAction extends SaveAction{
 				mainMgrPanel.getBillCardPanel().setHeadItem("dr", 0);
 			}
 		}
-		
+//		getDataModel().setCurrentState(StateRegister.STATE_EDIT); //add by ZTH  处理委外按钮后保存报错=== 出现问题明显条数翻倍了
 		super.execute();
 		frameUI.getDataModel().setCurrentState(StateRegister.STATE_NOTEDIT); 
 	}

+ 21 - 12
mmpac/mmpac/src/client/u8c/ui/mmpac/action/OrderUnApproveAction.java

@@ -30,20 +30,29 @@ public class OrderUnApproveAction extends AbstractAction {
 		MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
 		//int selectedRow = ((OrderMainPanel) getMainPanel()).getSelectedRow();
 		//HRAggVO [] s = (HRAggVO[]) mainMgrPanel.getMainBillListPanel().getData();
-		HRAggVO [] s = new HRAggVO[] {this.getSelection(mainMgrPanel)};
-		if (null != s && s != null){
-			//OrderMainVO headvo = (OrderMainVO) s[selectedRow].getParentVO();
-			OrderMainVO headvo = (OrderMainVO) s[0].getParentVO();
-			GetBaseDAOUtil.getGeneral(headvo.getPk_order());
-			if (headvo.getBillstatus() != IBillStatus.CHECKPASS){
-				throw new ValidationException("非审批态单据不允许取消审批");
+	//	HRAggVO [] s = new HRAggVO[] {this.getSelection(mainMgrPanel)};
+		boolean boo = this.frameUI.getBillCardPanel().isShowing();
+		HRAggVO [] s = null;
+		if(boo) {
+			HRAggVO	aggvo=(HRAggVO) mainMgrPanel.getMainBillCardPanel().getDeleteData();
+			s=new HRAggVO[]{aggvo};
+		}else {
+			s=(HRAggVO[]) mainMgrPanel.getMainBillListPanel().getDeleteData();
+		}
+		
+		if (null != s ){
+			for (int i = 0; i < s.length; i++) {
+				OrderMainVO headvo = (OrderMainVO) s[i].getParentVO();
+				GetBaseDAOUtil.getGeneral(headvo.getPk_order());
+				if (headvo.getBillstatus() != IBillStatus.CHECKPASS){
+					throw new ValidationException("非审批态单据不允许取消审批");
+				}
+				headvo.setBillstatus(IBillStatus.FREE);
+				headvo.setPk_approver("");
+				((OrderDataModel)this.frameUI.getDataModel()).execApprove(s[i]);
 			}
-			headvo.setBillstatus(IBillStatus.FREE);
-			headvo.setPk_approver("");
+			
 		}
-		//((OrderDataModel)this.frameUI.getDataModel()).execApprove(s[selectedRow]);
-		((OrderDataModel)this.frameUI.getDataModel()).execApprove(s[0]);
-		boolean boo = this.frameUI.getBillCardPanel().isShowing();
 		if(boo) {
 			this.frameUI.getBillCardPanel().setBillValueVO(s[0]);
 		}else {

+ 56 - 31
mmpac/mmpac/src/client/u8c/ui/mmpac/action/PushOtherInAction.java

@@ -20,8 +20,10 @@ import nc.vo.hr.tools.pub.HRAggVO;
 import nc.vo.ic.pub.bill.GeneralBillHeaderVO;
 import nc.vo.ic.pub.bill.GeneralBillItemVO;
 import nc.vo.ic.pub.bill.GeneralBillVO;
+import nc.vo.ic.pub.locator.LocatorVO;
 import nc.vo.pub.BusinessException;
 import nc.vo.pub.CircularlyAccessibleValueObject;
+import nc.vo.pub.VOStatus;
 import nc.vo.pub.ValidationException;
 import nc.vo.pub.lang.UFBoolean;
 import nc.vo.pub.lang.UFDate;
@@ -197,35 +199,47 @@ public class PushOtherInAction extends AbstractAction{
 					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", storcode, 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()));//换算率
-					}
+//					if(cmaterialcode.startsWith("MA")) {
+//						InvbasdocVO  invbasvo = GetBaseDAOUtil.getInvVO(cmaterialcode);
+//					    String pk_invbasdoc2 = invbasvo.getPrimaryKey();
+//					    Object objbdef6 =getHandNum("1001", storcode, 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.setNneedinassistnum(invo.getNastnum());//应入辅数量
-					String pkdw=getpkmeasdoc(invo.getCastunitid());
-					itemvo.setCastunitid(pkdw);//辅计量单位ID 
+					//辅数量不为空,需校验
+					if(null!=invo.getNastnum() && invo.getNastnum().compareTo(UFDouble.ZERO_DBL)>0) {
+						 if(null==bdef6 || "".equals(bdef6)|| null==invo.getNum() ) {
+								MessageDialog.showErrorDlg(frameUI, "错误", "请检查换算率或者主数量不能为空!");
+								return;
+							}
+						 
+							itemvo.setNinassistnum (invo.getNastnum());//实入辅数量
+							itemvo.setNneedinassistnum(invo.getNastnum());//应入辅数量
+							itemvo.setHsl(new UFDouble(invo.getBdef6()));//换算率
+							String pkdw=getpkmeasdoc(invo.getCastunitid());
+							itemvo.setCastunitid(pkdw);//辅计量单位ID 
+					}
+				   
+				    itemvo.setNshouldinnum(invo.getNum());//应入数量
+					itemvo.setNinnum(invo.getNum());//实入数量
 					itemvo.setAttributeValue("processcost", invo.getNmny());
 					itemvo.setPk_calbody(icheadvo.getPk_calbody());
 					itemvo.setVbatchcode(vbatcode);
@@ -262,12 +276,23 @@ public class PushOtherInAction extends AbstractAction{
 					itemvo.setAttributeValue("vuserdef14",invo.getBdef3());//玻璃编号
 //					itemvo.setAttributeValue("vuserdef15",vector.get()==null?null:vector.get().toString());//开票类型
 					itemvo.setAttributeValue("vuserdef17",invo.getConf());//窗号
+					itemvo.setAttributeValue("vuserdef16",invo.getPrjtypename());//仓位
 					itemvo.setAttributeValue("vuserdef18",invo.getWeight());//米重
 					itemvo.setAttributeValue("vuserdef19",invo.getRound());//装饰面周长
 					itemvo.setAttributeValue("vuserdef20",invo.getPrjtypecode());//专用区
 					itemvo.setAttributeValue("pk_defdoc20",getzyqpk("专用区",invo.getPrjtypecode()));//专用区
 					
-					
+					/************************货位*********************************/
+//					itemvo.setCspaceid("");
+//					LocatorVO  locatorvo  = new LocatorVO();
+////					locatorvo.setCspaceid(cspaceid);//货位主键
+//					
+////					locatorvo.setCwarehouseid(cwarehouseid);//库存仓库 
+////					locatorvo.setNinspacenum(new UFDouble(ninnum));//实入数量
+//					locatorvo.setStatus(VOStatus.NEW);
+//					locatorvo.setPk_corp(pk_corp);
+//					itemvo.setLocator(new LocatorVO[]{locatorvo});
+					/************************货位*********************************/
 					itemvos[i] = itemvo;
 //					lisbillvos.add(itemvo);
 				}
@@ -302,7 +327,7 @@ public class PushOtherInAction extends AbstractAction{
 			invo.setExecnastnum(invo.getNastnum());
 		}
 			ivo.updateVOArray(invos);
-			this.frameUI.getBillCardPanel().getBillModel().setBodyDataVO(invos);
+			this.frameUI.getBillCardPanel().getBillModel("mmpac_order_otherin").setBodyDataVO(invos);
 	}
 	
 	
@@ -438,7 +463,7 @@ public class PushOtherInAction extends AbstractAction{
     	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(" nonhandnum/NULLIF(nonhandastnum, 0) as hsl");
     		sql.append(" FROM");
     		sql.append(" ic_onhandnum");
     		sql.append(" WHERE");

+ 48 - 33
mmpac/mmpac/src/client/u8c/ui/mmpac/action/PushOtherOutAction.java

@@ -202,40 +202,54 @@ public class PushOtherOutAction extends AbstractAction{
 					String bdef6=outvo.getBdef6();
 					
 					//MA开头的型材没有主数量
-					if(cmaterialcode.startsWith("MA")) {
-						InvbasdocVO  invbasvo = GetBaseDAOUtil.getInvVO(cmaterialcode);
-					    String pk_invbasdoc2 = invbasvo.getPrimaryKey();
-					    Object objbdef6 =getHandNum("1001", storcode, 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()));//换算率
+//					if(cmaterialcode.startsWith("MA")) {
+//						InvbasdocVO  invbasvo = GetBaseDAOUtil.getInvVO(cmaterialcode);
+//					    String pk_invbasdoc2 = invbasvo.getPrimaryKey();
+//					    Object objbdef6 =getHandNum("1001", storcode, 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()));//换算率
+//					}
+					
+					
+					//辅数量不为空,需校验
+					if(null!=outvo.getNastnum() && outvo.getNastnum().compareTo(UFDouble.ZERO_DBL)>0) {
+						 if(null==bdef6 || "".equals(bdef6)|| null==outvo.getNum() ) {
+								MessageDialog.showErrorDlg(frameUI, "错误", "请检查换算率或者主数量不能为空!");
+								return;
+							}
+						 
+							itemvo.setNoutassistnum(outvo.getNastnum());//实出辅数量
+							itemvo.setNshouldoutassistnum(outvo.getNastnum());//应出辅数量
+							itemvo.setHsl(new UFDouble(outvo.getBdef6()));//换算率
+							String castunitid=getpk(outvo.getCastunitid()==null?"":outvo.getCastunitid().toString());
+							itemvo.setCastunitid(castunitid);//辅计量单位ID 
+							itemvo.setCastunitname(castunitid==null?"":castunitid.toString());//辅计量单位名称
 					}
 					
-//					itemvo.setNoutnum(outvo.getNum());//实出数量
-//					itemvo.setNshouldoutnum(outvo.getNum());//应出数量
-//					itemvo.setHsl(new UFDouble(outvo.getBdef6()));//换算率	
-					itemvo.setNoutassistnum(outvo.getNastnum());//实出辅数量
-					itemvo.setNshouldoutassistnum(outvo.getNastnum());//应出辅数量
 					
-					String castunitid=getpk(outvo.getCastunitid()==null?"":outvo.getCastunitid().toString());
-					itemvo.setCastunitid(castunitid);//辅计量单位ID 
-					itemvo.setCastunitname(castunitid==null?"":castunitid.toString());//辅计量单位名称
+					
+					
+					itemvo.setNoutnum(outvo.getNum());//实出数量
+					itemvo.setNshouldoutnum(outvo.getNum());//应出数量
+//					itemvo.setHsl(new UFDouble(outvo.getBdef6()));//换算率	
+				
 					
 					itemvo.setPk_calbody(icheadvo.getPk_calbody());
 					itemvo.setVbatchcode(vbatcode);//批次号
@@ -273,6 +287,7 @@ public class PushOtherOutAction extends AbstractAction{
 					itemvo.setAttributeValue("vuserdef14",outvo.getBdef3());//玻璃编号
 //					itemvo.setAttributeValue("vuserdef15",vector.get()==null?null:vector.get().toString());//开票类型
 					itemvo.setAttributeValue("vuserdef17",outvo.getConf());//窗号
+					itemvo.setAttributeValue("vuserdef16",outvo.getPrjtypename());//仓位
 					itemvo.setAttributeValue("vuserdef18",outvo.getWeight());//米重
 					itemvo.setAttributeValue("vuserdef19",outvo.getRound());//装饰面周长
 					itemvo.setAttributeValue("vuserdef20",outvo.getPrjtypecode());//专用区
@@ -304,7 +319,7 @@ public class PushOtherOutAction extends AbstractAction{
 		}
 			ivo.updateVOArray(outvos);
 			
-			this.frameUI.getBillCardPanel().getBillModel().setBodyDataVO(outvos);
+			this.frameUI.getBillCardPanel().getBillModel("mmpac_order_otherout").setBodyDataVO(outvos);
 	}
 	
 
@@ -412,7 +427,7 @@ public class PushOtherOutAction extends AbstractAction{
      	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(" nonhandnum/NULLIF(nonhandastnum, 0) as hsl");
      		sql.append(" FROM");
      		sql.append(" ic_onhandnum");
      		sql.append(" WHERE");

+ 1 - 0
mmpac/mmpac/src/client/u8c/ui/mmpac/action/TOProductOutDialog.java

@@ -594,6 +594,7 @@ public class TOProductOutDialog extends UIDialog implements ActionListener,BillE
 						itemvo.setAttributeValue("vuserdef17",vector.get(19)==null?null:vector.get(19).toString());//窗号
 						itemvo.setAttributeValue("vuserdef18",vector.get(17)==null?null:vector.get(17).toString());//米重
 						itemvo.setAttributeValue("vuserdef19",vector.get(18)==null?null:vector.get(18).toString());//装饰面周长
+						itemvo.setAttributeValue("vuserdef16",vector.get(7)==null?null:vector.get(7).toString());//仓位
 						itemvo.setAttributeValue("vuserdef20",vector.get(6)==null?null:vector.get(6).toString());//专用区
 						itemvo.setAttributeValue("pk_defdoc20",getzyqpk("专用区",vector.get(6)==null?null:vector.get(6).toString()));//专用区
 						

+ 18 - 5
mmpac/mmpac/src/client/u8c/ui/mmpac/action/ToMaterialOutDialog.java

@@ -666,6 +666,11 @@ public class ToMaterialOutDialog extends UIDialog implements ActionListener,Bill
 			StringBuffer errmsg = new StringBuffer();
 			//数量校验
 			try {
+				
+				//查询参数,允许超订单数量发货  Y允许  N不允许
+				String sqlma="SELECT DEFAULTVALUE FROM pub_sysinittemp WHERE paratype = '1' AND INITCODE='MA02' ";
+				Object valueparobj=iuap.executeQuery(sqlma, new ColumnProcessor());
+				
 				int execsize = 0;//勾选的条数
 				for(int i = 0; i < vectors.size(); i++) {
 					Vector<Object> vector = (Vector<Object>)vectors.get(i);
@@ -675,12 +680,19 @@ public class ToMaterialOutDialog extends UIDialog implements ActionListener,Bill
 							continue;
 						}
 						execsize = execsize + 1;
-						UFDouble execnum = new UFDouble(vector.get(1).toString());//本次执行数量
-						UFDouble nnum =  vector.get(22) == null?new UFDouble(0):new UFDouble(vector.get(22).toString());//主数量
-						UFDouble usednum = vector.get(30) == null?new UFDouble(0):new UFDouble(vector.get(30).toString());//已执行主数量
-						if(execnum.compareTo(nnum.sub(usednum)) > 0 && nnum.compareTo(UFDouble.ZERO_DBL)>0) {
-							errmsg.append("第"+(i+1)+"行本次执行数量超过订单剩余数量!");
+						
+						if(!(null!=valueparobj && "Y".equals(valueparobj.toString()))) {
+							UFDouble execnum = new UFDouble(vector.get(1).toString());//本次执行数量
+							UFDouble nnum =  vector.get(22) == null?new UFDouble(0):new UFDouble(vector.get(22).toString());//主数量
+							UFDouble usednum = vector.get(30) == null?new UFDouble(0):new UFDouble(vector.get(30).toString());//已执行主数量
+							if(execnum.compareTo(nnum.sub(usednum)) > 0 && nnum.compareTo(UFDouble.ZERO_DBL)>0) {
+								errmsg.append("第"+(i+1)+"行本次执行数量超过订单剩余数量!");
+							}	
+							
+							
 						}
+						
+				
 					}
 				}
 				
@@ -875,6 +887,7 @@ public class ToMaterialOutDialog extends UIDialog implements ActionListener,Bill
 						itemvo.setAttributeValue("vuserdef17",vector.get(18)==null?null:vector.get(18).toString());//窗号
 						itemvo.setAttributeValue("vuserdef18",vector.get(16)==null?null:vector.get(16).toString());//米重
 						itemvo.setAttributeValue("vuserdef19",vector.get(17)==null?null:vector.get(17).toString());//装饰面周长
+						itemvo.setAttributeValue("vuserdef16",vector.get(6)==null?null:vector.get(6).toString());//仓位
 						itemvo.setAttributeValue("vuserdef20",vector.get(5)==null?null:vector.get(5).toString());//专用区
 						itemvo.setAttributeValue("pk_defdoc20",getzyqpk("专用区",vector.get(5)==null?null:vector.get(5).toString()));//专用区
 						

+ 13 - 5
mmpac/mmpac/src/client/u8c/ui/mmpac/action/ToSaleOutDialog.java

@@ -452,6 +452,10 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 			StringBuffer errmsg = new StringBuffer();
 			//数量校验
 			try {
+				
+				//查询参数,允许超订单数量发货  Y允许  N不允许
+				String sqlma="SELECT DEFAULTVALUE FROM pub_sysinittemp WHERE paratype = '1' AND INITCODE='MA02' ";
+				Object valueparobj=iuap.executeQuery(sqlma, new ColumnProcessor());
 				int execsize = 0;//勾选的条数
 				for(int i = 0; i < vectors.size(); i++) {
 					Vector<Object> vector = (Vector<Object>)vectors.get(i);
@@ -461,11 +465,14 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 							continue;
 						}
 						execsize = execsize + 1;
-						UFDouble execnum = new UFDouble(vector.get(1).toString());//本次执行数量
-						UFDouble nnum = new UFDouble(vector.get(23).toString());//主数量
-						UFDouble usednum = vector.get(51) == null?new UFDouble(0):new UFDouble(vector.get(51).toString());//已执行主数量
-						if(execnum.compareTo(nnum.sub(usednum)) > 0 && nnum.compareTo(UFDouble.ZERO_DBL)>0 ) {
-							errmsg.append("第"+(i+1)+"行本次执行数量超过订单剩余数量!");
+						
+						if(!(null!=valueparobj && "Y".equals(valueparobj.toString()))) {
+							UFDouble execnum = new UFDouble(vector.get(1).toString());//本次执行数量
+							UFDouble nnum = new UFDouble(vector.get(23).toString());//主数量
+							UFDouble usednum = vector.get(51) == null?new UFDouble(0):new UFDouble(vector.get(51).toString());//已执行主数量
+							if(execnum.compareTo(nnum.sub(usednum)) > 0 && nnum.compareTo(UFDouble.ZERO_DBL)>0 ) {
+								errmsg.append("第"+(i+1)+"行本次执行数量超过订单剩余数量!");
+							}
 						}
 					}
 				}
@@ -706,6 +713,7 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 						sbvo.setAttributeValue("vdef17",vector.get(19)==null?null:vector.get(19).toString());//窗号
 						sbvo.setAttributeValue("vdef18",vector.get(17)==null?null:vector.get(17).toString());//米重
 						sbvo.setAttributeValue("vdef19",vector.get(18)==null?null:vector.get(18).toString());//装饰面周长
+						sbvo.setAttributeValue("vdef16",vector.get(7)==null?null:vector.get(7).toString());//仓位
 						sbvo.setAttributeValue("vdef20",vector.get(6)==null?null:vector.get(6).toString());//专用区
 						sbvo.setAttributeValue("pk_defdoc20",getzyqpk("专用区",vector.get(6)==null?null:vector.get(6).toString()));//专用区