2023年7月26日 修改接口,
This commit is contained in:
parent
261edbd999
commit
3c778ecede
|
@ -1,6 +1,8 @@
|
|||
package org.jeecg.modules.kc.grab.SynchronizationService;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.jeecg.modules.kc.grab.SynchronizationService.base.BaseSync;
|
||||
|
@ -46,7 +48,11 @@ public class SyncTJwTkkcb extends BaseSync {
|
|||
List<Xxhbtkkcb> outDataList = Lists.newArrayList();
|
||||
|
||||
//清洗数据
|
||||
inDataList.forEach(x -> outDataList.add(BeanUtil.toBean(x, Xxhbtkkcb.class)));
|
||||
inDataList.forEach(x -> {
|
||||
Xxhbtkkcb outData = BeanUtil.toBean(x, Xxhbtkkcb.class);
|
||||
outData.setTimestamps(DateUtil.format(x.getTimestamps(), DatePattern.NORM_DATETIME_PATTERN));
|
||||
outDataList.add(BeanUtil.toBean(x, Xxhbtkkcb.class));
|
||||
});
|
||||
|
||||
//保存到胃
|
||||
int syncnum=0;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package org.jeecg.modules.kc.ktgl.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -19,10 +19,6 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.jeecg.common.api.CommonAPI;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.system.vo.SysUserCacheInfo;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.kc.grab.SynchronizationService.tools.ChangeTingKeTongJi;
|
||||
import org.jeecg.modules.kc.kcXqxnHistory.entity.KcXqxnHistory;
|
||||
import org.jeecg.modules.kc.ktgl.entity.KcKetangbiao;
|
||||
|
@ -33,25 +29,18 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.modules.kc.qa.entity.KcEvaluationstudent;
|
||||
import org.jeecg.modules.kc.qa.service.IKcEvaluationstudentService;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Description: 课堂管理-子表
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-04-01
|
||||
|
@ -68,6 +57,9 @@ public class KcKetangbiaoController extends JeecgController<KcKetangbiao, IKcKet
|
|||
@Autowired
|
||||
private ChangeTingKeTongJi changeTingKeTongJi;
|
||||
|
||||
@Autowired
|
||||
private IKcEvaluationstudentService kcEvaluationstudentService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private CommonAPI commonApi;
|
||||
|
@ -151,14 +143,56 @@ public class KcKetangbiaoController extends JeecgController<KcKetangbiao, IKcKet
|
|||
Set<String> idSet = Sets.newHashSet();
|
||||
IPage<KcKetangbiao> pageList = kcKetangbiaoService.fundAllPjjgList(page, queryWrapper);
|
||||
pageList.getRecords().forEach(x -> idSet.add(x.getId()));
|
||||
//查询平均分
|
||||
|
||||
//查询教师平均分
|
||||
//查询教师平均分,查完了
|
||||
|
||||
|
||||
//查询学生平均分
|
||||
QueryWrapper<KcEvaluationstudent> qw = new QueryWrapper<>();
|
||||
qw.in("ketangbiaoid",idSet);
|
||||
List<KcEvaluationstudent> evaluationstudentList = kcEvaluationstudentService.list(qw);
|
||||
|
||||
Map<String, List<KcEvaluationstudent>> evaluationstudentListMap = evaluationstudentList.stream().collect(Collectors.groupingBy(KcEvaluationstudent::getKetangbiaoid));
|
||||
|
||||
Map<String, Integer> evaluationstudentAllDivideMap = Maps.newHashMap();
|
||||
|
||||
evaluationstudentListMap.forEach((k,v) -> {
|
||||
String allNumKey = "allNum-" + k;
|
||||
String numKey = "num-" + k;
|
||||
evaluationstudentAllDivideMap.put(allNumKey, v.size());//数量
|
||||
AtomicReference<Integer> sum = new AtomicReference<>(0);
|
||||
v.forEach(x -> sum.updateAndGet(v1 -> v1 + x.getStars()));
|
||||
evaluationstudentAllDivideMap.put(numKey,sum.get());//总分
|
||||
// if(evaluationstudentAllDivideMap.containsKey(allNumKey)){
|
||||
// Integer allNum = evaluationstudentAllDivideMap.get(allNumKey);
|
||||
// allNum += 1;
|
||||
// evaluationstudentAllDivideMap.put(allNumKey,allNum);
|
||||
// }else{
|
||||
// evaluationstudentAllDivideMap.put(allNumKey,1);
|
||||
// }
|
||||
// if(evaluationstudentAllDivideMap.containsKey(numKey)){
|
||||
// Integer num = evaluationstudentAllDivideMap.get(numKey);
|
||||
// num += v.
|
||||
// }
|
||||
});
|
||||
//再计算平均数扔给主list
|
||||
|
||||
pageList.getRecords().forEach(x -> {
|
||||
x.setXspjPjf("0");
|
||||
|
||||
String allNumKey = "allNum-" + x.getId();
|
||||
String numKey = "num-" + x.getId();
|
||||
Integer allNUm = null;
|
||||
Integer num = null;
|
||||
if(evaluationstudentAllDivideMap.containsKey(allNumKey)){
|
||||
allNUm = evaluationstudentAllDivideMap.get(allNumKey);
|
||||
}
|
||||
if(evaluationstudentAllDivideMap.containsKey(numKey)){
|
||||
num = evaluationstudentAllDivideMap.get(numKey);
|
||||
}
|
||||
if(allNUm != null && num != null && num != 0){
|
||||
x.setXspjPjf(String.valueOf(num / allNUm));
|
||||
}
|
||||
});
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
|
|
@ -291,4 +291,10 @@ public class KcKetangbiao implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private boolean searchByNowXqxn;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String jspjPjf;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String xspjPjf;
|
||||
|
||||
}
|
||||
|
|
|
@ -51,5 +51,5 @@ public interface KcKetangbiaoMapper extends BaseMapper<KcKetangbiao> {
|
|||
|
||||
List<KcKetangbiao> getKtbjList(KcKetangbiao kcKetangbiao);
|
||||
|
||||
IPage<KcKetangbiao> fundAllPjjgList(Page<KcKetangbiao> page, @Param(Constants.ENTITY) QueryWrapper<KcKetangbiao> queryWrapper);
|
||||
IPage<KcKetangbiao> fundAllPjjgList(Page<KcKetangbiao> page, @Param(Constants.WRAPPER) QueryWrapper<KcKetangbiao> queryWrapper);
|
||||
}
|
||||
|
|
|
@ -548,9 +548,10 @@
|
|||
<select id="fundAllPjjgList" resultType="org.jeecg.modules.kc.ktgl.entity.KcKetangbiao">
|
||||
SELECT
|
||||
a.*,
|
||||
fen.avgscore
|
||||
from kc_ketangbiao a
|
||||
left join zongtipingjiapingjunfen fen on fen.kechengbiaoid = a.id
|
||||
fen.avgscore as jspjPjf
|
||||
from
|
||||
kc_ketangbiao a
|
||||
left join zongtipingjiapingjunfen fen on fen.kechengbiaoid = a.kechengbiaoid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
|
|
@ -56,7 +56,29 @@ public class KcEvaluationstudentController extends JeecgController<KcEvaluations
|
|||
IPage<KcEvaluationstudent> pageList = kcEvaluationstudentService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param kcEvaluationstudent
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "kc_evaluationstudent-分页列表查询")
|
||||
@ApiOperation(value="kc_evaluationstudent-分页列表查询", notes="kc_evaluationstudent-分页列表查询")
|
||||
@GetMapping(value = "/queryAllList")
|
||||
public Result<IPage<KcEvaluationstudent>> queryAllList(KcEvaluationstudent kcEvaluationstudent,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<KcEvaluationstudent> queryWrapper = QueryGenerator.initQueryWrapper(kcEvaluationstudent, req.getParameterMap());
|
||||
Page<KcEvaluationstudent> page = new Page<KcEvaluationstudent>(pageNo, pageSize);
|
||||
IPage<KcEvaluationstudent> pageList = kcEvaluationstudentService.queryAllList(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.modules.kc.qa.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
@ -58,4 +59,8 @@ public class KcEvaluationstudent implements Serializable {
|
|||
@Excel(name = "星级", width = 15)
|
||||
@ApiModelProperty(value = "星级")
|
||||
private java.lang.Integer stars;
|
||||
|
||||
//课程名称
|
||||
@TableField(exist = false)
|
||||
private String kcmc;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package org.jeecg.modules.kc.qa.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.kc.qa.entity.KcEvaluationstudent;
|
||||
|
||||
/**
|
||||
|
@ -11,4 +16,5 @@ import org.jeecg.modules.kc.qa.entity.KcEvaluationstudent;
|
|||
*/
|
||||
public interface KcEvaluationstudentMapper extends BaseMapper<KcEvaluationstudent> {
|
||||
|
||||
IPage<KcEvaluationstudent> queryAllList(Page<KcEvaluationstudent> page,@Param(Constants.WRAPPER) QueryWrapper<KcEvaluationstudent> queryWrapper);
|
||||
}
|
||||
|
|
|
@ -2,4 +2,12 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.kc.qa.mapper.KcEvaluationstudentMapper">
|
||||
|
||||
<select id="queryAllList" resultType="org.jeecg.modules.kc.qa.entity.KcEvaluationstudent">
|
||||
select
|
||||
a.*,
|
||||
kt.kcmc
|
||||
from kc_evaluationstudent a
|
||||
left join kc_ketangbiao kt on kt.id = a.ketangbiaoid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
|
@ -1,5 +1,8 @@
|
|||
package org.jeecg.modules.kc.qa.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.kc.qa.entity.KcEvaluationstudent;
|
||||
|
||||
|
@ -11,4 +14,5 @@ import org.jeecg.modules.kc.qa.entity.KcEvaluationstudent;
|
|||
*/
|
||||
public interface IKcEvaluationstudentService extends IService<KcEvaluationstudent> {
|
||||
|
||||
IPage<KcEvaluationstudent> queryAllList(Page<KcEvaluationstudent> page, QueryWrapper<KcEvaluationstudent> queryWrapper);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package org.jeecg.modules.kc.qa.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.kc.qa.entity.KcEvaluationstudent;
|
||||
import org.jeecg.modules.kc.qa.mapper.KcEvaluationstudentMapper;
|
||||
|
@ -15,4 +18,8 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class KcEvaluationstudentServiceImpl extends ServiceImpl<KcEvaluationstudentMapper, KcEvaluationstudent> implements IKcEvaluationstudentService {
|
||||
|
||||
@Override
|
||||
public IPage<KcEvaluationstudent> queryAllList(Page<KcEvaluationstudent> page, QueryWrapper<KcEvaluationstudent> queryWrapper) {
|
||||
return baseMapper.queryAllList(page,queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue