|
@@ -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;
|