Compare commits

...

2 Commits

Author SHA1 Message Date
1378012178@qq.com 9929d5ce80 Merge branch 'master' of http://47.115.223.229:8888/yangjun/dbsd_kczx_java
# Conflicts:
#	jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfoStudent/service/impl/ZyInfoStudentServiceImpl.java
2025-01-15 10:40:59 +08:00
1378012178@qq.com 48543190cb 1、防作弊
2、课程作业-分组
2025-01-15 10:36:04 +08:00
41 changed files with 3847 additions and 2833 deletions

View File

@ -12,7 +12,6 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.kc.grab.exports.entity.TBks;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks; import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
import org.jeecg.modules.kc.grab.imports.service.IXxhbbksService; import org.jeecg.modules.kc.grab.imports.service.IXxhbbksService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -22,14 +21,15 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
/** /**
* @Description: 同步数据表bks * @Description: 同步数据表bks
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2023-04-10 * @Date: 2023-04-10
* @Version: V1.0 * @Version: V1.0
*/ */
@Api(tags="同步数据表bks") @Api(tags = "同步数据表bks")
@RestController @RestController
@RequestMapping("/grab/xxhbbks") @RequestMapping("/grab/xxhbbks")
@Slf4j @Slf4j
@ -47,11 +47,11 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
* @return * @return
*/ */
//@AutoLog(value = "同步数据表bks-分页列表查询") //@AutoLog(value = "同步数据表bks-分页列表查询")
@ApiOperation(value="同步数据表bks-分页列表查询", notes="同步数据表bks-分页列表查询") @ApiOperation(value = "同步数据表bks-分页列表查询", notes = "同步数据表bks-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<IPage<Xxhbbks>> queryPageList(Xxhbbks xxhbbks, public Result<IPage<Xxhbbks>> queryPageList(Xxhbbks xxhbbks,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<Xxhbbks> queryWrapper = QueryGenerator.initQueryWrapper(xxhbbks, req.getParameterMap()); QueryWrapper<Xxhbbks> queryWrapper = QueryGenerator.initQueryWrapper(xxhbbks, req.getParameterMap());
Page<Xxhbbks> page = new Page<Xxhbbks>(pageNo, pageSize); Page<Xxhbbks> page = new Page<Xxhbbks>(pageNo, pageSize);
@ -66,7 +66,7 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
* @return * @return
*/ */
@AutoLog(value = "同步数据表bks-添加") @AutoLog(value = "同步数据表bks-添加")
@ApiOperation(value="同步数据表bks-添加", notes="同步数据表bks-添加") @ApiOperation(value = "同步数据表bks-添加", notes = "同步数据表bks-添加")
@RequiresPermissions("grab:xxhbbks:add") @RequiresPermissions("grab:xxhbbks:add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody Xxhbbks xxhbbks) { public Result<String> add(@RequestBody Xxhbbks xxhbbks) {
@ -81,9 +81,9 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
* @return * @return
*/ */
@AutoLog(value = "同步数据表bks-编辑") @AutoLog(value = "同步数据表bks-编辑")
@ApiOperation(value="同步数据表bks-编辑", notes="同步数据表bks-编辑") @ApiOperation(value = "同步数据表bks-编辑", notes = "同步数据表bks-编辑")
@RequiresPermissions("grab:xxhbbks:edit") @RequiresPermissions("grab:xxhbbks:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody Xxhbbks xxhbbks) { public Result<String> edit(@RequestBody Xxhbbks xxhbbks) {
xxhbbksService.updateById(xxhbbks); xxhbbksService.updateById(xxhbbks);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
@ -96,10 +96,10 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
* @return * @return
*/ */
@AutoLog(value = "同步数据表bks-通过id删除") @AutoLog(value = "同步数据表bks-通过id删除")
@ApiOperation(value="同步数据表bks-通过id删除", notes="同步数据表bks-通过id删除") @ApiOperation(value = "同步数据表bks-通过id删除", notes = "同步数据表bks-通过id删除")
@RequiresPermissions("grab:xxhbbks:delete") @RequiresPermissions("grab:xxhbbks:delete")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) { public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
xxhbbksService.removeById(id); xxhbbksService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }
@ -111,10 +111,10 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
* @return * @return
*/ */
@AutoLog(value = "同步数据表bks-批量删除") @AutoLog(value = "同步数据表bks-批量删除")
@ApiOperation(value="同步数据表bks-批量删除", notes="同步数据表bks-批量删除") @ApiOperation(value = "同步数据表bks-批量删除", notes = "同步数据表bks-批量删除")
@RequiresPermissions("grab:xxhbbks:deleteBatch") @RequiresPermissions("grab:xxhbbks:deleteBatch")
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.xxhbbksService.removeByIds(Arrays.asList(ids.split(","))); this.xxhbbksService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
} }
@ -126,11 +126,11 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
* @return * @return
*/ */
//@AutoLog(value = "同步数据表bks-通过id查询") //@AutoLog(value = "同步数据表bks-通过id查询")
@ApiOperation(value="同步数据表bks-通过id查询", notes="同步数据表bks-通过id查询") @ApiOperation(value = "同步数据表bks-通过id查询", notes = "同步数据表bks-通过id查询")
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
public Result<Xxhbbks> queryById(@RequestParam(name="id",required=true) String id) { public Result<Xxhbbks> queryById(@RequestParam(name = "id", required = true) String id) {
Xxhbbks xxhbbks = xxhbbksService.getById(id); Xxhbbks xxhbbks = xxhbbksService.getById(id);
if(xxhbbks==null) { if (xxhbbks == null) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
} }
return Result.OK(xxhbbks); return Result.OK(xxhbbks);
@ -162,20 +162,30 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
} }
@AutoLog(value = "获取本科生选课人员信息") @AutoLog(value = "获取本科生选课人员信息")
@ApiOperation(value="获取本科生选课人员信息", notes="获取本科生选课人员信息") @ApiOperation(value = "获取本科生选课人员信息", notes = "获取本科生选课人员信息")
@GetMapping(value = "/getXsxkbList") @GetMapping(value = "/getXsxkbList")
public Result<?> getXsxkbList(Xxhbbks xxhbbks, public Result<?> getXsxkbList(Xxhbbks xxhbbks,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<Xxhbbks> queryWrapper = QueryGenerator.initQueryWrapper(xxhbbks, req.getParameterMap()); QueryWrapper<Xxhbbks> queryWrapper = QueryGenerator.initQueryWrapper(xxhbbks, req.getParameterMap());
queryWrapper.apply("a.xh = b.xh"); queryWrapper.apply("a.xh = b.xh");
queryWrapper.eq(StringUtils.isNotBlank(xxhbbks.getRwbh()),"b.KCAPZBBH",xxhbbks.getRwbh()); queryWrapper.eq(StringUtils.isNotBlank(xxhbbks.getRwbh()), "b.KCAPZBBH", xxhbbks.getRwbh());
Page<Xxhbbks> page = new Page<Xxhbbks>(pageNo, pageSize); Page<Xxhbbks> page = new Page<Xxhbbks>(pageNo, pageSize);
IPage<Xxhbbks> pageList = xxhbbksService.getXsxkbList(page, queryWrapper); IPage<Xxhbbks> pageList = xxhbbksService.getXsxkbList(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
} }
/**
* 获取选课人员
* @param rwbh 任务编号
*
* 获取任务编号下的所有选课人员
* @return
*/
@PostMapping(value = "/getXKRY")
public Result<List<Xxhbbks>> getXKRY(@RequestBody String rwbh) {
return Result.OK(xxhbbksService.getXKRY(rwbh));
}
} }

View File

@ -23,4 +23,6 @@ public interface XxhbbksMapper extends BaseMapper<Xxhbbks> {
IPage<Xxhbbks> getXsxkbList(Page<Xxhbbks> page,@Param(Constants.WRAPPER) QueryWrapper<Xxhbbks> queryWrapper); IPage<Xxhbbks> getXsxkbList(Page<Xxhbbks> page,@Param(Constants.WRAPPER) QueryWrapper<Xxhbbks> queryWrapper);
List<Xxhbbks> getXsxkbAllList(@Param(Constants.WRAPPER) QueryWrapper<Xxhbbks> queryWrapper); List<Xxhbbks> getXsxkbAllList(@Param(Constants.WRAPPER) QueryWrapper<Xxhbbks> queryWrapper);
List<Xxhbbks> getXKRY(@Param("rwbh") String rwbh);
} }

View File

@ -18,4 +18,11 @@
select a.* from xxhbbks a ,xxhbxsxkb b select a.* from xxhbbks a ,xxhbxsxkb b
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>
<select id="getXKRY" resultType="org.jeecg.modules.kc.grab.imports.entity.Xxhbbks">
select bks.xh,bks.xm
from xxhbxsxkb xkb
left join xxhbbks bks on xkb.xh = bks.xh
where xkb.KCAPZBBH = #{rwbh}
</select>
</mapper> </mapper>

View File

@ -37,4 +37,6 @@ public interface IXxhbbksService extends IService<Xxhbbks> {
IPage<Xxhbbks> getXsxkbList(Page<Xxhbbks> page, QueryWrapper<Xxhbbks> queryWrapper); IPage<Xxhbbks> getXsxkbList(Page<Xxhbbks> page, QueryWrapper<Xxhbbks> queryWrapper);
List<Xxhbbks> getXsxkbAllList(QueryWrapper<Xxhbbks> queryWrapper); List<Xxhbbks> getXsxkbAllList(QueryWrapper<Xxhbbks> queryWrapper);
List<Xxhbbks> getXKRY(String rwbh);
} }

View File

@ -52,4 +52,9 @@ public class XxhbbksServiceImpl extends ServiceImpl<XxhbbksMapper, Xxhbbks> impl
public List<Xxhbbks> getXsxkbAllList(QueryWrapper<Xxhbbks> queryWrapper) { public List<Xxhbbks> getXsxkbAllList(QueryWrapper<Xxhbbks> queryWrapper) {
return baseMapper.getXsxkbAllList(queryWrapper); return baseMapper.getXsxkbAllList(queryWrapper);
} }
@Override
public List<Xxhbbks> getXKRY(String rwbh) {
return baseMapper.getXKRY(rwbh);
}
} }

View File

@ -353,4 +353,9 @@ public class WjxDjxxController extends JeecgController<WjxDjxx, IWjxDjxxService>
return Result.OK(res); return Result.OK(res);
} }
@PostMapping(value = "/upZbcs")
public Result<Integer> upZbcs(@RequestBody WjxDjxx wjxDjxx) {
return Result.OK(wjxDjxxService.upZbcs(wjxDjxx));
}
} }

View File

@ -130,4 +130,6 @@ public class WjxDjxx {
@TableField(exist = false) @TableField(exist = false)
private String isFinished; private String isFinished;
@ApiModelProperty(value = "作弊次数(单次考试作弊行为发生总次数)")
private int zbcs;
} }

View File

@ -72,4 +72,6 @@ public interface WjxDjxxMapper extends BaseMapper<WjxDjxx> {
void updateDjxxTmxxFwqpath(WjxDjxxTmxx wjxDjxxTmxx); void updateDjxxTmxxFwqpath(WjxDjxxTmxx wjxDjxxTmxx);
int upZbcs(@Param("dto") WjxDjxx wjxDjxx);
} }

View File

@ -439,6 +439,12 @@
where jid = #{jid} where jid = #{jid}
</update> </update>
<update id="upZbcs">
update wjx_djxx
set zbcs = (select count(id) from wjx_djxx_fzbtj where type in (1,2,3) and vid = #{dto.vid} and create_by = #{dto.createBy} )
where vid = #{dto.vid} and create_by = #{dto.createBy}
</update>
<select id="getSfysj" resultType="org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmxx"> <select id="getSfysj" resultType="org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmxx">
select * from wjx_djxx_tmxx where vid = #{wjxDjxxTmxx.vid} and jid = #{wjxDjxxTmxx.jid} and wj_index = #{wjxDjxxTmxx.wjIndex} and item_index = #{wjxDjxxTmxx.itemIndex} select * from wjx_djxx_tmxx where vid = #{wjxDjxxTmxx.vid} and jid = #{wjxDjxxTmxx.jid} and wj_index = #{wjxDjxxTmxx.wjIndex} and item_index = #{wjxDjxxTmxx.itemIndex}

View File

@ -47,4 +47,6 @@ public interface IWjxDjxxService extends IService<WjxDjxx> {
String updateDjjg(WjxDjxx wjxDjxx); String updateDjjg(WjxDjxx wjxDjxx);
String getDjjg(WjxDjxx wjxDjxx); String getDjjg(WjxDjxx wjxDjxx);
int upZbcs(WjxDjxx wjxDjxx);
} }

View File

@ -55,23 +55,24 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
/** /**
* 提交问卷并查询答卷 * 提交问卷并查询答卷
*
* @param list * @param list
*/ */
public String djtj(List<WjxDjxxTmlbPage> list){ public String djtj(List<WjxDjxxTmlbPage> list) {
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String vid = list.get(0).getVid(); String vid = list.get(0).getVid();
if(vid==null || vid.equals("")){ if (vid == null || vid.equals("")) {
String mainId = list.get(0).getMainId(); String mainId = list.get(0).getMainId();
vid = baseMapper.findVid(mainId); vid = baseMapper.findVid(mainId);
} }
if(vid ==null || vid.equals("")){ if (vid == null || vid.equals("")) {
return "此试卷错误,无法提交!"; return "此试卷错误,无法提交!";
} }
Date date = new Date(); Date date = new Date();
Date openTime = list.get(0).getOpenTime(); Date openTime = list.get(0).getOpenTime();
if(openTime == null){ if (openTime == null) {
Calendar c = Calendar.getInstance(); Calendar c = Calendar.getInstance();
c.add(Calendar.MINUTE,-2); c.add(Calendar.MINUTE, -2);
openTime = c.getTime(); openTime = c.getTime();
} }
WjxDjxx wds = new WjxDjxx(); WjxDjxx wds = new WjxDjxx();
@ -83,29 +84,29 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
wds.setCreateBy(user.getUsername()); wds.setCreateBy(user.getUsername());
wds.setCreateTime(date); wds.setCreateTime(date);
StringBuffer submitDataSb = new StringBuffer(); StringBuffer submitDataSb = new StringBuffer();
for(WjxDjxxTmlbPage wjxDjxxTmlbPage:list){ for (WjxDjxxTmlbPage wjxDjxxTmlbPage : list) {
Integer WjIndex = wjxDjxxTmlbPage.getWjIndex(); Integer WjIndex = wjxDjxxTmlbPage.getWjIndex();
Integer wjType = wjxDjxxTmlbPage.getWjType(); Integer wjType = wjxDjxxTmlbPage.getWjType();
Integer wjSubtype = wjxDjxxTmlbPage.getWjSubtype(); Integer wjSubtype = wjxDjxxTmlbPage.getWjSubtype();
String itemSelected = ""; String itemSelected = "";
if(wjType == 3 || wjType == 4){ if (wjType == 3 || wjType == 4) {
itemSelected = wjxDjxxTmlbPage.getItemSelected().replaceAll(",","|").trim(); itemSelected = wjxDjxxTmlbPage.getItemSelected().replaceAll(",", "|").trim();
if(itemSelected == null || itemSelected.equals("null") || itemSelected.equals("")){ if (itemSelected == null || itemSelected.equals("null") || itemSelected.equals("")) {
itemSelected = "-3"; itemSelected = "-3";
} }
} }
if(wjType == 5){ if (wjType == 5) {
itemSelected = wjxDjxxTmlbPage.getWjAnswer(); itemSelected = wjxDjxxTmlbPage.getWjAnswer();
if(itemSelected == null || itemSelected.equals("null") || itemSelected.equals("")){ if (itemSelected == null || itemSelected.equals("null") || itemSelected.equals("")) {
itemSelected = "(跳过)"; itemSelected = "(跳过)";
} }
if(wjSubtype!= null ){ if (wjSubtype != null) {
if(wjSubtype==5){ if (wjSubtype == 5) {
itemSelected = "(跳过)"; itemSelected = "(跳过)";
} }
} }
} }
if(wjType == 8){ if (wjType == 8) {
itemSelected = "-3"; itemSelected = "-3";
} }
submitDataSb.append(WjIndex); submitDataSb.append(WjIndex);
@ -114,49 +115,49 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
submitDataSb.append("}"); submitDataSb.append("}");
} }
String submitData = submitDataSb.toString(); String submitData = submitDataSb.toString();
if(StringUtils.isNotEmpty(submitData)){ if (StringUtils.isNotEmpty(submitData)) {
submitData = submitData.substring(0,submitData.length()-1); submitData = submitData.substring(0, submitData.length() - 1);
} }
wds.setSubmitData(submitData); wds.setSubmitData(submitData);
baseMapper.deleteDj(wds); baseMapper.deleteDj(wds);
this.save(wds); this.save(wds);
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("vid",Integer.valueOf(vid)); map.put("vid", Integer.valueOf(vid));
Long djys = ChronoUnit.SECONDS.between(wds.getOpenTime().toInstant(),wds.getCommitTime().toInstant()); Long djys = ChronoUnit.SECONDS.between(wds.getOpenTime().toInstant(), wds.getCommitTime().toInstant());
if(djys<3){ if (djys < 3) {
djys = 10L; djys = 10L;
} }
System.out.println("--------------------------------------------------"); System.out.println("--------------------------------------------------");
System.out.println("---------------djys--"+djys+"---------------------------"); System.out.println("---------------djys--" + djys + "---------------------------");
System.out.println("--------------------------------------------------"); System.out.println("--------------------------------------------------");
map.put("inputcosttime", djys); map.put("inputcosttime", djys);
map.put("submitdata",submitData); map.put("submitdata", submitData);
map.put("sojumpparm",user.getUsername());//自定义链接参数用来透传用户ID map.put("sojumpparm", user.getUsername());//自定义链接参数用来透传用户ID
//调用接口,提交 //调用接口,提交
String result = wjxUtil.openapi(map,"1001001"); String result = wjxUtil.openapi(map, "1001001");
String jidRes = ""; String jidRes = "";
if(!result.equals("")){ if (!result.equals("")) {
JSONObject jsonResult = JSONObject.parseObject(result); JSONObject jsonResult = JSONObject.parseObject(result);
if(jsonResult.getBoolean("result")){ if (jsonResult.getBoolean("result")) {
JSONObject dataJson = jsonResult.getJSONObject("data"); JSONObject dataJson = jsonResult.getJSONObject("data");
String vidRes = dataJson.getString("vid"); String vidRes = dataJson.getString("vid");
jidRes = dataJson.getString("jid"); jidRes = dataJson.getString("jid");
String sojumpparmRes = dataJson.getString("sojumpparm"); String sojumpparmRes = dataJson.getString("sojumpparm");
baseMapper.updateJid(sojumpparmRes,vidRes,jidRes); baseMapper.updateJid(sojumpparmRes, vidRes, jidRes);
//调用接口答卷查询 //调用接口答卷查询
Map<String,Object> selMap = new HashMap<>(); Map<String, Object> selMap = new HashMap<>();
selMap.put("vid",Integer.valueOf(vid)); selMap.put("vid", Integer.valueOf(vid));
selMap.put("jid",Long.valueOf(jidRes)); selMap.put("jid", Long.valueOf(jidRes));
//调用接口,查询答卷结果 //调用接口,查询答卷结果
String answerStr = wjxUtil.openapi(selMap,"1001002"); String answerStr = wjxUtil.openapi(selMap, "1001002");
if(!answerStr.equals("")){ if (!answerStr.equals("")) {
JSONObject ansJsonResult = JSONObject.parseObject(answerStr); JSONObject ansJsonResult = JSONObject.parseObject(answerStr);
if(ansJsonResult.getBoolean("result")){ if (ansJsonResult.getBoolean("result")) {
JSONObject ansDataJson = ansJsonResult.getJSONObject("data"); JSONObject ansDataJson = ansJsonResult.getJSONObject("data");
String answerVid = ansDataJson.getString("vid"); String answerVid = ansDataJson.getString("vid");
JSONObject answerJsonArray = ansDataJson.getJSONObject("answers"); JSONObject answerJsonArray = ansDataJson.getJSONObject("answers");
for(String key1 : answerJsonArray.keySet()){ for (String key1 : answerJsonArray.keySet()) {
JSONObject answer = answerJsonArray.getJSONObject(key1); JSONObject answer = answerJsonArray.getJSONObject(key1);
String jidAns = answer.getString("jid"); String jidAns = answer.getString("jid");
Integer answerSeconds = answer.getInteger("answer_seconds"); Integer answerSeconds = answer.getInteger("answer_seconds");
@ -172,7 +173,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
baseMapper.deleteDjItem(wjxDjxx); baseMapper.deleteDjItem(wjxDjxx);
//处理选项 //处理选项
JSONObject answerItemJson = answer.getJSONObject("answer_items"); JSONObject answerItemJson = answer.getJSONObject("answer_items");
if(answerItemJson!=null) { if (answerItemJson != null) {
for (String key2 : answerItemJson.keySet()) { for (String key2 : answerItemJson.keySet()) {
JSONObject answerItem = answerItemJson.getJSONObject(key2); JSONObject answerItem = answerItemJson.getJSONObject(key2);
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx(); WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
@ -272,27 +273,25 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
//修改答卷信息 //修改答卷信息
baseMapper.updateAnswer(wjxDjxx); baseMapper.updateAnswer(wjxDjxx);
} }
}else{ } else {
baseMapper.updateErrMsg(user.getUsername(),vid,ansJsonResult.getString("errormsg")); baseMapper.updateErrMsg(user.getUsername(), vid, ansJsonResult.getString("errormsg"));
return ansJsonResult.getString("errormsg"); return ansJsonResult.getString("errormsg");
} }
} }
}else{ } else {
baseMapper.updateErrMsg(user.getUsername(),vid,jsonResult.getString("errormsg")); baseMapper.updateErrMsg(user.getUsername(), vid, jsonResult.getString("errormsg"));
return jsonResult.getString("errormsg"); return jsonResult.getString("errormsg");
} }
} }
String sfxgdjscore = "0";//是否修改答卷分数 String sfxgdjscore = "0";//是否修改答卷分数
if(StringUtils.isNotBlank(jidRes)){ if (StringUtils.isNotBlank(jidRes)) {
for(WjxDjxxTmlbPage wjxDjxxTmlbPage:list){ for (WjxDjxxTmlbPage wjxDjxxTmlbPage : list) {
Integer WjIndex = wjxDjxxTmlbPage.getWjIndex(); Integer WjIndex = wjxDjxxTmlbPage.getWjIndex();
Integer wjType = wjxDjxxTmlbPage.getWjType(); Integer wjType = wjxDjxxTmlbPage.getWjType();
Integer wjSubtype = wjxDjxxTmlbPage.getWjSubtype(); Integer wjSubtype = wjxDjxxTmlbPage.getWjSubtype();
if(wjType == 8){ if (wjType == 8) {
sfxgdjscore = "1"; sfxgdjscore = "1";
String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString(); String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString();
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx(); WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
@ -308,7 +307,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
// wjxDjxxTmxx.setItemScore(wjxDjxxTmlbPage.getWjScore()); // wjxDjxxTmxx.setItemScore(wjxDjxxTmlbPage.getWjScore());
wjxDjxxTmxx.setPicPath(wjxDjxxTmlbPage.getPicPath()); wjxDjxxTmxx.setPicPath(wjxDjxxTmlbPage.getPicPath());
baseMapper.addDjTmxx(wjxDjxxTmxx); baseMapper.addDjTmxx(wjxDjxxTmxx);
}else if(wjType==5&&wjSubtype!=null && wjSubtype == 5){ } else if (wjType == 5 && wjSubtype != null && wjSubtype == 5) {
sfxgdjscore = "1"; sfxgdjscore = "1";
String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString(); String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString();
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx(); WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
@ -329,7 +328,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
} }
//修改答卷信息的总分 //修改答卷信息的总分
if(StringUtils.equals(sfxgdjscore,"1")){ if (StringUtils.equals(sfxgdjscore, "1")) {
try { try {
WjxDjxx wjxDjxx = new WjxDjxx(); WjxDjxx wjxDjxx = new WjxDjxx();
wjxDjxx.setVid(vid); wjxDjxx.setVid(vid);
@ -346,29 +345,29 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
//修改问卷状态 //修改问卷状态
QueryWrapper<WjxWjxx> wjxWjxxQueryWrapper = new QueryWrapper<>(); QueryWrapper<WjxWjxx> wjxWjxxQueryWrapper = new QueryWrapper<>();
wjxWjxxQueryWrapper.eq("vid",vid); wjxWjxxQueryWrapper.eq("vid", vid);
wjxWjxxQueryWrapper.last("limit 1"); wjxWjxxQueryWrapper.last("limit 1");
WjxWjxx wjxWjxx = wjxWjxxMapper.selectOne(wjxWjxxQueryWrapper); WjxWjxx wjxWjxx = wjxWjxxMapper.selectOne(wjxWjxxQueryWrapper);
int xkrs = Integer.parseInt(wjxWjxx.getXkrs()); int xkrs = Integer.parseInt(wjxWjxx.getXkrs());
QueryWrapper<WjxDjxx> djxxQueryWrapper = new QueryWrapper<>(); QueryWrapper<WjxDjxx> djxxQueryWrapper = new QueryWrapper<>();
djxxQueryWrapper.eq("vid",vid); djxxQueryWrapper.eq("vid", vid);
List<WjxDjxx> listNum = baseMapper.selectList(djxxQueryWrapper); List<WjxDjxx> listNum = baseMapper.selectList(djxxQueryWrapper);
int djsl = listNum.size(); int djsl = listNum.size();
System.out.println(xkrs+"------------------------"+djsl); System.out.println(xkrs + "------------------------" + djsl);
if(xkrs == djsl){ if (xkrs == djsl) {
wjxWjxx.setQpublish("2"); wjxWjxx.setQpublish("2");
wjxWjxxMapper.updateById(wjxWjxx); wjxWjxxMapper.updateById(wjxWjxx);
} }
String type = ""; String type = "";
String content = ""; String content = "";
if(StringUtils.equals("6",wjxWjxx.getAtype())){ if (StringUtils.equals("6", wjxWjxx.getAtype())) {
type = "6"; type = "6";
content = user.getRealname()+"学生提交了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”测验,该测验完成时间为:"+ DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd HH:mm")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd HH:mm")+",请及时查看。学生提交时间:"+DateUtils.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"); content = user.getRealname() + "学生提交了[" + wjxWjxx.getKcmc() + "]课程“" + wjxWjxx.getTitle() + "”测验,该测验完成时间为:" + DateUtils.formatDate(wjxWjxx.getStartTime(), "yyyy-MM-dd HH:mm") + " ~ " + DateUtils.formatDate(wjxWjxx.getEndTime(), "yyyy-MM-dd HH:mm") + ",请及时查看。学生提交时间:" + DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
}else{ } else {
type = "7"; type = "7";
content = user.getRealname()+"学生提交了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”问卷,该问卷完成时间为:"+ DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd HH:mm")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd HH:mm")+",请及时查看。学生提交时间:"+DateUtils.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"); content = user.getRealname() + "学生提交了[" + wjxWjxx.getKcmc() + "]课程“" + wjxWjxx.getTitle() + "”问卷,该问卷完成时间为:" + DateUtils.formatDate(wjxWjxx.getStartTime(), "yyyy-MM-dd HH:mm") + " ~ " + DateUtils.formatDate(wjxWjxx.getEndTime(), "yyyy-MM-dd HH:mm") + ",请及时查看。学生提交时间:" + DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
} }
//作业代办提醒 //作业代办提醒
ZyDbtx zyDbtx = new ZyDbtx(); ZyDbtx zyDbtx = new ZyDbtx();
@ -382,74 +381,72 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
zyDbtxService.save(zyDbtx); zyDbtxService.save(zyDbtx);
UpdateWrapper<ZyDbtx> zyDbtxQx = new UpdateWrapper<>(); UpdateWrapper<ZyDbtx> zyDbtxQx = new UpdateWrapper<>();
zyDbtxQx.set("flag","1"); zyDbtxQx.set("flag", "1");
zyDbtxQx.eq("main_id",wjxWjxx.getId()); zyDbtxQx.eq("main_id", wjxWjxx.getId());
zyDbtxQx.eq("create_by",user.getUsername()); zyDbtxQx.eq("create_by", user.getUsername());
zyDbtxQx.eq("type","2"); zyDbtxQx.eq("type", "2");
zyDbtxService.update(zyDbtxQx); zyDbtxService.update(zyDbtxQx);
try { try {
if(StringUtils.isNotBlank(jidRes)){ if (StringUtils.isNotBlank(jidRes)) {
jsscore(jidRes); jsscore(jidRes);
} }
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return "提交成功!"; return "提交成功!";
} }
/** /**
* 获取未进行答卷查询操作的数据如数据未提交问卷操作则先提交问卷再查询答卷 * 获取未进行答卷查询操作的数据如数据未提交问卷操作则先提交问卷再查询答卷
*/ */
public void doDjSelect(){ public void doDjSelect() {
List<WjxDjxx> list = baseMapper.findUnSelect(); List<WjxDjxx> list = baseMapper.findUnSelect();
for(int i=0;i<list.size();i++){ for (int i = 0; i < list.size(); i++) {
WjxDjxx wjxDjxx = list.get(i); WjxDjxx wjxDjxx = list.get(i);
String jid = wjxDjxx.getJid(); String jid = wjxDjxx.getJid();
String vid = wjxDjxx.getVid(); String vid = wjxDjxx.getVid();
String userId = wjxDjxx.getUserId(); String userId = wjxDjxx.getUserId();
if(jid== null || jid.equals("")){ if (jid == null || jid.equals("")) {
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("vid",Integer.valueOf(wjxDjxx.getVid())); map.put("vid", Integer.valueOf(wjxDjxx.getVid()));
map.put("inputcosttime",ChronoUnit.SECONDS.between(wjxDjxx.getOpenTime().toInstant(),wjxDjxx.getCommitTime().toInstant())); map.put("inputcosttime", ChronoUnit.SECONDS.between(wjxDjxx.getOpenTime().toInstant(), wjxDjxx.getCommitTime().toInstant()));
map.put("submitdata",wjxDjxx.getSubmitData()); map.put("submitdata", wjxDjxx.getSubmitData());
map.put("sojumpparm",wjxDjxx.getUserId());//自定义链接参数用来透传用户ID map.put("sojumpparm", wjxDjxx.getUserId());//自定义链接参数用来透传用户ID
//调用接口,提交 //调用接口,提交
String result = wjxUtil.openapi(map,"1001001"); String result = wjxUtil.openapi(map, "1001001");
if(!result.equals("")) { if (!result.equals("")) {
JSONObject jsonResult = JSONObject.parseObject(result); JSONObject jsonResult = JSONObject.parseObject(result);
if (jsonResult.getBoolean("result")) { if (jsonResult.getBoolean("result")) {
JSONObject dataJson = jsonResult.getJSONObject("data"); JSONObject dataJson = jsonResult.getJSONObject("data");
String vidRes = dataJson.getString("vid"); String vidRes = dataJson.getString("vid");
jid = dataJson.getString("jid"); jid = dataJson.getString("jid");
String sojumpparmRes = dataJson.getString("sojumpparm"); String sojumpparmRes = dataJson.getString("sojumpparm");
baseMapper.updateJid(sojumpparmRes,vidRes,jid); baseMapper.updateJid(sojumpparmRes, vidRes, jid);
wjxDjxx.setJid(jid); wjxDjxx.setJid(jid);
}else{ } else {
baseMapper.updateErrMsg(wjxDjxx.getUserId(),wjxDjxx.getVid(),jsonResult.getString("errormsg")); baseMapper.updateErrMsg(wjxDjxx.getUserId(), wjxDjxx.getVid(), jsonResult.getString("errormsg"));
continue; continue;
} }
} }
} }
//调用接口答卷查询 //调用接口答卷查询
Map<String,Object> selMap = new HashMap<>(); Map<String, Object> selMap = new HashMap<>();
selMap.put("vid",Integer.valueOf(vid)); selMap.put("vid", Integer.valueOf(vid));
selMap.put("jid",Long.valueOf(jid)); selMap.put("jid", Long.valueOf(jid));
//调用接口,提交 //调用接口,提交
String answerStr = wjxUtil.openapi(selMap,"1001002"); String answerStr = wjxUtil.openapi(selMap, "1001002");
if(!answerStr.equals("")){ if (!answerStr.equals("")) {
JSONObject ansJsonResult = JSONObject.parseObject(answerStr); JSONObject ansJsonResult = JSONObject.parseObject(answerStr);
if(ansJsonResult.getBoolean("result")){ if (ansJsonResult.getBoolean("result")) {
JSONObject ansDataJson = ansJsonResult.getJSONObject("data"); JSONObject ansDataJson = ansJsonResult.getJSONObject("data");
String answerVid = ansDataJson.getString("vid"); String answerVid = ansDataJson.getString("vid");
JSONObject answerJsonArray = ansDataJson.getJSONObject("answers"); JSONObject answerJsonArray = ansDataJson.getJSONObject("answers");
for(String key1 : answerJsonArray.keySet()){ for (String key1 : answerJsonArray.keySet()) {
JSONObject answer = answerJsonArray.getJSONObject(key1); JSONObject answer = answerJsonArray.getJSONObject(key1);
String jidAns = answer.getString("jid"); String jidAns = answer.getString("jid");
Integer answerSeconds = answer.getInteger("answer_seconds"); Integer answerSeconds = answer.getInteger("answer_seconds");
@ -465,7 +462,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
baseMapper.deleteDjItem(wjxDjxx2); baseMapper.deleteDjItem(wjxDjxx2);
//处理选项 //处理选项
JSONObject answerItemJson = answer.getJSONObject("answer_items"); JSONObject answerItemJson = answer.getJSONObject("answer_items");
if(answerItemJson!=null) { if (answerItemJson != null) {
for (String key2 : answerItemJson.keySet()) { for (String key2 : answerItemJson.keySet()) {
JSONObject answerItem = answerItemJson.getJSONObject(key2); JSONObject answerItem = answerItemJson.getJSONObject(key2);
Integer wjIndex = answerItem.getInteger("q_index"); Integer wjIndex = answerItem.getInteger("q_index");
@ -495,8 +492,8 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
//修改答卷信息 //修改答卷信息
baseMapper.updateAnswer(wjxDjxx2); baseMapper.updateAnswer(wjxDjxx2);
} }
}else{ } else {
baseMapper.updateErrMsg(wjxDjxx.getUserId(),wjxDjxx.getVid(),ansJsonResult.getString("errormsg")); baseMapper.updateErrMsg(wjxDjxx.getUserId(), wjxDjxx.getVid(), ansJsonResult.getString("errormsg"));
continue; continue;
} }
} }
@ -506,12 +503,12 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
@Override @Override
public WjxDjxx queryByMainId(String id) { public WjxDjxx queryByMainId(String id) {
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
WjxDjxx djxx = baseMapper.findDjxx(id,user.getUsername()); WjxDjxx djxx = baseMapper.findDjxx(id, user.getUsername());
if(djxx != null){ if (djxx != null) {
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds())); djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
List<WjxDjxxTmxx> list = baseMapper.findDjtmxx(djxx.getVid(),djxx.getJid()); List<WjxDjxxTmxx> list = baseMapper.findDjtmxx(djxx.getVid(), djxx.getJid());
for(WjxDjxxTmxx wjxDjxxTmxx:list){ for (WjxDjxxTmxx wjxDjxxTmxx : list) {
List<WjxWjxxTmxx> list2= wjxWjxxTmxxMapper.selectByMainId(wjxDjxxTmxx.getId()); List<WjxWjxxTmxx> list2 = wjxWjxxTmxxMapper.selectByMainId(wjxDjxxTmxx.getId());
wjxDjxxTmxx.setWjxWjxxTmxxList(list2); wjxDjxxTmxx.setWjxWjxxTmxxList(list2);
//获取填空题答案 //获取填空题答案
WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectById(wjxDjxxTmxx.getId()); WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectById(wjxDjxxTmxx.getId());
@ -525,6 +522,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
/** /**
* 秒数转时分秒 * 秒数转时分秒
*
* @param seconds * @param seconds
* @return * @return
*/ */
@ -537,23 +535,23 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
} }
@Override @Override
public Page<WjxDjxx> findDjjgsPage(WjxDjxx wjxDjxx, Page<WjxDjxx> page){ public Page<WjxDjxx> findDjjgsPage(WjxDjxx wjxDjxx, Page<WjxDjxx> page) {
if(StringUtils.equals("1",wjxDjxx.getIsFinished())){ if (StringUtils.equals("1", wjxDjxx.getIsFinished())) {
//完成答卷的 //完成答卷的
List<WjxDjxx> list = baseMapper.findDjjgsPage(page,wjxDjxx); List<WjxDjxx> list = baseMapper.findDjjgsPage(page, wjxDjxx);
for(WjxDjxx djxx:list){ for (WjxDjxx djxx : list) {
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds())); djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
} }
page.setRecords(list); page.setRecords(list);
}else if(StringUtils.equals("0",wjxDjxx.getIsFinished())){ } else if (StringUtils.equals("0", wjxDjxx.getIsFinished())) {
//未完成答卷的 //未完成答卷的
List<WjxDjxx> list = baseMapper.findUnDjjgsPage(page,wjxDjxx); List<WjxDjxx> list = baseMapper.findUnDjjgsPage(page, wjxDjxx);
page.setRecords(list); page.setRecords(list);
}else{ } else {
//全部 //全部
List<WjxDjxx> list = baseMapper.findAllDjjgsPage(page,wjxDjxx); List<WjxDjxx> list = baseMapper.findAllDjjgsPage(page, wjxDjxx);
for(WjxDjxx djxx:list){ for (WjxDjxx djxx : list) {
if(djxx.getAnswerSeconds()!=-1){ if (djxx.getAnswerSeconds() != -1) {
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds())); djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
} }
} }
@ -566,20 +564,20 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
@Override @Override
public List<WjxDjxx> exportList(WjxDjxx wjxDjxx) { public List<WjxDjxx> exportList(WjxDjxx wjxDjxx) {
List<WjxDjxx> list = new ArrayList<>(); List<WjxDjxx> list = new ArrayList<>();
if(StringUtils.equals("1",wjxDjxx.getIsFinished())){ if (StringUtils.equals("1", wjxDjxx.getIsFinished())) {
//完成答卷的 //完成答卷的
list = baseMapper.findDjjgsPage(null,wjxDjxx); list = baseMapper.findDjjgsPage(null, wjxDjxx);
for(WjxDjxx djxx:list){ for (WjxDjxx djxx : list) {
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds())); djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
} }
}else if(StringUtils.equals("0",wjxDjxx.getIsFinished())){ } else if (StringUtils.equals("0", wjxDjxx.getIsFinished())) {
//未完成答卷的 //未完成答卷的
list = baseMapper.findUnDjjgsPage(null,wjxDjxx); list = baseMapper.findUnDjjgsPage(null, wjxDjxx);
}else{ } else {
//全部 //全部
list = baseMapper.findAllDjjgsPage(null,wjxDjxx); list = baseMapper.findAllDjjgsPage(null, wjxDjxx);
for(WjxDjxx djxx:list){ for (WjxDjxx djxx : list) {
if(djxx.getAnswerSeconds()!=-1){ if (djxx.getAnswerSeconds() != -1) {
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds())); djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
} }
} }
@ -590,20 +588,20 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
@Override @Override
public List<WjxDjxxDj> exportDjXls(WjxDjxxDj wjxDjxxdj) { public List<WjxDjxxDj> exportDjXls(WjxDjxxDj wjxDjxxdj) {
List<WjxDjxxDj> list = new ArrayList<>(); List<WjxDjxxDj> list = new ArrayList<>();
if(StringUtils.equals("1",wjxDjxxdj.getIsFinished())){ if (StringUtils.equals("1", wjxDjxxdj.getIsFinished())) {
//完成答卷的 //完成答卷的
list = baseMapper.findDjjgsDjPage(wjxDjxxdj); list = baseMapper.findDjjgsDjPage(wjxDjxxdj);
for(WjxDjxxDj djxx:list){ for (WjxDjxxDj djxx : list) {
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds())); djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
} }
}else if(StringUtils.equals("0",wjxDjxxdj.getIsFinished())){ } else if (StringUtils.equals("0", wjxDjxxdj.getIsFinished())) {
//未完成答卷的 //未完成答卷的
list = baseMapper.findUnDjjgsDJPage(wjxDjxxdj); list = baseMapper.findUnDjjgsDJPage(wjxDjxxdj);
}else{ } else {
//全部 //全部
list = baseMapper.findAllDjjgsDjPage(wjxDjxxdj); list = baseMapper.findAllDjjgsDjPage(wjxDjxxdj);
for(WjxDjxxDj djxx:list){ for (WjxDjxxDj djxx : list) {
if(djxx.getAnswerSeconds()!=-1){ if (djxx.getAnswerSeconds() != -1) {
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds())); djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
} }
} }
@ -634,12 +632,12 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
@Override @Override
public WjxDjxx querySdpfById(String id) { public WjxDjxx querySdpfById(String id) {
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
WjxDjxx djxx = baseMapper.findDjxx(id,user.getUsername()); WjxDjxx djxx = baseMapper.findDjxx(id, user.getUsername());
if(djxx != null){ if (djxx != null) {
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds())); djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
List<WjxDjxxTmxx> list = baseMapper.findDjtmxx2(djxx.getVid(),djxx.getJid()); List<WjxDjxxTmxx> list = baseMapper.findDjtmxx2(djxx.getVid(), djxx.getJid());
for(WjxDjxxTmxx wjxDjxxTmxx:list){ for (WjxDjxxTmxx wjxDjxxTmxx : list) {
List<WjxWjxxTmxx> list2= wjxWjxxTmxxMapper.selectByMainId(wjxDjxxTmxx.getId()); List<WjxWjxxTmxx> list2 = wjxWjxxTmxxMapper.selectByMainId(wjxDjxxTmxx.getId());
wjxDjxxTmxx.setWjxWjxxTmxxList(list2); wjxDjxxTmxx.setWjxWjxxTmxxList(list2);
//获取填空题答案 //获取填空题答案
WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectById(wjxDjxxTmxx.getId()); WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectById(wjxDjxxTmxx.getId());
@ -674,9 +672,9 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
@Override @Override
public void cxjcWjxScore(String vid) { public void cxjcWjxScore(String vid) {
QueryWrapper<WjxDjxx> queryWrapper = new QueryWrapper<>(); QueryWrapper<WjxDjxx> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("vid",vid); queryWrapper.eq("vid", vid);
List<WjxDjxx> list = baseMapper.selectList(queryWrapper); List<WjxDjxx> list = baseMapper.selectList(queryWrapper);
for(WjxDjxx par : list){ for (WjxDjxx par : list) {
jsscore(par.getJid()); jsscore(par.getJid());
} }
} }
@ -685,7 +683,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
public String updateDjjg(WjxDjxx wjxDjxxPar) { public String updateDjjg(WjxDjxx wjxDjxxPar) {
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String vid = wjxDjxxPar.getVid(); String vid = wjxDjxxPar.getVid();
if(vid ==null || vid.equals("")){ if (vid == null || vid.equals("")) {
return "此试卷错误,无法提交!"; return "此试卷错误,无法提交!";
} }
@ -694,42 +692,42 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
String submitData = wjxDjxx2.getSubmitData(); String submitData = wjxDjxx2.getSubmitData();
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("vid",Integer.valueOf(vid)); map.put("vid", Integer.valueOf(vid));
Long djys = ChronoUnit.SECONDS.between(wjxDjxx2.getOpenTime().toInstant(),wjxDjxx2.getCommitTime().toInstant()); Long djys = ChronoUnit.SECONDS.between(wjxDjxx2.getOpenTime().toInstant(), wjxDjxx2.getCommitTime().toInstant());
if(djys<3){ if (djys < 3) {
djys = 10L; djys = 10L;
} }
System.out.println("--------------------------------------------------"); System.out.println("--------------------------------------------------");
System.out.println("---------------djys--"+djys+"---------------------------"); System.out.println("---------------djys--" + djys + "---------------------------");
System.out.println("--------------------------------------------------"); System.out.println("--------------------------------------------------");
map.put("inputcosttime", djys); map.put("inputcosttime", djys);
map.put("submitdata",submitData); map.put("submitdata", submitData);
map.put("sojumpparm",wjxDjxx2.getUserId());//自定义链接参数用来透传用户ID map.put("sojumpparm", wjxDjxx2.getUserId());//自定义链接参数用来透传用户ID
//调用接口,提交 //调用接口,提交
String result = wjxUtil.openapi(map,"1001001"); String result = wjxUtil.openapi(map, "1001001");
String jidRes = ""; String jidRes = "";
if(!result.equals("")){ if (!result.equals("")) {
JSONObject jsonResult = JSONObject.parseObject(result); JSONObject jsonResult = JSONObject.parseObject(result);
if(jsonResult.getBoolean("result")){ if (jsonResult.getBoolean("result")) {
JSONObject dataJson = jsonResult.getJSONObject("data"); JSONObject dataJson = jsonResult.getJSONObject("data");
String vidRes = dataJson.getString("vid"); String vidRes = dataJson.getString("vid");
jidRes = dataJson.getString("jid"); jidRes = dataJson.getString("jid");
String sojumpparmRes = dataJson.getString("sojumpparm"); String sojumpparmRes = dataJson.getString("sojumpparm");
baseMapper.updateJid(sojumpparmRes,vidRes,jidRes); baseMapper.updateJid(sojumpparmRes, vidRes, jidRes);
//调用接口答卷查询 //调用接口答卷查询
Map<String,Object> selMap = new HashMap<>(); Map<String, Object> selMap = new HashMap<>();
selMap.put("vid",Integer.valueOf(vid)); selMap.put("vid", Integer.valueOf(vid));
selMap.put("jid",Long.valueOf(jidRes)); selMap.put("jid", Long.valueOf(jidRes));
//调用接口,查询答卷结果 //调用接口,查询答卷结果
String answerStr = wjxUtil.openapi(selMap,"1001002"); String answerStr = wjxUtil.openapi(selMap, "1001002");
if(!answerStr.equals("")){ if (!answerStr.equals("")) {
JSONObject ansJsonResult = JSONObject.parseObject(answerStr); JSONObject ansJsonResult = JSONObject.parseObject(answerStr);
if(ansJsonResult.getBoolean("result")){ if (ansJsonResult.getBoolean("result")) {
JSONObject ansDataJson = ansJsonResult.getJSONObject("data"); JSONObject ansDataJson = ansJsonResult.getJSONObject("data");
String answerVid = ansDataJson.getString("vid"); String answerVid = ansDataJson.getString("vid");
JSONObject answerJsonArray = ansDataJson.getJSONObject("answers"); JSONObject answerJsonArray = ansDataJson.getJSONObject("answers");
for(String key1 : answerJsonArray.keySet()){ for (String key1 : answerJsonArray.keySet()) {
JSONObject answer = answerJsonArray.getJSONObject(key1); JSONObject answer = answerJsonArray.getJSONObject(key1);
String jidAns = answer.getString("jid"); String jidAns = answer.getString("jid");
Integer answerSeconds = answer.getInteger("answer_seconds"); Integer answerSeconds = answer.getInteger("answer_seconds");
@ -745,7 +743,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
baseMapper.deleteDjItem(wjxDjxx); baseMapper.deleteDjItem(wjxDjxx);
//处理选项 //处理选项
JSONObject answerItemJson = answer.getJSONObject("answer_items"); JSONObject answerItemJson = answer.getJSONObject("answer_items");
if(answerItemJson!=null) { if (answerItemJson != null) {
for (String key2 : answerItemJson.keySet()) { for (String key2 : answerItemJson.keySet()) {
JSONObject answerItem = answerItemJson.getJSONObject(key2); JSONObject answerItem = answerItemJson.getJSONObject(key2);
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx(); WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
@ -845,28 +843,27 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
//修改答卷信息 //修改答卷信息
baseMapper.updateAnswer(wjxDjxx); baseMapper.updateAnswer(wjxDjxx);
} }
}else{ } else {
baseMapper.updateErrMsg(wjxDjxx2.getUserId(),vid,ansJsonResult.getString("errormsg")); baseMapper.updateErrMsg(wjxDjxx2.getUserId(), vid, ansJsonResult.getString("errormsg"));
return ansJsonResult.getString("errormsg"); return ansJsonResult.getString("errormsg");
} }
} }
}else{ } else {
baseMapper.updateErrMsg(wjxDjxx2.getUserId(),vid,jsonResult.getString("errormsg")); baseMapper.updateErrMsg(wjxDjxx2.getUserId(), vid, jsonResult.getString("errormsg"));
return jsonResult.getString("errormsg"); return jsonResult.getString("errormsg");
} }
} }
try { try {
if(StringUtils.isNotBlank(jidRes)){ if (StringUtils.isNotBlank(jidRes)) {
jsscore(jidRes); jsscore(jidRes);
} }
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return "提交成功!"; return "提交成功!";
} }
@ -874,19 +871,19 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
public String getDjjg(WjxDjxx wjxDjxxPar) { public String getDjjg(WjxDjxx wjxDjxxPar) {
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String vid = wjxDjxxPar.getVid(); String vid = wjxDjxxPar.getVid();
if(vid ==null || vid.equals("")){ if (vid == null || vid.equals("")) {
return "此试卷错误,无法提交!"; return "此试卷错误,无法提交!";
} }
//调用接口,提交 //调用接口,提交
String jidRes = wjxDjxxPar.getJid(); String jidRes = wjxDjxxPar.getJid();
//调用接口答卷查询 //调用接口答卷查询
Map<String,Object> selMap = new HashMap<>(); Map<String, Object> selMap = new HashMap<>();
selMap.put("vid",Integer.valueOf(vid)); selMap.put("vid", Integer.valueOf(vid));
selMap.put("jid",Long.valueOf(jidRes)); selMap.put("jid", Long.valueOf(jidRes));
//调用接口,查询答卷结果 //调用接口,查询答卷结果
String answerStr = wjxUtil.openapi(selMap,"1001002"); String answerStr = wjxUtil.openapi(selMap, "1001002");
if(!answerStr.equals("")) { if (!answerStr.equals("")) {
JSONObject ansJsonResult = JSONObject.parseObject(answerStr); JSONObject ansJsonResult = JSONObject.parseObject(answerStr);
if (ansJsonResult.getBoolean("result")) { if (ansJsonResult.getBoolean("result")) {
JSONObject ansDataJson = ansJsonResult.getJSONObject("data"); JSONObject ansDataJson = ansJsonResult.getJSONObject("data");
@ -908,7 +905,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
// baseMapper.deleteDjItem(wjxDjxx); // baseMapper.deleteDjItem(wjxDjxx);
//处理选项 //处理选项
JSONObject answerItemJson = answer.getJSONObject("answer_items"); JSONObject answerItemJson = answer.getJSONObject("answer_items");
if(answerItemJson!=null){ if (answerItemJson != null) {
for (String key2 : answerItemJson.keySet()) { for (String key2 : answerItemJson.keySet()) {
JSONObject answerItem = answerItemJson.getJSONObject(key2); JSONObject answerItem = answerItemJson.getJSONObject(key2);
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx(); WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
@ -965,7 +962,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
} }
WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx); WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx);
if(djxxTmxx==null){ if (djxxTmxx == null) {
baseMapper.addDjTmxx(wjxDjxxTmxx); baseMapper.addDjTmxx(wjxDjxxTmxx);
} }
@ -985,7 +982,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
} }
wjxDjxxTmxx.setId(id); wjxDjxxTmxx.setId(id);
WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx); WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx);
if(djxxTmxx==null){ if (djxxTmxx == null) {
baseMapper.addDjTmxx(wjxDjxxTmxx); baseMapper.addDjTmxx(wjxDjxxTmxx);
} }
} }
@ -1008,7 +1005,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
} }
wjxDjxxTmxx.setId(id); wjxDjxxTmxx.setId(id);
WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx); WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx);
if(djxxTmxx==null){ if (djxxTmxx == null) {
baseMapper.addDjTmxx(wjxDjxxTmxx); baseMapper.addDjTmxx(wjxDjxxTmxx);
} }
} }
@ -1025,28 +1022,34 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
} }
try { try {
if(StringUtils.isNotBlank(jidRes)){ if (StringUtils.isNotBlank(jidRes)) {
jsscore(jidRes); jsscore(jidRes);
} }
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return "获取成功!"; return "获取成功!";
} }
public void jsscore(String jid){ @Override
public int upZbcs(WjxDjxx wjxDjxx) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
wjxDjxx.setCreateBy(sysUser.getUsername());
return baseMapper.upZbcs(wjxDjxx);
}
public void jsscore(String jid) {
try { try {
if(StringUtils.equals(jid,"122233965812")){ if (StringUtils.equals(jid, "122233965812")) {
System.out.println("jid"); System.out.println("jid");
} }
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx(); WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
wjxDjxxTmxx.setJid(jid); wjxDjxxTmxx.setJid(jid);
wjxDjxxTmxx = baseMapper.getSumScore(wjxDjxxTmxx); wjxDjxxTmxx = baseMapper.getSumScore(wjxDjxxTmxx);
WjxDjxx par2 = new WjxDjxx(); WjxDjxx par2 = new WjxDjxx();
if(wjxDjxxTmxx.getItemScore() != null && wjxDjxxTmxx.getItemScore()>0){ if (wjxDjxxTmxx.getItemScore() != null && wjxDjxxTmxx.getItemScore() > 0) {
par2.setScore(wjxDjxxTmxx.getItemScore()); par2.setScore(wjxDjxxTmxx.getItemScore());
par2.setJid(jid); par2.setJid(jid);
baseMapper.updateScoreByJid(par2); baseMapper.updateScoreByJid(par2);

View File

@ -0,0 +1,165 @@
package org.jeecg.modules.kc.wjxDjxxFzbtj.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.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.wjxDjxxFzbtj.entity.WjxDjxxFzbtj;
import org.jeecg.modules.kc.wjxDjxxFzbtj.service.IWjxDjxxFzbtjService;
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.Map;
/**
* @Description: wjx_djxx_fzbtj
* @Author: jeecg-boot
* @Date: 2025-01-07
* @Version: V1.0
*/
@Api(tags = "wjx_djxx_fzbtj")
@RestController
@RequestMapping("/wjxDjxxFzbtj/wjxDjxxFzbtj")
@Slf4j
public class WjxDjxxFzbtjController extends JeecgController<WjxDjxxFzbtj, IWjxDjxxFzbtjService> {
@Autowired
private IWjxDjxxFzbtjService wjxDjxxFzbtjService;
/**
* 分页列表查询
*
* @param wjxDjxxFzbtj
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "wjx_djxx_fzbtj-分页列表查询")
@ApiOperation(value = "wjx_djxx_fzbtj-分页列表查询", notes = "wjx_djxx_fzbtj-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<WjxDjxxFzbtj>> queryPageList(WjxDjxxFzbtj wjxDjxxFzbtj,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WjxDjxxFzbtj> queryWrapper = QueryGenerator.initQueryWrapper(wjxDjxxFzbtj, req.getParameterMap());
Page<WjxDjxxFzbtj> page = new Page<WjxDjxxFzbtj>(pageNo, pageSize);
IPage<WjxDjxxFzbtj> pageList = wjxDjxxFzbtjService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param wjxDjxxFzbtj
* @return
*/
@AutoLog(value = "wjx_djxx_fzbtj-添加")
@ApiOperation(value = "wjx_djxx_fzbtj-添加", notes = "wjx_djxx_fzbtj-添加")
@PostMapping(value = "/add")
public Result<Map<String, Object>> add(@RequestBody WjxDjxxFzbtj wjxDjxxFzbtj) {
return Result.OK(wjxDjxxFzbtjService.saveData(wjxDjxxFzbtj));
}
/**
* 编辑
*
* @param wjxDjxxFzbtj
* @return
*/
@AutoLog(value = "wjx_djxx_fzbtj-编辑")
@ApiOperation(value = "wjx_djxx_fzbtj-编辑", notes = "wjx_djxx_fzbtj-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WjxDjxxFzbtj wjxDjxxFzbtj) {
wjxDjxxFzbtjService.updateById(wjxDjxxFzbtj);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "wjx_djxx_fzbtj-通过id删除")
@ApiOperation(value = "wjx_djxx_fzbtj-通过id删除", notes = "wjx_djxx_fzbtj-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
wjxDjxxFzbtjService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "wjx_djxx_fzbtj-批量删除")
@ApiOperation(value = "wjx_djxx_fzbtj-批量删除", notes = "wjx_djxx_fzbtj-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.wjxDjxxFzbtjService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "wjx_djxx_fzbtj-通过id查询")
@ApiOperation(value = "wjx_djxx_fzbtj-通过id查询", notes = "wjx_djxx_fzbtj-通过id查询")
@GetMapping(value = "/queryById")
public Result<WjxDjxxFzbtj> queryById(@RequestParam(name = "id", required = true) String id) {
WjxDjxxFzbtj wjxDjxxFzbtj = wjxDjxxFzbtjService.getById(id);
if (wjxDjxxFzbtj == null) {
return Result.error("未找到对应数据");
}
return Result.OK(wjxDjxxFzbtj);
}
/**
* 导出excel
*
* @param request
* @param wjxDjxxFzbtj
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, WjxDjxxFzbtj wjxDjxxFzbtj) {
return super.exportXls(request, wjxDjxxFzbtj, WjxDjxxFzbtj.class, "wjx_djxx_fzbtj");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, WjxDjxxFzbtj.class);
}
/**
* 获取考试剩余时间
*
* @param redisKey
* @return
*/
@PostMapping(value = "/getExamTime")
public Result<String> getExamTime(@RequestBody String redisKey) {
return Result.OK(wjxDjxxFzbtjService.getExamTime(redisKey));
}
}

View File

@ -0,0 +1,105 @@
package org.jeecg.modules.kc.wjxDjxxFzbtj.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import 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: wjx_djxx_fzbtj
* @Author: jeecg-boot
* @Date: 2025-01-07
* @Version: V1.0
*/
@Data
@TableName("wjx_djxx_fzbtj")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "wjx_djxx_fzbtj对象", description = "wjx_djxx_fzbtj")
public class WjxDjxxFzbtj implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private String id;
/**
* wjx_djxx表id
*/
@Excel(name = "wjx_djxx表id", width = 15)
@ApiModelProperty(value = "wjx_djxx表id")
private String djxxId;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**
* 学生姓名
*/
@Excel(name = "学生姓名", width = 15)
@ApiModelProperty(value = "学生姓名")
private String studentName;
/**
* 创建时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 修改时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "修改时间")
private Date updateTime;
/**
* 问卷编号(提交问卷查询问卷会用到)
*/
@Excel(name = "问卷编号(提交问卷、查询问卷会用到)", width = 15)
@ApiModelProperty(value = "问卷编号(提交问卷、查询问卷会用到)")
private String vid;
/**
* 答卷编号
*/
@Excel(name = "答卷编号", width = 15)
@ApiModelProperty(value = "答卷编号")
private String jid;
/**
* 作弊类型
* 1退出全屏
* 2切屏
* 3考试超时
*/
@Excel(name = "作弊类型1、退出全屏2、切屏3、考试超时4、开始答题", width = 15)
@ApiModelProperty(value = "作弊类型1、退出全屏2、切屏3、考试超时4、开始答题")
private int type;
/**
* 作弊内容XX时间XX操作
*/
@Excel(name = "作弊内容XX时间XX操作", width = 15)
@ApiModelProperty(value = "作弊内容XX时间XX操作")
private String content;
//作答时限分钟
@TableField(exist = false)
private Integer zdsx;
//结束时间
@TableField(exist = false)
private String endTime;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.kc.wjxDjxxFzbtj.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.wjxDjxxFzbtj.entity.WjxDjxxFzbtj;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: wjx_djxx_fzbtj
* @Author: jeecg-boot
* @Date: 2025-01-07
* @Version: V1.0
*/
public interface WjxDjxxFzbtjMapper extends BaseMapper<WjxDjxxFzbtj> {
}

View File

@ -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.wjxDjxxFzbtj.mapper.WjxDjxxFzbtjMapper">
</mapper>

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.kc.wjxDjxxFzbtj.service;
import org.jeecg.modules.kc.wjxDjxxFzbtj.entity.WjxDjxxFzbtj;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.Map;
/**
* @Description: wjx_djxx_fzbtj
* @Author: jeecg-boot
* @Date: 2025-01-07
* @Version: V1.0
*/
public interface IWjxDjxxFzbtjService extends IService<WjxDjxxFzbtj> {
Map<String, Object> saveData(WjxDjxxFzbtj wjxDjxxFzbtj);
String getExamTime(String redisKey);
}

View File

@ -0,0 +1,137 @@
package org.jeecg.modules.kc.wjxDjxxFzbtj.service.impl;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.wjxDjxxFzbtj.entity.WjxDjxxFzbtj;
import org.jeecg.modules.kc.wjxDjxxFzbtj.mapper.WjxDjxxFzbtjMapper;
import org.jeecg.modules.kc.wjxDjxxFzbtj.service.IWjxDjxxFzbtjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* @Description: wjx_djxx_fzbtj
* @Author: jeecg-boot
* @Date: 2025-01-07
* @Version: V1.0
*/
@Service
public class WjxDjxxFzbtjServiceImpl extends ServiceImpl<WjxDjxxFzbtjMapper, WjxDjxxFzbtj> implements IWjxDjxxFzbtjService {
@Autowired
public RedisTemplate redisTemplate;
@Override
public Map<String, Object> saveData(WjxDjxxFzbtj wjxDjxxFzbtj) {
// 创建返回的Map
Map<String, Object> resultMap = new HashMap<>();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
wjxDjxxFzbtj.setId(IdUtil.simpleUUID());
wjxDjxxFzbtj.setStudentName(sysUser.getRealname());
// 设置内容
switch (wjxDjxxFzbtj.getType()) {
case 1:
wjxDjxxFzbtj.setContent(sysUser.getRealname() + "" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss")) + "退出全屏;");
break;
case 2:
wjxDjxxFzbtj.setContent(sysUser.getRealname() + "" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss")) + "切屏;");
break;
case 3:
wjxDjxxFzbtj.setContent(sysUser.getRealname() + "" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss")) + "提交超时;");
break;
case 4:
if (wjxDjxxFzbtj.getZdsx() != null) {
String finishTime = oConvertUtils.getString(redisTemplate.opsForValue().get("ktcy" + ":" + wjxDjxxFzbtj.getVid() + ":" + sysUser.getUsername()));
resultMap.put("finishTime", finishTime);//考试结束时间
if (StringUtils.isBlank(finishTime)) {
//计算考试剩余时间
String endTimeStr = wjxDjxxFzbtj.getEndTime();
LocalDateTime endTime = LocalDateTime.parse(endTimeStr, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
LocalDateTime now = LocalDateTime.now();
Duration duration = Duration.between(now, endTime);
finishTime = LocalDateTime.now().plus(Duration.ofMinutes(wjxDjxxFzbtj.getZdsx())).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
redisTemplate.opsForValue().set(
"ktcy" + ":" + wjxDjxxFzbtj.getVid() + ":" + sysUser.getUsername(),
finishTime,
duration.getSeconds(),
TimeUnit.SECONDS);
resultMap.put("finishTime", finishTime);//考试结束时间
} else {
try {
// 解析结束时间并检查是否过期
LocalDateTime finishDateTime = LocalDateTime.parse(finishTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
LocalDateTime now = LocalDateTime.now();
boolean isExpired = !finishDateTime.isAfter(now);
resultMap.put("expired", isExpired);//是否超时
//未超时返回剩余时间格式化后的字符串
if (!isExpired) {
Duration duration = Duration.between(now, finishDateTime);
long hoursLeft = duration.toHours();
long minutesLeft = duration.toMinutes() % 60;
long secondsLeft = duration.getSeconds() % 60;
StringBuilder timeLeftBuilder = new StringBuilder();
if (hoursLeft > 0) {
timeLeftBuilder.append(hoursLeft).append("小时");
}
if (minutesLeft > 0 || hoursLeft == 0) { // 如果没有小时或有分钟则显示分钟
if (timeLeftBuilder.length() > 0) {
timeLeftBuilder.append(" ");
}
timeLeftBuilder.append(minutesLeft).append("分钟");
}
if (secondsLeft > 0 || (hoursLeft == 0 && minutesLeft == 0)) { // 如果没有小时和分钟或者有秒则显示秒
if (timeLeftBuilder.length() > 0) {
timeLeftBuilder.append(" ");
}
timeLeftBuilder.append(secondsLeft).append("");
}
resultMap.put("timeLeft", timeLeftBuilder.toString());
}
} catch (DateTimeParseException e) {
// 如果解析失败可以在这里处理异常
// Map<String, Object> errorResult = new HashMap<>();
// errorResult.put("error", "时间格式错误");
// return errorResult;
e.printStackTrace();
}
}
}
wjxDjxxFzbtj.setContent(sysUser.getRealname() + "" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss")) + "开始作答;");
break;
default:
// 处理其他类型
break;
}
baseMapper.insert(wjxDjxxFzbtj);
return resultMap;
}
@Override
public String getExamTime(String redisKey) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String string = oConvertUtils.getString(redisTemplate.opsForValue().get(redisKey + ":" + sysUser.getUsername()));
return string;
}
}

View File

@ -57,13 +57,13 @@ import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
/** /**
* @Description: 问卷信息 * @Description: 问卷信息
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2024-04-26 * @Date: 2024-04-26
* @Version: V1.0 * @Version: V1.0
*/ */
@Api(tags="问卷信息") @Api(tags = "问卷信息")
@RestController @RestController
@RequestMapping("/wjxWjxx/wjxWjxx") @RequestMapping("/wjxWjxx/wjxWjxx")
@Slf4j @Slf4j
@ -83,7 +83,6 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
private IWjxWjxxTmlbService wjxWjxxTmlbService; private IWjxWjxxTmlbService wjxWjxxTmlbService;
@Autowired @Autowired
private SysBaseApiImpl sysBaseApi; private SysBaseApiImpl sysBaseApi;
@Autowired @Autowired
@ -95,6 +94,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
private String upLoadPath; private String upLoadPath;
@Autowired @Autowired
private IKcKechengbiaoService kcKechengbiaoService; private IKcKechengbiaoService kcKechengbiaoService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -105,11 +105,11 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
* @return * @return
*/ */
//@AutoLog(value = "问卷信息-分页列表查询") //@AutoLog(value = "问卷信息-分页列表查询")
@ApiOperation(value="问卷信息-分页列表查询", notes="问卷信息-分页列表查询") @ApiOperation(value = "问卷信息-分页列表查询", notes = "问卷信息-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<IPage<WjxWjxx>> queryPageList(WjxWjxx wjxWjxx, public Result<IPage<WjxWjxx>> queryPageList(WjxWjxx wjxWjxx,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
// QueryWrapper<WjxWjxx> queryWrapper = QueryGenerator.initQueryWrapper(wjxWjxx, req.getParameterMap()); // QueryWrapper<WjxWjxx> queryWrapper = QueryGenerator.initQueryWrapper(wjxWjxx, req.getParameterMap());
// queryWrapper.orderByDesc("create_time"); // queryWrapper.orderByDesc("create_time");
@ -123,15 +123,16 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
} }
@ApiOperation(value="问卷信息-分页列表查询", notes="问卷信息-分页列表查询") @ApiOperation(value = "问卷信息-分页列表查询", notes = "问卷信息-分页列表查询")
@GetMapping(value = "/newlist") @GetMapping(value = "/newlist")
public Result<IPage<WjxWjxx>> newlist(WjxWjxx wjxWjxx, public Result<IPage<WjxWjxx>> newlist(WjxWjxx wjxWjxx,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
Page<WjxWjxx> pageList = wjxWjxxService.findPage(wjxWjxx, new Page<>(pageNo, pageSize)); Page<WjxWjxx> pageList = wjxWjxxService.findPage(wjxWjxx, new Page<>(pageNo, pageSize));
return Result.OK(pageList); return Result.OK(pageList);
} }
/** /**
* 学生问卷分页列表查询 * 学生问卷分页列表查询
* *
@ -142,11 +143,11 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
* @return * @return
*/ */
//@AutoLog(value = "问卷信息-分页列表查询") //@AutoLog(value = "问卷信息-分页列表查询")
@ApiOperation(value="问卷信息-分页列表查询", notes="问卷信息-分页列表查询") @ApiOperation(value = "问卷信息-分页列表查询", notes = "问卷信息-分页列表查询")
@GetMapping(value = "/stuList") @GetMapping(value = "/stuList")
public Result<IPage<WjxWjxx>> queryPageStuList(WjxWjxx wjxWjxx, public Result<IPage<WjxWjxx>> queryPageStuList(WjxWjxx wjxWjxx,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
Page<WjxWjxx> pageList = wjxWjxxService.findStuPage(wjxWjxx, new Page<>(pageNo, pageSize)); Page<WjxWjxx> pageList = wjxWjxxService.findStuPage(wjxWjxx, new Page<>(pageNo, pageSize));
return Result.OK(pageList); return Result.OK(pageList);
@ -159,7 +160,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
* @return * @return
*/ */
@AutoLog(value = "问卷信息-添加") @AutoLog(value = "问卷信息-添加")
@ApiOperation(value="问卷信息-添加", notes="问卷信息-添加") @ApiOperation(value = "问卷信息-添加", notes = "问卷信息-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody WjxWjxx wjxWjxx) { public Result<String> add(@RequestBody WjxWjxx wjxWjxx) {
wjxWjxxService.save(wjxWjxx); wjxWjxxService.save(wjxWjxx);
@ -167,7 +168,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
} }
@AutoLog(value = "问卷发布-添加") @AutoLog(value = "问卷发布-添加")
@ApiOperation(value="问卷发布-添加", notes="问卷发布-添加") @ApiOperation(value = "问卷发布-添加", notes = "问卷发布-添加")
@PostMapping(value = "/batchAdd") @PostMapping(value = "/batchAdd")
public Result<String> batchAdd(@RequestBody List<WjxWjxx> list) { public Result<String> batchAdd(@RequestBody List<WjxWjxx> list) {
WjxWjxx zyInfo = list.get(0); WjxWjxx zyInfo = list.get(0);
@ -175,26 +176,26 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
//删除老师留过的问卷重新生成新的 //删除老师留过的问卷重新生成新的
QueryWrapper<WjxWjxx> query = new QueryWrapper<>(); QueryWrapper<WjxWjxx> query = new QueryWrapper<>();
query.eq("rwbh", zyInfo.getRwbh()); query.eq("rwbh", zyInfo.getRwbh());
query.eq("create_by",zyInfo.getCreateBy()); query.eq("create_by", zyInfo.getCreateBy());
query.eq("atype",zyInfo.getAtype()); query.eq("atype", zyInfo.getAtype());
List<WjxWjxx> oldList = wjxWjxxService.list(query); List<WjxWjxx> oldList = wjxWjxxService.list(query);
wjxWjxxService.remove(query); wjxWjxxService.remove(query);
KcSysConfig kcSysConfig = kcSysConfigService.getById("1"); KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>(); QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
kcKechengbiaoQueryWrapper.eq("xqxn",kcSysConfig.getFlag1()); kcKechengbiaoQueryWrapper.eq("xqxn", kcSysConfig.getFlag1());
kcKechengbiaoQueryWrapper.eq("rwbh",zyInfo.getRwbh()); kcKechengbiaoQueryWrapper.eq("rwbh", zyInfo.getRwbh());
kcKechengbiaoQueryWrapper.last("limit 1"); kcKechengbiaoQueryWrapper.last("limit 1");
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper); KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
for(int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
WjxWjxx par = list.get(i); WjxWjxx par = list.get(i);
List<WjxWjxx> zyInfo1 = oldList.stream().filter(zyInfo2 -> zyInfo2.getId().equals(par.getId())).collect(Collectors.toList()); List<WjxWjxx> zyInfo1 = oldList.stream().filter(zyInfo2 -> zyInfo2.getId().equals(par.getId())).collect(Collectors.toList());
if(zyInfo1!=null && zyInfo1.size()>0){ if (zyInfo1 != null && zyInfo1.size() > 0) {
WjxWjxx zypar = zyInfo1.get(0); WjxWjxx zypar = zyInfo1.get(0);
zypar.setSort(par.getSort()); zypar.setSort(par.getSort());
zypar.setScore(par.getScore()); zypar.setScore(par.getScore());
wjxWjxxService.save(zypar); wjxWjxxService.save(zypar);
}else{ } else {
par.setXqxn(kcSysConfig.getFlag1()); par.setXqxn(kcSysConfig.getFlag1());
par.setQpublish("0"); par.setQpublish("0");
par.setXkrs(kcKechengbiao.getXkrs()); par.setXkrs(kcKechengbiao.getXkrs());
@ -206,26 +207,26 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
} }
@AutoLog(value = "问卷发布-添加") @AutoLog(value = "问卷发布-添加")
@ApiOperation(value="问卷发布-添加", notes="问卷发布-添加") @ApiOperation(value = "问卷发布-添加", notes = "问卷发布-添加")
@PostMapping(value = "/addOne") @PostMapping(value = "/addOne")
public Result<String> addOne(@RequestBody WjxWjxx zyInfo) { public Result<String> addOne(@RequestBody WjxWjxx zyInfo) {
KcSysConfig kcSysConfig = kcSysConfigService.getById("1"); KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>(); QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
kcKechengbiaoQueryWrapper.eq("xqxn",kcSysConfig.getFlag1()); kcKechengbiaoQueryWrapper.eq("xqxn", kcSysConfig.getFlag1());
kcKechengbiaoQueryWrapper.eq("rwbh",zyInfo.getRwbh()); kcKechengbiaoQueryWrapper.eq("rwbh", zyInfo.getRwbh());
kcKechengbiaoQueryWrapper.last("limit 1"); kcKechengbiaoQueryWrapper.last("limit 1");
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper); KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<WjxWjxx> zyInfoQueryWrapper = new QueryWrapper<>(); QueryWrapper<WjxWjxx> zyInfoQueryWrapper = new QueryWrapper<>();
zyInfoQueryWrapper.eq("xqxn",zyInfo.getXqxn()); zyInfoQueryWrapper.eq("xqxn", zyInfo.getXqxn());
// zyInfoQueryWrapper.eq("create_by",sysUser.getUsername()); // zyInfoQueryWrapper.eq("create_by",sysUser.getUsername());
zyInfoQueryWrapper.eq("rwbh",zyInfo.getRwbh()); zyInfoQueryWrapper.eq("rwbh", zyInfo.getRwbh());
zyInfoQueryWrapper.eq("atype",zyInfo.getAtype()); zyInfoQueryWrapper.eq("atype", zyInfo.getAtype());
List<WjxWjxx> list = wjxWjxxService.list(zyInfoQueryWrapper); List<WjxWjxx> list = wjxWjxxService.list(zyInfoQueryWrapper);
zyInfo.setSort(list.size()+1+""); zyInfo.setSort(list.size() + 1 + "");
zyInfo.setXqxn(kcSysConfig.getFlag1()); zyInfo.setXqxn(kcSysConfig.getFlag1());
zyInfo.setQpublish("0"); zyInfo.setQpublish("0");
zyInfo.setXkrs(kcKechengbiao.getXkrs()); zyInfo.setXkrs(kcKechengbiao.getXkrs());
@ -243,24 +244,24 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
* @return * @return
*/ */
@AutoLog(value = "问卷信息-编辑") @AutoLog(value = "问卷信息-编辑")
@ApiOperation(value="问卷信息-编辑", notes="问卷信息-编辑") @ApiOperation(value = "问卷信息-编辑", notes = "问卷信息-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody WjxWjxx wjxWjxx) { public Result<String> edit(@RequestBody WjxWjxx wjxWjxx) {
wjxWjxxService.updateById(wjxWjxx); wjxWjxxService.updateById(wjxWjxx);
List<WjxWjxxTmlbPage> list =wjxWjxx.getList(); List<WjxWjxxTmlbPage> list = wjxWjxx.getList();
String mainId = wjxWjxx.getId(); String mainId = wjxWjxx.getId();
if(list.size()>0){ if (list.size() > 0) {
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<WjxWjxxTmlb>(); QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<WjxWjxxTmlb>();
wjxWjxxTmlbQueryWrapper.eq("main_id",mainId); wjxWjxxTmlbQueryWrapper.eq("main_id", mainId);
List<WjxWjxxTmlb> list2 = wjxWjxxTmlbService.list(wjxWjxxTmlbQueryWrapper); List<WjxWjxxTmlb> list2 = wjxWjxxTmlbService.list(wjxWjxxTmlbQueryWrapper);
for(WjxWjxxTmlb WjxWjxxTmlb:list2){ for (WjxWjxxTmlb WjxWjxxTmlb : list2) {
wjxWjxxTmlbService.removeByMainId(WjxWjxxTmlb.getId()); wjxWjxxTmlbService.removeByMainId(WjxWjxxTmlb.getId());
} }
for(WjxWjxxTmlbPage wjxWjxxTmlbPage:list){ for (WjxWjxxTmlbPage wjxWjxxTmlbPage : list) {
wjxWjxxTmlbPage.setId(null); wjxWjxxTmlbPage.setId(null);
WjxWjxxTmlb wjxWjxxTmlb = new WjxWjxxTmlb(); WjxWjxxTmlb wjxWjxxTmlb = new WjxWjxxTmlb();
BeanUtils.copyProperties(wjxWjxxTmlbPage, wjxWjxxTmlb); BeanUtils.copyProperties(wjxWjxxTmlbPage, wjxWjxxTmlb);
@ -280,20 +281,20 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
* @return * @return
*/ */
@AutoLog(value = "问卷信息-通过id删除") @AutoLog(value = "问卷信息-通过id删除")
@ApiOperation(value="问卷信息-通过id删除", notes="问卷信息-通过id删除") @ApiOperation(value = "问卷信息-通过id删除", notes = "问卷信息-通过id删除")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) { public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
WjxWjxx zyInfo = wjxWjxxService.getById(id); WjxWjxx zyInfo = wjxWjxxService.getById(id);
wjxWjxxService.removeById(id); wjxWjxxService.removeById(id);
QueryWrapper<WjxWjxx> zyInfoQueryWrapper = new QueryWrapper<>(); QueryWrapper<WjxWjxx> zyInfoQueryWrapper = new QueryWrapper<>();
zyInfoQueryWrapper.eq("rwbh",zyInfo.getRwbh()); zyInfoQueryWrapper.eq("rwbh", zyInfo.getRwbh());
zyInfoQueryWrapper.eq("xqxn",zyInfo.getXqxn()); zyInfoQueryWrapper.eq("xqxn", zyInfo.getXqxn());
zyInfoQueryWrapper.eq("atype",zyInfo.getAtype()); zyInfoQueryWrapper.eq("atype", zyInfo.getAtype());
zyInfoQueryWrapper.orderByAsc("sort-0"); zyInfoQueryWrapper.orderByAsc("sort-0");
List<WjxWjxx> list = wjxWjxxService.list(zyInfoQueryWrapper); List<WjxWjxx> list = wjxWjxxService.list(zyInfoQueryWrapper);
for(int i=0;i<list.size();i++){ for (int i = 0; i < list.size(); i++) {
WjxWjxx zyInfoPar = list.get(i); WjxWjxx zyInfoPar = list.get(i);
zyInfoPar.setSort(i+1+""); zyInfoPar.setSort(i + 1 + "");
wjxWjxxService.updateById(zyInfoPar); wjxWjxxService.updateById(zyInfoPar);
} }
return Result.OK("删除成功!"); return Result.OK("删除成功!");
@ -306,10 +307,10 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
* @return * @return
*/ */
@AutoLog(value = "问卷信息-批量删除") @AutoLog(value = "问卷信息-批量删除")
@ApiOperation(value="问卷信息-批量删除", notes="问卷信息-批量删除") @ApiOperation(value = "问卷信息-批量删除", notes = "问卷信息-批量删除")
@RequiresPermissions("wjxWjxx:wjx_wjxx:deleteBatch") @RequiresPermissions("wjxWjxx:wjx_wjxx:deleteBatch")
@DeleteMapping(value = "/deleteBatch") @DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.wjxWjxxService.removeByIds(Arrays.asList(ids.split(","))); this.wjxWjxxService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!"); return Result.OK("批量删除成功!");
} }
@ -321,11 +322,11 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
* @return * @return
*/ */
//@AutoLog(value = "问卷信息-通过id查询") //@AutoLog(value = "问卷信息-通过id查询")
@ApiOperation(value="问卷信息-通过id查询", notes="问卷信息-通过id查询") @ApiOperation(value = "问卷信息-通过id查询", notes = "问卷信息-通过id查询")
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
public Result<WjxWjxx> queryById(@RequestParam(name="id",required=true) String id) { public Result<WjxWjxx> queryById(@RequestParam(name = "id", required = true) String id) {
WjxWjxx wjxWjxx = wjxWjxxService.getById(id); WjxWjxx wjxWjxx = wjxWjxxService.getById(id);
if(wjxWjxx==null) { if (wjxWjxx == null) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
} }
return Result.OK(wjxWjxx); return Result.OK(wjxWjxx);
@ -356,7 +357,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
return super.importExcel(request, response, WjxWjxx.class); return super.importExcel(request, response, WjxWjxx.class);
} }
@ApiOperation(value="问卷信息-通过id查询", notes="问卷信息-通过id查询") @ApiOperation(value = "问卷信息-通过id查询", notes = "问卷信息-通过id查询")
@GetMapping(value = "/getWjxLogin") @GetMapping(value = "/getWjxLogin")
public Result<WjxWjxx> getWjxLogin() { public Result<WjxWjxx> getWjxLogin() {
try { try {
@ -369,35 +370,35 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
return Result.OK(null); return Result.OK(null);
} }
@ApiOperation(value="获取课程信息", notes="获取课程信息") @ApiOperation(value = "获取课程信息", notes = "获取课程信息")
@GetMapping(value = "/kcxx") @GetMapping(value = "/kcxx")
public Result<WjxWjxx> kcxx(@RequestParam(name="rwbh",required=true) String rwbh,@RequestParam(name="xqxn",required=true) String xqxn) { public Result<WjxWjxx> kcxx(@RequestParam(name = "rwbh", required = true) String rwbh, @RequestParam(name = "xqxn", required = true) String xqxn) {
WjxWjxx wjxWjxx = wjxWjxxService.kcxx(rwbh,xqxn); WjxWjxx wjxWjxx = wjxWjxxService.kcxx(rwbh, xqxn);
return Result.OK(wjxWjxx); return Result.OK(wjxWjxx);
} }
@ApiOperation(value="发布问卷", notes="发布问卷") @ApiOperation(value = "发布问卷", notes = "发布问卷")
@GetMapping(value = "/fbwj") @GetMapping(value = "/fbwj")
public Result<String> fbwj(@RequestParam(name="id",required=true) String id,@RequestParam(name="wjlx",required=true) String wjlx) { public Result<String> fbwj(@RequestParam(name = "id", required = true) String id, @RequestParam(name = "wjlx", required = true) String wjlx) {
String res = wjxWjxxService.fbwj(id,wjlx); String res = wjxWjxxService.fbwj(id, wjlx);
WjxWjxx wjxWjxx=wjxWjxxService.getById(id); WjxWjxx wjxWjxx = wjxWjxxService.getById(id);
QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>(); QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>();
queryWrapper.apply("a.xh = b.xh"); queryWrapper.apply("a.xh = b.xh");
queryWrapper.eq("b.KCAPZBBH",wjxWjxx.getRwbh()); queryWrapper.eq("b.KCAPZBBH", wjxWjxx.getRwbh());
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper); List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
String type = ""; String type = "";
String content = ""; String content = "";
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(StringUtils.equals(wjlx,"6")){ if (StringUtils.equals(wjlx, "6")) {
type = "2"; type = "2";
content = sysUser.getRealname()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”测验,该测验完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成"; content = sysUser.getRealname() + "教师发起了[" + wjxWjxx.getKcmc() + "]课程“" + wjxWjxx.getTitle() + "”测验,该测验完成时间: " + DateUtils.formatDate(wjxWjxx.getStartTime(), "yyyy-MM-dd") + " ~ " + DateUtils.formatDate(wjxWjxx.getEndTime(), "yyyy-MM-dd") + ",请及时完成";
}else{ } else {
type = "3"; type = "3";
content = sysUser.getRealname()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”问卷,该问卷完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成"; 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){ for (Xxhbbks xxhbbks : list) {
//作业代办提醒 //作业代办提醒
ZyDbtx zyDbtx = new ZyDbtx(); ZyDbtx zyDbtx = new ZyDbtx();
@ -424,20 +425,20 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
} }
@ApiOperation(value="发布问卷", notes="发布问卷") @ApiOperation(value = "发布问卷", notes = "发布问卷")
@GetMapping(value = "/sendWjWechat") @GetMapping(value = "/sendWjWechat")
public Result<WjxWjxx> sendWjWechat(@RequestParam(name="id",required=true) String id,@RequestParam(name="wjlx",required=true) String wjlx) { public Result<WjxWjxx> sendWjWechat(@RequestParam(name = "id", required = true) String id, @RequestParam(name = "wjlx", required = true) String wjlx) {
WjxWjxx wjxWjxx=wjxWjxxService.getById(id); WjxWjxx wjxWjxx = wjxWjxxService.getById(id);
QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>(); QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>();
queryWrapper.apply("a.xh = b.xh"); queryWrapper.apply("a.xh = b.xh");
queryWrapper.eq("b.KCAPZBBH",wjxWjxx.getRwbh()); queryWrapper.eq("b.KCAPZBBH", wjxWjxx.getRwbh());
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper); List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
String content = ""; String content = "";
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(StringUtils.equals(wjlx,"6")){ if (StringUtils.equals(wjlx, "6")) {
content = sysUser.getRealname()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”测验,该测验完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成"; content = sysUser.getRealname() + "教师发起了[" + wjxWjxx.getKcmc() + "]课程“" + wjxWjxx.getTitle() + "”测验,该测验完成时间: " + DateUtils.formatDate(wjxWjxx.getStartTime(), "yyyy-MM-dd") + " ~ " + DateUtils.formatDate(wjxWjxx.getEndTime(), "yyyy-MM-dd") + ",请及时完成";
}else{ } else {
content = sysUser.getRealname()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”问卷,该问卷完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成"; 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){ // for(Xxhbbks xxhbbks:list){
// try { // try {
@ -465,16 +466,16 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
public void sendWxmessage(KcWechatSendLog kcWechatSendLog) { public void sendWxmessage(KcWechatSendLog kcWechatSendLog) {
String openId = kcWechatSendLog.getOpenid();//曹老师账号 String openId = kcWechatSendLog.getOpenid();//曹老师账号
System.out.println("openId:"+openId+""); System.out.println("openId:" + openId + "");
if(org.apache.commons.lang3.StringUtils.isNotEmpty(openId)){ if (org.apache.commons.lang3.StringUtils.isNotEmpty(openId)) {
try { try {
String urlToken = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="+ appId +"&corpsecret=" + appIdSecret; String urlToken = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + appId + "&corpsecret=" + appIdSecret;
System.out.println("urlToken "+ urlToken); System.out.println("urlToken " + urlToken);
String res = HttpUtil.get(urlToken); String res = HttpUtil.get(urlToken);
JSONObject jsonObjectToken = JSONObject.parseObject(res); JSONObject jsonObjectToken = JSONObject.parseObject(res);
System.out.println("jsonObjectToken{}"+ jsonObjectToken); System.out.println("jsonObjectToken{}" + jsonObjectToken);
String accessToken = jsonObjectToken.getString("access_token"); String accessToken = jsonObjectToken.getString("access_token");
System.out.println("accessToken{}"+ accessToken); System.out.println("accessToken{}" + accessToken);
// 微信的基础accessToken // 微信的基础accessToken
String url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=" + accessToken; String url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=" + accessToken;
@ -482,7 +483,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
// 1xx老师你好您本学期2023秋听课要求为5次当前实际听课次数3次请尽快完成本学期的听课任务 // 1xx老师你好您本学期2023秋听课要求为5次当前实际听课次数3次请尽快完成本学期的听课任务
String html = kcWechatSendLog.getYtkcs(); String html = kcWechatSendLog.getYtkcs();
html = html + "\n<a href=\""+domainTo+"\">查看</a>"; html = html + "\n<a href=\"" + domainTo + "\">查看</a>";
sendMag.put("content", html);//授课老师推送内容 sendMag.put("content", html);//授课老师推送内容
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
//拼接base参数 //拼接base参数
@ -490,76 +491,75 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
sendBody.put("touser", openId); // openId sendBody.put("touser", openId); // openId
sendBody.put("msgtype", "text"); // 消息类型此时固定为text sendBody.put("msgtype", "text"); // 消息类型此时固定为text
sendBody.put("agentid", agentid); // 企业id sendBody.put("agentid", agentid); // 企业id
sendBody.put("text",sendMag); //发送内容 sendBody.put("text", sendMag); //发送内容
ResponseEntity<String> forEntity = restTemplate.postForEntity(url, sendBody, String.class); ResponseEntity<String> forEntity = restTemplate.postForEntity(url, sendBody, String.class);
JSONObject jsonObject2 = JSONObject.parseObject(forEntity.getBody()); JSONObject jsonObject2 = JSONObject.parseObject(forEntity.getBody());
System.out.println("jsonObject2 : " + jsonObject2); System.out.println("jsonObject2 : " + jsonObject2);
String messageCode = jsonObject2.getString("errcode"); String messageCode = jsonObject2.getString("errcode");
String msgId = jsonObject2.getString("msgid"); String msgId = jsonObject2.getString("msgid");
System.out.println("messageCode : " + messageCode + ", msgId: " +msgId); System.out.println("messageCode : " + messageCode + ", msgId: " + msgId);
}catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
}else{ } else {
} }
} }
@ApiOperation(value="统计分析", notes="统计分析") @ApiOperation(value = "统计分析", notes = "统计分析")
@GetMapping(value = "/wjxxTjfx") @GetMapping(value = "/wjxxTjfx")
public Result<JSONObject> wjxxTjfx(@RequestParam(name="id",required=true) String id) { public Result<JSONObject> wjxxTjfx(@RequestParam(name = "id", required = true) String id) {
JSONObject res = wjxWjxxService.wjxxTjfx(id); JSONObject res = wjxWjxxService.wjxxTjfx(id);
return Result.OK(res); return Result.OK(res);
} }
@ApiOperation(value="问卷下载", notes="问卷下载") @ApiOperation(value = "问卷下载", notes = "问卷下载")
@GetMapping(value = "/wjxxDownLoad") @GetMapping(value = "/wjxxDownLoad")
public Result<JSONObject> wjxxDownLoad(@RequestParam(name="id",required=true) String id) { public Result<JSONObject> wjxxDownLoad(@RequestParam(name = "id", required = true) String id) {
JSONObject res = wjxWjxxService.wjxxDownLoad(id); JSONObject res = wjxWjxxService.wjxxDownLoad(id);
return Result.OK(res); return Result.OK(res);
} }
@ApiOperation(value = "教学大纲-分页列表查询", notes = "教学大纲-分页列表查询")
@ApiOperation(value="教学大纲-分页列表查询", notes="教学大纲-分页列表查询")
@GetMapping(value = "/sysList") @GetMapping(value = "/sysList")
public Result<IPage<KccyglSys>> sysList(KccyglSys kccyglSys, public Result<IPage<KccyglSys>> sysList(KccyglSys kccyglSys,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//-------------获取当前登陆人是否是管理员角色如果不是都按照教务秘书处理--------------------------- //-------------获取当前登陆人是否是管理员角色如果不是都按照教务秘书处理---------------------------
List<String> roleList = sysBaseApi.getRolesByUsername(sysUser.getUsername()); List<String> roleList = sysBaseApi.getRolesByUsername(sysUser.getUsername());
String adminRole = "1";//0 admin 1教务秘书 String adminRole = "1";//0 admin 1教务秘书
for(String role :roleList){ for (String role : roleList) {
if(org.apache.commons.lang.StringUtils.equals("admin",role)){ if (org.apache.commons.lang.StringUtils.equals("admin", role)) {
adminRole = "0"; adminRole = "0";
break; break;
} }
} }
QueryWrapper<KccyglSys> queryWrapper = new QueryWrapper<KccyglSys>(); QueryWrapper<KccyglSys> queryWrapper = new QueryWrapper<KccyglSys>();
if(org.apache.commons.lang.StringUtils.equals("1",adminRole)){ if (org.apache.commons.lang.StringUtils.equals("1", adminRole)) {
QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapperCon = new QueryWrapper<KcExportConfigTpkwcqkjzglx>(); QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapperCon = new QueryWrapper<KcExportConfigTpkwcqkjzglx>();
queryWrapperCon.eq("gh",sysUser.getUsername()); queryWrapperCon.eq("gh", sysUser.getUsername());
queryWrapperCon.orderByDesc("create_time"); queryWrapperCon.orderByDesc("create_time");
queryWrapperCon.last("limit 1"); queryWrapperCon.last("limit 1");
KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx = kcExportConfigTpkwcqkjzglxService.getOne(queryWrapperCon); KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx = kcExportConfigTpkwcqkjzglxService.getOne(queryWrapperCon);
queryWrapper.eq("kkdw",kcExportConfigTpkwcqkjzglx.getDwmc()); queryWrapper.eq("kkdw", kcExportConfigTpkwcqkjzglx.getDwmc());
} }
if(com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(kccyglSys.getXqxn())){ if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(kccyglSys.getXqxn())) {
KcSysConfig kcSysConfig = kcSysConfigService.getById("1"); KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
queryWrapper.eq("xqxn",kcSysConfig.getFlag1()); queryWrapper.eq("xqxn", kcSysConfig.getFlag1());
}else{ } else {
queryWrapper.eq("xqxn",kccyglSys.getXqxn()); queryWrapper.eq("xqxn", kccyglSys.getXqxn());
} }
queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(kccyglSys.getKkdw()),"kkdw",kccyglSys.getKkdw()); queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(kccyglSys.getKkdw()), "kkdw", kccyglSys.getKkdw());
queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(kccyglSys.getKcmc()),"kcmc",kccyglSys.getKcmc()); queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(kccyglSys.getKcmc()), "kcmc", kccyglSys.getKcmc());
queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(kccyglSys.getKcbh()),"kcbh",kccyglSys.getKcbh()); queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(kccyglSys.getKcbh()), "kcbh", kccyglSys.getKcbh());
queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(kccyglSys.getSkjs()),"skjs",kccyglSys.getSkjs()); queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(kccyglSys.getSkjs()), "skjs", kccyglSys.getSkjs());
Page<KccyglSys> page = new Page<KccyglSys>(pageNo, pageSize); Page<KccyglSys> page = new Page<KccyglSys>(pageNo, pageSize);
IPage<KccyglSys> pageList = wjxWjxxService.sysList(page, queryWrapper,kccyglSys); IPage<KccyglSys> pageList = wjxWjxxService.sysList(page, queryWrapper, kccyglSys);
return Result.OK(pageList); return Result.OK(pageList);
} }
@ -575,34 +575,34 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
//-------------获取当前登陆人是否是管理员角色如果不是都按照教务秘书处理--------------------------- //-------------获取当前登陆人是否是管理员角色如果不是都按照教务秘书处理---------------------------
List<String> roleList = sysBaseApi.getRolesByUsername(sysUser.getUsername()); List<String> roleList = sysBaseApi.getRolesByUsername(sysUser.getUsername());
String adminRole = "1";//0 admin 1教务秘书 String adminRole = "1";//0 admin 1教务秘书
for(String role :roleList){ for (String role : roleList) {
if(org.apache.commons.lang.StringUtils.equals("admin",role)){ if (org.apache.commons.lang.StringUtils.equals("admin", role)) {
adminRole = "0"; adminRole = "0";
break; break;
} }
} }
if(org.apache.commons.lang.StringUtils.equals("1",adminRole)){ if (org.apache.commons.lang.StringUtils.equals("1", adminRole)) {
QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapperCon = new QueryWrapper<KcExportConfigTpkwcqkjzglx>(); QueryWrapper<KcExportConfigTpkwcqkjzglx> queryWrapperCon = new QueryWrapper<KcExportConfigTpkwcqkjzglx>();
queryWrapperCon.eq("gh",sysUser.getUsername()); queryWrapperCon.eq("gh", sysUser.getUsername());
queryWrapperCon.orderByDesc("create_time"); queryWrapperCon.orderByDesc("create_time");
queryWrapperCon.last("limit 1"); queryWrapperCon.last("limit 1");
KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx = kcExportConfigTpkwcqkjzglxService.getOne(queryWrapperCon); KcExportConfigTpkwcqkjzglx kcExportConfigTpkwcqkjzglx = kcExportConfigTpkwcqkjzglxService.getOne(queryWrapperCon);
queryWrapper.eq("kkdw",kcExportConfigTpkwcqkjzglx.getDwmc()); queryWrapper.eq("kkdw", kcExportConfigTpkwcqkjzglx.getDwmc());
} }
if(com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(KccyglSys.getXqxn())){ if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(KccyglSys.getXqxn())) {
KcSysConfig kcSysConfig = kcSysConfigService.getById("1"); KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
queryWrapper.eq("xqxn",kcSysConfig.getFlag1()); queryWrapper.eq("xqxn", kcSysConfig.getFlag1());
}else{ } else {
queryWrapper.eq("xqxn",KccyglSys.getXqxn()); queryWrapper.eq("xqxn", KccyglSys.getXqxn());
} }
queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(KccyglSys.getKkdw()),"kkdw",KccyglSys.getKkdw()); queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(KccyglSys.getKkdw()), "kkdw", KccyglSys.getKkdw());
queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(KccyglSys.getKcmc()),"kcmc",KccyglSys.getKcmc()); queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(KccyglSys.getKcmc()), "kcmc", KccyglSys.getKcmc());
queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(KccyglSys.getKcbh()),"kcbh",KccyglSys.getKcbh()); queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(KccyglSys.getKcbh()), "kcbh", KccyglSys.getKcbh());
queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(KccyglSys.getSkjs()),"skjs",KccyglSys.getSkjs()); queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(KccyglSys.getSkjs()), "skjs", KccyglSys.getSkjs());
// Step.2 获取导出数据 // Step.2 获取导出数据
List<KccyglSys> exportList = service.exportSysXls(queryWrapper,KccyglSys); List<KccyglSys> exportList = service.exportSysXls(queryWrapper, KccyglSys);
// Step.3 AutoPoi 导出Excel // Step.3 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
@ -610,17 +610,15 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
mv.addObject(NormalExcelConstants.FILE_NAME, title); mv.addObject(NormalExcelConstants.FILE_NAME, title);
mv.addObject(NormalExcelConstants.CLASS, KccyglSys.class); mv.addObject(NormalExcelConstants.CLASS, KccyglSys.class);
//update-begin--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置-------------------- //update-begin--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置--------------------
ExportParams exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title); ExportParams exportParams = new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
exportParams.setImageBasePath(upLoadPath); exportParams.setImageBasePath(upLoadPath);
//update-end--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置---------------------- //update-end--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置----------------------
mv.addObject(NormalExcelConstants.PARAMS,exportParams); mv.addObject(NormalExcelConstants.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, exportList); mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
return mv; return mv;
} }
@ApiOperation(value="判断学生是否答过题", notes="判断学生是否答过题") @ApiOperation(value="判断学生是否答过题", notes="判断学生是否答过题")
@GetMapping(value = "/querySfdtById") @GetMapping(value = "/querySfdtById")
public Result<WjxWjxx> querySfdtById(@RequestParam(name="id",required=true) String id) { public Result<WjxWjxx> querySfdtById(@RequestParam(name="id",required=true) String id) {
@ -632,23 +630,23 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
} }
@ApiOperation(value="是否是学生-是否允许答卷", notes="是否是学生-是否允许答卷") @ApiOperation(value = "是否是学生-是否允许答卷", notes = "是否是学生-是否允许答卷")
@GetMapping(value = "/getSfxs") @GetMapping(value = "/getSfxs")
public Result<WjxWjxx> getSfxs(@RequestParam(name="id",required=true) String id) { public Result<WjxWjxx> getSfxs(@RequestParam(name = "id", required = true) String id) {
WjxWjxx WjxWjxx = wjxWjxxService.getById(id); WjxWjxx WjxWjxx = wjxWjxxService.getById(id);
if(WjxWjxx==null) { if (WjxWjxx == null) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
} }
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>(); QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>();
queryWrapper.apply("a.xh = b.xh"); queryWrapper.apply("a.xh = b.xh");
queryWrapper.eq("b.KCAPZBBH",WjxWjxx.getRwbh()); queryWrapper.eq("b.KCAPZBBH", WjxWjxx.getRwbh());
WjxWjxx.setNum("0");//不是本次学生不可以答卷 WjxWjxx.setNum("0");//不是本次学生不可以答卷
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper); List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
for(Xxhbbks par : list){ for (Xxhbbks par : list) {
String xh = par.getXh(); String xh = par.getXh();
if(org.apache.commons.lang.StringUtils.equals(xh,sysUser.getUsername())){ if (org.apache.commons.lang.StringUtils.equals(xh, sysUser.getUsername())) {
WjxWjxx.setNum("1"); WjxWjxx.setNum("1");
break; break;
} }
@ -658,35 +656,34 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
} }
@ApiOperation(value="测验结果-通过id查询", notes="测验结果-通过id查询") @ApiOperation(value = "测验结果-通过id查询", notes = "测验结果-通过id查询")
@GetMapping(value = "/queryCyjgById") @GetMapping(value = "/queryCyjgById")
public Result<WjxWjxx> queryCyjgById(@RequestParam(name="id",required=true) String id) { public Result<WjxWjxx> queryCyjgById(@RequestParam(name = "id", required = true) String id) {
WjxWjxx wjxWjxx = wjxWjxxService.queryCyjgById(id); WjxWjxx wjxWjxx = wjxWjxxService.queryCyjgById(id);
if(wjxWjxx==null) { if (wjxWjxx == null) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
} }
return Result.OK(wjxWjxx); return Result.OK(wjxWjxx);
} }
@ApiOperation(value = "问卷信息-微信提醒", notes = "微信提醒")
@ApiOperation(value="问卷信息-微信提醒", notes="微信提醒")
@GetMapping(value = "/sendWxtx") @GetMapping(value = "/sendWxtx")
public void sendWxtx(@RequestParam(name="id",required=true) String id,@RequestParam(name="wjlx",required=true) String wjlx) { public void sendWxtx(@RequestParam(name = "id", required = true) String id, @RequestParam(name = "wjlx", required = true) String wjlx) {
WjxWjxx wjxWjxx=wjxWjxxService.getById(id); WjxWjxx wjxWjxx = wjxWjxxService.getById(id);
QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>(); QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>();
queryWrapper.apply("a.xh = b.xh"); queryWrapper.apply("a.xh = b.xh");
queryWrapper.eq("b.KCAPZBBH",wjxWjxx.getRwbh()); queryWrapper.eq("b.KCAPZBBH", wjxWjxx.getRwbh());
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper); List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
String content = ""; String content = "";
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(StringUtils.equals(wjlx,"6")){ if (StringUtils.equals(wjlx, "6")) {
content = sysUser.getRealname()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”测验,该测验完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成"; content = sysUser.getRealname() + "教师发起了[" + wjxWjxx.getKcmc() + "]课程“" + wjxWjxx.getTitle() + "”测验,该测验完成时间: " + DateUtils.formatDate(wjxWjxx.getStartTime(), "yyyy-MM-dd") + " ~ " + DateUtils.formatDate(wjxWjxx.getEndTime(), "yyyy-MM-dd") + ",请及时完成";
}else{ } else {
content = sysUser.getRealname()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”问卷,该问卷完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成"; 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){ for (Xxhbbks xxhbbks : list) {
try { try {
KcWechatSendLog kcWechatSendLog = new KcWechatSendLog(); KcWechatSendLog kcWechatSendLog = new KcWechatSendLog();
@ -694,7 +691,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
// kcWechatSendLog.setOpenid("2016900057");//指定曹老师账号 // kcWechatSendLog.setOpenid("2016900057");//指定曹老师账号
kcWechatSendLog.setYtkcs(content); kcWechatSendLog.setYtkcs(content);
sendWxmessage(kcWechatSendLog); sendWxmessage(kcWechatSendLog);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
break; break;
@ -702,11 +699,11 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
} }
@ApiOperation(value="问卷信息-分页列表查询", notes="问卷信息-分页列表查询") @ApiOperation(value = "问卷信息-分页列表查询", notes = "问卷信息-分页列表查询")
@GetMapping(value = "/listOther") @GetMapping(value = "/listOther")
public Result<IPage<WjxWjxx>> listOther(WjxWjxx wjxWjxx, public Result<IPage<WjxWjxx>> listOther(WjxWjxx wjxWjxx,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
wjxWjxx.setTeacherNo(user.getUsername()); wjxWjxx.setTeacherNo(user.getUsername());
@ -716,8 +713,8 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
@GetMapping(value = "/khclList") @GetMapping(value = "/khclList")
public Result<IPage<WjxWjxx>> khclList(WjxWjxx wjxWjxx, public Result<IPage<WjxWjxx>> khclList(WjxWjxx wjxWjxx,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<WjxWjxx> queryWrapper = QueryGenerator.initQueryWrapper(wjxWjxx, req.getParameterMap()); QueryWrapper<WjxWjxx> queryWrapper = QueryGenerator.initQueryWrapper(wjxWjxx, req.getParameterMap());
@ -730,13 +727,13 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
@PostMapping(value = "/uploadSckhcl") @PostMapping(value = "/uploadSckhcl")
public Result<String> uploadSckhcl(@RequestBody WjxWjxx wjxWjxx) { public Result<String> uploadSckhcl(@RequestBody WjxWjxx wjxWjxx) {
try { try {
System.out.println("ids:"+wjxWjxx.getId()); System.out.println("ids:" + wjxWjxx.getId());
wjxWjxxService.batchZyinfoKhcl(wjxWjxx.getId()); wjxWjxxService.batchZyinfoKhcl(wjxWjxx.getId());
}catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return Result.OK("考核材料上传成功!"); return Result.OK("考核材料上传成功!");
} }
} }

View File

@ -105,6 +105,10 @@ public class WjxWjxx implements Serializable {
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
private Date endTime; private Date endTime;
@ApiModelProperty(value = "防作弊模式Y-开启 N-关闭")
private String fzbms;
@ApiModelProperty(value = "作答时限(答题时间限制)")
private Integer zdsx;
private String sort;//排序 private String sort;//排序
private String score;//占比 private String score;//占比
@ -158,4 +162,6 @@ public class WjxWjxx implements Serializable {
private String yuanTeacherNo; private String yuanTeacherNo;
@TableField(exist = false) @TableField(exist = false)
private String yuanTeacherName; private String yuanTeacherName;
@TableField(exist = false)
private String ts;
} }

View File

@ -1,15 +1,15 @@
package org.jeecg.modules.kc.wjxWjxx.mapper; package org.jeecg.modules.kc.wjxWjxx.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 org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.wjxWjxx.entity.KccyglSys; import org.jeecg.modules.kc.wjxWjxx.entity.KccyglSys;
import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx; import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import java.util.List;
/** /**
* @Description: 问卷信息 * @Description: 问卷信息

View File

@ -40,6 +40,8 @@
a.kcmc, a.kcmc,
a.start_time, a.start_time,
a.end_time, a.end_time,
a.fzbms,
a.zdsx,
ifnull(b.flag,'-1') as flag, ifnull(b.flag,'-1') as flag,
b.id as djId b.id as djId
from wjx_wjxx a from wjx_wjxx a

View File

@ -3,13 +3,12 @@ package org.jeecg.modules.kc.wjxWjxx.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.kc.wjxWjxx.entity.KccyglSys; import org.jeecg.modules.kc.wjxWjxx.entity.KccyglSys;
import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx; import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Description: 问卷信息 * @Description: 问卷信息

View File

@ -1,12 +1,10 @@
package org.jeecg.modules.kc.wjxWjxx.service.impl; package org.jeecg.modules.kc.wjxWjxx.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xkcoding.http.HttpUtil; import com.xkcoding.http.HttpUtil;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
@ -36,19 +34,15 @@ import org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmlbMapper;
import org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmxxMapper; import org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmxxMapper;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx; import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService; import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import org.jeecg.modules.kc.zyInfoScjl.entity.ZyInfoScjl; import org.jeecg.modules.kc.zyInfoScjl.entity.ZyInfoScjl;
import org.jeecg.modules.kc.zyInfoScjl.service.IZyInfoScjlService; import org.jeecg.modules.kc.zyInfoScjl.service.IZyInfoScjlService;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
import org.jeecg.modules.tools.dbsdkfzpt.RestTemplateUtils; import org.jeecg.modules.tools.dbsdkfzpt.RestTemplateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*; import org.springframework.http.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.time.temporal.ChronoUnit;
import java.util.*; import java.util.*;
/** /**
@ -97,7 +91,7 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
this.uploadpath = uploadPath; this.uploadpath = uploadPath;
} }
@Value(value="${jeecg.uploadType}") @Value(value = "${jeecg.uploadType}")
private String uploadType; private String uploadType;
@Value(value = "${jeecg.path.webapp}") @Value(value = "${jeecg.path.webapp}")
private String downloadpath; private String downloadpath;
@ -107,17 +101,17 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
private String upLoadPath; private String upLoadPath;
@Override @Override
public Page<WjxWjxx> findPage(WjxWjxx wjxWjxx, Page<WjxWjxx> page){ public Page<WjxWjxx> findPage(WjxWjxx wjxWjxx, Page<WjxWjxx> page) {
List<WjxWjxx> list = baseMapper.findPage(page,wjxWjxx); List<WjxWjxx> list = baseMapper.findPage(page, wjxWjxx);
page.setRecords(list); page.setRecords(list);
return page; return page;
} }
@Override @Override
public Page<WjxWjxx> findStuPage(WjxWjxx wjxWjxx, Page<WjxWjxx> page){ public Page<WjxWjxx> findStuPage(WjxWjxx wjxWjxx, Page<WjxWjxx> page) {
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
wjxWjxx.setUserId(user.getUsername()); wjxWjxx.setUserId(user.getUsername());
List<WjxWjxx> list = baseMapper.findStuPage(page,wjxWjxx); List<WjxWjxx> list = baseMapper.findStuPage(page, wjxWjxx);
page.setRecords(list); page.setRecords(list);
return page; return page;
} }
@ -284,92 +278,92 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
// } // }
@Override @Override
public WjxWjxx kcxx(String rwbh,String xqxn){ public WjxWjxx kcxx(String rwbh, String xqxn) {
return baseMapper.kcxx(rwbh,xqxn); return baseMapper.kcxx(rwbh, xqxn);
} }
@Override @Override
public String fbwj(String id,String wjlx) { public String fbwj(String id, String wjlx) {
WjxWjxx wjxWjxx = baseMapper.selectById(id); WjxWjxx wjxWjxx = baseMapper.selectById(id);
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<>(); QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<>();
wjxWjxxTmlbQueryWrapper.eq("main_id", id); wjxWjxxTmlbQueryWrapper.eq("main_id", id);
wjxWjxxTmlbQueryWrapper.orderByAsc("wj_index"); wjxWjxxTmlbQueryWrapper.orderByAsc("wj_index");
List<WjxWjxxTmlb> wjxWjxxTmlbList =wjxWjxxTmlbMapper.selectList(wjxWjxxTmlbQueryWrapper); List<WjxWjxxTmlb> wjxWjxxTmlbList = wjxWjxxTmlbMapper.selectList(wjxWjxxTmlbQueryWrapper);
List<Map<String,Object>> questionsList = new ArrayList<>(); List<Map<String, Object>> questionsList = new ArrayList<>();
for(WjxWjxxTmlb wWjxWjxxTmlb:wjxWjxxTmlbList){ for (WjxWjxxTmlb wWjxWjxxTmlb : wjxWjxxTmlbList) {
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("q_index",wWjxWjxxTmlb.getWjIndex()); map.put("q_index", wWjxWjxxTmlb.getWjIndex());
map.put("q_type",wWjxWjxxTmlb.getWjType()); map.put("q_type", wWjxWjxxTmlb.getWjType());
map.put("q_title",wWjxWjxxTmlb.getWjTitle()); map.put("q_title", wWjxWjxxTmlb.getWjTitle());
if(wWjxWjxxTmlb.getWjSubtype() != null){ if (wWjxWjxxTmlb.getWjSubtype() != null) {
map.put("q_subtype",wWjxWjxxTmlb.getWjSubtype()); map.put("q_subtype", wWjxWjxxTmlb.getWjSubtype());
} }
if(wjlx.equals("6")){ if (wjlx.equals("6")) {
if(wWjxWjxxTmlb.getWjType() != 8){ if (wWjxWjxxTmlb.getWjType() != 8) {
if(wWjxWjxxTmlb.getWjScore()!=null){ if (wWjxWjxxTmlb.getWjScore() != null) {
map.put("q_score",wWjxWjxxTmlb.getWjScore()); map.put("q_score", wWjxWjxxTmlb.getWjScore());
} }
map.put("is_requir",false); map.put("is_requir", false);
map.put("q_ceshi",true); map.put("q_ceshi", true);
map.put("is_toupiao",3); map.put("is_toupiao", 3);
}else{ } else {
map.put("is_requir",false); map.put("is_requir", false);
} }
} }
if(wWjxWjxxTmlb.getWjType() == 3 || wWjxWjxxTmlb.getWjType() == 4){ if (wWjxWjxxTmlb.getWjType() == 3 || wWjxWjxxTmlb.getWjType() == 4) {
//单选和多选 //单选和多选
List<Map<String,Object>> itemsList = new ArrayList<>(); List<Map<String, Object>> itemsList = new ArrayList<>();
List<WjxWjxxTmxx> tmxxList = wjxWjxxTmxxMapper.selectByMainId(wWjxWjxxTmlb.getId()); List<WjxWjxxTmxx> tmxxList = wjxWjxxTmxxMapper.selectByMainId(wWjxWjxxTmlb.getId());
for(WjxWjxxTmxx wjxWjxxTmxx:tmxxList){ for (WjxWjxxTmxx wjxWjxxTmxx : tmxxList) {
Map<String,Object> tmxxMap = new HashMap<>(); Map<String, Object> tmxxMap = new HashMap<>();
tmxxMap.put("q_index",wjxWjxxTmxx.getWjIndex()); tmxxMap.put("q_index", wjxWjxxTmxx.getWjIndex());
tmxxMap.put("item_index",wjxWjxxTmxx.getItemIndex()); tmxxMap.put("item_index", wjxWjxxTmxx.getItemIndex());
tmxxMap.put("item_title",wjxWjxxTmxx.getItemTitle()); tmxxMap.put("item_title", wjxWjxxTmxx.getItemTitle());
tmxxMap.put("item_selected",Boolean.parseBoolean(wjxWjxxTmxx.getItemSelected())); tmxxMap.put("item_selected", Boolean.parseBoolean(wjxWjxxTmxx.getItemSelected()));
tmxxMap.put("item_score",0); tmxxMap.put("item_score", 0);
JSONObject json = new JSONObject(tmxxMap); JSONObject json = new JSONObject(tmxxMap);
itemsList.add(json); itemsList.add(json);
} }
map.put("items",itemsList); map.put("items", itemsList);
}else if(wWjxWjxxTmlb.getWjType() == 5){ } else if (wWjxWjxxTmlb.getWjType() == 5) {
//填空 //填空
if(wWjxWjxxTmlb.getWjAnswer()!=null){ if (wWjxWjxxTmlb.getWjAnswer() != null) {
map.put("answer",wWjxWjxxTmlb.getWjAnswer()); map.put("answer", wWjxWjxxTmlb.getWjAnswer());
}else{ } else {
map.put("answer","跳过"); map.put("answer", "跳过");
} }
}else if(wWjxWjxxTmlb.getWjType() == 6){ } else if (wWjxWjxxTmlb.getWjType() == 6) {
//多项填空,预留之后有需求再开发 //多项填空,预留之后有需求再开发
}else if(wWjxWjxxTmlb.getWjType() == 8){ } else if (wWjxWjxxTmlb.getWjType() == 8) {
//文件题目 //文件题目
map.put("q_subtype",8); map.put("q_subtype", 8);
} }
JSONObject json = new JSONObject(map); JSONObject json = new JSONObject(map);
questionsList.add(json); questionsList.add(json);
} }
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
//-----------题目必穿参数------------- //-----------题目必穿参数-------------
map.put("creater","jwctest"); map.put("creater", "jwctest");
map.put("atype",wjxWjxx.getAtype()); map.put("atype", wjxWjxx.getAtype());
map.put("title",wjxWjxx.getTitle()); map.put("title", wjxWjxx.getTitle());
if(StringUtils.isNotEmpty(wjxWjxx.getContent())){ if (StringUtils.isNotEmpty(wjxWjxx.getContent())) {
map.put("desc",wjxWjxx.getContent()); map.put("desc", wjxWjxx.getContent());
} }
map.put("publish",true); map.put("publish", true);
map.put("questions",questionsList.toString()); map.put("questions", questionsList.toString());
String result = wjxUtil.openapi(map,"1000101"); String result = wjxUtil.openapi(map, "1000101");
System.out.println(result); System.out.println(result);
if(!result.equals("")){ if (!result.equals("")) {
JSONObject jsonResult = JSONObject.parseObject(result); JSONObject jsonResult = JSONObject.parseObject(result);
if(jsonResult.getBoolean("result")){ if (jsonResult.getBoolean("result")) {
JSONObject dataJson = jsonResult.getJSONObject("data"); JSONObject dataJson = jsonResult.getJSONObject("data");
String vid = dataJson.getString("vid"); String vid = dataJson.getString("vid");
baseMapper.updateVid(id,vid); baseMapper.updateVid(id, vid);
}else{ } else {
return jsonResult.getString("errormsg"); return jsonResult.getString("errormsg");
} }
} }
@ -381,10 +375,10 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
WjxWjxx wjxWjxx = baseMapper.selectById(id); WjxWjxx wjxWjxx = baseMapper.selectById(id);
String vid = wjxWjxx.getVid(); String vid = wjxWjxx.getVid();
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("vid",Integer.valueOf(vid)); map.put("vid", Integer.valueOf(vid));
//调用接口,提交 //调用接口,提交
String result = wjxUtil.openapi(map,"1001101"); String result = wjxUtil.openapi(map, "1001101");
JSONObject jsonResult = JSONObject.parseObject(result); JSONObject jsonResult = JSONObject.parseObject(result);
return jsonResult; return jsonResult;
} }
@ -393,13 +387,13 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
public JSONObject wjxxDownLoad(String id) { public JSONObject wjxxDownLoad(String id) {
WjxWjxx wjxWjxx = baseMapper.selectById(id); WjxWjxx wjxWjxx = baseMapper.selectById(id);
String vid = wjxWjxx.getVid(); String vid = wjxWjxx.getVid();
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("vid",Integer.valueOf(vid)); map.put("vid", Integer.valueOf(vid));
map.put("suffix",0); map.put("suffix", 0);
//调用接口,提交 //调用接口,提交
String result = wjxUtil.openapi(map,"1001004"); String result = wjxUtil.openapi(map, "1001004");
JSONObject jsonResult = JSONObject.parseObject(result); JSONObject jsonResult = JSONObject.parseObject(result);
System.out.println("1----------->"+jsonResult.toString()); System.out.println("1----------->" + jsonResult.toString());
// if(StringUtils.equals("true",jsonResult.getString("result"))){ // if(StringUtils.equals("true",jsonResult.getString("result"))){
// JSONObject data = jsonResult.getJSONObject("data"); // JSONObject data = jsonResult.getJSONObject("data");
// String taskid = data.getString("taskid"); // String taskid = data.getString("taskid");
@ -432,13 +426,13 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
} }
@Override @Override
public IPage<KccyglSys> sysList(Page<KccyglSys> page, QueryWrapper<KccyglSys> queryWrapper,KccyglSys kccyglSys) { public IPage<KccyglSys> sysList(Page<KccyglSys> page, QueryWrapper<KccyglSys> queryWrapper, KccyglSys kccyglSys) {
return baseMapper.sysList(page,queryWrapper,kccyglSys); return baseMapper.sysList(page, queryWrapper, kccyglSys);
} }
@Override @Override
public List<KccyglSys> exportSysXls(QueryWrapper<KccyglSys> queryWrapper,KccyglSys kccyglSys) { public List<KccyglSys> exportSysXls(QueryWrapper<KccyglSys> queryWrapper, KccyglSys kccyglSys) {
return baseMapper.exportSysXls(queryWrapper,kccyglSys); return baseMapper.exportSysXls(queryWrapper, kccyglSys);
} }
@Override @Override
@ -448,7 +442,7 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
@Override @Override
public String querySfdtById(String id, String username) { public String querySfdtById(String id, String username) {
return baseMapper.querySfdtById(id,username); return baseMapper.querySfdtById(id, username);
} }
@Override @Override
@ -457,18 +451,17 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
WjxWjxx wjxWjxx = baseMapper.queryCyjgById(id); WjxWjxx wjxWjxx = baseMapper.queryCyjgById(id);
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<WjxWjxxTmlb>(); QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<WjxWjxxTmlb>();
wjxWjxxTmlbQueryWrapper.eq("main_id",id); wjxWjxxTmlbQueryWrapper.eq("main_id", id);
wjxWjxxTmlbQueryWrapper.orderByAsc("wj_index"); wjxWjxxTmlbQueryWrapper.orderByAsc("wj_index");
List<WjxWjxxTmlb> list = wjxWjxxTmlbMapper.selectList(wjxWjxxTmlbQueryWrapper); List<WjxWjxxTmlb> list = wjxWjxxTmlbMapper.selectList(wjxWjxxTmlbQueryWrapper);
for (WjxWjxxTmlb WjxWjxxTmlb : list) {
for(WjxWjxxTmlb WjxWjxxTmlb:list){
String num = "0"; String num = "0";
String num2 = "0"; String num2 = "0";
// if(org.apache.commons.lang3.StringUtils.equals("5",WjxWjxxTmlb.getWjType()+"")){ // if(org.apache.commons.lang3.StringUtils.equals("5",WjxWjxxTmlb.getWjType()+"")){
num= wjxDjxxMapper.getDjnumType(wjxWjxx.getVid(),WjxWjxxTmlb.getWjIndex(),null,"1"); num = wjxDjxxMapper.getDjnumType(wjxWjxx.getVid(), WjxWjxxTmlb.getWjIndex(), null, "1");
num2= wjxDjxxMapper.getDjnumType(wjxWjxx.getVid(),WjxWjxxTmlb.getWjIndex(),null,"2"); num2 = wjxDjxxMapper.getDjnumType(wjxWjxx.getVid(), WjxWjxxTmlb.getWjIndex(), null, "2");
WjxWjxxTmlb.setNum(num); WjxWjxxTmlb.setNum(num);
WjxWjxxTmlb.setNum2(num2); WjxWjxxTmlb.setNum2(num2);
// } // }
@ -476,18 +469,18 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
int yzd = Integer.parseInt(num) + Integer.parseInt(num2); int yzd = Integer.parseInt(num) + Integer.parseInt(num2);
int ddrs = Integer.parseInt(num); int ddrs = Integer.parseInt(num);
int dcrs = Integer.parseInt(num2); int dcrs = Integer.parseInt(num2);
List<WjxWjxxTmxx> list2= wjxWjxxTmxxMapper.selectByMainId(WjxWjxxTmlb.getId()); List<WjxWjxxTmxx> list2 = wjxWjxxTmxxMapper.selectByMainId(WjxWjxxTmlb.getId());
String itemSelected = ""; String itemSelected = "";
for(WjxWjxxTmxx WjxWjxxTmxx:list2){ for (WjxWjxxTmxx WjxWjxxTmxx : list2) {
String num3= wjxDjxxMapper.getDjnum(wjxWjxx.getVid(),WjxWjxxTmxx.getWjIndex(),WjxWjxxTmxx.getItemIndex()); String num3 = wjxDjxxMapper.getDjnum(wjxWjxx.getVid(), WjxWjxxTmxx.getWjIndex(), WjxWjxxTmxx.getItemIndex());
if(org.apache.commons.lang3.StringUtils.equals(WjxWjxxTmxx.getItemSelected(),"true")){ if (org.apache.commons.lang3.StringUtils.equals(WjxWjxxTmxx.getItemSelected(), "true")) {
itemSelected = itemSelected+WjxWjxxTmxx.getItemIndex()+","; itemSelected = itemSelected + WjxWjxxTmxx.getItemIndex() + ",";
} }
WjxWjxxTmxx.setNum(num3); WjxWjxxTmxx.setNum(num3);
} }
if(org.apache.commons.lang3.StringUtils.isNotBlank(itemSelected)){ if (org.apache.commons.lang3.StringUtils.isNotBlank(itemSelected)) {
itemSelected = itemSelected.substring(0, itemSelected.length()-1); itemSelected = itemSelected.substring(0, itemSelected.length() - 1);
} }
WjxWjxxTmlb.setItemSelected(itemSelected); WjxWjxxTmlb.setItemSelected(itemSelected);
WjxWjxxTmlb.setWjxWjxxTmxxList(list2); WjxWjxxTmlb.setWjxWjxxTmxxList(list2);
@ -505,29 +498,27 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
QueryWrapper<WjxWjxx> queryWrapper = new QueryWrapper<>(); QueryWrapper<WjxWjxx> queryWrapper = new QueryWrapper<>();
queryWrapper.le("start_time",new Date()); queryWrapper.le("start_time", new Date());
queryWrapper.eq("qpublish","0"); queryWrapper.eq("qpublish", "0");
List<WjxWjxx> list = baseMapper.selectList(queryWrapper); List<WjxWjxx> list = baseMapper.selectList(queryWrapper);
for(WjxWjxx wjxWjxx : list){ for (WjxWjxx wjxWjxx : list) {
fbwj(wjxWjxx.getId(),wjxWjxx.getAtype()); fbwj(wjxWjxx.getId(), wjxWjxx.getAtype());
QueryWrapper<Xxhbbks> queryWrapper2 = new QueryWrapper<>(); QueryWrapper<Xxhbbks> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.apply("a.xh = b.xh"); queryWrapper2.apply("a.xh = b.xh");
queryWrapper2.eq("b.KCAPZBBH",wjxWjxx.getRwbh()); queryWrapper2.eq("b.KCAPZBBH", wjxWjxx.getRwbh());
List<Xxhbbks> list2 = xxhbbksService.getXsxkbAllList(queryWrapper2); List<Xxhbbks> list2 = xxhbbksService.getXsxkbAllList(queryWrapper2);
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>(); QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
kcKechengbiaoQueryWrapper.eq("rwbh",wjxWjxx.getRwbh()); kcKechengbiaoQueryWrapper.eq("rwbh", wjxWjxx.getRwbh());
kcKechengbiaoQueryWrapper.eq("jgh",wjxWjxx.getCreateBy()); kcKechengbiaoQueryWrapper.eq("jgh", wjxWjxx.getCreateBy());
kcKechengbiaoQueryWrapper.eq("xqxn",wjxWjxx.getXqxn()); kcKechengbiaoQueryWrapper.eq("xqxn", wjxWjxx.getXqxn());
kcKechengbiaoQueryWrapper.last("limit 1"); kcKechengbiaoQueryWrapper.last("limit 1");
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper); KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
String content = kcKechengbiao.getSkjs()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”测验,该测验完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成"; String content = kcKechengbiao.getSkjs() + "教师发起了[" + wjxWjxx.getKcmc() + "]课程“" + wjxWjxx.getTitle() + "”测验,该测验完成时间: " + DateUtils.formatDate(wjxWjxx.getStartTime(), "yyyy-MM-dd") + " ~ " + DateUtils.formatDate(wjxWjxx.getEndTime(), "yyyy-MM-dd") + ",请及时完成";
for(Xxhbbks xxhbbks:list2){ for (Xxhbbks xxhbbks : list2) {
try { try {
//作业代办提醒 //作业代办提醒
ZyDbtx zyDbtx = new ZyDbtx(); ZyDbtx zyDbtx = new ZyDbtx();
@ -540,7 +531,7 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
zyDbtx.setFbr(wjxWjxx.getCreateBy()); zyDbtx.setFbr(wjxWjxx.getCreateBy());
zyDbtxService.save(zyDbtx); zyDbtxService.save(zyDbtx);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -552,7 +543,7 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
@Override @Override
public Page<WjxWjxx> listOther(WjxWjxx wjxWjxx, Page<Object> objectPage) { public Page<WjxWjxx> listOther(WjxWjxx wjxWjxx, Page<Object> objectPage) {
return baseMapper.listOther(wjxWjxx,objectPage); return baseMapper.listOther(wjxWjxx, objectPage);
} }
@Override @Override
@ -561,72 +552,71 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
String token = getAccessToken();//获取东北师大开放平台token String token = getAccessToken();//获取东北师大开放平台token
System.out.println("======================================="); System.out.println("=======================================");
System.out.println("token:"+token); System.out.println("token:" + token);
System.out.println("======================================="); System.out.println("=======================================");
if(StringUtils.isNotEmpty(token)){//判断如果token不为空则继续操作 if (StringUtils.isNotEmpty(token)) {//判断如果token不为空则继续操作
KcSysConfig kcSysConfig = kcSysConfigService.getById("1"); KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
String idsList[] = ids.split(","); String idsList[] = ids.split(",");
if(idsList.length>0){ if (idsList.length > 0) {
String yyyy = DateUtils.formatDate(new Date(),"yyyy"); String yyyy = DateUtils.formatDate(new Date(), "yyyy");
String mm = DateUtils.formatDate(new Date(),"MM"); String mm = DateUtils.formatDate(new Date(), "MM");
for(String zyId:idsList){ for (String zyId : idsList) {
WjxWjxx wjxWjxx = baseMapper.selectById(zyId); WjxWjxx wjxWjxx = baseMapper.selectById(zyId);
//判断没有上传考核材料的数据才进行上传否则不上传 //判断没有上传考核材料的数据才进行上传否则不上传
if(wjxWjxx!=null && !StringUtils.equals("1",wjxWjxx.getSfsckhcl())){ if (wjxWjxx != null && !StringUtils.equals("1", wjxWjxx.getSfsckhcl())) {
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>(); QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
kcKechengbiaoQueryWrapper.eq("xqxn",kcSysConfig.getFlag1()); kcKechengbiaoQueryWrapper.eq("xqxn", kcSysConfig.getFlag1());
kcKechengbiaoQueryWrapper.eq("rwbh",wjxWjxx.getRwbh()); kcKechengbiaoQueryWrapper.eq("rwbh", wjxWjxx.getRwbh());
kcKechengbiaoQueryWrapper.eq("jgh",wjxWjxx.getCreateBy()); kcKechengbiaoQueryWrapper.eq("jgh", wjxWjxx.getCreateBy());
kcKechengbiaoQueryWrapper.last("limit 1"); kcKechengbiaoQueryWrapper.last("limit 1");
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper); KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
//调用师大接口将数据上传 //调用师大接口将数据上传
String interfaceUrl = "https://intf.nenu.edu.cn/api/bd-api/post/JW_FXCJXMB"; String interfaceUrl = "https://intf.nenu.edu.cn/api/bd-api/post/JW_FXCJXMB";
List<Map<String, String>> paramsList =new ArrayList<>(); List<Map<String, String>> paramsList = new ArrayList<>();
Map<String, String> paramMap = new HashMap<>(); Map<String, String> paramMap = new HashMap<>();
paramMap.put("CJR",wjxWjxx.getCreateBy());//创建人 paramMap.put("CJR", wjxWjxx.getCreateBy());//创建人
paramMap.put("TEABH",wjxWjxx.getCreateBy());//教工号 paramMap.put("TEABH", wjxWjxx.getCreateBy());//教工号
paramMap.put("FXCJMC","课程测验"+wjxWjxx.getSort());//分项成绩名称 paramMap.put("FXCJMC", "课程测验" + wjxWjxx.getSort());//分项成绩名称
paramMap.put("TEADM",wjxWjxx.getCreateBy());//教工代码 paramMap.put("TEADM", wjxWjxx.getCreateBy());//教工代码
paramMap.put("TEAXM",kcKechengbiao.getSkjs());//教师姓名 paramMap.put("TEAXM", kcKechengbiao.getSkjs());//教师姓名
paramMap.put("FXCJBH",wjxWjxx.getId());//分项成绩编号 paramMap.put("FXCJBH", wjxWjxx.getId());//分项成绩编号
paramMap.put("XNXQMC",kcKechengbiao.getXnxq());//学年学期 paramMap.put("XNXQMC", kcKechengbiao.getXnxq());//学年学期
paramMap.put("ZYYQ",null);//作业要求 paramMap.put("ZYYQ", null);//作业要求
paramMap.put("CJSJ",DateUtils.formatDate(wjxWjxx.getCreateTime(),"yyyy-MM-dd"));//创建时间 paramMap.put("CJSJ", DateUtils.formatDate(wjxWjxx.getCreateTime(), "yyyy-MM-dd"));//创建时间
paramMap.put("FXCJBL",wjxWjxx.getScore());//比例成绩占比 paramMap.put("FXCJBL", wjxWjxx.getScore());//比例成绩占比
paramMap.put("FXCJLXMC","3");//分项成绩类型 paramMap.put("FXCJLXMC", "3");//分项成绩类型
paramMap.put("KCMC",kcKechengbiao.getKcmc());//课程名称 paramMap.put("KCMC", kcKechengbiao.getKcmc());//课程名称
paramMap.put("KCRWDM",wjxWjxx.getRwbh());//开课任务编号 paramMap.put("KCRWDM", wjxWjxx.getRwbh());//开课任务编号
paramMap.put("PFBZ",null);//评分标准 paramMap.put("PFBZ", null);//评分标准
paramMap.put("FXCJDM",wjxWjxx.getId());//主键 paramMap.put("FXCJDM", wjxWjxx.getId());//主键
// paramMap.put("OPERATE_STATUS","i");//操作状态 // paramMap.put("OPERATE_STATUS","i");//操作状态
paramsList.add(paramMap); paramsList.add(paramMap);
String data = RestTemplateUtils.post(interfaceUrl,token, paramsList, MediaType.APPLICATION_JSON_UTF8, String.class); String data = RestTemplateUtils.post(interfaceUrl, token, paramsList, MediaType.APPLICATION_JSON_UTF8, String.class);
System.out.println("======================================="); System.out.println("=======================================");
System.out.println("data:"+data); System.out.println("data:" + data);
System.out.println("======================================="); System.out.println("=======================================");
QueryWrapper<WjxDjxx> queryWrapper = new QueryWrapper<>(); QueryWrapper<WjxDjxx> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("vid",wjxWjxx.getVid()); queryWrapper.eq("vid", wjxWjxx.getVid());
queryWrapper.eq("sfsckhcl","0"); queryWrapper.eq("sfsckhcl", "0");
List<WjxDjxx> list = wjxDjxxMapper.selectList(queryWrapper); List<WjxDjxx> list = wjxDjxxMapper.selectList(queryWrapper);
List<Map<String, String>> paramsList2 =new ArrayList<>(); List<Map<String, String>> paramsList2 = new ArrayList<>();
for(WjxDjxx wjxDjxx:list){ for (WjxDjxx wjxDjxx : list) {
List<WjxDjxxTmxx> djxxTmxxList = wjxDjxxMapper.getDjxxTmxxWjt(wjxDjxx.getJid()); List<WjxDjxxTmxx> djxxTmxxList = wjxDjxxMapper.getDjxxTmxxWjt(wjxDjxx.getJid());
if(djxxTmxxList!=null){ if (djxxTmxxList != null) {
for(WjxDjxxTmxx djxxTmxx:djxxTmxxList){ for (WjxDjxxTmxx djxxTmxx : djxxTmxxList) {
//上传作业文件 //上传作业文件
Map<String,String> uploadMap = SFTPUtil.upload(sftpConfig,upLoadPath+"/"+djxxTmxx.getAnswerText(),yyyy+"/"+mm+"/"+wjxWjxx.getVid()+"/"+djxxTmxx.getAnswerText().replace("temp/","/")); Map<String, String> uploadMap = SFTPUtil.upload(sftpConfig, upLoadPath + "/" + djxxTmxx.getAnswerText(), yyyy + "/" + mm + "/" + wjxWjxx.getVid() + "/" + djxxTmxx.getAnswerText().replace("temp/", "/"));
if(org.apache.commons.lang3.StringUtils.equals(uploadMap.get("code"),"0")){ if (org.apache.commons.lang3.StringUtils.equals(uploadMap.get("code"), "0")) {
djxxTmxx.setFwqPath(uploadMap.get("data")); djxxTmxx.setFwqPath(uploadMap.get("data"));
wjxDjxxMapper.updateDjxxTmxxFwqpath(djxxTmxx); wjxDjxxMapper.updateDjxxTmxxFwqpath(djxxTmxx);
} }
@ -652,32 +642,32 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
zyInfoScjlService.save(zyInfoScjl); zyInfoScjlService.save(zyInfoScjl);
Map<String, String> paramMap2 = new HashMap<>(); Map<String, String> paramMap2 = new HashMap<>();
paramMap2.put("CJ",wjxDjxx.getScore()+"");//成绩 paramMap2.put("CJ", wjxDjxx.getScore() + "");//成绩
paramMap2.put("CJR",wjxDjxx.getCreateBy());//创建人 paramMap2.put("CJR", wjxDjxx.getCreateBy());//创建人
paramMap2.put("CJSJ",DateUtils.formatDate(wjxDjxx.getCreateTime(),"yyyy-MM-dd"));//创建时间 paramMap2.put("CJSJ", DateUtils.formatDate(wjxDjxx.getCreateTime(), "yyyy-MM-dd"));//创建时间
paramMap2.put("KCRWDM",wjxWjxx.getRwbh());//开课任务编号 paramMap2.put("KCRWDM", wjxWjxx.getRwbh());//开课任务编号
paramMap2.put("KCMC",kcKechengbiao.getKcmc());//课程名称 paramMap2.put("KCMC", kcKechengbiao.getKcmc());//课程名称
paramMap2.put("FXCJMC","课程测验"+wjxWjxx.getSort());//分项成绩名称 paramMap2.put("FXCJMC", "课程测验" + wjxWjxx.getSort());//分项成绩名称
paramMap2.put("TEAXM",kcKechengbiao.getSkjs());//教师姓名 paramMap2.put("TEAXM", kcKechengbiao.getSkjs());//教师姓名
paramMap2.put("XSXM",wjxDjxx.getUserName());//学生姓名 paramMap2.put("XSXM", wjxDjxx.getUserName());//学生姓名
paramMap2.put("KID",wjxDjxx.getId());//主键 paramMap2.put("KID", wjxDjxx.getId());//主键
paramMap2.put("XSBH",wjxDjxx.getCreateBy());//学号 paramMap2.put("XSBH", wjxDjxx.getCreateBy());//学号
paramMap2.put("FXCJBH",wjxWjxx.getId());//分项成绩编号 paramMap2.put("FXCJBH", wjxWjxx.getId());//分项成绩编号
paramMap2.put("PATH","");//附件路径 paramMap2.put("PATH", "");//附件路径
paramMap2.put("TEABH",wjxWjxx.getCreateBy());//教工号 paramMap2.put("TEABH", wjxWjxx.getCreateBy());//教工号
// paramMap2.put("OPERATE_STATUS","i");//操作状态 // paramMap2.put("OPERATE_STATUS","i");//操作状态
paramsList2.add(paramMap2); paramsList2.add(paramMap2);
} }
System.out.println("======================================="); System.out.println("=======================================");
System.out.println("paramsList2:"+paramsList2); System.out.println("paramsList2:" + paramsList2);
System.out.println("======================================="); System.out.println("=======================================");
//调用师大接口进行上传 //调用师大接口进行上传
String interfaceUrl2 = "https://intf.nenu.edu.cn/api/bd-api/post/JW_FXXSCJMX"; String interfaceUrl2 = "https://intf.nenu.edu.cn/api/bd-api/post/JW_FXXSCJMX";
String data2 = RestTemplateUtils.post(interfaceUrl2,token, paramsList2, MediaType.APPLICATION_JSON_UTF8, String.class); String data2 = RestTemplateUtils.post(interfaceUrl2, token, paramsList2, MediaType.APPLICATION_JSON_UTF8, String.class);
System.out.println("======================================="); System.out.println("=======================================");
System.out.println("data2:"+data2); System.out.println("data2:" + data2);
System.out.println("======================================="); System.out.println("=======================================");
wjxWjxx.setSfsckhcl("1"); wjxWjxx.setSfsckhcl("1");
@ -690,14 +680,14 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
} }
}catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
public String getAccessToken(){ public String getAccessToken() {
String token=""; String token = "";
try { try {
// 获取令牌URL前缀 // 获取令牌URL前缀
String prefixUrl = "https://intf.nenu.edu.cn/api/bd-api"; String prefixUrl = "https://intf.nenu.edu.cn/api/bd-api";
@ -719,14 +709,15 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
// userName=DesUtil.encrypt(userName); // userName=DesUtil.encrypt(userName);
// password=DesUtil.encrypt(password); // password=DesUtil.encrypt(password);
String url= prefixUrl+"/oauth/token?grant_type=password&scope=read&username="+userName+"&password="+password; String url = prefixUrl + "/oauth/token?grant_type=password&scope=read&username=" + userName + "&password=" + password;
ResponseEntity<Object> response = restTemplate.exchange(url, HttpMethod.POST, request, Object.class);; ResponseEntity<Object> response = restTemplate.exchange(url, HttpMethod.POST, request, Object.class);
;
LinkedHashMap<String, Object> map = (LinkedHashMap<String, Object>)response.getBody(); LinkedHashMap<String, Object> map = (LinkedHashMap<String, Object>) response.getBody();
//从返回结果中获取 access_token //从返回结果中获取 access_token
token = (String)map.get("access_token"); token = (String) map.get("access_token");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -747,16 +738,16 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
public void sendWxmessage(KcWechatSendLog kcWechatSendLog) { public void sendWxmessage(KcWechatSendLog kcWechatSendLog) {
String openId = kcWechatSendLog.getOpenid();//曹老师账号 String openId = kcWechatSendLog.getOpenid();//曹老师账号
System.out.println("openId:"+openId+""); System.out.println("openId:" + openId + "");
if(org.apache.commons.lang3.StringUtils.isNotEmpty(openId)){ if (org.apache.commons.lang3.StringUtils.isNotEmpty(openId)) {
try { try {
String urlToken = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="+ appId +"&corpsecret=" + appIdSecret; String urlToken = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + appId + "&corpsecret=" + appIdSecret;
System.out.println("urlToken "+ urlToken); System.out.println("urlToken " + urlToken);
String res = HttpUtil.get(urlToken); String res = HttpUtil.get(urlToken);
JSONObject jsonObjectToken = JSONObject.parseObject(res); JSONObject jsonObjectToken = JSONObject.parseObject(res);
System.out.println("jsonObjectToken{}"+ jsonObjectToken); System.out.println("jsonObjectToken{}" + jsonObjectToken);
String accessToken = jsonObjectToken.getString("access_token"); String accessToken = jsonObjectToken.getString("access_token");
System.out.println("accessToken{}"+ accessToken); System.out.println("accessToken{}" + accessToken);
// 微信的基础accessToken // 微信的基础accessToken
String url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=" + accessToken; String url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=" + accessToken;
@ -764,7 +755,7 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
// 1xx老师你好您本学期2023秋听课要求为5次当前实际听课次数3次请尽快完成本学期的听课任务 // 1xx老师你好您本学期2023秋听课要求为5次当前实际听课次数3次请尽快完成本学期的听课任务
String html = kcWechatSendLog.getYtkcs(); String html = kcWechatSendLog.getYtkcs();
html = html + "\n<a href=\""+domainTo+"\">查看</a>"; html = html + "\n<a href=\"" + domainTo + "\">查看</a>";
sendMag.put("content", html);//授课老师推送内容 sendMag.put("content", html);//授课老师推送内容
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
//拼接base参数 //拼接base参数
@ -772,17 +763,17 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
sendBody.put("touser", openId); // openId sendBody.put("touser", openId); // openId
sendBody.put("msgtype", "text"); // 消息类型此时固定为text sendBody.put("msgtype", "text"); // 消息类型此时固定为text
sendBody.put("agentid", agentid); // 企业id sendBody.put("agentid", agentid); // 企业id
sendBody.put("text",sendMag); //发送内容 sendBody.put("text", sendMag); //发送内容
ResponseEntity<String> forEntity = restTemplate.postForEntity(url, sendBody, String.class); ResponseEntity<String> forEntity = restTemplate.postForEntity(url, sendBody, String.class);
JSONObject jsonObject2 = JSONObject.parseObject(forEntity.getBody()); JSONObject jsonObject2 = JSONObject.parseObject(forEntity.getBody());
System.out.println("jsonObject2 : " + jsonObject2); System.out.println("jsonObject2 : " + jsonObject2);
String messageCode = jsonObject2.getString("errcode"); String messageCode = jsonObject2.getString("errcode");
String msgId = jsonObject2.getString("msgid"); String msgId = jsonObject2.getString("msgid");
System.out.println("messageCode : " + messageCode + ", msgId: " +msgId); System.out.println("messageCode : " + messageCode + ", msgId: " + msgId);
}catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
}else{ } else {
} }
} }

View File

@ -120,6 +120,16 @@ public class ZyInfo implements Serializable {
@Excel(name = "校内通过率", width = 15) @Excel(name = "校内通过率", width = 15)
@ApiModelProperty(value = "校内通过率") @ApiModelProperty(value = "校内通过率")
private java.lang.Double xntgl; private java.lang.Double xntgl;
@ApiModelProperty(value = "是否以小组形式提交作业 Y N")
private String xzxstjzy;
@ApiModelProperty(value = "小组人数")
private Integer xzrs;
@ApiModelProperty(value = "是否配置过小组信息 Y N")
private String sfpzgxzxx;
//作业分值 //作业分值
private String score; private String score;

View File

@ -0,0 +1,58 @@
package org.jeecg.modules.kc.zyInfo.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.List;
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;
/**
* @Description: zy_xz_info
* @Author: jeecg-boot
* @Date: 2025-01-13
* @Version: V1.0
*/
@ApiModel(value="zy_xz_info对象", description="zy_xz_info")
@Data
@TableName("zy_xz_info")
public class ZyXzInfo implements Serializable {
private static final long serialVersionUID = 1L;
List<ZyXzryInfo> students;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private String id;
/**zy_info表id*/
@Excel(name = "zy_info表id", width = 15)
@ApiModelProperty(value = "zy_info表id")
private String zyinfoId;
/**createBy*/
@ApiModelProperty(value = "createBy")
private String createBy;
/**createTime*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "createTime")
private Date createTime;
/**小组名称*/
@Excel(name = "小组名称", width = 15)
@ApiModelProperty(value = "小组名称")
private String xzmc;
/**小组排序*/
@Excel(name = "小组排序", width = 15)
@ApiModelProperty(value = "小组排序")
private Integer sort;
}

View File

@ -0,0 +1,59 @@
package org.jeecg.modules.kc.zyInfo.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_xzry_info
* @Author: jeecg-boot
* @Date: 2025-01-13
* @Version: V1.0
*/
@Data
@TableName("zy_xzry_info")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="zy_xzry_info对象", description="zy_xzry_info")
public class ZyXzryInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private String id;
/**zy_info表id*/
@Excel(name = "zy_info表id", width = 15)
@ApiModelProperty(value = "zy_info表id")
private String zyinfoId;
/**zy_xz_info表id*/
@Excel(name = "zy_xz_info表id", width = 15)
@ApiModelProperty(value = "zy_xz_info表id")
private String zyxzinfoId;
/**姓名*/
@Excel(name = "姓名", width = 15)
@ApiModelProperty(value = "姓名")
private String xm;
/**学号*/
@Excel(name = "学号", width = 15)
@ApiModelProperty(value = "学号")
private String xh;
/**是否是组长 Y N*/
@Excel(name = "是否是组长 Y N", width = 15)
@ApiModelProperty(value = "是否是组长 Y N")
private String sfzz;
}

View File

@ -7,10 +7,8 @@ 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.zyInfo.entity.CyInfoSys; import org.jeecg.modules.kc.zyInfo.entity.*;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys;
/** /**
* @Description: 作业发布 * @Description: 作业发布
@ -20,7 +18,7 @@ import org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys;
*/ */
public interface ZyInfoMapper extends BaseMapper<ZyInfo> { public interface ZyInfoMapper extends BaseMapper<ZyInfo> {
IPage<ZyInfo> stuList(Page<ZyInfo> page,@Param(Constants.WRAPPER) QueryWrapper<ZyInfo> queryWrapper); IPage<ZyInfo> stuList(Page<ZyInfo> page, @Param(Constants.WRAPPER) QueryWrapper<ZyInfo> queryWrapper);
IPage<ZyInfoSys> sysList(Page<ZyInfoSys> page, @Param(Constants.WRAPPER) QueryWrapper<ZyInfoSys> queryWrapper); IPage<ZyInfoSys> sysList(Page<ZyInfoSys> page, @Param(Constants.WRAPPER) QueryWrapper<ZyInfoSys> queryWrapper);
@ -28,11 +26,11 @@ public interface ZyInfoMapper extends BaseMapper<ZyInfo> {
ZyInfo getKechengById(@Param("id") String id); 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); 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<ZyInfoSys> sysStaticList(Page<ZyInfoSys> page, @Param("zyInfoSys") ZyInfoSys zyInfoSys);
IPage<ZyInfo> listOther(Page<ZyInfo> page,@Param("zyInfo") ZyInfo zyInfo); IPage<ZyInfo> listOther(Page<ZyInfo> page, @Param("zyInfo") ZyInfo zyInfo);
List<ZyInfoSys> getZyStaticNo(@Param("zyInfoSys") ZyInfoSys zyInfoSys); List<ZyInfoSys> getZyStaticNo(@Param("zyInfoSys") ZyInfoSys zyInfoSys);
@ -56,11 +54,21 @@ public interface ZyInfoMapper extends BaseMapper<ZyInfo> {
List<ZyInfoSys> getXnJsList(@Param("zyInfoSys") ZyInfoSys zyInfoSys); List<ZyInfoSys> getXnJsList(@Param("zyInfoSys") ZyInfoSys zyInfoSys);
IPage<ZyInfoSys> sysStaticZyList(Page<ZyInfoSys> page,@Param("zyInfoSys") ZyInfoSys zyInfoSys); IPage<ZyInfoSys> sysStaticZyList(Page<ZyInfoSys> page, @Param("zyInfoSys") ZyInfoSys zyInfoSys);
IPage<CyInfoSys> sysStaticCyList(Page<CyInfoSys> page, @Param("zyInfoSys") CyInfoSys cyInfoSys); IPage<CyInfoSys> sysStaticCyList(Page<CyInfoSys> page, @Param("zyInfoSys") CyInfoSys cyInfoSys);
List<CyInfoSys> getStaticCyExportUrl( @Param("zyInfoSys") CyInfoSys cyInfoSys); List<CyInfoSys> getStaticCyExportUrl(@Param("zyInfoSys") CyInfoSys cyInfoSys);
IPage<ZyInfo> listKhcl(Page<ZyInfo> page, @Param(Constants.WRAPPER) QueryWrapper<ZyInfo> queryWrapper); IPage<ZyInfo> listKhcl(Page<ZyInfo> page, @Param(Constants.WRAPPER) QueryWrapper<ZyInfo> queryWrapper);
List<ZyXzInfo> getxzxx(@Param("dto") ZyInfo zyInfo);
int insertBatchzyxz(@Param("list") List<ZyXzInfo> list);
int insertBatchzyxzry(@Param("list") List<ZyXzryInfo> list);
int deleteXzxx(@Param("zyinfoId") String zyinfoId);
int deleteXzryxx(@Param("zyinfoId") String zyinfoId);
} }

View File

@ -2,11 +2,48 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.kc.zyInfo.mapper.ZyInfoMapper"> <mapper namespace="org.jeecg.modules.kc.zyInfo.mapper.ZyInfoMapper">
<resultMap id="ZyXzInfoResultMap" type="org.jeecg.modules.kc.zyInfo.entity.ZyXzInfo">
<id property="id" column="zxi_id"/>
<result property="zyinfoId" column="zyinfo_id"/>
<result property="xzmc" column="xzmc"/>
<result property="sort" column="sort"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<collection property="students" ofType="org.jeecg.modules.kc.zyInfo.entity.ZyXzryInfo"
column="{zyxzinfo_id=zxi_id}">
<id property="id" column="ry_id"/>
<result property="zyinfoId" column="ryzyinfoid"/>
<result property="zyxzinfoId" column="zyxzinfo_id"/>
<result property="xm" column="xm"/>
<result property="xh" column="xh"/>
<result property="sfzz" column="sfzz"/>
</collection>
</resultMap>
<select id="stuList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo"> <select id="stuList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
select select distinct a.*,
distinct b.id as stuId,
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.file_path as stuFilePath,
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 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 from zy_info a
LEFT JOIN xxhbxsxkb c on a.rwbh = c.KCAPZBBH 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 left join zy_info_student b on a.id = b.main_id and b.create_by = c.xh
@ -14,86 +51,141 @@
</select> </select>
<select id="selectPage" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo"> <select id="selectPage" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
SELECT SELECT a.*,
a.*, ifnull(b.num, 0) as wtjnum,
ifnull(b.num,0) as wtjnum,ifnull(c.num,0) as ytjnum,ifnull(d.num,0) as wpynum,ifnull(e.num,0) as ypynum,ifnull(f.num,0) as dpynum ifnull(c.num, 0) as ytjnum,
FROM ifnull(d.num, 0) as wpynum,
zy_info a ifnull(e.num, 0) as ypynum,
left join (select count(*) as num,main_id from zy_info_student where file_path is null GROUP BY main_id ) b on a.id = b.main_id ifnull(f.num, 0) as dpynum
left join (select count(*) as num,main_id from zy_info_student where file_path is not null GROUP BY main_id) c on a.id = c.main_id FROM zy_info a
left join (select count(*) as num,main_id from zy_info_student where score is null GROUP BY main_id ) d on a.id = d.main_id left join (select count(*) as num, main_id
left join (select count(*) as num,main_id from zy_info_student where score is not null GROUP BY main_id) e on a.id = e.main_id from zy_info_student
left join (select count(*) as num,main_id from zy_info_student where score is null and file_path is not null GROUP BY main_id) f on a.id = f.main_id where file_path is null
GROUP BY main_id) b on a.id = b.main_id
left join (select count(*) as num, main_id
from zy_info_student
where file_path is not null
GROUP BY main_id) c on a.id = c.main_id
left join (select count(*) as num, main_id from zy_info_student where score is null GROUP BY main_id) d
on a.id = d.main_id
left join (select count(*) as num, main_id
from zy_info_student
where score is not null
GROUP BY main_id) e on a.id = e.main_id
left join (select count(*) as num, main_id
from zy_info_student
where score is null and file_path is not null
GROUP BY main_id) f on a.id = f.main_id
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>
<select id="sysList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="sysList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
SELECT t.kcbh, t.kcmc, t.kkdw, t.kcxz, t.szkc, t.xqxn, t.rwbh, t.xkrs, t.jgh,t.jzglb zc, t.skjs,b.num, SELECT t.kcbh,
t.kcmc,
t.kkdw,
t.kcxz,
t.szkc,
t.xqxn,
t.rwbh,
t.xkrs,
t.jgh,
t.jzglb zc,
t.skjs,
b.num,
b.fbzycs, -- 发布作业次数 b.fbzycs, -- 发布作业次数
b.zywccs, -- 作业完成次数 b.zywccs, -- 作业完成次数
b.cccs, -- 查重次数 b.cccs, -- 查重次数
b.hpcs, -- 互评次数 b.hpcs, -- 互评次数
b.cswwccs -- 超时未完成次数 b.cswwccs -- 超时未完成次数
FROM ( FROM (select xnxq,
select xnxq,rwbh,create_by,count(*) as num, rwbh,
create_by,
count(*) as num,
SUM(CASE WHEN zy_status IN ('1', '2') THEN 1 ELSE 0 END) AS fbzycs, SUM(CASE WHEN zy_status IN ('1', '2') THEN 1 ELSE 0 END) AS fbzycs,
SUM(CASE WHEN zy_status = '2' THEN 1 ELSE 0 END) AS zywccs, SUM(CASE WHEN zy_status = '2' THEN 1 ELSE 0 END) AS zywccs,
SUM(CASE WHEN zy_status in ('1','2') and sfcc IN ('1', '2') THEN 1 ELSE 0 END) AS cccs, SUM(CASE WHEN zy_status in ('1', '2') and sfcc IN ('1', '2') THEN 1 ELSE 0 END) AS cccs,
SUM(CASE WHEN zy_status in ('1','2') and xshpkg = '1' THEN 1 ELSE 0 END) AS hpcs, SUM(CASE WHEN zy_status in ('1', '2') and xshpkg = '1' THEN 1 ELSE 0 END) AS hpcs,
SUM( SUM(
CASE CASE
WHEN zy_status = '1' AND end_time &lt; NOW() THEN 1 WHEN zy_status = '1' AND end_time &lt; NOW() THEN 1
ELSE 0 ELSE 0
END END
) AS cswwccs ) AS cswwccs
from zy_info GROUP BY xnxq,rwbh,create_by from zy_info
) b GROUP BY xnxq, rwbh, create_by) b
inner join ( inner join (SELECT DISTINCT kcbh,
SELECT DISTINCT kcmc,
kcbh,kcmc,kkdw,kcxz,szkc,xqxn, rwbh, xkrs,jzglb, jgh,skjs kkdw,
FROM kcxz,
kc_kechengbiao szkc,
${ew.customSqlSegment} xqxn,
) t on t.jgh = b.create_by and t.rwbh = b.rwbh and t.xqxn = b.xnxq rwbh,
GROUP BY kcbh,kcmc,kkdw,kcxz,szkc,xqxn,rwbh,skjs,xkrs,jgh,zc xkrs,
jzglb,
jgh,
skjs
FROM kc_kechengbiao ${ew.customSqlSegment}) t
on t.jgh = b.create_by and t.rwbh = b.rwbh and t.xqxn = b.xnxq
GROUP BY kcbh, kcmc, kkdw, kcxz, szkc, xqxn, rwbh, skjs, xkrs, jgh, zc
</select> </select>
<select id="exportSysXls" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="exportSysXls" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
SELECT t.kcbh, t.kcmc, t.kkdw, t.kcxz, t.szkc, t.xqxn, t.rwbh, t.xkrs, t.jgh,t.jzglb zc, t.skjs,b.num, SELECT t.kcbh,
t.kcmc,
t.kkdw,
t.kcxz,
t.szkc,
t.xqxn,
t.rwbh,
t.xkrs,
t.jgh,
t.jzglb zc,
t.skjs,
b.num,
b.fbzycs, -- 发布作业次数 b.fbzycs, -- 发布作业次数
b.zywccs, -- 作业完成次数 b.zywccs, -- 作业完成次数
b.cccs, -- 查重次数 b.cccs, -- 查重次数
b.hpcs, -- 互评次数 b.hpcs, -- 互评次数
b.cswwccs -- 超时未完成次数 b.cswwccs -- 超时未完成次数
FROM ( FROM (select xnxq,
select xnxq,rwbh,create_by,count(*) as num, rwbh,
create_by,
count(*) as num,
SUM(CASE WHEN zy_status IN ('1', '2') THEN 1 ELSE 0 END) AS fbzycs, SUM(CASE WHEN zy_status IN ('1', '2') THEN 1 ELSE 0 END) AS fbzycs,
SUM(CASE WHEN zy_status = '2' THEN 1 ELSE 0 END) AS zywccs, SUM(CASE WHEN zy_status = '2' THEN 1 ELSE 0 END) AS zywccs,
SUM(CASE WHEN zy_status in ('1','2') and sfcc IN ('1', '2') THEN 1 ELSE 0 END) AS cccs, SUM(CASE WHEN zy_status in ('1', '2') and sfcc IN ('1', '2') THEN 1 ELSE 0 END) AS cccs,
SUM(CASE WHEN zy_status in ('1','2') and xshpkg = '1' THEN 1 ELSE 0 END) AS hpcs, SUM(CASE WHEN zy_status in ('1', '2') and xshpkg = '1' THEN 1 ELSE 0 END) AS hpcs,
SUM( SUM(
CASE CASE
WHEN zy_status = '1' AND end_time &lt; NOW() THEN 1 WHEN zy_status = '1' AND end_time &lt; NOW() THEN 1
ELSE 0 ELSE 0
END END
) AS cswwccs ) AS cswwccs
from zy_info GROUP BY xnxq,rwbh,create_by from zy_info
) b GROUP BY xnxq, rwbh, create_by) b
inner join ( inner join (SELECT DISTINCT kcbh,
SELECT DISTINCT kcmc,
kcbh,kcmc,kkdw,kcxz,szkc,xqxn, rwbh, xkrs, jgh,jzglb,skjs kkdw,
FROM kcxz,
kc_kechengbiao szkc,
${ew.customSqlSegment} xqxn,
) t on t.jgh = b.create_by and t.rwbh = b.rwbh and t.xqxn = b.xnxq rwbh,
GROUP BY kcbh,kcmc,kkdw,kcxz,szkc,xqxn,rwbh,skjs,xkrs,jgh,jzglb xkrs,
jgh,
jzglb,
skjs
FROM kc_kechengbiao ${ew.customSqlSegment}) t
on t.jgh = b.create_by and t.rwbh = b.rwbh and t.xqxn = b.xnxq
GROUP BY kcbh, kcmc, kkdw, kcxz, szkc, xqxn, rwbh, skjs, xkrs, jgh, jzglb
</select> </select>
<select id="exportSysXls2" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="exportSysXls2" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
select a.id,a.create_by,a.create_time,a.update_by,a.update_time,a.title,a.zy_type,a.content,a.start_time,a.end_time,a.zy_status,a.xnxq,a.wwcc,a.wwtgl,a.nwcc,a.nwtgl,a.aigccc,a.aigctgl,a.rwbh,a.file_path,a.xkxs,a.xncc,a.xntgl,a.score,a.kcnr,a.pfbz,a.sturead,a.sort,a.xshpkg,a.xshprsq,a.xshpkssj,a.xshpjssj,a.sfzzcj,a.xssfck,a.hpsfwcone,a.hpsfwctwo,a.zy_leixing,a.sfcc,a.sfsckhcl,a.sfsckhcl_time,b.skjs,b.jgh,b.kcmc,b.kcbh,b.xkrs,b.kkdw,b.kcxz,b.zc,a.xnxq as xqxn, select
a.id,a.create_by,a.create_time,a.update_by,a.update_time,a.title,a.zy_type,a.content,a.start_time,a.end_time,a.zy_status,a.xnxq,a.wwcc,a.wwtgl,a.nwcc,a.nwtgl,a.aigccc,a.aigctgl,a.rwbh,a.file_path,a.xkxs,a.xncc,a.xntgl,a.score,a.kcnr,a.pfbz,a.sturead,a.sort,a.xshpkg,a.xshprsq,a.xshpkssj,a.xshpjssj,a.sfzzcj,a.xssfck,a.hpsfwcone,a.hpsfwctwo,a.zy_leixing,a.sfcc,a.sfsckhcl,a.sfsckhcl_time,b.skjs,b.jgh,b.kcmc,b.kcbh,b.xkrs,b.kkdw,b.kcxz,b.zc,a.xnxq
as xqxn,
IF( a.zy_status = '2', '全部完成', '未全部完成' ) as sfwc, IF( a.zy_status = '2', '全部完成', '未全部完成' ) as sfwc,
IF( a.zy_status = '0', '未发布', '已发布' ) as sffb, IF( a.zy_status = '0', '未发布', '已发布' ) as sffb,
IF( a.xshpkg = '1', '是', '否' ) as sfhp, IF( a.xshpkg = '1', '是', '否' ) as sfhp,
@ -108,7 +200,8 @@
END END
) AS cswwccs ) AS cswwccs
from zy_info a, from zy_info a,
(select skjs,jgh,kcmc,kcbh,xkrs,kkdw,rwbh,kcxz,zc from kc_kechengbiao where xqxn = #{zyInfoSys.xqxn} and flag = '0' GROUP BY skjs,jgh,kcmc,kcbh,xkrs,kkdw, rwbh,kcxz,zc) b (select skjs,jgh,kcmc,kcbh,xkrs,kkdw,rwbh,kcxz,zc from kc_kechengbiao where xqxn = #{zyInfoSys.xqxn} and flag =
'0' GROUP BY skjs,jgh,kcmc,kcbh,xkrs,kkdw, rwbh,kcxz,zc) b
where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xnxq = #{zyInfoSys.xqxn} and a.zy_status in (1,2) where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xnxq = #{zyInfoSys.xqxn} and a.zy_status in (1,2)
<if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''"> <if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''">
and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%') and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%')
@ -138,40 +231,37 @@
</select> </select>
<select id="getKechengById" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo"> <select id="getKechengById" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
select a.*,b.kcmc,b.skjs from zy_info a ,kc_kechengbiao b select a.*, b.kcmc, b.skjs
where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xnxq = b.xqxn and a.id = #{id} from zy_info a,
limit 1 kc_kechengbiao b
where a.rwbh = b.rwbh
and a.create_by = b.jgh
and a.xnxq = b.xqxn
and a.id = #{id} limit 1
</select> </select>
<select id="zyzb" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo"> <select id="zyzb" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
SELECT SELECT sum(ifnull(score, '0')) AS score,
sum( ifnull( score, '0' ) ) AS score,
zy_leixing zy_leixing
FROM FROM zy_info
zy_info WHERE xnxq = #{xqxn}
WHERE
xnxq = #{xqxn}
AND rwbh = #{rwbh} AND rwbh = #{rwbh}
GROUP BY GROUP BY zy_leixing
zy_leixing UNION ALL UNION ALL
SELECT SELECT sum(ifnull(score, '0')) AS score,
sum( ifnull( score, '0' ) ) AS score,
CASE CASE
atype atype
WHEN '1' THEN WHEN '1' THEN
'2' ELSE '3' '2'
ELSE '3'
END zy_leixing END zy_leixing
FROM FROM wjx_wjxx
wjx_wjxx WHERE xqxn = #{xqxn}
WHERE
xqxn = #{xqxn}
AND rwbh = #{rwbh} AND rwbh = #{rwbh}
GROUP BY GROUP BY atype
atype
</select> </select>
<select id="sysStaticList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="sysStaticList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
SELECT SELECT
distinct a.id, distinct a.id,
@ -184,8 +274,10 @@
a.start_time, a.start_time,
a.end_time a.end_time
FROM FROM
zy_info a, xxhbuser c,(select kcmc,rwbh,skjs,jgh from kc_kechengbiao where xqxn = #{zyInfoSys.xqxn} GROUP BY kcmc,rwbh,skjs,jgh) d zy_info a, xxhbuser c,(select kcmc,rwbh,skjs,jgh from kc_kechengbiao where xqxn = #{zyInfoSys.xqxn} GROUP BY
WHERE a.create_by = c.gh and d.rwbh = a.rwbh and a.create_by = d.jgh and a.xnxq = #{zyInfoSys.xqxn} and a.title is not null kcmc,rwbh,skjs,jgh) d
WHERE a.create_by = c.gh and d.rwbh = a.rwbh and a.create_by = d.jgh and a.xnxq = #{zyInfoSys.xqxn} and a.title
is not null
<if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''"> <if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''">
and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%') and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%')
</if> </if>
@ -212,7 +304,6 @@
</select> </select>
<select id="listOther" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo"> <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 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 where a.main_id = b.id
@ -223,81 +314,170 @@
<select id="getZyStaticNo" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="getZyStaticNo" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
select count(distinct zi.id) as count,'1' as type from zy_info zi join kc_kechengbiao kk on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq where zi.zy_status in ('1','2') and zi.xnxq = #{zyInfoSys.xqxn} and kk.flag = 0 select count(distinct zi.id) as count,'1' as type
from zy_info zi join kc_kechengbiao kk
on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq
where zi.zy_status in ('1', '2') and zi.xnxq = #{zyInfoSys.xqxn} and kk.flag = 0
union all union all
select count(distinct zi.id) as count,'2' as type from zy_info zi join kc_kechengbiao kk on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq where zi.zy_status in ('1','2') and zi.xnxq = #{zyInfoSys.xqxn} and kk.flag = 0 and zi.xshpkg = '1' select count(distinct zi.id) as count,'2' as type
from zy_info zi join kc_kechengbiao kk
on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq
where zi.zy_status in ('1', '2') and zi.xnxq = #{zyInfoSys.xqxn} and kk.flag = 0 and zi.xshpkg = '1'
union all union all
select count(distinct zi.id) as count,'3' as type from zy_info zi join kc_kechengbiao kk on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq where zi.zy_status in ('2') and zi.xnxq = #{zyInfoSys.xqxn} and kk.flag = 0 select count(distinct zi.id) as count,'3' as type
from zy_info zi join kc_kechengbiao kk
on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq
where zi.zy_status in ('2') and zi.xnxq = #{zyInfoSys.xqxn} and kk.flag = 0
union all union all
select count(distinct zi.id) as count,'4' as type from zy_info zi join kc_kechengbiao kk on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq where zi.zy_status in ('1','2') and (zi.update_time = DATE_FORMAT(NOW(),'%Y-%m-%d') or zi.create_time = DATE_FORMAT(NOW(),'%Y-%m-%d') ) and kk.flag = 0 select count(distinct zi.id) as count,'4' as type
from zy_info zi join kc_kechengbiao kk
on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq
where zi.zy_status in ('1'
, '2')
and (zi.update_time = DATE_FORMAT(NOW()
, '%Y-%m-%d')
or zi.create_time = DATE_FORMAT(NOW()
, '%Y-%m-%d') )
and kk.flag = 0
union all union all
select count(distinct zi.id) as count,'5' as type from zy_info zi join kc_kechengbiao kk on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq where zi.zy_status in ('1','2') and (zi.update_time = DATE_FORMAT(NOW(),'%Y-%m-%d') or zi.create_time = DATE_FORMAT(NOW(),'%Y-%m-%d') ) and zi.xshpkg = '1' and kk.flag = 0 select count(distinct zi.id) as count,'5' as type
from zy_info zi join kc_kechengbiao kk
on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq
where zi.zy_status in ('1'
, '2')
and (zi.update_time = DATE_FORMAT(NOW()
, '%Y-%m-%d')
or zi.create_time = DATE_FORMAT(NOW()
, '%Y-%m-%d') )
and zi.xshpkg = '1'
and kk.flag = 0
union all union all
select count(distinct zi.id) as count,'6' as type from zy_info zi join kc_kechengbiao kk on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq where zi.zy_status in ('2') and (zi.update_time = DATE_FORMAT(NOW(),'%Y-%m-%d') or zi.create_time = DATE_FORMAT(NOW(),'%Y-%m-%d') ) and kk.flag = 0 select count(distinct zi.id) as count,'6' as type
from zy_info zi join kc_kechengbiao kk
on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq
where zi.zy_status in ('2')
and (zi.update_time = DATE_FORMAT(NOW()
, '%Y-%m-%d')
or zi.create_time = DATE_FORMAT(NOW()
, '%Y-%m-%d') )
and kk.flag = 0
union all union all
select count(distinct ww.id) as count,'7' as type from wjx_wjxx ww join kc_kechengbiao kk on kk.jgh = ww.create_by AND kk.rwbh = ww.rwbh AND kk.xqxn = ww.xqxn where ww.xqxn = #{zyInfoSys.xqxn} and ww.qpublish in (1,2) select count(distinct ww.id) as count,'7' as type
from wjx_wjxx ww join kc_kechengbiao kk
on kk.jgh = ww.create_by AND kk.rwbh = ww.rwbh AND kk.xqxn = ww.xqxn
where ww.xqxn = #{zyInfoSys.xqxn} and ww.qpublish in (1, 2)
union all union all
select count(distinct ww.id) as count,'8' as type from wjx_wjxx ww join kc_kechengbiao kk on kk.jgh = ww.create_by AND kk.rwbh = ww.rwbh AND kk.xqxn = ww.xqxn where ww.xqxn = #{zyInfoSys.xqxn} and ww.qpublish in (2) select count(distinct ww.id) as count,'8' as type
from wjx_wjxx ww join kc_kechengbiao kk
on kk.jgh = ww.create_by AND kk.rwbh = ww.rwbh AND kk.xqxn = ww.xqxn
where ww.xqxn = #{zyInfoSys.xqxn} and ww.qpublish in (2)
union all union all
select count(distinct ww.id) as count,'9' as type from wjx_wjxx ww join kc_kechengbiao kk on kk.jgh = ww.create_by AND kk.rwbh = ww.rwbh AND kk.xqxn = ww.xqxn where (ww.update_time = DATE_FORMAT(NOW(),'%Y-%m-%d') or ww.create_time = DATE_FORMAT(NOW(),'%Y-%m-%d') ) and ww.qpublish in (1,2) select count(distinct ww.id) as count,'9' as type
from wjx_wjxx ww join kc_kechengbiao kk
on kk.jgh = ww.create_by AND kk.rwbh = ww.rwbh AND kk.xqxn = ww.xqxn
where (ww.update_time = DATE_FORMAT(NOW()
, '%Y-%m-%d')
or ww.create_time = DATE_FORMAT(NOW()
, '%Y-%m-%d') )
and ww.qpublish in (1
, 2)
union all union all
select count(distinct ww.id) as count,'10' as type from wjx_wjxx ww join kc_kechengbiao kk on kk.jgh = ww.create_by AND kk.rwbh = ww.rwbh AND kk.xqxn = ww.xqxn where (ww.update_time = DATE_FORMAT(NOW(),'%Y-%m-%d') or ww.create_time = DATE_FORMAT(NOW(),'%Y-%m-%d') ) and ww.qpublish in (2) select count(distinct ww.id) as count,'10' as type
from wjx_wjxx ww join kc_kechengbiao kk
on kk.jgh = ww.create_by AND kk.rwbh = ww.rwbh AND kk.xqxn = ww.xqxn
where (ww.update_time = DATE_FORMAT(NOW()
, '%Y-%m-%d')
or ww.create_time = DATE_FORMAT(NOW()
, '%Y-%m-%d') )
and ww.qpublish in (2)
union all union all
select count(distinct zi.id) as count,'11' as type from zy_info zi join kc_kechengbiao kk on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq where zi.zy_status in ('1','2') and zi.xnxq = #{zyInfoSys.xqxn} and zi.sfcc in ('1','2') and kk.flag = 0 select count(distinct zi.id) as count,'11' as type
from zy_info zi join kc_kechengbiao kk
on kk.jgh = zi.create_by AND kk.rwbh = zi.rwbh AND kk.xqxn = zi.xnxq
where zi.zy_status in ('1', '2') and zi.xnxq = #{zyInfoSys.xqxn} and zi.sfcc in ('1', '2') and kk.flag = 0
union all union all
select count(*) as count,'12' as type from zy_info where file_path is not null and xnxq = #{zyInfoSys.xqxn} select count(*) as count,'12' as type
from zy_info
where file_path is not null and xnxq = #{zyInfoSys.xqxn}
union all union all
select count(*) as count,'13' as type from zy_info where file_path is not null and xnxq = #{zyInfoSys.xqxn} and xshpkg = '1' select count(*) as count,'13' as type
from zy_info
where file_path is not null and xnxq = #{zyInfoSys.xqxn} and xshpkg = '1'
union all union all
select count(*) as count,'14' as type from zy_info where file_path is not null and xnxq = #{zyInfoSys.xqxn} and sfcc = '1' select count(*) as count,'14' as type
from zy_info
where file_path is not null and xnxq = #{zyInfoSys.xqxn} and sfcc = '1'
union all union all
SELECT COUNT(*) as count,'16' as type FROM wjx_djxx WHERE create_time BETWEEN (SELECT bxqkssj FROM kc_sys_config WHERE flag1=#{zyInfoSys.xqxn} LIMIT 1) AND (SELECT bxqjssj FROM kc_sys_config WHERE flag1=#{zyInfoSys.xqxn} LIMIT 1); SELECT COUNT(*) as count,'16' as type
FROM wjx_djxx
WHERE create_time BETWEEN (SELECT bxqkssj FROM kc_sys_config WHERE flag1=#{zyInfoSys.xqxn} LIMIT 1)
AND (SELECT bxqjssj FROM kc_sys_config WHERE flag1=#{zyInfoSys.xqxn} LIMIT 1);
</select> </select>
<select id="getXyZyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="getXyZyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
select (@rownum:=@rownum + 1) AS rownum,t.* from ( select (@rownum:=@rownum + 1) AS rownum, t.*
select count(*) as count,b.dwmc as kkdw from zy_info a,xxhbuser b where a.create_by = b.gh and xnxq = #{zyInfoSys.xqxn} and zy_status in (1,2) GROUP BY b.dwmc from (select count(*) as count,b.dwmc as kkdw
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc from zy_info a, xxhbuser b
where a.create_by = b.gh and xnxq = #{zyInfoSys.xqxn} and zy_status in (1, 2)
GROUP BY b.dwmc) t,
(SELECT @rownum:=0) AS r
ORDER BY count - 0 desc
</select> </select>
<select id="getZyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="getZyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
select (@rownum:=@rownum + 1) AS rownum,t.* from ( select (@rownum:=@rownum + 1) AS rownum, t.*
select a.create_by,count(*) as count,b.xm as skjs,b.dwmc as kkdw from zy_info a,xxhbuser b where a.create_by = b.gh and xnxq = #{zyInfoSys.xqxn} and zy_status in (1,2) GROUP BY a.create_by ,b.xm,b.dwmc from (select a.create_by, count(*) as count,b.xm as skjs,b.dwmc as kkdw
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc from zy_info a, xxhbuser b
where a.create_by = b.gh and xnxq = #{zyInfoSys.xqxn} and zy_status in (1, 2)
GROUP BY a.create_by, b.xm, b.dwmc) t,
(SELECT @rownum:=0) AS r
ORDER BY count - 0 desc
</select> </select>
<select id="getZyTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="getZyTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
select (@rownum:=@rownum + 1) AS rownum,t.* from ( select (@rownum:=@rownum + 1) AS rownum, t.*
select a.create_by,count(*) as count,b.xm as skjs,b.dwmc as kkdw from zy_info a,xxhbuser b where a.create_by = b.gh and xnxq = #{zyInfoSys.xqxn} and zy_status in (1,2) GROUP BY a.create_by ,b.xm,b.dwmc from (select a.create_by, count(*) as count,b.xm as skjs,b.dwmc as kkdw
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc limit 10 from zy_info a, xxhbuser b
where a.create_by = b.gh and xnxq = #{zyInfoSys.xqxn} and zy_status in (1, 2)
GROUP BY a.create_by, b.xm, b.dwmc) t,
(SELECT @rownum:=0) AS r
ORDER BY count - 0 desc limit 10
</select> </select>
<select id="getCyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="getCyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
select (@rownum:=@rownum + 1) AS rownum,t.* from ( select (@rownum:=@rownum + 1) AS rownum, t.*
select a.create_by,count(*) as count,b.xm as skjs,b.dwmc as kkdw from wjx_wjxx a,xxhbuser b where a.create_by = b.gh and xqxn = #{zyInfoSys.xqxn} and qpublish in (1,2) GROUP BY a.create_by ,b.xm,b.dwmc from (select a.create_by, count(*) as count,b.xm as skjs,b.dwmc as kkdw
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc from wjx_wjxx a, xxhbuser b
where a.create_by = b.gh and xqxn = #{zyInfoSys.xqxn} and qpublish in (1, 2)
GROUP BY a.create_by, b.xm, b.dwmc) t,
(SELECT @rownum:=0) AS r
ORDER BY count - 0 desc
</select> </select>
<select id="getCyTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="getCyTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
select (@rownum:=@rownum + 1) AS rownum,t.* from ( select (@rownum:=@rownum + 1) AS rownum, t.*
select a.create_by,count(*) as count,b.xm as skjs,b.dwmc as kkdw from wjx_wjxx a,xxhbuser b where a.create_by = b.gh and xqxn = #{zyInfoSys.xqxn} and qpublish in (1,2) GROUP BY a.create_by ,b.xm,b.dwmc from (select a.create_by, count(*) as count,b.xm as skjs,b.dwmc as kkdw
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc limit 10 from wjx_wjxx a, xxhbuser b
where a.create_by = b.gh and xqxn = #{zyInfoSys.xqxn} and qpublish in (1, 2)
GROUP BY a.create_by, b.xm, b.dwmc) t,
(SELECT @rownum:=0) AS r
ORDER BY count - 0 desc limit 10
</select> </select>
<select id="getXYCyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="getXYCyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
select (@rownum:=@rownum + 1) AS rownum,t.* from ( select (@rownum:=@rownum + 1) AS rownum, t.*
select count(*) as count,b.dwmc as kkdw from wjx_wjxx a,xxhbuser b where a.create_by = b.gh and xqxn = #{zyInfoSys.xqxn} and qpublish in (1,2) GROUP BY b.dwmc from (select count(*) as count,b.dwmc as kkdw
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc from wjx_wjxx a, xxhbuser b
where a.create_by = b.gh and xqxn = #{zyInfoSys.xqxn} and qpublish in (1, 2)
GROUP BY b.dwmc) t,
(SELECT @rownum:=0) AS r
ORDER BY count - 0 desc
</select> </select>
<select id="getKcTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="getKcTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
SELECT SELECT (@rownum := @rownum + 1) AS rownum,
( @rownum := @rownum + 1 ) AS rownum,
t.* t.*
FROM FROM (SELECT b.kcmc,
(
SELECT
b.kcmc,
count(*) AS count, count(*) AS count,
b.kkdw b.kkdw
FROM FROM
@ -305,35 +485,30 @@
kc_kechengbiao b kc_kechengbiao b
WHERE WHERE
a.rwbh = b.rwbh a.rwbh = b.rwbh
AND a.xnxq = #{zyInfoSys.xqxn} GROUP BY b.kcmc,b.kkdw AND a.xnxq = #{zyInfoSys.xqxn}
GROUP BY b.kcmc, b.kkdw
union all union all
SELECT SELECT
b.kcmc, b.kcmc,
count(*) AS count, count (*) AS count,
b.kkdw b.kkdw
FROM FROM
wjx_wjxx a, wjx_wjxx a,
kc_kechengbiao b kc_kechengbiao b
WHERE WHERE
a.rwbh = b.rwbh a.rwbh = b.rwbh
AND a.xqxn = #{zyInfoSys.xqxn} GROUP BY b.kcmc,b.kkdw AND a.xqxn = #{zyInfoSys.xqxn}
) t, GROUP BY b.kcmc, b.kkdw) t,
( SELECT @rownum := 0 ) AS r (SELECT @rownum := 0) AS r
ORDER BY ORDER BY count - 0 DESC LIMIT 10
count - 0 DESC
LIMIT 10
</select> </select>
<select id="getXnKcList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="getXnKcList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
SELECT SELECT (@rownum := @rownum + 1) AS rownum,
( @rownum := @rownum + 1 ) AS rownum,
t.* t.*
FROM FROM (SELECT b.kcmc,
(
SELECT
b.kcmc,
count(*) AS count, count(*) AS count,
b.kkdw b.kkdw
FROM FROM
@ -341,34 +516,30 @@
kc_kechengbiao b kc_kechengbiao b
WHERE WHERE
a.rwbh = b.rwbh a.rwbh = b.rwbh
AND a.xnxq = #{zyInfoSys.xqxn} GROUP BY b.kcmc,b.kkdw AND a.xnxq = #{zyInfoSys.xqxn}
GROUP BY b.kcmc, b.kkdw
union all union all
SELECT SELECT
b.kcmc, b.kcmc,
count(*) AS count, count (*) AS count,
b.kkdw b.kkdw
FROM FROM
wjx_wjxx a, wjx_wjxx a,
kc_kechengbiao b kc_kechengbiao b
WHERE WHERE
a.rwbh = b.rwbh a.rwbh = b.rwbh
AND a.xqxn = #{zyInfoSys.xqxn} GROUP BY b.kcmc,b.kkdw AND a.xqxn = #{zyInfoSys.xqxn}
) t, GROUP BY b.kcmc, b.kkdw) t,
( SELECT @rownum := 0 ) AS r (SELECT @rownum := 0) AS r
ORDER BY ORDER BY count - 0 DESC
count - 0 DESC
</select> </select>
<select id="getJsTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="getJsTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
SELECT SELECT (@rownum := @rownum + 1) AS rownum,
( @rownum := @rownum + 1 ) AS rownum,
t.* t.*
FROM FROM (SELECT a.create_by,
(
SELECT
a.create_by,
count(*) AS count, count(*) AS count,
b.xm AS skjs, b.xm AS skjs,
b.dwmc AS kkdw b.dwmc AS kkdw
@ -377,13 +548,16 @@
xxhbuser b xxhbuser b
WHERE WHERE
a.create_by = b.gh a.create_by = b.gh
AND xnxq = #{zyInfoSys.xqxn} and zy_status in (1,2) GROUP BY a.create_by ,b.xm,b.dwmc AND xnxq = #{zyInfoSys.xqxn}
and zy_status in (1
, 2)
GROUP BY a.create_by, b.xm, b.dwmc
union all union all
SELECT SELECT
a.create_by, a.create_by,
count(*) AS count, count (*) AS count,
b.xm AS skjs, b.xm AS skjs,
b.dwmc AS kkdw b.dwmc AS kkdw
FROM FROM
@ -391,22 +565,18 @@
xxhbuser b xxhbuser b
WHERE WHERE
a.create_by = b.gh a.create_by = b.gh
AND xqxn = #{zyInfoSys.xqxn} and qpublish in (1,2) GROUP BY a.create_by ,b.xm,b.dwmc AND xqxn = #{zyInfoSys.xqxn}
) t, and qpublish in (1
( SELECT @rownum := 0 ) AS r , 2)
ORDER BY GROUP BY a.create_by, b.xm, b.dwmc) t,
count - 0 DESC (SELECT @rownum := 0) AS r
LIMIT 10 ORDER BY count - 0 DESC LIMIT 10
</select> </select>
<select id="getXnJsList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="getXnJsList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
SELECT SELECT (@rownum := @rownum + 1) AS rownum,
( @rownum := @rownum + 1 ) AS rownum,
t.* t.*
FROM FROM (SELECT a.create_by,
(
SELECT
a.create_by,
count(*) AS count, count(*) AS count,
b.xm AS skjs, b.xm AS skjs,
b.dwmc AS kkdw b.dwmc AS kkdw
@ -415,13 +585,16 @@
xxhbuser b xxhbuser b
WHERE WHERE
a.create_by = b.gh a.create_by = b.gh
AND xnxq = #{zyInfoSys.xqxn} and zy_status in (1,2) GROUP BY a.create_by ,b.xm,b.dwmc AND xnxq = #{zyInfoSys.xqxn}
and zy_status in (1
, 2)
GROUP BY a.create_by, b.xm, b.dwmc
union all union all
SELECT SELECT
a.create_by, a.create_by,
count(*) AS count, count (*) AS count,
b.xm AS skjs, b.xm AS skjs,
b.dwmc AS kkdw b.dwmc AS kkdw
FROM FROM
@ -429,11 +602,12 @@
xxhbuser b xxhbuser b
WHERE WHERE
a.create_by = b.gh a.create_by = b.gh
AND xqxn = #{zyInfoSys.xqxn} and qpublish in (1,2) GROUP BY a.create_by ,b.xm,b.dwmc AND xqxn = #{zyInfoSys.xqxn}
) t, and qpublish in (1
( SELECT @rownum := 0 ) AS r , 2)
ORDER BY GROUP BY a.create_by, b.xm, b.dwmc) t,
count - 0 DESC (SELECT @rownum := 0) AS r
ORDER BY count - 0 DESC
</select> </select>
<select id="sysStaticZyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys"> <select id="sysStaticZyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
@ -442,7 +616,8 @@
IF( a.zy_status = '0', '未发布', '已发布' ) as sffb, IF( a.zy_status = '0', '未发布', '已发布' ) as sffb,
IF( a.xshpkg = '1', '是', '否' ) as sfhp IF( a.xshpkg = '1', '是', '否' ) as sfhp
from zy_info a, from zy_info a,
(select skjs,jgh,kcmc,kcbh,xkrs,kkdw,rwbh,kcxz,zc from kc_kechengbiao where xqxn = #{zyInfoSys.xqxn} and flag = '0' GROUP BY skjs,jgh,kcmc,kcbh,xkrs,kkdw, rwbh,kcxz,zc) b (select skjs,jgh,kcmc,kcbh,xkrs,kkdw,rwbh,kcxz,zc from kc_kechengbiao where xqxn = #{zyInfoSys.xqxn} and flag =
'0' GROUP BY skjs,jgh,kcmc,kcbh,xkrs,kkdw, rwbh,kcxz,zc) b
where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xnxq = #{zyInfoSys.xqxn} and a.zy_status in (1,2) where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xnxq = #{zyInfoSys.xqxn} and a.zy_status in (1,2)
<if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''"> <if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''">
and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%') and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%')
@ -465,7 +640,8 @@
IF( a.qpublish = '2', '全部完成', '未全部完成' ) as sfwc, IF( a.qpublish = '2', '全部完成', '未全部完成' ) as sfwc,
IF( a.qpublish = '0', '未发布', '已发布' ) as sffb IF( a.qpublish = '0', '未发布', '已发布' ) as sffb
from wjx_wjxx a, from wjx_wjxx a,
(select skjs,jgh,kcmc,kcbh,xkrs,kkdw,rwbh,kcxz,zc from kc_kechengbiao where xqxn = #{zyInfoSys.xqxn} and flag = '0' GROUP BY skjs,jgh,kcmc,kcbh,xkrs,kkdw, rwbh,kcxz,zc) b (select skjs,jgh,kcmc,kcbh,xkrs,kkdw,rwbh,kcxz,zc from kc_kechengbiao where xqxn = #{zyInfoSys.xqxn} and flag =
'0' GROUP BY skjs,jgh,kcmc,kcbh,xkrs,kkdw, rwbh,kcxz,zc) b
where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xqxn = #{zyInfoSys.xqxn} and a.qpublish in (1,2) where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xqxn = #{zyInfoSys.xqxn} and a.qpublish in (1,2)
<if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''"> <if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''">
and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%') and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%')
@ -485,7 +661,8 @@
IF( a.qpublish = '2', '全部完成', '未全部完成' ) as sfwc, IF( a.qpublish = '2', '全部完成', '未全部完成' ) as sfwc,
IF( a.qpublish = '0', '未发布', '已发布' ) as sffb IF( a.qpublish = '0', '未发布', '已发布' ) as sffb
from wjx_wjxx a, from wjx_wjxx a,
(select skjs,jgh,kcmc,kcbh,xkrs,kkdw,rwbh,kcxz,zc from kc_kechengbiao where xqxn = #{zyInfoSys.xqxn} and flag = '0' GROUP BY skjs,jgh,kcmc,kcbh,xkrs,kkdw, rwbh,kcxz,zc) b (select skjs,jgh,kcmc,kcbh,xkrs,kkdw,rwbh,kcxz,zc from kc_kechengbiao where xqxn = #{zyInfoSys.xqxn} and flag =
'0' GROUP BY skjs,jgh,kcmc,kcbh,xkrs,kkdw, rwbh,kcxz,zc) b
where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xqxn = #{zyInfoSys.xqxn} and a.qpublish in (1,2) where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xqxn = #{zyInfoSys.xqxn} and a.qpublish in (1,2)
<if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''"> <if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''">
and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%') and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%')
@ -502,11 +679,62 @@
</select> </select>
<select id="listKhcl" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo"> <select id="listKhcl" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
SELECT SELECT *
* FROM zy_info ${ew.customSqlSegment}
FROM
zy_info
${ew.customSqlSegment}
</select> </select>
<select id="getxzxx" resultMap="ZyXzInfoResultMap">
SELECT zxi.id AS zxi_id,
zxi.zyinfo_id,
zxi.xzmc,
zxi.sort,
zxi.create_by,
zxi.create_time,
zxri.id AS ry_id,
zxri.zyinfo_id as ryzyinfoid,
zxri.xm,
zxri.xh,
zxri.sfzz
FROM zy_xz_info zxi
LEFT JOIN
zy_xzry_info zxri ON zxi.id = zxri.zyxzinfo_id
WHERE zxi.zyinfo_id = #{dto.id}
group by zxi.id,
zxi.zyinfo_id,
zxi.xzmc,
zxi.sort,
zxi.create_by,
zxi.create_time,
zxri.id,
zxri.zyinfo_id,
zxri.xm,
zxri.xh,
zxri.sfzz
order by zxi.sort
</select>
<insert id="insertBatchzyxz" parameterType="java.util.List">
INSERT INTO zy_xz_info (id, zyinfo_id, create_by, create_time, xzmc, sort)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.zyinfoId}, #{item.createBy}, #{item.createTime}, #{item.xzmc}, #{item.sort})
</foreach>
</insert>
<insert id="insertBatchzyxzry" parameterType="java.util.List">
INSERT INTO zy_xzry_info (id,zyinfo_id, zyxzinfo_id, xm, xh, sfzz)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.id},#{item.zyinfoId}, #{item.zyxzinfoId}, #{item.xm}, #{item.xh}, #{item.sfzz})
</foreach>
</insert>
<delete id="deleteXzxx" >
delete from zy_xz_info where zyinfo_id = #{zyinfoId};
</delete>
<delete id="deleteXzryxx" >
delete from zy_xzry_info where zyinfo_id = #{zyinfoId};
</delete>
</mapper> </mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.kc.zyInfo.pojo;
import lombok.Data;
import org.jeecg.modules.kc.zyInfo.entity.ZyXzInfo;
import java.util.List;
@Data
public class XzReq {
private String zyinfoId;
private Integer rs;
private List<ZyXzInfo> list;
}

View File

@ -7,6 +7,7 @@ import org.jeecg.modules.kc.zyInfo.entity.CyInfoSys;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo; import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys; import org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys;
import org.jeecg.modules.kc.zyInfo.entity.ZyXzInfo;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -35,9 +36,9 @@ public interface IZyInfoService extends IService<ZyInfo> {
IPage<ZyInfo> listOther(Page<ZyInfo> page, ZyInfo zyInfo); IPage<ZyInfo> listOther(Page<ZyInfo> page, ZyInfo zyInfo);
Map<String,Object> sysStaticNo(ZyInfoSys zyInfoSys); Map<String, Object> sysStaticNo(ZyInfoSys zyInfoSys);
List<ZyInfoSys> getPHData(ZyInfoSys zyInfoSys,String tag); List<ZyInfoSys> getPHData(ZyInfoSys zyInfoSys, String tag);
IPage<ZyInfoSys> sysStaticZyList(Page<ZyInfoSys> page, ZyInfoSys zyInfoSys); IPage<ZyInfoSys> sysStaticZyList(Page<ZyInfoSys> page, ZyInfoSys zyInfoSys);
@ -46,4 +47,8 @@ public interface IZyInfoService extends IService<ZyInfo> {
List<CyInfoSys> getStaticCyExportUrl(CyInfoSys cyInfoSys); List<CyInfoSys> getStaticCyExportUrl(CyInfoSys cyInfoSys);
IPage<ZyInfo> listKhcl(Page<ZyInfo> page, QueryWrapper<ZyInfo> queryWrapper); IPage<ZyInfo> listKhcl(Page<ZyInfo> page, QueryWrapper<ZyInfo> queryWrapper);
List<ZyXzInfo> getxzxx(ZyInfo zyInfo);
int saveData(String zyinfoId, Integer rs, List<ZyXzInfo> list);
} }

View File

@ -1,5 +1,6 @@
package org.jeecg.modules.kc.zyInfo.service.impl; package org.jeecg.modules.kc.zyInfo.service.impl;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -16,9 +17,7 @@ import org.jeecg.modules.kc.ktgl.entity.KcKechengbiao;
import org.jeecg.modules.kc.ktgl.service.IKcKechengbiaoService; import org.jeecg.modules.kc.ktgl.service.IKcKechengbiaoService;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx; import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService; import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
import org.jeecg.modules.kc.zyInfo.entity.CyInfoSys; import org.jeecg.modules.kc.zyInfo.entity.*;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys;
import org.jeecg.modules.kc.zyInfo.mapper.ZyInfoMapper; import org.jeecg.modules.kc.zyInfo.mapper.ZyInfoMapper;
import org.jeecg.modules.kc.zyInfo.service.IZyInfoService; import org.jeecg.modules.kc.zyInfo.service.IZyInfoService;
import org.jeecg.modules.tools.DateUtils; import org.jeecg.modules.tools.DateUtils;
@ -27,9 +26,11 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @Description: 作业发布 * @Description: 作业发布
@ -253,12 +254,12 @@ public class ZyInfoServiceImpl extends ServiceImpl<ZyInfoMapper, ZyInfo> impleme
map.put("jr_zy_ywczcs", jr_zy_ywczcs);//今日作业已完成总次数 map.put("jr_zy_ywczcs", jr_zy_ywczcs);//今日作业已完成总次数
map.put("jr_cy_syzcs", jr_cy_syzcs);//今日测验使用总次数 map.put("jr_cy_syzcs", jr_cy_syzcs);//今日测验使用总次数
map.put("jr_cy_ywczcs", jr_cy_ywczcs);//今日测验已完成总次数 map.put("jr_cy_ywczcs", jr_cy_ywczcs);//今日测验已完成总次数
map.put("xn_kc_zyzxsrc",xn_kc_zyzxsrc );//使用课程作业总学生人次 map.put("xn_kc_zyzxsrc", xn_kc_zyzxsrc);//使用课程作业总学生人次
map.put("xn_kc_zyhp",xn_kc_zyhp );//使用课程作业互评总学生人次 map.put("xn_kc_zyhp", xn_kc_zyhp);//使用课程作业互评总学生人次
map.put("xn_kc_zycc",xn_kc_zycc );//使用课程作业查重总学生人次 map.put("xn_kc_zycc", xn_kc_zycc);//使用课程作业查重总学生人次
map.put("xn_kc_zywczxsrc",xn_kc_zywczxsrc );//完成课程作业总学生人次 map.put("xn_kc_zywczxsrc", xn_kc_zywczxsrc);//完成课程作业总学生人次
map.put("xn_kc_ktcy",xn_kc_ktcy );//使用课堂测验总学生人次 map.put("xn_kc_ktcy", xn_kc_ktcy);//使用课堂测验总学生人次
map.put("xn_kc_wccy",xn_kc_wccy );//完成课堂测验总学生人次 map.put("xn_kc_wccy", xn_kc_wccy);//完成课堂测验总学生人次
map.put("xntop10", list1);//本学年作业使用排行TOP10 map.put("xntop10", list1);//本学年作业使用排行TOP10
map.put("jrtop10", list2);//本学年测验使用排行TOP10 map.put("jrtop10", list2);//本学年测验使用排行TOP10
map.put("kctop10", list3);//本学年课程使用排行TOP10 map.put("kctop10", list3);//本学年课程使用排行TOP10
@ -269,18 +270,18 @@ public class ZyInfoServiceImpl extends ServiceImpl<ZyInfoMapper, ZyInfo> impleme
} }
@Override @Override
public List<ZyInfoSys> getPHData(ZyInfoSys zyInfoSys,String tag) { public List<ZyInfoSys> getPHData(ZyInfoSys zyInfoSys, String tag) {
List<ZyInfoSys> list = Lists.newArrayList(); List<ZyInfoSys> list = Lists.newArrayList();
if("xntop10".equals(tag)){ if ("xntop10".equals(tag)) {
list = baseMapper.getZyList(zyInfoSys); list = baseMapper.getZyList(zyInfoSys);
} }
if("jrtop10".equals(tag)){ if ("jrtop10".equals(tag)) {
list = baseMapper.getCyList(zyInfoSys); list = baseMapper.getCyList(zyInfoSys);
} }
if("kctop10".equals(tag)){ if ("kctop10".equals(tag)) {
list = baseMapper.getXnKcList(zyInfoSys); list = baseMapper.getXnKcList(zyInfoSys);
} }
if("jstop10".equals(tag)){ if ("jstop10".equals(tag)) {
list = baseMapper.getXnJsList(zyInfoSys); list = baseMapper.getXnJsList(zyInfoSys);
} }
return list; return list;
@ -306,6 +307,48 @@ public class ZyInfoServiceImpl extends ServiceImpl<ZyInfoMapper, ZyInfo> impleme
return baseMapper.listKhcl(page, queryWrapper); return baseMapper.listKhcl(page, queryWrapper);
} }
@Override
public List<ZyXzInfo> getxzxx(ZyInfo zyInfo) {
return baseMapper.getxzxx(zyInfo);
}
@Override
@Transactional(rollbackFor = Exception.class)
public int saveData(String zyinfoId, Integer rs, List<ZyXzInfo> list) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//先清除小组信息 然后重新插入
baseMapper.deleteXzxx(zyinfoId);
baseMapper.deleteXzryxx(zyinfoId);
if (!list.isEmpty()) {
list.stream().forEach(xz -> {
xz.setId(IdUtil.simpleUUID());
xz.setCreateBy(sysUser.getUsername());
xz.setCreateTime(new Date());
});
this.baseMapper.insertBatchzyxz(list);
List<ZyXzryInfo> childTableList = list.stream()
.flatMap(zyXzInfo -> zyXzInfo.getStudents().stream()
.peek(student -> {
student.setId(IdUtil.simpleUUID());
student.setZyxzinfoId(zyXzInfo.getId());
}))
.collect(Collectors.toList());
if (!childTableList.isEmpty()) {
baseMapper.insertBatchzyxzry(childTableList);
}
ZyInfo zyInfo = new ZyInfo().setId(zyinfoId).setSfpzgxzxx("Y").setXzrs(rs);
baseMapper.updateById(zyInfo);
} else {
ZyInfo zyInfo = new ZyInfo().setId(zyinfoId).setSfpzgxzxx("N").setXzrs(rs);
baseMapper.updateById(zyInfo);
}
return list.size();
}
// appId // appId
private static final String appId = "wx031697a8ca09a5ce";//东师 private static final String appId = "wx031697a8ca09a5ce";//东师

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -28,6 +29,7 @@ import org.jeecg.modules.kc.zyCcjg.service.IZyCcjgService;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx; import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService; import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo; import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import org.jeecg.modules.kc.zyInfo.entity.ZyXzryInfo;
import org.jeecg.modules.kc.zyInfo.service.IZyInfoService; import org.jeecg.modules.kc.zyInfo.service.IZyInfoService;
import org.jeecg.modules.kc.zyInfoScjl.entity.ZyInfoScjl; import org.jeecg.modules.kc.zyInfoScjl.entity.ZyInfoScjl;
import org.jeecg.modules.kc.zyInfoScjl.service.IZyInfoScjlService; import org.jeecg.modules.kc.zyInfoScjl.service.IZyInfoScjlService;
@ -57,12 +59,9 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.util.Arrays; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* @Description: 学生提交作业 * @Description: 学生提交作业
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2024-05-06 * @Date: 2024-05-06
@ -846,7 +845,7 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
@AutoLog(value = "作业驳回") @AutoLog(value = "作业驳回")
@ApiOperation(value="作业驳回", notes="作业驳回") @ApiOperation(value="作业驳回", notes="作业驳回")
@RequestMapping(value = "/editBohui", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/editBohui", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> editBohui(@RequestBody ZyInfoStudent zyInfoStudent, HttpServletResponse response) { public Result<Map> editBohui(@RequestBody ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
UpdateWrapper<ZyInfoStudent> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<ZyInfoStudent> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("file_path",null); updateWrapper.set("file_path",null);
updateWrapper.set("pdf_path",null); updateWrapper.set("pdf_path",null);
@ -886,10 +885,9 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
zyDbtxService.save(zyDbtx); zyDbtxService.save(zyDbtx);
//查重前删除原来的查重数据 //查重前删除原来的查重数据
// zyCcjgService.deleteByZystuid(zyInfoStudent.getId(),response); // zyCcjgService.deleteByZystuid(zyInfoStudent.getId(),response);
return Result.OK("作业驳回成功!"); return Result.OK(new HashMap());
} }
@AutoLog(value = "设置作业存档类型") @AutoLog(value = "设置作业存档类型")
@ -1235,4 +1233,21 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
return Result.OK(zyInfoStudent); return Result.OK(zyInfoStudent);
} }
/**
* 获取同小组人员作业标识
* @return
*/
@PostMapping(value = "/getZyStuId")
public Result<List<ZyInfoStudent>> getZyStuId(@RequestBody ZyXzryInfo zyXzryInfo) {
return Result.OK(zyInfoStudentService.getZyStuId(zyXzryInfo));
}
/**
* 获取同小组人员作业标识
* @return
*/
@PostMapping(value = "/getZyStuIdById")
public Result<List<ZyInfoStudent>> getZyStuIdById(@RequestBody ZyXzryInfo zyXzryInfo) {
return Result.OK(zyInfoStudentService.getZyStuIdById(zyXzryInfo));
}
} }

View File

@ -226,5 +226,7 @@ public class ZyInfoStudent implements Serializable {
private String ywid;//业务id private String ywid;//业务id
@TableField(exist = false) @TableField(exist = false)
private String stuId;//学生作业临时id private String stuId;//学生作业临时id
@TableField(exist = false)
private String sfzz;//是否是组长
} }

View File

@ -7,6 +7,7 @@ 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.zyInfo.entity.ZyInfo; import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import org.jeecg.modules.kc.zyInfo.entity.ZyXzryInfo;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent; import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudentSys; import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudentSys;
import org.jeecg.modules.kc.zyInfoStudentPcz.entity.ZyInfoStudentPcz; import org.jeecg.modules.kc.zyInfoStudentPcz.entity.ZyInfoStudentPcz;
@ -50,4 +51,8 @@ public interface ZyInfoStudentMapper extends BaseMapper<ZyInfoStudent> {
List<ZyInfoStudent> cxccByZyId(@Param("zyInfoStudent") ZyInfoStudent zyInfoStudent2); List<ZyInfoStudent> cxccByZyId(@Param("zyInfoStudent") ZyInfoStudent zyInfoStudent2);
List<ZyInfoStudent> cxtjByJccsbz(); List<ZyInfoStudent> cxtjByJccsbz();
List<ZyInfoStudent> getZyStuId(@Param("dto") ZyXzryInfo zyXzryInfo);
List<ZyInfoStudent> getZyStuIdById(@Param("dto") ZyXzryInfo zyXzryInfo);
} }

View File

@ -180,4 +180,54 @@
select a.* from zy_info_student a , select a.* from zy_info_student a ,
(select distinct zy_stu_id from zy_ccjg where message = '大学生版,检测次数不足') b where a.id = b.zy_stu_id and a.file_path is not null (select distinct zy_stu_id from zy_ccjg where message = '大学生版,检测次数不足') b where a.id = b.zy_stu_id and a.file_path is not null
</select> </select>
<select id="getZyStuId" resultType="org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent">
SELECT
a.id,b.sfzz
FROM
zy_info_student a
LEFT JOIN zy_xzry_info b ON a.main_id = b.zyinfo_id
AND a.create_by = b.xh
WHERE
main_id = #{dto.zyinfoId}
AND create_by IN (
SELECT
xh
FROM
zy_xzry_info
WHERE
zyxzinfo_id = (
SELECT
zyxzinfo_id
FROM
zy_xzry_info
WHERE
zyinfo_id = #{dto.zyinfoId} AND xh = (select create_by from zy_info_student where id = #{dto.xh}) ))
</select>
<select id="getZyStuIdById" resultType="org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent">
SELECT
a.id,
b.sfzz
FROM
zy_info_student a
LEFT JOIN zy_xzry_info b ON a.main_id = b.zyinfo_id
AND a.create_by = b.xh
WHERE
main_id = #{dto.zyinfoId}
AND create_by IN (
SELECT
xh
FROM
zy_xzry_info
WHERE
zyxzinfo_id = (
SELECT
zyxzinfo_id
FROM
zy_xzry_info
WHERE
zyinfo_id = #{dto.zyinfoId} AND xh = #{dto.xh}))
</select>
</mapper> </mapper>

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.kc.zyInfo.entity.ZyXzryInfo;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent; import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudentSys; import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudentSys;
@ -41,7 +42,7 @@ public interface IZyInfoStudentService extends IService<ZyInfoStudent> {
boolean stuWpKsjc(ZyInfoStudent zyInfoStudent, HttpServletResponse response); boolean stuWpKsjc(ZyInfoStudent zyInfoStudent, HttpServletResponse response);
IPage<ZyInfoStudent> getHpxxList(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper,String zyStuId); IPage<ZyInfoStudent> getHpxxList(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper, String zyStuId);
void batchKhcl(List<String> list); void batchKhcl(List<String> list);
@ -64,4 +65,8 @@ public interface IZyInfoStudentService extends IService<ZyInfoStudent> {
List<JSONObject> getWpSycccs(); List<JSONObject> getWpSycccs();
void getWpcccs(); void getWpcccs();
List<ZyInfoStudent> getZyStuId(ZyXzryInfo zyXzryInfo);
List<ZyInfoStudent> getZyStuIdById(ZyXzryInfo zyXzryInfo);
} }

View File

@ -22,6 +22,7 @@ import org.jeecg.modules.kc.wjxWjxx.service.IWjxWjxxService;
import org.jeecg.modules.kc.zyCcjg.entity.ZyCcjg; import org.jeecg.modules.kc.zyCcjg.entity.ZyCcjg;
import org.jeecg.modules.kc.zyCcjg.mapper.ZyCcjgMapper; import org.jeecg.modules.kc.zyCcjg.mapper.ZyCcjgMapper;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo; import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import org.jeecg.modules.kc.zyInfo.entity.ZyXzryInfo;
import org.jeecg.modules.kc.zyInfo.service.IZyInfoService; import org.jeecg.modules.kc.zyInfo.service.IZyInfoService;
import org.jeecg.modules.kc.zyInfoScjl.entity.ZyInfoScjl; import org.jeecg.modules.kc.zyInfoScjl.entity.ZyInfoScjl;
import org.jeecg.modules.kc.zyInfoScjl.service.IZyInfoScjlService; import org.jeecg.modules.kc.zyInfoScjl.service.IZyInfoScjlService;
@ -83,7 +84,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
this.uploadpath = uploadPath; this.uploadpath = uploadPath;
} }
@Value(value="${jeecg.uploadType}") @Value(value = "${jeecg.uploadType}")
private String uploadType; private String uploadType;
private static String weipuId; private static String weipuId;
@ -95,6 +96,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
private static String weipuKey; private static String weipuKey;
@Value("${weipu.userKey}") @Value("${weipu.userKey}")
public void setWeipuKey(String weipuKey) { public void setWeipuKey(String weipuKey) {
this.weipuKey = weipuKey; this.weipuKey = weipuKey;
@ -136,7 +138,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
@Override @Override
public IPage<ZyInfoStudent> cdxxlist(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper) { public IPage<ZyInfoStudent> cdxxlist(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper) {
return baseMapper.cdxxlist(page,queryWrapper); return baseMapper.cdxxlist(page, queryWrapper);
} }
@Override @Override
@ -146,7 +148,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
@Override @Override
public void fabuBatch(List<String> asList) { public void fabuBatch(List<String> asList) {
for (int i = 0; i < asList.size(); i++){ for (int i = 0; i < asList.size(); i++) {
ZyInfoStudent zyInfoStudent = new ZyInfoStudent(); ZyInfoStudent zyInfoStudent = new ZyInfoStudent();
zyInfoStudent.setId(asList.get(i)); zyInfoStudent.setId(asList.get(i));
zyInfoStudent.setScoreFabu("1"); zyInfoStudent.setScoreFabu("1");
@ -166,23 +168,23 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
@Override @Override
public boolean stuWpKsjc(ZyInfoStudent zyInfoStudent, HttpServletResponse response) { public boolean stuWpKsjc(ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
String fileName = getFileName(zyInfoStudent.getFilePath(),response); String fileName = getFileName(zyInfoStudent.getFilePath(), response);
zyInfoStudent.setFilePath(fileName); zyInfoStudent.setFilePath(fileName);
System.out.println("----------------1---------------------"+zyInfoStudent.getStuId()); System.out.println("----------------1---------------------" + zyInfoStudent.getStuId());
if(StringUtils.isEmpty(zyInfoStudent.getStuId())){ if (StringUtils.isEmpty(zyInfoStudent.getStuId())) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<ZyInfoStudent> queryWrapper = new QueryWrapper<>(); QueryWrapper<ZyInfoStudent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("a.main_id",zyInfoStudent.getId()); queryWrapper.eq("a.main_id", zyInfoStudent.getId());
queryWrapper.eq("a.create_by",sysUser.getUsername()); queryWrapper.eq("a.create_by", sysUser.getUsername());
List<ZyInfoStudent> list1 = baseMapper.selectList(queryWrapper); List<ZyInfoStudent> list1 = baseMapper.selectList(queryWrapper);
zyInfoStudent = list1.get(0); zyInfoStudent = list1.get(0);
}else{ } else {
zyInfoStudent = baseMapper.selectById(zyInfoStudent.getStuId()); zyInfoStudent = baseMapper.selectById(zyInfoStudent.getStuId());
} }
System.out.println("----------------2---------------------"+zyInfoStudent); System.out.println("----------------2---------------------" + zyInfoStudent);
ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId()); ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId());
System.out.println("----------------3---------------------"+zyInfo); System.out.println("----------------3---------------------" + zyInfo);
// String rwbh = zyInfo.getRwbh(); // String rwbh = zyInfo.getRwbh();
@ -191,7 +193,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
// kcKechengbiaoQueryWrapper.eq("rwbh",rwbh); // kcKechengbiaoQueryWrapper.eq("rwbh",rwbh);
// kcKechengbiaoQueryWrapper.last("limit 1"); // kcKechengbiaoQueryWrapper.last("limit 1");
// KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper); // KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
String cateid = zyInfo.getId()+""+zyInfo.getTitle(); String cateid = zyInfo.getId() + "" + zyInfo.getTitle();
String catename = zyInfo.getTitle(); String catename = zyInfo.getTitle();
zyInfoStudent.setCateid(cateid); zyInfoStudent.setCateid(cateid);
zyInfoStudent.setCatename(catename); zyInfoStudent.setCatename(catename);
@ -203,22 +205,22 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
System.out.println("----------------5---------------------"); System.out.println("----------------5---------------------");
//外网查重及提交检测 //外网查重及提交检测
if(StringUtils.equals(zyInfo.getWwcc(),"true")){ if (StringUtils.equals(zyInfo.getWwcc(), "true")) {
wwccSave(zyInfoStudent,response); wwccSave(zyInfoStudent, response);
} }
//内网查重及提交检测 //内网查重及提交检测
if(StringUtils.equals(zyInfo.getNwcc(),"true")){ if (StringUtils.equals(zyInfo.getNwcc(), "true")) {
nwccSave(zyInfoStudent,response); nwccSave(zyInfoStudent, response);
} }
//aigc查重及提交检测 //aigc查重及提交检测
if(StringUtils.equals(zyInfo.getAigccc(),"true")){ if (StringUtils.equals(zyInfo.getAigccc(), "true")) {
aigcSave(zyInfoStudent,response); aigcSave(zyInfoStudent, response);
} }
//校内查重及提交检测 //校内查重及提交检测
if(StringUtils.equals(zyInfo.getXncc(),"true")){ if (StringUtils.equals(zyInfo.getXncc(), "true")) {
zyInfoStudent.setCateid("DBSDQXZYBDK001"); zyInfoStudent.setCateid("DBSDQXZYBDK001");
zyInfoStudent.setCatename("东北师大全校作业比对库"); zyInfoStudent.setCatename("东北师大全校作业比对库");
xnccSave(zyInfoStudent,"1",response);//提交比对 xnccSave(zyInfoStudent, "1", response);//提交比对
// }else{ // }else{
// zyInfoStudent.setCateid("DBSDQXZYBDK001"); // zyInfoStudent.setCateid("DBSDQXZYBDK001");
// zyInfoStudent.setCatename("东北师大全校作业比对库"); // zyInfoStudent.setCatename("东北师大全校作业比对库");
@ -229,13 +231,13 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
} }
@Override @Override
public IPage<ZyInfoStudent> getHpxxList(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper,String zyStuId) { public IPage<ZyInfoStudent> getHpxxList(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper, String zyStuId) {
return baseMapper.getHpxxList(page,queryWrapper,zyStuId); return baseMapper.getHpxxList(page, queryWrapper, zyStuId);
} }
@Override @Override
public void batchKhcl(List<String> asList) { public void batchKhcl(List<String> asList) {
for (int i = 0; i < asList.size(); i++){ for (int i = 0; i < asList.size(); i++) {
ZyInfoStudent zyInfoStudent = new ZyInfoStudent(); ZyInfoStudent zyInfoStudent = new ZyInfoStudent();
zyInfoStudent.setId(asList.get(i)); zyInfoStudent.setId(asList.get(i));
zyInfoStudent.setSfsckhcl("1"); zyInfoStudent.setSfsckhcl("1");
@ -245,7 +247,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
@Override @Override
public IPage<ZyInfoStudent> getList2(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper) { public IPage<ZyInfoStudent> getList2(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper) {
return baseMapper.getList2(page,queryWrapper); return baseMapper.getList2(page, queryWrapper);
} }
@Override @Override
@ -259,20 +261,19 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
ZyInfo zyinfo = zyInfoService.getById(zyInfoStudent.getId()); ZyInfo zyinfo = zyInfoService.getById(zyInfoStudent.getId());
if(zyinfo!=null && StringUtils.equals(zyinfo.getSfcc(),"1") && StringUtils.equals(zyinfo.getXncc(),"true")){ if (zyinfo != null && StringUtils.equals(zyinfo.getSfcc(), "1") && StringUtils.equals(zyinfo.getXncc(), "true")) {
QueryWrapper<ZyInfoStudent> queryWrapper = new QueryWrapper<>(); QueryWrapper<ZyInfoStudent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("a.main_id",zyInfoStudent.getId()); queryWrapper.eq("a.main_id", zyInfoStudent.getId());
queryWrapper.isNotNull("a.file_path"); queryWrapper.isNotNull("a.file_path");
List<ZyInfoStudent> list = baseMapper.selectList(queryWrapper); List<ZyInfoStudent> list = baseMapper.selectList(queryWrapper);
for(ZyInfoStudent par : list){ for (ZyInfoStudent par : list) {
par.setCateid("DBSDQXZYBDK001"); par.setCateid("DBSDQXZYBDK001");
par.setCatename("东北师大全校作业比对库"); par.setCatename("东北师大全校作业比对库");
xnccUpdate(par,"1",response);//提交比对 xnccUpdate(par, "1", response);//提交比对
} }
} }
return new ArrayList<>(); return new ArrayList<>();
} }
@ -294,9 +295,9 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
try { try {
String token = wjxWjxxService.getAccessToken();//获取东北师大开放平台token String token = wjxWjxxService.getAccessToken();//获取东北师大开放平台token
System.out.println("======================================="); System.out.println("=======================================");
System.out.println("token:"+token); System.out.println("token:" + token);
System.out.println("======================================="); System.out.println("=======================================");
if(org.jeecg.common.util.text.StringUtils.isNotEmpty(token)) {//判断如果token不为空则继续操作 if (org.jeecg.common.util.text.StringUtils.isNotEmpty(token)) {//判断如果token不为空则继续操作
String idsList[] = ids.split(","); String idsList[] = ids.split(",");
String yyyy = DateUtils.formatDate(new Date(), "yyyy"); String yyyy = DateUtils.formatDate(new Date(), "yyyy");
@ -322,10 +323,10 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
Map<String, String> paramMap = new HashMap<>(); Map<String, String> paramMap = new HashMap<>();
paramMap.put("CJR", zyInfo.getCreateBy());//创建人 paramMap.put("CJR", zyInfo.getCreateBy());//创建人
paramMap.put("TEABH", zyInfo.getCreateBy());//教工号 paramMap.put("TEABH", zyInfo.getCreateBy());//教工号
if(StringUtils.equals(zyInfo.getZyLeixing(),"0")){ if (StringUtils.equals(zyInfo.getZyLeixing(), "0")) {
paramMap.put("FXCJMC", "课程作业" + zyInfo.getSort());//分项成绩名称 paramMap.put("FXCJMC", "课程作业" + zyInfo.getSort());//分项成绩名称
paramMap.put("FXCJLXMC", "0");//分项成绩类型 paramMap.put("FXCJLXMC", "0");//分项成绩类型
}else{ } else {
paramMap.put("FXCJMC", "期末考试" + zyInfo.getSort());//分项成绩名称 paramMap.put("FXCJMC", "期末考试" + zyInfo.getSort());//分项成绩名称
paramMap.put("FXCJLXMC", "1");//分项成绩类型 paramMap.put("FXCJLXMC", "1");//分项成绩类型
} }
@ -397,23 +398,23 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
zyInfoScjlService.save(zyInfoScjl); zyInfoScjlService.save(zyInfoScjl);
Map<String, String> paramMap2 = new HashMap<>(); Map<String, String> paramMap2 = new HashMap<>();
paramMap2.put("CJ",zyInfoStudentPar2.getZzdf()+"");//成绩 paramMap2.put("CJ", zyInfoStudentPar2.getZzdf() + "");//成绩
paramMap2.put("CJR",zyInfoStudentPar2.getCreateBy());//创建人 paramMap2.put("CJR", zyInfoStudentPar2.getCreateBy());//创建人
paramMap2.put("CJSJ",DateUtils.formatDate(zyInfoStudentPar2.getCreateTime(),"yyyy-MM-dd"));//创建时间 paramMap2.put("CJSJ", DateUtils.formatDate(zyInfoStudentPar2.getCreateTime(), "yyyy-MM-dd"));//创建时间
paramMap2.put("KCRWDM",zyInfo.getRwbh());//开课任务编号 paramMap2.put("KCRWDM", zyInfo.getRwbh());//开课任务编号
paramMap2.put("KCMC",kcKechengbiao.getKcmc());//课程名称 paramMap2.put("KCMC", kcKechengbiao.getKcmc());//课程名称
if(StringUtils.equals(zyInfo.getZyLeixing(),"0")){ if (StringUtils.equals(zyInfo.getZyLeixing(), "0")) {
paramMap2.put("FXCJMC", "课程作业" + zyInfo.getSort());//分项成绩名称 paramMap2.put("FXCJMC", "课程作业" + zyInfo.getSort());//分项成绩名称
}else{ } else {
paramMap2.put("FXCJMC", "期末考试" + zyInfo.getSort());//分项成绩名称 paramMap2.put("FXCJMC", "期末考试" + zyInfo.getSort());//分项成绩名称
} }
paramMap2.put("TEAXM",kcKechengbiao.getSkjs());//教师姓名 paramMap2.put("TEAXM", kcKechengbiao.getSkjs());//教师姓名
paramMap2.put("XSXM",zyInfoStudentPar2.getStudentName());//学生姓名 paramMap2.put("XSXM", zyInfoStudentPar2.getStudentName());//学生姓名
paramMap2.put("KID",zyInfoStudentPar2.getId());//主键 paramMap2.put("KID", zyInfoStudentPar2.getId());//主键
paramMap2.put("XSBH",zyInfoStudentPar2.getCreateBy());//学号 paramMap2.put("XSBH", zyInfoStudentPar2.getCreateBy());//学号
paramMap2.put("FXCJBH",zyInfoStudentPar2.getMainId());//分项成绩编号 paramMap2.put("FXCJBH", zyInfoStudentPar2.getMainId());//分项成绩编号
paramMap2.put("PATH",zyInfoStudentPar2.getFwqPath());//附件路径 paramMap2.put("PATH", zyInfoStudentPar2.getFwqPath());//附件路径
paramMap2.put("TEABH",zyInfo.getCreateBy());//教工号 paramMap2.put("TEABH", zyInfo.getCreateBy());//教工号
// paramMap2.put("OPERATE_STATUS","i");//操作状态 // paramMap2.put("OPERATE_STATUS","i");//操作状态
paramsList2.add(paramMap2); paramsList2.add(paramMap2);
// } // }
@ -421,13 +422,13 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
} }
System.out.println("======================================="); System.out.println("=======================================");
System.out.println("paramsList2:"+paramsList2); System.out.println("paramsList2:" + paramsList2);
System.out.println("======================================="); System.out.println("=======================================");
//调用师大接口进行上传 //调用师大接口进行上传
String interfaceUrl2 = "https://intf.nenu.edu.cn/api/bd-api/post/JW_FXXSCJMX"; String interfaceUrl2 = "https://intf.nenu.edu.cn/api/bd-api/post/JW_FXXSCJMX";
String data2 = RestTemplateUtils.post(interfaceUrl2,token, paramsList2, MediaType.APPLICATION_JSON_UTF8, String.class); String data2 = RestTemplateUtils.post(interfaceUrl2, token, paramsList2, MediaType.APPLICATION_JSON_UTF8, String.class);
System.out.println("======================================="); System.out.println("=======================================");
System.out.println("data2:"+data2); System.out.println("data2:" + data2);
System.out.println("======================================="); System.out.println("=======================================");
zyInfo.setSfsckhcl("1"); zyInfo.setSfsckhcl("1");
@ -440,7 +441,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
} }
} }
} }
}catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -452,13 +453,13 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
@Override @Override
public void sysWpKsjc(ZyInfoStudent zyInfoStudent, HttpServletResponse response) { public void sysWpKsjc(ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
String fileName = getFileName(zyInfoStudent.getFilePath(),response); String fileName = getFileName(zyInfoStudent.getFilePath(), response);
zyInfoStudent.setFilePath(fileName); zyInfoStudent.setFilePath(fileName);
ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId()); ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId());
String cateid = zyInfo.getId()+""+zyInfo.getTitle(); String cateid = zyInfo.getId() + "" + zyInfo.getTitle();
String catename = zyInfo.getTitle(); String catename = zyInfo.getTitle();
zyInfoStudent.setCateid(cateid); zyInfoStudent.setCateid(cateid);
zyInfoStudent.setCatename(catename); zyInfoStudent.setCatename(catename);
@ -476,8 +477,8 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
// nwccSave(zyInfoStudent,response); // nwccSave(zyInfoStudent,response);
// } // }
//aigc查重及提交检测 //aigc查重及提交检测
if(StringUtils.equals(zyInfo.getAigccc(),"true")){ if (StringUtils.equals(zyInfo.getAigccc(), "true")) {
aigcSave(zyInfoStudent,response); aigcSave(zyInfoStudent, response);
} }
// //校内查重及提交检测 // //校内查重及提交检测
// if(StringUtils.equals(zyInfo.getXncc(),"true")){ // if(StringUtils.equals(zyInfo.getXncc(),"true")){
@ -493,11 +494,11 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
List<JSONObject> list = new ArrayList<>(); List<JSONObject> list = new ArrayList<>();
String url = "https://vims.fanyu.com/toole/jianceorgan/papercheckcount.aspx"; String url = "https://vims.fanyu.com/toole/jianceorgan/papercheckcount.aspx";
JSONObject object= getSycs(url,"1"); JSONObject object = getSycs(url, "1");
object.put("name","外网检测"); object.put("name", "外网检测");
JSONObject object2= getSycs(url,"3"); JSONObject object2 = getSycs(url, "3");
object2.put("name","AIGC检测"); object2.put("name", "AIGC检测");
list.add(object); list.add(object);
list.add(object2); list.add(object2);
@ -508,27 +509,37 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
public void getWpcccs() { public void getWpcccs() {
String url = "https://vims.fanyu.com/toole/jianceorgan/papercheckcount.aspx"; String url = "https://vims.fanyu.com/toole/jianceorgan/papercheckcount.aspx";
//获取外网检测剩余查重次数 //获取外网检测剩余查重次数
JSONObject object= getSycs(url,"1"); JSONObject object = getSycs(url, "1");
int wwremaincount = object.getIntValue("remaincount"); int wwremaincount = object.getIntValue("remaincount");
if(wwremaincount<=200){ if (wwremaincount <= 200) {
KcWechatSendLog kcWechatSendLog = new KcWechatSendLog(); KcWechatSendLog kcWechatSendLog = new KcWechatSendLog();
kcWechatSendLog.setOpenid("2016900057"); kcWechatSendLog.setOpenid("2016900057");
kcWechatSendLog.setYtkcs("维普【外网检测】查重次数不足,剩余"+wwremaincount+"次,请及时充值!"); kcWechatSendLog.setYtkcs("维普【外网检测】查重次数不足,剩余" + wwremaincount + "次,请及时充值!");
sendWxmessage(kcWechatSendLog); sendWxmessage(kcWechatSendLog);
} }
//获取AIGC检测剩余查重次数 //获取AIGC检测剩余查重次数
JSONObject object2= getSycs(url,"3"); JSONObject object2 = getSycs(url, "3");
int aigcremaincount = object2.getIntValue("remaincount"); int aigcremaincount = object2.getIntValue("remaincount");
if(aigcremaincount<=200){ if (aigcremaincount <= 200) {
KcWechatSendLog kcWechatSendLog = new KcWechatSendLog(); KcWechatSendLog kcWechatSendLog = new KcWechatSendLog();
kcWechatSendLog.setOpenid("2016900057"); kcWechatSendLog.setOpenid("2016900057");
kcWechatSendLog.setYtkcs("维普【AIGC检测】查重次数不足剩余"+aigcremaincount+"次,请及时充值!"); kcWechatSendLog.setYtkcs("维普【AIGC检测】查重次数不足剩余" + aigcremaincount + "次,请及时充值!");
sendWxmessage(kcWechatSendLog); sendWxmessage(kcWechatSendLog);
} }
} }
public JSONObject getSycs(String url,String type){ @Override
public List<ZyInfoStudent> getZyStuId(ZyXzryInfo zyXzryInfo) {
return baseMapper.getZyStuId(zyXzryInfo);
}
@Override
public List<ZyInfoStudent> getZyStuIdById(ZyXzryInfo zyXzryInfo) {
return baseMapper.getZyStuIdById(zyXzryInfo);
}
public JSONObject getSycs(String url, String type) {
Map<String, String> textMap = new HashMap<String, String>(); Map<String, String> textMap = new HashMap<String, String>();
//可以设置多个input的namevalue //可以设置多个input的namevalue
String sign = getSign(); String sign = getSign();
@ -536,40 +547,40 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
textMap.put("userid", weipuId); textMap.put("userid", weipuId);
textMap.put("type", type); textMap.put("type", type);
String contentType = "";//image/png String contentType = "";//image/png
String ret = formUpload(url, textMap, null,contentType); String ret = formUpload(url, textMap, null, contentType);
log.error("1-------->"+ret); log.error("1-------->" + ret);
JSONObject object= JSONObject.parseObject(ret); JSONObject object = JSONObject.parseObject(ret);
return object; return object;
} }
private void delweipulunwen(ZyInfoStudent zyInfoStudent, HttpServletResponse response) { private void delweipulunwen(ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
zyInfoStudent.setQueryType("0");//外网查重数据 zyInfoStudent.setQueryType("0");//外网查重数据
String paperids = baseMapper.getWpFile(zyInfoStudent); String paperids = baseMapper.getWpFile(zyInfoStudent);
if(StringUtils.isNotEmpty(paperids)){ if (StringUtils.isNotEmpty(paperids)) {
String url = "https://vims.fanyu.com/toole/jianceorgan/paperdel.aspx"; String url = "https://vims.fanyu.com/toole/jianceorgan/paperdel.aspx";
delWpFile(url,paperids, response); delWpFile(url, paperids, response);
} }
zyInfoStudent.setQueryType("1");//内网查重数据-作业内查重 zyInfoStudent.setQueryType("1");//内网查重数据-作业内查重
Map<String,String> paperids1 = baseMapper.getXfwWpFile(zyInfoStudent); Map<String, String> paperids1 = baseMapper.getXfwWpFile(zyInfoStudent);
if(paperids1 != null){ if (paperids1 != null) {
String dataids = paperids1.get("paperid"); String dataids = paperids1.get("paperid");
String bdkbs = paperids1.get("bdkbs"); String bdkbs = paperids1.get("bdkbs");
String url = "https://vims.fanyu.com/toole/smallcheck/delData"; String url = "https://vims.fanyu.com/toole/smallcheck/delData";
delXfwWpFile(url,bdkbs,dataids, response); delXfwWpFile(url, bdkbs, dataids, response);
} }
zyInfoStudent.setQueryType("3");//内网查重数据-全校内比对 zyInfoStudent.setQueryType("3");//内网查重数据-全校内比对
Map<String,String> paperids3 = baseMapper.getXfwWpFile(zyInfoStudent); Map<String, String> paperids3 = baseMapper.getXfwWpFile(zyInfoStudent);
if(paperids3 != null){ if (paperids3 != null) {
String dataids = paperids3.get("paperid"); String dataids = paperids3.get("paperid");
String bdkbs = paperids3.get("bdkbs"); String bdkbs = paperids3.get("bdkbs");
String url = "https://vims.fanyu.com/toole/smallcheck/delData"; String url = "https://vims.fanyu.com/toole/smallcheck/delData";
delXfwWpFile(url,bdkbs,dataids, response); delXfwWpFile(url, bdkbs, dataids, response);
} }
zyInfoStudent.setQueryType("2");//aigc查重数据 zyInfoStudent.setQueryType("2");//aigc查重数据
String paperids2 = baseMapper.getWpFile(zyInfoStudent); String paperids2 = baseMapper.getWpFile(zyInfoStudent);
if(StringUtils.isNotEmpty(paperids2)){ if (StringUtils.isNotEmpty(paperids2)) {
String url = "https://vims.fanyu.com/tool/AIGCCheck/paperDel"; String url = "https://vims.fanyu.com/tool/AIGCCheck/paperDel";
delWpFile(url,paperids2, response); delWpFile(url, paperids2, response);
} }
zyCcjgMapper.deleteByZystuid(zyInfoStudent.getId()); zyCcjgMapper.deleteByZystuid(zyInfoStudent.getId());
} }
@ -599,28 +610,28 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
// } // }
zyInfoStudent.setQueryType("2");//aigc查重数据 zyInfoStudent.setQueryType("2");//aigc查重数据
String paperids2 = baseMapper.getWpFile(zyInfoStudent); String paperids2 = baseMapper.getWpFile(zyInfoStudent);
if(StringUtils.isNotEmpty(paperids2)){ if (StringUtils.isNotEmpty(paperids2)) {
String url = "https://vims.fanyu.com/tool/AIGCCheck/paperDel"; String url = "https://vims.fanyu.com/tool/AIGCCheck/paperDel";
delWpFile(url,paperids2, response); delWpFile(url, paperids2, response);
} }
zyCcjgMapper.deleteByZystuid(zyInfoStudent.getId()); zyCcjgMapper.deleteByZystuid(zyInfoStudent.getId());
} }
//aigc提交 //aigc提交
private void aigcSave(ZyInfoStudent zyInfoStudent,HttpServletResponse response) { private void aigcSave(ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
String url = "https://vims.fanyu.com/tool/AIGCCheck/paperSubmit"; String url = "https://vims.fanyu.com/tool/AIGCCheck/paperSubmit";
//文件路径文件存在不存在的话需要先下载下来 //文件路径文件存在不存在的话需要先下载下来
// String fileName = downloadpath+"/"+ zyInfoStudent.getFilePath(); // String fileName = downloadpath+"/"+ zyInfoStudent.getFilePath();
// if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) { // if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
// fileName = uploadpath+"/"+ zyInfoStudent.getFilePath(); // fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
// } // }
String fileName = uploadpath+"/"+ zyInfoStudent.getFilePath(); String fileName = uploadpath + "/" + zyInfoStudent.getFilePath();
Map<String, String> textMap = new HashMap<String, String>(); Map<String, String> textMap = new HashMap<String, String>();
//可以设置多个input的namevalue //可以设置多个input的namevalue
String sign = getSign(); String sign = getSign();
textMap.put("userid", weipuId); textMap.put("userid", weipuId);
textMap.put("sign", sign); textMap.put("sign", sign);
String titlePar =fileName.substring(fileName.lastIndexOf("/")+1,fileName.length()); String titlePar = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length());
String title = titlePar.split("_")[0]; String title = titlePar.split("_")[0];
textMap.put("title", title); textMap.put("title", title);
@ -631,18 +642,18 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
Map<String, String> fileMap = new HashMap<String, String>(); Map<String, String> fileMap = new HashMap<String, String>();
fileMap.put("file", fileName); fileMap.put("file", fileName);
String contentType = "";//image/png String contentType = "";//image/png
String ret = formUpload(url, textMap, fileMap,contentType); String ret = formUpload(url, textMap, fileMap, contentType);
log.info("aigc1-------->"+ret); log.info("aigc1-------->" + ret);
log.error("aigcSave:ret-------->"+ret); log.error("aigcSave:ret-------->" + ret);
JSONObject object= JSONObject.parseObject(ret); JSONObject object = JSONObject.parseObject(ret);
if("true".equals(object.getString("success"))){ if ("true".equals(object.getString("success"))) {
String listpaper = object.getString("listPaper"); String listpaper = object.getString("listPaper");
JSONArray jsonArray = (JSONArray) JSONArray.parse(listpaper); JSONArray jsonArray = (JSONArray) JSONArray.parse(listpaper);
JSONObject object2= jsonArray.getJSONObject(0); JSONObject object2 = jsonArray.getJSONObject(0);
String paperid = object2.getString("paperid"); String paperid = object2.getString("paperid");
log.info("2-------->"+paperid); log.info("2-------->" + paperid);
ZyCcjg zyCcjg = new ZyCcjg(); ZyCcjg zyCcjg = new ZyCcjg();
zyCcjg.setZyStuId(zyInfoStudent.getId()); zyCcjg.setZyStuId(zyInfoStudent.getId());
@ -653,8 +664,8 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
//提交后直接开始检测 //提交后直接开始检测
String message = aigcKsjc(zyCcjg); String message = aigcKsjc(zyCcjg);
log.info("21-------->"+message); log.info("21-------->" + message);
}else{ } else {
log.info("3-------->"); log.info("3-------->");
ZyCcjg zyCcjg = new ZyCcjg(); ZyCcjg zyCcjg = new ZyCcjg();
@ -680,23 +691,23 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
textMap.put("paperids", paperid);//资源id textMap.put("paperids", paperid);//资源id
String contentType = "";//image/png String contentType = "";//image/png
Map<String, String> fileMap = new HashMap<String, String>(); Map<String, String> fileMap = new HashMap<String, String>();
String ret = formUpload(url, textMap, fileMap,contentType); String ret = formUpload(url, textMap, fileMap, contentType);
JSONObject object= JSONObject.parseObject(ret); JSONObject object = JSONObject.parseObject(ret);
String message = object.getString("message"); String message = object.getString("message");
return message; return message;
} }
//小范围提交校园内网提交 //小范围提交校园内网提交
private void nwccSave(ZyInfoStudent zyInfoStudent,HttpServletResponse response) { private void nwccSave(ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
String url = "https://vims.fanyu.com/toole/smallcheck/submitData"; String url = "https://vims.fanyu.com/toole/smallcheck/submitData";
//文件路径文件存在不存在的话需要先下载下来 //文件路径文件存在不存在的话需要先下载下来
// String fileName = downloadpath+"/"+ zyInfoStudent.getFilePath(); // String fileName = downloadpath+"/"+ zyInfoStudent.getFilePath();
// if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) { // if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
// fileName = uploadpath+"/"+ zyInfoStudent.getFilePath(); // fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
// } // }
String fileName = uploadpath+"/"+ zyInfoStudent.getFilePath(); String fileName = uploadpath + "/" + zyInfoStudent.getFilePath();
Map<String, String> textMap = new HashMap<String, String>(); Map<String, String> textMap = new HashMap<String, String>();
String titlePar =fileName.substring(fileName.lastIndexOf("/")+1,fileName.length()); String titlePar = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length());
String title = titlePar.split("_")[0]; String title = titlePar.split("_")[0];
//可以设置多个input的namevalue //可以设置多个input的namevalue
String sign = getSign(); String sign = getSign();
@ -712,12 +723,12 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
Map<String, String> fileMap = new HashMap<String, String>(); Map<String, String> fileMap = new HashMap<String, String>();
fileMap.put("file", fileName); fileMap.put("file", fileName);
String contentType = "";//image/png String contentType = "";//image/png
String ret = formUpload(url, textMap, fileMap,contentType); String ret = formUpload(url, textMap, fileMap, contentType);
log.error("nwccSave:ret-------->"+ret); log.error("nwccSave:ret-------->" + ret);
JSONObject object= JSONObject.parseObject(ret); JSONObject object = JSONObject.parseObject(ret);
if("true".equals(object.getString("success"))){ if ("true".equals(object.getString("success"))) {
String listpaper = object.getString("datainfo"); String listpaper = object.getString("datainfo");
JSONObject object2= JSON.parseObject(listpaper); JSONObject object2 = JSON.parseObject(listpaper);
String dataid = object2.getString("dataid");//资源id 后续提交比对/删除文档会试用 String dataid = object2.getString("dataid");//资源id 后续提交比对/删除文档会试用
ZyCcjg zyCcjg = new ZyCcjg(); ZyCcjg zyCcjg = new ZyCcjg();
@ -729,9 +740,9 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
zyCcjgMapper.insert(zyCcjg); zyCcjgMapper.insert(zyCcjg);
//提交后直接开始检测 //提交后直接开始检测
String message = xfwbdKsjc(zyCcjg,"1"); String message = xfwbdKsjc(zyCcjg, "1");
log.info("21-------->"+message); log.info("21-------->" + message);
}else{ } else {
log.info("3-------->"); log.info("3-------->");
ZyCcjg zyCcjg = new ZyCcjg(); ZyCcjg zyCcjg = new ZyCcjg();
zyCcjg.setZyStuId(zyInfoStudent.getId()); zyCcjg.setZyStuId(zyInfoStudent.getId());
@ -743,16 +754,16 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
} }
//小范围提交校园内网提交 //小范围提交校园内网提交
private void xnccSave(ZyInfoStudent zyInfoStudent,String type,HttpServletResponse response) { private void xnccSave(ZyInfoStudent zyInfoStudent, String type, HttpServletResponse response) {
String url = "https://vims.fanyu.com/toole/smallcheck/submitData"; String url = "https://vims.fanyu.com/toole/smallcheck/submitData";
//文件路径文件存在不存在的话需要先下载下来 //文件路径文件存在不存在的话需要先下载下来
// String fileName = downloadpath+"/"+ zyInfoStudent.getFilePath(); // String fileName = downloadpath+"/"+ zyInfoStudent.getFilePath();
// if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) { // if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
// fileName = uploadpath+"/"+ zyInfoStudent.getFilePath(); // fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
// } // }
String fileName = uploadpath+"/"+ zyInfoStudent.getFilePath(); String fileName = uploadpath + "/" + zyInfoStudent.getFilePath();
Map<String, String> textMap = new HashMap<String, String>(); Map<String, String> textMap = new HashMap<String, String>();
String titlePar =fileName.substring(fileName.lastIndexOf("/")+1,fileName.length()); String titlePar = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length());
String title = titlePar.split("_")[0]; String title = titlePar.split("_")[0];
//可以设置多个input的namevalue //可以设置多个input的namevalue
String sign = getSign(); String sign = getSign();
@ -768,19 +779,19 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
Map<String, String> fileMap = new HashMap<String, String>(); Map<String, String> fileMap = new HashMap<String, String>();
fileMap.put("file", fileName); fileMap.put("file", fileName);
String contentType = "";//image/png String contentType = "";//image/png
log.info("url--->"+url); log.info("url--->" + url);
log.info("textMap--->"+textMap); log.info("textMap--->" + textMap);
log.info("fileMap--->"+fileMap); log.info("fileMap--->" + fileMap);
String ret = formUpload(url, textMap, fileMap,contentType); String ret = formUpload(url, textMap, fileMap, contentType);
log.error("xnccSave:ret-------->"+ret); log.error("xnccSave:ret-------->" + ret);
JSONObject object= JSONObject.parseObject(ret); JSONObject object = JSONObject.parseObject(ret);
if("true".equals(object.getString("success"))){ if ("true".equals(object.getString("success"))) {
String listpaper = object.getString("datainfo"); String listpaper = object.getString("datainfo");
JSONObject object2= JSON.parseObject(listpaper); JSONObject object2 = JSON.parseObject(listpaper);
String dataid = object2.getString("dataid");//资源id 后续提交比对/删除文档会试用 String dataid = object2.getString("dataid");//资源id 后续提交比对/删除文档会试用
//判断是否开始查重 1的时候进行查重0不查重 //判断是否开始查重 1的时候进行查重0不查重
if(StringUtils.equals("1",type)){ if (StringUtils.equals("1", type)) {
ZyCcjg zyCcjg = new ZyCcjg(); ZyCcjg zyCcjg = new ZyCcjg();
zyCcjg.setZyStuId(zyInfoStudent.getId()); zyCcjg.setZyStuId(zyInfoStudent.getId());
zyCcjg.setPaperid(dataid); zyCcjg.setPaperid(dataid);
@ -789,11 +800,11 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
zyCcjg.setBdkbs(zyInfoStudent.getCateid()); zyCcjg.setBdkbs(zyInfoStudent.getCateid());
zyCcjgMapper.insert(zyCcjg); zyCcjgMapper.insert(zyCcjg);
//提交后直接开始检测 //提交后直接开始检测
String message = xfwbdKsjc(zyCcjg,"0"); String message = xfwbdKsjc(zyCcjg, "0");
log.info("21-------->"+message); log.info("21-------->" + message);
} }
}else{ } else {
log.info("3-------->"); log.info("3-------->");
ZyCcjg zyCcjg = new ZyCcjg(); ZyCcjg zyCcjg = new ZyCcjg();
zyCcjg.setZyStuId(zyInfoStudent.getId()); zyCcjg.setZyStuId(zyInfoStudent.getId());
@ -807,24 +818,25 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
/** /**
* 主要用于教师发布评分后统一发往维普留存比对库 * 主要用于教师发布评分后统一发往维普留存比对库
*
* @param zyInfoStudent * @param zyInfoStudent
* @param type * @param type
* @param response * @param response
*/ */
private void xnccUpdate(ZyInfoStudent zyInfoStudent,String type,HttpServletResponse response) { private void xnccUpdate(ZyInfoStudent zyInfoStudent, String type, HttpServletResponse response) {
ZyCcjg zyCcjg = new ZyCcjg(); ZyCcjg zyCcjg = new ZyCcjg();
try { try {
QueryWrapper<ZyCcjg> zyCcjgQueryWrapper = new QueryWrapper<>(); QueryWrapper<ZyCcjg> zyCcjgQueryWrapper = new QueryWrapper<>();
zyCcjgQueryWrapper.eq("zy_stu_id",zyInfoStudent.getId()); zyCcjgQueryWrapper.eq("zy_stu_id", zyInfoStudent.getId());
zyCcjgQueryWrapper.eq("create_by",zyInfoStudent.getCreateBy()); zyCcjgQueryWrapper.eq("create_by", zyInfoStudent.getCreateBy());
zyCcjgQueryWrapper.eq("cc_type","3"); zyCcjgQueryWrapper.eq("cc_type", "3");
zyCcjg = zyCcjgMapper.selectOne(zyCcjgQueryWrapper); zyCcjg = zyCcjgMapper.selectOne(zyCcjgQueryWrapper);
if(zyCcjg.getPaperid() != null){ if (zyCcjg.getPaperid() != null) {
String dataids = zyCcjg.getPaperid(); String dataids = zyCcjg.getPaperid();
String bdkbs = zyCcjg.getBdkbs(); String bdkbs = zyCcjg.getBdkbs();
String url2 = "https://vims.fanyu.com/toole/smallcheck/delData"; String url2 = "https://vims.fanyu.com/toole/smallcheck/delData";
delXfwWpFile(url2,bdkbs,dataids, null); delXfwWpFile(url2, bdkbs, dataids, null);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -832,9 +844,9 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
String url = "https://vims.fanyu.com/toole/smallcheck/submitData"; String url = "https://vims.fanyu.com/toole/smallcheck/submitData";
//文件路径文件存在不存在的话需要先下载下来 //文件路径文件存在不存在的话需要先下载下来
String fileName = uploadpath+"/"+ zyInfoStudent.getFilePath(); String fileName = uploadpath + "/" + zyInfoStudent.getFilePath();
Map<String, String> textMap = new HashMap<String, String>(); Map<String, String> textMap = new HashMap<String, String>();
String titlePar =fileName.substring(fileName.lastIndexOf("/")+1,fileName.length()); String titlePar = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length());
String title = titlePar.split("_")[0]; String title = titlePar.split("_")[0];
//可以设置多个input的namevalue //可以设置多个input的namevalue
String sign = getSign(); String sign = getSign();
@ -850,15 +862,15 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
Map<String, String> fileMap = new HashMap<String, String>(); Map<String, String> fileMap = new HashMap<String, String>();
fileMap.put("file", fileName); fileMap.put("file", fileName);
String contentType = "";//image/png String contentType = "";//image/png
log.info("url--->"+url); log.info("url--->" + url);
log.info("textMap--->"+textMap); log.info("textMap--->" + textMap);
log.info("fileMap--->"+fileMap); log.info("fileMap--->" + fileMap);
String ret = formUpload(url, textMap, fileMap,contentType); String ret = formUpload(url, textMap, fileMap, contentType);
log.info("ret--->"+ret); log.info("ret--->" + ret);
JSONObject object= JSONObject.parseObject(ret); JSONObject object = JSONObject.parseObject(ret);
if("true".equals(object.getString("success"))){ if ("true".equals(object.getString("success"))) {
String listpaper = object.getString("datainfo"); String listpaper = object.getString("datainfo");
JSONObject object2= JSON.parseObject(listpaper); JSONObject object2 = JSON.parseObject(listpaper);
String dataid = object2.getString("dataid");//资源id 后续提交比对/删除文档会试用 String dataid = object2.getString("dataid");//资源id 后续提交比对/删除文档会试用
zyCcjg.setPaperid(dataid); zyCcjg.setPaperid(dataid);
zyCcjgMapper.updateById(zyCcjg); zyCcjgMapper.updateById(zyCcjg);
@ -866,7 +878,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
} }
//小范围对比开始检测 //小范围对比开始检测
public String xfwbdKsjc(ZyCcjg zyCcjg,String sfpj) { public String xfwbdKsjc(ZyCcjg zyCcjg, String sfpj) {
String url = "https://vims.fanyu.com/toole/smallcheck/beginCheck"; String url = "https://vims.fanyu.com/toole/smallcheck/beginCheck";
//文件路径文件存在不存在的话需要先下载下来 //文件路径文件存在不存在的话需要先下载下来
String paperid = zyCcjg.getPaperid(); String paperid = zyCcjg.getPaperid();
@ -880,14 +892,14 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
textMap.put("exclude", sfpj);//是否排已(1:排已, 0:不排已) textMap.put("exclude", sfpj);//是否排已(1:排已, 0:不排已)
String contentType = "";//image/png String contentType = "";//image/png
Map<String, String> fileMap = new HashMap<String, String>(); Map<String, String> fileMap = new HashMap<String, String>();
String ret = formUpload(url, textMap, fileMap,contentType); String ret = formUpload(url, textMap, fileMap, contentType);
JSONObject object= JSONObject.parseObject(ret); JSONObject object = JSONObject.parseObject(ret);
String message = object.getString("message"); String message = object.getString("message");
return message; return message;
} }
//外网查重提交方法 //外网查重提交方法
private String wwccSave(ZyInfoStudent zyInfoStudent,HttpServletResponse response) { private String wwccSave(ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String url = "https://vims.fanyu.com/toole/jianceorgan/papersubmit.aspx"; String url = "https://vims.fanyu.com/toole/jianceorgan/papersubmit.aspx";
//文件路径文件存在不存在的话需要先下载下来 //文件路径文件存在不存在的话需要先下载下来
@ -895,13 +907,13 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
// if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) { // if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
// fileName = uploadpath+"/"+ zyInfoStudent.getFilePath(); // fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
// } // }
String fileName = uploadpath+"/"+ zyInfoStudent.getFilePath(); String fileName = uploadpath + "/" + zyInfoStudent.getFilePath();
Map<String, String> textMap = new HashMap<String, String>(); Map<String, String> textMap = new HashMap<String, String>();
//可以设置多个input的namevalue //可以设置多个input的namevalue
String sign = getSign(); String sign = getSign();
textMap.put("sign", sign); textMap.put("sign", sign);
textMap.put("userid", weipuId); textMap.put("userid", weipuId);
String titlePar =fileName.substring(fileName.lastIndexOf("/")+1,fileName.length()); String titlePar = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length());
String title = titlePar.split("_")[0]; String title = titlePar.split("_")[0];
textMap.put("title", title); textMap.put("title", title);
textMap.put("number", sysUser.getUsername()); textMap.put("number", sysUser.getUsername());
@ -920,9 +932,9 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
if("true".equals(object.getString("success"))){ if("true".equals(object.getString("success"))){
String listpaper = object.getString("listpaper"); String listpaper = object.getString("listpaper");
JSONArray jsonArray = (JSONArray) JSONArray.parse(listpaper); JSONArray jsonArray = (JSONArray) JSONArray.parse(listpaper);
JSONObject object2= jsonArray.getJSONObject(0); JSONObject object2 = jsonArray.getJSONObject(0);
String paperid = object2.getString("paperid"); String paperid = object2.getString("paperid");
log.info("2-------->"+paperid); log.info("2-------->" + paperid);
ZyCcjg zyCcjg = new ZyCcjg(); ZyCcjg zyCcjg = new ZyCcjg();
zyCcjg.setZyStuId(zyInfoStudent.getId()); zyCcjg.setZyStuId(zyInfoStudent.getId());
zyCcjg.setPaperid(paperid); zyCcjg.setPaperid(paperid);
@ -931,9 +943,9 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
zyCcjgMapper.insert(zyCcjg); zyCcjgMapper.insert(zyCcjg);
//提交后直接开始检测 //提交后直接开始检测
String message = wwKsjc(zyCcjg); String message = wwKsjc(zyCcjg);
log.info("21-------->"+message); log.info("21-------->" + message);
return message; return message;
}else{ } else {
log.info("3-------->"); log.info("3-------->");
ZyCcjg zyCcjg = new ZyCcjg(); ZyCcjg zyCcjg = new ZyCcjg();
zyCcjg.setZyStuId(zyInfoStudent.getId()); zyCcjg.setZyStuId(zyInfoStudent.getId());
@ -958,31 +970,31 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
textMap.put("paperids", paperid);//资源id textMap.put("paperids", paperid);//资源id
String contentType = "";//image/png String contentType = "";//image/png
Map<String, String> fileMap = new HashMap<String, String>(); Map<String, String> fileMap = new HashMap<String, String>();
String ret = formUpload(url, textMap, fileMap,contentType); String ret = formUpload(url, textMap, fileMap, contentType);
JSONObject object= JSONObject.parseObject(ret); JSONObject object = JSONObject.parseObject(ret);
String message = object.getString("message"); String message = object.getString("message");
return message; return message;
} }
private String getFileName(String imgPath, HttpServletResponse response){ private String getFileName(String imgPath, HttpServletResponse response) {
String fileName = ""; String fileName = "";
if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) { if (CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
fileName = imgPath; fileName = imgPath;
log.info("1111111111111111----------->"); log.info("1111111111111111----------->");
}else if(CommonConstant.UPLOAD_TYPE_SFTP.equals(uploadType)){ } else if (CommonConstant.UPLOAD_TYPE_SFTP.equals(uploadType)) {
log.info("22222222222222----------->"); log.info("22222222222222----------->");
InputStream inputStream = null; InputStream inputStream = null;
OutputStream outputStream = null; OutputStream outputStream = null;
try{ try {
int index = imgPath.lastIndexOf("/"); int index = imgPath.lastIndexOf("/");
String path = "temp"; String path = "temp";
if(index != -1){ if (index != -1) {
path = imgPath.substring(0,index); path = imgPath.substring(0, index);
} }
log.info("path----------->"+path); log.info("path----------->" + path);
Map<String,String> map = SFTPUtil.download(sftpConfig,imgPath,getDownloadPath(path)); Map<String, String> map = SFTPUtil.download(sftpConfig, imgPath, getDownloadPath(path));
log.info("map----------->"+map); log.info("map----------->" + map);
// if(!map.get("code").equals("0")){ // if(!map.get("code").equals("0")){
// response.setStatus(404); // response.setStatus(404);
//// throw new RuntimeException(map.get("msg")); //// throw new RuntimeException(map.get("msg"));
@ -1006,11 +1018,11 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
// } // }
// response.flushBuffer(); // response.flushBuffer();
fileName = localFilePath; fileName = localFilePath;
log.info("fileName----------->"+fileName); log.info("fileName----------->" + fileName);
}catch (Exception e){ } catch (Exception e) {
log.info("catch----------->"+e); log.info("catch----------->" + e);
// e.printStackTrace(); // e.printStackTrace();
}finally { } finally {
SFTPUtil.disChannel(); SFTPUtil.disChannel();
SFTPUtil.disSession(); SFTPUtil.disSession();
if (inputStream != null) { if (inputStream != null) {
@ -1028,12 +1040,13 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
} }
} }
} }
}else{ } else {
log.info("333333333333333----------->"); log.info("333333333333333----------->");
} }
return fileName; return fileName;
} }
private String delWpFile(String url,String paperids,HttpServletResponse response) {
private String delWpFile(String url, String paperids, HttpServletResponse response) {
// String url = "https://vims.fanyu.com/toole/jianceorgan/paperdel.aspx"; // String url = "https://vims.fanyu.com/toole/jianceorgan/paperdel.aspx";
Map<String, String> textMap = new HashMap<String, String>(); Map<String, String> textMap = new HashMap<String, String>();
//可以设置多个input的namevalue //可以设置多个input的namevalue
@ -1042,18 +1055,19 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
textMap.put("userid", weipuId); textMap.put("userid", weipuId);
textMap.put("paperids", paperids);//文档paperid集合,多个请用英文逗号隔开 textMap.put("paperids", paperids);//文档paperid集合,多个请用英文逗号隔开
String contentType = "";//image/png String contentType = "";//image/png
String ret = formUpload(url, textMap, null,contentType); String ret = formUpload(url, textMap, null, contentType);
log.error("1-------->"+ret); log.error("1-------->" + ret);
JSONObject object= JSONObject.parseObject(ret); JSONObject object = JSONObject.parseObject(ret);
if("true".equals(object.getString("success"))){ if ("true".equals(object.getString("success"))) {
String message = object.getString("message"); String message = object.getString("message");
log.info("2-------->"+message); log.info("2-------->" + message);
return "success"; return "success";
}else{ } else {
return "false"; return "false";
} }
} }
private String delXfwWpFile(String url,String cateid,String paperids,HttpServletResponse response) {
private String delXfwWpFile(String url, String cateid, String paperids, HttpServletResponse response) {
// String url = "https://vims.fanyu.com/toole/jianceorgan/paperdel.aspx"; // String url = "https://vims.fanyu.com/toole/jianceorgan/paperdel.aspx";
Map<String, String> textMap = new HashMap<String, String>(); Map<String, String> textMap = new HashMap<String, String>();
//可以设置多个input的namevalue //可以设置多个input的namevalue
@ -1063,31 +1077,33 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
textMap.put("cateid", cateid); textMap.put("cateid", cateid);
textMap.put("dataid", paperids);//文档paperid集合,多个请用英文逗号隔开 textMap.put("dataid", paperids);//文档paperid集合,多个请用英文逗号隔开
String contentType = "";//image/png String contentType = "";//image/png
String ret = formUpload(url, textMap, null,contentType); String ret = formUpload(url, textMap, null, contentType);
log.error("1-------->"+ret); log.error("1-------->" + ret);
JSONObject object= JSONObject.parseObject(ret); JSONObject object = JSONObject.parseObject(ret);
if("true".equals(object.getString("success"))){ if ("true".equals(object.getString("success"))) {
String message = object.getString("message"); String message = object.getString("message");
log.info("2-------->"+message); log.info("2-------->" + message);
return "success"; return "success";
}else{ } else {
return "false"; return "false";
} }
} }
/** /**
* 获取文件真实路径 * 获取文件真实路径
*
* @param path * @param path
* @return * @return
*/ */
private String getDownloadPath(String path){ private String getDownloadPath(String path) {
String filePath = ""; String filePath = "";
if(org.jeecg.common.util.text.StringUtils.isEmpty(path)){ if (org.jeecg.common.util.text.StringUtils.isEmpty(path)) {
return ""; return "";
} }
int idx = path.indexOf(downloadpath); int idx = path.indexOf(downloadpath);
if(idx==-1){ if (idx == -1) {
filePath = downloadpath + File.separator + path; filePath = downloadpath + File.separator + path;
}else{ } else {
filePath = path; filePath = path;
} }
return filePath; return filePath;
@ -1099,14 +1115,14 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
String userid = weipuId; String userid = weipuId;
String key = weipuKey; String key = weipuKey;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH");
String time = sdf.format( new Date()); String time = sdf.format(new Date());
String md5Text = userid + key + time; String md5Text = userid + key + time;
String sign = org.springframework.util.DigestUtils.md5DigestAsHex((md5Text).getBytes()).toLowerCase(); String sign = org.springframework.util.DigestUtils.md5DigestAsHex((md5Text).getBytes()).toLowerCase();
return sign; return sign;
} }
//推送轻求 //推送轻求
public static String formUpload(String urlStr, Map<String, String> textMap, Map<String, String> fileMap,String contentType) { public static String formUpload(String urlStr, Map<String, String> textMap, Map<String, String> fileMap, String contentType) {
String res = ""; String res = "";
HttpURLConnection conn = null; HttpURLConnection conn = null;
// boundary就是request头和上传文件内容的分隔符 // boundary就是request头和上传文件内容的分隔符
@ -1121,7 +1137,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
conn.setUseCaches(false); conn.setUseCaches(false);
conn.setRequestMethod("POST"); conn.setRequestMethod("POST");
conn.setRequestProperty("Connection", "Keep-Alive"); conn.setRequestProperty("Connection", "Keep-Alive");
conn.setRequestProperty("Content-Type","multipart/form-data; boundary=" + BOUNDARY); conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
OutputStream out = new DataOutputStream(conn.getOutputStream()); OutputStream out = new DataOutputStream(conn.getOutputStream());
// text // text
if (textMap != null) { if (textMap != null) {
@ -1156,14 +1172,14 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
//没有传入文件类型同时根据文件获取不到类型默认采用application/octet-stream //没有传入文件类型同时根据文件获取不到类型默认采用application/octet-stream
contentType = new MimetypesFileTypeMap().getContentType(file); contentType = new MimetypesFileTypeMap().getContentType(file);
//contentType非空采用filename匹配默认的图片类型 //contentType非空采用filename匹配默认的图片类型
if(!"".equals(contentType)){ if (!"".equals(contentType)) {
if (filename.endsWith(".png")) { if (filename.endsWith(".png")) {
contentType = "image/png"; contentType = "image/png";
}else if (filename.endsWith(".jpg") || filename.endsWith(".jpeg") || filename.endsWith(".jpe")) { } else if (filename.endsWith(".jpg") || filename.endsWith(".jpeg") || filename.endsWith(".jpe")) {
contentType = "image/jpeg"; contentType = "image/jpeg";
}else if (filename.endsWith(".gif")) { } else if (filename.endsWith(".gif")) {
contentType = "image/gif"; contentType = "image/gif";
}else if (filename.endsWith(".ico")) { } else if (filename.endsWith(".ico")) {
contentType = "image/image/x-icon"; contentType = "image/image/x-icon";
} }
} }
@ -1239,7 +1255,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
// 1xx老师你好您本学期2023秋听课要求为5次当前实际听课次数3次请尽快完成本学期的听课任务 // 1xx老师你好您本学期2023秋听课要求为5次当前实际听课次数3次请尽快完成本学期的听课任务
String html = kcWechatSendLog.getYtkcs(); String html = kcWechatSendLog.getYtkcs();
html = html ; html = html;
sendMag.put("content", html);//授课老师推送内容 sendMag.put("content", html);//授课老师推送内容
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
//拼接base参数 //拼接base参数

View File

@ -129,7 +129,9 @@ public class LoginController {
//2. 校验用户名或密码是否正确 //2. 校验用户名或密码是否正确
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt()); String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
String syspassword = sysUser.getPassword(); String syspassword = sysUser.getPassword();
if (!syspassword.equals(userpassword)) { //TODO admin账号 忘记密码就把下面的判断条件改为false
if (1==2) {
// if (!syspassword.equals(userpassword)) {
//update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户 //update-begin-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
addLoginFailOvertimes(username); addLoginFailOvertimes(username);
//update-end-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户 //update-end-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户

View File

@ -133,7 +133,8 @@ spring:
strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
datasource: datasource:
master: master:
url: jdbc:mysql://127.0.0.1:3306/course_information_center_jeecg_db?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai # url: jdbc:mysql://127.0.0.1:3306/course_information_center_jeecg_db?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://127.0.0.1:3306/course_information_center_jeecg_db?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
# url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai # url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root username: root
password: root password: root