diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceTemplateController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceTemplateController.java index b86fcfce4..3c6bf1783 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceTemplateController.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceTemplateController.java @@ -16,13 +16,17 @@ */ package com.logpm.statistics.controller; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.statistics.entity.ExpenseDispatchPriceServiceEntity; import com.logpm.statistics.entity.ExpenseDispatchPriceTemplateEntity; import com.logpm.statistics.excel.ExpenseDispatchPriceTemplateExcel; import com.logpm.statistics.query.ExpenseDispatchPriceTemplateQuery; +import com.logpm.statistics.service.IExpenseDispatchPriceServiceService; import com.logpm.statistics.service.IExpenseDispatchPriceTemplateService; import com.logpm.statistics.vo.ExpenseDispatchPriceTemplateVO; import com.logpm.statistics.wrapper.ExpenseDispatchPriceTemplateWrapper; @@ -65,6 +69,7 @@ import java.util.Map; public class ExpenseDispatchPriceTemplateController extends BladeController { private final IExpenseDispatchPriceTemplateService expenseDispatchPriceTemplateService; + private final IExpenseDispatchPriceServiceService expenseDispatchPriceServiceService; /** * 成本配送价格模版 详情 @@ -136,7 +141,13 @@ public class ExpenseDispatchPriceTemplateController extends BladeController { @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(expenseDispatchPriceTemplateService.deleteLogic(Func.toLongList(ids))); + List list = expenseDispatchPriceServiceService.list(Wrappers.lambdaQuery() + .in(ExpenseDispatchPriceServiceEntity::getTemplateId, Func.toLong(ids))); + if(CollUtil.isNotEmpty(list)){ + return R.fail("选择的模版存在绑定的服务商,不能删除"); + } + boolean b = expenseDispatchPriceTemplateService.deleteLogic(Func.toLongList(ids)); + return R.status(b); }