From 89e9e2c97587c59152caad47ef28e11a84bcf6d2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-G8BCEP0\\HP" <2037158277@qq.com> Date: Wed, 25 Aug 2021 17:24:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=B7=A5=E6=97=B6=E8=AE=B0=E5=BD=95=E5=92=8C=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=88=91=E7=AE=A1=E7=90=86=EF=BC=8C=E6=88=91=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xkrs/controller/WorkHourRecordController.java | 14 ++++---------- src/main/java/com/xkrs/model/qo/WorkRecordQo.java | 13 ++++++++++++- .../service/impl/WorkHourRecordServiceImpl.java | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) 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);