This commit is contained in:
parent
ac70d1f8b7
commit
68bd613af6
|
@ -52,17 +52,22 @@ public class ActivityVo implements Serializable {
|
|||
private Long coverUrl;
|
||||
|
||||
/**
|
||||
* 浏览量
|
||||
* 浏览数量
|
||||
*/
|
||||
@ExcelProperty(value = "浏览量")
|
||||
@ExcelProperty(value = "浏览数量")
|
||||
private Long viewNums;
|
||||
|
||||
/**
|
||||
* 参与量
|
||||
* 报名数量
|
||||
*/
|
||||
@ExcelProperty(value = "参与量")
|
||||
@ExcelProperty(value = "报名数量")
|
||||
private Long enterNums;
|
||||
|
||||
/**
|
||||
* 参加数量
|
||||
*/
|
||||
private Long joinNums;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package org.dromara.scale.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.scale.domain.ActivityEnter;
|
||||
import org.dromara.scale.domain.vo.ActivityEnterVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
|
||||
/**
|
||||
* 活动报名Mapper接口
|
||||
|
@ -10,6 +12,7 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|||
* @author cjw
|
||||
* @date 2024-08-19
|
||||
*/
|
||||
@Mapper
|
||||
public interface ActivityEnterMapper extends BaseMapperPlus<ActivityEnter, ActivityEnterVo> {
|
||||
|
||||
int updateActivityEnterNum(Long activityId);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.scale.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.dromara.scale.domain.Activity;
|
||||
import org.dromara.scale.domain.vo.ActivityVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
@ -10,6 +11,7 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|||
* @author cjw
|
||||
* @date 2024-08-19
|
||||
*/
|
||||
@Mapper
|
||||
public interface ActivityMapper extends BaseMapperPlus<Activity, ActivityVo> {
|
||||
int addViewNum(Long id);
|
||||
}
|
||||
|
|
|
@ -46,4 +46,6 @@ public interface SysEvaluationRecordMapper extends BaseMapperPlus<SysEvaluationR
|
|||
|
||||
List<String> selectEvaluationScaleList(@Param("userId") Long userId);
|
||||
|
||||
int selectCountRecordByScaleId(Long scaleId);
|
||||
|
||||
}
|
||||
|
|
|
@ -40,6 +40,4 @@ public interface SysScalePublishMapper extends BaseMapperPlus<SysScalePublish, S
|
|||
|
||||
void addCompleteNum(Long batchNo);
|
||||
|
||||
int selectCountScalePublishByScaleId(Long scaleId);
|
||||
|
||||
}
|
||||
|
|
|
@ -49,8 +49,12 @@ public class ActivityServiceImpl implements IActivityService {
|
|||
Long l = enterMapper.selectCount(new LambdaQueryWrapper<ActivityEnter>()
|
||||
.eq(ActivityEnter::getActivityId, id)
|
||||
.eq(ActivityEnter::getCreateBy, userId));
|
||||
Long join = enterMapper.selectCount(new LambdaQueryWrapper<ActivityEnter>()
|
||||
.eq(ActivityEnter::getActivityId, id)
|
||||
.eq(ActivityEnter::getStatus, 1));
|
||||
ActivityVo activityVo = baseMapper.selectVoById(id);
|
||||
activityVo.setJoinFlag(l.intValue());
|
||||
activityVo.setJoinNums(join);
|
||||
return activityVo;
|
||||
}
|
||||
|
||||
|
|
|
@ -225,6 +225,9 @@ public class EvaluationServiceImpl implements IEvaluationService {
|
|||
warnRecordService.insertByBo(wre);
|
||||
}
|
||||
} else {
|
||||
Integer freeFlag = sysScale.getFreeFlag();
|
||||
//不是免费的
|
||||
if(StatusEnum.DISABLED.getValue().equals(freeFlag)) {
|
||||
//个人要更新订单状态
|
||||
SysScaleOrder scaleOrder = orderMapper.selectOne(new LambdaQueryWrapper<SysScaleOrder>().eq(SysScaleOrder::getRecordId, recordId));
|
||||
SysScaleOrder order = new SysScaleOrder();
|
||||
|
@ -234,6 +237,7 @@ public class EvaluationServiceImpl implements IEvaluationService {
|
|||
order.setUpdateBy(scaleOrder.getCreateBy());
|
||||
orderMapper.updateById(order);
|
||||
}
|
||||
}
|
||||
//不允许查看考核结果
|
||||
if (!allowQueryResult) {
|
||||
return null;
|
||||
|
|
|
@ -14,6 +14,7 @@ import lombok.RequiredArgsConstructor;
|
|||
import org.apache.poi.xwpf.usermodel.XWPFTable;
|
||||
import org.dromara.common.core.service.DeptService;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.scale.domain.SysEvaluationRecord;
|
||||
|
@ -122,7 +123,11 @@ public class SysEvaluationRecordServiceImpl implements ISysEvaluationRecordServi
|
|||
EvaluationRecordWordData wordData = new EvaluationRecordWordData();
|
||||
|
||||
String name = configService.selectConfigByKey("sys.school.name");
|
||||
if (StringUtils.isEmpty(name)) {
|
||||
wordData.setSchoolName(name);
|
||||
} else {
|
||||
wordData.setSchoolName("无");
|
||||
}
|
||||
|
||||
SysEvaluationRecord sysEvaluationRecord = baseMapper.selectById(recordId);
|
||||
Date createTime = sysEvaluationRecord.getCreateTime();
|
||||
|
@ -227,11 +232,11 @@ public class SysEvaluationRecordServiceImpl implements ISysEvaluationRecordServi
|
|||
wordData.setRadar(radar);
|
||||
}
|
||||
wordData.setPropose(stringBuilder.toString());
|
||||
File path = null;
|
||||
File path;
|
||||
if (mbtiFlag) {
|
||||
path = new File("/usr/local/mental/word/MBTITemplate.docx");
|
||||
path = new File("/usr/local/tenant/word/MBTITemplate.docx");
|
||||
} else {
|
||||
path = new File("/usr/local/mental/word/personalTemplate.docx");
|
||||
path = new File("/usr/local/tenant/word/personalTemplate.docx");
|
||||
}
|
||||
File docx = FileUtil.createTempFile(".docx", true);
|
||||
String wordPath = docx.getPath();
|
||||
|
|
|
@ -133,7 +133,6 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
|||
Date date = new Date();
|
||||
LoginUser loginUser = getLoginUser();
|
||||
SysScalePublish add = MapstructUtils.convert(bo, SysScalePublish.class);
|
||||
//add.setStatus(StatusEnum.IN_USE.getValue());
|
||||
//预约开关
|
||||
Integer status = add.getStatus();
|
||||
//如果预约了,则默认中止
|
||||
|
@ -346,7 +345,6 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
|||
int personTotal = maleNum + femaleNum;
|
||||
wordData.setPersonNum(String.valueOf(personTotal));
|
||||
int malePercent = processHalfUpPercent(maleNum, personTotal);
|
||||
// int femalePercent = processHalfUpPercent(femaleNum, personTotal);
|
||||
int femalePercent = 100 - malePercent;
|
||||
wordData.setMaleNum(String.valueOf(maleNum));
|
||||
wordData.setMalePercent(malePercent + "%");
|
||||
|
@ -359,7 +357,6 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
|||
int undoneNum = recordMapper.selectUndoneNumByBatchNo(batchNo);
|
||||
int recordNum = completeNum + undoneNum;
|
||||
int completePercent = processHalfUpPercent(completeNum, recordNum);
|
||||
// int undonePercent = processHalfUpPercent(undoneNum, recordNum);
|
||||
int undonePercent = 100 - completePercent;
|
||||
|
||||
wordData.setCompleteNum(String.valueOf(completeNum));
|
||||
|
@ -373,7 +370,6 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
|||
int warnNum = recordMapper.selectWarnNumByBatchNo(batchNo);
|
||||
int warnPercent = processHalfUpPercent(warnNum, completeNum);
|
||||
int normalNum = completeNum - warnNum;
|
||||
// int normalPercent = processHalfUpPercent(normalNum, completeNum);
|
||||
int normalPercent = 100 - warnPercent;
|
||||
wordData.setRecordNum(String.valueOf(completeNum));
|
||||
wordData.setWarnNum(String.valueOf(warnNum));
|
||||
|
@ -449,7 +445,7 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
|||
wordWarnList.add(wordWarn);
|
||||
}
|
||||
wordData.setWarnCharts(wordWarnList);
|
||||
File path = new File("/usr/local/mental/word/groupTemplate.docx");
|
||||
File path = new File("/usr/local/tenant/word/groupTemplate.docx");
|
||||
File docx = FileUtil.createTempFile(".docx", true);
|
||||
String wordPath = docx.getPath();
|
||||
try (FileInputStream fileInputStream = new FileInputStream(path)) {
|
||||
|
|
|
@ -18,10 +18,7 @@ import org.dromara.scale.domain.bo.SysScaleQuestionBo;
|
|||
import org.dromara.scale.domain.vo.SysScaleAnswerVo;
|
||||
import org.dromara.scale.domain.vo.SysScaleFactorVo;
|
||||
import org.dromara.scale.domain.vo.SysScaleQuestionVo;
|
||||
import org.dromara.scale.mapper.SysScaleAnswerMapper;
|
||||
import org.dromara.scale.mapper.SysScaleMapper;
|
||||
import org.dromara.scale.mapper.SysScalePublishMapper;
|
||||
import org.dromara.scale.mapper.SysScaleQuestionMapper;
|
||||
import org.dromara.scale.mapper.*;
|
||||
import org.dromara.scale.service.ISysScaleQuestionService;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Caching;
|
||||
|
@ -47,7 +44,7 @@ public class SysScaleQuestionServiceImpl implements ISysScaleQuestionService {
|
|||
|
||||
private final SysScaleMapper scaleMapper;
|
||||
|
||||
private final SysScalePublishMapper publishMapper;
|
||||
private final SysEvaluationRecordMapper recordMapper;
|
||||
|
||||
/**
|
||||
* 查询量问题内容
|
||||
|
@ -115,9 +112,9 @@ public class SysScaleQuestionServiceImpl implements ISysScaleQuestionService {
|
|||
@Override
|
||||
public Boolean insertByBo(SysScaleQuestionBo bo) {
|
||||
Long scaleId = bo.getScaleId();
|
||||
int i = publishMapper.selectCountScalePublishByScaleId(scaleId);
|
||||
int i = recordMapper.selectCountRecordByScaleId(scaleId);
|
||||
if (i > 0) {
|
||||
throw new ServiceException("此量表已有发布,无法新增问题");
|
||||
throw new ServiceException("此量表已有答题记录,无法新增问题");
|
||||
}
|
||||
SysScaleQuestion add = MapstructUtils.convert(bo, SysScaleQuestion.class);
|
||||
//validEntityBeforeSave(add);
|
||||
|
@ -157,9 +154,9 @@ public class SysScaleQuestionServiceImpl implements ISysScaleQuestionService {
|
|||
@Override
|
||||
public Boolean updateByBo(SysScaleQuestionBo bo) {
|
||||
Long scaleId = bo.getScaleId();
|
||||
int i = publishMapper.selectCountScalePublishByScaleId(scaleId);
|
||||
int i = recordMapper.selectCountRecordByScaleId(scaleId);
|
||||
if (i > 0) {
|
||||
throw new ServiceException("此量表已有发布,无法修改问题");
|
||||
throw new ServiceException("此量表已有答题记录,无法修改问题");
|
||||
}
|
||||
SysScaleQuestion update = MapstructUtils.convert(bo, SysScaleQuestion.class);
|
||||
//validEntityBeforeSave(update);
|
||||
|
@ -188,9 +185,9 @@ public class SysScaleQuestionServiceImpl implements ISysScaleQuestionService {
|
|||
@Override
|
||||
public Boolean deleteByBo(SysScaleQuestionBo bo) {
|
||||
Long scaleId = bo.getScaleId();
|
||||
int i = publishMapper.selectCountScalePublishByScaleId(scaleId);
|
||||
int i = recordMapper.selectCountRecordByScaleId(scaleId);
|
||||
if (i > 0) {
|
||||
throw new ServiceException("此量表已有发布,无法删除问题");
|
||||
throw new ServiceException("此量表已有答题记录,无法删除问题");
|
||||
}
|
||||
Long questionId = bo.getQuestionId();
|
||||
int flag = baseMapper.deleteById(questionId);
|
||||
|
|
|
@ -108,4 +108,10 @@
|
|||
where user_id = #{userId}
|
||||
group by scale_id
|
||||
</select>
|
||||
|
||||
<select id="selectCountRecordByScaleId" resultType="int">
|
||||
select count(*)
|
||||
from sys_evaluation_record
|
||||
where scale_id = #{scaleId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -105,9 +105,4 @@
|
|||
where batch_no = #{batchNo}
|
||||
</select>
|
||||
|
||||
<select id="selectCountScalePublishByScaleId" resultType="int">
|
||||
select count(*)
|
||||
from sys_scale_publish
|
||||
where find_in_set(#{scaleId}, scale_ids)
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue