Ejemplo n.º 1
0
 public String syncData() throws Exception {
   contractChangeProtocolService.syncData(startDate, endDate);
   contractChangeItemService.syncData(startDate, endDate);
   Map<String, Object> resultMap = new HashMap<String, Object>();
   resultMap.put("success", "数据同步成功");
   outputJson(resultMap, getCallback());
   return Action.NONE;
 }
Ejemplo n.º 2
0
  public String history() throws Exception {
    Map<String, Object> filter = new HashMap<String, Object>();

    if (null != contract.getSelfNo() && !"".equals(contract.getSelfNo())) {
      filter.put("selfNo", contract.getSelfNo());
    }
    if (null != contract.getContractNo() && !"".equals(contract.getContractNo())) {
      filter.put("contractNo", contract.getContractNo());
    }
    if (null != contractId && !"".equals(contractId)) {
      filter.put("contractId", contractId);
    }

    Map changeItemMap = contractChangeItemService.getChangeItemNum(filter);
    Map protocolMap = contractChangeProtocolService.getProtocolNumAndPrice(filter);
    HashMap param = new HashMap();
    param.put("id", contractId);
    List<Contract> list = contractService.findByFilter(param);
    String url = "/";
    if (list != null) {
      try {
        Resource resource = new ClassPathResource("/config.properties");
        Properties props = PropertiesLoaderUtils.loadProperties(resource);
        url = props.getProperty("apiUrl");

        url += "investCost/contract/showView.action?id=" + list.get(0).getId();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
    Map result = new HashMap();
    result.put("changeItemTotalNum", changeItemMap.get("changeItemTotalNum"));
    result.put("protocolTotalNum", protocolMap.get("protocolTotalNum"));
    result.put("protocolTotalPrice", protocolMap.get("protocolTotalPrice"));
    result.put("url", url);
    outputJson(result, getCallback());
    return Action.NONE;
  }