Przeglądaj źródła

生产总订单生单优化

zthwr 10 miesięcy temu
rodzic
commit
369d856253

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

@@ -150,7 +150,7 @@ public class TOProductOutDialog extends UIDialog implements ActionListener,BillE
 			try {
 				ivjUIPanel0 = new UIPanel();
 				ivjUIPanel0.setLayout(new FlowLayout(FlowLayout.LEFT));
-				ivjUIPanel0.add(getQueryBtn());
+	//			ivjUIPanel0.add(getQueryBtn());
 				ivjUIPanel0.add(getSelectallBtn());
 				ivjUIPanel0.add(getCancelallBtn());
 			} catch (Throwable ivjExc) {

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

@@ -822,7 +822,7 @@ public class ToMaterialOutDialog extends UIDialog implements ActionListener,Bill
 						if(Hsl != null) {
 							UFDouble ninassistnum = new UFDouble(ninnum.div(Hsl).toString(),2);
 							itemvo.setNoutassistnum(new UFDouble(ninassistnum));//实出辅数量
-							itemvo.setNshouldoutassistnum(ninassistnum);//应辅数量 
+							itemvo.setNshouldoutassistnum(ninassistnum);//应辅数量 
 						}
 					
 						itemvo.setAttributeValue("processcost", new UFDouble(vector.get(24)==null?"0":vector.get(24).toString()));

+ 214 - 46
mmpac/mmpac/src/client/u8c/ui/mmpac/action/ToSaleOutDialog.java

@@ -32,6 +32,7 @@ import nc.jdbc.framework.generator.IdGenerator;
 import nc.jdbc.framework.generator.SequenceGenerator;
 import nc.jdbc.framework.processor.BeanListProcessor;
 import nc.jdbc.framework.processor.ColumnProcessor;
+import nc.jdbc.framework.processor.MapProcessor;
 import nc.md.data.access.NCObject;
 import nc.md.persist.framework.IMDPersistenceQueryService;
 import nc.ui.pub.ClientEnvironment;
@@ -95,6 +96,7 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 	private  ISaleOrder isoservice = (ISaleOrder) NCLocator.getInstance().lookup(ISaleOrder.class.getName());
 	private  IOrderTotalInfo iorder = NCLocator.getInstance().lookup(IOrderTotalInfo.class);
 	private IplatFormEntry iIplatFormEntry = NCLocator.getInstance().lookup(IplatFormEntry.class);
+	private IUAPQueryBS iuap=(IUAPQueryBS) NCLocator.getInstance().lookup(IUAPQueryBS.class.getName());
 	public ToSaleOutDialog(HRAggVO aggvo) {
 		super();
 		initialize(aggvo);
@@ -169,7 +171,7 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 			try {
 				ivjUIPanel0 = new UIPanel();
 				ivjUIPanel0.setLayout(new FlowLayout(FlowLayout.LEFT));
-				ivjUIPanel0.add(getQueryBtn());
+			//	ivjUIPanel0.add(getQueryBtn());
 				ivjUIPanel0.add(getSelectallBtn());
 				ivjUIPanel0.add(getCancelallBtn());
 			} catch (Throwable ivjExc) {
@@ -326,10 +328,20 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 			for(OrderInVO invo:orderinvos) {
 				UFDouble num = invo.getNum() == null ? new UFDouble(0) : invo.getNum();
 				UFDouble bdef8 = invo.getBdef8()== null ? UFDouble.ZERO_DBL :new UFDouble(invo.getBdef8());//销售出库已执行主数量
-				if(num.sub(bdef8).compareTo(UFDouble.ZERO_DBL)==0) {
+				
+				UFDouble nastnum=invo.getNastnum() == null ? UFDouble.ZERO_DBL : invo.getNastnum();//辅数量
+				UFDouble exenastnum = invo.getBdef9() == null ? UFDouble.ZERO_DBL : new UFDouble(invo.getBdef9());//已执行辅数量
+				
+				if(num.sub(bdef8).compareTo(UFDouble.ZERO_DBL)==0  && num.compareTo(UFDouble.ZERO_DBL)>0) {
 					continue;
 				}
-				invo.setBdef5(num.sub(bdef8).toString());
+				invo.setBdef5(num.sub(bdef8).setScale(2, UFDouble.ROUND_HALF_UP).toString());
+				
+				//没有辅数量
+				if(nastnum.compareTo(UFDouble.ZERO_DBL)!=0 ) {
+					invo.setBdef7(nastnum.sub(exenastnum).setScale(2, UFDouble.ROUND_HALF_UP).toString());//本次执行辅数量
+				}
+				
 				invos.add(invo);
 			}
 			
@@ -342,13 +354,21 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 				OrderInVO invo = (OrderInVO) vo;
 				UFDouble num = invo.getNum() == null ? new UFDouble(0) : invo.getNum();
 				UFDouble bdef8 = invo.getBdef8() == null ?UFDouble.ZERO_DBL : new UFDouble(invo.getBdef8());
+				UFDouble nastnum=invo.getNastnum() == null ? UFDouble.ZERO_DBL : invo.getNastnum();//辅数量
+				UFDouble exenastnum = invo.getBdef9() == null ? UFDouble.ZERO_DBL : new UFDouble(invo.getBdef9());//已执行辅数量
 //				if(num.equals(execnum) && num.equals(new UFDouble(0))) {
 //					continue;
 //				}
-				if(num.sub(bdef8).compareTo(UFDouble.ZERO_DBL)==0) {
+				if(num.sub(bdef8).compareTo(UFDouble.ZERO_DBL)==0  && num.compareTo(UFDouble.ZERO_DBL)>0) {
 					continue;
 				}
-				invo.setBdef5(num.sub(bdef8).toString());
+				
+				//没有辅数量
+				if(nastnum.compareTo(UFDouble.ZERO_DBL)!=0 ) {
+					invo.setBdef7(nastnum.sub(exenastnum).setScale(2, UFDouble.ROUND_HALF_UP).toString());//本次执行辅数量
+				}
+				
+				invo.setBdef5(num.sub(bdef8).setScale(2, UFDouble.ROUND_HALF_UP).toString());
 				invos.add(invo);
 			}
 		}
@@ -362,9 +382,41 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 	}
 
 	@Override
-	public void afterEdit(BillEditEvent var1) {
-		// TODO Auto-generated method stub
-		
+	public void afterEdit(BillEditEvent arg0) {
+		  Object  objbdef6=this.jlcardPanel.getBodyValueAt(arg0.getRow(), "bdef6");//换算率
+		  Object  objnastnum=this.jlcardPanel.getBodyValueAt(arg0.getRow(), "nastnum");//辅数量
+		  Object  objnum=this.jlcardPanel.getBodyValueAt(arg0.getRow(), "num");//主数量
+		  
+		  if(null!=objnastnum && "".equals(objnastnum.toString()) && (null==objbdef6 || "".equals(objbdef6.toString()))) {
+			  MessageDialog.showErrorDlg(mainpanel, "错误", "请检查换算率不能为空!");
+			  this.jlcardPanel.setBodyValueAt(false, arg0.getRow(), "bdef4");
+			  return;
+		  }
+		  //本次执行主数量
+		  if("bdef5".equals(arg0.getKey())) {
+			  String value=arg0.getValue().toString();//填写的主数量
+			  
+			  UFDouble  ufbdef7=new UFDouble(value).div 
+					  (new UFDouble(objnum.toString()).div(new UFDouble(objnastnum.toString()))).setScale(2, UFDouble.ROUND_HALF_UP);
+			  
+			  this.jlcardPanel.setBodyValueAt(ufbdef7, arg0.getRow(), "bdef7");//本次执行辅数量
+		  }
+		  
+		  //本次执行辅数量
+		  if("bdef7".equals(arg0.getKey())) {
+	          String value=arg0.getValue().toString();//填写的辅数量
+			  
+	          if(null!=objnastnum && !"".equals(objnastnum.toString())) {
+	        	  
+	        	  UFDouble  ufbdef5=new UFDouble(value).multiply
+	        			  (new UFDouble(objnum.toString()).div(new UFDouble(objnastnum.toString()))).setScale(2, UFDouble.ROUND_HALF_UP);
+	    		  
+	    		  this.jlcardPanel.setBodyValueAt(ufbdef5, arg0.getRow(), "bdef5");//本次执行辅数量
+	          }else {
+	        	  MessageDialog.showHintDlg(mainpanel, "提示", "此存货没有辅计量单位!");
+	        	  this.jlcardPanel.setBodyValueAt(null, arg0.getRow(), "bdef7");//本次执行辅数量
+	          }
+		 }
 	}
 
 	@Override
@@ -410,9 +462,9 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 						}
 						execsize = execsize + 1;
 						UFDouble execnum = new UFDouble(vector.get(1).toString());//本次执行数量
-						UFDouble nnum = new UFDouble(vector.get(22).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) {
+						if(execnum.compareTo(nnum.sub(usednum)) > 0 && nnum.compareTo(UFDouble.ZERO_DBL)>0 ) {
 							errmsg.append("第"+(i+1)+"行本次执行数量超过订单剩余数量!");
 						}
 					}
@@ -436,14 +488,35 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 				SaleOrderVO [] saleaggvos=new SaleOrderVO [1];
 				SaleOrderVO  saleaggvo=new SaleOrderVO();
 				SaleorderHVO saleheadvo =new  SaleorderHVO();
+				
+				//项目编码 pk_defdoc9
+//				saleheadvo.setAttributeValue("pk_defdoc9", prjcode);
+//				//项目名称pk_defdoc10
+//				saleheadvo.setAttributeValue("pk_defdoc10", prjcode);
+//				//加工单号pk_defdoc2
+//				saleheadvo.setAttributeValue("pk_defdoc2", headvo.getDef1());
+//				saleheadvo.setAttributeValue("pk_defdoc8", billtype);//业务类型
+				
+				
+				Map<String,String> mapcodename=getprojectmap(prjcode);
+				//项目编码 
+			//	saleheadvo.setAttributeValue("vuserdef9",mapcodename.get("jobcode") );
 				//项目编码 pk_defdoc9
-				saleheadvo.setAttributeValue("pk_defdoc9", prjcode);
+			//	saleheadvo.setAttributeValue("pk_defdoc9", prjcode);
+				//项目名称
+				saleheadvo.setAttributeValue("vdef10", mapcodename.get("jobname"));
 				//项目名称pk_defdoc10
-				saleheadvo.setAttributeValue("pk_defdoc10", prjcode);
-				//加工单号pk_defdoc2
-				saleheadvo.setAttributeValue("pk_defdoc2", headvo.getDef1());
+				saleheadvo.setAttributeValue("pk_defdoc10", prjcode);						
+				//加工单号
+				saleheadvo.setAttributeValue("vdef1", headvo.getDef1());
+			
+				//业务类型
+				saleheadvo.setAttributeValue("vdef7", billtype.trim());
+				
+				saleheadvo.setAttributeValue("pk_defdoc7",getpkdefdoc(billtype.trim()));
+				
+				
 				saleheadvo.setVnote("来源生产总订单");//备注
-				saleheadvo.setAttributeValue("pk_defdoc8", billtype);//业务类型
 				saleheadvo.setAttributeValue("bcooptopo", "N");//是否已协同生成采购订单
 				saleheadvo.setBfreecustflag(UFBoolean.FALSE);//是否散户
 				saleheadvo.setBinitflag(UFBoolean.FALSE);//期初标志
@@ -479,13 +552,14 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 				saleaggvo.setParentVO(saleheadvo);
 				SaleorderBVO[]  salebodyvos=new SaleorderBVO[execsize];
 				Map<String, UFDouble> updatemap = new HashMap<>();
+				Map<String, UFDouble> updatfzemap = new HashMap<>();
 				int k = 0;
 				for(int j = 0; j < vectors.size(); j++) {
 					Vector<Object> vector = (Vector<Object>)vectors.get(j);
 					//自定义项4为勾选按钮 :勾选为Y 没有勾选是null
 					if(null!=vector.get(0) &&  "Y".equals(vector.get(0).toString())){
 						SaleorderBVO sbvo = new SaleorderBVO();
-						String cmaterialcode = vector.get(8).toString();
+						String cmaterialcode = vector.get(9).toString();
 						String pk_invbasdoc = "";//存货pk管理档案主键
 						if(cmaterialcode.startsWith("0001")) {
 							pk_invbasdoc = cmaterialcode;
@@ -522,26 +596,30 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 						sbvo.setCprojectid(prjcode);//项目
 						
 						 //corder_bid 销售订单附表ID   creceipttype 来源单据类型
-						sbvo.setCquoteunitid(GetBaseDAOUtil.getMeasidByName(vector.get(21).toString()));//报价计量单位
+						sbvo.setCquoteunitid(GetBaseDAOUtil.getMeasidByName(vector.get(22).toString()));//报价计量单位
 						sbvo.setCreceiptcorpid(kh); // 收货单位
-						sbvo.setCunitid(GetBaseDAOUtil.getMeasidByName(vector.get(21).toString()));  // 主计量单位
-						sbvo.setCpackunitid(vector.get(28) == null ? null : GetBaseDAOUtil.getMeasidByNames(vector.get(28).toString()));  // 辅单位
+						sbvo.setCunitid(GetBaseDAOUtil.getMeasidByName(vector.get(22).toString()));  // 主计量单位
+						sbvo.setCpackunitid(vector.get(29) == null ? null : GetBaseDAOUtil.getMeasidByNames(vector.get(29).toString()));  // 辅单位
 						sbvo.setDconsigndate(PubEnv.getLoginDate());//发货日期 
 						sbvo.setDdeliverdate(PubEnv.getLoginDate()); //交货日期
 						UFDouble ninnum = vector.get(1) == null ? null : new UFDouble(vector.get(1).toString());
 						sbvo.setNnumber(ninnum);//数量
-						UFDouble Hsl = vector.get(49) == null ? null : new UFDouble(vector.get(49).toString());
+						UFDouble Hsl = vector.get(50) == null ? null : new UFDouble(vector.get(50).toString());
 						//没有换算率则辅数量为空
-						UFDouble ninassistnum =UFDouble.ZERO_DBL;
-						if(Hsl != null) {
-							ninassistnum = new UFDouble(ninnum.div(Hsl).toString(),2);
-							sbvo.setNpacknumber(new UFDouble(ninassistnum));//辅数量
-						}
+					//	UFDouble ninassistnum =UFDouble.ZERO_DBL;
+						UFDouble ninassistnum = vector.get(2) == null ? null : new UFDouble(vector.get(2).toString());//本次执行辅数量
+//						if(Hsl != null) {
+//							ninassistnum = new UFDouble(ninnum.div(Hsl).toString(),2);
+//							sbvo.setNpacknumber(new UFDouble(ninassistnum));//辅数量
+//						}
+						sbvo.setNpacknumber(ninassistnum);//辅数量
+						
+						
 						sbvo.setNquoteunitnum(ninnum);//报价单位数量
 					
 						sbvo.setFbatchstatus(1); //批次状态 
 						sbvo.setIncoconfclose("N");
-						sbvo.setCbatchid(vector.get(7)==null?"":vector.get(7).toString());//批次
+						sbvo.setCbatchid(vector.get(8)==null?"":vector.get(8).toString());//批次
 						sbvo.setNdiscountrate(new UFDouble("100"));//整单折扣 
 						sbvo.setNexchangeotobrate(UFDouble.ONE_DBL);//折本汇率
 						sbvo.setNitemdiscountrate(new UFDouble("100"));//单品折扣率 
@@ -584,29 +662,70 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 		//				sbvo.setVreceiveaddress(pk_corp);	//收货地址
 						String bidpk=UUID.randomUUID().toString().substring(0, 20);
 						sbvo.setCorder_bid(bidpk);//主键
-						sbvo.setVfree1(vector.get(12)==null?null:vector.get(12).toString());//颜色
-						sbvo.setVfree2(vector.get(14)==null?null:vector.get(14).toString());//合金
-						sbvo.setVfree3(vector.get(13)==null?null:vector.get(13).toString());//定尺
-						sbvo.setVfree4(vector.get(15)==null?null:vector.get(15).toString());//标准
-						sbvo.setAttributeValue("pk_defdoc1", vector.get(37)==null?null:vector.get(37).toString());//楼号楼层
-						sbvo.setAttributeValue("pk_defdoc2", vector.get(38)==null?null:vector.get(38).toString());//樘数(数量)
-						sbvo.setAttributeValue("pk_defdoc3", vector.get(39)==null?null:vector.get(39).toString());//框统计
-						sbvo.setAttributeValue("pk_defdoc4", vector.get(40)==null?null:vector.get(40).toString());//扇统计
-						sbvo.setAttributeValue("pk_defdoc5", vector.get(41)==null?null:vector.get(41).toString());//半成品分类
-						sbvo.setAttributeValue("pk_defdoc6", vector.get(42)==null?null:vector.get(42).toString());//面积
-						sbvo.setAttributeValue("pk_defdoc7", vector.get(43)==null?null:vector.get(43).toString());//切割长度
-						sbvo.setAttributeValue("pk_defdoc8", vector.get(44)==null?null:vector.get(44).toString());//切割角度左下
-						sbvo.setAttributeValue("pk_defdoc9", vector.get(45)==null?null:vector.get(45).toString());//切割角度右上
-						sbvo.setAttributeValue("pk_defdoc10",vector.get(46)==null?null:vector.get(46).toString());//备注
-						sbvo.setAttributeValue("pk_defdoc11",vector.get(19)==null?null:vector.get(19).toString());//宽度
-						sbvo.setAttributeValue("pk_defdoc12",vector.get(20)==null?null:vector.get(20).toString());//高度
-						sbvo.setAttributeValue("pk_defdoc13",vector.get(47)==null?null:vector.get(47).toString());//系列
-						sbvo.setAttributeValue("pk_defdoc14",vector.get(48)==null?null:vector.get(48).toString());//玻璃编号
-						sbvo.setAttributeValue("pk_defdoc20",vector.get(36)==null?null:vector.get(36).toString());//开票类型
+//						sbvo.setVfree1(vector.get(12)==null?null:vector.get(12).toString());//颜色
+//						sbvo.setVfree2(vector.get(14)==null?null:vector.get(14).toString());//合金
+//						sbvo.setVfree3(vector.get(13)==null?null:vector.get(13).toString());//定尺
+//						sbvo.setVfree4(vector.get(15)==null?null:vector.get(15).toString());//标准
+//						sbvo.setAttributeValue("pk_defdoc1", vector.get(37)==null?null:vector.get(37).toString());//楼号楼层
+//						sbvo.setAttributeValue("pk_defdoc2", vector.get(38)==null?null:vector.get(38).toString());//樘数(数量)
+//						sbvo.setAttributeValue("pk_defdoc3", vector.get(39)==null?null:vector.get(39).toString());//框统计
+//						sbvo.setAttributeValue("pk_defdoc4", vector.get(40)==null?null:vector.get(40).toString());//扇统计
+//						sbvo.setAttributeValue("pk_defdoc5", vector.get(41)==null?null:vector.get(41).toString());//半成品分类
+//						sbvo.setAttributeValue("pk_defdoc6", vector.get(42)==null?null:vector.get(42).toString());//面积
+//						sbvo.setAttributeValue("pk_defdoc7", vector.get(43)==null?null:vector.get(43).toString());//切割长度
+//						sbvo.setAttributeValue("pk_defdoc8", vector.get(44)==null?null:vector.get(44).toString());//切割角度左下
+//						sbvo.setAttributeValue("pk_defdoc9", vector.get(45)==null?null:vector.get(45).toString());//切割角度右上
+//						sbvo.setAttributeValue("pk_defdoc10",vector.get(46)==null?null:vector.get(46).toString());//备注
+//						sbvo.setAttributeValue("pk_defdoc11",vector.get(19)==null?null:vector.get(19).toString());//宽度
+//						sbvo.setAttributeValue("pk_defdoc12",vector.get(20)==null?null:vector.get(20).toString());//高度
+//						sbvo.setAttributeValue("pk_defdoc13",vector.get(47)==null?null:vector.get(47).toString());//系列
+//						sbvo.setAttributeValue("pk_defdoc14",vector.get(48)==null?null:vector.get(48).toString());//玻璃编号
+//						sbvo.setAttributeValue("pk_defdoc20",vector.get(36)==null?null:vector.get(36).toString());//开票类型
+						
+						sbvo.setVfree1(vector.get(13) == null ? null : vector.get(13).toString());//颜色
+						sbvo.setVfree2(vector.get(15) == null ? null : vector.get(15).toString());//合金
+						sbvo.setVfree3(vector.get(14) == null ? null : vector.get(14).toString());//定尺
+						sbvo.setVfree4(vector.get(16) == null ? null : vector.get(16).toString());//标准
+						
+						sbvo.setAttributeValue("vdef1", vector.get(38)==null?null:vector.get(38).toString());//楼号楼层
+						sbvo.setAttributeValue("vdef2", vector.get(39)==null?null:vector.get(39).toString());//樘数(数量)
+						sbvo.setAttributeValue("vdef3", vector.get(40)==null?null:vector.get(40).toString());//框统计
+						sbvo.setAttributeValue("vdef4", vector.get(41)==null?null:vector.get(41).toString());//扇统计
+						sbvo.setAttributeValue("vdef5", vector.get(42)==null?null:vector.get(42).toString());//半成品分类
+						sbvo.setAttributeValue("vdef6", vector.get(43)==null?null:vector.get(43).toString());//面积
+						sbvo.setAttributeValue("vdef7", vector.get(44)==null?null:vector.get(44).toString());//切割长度
+						sbvo.setAttributeValue("vdef8", vector.get(45)==null?null:vector.get(45).toString());//切割角度左下
+						sbvo.setAttributeValue("vdef9", vector.get(46)==null?null:vector.get(46).toString());//切割角度右上
+						sbvo.setAttributeValue("vdef10",vector.get(47)==null?null:vector.get(47).toString());//备注
+						sbvo.setAttributeValue("vdef11",vector.get(20)==null?null:vector.get(20).toString());//宽度
+						sbvo.setAttributeValue("vdef12",vector.get(21)==null?null:vector.get(21).toString());//高度
+						sbvo.setAttributeValue("vdef13",vector.get(48)==null?null:vector.get(48).toString());//系列
+						sbvo.setAttributeValue("vdef14",vector.get(49)==null?null:vector.get(49).toString());//玻璃编号
+											
+						sbvo.setAttributeValue("vdef15",vector.get(37)==null?null:vector.get(37).toString());//开票类型
+						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("vdef20",vector.get(6)==null?null:vector.get(6).toString());//专用区
+						sbvo.setAttributeValue("pk_defdoc20",getzyqpk("专用区",vector.get(6)==null?null:vector.get(6).toString()));//专用区
+						
+						//来源单据主表ID 
+						sbvo.setCsourcebillid(headvo.getPk_order());
+						//来源子表ID 
+						sbvo.setCsourcebillbodyid(vector.get(35).toString());
+						//来源单据类型
+						sbvo.setCreceipttype("55A2");
+						
 						//回写数量
 						UFDouble updatenum =  new UFDouble(vector.get(51)==null?"0":vector.get(51).toString())
 								.add(new UFDouble(vector.get(1)==null?"0":vector.get(1).toString()));
-						updatemap.put(vector.get(34).toString(), updatenum);
+						updatemap.put(vector.get(35).toString(), updatenum);
+						
+						UFDouble updatefznum =  new UFDouble(vector.get(52)==null?"0":
+							vector.get(52).toString()).add(new UFDouble(vector.get(2)==null?"0":vector.get(2).toString()));//已执行辅数量+本次执行辅数量
+						
+						updatfzemap.put(vector.get(35).toString(), updatefznum);
+						
 						salebodyvos[k]=sbvo;
 						k = k + 1;
 					}
@@ -631,6 +750,8 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 				IplatFormEntry iIplatFormEntry = (IplatFormEntry)NCLocator.getInstance().lookup(IplatFormEntry.class.getName());
 				iIplatFormEntry.processAction("APPROVE", "30", saleheadvo.getDbilldate().toString(), null, inseaggvos, null, null);	
 				Boolean updateres = iorder.UpdateInExecNum(updatemap);
+				Boolean updateresfz = iorder.UpdateInfzExecNum(updatfzemap);
+				
 				MessageDialog.showHintDlg(mainpanel, "成功", "销售出库单新增成功!");
 				this.closeCancel();
 			}  catch (Exception e1) {
@@ -763,5 +884,52 @@ public class ToSaleOutDialog extends UIDialog implements ActionListener,BillEdit
 	      return valueobj.toString();
 			
 		}
+	
+    //项目管理档案-编码和名称
+    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;
+    	
+    }
 
 }

+ 46 - 0
mmpac/mmpac/src/private/u8c/impl/mmpac/mmpac/OrderTotalInfoImpl.java

@@ -123,6 +123,30 @@ public class OrderTotalInfoImpl implements IOrderTotalInfo {
 		
 		return false;
 	}
+	
+	
+	public boolean UpdateInfzExecNum(Map<String, UFDouble> updatemap) throws Exception {
+		// TODO Auto-generated method stub
+		List<OrderInVO> updatevos = new ArrayList<>();
+		OrderTotalInfoDAO dao = new OrderTotalInfoDAO();
+		Boolean res = false;
+		Iterator it = updatemap.keySet().iterator();
+	
+		while(it.hasNext()) {
+			Object key = it.next();
+			Object val = updatemap.get(key);
+			OrderInVO invo = GetBaseDAOUtil.getorderInVO(key.toString());
+//				invo.setExecnum(new UFDouble(val.toString()));
+			invo.setBdef9(val.toString());//销售出库已执行辅数量
+			updatevos.add(invo);
+		}
+		for(int i = 0;i < updatevos.size();i++) {
+		//	dao.UpdateInExecNum(updatevos.get(i), new String[]{OrderIssueVO.EXECNUM});
+			dao.UpdateInExecNum(updatevos.get(i), new String[]{OrderIssueVO.BDEF9});//销售出库已执行辅数量
+		}
+		return true;
+
+	}
 
 	@Override
 	public void insertProduct(GeneralBillVO[] aggvo,Map<String, UFDouble> updatemap) throws Exception {
@@ -144,6 +168,28 @@ public class OrderTotalInfoImpl implements IOrderTotalInfo {
 		}
 		
 	}
+	
+	@Override
+	public boolean UpdatefzccpExecNum(Map<String, UFDouble> updatemap) throws Exception {
+		List<OrderInVO> updatevos = new ArrayList<>();
+		OrderTotalInfoDAO dao = new OrderTotalInfoDAO();
+		Boolean res = false;
+		Iterator it = updatemap.keySet().iterator();
+		while(it.hasNext()) {
+			Object key = it.next();
+			Object val = updatemap.get(key);
+			OrderInVO issuevo = GetBaseDAOUtil.getorderInVO(key.toString());
+			issuevo.setExecnastnum(new UFDouble(val.toString()));
+			updatevos.add(issuevo);
+		}
+		for(int i = 0;i < updatevos.size();i++) {
+			dao.UpdateInExecNum(updatevos.get(i), new String[]{OrderInVO.EXECNASTNUM});
+		}
+		return true;
+	}
+
+	
+	
 
 	//生单形成的单据删除后回写数量
 	@Override

+ 6 - 0
mmpac/mmpac/src/public/u8c/itf/mmpac/mmpac/IOrderTotalInfo.java

@@ -15,12 +15,18 @@ public interface IOrderTotalInfo {
 	
 	public abstract boolean UpdateIssueExecNum(Map<String,UFDouble> updatemap) throws BusinessException;
 	
+	//销售出库已执行主数量
 	public abstract boolean UpdateInExecNum(Map<String,UFDouble> updatemap) throws BusinessException;
 	
+	//销售出库已执行辅助数量
+	public abstract boolean UpdateInfzExecNum(Map<String,UFDouble> updatemap) throws Exception;
+	
 	public abstract void insertProduct(GeneralBillVO[] aggvo,Map<String,UFDouble> updatemap) throws Exception;
 	
 	public abstract boolean UpdatefzExecNum(Map<String,UFDouble> updatemap) throws BusinessException;
 	
+	public abstract boolean UpdatefzccpExecNum(Map<String,UFDouble> updatemap) throws Exception;
+	
 	//生单形成的单据删除后回写数量
 	public abstract void updateExecnum(String sql) throws BusinessException;
 }