|
|
|
|
@ -38,6 +38,8 @@ import org.springblade.core.mp.support.Condition; |
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.desk.dashboard.pojo.entity.DsPartEntity; |
|
|
|
|
import org.springblade.desk.dashboard.service.IDsPartService; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
@ -50,6 +52,8 @@ import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
import org.springblade.core.excel.util.ExcelUtil; |
|
|
|
|
import org.springblade.core.tool.constant.BladeConstant; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.List; |
|
|
|
|
import jakarta.servlet.http.HttpServletResponse; |
|
|
|
|
@ -68,6 +72,8 @@ public class DsPartRelationController extends BladeController { |
|
|
|
|
|
|
|
|
|
private final IDsPartRelationService dsPartRelationService; |
|
|
|
|
|
|
|
|
|
private final IDsPartService dsPartService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 部件-子件关联表 详情 |
|
|
|
|
*/ |
|
|
|
|
@ -100,6 +106,24 @@ public class DsPartRelationController extends BladeController { |
|
|
|
|
return R.data(pages); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/getSubParts") |
|
|
|
|
@ApiOperationSupport(order = 3) |
|
|
|
|
@Operation(summary = "分页", description = "传入dsPartRelation") |
|
|
|
|
public R<List<DsPartEntity>> getSubParts(String partCode) { |
|
|
|
|
List<DsPartEntity> pages = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
QueryWrapper<DsPartRelationEntity> relationQuery = new QueryWrapper<>(); |
|
|
|
|
relationQuery.eq("part_code", partCode); |
|
|
|
|
List<DsPartRelationEntity> list = dsPartRelationService.list(relationQuery); |
|
|
|
|
if(null != list && list.size() > 0){ |
|
|
|
|
List<Long> childPartIds = list.stream().map(DsPartRelationEntity::getChildPartId).toList(); |
|
|
|
|
QueryWrapper<DsPartEntity> partQuery = new QueryWrapper<>(); |
|
|
|
|
partQuery.in("id", childPartIds); |
|
|
|
|
pages = dsPartService.list(partQuery); |
|
|
|
|
} |
|
|
|
|
return R.data(pages); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 部件-子件关联表 新增 |
|
|
|
|
*/ |
|
|
|
|
|