@Test public void testModifyArrangements() throws Exception { }
@Override public CommonResult modifyArrangements(ArrangementParam arrangementParam){ int count = 0; List<Arrangement> arrangements = arrangementParam.getArrangements(); Date startDate = Date.valueOf(arrangementParam.getStartDate()); Date endDate = Date.valueOf(arrangementParam.getEndDate()); Integer departmentId = arrangementParam.getDepartmentId(); if(startDate.compareTo(endDate) > 0) return CommonResult.fail(ResultCode.E_809); if(departmentId == null) return CommonResult.fail(ResultCode.E_801); arrangementMapper.deleteByDepartmentIdAndDatePeriod(startDate, endDate, departmentId); for(Arrangement arrangement : arrangements){ arrangement.setDepartmentId(departmentId); count += arrangementMapper.insertSelective(arrangement); } return CommonResult.success(count); }
ArrangementManagementServiceImpl implements ArrangementManagementService { @Override public CommonResult modifyArrangements(ArrangementParam arrangementParam){ int count = 0; List<Arrangement> arrangements = arrangementParam.getArrangements(); Date startDate = Date.valueOf(arrangementParam.getStartDate()); Date endDate = Date.valueOf(arrangementParam.getEndDate()); Integer departmentId = arrangementParam.getDepartmentId(); if(startDate.compareTo(endDate) > 0) return CommonResult.fail(ResultCode.E_809); if(departmentId == null) return CommonResult.fail(ResultCode.E_801); arrangementMapper.deleteByDepartmentIdAndDatePeriod(startDate, endDate, departmentId); for(Arrangement arrangement : arrangements){ arrangement.setDepartmentId(departmentId); count += arrangementMapper.insertSelective(arrangement); } return CommonResult.success(count); } }
ArrangementManagementServiceImpl implements ArrangementManagementService { @Override public CommonResult modifyArrangements(ArrangementParam arrangementParam){ int count = 0; List<Arrangement> arrangements = arrangementParam.getArrangements(); Date startDate = Date.valueOf(arrangementParam.getStartDate()); Date endDate = Date.valueOf(arrangementParam.getEndDate()); Integer departmentId = arrangementParam.getDepartmentId(); if(startDate.compareTo(endDate) > 0) return CommonResult.fail(ResultCode.E_809); if(departmentId == null) return CommonResult.fail(ResultCode.E_801); arrangementMapper.deleteByDepartmentIdAndDatePeriod(startDate, endDate, departmentId); for(Arrangement arrangement : arrangements){ arrangement.setDepartmentId(departmentId); count += arrangementMapper.insertSelective(arrangement); } return CommonResult.success(count); }  }
ArrangementManagementServiceImpl implements ArrangementManagementService { @Override public CommonResult modifyArrangements(ArrangementParam arrangementParam){ int count = 0; List<Arrangement> arrangements = arrangementParam.getArrangements(); Date startDate = Date.valueOf(arrangementParam.getStartDate()); Date endDate = Date.valueOf(arrangementParam.getEndDate()); Integer departmentId = arrangementParam.getDepartmentId(); if(startDate.compareTo(endDate) > 0) return CommonResult.fail(ResultCode.E_809); if(departmentId == null) return CommonResult.fail(ResultCode.E_801); arrangementMapper.deleteByDepartmentIdAndDatePeriod(startDate, endDate, departmentId); for(Arrangement arrangement : arrangements){ arrangement.setDepartmentId(departmentId); count += arrangementMapper.insertSelective(arrangement); } return CommonResult.success(count); }  @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 modifyArrangements(ArrangementParam arrangementParam){ int count = 0; List<Arrangement> arrangements = arrangementParam.getArrangements(); Date startDate = Date.valueOf(arrangementParam.getStartDate()); Date endDate = Date.valueOf(arrangementParam.getEndDate()); Integer departmentId = arrangementParam.getDepartmentId(); if(startDate.compareTo(endDate) > 0) return CommonResult.fail(ResultCode.E_809); if(departmentId == null) return CommonResult.fail(ResultCode.E_801); arrangementMapper.deleteByDepartmentIdAndDatePeriod(startDate, endDate, departmentId); for(Arrangement arrangement : arrangements){ arrangement.setDepartmentId(departmentId); count += arrangementMapper.insertSelective(arrangement); } return CommonResult.success(count); }  @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);  }