瀏覽代碼

查询单据状态+修改优化

zthwr 1 年之前
父節點
當前提交
9fac557fea

+ 8 - 0
ic/META-INF/ffopenapi.upm

@@ -1,8 +1,16 @@
 <?xml version="1.0" encoding='gb2312'?>
 <module name="ic">
+   <!--ÐÎ̬ת»»-->
     <public>
  	   <component name="transformadd" accessProtected="false"  remote="true" singleton="true" tx="NONE" supportAlias="true">
        <implementation>nc.bs.ic.impl.TransformAddImpl</implementation>
  	   </component>
     </public>	
+    <!--µ¥¾Ý״̬²éѯ-->
+     <public>
+ 	   <component name="intobillstatus" accessProtected="false"  remote="true" singleton="true" tx="NONE" supportAlias="true">
+       <implementation>nc.bs.ic.impl.IntoBillStatusImpl</implementation>
+ 	   </component>
+    </public>	
+    
 </module>

+ 392 - 0
ic/ic/src/private/nc/bs/ic/impl/IntoBillStatusImpl.java

@@ -0,0 +1,392 @@
+package nc.bs.ic.impl;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import nc.bs.dao.DAOException;
+import nc.bs.framework.adaptor.IHttpServletAdaptor;
+import nc.bs.framework.common.InvocationInfoProxy;
+import nc.bs.framework.common.NCLocator;
+import nc.bs.framework.server.ISecurityTokenCallback;
+import nc.bs.servlet.service.BaseServlet;
+import nc.itf.uap.IUAPQueryBS;
+import nc.jdbc.framework.processor.ColumnProcessor;
+import nc.jdbc.framework.processor.MapListProcessor;
+import nc.log.NcLog;
+import nc.vo.pub.BusinessException;
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+/**
+ * 
+ * 查询NC单据状态返回给MES
+ * @author Administrator
+ *
+ */
+
+public class IntoBillStatusImpl extends BaseServlet implements IHttpServletAdaptor{
+	
+	
+	private IUAPQueryBS iuap = null;
+
+   
+    private IUAPQueryBS getIuap() {
+        if (this.iuap == null) {
+            this.iuap = NCLocator.getInstance().lookup(IUAPQueryBS.class);
+        }
+        return this.iuap;
+
+    }
+	
+
+	@Override
+	public void doAction(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+			
+	   NcLog.initUI("查询NC单据状态开始","status");
+	   List<JSONObject> pljf = new ArrayList<JSONObject>();
+	   NCLocator.getInstance().lookup(ISecurityTokenCallback.class).token("NCSystem".getBytes(),"pfxx".getBytes());
+       try {
+			String createStr = buildJson(req, resp, this.getClass().getName());
+			JSONObject json = JSONObject.fromObject(createStr);
+			PrintWriter out = resp.getWriter();
+			String tddtp = json.getString("tddtp");//表名
+			pljf = itSo(tddtp);	
+//			checkJson(json);//非空判断
+//			InvocationInfoProxy.getInstance().setGroupId("0001V5100000000006BX");
+//			InvocationInfoProxy.getInstance().setUserId(SqlexecuteQuery("cuserid", "sm_user", "user_code", json.getString("creator")));
+//			out.print(formatRSJsonData("成功","",tddtp)); 
+			
+			out.print(pljf); 
+				
+		  } catch (Exception e) {
+			 // TODO Auto-generated catch block
+			 resp.getWriter().write(formatRSJsonData("失败",
+					     e.getMessage().toString(),"").toString());
+			 StringWriter stringWriter = new StringWriter();
+			 e.printStackTrace(new PrintWriter(stringWriter));
+			 //获取详细信息
+			 String msg=stringWriter.getBuffer().toString();
+			 NcLog.initUI("接口返回值提示:"+msg,"status");
+			}
+		
+		
+	}
+	
+	
+	
+	public List<JSONObject> itSo(String tddtp ){
+		List<JSONObject> pljf = new ArrayList<JSONObject>();
+		JSONObject jsonObj = new JSONObject();
+		String tablename=null;
+		String pkname=null;
+		boolean billType=false;//是否有审批流,默认为否
+		try {
+			if (tddtp.equals("saleorder")) {//销售订单
+				tablename="so_saleorder";
+				pkname="csaleorderid";
+				pljf = getDrJson(tablename,pkname,true,0);
+			}else if (tddtp.equals("delivery")) {//发货单/退货单
+				tablename="so_delivery";
+				pkname="cdeliveryid";
+				pljf = getDrJson(tablename,pkname,true,0);
+			}else if (tddtp.equals("saleout")) {//销售出库单-发货指示书
+				tablename="ic_saleout_h";
+				pkname="cgeneralhid";
+				pljf = getDrJson(tablename,pkname,billType,1);
+			}else if (tddtp.equals("shapechange")) {//形态转换单
+				tablename="ic_transform_h";
+				pkname="cspecialhid ";
+				pljf = getDrJson(tablename,pkname,true,1);
+			}else if (tddtp.equals("finprodin")) {// 产成品入库单
+				tablename="ic_finprodin_h";
+				pkname="cgeneralhid";
+				pljf = getDrJson(tablename,pkname,billType,1);
+			}else if (tddtp.equals("matout")) {// 材料进出库单
+				tablename="ic_material_h";
+				pkname="cgeneralhid";
+				pljf = getDrJson(tablename,pkname,billType,1);
+			}else if (tddtp.equals("generalout")) {//其他出库单
+				tablename="ic_generalout_h";
+				pkname="cgeneralhid";
+				pljf = getDrJson(tablename,pkname,billType,1);
+			}else if (tddtp.equals("wboxin")) {//其他入库单
+				tablename="ic_generalin_h";
+				pkname="cgeneralhid";
+				pljf = getDrJson(tablename,pkname,billType,1);
+			}else if (tddtp.equals("whstrans")) {// 转库单
+				tablename="ic_whstrans_h";
+				pkname="cspecialhid";
+				pljf = getDrJson(tablename,pkname,true,1);
+			}else if (tddtp.equals("locadjust")) {// 库存货位调整单
+				tablename="ic_locadjust_h";
+				pkname="cgeneralhid";
+				pljf = getDrJson(tablename,pkname,billType,1);
+			}else if (tddtp.equals("freightinner")) {// 采购发票-内外销运费
+				tablename="po_invoice";
+				pkname="pk_invoice";
+				pljf = getDrJson(tablename,pkname,billType,1);
+			}else {
+				jsonObj.put(tddtp, "请确认查询参数" + tddtp + "是否正确!");
+				pljf.add(jsonObj);
+			}	
+		} catch (Exception e) {
+			jsonObj.put("同步状态错误:",e.getMessage());
+			pljf.add(jsonObj);
+		}
+		return pljf;
+	}
+	
+	
+	/**
+	 * 以单据号为凭证的同步数据转态回传
+	 * @param tablename 表名
+	 * @param pkname 主键名
+	 * @param billType 是否有审批流,默认为否
+	 * @param flagType 0:fstatusflag,1:fbillflag 
+	 * @return
+	 * @throws BusinessException 
+	 */
+	public  List<JSONObject> getDrJson(String tablename,String pkname,boolean billType,int flagType) throws BusinessException{
+		List<JSONObject> pljf = new ArrayList<JSONObject>();
+		JSONObject jsonObj = new JSONObject();
+		String sql=null;
+		if(billType==false){
+			sql="select "+pkname+",vbillcode,dr,vdef20 from "+tablename+" where dr=1 and vdef20='6' ";
+		}else{
+			if(flagType==0){
+				sql="select "+pkname+",vbillcode,fstatusflag,dr,vdef20 from "+tablename+
+						" where nvl(dr,0)=0 and vdef20='6' and fstatusflag in (2,8)  or dr=1 and vdef20='6' or dr=1 and vdef20='7'  ";	
+			}else if(flagType==1){
+				sql="select "+pkname+",vbillcode,fbillflag as fstatusflag,dr,vdef20 from "+tablename+
+						" where nvl(dr,0)=0 and vdef20='6' and fbillflag in (3,4)  or dr=1 and vdef20='6' or dr=1 and vdef20='7'  ";	
+			}
+			
+		}
+		List<Map<String, String>> pl = (List<Map<String, String>>) getIuap()
+				.executeQuery(sql, null,new MapListProcessor());
+		for (int i = 0; i < pl.size(); i++) {
+			Map<String, String> map = pl.get(i);
+			Set<String> keys = map.keySet();
+			jsonObj = new JSONObject();
+			String pkid=null;
+			String vbillcode=null;
+			String fstatusflag=null;
+			String dr=null;
+			String vdef20=null;
+			for (String key : keys) {
+				if(key.equals(pkname)){
+					pkid= map.get(key);
+				}else if(key.equals("vbillcode")){
+					vbillcode=String.valueOf(map.get(key));
+				}else if(key.equals("fstatusflag")){
+					fstatusflag=String.valueOf(map.get(key));
+				}else if(key.equals("dr")){
+					dr=String.valueOf(map.get(key));
+				}else if(key.equals("vdef20")){
+					vdef20=String.valueOf(map.get(key));
+				}
+			}
+			//状态回传后设值为7,删除传值为8
+			try {
+				String uds=null;
+				if(vdef20.equals("7")&&dr.equals("1")||vdef20.equals("6")&&dr.equals("1")){
+					uds ="update "+tablename+" set vdef20='8' " + " where "+pkname+"='"+pkid+"'";
+				}else{
+					uds ="update "+tablename+" set vdef20='7' " + " where "+pkname+"='"+pkid+"'";
+				}
+//				getIuap().executeQuery(uds, null);
+			} catch (Exception e2) {
+			}
+			if(billType==false){
+				jsonObj.put("status","4");
+				jsonObj.put("vbillcode",vbillcode);
+				jsonObj.put("message","同步NC单据已删除!");
+				pljf.add(jsonObj);
+			}else{
+				if(flagType==0){
+					if(fstatusflag.equals("2")){
+						jsonObj.put("status","2");
+						jsonObj.put("vbillcode",vbillcode);
+						jsonObj.put("message","同步NC单据已审批!");
+						pljf.add(jsonObj);
+					}else if(fstatusflag.equals("8")){
+						jsonObj.put("status","3");
+						jsonObj.put("vbillcode",vbillcode);
+						jsonObj.put("message","同步NC单据审批未通过!");
+						pljf.add(jsonObj);
+					}
+					if(dr.equals("1")){
+						jsonObj.put("status","4");
+						jsonObj.put("vbillcode",vbillcode);
+						jsonObj.put("message","同步NC单据已删除!");
+						pljf.add(jsonObj);
+					}	
+				}else if(flagType==1){
+					if(fstatusflag.equals("4")){
+						jsonObj.put("status","2");
+						jsonObj.put("vbillcode",vbillcode);
+						jsonObj.put("message","同步NC单据已审批!");
+						pljf.add(jsonObj);
+					}else if(fstatusflag.equals("3")){
+						jsonObj.put("status","3");
+						jsonObj.put("vbillcode",vbillcode);
+						jsonObj.put("message","同步NC单据审批未通过!");
+						pljf.add(jsonObj);
+					}
+					if(dr.equals("1")){
+						jsonObj.put("status","4");
+						jsonObj.put("vbillcode",vbillcode);
+						jsonObj.put("message","同步NC单据已删除!");
+						pljf.add(jsonObj);
+					}	
+				}
+				
+			}	
+		 }
+		     return pljf;
+	  }			
+	
+	
+	/**
+	 * 以Id为凭证的同步数据状态回传
+	 * @param tablename 表名
+	 * @return
+	 * @throws BusinessException 
+	 */
+	public  List<JSONObject> getDrJsonById(String tablename) throws BusinessException{
+		List<JSONObject> pljf = new ArrayList<JSONObject>();
+		JSONObject jsonObj = new JSONObject();
+		String	sql="select vdef19 from "+tablename+" where dr=1 and vdef20='6' ";
+		List<Map<String, String>> pl = (List<Map<String, String>>) getIuap()
+				.executeQuery(sql, null,new MapListProcessor());
+		for (int i = 0; i < pl.size(); i++) {
+			Map<String, String> map = pl.get(i);
+			Set<String> keys = map.keySet();
+			jsonObj = new JSONObject();
+			String id=null;
+			for (String key : keys) {
+				if(key.equals("vdef19")){
+					id= map.get(key);
+				}
+			}
+			//状态回传后设值为2
+			try {
+				String uds ="update "+tablename+" set vdef20='2' " +
+						" where vdef19='"+id+"'";
+//				getIuap().executeQuery(uds, null);
+			} catch (Exception e2) {
+			}
+			jsonObj.put("status","4");
+			jsonObj.put("vbillcode",id);
+			jsonObj.put("message","同步NC单据已删除!");
+			pljf.add(jsonObj);
+		}
+		return pljf;
+	 }			
+	
+	
+	/*
+	 * 非空判断
+	 */
+	private void checkJson(JSONObject json) throws Exception {
+		
+		StringBuffer mags = new StringBuffer();
+		Boolean empty = true;
+		
+		String vbillcode = "vbillcode";//单据号
+		String group = "pk_group";//集团编码
+		String creator = "creator";//创建人
+		
+		String body = "cspecialbid";//表体
+ 
+		String[] HeadKey = {vbillcode,group,creator};
+		
+		for (String as : HeadKey) {
+
+			if (json.getString(as).isEmpty()) {
+				empty = false;
+				mags.append("'" + as + "'");
+			}
+		}
+		
+		if (json.getJSONArray(body)==null) {
+			empty = false;
+			mags.append("表体不存在! ");
+		}
+		
+		JSONArray oprepObjectBs = json.getJSONArray("cspecialbid");
+		
+		if (oprepObjectBs == null || oprepObjectBs.size() == 0) {
+			throw new Exception("表体内容不可为空!");
+		}
+		
+		String cmaterialoid = "cmaterialoid";//物料编码
+		
+		for(int i = 0; i < oprepObjectBs.size(); i++) {
+			
+			JSONObject oprepJsonObjectB = oprepObjectBs.getJSONObject(i);
+			String[] BodyKey = {cmaterialoid};
+			int num = i+1;
+			
+			mags.append("第"+num+"块表体:{");
+			for (String as : BodyKey) {
+
+				if (oprepJsonObjectB.getString(as).isEmpty()) {
+					empty = false;
+					mags.append("'" + as + "' ");
+				}
+			}
+			mags.append("}");
+		}
+		
+		if (!empty) {
+			throw new Exception("以下字段不可为空:"+mags);
+		}
+	}
+	
+	
+	/*
+	 * 数据库查询
+	 */
+	private String SqlexecuteQuery(String out,String table,String key,String value) throws Exception {
+		
+		String sql = "select "+out+" from "+table+" where "+key+" = '"+value+"' and nvl(dr,0)=0";
+		
+		Object object;
+		try {
+			object = getIuap().executeQuery(sql, new ColumnProcessor());
+			if (object==null) {
+				throw new Exception("未查询到数据!请检查编码"+value+"是否正确!");
+			}
+			
+			return object.toString();
+		} catch (BusinessException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			return e.getMessage();
+		}
+	}
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 6 - 2
ic/ic/src/private/nc/bs/ic/impl/TransformAddImpl.java

@@ -34,7 +34,11 @@ import nc.vo.util.CloneUtil;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
 import nc.vo.ic.m4n.entity.TransformBodyVO;
-
+/**
+ * 
+ * ÐÎ̬ת»»
+ *
+ */
 
 public class TransformAddImpl extends BaseServlet implements IHttpServletAdaptor{
 	
@@ -43,7 +47,7 @@ public class TransformAddImpl extends BaseServlet implements IHttpServletAdaptor
 	@Override
 	public void doAction(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
 		// TODO Auto-generated method stub
-		InvocationInfoProxy.getInstance().setUserDataSource("sypnctest");
+		InvocationInfoProxy.getInstance().setUserDataSource("SYPTEST20230320");
 		NCLocator.getInstance().lookup(ISecurityTokenCallback.class).token("NCSystem".getBytes(),"pfxx".getBytes());
         try {
 			String createStr = buildJson(req, resp, this.getClass().getName());

+ 77 - 0
ic/ic/src/private/nc/log/NcLog.java

@@ -22,6 +22,16 @@ public class NcLog
   private static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
   private static SimpleDateFormat format$ = new SimpleDateFormat("yyyy-MM-dd");
 
+ 
+  public static void initUI(String str){
+	  info(str);
+  }
+  
+  public static void initUI(String str,String logname){
+	  info2(str,logname);
+  }
+  
+  
   public static void info(String str)
   {
     String logFilePath = getLogFile();
@@ -57,6 +67,45 @@ public class NcLog
         }
     }
   }
+  
+  
+  
+  
+  public static void info2(String str,String logname)
+  {
+    String logFilePath = getLogFile(logname);
+    File file = new File(logFilePath);
+    BufferedWriter fos = null;
+    try
+    {
+      fos = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true)));
+      str = format.format(new Date()) + " " + str + "\r\n";
+      
+      fos.write(str + "\r\n");
+      fos.flush();
+    }
+    catch (Exception localException)
+    {
+      if (fos != null)
+        try
+        {
+          fos.close();
+        }
+        catch (IOException localIOException)
+        {
+        }
+    }
+    finally {
+      if (fos != null)
+        try
+        {
+          fos.close();
+        }
+        catch (IOException localIOException2)
+        {
+        }
+    }
+  }
 
   private static String getLogFile() {
     String destFileFolder = RuntimeEnv.getInstance().getNCHome() + File.separator + "mancLog" + File.separator + format$.format(new Date());
@@ -78,4 +127,32 @@ public class NcLog
     }
     return destFilePath;
   }
+  
+  
+  private static String getLogFile(String logname) {
+	    String destFileFolder = RuntimeEnv.getInstance().getNCHome() + File.separator + "mancLog" + File.separator + format$.format(new Date());
+	    String destFilePath = destFileFolder + File.separator + logname + ".log" ;
+	    File destFolder = new File(destFileFolder);
+	    if (!destFolder.exists()) {
+	      destFolder.mkdirs();
+	    }
+	    File destFile = new File(destFilePath);
+	    if (!destFile.exists()) {
+	      try
+	      {
+	        destFile.createNewFile();
+	      }
+	      catch (Exception e)
+	      {
+	        logger.info(e);
+	      }
+	    }
+	    return destFilePath;
+	  }
+  
+  
+  
+  
+  
+  
 }

+ 44 - 39
ic/ic/src/private/nc/pubimpl/so/m30/pfxx/M30PfxxPlugin.java

@@ -89,6 +89,7 @@ public class M30PfxxPlugin extends AbstractSOPfxxPlugin {
      * @throws BusinessException
      */
 	
+
     SaleOrderHVO headvo=(SaleOrderHVO) vo.getParentVO();
  //    if( headvo.getNexchangerate().compareTo(UFDouble.ONE_DBL)!=0){
  		String corigcurrencyid= headvo.getCorigcurrencyid();
@@ -112,8 +113,6 @@ public class M30PfxxPlugin extends AbstractSOPfxxPlugin {
  					bodyvo.setNtaxprice(nqtorigtaxprice);//主本币含税单价
  					bodyvo.setNpiece(nqtorigprice);//主本币无税单价
  					bodyvo.setNtaxnetprice(nqtorigtaxprice);//主本币含税净价
- 					bodyvo.setNorigtaxnetprice(nqtorigtaxprice);//主含税净价
-					bodyvo.setNorignetprice(nqtorigprice);//主无税净价
  					bodyvo.setNnetprice(nqtorigprice);//主本币无税净价
  					bodyvo.setNmny(norigmny);//本币无税金额
  					bodyvo.setNtaxmny(norigtaxmny);//本币价税合计
@@ -130,24 +129,36 @@ public class M30PfxxPlugin extends AbstractSOPfxxPlugin {
  				UFDouble foreignAmount=	currRateUtil.getAmountByOpp(corigcurrencyid,
  						ccurrencyid, norigprice, foreignrate, headvo.getDbilldate());
  				bodyvo.setNtaxprice(foreignAmount);//主本币含税单价
+ 				
  				UFDouble ngprice=currRateUtil.getAmountByOpp(corigcurrencyid,
  						ccurrencyid, bodyvo.getNorigprice()/*主原币无税单价*/, foreignrate, headvo.getDbilldate());
+ 				
  				bodyvo.setNprice(ngprice); // 主本币无税单价
+ 				
  				bodyvo.setNqtprice(ngprice); //报价本币无税单价
+ 				
  				bodyvo.setNqttaxprice(foreignAmount);//报价本币含税单价
+ 				
+ 				
  				UFDouble nmny=currRateUtil.getAmountByOpp(corigcurrencyid,
  						ccurrencyid, bodyvo.getNorigmny()/*原币无税金额*/, foreignrate, headvo.getDbilldate());
+ 				
  				bodyvo.setNmny(nmny);//本币无税金额  
+ 				
  				UFDouble ntaxmny=currRateUtil.getAmountByOpp(corigcurrencyid,
  						ccurrencyid, bodyvo.getNorigtaxmny()/*原币价税合计*/, foreignrate, headvo.getDbilldate());
+ 				
  				bodyvo.setNtaxmny(ntaxmny);//ntaxmny 本币价税合计
+ 				
  				bodyvo.setNcaltaxmny(nmny);//计税金额
  				bodyvo.setNqtnetprice(ngprice);//本币无税净价
  				bodyvo.setNnetprice(ngprice);//主本币无税净价
- 				bodyvo.setNorignetprice(ngprice);//主无税净价
+ 				
  				bodyvo.setNqttaxnetprice(foreignAmount);//本币含税净价
  				bodyvo.setNtaxnetprice(foreignAmount);//主本币含税净价
- 				bodyvo.setNorigtaxnetprice(foreignAmount);//主含税净价
+
+ 				
+
  				bodyvo.setNtax(ntaxmny.sub(nmny));//税额=价税合计-无税金额
  			}
  			
@@ -155,44 +166,38 @@ public class M30PfxxPlugin extends AbstractSOPfxxPlugin {
  			 ExceptionUtils.wrappException(e1);
               return null;
  		}
-//	}
 	
-	  try {
-		InsertSaleOrderAction insertact = new InsertSaleOrderAction();
-		    SaleOrderVO[] retvos = insertact.insert(insertvo);
-		    if (null == retvos || retvos.length == 0) {
-		      return null;
-		    }
-		    
-		    
-		
-		//add by ZTH 江门工玻 销售订单审批通过  
-		
-		String pk_org = retvos[0].getParentVO().getPk_org();
-		//0001V510000000002GEH   江门基地				
-		if(pk_org != null && (pk_org.equals("0001V510000000002GDX"))){
-		 IPFBusiAction service = NCLocator.getInstance().lookup(IPFBusiAction.class);
-		 String usdeid=InvocationInfoProxy.getInstance().getUserId();
-		    try {
-				service.processAction(IPFActionName.APPROVE,
-				     "30", null, retvos[0], null, null);
-			} catch (BusinessException e) {
-				// TODO 自动生成的 catch 块
-				ExceptionUtils.wrappBusinessException(e.getMessage());
-			    return null;
-			}
-		}	
-		
-		
+	  InsertSaleOrderAction insertact = new InsertSaleOrderAction();
+	  InvocationInfoProxy.getInstance().setUserId(insertvo[0].getParentVO().getBillmaker());
+	    SaleOrderVO[] retvos = insertact.insert(insertvo);
+	    if (null == retvos || retvos.length == 0) {
+	      return null;
+	    }
+	    
+	    
+    
+    //add by ZTH 江门工玻 销售订单审批通过  
+    
+	String pk_org = retvos[0].getParentVO().getPk_org();
+	//0001V510000000002GEH   江门基地				
+	if(pk_org != null && (pk_org.equals("0001V510000000002GDX"))){
+	 IPFBusiAction service = NCLocator.getInstance().lookup(IPFBusiAction.class);
+	 InvocationInfoProxy.getInstance().setUserId(retvos[0].getParentVO().getApprover());
+	    try {
+	    	service.processAction(IPFActionName.APPROVE,
+			     "30", null, retvos[0], null, null);
+		} catch (BusinessException e) {
+			// TODO 自动生成的 catch 块
+			ExceptionUtils.wrappBusinessException(e.getMessage());
+		    return null;
+		}
+	}	
+    
+    
 
   
-		
-		return retvos[0];
-	} catch (Exception e) {
-		// TODO 自动生成的 catch 块
-		e.printStackTrace();
-	}
-	  return null;
+    
+    return retvos[0];
   }
 
   @Override

+ 13 - 6
ic/ic/src/private/nc/pubimpl/so/m4331/pfxx/M4331PfxxPlugin.java

@@ -64,8 +64,6 @@ public class M4331PfxxPlugin extends nc.pubimpl.so.pfxx.AbstractSOPfxxPlugin {
 					bodyvo.setNtaxprice(nqtorigtaxprice);//主本币含税单价
 					bodyvo.setNpiece(nqtorigprice);//主本币无税单价
 					bodyvo.setNtaxnetprice(nqtorigtaxprice);//主本币含税净价
-					bodyvo.setNorigtaxnetprice(nqtorigtaxprice);//主含税净价
-					bodyvo.setNorignetprice(nqtorigprice);//主无税净价
 					bodyvo.setNnetprice(nqtorigprice);//主本币无税净价
 					bodyvo.setNmny(norigmny);//本币无税金额
 					bodyvo.setNtaxmny(norigtaxmny);//本币价税合计
@@ -93,10 +91,8 @@ public class M4331PfxxPlugin extends nc.pubimpl.so.pfxx.AbstractSOPfxxPlugin {
 				bodyvo.setNcaltaxmny(nmny);//计税金额
 				bodyvo.setNqtnetprice(ngprice);//本币无税净价
 				bodyvo.setNnetprice(ngprice);//主本币无税净价
-				bodyvo.setNorignetprice(ngprice);//主无税净价
 				bodyvo.setNqttaxnetprice(foreignAmount);//本币含税净价
 				bodyvo.setNtaxnetprice(foreignAmount);//主本币含税净价
-				bodyvo.setNorigtaxnetprice(foreignAmount);//主含税净价
 				bodyvo.setNtax(ntaxmny.sub(nmny));//税额=价税合计-无税金额
 		} catch (BusinessException e) {
 			// TODO 自动生成的 catch 块
@@ -105,7 +101,7 @@ public class M4331PfxxPlugin extends nc.pubimpl.so.pfxx.AbstractSOPfxxPlugin {
 	}
     
     
-    DeliveryInsertAction insert = new DeliveryInsertAction();
+   /* DeliveryInsertAction insert = new DeliveryInsertAction();
     try {
 		DeliveryVO[] ret = insert.insert(insertvo);
 		if (null == ret || ret.length == 0) {
@@ -116,9 +112,20 @@ public class M4331PfxxPlugin extends nc.pubimpl.so.pfxx.AbstractSOPfxxPlugin {
 		return approvevos[0];
 	} catch (Exception e) {
 		// TODO 自动生成的 catch 块
+		e.printStackTrace();
 		ExceptionUtils.wrappBusinessException(e.getMessage());
+		
 	}
-    return null;
+	return insertvo[0];*/
+    
+    DeliveryInsertAction insert = new DeliveryInsertAction();
+    DeliveryVO[] ret = insert.insert(insertvo);
+    if (null == ret || ret.length == 0) {
+      return null;
+    }
+    return ret[0];
+    
+    
   }
 
   @Override