|
@@ -7,17 +7,23 @@ import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
+import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
+import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.evaluate.dto.AddEvaluateTemplateDto;
|
|
|
import com.xjrsoft.module.evaluate.dto.EvaluateTemplatePageDto;
|
|
|
import com.xjrsoft.module.evaluate.dto.UpdateEvaluateTemplateDto;
|
|
|
import com.xjrsoft.module.evaluate.dto.UpdateEvaluateTemplateStatusDto;
|
|
|
+import com.xjrsoft.module.evaluate.entity.EvaluateManage;
|
|
|
import com.xjrsoft.module.evaluate.entity.EvaluateTemplate;
|
|
|
+import com.xjrsoft.module.evaluate.service.IEvaluateManageService;
|
|
|
import com.xjrsoft.module.evaluate.service.IEvaluateTemplateService;
|
|
|
import com.xjrsoft.module.evaluate.vo.EvaluateTemplatePageVo;
|
|
|
import com.xjrsoft.module.evaluate.vo.EvaluateTemplateVo;
|
|
|
+import com.xjrsoft.module.organization.entity.User;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
@@ -51,6 +57,7 @@ public class EvaluateTemplateController {
|
|
|
|
|
|
|
|
|
private final IEvaluateTemplateService evaluateTemplateService;
|
|
|
+ private final IEvaluateManageService evaluateManageService;
|
|
|
|
|
|
@GetMapping(value = "/page")
|
|
|
@ApiOperation(value="评价模版列表(分页)")
|
|
@@ -120,6 +127,14 @@ public class EvaluateTemplateController {
|
|
|
@ApiOperation(value = "删除评价模版")
|
|
|
@SaCheckPermission("evaluatetemplate:delete")
|
|
|
public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
+ List<EvaluateManage> list = evaluateManageService.list(
|
|
|
+ new QueryWrapper<EvaluateManage>().lambda()
|
|
|
+ .in(EvaluateManage::getEvaluateTemplateId, ids)
|
|
|
+ .eq(EvaluateManage::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ );
|
|
|
+ if(!list.isEmpty()){
|
|
|
+ return RT.error("该模板已经被使用,无法删除");
|
|
|
+ }
|
|
|
return RT.ok(evaluateTemplateService.removeBatchByIds(ids));
|
|
|
|
|
|
}
|