public List<EpTaskStepHistory> listEpTaskStepHistory(String historyTaskId) { if (StringUtils.isBlank(historyTaskId)) { throw new BusinessException("id", ErrorCode.PARAMETER_NOT_FOUND); } EpTaskStepHistoryExample example = new EpTaskStepHistoryExample(); EpTaskStepHistoryExample.Criteria criteria = example.createCriteria(); criteria.andHistoryTaskIdEqualTo(historyTaskId); List<EpTaskStepHistory> list = epTaskStepHistoryDAO.selectByExample(example); return list; }
public List<EpTaskHistory> listEpTaskHistory( String startTime, String endTime, String taskId, String organName, String branchName, String employeeName, String userId, String allotUserId, String employeeId) { EpTaskHistoryVO epTaskHistory = new EpTaskHistoryVO(); if (!StringUtils.isBlank(startTime)) { epTaskHistory.setStartTime(startTime); } if (!StringUtils.isBlank(endTime)) { epTaskHistory.setEndTime(endTime); } if (!StringUtils.isBlank(allotUserId)) { epTaskHistory.setAllotUserId(allotUserId); } if (!StringUtils.isBlank(taskId)) { epTaskHistory.setTaskId(taskId); } if (!StringUtils.isBlank(organName)) { epTaskHistory.setOrganName(organName); } if (!StringUtils.isBlank(branchName)) { epTaskHistory.setBranchName(branchName); } if (!StringUtils.isBlank(employeeName)) { epTaskHistory.setEmployeeName(employeeName); } if (!StringUtils.isBlank(userId)) { epTaskHistory.setUserId(userId); } if (!StringUtils.isBlank(employeeId)) { epTaskHistory.setEmployeeId(employeeId); } return epTaskStepHistoryDAO.listEpTaskStepHistory(epTaskHistory); }
public void finishTask(String jsonString) throws JSONException { JSONObject jsonObj = new JSONObject(jsonString); String epRtaskEmployeeId = jsonObj.getString("id"); String taskResult = jsonObj.getString("result"); EpRTaskEmployee epRTaskEmployee = epRTaskEmployeeDAO.selectByPrimaryKey(epRtaskEmployeeId); EpTask epTask = epTaskDAO.selectByPrimaryKey(epRTaskEmployee.getTaskId()); EpTaskHistory taskHistory = new EpTaskHistory(); String historyTaskId = sequenceDAO.getEpTaskHistoryeq(); taskHistory.setId(historyTaskId); taskHistory.setAllotUserId(epRTaskEmployee.getAllotUserId()); Branch branch = branchDAO.selectByPrimaryKey(epTask.getBranchId()); String branchName = null; if (branch != null) { branchName = branch.getName(); } taskHistory.setBranchName(branchName); String EmployeeId = epRTaskEmployee.getEmployeeId(); AcEmployees acEmployees = acEmployeesDAO.selectByPrimaryKey(EmployeeId); String employeeName = null; if (acEmployees != null) { employeeName = acEmployees.getName(); } taskHistory.setEmployeeName(employeeName); Long endTime = System.currentTimeMillis(); taskHistory.setSupportEmployee(epRTaskEmployee.getSupportEmployee()); taskHistory.setEmployeeId(EmployeeId); taskHistory.setEndTime(endTime.toString()); taskHistory.setExecuteTime(epRTaskEmployee.getExecuteTime()); taskHistory.setExecuteTimeType(epRTaskEmployee.getExecuteTimeType()); taskHistory.setNote(epTask.getNote()); String organName = null; Organ organ = organDAO.selectByPrimaryKey(epTask.getOrganId()); if (organ != null) { organName = organ.getName(); } taskHistory.setOrganName(organName); taskHistory.setResult(taskResult); taskHistory.setTaskId(epRTaskEmployee.getTaskId()); taskHistory.setTaskName(epTask.getName()); taskHistory.setTaskType(epTask.getType()); taskHistory.setType(new BigDecimal(1)); taskHistory.setUserId(epRTaskEmployee.getUserId()); JSONArray jsonArray = jsonObj.getJSONArray("steps"); epTaskHistoryDAO.insert(taskHistory); if (jsonArray.length() > 0) { for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonSteps = new JSONObject(jsonArray.getString(i)); String stepId = jsonSteps.getString("stepId"); String result = jsonSteps.getString("result"); System.out.println("result:" + result); String stepCaptureId = jsonSteps.getString("stepCaptureId"); EpTaskStepHistory epTaskStepHistory = new EpTaskStepHistory(); String taskStephistoryId = sequenceDAO.getEpTaskStepHistoryeq(); EpTaskStep epTaskStep = epTaskStepDAO.selectByPrimaryKey(stepId); if (epTaskStep == null) { throw new BusinessException("EP_TASK_STEP STEP_ID", ErrorCode.RESOURCE_NOT_FOUND); } epTaskStepHistory.setDeviceType(epTaskStep.getDeviceType()); epTaskStepHistory.setHistoryTaskId(historyTaskId); epTaskStepHistory.setId(taskStephistoryId); epTaskStepHistory.setResult(result); epTaskStepHistory.setSeq(new BigDecimal(epTaskStep.getSeq())); epTaskStepHistory.setStepId(stepId); epTaskStepHistory.setStepCaptureId(stepCaptureId); epTaskStepHistory.setStepName(epTaskStep.getName()); epTaskStepHistory.setStepNote(epTaskStep.getNote()); epTaskStepHistoryDAO.insert(epTaskStepHistory); } } epRTaskEmployeeDAO.deleteByPrimaryKey(epRtaskEmployeeId); }