public String itsubmit() { try { encodeHandle(); List<IssueType> updatedlists = new ArrayList<IssueType>(); List<IssueType> deletedlists = new ArrayList<IssueType>(); Date now = new Date(); if (updated != null) { updatedlists = JSON.parseArray(updated, IssueType.class); for (IssueType entity : updatedlists) { entity.setModifyTime(now); entity.setModifyStaff(staffno); } } if (deleted != null) { deletedlists = JSON.parseArray(deleted, IssueType.class); for (IssueType entity : deletedlists) { entity.setModifyTime(now); entity.setModifyStaff(staffno); } } issueTypeService.modify(updatedlists, deletedlists); } catch (Exception ex) { throw ex; } return null; }
public String itdata() { try { Map<String, Object> params = new HashMap<String, Object>(); params.put("staffno", staffno); if (!regionmarketid.equals("")) { String regionmarketWhere = " CHARINDEX(','+CAST(A.RegionMarketId AS VARCHAR(4))+',','," + regionmarketid + ",') > 0 "; params.put("regionmarketWhere", regionmarketWhere); } if (!tickettypeid.equals("")) { String tickettypeWhere = " CHARINDEX(','+CAST(A.TicketTypeId AS VARCHAR(4))+',','," + tickettypeid + ",') > 0 "; params.put("tickettypeWhere", tickettypeWhere); } params.put("starttime", startDate); params.put("endtime", endDate); List<IssueType> lists = issueTypeService.retrieveForMod(params); for (IssueType entity : lists) { entity.setRegionMarketName( (HelperUtils.getLanguageValue("zh", entity.getRegionMarketName()))); entity.setTicketTypeName((HelperUtils.getLanguageValue("zh", entity.getTicketTypeName()))); } 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; }