修改bug
This commit is contained in:
parent
9da8923288
commit
2a8d14525e
|
@ -2,6 +2,7 @@ package org.jeecg.modules.kc.grab.SynchronizationService;
|
|||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.modules.kc.grab.SynchronizationService.base.BaseSync;
|
||||
import org.jeecg.modules.kc.wjxWjxx.service.IWjxWjxxService;
|
||||
import org.jeecg.modules.kc.zyCcjg.service.IZyCcjgService;
|
||||
import org.jeecg.modules.kc.zyInfo.service.IZyInfoService;
|
||||
import org.quartz.JobExecutionContext;
|
||||
|
@ -20,6 +21,8 @@ public class SyncZyCcjg extends BaseSync {
|
|||
|
||||
@Autowired
|
||||
private IZyInfoService zyInfoService;
|
||||
@Autowired
|
||||
private IWjxWjxxService wjxWjxxService;
|
||||
|
||||
/**
|
||||
* 若参数变量名修改 QuartzJobController中也需对应修改
|
||||
|
@ -48,6 +51,12 @@ public class SyncZyCcjg extends BaseSync {
|
|||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
wjxWjxxService.updateCeyanStatus();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,184 @@
|
|||
package org.jeecg.modules.kc.grab.imports.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.kc.grab.imports.entity.Xxhbxskc;
|
||||
import org.jeecg.modules.kc.grab.imports.service.IXxhbxskcService;
|
||||
import org.jeecg.modules.kc.zyCyFenxiang.entity.ZyCyFenxiang;
|
||||
import org.jeecg.modules.kc.zyCyFenxiang.service.IZyCyFenxiangService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 同步数据表(bks)
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-04-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="同步数据表(bks)")
|
||||
@RestController
|
||||
@RequestMapping("/grab/xxhbxskc")
|
||||
@Slf4j
|
||||
public class XxhbxskcController extends JeecgController<Xxhbxskc, IXxhbxskcService> {
|
||||
@Autowired
|
||||
private IXxhbxskcService xxhbxskcService;
|
||||
@Autowired
|
||||
private IZyCyFenxiangService zyCyFenxiangService;
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param xxhbxskc
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "同步数据表(bks)-分页列表查询")
|
||||
@ApiOperation(value="同步数据表(bks)-分页列表查询", notes="同步数据表(bks)-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<Xxhbxskc>> queryPageList(Xxhbxskc xxhbxskc,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
String mainId = xxhbxskc.getMainId();
|
||||
QueryWrapper<Xxhbxskc> queryWrapper = QueryGenerator.initQueryWrapper(xxhbxskc, req.getParameterMap());
|
||||
if(StringUtils.isNotBlank(mainId)){
|
||||
QueryWrapper<ZyCyFenxiang> zyCyFenxiangQueryWrapper = new QueryWrapper<>();
|
||||
zyCyFenxiangQueryWrapper.eq("main_id",mainId);
|
||||
List<ZyCyFenxiang> list = zyCyFenxiangService.list(zyCyFenxiangQueryWrapper);
|
||||
if(list != null && list.size()>0){
|
||||
String arr = "";
|
||||
for(ZyCyFenxiang par : list){
|
||||
arr = arr +par.getTeacherNo()+",";
|
||||
}
|
||||
if(StringUtils.isNotBlank(arr)){
|
||||
arr = arr.substring(0,arr.length()-1);
|
||||
queryWrapper.notIn("gh",arr.split(","));
|
||||
}
|
||||
}
|
||||
}
|
||||
Page<Xxhbxskc> page = new Page<Xxhbxskc>(pageNo, pageSize);
|
||||
IPage<Xxhbxskc> pageList = xxhbxskcService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param xxhbxskc
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-添加")
|
||||
@ApiOperation(value="同步数据表(bks)-添加", notes="同步数据表(bks)-添加")
|
||||
@RequiresPermissions("grab:xxhbxskc:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody Xxhbxskc xxhbxskc) {
|
||||
xxhbxskcService.save(xxhbxskc);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param xxhbxskc
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-编辑")
|
||||
@ApiOperation(value="同步数据表(bks)-编辑", notes="同步数据表(bks)-编辑")
|
||||
@RequiresPermissions("grab:xxhbxskc:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody Xxhbxskc xxhbxskc) {
|
||||
xxhbxskcService.updateById(xxhbxskc);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-通过id删除")
|
||||
@ApiOperation(value="同步数据表(bks)-通过id删除", notes="同步数据表(bks)-通过id删除")
|
||||
@RequiresPermissions("grab:xxhbxskc:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
xxhbxskcService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-批量删除")
|
||||
@ApiOperation(value="同步数据表(bks)-批量删除", notes="同步数据表(bks)-批量删除")
|
||||
@RequiresPermissions("grab:xxhbxskc:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.xxhbxskcService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "同步数据表(bks)-通过id查询")
|
||||
@ApiOperation(value="同步数据表(bks)-通过id查询", notes="同步数据表(bks)-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<Xxhbxskc> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
Xxhbxskc xxhbxskc = xxhbxskcService.getById(id);
|
||||
if(xxhbxskc==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(xxhbxskc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param xxhbxskc
|
||||
*/
|
||||
@RequiresPermissions("grab:xxhbxskc:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, Xxhbxskc xxhbxskc) {
|
||||
return super.exportXls(request, xxhbxskc, Xxhbxskc.class, "同步数据表(bks)");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("grab:xxhbxskc:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, Xxhbxskc.class);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -84,4 +84,7 @@ public class Xxhbxskc implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private Integer mysqlnum;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String mainId;
|
||||
|
||||
}
|
||||
|
|
|
@ -344,4 +344,13 @@ public class WjxDjxxController extends JeecgController<WjxDjxx, IWjxDjxxService>
|
|||
return Result.OK(res);
|
||||
}
|
||||
|
||||
@ApiOperation(value="修复答卷结果,因时间问题导致的数据", notes="修复答卷结果,因时间问题导致的数据")
|
||||
@PostMapping(value = "/getDjjg")
|
||||
public Result<String> getDjjg(@RequestBody WjxDjxx wjxDjxx) {
|
||||
String res = "提交成功!";
|
||||
res = wjxDjxxService.getDjjg(wjxDjxx);
|
||||
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,4 +45,6 @@ public interface IWjxDjxxService extends IService<WjxDjxx> {
|
|||
void cxjcWjxScore(String vid);
|
||||
|
||||
String updateDjjg(WjxDjxx wjxDjxx);
|
||||
|
||||
String getDjjg(WjxDjxx wjxDjxx);
|
||||
}
|
||||
|
|
|
@ -834,11 +834,169 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
|
||||
|
||||
|
||||
return "提交成功!";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDjjg(WjxDjxx wjxDjxxPar) {
|
||||
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String vid = wjxDjxxPar.getVid();
|
||||
if(vid ==null || vid.equals("")){
|
||||
return "此试卷错误,无法提交!";
|
||||
}
|
||||
|
||||
//调用接口,提交
|
||||
String jidRes = wjxDjxxPar.getJid();
|
||||
//调用接口,答卷查询
|
||||
Map<String,Object> selMap = new HashMap<>();
|
||||
selMap.put("vid",Integer.valueOf(vid));
|
||||
selMap.put("jid",Long.valueOf(jidRes));
|
||||
//调用接口,查询答卷结果
|
||||
String answerStr = wjxUtil.openapi(selMap,"1001002");
|
||||
if(!answerStr.equals("")) {
|
||||
JSONObject ansJsonResult = JSONObject.parseObject(answerStr);
|
||||
if (ansJsonResult.getBoolean("result")) {
|
||||
JSONObject ansDataJson = ansJsonResult.getJSONObject("data");
|
||||
String answerVid = ansDataJson.getString("vid");
|
||||
JSONObject answerJsonArray = ansDataJson.getJSONObject("answers");
|
||||
for (String key1 : answerJsonArray.keySet()) {
|
||||
JSONObject answer = answerJsonArray.getJSONObject(key1);
|
||||
String jidAns = answer.getString("jid");
|
||||
Integer answerSeconds = answer.getInteger("answer_seconds");
|
||||
Double score = answer.getDouble("score");
|
||||
Double totalScore = answer.getDouble("total_score");
|
||||
WjxDjxx wjxDjxx = new WjxDjxx();
|
||||
wjxDjxx.setVid(answerVid);
|
||||
wjxDjxx.setJid(jidAns);
|
||||
wjxDjxx.setAnswerSeconds(answerSeconds);
|
||||
wjxDjxx.setScore(score);
|
||||
wjxDjxx.setTotalScore(totalScore);
|
||||
//删除选项信息
|
||||
baseMapper.deleteDjItem(wjxDjxx);
|
||||
//处理选项
|
||||
JSONObject answerItemJson = answer.getJSONObject("answer_items");
|
||||
for (String key2 : answerItemJson.keySet()) {
|
||||
JSONObject answerItem = answerItemJson.getJSONObject(key2);
|
||||
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
|
||||
wjxDjxxTmxx.setVid(answerVid);
|
||||
wjxDjxxTmxx.setJid(jidAns);
|
||||
wjxDjxxTmxx.setUserId(wjxDjxxPar.getUserId());
|
||||
wjxDjxxTmxx.setCreateBy(wjxDjxxPar.getUserId());
|
||||
wjxDjxxTmxx.setCreateTime(new Date());
|
||||
|
||||
if (answerItem.get("q_index") != null) {
|
||||
Integer wjIndex = answerItem.getInteger("q_index");
|
||||
wjxDjxxTmxx.setWjIndex(wjIndex);
|
||||
}
|
||||
if (answerItem.get("title") != null) {
|
||||
String wjTitle = answerItem.getString("title");
|
||||
wjxDjxxTmxx.setWjTitle(wjTitle);
|
||||
}
|
||||
|
||||
if (answerItem.get("item_value") != null) {
|
||||
Double itemScore = answerItem.getDouble("item_value");
|
||||
wjxDjxxTmxx.setItemScore(itemScore);
|
||||
}
|
||||
if (answerItem.get("answer_text") != null) {
|
||||
String answerText = answerItem.getString("answer_text");
|
||||
wjxDjxxTmxx.setAnswerText(answerText);
|
||||
}
|
||||
if (answerItem.get("item_index") != null) {
|
||||
JSONArray itemIndex = answerItem.getJSONArray("item_index");
|
||||
|
||||
QueryWrapper<WjxWjxx> wjxWjxxQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxQueryWrapper.eq("vid", vid);
|
||||
wjxWjxxQueryWrapper.last("limit 1");
|
||||
WjxWjxx wjxxPar = wjxWjxxMapper.selectOne(wjxWjxxQueryWrapper);
|
||||
|
||||
|
||||
if (itemIndex.size() > 0) {
|
||||
for (Object index : itemIndex) {
|
||||
Integer ti = (Integer) index;
|
||||
|
||||
|
||||
wjxDjxxTmxx.setItemIndex(ti);
|
||||
String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString();
|
||||
wjxDjxxTmxx.setId(id);
|
||||
|
||||
try {
|
||||
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id", wjxxPar.getId());
|
||||
wjxWjxxTmlbQueryWrapper.eq("wj_index", wjxDjxxTmxx.getWjIndex());
|
||||
wjxWjxxTmlbQueryWrapper.last("limit 1");
|
||||
WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectOne(wjxWjxxTmlbQueryWrapper);
|
||||
wjxDjxxTmxx.setPicPath(tmlb.getPicPath());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
baseMapper.addDjTmxx(wjxDjxxTmxx);
|
||||
}
|
||||
} else {
|
||||
String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString();
|
||||
|
||||
try {
|
||||
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id", wjxxPar.getId());
|
||||
wjxWjxxTmlbQueryWrapper.eq("wj_index", wjxDjxxTmxx.getWjIndex());
|
||||
wjxWjxxTmlbQueryWrapper.last("limit 1");
|
||||
WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectOne(wjxWjxxTmlbQueryWrapper);
|
||||
wjxDjxxTmxx.setPicPath(tmlb.getPicPath());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
wjxDjxxTmxx.setId(id);
|
||||
;
|
||||
baseMapper.addDjTmxx(wjxDjxxTmxx);
|
||||
}
|
||||
} else {
|
||||
String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString();
|
||||
|
||||
try {
|
||||
QueryWrapper<WjxWjxx> wjxWjxxQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxQueryWrapper.eq("vid", vid);
|
||||
wjxWjxxQueryWrapper.last("limit 1");
|
||||
WjxWjxx wjxxPar = wjxWjxxMapper.selectOne(wjxWjxxQueryWrapper);
|
||||
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id", wjxxPar.getId());
|
||||
wjxWjxxTmlbQueryWrapper.eq("wj_index", wjxDjxxTmxx.getWjIndex());
|
||||
wjxWjxxTmlbQueryWrapper.last("limit 1");
|
||||
WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectOne(wjxWjxxTmlbQueryWrapper);
|
||||
wjxDjxxTmxx.setPicPath(tmlb.getPicPath());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
wjxDjxxTmxx.setId(id);
|
||||
;
|
||||
baseMapper.addDjTmxx(wjxDjxxTmxx);
|
||||
}
|
||||
}
|
||||
//修改答卷信息
|
||||
baseMapper.updateAnswer(wjxDjxx);
|
||||
}
|
||||
} else {
|
||||
baseMapper.updateErrMsg(wjxDjxxPar.getUserId(), vid, ansJsonResult.getString("errormsg"));
|
||||
return ansJsonResult.getString("errormsg");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if(StringUtils.isNotBlank(jidRes)){
|
||||
jsscore(jidRes);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
|
||||
return "提交成功!";
|
||||
}
|
||||
|
||||
public void jsscore(String jid){
|
||||
try {
|
||||
if(StringUtils.equals(jid,"122233965812")){
|
||||
System.out.println("jid");
|
||||
}
|
||||
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
|
||||
wjxDjxxTmxx.setJid(jid);
|
||||
wjxDjxxTmxx = baseMapper.getSumScore(wjxDjxxTmxx);
|
||||
|
|
|
@ -699,4 +699,16 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="问卷信息-分页列表查询", notes="问卷信息-分页列表查询")
|
||||
@GetMapping(value = "/listOther")
|
||||
public Result<IPage<WjxWjxx>> listOther(WjxWjxx wjxWjxx,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
Page<WjxWjxx> pageList = wjxWjxxService.listOther(wjxWjxx, new Page<>(pageNo, pageSize));
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -145,4 +145,10 @@ public class WjxWjxx implements Serializable {
|
|||
List<WjxWjxxTmlbPage> list;
|
||||
@TableField(exist = false)
|
||||
List<WjxWjxxTmlb> tmlbList;
|
||||
@TableField(exist = false)
|
||||
private String teacherNo;
|
||||
@TableField(exist = false)
|
||||
private String yuanTeacherNo;
|
||||
@TableField(exist = false)
|
||||
private String yuanTeacherName;
|
||||
}
|
||||
|
|
|
@ -32,4 +32,6 @@ public interface WjxWjxxMapper extends BaseMapper<WjxWjxx> {
|
|||
String querySfdtById(@Param("id") String id, @Param("username") String username);
|
||||
|
||||
WjxWjxx queryCyjgById(String id);
|
||||
|
||||
Page<WjxWjxx> listOther(@Param("wjxWjxx") WjxWjxx wjxWjxx, Page<Object> objectPage);
|
||||
}
|
||||
|
|
|
@ -149,4 +149,13 @@
|
|||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listOther" resultType="org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx">
|
||||
select b.*,a.teacher_no,a.yuan_teacher_no,a.yuan_teacher_name from zy_cy_fenxiang a ,wjx_wjxx b
|
||||
where a.main_id = b.id
|
||||
<if test="wjxWjxx.teacherNo != null and wjxWjxx.teacherNo != ''">
|
||||
and a.teacher_no = #{wjxWjxx.teacherNo}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -36,4 +36,8 @@ public interface IWjxWjxxService extends IService<WjxWjxx> {
|
|||
String querySfdtById(String id, String username);
|
||||
|
||||
WjxWjxx queryCyjgById(String id);
|
||||
|
||||
void updateCeyanStatus();
|
||||
|
||||
Page<WjxWjxx> listOther(WjxWjxx wjxWjxx, Page<Object> objectPage);
|
||||
}
|
||||
|
|
|
@ -6,10 +6,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.xkcoding.http.HttpUtil;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.common.util.text.StringUtils;
|
||||
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
|
||||
import org.jeecg.modules.kc.grab.imports.service.IXxhbbksService;
|
||||
import org.jeecg.modules.kc.kcWechatSendLog.entity.KcWechatSendLog;
|
||||
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx;
|
||||
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmxx;
|
||||
import org.jeecg.modules.kc.wjxDjxx.mapper.WjxDjxxMapper;
|
||||
|
@ -23,9 +27,12 @@ import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmlb;
|
|||
import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmxx;
|
||||
import org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmlbMapper;
|
||||
import org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmxxMapper;
|
||||
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
|
@ -52,6 +59,9 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
@Autowired
|
||||
private WjxDjxxMapper wjxDjxxMapper;
|
||||
|
||||
@Autowired
|
||||
private IXxhbbksService xxhbbksService;
|
||||
|
||||
@Override
|
||||
public Page<WjxWjxx> findPage(WjxWjxx wjxWjxx, Page<WjxWjxx> page){
|
||||
List<WjxWjxx> list = baseMapper.findPage(page,wjxWjxx);
|
||||
|
@ -441,5 +451,98 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
return wjxWjxx;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCeyanStatus() {
|
||||
|
||||
|
||||
QueryWrapper<WjxWjxx> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.le("start_time",new Date());
|
||||
queryWrapper.eq("qpublish","0");
|
||||
List<WjxWjxx> list = baseMapper.selectList(queryWrapper);
|
||||
for(WjxWjxx wjxWjxx : list){
|
||||
|
||||
|
||||
QueryWrapper<Xxhbbks> queryWrapper2 = new QueryWrapper<>();
|
||||
queryWrapper2.apply("a.xh = b.xh");
|
||||
queryWrapper2.eq("b.KCAPZBBH",wjxWjxx.getRwbh());
|
||||
List<Xxhbbks> list2 = xxhbbksService.getXsxkbAllList(queryWrapper2);
|
||||
String type = "";
|
||||
String content = "";
|
||||
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
content = "教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”测验,该测验完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成";
|
||||
for(Xxhbbks xxhbbks:list2){
|
||||
|
||||
try {
|
||||
KcWechatSendLog kcWechatSendLog = new KcWechatSendLog();
|
||||
kcWechatSendLog.setOpenid(xxhbbks.getXh());
|
||||
// kcWechatSendLog.setOpenid("2016900057");//指定曹老师账号
|
||||
kcWechatSendLog.setYtkcs(content);
|
||||
sendWxmessage(kcWechatSendLog);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<WjxWjxx> listOther(WjxWjxx wjxWjxx, Page<Object> objectPage) {
|
||||
return baseMapper.listOther(wjxWjxx,objectPage);
|
||||
}
|
||||
|
||||
// appId
|
||||
private static final String appId = "wx031697a8ca09a5ce";//东师
|
||||
|
||||
private static final String agentid = "1000065";//
|
||||
// appIdSecret
|
||||
private static final String appIdSecret = "6Qhnge3xfzAQMDX2TcjEyE0vUGP96hP9OTYUsYBze2Y";//东师
|
||||
|
||||
//微信通知点击后跳转的页面
|
||||
private static final String domainTo = "https://zxkccx.webvpn.nenu.edu.cn";
|
||||
|
||||
public void sendWxmessage(KcWechatSendLog kcWechatSendLog) {
|
||||
String openId = kcWechatSendLog.getOpenid();//曹老师账号
|
||||
System.out.println("openId:"+openId+"");
|
||||
if(org.apache.commons.lang3.StringUtils.isNotEmpty(openId)){
|
||||
try {
|
||||
String urlToken = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="+ appId +"&corpsecret=" + appIdSecret;
|
||||
System.out.println("urlToken: "+ urlToken);
|
||||
String res = HttpUtil.get(urlToken);
|
||||
JSONObject jsonObjectToken = JSONObject.parseObject(res);
|
||||
System.out.println("jsonObjectToken:{}"+ jsonObjectToken);
|
||||
String accessToken = jsonObjectToken.getString("access_token");
|
||||
System.out.println("accessToken:{}"+ accessToken);
|
||||
|
||||
// 微信的基础accessToken
|
||||
String url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=" + accessToken;
|
||||
Map<String, Object> sendMag = new HashMap<>();
|
||||
|
||||
// 1、xx老师,你好,您本学期(2023秋)听课要求为:5次,当前实际听课次数:3次,请尽快完成本学期的听课任务。
|
||||
String html = kcWechatSendLog.getYtkcs();
|
||||
html = html + "\n<a href=\""+domainTo+"\">查看</a>";
|
||||
sendMag.put("content", html);//授课老师推送内容
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
//拼接base参数
|
||||
Map<String, Object> sendBody = new HashMap<>();
|
||||
sendBody.put("touser", openId); // openId
|
||||
sendBody.put("msgtype", "text"); // 消息类型,此时固定为:text
|
||||
sendBody.put("agentid", agentid); // 企业id
|
||||
sendBody.put("text",sendMag); //发送内容
|
||||
ResponseEntity<String> forEntity = restTemplate.postForEntity(url, sendBody, String.class);
|
||||
JSONObject jsonObject2 = JSONObject.parseObject(forEntity.getBody());
|
||||
System.out.println("jsonObject2 : " + jsonObject2);
|
||||
String messageCode = jsonObject2.getString("errcode");
|
||||
String msgId = jsonObject2.getString("msgid");
|
||||
System.out.println("messageCode : " + messageCode + ", msgId: " +msgId);
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}else{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,182 @@
|
|||
package org.jeecg.modules.kc.zyCyFenxiang.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.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.kc.zyCyFenxiang.entity.ZyCyFenxiang;
|
||||
import org.jeecg.modules.kc.zyCyFenxiang.service.IZyCyFenxiangService;
|
||||
|
||||
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: zy_cy_fenxiang
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-11-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="zy_cy_fenxiang")
|
||||
@RestController
|
||||
@RequestMapping("/zyCyFenxiang/zyCyFenxiang")
|
||||
@Slf4j
|
||||
public class ZyCyFenxiangController extends JeecgController<ZyCyFenxiang, IZyCyFenxiangService> {
|
||||
@Autowired
|
||||
private IZyCyFenxiangService zyCyFenxiangService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param zyCyFenxiang
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "zy_cy_fenxiang-分页列表查询")
|
||||
@ApiOperation(value="zy_cy_fenxiang-分页列表查询", notes="zy_cy_fenxiang-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<ZyCyFenxiang>> queryPageList(ZyCyFenxiang zyCyFenxiang,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ZyCyFenxiang> queryWrapper = QueryGenerator.initQueryWrapper(zyCyFenxiang, req.getParameterMap());
|
||||
Page<ZyCyFenxiang> page = new Page<ZyCyFenxiang>(pageNo, pageSize);
|
||||
IPage<ZyCyFenxiang> pageList = zyCyFenxiangService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param zyCyFenxiang
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "zy_cy_fenxiang-添加")
|
||||
@ApiOperation(value="zy_cy_fenxiang-添加", notes="zy_cy_fenxiang-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ZyCyFenxiang zyCyFenxiang) {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
zyCyFenxiang.setYuanTeacherNo(loginUser.getUsername());
|
||||
zyCyFenxiang.setYuanTeacherName(loginUser.getRealname());
|
||||
zyCyFenxiangService.save(zyCyFenxiang);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param zyCyFenxiang
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "zy_cy_fenxiang-编辑")
|
||||
@ApiOperation(value="zy_cy_fenxiang-编辑", notes="zy_cy_fenxiang-编辑")
|
||||
@RequiresPermissions("zyCyFenxiang:zy_cy_fenxiang:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ZyCyFenxiang zyCyFenxiang) {
|
||||
zyCyFenxiangService.updateById(zyCyFenxiang);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "zy_cy_fenxiang-通过id删除")
|
||||
@ApiOperation(value="zy_cy_fenxiang-通过id删除", notes="zy_cy_fenxiang-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
zyCyFenxiangService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "zy_cy_fenxiang-批量删除")
|
||||
@ApiOperation(value="zy_cy_fenxiang-批量删除", notes="zy_cy_fenxiang-批量删除")
|
||||
@RequiresPermissions("zyCyFenxiang:zy_cy_fenxiang:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.zyCyFenxiangService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "zy_cy_fenxiang-通过id查询")
|
||||
@ApiOperation(value="zy_cy_fenxiang-通过id查询", notes="zy_cy_fenxiang-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<ZyCyFenxiang> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ZyCyFenxiang zyCyFenxiang = zyCyFenxiangService.getById(id);
|
||||
if(zyCyFenxiang==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(zyCyFenxiang);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param zyCyFenxiang
|
||||
*/
|
||||
@RequiresPermissions("zyCyFenxiang:zy_cy_fenxiang:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ZyCyFenxiang zyCyFenxiang) {
|
||||
return super.exportXls(request, zyCyFenxiang, ZyCyFenxiang.class, "zy_cy_fenxiang");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("zyCyFenxiang:zy_cy_fenxiang:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ZyCyFenxiang.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package org.jeecg.modules.kc.zyCyFenxiang.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: zy_cy_fenxiang
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-11-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("zy_cy_fenxiang")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="zy_cy_fenxiang对象", description="zy_cy_fenxiang")
|
||||
public class ZyCyFenxiang 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 rwbh;
|
||||
/**类型(0作业,1测验)*/
|
||||
@Excel(name = "类型(0作业,1测验)", width = 15)
|
||||
@ApiModelProperty(value = "类型(0作业,1测验)")
|
||||
private java.lang.String type;
|
||||
/**分享的id*/
|
||||
@Excel(name = "分享的id", width = 15)
|
||||
@ApiModelProperty(value = "分享的id")
|
||||
private java.lang.String mainId;
|
||||
/**教工号*/
|
||||
@Excel(name = "教工号", width = 15)
|
||||
@ApiModelProperty(value = "教工号")
|
||||
private java.lang.String teacherNo;
|
||||
/**教师姓名*/
|
||||
@Excel(name = "教师姓名", width = 15)
|
||||
@ApiModelProperty(value = "教师姓名")
|
||||
private java.lang.String teacherName;
|
||||
/**教工号*/
|
||||
@Excel(name = "教工号", width = 15)
|
||||
@ApiModelProperty(value = "教工号")
|
||||
private java.lang.String yuanTeacherNo;
|
||||
/**教师姓名*/
|
||||
@Excel(name = "教师姓名", width = 15)
|
||||
@ApiModelProperty(value = "教师姓名")
|
||||
private java.lang.String yuanTeacherName;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package org.jeecg.modules.kc.zyCyFenxiang.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.kc.zyCyFenxiang.entity.ZyCyFenxiang;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: zy_cy_fenxiang
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-11-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ZyCyFenxiangMapper extends BaseMapper<ZyCyFenxiang> {
|
||||
|
||||
}
|
|
@ -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.zyCyFenxiang.mapper.ZyCyFenxiangMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package org.jeecg.modules.kc.zyCyFenxiang.service;
|
||||
|
||||
import org.jeecg.modules.kc.zyCyFenxiang.entity.ZyCyFenxiang;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: zy_cy_fenxiang
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-11-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IZyCyFenxiangService extends IService<ZyCyFenxiang> {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.jeecg.modules.kc.zyCyFenxiang.service.impl;
|
||||
|
||||
import org.jeecg.modules.kc.zyCyFenxiang.entity.ZyCyFenxiang;
|
||||
import org.jeecg.modules.kc.zyCyFenxiang.mapper.ZyCyFenxiangMapper;
|
||||
import org.jeecg.modules.kc.zyCyFenxiang.service.IZyCyFenxiangService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: zy_cy_fenxiang
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-11-04
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ZyCyFenxiangServiceImpl extends ServiceImpl<ZyCyFenxiangMapper, ZyCyFenxiang> implements IZyCyFenxiangService {
|
||||
|
||||
}
|
|
@ -197,6 +197,23 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value="引用作业列表", notes="引用作业列表")
|
||||
@GetMapping(value = "/listOther")
|
||||
public Result<IPage<ZyInfo>> listOther(ZyInfo zyInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
zyInfo.setTeacherNo(user.getUsername());
|
||||
Page<ZyInfo> page = new Page<ZyInfo>(pageNo, pageSize);
|
||||
IPage<ZyInfo> pageList = zyInfoService.listOther(page, zyInfo);
|
||||
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
|
|
|
@ -213,5 +213,11 @@ public class ZyInfo implements Serializable {
|
|||
private String pyContent;
|
||||
@TableField(exist = false)
|
||||
private String pyFilePath;
|
||||
@TableField(exist = false)
|
||||
private String teacherNo;
|
||||
@TableField(exist = false)
|
||||
private String yuanTeacherNo;
|
||||
@TableField(exist = false)
|
||||
private String yuanTeacherName;
|
||||
|
||||
}
|
||||
|
|
|
@ -30,4 +30,6 @@ public interface ZyInfoMapper extends BaseMapper<ZyInfo> {
|
|||
List<ZyInfo> zyzb(@Param("rwbh")String rwbh, @Param("xqxn")String xqxn, @Param("teano")String teano, @Param("zyLeixing")String zyLeixing);
|
||||
|
||||
IPage<ZyInfoSys> sysStaticList(Page<ZyInfoSys> page,@Param("zyInfoSys") ZyInfoSys zyInfoSys);
|
||||
|
||||
IPage<ZyInfo> listOther(Page<ZyInfo> page,@Param("zyInfo") ZyInfo zyInfo);
|
||||
}
|
||||
|
|
|
@ -133,4 +133,14 @@
|
|||
|
||||
ORDER BY zy_status DESC, a.title DESC
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="listOther" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
|
||||
select b.*,a.teacher_no,a.yuan_teacher_no,a.yuan_teacher_name from zy_cy_fenxiang a ,zy_info b
|
||||
where a.main_id = b.id
|
||||
<if test="zyInfo.teacherNo != null and zyInfo.teacherNo != ''">
|
||||
and a.teacher_no = #{zyInfo.teacherNo}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
|
@ -30,4 +30,6 @@ public interface IZyInfoService extends IService<ZyInfo> {
|
|||
void updateInfoZyStatus();
|
||||
|
||||
IPage<ZyInfoSys> sysStaticList(Page<ZyInfoSys> page, ZyInfoSys zyInfoSys);
|
||||
|
||||
IPage<ZyInfo> listOther(Page<ZyInfo> page, ZyInfo zyInfo);
|
||||
}
|
||||
|
|
|
@ -162,6 +162,11 @@ public class ZyInfoServiceImpl extends ServiceImpl<ZyInfoMapper, ZyInfo> impleme
|
|||
return baseMapper.sysStaticList(page, zyInfoSys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ZyInfo> listOther(Page<ZyInfo> page, ZyInfo zyInfo) {
|
||||
return baseMapper.listOther(page, zyInfo);
|
||||
}
|
||||
|
||||
// appId
|
||||
private static final String appId = "wx031697a8ca09a5ce";//东师
|
||||
|
||||
|
|
Loading…
Reference in New Issue