예제 #1
0
  public String sdsubmit() {
    try {
      encodeHandle();

      List<StatusDetail> updatedlists = new ArrayList<StatusDetail>();
      List<StatusDetail> deletedlists = new ArrayList<StatusDetail>();

      Date now = new Date();
      if (updated != null) {
        updatedlists = JSON.parseArray(updated, StatusDetail.class);
        for (StatusDetail entity : updatedlists) {
          entity.setModifyTime(now);
          entity.setModifyStaff(staffno);
        }
      }
      if (deleted != null) {
        deletedlists = JSON.parseArray(deleted, StatusDetail.class);
        for (StatusDetail entity : deletedlists) {
          entity.setModifyTime(now);
          entity.setModifyStaff(staffno);
        }
      }
      statusDetailService.modify(updatedlists, deletedlists);
    } catch (Exception ex) {
      throw ex;
    }
    return null;
  }
예제 #2
0
  public String sddata() {
    try {
      Map<String, Object> params = new HashMap<String, Object>();
      params.put("staffno", staffno);
      if (!statusid.equals("")) {
        String statusWhere =
            " CHARINDEX(','+CAST(A.StatusId AS VARCHAR(4))+',','," + statusid + ",') > 0 ";
        params.put("statusWhere", statusWhere);
      }
      params.put("starttime", startDate);
      params.put("endtime", endDate);

      List<StatusDetail> lists = statusDetailService.retrieveForMod(params);
      for (StatusDetail entity : lists) {
        entity.setStatusName(HelperUtils.getLanguageValue("zh", entity.getStatusName()));
      }
      JsonConfig jsonConfig = new JsonConfig();
      jsonConfig.registerJsonValueProcessor(
          Date.class, new JsonDateValueProcessor("yyyy-MM-dd HH:mm:ss"));
      JSONArray json = JSONArray.fromObject(lists, jsonConfig);
      String s = json.toString();
      postJSON("{\"rows\":" + s + "}");
    } catch (Exception ex) {
      throw ex;
    }
    return null;
  }