|
|
|
@ -1,8 +1,9 @@
|
|
|
|
|
package com.supervision.manage.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.supervision.manage.service.AskQuestionLibraryManageService;
|
|
|
|
|
import com.supervision.model.AskTemplateQuestionLibrary;
|
|
|
|
|
import com.supervision.model.CommonDic;
|
|
|
|
|
import com.supervision.service.AskTemplateQuestionLibraryService;
|
|
|
|
|
import com.supervision.service.CommonDicService;
|
|
|
|
@ -38,4 +39,33 @@ public class AskQuestionLibraryManageServiceImpl implements AskQuestionLibraryMa
|
|
|
|
|
public List<CommonDic> queryItemList() {
|
|
|
|
|
return commonDicService.lambdaQuery().eq(CommonDic::getGroupCode, "AQT").isNull(CommonDic::getParentId).list();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String saveQuestionLibrary(AskTemplateQuestionLibrary askTemplateQuestionLibrary) {
|
|
|
|
|
assertSave(askTemplateQuestionLibrary);
|
|
|
|
|
|
|
|
|
|
askTemplateQuestionLibraryService.save(askTemplateQuestionLibrary);
|
|
|
|
|
return askTemplateQuestionLibrary.getId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean updateQuestionLibrary(AskTemplateQuestionLibrary askTemplateQuestionLibrary) {
|
|
|
|
|
Assert.notEmpty(askTemplateQuestionLibrary.getId(),"id不能为空");
|
|
|
|
|
assertSave(askTemplateQuestionLibrary);
|
|
|
|
|
|
|
|
|
|
return askTemplateQuestionLibraryService.updateById(askTemplateQuestionLibrary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean deleteQuestionLibrary(String id) {
|
|
|
|
|
Assert.notEmpty(id,"id不能为空");
|
|
|
|
|
|
|
|
|
|
return askTemplateQuestionLibraryService.removeById(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void assertSave(AskTemplateQuestionLibrary askTemplateQuestionLibrary){
|
|
|
|
|
Assert.notEmpty(askTemplateQuestionLibrary.getCode(),"编码不能为空");
|
|
|
|
|
Assert.notEmpty(askTemplateQuestionLibrary.getQuestion(),"问题不能为空");
|
|
|
|
|
Assert.notEmpty(askTemplateQuestionLibrary.getDefaultAnswer(),"默认回答不能为空");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|