|
|
|
|
@ -27,6 +27,7 @@ package org.springblade.desk.cost.controller; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
|
@ -37,6 +38,7 @@ import jakarta.validation.Valid; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
|
import org.springblade.core.excel.util.ExcelUtil; |
|
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
|
@ -46,8 +48,10 @@ import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.desk.cost.excel.SubjectFeeExcel; |
|
|
|
|
import org.springblade.desk.cost.pojo.entity.SubjectFeeDetailEntity; |
|
|
|
|
import org.springblade.desk.cost.pojo.entity.SubjectFeeEntity; |
|
|
|
|
import org.springblade.desk.cost.pojo.vo.SubjectFeeVO; |
|
|
|
|
import org.springblade.desk.cost.service.ISubjectFeeDetailService; |
|
|
|
|
import org.springblade.desk.cost.service.ISubjectFeeService; |
|
|
|
|
import org.springblade.desk.cost.wrapper.SubjectFeeWrapper; |
|
|
|
|
import org.springblade.system.cache.UserCache; |
|
|
|
|
@ -55,6 +59,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 科目费用表 控制器 |
|
|
|
|
@ -69,6 +74,7 @@ import java.util.Map; |
|
|
|
|
public class SubjectFeeController extends BladeController { |
|
|
|
|
|
|
|
|
|
private final ISubjectFeeService subjectFeeService; |
|
|
|
|
private final ISubjectFeeDetailService subjectFeeDetailService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 科目费用表 详情 |
|
|
|
|
@ -145,6 +151,12 @@ public class SubjectFeeController extends BladeController { |
|
|
|
|
@ApiOperationSupport(order = 7) |
|
|
|
|
@Operation(summary = "逻辑删除", description = "传入ids") |
|
|
|
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
|
List<Long> idList = Func.toLongList(ids); |
|
|
|
|
List<SubjectFeeDetailEntity> detailList = subjectFeeDetailService.list(Wrappers.<SubjectFeeDetailEntity>lambdaQuery().in(SubjectFeeDetailEntity::getParentId,idList)); |
|
|
|
|
if(CollectionUtils.isNotEmpty(detailList)){ |
|
|
|
|
List<Long> childIdList = detailList.stream().map(BaseEntity::getId).collect(Collectors.toList()); |
|
|
|
|
subjectFeeDetailService.deleteLogic(childIdList); |
|
|
|
|
} |
|
|
|
|
return R.status(subjectFeeService.deleteLogic(Func.toLongList(ids))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|