Procházet zdrojové kódy

销售合同修改调整

18870042648 před 2 roky
rodič
revize
6e17874d2c

+ 12 - 4
ypff/ypff/src/private/nc/bs/yp/impl/ModifyMaintianImpl.java

@@ -56,7 +56,7 @@ public class ModifyMaintianImpl extends BaseServlet implements IHttpServletAdapt
 			resp.getWriter().write(formatRSJsonData("0",vbillcode,"").toString());
 		} catch (Exception e) {
 			//前端控制台打印xml数据
-			resp.getWriter().write(formatRSJsonData("1",vbillcode,e.getMessage()).toString());
+			resp.getWriter().write(formatRSJsonData("1",vbillcode,e.getMessage()==null?e.toString():e.getMessage()).toString());
 			StringWriter stringWriter = new StringWriter();
 			e.printStackTrace(new PrintWriter(stringWriter));
 			//获取详细信息
@@ -68,6 +68,9 @@ public class ModifyMaintianImpl extends BaseServlet implements IHttpServletAdapt
 
 	public void collect(JSONObject json) throws Exception {
 		
+		//版本号
+		int version;
+		
 		//合同条款
 		CtSaleTermVO ctSaleTermVO = new CtSaleTermVO();
 		List<CtSaleTermVO> ctSaleTermListVO = new ArrayList<CtSaleTermVO>();
@@ -110,6 +113,11 @@ public class ModifyMaintianImpl extends BaseServlet implements IHttpServletAdapt
 		//主表vo状态
 		aggCtSaleVO.getParent().setStatus(1);
 		
+		if (aggCtSaleVO.getChildren(CtSaleChangeVO.class)==null) {
+			version = 0;
+		}else {
+			version = aggCtSaleVO.getChildren(CtSaleChangeVO.class).length;
+		}
 		
 		//变更历史
 		CtSaleChangeVO ctSaleChangeVO = new CtSaleChangeVO();
@@ -122,7 +130,7 @@ public class ModifyMaintianImpl extends BaseServlet implements IHttpServletAdapt
 		//组织
 		ctSaleChangeVO.setPk_org_v(salesOrgVO.getPk_vid());
 		//版本号数组+1
-		ctSaleChangeVO.setVchangecode(new UFDouble(aggCtSaleVO.getChildren(CtSaleChangeVO.class).length+1));
+		ctSaleChangeVO.setVchangecode(new UFDouble(version+1));
 		//变更日期
 		ctSaleChangeVO.setVchgdate(new UFDate(json.getString("vchgdate")));
 		//变更人
@@ -207,8 +215,8 @@ public class ModifyMaintianImpl extends BaseServlet implements IHttpServletAdapt
 		
 		
 		//创建数组长度+1加入变更记录
-		CtSaleChangeVO[] CtSaleChangearrVO = new CtSaleChangeVO[aggCtSaleVO.getChildren(CtSaleChangeVO.class).length+1];
-		for (int i = 0; i < aggCtSaleVO.getChildren(CtSaleChangeVO.class).length; i++) {
+		CtSaleChangeVO[] CtSaleChangearrVO = new CtSaleChangeVO[version+1];
+		for (int i = 0; i < version; i++) {
 			CtSaleChangearrVO[i] = (CtSaleChangeVO) aggCtSaleVO.getChildren(CtSaleChangeVO.class)[i];
 		}
 		CtSaleChangearrVO[CtSaleChangearrVO.length-1] = ctSaleChangeVO;

+ 2 - 2
ypff/ypff/src/private/nc/bs/yp/impl/SaleorderOutboundImpl.java

@@ -23,8 +23,8 @@ import nc.log.NcLog;
 import nc.md.persist.framework.IMDPersistenceQueryService;
 import nc.vo.ic.m4c.entity.SaleOutVO;
 import nc.vo.pub.BusinessException;
-import nc.vo.so.m30.entity.SaleOrderVO;
 import nc.vo.so.m4331.entity.DeliveryVO;
+
 import net.sf.json.JSONObject;
 
 /**
@@ -46,7 +46,7 @@ public class SaleorderOutboundImpl extends BaseServlet implements IHttpServletAd
 		
 		NCLocator.getInstance().lookup(ISecurityTokenCallback.class).token("NCSystem".getBytes(),"pfxx".getBytes());
         InvocationInfoProxy.getInstance().setUserDataSource("syptest210103");
-		
+		 
         String vbillcode = "";
         String errorMessgae = "";
         JSONObject logObject = new JSONObject();