代码问题

private Map getDealRequestAccountApplyData(HttpServletRequest request,String STATUS) throws JsonParseException, JsonMappingException, IOException {
		ObjectMapper mapper = new ObjectMapper(); //转换器 
		String applyType = request.getParameter("applyType")==null?"":request.getParameter("applyType");
		HashMap mainMap = new HashMap();
		if(AccountConstant.ACCOUNT_OPEN_TYPE.equals(applyType)){
			String mainJSON = request.getParameter("mainData");
			mainMap = (HashMap) mapper.readValue(mainJSON, Map.class);
			String accountName = mainMap.get("accountName")==null?"":mainMap.get("accountName").toString().replace("(", "(").replace(")", ")");
			mainMap.put("accountName", accountName);
		}else if(AccountConstant.ACCOUNT_CHANGE_TYPE.equals(applyType)){
			String id = request.getParameter("id")==null?"":request.getParameter("id");
			String applyNo = request.getParameter("applyNo")==null?"":request.getParameter("applyNo");
			String beforeJSON = request.getParameter("beforeData");
			HashMap beforeMap = (HashMap) mapper.readValue(beforeJSON, Map.class);
			String accountNoBefore = beforeMap.get("accountNo")==null?"":beforeMap.get("accountNo").toString();
			Account account = this.mapper.getAccountByAccountNo(accountNoBefore);
			mainMap.put("accountId", account.getId());
			String afterJSON = request.getParameter("afterData");
			HashMap afterMap = (HashMap) mapper.readValue(afterJSON, Map.class);
			mainMap.putAll(afterMap);
			mainMap.put("applyNo", applyNo);
			mainMap.put("id", id);
		}else if(AccountConstant.ACCOUNT_CLOSE_TYPE.equals(applyType)){
			String id = request.getParameter("id")==null?"":request.getParameter("id");
			String applyNo = request.getParameter("applyNo")==null?"":request.getParameter("applyNo");
			String afterJSON = request.getParameter("afterData");
			mainMap = (HashMap) mapper.readValue(afterJSON, Map.class);
			String accountNo = mainMap.get("accountNo")==null?"":mainMap.get("accountNo").toString();
			Account account = this.mapper.getAccountByAccountNo(accountNo);
			mainMap.put("accountId", account.getId());
			mainMap.put("applyNo", applyNo);
			mainMap.put("id", id);
		}
		mainMap.put("applyType", applyType);
		return mainMap = this.getDealRequestAccountApplyData(mainMap,STATUS);
	}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值