|
|
@@ -1,11 +1,13 @@
|
|
|
package com.ruoyi.web.controller.project;
|
|
|
|
|
|
+import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.config.RuoYiConfig;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import com.ruoyi.common.enums.BusinessType;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
|
import com.ruoyi.common.utils.file.MimeTypeUtils;
|
|
|
@@ -52,6 +54,7 @@ public class ProjectTaskController extends BaseController {
|
|
|
*/
|
|
|
@PostMapping("/add")
|
|
|
@ApiOperation("新增项目")
|
|
|
+ @Log(title = "项目管理", businessType = BusinessType.INSERT)
|
|
|
public AjaxResult add( @RequestBody ProjectTask projectTask){
|
|
|
if (projectTask.getAid()== null){
|
|
|
return error("负责人不能为空");
|
|
|
@@ -66,6 +69,7 @@ public class ProjectTaskController extends BaseController {
|
|
|
*/
|
|
|
@PutMapping("/update")
|
|
|
@ApiOperation("修改项目")
|
|
|
+ @Log(title = "项目管理", businessType = BusinessType.UPDATE)
|
|
|
public AjaxResult update( @RequestBody ProjectTask projectTask){
|
|
|
if (projectTask.getAid()== null){
|
|
|
return error("负责人不能为空");
|
|
|
@@ -94,6 +98,7 @@ public class ProjectTaskController extends BaseController {
|
|
|
*/
|
|
|
@PostMapping("/addRecord")
|
|
|
@ApiOperation("新增项目打卡")
|
|
|
+ @Log(title = "项目管理", businessType = BusinessType.INSERT)
|
|
|
public AjaxResult addRecord( @RequestBody ProjectStaffRecord in){
|
|
|
if (in.getRecordTime()==null){
|
|
|
in.setRecordTime(new Date());
|
|
|
@@ -115,6 +120,7 @@ public class ProjectTaskController extends BaseController {
|
|
|
*/
|
|
|
@PostMapping("/updateRecord")
|
|
|
@ApiOperation("修改成员打卡")
|
|
|
+ @Log(title = "项目日志管理", businessType = BusinessType.UPDATE)
|
|
|
public AjaxResult updateRecord( @RequestBody ProjectStaffRecord in){
|
|
|
Long userId = SecurityUtils.getUserId();
|
|
|
in.setAid(userId);
|
|
|
@@ -172,6 +178,7 @@ public class ProjectTaskController extends BaseController {
|
|
|
*/
|
|
|
@PostMapping("/listRecord/export")
|
|
|
@ApiOperation("导出项目打卡列表")
|
|
|
+ @Log(title = "项目日志管理", businessType = BusinessType.EXPORT)
|
|
|
public void listRecordExport(HttpServletResponse response, ProjectStaffRecordInput in){
|
|
|
List<ProjectStaffRecordOut> list=projectStaffRecordService.listRecord(in);
|
|
|
ExcelUtil<ProjectStaffRecordOut> util = new ExcelUtil<>(ProjectStaffRecordOut.class);
|
|
|
@@ -187,6 +194,7 @@ public class ProjectTaskController extends BaseController {
|
|
|
*/
|
|
|
@PostMapping("/listRecord/importData")
|
|
|
@ApiOperation("导入项目打卡数据")
|
|
|
+ @Log(title = "项目日志管理", businessType = BusinessType.IMPORT)
|
|
|
public AjaxResult listRecordImportData(MultipartFile file, boolean isUpdateSupport) throws Exception
|
|
|
{
|
|
|
ExcelUtil<ProjectStaffRecordOut> util = new ExcelUtil<>(ProjectStaffRecordOut.class);
|
|
|
@@ -203,6 +211,7 @@ public class ProjectTaskController extends BaseController {
|
|
|
*/
|
|
|
@PostMapping("/deleteStaff")
|
|
|
@ApiOperation("删除项目成员")
|
|
|
+ @Log(title = "项目管理", businessType = BusinessType.DELETE)
|
|
|
public AjaxResult deleteStaff( @RequestBody ProjectStaff in){
|
|
|
if (in.getId()== null){
|
|
|
return error("项目成员编号不能为空");
|
|
|
@@ -217,9 +226,9 @@ public class ProjectTaskController extends BaseController {
|
|
|
*/
|
|
|
@GetMapping("/listStaff")
|
|
|
@ApiOperation("项目成员列表")
|
|
|
- public AjaxResult listStaff( @RequestBody ProjectStaff in){
|
|
|
- if (in.getId()== null){
|
|
|
- return error("项目成员编号不能为空");
|
|
|
+ public AjaxResult listStaff( ProjectStaff in){
|
|
|
+ if (in.getPid()== null){
|
|
|
+ return error("项目编号不能为空");
|
|
|
}
|
|
|
return projectStaffService.listStaff(in);
|
|
|
}
|
|
|
@@ -232,6 +241,7 @@ public class ProjectTaskController extends BaseController {
|
|
|
*/
|
|
|
@PostMapping("/deleteProject")
|
|
|
@ApiOperation("删除项目")
|
|
|
+ @Log(title = "项目管理", businessType = BusinessType.DELETE)
|
|
|
public AjaxResult deleteProject( @RequestBody ProjectTask in){
|
|
|
if (in.getId()== null){
|
|
|
return error("项目编号不能为空");
|
|
|
@@ -273,6 +283,7 @@ public class ProjectTaskController extends BaseController {
|
|
|
*/
|
|
|
@PostMapping("/export")
|
|
|
@ApiOperation("导出项目列表")
|
|
|
+ @Log(title = "项目管理", businessType = BusinessType.EXPORT)
|
|
|
public void export(HttpServletResponse response,ProjectListInput in)
|
|
|
{
|
|
|
List<ProjectTaskListOut> list=projectTaskService.list(in);
|
|
|
@@ -288,6 +299,7 @@ public class ProjectTaskController extends BaseController {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
@PostMapping("/importData")
|
|
|
+ @Log(title = "项目管理", businessType = BusinessType.IMPORT)
|
|
|
@ApiOperation("导入项目列表")
|
|
|
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
|
|
{
|