添加功能
This commit is contained in:
parent
dd49d1fed1
commit
754055ae2b
|
@ -115,7 +115,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
// Page<WjxWjxx> page = new Page<WjxWjxx>(pageNo, pageSize);
|
||||
// IPage<WjxWjxx> pageList = wjxWjxxService.page(page, queryWrapper);
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
wjxWjxx.setCreateBy(user.getUsername());
|
||||
// wjxWjxx.setCreateBy(user.getUsername());
|
||||
Page<WjxWjxx> pageList = wjxWjxxService.findPage(wjxWjxx, new Page<>(pageNo, pageSize));
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
QueryWrapper<WjxWjxx> zyInfoQueryWrapper = new QueryWrapper<>();
|
||||
zyInfoQueryWrapper.eq("xqxn",zyInfo.getXqxn());
|
||||
zyInfoQueryWrapper.eq("create_by",sysUser.getUsername());
|
||||
// zyInfoQueryWrapper.eq("create_by",sysUser.getUsername());
|
||||
zyInfoQueryWrapper.eq("rwbh",zyInfo.getRwbh());
|
||||
zyInfoQueryWrapper.eq("atype",zyInfo.getAtype());
|
||||
List<WjxWjxx> list = wjxWjxxService.list(zyInfoQueryWrapper);
|
||||
|
@ -282,7 +282,6 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
wjxWjxxService.removeById(id);
|
||||
QueryWrapper<WjxWjxx> zyInfoQueryWrapper = new QueryWrapper<>();
|
||||
zyInfoQueryWrapper.eq("rwbh",zyInfo.getRwbh());
|
||||
zyInfoQueryWrapper.eq("create_by",zyInfo.getCreateBy());
|
||||
zyInfoQueryWrapper.eq("xqxn",zyInfo.getXqxn());
|
||||
zyInfoQueryWrapper.eq("atype",zyInfo.getAtype());
|
||||
zyInfoQueryWrapper.orderByAsc("sort-0");
|
||||
|
@ -406,15 +405,15 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
zyDbtx.setFbr(user.getUsername());
|
||||
zyDbtxService.save(zyDbtx);
|
||||
try {
|
||||
KcWechatSendLog kcWechatSendLog = new KcWechatSendLog();
|
||||
kcWechatSendLog.setOpenid(xxhbbks.getXh());
|
||||
// kcWechatSendLog.setOpenid("2016900057");//指定曹老师账号
|
||||
kcWechatSendLog.setYtkcs(zyDbtx.getContent());
|
||||
sendWxmessage(kcWechatSendLog);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
// try {
|
||||
// KcWechatSendLog kcWechatSendLog = new KcWechatSendLog();
|
||||
// kcWechatSendLog.setOpenid(xxhbbks.getXh());
|
||||
//// kcWechatSendLog.setOpenid("2016900057");//指定曹老师账号
|
||||
// kcWechatSendLog.setYtkcs(zyDbtx.getContent());
|
||||
// sendWxmessage(kcWechatSendLog);
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
@ -435,17 +434,17 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
}else{
|
||||
content = sysUser.getRealname()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”问卷,该问卷完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成";
|
||||
}
|
||||
for(Xxhbbks xxhbbks:list){
|
||||
try {
|
||||
KcWechatSendLog kcWechatSendLog = new KcWechatSendLog();
|
||||
kcWechatSendLog.setOpenid(xxhbbks.getXh());
|
||||
// kcWechatSendLog.setOpenid("2016900057");//指定曹老师账号
|
||||
kcWechatSendLog.setYtkcs(content);
|
||||
sendWxmessage(kcWechatSendLog);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
// for(Xxhbbks xxhbbks:list){
|
||||
// try {
|
||||
// KcWechatSendLog kcWechatSendLog = new KcWechatSendLog();
|
||||
// kcWechatSendLog.setOpenid(xxhbbks.getXh());
|
||||
//// kcWechatSendLog.setOpenid("2016900057");//指定曹老师账号
|
||||
// kcWechatSendLog.setYtkcs(content);
|
||||
// sendWxmessage(kcWechatSendLog);
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
return Result.OK(null);
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ public class WjxWjxxTmlbController extends JeecgController<WjxWjxxTmlb, IWjxWjxx
|
|||
HttpServletRequest req) {
|
||||
QueryWrapper<WjxWjxxTmlb> queryWrapper = QueryGenerator.initQueryWrapper(wjxWjxxTmlb, req.getParameterMap());
|
||||
Page<WjxWjxxTmlb> page = new Page<WjxWjxxTmlb>(pageNo, pageSize);
|
||||
queryWrapper.groupBy("wj_title,wj_score,wj_sytype,wj_type,wj_answer");
|
||||
queryWrapper.groupBy("wj_title,wj_score,wj_type,wj_answer");
|
||||
IPage<WjxWjxxTmlb> pageList = wjxWjxxTmlbService.distinctList(page, queryWrapper);
|
||||
if(pageList.getRecords()!=null){
|
||||
for(WjxWjxxTmlb par:pageList.getRecords()){
|
||||
|
@ -302,7 +302,6 @@ public class WjxWjxxTmlbController extends JeecgController<WjxWjxxTmlb, IWjxWjxx
|
|||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("wjxWjxxTmlb:wjx_wjxx_tmlb:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
|
@ -369,4 +368,44 @@ public class WjxWjxxTmlbController extends JeecgController<WjxWjxxTmlb, IWjxWjxx
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param wjxWjxxTmlb
|
||||
*/
|
||||
@RequestMapping(value = "/exportDownXls")
|
||||
public ModelAndView exportDownXls(HttpServletRequest request, WjxWjxxTmlb wjxWjxxTmlb) {
|
||||
// Step.1 组装查询条件查询数据
|
||||
QueryWrapper<WjxWjxxTmlb> queryWrapper = QueryGenerator.initQueryWrapper(wjxWjxxTmlb, 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<WjxWjxxTmlb> wjxWjxxTmlbList = wjxWjxxTmlbService.list(queryWrapper);
|
||||
|
||||
// Step.3 组装pageList
|
||||
List<WjxWjxxTmlbPage> pageList = new ArrayList<WjxWjxxTmlbPage>();
|
||||
for (WjxWjxxTmlb main : wjxWjxxTmlbList) {
|
||||
WjxWjxxTmlbPage vo = new WjxWjxxTmlbPage();
|
||||
BeanUtils.copyProperties(main, vo);
|
||||
List<WjxWjxxTmxx> wjxWjxxTmxxList = wjxWjxxTmxxService.selectByMainId(main.getId());
|
||||
vo.setWjxWjxxTmxxList(wjxWjxxTmxxList);
|
||||
pageList.add(vo);
|
||||
}
|
||||
|
||||
// Step.4 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "题目信息列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, WjxWjxxTmlbPage.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("题目信息数据", "导出人:"+sysUser.getRealname(), "题目信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,7 +47,6 @@ public class WjxWjxxTmlb implements Serializable {
|
|||
@ApiModelProperty(value = "修改时间")
|
||||
private java.util.Date updateTime;
|
||||
/**问卷id*/
|
||||
@Excel(name = "问卷id", width = 15)
|
||||
@ApiModelProperty(value = "问卷id")
|
||||
private java.lang.String mainId;
|
||||
/**题目编号*/
|
||||
|
@ -55,11 +54,11 @@ public class WjxWjxxTmlb implements Serializable {
|
|||
@ApiModelProperty(value = "题目编号")
|
||||
private java.lang.Integer wjIndex;
|
||||
/**题目类型*/
|
||||
@Excel(name = "题目类型", width = 15)
|
||||
@Excel(name = "题目类型", width = 15,dicCode = "wj_type")
|
||||
@ApiModelProperty(value = "题目类型")
|
||||
@Dict(dicCode = "wj_type")
|
||||
private java.lang.Integer wjType;
|
||||
/**题目细分类*/
|
||||
@Excel(name = "题目细分类", width = 15)
|
||||
@ApiModelProperty(value = "题目细分类")
|
||||
private java.lang.Integer wjSubtype;
|
||||
/**问题标题*/
|
||||
|
@ -67,11 +66,9 @@ public class WjxWjxxTmlb implements Serializable {
|
|||
@ApiModelProperty(value = "问题标题")
|
||||
private java.lang.String wjTitle;
|
||||
/**是否必填*/
|
||||
@Excel(name = "是否必填", width = 15)
|
||||
@ApiModelProperty(value = "是否必填")
|
||||
private java.lang.String isRequir;
|
||||
/**是否是考试*/
|
||||
@Excel(name = "是否是考试", width = 15)
|
||||
@ApiModelProperty(value = "是否是考试")
|
||||
private java.lang.String wjCeshi;
|
||||
/**问题分值*/
|
||||
|
@ -79,7 +76,6 @@ public class WjxWjxxTmlb implements Serializable {
|
|||
@ApiModelProperty(value = "问题分值")
|
||||
private java.lang.Double wjScore;
|
||||
/**题目解析*/
|
||||
@Excel(name = "题目解析", width = 15)
|
||||
@ApiModelProperty(value = "题目解析")
|
||||
private java.lang.String wjParsing;
|
||||
/**正确答案*/
|
||||
|
@ -87,7 +83,6 @@ public class WjxWjxxTmlb implements Serializable {
|
|||
@ApiModelProperty(value = "正确答案")
|
||||
private java.lang.String wjAnswer;
|
||||
/**填写提示*/
|
||||
@Excel(name = "填写提示", width = 15)
|
||||
@ApiModelProperty(value = "填写提示")
|
||||
private java.lang.String prompt;
|
||||
|
||||
|
|
|
@ -57,7 +57,6 @@ public class WjxWjxxTmxx implements Serializable {
|
|||
@ApiModelProperty(value = "选项标题")
|
||||
private java.lang.String itemTitle;
|
||||
/**选项文字描述*/
|
||||
@Excel(name = "选项文字描述", width = 15)
|
||||
@ApiModelProperty(value = "选项文字描述")
|
||||
private java.lang.String itemImageText;
|
||||
/**正确答案*/
|
||||
|
@ -66,7 +65,6 @@ public class WjxWjxxTmxx implements Serializable {
|
|||
@Dict(dicCode = "wj_zqda")
|
||||
private java.lang.String itemSelected;
|
||||
/**选项分值*/
|
||||
@Excel(name = "选项分值", width = 15)
|
||||
@ApiModelProperty(value = "选项分值")
|
||||
private java.lang.Double itemScore;
|
||||
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
<mapper namespace="org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmlbMapper">
|
||||
|
||||
<select id="distinctList" resultType="org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmlb">
|
||||
select distinct max(id) id,wj_title,wj_score,wj_sytype,wj_type,wj_answer from wjx_wjxx_tmlb
|
||||
select a.* from wjx_wjxx_tmlb a
|
||||
, (
|
||||
select distinct max(id) id,wj_title,wj_score,wj_type,wj_answer from wjx_wjxx_tmlb
|
||||
${ew.customSqlSegment}
|
||||
|
||||
) b
|
||||
where a.id = b.id
|
||||
</select>
|
||||
</mapper>
|
|
@ -46,20 +46,21 @@ public class WjxWjxxTmlbServiceImpl extends ServiceImpl<WjxWjxxTmlbMapper, WjxWj
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveMain(WjxWjxxTmlb wjxWjxxTmlb, List<WjxWjxxTmxx> wjxWjxxTmxxList) {
|
||||
wjxWjxxTmlb.setWjLeixing("6");
|
||||
wjxWjxxTmlbMapper.insert(wjxWjxxTmlb);
|
||||
if(wjxWjxxTmxxList!=null && wjxWjxxTmxxList.size()>0) {
|
||||
for(WjxWjxxTmxx entity:wjxWjxxTmxxList) {
|
||||
//外键设置
|
||||
entity.setMainId(wjxWjxxTmlb.getId());
|
||||
entity.setWjIndex(wjxWjxxTmlb.getWjIndex());
|
||||
String itemSelected[] = wjxWjxxTmlb.getItemSelected().split(",");
|
||||
String sfxz = "false";
|
||||
for(String par:itemSelected){
|
||||
if(StringUtils.equals(par, entity.getItemIndex().toString())){
|
||||
sfxz = "true";
|
||||
}
|
||||
}
|
||||
entity.setItemSelected(sfxz);
|
||||
// String itemSelected[] = wjxWjxxTmlb.getItemSelected().split(",");
|
||||
// String sfxz = wjxWjxxTmlb.getItemSelected();
|
||||
// for(String par:itemSelected){
|
||||
// if(StringUtils.equals(par, entity.getItemIndex().toString())){
|
||||
// sfxz = "true";
|
||||
// }
|
||||
// }
|
||||
// entity.setItemSelected(sfxz);
|
||||
wjxWjxxTmxxMapper.insert(entity);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,6 @@ public class WjxWjxxTmlbPage {
|
|||
@ApiModelProperty(value = "修改时间")
|
||||
private java.util.Date updateTime;
|
||||
/**问卷id*/
|
||||
@Excel(name = "问卷id", width = 15)
|
||||
@ApiModelProperty(value = "问卷id")
|
||||
private java.lang.String mainId;
|
||||
/**题目编号*/
|
||||
|
@ -52,11 +51,11 @@ public class WjxWjxxTmlbPage {
|
|||
@ApiModelProperty(value = "题目编号")
|
||||
private java.lang.Integer wjIndex;
|
||||
/**题目类型*/
|
||||
@Excel(name = "题目类型", width = 15)
|
||||
@Excel(name = "题目类型", width = 15,dicCode = "wj_type")
|
||||
@ApiModelProperty(value = "题目类型")
|
||||
@Dict(dicCode = "wj_type")
|
||||
private java.lang.Integer wjType;
|
||||
/**题目细分类*/
|
||||
@Excel(name = "题目细分类", width = 15)
|
||||
@ApiModelProperty(value = "题目细分类")
|
||||
private java.lang.Integer wjSubtype;
|
||||
/**问题标题*/
|
||||
|
@ -64,11 +63,9 @@ public class WjxWjxxTmlbPage {
|
|||
@ApiModelProperty(value = "问题标题")
|
||||
private java.lang.String wjTitle;
|
||||
/**是否必填*/
|
||||
@Excel(name = "是否必填", width = 15)
|
||||
@ApiModelProperty(value = "是否必填")
|
||||
private java.lang.String isRequir;
|
||||
/**是否是考试*/
|
||||
@Excel(name = "是否是考试", width = 15)
|
||||
@ApiModelProperty(value = "是否是考试")
|
||||
private java.lang.String wjCeshi;
|
||||
/**问题分值*/
|
||||
|
@ -76,7 +73,6 @@ public class WjxWjxxTmlbPage {
|
|||
@ApiModelProperty(value = "问题分值")
|
||||
private java.lang.Double wjScore;
|
||||
/**题目解析*/
|
||||
@Excel(name = "题目解析", width = 15)
|
||||
@ApiModelProperty(value = "题目解析")
|
||||
private java.lang.String wjParsing;
|
||||
/**正确答案*/
|
||||
|
@ -84,7 +80,6 @@ public class WjxWjxxTmlbPage {
|
|||
@ApiModelProperty(value = "正确答案")
|
||||
private java.lang.String wjAnswer;
|
||||
/**填写提示*/
|
||||
@Excel(name = "填写提示", width = 15)
|
||||
@ApiModelProperty(value = "填写提示")
|
||||
private java.lang.String prompt;
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public class ZyGonggaoController extends JeecgController<ZyGonggao, IZyGonggaoSe
|
|||
HttpServletRequest req) {
|
||||
QueryWrapper<ZyGonggao> queryWrapper = QueryGenerator.initQueryWrapper(zyGonggao, req.getParameterMap());
|
||||
Page<ZyGonggao> page = new Page<ZyGonggao>(pageNo, pageSize);
|
||||
queryWrapper.eq(StringUtils.isNotBlank(zyGonggao.getTeano()),"create_by",zyGonggao.getTeano());
|
||||
// queryWrapper.eq(StringUtils.isNotBlank(zyGonggao.getTeano()),"create_by",zyGonggao.getTeano());
|
||||
IPage<ZyGonggao> pageList = zyGonggaoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
|
||||
|
||||
QueryWrapper<ZyInfo> queryWrapper2 = new QueryWrapper<>();
|
||||
queryWrapper2.eq("create_by",zyInfo.getTeano());
|
||||
// queryWrapper2.eq("create_by",zyInfo.getTeano());
|
||||
queryWrapper2.eq("rwbh",zyInfo.getRwbh());
|
||||
queryWrapper2.eq("xnxq",zyInfo.getXnxq());
|
||||
queryWrapper2.eq("zy_status","0");
|
||||
|
@ -130,11 +130,11 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
|
||||
zyInfoStudentService.deleteMainId(zyInfo2.getId());
|
||||
for(Xxhbbks xxhbbks:list){
|
||||
ZyInfoStudent zyInfoStudent = new ZyInfoStudent();
|
||||
zyInfoStudent.setMainId(zyInfo2.getId());
|
||||
zyInfoStudent.setCreateBy(xxhbbks.getXh());
|
||||
zyInfoStudent.setStudentName(xxhbbks.getXm());
|
||||
zyInfoStudentService.save(zyInfoStudent);
|
||||
// ZyInfoStudent zyInfoStudent = new ZyInfoStudent();
|
||||
// zyInfoStudent.setMainId(zyInfo2.getId());
|
||||
// zyInfoStudent.setCreateBy(xxhbbks.getXh());
|
||||
// zyInfoStudent.setStudentName(xxhbbks.getXm());
|
||||
// zyInfoStudentService.save(zyInfoStudent);
|
||||
|
||||
//作业代办提醒
|
||||
ZyDbtx zyDbtx = new ZyDbtx();
|
||||
|
@ -175,9 +175,16 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
queryWrapper.eq(StringUtils.isNotBlank(zyInfo.getTeano()),"a.create_by",zyInfo.getTeano());
|
||||
queryWrapper.orderByAsc("a.sort - 0");
|
||||
IPage<ZyInfo> pageList = zyInfoService.page(page, queryWrapper);
|
||||
pageList.getRecords().forEach(zyInfo1 -> {
|
||||
String xkrs = kcKechengbiao.getXkrs();
|
||||
zyInfo1.setXkxs(xkrs);
|
||||
int wtj = Integer.parseInt(xkrs)-Integer.parseInt(zyInfo1.getDpynum())-Integer.parseInt(zyInfo1.getYpynum());
|
||||
zyInfo1.setWtjnum(wtj+"");
|
||||
});
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
|
@ -221,7 +228,7 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
|
||||
QueryWrapper<ZyInfo> zyInfoQueryWrapper = new QueryWrapper<>();
|
||||
zyInfoQueryWrapper.eq("xnxq",zyInfo.getXnxq());
|
||||
zyInfoQueryWrapper.eq("create_by",zyInfo.getTeano());
|
||||
// zyInfoQueryWrapper.eq("create_by",zyInfo.getTeano());
|
||||
zyInfoQueryWrapper.eq("rwbh",zyInfo.getRwbh());
|
||||
if(StringUtils.isNotBlank(zyInfo.getZyLeixing())){
|
||||
zyInfoQueryWrapper.eq("zy_leixing",zyInfo.getZyLeixing());
|
||||
|
@ -248,6 +255,69 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ZyInfo zyInfo) {
|
||||
zyInfoService.updateById(zyInfo);
|
||||
|
||||
|
||||
ZyInfo zyInfo2 = zyInfoService.getById(zyInfo.getId());
|
||||
if(StringUtils.equals(zyInfo2.getZyStatus(),"1")){
|
||||
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
|
||||
kcKechengbiaoQueryWrapper.eq("rwbh",zyInfo.getRwbh());
|
||||
kcKechengbiaoQueryWrapper.eq("jgh",zyInfo.getCreateBy());
|
||||
kcKechengbiaoQueryWrapper.eq("xqxn",zyInfo.getXnxq());
|
||||
kcKechengbiaoQueryWrapper.last("limit 1");
|
||||
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
|
||||
|
||||
QueryWrapper<ZyDbtx> zyDbtxQueryWrapper = new QueryWrapper<>();
|
||||
zyDbtxQueryWrapper.eq("type","2");//发送作业
|
||||
zyDbtxQueryWrapper.eq("rwbh",zyInfo.getRwbh());
|
||||
List<ZyDbtx> dbtxlist = zyDbtxService.list(zyDbtxQueryWrapper);
|
||||
String xharrs[] = new String[dbtxlist.size()];
|
||||
for(int i=0;i<dbtxlist.size();i++){
|
||||
xharrs[i] = dbtxlist.get(i).getCreateBy();
|
||||
}
|
||||
|
||||
QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.apply("a.xh = b.xh");
|
||||
queryWrapper.eq("b.KCAPZBBH",zyInfo2.getRwbh());
|
||||
if(xharrs.length>0){
|
||||
queryWrapper.notIn("a.xh",xharrs);
|
||||
}
|
||||
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
|
||||
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
for(Xxhbbks xxhbbks:list) {
|
||||
|
||||
//作业代办提醒
|
||||
ZyDbtx zyDbtx = new ZyDbtx();
|
||||
zyDbtx.setCreateBy(xxhbbks.getXh());
|
||||
zyDbtx.setMainId(zyInfo.getId());
|
||||
zyDbtx.setRwbh(zyInfo.getRwbh());
|
||||
String hpts = "";
|
||||
if (StringUtils.equals(zyInfo.getXshpkg(), "1")) {
|
||||
hpts = "互评时间:" + DateUtils.formatDate(zyInfo.getXshpkssj(), "yyyy-MM-dd HH:mm") + " ~ " + DateUtils.formatDate(zyInfo.getXshpjssj(), "yyyy-MM-dd HH:mm");
|
||||
}
|
||||
|
||||
if (StringUtils.equals(zyInfo.getZyLeixing(), "0")) {
|
||||
zyDbtx.setType("0");//0发布作业 1评分 2测验 3问卷 4讨论
|
||||
zyDbtx.setContent(user.getRealname() + "老师主讲的[" + kcKechengbiao.getKcmc() + "]课程于" + DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss") + "发布了一篇题目为“" + zyInfo.getTitle() + "”的作业,该作业提交时间为:" + DateUtils.formatDate(zyInfo.getStartTime(), "yyyy-MM-dd HH:mm") + " ~ " + DateUtils.formatDate(zyInfo.getEndTime(), "yyyy-MM-dd HH:mm") + ",请按时完成! " + hpts);
|
||||
} else if (StringUtils.equals(zyInfo.getZyLeixing(), "1")) {
|
||||
zyDbtx.setType("10");//0发布作业 1评分 2测验 3问卷 4讨论
|
||||
zyDbtx.setContent(user.getRealname() + "老师主讲的[" + kcKechengbiao.getKcmc() + "]课程于" + DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss") + "发布了一篇题目为“" + zyInfo.getTitle() + "”的期末考试,该期末考试提交时间为:" + DateUtils.formatDate(zyInfo.getStartTime(), "yyyy-MM-dd HH:mm") + " ~ " + DateUtils.formatDate(zyInfo.getEndTime(), "yyyy-MM-dd HH:mm") + ",请按时完成! " + hpts);
|
||||
}
|
||||
zyDbtx.setFlag("0");
|
||||
zyDbtx.setFbr(user.getUsername());
|
||||
zyDbtxService.save(zyDbtx);
|
||||
|
||||
// try {
|
||||
// KcWechatSendLog kcWechatSendLog = new KcWechatSendLog();
|
||||
// kcWechatSendLog.setOpenid(xxhbbks.getXh());
|
||||
// kcWechatSendLog.setYtkcs(zyDbtx.getContent());
|
||||
// sendWxmessage(kcWechatSendLog);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
@ -313,12 +383,12 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
kcKechengbiaoQueryWrapper.last("limit 1");
|
||||
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
|
||||
for(Xxhbbks xxhbbks:list){
|
||||
ZyInfoStudent zyInfoStudent = new ZyInfoStudent();
|
||||
zyInfoStudent.setMainId(zyInfo.getId());
|
||||
zyInfoStudent.setCreateBy(xxhbbks.getXh());
|
||||
zyInfoStudent.setStudentName(xxhbbks.getXm());
|
||||
zyInfoStudent.setZyLeixing(zyInfo.getZyLeixing());
|
||||
zyInfoStudentService.save(zyInfoStudent);
|
||||
// ZyInfoStudent zyInfoStudent = new ZyInfoStudent();
|
||||
// zyInfoStudent.setMainId(zyInfo.getId());
|
||||
// zyInfoStudent.setCreateBy(xxhbbks.getXh());
|
||||
// zyInfoStudent.setStudentName(xxhbbks.getXm());
|
||||
// zyInfoStudent.setZyLeixing(zyInfo.getZyLeixing());
|
||||
// zyInfoStudentService.save(zyInfoStudent);
|
||||
|
||||
//作业代办提醒
|
||||
ZyDbtx zyDbtx = new ZyDbtx();
|
||||
|
@ -418,7 +488,6 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
zyInfoService.removeById(id);
|
||||
QueryWrapper<ZyInfo> zyInfoQueryWrapper = new QueryWrapper<>();
|
||||
zyInfoQueryWrapper.eq("rwbh",zyInfo.getRwbh());
|
||||
zyInfoQueryWrapper.eq("create_by",zyInfo.getCreateBy());
|
||||
zyInfoQueryWrapper.eq("xnxq",zyInfo.getXnxq());
|
||||
zyInfoQueryWrapper.eq("zy_leixing","0");
|
||||
zyInfoQueryWrapper.orderByAsc("sort-0");
|
||||
|
@ -497,10 +566,9 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
HttpServletRequest req) {
|
||||
QueryWrapper<ZyInfo> queryWrapper = QueryGenerator.initQueryWrapper("a",zyInfo, req.getParameterMap());
|
||||
Page<ZyInfo> page = new Page<ZyInfo>(pageNo, pageSize);
|
||||
queryWrapper.apply("a.id = b.main_id ");
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
queryWrapper.eq("b.create_by",sysUser.getUsername());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(zyInfo.getTeano()),"a.create_by",zyInfo.getTeano());
|
||||
queryWrapper.eq("c.KCAPZBBH",zyInfo.getRwbh());
|
||||
queryWrapper.eq("c.xh",sysUser.getUsername());
|
||||
queryWrapper.orderByDesc("a.sort");
|
||||
IPage<ZyInfo> pageList = zyInfoService.stuList(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
|
@ -610,8 +678,8 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
@ApiOperation(value="作业发布-通过id查询", notes="作业发布-通过id查询")
|
||||
@GetMapping(value = "/queryZyinfoByStuId")
|
||||
public Result<ZyInfo> queryZyinfoByStuId(@RequestParam(name="id",required=true) String id) {
|
||||
ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(id);
|
||||
ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId());
|
||||
// ZyInfoStudent zyInfoStudent = zyInfoStudentService.getById(id);
|
||||
ZyInfo zyInfo = zyInfoService.getById(id);
|
||||
return Result.OK(zyInfo);
|
||||
}
|
||||
|
||||
|
@ -746,7 +814,8 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
|
||||
@ApiOperation(value="作业发布-通过id查询", notes="作业发布-通过id查询")
|
||||
@GetMapping(value = "/zyzb")
|
||||
public Result<List<ZyInfo>> zyzb(@RequestParam(name="rwbh") String rwbh,@RequestParam(name="xqxn") String xqxn,@RequestParam(name="teano") String teano,@RequestParam(name="zyLeixing") String zyLeixing) {
|
||||
public Result<List<ZyInfo>> zyzb(@RequestParam(name="rwbh") String rwbh,@RequestParam(name="xqxn") String xqxn,@RequestParam(name="zyLeixing") String zyLeixing) {
|
||||
String teano = null;
|
||||
List<ZyInfo> zyInfo = zyInfoService.zyzb(rwbh,xqxn,teano,zyLeixing);
|
||||
return Result.OK(zyInfo);
|
||||
}
|
||||
|
|
|
@ -28,4 +28,5 @@ public interface ZyInfoMapper extends BaseMapper<ZyInfo> {
|
|||
ZyInfo getKechengById(@Param("id") String id);
|
||||
|
||||
List<ZyInfo> zyzb(@Param("rwbh")String rwbh, @Param("xqxn")String xqxn, @Param("teano")String teano, @Param("zyLeixing")String zyLeixing);
|
||||
|
||||
}
|
||||
|
|
|
@ -3,9 +3,13 @@
|
|||
<mapper namespace="org.jeecg.modules.kc.zyInfo.mapper.ZyInfoMapper">
|
||||
|
||||
<select id="stuList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
|
||||
select a.*,b.id as stuId ,b.file_path as stuFilePath,b.score as stuscore,b.wwxsl,b.nwxsl,b.aigcxsl,b.xnxsl,b.pdf_path as stuPdfPath,b.zzdf,b.xshpfs,
|
||||
select
|
||||
distinct
|
||||
a.*,b.id as stuId ,b.file_path as stuFilePath,b.score as stuscore,b.wwxsl,b.nwxsl,b.aigcxsl,b.xnxsl,b.pdf_path as stuPdfPath,b.zzdf,b.xshpfs,
|
||||
b.wwsftg,b.nwsftg,b.aigcsftg,b.xnsftg,round(ifnull(b.jxfs,'0') + ifnull(b.jxfs2,'0'),1) as jxfs, GREATEST(ifnull(b.wwxsl,0),ifnull(b.nwxsl,0),ifnull(b.aigcxsl,0),ifnull(b.xnxsl,0)) as zgccl,a.score as zyzb,b.score_fabu,b.py_content,b.py_file_path
|
||||
from zy_info a ,zy_info_student b
|
||||
from zy_info a
|
||||
LEFT JOIN xxhbxsxkb c on a.rwbh = c.KCAPZBBH
|
||||
left join zy_info_student b on a.id = b.main_id and b.create_by = c.xh
|
||||
${ew.customSqlSegment}
|
||||
|
||||
</select>
|
||||
|
|
|
@ -26,4 +26,5 @@ public interface IZyInfoService extends IService<ZyInfo> {
|
|||
ZyInfo getKechengById(String id);
|
||||
|
||||
List<ZyInfo> zyzb(String rwbh, String xqxn, String teano, String zyLeixing);
|
||||
|
||||
}
|
||||
|
|
|
@ -46,4 +46,5 @@ public class ZyInfoServiceImpl extends ServiceImpl<ZyInfoMapper, ZyInfo> impleme
|
|||
public List<ZyInfo> zyzb(String rwbh, String xqxn, String teano, String zyLeixing) {
|
||||
return baseMapper.zyzb(rwbh,xqxn,teano,zyLeixing);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -195,6 +195,74 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
|
|||
}
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param zyInfoStudent
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "学生提交作业-分页列表查询")
|
||||
@ApiOperation(value="学生提交作业-分页列表查询", notes="学生提交作业-分页列表查询")
|
||||
@GetMapping(value = "/getList2")
|
||||
public Result<IPage<ZyInfoStudent>> getList2(ZyInfoStudent zyInfoStudent,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
||||
QueryWrapper<ZyInfoStudent> queryWrapper = QueryGenerator.initQueryWrapper("a",zyInfoStudent, req.getParameterMap());
|
||||
Page<ZyInfoStudent> page = new Page<ZyInfoStudent>(pageNo, pageSize);
|
||||
|
||||
if(StringUtils.isNotEmpty(zyInfoStudent.getQueryType())){
|
||||
if(StringUtils.equals("1",zyInfoStudent.getQueryType())){//未提交
|
||||
queryWrapper.isNull("a.file_path");
|
||||
}else if(StringUtils.equals("2",zyInfoStudent.getQueryType())){//已提交
|
||||
queryWrapper.isNotNull("a.file_path");
|
||||
}else if(StringUtils.equals("3",zyInfoStudent.getQueryType())){//未评阅
|
||||
queryWrapper.isNull("a.score");
|
||||
}else if(StringUtils.equals("4",zyInfoStudent.getQueryType())){//已评阅
|
||||
queryWrapper.isNotNull("a.score");
|
||||
}else if(StringUtils.equals("5",zyInfoStudent.getQueryType())){//已评阅
|
||||
queryWrapper.isNull("a.score");
|
||||
queryWrapper.isNotNull("a.file_path");
|
||||
}
|
||||
}
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(zyInfoStudent.getYwid()),"b.id",zyInfoStudent.getYwid());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(zyInfoStudent.getRwbh()),"c.KCAPZBBH",zyInfoStudent.getRwbh());
|
||||
IPage<ZyInfoStudent> pageList = zyInfoStudentService.getList2(page, queryWrapper);
|
||||
for(ZyInfoStudent ZyInfoStudentPar:pageList.getRecords()){
|
||||
List<ZyInfoStudent> list = zyInfoStudentService.getCcjg(ZyInfoStudentPar);
|
||||
for(ZyInfoStudent par:list){
|
||||
if(StringUtils.equals(par.getCcType(),"0")){//外网
|
||||
ZyInfoStudentPar.setWwpaperdownurl(par.getPaperdownurl());
|
||||
ZyInfoStudentPar.setWwpaperviewurl(par.getPaperviewurl());
|
||||
ZyInfoStudentPar.setWwfilestateid(par.getFilestateid());
|
||||
ZyInfoStudentPar.setWwmessage(par.getMessage());
|
||||
}else if(StringUtils.equals(par.getCcType(),"1")){//作业
|
||||
ZyInfoStudentPar.setZypaperdownurl(par.getPaperdownurl());
|
||||
ZyInfoStudentPar.setZypaperviewurl(par.getPaperviewurl());
|
||||
ZyInfoStudentPar.setZyfilestateid(par.getFilestateid());
|
||||
ZyInfoStudentPar.setZymessage(par.getMessage());
|
||||
}else if(StringUtils.equals(par.getCcType(),"2")){//aigc
|
||||
ZyInfoStudentPar.setAigcpaperdownurl(par.getPaperdownurl());
|
||||
ZyInfoStudentPar.setAigcpaperviewurl(par.getPaperviewurl());
|
||||
ZyInfoStudentPar.setAigcfilestateid(par.getFilestateid());
|
||||
ZyInfoStudentPar.setAigcmessage(par.getMessage());
|
||||
}else if(StringUtils.equals(par.getCcType(),"3")){//学校
|
||||
ZyInfoStudentPar.setXxpaperdownurl(par.getPaperdownurl());
|
||||
ZyInfoStudentPar.setXxpaperviewurl(par.getPaperviewurl());
|
||||
ZyInfoStudentPar.setXxfilestateid(par.getFilestateid());
|
||||
ZyInfoStudentPar.setXxmessage(par.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
|
@ -528,8 +596,24 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
|
|||
@RequestMapping(value = "/zyscStu", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<Object> zyscStu(@RequestBody ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
|
||||
|
||||
ZyInfoStudent stuPar = zyInfoStudentService.getById(zyInfoStudent.getId());
|
||||
ZyInfo zyInfo = zyInfoService.getById(stuPar.getMainId());
|
||||
ZyInfoStudent stuPar = zyInfoStudentService.getById(zyInfoStudent.getStuId());
|
||||
ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId());
|
||||
if(stuPar==null) {
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
ZyInfoStudent zyInfoStudent1 = new ZyInfoStudent();
|
||||
zyInfoStudent1.setMainId(zyInfo.getId());
|
||||
zyInfoStudent1.setCreateBy(user.getUsername());
|
||||
zyInfoStudent1.setCreateTime(new Date());
|
||||
zyInfoStudent1.setFilePath(zyInfoStudent.getFilePath());
|
||||
zyInfoStudent1.setStudentName(user.getRealname());
|
||||
zyInfoStudentService.save(zyInfoStudent1);
|
||||
stuPar =zyInfoStudent1;
|
||||
zyInfoStudent =zyInfoStudent1;
|
||||
}else{
|
||||
stuPar.setFilePath(zyInfoStudent.getFilePath());
|
||||
|
||||
zyInfoStudent =stuPar;
|
||||
}
|
||||
|
||||
//判断是否可以取消代办xshpkg
|
||||
if(StringUtils.equals("0",zyInfo.getXshpkg())){
|
||||
|
|
|
@ -217,5 +217,9 @@ public class ZyInfoStudent implements Serializable {
|
|||
private String pfbz;//评分标准
|
||||
@TableField(exist = false)
|
||||
private String sturead;//评分标准是否允许学生查看
|
||||
@TableField(exist = false)
|
||||
private String ywid;//业务id
|
||||
@TableField(exist = false)
|
||||
private String stuId;//学生作业临时id
|
||||
|
||||
}
|
||||
|
|
|
@ -42,4 +42,6 @@ public interface ZyInfoStudentMapper extends BaseMapper<ZyInfoStudent> {
|
|||
IPage<ZyInfoStudent> getHpxxList(Page<ZyInfoStudent> page, @Param(Constants.WRAPPER) QueryWrapper<ZyInfoStudent> queryWrapper,@Param("zyStuId")String zyStuId);
|
||||
|
||||
void updateJxfs2(ZyInfo jspc);
|
||||
|
||||
IPage<ZyInfoStudent> getList2(Page<ZyInfoStudent> page,@Param(Constants.WRAPPER) QueryWrapper<ZyInfoStudent> queryWrapper);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,20 @@
|
|||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="getList2" resultType="org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent">
|
||||
select
|
||||
ifnull(a.id,c.xh) id,c.xh as create_by,a.create_time,a.update_by,a.update_time,a.main_id,a.file_path,a.wwxsl,
|
||||
a.nwxsl,a.aigcxsl,a.wwsftg,a.nwsftg,a.aigcsftg,a.score,d.xm as student_name,a.pdf_path,a.score_fabu,
|
||||
a.cdlx,a.xnxsl,a.xnsftg,a.publish_time,a.hpcs,a.xshpfs,a.jxfs,a.zzdf,a.jxfs2,a.zy_leixing,a.py_content,
|
||||
a.py_file_path,a.sfsckhcl,a.fwq_path,a.khcl_time,
|
||||
round(IFNULL(a.jxfs,'0') + IFNULL(a.jxfs2,'0'),2) as jxzf,b.wwcc,b.nwcc,b.aigccc,b.xncc,b.title as zyname, GREATEST(ifnull(a.wwxsl,0),ifnull(a.nwxsl,0),ifnull(a.aigcxsl,0),ifnull(a.xnxsl,0)) as zgccl,b.wwtgl as alltgl
|
||||
from zy_info b
|
||||
join xxhbxsxkb c on c.kcapzbbh = b.rwbh
|
||||
join xxhbbks d on c.xh = d.xh
|
||||
left join zy_info_student a on a.create_by = c.xh and a.main_id = b.id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="cdxxlist" resultType="org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent">
|
||||
select a.*,b.wwcc,b.nwcc,b.aigccc,b.xncc,b.title as zyname from zy_info_student a
|
||||
left join zy_info b on a.main_id = b.id
|
||||
|
|
|
@ -42,4 +42,6 @@ public interface IZyInfoStudentService extends IService<ZyInfoStudent> {
|
|||
IPage<ZyInfoStudent> getHpxxList(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper,String zyStuId);
|
||||
|
||||
void batchKhcl(List<String> list);
|
||||
|
||||
IPage<ZyInfoStudent> getList2(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper);
|
||||
}
|
||||
|
|
|
@ -204,6 +204,11 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ZyInfoStudent> getList2(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper) {
|
||||
return baseMapper.getList2(page,queryWrapper);
|
||||
}
|
||||
|
||||
private void delweipulunwen(ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
|
||||
zyInfoStudent.setQueryType("0");//外网查重数据
|
||||
String paperids = baseMapper.getWpFile(zyInfoStudent);
|
||||
|
|
|
@ -0,0 +1,174 @@
|
|||
package org.jeecg.modules.kc.zyZyxx.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
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;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.kc.zyZyxx.entity.ZyZyxx;
|
||||
import org.jeecg.modules.kc.zyZyxx.service.IZyZyxxService;
|
||||
|
||||
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.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.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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: 2024-09-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="资源信息")
|
||||
@RestController
|
||||
@RequestMapping("/zyZyxx/zyZyxx")
|
||||
@Slf4j
|
||||
public class ZyZyxxController extends JeecgController<ZyZyxx, IZyZyxxService> {
|
||||
@Autowired
|
||||
private IZyZyxxService zyZyxxService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param zyZyxx
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "资源信息-分页列表查询")
|
||||
@ApiOperation(value="资源信息-分页列表查询", notes="资源信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<ZyZyxx>> queryPageList(ZyZyxx zyZyxx,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ZyZyxx> queryWrapper = QueryGenerator.initQueryWrapper(zyZyxx, req.getParameterMap());
|
||||
Page<ZyZyxx> page = new Page<ZyZyxx>(pageNo, pageSize);
|
||||
IPage<ZyZyxx> pageList = zyZyxxService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param zyZyxx
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "资源信息-添加")
|
||||
@ApiOperation(value="资源信息-添加", notes="资源信息-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ZyZyxx zyZyxx) {
|
||||
zyZyxxService.save(zyZyxx);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param zyZyxx
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "资源信息-编辑")
|
||||
@ApiOperation(value="资源信息-编辑", notes="资源信息-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ZyZyxx zyZyxx) {
|
||||
zyZyxxService.updateById(zyZyxx);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "资源信息-通过id删除")
|
||||
@ApiOperation(value="资源信息-通过id删除", notes="资源信息-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
zyZyxxService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "资源信息-批量删除")
|
||||
@ApiOperation(value="资源信息-批量删除", notes="资源信息-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.zyZyxxService.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<ZyZyxx> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ZyZyxx zyZyxx = zyZyxxService.getById(id);
|
||||
if(zyZyxx==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(zyZyxx);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param zyZyxx
|
||||
*/
|
||||
@RequiresPermissions("zyZyxx:zy_zyxx:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ZyZyxx zyZyxx) {
|
||||
return super.exportXls(request, zyZyxx, ZyZyxx.class, "资源信息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("zyZyxx:zy_zyxx:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ZyZyxx.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package org.jeecg.modules.kc.zyZyxx.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: 2024-09-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("zy_zyxx")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="zy_zyxx对象", description="资源信息")
|
||||
public class ZyZyxx implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**createBy*/
|
||||
@ApiModelProperty(value = "createBy")
|
||||
private java.lang.String createBy;
|
||||
/**createTime*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "createTime")
|
||||
private java.util.Date createTime;
|
||||
/**updateBy*/
|
||||
@ApiModelProperty(value = "updateBy")
|
||||
private java.lang.String updateBy;
|
||||
/**updateTime*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "updateTime")
|
||||
private java.util.Date updateTime;
|
||||
/**标题*/
|
||||
@Excel(name = "标题", width = 15)
|
||||
@ApiModelProperty(value = "标题")
|
||||
private java.lang.String title;
|
||||
/**内容*/
|
||||
@Excel(name = "内容", width = 15)
|
||||
@ApiModelProperty(value = "内容")
|
||||
private java.lang.String content;
|
||||
/**附件*/
|
||||
@Excel(name = "附件", width = 15)
|
||||
@ApiModelProperty(value = "附件")
|
||||
private java.lang.String filePath;
|
||||
/**是否发布*/
|
||||
@Excel(name = "是否发布", width = 15, dicCode = "yn")
|
||||
@Dict(dicCode = "yn")
|
||||
@ApiModelProperty(value = "是否发布")
|
||||
private java.lang.String sffb;
|
||||
/**任务编号*/
|
||||
@ApiModelProperty(value = "任务编号")
|
||||
private java.lang.String rwbh;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package org.jeecg.modules.kc.zyZyxx.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.kc.zyZyxx.entity.ZyZyxx;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 资源信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-09-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ZyZyxxMapper extends BaseMapper<ZyZyxx> {
|
||||
|
||||
}
|
|
@ -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.kc.zyZyxx.mapper.ZyZyxxMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package org.jeecg.modules.kc.zyZyxx.service;
|
||||
|
||||
import org.jeecg.modules.kc.zyZyxx.entity.ZyZyxx;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 资源信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-09-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IZyZyxxService extends IService<ZyZyxx> {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.jeecg.modules.kc.zyZyxx.service.impl;
|
||||
|
||||
import org.jeecg.modules.kc.zyZyxx.entity.ZyZyxx;
|
||||
import org.jeecg.modules.kc.zyZyxx.mapper.ZyZyxxMapper;
|
||||
import org.jeecg.modules.kc.zyZyxx.service.IZyZyxxService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 资源信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-09-19
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ZyZyxxServiceImpl extends ServiceImpl<ZyZyxxMapper, ZyZyxx> implements IZyZyxxService {
|
||||
|
||||
}
|
Loading…
Reference in New Issue