去除aspose破解;系统优化
This commit is contained in:
parent
89d25d13d7
commit
355d5caf8f
6
pom.xml
6
pom.xml
|
@ -307,6 +307,12 @@
|
||||||
<version>${fastjson.version}</version>
|
<version>${fastjson.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.luhuiguo</groupId>
|
||||||
|
<artifactId>aspose-words</artifactId>
|
||||||
|
<version>23.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-system</artifactId>
|
<artifactId>ruoyi-system</artifactId>
|
||||||
|
|
Binary file not shown.
|
@ -91,11 +91,8 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aspose.words</groupId>
|
<groupId>com.luhuiguo</groupId>
|
||||||
<artifactId>aspose-words</artifactId>
|
<artifactId>aspose-words</artifactId>
|
||||||
<version>15.12.0</version>
|
|
||||||
<scope>system</scope>
|
|
||||||
<systemPath>${project.basedir}/lib/aspose-words-15.8.0-jdk16.jar</systemPath>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
@ -113,8 +113,6 @@ public class ScalePublishController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 中止记录
|
* 中止记录
|
||||||
*
|
*
|
||||||
* @param bo
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("scale:publish:edit")
|
@SaCheckPermission("scale:publish:edit")
|
||||||
@Log(title = "中止量表发布", businessType = BusinessType.UPDATE)
|
@Log(title = "中止量表发布", businessType = BusinessType.UPDATE)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.dromara.scale.domain.word;
|
package org.dromara.scale.domain.word;
|
||||||
|
|
||||||
import com.deepoove.poi.data.ChartMultiSeriesRenderData;
|
|
||||||
import com.deepoove.poi.data.TableRenderData;
|
import com.deepoove.poi.data.TableRenderData;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
@ -25,7 +24,7 @@ public class EvaluationRecordWordData {
|
||||||
private String scaleName;
|
private String scaleName;
|
||||||
private String scaleDetails;
|
private String scaleDetails;
|
||||||
private TableRenderData factor;
|
private TableRenderData factor;
|
||||||
private ChartMultiSeriesRenderData radarChart;
|
private WordRadar radar;
|
||||||
private List<WordFactor> factors;
|
private List<WordFactor> factors;
|
||||||
private String propose;
|
private String propose;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package org.dromara.scale.domain.word;
|
||||||
|
|
||||||
|
import com.deepoove.poi.data.ChartMultiSeriesRenderData;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>TODO<p>
|
||||||
|
*
|
||||||
|
* @author cjw
|
||||||
|
* @version V1.0.0
|
||||||
|
* @date 2024/5/29 9:20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WordRadar {
|
||||||
|
private ChartMultiSeriesRenderData radarChart;
|
||||||
|
}
|
|
@ -23,9 +23,10 @@ public interface SysScalePublishMapper extends BaseMapperPlus<SysScalePublish, S
|
||||||
Page<EvaluationVo> selectEvaluationVoList(@Param("page") Page<EvaluationVo> page, @Param("batchNo") Long batchNo, @Param("scaleId") Long scaleId, @Param("deptId") Long deptId);
|
Page<EvaluationVo> selectEvaluationVoList(@Param("page") Page<EvaluationVo> page, @Param("batchNo") Long batchNo, @Param("scaleId") Long scaleId, @Param("deptId") Long deptId);
|
||||||
|
|
||||||
List<String> selectDeptIdsInUse();
|
List<String> selectDeptIdsInUse();
|
||||||
|
|
||||||
List<String> selectUserIdsInUse();
|
List<String> selectUserIdsInUse();
|
||||||
|
|
||||||
List<EvaluationVo> selectUndoneEvaluationVoList(@Param("batchNo") Long batchNo);
|
List<EvaluationVo> selectUndoneEvaluationVoList(@Param("batchNo") Long batchNo, @Param("scaleId") Long scaleId, @Param("deptId") Long deptId);
|
||||||
|
|
||||||
SysScalePublish selectPublishById(@Param("batchNo") Long batchNo);
|
SysScalePublish selectPublishById(@Param("batchNo") Long batchNo);
|
||||||
|
|
||||||
|
@ -38,4 +39,7 @@ public interface SysScalePublishMapper extends BaseMapperPlus<SysScalePublish, S
|
||||||
int selectCountScalePublish();
|
int selectCountScalePublish();
|
||||||
|
|
||||||
void addCompleteNum(Long batchNo);
|
void addCompleteNum(Long batchNo);
|
||||||
|
|
||||||
|
int selectCountScalePublishByScaleId(Long scaleId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,9 @@ public class StatisticServiceImpl implements IStatisticService {
|
||||||
Set<String> keys = collect.keySet();
|
Set<String> keys = collect.keySet();
|
||||||
List<StatisticFactorVo> data = new ArrayList<>();
|
List<StatisticFactorVo> data = new ArrayList<>();
|
||||||
for (String key : keys) {
|
for (String key : keys) {
|
||||||
|
if ("absent".equals(key)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
StatisticFactorVo one = new StatisticFactorVo();
|
StatisticFactorVo one = new StatisticFactorVo();
|
||||||
one.setFactorName(key);
|
one.setFactorName(key);
|
||||||
List<StatisticFactorVo> factorList = collect.get(key);
|
List<StatisticFactorVo> factorList = collect.get(key);
|
||||||
|
@ -139,6 +142,9 @@ public class StatisticServiceImpl implements IStatisticService {
|
||||||
Set<String> keys = collect.keySet();
|
Set<String> keys = collect.keySet();
|
||||||
List<StatisticFactorVo> data = new ArrayList<>();
|
List<StatisticFactorVo> data = new ArrayList<>();
|
||||||
for (String key : keys) {
|
for (String key : keys) {
|
||||||
|
if ("absent".equals(key)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
StatisticFactorVo one = new StatisticFactorVo();
|
StatisticFactorVo one = new StatisticFactorVo();
|
||||||
one.setFactorName(key);
|
one.setFactorName(key);
|
||||||
List<StatisticFactorVo> factorList = collect.get(key);
|
List<StatisticFactorVo> factorList = collect.get(key);
|
||||||
|
|
|
@ -39,8 +39,6 @@ public class SysEvaluationConclusionServiceImpl implements ISysEvaluationConclus
|
||||||
LambdaQueryWrapper<SysEvaluationConclusion> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<SysEvaluationConclusion> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(bo.getRecordId() != null, SysEvaluationConclusion::getRecordId, bo.getRecordId());
|
lqw.eq(bo.getRecordId() != null, SysEvaluationConclusion::getRecordId, bo.getRecordId());
|
||||||
lqw.eq(bo.getFactorId() != null, SysEvaluationConclusion::getFactorId, bo.getFactorId());
|
lqw.eq(bo.getFactorId() != null, SysEvaluationConclusion::getFactorId, bo.getFactorId());
|
||||||
lqw.eq(bo.getScore() != null, SysEvaluationConclusion::getScore, bo.getScore());
|
|
||||||
lqw.eq(bo.getScoreRate() != null, SysEvaluationConclusion::getScoreRate, bo.getScoreRate());
|
|
||||||
lqw.eq(bo.getFactorRangeId() != null, SysEvaluationConclusion::getFactorRangeId, bo.getFactorRangeId());
|
lqw.eq(bo.getFactorRangeId() != null, SysEvaluationConclusion::getFactorRangeId, bo.getFactorRangeId());
|
||||||
lqw.eq(bo.getStatus() != null, SysEvaluationConclusion::getStatus, bo.getStatus());
|
lqw.eq(bo.getStatus() != null, SysEvaluationConclusion::getStatus, bo.getStatus());
|
||||||
return lqw;
|
return lqw;
|
||||||
|
|
|
@ -23,6 +23,7 @@ import org.dromara.scale.domain.vo.SysScaleVo;
|
||||||
import org.dromara.scale.domain.word.EvaluationRecordWordData;
|
import org.dromara.scale.domain.word.EvaluationRecordWordData;
|
||||||
import org.dromara.scale.domain.word.WordEvaluationFactor;
|
import org.dromara.scale.domain.word.WordEvaluationFactor;
|
||||||
import org.dromara.scale.domain.word.WordFactor;
|
import org.dromara.scale.domain.word.WordFactor;
|
||||||
|
import org.dromara.scale.domain.word.WordRadar;
|
||||||
import org.dromara.scale.mapper.SysEvaluationRecordMapper;
|
import org.dromara.scale.mapper.SysEvaluationRecordMapper;
|
||||||
import org.dromara.scale.mapper.SysScaleMapper;
|
import org.dromara.scale.mapper.SysScaleMapper;
|
||||||
import org.dromara.scale.service.ISysEvaluationRecordService;
|
import org.dromara.scale.service.ISysEvaluationRecordService;
|
||||||
|
@ -146,10 +147,12 @@ public class SysEvaluationRecordServiceImpl implements ISysEvaluationRecordServi
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
WordEvaluationFactor answerVo = answerVos.get(i);
|
WordEvaluationFactor answerVo = answerVos.get(i);
|
||||||
|
String factorName = answerVo.getFactorName();
|
||||||
double score = answerVo.getScore().doubleValue();
|
double score = answerVo.getScore().doubleValue();
|
||||||
StringBuilder range = new StringBuilder();
|
StringBuilder range = new StringBuilder();
|
||||||
BigDecimal minValue = answerVo.getMinValue();
|
BigDecimal minValue = answerVo.getMinValue();
|
||||||
BigDecimal maxValue = answerVo.getMaxValue();
|
BigDecimal maxValue = answerVo.getMaxValue();
|
||||||
|
String answerScore = answerVo.getScore().toString();
|
||||||
boolean minFlag = false;
|
boolean minFlag = false;
|
||||||
boolean maxFlag = false;
|
boolean maxFlag = false;
|
||||||
if (minValue != null) {
|
if (minValue != null) {
|
||||||
|
@ -164,41 +167,49 @@ public class SysEvaluationRecordServiceImpl implements ISysEvaluationRecordServi
|
||||||
range.append("-");
|
range.append("-");
|
||||||
range.append(maxValue.doubleValue());
|
range.append(maxValue.doubleValue());
|
||||||
} else {
|
} else {
|
||||||
range.append(">=").append(minValue.doubleValue());
|
answerScore = answerScore + "↑";
|
||||||
|
range.append(minValue.doubleValue());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
range.append(maxValue.doubleValue()).append("<=");
|
range.append(maxValue.doubleValue());
|
||||||
|
answerScore = answerScore + "↓";
|
||||||
}
|
}
|
||||||
//处理因子得分表格
|
//处理因子得分表格
|
||||||
RowRenderData one = Rows.of(answerVo.getFactorName(), answerVo.getQuestionNum().toString(),
|
RowRenderData one = Rows.of(factorName, answerVo.getQuestionNum().toString(),
|
||||||
answerVo.getTotalScore().toString(), answerVo.getScore().toString(), range.toString(), answerVo.getRangeName())
|
answerVo.getTotalScore().toString(), answerScore, range.toString(), answerVo.getRangeName())
|
||||||
.textFontFamily("宋体").textFontSize(9).center().create();
|
.textFontFamily("宋体").textFontSize(9).center().create();
|
||||||
factorTable.addRow(one);
|
factorTable.addRow(one);
|
||||||
//处理测评结果
|
//处理测评结果
|
||||||
WordFactor wordFactor = new WordFactor();
|
WordFactor wordFactor = new WordFactor();
|
||||||
wordFactor.setFactorName(answerVo.getFactorName());
|
wordFactor.setFactorName(factorName);
|
||||||
wordFactor.setScore(score);
|
wordFactor.setScore(score);
|
||||||
wordFactor.setEvalDesc(answerVo.getEvalDesc());
|
wordFactor.setEvalDesc(answerVo.getEvalDesc());
|
||||||
//判断激活,放到首位并添加建议
|
//判断激活,放到首位并添加建议
|
||||||
if (answerVo.getStatus() == 1) {
|
if (answerVo.getStatus() == 1) {
|
||||||
factors.addFirst(wordFactor);
|
factors.addFirst(wordFactor);
|
||||||
stringBuilder.append(HtmlUtil.cleanHtmlTag(answerVo.getEvalPropose())).append("\n").append("\n").append("\r");
|
stringBuilder.append("\t").append(factorName).append("——").append(HtmlUtil.cleanHtmlTag(answerVo.getEvalPropose())).append("\n").append("\n").append("\r");
|
||||||
} else {
|
} else {
|
||||||
factors.add(wordFactor);
|
factors.add(wordFactor);
|
||||||
}
|
}
|
||||||
//雷达图使用
|
if (!"总分".equals(answerVo.getFactorName())) {
|
||||||
strings[i] = answerVo.getFactorName();
|
//雷达图使用
|
||||||
doubles[i] = score;
|
strings[i] = answerVo.getFactorName();
|
||||||
|
doubles[i] = score;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wordData.setFactor(factorTable);
|
wordData.setFactor(factorTable);
|
||||||
wordData.setFactors(factors);
|
wordData.setFactors(factors);
|
||||||
//处理雷达图
|
//处理雷达图
|
||||||
ChartMultiSeriesRenderData chart = Charts
|
if (strings.length >1) {
|
||||||
.ofMultiSeries(scale.getScaleName(), strings)
|
ChartMultiSeriesRenderData chart = Charts
|
||||||
.addSeries("因子项", doubles)
|
.ofMultiSeries(scale.getScaleName(), strings)
|
||||||
.create();
|
.addSeries("因子项", doubles)
|
||||||
wordData.setRadarChart(chart);
|
.create();
|
||||||
|
WordRadar radar = new WordRadar();
|
||||||
|
radar.setRadarChart(chart);
|
||||||
|
wordData.setRadar(radar);
|
||||||
|
}
|
||||||
wordData.setPropose(stringBuilder.toString());
|
wordData.setPropose(stringBuilder.toString());
|
||||||
ClassPathResource classPathResource = new ClassPathResource("word/personalTemplate.docx");
|
ClassPathResource classPathResource = new ClassPathResource("word/personalTemplate.docx");
|
||||||
Configure config = Configure.builder()
|
Configure config = Configure.builder()
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.model.LoginUser;
|
import org.dromara.common.core.domain.model.LoginUser;
|
||||||
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
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.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
@ -87,6 +88,10 @@ public class SysInterveneRecordServiceImpl implements ISysInterveneRecordService
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(SysInterveneRecordBo bo) {
|
public Boolean insertByBo(SysInterveneRecordBo bo) {
|
||||||
LoginUser loginUser = getLoginUser();
|
LoginUser loginUser = getLoginUser();
|
||||||
|
SysUser sysUser = userMapper.selectById(loginUser.getUserId());
|
||||||
|
if (sysUser.getInterveneStatus() == 0) {
|
||||||
|
throw new ServiceException("此用户状态为无需干预,无法提交干预记录");
|
||||||
|
}
|
||||||
SysInterveneRecord add = MapstructUtils.convert(bo, SysInterveneRecord.class);
|
SysInterveneRecord add = MapstructUtils.convert(bo, SysInterveneRecord.class);
|
||||||
add.setCreateTime(new Date());
|
add.setCreateTime(new Date());
|
||||||
add.setCounselorId(loginUser.getUserId());
|
add.setCounselorId(loginUser.getUserId());
|
||||||
|
|
|
@ -33,7 +33,6 @@ import org.dromara.scale.domain.word.WordWarn;
|
||||||
import org.dromara.scale.mapper.SysEvaluationRecordMapper;
|
import org.dromara.scale.mapper.SysEvaluationRecordMapper;
|
||||||
import org.dromara.scale.mapper.SysScaleMapper;
|
import org.dromara.scale.mapper.SysScaleMapper;
|
||||||
import org.dromara.scale.mapper.SysScalePublishMapper;
|
import org.dromara.scale.mapper.SysScalePublishMapper;
|
||||||
import org.dromara.scale.mapper.SysWarnRecordMapper;
|
|
||||||
import org.dromara.scale.service.ISysScalePublishService;
|
import org.dromara.scale.service.ISysScalePublishService;
|
||||||
import org.dromara.system.domain.SysUser;
|
import org.dromara.system.domain.SysUser;
|
||||||
import org.dromara.system.domain.vo.SysDeptVo;
|
import org.dromara.system.domain.vo.SysDeptVo;
|
||||||
|
@ -74,8 +73,6 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
||||||
|
|
||||||
private final SysUserMapper userMapper;
|
private final SysUserMapper userMapper;
|
||||||
|
|
||||||
private final SysWarnRecordMapper warnMapper;
|
|
||||||
|
|
||||||
private final ISysConfigService configService;
|
private final ISysConfigService configService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -84,7 +81,13 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
||||||
@Override
|
@Override
|
||||||
public SysScalePublishVo queryById(Long batchNo) {
|
public SysScalePublishVo queryById(Long batchNo) {
|
||||||
SysScalePublish publish = baseMapper.selectPublishById(batchNo);
|
SysScalePublish publish = baseMapper.selectPublishById(batchNo);
|
||||||
return MapstructUtils.convert(publish, SysScalePublishVo.class);
|
SysScalePublishVo sysScalePublishVo = MapstructUtils.convert(publish, SysScalePublishVo.class);
|
||||||
|
if (ObjectUtil.isEmpty(publish.getDeptNames())) {
|
||||||
|
String userIds = publish.getUserIds();
|
||||||
|
List<String> deptNames = deptMapper.findDeptNameByUserIds(userIds);
|
||||||
|
sysScalePublishVo.setDeptNames(deptNames);
|
||||||
|
}
|
||||||
|
return sysScalePublishVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -281,7 +284,7 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EvaluationVo> queryUndoneExportList(BaseQueryBo query) {
|
public List<EvaluationVo> queryUndoneExportList(BaseQueryBo query) {
|
||||||
return baseMapper.selectUndoneEvaluationVoList(query.getBatchNo());
|
return baseMapper.selectUndoneEvaluationVoList(query.getBatchNo(), query.getScaleId(), query.getDeptId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,6 +20,7 @@ import org.dromara.scale.domain.vo.SysScaleFactorVo;
|
||||||
import org.dromara.scale.domain.vo.SysScaleQuestionVo;
|
import org.dromara.scale.domain.vo.SysScaleQuestionVo;
|
||||||
import org.dromara.scale.mapper.SysScaleAnswerMapper;
|
import org.dromara.scale.mapper.SysScaleAnswerMapper;
|
||||||
import org.dromara.scale.mapper.SysScaleMapper;
|
import org.dromara.scale.mapper.SysScaleMapper;
|
||||||
|
import org.dromara.scale.mapper.SysScalePublishMapper;
|
||||||
import org.dromara.scale.mapper.SysScaleQuestionMapper;
|
import org.dromara.scale.mapper.SysScaleQuestionMapper;
|
||||||
import org.dromara.scale.service.ISysScaleQuestionService;
|
import org.dromara.scale.service.ISysScaleQuestionService;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
|
@ -46,6 +47,8 @@ public class SysScaleQuestionServiceImpl implements ISysScaleQuestionService {
|
||||||
|
|
||||||
private final SysScaleMapper scaleMapper;
|
private final SysScaleMapper scaleMapper;
|
||||||
|
|
||||||
|
private final SysScalePublishMapper publishMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询量问题内容
|
* 查询量问题内容
|
||||||
*/
|
*/
|
||||||
|
@ -86,6 +89,7 @@ public class SysScaleQuestionServiceImpl implements ISysScaleQuestionService {
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getQuestionContent()), SysScaleQuestion::getQuestionContent, bo.getQuestionContent());
|
lqw.eq(StringUtils.isNotBlank(bo.getQuestionContent()), SysScaleQuestion::getQuestionContent, bo.getQuestionContent());
|
||||||
// lqw.eq(bo.getFactorId() != null, SysScaleQuestion::getFactorId, bo.getFactorId());
|
// lqw.eq(bo.getFactorId() != null, SysScaleQuestion::getFactorId, bo.getFactorId());
|
||||||
// lqw.like(StringUtils.isNotBlank(bo.getFactorName()), SysScaleQuestion::getFactorName, bo.getFactorName());
|
// lqw.like(StringUtils.isNotBlank(bo.getFactorName()), SysScaleQuestion::getFactorName, bo.getFactorName());
|
||||||
|
lqw.orderByAsc(SysScaleQuestion::getQuestionOrder);
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,13 +115,17 @@ public class SysScaleQuestionServiceImpl implements ISysScaleQuestionService {
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(SysScaleQuestionBo bo) {
|
public Boolean insertByBo(SysScaleQuestionBo bo) {
|
||||||
|
Long scaleId = bo.getScaleId();
|
||||||
|
int i = publishMapper.selectCountScalePublishByScaleId(scaleId);
|
||||||
|
if (i > 0) {
|
||||||
|
throw new ServiceException("此量表已有发布,无法新增问题");
|
||||||
|
}
|
||||||
SysScaleQuestion add = MapstructUtils.convert(bo, SysScaleQuestion.class);
|
SysScaleQuestion add = MapstructUtils.convert(bo, SysScaleQuestion.class);
|
||||||
//validEntityBeforeSave(add);
|
//validEntityBeforeSave(add);
|
||||||
Long scaleId = bo.getScaleId();
|
|
||||||
SysScale sysScale = scaleMapper.selectById(scaleId);
|
SysScale sysScale = scaleMapper.selectById(scaleId);
|
||||||
Integer questionsNum = sysScale.getQuestionsNum();
|
Integer questionsNum = sysScale.getQuestionsNum();
|
||||||
int count = baseMapper.countQuestionNumByScaleId(scaleId);
|
int count = baseMapper.countQuestionNumByScaleId(scaleId);
|
||||||
if (count >= questionsNum - 1) {
|
if (count > questionsNum - 1) {
|
||||||
throw new ServiceException("问题数量超过量表的限定数量,请确认后提交");
|
throw new ServiceException("问题数量超过量表的限定数量,请确认后提交");
|
||||||
}
|
}
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
@ -148,6 +156,11 @@ public class SysScaleQuestionServiceImpl implements ISysScaleQuestionService {
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateByBo(SysScaleQuestionBo bo) {
|
public Boolean updateByBo(SysScaleQuestionBo bo) {
|
||||||
|
Long scaleId = bo.getScaleId();
|
||||||
|
int i = publishMapper.selectCountScalePublishByScaleId(scaleId);
|
||||||
|
if (i > 0) {
|
||||||
|
throw new ServiceException("此量表已有发布,无法修改问题");
|
||||||
|
}
|
||||||
SysScaleQuestion update = MapstructUtils.convert(bo, SysScaleQuestion.class);
|
SysScaleQuestion update = MapstructUtils.convert(bo, SysScaleQuestion.class);
|
||||||
//validEntityBeforeSave(update);
|
//validEntityBeforeSave(update);
|
||||||
scaleAnswerMapper.deleteScaleAnswerByQuestionId(update.getQuestionId());
|
scaleAnswerMapper.deleteScaleAnswerByQuestionId(update.getQuestionId());
|
||||||
|
@ -173,6 +186,11 @@ public class SysScaleQuestionServiceImpl implements ISysScaleQuestionService {
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteByBo(SysScaleQuestionBo bo) {
|
public Boolean deleteByBo(SysScaleQuestionBo bo) {
|
||||||
|
Long scaleId = bo.getScaleId();
|
||||||
|
int i = publishMapper.selectCountScalePublishByScaleId(scaleId);
|
||||||
|
if (i > 0) {
|
||||||
|
throw new ServiceException("此量表已有发布,无法删除问题");
|
||||||
|
}
|
||||||
Long questionId = bo.getQuestionId();
|
Long questionId = bo.getQuestionId();
|
||||||
int flag = baseMapper.deleteById(questionId);
|
int flag = baseMapper.deleteById(questionId);
|
||||||
scaleAnswerMapper.deleteScaleAnswerByQuestionId(questionId);
|
scaleAnswerMapper.deleteScaleAnswerByQuestionId(questionId);
|
||||||
|
|
|
@ -4,6 +4,7 @@ package org.dromara.scale.service.impl;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.domain.model.LoginUser;
|
import org.dromara.common.core.domain.model.LoginUser;
|
||||||
import org.dromara.common.core.enums.UserType;
|
import org.dromara.common.core.enums.UserType;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
|
@ -41,6 +42,7 @@ import static org.dromara.common.satoken.utils.LoginHelper.getLoginUser;
|
||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
* @date 2024/4/15 9:18
|
* @date 2024/4/15 9:18
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
public class WebServiceImpl implements IWebService {
|
public class WebServiceImpl implements IWebService {
|
||||||
|
@ -296,26 +298,24 @@ public class WebServiceImpl implements IWebService {
|
||||||
evalConclusion.setSituationName(SituationEnum.getNameByCode(range.getSituation()));
|
evalConclusion.setSituationName(SituationEnum.getNameByCode(range.getSituation()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} //else {
|
}
|
||||||
// logger.error("量表scaleId = {},配置项={} 配置的范围超过1条,但是存在配置范围最大最小值都为null",
|
|
||||||
// evalSubmitAnswerDto.getScaleId(), scaleEvalItem.getId());
|
|
||||||
// throw new EdfRuntimeException("量表配置项有问题,请联系管理员检查!");
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//假如未对应上说明这个量表配置有问题联系管理员
|
||||||
|
if(Objects.isNull(evalConclusion.getFactorRangeId())){
|
||||||
|
throw new ServiceException("量表配置项有问题,请联系管理员检查!");
|
||||||
|
}
|
||||||
if (used.contains(evalConclusion.getSituation())) {
|
if (used.contains(evalConclusion.getSituation())) {
|
||||||
evalConclusion.setWarnStatus(1);
|
evalConclusion.setWarnStatus(1);
|
||||||
}else {
|
} else {
|
||||||
evalConclusion.setWarnStatus(0);
|
evalConclusion.setWarnStatus(0);
|
||||||
}
|
}
|
||||||
list.add(evalConclusion);
|
list.add(evalConclusion);
|
||||||
}
|
}
|
||||||
//处理维度问题及status
|
//处理维度问题及status
|
||||||
//量表
|
|
||||||
SysScale scaleInfo = scaleMapper.selectById(scaleId);
|
SysScale scaleInfo = scaleMapper.selectById(scaleId);
|
||||||
scaleDimension(list, scaleInfo);
|
scaleDimension(list, scaleInfo);
|
||||||
//保存结果
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
package org.dromara.scale.utils;
|
package org.dromara.scale.utils;
|
||||||
|
|
||||||
import com.aspose.words.Document;
|
import com.aspose.words.Document;
|
||||||
import com.aspose.words.License;
|
|
||||||
import com.aspose.words.SaveFormat;
|
import com.aspose.words.SaveFormat;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>TODO<p>
|
* <p>TODO<p>
|
||||||
|
@ -17,16 +15,6 @@ import java.io.InputStream;
|
||||||
* @date 2024/5/20 15:03
|
* @date 2024/5/20 15:03
|
||||||
*/
|
*/
|
||||||
public class AsposeUtil {
|
public class AsposeUtil {
|
||||||
/**
|
|
||||||
* 加载license 用于破解 不生成水印
|
|
||||||
*/
|
|
||||||
@SneakyThrows
|
|
||||||
private static void getLicense() {
|
|
||||||
try (InputStream is = AsposeUtil.class.getClassLoader().getResourceAsStream("License.xml")) {
|
|
||||||
License license = new License();
|
|
||||||
license.setLicense(is);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* word转pdf
|
* word转pdf
|
||||||
|
@ -36,7 +24,6 @@ public class AsposeUtil {
|
||||||
*/
|
*/
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public static void wordToPdf(String wordPath, File pdfFile) {
|
public static void wordToPdf(String wordPath, File pdfFile) {
|
||||||
getLicense();
|
|
||||||
try (FileOutputStream os = new FileOutputStream(pdfFile)) {
|
try (FileOutputStream os = new FileOutputStream(pdfFile)) {
|
||||||
Document doc = new Document(wordPath);
|
Document doc = new Document(wordPath);
|
||||||
doc.save(os, SaveFormat.PDF);
|
doc.save(os, SaveFormat.PDF);
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
<License>
|
|
||||||
<Data>
|
|
||||||
<Products>
|
|
||||||
<Product>Aspose.Total for Java</Product>
|
|
||||||
<Product>Aspose.Words for Java</Product>
|
|
||||||
</Products>
|
|
||||||
<EditionType>Enterprise</EditionType>
|
|
||||||
<SubscriptionExpiry>20991231</SubscriptionExpiry>
|
|
||||||
<LicenseExpiry>20991231</LicenseExpiry>
|
|
||||||
<SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>
|
|
||||||
</Data>
|
|
||||||
<Signature>
|
|
||||||
sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=
|
|
||||||
</Signature>
|
|
||||||
</License>
|
|
|
@ -38,18 +38,16 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectStatisticFactor" resultType="org.dromara.scale.domain.vo.StatisticFactorVo">
|
<select id="selectStatisticFactor" resultType="org.dromara.scale.domain.vo.StatisticFactorVo">
|
||||||
select sf.factor_name as `factorName`,
|
select IFNULL(sf.factor_name, 'absent') as `factorName`,
|
||||||
d.dept_name,
|
d.dept_name as `deptName`,
|
||||||
parent.dept_name as `parentName`
|
parent.dept_name as `parentName`
|
||||||
from sys_evaluation_record er
|
from sys_dept parent
|
||||||
left join sys_dept d on d.dept_id = er.dept_id
|
left join sys_dept d on d.parent_id = parent.dept_id
|
||||||
left join sys_dept parent on parent.dept_id = d.parent_id
|
left join sys_evaluation_record er on er.dept_id = d.dept_id
|
||||||
left join sys_evaluation_conclusion ec on ec.record_id = er.record_id
|
left join sys_evaluation_conclusion ec on ec.record_id = er.record_id and ec.warn_status = 1
|
||||||
left join sys_scale_factor sf on sf.factor_id = ec.factor_id
|
left join sys_scale_factor sf on sf.factor_id = ec.factor_id
|
||||||
where er.batch_no = #{batchNo}
|
where er.scale_id = #{scaleId}
|
||||||
and er.scale_id = #{scaleId}
|
and er.batch_no = #{batchNo}
|
||||||
and er.status = 1
|
|
||||||
and ec.status = 1
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectStatisticWarn4All" resultType="org.dromara.scale.domain.vo.StatisticWarnVo">
|
<select id="selectStatisticWarn4All" resultType="org.dromara.scale.domain.vo.StatisticWarnVo">
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
left join sys_user u on u.user_id = er.user_id
|
left join sys_user u on u.user_id = er.user_id
|
||||||
where er.batch_no = #{batchNo}
|
where er.batch_no = #{batchNo}
|
||||||
<if test="deptId != null">
|
<if test="deptId != null">
|
||||||
and (FIND_IN_SET(#{deptId}, d.ancestors) OR d.dept_id = #{deptId})
|
and (FIND_IN_SET(#{deptId}, d.ancestors) OR d.dept_id = #{deptId})
|
||||||
</if>
|
</if>
|
||||||
<if test="scaleId != null">
|
<if test="scaleId != null">
|
||||||
and er.scale_id = #{scaleId}
|
and er.scale_id = #{scaleId}
|
||||||
|
@ -50,9 +50,15 @@
|
||||||
from sys_evaluation_record er
|
from sys_evaluation_record er
|
||||||
left join sys_scale s on s.scale_id = er.scale_id
|
left join sys_scale s on s.scale_id = er.scale_id
|
||||||
left join sys_dept d on d.dept_id = er.dept_id
|
left join sys_dept d on d.dept_id = er.dept_id
|
||||||
left join sys_user u on u.dept_id = d.dept_id
|
left join sys_user u on u.user_id = er.user_id
|
||||||
where er.batch_no = #{batchNo}
|
where er.batch_no = #{batchNo}
|
||||||
and er.status = 0
|
<if test="deptId != null">
|
||||||
|
and (FIND_IN_SET(#{deptId}, d.ancestors) OR d.dept_id = #{deptId})
|
||||||
|
</if>
|
||||||
|
<if test="scaleId != null">
|
||||||
|
and er.scale_id = #{scaleId}
|
||||||
|
</if>
|
||||||
|
and er.status <= 0
|
||||||
order by d.dept_id
|
order by d.dept_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -93,9 +99,15 @@
|
||||||
from sys_scale_publish
|
from sys_scale_publish
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="addCompleteNum" >
|
<select id="addCompleteNum">
|
||||||
update sys_scale_publish
|
update sys_scale_publish
|
||||||
set complete_num = complete_num + 1
|
set complete_num = complete_num + 1
|
||||||
where batch_no = #{batchNo}
|
where batch_no = #{batchNo}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCountScalePublishByScaleId" resultType="int">
|
||||||
|
select count(*)
|
||||||
|
from sys_scale_publish
|
||||||
|
where find_in_set(#{scaleId}, scale_ids)
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Binary file not shown.
|
@ -49,4 +49,6 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept, SysDeptVo> {
|
||||||
|
|
||||||
List<SysDeptVo> findDeptByIds(String deptIds);
|
List<SysDeptVo> findDeptByIds(String deptIds);
|
||||||
|
|
||||||
|
List<String> findDeptNameByUserIds(String userIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,4 +35,12 @@
|
||||||
FROM sys_dept d
|
FROM sys_dept d
|
||||||
WHERE FIND_IN_SET(d.dept_id, #{deptIds})
|
WHERE FIND_IN_SET(d.dept_id, #{deptIds})
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="findDeptNameByUserIds" resultType="java.lang.String">
|
||||||
|
select d.dept_name
|
||||||
|
from sys_user u
|
||||||
|
left join sys_dept d on d.dept_id = u.dept_id
|
||||||
|
where find_in_set(user_id, #{userIds})
|
||||||
|
group by d.dept_id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue