Sfoglia il codice sorgente

项目模块修改

anderx 2 anni fa
parent
commit
322185c191

+ 0 - 36
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectTaskListOut.java

@@ -1,46 +1,10 @@
 package com.ruoyi.project.bo;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.project.domain.ProjectTask;
 
-import java.util.Date;
 
 public class ProjectTaskListOut extends ProjectTask {
 
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date createTime;
 
-    @JsonFormat(pattern = "yyyy")
-    private Date projectYear;
-
-    @JsonFormat(pattern = "yyyy")
-    private Date createYear;
-
-    @Override
-    public Date getProjectYear() {
-        return projectYear;
-    }
-
-    public void setProjectYear(Date projectYear) {
-        this.projectYear = projectYear;
-    }
-
-    @Override
-    public Date getCreateYear() {
-        return createYear;
-    }
-
-    @Override
-    public void setCreateYear(Date createYear) {
-        this.createYear = createYear;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
 }

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectTaskOut.java

@@ -1,14 +1,17 @@
 package com.ruoyi.project.bo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.project.domain.ProjectStaff;
 import com.ruoyi.project.domain.ProjectTask;
 
+import java.util.Date;
 import java.util.List;
 
 public class ProjectTaskOut extends ProjectTask {
 
     List<ProjectStaff> list;
 
+
     public List<ProjectStaff> getList() {
         return list;
     }

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/project/domain/ProjectStaff.java

@@ -1,5 +1,7 @@
 package com.ruoyi.project.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -31,6 +33,7 @@ public class ProjectStaff implements Serializable {
     /**
      * 创建时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
     /**

+ 5 - 0
ruoyi-system/src/main/java/com/ruoyi/project/domain/ProjectTask.java

@@ -1,5 +1,7 @@
 package com.ruoyi.project.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -31,6 +33,7 @@ public class ProjectTask implements Serializable {
     /**
      * 创建时间
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
     /**
@@ -56,11 +59,13 @@ public class ProjectTask implements Serializable {
     /**
      * 项目年份
      */
+    @JsonFormat(pattern = "yyyy")
     private Date projectYear;
 
     /**
      * 创建年份
      */
+    @JsonFormat(pattern = "yyyy")
     private Date createYear;
 
     /**

+ 4 - 8
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectTaskServiceImpl.java

@@ -4,6 +4,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.enums.UserRolesType;
 import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.bean.BeanUtils;
 import com.ruoyi.project.bo.ProjectListInput;
 import com.ruoyi.project.bo.ProjectTaskListOut;
 import com.ruoyi.project.bo.ProjectTaskOut;
@@ -43,15 +44,10 @@ public class ProjectTaskServiceImpl   implements ProjectTaskService {
     @Override
     public AjaxResult details(Long id) {
         ProjectTask projectTask = projectTaskMapper.selectByPrimaryKey(id);
-        ProjectTaskOut out=new ProjectTaskOut();
+        ProjectTaskOut out=  new ProjectTaskOut();
+
         if (projectTask!=null){
-            out.setId(projectTask.getId());
-            out.setAid(projectTask.getAid());
-            out.setName(projectTask.getName());
-            out.setProjectStatus(projectTask.getProjectStatus());
-            out.setRemark(projectTask.getRemark());
-            out.setCreateTime(projectTask.getCreateTime());
-            out.setAdminName(projectTask.getAdminName());
+            BeanUtils.copyBeanProp(out, projectTask);
             List<ProjectStaff> projectStaffs = projectStaffMapper.selectBypid(id);
             if (!projectStaffs.isEmpty())out.setList(projectStaffs);
             return AjaxResult.success(out);