Browse Source

模糊查询修改

anderx 2 years ago
parent
commit
5fdf11acf7

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ProjectTaskController.java

@@ -204,6 +204,19 @@ public class ProjectTaskController extends BaseController {
     }
 
     /**
+     * 项目打卡日志导出模版
+     * @param response
+     */
+    @PostMapping("/listRecord/importTemplate")
+    @ApiOperation("项目打卡日志导出模版")
+    public void listRecordImportTemplate(HttpServletResponse response)
+    {
+        ExcelUtil<ProjectStaffRecordOut> util = new ExcelUtil<ProjectStaffRecordOut>(ProjectStaffRecordOut.class);
+        util.importTemplateExcel(response, "项目打卡日志列表");
+    }
+
+
+    /**
      * 删除项目成员
      * @param in
      * @return

+ 3 - 2
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffServiceImpl.java

@@ -53,12 +53,13 @@ public class ProjectStaffServiceImpl implements ProjectStaffService {
         if (sum > 0) {
             return AjaxResult.error("已存在打卡,请不要删除人员.");
         }
-        userMapper.updateUserProjectSum(in.getAid(),1);
+        ProjectStaff projectStaff = projectStaffMapper.selectByPrimaryKey(in.getId());
         int i = projectStaffMapper.deleteByPrimaryKey(in.getId());
         if (i>0){
-            projectTaskMapper.updateStaffName(in.getPid());
+            projectTaskMapper.updateStaffName(projectStaff.getPid());
             return AjaxResult.success();
         }
+        userMapper.updateUserProjectSum(in.getAid(),1);
         return AjaxResult.error("编号不存在");
     }