|
@@ -0,0 +1,142 @@
|
|
|
|
|
+package org.dromara.physical.service.impl;
|
|
|
|
|
+
|
|
|
|
|
+import org.dromara.common.core.utils.MapstructUtils;
|
|
|
|
|
+import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
|
+import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.dromara.physical.domain.PhysicalJudgePositionRelation;
|
|
|
|
|
+import org.dromara.physical.domain.bo.PhysicalJudgePositionRelationBo;
|
|
|
|
|
+import org.dromara.physical.domain.vo.PhysicalJudgePositionRelationVo;
|
|
|
|
|
+import org.dromara.physical.mapper.PhysicalJudgePositionRelationMapper;
|
|
|
|
|
+import org.dromara.physical.service.IPhysicalJudgePositionRelationService;
|
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+import java.util.Collection;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 裁判职务关联(支持待配置状态)Service业务层处理
|
|
|
|
|
+ *
|
|
|
|
|
+ * @author Lion Li
|
|
|
|
|
+ * @date 2025-12-25
|
|
|
|
|
+ */
|
|
|
|
|
+@Slf4j
|
|
|
|
|
+@RequiredArgsConstructor
|
|
|
|
|
+@Service
|
|
|
|
|
+public class PhysicalJudgePositionRelationServiceImpl implements IPhysicalJudgePositionRelationService {
|
|
|
|
|
+
|
|
|
|
|
+ private final PhysicalJudgePositionRelationMapper baseMapper;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询裁判职务关联(支持待配置状态)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param id 主键
|
|
|
|
|
+ * @return 裁判职务关联(支持待配置状态)
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public PhysicalJudgePositionRelationVo queryById(Long id){
|
|
|
|
|
+ return baseMapper.selectJudgePositionRelationById(id);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 分页查询裁判职务关联(支持待配置状态)列表
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param bo 查询条件
|
|
|
|
|
+ * @param pageQuery 分页参数
|
|
|
|
|
+ * @return 裁判职务关联(支持待配置状态)分页列表
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public TableDataInfo<PhysicalJudgePositionRelationVo> queryPageList(PhysicalJudgePositionRelationBo bo, PageQuery pageQuery) {
|
|
|
|
|
+ LambdaQueryWrapper<PhysicalJudgePositionRelation> lqw = buildQueryWrapper(bo);
|
|
|
|
|
+ Page<PhysicalJudgePositionRelationVo> result = baseMapper.selectJudgePositionRelationPage(pageQuery.build(), lqw);
|
|
|
|
|
+ return TableDataInfo.build(result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询符合条件的裁判职务关联(支持待配置状态)列表
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param bo 查询条件
|
|
|
|
|
+ * @return 裁判职务关联(支持待配置状态)列表
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<PhysicalJudgePositionRelationVo> queryList(PhysicalJudgePositionRelationBo bo) {
|
|
|
|
|
+ LambdaQueryWrapper<PhysicalJudgePositionRelation> lqw = buildQueryWrapper(bo);
|
|
|
|
|
+ return baseMapper.selectJudgePositionRelationList(lqw);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private LambdaQueryWrapper<PhysicalJudgePositionRelation> buildQueryWrapper(PhysicalJudgePositionRelationBo bo) {
|
|
|
|
|
+ Map<String, Object> params = bo.getParams();
|
|
|
|
|
+ LambdaQueryWrapper<PhysicalJudgePositionRelation> lqw = Wrappers.lambdaQuery();
|
|
|
|
|
+ lqw.orderByAsc(PhysicalJudgePositionRelation::getId);
|
|
|
|
|
+ lqw.eq(bo.getJudgeId() != null, PhysicalJudgePositionRelation::getJudgeId, bo.getJudgeId());
|
|
|
|
|
+ lqw.eq(bo.getPositionId() != null, PhysicalJudgePositionRelation::getPositionId, bo.getPositionId());
|
|
|
|
|
+ return lqw;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 新增裁判职务关联(支持待配置状态)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param bo 裁判职务关联(支持待配置状态)
|
|
|
|
|
+ * @return 是否新增成功
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean insertByBo(PhysicalJudgePositionRelationBo bo) {
|
|
|
|
|
+ PhysicalJudgePositionRelation add = MapstructUtils.convert(bo, PhysicalJudgePositionRelation.class);
|
|
|
|
|
+ validEntityBeforeSave(add);
|
|
|
|
|
+ boolean flag = baseMapper.insertJudgePositionRelation(add) > 0;
|
|
|
|
|
+ if (flag) {
|
|
|
|
|
+ bo.setId(add.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ return flag;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 修改裁判职务关联(支持待配置状态)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param bo 裁判职务关联(支持待配置状态)
|
|
|
|
|
+ * @return 是否修改成功
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean updateByBo(PhysicalJudgePositionRelationBo bo) {
|
|
|
|
|
+ PhysicalJudgePositionRelation update = MapstructUtils.convert(bo, PhysicalJudgePositionRelation.class);
|
|
|
|
|
+ validEntityBeforeSave(update);
|
|
|
|
|
+ return baseMapper.updateJudgePositionRelationById(update) > 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 保存前的数据校验
|
|
|
|
|
+ */
|
|
|
|
|
+ private void validEntityBeforeSave(PhysicalJudgePositionRelation entity){
|
|
|
|
|
+ //TODO 做一些数据校验,如唯一约束
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 校验并批量删除裁判职务关联(支持待配置状态)信息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param ids 待删除的主键集合
|
|
|
|
|
+ * @param isValid 是否进行有效性校验
|
|
|
|
|
+ * @return 是否删除成功
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
|
|
+ if(isValid){
|
|
|
|
|
+ //TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
|
+ }
|
|
|
|
|
+ return baseMapper.deleteJudgePositionRelation(ids) > 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<PhysicalJudgePositionRelationVo> selectPendingJudge() {
|
|
|
|
|
+ return baseMapper.selectPendingJudge();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<PhysicalJudgePositionRelationVo> selectUseIngByJudge() {
|
|
|
|
|
+ return baseMapper.selectUseIngByJudge();
|
|
|
|
|
+ }
|
|
|
|
|
+}
|