销售订单-修改返回值调整
This commit is contained in:
		
							parent
							
								
									932740331b
								
							
						
					
					
						commit
						3c80630d9a
					
				|  | @ -1,18 +1,17 @@ | |||
| 
 | ||||
| package nccloud.openapi.so.m30; | ||||
| 
 | ||||
| import nc.itf.bd.defdoc.IDefdocService; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import javax.ws.rs.Consumes; | ||||
| import javax.ws.rs.POST; | ||||
| import javax.ws.rs.Path; | ||||
| import javax.ws.rs.Produces; | ||||
| import nc.jdbc.framework.processor.*; | ||||
| import nc.bd.itf.tools.BFPubTools; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.bs.framework.common.InvocationInfoProxy; | ||||
| import nc.bs.framework.common.NCLocator; | ||||
| import nc.itf.bd.defdoc.IDefdocService; | ||||
| import nc.itf.pim.project.prv.IProject; | ||||
| import nc.jdbc.framework.processor.ColumnListProcessor; | ||||
| import nc.jdbc.framework.processor.ColumnProcessor; | ||||
| import nc.jdbc.framework.processor.MapProcessor; | ||||
| import nc.vo.bd.defdoc.DefdocVO; | ||||
| import nc.vo.pim.project.ProjectHeadVO; | ||||
| import nc.vo.pub.BusinessException; | ||||
| import nc.vo.pub.lang.UFDateTime; | ||||
| import nc.vo.pubapp.AppContext; | ||||
|  | @ -26,11 +25,15 @@ import nccloud.openapi.scmpub.pub.NCCPubRestResource; | |||
| import nccloud.openapi.scmpub.pub.TransferCodeToPKTool; | ||||
| import nccloud.openapi.scmpub.pub.TransferMapToVOTool; | ||||
| import nccloud.openapi.scmpub.util.CallReturnBuildUtil; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.bd.itf.tools.BFPubTools; | ||||
| import org.json.JSONString; | ||||
| import nc.vo.pim.project.ProjectHeadVO; | ||||
| import nc.itf.pim.project.prv.IProject; | ||||
| 
 | ||||
| import javax.ws.rs.Consumes; | ||||
| import javax.ws.rs.POST; | ||||
| import javax.ws.rs.Path; | ||||
| import javax.ws.rs.Produces; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| 
 | ||||
| /** | ||||
|  | @ -41,441 +44,443 @@ import nc.itf.pim.project.prv.IProject; | |||
| @Path("so/saleorder") | ||||
| public class SaleOrderResource extends NCCPubRestResource { | ||||
| 
 | ||||
| 	private static String BODYTABLE = "so_saleorder_b"; | ||||
| 	private static String HEADTABLE = "so_saleorder"; | ||||
| 	public BaseDAO dao; | ||||
|     private static String BODYTABLE = "so_saleorder_b"; | ||||
|     private static String HEADTABLE = "so_saleorder"; | ||||
|     public BaseDAO dao; | ||||
| 
 | ||||
| 	public BaseDAO getDao() { | ||||
| 		if (dao == null) { | ||||
| 			dao = new BaseDAO(); | ||||
| 		} | ||||
| 		return dao; | ||||
| 	} | ||||
|     public BaseDAO getDao() { | ||||
|         if (dao == null) { | ||||
|             dao = new BaseDAO(); | ||||
|         } | ||||
|         return dao; | ||||
|     } | ||||
| 
 | ||||
| 	@POST | ||||
| 	@Path("operation/save") | ||||
| 	@Consumes({ "application/json" }) | ||||
| 	@Produces({ "application/json" }) | ||||
| 	public JSONString save(Map<String, Object> paramMap) { | ||||
| 		List<Map<String, Object>> paramList = (List) paramMap.get("array"); | ||||
| 		return saveold(paramList); | ||||
| 	} | ||||
|     @POST | ||||
|     @Path("operation/save") | ||||
|     @Consumes({"application/json"}) | ||||
|     @Produces({"application/json"}) | ||||
|     public JSONString save(Map<String, Object> paramMap) { | ||||
|         List<Map<String, Object>> paramList = (List) paramMap.get("array"); | ||||
|         return saveold(paramList); | ||||
|     } | ||||
| 
 | ||||
| 	public JSONString saveold(List<Map<String, Object>> paramList) { | ||||
| 		try { | ||||
| 			for (Map<String, Object> map : paramList) { | ||||
| 				if (!map.containsKey(HEADTABLE) || !map.containsKey(BODYTABLE)) { | ||||
| 					return ResultMessageUtil.exceptionToJSON("传入参数不能为空", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
| 				} | ||||
| 			} | ||||
|     public JSONString saveold(List<Map<String, Object>> paramList) { | ||||
|         try { | ||||
|             for (Map<String, Object> map : paramList) { | ||||
|                 if (!map.containsKey(HEADTABLE) || !map.containsKey(BODYTABLE)) { | ||||
|                     return ResultMessageUtil.exceptionToJSON("传入参数不能为空", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
| 			IAPISaleOrderMaitain service = (IAPISaleOrderMaitain) NCLocator.getInstance() | ||||
| 					.lookup(IAPISaleOrderMaitain.class); | ||||
| 			SaleOrderVO[] results = service.save(paramList); | ||||
|             IAPISaleOrderMaitain service = (IAPISaleOrderMaitain) NCLocator.getInstance() | ||||
|                     .lookup(IAPISaleOrderMaitain.class); | ||||
|             SaleOrderVO[] results = service.save(paramList); | ||||
| 
 | ||||
| 			return ResultMessageUtil.toJSON(results, "销售订单新增保存成功"); | ||||
| 		} catch (Exception e) { | ||||
| 			return ResultMessageUtil.exceptionToJSON(e); | ||||
| 		} | ||||
| 	} | ||||
|             return ResultMessageUtil.toJSON(results, "销售订单新增保存成功"); | ||||
|         } catch (Exception e) { | ||||
|             return ResultMessageUtil.exceptionToJSON(e); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 	/** | ||||
| 	 *  | ||||
| 	 * @Description: 在2312基础上适配2005代码 | ||||
| 	 * @date: 2025年3月19日 18点11分 | ||||
| 	 * @version NCC2312 | ||||
| 	 */ | ||||
| 	@SuppressWarnings("unchecked") | ||||
| 	@POST | ||||
| 	@Path("save") | ||||
| 	@Consumes("application/json") | ||||
| 	@Produces("application/json") | ||||
| 	public JSONString save(List<Map<String, Object>> paramList) { | ||||
| 		InvocationInfoProxy.getInstance().setGroupId("0001A110000000000677"); | ||||
| 		try { | ||||
| 			for (Map<String, Object> map : paramList) { | ||||
| 				if (!map.containsKey(HEADTABLE) || !map.containsKey(BODYTABLE)) { | ||||
| 					return NCCRestUtils.toJSONString(CallReturnBuildUtil.buildHeadBodyResult()); | ||||
| 				} | ||||
| 				// 设置集团 | ||||
| 				Map<String, Object> headdata = (Map<String, Object>) map.get(HEADTABLE); | ||||
| 				headdata.put("pk_org", headdata.get("pk_org_v")); | ||||
| 				headdata.put("cdeptid", headdata.get("cdeptvid")); | ||||
| 				headdata.put("fstatusflag", 1); | ||||
| 				headdata.put("dmakedate", headdata.get("dbilldate")); | ||||
| 				headdata.put("dmakedate", headdata.get("dbilldate")); | ||||
| 				headdata.put("cinvoicecustid", headdata.get("ccustomerid")); | ||||
| 				headdata.put("ccustomervid", headdata.get("ccustomerid")); | ||||
| 				String pk_group = AppContext.getInstance().getPkGroup(); | ||||
| 				headdata.put("pk_group", pk_group); | ||||
| 				List<Object> bodyArr = (List<Object>) map.get(BODYTABLE); | ||||
| 				for (Object body : bodyArr) { | ||||
| 					Map<String, Object> bodydata = (Map<String, Object>) body; | ||||
| 					bodydata.put("pk_group", pk_group); | ||||
| 					bodydata.put("cprojectid", headdata.get("vdef6")); | ||||
| 					//bodydata.put("ctrafficorgvid", headdata.get("pk_org_v")); | ||||
| 					bodydata.put("csendstockorgvid", headdata.get("pk_org_v")); | ||||
| 					//bodydata.put("csendstordocid", headdata.get("pk_org_v")); | ||||
| 					bodydata.put("csendstockorgid", headdata.get("pk_org_v")); | ||||
| 					bodydata.put("carorgid", headdata.get("pk_org_v")); | ||||
| 					bodydata.put("carorgvid", headdata.get("pk_org_v")); | ||||
| 					bodydata.put("csettleorgid", headdata.get("pk_org_v")); | ||||
| 					bodydata.put("csettleorgvid", headdata.get("pk_org_v")); | ||||
| 					bodydata.put("ctaxcountryid", "CN"); | ||||
| 					bodydata.put("crececountryid", "CN"); | ||||
| 					bodydata.put("csendcountryid", "CN"); | ||||
| 					bodydata.put("fbuysellflag", 1); | ||||
| 					// 根据物料编码查询物料信息 | ||||
| 					setMaterl(bodydata); | ||||
| 				} | ||||
| 			} | ||||
| 			// 新增自定义档案 | ||||
| 			SaleOrderVO[] salevos = OpenAPIParaUtil.changeVO(paramList, HEADTABLE, BODYTABLE); | ||||
| 			genDef(salevos); | ||||
| 			for (Map<String, Object> map : paramList) { | ||||
| 				BaseDAO baseDAO = new BaseDAO(); | ||||
| 				Map<String, Object> headdata = (Map<String, Object>) map.get(HEADTABLE); | ||||
| 				List<Object> bodyArr = (List<Object>) map.get(BODYTABLE); | ||||
| 				for (Object body : bodyArr) { | ||||
| 					Map<String, Object> bodydata = (Map<String, Object>) body; | ||||
| 					String sql = " select pk_project from  bd_project  where project_code='" + headdata.get("vdef6") | ||||
| 							+ "'  and nvl(dr,0)=0  "; | ||||
| 					String o_pk_project = (String) baseDAO.executeQuery(sql, new ColumnProcessor()); | ||||
| 					bodydata.put("cprojectid", o_pk_project); | ||||
| 				} | ||||
| 			} | ||||
|     /** | ||||
|      * @Description: 在2312基础上适配2005代码 | ||||
|      * @date: 2025年3月19日 18点11分 | ||||
|      * @version NCC2312 | ||||
|      */ | ||||
|     @SuppressWarnings("unchecked") | ||||
|     @POST | ||||
|     @Path("save") | ||||
|     @Consumes("application/json") | ||||
|     @Produces("application/json") | ||||
|     public JSONString save(List<Map<String, Object>> paramList) { | ||||
|         InvocationInfoProxy.getInstance().setGroupId("0001A110000000000677"); | ||||
|         try { | ||||
|             for (Map<String, Object> map : paramList) { | ||||
|                 if (!map.containsKey(HEADTABLE) || !map.containsKey(BODYTABLE)) { | ||||
|                     return NCCRestUtils.toJSONString(CallReturnBuildUtil.buildHeadBodyResult()); | ||||
|                 } | ||||
|                 // 设置集团 | ||||
|                 Map<String, Object> headdata = (Map<String, Object>) map.get(HEADTABLE); | ||||
|                 headdata.put("pk_org", headdata.get("pk_org_v")); | ||||
|                 headdata.put("cdeptid", headdata.get("cdeptvid")); | ||||
|                 headdata.put("fstatusflag", 1); | ||||
|                 headdata.put("dmakedate", headdata.get("dbilldate")); | ||||
|                 headdata.put("dmakedate", headdata.get("dbilldate")); | ||||
|                 headdata.put("cinvoicecustid", headdata.get("ccustomerid")); | ||||
|                 headdata.put("ccustomervid", headdata.get("ccustomerid")); | ||||
|                 String pk_group = AppContext.getInstance().getPkGroup(); | ||||
|                 headdata.put("pk_group", pk_group); | ||||
|                 List<Object> bodyArr = (List<Object>) map.get(BODYTABLE); | ||||
|                 for (Object body : bodyArr) { | ||||
|                     Map<String, Object> bodydata = (Map<String, Object>) body; | ||||
|                     bodydata.put("pk_group", pk_group); | ||||
|                     bodydata.put("cprojectid", headdata.get("vdef6")); | ||||
|                     // bodydata.put("ctrafficorgvid", headdata.get("pk_org_v")); | ||||
|                     bodydata.put("csendstockorgvid", headdata.get("pk_org_v")); | ||||
|                     // bodydata.put("csendstordocid", headdata.get("pk_org_v")); | ||||
|                     bodydata.put("csendstockorgid", headdata.get("pk_org_v")); | ||||
|                     bodydata.put("carorgid", headdata.get("pk_org_v")); | ||||
|                     bodydata.put("carorgvid", headdata.get("pk_org_v")); | ||||
|                     bodydata.put("csettleorgid", headdata.get("pk_org_v")); | ||||
|                     bodydata.put("csettleorgvid", headdata.get("pk_org_v")); | ||||
|                     bodydata.put("ctaxcountryid", "CN"); | ||||
|                     bodydata.put("crececountryid", "CN"); | ||||
|                     bodydata.put("csendcountryid", "CN"); | ||||
|                     bodydata.put("fbuysellflag", 1); | ||||
|                     // 根据物料编码查询物料信息 | ||||
|                     setMaterl(bodydata); | ||||
|                 } | ||||
|             } | ||||
|             // 新增自定义档案 | ||||
|             SaleOrderVO[] salevos = OpenAPIParaUtil.changeVO(paramList, HEADTABLE, BODYTABLE); | ||||
|             genDef(salevos); | ||||
|             for (Map<String, Object> map : paramList) { | ||||
|                 BaseDAO baseDAO = new BaseDAO(); | ||||
|                 Map<String, Object> headdata = (Map<String, Object>) map.get(HEADTABLE); | ||||
|                 List<Object> bodyArr = (List<Object>) map.get(BODYTABLE); | ||||
|                 for (Object body : bodyArr) { | ||||
|                     Map<String, Object> bodydata = (Map<String, Object>) body; | ||||
|                     String sql = " select pk_project from  bd_project  where project_code='" + headdata.get("vdef6") | ||||
|                             + "'  and nvl(dr,0)=0  "; | ||||
|                     String o_pk_project = (String) baseDAO.executeQuery(sql, new ColumnProcessor()); | ||||
|                     bodydata.put("cprojectid", o_pk_project); | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
| 			// 参数形式转换为vo并翻译 | ||||
| 			List<SaleOrderVO> vosList = | ||||
| 					TransferMapToVOTool.transferMapToAggVO(paramList, SaleOrderVO.class); | ||||
| 			vosList = TransferCodeToPKTool.transferAggVO(vosList); | ||||
| 			SaleOrderVO[] vos = vosList.toArray(new SaleOrderVO[vosList.size()]); | ||||
|             // 参数形式转换为vo并翻译 | ||||
|             List<SaleOrderVO> vosList = | ||||
|                     TransferMapToVOTool.transferMapToAggVO(paramList, SaleOrderVO.class); | ||||
|             vosList = TransferCodeToPKTool.transferAggVO(vosList); | ||||
|             SaleOrderVO[] vos = vosList.toArray(new SaleOrderVO[vosList.size()]); | ||||
| 
 | ||||
| 			// 调用接口保存 | ||||
| 			IAPISaleOrderMaitain service = NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class); | ||||
| 			SaleOrderVO[] results = service.save(vos); | ||||
| 			// 包装返回信息 | ||||
| 			return NCCRestUtils.toJSONString(CallReturnBuildUtil.buildSuccessResult(results, "销售订单保存成功")); | ||||
| 		} catch (Exception e) { | ||||
| 			return NCCRestUtils.toJSONString(CallReturnBuildUtil.buildFailResult(null, "销售单保存异常:" + e.getMessage())); | ||||
| 		} | ||||
| 	} | ||||
|             // 调用接口保存 | ||||
|             IAPISaleOrderMaitain service = NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class); | ||||
|             SaleOrderVO[] results = service.save(vos); | ||||
|             // 包装返回信息 | ||||
|             return NCCRestUtils.toJSONString(CallReturnBuildUtil.buildSuccessResult(results, "销售订单保存成功")); | ||||
|         } catch (Exception e) { | ||||
|             return NCCRestUtils.toJSONString(CallReturnBuildUtil.buildFailResult(null, "销售单保存异常:" + e.getMessage())); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 	private void genDef(SaleOrderVO[] salevos) throws BusinessException { | ||||
| 		BaseDAO baseDAO = new BaseDAO(); | ||||
| 		ArrayList<String> arrhth = new ArrayList<String>(); | ||||
| 		ArrayList<String> arrxmh = new ArrayList<String>(); | ||||
| 		ArrayList<String> arrxsddh = new ArrayList<String>(); | ||||
| 		String sql = " select pk_org,pk_vid from org_orgs where org_orgs.code='" + salevos[0].getParentVO().getPk_org() | ||||
| 				+ "' and nvl(dr,0)=0 and isbusinessunit='Y' "; | ||||
|     private void genDef(SaleOrderVO[] salevos) throws BusinessException { | ||||
|         BaseDAO baseDAO = new BaseDAO(); | ||||
|         ArrayList<String> arrhth = new ArrayList<String>(); | ||||
|         ArrayList<String> arrxmh = new ArrayList<String>(); | ||||
|         ArrayList<String> arrxsddh = new ArrayList<String>(); | ||||
|         String sql = " select pk_org,pk_vid from org_orgs where org_orgs.code='" + salevos[0].getParentVO().getPk_org() | ||||
|                 + "' and nvl(dr,0)=0 and isbusinessunit='Y' "; | ||||
| 
 | ||||
| 		Map map = (Map) baseDAO.executeQuery(sql, new MapProcessor()); | ||||
| 		if (map == null) { | ||||
| 			throw new BusinessException("采购组织档案未查到"); | ||||
| 		} | ||||
| 		String o = (String) map.get("pk_org"); | ||||
|         Map map = (Map) baseDAO.executeQuery(sql, new MapProcessor()); | ||||
|         if (map == null) { | ||||
|             throw new BusinessException("采购组织档案未查到"); | ||||
|         } | ||||
|         String o = (String) map.get("pk_org"); | ||||
| 
 | ||||
| 		String cprocode = salevos[0].getChildrenVO()[0].getCprojectid(); | ||||
| 		String cproname = salevos[0].getChildrenVO()[0].getVbdef10(); | ||||
| 		if (!BFPubTools.getString_TrimAsNull(cprocode).equals("")) { | ||||
| 			sql = " select pk_project from  bd_project  where project_code='" + cprocode + "'  and  pk_duty_org='" + o | ||||
| 					+ "' and nvl(dr,0)=0  "; | ||||
| 			String o_pk_project = (String) baseDAO.executeQuery(sql, new ColumnProcessor()); | ||||
| 			if (o_pk_project == null) { | ||||
| 				// 新增项目档案 | ||||
| 				createPro(cprocode, cproname, map); | ||||
| 			} | ||||
| 		} | ||||
|         String cprocode = salevos[0].getChildrenVO()[0].getCprojectid(); | ||||
|         String cproname = salevos[0].getChildrenVO()[0].getVbdef10(); | ||||
|         if (!BFPubTools.getString_TrimAsNull(cprocode).equals("")) { | ||||
|             sql = " select pk_project from  bd_project  where project_code='" + cprocode + "'  and  pk_duty_org='" + o | ||||
|                     + "' and nvl(dr,0)=0  "; | ||||
|             String o_pk_project = (String) baseDAO.executeQuery(sql, new ColumnProcessor()); | ||||
|             if (o_pk_project == null) { | ||||
|                 // 新增项目档案 | ||||
|                 createPro(cprocode, cproname, map); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
| 		for (int i = 0; i < salevos.length; i++) { | ||||
| 			String vdef6 = BFPubTools.getString_TrimAsNull(salevos[i].getParentVO().getVdef6()); | ||||
| 			if (vdef6 != "" && !arrhth.contains(vdef6)) { | ||||
| 				arrhth.add(vdef6); | ||||
| 			} | ||||
|         for (int i = 0; i < salevos.length; i++) { | ||||
|             String vdef6 = BFPubTools.getString_TrimAsNull(salevos[i].getParentVO().getVdef6()); | ||||
|             if (vdef6 != "" && !arrhth.contains(vdef6)) { | ||||
|                 arrhth.add(vdef6); | ||||
|             } | ||||
| 
 | ||||
| 			String vdef2 = BFPubTools.getString_TrimAsNull(salevos[i].getParentVO().getVdef2()); | ||||
| 			if (vdef2 != "" && !arrxmh.contains(vdef2)) { | ||||
| 				arrxmh.add(vdef2); | ||||
| 			} | ||||
|             String vdef2 = BFPubTools.getString_TrimAsNull(salevos[i].getParentVO().getVdef2()); | ||||
|             if (vdef2 != "" && !arrxmh.contains(vdef2)) { | ||||
|                 arrxmh.add(vdef2); | ||||
|             } | ||||
| 
 | ||||
| 			String vdef13 = BFPubTools.getString_TrimAsNull(salevos[i].getParentVO().getVdef13()); | ||||
| 			if (vdef13 != "" && !arrxsddh.contains(vdef13)) { | ||||
| 				arrxsddh.add(vdef13); | ||||
| 			} | ||||
|             String vdef13 = BFPubTools.getString_TrimAsNull(salevos[i].getParentVO().getVdef13()); | ||||
|             if (vdef13 != "" && !arrxsddh.contains(vdef13)) { | ||||
|                 arrxsddh.add(vdef13); | ||||
|             } | ||||
| 
 | ||||
| 		} | ||||
| 		if (arrhth.size() > 0) { | ||||
| 			sql = " select code from bd_defdoc where  pk_defdoclist in(select pk_defdoclist from bd_defdoclist  where code='zdy-001') and pk_org='" | ||||
| 					+ o + "' and  "; | ||||
| 			sql += BFPubTools.getInSqlWithOutAnd("code", arrhth, 0, arrhth.size()); | ||||
| 			ArrayList<String> obj_arrhth = (ArrayList<String>) baseDAO.executeQuery(sql, new ColumnListProcessor()); | ||||
| 			if (obj_arrhth != null && obj_arrhth.size() > 0) { | ||||
| 				arrhth.removeAll(obj_arrhth); | ||||
| 			} | ||||
| 		} | ||||
|         } | ||||
|         if (arrhth.size() > 0) { | ||||
|             sql = " select code from bd_defdoc where  pk_defdoclist in(select pk_defdoclist from bd_defdoclist  where code='zdy-001') and pk_org='" | ||||
|                     + o + "' and  "; | ||||
|             sql += BFPubTools.getInSqlWithOutAnd("code", arrhth, 0, arrhth.size()); | ||||
|             ArrayList<String> obj_arrhth = (ArrayList<String>) baseDAO.executeQuery(sql, new ColumnListProcessor()); | ||||
|             if (obj_arrhth != null && obj_arrhth.size() > 0) { | ||||
|                 arrhth.removeAll(obj_arrhth); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
| 		// 组装销售订单数据 | ||||
| 		if (arrhth.size() > 0) { | ||||
| 			NCLocator.getInstance().lookup(IDefdocService.class).insertDefdocs(o, | ||||
| 					createDefVO(arrhth, "zdy-001", o.toString())); | ||||
| 		} | ||||
|         // 组装销售订单数据 | ||||
|         if (arrhth.size() > 0) { | ||||
|             NCLocator.getInstance().lookup(IDefdocService.class).insertDefdocs(o, | ||||
|                     createDefVO(arrhth, "zdy-001", o.toString())); | ||||
|         } | ||||
| 
 | ||||
| 		if (arrxmh.size() > 0) { | ||||
| 			sql = " select code from bd_defdoc where  pk_defdoclist in(select pk_defdoclist from bd_defdoclist  where code='BQxmh') and pk_org='" | ||||
| 					+ o + "' and "; | ||||
| 			sql += BFPubTools.getInSqlWithOutAnd("code", arrxmh, 0, arrxmh.size()); | ||||
| 			ArrayList<String> obj_arrhth = (ArrayList<String>) baseDAO.executeQuery(sql, new ColumnListProcessor()); | ||||
|         if (arrxmh.size() > 0) { | ||||
|             sql = " select code from bd_defdoc where  pk_defdoclist in(select pk_defdoclist from bd_defdoclist  where code='BQxmh') and pk_org='" | ||||
|                     + o + "' and "; | ||||
|             sql += BFPubTools.getInSqlWithOutAnd("code", arrxmh, 0, arrxmh.size()); | ||||
|             ArrayList<String> obj_arrhth = (ArrayList<String>) baseDAO.executeQuery(sql, new ColumnListProcessor()); | ||||
| 
 | ||||
| 			if (obj_arrhth != null && obj_arrhth.size() > 0) { | ||||
|             if (obj_arrhth != null && obj_arrhth.size() > 0) { | ||||
| 
 | ||||
| 				arrxmh.removeAll(obj_arrhth); | ||||
| 			} | ||||
|                 arrxmh.removeAll(obj_arrhth); | ||||
|             } | ||||
| 
 | ||||
| 		} | ||||
| 		if (arrxmh.size() > 0) { | ||||
| 			NCLocator.getInstance().lookup(IDefdocService.class).insertDefdocs(o, | ||||
| 					createDefVO(arrxmh, "BQxmh", o.toString())); | ||||
| 		} | ||||
|         } | ||||
|         if (arrxmh.size() > 0) { | ||||
|             NCLocator.getInstance().lookup(IDefdocService.class).insertDefdocs(o, | ||||
|                     createDefVO(arrxmh, "BQxmh", o.toString())); | ||||
|         } | ||||
| 
 | ||||
| 		if (arrxsddh.size() > 0) { | ||||
| 			sql = " select code from bd_defdoc where  pk_defdoclist in( select pk_defdoclist from bd_defdoclist  where code='BIP-ddh') and pk_org='" | ||||
| 					+ o + "' and  "; | ||||
| 			sql += BFPubTools.getInSqlWithOutAnd("code", arrxsddh, 0, arrxsddh.size()); | ||||
| 			ArrayList<String> obj_arrhth = (ArrayList<String>) baseDAO.executeQuery(sql, new ColumnListProcessor()); | ||||
| 			if (obj_arrhth != null && obj_arrhth.size() > 0) { | ||||
| 				arrxsddh.removeAll(obj_arrhth); | ||||
| 			} | ||||
| 		} | ||||
| 		if (arrxsddh.size() > 0) { | ||||
| 			NCLocator.getInstance().lookup(IDefdocService.class).insertDefdocs(o, | ||||
| 					createDefVO(arrxsddh, "BIP-ddh", o.toString())); | ||||
| 		} | ||||
|         if (arrxsddh.size() > 0) { | ||||
|             sql = " select code from bd_defdoc where  pk_defdoclist in( select pk_defdoclist from bd_defdoclist  where code='BIP-ddh') and pk_org='" | ||||
|                     + o + "' and  "; | ||||
|             sql += BFPubTools.getInSqlWithOutAnd("code", arrxsddh, 0, arrxsddh.size()); | ||||
|             ArrayList<String> obj_arrhth = (ArrayList<String>) baseDAO.executeQuery(sql, new ColumnListProcessor()); | ||||
|             if (obj_arrhth != null && obj_arrhth.size() > 0) { | ||||
|                 arrxsddh.removeAll(obj_arrhth); | ||||
|             } | ||||
|         } | ||||
|         if (arrxsddh.size() > 0) { | ||||
|             NCLocator.getInstance().lookup(IDefdocService.class).insertDefdocs(o, | ||||
|                     createDefVO(arrxsddh, "BIP-ddh", o.toString())); | ||||
|         } | ||||
| 
 | ||||
| 	} | ||||
|     } | ||||
| 
 | ||||
| 	private void createPro(String cprocode, String cproname, Map map) throws BusinessException { | ||||
| 		String pk_org = (String) map.get("pk_org"); | ||||
| 		String pk_org_v = (String) map.get("pk_vid"); | ||||
|     private void createPro(String cprocode, String cproname, Map map) throws BusinessException { | ||||
|         String pk_org = (String) map.get("pk_org"); | ||||
|         String pk_org_v = (String) map.get("pk_vid"); | ||||
| 
 | ||||
| 		ProjectHeadVO hvo = new ProjectHeadVO(); | ||||
| 		hvo.setProject_code(cprocode); | ||||
| 		hvo.setProject_name(cproname); | ||||
| 		hvo.setPk_org(pk_org); | ||||
| 		hvo.setPk_org_v(pk_org_v); | ||||
|         ProjectHeadVO hvo = new ProjectHeadVO(); | ||||
|         hvo.setProject_code(cprocode); | ||||
|         hvo.setProject_name(cproname); | ||||
|         hvo.setPk_org(pk_org); | ||||
|         hvo.setPk_org_v(pk_org_v); | ||||
| 
 | ||||
| 		hvo.setBill_type("4D10"); | ||||
| 		hvo.setCreationtime(new UFDateTime()); | ||||
| 		hvo.setCreator(InvocationInfoProxy.getInstance().getUserId()); | ||||
| 		hvo.setPk_group(InvocationInfoProxy.getInstance().getGroupId()); | ||||
| 		hvo.setDr(0); | ||||
| 		hvo.setPk_duty_org(pk_org); | ||||
| 		hvo.setTransi_type("4D10-01"); | ||||
| 		hvo.setPk_eps("1001A110000000004K64"); | ||||
| 		hvo.setPk_duty_dept_v(pk_org_v); | ||||
| 		hvo.setEnablestate(2); | ||||
| 		NCLocator.getInstance().lookup(IProject.class).insertProject(hvo); | ||||
| 	} | ||||
|         hvo.setBill_type("4D10"); | ||||
|         hvo.setCreationtime(new UFDateTime()); | ||||
|         hvo.setCreator(InvocationInfoProxy.getInstance().getUserId()); | ||||
|         hvo.setPk_group(InvocationInfoProxy.getInstance().getGroupId()); | ||||
|         hvo.setDr(0); | ||||
|         hvo.setPk_duty_org(pk_org); | ||||
|         hvo.setTransi_type("4D10-01"); | ||||
|         hvo.setPk_eps("1001A110000000004K64"); | ||||
|         hvo.setPk_duty_dept_v(pk_org_v); | ||||
|         hvo.setEnablestate(2); | ||||
|         NCLocator.getInstance().lookup(IProject.class).insertProject(hvo); | ||||
|     } | ||||
| 
 | ||||
| 	private DefdocVO[] createDefVO(List<String> newhth, String defdoclistcode, String pk_org) throws BusinessException { | ||||
| 		String sql = " select pk_defdoclist from bd_defdoclist  where code='" + defdoclistcode + "' "; | ||||
| 		String o = (String) getDao().executeQuery(sql, new ColumnProcessor()); | ||||
|     private DefdocVO[] createDefVO(List<String> newhth, String defdoclistcode, String pk_org) throws BusinessException { | ||||
|         String sql = " select pk_defdoclist from bd_defdoclist  where code='" + defdoclistcode + "' "; | ||||
|         String o = (String) getDao().executeQuery(sql, new ColumnProcessor()); | ||||
| 
 | ||||
| 		ArrayList<DefdocVO> arrvo = new ArrayList<DefdocVO>(); | ||||
| 		for (int i = 0; i < newhth.size(); i++) { | ||||
| 			DefdocVO vo = new DefdocVO(); | ||||
| 			vo.setEnablestate(2); | ||||
| 			vo.setPk_defdoclist(o); | ||||
| 			vo.setPk_org(pk_org); | ||||
| 			vo.setCode(newhth.get(i)); | ||||
| 			vo.setName(newhth.get(i)); | ||||
| 			vo.setDataoriginflag(0); | ||||
| 			vo.setDr(0); | ||||
| 			vo.setPk_group(InvocationInfoProxy.getInstance().getGroupId()); | ||||
| 			vo.setCreator(InvocationInfoProxy.getInstance().getUserId()); | ||||
| 			vo.setCreationtime(new UFDateTime()); | ||||
|         ArrayList<DefdocVO> arrvo = new ArrayList<DefdocVO>(); | ||||
|         for (int i = 0; i < newhth.size(); i++) { | ||||
|             DefdocVO vo = new DefdocVO(); | ||||
|             vo.setEnablestate(2); | ||||
|             vo.setPk_defdoclist(o); | ||||
|             vo.setPk_org(pk_org); | ||||
|             vo.setCode(newhth.get(i)); | ||||
|             vo.setName(newhth.get(i)); | ||||
|             vo.setDataoriginflag(0); | ||||
|             vo.setDr(0); | ||||
|             vo.setPk_group(InvocationInfoProxy.getInstance().getGroupId()); | ||||
|             vo.setCreator(InvocationInfoProxy.getInstance().getUserId()); | ||||
|             vo.setCreationtime(new UFDateTime()); | ||||
| 
 | ||||
| 			arrvo.add(vo); | ||||
| 		} | ||||
|             arrvo.add(vo); | ||||
|         } | ||||
| 
 | ||||
| 		return arrvo.toArray(new DefdocVO[arrvo.size()]); | ||||
|         return arrvo.toArray(new DefdocVO[arrvo.size()]); | ||||
| 
 | ||||
| 	} | ||||
|     } | ||||
| 
 | ||||
| 	private void setMaterl(Map<String, Object> bodydata) throws BusinessException { | ||||
| 		String sql = " select a.pk_material,a.pk_source, a.pk_measdoc cunitid,nvl(b.pk_measdoc,a.pk_measdoc) castunitid,nvl(b.measrate,'1/1') measrate from bd_material a left join bd_materialconvert  b on a.pk_material=b.pk_material where a.code='" | ||||
| 				+ bodydata.get("cmaterialvid") + "'  "; | ||||
| 		Map map = (Map) getDao().executeQuery(sql, new MapProcessor()); | ||||
| 		if (map == null) { | ||||
| 			throw new BusinessException(bodydata.get("cmaterialvid") + "物料未查到"); | ||||
| 		} | ||||
| 		bodydata.put("castunitid", map.get("castunitid")); | ||||
| 		bodydata.put("vchangerate", map.get("measrate")); | ||||
| 		// 重新计算金额 | ||||
| 		bodydata.put("cqtunitid", map.get("castunitid")); | ||||
| 		bodydata.put("cunitid", map.get("cunitid")); | ||||
|     private void setMaterl(Map<String, Object> bodydata) throws BusinessException { | ||||
|         String sql = " select a.pk_material,a.pk_source, a.pk_measdoc cunitid,nvl(b.pk_measdoc,a.pk_measdoc) castunitid,nvl(b.measrate,'1/1') measrate from bd_material a left join bd_materialconvert  b on a.pk_material=b.pk_material where a.code='" | ||||
|                 + bodydata.get("cmaterialvid") + "'  "; | ||||
|         Map map = (Map) getDao().executeQuery(sql, new MapProcessor()); | ||||
|         if (map == null) { | ||||
|             throw new BusinessException(bodydata.get("cmaterialvid") + "物料未查到"); | ||||
|         } | ||||
|         bodydata.put("castunitid", map.get("castunitid")); | ||||
|         bodydata.put("vchangerate", map.get("measrate")); | ||||
|         // 重新计算金额 | ||||
|         bodydata.put("cqtunitid", map.get("castunitid")); | ||||
|         bodydata.put("cunitid", map.get("cunitid")); | ||||
| 
 | ||||
| 		bodydata.put("cmaterialid", map.get("pk_material")); | ||||
| 		bodydata.put("cmaterialvid", map.get("pk_source")); | ||||
|         bodydata.put("cmaterialid", map.get("pk_material")); | ||||
|         bodydata.put("cmaterialvid", map.get("pk_source")); | ||||
| 
 | ||||
| 		bodydata.put("nqtunitnum", BFPubTools.getUFDouble_NullAsZero(bodydata.get("nnum")) | ||||
| 				.div(BFPubTools.getUFDouble_NullAsZero(map.get("measrate").toString().split("/")[0]))); | ||||
| 		 | ||||
| 		bodydata.put("nastnum", BFPubTools.getUFDouble_NullAsZero(bodydata.get("nnum")) | ||||
| 				.div(BFPubTools.getUFDouble_NullAsZero(map.get("measrate").toString().split("/")[0]))); | ||||
| 		sql = "select sl.pk_taxcode from bd_taxrate sl inner join bd_taxcode sm on sl.pk_taxcode=sm.pk_taxcode  where sl.taxrate=" | ||||
| 				+ bodydata.get("ntaxrate") + " and sm.pk_group<>'~' " + ""; | ||||
|         bodydata.put("nqtunitnum", BFPubTools.getUFDouble_NullAsZero(bodydata.get("nnum")) | ||||
|                 .div(BFPubTools.getUFDouble_NullAsZero(map.get("measrate").toString().split("/")[0]))); | ||||
| 
 | ||||
| 		String o_pk_project = (String) getDao().executeQuery(sql, new ColumnProcessor()); | ||||
| 		bodydata.put("ctaxcodeid", o_pk_project); | ||||
|         bodydata.put("nastnum", BFPubTools.getUFDouble_NullAsZero(bodydata.get("nnum")) | ||||
|                 .div(BFPubTools.getUFDouble_NullAsZero(map.get("measrate").toString().split("/")[0]))); | ||||
|         sql = "select sl.pk_taxcode from bd_taxrate sl inner join bd_taxcode sm on sl.pk_taxcode=sm.pk_taxcode  where sl.taxrate=" | ||||
|                 + bodydata.get("ntaxrate") + " and sm.pk_group<>'~' " + ""; | ||||
| 
 | ||||
| 	} | ||||
|         String o_pk_project = (String) getDao().executeQuery(sql, new ColumnProcessor()); | ||||
|         bodydata.put("ctaxcodeid", o_pk_project); | ||||
| 
 | ||||
| 	@POST | ||||
| 	@Path("update") | ||||
| 	@Consumes({ "application/json" }) | ||||
| 	@Produces({ "application/json" }) | ||||
| 	public JSONString update(Map<String, Object> paramMap) { | ||||
| 		try { | ||||
| 			if (paramMap == null || !paramMap.containsKey(HEADTABLE) || !paramMap.containsKey(BODYTABLE)) { | ||||
| 				return ResultMessageUtil.exceptionToJSON("传入参数不能为空", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
| 			} | ||||
| 			List<Map<String, Object>> paramList = new ArrayList<Map<String, Object>>(); | ||||
|     } | ||||
| 
 | ||||
| 			paramList.add(paramMap); | ||||
|     @POST | ||||
|     @Path("update") | ||||
|     @Consumes({"application/json"}) | ||||
|     @Produces({"application/json"}) | ||||
|     public JSONString update(Map<String, Object> paramMap) { | ||||
|         try { | ||||
|             if (paramMap == null || !paramMap.containsKey(HEADTABLE) || !paramMap.containsKey(BODYTABLE)) { | ||||
|                 return ResultMessageUtil.exceptionToJSON("传入参数不能为空", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
|             } | ||||
|             List<Map<String, Object>> paramList = new ArrayList<Map<String, Object>>(); | ||||
| 
 | ||||
| 			IAPISaleOrderMaitain service = (IAPISaleOrderMaitain) NCLocator.getInstance() | ||||
| 					.lookup(IAPISaleOrderMaitain.class); | ||||
| 			SaleOrderVO[] results = service.update(paramList); | ||||
|             paramList.add(paramMap); | ||||
| 
 | ||||
| 			return ResultMessageUtil.toJSON(results, "销售订单修改成功"); | ||||
| 		} catch (Exception e) { | ||||
| 			return ResultMessageUtil.exceptionToJSON(e); | ||||
| 		} | ||||
| 	} | ||||
|             IAPISaleOrderMaitain service = (IAPISaleOrderMaitain) NCLocator.getInstance() | ||||
|                     .lookup(IAPISaleOrderMaitain.class); | ||||
|             SaleOrderVO[] results = service.update(paramList); | ||||
| 
 | ||||
| 	@POST | ||||
| 	@Path("operation/delete") | ||||
| 	@Consumes({ "application/json" }) | ||||
| 	@Produces({ "application/json" }) | ||||
| 	public JSONString delete(Map<String, Object> paramMap) { | ||||
| 		ArrayList<String> paramArray = (ArrayList) paramMap.get("csaleorderid"); | ||||
| 		String[] hids = (String[]) paramArray.toArray(new String[0]); | ||||
| 		return delete(hids); | ||||
| 	} | ||||
|             // return ResultMessageUtil.toJSON(results, "销售订单修改成功"); | ||||
|             // 包装返回信息 | ||||
|             return NCCRestUtils.toJSONString(CallReturnBuildUtil.buildSuccessResult( | ||||
|                     results, "销售订单修改成功")); | ||||
|         } catch (Exception e) { | ||||
|             return ResultMessageUtil.exceptionToJSON(e); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 	@POST | ||||
| 	@Path("delete") | ||||
| 	@Consumes({ "application/json" }) | ||||
| 	@Produces({ "application/json" }) | ||||
| 	public JSONString delete(String[] hids) { | ||||
| 		if (hids == null || hids.length == 0) { | ||||
| 			return ResultMessageUtil.exceptionToJSON("传入参数为空,请检查", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
| 		} | ||||
|     @POST | ||||
|     @Path("operation/delete") | ||||
|     @Consumes({"application/json"}) | ||||
|     @Produces({"application/json"}) | ||||
|     public JSONString delete(Map<String, Object> paramMap) { | ||||
|         ArrayList<String> paramArray = (ArrayList) paramMap.get("csaleorderid"); | ||||
|         String[] hids = (String[]) paramArray.toArray(new String[0]); | ||||
|         return delete(hids); | ||||
|     } | ||||
| 
 | ||||
| 		try { | ||||
| 			((IAPISaleOrderMaitain) NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class)).delete(hids); | ||||
| 			String[] arr = new String[0]; | ||||
| 			return ResultMessageUtil.toJSON(arr, "销售订单删除成功"); | ||||
| 		} catch (Exception e) { | ||||
| 			return ResultMessageUtil.exceptionToJSON(new BusinessException("删除销售订单出现异常", e)); | ||||
| 		} | ||||
| 	} | ||||
|     @POST | ||||
|     @Path("delete") | ||||
|     @Consumes({"application/json"}) | ||||
|     @Produces({"application/json"}) | ||||
|     public JSONString delete(String[] hids) { | ||||
|         if (hids == null || hids.length == 0) { | ||||
|             return ResultMessageUtil.exceptionToJSON("传入参数为空,请检查", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
|         } | ||||
| 
 | ||||
| 	@POST | ||||
| 	@Path("querybyscheme") | ||||
| 	@Consumes({ "application/json" }) | ||||
| 	@Produces({ "application/json" }) | ||||
| 	public JSONString queryByScheme(Map<String, Object> paramMap) { | ||||
| 		SaleOrderVO[] resultVOs = null; | ||||
|         try { | ||||
|             ((IAPISaleOrderMaitain) NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class)).delete(hids); | ||||
|             String[] arr = new String[0]; | ||||
|             return ResultMessageUtil.toJSON(arr, "销售订单删除成功"); | ||||
|         } catch (Exception e) { | ||||
|             return ResultMessageUtil.exceptionToJSON(new BusinessException("删除销售订单出现异常", e)); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 		try { | ||||
| 			resultVOs = ((IAPISaleOrderQuery) NCLocator.getInstance().lookup(IAPISaleOrderQuery.class)) | ||||
| 					.queryByScheme(paramMap); | ||||
|     @POST | ||||
|     @Path("querybyscheme") | ||||
|     @Consumes({"application/json"}) | ||||
|     @Produces({"application/json"}) | ||||
|     public JSONString queryByScheme(Map<String, Object> paramMap) { | ||||
|         SaleOrderVO[] resultVOs = null; | ||||
| 
 | ||||
| 			return ResultMessageUtil.toJSON(resultVOs, "查询销售订单成功"); | ||||
| 		} catch (Exception e) { | ||||
| 			return ResultMessageUtil.exceptionToJSON(e); | ||||
| 		} | ||||
| 	} | ||||
|         try { | ||||
|             resultVOs = ((IAPISaleOrderQuery) NCLocator.getInstance().lookup(IAPISaleOrderQuery.class)) | ||||
|                     .queryByScheme(paramMap); | ||||
| 
 | ||||
| 	@POST | ||||
| 	@Path("sendapprove") | ||||
| 	@Consumes({ "application/json" }) | ||||
| 	@Produces({ "application/json" }) | ||||
| 	public JSONString sendApprove(Map<String, Object> paramMap) { | ||||
| 		SaleOrderVO[] sendApprove = null; | ||||
| 		ArrayList<String> paramArray = (ArrayList) paramMap.get("csaleorderid"); | ||||
| 		String[] hids = (String[]) paramArray.toArray(new String[0]); | ||||
| 		if (hids == null || hids.length == 0) { | ||||
| 			return ResultMessageUtil.exceptionToJSON("传入参数为空,请检查", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
| 		} | ||||
|             return ResultMessageUtil.toJSON(resultVOs, "查询销售订单成功"); | ||||
|         } catch (Exception e) { | ||||
|             return ResultMessageUtil.exceptionToJSON(e); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 		try { | ||||
| 			sendApprove = ((IAPISaleOrderMaitain) NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class)) | ||||
| 					.sendApprove(hids); | ||||
| 			return ResultMessageUtil.toJSON(sendApprove, "销售订单提交成功"); | ||||
| 		} catch (BusinessException e) { | ||||
| 			return ResultMessageUtil.exceptionToJSON(e); | ||||
| 		} | ||||
| 	} | ||||
|     @POST | ||||
|     @Path("sendapprove") | ||||
|     @Consumes({"application/json"}) | ||||
|     @Produces({"application/json"}) | ||||
|     public JSONString sendApprove(Map<String, Object> paramMap) { | ||||
|         SaleOrderVO[] sendApprove = null; | ||||
|         ArrayList<String> paramArray = (ArrayList) paramMap.get("csaleorderid"); | ||||
|         String[] hids = (String[]) paramArray.toArray(new String[0]); | ||||
|         if (hids == null || hids.length == 0) { | ||||
|             return ResultMessageUtil.exceptionToJSON("传入参数为空,请检查", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
|         } | ||||
| 
 | ||||
| 	@POST | ||||
| 	@Path("unsend") | ||||
| 	@Consumes({ "application/json" }) | ||||
| 	@Produces({ "application/json" }) | ||||
| 	public JSONString unSendApprove(Map<String, Object> paramMap) { | ||||
| 		SaleOrderVO[] unSend = null; | ||||
| 		ArrayList<String> paramArray = (ArrayList) paramMap.get("csaleorderid"); | ||||
| 		String[] hids = (String[]) paramArray.toArray(new String[0]); | ||||
| 		if (hids == null || hids.length == 0) { | ||||
| 			return ResultMessageUtil.exceptionToJSON("传入参数为空,请检查", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
| 		} | ||||
|         try { | ||||
|             sendApprove = ((IAPISaleOrderMaitain) NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class)) | ||||
|                     .sendApprove(hids); | ||||
|             return ResultMessageUtil.toJSON(sendApprove, "销售订单提交成功"); | ||||
|         } catch (BusinessException e) { | ||||
|             return ResultMessageUtil.exceptionToJSON(e); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 		try { | ||||
| 			unSend = ((IAPISaleOrderMaitain) NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class)) | ||||
| 					.unSendApprove(hids); | ||||
| 			return ResultMessageUtil.toJSON(unSend, "销售订单收回成功"); | ||||
| 		} catch (BusinessException e) { | ||||
| 			return ResultMessageUtil.exceptionToJSON(e); | ||||
| 		} | ||||
| 	} | ||||
|     @POST | ||||
|     @Path("unsend") | ||||
|     @Consumes({"application/json"}) | ||||
|     @Produces({"application/json"}) | ||||
|     public JSONString unSendApprove(Map<String, Object> paramMap) { | ||||
|         SaleOrderVO[] unSend = null; | ||||
|         ArrayList<String> paramArray = (ArrayList) paramMap.get("csaleorderid"); | ||||
|         String[] hids = (String[]) paramArray.toArray(new String[0]); | ||||
|         if (hids == null || hids.length == 0) { | ||||
|             return ResultMessageUtil.exceptionToJSON("传入参数为空,请检查", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
|         } | ||||
| 
 | ||||
| 	@POST | ||||
| 	@Path("approve") | ||||
| 	@Consumes({ "application/json" }) | ||||
| 	@Produces({ "application/json" }) | ||||
| 	public JSONString approve(Map<String, Object> paramMap) { | ||||
| 		SaleOrderVO[] aprove = null; | ||||
| 		ArrayList<String> paramArray = (ArrayList) paramMap.get("csaleorderid"); | ||||
| 		String[] hids = (String[]) paramArray.toArray(new String[0]); | ||||
| 		if (hids == null || hids.length == 0) { | ||||
| 			return ResultMessageUtil.exceptionToJSON("传入参数为空,请检查", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
| 		} | ||||
| 		try { | ||||
| 			aprove = ((IAPISaleOrderMaitain) NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class)).approve(hids); | ||||
| 			return ResultMessageUtil.toJSON(aprove, "销售订单审批成功"); | ||||
| 		} catch (BusinessException e) { | ||||
| 			return ResultMessageUtil.exceptionToJSON(e); | ||||
| 		} | ||||
| 	} | ||||
|         try { | ||||
|             unSend = ((IAPISaleOrderMaitain) NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class)) | ||||
|                     .unSendApprove(hids); | ||||
|             return ResultMessageUtil.toJSON(unSend, "销售订单收回成功"); | ||||
|         } catch (BusinessException e) { | ||||
|             return ResultMessageUtil.exceptionToJSON(e); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 	@POST | ||||
| 	@Path("unapprove") | ||||
| 	@Consumes({ "application/json" }) | ||||
| 	@Produces({ "application/json" }) | ||||
| 	public JSONString unApprove(Map<String, Object> paramMap) { | ||||
| 		SaleOrderVO[] unaprove = null; | ||||
| 		ArrayList<String> paramArray = (ArrayList) paramMap.get("csaleorderid"); | ||||
| 		String[] hids = (String[]) paramArray.toArray(new String[0]); | ||||
| 		if (hids == null || hids.length == 0) { | ||||
| 			return ResultMessageUtil.exceptionToJSON("传入参数为空,请检查", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
| 		} | ||||
| 		try { | ||||
| 			unaprove = ((IAPISaleOrderMaitain) NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class)) | ||||
| 					.unApprove(hids); | ||||
| 			return ResultMessageUtil.toJSON(unaprove, "销售订单取消审批成功"); | ||||
| 		} catch (BusinessException e) { | ||||
| 			return ResultMessageUtil.exceptionToJSON(e); | ||||
| 		} | ||||
| 	} | ||||
|     @POST | ||||
|     @Path("approve") | ||||
|     @Consumes({"application/json"}) | ||||
|     @Produces({"application/json"}) | ||||
|     public JSONString approve(Map<String, Object> paramMap) { | ||||
|         SaleOrderVO[] aprove = null; | ||||
|         ArrayList<String> paramArray = (ArrayList) paramMap.get("csaleorderid"); | ||||
|         String[] hids = (String[]) paramArray.toArray(new String[0]); | ||||
|         if (hids == null || hids.length == 0) { | ||||
|             return ResultMessageUtil.exceptionToJSON("传入参数为空,请检查", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
|         } | ||||
|         try { | ||||
|             aprove = ((IAPISaleOrderMaitain) NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class)).approve(hids); | ||||
|             return ResultMessageUtil.toJSON(aprove, "销售订单审批成功"); | ||||
|         } catch (BusinessException e) { | ||||
|             return ResultMessageUtil.exceptionToJSON(e); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @POST | ||||
|     @Path("unapprove") | ||||
|     @Consumes({"application/json"}) | ||||
|     @Produces({"application/json"}) | ||||
|     public JSONString unApprove(Map<String, Object> paramMap) { | ||||
|         SaleOrderVO[] unaprove = null; | ||||
|         ArrayList<String> paramArray = (ArrayList) paramMap.get("csaleorderid"); | ||||
|         String[] hids = (String[]) paramArray.toArray(new String[0]); | ||||
|         if (hids == null || hids.length == 0) { | ||||
|             return ResultMessageUtil.exceptionToJSON("传入参数为空,请检查", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); | ||||
|         } | ||||
|         try { | ||||
|             unaprove = ((IAPISaleOrderMaitain) NCLocator.getInstance().lookup(IAPISaleOrderMaitain.class)) | ||||
|                     .unApprove(hids); | ||||
|             return ResultMessageUtil.toJSON(unaprove, "销售订单取消审批成功"); | ||||
|         } catch (BusinessException e) { | ||||
|             return ResultMessageUtil.exceptionToJSON(e); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue