예제 #1
0
  private RecordedCase ModelToBean(GWTRecordedCase gwtRecordedCase) {

    RecordedCase bean = new RecordedCase();
    bean.setRequestMsg(gwtRecordedCase.getRequestMsg());
    bean.setResponseMsg(gwtRecordedCase.getResponseMsg());
    bean.setResponseFlag(gwtRecordedCase.getResponseFlag());
    bean.setIsCased(gwtRecordedCase.getIsCased());
    bean.setMemo(gwtRecordedCase.getMemo());
    bean.setCreateTime(gwtRecordedCase.GetCreateTime());
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date date = new Date();
    try {
      String recordTime = gwtRecordedCase.GetRecordTime();
      date = sdf.parse(recordTime);
    } catch (ParseException e) {
      String recordTime = gwtRecordedCase.GetCreateTime();
      try {
        date = sdf.parse(recordTime);
      } catch (ParseException e1) {
        e1.printStackTrace();
      }
    }
    bean.setRecordTime(date);
    bean.setSystemId(Integer.parseInt(gwtRecordedCase.getSystemID()));
    if (gwtRecordedCase.GetRecordUserId() != null) {
      bean.setRecordUserId(Integer.parseInt(gwtRecordedCase.GetRecordUserId()));
    }
    if (!gwtRecordedCase.IsNew()) {
      bean.setId(Integer.parseInt(gwtRecordedCase.getID()));
    }
    // bean.setRecordTime(gwtRecordedCase.GetRecordTime());

    return bean;
  }
예제 #2
0
  @Override
  public Boolean DeleteRecordedCase(List<GWTRecordedCase> recordedCaseList, Integer loginLogId) {

    for (GWTRecordedCase recordedCase : recordedCaseList) {
      dataDao.Del(ModelToBean(recordedCase));
      try {
        OperationLogService.writeOperationLog(
            OpType.RecordedCase,
            IDUType.Delete,
            Integer.parseInt(recordedCase.getID()),
            recordedCase.getMemo(),
            "requestMsg/recordTime",
            recordedCase.getRequestMsg() == null
                ? ""
                : recordedCase.getRequestMsg().substring(0, 1024),
            recordedCase.GetRecordTime(),
            loginLogId);
      } catch (Exception e) {
        log.error(e, e);
      }
    }

    return true;
  }