|
|
@@ -7,6 +7,7 @@ import cn.tr.module.smart.common.mapper.BizQuestionMapper;
|
|
|
import cn.tr.module.smart.common.po.BizQuestionPO;
|
|
|
import cn.tr.module.smart.common.repository.BizQuestionRepository;
|
|
|
import cn.tr.module.smart.common.service.IBizQuestionService;
|
|
|
+import cn.tr.module.smart.web.dto.BizQuestionInsertOrUpdateDTO;
|
|
|
import cn.tr.module.smart.wx.controller.vo.BizWxDeptQuestionVO;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
@@ -28,18 +29,6 @@ public class BizQuestionServiceImpl extends ServiceImpl<BizQuestionRepository, B
|
|
|
private BizQuestionRepository baseRepository;
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 编辑问卷调查问题字段
|
|
|
- * @param source 编辑实体类
|
|
|
- * @author lf
|
|
|
- * @date 2025/05/23 17:03
|
|
|
- */
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- @Override
|
|
|
- public boolean updateBizQuestionById(BizQuestionDTO source){
|
|
|
- return baseRepository.updateById(BizQuestionMapper.INSTANCE.convertPO(source))!=0;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 新增问卷调查问题字段
|
|
|
* @param source 新增实体类
|
|
|
@@ -48,8 +37,10 @@ public class BizQuestionServiceImpl extends ServiceImpl<BizQuestionRepository, B
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public boolean insertBizQuestion(List<BizQuestionDTO> source){
|
|
|
- return this.saveBatch(BizQuestionMapper.INSTANCE.convertPOList(source));
|
|
|
+ public boolean insertBizQuestion(BizQuestionInsertOrUpdateDTO source){
|
|
|
+ //对问卷组进行先删后插
|
|
|
+ baseRepository.delete(new LambdaQueryWrapper<BizQuestionPO>().in(BizQuestionPO::getGroupId, source.getGroupId()));
|
|
|
+ return this.saveBatch(BizQuestionMapper.INSTANCE.convertPOList(source.getQuestionList()));
|
|
|
}
|
|
|
|
|
|
/**
|