Browse Source

导入导出开发

anderx 2 years ago
parent
commit
2dba1e51ae

+ 2 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ProjectTaskController.java

@@ -109,7 +109,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @GetMapping("/listRecord")
-    public TableDataInfo listRecord( @RequestBody ProjectStaffRecordInput in){
+    public TableDataInfo listRecord( ProjectStaffRecordInput in){
         startPage();
         List<ProjectStaffRecordOut> list = projectStaffRecordService.listRecord(in);
         return getDataTable(list);
@@ -121,8 +121,7 @@ public class ProjectTaskController extends BaseController {
      * @param response
      */
     @PostMapping("/listRecord/export")
-    public void listRecordExport(HttpServletResponse response,@RequestBody ProjectStaffRecordInput in)
-    {
+    public void listRecordExport(HttpServletResponse response, ProjectStaffRecordInput in){
         List<ProjectStaffRecordOut> list=projectStaffRecordService.listRecord(in);
         ExcelUtil<ProjectStaffRecordOut> util = new ExcelUtil<>(ProjectStaffRecordOut.class);
         util.exportExcel(response, list, "项目研发日志列表");

+ 4 - 4
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectStaffRecordOut.java

@@ -7,7 +7,7 @@ import com.ruoyi.project.domain.ProjectStaffRecord;
 import java.util.Date;
 
 public class ProjectStaffRecordOut extends ProjectStaffRecord {
-
+    @Excel(name = "编号")
     private Long id;
     @Excel(name = "员工工号")
     private String jobNumber;
@@ -17,12 +17,12 @@ public class ProjectStaffRecordOut extends ProjectStaffRecord {
     private Long deptId;
     @Excel(name = "部门")
     private String deptName;
-    @Excel(name = "打卡时间")
+    @Excel(name = "打卡时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
     @Excel(name = "工时")
     private Double duration;
-    @Excel(name = "打卡月份")
+    @Excel(name = "打卡月份", dateFormat = "MM")
     @JsonFormat(pattern = "MM")
     private Date createMonth;
     @Excel(name = "项目编号")
@@ -37,7 +37,7 @@ public class ProjectStaffRecordOut extends ProjectStaffRecord {
     private Long examineId;
     @Excel(name = "审核人员")
     private String examineName;
-    @Excel(name = "审核时间")
+    @Excel(name = "审核时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date examineTime;
     private String annexUrl;

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -128,6 +128,8 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
             if (SecurityUtils.hashRoles(UserRolesType.INSPECTORS.getCode())){
                 in.setRoleType(2);
             }
+        }else if (in.getRoleType()==3){
+
         }
         return projectStaffRecordMapper.selectList(in);
     }