2023年8月12日 修复问题
This commit is contained in:
parent
76d15352d5
commit
c14865bdb4
|
@ -8,11 +8,14 @@ import io.swagger.annotations.Api;
|
|||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx;
|
||||
import org.jeecg.modules.kc.config.export.Export;
|
||||
import org.jeecg.modules.kc.config.service.IKcExportConfigTpkwcqkjzglxService;
|
||||
|
@ -23,7 +26,11 @@ import org.jeecg.modules.kc.tksf.kctkcstj.entity.KcTkcstj;
|
|||
import org.jeecg.modules.kc.tksf.kctkcstj.service.IKcTkcstjService;
|
||||
import org.jeecg.modules.tools.word.ExportWord;
|
||||
import org.jeecg.modules.tools.word.WordOperator;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
|
@ -50,13 +57,17 @@ public class KcExportConfigTpkwcqkjzglxController extends JeecgController<KcExpo
|
|||
@Autowired
|
||||
private IXxhbuserService xxhbuserService;
|
||||
|
||||
@Autowired
|
||||
private IKcTkcstjService kcTkcstjService;
|
||||
@Autowired
|
||||
private IKcTkcstjService kcTkcstjService;
|
||||
|
||||
@Autowired
|
||||
private ChangeTingKeTongJi changeTingKeTongJi;
|
||||
@Autowired
|
||||
private ChangeTingKeTongJi changeTingKeTongJi;
|
||||
|
||||
/**
|
||||
@Value("${jeecg.path.upload}")
|
||||
private String upLoadPath;
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param kcExportConfigTpkwcqkjzglx
|
||||
|
@ -91,8 +102,8 @@ public class KcExportConfigTpkwcqkjzglxController extends JeecgController<KcExpo
|
|||
x.setYskcs("0");
|
||||
if(tjMap.containsKey(x.getGh())){
|
||||
KcTkcstj tkcstj = tjMap.get(x.getGh());
|
||||
x.setTkxttj(tkcstj.getTkxttj());
|
||||
x.setYskcs(tkcstj.getYskcs());
|
||||
x.setTkxttj(StringUtils.defaultString(tkcstj.getTkxttj(),"0"));
|
||||
x.setYskcs(StringUtils.defaultString(tkcstj.getYskcs(),"0"));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -201,10 +212,58 @@ public class KcExportConfigTpkwcqkjzglxController extends JeecgController<KcExpo
|
|||
// @RequiresPermissions("config:kc_export_config_tpkwcqkjzglx:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx) {
|
||||
return super.exportXls(request, kcExportConfigTpkwcqkjzglx, KcExportConfigTpkwcqkjzglx.class, "人员信息");
|
||||
return exportXls(request, kcExportConfigTpkwcqkjzglx, KcExportConfigTpkwcqkjzglx.class, "人员信息");
|
||||
}
|
||||
|
||||
/**
|
||||
public ModelAndView exportXls(HttpServletRequest request, KcExportConfigTpkwcqkjzglx object, Class<KcExportConfigTpkwcqkjzglx> clazz, String title) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapper = QueryGenerator.initQueryWrapper(object, request.getParameterMap());
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
// 过滤选中数据
|
||||
String selections = request.getParameter("selections");
|
||||
if (oConvertUtils.isNotEmpty(selections)) {
|
||||
List<String> selectionList = Arrays.asList(selections.split(","));
|
||||
queryWrapper.in("id",selectionList);
|
||||
}
|
||||
// Step.2 获取导出数据
|
||||
List<KcExportConfigTpkwcqkjzglx> exportList = service.list(queryWrapper);
|
||||
|
||||
//根据当前学期学年,硬合并出来一个数据
|
||||
QueryWrapper<KcTkcstj> tjQw = new QueryWrapper<>();
|
||||
KcXqxnHistory kcXqxnHistory = changeTingKeTongJi.getXqConfig(object.getXqxn());
|
||||
tjQw.eq("xnxq",kcXqxnHistory.getTitle());
|
||||
List<KcTkcstj> tjList = kcTkcstjService.list(tjQw);
|
||||
Map<String,KcTkcstj> tjMap = Maps.newHashMap();
|
||||
tjList.forEach(x -> {
|
||||
tjMap.put(x.getJgh(),x);
|
||||
});
|
||||
|
||||
exportList.forEach(x -> {
|
||||
x.setTkxttj("0");
|
||||
x.setYskcs("0");
|
||||
if(tjMap.containsKey(x.getGh())){
|
||||
KcTkcstj tkcstj = tjMap.get(x.getGh());
|
||||
x.setTkxttj(StringUtils.defaultString(tkcstj.getTkxttj(),"0"));
|
||||
x.setYskcs(StringUtils.defaultString(tkcstj.getYskcs(),"0"));
|
||||
}
|
||||
});
|
||||
|
||||
// Step.3 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
//此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, title);
|
||||
mv.addObject(NormalExcelConstants.CLASS, clazz);
|
||||
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
||||
ExportParams exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
|
||||
exportParams.setImageBasePath(upLoadPath);
|
||||
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
||||
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
|
|
|
@ -81,7 +81,8 @@ public class KcExportConfigTpkwcqkjzglx implements Serializable {
|
|||
@ApiModelProperty(value = "状态")
|
||||
private java.lang.String zt;
|
||||
/**每学期应听课次数*/
|
||||
@Excel(name = "每学期应听课次数", width = 20)
|
||||
// @Excel(name = "每学期应听课次数", width = 20)
|
||||
@Excel(name = "本学期应听课次数", width = 15)
|
||||
@ApiModelProperty(value = "每学期应听课次数")
|
||||
private java.lang.String ytkcs;
|
||||
|
||||
|
@ -92,10 +93,11 @@ public class KcExportConfigTpkwcqkjzglx implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private String xqxn;
|
||||
|
||||
/**应听课次数*/
|
||||
/**本学期应听课次数*/
|
||||
@TableField(exist = false)
|
||||
private java.lang.String yskcs;
|
||||
/**听课次数*/
|
||||
/**本学期已听课次数*/
|
||||
@Excel(name = "本学期已听课次数", width = 15)
|
||||
@TableField(exist = false)
|
||||
private java.lang.String tkxttj;
|
||||
|
||||
|
|
|
@ -69,6 +69,10 @@ public class SyncTJzgXskc extends BaseSync {
|
|||
xxhbsynclog.setSynctype("0");//同步类型 0全量 1增量
|
||||
xxhbsynclog.setErrormessage(errorMessage);
|
||||
saveLog(xxhbsynclog,Xxhbxskc.class);
|
||||
|
||||
//todo 同步清洗到xxhbUser表。
|
||||
|
||||
//todo 再同步清洗到kc_export_config_tpkwcqkjzglx表
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,10 +12,12 @@
|
|||
xxhbuser cu
|
||||
WHERE ev.minkcid = kt.id AND ev.upuserid = cu.gh
|
||||
<if test="kcEvaluation.startTime != null and kcEvaluation.startTime != ''">
|
||||
and ev.up_date >= #{kcEvaluation.startTime}
|
||||
<!-- and ev.up_date >= #{kcEvaluation.startTime}-->
|
||||
and kt.skrq >= #{kcEvaluation.startTime}
|
||||
</if>
|
||||
<if test="kcEvaluation.endTime != null and kcEvaluation.endTime != ''">
|
||||
and ev.up_date <= #{kcEvaluation.endTime}
|
||||
<!-- and ev.up_date <= #{kcEvaluation.endTime}-->
|
||||
and kt.skrq <= #{kcEvaluation.endTime}
|
||||
</if>
|
||||
|
||||
<if test="kcEvaluation.kcxz != null and kcEvaluation.kcxz != ''">
|
||||
|
@ -55,10 +57,12 @@
|
|||
k.id = p.minkcid
|
||||
AND p.upuserid = c.gh
|
||||
<if test="kcEvaluation.startTime != null and kcEvaluation.startTime != ''">
|
||||
and p.up_date >= #{kcEvaluation.startTime}
|
||||
<!-- and a.up_date >= #{kcEvaluation.startTime}-->
|
||||
and k.skrq >= #{kcEvaluation.startTime}
|
||||
</if>
|
||||
<if test="kcEvaluation.endTime != null and kcEvaluation.endTime != ''">
|
||||
and p.up_date <= #{kcEvaluation.endTime}
|
||||
<!-- and a.up_date <= #{kcEvaluation.endTime}-->
|
||||
and k.skrq <= #{kcEvaluation.endTime}
|
||||
</if>
|
||||
<if test="kcEvaluation.username != null and kcEvaluation.username != ''">
|
||||
and (c.xm like concat('%',#{kcEvaluation.username},'%') or c.gh like concat('%',#{kcEvaluation.username},'%'))
|
||||
|
|
|
@ -168,4 +168,19 @@ public class KcEvaluationVo2 implements Serializable{
|
|||
@TableField(exist = false)
|
||||
private String sourceName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String findGh;
|
||||
|
||||
/**
|
||||
* 按当前用户的部门查询评课
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private boolean findByPkdwmc;
|
||||
|
||||
/**
|
||||
* 按当前用户的部门查询被评课
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private boolean findByBeiTkkdwmc;
|
||||
|
||||
}
|
||||
|
|
|
@ -252,22 +252,45 @@ public class TingKeStatisticsController {
|
|||
//tj.setYskcs(currentData.getTkyq());
|
||||
}
|
||||
|
||||
Date upDate = x.getUpDate();
|
||||
kcXqxnHistoryList.forEach(hx -> {
|
||||
Date startTime = hx.getStartTime();
|
||||
Date endTime = hx.getEndTime();
|
||||
long betweenStartDay = DateUtil.between(startTime, upDate, DateUnit.DAY,false);
|
||||
long betweenEndDay = DateUtil.between(endTime, upDate, DateUnit.DAY,false);
|
||||
if(betweenStartDay >=0 && betweenEndDay <=0) {
|
||||
x.setXqxn(hx.getTitle());
|
||||
}
|
||||
} );
|
||||
// Date upDate = x.getUpDate();
|
||||
String skrq = x.getSkrq();
|
||||
if(StringUtils.isNotBlank(skrq)){
|
||||
Date upDate = DateUtil.parseDate(skrq);
|
||||
kcXqxnHistoryList.forEach(hx -> {
|
||||
Date startTime = hx.getStartTime();
|
||||
Date endTime = hx.getEndTime();
|
||||
long betweenStartDay = DateUtil.between(startTime, upDate, DateUnit.DAY,false);
|
||||
long betweenEndDay = DateUtil.between(endTime, upDate, DateUnit.DAY,false);
|
||||
if(betweenStartDay >=0 && betweenEndDay <=0) {
|
||||
x.setXqxn(hx.getTitle());
|
||||
}
|
||||
} );
|
||||
}
|
||||
});
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
public IPage<KcEvaluationVo2> loadPageData2(KcEvaluationVo2 evaluation,QueryWrapper<KcEvaluationVo2> queryWrapper,Page<KcEvaluationVo2> page){
|
||||
//查询当前用户的学院
|
||||
if(evaluation.isFindByPkdwmc() || evaluation.isFindByBeiTkkdwmc()){
|
||||
QueryWrapper<KcExportConfigTpkwcqkjzglx> uqw = new QueryWrapper<>();
|
||||
//LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
uqw.eq("gh",evaluation.getFindGh());
|
||||
uqw.last("limit 1");
|
||||
KcExportConfigTpkwcqkjzglx exportConfigTpkwcqkjzglx = kcExportConfigTpkwcqkjzglxService.getOne(uqw);
|
||||
if(exportConfigTpkwcqkjzglx == null) {
|
||||
return new Page<>();
|
||||
}
|
||||
//queryWrapper.eq()
|
||||
if(evaluation.isFindByPkdwmc()){
|
||||
queryWrapper.eq("xu.DWMC",exportConfigTpkwcqkjzglx.getDwmc());
|
||||
}
|
||||
if(evaluation.isFindByBeiTkkdwmc()){
|
||||
queryWrapper.eq("kt.kkdw ",exportConfigTpkwcqkjzglx.getDwmc());
|
||||
}
|
||||
}
|
||||
|
||||
queryWrapper.isNotNull("a.upuserid");
|
||||
queryWrapper.isNotNull("a.minkcid");
|
||||
|
||||
|
@ -383,7 +406,7 @@ public class TingKeStatisticsController {
|
|||
}else{
|
||||
String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx());
|
||||
currentData.setZwmc(xZwmc);
|
||||
}
|
||||
}
|
||||
// tksfMap.put(x.getGh(),x);
|
||||
}else{
|
||||
String xZwmc = dictUtils.translateDictValue("tpkwcqkjzglx", x.getTklx());
|
||||
|
@ -406,17 +429,20 @@ public class TingKeStatisticsController {
|
|||
//tj.setYskcs(currentData.getTkyq());
|
||||
}
|
||||
|
||||
Date upDate = x.getUpDate();
|
||||
kcXqxnHistoryList.forEach(hx -> {
|
||||
Date startTime = hx.getStartTime();
|
||||
Date endTime = hx.getEndTime();
|
||||
long betweenStartDay = DateUtil.between(startTime, upDate, DateUnit.DAY,false);
|
||||
long betweenEndDay = DateUtil.between(endTime, upDate, DateUnit.DAY,false);
|
||||
if(betweenStartDay >=0 && betweenEndDay <=0) {
|
||||
x.setXqxn(hx.getTitle());
|
||||
}
|
||||
} );
|
||||
|
||||
// Date upDate = x.getUpDate();
|
||||
String skrq = x.getSkrq();
|
||||
if(StringUtils.isNotBlank(skrq)){
|
||||
Date upDate = DateUtil.parseDate(skrq);
|
||||
kcXqxnHistoryList.forEach(hx -> {
|
||||
Date startTime = hx.getStartTime();
|
||||
Date endTime = hx.getEndTime();
|
||||
long betweenStartDay = DateUtil.between(startTime, upDate, DateUnit.DAY,false);
|
||||
long betweenEndDay = DateUtil.between(endTime, upDate, DateUnit.DAY,false);
|
||||
if(betweenStartDay >=0 && betweenEndDay <=0) {
|
||||
x.setXqxn(hx.getTitle());
|
||||
}
|
||||
} );
|
||||
}
|
||||
});
|
||||
|
||||
return pageList;
|
||||
|
|
Loading…
Reference in New Issue