diff --git a/src/main/java/com/xkrs/controller/WorkHourRecordController.java b/src/main/java/com/xkrs/controller/WorkHourRecordController.java index e6b288d..30722e4 100644 --- a/src/main/java/com/xkrs/controller/WorkHourRecordController.java +++ b/src/main/java/com/xkrs/controller/WorkHourRecordController.java @@ -59,7 +59,6 @@ public class WorkHourRecordController { @GetMapping("/selectMemberWorkRecord") @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") public String selectMemberWorkRecord(@RequestHeader(value="Authorization") String token){ - List list = new ArrayList(); // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); // 验证token @@ -69,11 +68,10 @@ public class WorkHourRecordController { return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR,"您还没有注册登录,请先注册登录",locale); } List memberWorkRecordVos = workHourRecordService.selectMemberWorkRecord(sysUserEntity.getId()); - list.add(memberWorkRecordVos); - if(list.size() == 0){ + if(memberWorkRecordVos.size() == 0){ return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有任何数据",locale); } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS,list,locale); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,memberWorkRecordVos,locale); } /** @@ -210,14 +208,10 @@ public class WorkHourRecordController { @PreAuthorize("hasAnyAuthority('auth_administor','auth_general_user')") public String selectProjectByGanttChart(@RequestParam("projectNumber") String projectNumber,@RequestHeader(value="Authorization") String token){ Locale locale = LocaleContextHolder.getLocale(); - List list = new ArrayList(); - List> maps = workHourRecordDao.selectWorkHourPar(projectNumber); - list.add(maps); List> maps1 = workHourRecordDao.selectWorkHourMember(projectNumber); - list.add(maps1); - if(list.size() == 0){ + if(maps1.size() == 0){ return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有任何数据",locale); } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS,list,locale); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,maps1,locale); } } diff --git a/src/main/java/com/xkrs/model/qo/WorkRecordQo.java b/src/main/java/com/xkrs/model/qo/WorkRecordQo.java index f2e493f..65e9aa1 100644 --- a/src/main/java/com/xkrs/model/qo/WorkRecordQo.java +++ b/src/main/java/com/xkrs/model/qo/WorkRecordQo.java @@ -24,11 +24,14 @@ public class WorkRecordQo { @NotBlank(message = "{WorkHourRecord.projectNumber.null}",groups = {WorkRecordQoInsert.class, WorkRecordQoUpdate.class}) private String projectNumber; - public WorkRecordQo(String workContent, Integer workHour, String color, String projectNumber) { + private String submitTime; + + public WorkRecordQo(String workContent, Integer workHour, String color, String projectNumber, String submitTime) { this.workContent = workContent; this.workHour = workHour; this.color = color; this.projectNumber = projectNumber; + this.submitTime = submitTime; } public String getWorkContent() { @@ -62,4 +65,12 @@ public class WorkRecordQo { public void setProjectNumber(String projectNumber) { this.projectNumber = projectNumber; } + + public String getSubmitTime() { + return submitTime; + } + + public void setSubmitTime(String submitTime) { + this.submitTime = submitTime; + } } diff --git a/src/main/java/com/xkrs/service/impl/WorkHourRecordServiceImpl.java b/src/main/java/com/xkrs/service/impl/WorkHourRecordServiceImpl.java index 5d81f74..1f338b1 100644 --- a/src/main/java/com/xkrs/service/impl/WorkHourRecordServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/WorkHourRecordServiceImpl.java @@ -62,7 +62,7 @@ public class WorkHourRecordServiceImpl implements WorkHourRecordService { workHourRecord.setColor(workRecordQo.getColor()); workHourRecord.setUserId(sysUserEntity.getId()); workHourRecord.setProjectNumber(workRecordQo.getProjectNumber()); - workHourRecord.setSubmitTime(DateTimeUtil.dateTimeToString(LocalDateTime.now())); + workHourRecord.setSubmitTime(workRecordQo.getSubmitTime()); WorkHourRecord save = workHourRecordDao.save(workHourRecord); if(save != null){ return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"提交成功",locale);