Commit 767beba5 authored by 严国华's avatar 严国华

bubichainpom修改

parent 61c9cb73
...@@ -112,12 +112,9 @@ ...@@ -112,12 +112,9 @@
<groupId>cn.bubi.sdk</groupId> <groupId>cn.bubi.sdk</groupId>
<artifactId>bubichain-sdk</artifactId> <artifactId>bubichain-sdk</artifactId>
<version>4.0.4</version> <version>4.0.4</version>
<scope>system</scope>
<systemPath>${basedir}/libs/bubichain-sdk-4.0.4.jar</systemPath>
</dependency> </dependency>
<dependency>
<groupId>cn.bubi.sdk</groupId>
<artifactId>bubichain-sdk</artifactId>
<version>4.0.4</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package org.dromara.zjk.service.impl; package org.dromara.zjk.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import org.dromara.common.core.constant.TenantConstants; import org.dromara.common.core.constant.TenantConstants;
import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.MapstructUtils;
...@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.zjk.domain.LearningEvaluate; import org.dromara.zjk.domain.LearningEvaluate;
import org.dromara.zjk.domain.LearningSuggest;
import org.dromara.zjk.mapper.ZjkExpertMapper; import org.dromara.zjk.mapper.ZjkExpertMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.dromara.zjk.domain.bo.LearningBackBo; import org.dromara.zjk.domain.bo.LearningBackBo;
...@@ -64,7 +66,9 @@ public class LearningBackServiceImpl implements ILearningBackService { ...@@ -64,7 +66,9 @@ public class LearningBackServiceImpl implements ILearningBackService {
LambdaQueryWrapper<LearningBack> lqw = buildQueryWrapper(bo); LambdaQueryWrapper<LearningBack> lqw = buildQueryWrapper(bo);
if(!StringUtils.isEmpty(bo.getExpertName())){ if(!StringUtils.isEmpty(bo.getExpertName())){
List<Long> uids = zjkExpertMapper.selectIdsByName(bo.getExpertName()); List<Long> uids = zjkExpertMapper.selectIdsByName(bo.getExpertName());
lqw.in(LearningBack::getCreateBy, uids); if(!CollectionUtil.isEmpty(uids)){
lqw.in(LearningBack::getCreateBy, uids);
}
} }
lqw.orderByDesc(LearningBack::getCreateTime); lqw.orderByDesc(LearningBack::getCreateTime);
Page<LearningBackVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); Page<LearningBackVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
......
package org.dromara.zjk.service.impl; package org.dromara.zjk.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.constant.TenantConstants; import org.dromara.common.core.constant.TenantConstants;
import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.dromara.common.mybatis.core.page.TableDataInfo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.zjk.domain.LearningBack; import org.dromara.zjk.domain.LearningEvaluate;
import org.dromara.zjk.enums.ApprovalStatusEnum;
import org.dromara.zjk.learning_world.mapper.ZjkLearningCourseMapper;
import org.dromara.zjk.mapper.ZjkExpertMapper;
import org.springframework.stereotype.Service;
import org.dromara.zjk.domain.bo.LearningEvaluateBo; import org.dromara.zjk.domain.bo.LearningEvaluateBo;
import org.dromara.zjk.domain.vo.LearningEvaluateVo; import org.dromara.zjk.domain.vo.LearningEvaluateVo;
import org.dromara.zjk.domain.LearningEvaluate; import org.dromara.zjk.learning_world.mapper.ZjkLearningCourseMapper;
import org.dromara.zjk.mapper.LearningEvaluateMapper; import org.dromara.zjk.mapper.LearningEvaluateMapper;
import org.dromara.zjk.mapper.ZjkExpertMapper;
import org.dromara.zjk.service.ILearningEvaluateService; import org.dromara.zjk.service.ILearningEvaluateService;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Collection;
/** /**
* 【请填写功能名称】Service业务层处理 * 【请填写功能名称】Service业务层处理
...@@ -39,6 +38,7 @@ public class LearningEvaluateServiceImpl implements ILearningEvaluateService { ...@@ -39,6 +38,7 @@ public class LearningEvaluateServiceImpl implements ILearningEvaluateService {
private final LearningEvaluateMapper baseMapper; private final LearningEvaluateMapper baseMapper;
private final ZjkExpertMapper zjkExpertMapper; private final ZjkExpertMapper zjkExpertMapper;
private final ZjkLearningCourseMapper zjkLearningCourseMapper; private final ZjkLearningCourseMapper zjkLearningCourseMapper;
/** /**
* 查询【请填写功能名称】 * 查询【请填写功能名称】
* *
...@@ -46,9 +46,9 @@ public class LearningEvaluateServiceImpl implements ILearningEvaluateService { ...@@ -46,9 +46,9 @@ public class LearningEvaluateServiceImpl implements ILearningEvaluateService {
* @return 【请填写功能名称】 * @return 【请填写功能名称】
*/ */
@Override @Override
public LearningEvaluateVo queryById(String ID){ public LearningEvaluateVo queryById(String ID) {
LearningEvaluateVo res = baseMapper.selectVoById(ID); LearningEvaluateVo res = baseMapper.selectVoById(ID);
if(res.getCourseId()!=null){ if (res.getCourseId() != null) {
res.setCourseName(zjkLearningCourseMapper.selectById(res.getCourseId()).getCourseName()); res.setCourseName(zjkLearningCourseMapper.selectById(res.getCourseId()).getCourseName());
} }
return res; return res;
...@@ -68,17 +68,21 @@ public class LearningEvaluateServiceImpl implements ILearningEvaluateService { ...@@ -68,17 +68,21 @@ public class LearningEvaluateServiceImpl implements ILearningEvaluateService {
if (contains) { if (contains) {
lqw.in(LearningEvaluate::getCreateBy, LoginHelper.getUserId()); lqw.in(LearningEvaluate::getCreateBy, LoginHelper.getUserId());
} }
if(!StringUtils.isEmpty(bo.getExpertName())){ if (!StringUtils.isEmpty(bo.getExpertName())) {
List<Long> uids = zjkExpertMapper.selectIdsByName(bo.getExpertName()); List<Long> uids = zjkExpertMapper.selectIdsByName(bo.getExpertName());
lqw.in(LearningEvaluate::getCreateBy, uids); if (!CollectionUtil.isEmpty(uids)) {
lqw.in(LearningEvaluate::getCreateBy, uids);
}
} }
if(!StringUtils.isEmpty(bo.getCourseName())){ if (!StringUtils.isEmpty(bo.getCourseName())) {
List<Long> cids = zjkLearningCourseMapper.selectIdsByName(bo.getCourseName()); List<Long> cids = zjkLearningCourseMapper.selectIdsByName(bo.getCourseName());
lqw.in(LearningEvaluate::getCourseId, cids); if (!CollectionUtil.isEmpty(cids)) {
lqw.in(LearningEvaluate::getCourseId, cids);
}
} }
lqw.orderByDesc(LearningEvaluate::getCreateTime); lqw.orderByDesc(LearningEvaluate::getCreateTime);
Page<LearningEvaluateVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); Page<LearningEvaluateVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
result.getRecords().stream().forEach(o ->{ result.getRecords().stream().forEach(o -> {
o.setExpertName(zjkExpertMapper.selectByUserId(o.getCreateBy()).getExpertName()); o.setExpertName(zjkExpertMapper.selectByUserId(o.getCreateBy()).getExpertName());
o.setCourseName(zjkLearningCourseMapper.selectById(o.getCourseId()).getCourseName()); o.setCourseName(zjkLearningCourseMapper.selectById(o.getCourseId()).getCourseName());
}); });
...@@ -145,7 +149,7 @@ public class LearningEvaluateServiceImpl implements ILearningEvaluateService { ...@@ -145,7 +149,7 @@ public class LearningEvaluateServiceImpl implements ILearningEvaluateService {
/** /**
* 保存前的数据校验 * 保存前的数据校验
*/ */
private void validEntityBeforeSave(LearningEvaluate entity){ private void validEntityBeforeSave(LearningEvaluate entity) {
//TODO 做一些数据校验,如唯一约束 //TODO 做一些数据校验,如唯一约束
if (StringUtils.isBlank(entity.getID())) { if (StringUtils.isBlank(entity.getID())) {
entity.setID(IdUtil.simpleUUID()); // 或使用其他ID生成方式 entity.setID(IdUtil.simpleUUID()); // 或使用其他ID生成方式
...@@ -161,7 +165,7 @@ public class LearningEvaluateServiceImpl implements ILearningEvaluateService { ...@@ -161,7 +165,7 @@ public class LearningEvaluateServiceImpl implements ILearningEvaluateService {
*/ */
@Override @Override
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) { public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
if(isValid){ if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验 //TODO 做一些业务上的校验,判断是否需要校验
} }
return baseMapper.deleteByIds(ids) > 0; return baseMapper.deleteByIds(ids) > 0;
......
package org.dromara.zjk.service.impl; package org.dromara.zjk.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
...@@ -62,7 +63,9 @@ public class LearningSuggestServiceImpl implements ILearningSuggestService { ...@@ -62,7 +63,9 @@ public class LearningSuggestServiceImpl implements ILearningSuggestService {
LambdaQueryWrapper<LearningSuggest> lqw = buildQueryWrapper(bo); LambdaQueryWrapper<LearningSuggest> lqw = buildQueryWrapper(bo);
if(!StringUtils.isEmpty(bo.getExpertName())){ if(!StringUtils.isEmpty(bo.getExpertName())){
List<Long> uids = zjkExpertMapper.selectIdsByName(bo.getExpertName()); List<Long> uids = zjkExpertMapper.selectIdsByName(bo.getExpertName());
lqw.in(LearningSuggest::getCreateBy, uids); if(!CollectionUtil.isEmpty(uids)){
lqw.in(LearningSuggest::getCreateBy, uids);
}
} }
Page<LearningSuggestVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); Page<LearningSuggestVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
result.getRecords().stream().forEach(o ->{ result.getRecords().stream().forEach(o ->{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment