Commit ae8b894c by 裴大威

fix 1020390、1020392

parent 74047a16
......@@ -10,7 +10,10 @@ import com.pcloud.book.group.vo.GroupQrcodeBaseInfoVO;
import com.pcloud.book.reading.biz.ReadingActivityBiz;
import com.pcloud.book.skill.biz.PcloudGroupActivityBiz;
import com.pcloud.book.skill.dao.PcloudGroupActivityDao;
import com.pcloud.book.skill.dao.PcloudSkillDao;
import com.pcloud.book.skill.entity.PcloudGroupActivity;
import com.pcloud.book.skill.entity.PcloudSkill;
import com.pcloud.book.skill.enums.SkillTypeEnum;
import com.pcloud.book.skill.facade.request.SaveGroupActivityRequestVO;
import com.pcloud.book.skill.facade.request.UpdateGroupActivityRequestVO;
import com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO;
......@@ -38,6 +41,8 @@ import lombok.extern.slf4j.Slf4j;
public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
@Resource
private PcloudSkillDao pcloudSkillDao;
@Resource
private PcloudGroupActivityDao pcloudGroupActivityDao;
@Resource
private GroupQrcodeBiz groupQrcodeBiz;
......@@ -77,6 +82,13 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
@Override
public void deleteGroupActivity(Long id, Long partyId) {
if (Objects.isNull(id)) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "该共读活动不存在!");
}
PcloudSkill byRelId = pcloudSkillDao.getByRelId(id.intValue(), SkillTypeEnum.READING.value);
if (Objects.nonNull(byRelId)) {
throw new BookBizException(BookBizException.PARAM_IS_EXIST, "该共读活动已经关联技能,无法删除!");
}
pcloudGroupActivityDao.deleteById(id);
}
......
......@@ -6,7 +6,10 @@ import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.consumer.label.LabelConsr;
import com.pcloud.book.skill.biz.PcloudResourceBiz;
import com.pcloud.book.skill.dao.PcloudResourceDao;
import com.pcloud.book.skill.dao.PcloudSkillDao;
import com.pcloud.book.skill.entity.PcloudResource;
import com.pcloud.book.skill.entity.PcloudSkill;
import com.pcloud.book.skill.enums.SkillTypeEnum;
import com.pcloud.book.skill.facade.response.QueryPcloudResponseVO;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.page.PageBeanNew;
......@@ -20,11 +23,14 @@ import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Service
public class PcloudResourceBizImpl implements PcloudResourceBiz {
@Autowired
private PcloudSkillDao pcloudSkillDao;
@Autowired
private PcloudResourceDao pcloudResourceDao;
@Autowired
private LabelConsr labelConsr;
......@@ -61,6 +67,10 @@ public class PcloudResourceBizImpl implements PcloudResourceBiz {
if (id==null){
throw new BookBizException(BookBizException.PARAM_IS_NULL,"参数为空!");
}
PcloudSkill byRelId = pcloudSkillDao.getByRelId(id.intValue(), SkillTypeEnum.RESOURCE.value);
if (Objects.nonNull(byRelId)) {
throw new BookBizException(BookBizException.PARAM_IS_EXIST, "该配套资源已经关联技能,无法删除!");
}
pcloudResourceDao.deletePcloudResource(id);
// 删除关系
// pcloudResourceItemDao.deleteByPcloudResourceId(id);
......
......@@ -25,7 +25,5 @@ public interface PcloudSkillDao extends BaseDao<PcloudSkill> {
Integer getMaxSeqNum();
PcloudSkill getByRelSkillId(Integer relSkillId);
PcloudSkill getByRelId(Integer relSkillId, Integer type);
}
......@@ -26,11 +26,6 @@ public class PcloudSkillDaoImpl extends BaseDaoImpl<PcloudSkill> implements Pclo
}
@Override
public PcloudSkill getByRelSkillId(Integer relSkillId) {
return super.getSqlSession().selectOne(getStatement("getByRelSkillId"),relSkillId);
}
@Override
public List<RobotSkill4H5> getSkillList4TimeController(Integer type, Long labelId, String wxUserId) {
Map<String,Object> map=new HashMap<>();
map.put("type",type);
......
package com.pcloud.book.timecontrol.biz.impl;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import com.pcloud.book.group.biz.WeixinQrcodeBiz;
import com.pcloud.book.skill.dao.PcloudSkillDao;
import com.pcloud.book.skill.entity.PcloudSkill;
import com.pcloud.book.skill.enums.SkillTypeEnum;
import com.pcloud.book.timecontrol.biz.TaskBiz;
import com.pcloud.book.timecontrol.biz.TaskSubscribeBiz;
import com.pcloud.book.timecontrol.dto.*;
......@@ -46,6 +50,8 @@ public class TaskBizImpl implements TaskBiz {
private final static Logger LOGGER = LoggerFactory.getLogger(TaskBizImpl.class);
@Autowired
private PcloudSkillDao pcloudSkillDao;
@Autowired
private TimeControlTaskMapper taskMapper;
@Autowired
private TimeControlTaskItemMapper taskItemMapper;
......@@ -79,6 +85,10 @@ public class TaskBizImpl implements TaskBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteTask(Integer taskId) {
PcloudSkill byRelId = pcloudSkillDao.getByRelId(taskId, SkillTypeEnum.TIME_MANAGE.value);
if (Objects.nonNull(byRelId)) {
throw new BookBizException(BookBizException.PARAM_IS_EXIST, "该计划已经关联技能,无法删除!");
}
// 1删除任务模板
taskMapper.deleteByPrimaryKey(taskId);
......
......@@ -177,15 +177,6 @@
select ifnull(max(seq_num),0) from pcloud_skill
</select>
<select id="getByRelSkillId" parameterType="integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
pcloud_skill
where
rel_skill_id = #{relSkillId}
</select>
<select id="getByRelId" resultMap="BaseResultMap">
select id, skill_type, rel_skill_id, skill_fuse_reply, seq_num
from pcloud_skill where rel_skill_id = #{relSkillId} and skill_type = #{type}
......
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