Merge branch 'master' of https://gitee.com/mini-org-project/course_information_center_java
This commit is contained in:
commit
ce6c692da1
|
@ -1,16 +1,17 @@
|
||||||
package org.jeecg.modules.kc.qa.mapper;
|
package org.jeecg.modules.kc.qa.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
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.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.jeecg.modules.kc.qa.entity.KcEvaluation;
|
import org.jeecg.modules.kc.qa.entity.KcEvaluation;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import org.jeecg.modules.kc.qa.entity.KcEvaluationPkmx;
|
import org.jeecg.modules.kc.qa.entity.KcEvaluationPkmx;
|
||||||
import org.jeecg.modules.kc.statistics.KcEvaluationVo;
|
import org.jeecg.modules.kc.statistics.KcEvaluationVo;
|
||||||
|
import org.jeecg.modules.kc.statistics.KcEvaluationVo2;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 调查问卷-回答主表
|
* @Description: 调查问卷-回答主表
|
||||||
|
@ -34,4 +35,6 @@ public interface KcEvaluationMapper extends BaseMapper<KcEvaluation> {
|
||||||
List<KcEvaluation> keTangList(Page<KcEvaluation> page, @Param(Constants.WRAPPER) QueryWrapper<KcEvaluation> queryWrapper);
|
List<KcEvaluation> keTangList(Page<KcEvaluation> page, @Param(Constants.WRAPPER) QueryWrapper<KcEvaluation> queryWrapper);
|
||||||
|
|
||||||
List<KcEvaluationVo> selectPageAndKcmc(Page<KcEvaluationVo> page, @Param(Constants.WRAPPER) QueryWrapper<KcEvaluationVo> queryWrapper);
|
List<KcEvaluationVo> selectPageAndKcmc(Page<KcEvaluationVo> page, @Param(Constants.WRAPPER) QueryWrapper<KcEvaluationVo> queryWrapper);
|
||||||
|
|
||||||
|
List<KcEvaluationVo2> selectPageAndKcmc2(Page<KcEvaluationVo2> page, @Param(Constants.WRAPPER) QueryWrapper<KcEvaluationVo2> queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
|
@ -416,4 +416,27 @@
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPageAndKcmc2" resultType="org.jeecg.modules.kc.statistics.KcEvaluationVo2">
|
||||||
|
select
|
||||||
|
a.*,
|
||||||
|
a.upuserid as tkjgh,
|
||||||
|
a.upuser as tkjsxm,
|
||||||
|
a.evaluationver as pjlblx,
|
||||||
|
kt.kcmc as kcmc,
|
||||||
|
kt.kkdw as kkdw,
|
||||||
|
kt.skjs as skjs,
|
||||||
|
kt.jgh as skjgh,
|
||||||
|
kt.sksj as sksj,
|
||||||
|
kt.skrq as skrq,
|
||||||
|
kt.hh as jieci,
|
||||||
|
kt.skdd as skdd,
|
||||||
|
xu.DWMC as tkdwmc,
|
||||||
|
fen.avgscore as tkpjjg
|
||||||
|
from kc_evaluation a
|
||||||
|
left join kc_ketangbiao kt on kt.id = a.minkcid
|
||||||
|
left join xxhbuser xu on xu.GH = a.upuserid
|
||||||
|
left join zongtipingjiapingjunfen fen on fen.kechengbiaoid = kt.kechengbiaoid
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -7,6 +7,7 @@ import org.jeecg.modules.kc.qa.entity.KcEvaluation;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.jeecg.modules.kc.qa.entity.KcEvaluationPkmx;
|
import org.jeecg.modules.kc.qa.entity.KcEvaluationPkmx;
|
||||||
import org.jeecg.modules.kc.statistics.KcEvaluationVo;
|
import org.jeecg.modules.kc.statistics.KcEvaluationVo;
|
||||||
|
import org.jeecg.modules.kc.statistics.KcEvaluationVo2;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -35,4 +36,6 @@ public interface IKcEvaluationService extends IService<KcEvaluation> {
|
||||||
IPage<KcEvaluation> keTangList(Page<KcEvaluation> page, QueryWrapper<KcEvaluation> queryWrapper);
|
IPage<KcEvaluation> keTangList(Page<KcEvaluation> page, QueryWrapper<KcEvaluation> queryWrapper);
|
||||||
|
|
||||||
IPage<KcEvaluationVo> selectPageAndKcmc(Page<KcEvaluationVo> page, QueryWrapper<KcEvaluationVo> queryWrapper);
|
IPage<KcEvaluationVo> selectPageAndKcmc(Page<KcEvaluationVo> page, QueryWrapper<KcEvaluationVo> queryWrapper);
|
||||||
|
|
||||||
|
IPage<KcEvaluationVo2> selectPageAndKcmc2(Page<KcEvaluationVo2> page, QueryWrapper<KcEvaluationVo2> queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import org.jeecg.modules.kc.qa.mapper.KcEvaluationMapper;
|
||||||
import org.jeecg.modules.kc.qa.service.IKcEvaluationService;
|
import org.jeecg.modules.kc.qa.service.IKcEvaluationService;
|
||||||
import org.jeecg.modules.kc.qa.service.IKcEvaluationsService;
|
import org.jeecg.modules.kc.qa.service.IKcEvaluationsService;
|
||||||
import org.jeecg.modules.kc.statistics.KcEvaluationVo;
|
import org.jeecg.modules.kc.statistics.KcEvaluationVo;
|
||||||
|
import org.jeecg.modules.kc.statistics.KcEvaluationVo2;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -111,4 +112,9 @@ public class KcEvaluationServiceImpl extends ServiceImpl<KcEvaluationMapper, KcE
|
||||||
return page.setRecords(baseMapper.selectPageAndKcmc(page,queryWrapper));
|
return page.setRecords(baseMapper.selectPageAndKcmc(page,queryWrapper));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<KcEvaluationVo2> selectPageAndKcmc2(Page<KcEvaluationVo2> page, QueryWrapper<KcEvaluationVo2> queryWrapper) {
|
||||||
|
return page.setRecords(baseMapper.selectPageAndKcmc2(page,queryWrapper));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,168 @@
|
||||||
|
package org.jeecg.modules.kc.statistics;
|
||||||
|
|
||||||
|
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 com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 调查问卷-回答主表
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-04-09
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("kc_evaluation")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="kc_evaluation对象", description="调查问卷-回答主表")
|
||||||
|
public class KcEvaluationVo2 implements Serializable{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private String id;
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(value = "上传日期")
|
||||||
|
private Date upDate;
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "HH:mm")
|
||||||
|
@DateTimeFormat(pattern="HH:mm")
|
||||||
|
@ApiModelProperty(value = "上传时间")
|
||||||
|
private Date upTime;
|
||||||
|
@ApiModelProperty(value = "答案")
|
||||||
|
private String answer1;
|
||||||
|
/**上传人id*/
|
||||||
|
@ApiModelProperty(value = "上传人id")
|
||||||
|
private Integer upuserid;
|
||||||
|
/**上传人id*/
|
||||||
|
@ApiModelProperty(value = "上传人id")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String upuseridLike;
|
||||||
|
/**上传时间戳*/
|
||||||
|
@ApiModelProperty(value = "上传时间戳")
|
||||||
|
private String upTimestamp;
|
||||||
|
/**课程最小id*/
|
||||||
|
@ApiModelProperty(value = "课程最小id")
|
||||||
|
private String minkcid;
|
||||||
|
/**答案2*/
|
||||||
|
@ApiModelProperty(value = "答案2")
|
||||||
|
private String answer2;
|
||||||
|
/**答案3*/
|
||||||
|
@ApiModelProperty(value = "答案3")
|
||||||
|
private String answer3;
|
||||||
|
/**答案4*/
|
||||||
|
@ApiModelProperty(value = "答案4")
|
||||||
|
private String answer4;
|
||||||
|
/**答案5*/
|
||||||
|
@ApiModelProperty(value = "答案5")
|
||||||
|
private String answer5;
|
||||||
|
/**答案6*/
|
||||||
|
@ApiModelProperty(value = "答案6")
|
||||||
|
private String answer6;
|
||||||
|
/**答案7*/
|
||||||
|
@ApiModelProperty(value = "答案7")
|
||||||
|
private String answer7;
|
||||||
|
/**答案8*/
|
||||||
|
@ApiModelProperty(value = "答案8")
|
||||||
|
private String answer8;
|
||||||
|
/**答案9*/
|
||||||
|
@ApiModelProperty(value = "答案9")
|
||||||
|
private String answer9;
|
||||||
|
/**答案10*/
|
||||||
|
@ApiModelProperty(value = "答案10")
|
||||||
|
//@MappedJdbcTypes(JdbcType.LONGVARCHAR)
|
||||||
|
//@TableField(jdbcType = JdbcType.LONGVARCHAR)
|
||||||
|
private String answer10;
|
||||||
|
/**答案11*/
|
||||||
|
@ApiModelProperty(value = "答案11")
|
||||||
|
private String answer11;
|
||||||
|
/**问卷版本*/
|
||||||
|
@ApiModelProperty(value = "问卷版本")
|
||||||
|
private Integer evaluationver;
|
||||||
|
|
||||||
|
/**数据来源(0:门户添加,1:老系统,2:政务大厅,3后台导入)*/
|
||||||
|
@ApiModelProperty(value = "数据来源(0:课程中心,1:老系统,2:政务大厅,3:纸质评价)")
|
||||||
|
private Integer source;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Excel(name = "学期", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String xqxn;
|
||||||
|
|
||||||
|
@Excel(name = "课程名称", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String kcmc;
|
||||||
|
|
||||||
|
|
||||||
|
@Excel(name = "开课单位", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String kkdw;
|
||||||
|
|
||||||
|
@Excel(name = "授课教师", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String skjs;
|
||||||
|
|
||||||
|
@Excel(name = "授课教师工号", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String skjgh;
|
||||||
|
|
||||||
|
//授课日期(时间/节次)
|
||||||
|
@Excel(name = "授课日期", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String skrq;
|
||||||
|
|
||||||
|
@Excel(name = "授课时间", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String sksj;
|
||||||
|
|
||||||
|
@Excel(name = "授课节次", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String jieci;
|
||||||
|
|
||||||
|
@Excel(name = "授课地点", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String skdd;
|
||||||
|
|
||||||
|
@Excel(name = "听课教师单位", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String tkdwmc;
|
||||||
|
|
||||||
|
@Excel(name = "听课教师工号", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String tkjgh;
|
||||||
|
|
||||||
|
@Excel(name = "听课教师姓名", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String tkjsxm;
|
||||||
|
|
||||||
|
@Excel(name = "听课身份", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String tksf;
|
||||||
|
|
||||||
|
// @Excel(name = "听课评价结果(5分制)", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String tkpjjg;
|
||||||
|
|
||||||
|
@Excel(name = "评价量表类型", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String pjlblx;
|
||||||
|
|
||||||
|
@Excel(name = "数据来源", width = 15)
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String sourceName;
|
||||||
|
|
||||||
|
}
|
|
@ -174,7 +174,120 @@ public class TingKeStatisticsController {
|
||||||
long betweenStartDay = DateUtil.between(startTime, upDate, DateUnit.DAY,false);
|
long betweenStartDay = DateUtil.between(startTime, upDate, DateUnit.DAY,false);
|
||||||
long betweenEndDay = DateUtil.between(endTime, upDate, DateUnit.DAY,false);
|
long betweenEndDay = DateUtil.between(endTime, upDate, DateUnit.DAY,false);
|
||||||
if(betweenStartDay >=0 && betweenEndDay <=0) {
|
if(betweenStartDay >=0 && betweenEndDay <=0) {
|
||||||
System.out.println("在范围内");
|
x.setXqxn(hx.getTitle());
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return pageList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IPage<KcEvaluationVo2> loadPageData2(KcEvaluationVo2 evaluation,QueryWrapper<KcEvaluationVo2> queryWrapper,Page<KcEvaluationVo2> page){
|
||||||
|
queryWrapper.isNotNull("a.upuserid");
|
||||||
|
queryWrapper.isNotNull("a.minkcid");
|
||||||
|
|
||||||
|
// if(StringUtils.isNotBlank(evaluation.getDwmc())){
|
||||||
|
// List<Xxhbuser> xxhbuserList = szdwList.stream().filter(x -> StringUtils.equals(x.getDwh(),evaluation.getDwmc())).collect(Collectors.toList());
|
||||||
|
// Set<String> ghSet = xxhbuserList.stream().map(x -> x.getGh()).collect(Collectors.toSet());
|
||||||
|
// queryWrapper.in("a.upuserid",ghSet);
|
||||||
|
// }
|
||||||
|
queryWrapper.like(StringUtils.isNotBlank(evaluation.getKkdw()),"kt.kkdw",evaluation.getKkdw());
|
||||||
|
queryWrapper.like(StringUtils.isNotBlank(evaluation.getSkjs()),"kt.skjs",evaluation.getSkjs());
|
||||||
|
queryWrapper.like(StringUtils.isNotBlank(evaluation.getSkjgh()),"kt.jgh",evaluation.getSkjgh());
|
||||||
|
queryWrapper.like(StringUtils.isNotBlank(evaluation.getUpuseridLike()),"a.upuserid",evaluation.getUpuseridLike());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<KcXqxnHistory> kcXqxnHistoryList = kcXqxnHistoryService.list();
|
||||||
|
//查询所在单位
|
||||||
|
List<Xxhbuser> szdwList = xxhbuserService.list();
|
||||||
|
Map<String, Xxhbuser> szdwMap = Maps.newHashMap();
|
||||||
|
szdwList.forEach(x -> {
|
||||||
|
szdwMap.put(x.getGh(),x);
|
||||||
|
});
|
||||||
|
|
||||||
|
//补充搜索
|
||||||
|
if(StringUtils.isNotBlank(evaluation.getXqxn())){
|
||||||
|
List<KcXqxnHistory> xqxnHistoryList = kcXqxnHistoryList.stream().filter(x -> StringUtils.equals(x.getTitle(),evaluation.getXqxn())).collect(Collectors.toList());
|
||||||
|
if(xqxnHistoryList != null && !xqxnHistoryList.isEmpty()){
|
||||||
|
KcXqxnHistory xqxnHistory = xqxnHistoryList.get(0);
|
||||||
|
queryWrapper.ge("a.up_date",xqxnHistory.getStartTime());
|
||||||
|
queryWrapper.le("a.up_date",xqxnHistory.getEndTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IPage<KcEvaluationVo2> pageList = service.selectPageAndKcmc2(page, queryWrapper);
|
||||||
|
//---------------------补数据1------------------------------------------
|
||||||
|
Map<Integer,String> sourceDictMap = Maps.newHashMap();
|
||||||
|
//0:门户添加,1:老系统,2:政务大厅,3后台导入
|
||||||
|
sourceDictMap.put(0,"课程中心");
|
||||||
|
sourceDictMap.put(1,"老系统");
|
||||||
|
sourceDictMap.put(2,"服务大厅");
|
||||||
|
sourceDictMap.put(3,"线下纸质");
|
||||||
|
//---------------------补数据1------------------------------------------
|
||||||
|
|
||||||
|
Set<String> tjSet = Sets.newHashSet();
|
||||||
|
pageList.getRecords().forEach(x -> {
|
||||||
|
//补充信息
|
||||||
|
x.setSourceName(sourceDictMap.get(x.getSource()));//数据来源
|
||||||
|
Integer ixuserId = x.getUpuserid();
|
||||||
|
String xuserId = String.valueOf(ixuserId);
|
||||||
|
tjSet.add(xuserId);
|
||||||
|
});
|
||||||
|
|
||||||
|
if(tjSet.isEmpty()){
|
||||||
|
return new Page<>();
|
||||||
|
}
|
||||||
|
//---------------------补数据2------------------------------------------
|
||||||
|
|
||||||
|
//查询听课身份
|
||||||
|
QueryWrapper<KcTksfrzb> tksfQw = new QueryWrapper<>();
|
||||||
|
tksfQw.in("gh",tjSet);
|
||||||
|
List<KcTksfrzb> tksfList = kcTksfrzbService.list(tksfQw);
|
||||||
|
Map<String, KcTksfrzb> tksfMap = Maps.newHashMap();
|
||||||
|
tksfList.forEach(x -> {
|
||||||
|
if(tksfMap.containsKey(x.getGh())){
|
||||||
|
//存在了,拼接职务名称,取最大的听课要求
|
||||||
|
KcTksfrzb currentData = tksfMap.get(x.getGh());
|
||||||
|
String currentZwmc = currentData.getZwmc();
|
||||||
|
String currentTkyq = currentData.getTkyq();
|
||||||
|
if(StringUtils.isNotBlank(currentTkyq)){
|
||||||
|
int tkyq = Integer.parseInt(currentTkyq);
|
||||||
|
int xtkyq = Integer.parseInt(x.getTkyq());
|
||||||
|
x.setZwmc(currentZwmc + "、" + x.getZwmc());
|
||||||
|
if(tkyq > xtkyq){
|
||||||
|
x.setTkyq(String.valueOf(tkyq));
|
||||||
|
}else{
|
||||||
|
x.setTkyq(String.valueOf(xtkyq));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tksfMap.put(x.getGh(),x);
|
||||||
|
}else {
|
||||||
|
tksfMap.put(x.getGh(),x);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//---------------------补数据2------------------------------------------
|
||||||
|
pageList.getRecords().forEach(x -> {
|
||||||
|
Integer ixuserId = x.getUpuserid();
|
||||||
|
String xuserId = String.valueOf(ixuserId);
|
||||||
|
// if(szdwMap.containsKey(xuserId)){
|
||||||
|
// Xxhbuser currentData = szdwMap.get(xuserId);
|
||||||
|
// x.setDwmc(currentData.getDwmc());
|
||||||
|
// }
|
||||||
|
if(tksfMap.containsKey(xuserId)){
|
||||||
|
KcTksfrzb currentData = tksfMap.get(xuserId);
|
||||||
|
//tj.setJsxm(currentData.getXm());
|
||||||
|
x.setTksf(currentData.getZwmc());
|
||||||
|
//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());
|
x.setXqxn(hx.getTitle());
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
@ -208,6 +321,17 @@ public class TingKeStatisticsController {
|
||||||
return exportXls(request, kcEvaluationVo, KcEvaluationVo.class, "评价量表统计");
|
return exportXls(request, kcEvaluationVo, KcEvaluationVo.class, "评价量表统计");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/exportEvaluationXls2")
|
||||||
|
public ModelAndView exportXls2(HttpServletRequest request, KcEvaluationVo2 kcEvaluationVo) {
|
||||||
|
return exportXls(request, kcEvaluationVo, KcEvaluationVo2.class, "评价量表统计");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel
|
* 导出excel
|
||||||
|
@ -244,6 +368,40 @@ public class TingKeStatisticsController {
|
||||||
return mv;
|
return mv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
*/
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, KcEvaluationVo2 object, Class<KcEvaluationVo2> clazz, String title) {
|
||||||
|
// Step.1 组装查询条件
|
||||||
|
QueryWrapper<KcEvaluationVo2> 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<KcEvaluationVo> exportList = service.selectPageAndKcmc(queryWrapper);
|
||||||
|
Page<KcEvaluationVo2> page = new Page<>(1, -1);
|
||||||
|
IPage<KcEvaluationVo2> pageList = loadPageData2(object,queryWrapper,page);
|
||||||
|
|
||||||
|
// 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, pageList.getRecords());
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Date upDate = DateUtil.parseDateTime("2023-03-13 00:00:00");
|
Date upDate = DateUtil.parseDateTime("2023-03-13 00:00:00");
|
||||||
|
|
|
@ -0,0 +1,163 @@
|
||||||
|
package org.jeecg.modules.sys.jwms.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.sys.jwms.entity.Jwms;
|
||||||
|
import org.jeecg.modules.sys.jwms.service.IJwmsService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
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-06-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags="教务秘书")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/sys/jwms")
|
||||||
|
@Slf4j
|
||||||
|
public class JwmsController extends JeecgController<Jwms, IJwmsService> {
|
||||||
|
@Autowired
|
||||||
|
private IJwmsService jwmsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param jwms
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "教务秘书-分页列表查询")
|
||||||
|
@ApiOperation(value="教务秘书-分页列表查询", notes="教务秘书-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<Jwms>> queryPageList(Jwms jwms,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<Jwms> queryWrapper = QueryGenerator.initQueryWrapper(jwms, req.getParameterMap());
|
||||||
|
Page<Jwms> page = new Page<Jwms>(pageNo, pageSize);
|
||||||
|
IPage<Jwms> pageList = jwmsService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param jwms
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "教务秘书-添加")
|
||||||
|
@ApiOperation(value="教务秘书-添加", notes="教务秘书-添加")
|
||||||
|
@RequiresPermissions("sys:jwms:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody Jwms jwms) {
|
||||||
|
jwmsService.save(jwms);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param jwms
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "教务秘书-编辑")
|
||||||
|
@ApiOperation(value="教务秘书-编辑", notes="教务秘书-编辑")
|
||||||
|
@RequiresPermissions("sys:jwms:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody Jwms jwms) {
|
||||||
|
jwmsService.updateById(jwms);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "教务秘书-通过id删除")
|
||||||
|
@ApiOperation(value="教务秘书-通过id删除", notes="教务秘书-通过id删除")
|
||||||
|
@RequiresPermissions("sys:jwms:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
jwmsService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "教务秘书-批量删除")
|
||||||
|
@ApiOperation(value="教务秘书-批量删除", notes="教务秘书-批量删除")
|
||||||
|
@RequiresPermissions("sys:jwms:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.jwmsService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "教务秘书-通过id查询")
|
||||||
|
@ApiOperation(value="教务秘书-通过id查询", notes="教务秘书-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<Jwms> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
Jwms jwms = jwmsService.getById(id);
|
||||||
|
if(jwms==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(jwms);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param jwms
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("sys:jwms:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, Jwms jwms) {
|
||||||
|
return super.exportXls(request, jwms, Jwms.class, "教务秘书");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("sys:jwms:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, Jwms.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package org.jeecg.modules.sys.jwms.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 教务秘书
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-06-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("jwms")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="jwms对象", description="教务秘书")
|
||||||
|
public class Jwms implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private java.lang.Integer id;
|
||||||
|
/**账号*/
|
||||||
|
@Excel(name = "账号", width = 15)
|
||||||
|
@ApiModelProperty(value = "账号")
|
||||||
|
private java.lang.String userid;
|
||||||
|
/**用户名*/
|
||||||
|
@Excel(name = "用户名", width = 15)
|
||||||
|
@ApiModelProperty(value = "用户名")
|
||||||
|
private java.lang.String username;
|
||||||
|
/**范围*/
|
||||||
|
@Excel(name = "范围", width = 15)
|
||||||
|
@ApiModelProperty(value = "范围")
|
||||||
|
private java.lang.String range;
|
||||||
|
/**院校*/
|
||||||
|
@Excel(name = "院校", width = 15)
|
||||||
|
@ApiModelProperty(value = "院校")
|
||||||
|
private java.lang.String college;
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.sys.jwms.mapper;
|
||||||
|
|
||||||
|
import org.jeecg.modules.sys.jwms.entity.Jwms;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 教务秘书
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-06-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface JwmsMapper extends BaseMapper<Jwms> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.sys.jwms.mapper.JwmsMapper">
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.sys.jwms.service;
|
||||||
|
|
||||||
|
import org.jeecg.modules.sys.jwms.entity.Jwms;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 教务秘书
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-06-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IJwmsService extends IService<Jwms> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.jeecg.modules.sys.jwms.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.sys.jwms.entity.Jwms;
|
||||||
|
import org.jeecg.modules.sys.jwms.mapper.JwmsMapper;
|
||||||
|
import org.jeecg.modules.sys.jwms.service.IJwmsService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 教务秘书
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-06-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class JwmsServiceImpl extends ServiceImpl<JwmsMapper, Jwms> implements IJwmsService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package org.jeecg.modules.jwms.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 教务秘书
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-06-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("jwms")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="jwms对象", description="教务秘书")
|
||||||
|
public class SysJwms implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private Integer id;
|
||||||
|
/**账号*/
|
||||||
|
@Excel(name = "账号", width = 15)
|
||||||
|
@ApiModelProperty(value = "账号")
|
||||||
|
private String userid;
|
||||||
|
/**用户名*/
|
||||||
|
@Excel(name = "用户名", width = 15)
|
||||||
|
@ApiModelProperty(value = "用户名")
|
||||||
|
private String username;
|
||||||
|
/**范围*/
|
||||||
|
@Excel(name = "范围", width = 15)
|
||||||
|
@ApiModelProperty(value = "范围")
|
||||||
|
private String range;
|
||||||
|
/**院校*/
|
||||||
|
@Excel(name = "院校", width = 15)
|
||||||
|
@ApiModelProperty(value = "院校")
|
||||||
|
private String college;
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.jwms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.jwms.entity.SysJwms;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 教务秘书
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-06-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface SysJwmsMapper extends BaseMapper<SysJwms> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.jwms.mapper.SysJwmsMapper">
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.jwms.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.jwms.entity.SysJwms;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 教务秘书
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-06-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ISysJwmsService extends IService<SysJwms> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.jeecg.modules.jwms.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.jwms.entity.SysJwms;
|
||||||
|
import org.jeecg.modules.jwms.mapper.SysJwmsMapper;
|
||||||
|
import org.jeecg.modules.jwms.service.ISysJwmsService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 教务秘书
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-06-17
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysJwmsServiceImpl extends ServiceImpl<SysJwmsMapper, SysJwms> implements ISysJwmsService {
|
||||||
|
|
||||||
|
}
|
|
@ -4,6 +4,7 @@ import cn.hutool.core.util.RandomUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.aliyuncs.exceptions.ClientException;
|
import com.aliyuncs.exceptions.ClientException;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
@ -20,10 +21,7 @@ import org.jeecg.common.util.*;
|
||||||
import org.jeecg.common.util.encryption.EncryptedString;
|
import org.jeecg.common.util.encryption.EncryptedString;
|
||||||
import org.jeecg.config.JeecgBaseConfig;
|
import org.jeecg.config.JeecgBaseConfig;
|
||||||
import org.jeecg.modules.base.service.BaseCommonService;
|
import org.jeecg.modules.base.service.BaseCommonService;
|
||||||
import org.jeecg.modules.system.entity.SysDepart;
|
import org.jeecg.modules.system.entity.*;
|
||||||
import org.jeecg.modules.system.entity.SysRoleIndex;
|
|
||||||
import org.jeecg.modules.system.entity.SysTenant;
|
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
|
||||||
import org.jeecg.modules.system.model.SysLoginModel;
|
import org.jeecg.modules.system.model.SysLoginModel;
|
||||||
import org.jeecg.modules.system.service.*;
|
import org.jeecg.modules.system.service.*;
|
||||||
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
||||||
|
@ -37,6 +35,7 @@ import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author scott
|
* @Author scott
|
||||||
|
@ -57,6 +56,12 @@ public class LoginController {
|
||||||
private ISysLogService logService;
|
private ISysLogService logService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysRoleService sysRoleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysUserRoleService sysUserRoleService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDepartService sysDepartService;
|
private ISysDepartService sysDepartService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -174,6 +179,20 @@ public class LoginController {
|
||||||
|
|
||||||
obj.put("userInfo",sysUser);
|
obj.put("userInfo",sysUser);
|
||||||
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
|
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
|
||||||
|
|
||||||
|
//查询当前用户角色列表
|
||||||
|
QueryWrapper<SysUserRole> sysUserRoleQw = new QueryWrapper<>();
|
||||||
|
sysUserRoleQw.eq("user_id",sysUser.getId());
|
||||||
|
List<SysUserRole> sysUserRoleList = sysUserRoleService.list(sysUserRoleQw);
|
||||||
|
Set<String> roleIdSet = sysUserRoleList.stream().map(x -> x.getRoleId()).collect(Collectors.toSet());
|
||||||
|
|
||||||
|
if(roleIdSet != null && !roleIdSet.isEmpty()){
|
||||||
|
QueryWrapper<SysRole> sysRoleQw = new QueryWrapper<>();
|
||||||
|
sysRoleQw.in("id",roleIdSet);
|
||||||
|
List<SysRole> sysRoleList = sysRoleService.list(sysRoleQw);
|
||||||
|
obj.put("roleList",sysRoleList);
|
||||||
|
}
|
||||||
|
|
||||||
result.setResult(obj);
|
result.setResult(obj);
|
||||||
result.success("");
|
result.success("");
|
||||||
}
|
}
|
||||||
|
@ -482,6 +501,20 @@ public class LoginController {
|
||||||
// update-end--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去
|
// update-end--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去
|
||||||
obj.put("multi_depart", 2);
|
obj.put("multi_depart", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//查询当前用户角色列表
|
||||||
|
QueryWrapper<SysUserRole> sysUserRoleQw = new QueryWrapper<>();
|
||||||
|
sysUserRoleQw.eq("user_id",sysUser.getId());
|
||||||
|
List<SysUserRole> sysUserRoleList = sysUserRoleService.list(sysUserRoleQw);
|
||||||
|
Set<String> roleIdSet = sysUserRoleList.stream().map(x -> x.getRoleId()).collect(Collectors.toSet());
|
||||||
|
|
||||||
|
if(roleIdSet != null && !roleIdSet.isEmpty()){
|
||||||
|
QueryWrapper<SysRole> sysRoleQw = new QueryWrapper<>();
|
||||||
|
sysRoleQw.in("id",roleIdSet);
|
||||||
|
List<SysRole> sysRoleList = sysRoleService.list(sysRoleQw);
|
||||||
|
obj.put("roleList",sysRoleList);
|
||||||
|
}
|
||||||
|
|
||||||
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
|
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
|
||||||
result.setResult(obj);
|
result.setResult(obj);
|
||||||
result.success("登录成功");
|
result.success("登录成功");
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.jeecg.modules.system.service.impl;
|
package org.jeecg.modules.system.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
@ -29,9 +28,12 @@ import org.jeecg.common.util.*;
|
||||||
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
|
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
|
||||||
import org.jeecg.modules.base.service.BaseCommonService;
|
import org.jeecg.modules.base.service.BaseCommonService;
|
||||||
import org.jeecg.modules.cas.util.XmlUtils;
|
import org.jeecg.modules.cas.util.XmlUtils;
|
||||||
|
import org.jeecg.modules.jwms.entity.SysJwms;
|
||||||
|
import org.jeecg.modules.jwms.service.ISysJwmsService;
|
||||||
import org.jeecg.modules.system.entity.*;
|
import org.jeecg.modules.system.entity.*;
|
||||||
import org.jeecg.modules.system.mapper.*;
|
import org.jeecg.modules.system.mapper.*;
|
||||||
import org.jeecg.modules.system.model.SysUserSysDepartModel;
|
import org.jeecg.modules.system.model.SysUserSysDepartModel;
|
||||||
|
import org.jeecg.modules.system.service.ISysRoleService;
|
||||||
import org.jeecg.modules.system.service.ISysUserService;
|
import org.jeecg.modules.system.service.ISysUserService;
|
||||||
import org.jeecg.modules.system.vo.SysUserDepVo;
|
import org.jeecg.modules.system.vo.SysUserDepVo;
|
||||||
import org.jeecg.modules.system.vo.UserAvatar;
|
import org.jeecg.modules.system.vo.UserAvatar;
|
||||||
|
@ -39,11 +41,9 @@ import org.jeecg.modules.system.vo.lowapp.DepartAndUserInfo;
|
||||||
import org.jeecg.modules.system.vo.lowapp.DepartInfo;
|
import org.jeecg.modules.system.vo.lowapp.DepartInfo;
|
||||||
import org.jeecg.modules.system.vo.lowapp.UpdateDepartInfo;
|
import org.jeecg.modules.system.vo.lowapp.UpdateDepartInfo;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@ -96,6 +96,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
private SysUserTenantMapper relationMapper;
|
private SysUserTenantMapper relationMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserTenantMapper userTenantMapper;
|
private SysUserTenantMapper userTenantMapper;
|
||||||
|
@Autowired
|
||||||
|
private ISysRoleService sysRoleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysJwmsService jwmsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<IPage<SysUser>> queryPageList(HttpServletRequest req, QueryWrapper<SysUser> queryWrapper, Integer pageSize, Integer pageNo) {
|
public Result<IPage<SysUser>> queryPageList(HttpServletRequest req, QueryWrapper<SysUser> queryWrapper, Integer pageSize, Integer pageNo) {
|
||||||
|
@ -547,14 +552,38 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
final String realname = XmlUtils.getTextForElement(res, "cn");
|
final String realname = XmlUtils.getTextForElement(res, "cn");
|
||||||
final String containerId = XmlUtils.getTextForElement(res, "containerId");
|
final String containerId = XmlUtils.getTextForElement(res, "containerId");
|
||||||
String roles = "";
|
String roles = "";
|
||||||
|
int userIdentity = 1;
|
||||||
//判断是否为教师
|
//判断是否为教师
|
||||||
if(StringUtils.indexOf(containerId,"ou=jzg") != -1){
|
if(StringUtils.indexOf(containerId,"ou=jzg") != -1){
|
||||||
roles = "2";
|
roles = "teacher";//教师角色
|
||||||
|
userIdentity = 2;//允许进入后台
|
||||||
}else if(StringUtils.indexOf(containerId,"ou=bzks") != -1){
|
}else if(StringUtils.indexOf(containerId,"ou=bzks") != -1){
|
||||||
roles = "3";
|
roles = "student";//学生角色
|
||||||
|
userIdentity = 1;//不允许进入后台
|
||||||
}else{
|
}else{
|
||||||
return checkUserIsEffective(sysUser);
|
return checkUserIsEffective(sysUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryWrapper<SysJwms> jwmsQw = new QueryWrapper<>();
|
||||||
|
jwmsQw.in("userid",username);
|
||||||
|
jwmsQw.last("limit 1");
|
||||||
|
SysJwms jwms = jwmsService.getOne(jwmsQw);
|
||||||
|
if(jwms != null){
|
||||||
|
roles = "jwms";//教务秘书角色
|
||||||
|
userIdentity = 2;//允许进入后台
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryWrapper<SysRole> sysRoleQw = new QueryWrapper<>();
|
||||||
|
sysRoleQw.in("role_code",roles);
|
||||||
|
sysRoleQw.last("limit 1");
|
||||||
|
SysRole sysRole = sysRoleService.getOne(sysRoleQw);
|
||||||
|
if(sysRole != null){
|
||||||
|
roles = sysRole.getId();
|
||||||
|
}else{
|
||||||
|
log.error("创建用户出现错误,未找到["+roles+"]角色,请添加");
|
||||||
|
throw new JeecgBootException("创建用户出现错误,未找到["+roles+"]角色,请添加");
|
||||||
|
}
|
||||||
|
|
||||||
StringUtils.split(containerId,",");
|
StringUtils.split(containerId,",");
|
||||||
//情况1:根据用户信息查询,该用户不存在
|
//情况1:根据用户信息查询,该用户不存在
|
||||||
if (sysUser == null) {
|
if (sysUser == null) {
|
||||||
|
@ -568,11 +597,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
String passwordEncode = PasswordUtil.encrypt(user.getUsername(), "123456", salt);
|
String passwordEncode = PasswordUtil.encrypt(user.getUsername(), "123456", salt);
|
||||||
user.setPassword(passwordEncode);
|
user.setPassword(passwordEncode);
|
||||||
user.setPhone(username);
|
user.setPhone(username);
|
||||||
if(StringUtils.indexOf(containerId,"ou=jzg") != -1){
|
user.setUserIdentity(userIdentity);
|
||||||
user.setUserIdentity(2);
|
|
||||||
}else if(StringUtils.indexOf(containerId,"ou=bzks") != -1){
|
|
||||||
user.setUserIdentity(1);
|
|
||||||
}
|
|
||||||
user.setWorkNo(username);
|
user.setWorkNo(username);
|
||||||
user.setStatus(1);
|
user.setStatus(1);
|
||||||
user.setDelFlag(0);
|
user.setDelFlag(0);
|
||||||
|
|
7
pom.xml
7
pom.xml
|
@ -171,6 +171,13 @@
|
||||||
<version>${jeecgboot.version}</version>
|
<version>${jeecgboot.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- main 模块-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-module-main</artifactId>
|
||||||
|
<version>${jeecgboot.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- jeecg tools -->
|
<!-- jeecg tools -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jeecgframework.boot</groupId>
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
|
Loading…
Reference in New Issue