|
|
@@ -1,8 +1,8 @@
|
|
|
package com.xintong.visualinspection.controller;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -15,8 +15,11 @@ import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.xintong.system.err.BusinessException;
|
|
|
import com.xintong.visualinspection.bean.CheckAppeal;
|
|
|
-import com.xintong.visualinspection.bean.Team;
|
|
|
+import com.xintong.visualinspection.bean.Task;
|
|
|
+import com.xintong.visualinspection.bean.User;
|
|
|
import com.xintong.visualinspection.service.CheckAppealService;
|
|
|
+import com.xintong.visualinspection.service.TaskService;
|
|
|
+import com.xintong.visualinspection.util.Constants;
|
|
|
|
|
|
/**
|
|
|
* 文件名:CheckItemController
|
|
|
@@ -28,7 +31,8 @@ public class CheckAppealController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private CheckAppealService checkAppealService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ TaskService taskService;
|
|
|
|
|
|
/**
|
|
|
* 添加考核项
|
|
|
@@ -38,8 +42,21 @@ public class CheckAppealController extends BaseController {
|
|
|
* @since 1.0.0
|
|
|
*/
|
|
|
@RequestMapping(value = "/add")
|
|
|
- public String add(@Valid @RequestBody CheckAppeal checkAppeal){
|
|
|
+ public String add(HttpServletRequest request,@Valid @RequestBody CheckAppeal checkAppeal){
|
|
|
+// CheckAppeal ca = checkAppealService.getByTaskId(checkAppeal.getTask_id());
|
|
|
+// if(ca!=null) {
|
|
|
+// throw new BusinessException(21201);
|
|
|
+// }
|
|
|
+
|
|
|
+ User u = getCurrentUser(request);
|
|
|
+ checkAppeal.setAppeal_man(new Long(u.getId()));
|
|
|
+ checkAppeal.setCheck_status(Constants.STATUS_APPEALING);
|
|
|
+ if(u.getOrganid()!=null)
|
|
|
+ checkAppeal.setAppeal_dept(new Long(u.getOrganid()));
|
|
|
checkAppealService.insert(checkAppeal);
|
|
|
+ Task task = taskService.getById(checkAppeal.getTask_id());
|
|
|
+ task.setCheck_status(checkAppeal.getCheck_status());
|
|
|
+ taskService.update(task);
|
|
|
return super.returnSuccessResult("添加成功");
|
|
|
}
|
|
|
|