Package net.sf.json

Examples of net.sf.json.JSONObject.accumulate()


      currentUserName = UserUtil.getCurrentUserName(request);
      String creatorId = UserUtil.getCurrentUserId(request);
      Double[] count = financeManager.count(creatorId, request.getParameter("financeType"));
      DecimalFormat df = new DecimalFormat("#.00");
      JSONObject jsonObject = new JSONObject();
      jsonObject.accumulate("totalArrearage", df.format(count[0]));
      jsonObject.accumulate("requitedArrearage", df.format(count[1]));
      jsonObject.accumulate("remain", df.format(count[0] - count[1]));
      print(response, jsonObject.toString());
      log.info(currentUserName + ">统计欠款总额<type=" + request.getParameter("financeType") + ">=" + jsonObject.toString());
    } catch (Exception ex) {
View Full Code Here


      String creatorId = UserUtil.getCurrentUserId(request);
      Double[] count = financeManager.count(creatorId, request.getParameter("financeType"));
      DecimalFormat df = new DecimalFormat("#.00");
      JSONObject jsonObject = new JSONObject();
      jsonObject.accumulate("totalArrearage", df.format(count[0]));
      jsonObject.accumulate("requitedArrearage", df.format(count[1]));
      jsonObject.accumulate("remain", df.format(count[0] - count[1]));
      print(response, jsonObject.toString());
      log.info(currentUserName + ">统计欠款总额<type=" + request.getParameter("financeType") + ">=" + jsonObject.toString());
    } catch (Exception ex) {
      ex.printStackTrace();
View Full Code Here

      Double[] count = financeManager.count(creatorId, request.getParameter("financeType"));
      DecimalFormat df = new DecimalFormat("#.00");
      JSONObject jsonObject = new JSONObject();
      jsonObject.accumulate("totalArrearage", df.format(count[0]));
      jsonObject.accumulate("requitedArrearage", df.format(count[1]));
      jsonObject.accumulate("remain", df.format(count[0] - count[1]));
      print(response, jsonObject.toString());
      log.info(currentUserName + ">统计欠款总额<type=" + request.getParameter("financeType") + ">=" + jsonObject.toString());
    } catch (Exception ex) {
      ex.printStackTrace();
    }
View Full Code Here

      String newPwd2 = jsonObject.getString("newPwd2");
      jsonObject = new JSONObject();
      if (user.getPassword().equals(oldPwd) && newPwd1.equals(newPwd2)) {
        userManager.changePwd(user.getUserId(), newPwd1);
        log.info("用户<" + user + ">,修改密码成功!");
        jsonObject.accumulate("status", "success");
      } else {
        jsonObject.accumulate("status", "error");
        if (!user.getPassword().equals(oldPwd)) {
          log.warn(user + ",修改密码,错误:旧密码验证错误!");
          jsonObject.accumulate("error", "旧密码验证错误!");
View Full Code Here

      if (user.getPassword().equals(oldPwd) && newPwd1.equals(newPwd2)) {
        userManager.changePwd(user.getUserId(), newPwd1);
        log.info("用户<" + user + ">,修改密码成功!");
        jsonObject.accumulate("status", "success");
      } else {
        jsonObject.accumulate("status", "error");
        if (!user.getPassword().equals(oldPwd)) {
          log.warn(user + ",修改密码,错误:旧密码验证错误!");
          jsonObject.accumulate("error", "旧密码验证错误!");
        } else if (!newPwd1.equals(newPwd2)) {
          log.warn(user + ",修改密码,错误:两次新密码不相同!");
View Full Code Here

        jsonObject.accumulate("status", "success");
      } else {
        jsonObject.accumulate("status", "error");
        if (!user.getPassword().equals(oldPwd)) {
          log.warn(user + ",修改密码,错误:旧密码验证错误!");
          jsonObject.accumulate("error", "旧密码验证错误!");
        } else if (!newPwd1.equals(newPwd2)) {
          log.warn(user + ",修改密码,错误:两次新密码不相同!");
          jsonObject.accumulate("error", "两次新密码不相同!");
        }
      }
View Full Code Here

        if (!user.getPassword().equals(oldPwd)) {
          log.warn(user + ",修改密码,错误:旧密码验证错误!");
          jsonObject.accumulate("error", "旧密码验证错误!");
        } else if (!newPwd1.equals(newPwd2)) {
          log.warn(user + ",修改密码,错误:两次新密码不相同!");
          jsonObject.accumulate("error", "两次新密码不相同!");
        }
      }
      print(response, jsonObject.toString());
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

      Map<String, String[]> parameterMap = request.getParameterMap();
      Iterator<String> paIter = parameterMap.keySet().iterator();
      while (paIter.hasNext()) {
        String key = paIter.next().toString();
        String[] values = (String[])parameterMap.get(key);
        jsonObject.accumulate(key, values[0]);
      }
      log.debug("从客户端获得json=" + jsonObject.toString());
    } catch (Exception e) {
      log.error("获取json数据出错,错误信息如下:\n\t" + e.getMessage());
      e.printStackTrace();
View Full Code Here

    Integer goodsTypeId = StringUtil.getIntValue(request, "id");
    try {
      currentUserName = UserUtil.getCurrentUserName(request);
      GoodsType goodsType = (GoodsType) getBaseManager().get(GoodsType.class, goodsTypeId);
      JSONObject jsonObject = new JSONObject();
      jsonObject.accumulate("createDate", StringUtil.getValue(goodsType.getCreateDate(),"date"));
     
      //jsonObject.accumulate("parentId", goodsTypeManager.getParentTypes(goodsTypeId));
      jsonObject.accumulate("parentId", goodsType.getParentId() == null ? 0 : goodsType.getParentId());
      jsonObject.accumulate("typeName", goodsType.getTypeName());
      jsonObject.accumulate("remark", goodsType.getRemark());
View Full Code Here

      GoodsType goodsType = (GoodsType) getBaseManager().get(GoodsType.class, goodsTypeId);
      JSONObject jsonObject = new JSONObject();
      jsonObject.accumulate("createDate", StringUtil.getValue(goodsType.getCreateDate(),"date"));
     
      //jsonObject.accumulate("parentId", goodsTypeManager.getParentTypes(goodsTypeId));
      jsonObject.accumulate("parentId", goodsType.getParentId() == null ? 0 : goodsType.getParentId());
      jsonObject.accumulate("typeName", goodsType.getTypeName());
      jsonObject.accumulate("remark", goodsType.getRemark());
      print(response, jsonObject.toString());
      log.debug(currentUserName + ">载入物品类型[name=" + goodsType.getTypeName() + "]");
    } catch(JSONException je) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.