This commit is contained in:
Vinjor 2025-02-19 15:28:25 +08:00
parent 59811ea203
commit 2d7ffce71a
5 changed files with 30 additions and 6 deletions

View File

@ -19,6 +19,7 @@ import cn.iocoder.yudao.module.train.entity.Train;
import cn.iocoder.yudao.module.train.mapper.TrainMapper; import cn.iocoder.yudao.module.train.mapper.TrainMapper;
import cn.iocoder.yudao.module.train.service.TrainService; import cn.iocoder.yudao.module.train.service.TrainService;
import cn.iocoder.yudao.module.train.vo.TrainVO; import cn.iocoder.yudao.module.train.vo.TrainVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -97,12 +98,17 @@ public class DataViewServiceImpl implements DataViewService {
@Override @Override
public IndexDataVO selectIndexInfo(String type, String timeType, Long coachId, String startTime, String endTime) { public IndexDataVO selectIndexInfo(String type, String timeType, Long coachId, String startTime, String endTime) {
IndexDataVO rtnObj = new IndexDataVO(); IndexDataVO rtnObj = new IndexDataVO();
DecimalFormat df = new DecimalFormat("#.00");
//默认查全部数据 //默认查全部数据
String startTimeStr = ""; String startTimeStr = "";
String endTimeStr = ""; String endTimeStr = "";
if("more".equals(timeType)){ if("more".equals(timeType)){
if(StringUtils.isNotEmpty(startTime)){
startTimeStr = startTime+" 00:00:01"; startTimeStr = startTime+" 00:00:01";
}
if(StringUtils.isNotEmpty(endTime)) {
endTimeStr = endTime + " 23:59:59"; endTimeStr = endTime + " 23:59:59";
}
}else if("month".equals(timeType)){ }else if("month".equals(timeType)){
//当月 //当月
startTimeStr = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()),"yyyy-MM-dd")+" 00:00:01"; startTimeStr = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()),"yyyy-MM-dd")+" 00:00:01";
@ -132,10 +138,23 @@ public class DataViewServiceImpl implements DataViewService {
schoolAmount = schoolAmount+item.getPriceAmount(); schoolAmount = schoolAmount+item.getPriceAmount();
} }
} }
int allNum = coachNum+schoolNum;
double coachRate=0;
double schoolRate=0;
if(allNum>0){
if(coachNum>0){
coachRate = coachNum / allNum;
}
if(schoolNum>0){
schoolRate = schoolNum / allNum;
}
}
studentInfoMap.put("coachNum",coachNum); studentInfoMap.put("coachNum",coachNum);
studentInfoMap.put("coachAmount",coachAmount); studentInfoMap.put("coachAmount",coachAmount);
studentInfoMap.put("coachRate",0!=coachRate?(Double.parseDouble(df.format(coachRate))*100):0);
studentInfoMap.put("schoolNum",schoolNum); studentInfoMap.put("schoolNum",schoolNum);
studentInfoMap.put("schoolAmount",schoolAmount); studentInfoMap.put("schoolAmount",schoolAmount);
studentInfoMap.put("schoolRate",0!=schoolRate?(Double.parseDouble(df.format(schoolRate))*100):0);
rtnObj.setStudentInfo(studentInfoMap); rtnObj.setStudentInfo(studentInfoMap);
/*4.财务情况--TODO*/ /*4.财务情况--TODO*/
Map<String,Object> moneyInfoMap = new HashMap<>(); Map<String,Object> moneyInfoMap = new HashMap<>();
@ -217,7 +236,6 @@ public class DataViewServiceImpl implements DataViewService {
if(0!=subject3Num && 0!=subject3PassNum){ if(0!=subject3Num && 0!=subject3PassNum){
subject3Rate = subject3PassNum / subject3Num; subject3Rate = subject3PassNum / subject3Num;
} }
DecimalFormat df = new DecimalFormat("#.00");
Map<String,Object> examInfoMap = new HashMap<>(); Map<String,Object> examInfoMap = new HashMap<>();
examInfoMap.put("subject2All",subject2Num); examInfoMap.put("subject2All",subject2Num);
examInfoMap.put("subject2Pass",subject2PassNum); examInfoMap.put("subject2Pass",subject2PassNum);

View File

@ -20,6 +20,9 @@ public class NotifyMessageMyPageReqVO extends PageParam {
@Schema(description = "是否已读", example = "true") @Schema(description = "是否已读", example = "true")
private Boolean readStatus; private Boolean readStatus;
@Schema(description = "系统标识", example = "true")
private String systemCode;
@Schema(description = "创建时间") @Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;

View File

@ -80,5 +80,4 @@ public class ApiNotifyMessageController {
public CommonResult<Long> getUnreadNotifyMessageCount() { public CommonResult<Long> getUnreadNotifyMessageCount() {
return success(notifyMessageService.getWXUnreadNotifyMessageCount(getLoginUserId())); return success(notifyMessageService.getWXUnreadNotifyMessageCount(getLoginUserId()));
} }
} }

View File

@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.system.dal.dataobject.notify;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO;
import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
@ -11,7 +10,6 @@ import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.*; import lombok.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
import java.util.Map; import java.util.Map;
/** /**
@ -97,5 +95,9 @@ public class NotifyMessageDO extends BaseDO {
* 阅读时间 * 阅读时间
*/ */
private LocalDateTime readTime; private LocalDateTime readTime;
/**
* 系统标识
*/
private String systemCode;
} }

View File

@ -29,6 +29,7 @@ public interface NotifyMessageMapper extends BaseMapperX<NotifyMessageDO> {
default PageResult<NotifyMessageDO> selectPage(NotifyMessageMyPageReqVO reqVO, Long userId, Integer userType) { default PageResult<NotifyMessageDO> selectPage(NotifyMessageMyPageReqVO reqVO, Long userId, Integer userType) {
return selectPage(reqVO, new LambdaQueryWrapperX<NotifyMessageDO>() return selectPage(reqVO, new LambdaQueryWrapperX<NotifyMessageDO>()
.eqIfPresent(NotifyMessageDO::getReadStatus, reqVO.getReadStatus()) .eqIfPresent(NotifyMessageDO::getReadStatus, reqVO.getReadStatus())
.eqIfPresent(NotifyMessageDO::getSystemCode, reqVO.getSystemCode())
.betweenIfPresent(NotifyMessageDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(NotifyMessageDO::getCreateTime, reqVO.getCreateTime())
.eq(NotifyMessageDO::getUserId, userId) .eq(NotifyMessageDO::getUserId, userId)
.eq(NotifyMessageDO::getUserType, userType) .eq(NotifyMessageDO::getUserType, userType)
@ -38,6 +39,7 @@ public interface NotifyMessageMapper extends BaseMapperX<NotifyMessageDO> {
default PageResult<NotifyMessageDO> selectWxPage(NotifyMessageMyPageReqVO reqVO, Long userId) { default PageResult<NotifyMessageDO> selectWxPage(NotifyMessageMyPageReqVO reqVO, Long userId) {
return selectPage(reqVO, new LambdaQueryWrapperX<NotifyMessageDO>() return selectPage(reqVO, new LambdaQueryWrapperX<NotifyMessageDO>()
.eqIfPresent(NotifyMessageDO::getReadStatus, reqVO.getReadStatus()) .eqIfPresent(NotifyMessageDO::getReadStatus, reqVO.getReadStatus())
.eqIfPresent(NotifyMessageDO::getSystemCode, reqVO.getSystemCode())
.betweenIfPresent(NotifyMessageDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(NotifyMessageDO::getCreateTime, reqVO.getCreateTime())
.eq(NotifyMessageDO::getUserId, userId) .eq(NotifyMessageDO::getUserId, userId)
.eq(NotifyMessageDO::getUserType, 1) .eq(NotifyMessageDO::getUserType, 1)