|
@@ -1,34 +1,25 @@
|
|
|
package com.ruoyi.project.training.bccnew.controller;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
|
|
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
|
|
+import com.ruoyi.framework.web.controller.BaseController;
|
|
|
+import com.ruoyi.framework.web.domain.AjaxResult;
|
|
|
+import com.ruoyi.framework.web.page.TableDataInfo;
|
|
|
import com.ruoyi.project.system.domain.SysUser;
|
|
|
import com.ruoyi.project.system.service.ISysUserService;
|
|
|
import com.ruoyi.project.training.bccnew.domain.TTsFirstplan;
|
|
|
-import com.ruoyi.project.training.bccnew.domain.TTsFlplan;
|
|
|
+import com.ruoyi.project.training.bccnew.domain.TTsLjplan;
|
|
|
import com.ruoyi.project.training.bccnew.domain.TTsNew;
|
|
|
import com.ruoyi.project.training.bccnew.service.ITTsApproveService;
|
|
|
import com.ruoyi.project.training.bccnew.service.ITTsFirstplanService;
|
|
|
+import com.ruoyi.project.training.bccnew.service.ITTsLjplanService;
|
|
|
import com.ruoyi.project.training.bccnew.service.ITTsNewService;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
|
|
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
|
|
-import com.ruoyi.project.training.bccnew.domain.TTsLjplan;
|
|
|
-import com.ruoyi.project.training.bccnew.service.ITTsLjplanService;
|
|
|
-import com.ruoyi.framework.web.controller.BaseController;
|
|
|
-import com.ruoyi.framework.web.domain.AjaxResult;
|
|
|
-import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
-import com.ruoyi.framework.web.page.TableDataInfo;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 裂解培训Controller
|
|
@@ -136,6 +127,63 @@ public class TTsLjplanController extends BaseController
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody TTsLjplan tTsLjplan)
|
|
|
{
|
|
|
+ if ("好".equals(tTsLjplan.getScore1())) {
|
|
|
+ tTsLjplan.setPlanStatus(3L);
|
|
|
+ }
|
|
|
+ if ("满意".equals(tTsLjplan.getScore1()) && "好".equals(tTsLjplan.getScore2())) {
|
|
|
+ tTsLjplan.setPlanStatus(3L);
|
|
|
+ }
|
|
|
+ if ("满意".equals(tTsLjplan.getScore1()) && "满意".equals(tTsLjplan.getScore2()) && "好".equals(tTsLjplan.getScore3())) {
|
|
|
+ tTsLjplan.setPlanStatus(3L);
|
|
|
+ }
|
|
|
+ if ("满意".equals(tTsLjplan.getScore1()) && "差".equals(tTsLjplan.getScore2()) && "好".equals(tTsLjplan.getScore2())) {
|
|
|
+ tTsLjplan.setPlanStatus(3L);
|
|
|
+ }
|
|
|
+ if ("差".equals(tTsLjplan.getScore1()) && "好".equals(tTsLjplan.getScore2())) {
|
|
|
+ tTsLjplan.setPlanStatus(3L);
|
|
|
+ }
|
|
|
+ if ("差".equals(tTsLjplan.getScore1()) && "满意".equals(tTsLjplan.getScore2())) {
|
|
|
+ tTsLjplan.setPlanStatus(1L);
|
|
|
+ }
|
|
|
+ if ("差".equals(tTsLjplan.getScore1()) && "差".equals(tTsLjplan.getScore2())) {
|
|
|
+ tTsLjplan.setPlanStatus(1L);
|
|
|
+ }
|
|
|
+ if (tTsLjplan.getPlanStatus() == 3) {
|
|
|
+ TTsFirstplan tTsFirstplan = new TTsFirstplan();
|
|
|
+ tTsFirstplan.setNewId(tTsLjplan.getNewId());
|
|
|
+ List<TTsFirstplan> tTsFirstplans = tTsFirstplanService.selectTTsFirstplanListByNewId(tTsFirstplan);
|
|
|
+ tTsFirstplan.setPlanStatus(3L);
|
|
|
+ List<TTsFirstplan> tTsFirstplansDone = tTsFirstplanService.selectTTsFirstplanListByNewId(tTsFirstplan);
|
|
|
+ TTsLjplan entity = new TTsLjplan();
|
|
|
+ entity.setNewId(tTsLjplan.getNewId());
|
|
|
+ List<TTsLjplan> tTsLjplans = tTsLjplanService.selectTTsLjplanListByNewId(entity);
|
|
|
+ entity.setPlanStatus(3L);
|
|
|
+ List<TTsLjplan> tTsLjplansDone = tTsLjplanService.selectTTsLjplanListByNewId(entity);
|
|
|
+ if (!CollectionUtils.isEmpty(tTsFirstplans) && !CollectionUtils.isEmpty(tTsFirstplansDone) &&
|
|
|
+ tTsFirstplans.size() == tTsFirstplansDone.size() &&
|
|
|
+ !CollectionUtils.isEmpty(tTsLjplans) && !CollectionUtils.isEmpty(tTsLjplansDone) &&
|
|
|
+ tTsLjplans.size() == tTsLjplansDone.size()) {
|
|
|
+ tTsApproveService.doApprove(tTsLjplan.getNewId(), "1", getUserId(), getNickName());
|
|
|
+ }
|
|
|
+ }else
|
|
|
+ if (tTsLjplan.getPlanStatus() == 1){
|
|
|
+ TTsLjplan entity = new TTsLjplan();
|
|
|
+ entity.setNewId(tTsLjplan.getNewId());
|
|
|
+ for (TTsLjplan item : tTsLjplanService.selectTTsLjplanListByNewId(entity)) {
|
|
|
+ if (item.getPlanStatus() == null){
|
|
|
+ item.setPlanStatus(1L);
|
|
|
+ tTsLjplanService.updateTTsLjplan(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ TTsFirstplan tTsFirstplan = new TTsFirstplan();
|
|
|
+ tTsFirstplan.setNewId(tTsLjplan.getNewId());
|
|
|
+ for (TTsFirstplan item : tTsFirstplanService.selectTTsFirstplanListByNewId(tTsFirstplan)) {
|
|
|
+ if (item.getPlanStatus() == null){
|
|
|
+ item.setPlanStatus(1L);
|
|
|
+ tTsFirstplanService.updateTTsFirstplan(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return toAjax(tTsLjplanService.updateTTsLjplan(tTsLjplan));
|
|
|
}
|
|
|
|