@Test public void testListArrangements() throws Exception { }
@Override public CommonResult listArrangements(Date startDate, Date endDate, Integer departmentId){ JSONObject returnJson = new JSONObject(); Date today = startDate; SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); while(today.compareTo(endDate) <= 0){ Calendar calendar = Calendar.getInstance(); calendar.setTime(today); List<HashMap> arrangementLogInfo = new ArrayList<>(); List<HashMap> arrangements = arrangementMapper.listByDepartmentIdAndDatePeriod(today, today, departmentId); for(HashMap arrangement : arrangements){ arrangement.remove("appointmentDate"); arrangement.put("timeSlot", ConstantMap.convert("看诊时间段", Byte.valueOf(String.valueOf(arrangement.get("timeSlot"))))); arrangement.put("registrationLevel", ConstantMap.convert("挂号级别", Byte.valueOf(String.valueOf(arrangement.get("registrationLevelId"))))); arrangement.put("isValid", getStatusStr((Boolean)arrangement.get("isValid"))); arrangementLogInfo.add(arrangement); } returnJson.put(formatter.format(today), arrangementLogInfo); calendar.add(Calendar.DAY_OF_MONTH, 1); java.util.Date tomorrow = calendar.getTime(); today = new Date(tomorrow.getTime()); } return CommonResult.success(returnJson); }
ArrangementManagementServiceImpl implements ArrangementManagementService { @Override public CommonResult listArrangements(Date startDate, Date endDate, Integer departmentId){ JSONObject returnJson = new JSONObject(); Date today = startDate; SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); while(today.compareTo(endDate) <= 0){ Calendar calendar = Calendar.getInstance(); calendar.setTime(today); List<HashMap> arrangementLogInfo = new ArrayList<>(); List<HashMap> arrangements = arrangementMapper.listByDepartmentIdAndDatePeriod(today, today, departmentId); for(HashMap arrangement : arrangements){ arrangement.remove("appointmentDate"); arrangement.put("timeSlot", ConstantMap.convert("看诊时间段", Byte.valueOf(String.valueOf(arrangement.get("timeSlot"))))); arrangement.put("registrationLevel", ConstantMap.convert("挂号级别", Byte.valueOf(String.valueOf(arrangement.get("registrationLevelId"))))); arrangement.put("isValid", getStatusStr((Boolean)arrangement.get("isValid"))); arrangementLogInfo.add(arrangement); } returnJson.put(formatter.format(today), arrangementLogInfo); calendar.add(Calendar.DAY_OF_MONTH, 1); java.util.Date tomorrow = calendar.getTime(); today = new Date(tomorrow.getTime()); } return CommonResult.success(returnJson); } }
ArrangementManagementServiceImpl implements ArrangementManagementService { @Override public CommonResult listArrangements(Date startDate, Date endDate, Integer departmentId){ JSONObject returnJson = new JSONObject(); Date today = startDate; SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); while(today.compareTo(endDate) <= 0){ Calendar calendar = Calendar.getInstance(); calendar.setTime(today); List<HashMap> arrangementLogInfo = new ArrayList<>(); List<HashMap> arrangements = arrangementMapper.listByDepartmentIdAndDatePeriod(today, today, departmentId); for(HashMap arrangement : arrangements){ arrangement.remove("appointmentDate"); arrangement.put("timeSlot", ConstantMap.convert("看诊时间段", Byte.valueOf(String.valueOf(arrangement.get("timeSlot"))))); arrangement.put("registrationLevel", ConstantMap.convert("挂号级别", Byte.valueOf(String.valueOf(arrangement.get("registrationLevelId"))))); arrangement.put("isValid", getStatusStr((Boolean)arrangement.get("isValid"))); arrangementLogInfo.add(arrangement); } returnJson.put(formatter.format(today), arrangementLogInfo); calendar.add(Calendar.DAY_OF_MONTH, 1); java.util.Date tomorrow = calendar.getTime(); today = new Date(tomorrow.getTime()); } return CommonResult.success(returnJson); }  }
ArrangementManagementServiceImpl implements ArrangementManagementService { @Override public CommonResult listArrangements(Date startDate, Date endDate, Integer departmentId){ JSONObject returnJson = new JSONObject(); Date today = startDate; SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); while(today.compareTo(endDate) <= 0){ Calendar calendar = Calendar.getInstance(); calendar.setTime(today); List<HashMap> arrangementLogInfo = new ArrayList<>(); List<HashMap> arrangements = arrangementMapper.listByDepartmentIdAndDatePeriod(today, today, departmentId); for(HashMap arrangement : arrangements){ arrangement.remove("appointmentDate"); arrangement.put("timeSlot", ConstantMap.convert("看诊时间段", Byte.valueOf(String.valueOf(arrangement.get("timeSlot"))))); arrangement.put("registrationLevel", ConstantMap.convert("挂号级别", Byte.valueOf(String.valueOf(arrangement.get("registrationLevelId"))))); arrangement.put("isValid", getStatusStr((Boolean)arrangement.get("isValid"))); arrangementLogInfo.add(arrangement); } returnJson.put(formatter.format(today), arrangementLogInfo); calendar.add(Calendar.DAY_OF_MONTH, 1); java.util.Date tomorrow = calendar.getTime(); today = new Date(tomorrow.getTime()); } return CommonResult.success(returnJson); }  @Override CommonResult insertArrangementRule(ArrangementRuleParam arrangementRuleParam); @Override CommonResult listArrangementRules(Integer departmentId); @Override CommonResult insertArrangement(ArrangementParam arrangementParam); List<ArrangementConflictParam> saveArrangement(Date today, int week, Integer departmentId,
                                                          Integer arrangementRuleId, List<Arrangement> arrangements,
                                                          List<ArrangementConflictParam> conflict, Boolean toInsert,
                                                          List<Arrangement> toInsertArrangements); @Override CommonResult listArrangements(Date startDate, Date endDate, Integer departmentId); String getStatusStr(Boolean isValid); @Override CommonResult modifyArrangements(ArrangementParam arrangementParam); @Override CommonResult modifyArrangement(Integer arrangementId, Byte timeSlot); JSONObject formatJson(JSONObject jsonObject, List<HashMap> arrangementRule); }
ArrangementManagementServiceImpl implements ArrangementManagementService { @Override public CommonResult listArrangements(Date startDate, Date endDate, Integer departmentId){ JSONObject returnJson = new JSONObject(); Date today = startDate; SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); while(today.compareTo(endDate) <= 0){ Calendar calendar = Calendar.getInstance(); calendar.setTime(today); List<HashMap> arrangementLogInfo = new ArrayList<>(); List<HashMap> arrangements = arrangementMapper.listByDepartmentIdAndDatePeriod(today, today, departmentId); for(HashMap arrangement : arrangements){ arrangement.remove("appointmentDate"); arrangement.put("timeSlot", ConstantMap.convert("看诊时间段", Byte.valueOf(String.valueOf(arrangement.get("timeSlot"))))); arrangement.put("registrationLevel", ConstantMap.convert("挂号级别", Byte.valueOf(String.valueOf(arrangement.get("registrationLevelId"))))); arrangement.put("isValid", getStatusStr((Boolean)arrangement.get("isValid"))); arrangementLogInfo.add(arrangement); } returnJson.put(formatter.format(today), arrangementLogInfo); calendar.add(Calendar.DAY_OF_MONTH, 1); java.util.Date tomorrow = calendar.getTime(); today = new Date(tomorrow.getTime()); } return CommonResult.success(returnJson); }  @Override CommonResult insertArrangementRule(ArrangementRuleParam arrangementRuleParam); @Override CommonResult listArrangementRules(Integer departmentId); @Override CommonResult insertArrangement(ArrangementParam arrangementParam); List<ArrangementConflictParam> saveArrangement(Date today, int week, Integer departmentId,
                                                          Integer arrangementRuleId, List<Arrangement> arrangements,
                                                          List<ArrangementConflictParam> conflict, Boolean toInsert,
                                                          List<Arrangement> toInsertArrangements); @Override CommonResult listArrangements(Date startDate, Date endDate, Integer departmentId); String getStatusStr(Boolean isValid); @Override CommonResult modifyArrangements(ArrangementParam arrangementParam); @Override CommonResult modifyArrangement(Integer arrangementId, Byte timeSlot); JSONObject formatJson(JSONObject jsonObject, List<HashMap> arrangementRule);  }