parent
7deb4d868c
commit
48543190cb
|
@ -12,7 +12,6 @@ import org.jeecg.common.api.vo.Result;
|
|||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.modules.kc.grab.exports.entity.TBks;
|
||||
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
|
||||
import org.jeecg.modules.kc.grab.imports.service.IXxhbbksService;
|
||||
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.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Description: 同步数据表(bks)
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-04-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="同步数据表(bks)")
|
||||
@Api(tags = "同步数据表(bks)")
|
||||
@RestController
|
||||
@RequestMapping("/grab/xxhbbks")
|
||||
@Slf4j
|
||||
|
@ -47,11 +47,11 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "同步数据表(bks)-分页列表查询")
|
||||
@ApiOperation(value="同步数据表(bks)-分页列表查询", notes="同步数据表(bks)-分页列表查询")
|
||||
@ApiOperation(value = "同步数据表(bks)-分页列表查询", notes = "同步数据表(bks)-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<Xxhbbks>> queryPageList(Xxhbbks xxhbbks,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<Xxhbbks> queryWrapper = QueryGenerator.initQueryWrapper(xxhbbks, req.getParameterMap());
|
||||
Page<Xxhbbks> page = new Page<Xxhbbks>(pageNo, pageSize);
|
||||
|
@ -66,7 +66,7 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-添加")
|
||||
@ApiOperation(value="同步数据表(bks)-添加", notes="同步数据表(bks)-添加")
|
||||
@ApiOperation(value = "同步数据表(bks)-添加", notes = "同步数据表(bks)-添加")
|
||||
@RequiresPermissions("grab:xxhbbks:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody Xxhbbks xxhbbks) {
|
||||
|
@ -81,9 +81,9 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-编辑")
|
||||
@ApiOperation(value="同步数据表(bks)-编辑", notes="同步数据表(bks)-编辑")
|
||||
@ApiOperation(value = "同步数据表(bks)-编辑", notes = "同步数据表(bks)-编辑")
|
||||
@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) {
|
||||
xxhbbksService.updateById(xxhbbks);
|
||||
return Result.OK("编辑成功!");
|
||||
|
@ -96,10 +96,10 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-通过id删除")
|
||||
@ApiOperation(value="同步数据表(bks)-通过id删除", notes="同步数据表(bks)-通过id删除")
|
||||
@ApiOperation(value = "同步数据表(bks)-通过id删除", notes = "同步数据表(bks)-通过id删除")
|
||||
@RequiresPermissions("grab:xxhbbks: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);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
@ -111,10 +111,10 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-批量删除")
|
||||
@ApiOperation(value="同步数据表(bks)-批量删除", notes="同步数据表(bks)-批量删除")
|
||||
@ApiOperation(value = "同步数据表(bks)-批量删除", notes = "同步数据表(bks)-批量删除")
|
||||
@RequiresPermissions("grab:xxhbbks: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(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
@ -126,11 +126,11 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "同步数据表(bks)-通过id查询")
|
||||
@ApiOperation(value="同步数据表(bks)-通过id查询", notes="同步数据表(bks)-通过id查询")
|
||||
@ApiOperation(value = "同步数据表(bks)-通过id查询", notes = "同步数据表(bks)-通过id查询")
|
||||
@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);
|
||||
if(xxhbbks==null) {
|
||||
if (xxhbbks == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(xxhbbks);
|
||||
|
@ -162,20 +162,30 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
|
|||
}
|
||||
|
||||
|
||||
|
||||
@AutoLog(value = "获取本科生选课人员信息")
|
||||
@ApiOperation(value="获取本科生选课人员信息", notes="获取本科生选课人员信息")
|
||||
@ApiOperation(value = "获取本科生选课人员信息", notes = "获取本科生选课人员信息")
|
||||
@GetMapping(value = "/getXsxkbList")
|
||||
public Result<?> getXsxkbList(Xxhbbks xxhbbks,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<Xxhbbks> queryWrapper = QueryGenerator.initQueryWrapper(xxhbbks, req.getParameterMap());
|
||||
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);
|
||||
IPage<Xxhbbks> pageList = xxhbbksService.getXsxkbList(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取选课人员
|
||||
* @param rwbh 任务编号
|
||||
*
|
||||
* 获取任务编号下的所有选课人员
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/getXKRY")
|
||||
public Result<List<Xxhbbks>> getXKRY(@RequestBody String rwbh) {
|
||||
return Result.OK(xxhbbksService.getXKRY(rwbh));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,4 +23,6 @@ public interface XxhbbksMapper extends BaseMapper<Xxhbbks> {
|
|||
IPage<Xxhbbks> getXsxkbList(Page<Xxhbbks> page,@Param(Constants.WRAPPER) QueryWrapper<Xxhbbks> queryWrapper);
|
||||
|
||||
List<Xxhbbks> getXsxkbAllList(@Param(Constants.WRAPPER) QueryWrapper<Xxhbbks> queryWrapper);
|
||||
|
||||
List<Xxhbbks> getXKRY(@Param("rwbh") String rwbh);
|
||||
}
|
||||
|
|
|
@ -18,4 +18,11 @@
|
|||
select a.* from xxhbbks a ,xxhbxsxkb b
|
||||
${ew.customSqlSegment}
|
||||
</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>
|
|
@ -37,4 +37,6 @@ public interface IXxhbbksService extends IService<Xxhbbks> {
|
|||
IPage<Xxhbbks> getXsxkbList(Page<Xxhbbks> page, QueryWrapper<Xxhbbks> queryWrapper);
|
||||
|
||||
List<Xxhbbks> getXsxkbAllList(QueryWrapper<Xxhbbks> queryWrapper);
|
||||
|
||||
List<Xxhbbks> getXKRY(String rwbh);
|
||||
}
|
||||
|
|
|
@ -52,4 +52,9 @@ public class XxhbbksServiceImpl extends ServiceImpl<XxhbbksMapper, Xxhbbks> impl
|
|||
public List<Xxhbbks> getXsxkbAllList(QueryWrapper<Xxhbbks> queryWrapper) {
|
||||
return baseMapper.getXsxkbAllList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Xxhbbks> getXKRY(String rwbh) {
|
||||
return baseMapper.getXKRY(rwbh);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -353,4 +353,9 @@ public class WjxDjxxController extends JeecgController<WjxDjxx, IWjxDjxxService>
|
|||
return Result.OK(res);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/upZbcs")
|
||||
public Result<Integer> upZbcs(@RequestBody WjxDjxx wjxDjxx) {
|
||||
return Result.OK(wjxDjxxService.upZbcs(wjxDjxx));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -130,4 +130,6 @@ public class WjxDjxx {
|
|||
@TableField(exist = false)
|
||||
private String isFinished;
|
||||
|
||||
@ApiModelProperty(value = "作弊次数(单次考试作弊行为发生总次数)")
|
||||
private int zbcs;
|
||||
}
|
||||
|
|
|
@ -72,4 +72,6 @@ public interface WjxDjxxMapper extends BaseMapper<WjxDjxx> {
|
|||
|
||||
|
||||
void updateDjxxTmxxFwqpath(WjxDjxxTmxx wjxDjxxTmxx);
|
||||
|
||||
int upZbcs(@Param("dto") WjxDjxx wjxDjxx);
|
||||
}
|
||||
|
|
|
@ -439,6 +439,12 @@
|
|||
where jid = #{jid}
|
||||
</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 * from wjx_djxx_tmxx where vid = #{wjxDjxxTmxx.vid} and jid = #{wjxDjxxTmxx.jid} and wj_index = #{wjxDjxxTmxx.wjIndex} and item_index = #{wjxDjxxTmxx.itemIndex}
|
||||
|
|
|
@ -47,4 +47,6 @@ public interface IWjxDjxxService extends IService<WjxDjxx> {
|
|||
String updateDjjg(WjxDjxx wjxDjxx);
|
||||
|
||||
String getDjjg(WjxDjxx wjxDjxx);
|
||||
|
||||
int upZbcs(WjxDjxx wjxDjxx);
|
||||
}
|
||||
|
|
|
@ -55,23 +55,24 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
|
||||
/**
|
||||
* 提交问卷,并查询答卷
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
public String djtj(List<WjxDjxxTmlbPage> list){
|
||||
public String djtj(List<WjxDjxxTmlbPage> list) {
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String vid = list.get(0).getVid();
|
||||
if(vid==null || vid.equals("")){
|
||||
if (vid == null || vid.equals("")) {
|
||||
String mainId = list.get(0).getMainId();
|
||||
vid = baseMapper.findVid(mainId);
|
||||
}
|
||||
if(vid ==null || vid.equals("")){
|
||||
if (vid == null || vid.equals("")) {
|
||||
return "此试卷错误,无法提交!";
|
||||
}
|
||||
Date date = new Date();
|
||||
Date openTime = list.get(0).getOpenTime();
|
||||
if(openTime == null){
|
||||
if (openTime == null) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.add(Calendar.MINUTE,-2);
|
||||
c.add(Calendar.MINUTE, -2);
|
||||
openTime = c.getTime();
|
||||
}
|
||||
WjxDjxx wds = new WjxDjxx();
|
||||
|
@ -83,29 +84,29 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
wds.setCreateBy(user.getUsername());
|
||||
wds.setCreateTime(date);
|
||||
StringBuffer submitDataSb = new StringBuffer();
|
||||
for(WjxDjxxTmlbPage wjxDjxxTmlbPage:list){
|
||||
for (WjxDjxxTmlbPage wjxDjxxTmlbPage : list) {
|
||||
Integer WjIndex = wjxDjxxTmlbPage.getWjIndex();
|
||||
Integer wjType = wjxDjxxTmlbPage.getWjType();
|
||||
Integer wjSubtype = wjxDjxxTmlbPage.getWjSubtype();
|
||||
String itemSelected = "";
|
||||
if(wjType == 3 || wjType == 4){
|
||||
itemSelected = wjxDjxxTmlbPage.getItemSelected().replaceAll(",","|").trim();
|
||||
if(itemSelected == null || itemSelected.equals("null") || itemSelected.equals("")){
|
||||
if (wjType == 3 || wjType == 4) {
|
||||
itemSelected = wjxDjxxTmlbPage.getItemSelected().replaceAll(",", "|").trim();
|
||||
if (itemSelected == null || itemSelected.equals("null") || itemSelected.equals("")) {
|
||||
itemSelected = "-3";
|
||||
}
|
||||
}
|
||||
if(wjType == 5){
|
||||
if (wjType == 5) {
|
||||
itemSelected = wjxDjxxTmlbPage.getWjAnswer();
|
||||
if(itemSelected == null || itemSelected.equals("null") || itemSelected.equals("")){
|
||||
if (itemSelected == null || itemSelected.equals("null") || itemSelected.equals("")) {
|
||||
itemSelected = "(跳过)";
|
||||
}
|
||||
if(wjSubtype!= null ){
|
||||
if(wjSubtype==5){
|
||||
if (wjSubtype != null) {
|
||||
if (wjSubtype == 5) {
|
||||
itemSelected = "(跳过)";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(wjType == 8){
|
||||
if (wjType == 8) {
|
||||
itemSelected = "-3";
|
||||
}
|
||||
submitDataSb.append(WjIndex);
|
||||
|
@ -114,49 +115,49 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
submitDataSb.append("}");
|
||||
}
|
||||
String submitData = submitDataSb.toString();
|
||||
if(StringUtils.isNotEmpty(submitData)){
|
||||
submitData = submitData.substring(0,submitData.length()-1);
|
||||
if (StringUtils.isNotEmpty(submitData)) {
|
||||
submitData = submitData.substring(0, submitData.length() - 1);
|
||||
}
|
||||
wds.setSubmitData(submitData);
|
||||
baseMapper.deleteDj(wds);
|
||||
this.save(wds);
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("vid",Integer.valueOf(vid));
|
||||
Long djys = ChronoUnit.SECONDS.between(wds.getOpenTime().toInstant(),wds.getCommitTime().toInstant());
|
||||
if(djys<3){
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("vid", Integer.valueOf(vid));
|
||||
Long djys = ChronoUnit.SECONDS.between(wds.getOpenTime().toInstant(), wds.getCommitTime().toInstant());
|
||||
if (djys < 3) {
|
||||
djys = 10L;
|
||||
}
|
||||
System.out.println("--------------------------------------------------");
|
||||
System.out.println("---------------djys--"+djys+"---------------------------");
|
||||
System.out.println("---------------djys--" + djys + "---------------------------");
|
||||
System.out.println("--------------------------------------------------");
|
||||
map.put("inputcosttime", djys);
|
||||
map.put("submitdata",submitData);
|
||||
map.put("sojumpparm",user.getUsername());//自定义链接参数,用来透传用户ID
|
||||
map.put("submitdata", submitData);
|
||||
map.put("sojumpparm", user.getUsername());//自定义链接参数,用来透传用户ID
|
||||
//调用接口,提交
|
||||
String result = wjxUtil.openapi(map,"1001001");
|
||||
String result = wjxUtil.openapi(map, "1001001");
|
||||
String jidRes = "";
|
||||
if(!result.equals("")){
|
||||
if (!result.equals("")) {
|
||||
JSONObject jsonResult = JSONObject.parseObject(result);
|
||||
if(jsonResult.getBoolean("result")){
|
||||
if (jsonResult.getBoolean("result")) {
|
||||
JSONObject dataJson = jsonResult.getJSONObject("data");
|
||||
String vidRes = dataJson.getString("vid");
|
||||
jidRes = dataJson.getString("jid");
|
||||
String sojumpparmRes = dataJson.getString("sojumpparm");
|
||||
baseMapper.updateJid(sojumpparmRes,vidRes,jidRes);
|
||||
baseMapper.updateJid(sojumpparmRes, vidRes, jidRes);
|
||||
//调用接口,答卷查询
|
||||
Map<String,Object> selMap = new HashMap<>();
|
||||
selMap.put("vid",Integer.valueOf(vid));
|
||||
selMap.put("jid",Long.valueOf(jidRes));
|
||||
Map<String, Object> selMap = new HashMap<>();
|
||||
selMap.put("vid", Integer.valueOf(vid));
|
||||
selMap.put("jid", Long.valueOf(jidRes));
|
||||
//调用接口,查询答卷结果
|
||||
String answerStr = wjxUtil.openapi(selMap,"1001002");
|
||||
if(!answerStr.equals("")){
|
||||
String answerStr = wjxUtil.openapi(selMap, "1001002");
|
||||
if (!answerStr.equals("")) {
|
||||
JSONObject ansJsonResult = JSONObject.parseObject(answerStr);
|
||||
if(ansJsonResult.getBoolean("result")){
|
||||
if (ansJsonResult.getBoolean("result")) {
|
||||
JSONObject ansDataJson = ansJsonResult.getJSONObject("data");
|
||||
String answerVid = ansDataJson.getString("vid");
|
||||
JSONObject answerJsonArray = ansDataJson.getJSONObject("answers");
|
||||
for(String key1 : answerJsonArray.keySet()){
|
||||
for (String key1 : answerJsonArray.keySet()) {
|
||||
JSONObject answer = answerJsonArray.getJSONObject(key1);
|
||||
String jidAns = answer.getString("jid");
|
||||
Integer answerSeconds = answer.getInteger("answer_seconds");
|
||||
|
@ -172,7 +173,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
baseMapper.deleteDjItem(wjxDjxx);
|
||||
//处理选项
|
||||
JSONObject answerItemJson = answer.getJSONObject("answer_items");
|
||||
if(answerItemJson!=null) {
|
||||
if (answerItemJson != null) {
|
||||
for (String key2 : answerItemJson.keySet()) {
|
||||
JSONObject answerItem = answerItemJson.getJSONObject(key2);
|
||||
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
|
||||
|
@ -272,27 +273,25 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
//修改答卷信息
|
||||
baseMapper.updateAnswer(wjxDjxx);
|
||||
}
|
||||
}else{
|
||||
baseMapper.updateErrMsg(user.getUsername(),vid,ansJsonResult.getString("errormsg"));
|
||||
} else {
|
||||
baseMapper.updateErrMsg(user.getUsername(), vid, ansJsonResult.getString("errormsg"));
|
||||
return ansJsonResult.getString("errormsg");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
baseMapper.updateErrMsg(user.getUsername(),vid,jsonResult.getString("errormsg"));
|
||||
} else {
|
||||
baseMapper.updateErrMsg(user.getUsername(), vid, jsonResult.getString("errormsg"));
|
||||
return jsonResult.getString("errormsg");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
String sfxgdjscore = "0";//是否修改答卷分数
|
||||
if(StringUtils.isNotBlank(jidRes)){
|
||||
for(WjxDjxxTmlbPage wjxDjxxTmlbPage:list){
|
||||
if (StringUtils.isNotBlank(jidRes)) {
|
||||
for (WjxDjxxTmlbPage wjxDjxxTmlbPage : list) {
|
||||
Integer WjIndex = wjxDjxxTmlbPage.getWjIndex();
|
||||
Integer wjType = wjxDjxxTmlbPage.getWjType();
|
||||
Integer wjSubtype = wjxDjxxTmlbPage.getWjSubtype();
|
||||
if(wjType == 8){
|
||||
if (wjType == 8) {
|
||||
sfxgdjscore = "1";
|
||||
String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString();
|
||||
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
|
||||
|
@ -308,7 +307,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
// wjxDjxxTmxx.setItemScore(wjxDjxxTmlbPage.getWjScore());
|
||||
wjxDjxxTmxx.setPicPath(wjxDjxxTmlbPage.getPicPath());
|
||||
baseMapper.addDjTmxx(wjxDjxxTmxx);
|
||||
}else if(wjType==5&&wjSubtype!=null && wjSubtype == 5){
|
||||
} else if (wjType == 5 && wjSubtype != null && wjSubtype == 5) {
|
||||
sfxgdjscore = "1";
|
||||
String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString();
|
||||
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 {
|
||||
WjxDjxx wjxDjxx = new WjxDjxx();
|
||||
wjxDjxx.setVid(vid);
|
||||
|
@ -346,29 +345,29 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
//修改问卷状态
|
||||
|
||||
QueryWrapper<WjxWjxx> wjxWjxxQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxQueryWrapper.eq("vid",vid);
|
||||
wjxWjxxQueryWrapper.eq("vid", vid);
|
||||
wjxWjxxQueryWrapper.last("limit 1");
|
||||
WjxWjxx wjxWjxx = wjxWjxxMapper.selectOne(wjxWjxxQueryWrapper);
|
||||
int xkrs = Integer.parseInt(wjxWjxx.getXkrs());
|
||||
|
||||
QueryWrapper<WjxDjxx> djxxQueryWrapper = new QueryWrapper<>();
|
||||
djxxQueryWrapper.eq("vid",vid);
|
||||
djxxQueryWrapper.eq("vid", vid);
|
||||
List<WjxDjxx> listNum = baseMapper.selectList(djxxQueryWrapper);
|
||||
int djsl = listNum.size();
|
||||
System.out.println(xkrs+"------------------------"+djsl);
|
||||
if(xkrs == djsl){
|
||||
System.out.println(xkrs + "------------------------" + djsl);
|
||||
if (xkrs == djsl) {
|
||||
wjxWjxx.setQpublish("2");
|
||||
wjxWjxxMapper.updateById(wjxWjxx);
|
||||
}
|
||||
String type = "";
|
||||
String content = "";
|
||||
if(StringUtils.equals("6",wjxWjxx.getAtype())){
|
||||
if (StringUtils.equals("6", wjxWjxx.getAtype())) {
|
||||
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";
|
||||
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();
|
||||
|
@ -382,74 +381,72 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
zyDbtxService.save(zyDbtx);
|
||||
|
||||
|
||||
|
||||
UpdateWrapper<ZyDbtx> zyDbtxQx = new UpdateWrapper<>();
|
||||
zyDbtxQx.set("flag","1");
|
||||
zyDbtxQx.eq("main_id",wjxWjxx.getId());
|
||||
zyDbtxQx.eq("create_by",user.getUsername());
|
||||
zyDbtxQx.eq("type","2");
|
||||
zyDbtxQx.set("flag", "1");
|
||||
zyDbtxQx.eq("main_id", wjxWjxx.getId());
|
||||
zyDbtxQx.eq("create_by", user.getUsername());
|
||||
zyDbtxQx.eq("type", "2");
|
||||
zyDbtxService.update(zyDbtxQx);
|
||||
|
||||
|
||||
try {
|
||||
if(StringUtils.isNotBlank(jidRes)){
|
||||
if (StringUtils.isNotBlank(jidRes)) {
|
||||
jsscore(jidRes);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
|
||||
return "提交成功!";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取未进行答卷查询操作的数据,如数据未提交问卷操作则先提交问卷,再查询答卷
|
||||
*/
|
||||
public void doDjSelect(){
|
||||
public void doDjSelect() {
|
||||
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);
|
||||
String jid = wjxDjxx.getJid();
|
||||
String vid = wjxDjxx.getVid();
|
||||
String userId = wjxDjxx.getUserId();
|
||||
if(jid== null || jid.equals("")){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("vid",Integer.valueOf(wjxDjxx.getVid()));
|
||||
map.put("inputcosttime",ChronoUnit.SECONDS.between(wjxDjxx.getOpenTime().toInstant(),wjxDjxx.getCommitTime().toInstant()));
|
||||
map.put("submitdata",wjxDjxx.getSubmitData());
|
||||
map.put("sojumpparm",wjxDjxx.getUserId());//自定义链接参数,用来透传用户ID
|
||||
if (jid == null || jid.equals("")) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("vid", Integer.valueOf(wjxDjxx.getVid()));
|
||||
map.put("inputcosttime", ChronoUnit.SECONDS.between(wjxDjxx.getOpenTime().toInstant(), wjxDjxx.getCommitTime().toInstant()));
|
||||
map.put("submitdata", wjxDjxx.getSubmitData());
|
||||
map.put("sojumpparm", wjxDjxx.getUserId());//自定义链接参数,用来透传用户ID
|
||||
//调用接口,提交
|
||||
String result = wjxUtil.openapi(map,"1001001");
|
||||
if(!result.equals("")) {
|
||||
String result = wjxUtil.openapi(map, "1001001");
|
||||
if (!result.equals("")) {
|
||||
JSONObject jsonResult = JSONObject.parseObject(result);
|
||||
if (jsonResult.getBoolean("result")) {
|
||||
JSONObject dataJson = jsonResult.getJSONObject("data");
|
||||
String vidRes = dataJson.getString("vid");
|
||||
jid = dataJson.getString("jid");
|
||||
String sojumpparmRes = dataJson.getString("sojumpparm");
|
||||
baseMapper.updateJid(sojumpparmRes,vidRes,jid);
|
||||
baseMapper.updateJid(sojumpparmRes, vidRes, jid);
|
||||
wjxDjxx.setJid(jid);
|
||||
}else{
|
||||
baseMapper.updateErrMsg(wjxDjxx.getUserId(),wjxDjxx.getVid(),jsonResult.getString("errormsg"));
|
||||
} else {
|
||||
baseMapper.updateErrMsg(wjxDjxx.getUserId(), wjxDjxx.getVid(), jsonResult.getString("errormsg"));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
//调用接口,答卷查询
|
||||
Map<String,Object> selMap = new HashMap<>();
|
||||
selMap.put("vid",Integer.valueOf(vid));
|
||||
selMap.put("jid",Long.valueOf(jid));
|
||||
Map<String, Object> selMap = new HashMap<>();
|
||||
selMap.put("vid", Integer.valueOf(vid));
|
||||
selMap.put("jid", Long.valueOf(jid));
|
||||
//调用接口,提交
|
||||
String answerStr = wjxUtil.openapi(selMap,"1001002");
|
||||
if(!answerStr.equals("")){
|
||||
String answerStr = wjxUtil.openapi(selMap, "1001002");
|
||||
if (!answerStr.equals("")) {
|
||||
JSONObject ansJsonResult = JSONObject.parseObject(answerStr);
|
||||
if(ansJsonResult.getBoolean("result")){
|
||||
if (ansJsonResult.getBoolean("result")) {
|
||||
JSONObject ansDataJson = ansJsonResult.getJSONObject("data");
|
||||
String answerVid = ansDataJson.getString("vid");
|
||||
JSONObject answerJsonArray = ansDataJson.getJSONObject("answers");
|
||||
for(String key1 : answerJsonArray.keySet()){
|
||||
for (String key1 : answerJsonArray.keySet()) {
|
||||
JSONObject answer = answerJsonArray.getJSONObject(key1);
|
||||
String jidAns = answer.getString("jid");
|
||||
Integer answerSeconds = answer.getInteger("answer_seconds");
|
||||
|
@ -465,7 +462,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
baseMapper.deleteDjItem(wjxDjxx2);
|
||||
//处理选项
|
||||
JSONObject answerItemJson = answer.getJSONObject("answer_items");
|
||||
if(answerItemJson!=null) {
|
||||
if (answerItemJson != null) {
|
||||
for (String key2 : answerItemJson.keySet()) {
|
||||
JSONObject answerItem = answerItemJson.getJSONObject(key2);
|
||||
Integer wjIndex = answerItem.getInteger("q_index");
|
||||
|
@ -495,8 +492,8 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
//修改答卷信息
|
||||
baseMapper.updateAnswer(wjxDjxx2);
|
||||
}
|
||||
}else{
|
||||
baseMapper.updateErrMsg(wjxDjxx.getUserId(),wjxDjxx.getVid(),ansJsonResult.getString("errormsg"));
|
||||
} else {
|
||||
baseMapper.updateErrMsg(wjxDjxx.getUserId(), wjxDjxx.getVid(), ansJsonResult.getString("errormsg"));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -506,12 +503,12 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
@Override
|
||||
public WjxDjxx queryByMainId(String id) {
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
WjxDjxx djxx = baseMapper.findDjxx(id,user.getUsername());
|
||||
if(djxx != null){
|
||||
WjxDjxx djxx = baseMapper.findDjxx(id, user.getUsername());
|
||||
if (djxx != null) {
|
||||
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
|
||||
List<WjxDjxxTmxx> list = baseMapper.findDjtmxx(djxx.getVid(),djxx.getJid());
|
||||
for(WjxDjxxTmxx wjxDjxxTmxx:list){
|
||||
List<WjxWjxxTmxx> list2= wjxWjxxTmxxMapper.selectByMainId(wjxDjxxTmxx.getId());
|
||||
List<WjxDjxxTmxx> list = baseMapper.findDjtmxx(djxx.getVid(), djxx.getJid());
|
||||
for (WjxDjxxTmxx wjxDjxxTmxx : list) {
|
||||
List<WjxWjxxTmxx> list2 = wjxWjxxTmxxMapper.selectByMainId(wjxDjxxTmxx.getId());
|
||||
wjxDjxxTmxx.setWjxWjxxTmxxList(list2);
|
||||
//获取填空题答案
|
||||
WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectById(wjxDjxxTmxx.getId());
|
||||
|
@ -525,6 +522,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
|
||||
/**
|
||||
* 秒数转时分秒
|
||||
*
|
||||
* @param seconds
|
||||
* @return
|
||||
*/
|
||||
|
@ -537,23 +535,23 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
}
|
||||
|
||||
@Override
|
||||
public Page<WjxDjxx> findDjjgsPage(WjxDjxx wjxDjxx, Page<WjxDjxx> page){
|
||||
if(StringUtils.equals("1",wjxDjxx.getIsFinished())){
|
||||
public Page<WjxDjxx> findDjjgsPage(WjxDjxx wjxDjxx, Page<WjxDjxx> page) {
|
||||
if (StringUtils.equals("1", wjxDjxx.getIsFinished())) {
|
||||
//完成答卷的
|
||||
List<WjxDjxx> list = baseMapper.findDjjgsPage(page,wjxDjxx);
|
||||
for(WjxDjxx djxx:list){
|
||||
List<WjxDjxx> list = baseMapper.findDjjgsPage(page, wjxDjxx);
|
||||
for (WjxDjxx djxx : list) {
|
||||
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
|
||||
}
|
||||
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);
|
||||
}else{
|
||||
} else {
|
||||
//全部
|
||||
List<WjxDjxx> list = baseMapper.findAllDjjgsPage(page,wjxDjxx);
|
||||
for(WjxDjxx djxx:list){
|
||||
if(djxx.getAnswerSeconds()!=-1){
|
||||
List<WjxDjxx> list = baseMapper.findAllDjjgsPage(page, wjxDjxx);
|
||||
for (WjxDjxx djxx : list) {
|
||||
if (djxx.getAnswerSeconds() != -1) {
|
||||
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
|
||||
}
|
||||
}
|
||||
|
@ -566,20 +564,20 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
@Override
|
||||
public List<WjxDjxx> exportList(WjxDjxx wjxDjxx) {
|
||||
List<WjxDjxx> list = new ArrayList<>();
|
||||
if(StringUtils.equals("1",wjxDjxx.getIsFinished())){
|
||||
if (StringUtils.equals("1", wjxDjxx.getIsFinished())) {
|
||||
//完成答卷的
|
||||
list = baseMapper.findDjjgsPage(null,wjxDjxx);
|
||||
for(WjxDjxx djxx:list){
|
||||
list = baseMapper.findDjjgsPage(null, wjxDjxx);
|
||||
for (WjxDjxx djxx : list) {
|
||||
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
|
||||
}
|
||||
}else if(StringUtils.equals("0",wjxDjxx.getIsFinished())){
|
||||
} else if (StringUtils.equals("0", wjxDjxx.getIsFinished())) {
|
||||
//未完成答卷的
|
||||
list = baseMapper.findUnDjjgsPage(null,wjxDjxx);
|
||||
}else{
|
||||
list = baseMapper.findUnDjjgsPage(null, wjxDjxx);
|
||||
} else {
|
||||
//全部
|
||||
list = baseMapper.findAllDjjgsPage(null,wjxDjxx);
|
||||
for(WjxDjxx djxx:list){
|
||||
if(djxx.getAnswerSeconds()!=-1){
|
||||
list = baseMapper.findAllDjjgsPage(null, wjxDjxx);
|
||||
for (WjxDjxx djxx : list) {
|
||||
if (djxx.getAnswerSeconds() != -1) {
|
||||
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
|
||||
}
|
||||
}
|
||||
|
@ -590,20 +588,20 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
@Override
|
||||
public List<WjxDjxxDj> exportDjXls(WjxDjxxDj wjxDjxxdj) {
|
||||
List<WjxDjxxDj> list = new ArrayList<>();
|
||||
if(StringUtils.equals("1",wjxDjxxdj.getIsFinished())){
|
||||
if (StringUtils.equals("1", wjxDjxxdj.getIsFinished())) {
|
||||
//完成答卷的
|
||||
list = baseMapper.findDjjgsDjPage(wjxDjxxdj);
|
||||
for(WjxDjxxDj djxx:list){
|
||||
for (WjxDjxxDj djxx : list) {
|
||||
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
|
||||
}
|
||||
}else if(StringUtils.equals("0",wjxDjxxdj.getIsFinished())){
|
||||
} else if (StringUtils.equals("0", wjxDjxxdj.getIsFinished())) {
|
||||
//未完成答卷的
|
||||
list = baseMapper.findUnDjjgsDJPage(wjxDjxxdj);
|
||||
}else{
|
||||
} else {
|
||||
//全部
|
||||
list = baseMapper.findAllDjjgsDjPage(wjxDjxxdj);
|
||||
for(WjxDjxxDj djxx:list){
|
||||
if(djxx.getAnswerSeconds()!=-1){
|
||||
for (WjxDjxxDj djxx : list) {
|
||||
if (djxx.getAnswerSeconds() != -1) {
|
||||
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
|
||||
}
|
||||
}
|
||||
|
@ -634,12 +632,12 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
@Override
|
||||
public WjxDjxx querySdpfById(String id) {
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
WjxDjxx djxx = baseMapper.findDjxx(id,user.getUsername());
|
||||
if(djxx != null){
|
||||
WjxDjxx djxx = baseMapper.findDjxx(id, user.getUsername());
|
||||
if (djxx != null) {
|
||||
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
|
||||
List<WjxDjxxTmxx> list = baseMapper.findDjtmxx2(djxx.getVid(),djxx.getJid());
|
||||
for(WjxDjxxTmxx wjxDjxxTmxx:list){
|
||||
List<WjxWjxxTmxx> list2= wjxWjxxTmxxMapper.selectByMainId(wjxDjxxTmxx.getId());
|
||||
List<WjxDjxxTmxx> list = baseMapper.findDjtmxx2(djxx.getVid(), djxx.getJid());
|
||||
for (WjxDjxxTmxx wjxDjxxTmxx : list) {
|
||||
List<WjxWjxxTmxx> list2 = wjxWjxxTmxxMapper.selectByMainId(wjxDjxxTmxx.getId());
|
||||
wjxDjxxTmxx.setWjxWjxxTmxxList(list2);
|
||||
//获取填空题答案
|
||||
WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectById(wjxDjxxTmxx.getId());
|
||||
|
@ -674,9 +672,9 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
@Override
|
||||
public void cxjcWjxScore(String vid) {
|
||||
QueryWrapper<WjxDjxx> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("vid",vid);
|
||||
queryWrapper.eq("vid", vid);
|
||||
List<WjxDjxx> list = baseMapper.selectList(queryWrapper);
|
||||
for(WjxDjxx par : list){
|
||||
for (WjxDjxx par : list) {
|
||||
jsscore(par.getJid());
|
||||
}
|
||||
}
|
||||
|
@ -685,7 +683,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
public String updateDjjg(WjxDjxx wjxDjxxPar) {
|
||||
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String vid = wjxDjxxPar.getVid();
|
||||
if(vid ==null || vid.equals("")){
|
||||
if (vid == null || vid.equals("")) {
|
||||
return "此试卷错误,无法提交!";
|
||||
}
|
||||
|
||||
|
@ -694,42 +692,42 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
|
||||
|
||||
String submitData = wjxDjxx2.getSubmitData();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("vid",Integer.valueOf(vid));
|
||||
Long djys = ChronoUnit.SECONDS.between(wjxDjxx2.getOpenTime().toInstant(),wjxDjxx2.getCommitTime().toInstant());
|
||||
if(djys<3){
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("vid", Integer.valueOf(vid));
|
||||
Long djys = ChronoUnit.SECONDS.between(wjxDjxx2.getOpenTime().toInstant(), wjxDjxx2.getCommitTime().toInstant());
|
||||
if (djys < 3) {
|
||||
djys = 10L;
|
||||
}
|
||||
System.out.println("--------------------------------------------------");
|
||||
System.out.println("---------------djys--"+djys+"---------------------------");
|
||||
System.out.println("---------------djys--" + djys + "---------------------------");
|
||||
System.out.println("--------------------------------------------------");
|
||||
map.put("inputcosttime", djys);
|
||||
map.put("submitdata",submitData);
|
||||
map.put("sojumpparm",wjxDjxx2.getUserId());//自定义链接参数,用来透传用户ID
|
||||
map.put("submitdata", submitData);
|
||||
map.put("sojumpparm", wjxDjxx2.getUserId());//自定义链接参数,用来透传用户ID
|
||||
//调用接口,提交
|
||||
String result = wjxUtil.openapi(map,"1001001");
|
||||
String result = wjxUtil.openapi(map, "1001001");
|
||||
String jidRes = "";
|
||||
if(!result.equals("")){
|
||||
if (!result.equals("")) {
|
||||
JSONObject jsonResult = JSONObject.parseObject(result);
|
||||
if(jsonResult.getBoolean("result")){
|
||||
if (jsonResult.getBoolean("result")) {
|
||||
JSONObject dataJson = jsonResult.getJSONObject("data");
|
||||
String vidRes = dataJson.getString("vid");
|
||||
jidRes = dataJson.getString("jid");
|
||||
String sojumpparmRes = dataJson.getString("sojumpparm");
|
||||
baseMapper.updateJid(sojumpparmRes,vidRes,jidRes);
|
||||
baseMapper.updateJid(sojumpparmRes, vidRes, jidRes);
|
||||
//调用接口,答卷查询
|
||||
Map<String,Object> selMap = new HashMap<>();
|
||||
selMap.put("vid",Integer.valueOf(vid));
|
||||
selMap.put("jid",Long.valueOf(jidRes));
|
||||
Map<String, Object> selMap = new HashMap<>();
|
||||
selMap.put("vid", Integer.valueOf(vid));
|
||||
selMap.put("jid", Long.valueOf(jidRes));
|
||||
//调用接口,查询答卷结果
|
||||
String answerStr = wjxUtil.openapi(selMap,"1001002");
|
||||
if(!answerStr.equals("")){
|
||||
String answerStr = wjxUtil.openapi(selMap, "1001002");
|
||||
if (!answerStr.equals("")) {
|
||||
JSONObject ansJsonResult = JSONObject.parseObject(answerStr);
|
||||
if(ansJsonResult.getBoolean("result")){
|
||||
if (ansJsonResult.getBoolean("result")) {
|
||||
JSONObject ansDataJson = ansJsonResult.getJSONObject("data");
|
||||
String answerVid = ansDataJson.getString("vid");
|
||||
JSONObject answerJsonArray = ansDataJson.getJSONObject("answers");
|
||||
for(String key1 : answerJsonArray.keySet()){
|
||||
for (String key1 : answerJsonArray.keySet()) {
|
||||
JSONObject answer = answerJsonArray.getJSONObject(key1);
|
||||
String jidAns = answer.getString("jid");
|
||||
Integer answerSeconds = answer.getInteger("answer_seconds");
|
||||
|
@ -745,7 +743,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
baseMapper.deleteDjItem(wjxDjxx);
|
||||
//处理选项
|
||||
JSONObject answerItemJson = answer.getJSONObject("answer_items");
|
||||
if(answerItemJson!=null) {
|
||||
if (answerItemJson != null) {
|
||||
for (String key2 : answerItemJson.keySet()) {
|
||||
JSONObject answerItem = answerItemJson.getJSONObject(key2);
|
||||
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
|
||||
|
@ -845,28 +843,27 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
//修改答卷信息
|
||||
baseMapper.updateAnswer(wjxDjxx);
|
||||
}
|
||||
}else{
|
||||
baseMapper.updateErrMsg(wjxDjxx2.getUserId(),vid,ansJsonResult.getString("errormsg"));
|
||||
} else {
|
||||
baseMapper.updateErrMsg(wjxDjxx2.getUserId(), vid, ansJsonResult.getString("errormsg"));
|
||||
return ansJsonResult.getString("errormsg");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
baseMapper.updateErrMsg(wjxDjxx2.getUserId(),vid,jsonResult.getString("errormsg"));
|
||||
} else {
|
||||
baseMapper.updateErrMsg(wjxDjxx2.getUserId(), vid, jsonResult.getString("errormsg"));
|
||||
return jsonResult.getString("errormsg");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
if(StringUtils.isNotBlank(jidRes)){
|
||||
if (StringUtils.isNotBlank(jidRes)) {
|
||||
jsscore(jidRes);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
|
||||
return "提交成功!";
|
||||
}
|
||||
|
||||
|
@ -874,19 +871,19 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
public String getDjjg(WjxDjxx wjxDjxxPar) {
|
||||
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String vid = wjxDjxxPar.getVid();
|
||||
if(vid ==null || vid.equals("")){
|
||||
if (vid == null || vid.equals("")) {
|
||||
return "此试卷错误,无法提交!";
|
||||
}
|
||||
|
||||
//调用接口,提交
|
||||
String jidRes = wjxDjxxPar.getJid();
|
||||
//调用接口,答卷查询
|
||||
Map<String,Object> selMap = new HashMap<>();
|
||||
selMap.put("vid",Integer.valueOf(vid));
|
||||
selMap.put("jid",Long.valueOf(jidRes));
|
||||
Map<String, Object> selMap = new HashMap<>();
|
||||
selMap.put("vid", Integer.valueOf(vid));
|
||||
selMap.put("jid", Long.valueOf(jidRes));
|
||||
//调用接口,查询答卷结果
|
||||
String answerStr = wjxUtil.openapi(selMap,"1001002");
|
||||
if(!answerStr.equals("")) {
|
||||
String answerStr = wjxUtil.openapi(selMap, "1001002");
|
||||
if (!answerStr.equals("")) {
|
||||
JSONObject ansJsonResult = JSONObject.parseObject(answerStr);
|
||||
if (ansJsonResult.getBoolean("result")) {
|
||||
JSONObject ansDataJson = ansJsonResult.getJSONObject("data");
|
||||
|
@ -908,7 +905,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
// baseMapper.deleteDjItem(wjxDjxx);
|
||||
//处理选项
|
||||
JSONObject answerItemJson = answer.getJSONObject("answer_items");
|
||||
if(answerItemJson!=null){
|
||||
if (answerItemJson != null) {
|
||||
for (String key2 : answerItemJson.keySet()) {
|
||||
JSONObject answerItem = answerItemJson.getJSONObject(key2);
|
||||
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
|
||||
|
@ -965,7 +962,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
}
|
||||
|
||||
WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx);
|
||||
if(djxxTmxx==null){
|
||||
if (djxxTmxx == null) {
|
||||
baseMapper.addDjTmxx(wjxDjxxTmxx);
|
||||
}
|
||||
|
||||
|
@ -985,7 +982,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
}
|
||||
wjxDjxxTmxx.setId(id);
|
||||
WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx);
|
||||
if(djxxTmxx==null){
|
||||
if (djxxTmxx == null) {
|
||||
baseMapper.addDjTmxx(wjxDjxxTmxx);
|
||||
}
|
||||
}
|
||||
|
@ -1008,7 +1005,7 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
}
|
||||
wjxDjxxTmxx.setId(id);
|
||||
WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx);
|
||||
if(djxxTmxx==null){
|
||||
if (djxxTmxx == null) {
|
||||
baseMapper.addDjTmxx(wjxDjxxTmxx);
|
||||
}
|
||||
}
|
||||
|
@ -1025,28 +1022,34 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
}
|
||||
|
||||
try {
|
||||
if(StringUtils.isNotBlank(jidRes)){
|
||||
if (StringUtils.isNotBlank(jidRes)) {
|
||||
jsscore(jidRes);
|
||||
}
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
|
||||
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 {
|
||||
if(StringUtils.equals(jid,"122233965812")){
|
||||
if (StringUtils.equals(jid, "122233965812")) {
|
||||
System.out.println("jid");
|
||||
}
|
||||
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
|
||||
wjxDjxxTmxx.setJid(jid);
|
||||
wjxDjxxTmxx = baseMapper.getSumScore(wjxDjxxTmxx);
|
||||
WjxDjxx par2 = new WjxDjxx();
|
||||
if(wjxDjxxTmxx.getItemScore() != null && wjxDjxxTmxx.getItemScore()>0){
|
||||
if (wjxDjxxTmxx.getItemScore() != null && wjxDjxxTmxx.getItemScore() > 0) {
|
||||
par2.setScore(wjxDjxxTmxx.getItemScore());
|
||||
par2.setJid(jid);
|
||||
baseMapper.updateScoreByJid(par2);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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> {
|
||||
|
||||
}
|
|
@ -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>
|
|
@ -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);
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -57,13 +57,13 @@ import io.swagger.annotations.ApiOperation;
|
|||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Description: 问卷信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-04-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="问卷信息")
|
||||
@Api(tags = "问卷信息")
|
||||
@RestController
|
||||
@RequestMapping("/wjxWjxx/wjxWjxx")
|
||||
@Slf4j
|
||||
|
@ -83,7 +83,6 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
private IWjxWjxxTmlbService wjxWjxxTmlbService;
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private SysBaseApiImpl sysBaseApi;
|
||||
@Autowired
|
||||
|
@ -95,6 +94,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
private String upLoadPath;
|
||||
@Autowired
|
||||
private IKcKechengbiaoService kcKechengbiaoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
|
@ -105,11 +105,11 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "问卷信息-分页列表查询")
|
||||
@ApiOperation(value="问卷信息-分页列表查询", notes="问卷信息-分页列表查询")
|
||||
@ApiOperation(value = "问卷信息-分页列表查询", notes = "问卷信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<WjxWjxx>> queryPageList(WjxWjxx wjxWjxx,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
// QueryWrapper<WjxWjxx> queryWrapper = QueryGenerator.initQueryWrapper(wjxWjxx, req.getParameterMap());
|
||||
// queryWrapper.orderByDesc("create_time");
|
||||
|
@ -123,15 +123,16 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
}
|
||||
|
||||
|
||||
@ApiOperation(value="问卷信息-分页列表查询", notes="问卷信息-分页列表查询")
|
||||
@ApiOperation(value = "问卷信息-分页列表查询", notes = "问卷信息-分页列表查询")
|
||||
@GetMapping(value = "/newlist")
|
||||
public Result<IPage<WjxWjxx>> newlist(WjxWjxx wjxWjxx,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<WjxWjxx> pageList = wjxWjxxService.findPage(wjxWjxx, new Page<>(pageNo, pageSize));
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生问卷分页列表查询
|
||||
*
|
||||
|
@ -142,11 +143,11 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "问卷信息-分页列表查询")
|
||||
@ApiOperation(value="问卷信息-分页列表查询", notes="问卷信息-分页列表查询")
|
||||
@ApiOperation(value = "问卷信息-分页列表查询", notes = "问卷信息-分页列表查询")
|
||||
@GetMapping(value = "/stuList")
|
||||
public Result<IPage<WjxWjxx>> queryPageStuList(WjxWjxx wjxWjxx,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<WjxWjxx> pageList = wjxWjxxService.findStuPage(wjxWjxx, new Page<>(pageNo, pageSize));
|
||||
return Result.OK(pageList);
|
||||
|
@ -159,7 +160,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问卷信息-添加")
|
||||
@ApiOperation(value="问卷信息-添加", notes="问卷信息-添加")
|
||||
@ApiOperation(value = "问卷信息-添加", notes = "问卷信息-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody WjxWjxx wjxWjxx) {
|
||||
wjxWjxxService.save(wjxWjxx);
|
||||
|
@ -167,7 +168,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
}
|
||||
|
||||
@AutoLog(value = "问卷发布-添加")
|
||||
@ApiOperation(value="问卷发布-添加", notes="问卷发布-添加")
|
||||
@ApiOperation(value = "问卷发布-添加", notes = "问卷发布-添加")
|
||||
@PostMapping(value = "/batchAdd")
|
||||
public Result<String> batchAdd(@RequestBody List<WjxWjxx> list) {
|
||||
WjxWjxx zyInfo = list.get(0);
|
||||
|
@ -175,26 +176,26 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
//删除老师留过的问卷,重新生成新的
|
||||
QueryWrapper<WjxWjxx> query = new QueryWrapper<>();
|
||||
query.eq("rwbh", zyInfo.getRwbh());
|
||||
query.eq("create_by",zyInfo.getCreateBy());
|
||||
query.eq("atype",zyInfo.getAtype());
|
||||
query.eq("create_by", zyInfo.getCreateBy());
|
||||
query.eq("atype", zyInfo.getAtype());
|
||||
List<WjxWjxx> oldList = wjxWjxxService.list(query);
|
||||
wjxWjxxService.remove(query);
|
||||
|
||||
KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
|
||||
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
|
||||
kcKechengbiaoQueryWrapper.eq("xqxn",kcSysConfig.getFlag1());
|
||||
kcKechengbiaoQueryWrapper.eq("rwbh",zyInfo.getRwbh());
|
||||
kcKechengbiaoQueryWrapper.eq("xqxn", kcSysConfig.getFlag1());
|
||||
kcKechengbiaoQueryWrapper.eq("rwbh", zyInfo.getRwbh());
|
||||
kcKechengbiaoQueryWrapper.last("limit 1");
|
||||
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);
|
||||
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);
|
||||
zypar.setSort(par.getSort());
|
||||
zypar.setScore(par.getScore());
|
||||
wjxWjxxService.save(zypar);
|
||||
}else{
|
||||
} else {
|
||||
par.setXqxn(kcSysConfig.getFlag1());
|
||||
par.setQpublish("0");
|
||||
par.setXkrs(kcKechengbiao.getXkrs());
|
||||
|
@ -206,26 +207,26 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
}
|
||||
|
||||
@AutoLog(value = "问卷发布-添加")
|
||||
@ApiOperation(value="问卷发布-添加", notes="问卷发布-添加")
|
||||
@ApiOperation(value = "问卷发布-添加", notes = "问卷发布-添加")
|
||||
@PostMapping(value = "/addOne")
|
||||
public Result<String> addOne(@RequestBody WjxWjxx zyInfo) {
|
||||
KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
|
||||
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
|
||||
kcKechengbiaoQueryWrapper.eq("xqxn",kcSysConfig.getFlag1());
|
||||
kcKechengbiaoQueryWrapper.eq("rwbh",zyInfo.getRwbh());
|
||||
kcKechengbiaoQueryWrapper.eq("xqxn", kcSysConfig.getFlag1());
|
||||
kcKechengbiaoQueryWrapper.eq("rwbh", zyInfo.getRwbh());
|
||||
kcKechengbiaoQueryWrapper.last("limit 1");
|
||||
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
|
||||
|
||||
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
QueryWrapper<WjxWjxx> zyInfoQueryWrapper = new QueryWrapper<>();
|
||||
zyInfoQueryWrapper.eq("xqxn",zyInfo.getXqxn());
|
||||
zyInfoQueryWrapper.eq("xqxn", zyInfo.getXqxn());
|
||||
// zyInfoQueryWrapper.eq("create_by",sysUser.getUsername());
|
||||
zyInfoQueryWrapper.eq("rwbh",zyInfo.getRwbh());
|
||||
zyInfoQueryWrapper.eq("atype",zyInfo.getAtype());
|
||||
zyInfoQueryWrapper.eq("rwbh", zyInfo.getRwbh());
|
||||
zyInfoQueryWrapper.eq("atype", zyInfo.getAtype());
|
||||
List<WjxWjxx> list = wjxWjxxService.list(zyInfoQueryWrapper);
|
||||
|
||||
zyInfo.setSort(list.size()+1+"");
|
||||
zyInfo.setSort(list.size() + 1 + "");
|
||||
zyInfo.setXqxn(kcSysConfig.getFlag1());
|
||||
zyInfo.setQpublish("0");
|
||||
zyInfo.setXkrs(kcKechengbiao.getXkrs());
|
||||
|
@ -243,24 +244,24 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问卷信息-编辑")
|
||||
@ApiOperation(value="问卷信息-编辑", notes="问卷信息-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
@ApiOperation(value = "问卷信息-编辑", notes = "问卷信息-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody WjxWjxx wjxWjxx) {
|
||||
wjxWjxxService.updateById(wjxWjxx);
|
||||
|
||||
|
||||
List<WjxWjxxTmlbPage> list =wjxWjxx.getList();
|
||||
List<WjxWjxxTmlbPage> list = wjxWjxx.getList();
|
||||
String mainId = wjxWjxx.getId();
|
||||
if(list.size()>0){
|
||||
if (list.size() > 0) {
|
||||
|
||||
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<WjxWjxxTmlb>();
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id",mainId);
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id", mainId);
|
||||
List<WjxWjxxTmlb> list2 = wjxWjxxTmlbService.list(wjxWjxxTmlbQueryWrapper);
|
||||
for(WjxWjxxTmlb WjxWjxxTmlb:list2){
|
||||
for (WjxWjxxTmlb WjxWjxxTmlb : list2) {
|
||||
wjxWjxxTmlbService.removeByMainId(WjxWjxxTmlb.getId());
|
||||
}
|
||||
|
||||
for(WjxWjxxTmlbPage wjxWjxxTmlbPage:list){
|
||||
for (WjxWjxxTmlbPage wjxWjxxTmlbPage : list) {
|
||||
wjxWjxxTmlbPage.setId(null);
|
||||
WjxWjxxTmlb wjxWjxxTmlb = new WjxWjxxTmlb();
|
||||
BeanUtils.copyProperties(wjxWjxxTmlbPage, wjxWjxxTmlb);
|
||||
|
@ -280,20 +281,20 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问卷信息-通过id删除")
|
||||
@ApiOperation(value="问卷信息-通过id删除", notes="问卷信息-通过id删除")
|
||||
@ApiOperation(value = "问卷信息-通过id删除", notes = "问卷信息-通过id删除")
|
||||
@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);
|
||||
wjxWjxxService.removeById(id);
|
||||
QueryWrapper<WjxWjxx> zyInfoQueryWrapper = new QueryWrapper<>();
|
||||
zyInfoQueryWrapper.eq("rwbh",zyInfo.getRwbh());
|
||||
zyInfoQueryWrapper.eq("xqxn",zyInfo.getXqxn());
|
||||
zyInfoQueryWrapper.eq("atype",zyInfo.getAtype());
|
||||
zyInfoQueryWrapper.eq("rwbh", zyInfo.getRwbh());
|
||||
zyInfoQueryWrapper.eq("xqxn", zyInfo.getXqxn());
|
||||
zyInfoQueryWrapper.eq("atype", zyInfo.getAtype());
|
||||
zyInfoQueryWrapper.orderByAsc("sort-0");
|
||||
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);
|
||||
zyInfoPar.setSort(i+1+"");
|
||||
zyInfoPar.setSort(i + 1 + "");
|
||||
wjxWjxxService.updateById(zyInfoPar);
|
||||
}
|
||||
return Result.OK("删除成功!");
|
||||
|
@ -306,10 +307,10 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问卷信息-批量删除")
|
||||
@ApiOperation(value="问卷信息-批量删除", notes="问卷信息-批量删除")
|
||||
@ApiOperation(value = "问卷信息-批量删除", notes = "问卷信息-批量删除")
|
||||
@RequiresPermissions("wjxWjxx:wjx_wjxx: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(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
@ -321,11 +322,11 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "问卷信息-通过id查询")
|
||||
@ApiOperation(value="问卷信息-通过id查询", notes="问卷信息-通过id查询")
|
||||
@ApiOperation(value = "问卷信息-通过id查询", notes = "问卷信息-通过id查询")
|
||||
@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);
|
||||
if(wjxWjxx==null) {
|
||||
if (wjxWjxx == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(wjxWjxx);
|
||||
|
@ -356,7 +357,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
return super.importExcel(request, response, WjxWjxx.class);
|
||||
}
|
||||
|
||||
@ApiOperation(value="问卷信息-通过id查询", notes="问卷信息-通过id查询")
|
||||
@ApiOperation(value = "问卷信息-通过id查询", notes = "问卷信息-通过id查询")
|
||||
@GetMapping(value = "/getWjxLogin")
|
||||
public Result<WjxWjxx> getWjxLogin() {
|
||||
try {
|
||||
|
@ -369,35 +370,35 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
return Result.OK(null);
|
||||
}
|
||||
|
||||
@ApiOperation(value="获取课程信息", notes="获取课程信息")
|
||||
@ApiOperation(value = "获取课程信息", notes = "获取课程信息")
|
||||
@GetMapping(value = "/kcxx")
|
||||
public Result<WjxWjxx> kcxx(@RequestParam(name="rwbh",required=true) String rwbh,@RequestParam(name="xqxn",required=true) String xqxn) {
|
||||
WjxWjxx wjxWjxx = wjxWjxxService.kcxx(rwbh,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);
|
||||
return Result.OK(wjxWjxx);
|
||||
}
|
||||
|
||||
@ApiOperation(value="发布问卷", notes="发布问卷")
|
||||
@ApiOperation(value = "发布问卷", notes = "发布问卷")
|
||||
@GetMapping(value = "/fbwj")
|
||||
public Result<String> fbwj(@RequestParam(name="id",required=true) String id,@RequestParam(name="wjlx",required=true) String wjlx) {
|
||||
String res = wjxWjxxService.fbwj(id,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);
|
||||
|
||||
WjxWjxx wjxWjxx=wjxWjxxService.getById(id);
|
||||
WjxWjxx wjxWjxx = wjxWjxxService.getById(id);
|
||||
QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.apply("a.xh = b.xh");
|
||||
queryWrapper.eq("b.KCAPZBBH",wjxWjxx.getRwbh());
|
||||
queryWrapper.eq("b.KCAPZBBH", wjxWjxx.getRwbh());
|
||||
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
|
||||
String type = "";
|
||||
String content = "";
|
||||
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(StringUtils.equals(wjlx,"6")){
|
||||
if (StringUtils.equals(wjlx, "6")) {
|
||||
type = "2";
|
||||
content = sysUser.getRealname()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”测验,该测验完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成";
|
||||
}else{
|
||||
content = sysUser.getRealname() + "教师发起了[" + wjxWjxx.getKcmc() + "]课程“" + wjxWjxx.getTitle() + "”测验,该测验完成时间: " + DateUtils.formatDate(wjxWjxx.getStartTime(), "yyyy-MM-dd") + " ~ " + DateUtils.formatDate(wjxWjxx.getEndTime(), "yyyy-MM-dd") + ",请及时完成";
|
||||
} else {
|
||||
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();
|
||||
|
@ -424,20 +425,20 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
}
|
||||
|
||||
|
||||
@ApiOperation(value="发布问卷", notes="发布问卷")
|
||||
@ApiOperation(value = "发布问卷", notes = "发布问卷")
|
||||
@GetMapping(value = "/sendWjWechat")
|
||||
public Result<WjxWjxx> sendWjWechat(@RequestParam(name="id",required=true) String id,@RequestParam(name="wjlx",required=true) String wjlx) {
|
||||
WjxWjxx wjxWjxx=wjxWjxxService.getById(id);
|
||||
public Result<WjxWjxx> sendWjWechat(@RequestParam(name = "id", required = true) String id, @RequestParam(name = "wjlx", required = true) String wjlx) {
|
||||
WjxWjxx wjxWjxx = wjxWjxxService.getById(id);
|
||||
QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.apply("a.xh = b.xh");
|
||||
queryWrapper.eq("b.KCAPZBBH",wjxWjxx.getRwbh());
|
||||
queryWrapper.eq("b.KCAPZBBH", wjxWjxx.getRwbh());
|
||||
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
|
||||
String content = "";
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
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")+",请及时完成";
|
||||
}else{
|
||||
content = sysUser.getRealname()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”问卷,该问卷完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成";
|
||||
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") + ",请及时完成";
|
||||
} else {
|
||||
content = sysUser.getRealname() + "教师发起了[" + wjxWjxx.getKcmc() + "]课程“" + wjxWjxx.getTitle() + "”问卷,该问卷完成时间: " + DateUtils.formatDate(wjxWjxx.getStartTime(), "yyyy-MM-dd") + " ~ " + DateUtils.formatDate(wjxWjxx.getEndTime(), "yyyy-MM-dd") + ",请及时完成";
|
||||
}
|
||||
// for(Xxhbbks xxhbbks:list){
|
||||
// try {
|
||||
|
@ -465,16 +466,16 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
|
||||
public void sendWxmessage(KcWechatSendLog kcWechatSendLog) {
|
||||
String openId = kcWechatSendLog.getOpenid();//曹老师账号
|
||||
System.out.println("openId:"+openId+"");
|
||||
if(org.apache.commons.lang3.StringUtils.isNotEmpty(openId)){
|
||||
System.out.println("openId:" + openId + "");
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(openId)) {
|
||||
try {
|
||||
String urlToken = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="+ appId +"&corpsecret=" + appIdSecret;
|
||||
System.out.println("urlToken: "+ urlToken);
|
||||
String urlToken = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + appId + "&corpsecret=" + appIdSecret;
|
||||
System.out.println("urlToken: " + urlToken);
|
||||
String res = HttpUtil.get(urlToken);
|
||||
JSONObject jsonObjectToken = JSONObject.parseObject(res);
|
||||
System.out.println("jsonObjectToken:{}"+ jsonObjectToken);
|
||||
System.out.println("jsonObjectToken:{}" + jsonObjectToken);
|
||||
String accessToken = jsonObjectToken.getString("access_token");
|
||||
System.out.println("accessToken:{}"+ accessToken);
|
||||
System.out.println("accessToken:{}" + accessToken);
|
||||
|
||||
// 微信的基础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>
|
|||
|
||||
// 1、xx老师,你好,您本学期(2023秋)听课要求为:5次,当前实际听课次数:3次,请尽快完成本学期的听课任务。
|
||||
String html = kcWechatSendLog.getYtkcs();
|
||||
html = html + "\n<a href=\""+domainTo+"\">查看</a>";
|
||||
html = html + "\n<a href=\"" + domainTo + "\">查看</a>";
|
||||
sendMag.put("content", html);//授课老师推送内容
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
//拼接base参数
|
||||
|
@ -490,76 +491,75 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
sendBody.put("touser", openId); // openId
|
||||
sendBody.put("msgtype", "text"); // 消息类型,此时固定为:text
|
||||
sendBody.put("agentid", agentid); // 企业id
|
||||
sendBody.put("text",sendMag); //发送内容
|
||||
sendBody.put("text", sendMag); //发送内容
|
||||
ResponseEntity<String> forEntity = restTemplate.postForEntity(url, sendBody, String.class);
|
||||
JSONObject jsonObject2 = JSONObject.parseObject(forEntity.getBody());
|
||||
System.out.println("jsonObject2 : " + jsonObject2);
|
||||
String messageCode = jsonObject2.getString("errcode");
|
||||
String msgId = jsonObject2.getString("msgid");
|
||||
System.out.println("messageCode : " + messageCode + ", msgId: " +msgId);
|
||||
}catch (Exception e) {
|
||||
System.out.println("messageCode : " + messageCode + ", msgId: " + msgId);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value="统计分析", notes="统计分析")
|
||||
@ApiOperation(value = "统计分析", notes = "统计分析")
|
||||
@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);
|
||||
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
@ApiOperation(value="问卷下载", notes="问卷下载")
|
||||
@ApiOperation(value = "问卷下载", notes = "问卷下载")
|
||||
@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);
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value="教学大纲-分页列表查询", notes="教学大纲-分页列表查询")
|
||||
@ApiOperation(value = "教学大纲-分页列表查询", notes = "教学大纲-分页列表查询")
|
||||
@GetMapping(value = "/sysList")
|
||||
public Result<IPage<KccyglSys>> sysList(KccyglSys kccyglSys,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//-------------获取当前登陆人是否是管理员角色,如果不是都按照教务秘书处理---------------------------
|
||||
List<String> roleList = sysBaseApi.getRolesByUsername(sysUser.getUsername());
|
||||
String adminRole = "1";//0 admin 1教务秘书
|
||||
for(String role :roleList){
|
||||
if(org.apache.commons.lang.StringUtils.equals("admin",role)){
|
||||
for (String role : roleList) {
|
||||
if (org.apache.commons.lang.StringUtils.equals("admin", role)) {
|
||||
adminRole = "0";
|
||||
break;
|
||||
}
|
||||
}
|
||||
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>();
|
||||
queryWrapperCon.eq("gh",sysUser.getUsername());
|
||||
queryWrapperCon.eq("gh", sysUser.getUsername());
|
||||
queryWrapperCon.orderByDesc("create_time");
|
||||
queryWrapperCon.last("limit 1");
|
||||
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");
|
||||
queryWrapper.eq("xqxn",kcSysConfig.getFlag1());
|
||||
}else{
|
||||
queryWrapper.eq("xqxn",kccyglSys.getXqxn());
|
||||
queryWrapper.eq("xqxn", kcSysConfig.getFlag1());
|
||||
} else {
|
||||
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.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.getSkjs()),"skjs",kccyglSys.getSkjs());
|
||||
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.getKcbh()), "kcbh", kccyglSys.getKcbh());
|
||||
queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(kccyglSys.getSkjs()), "skjs", kccyglSys.getSkjs());
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -575,34 +575,34 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
//-------------获取当前登陆人是否是管理员角色,如果不是都按照教务秘书处理---------------------------
|
||||
List<String> roleList = sysBaseApi.getRolesByUsername(sysUser.getUsername());
|
||||
String adminRole = "1";//0 admin 1教务秘书
|
||||
for(String role :roleList){
|
||||
if(org.apache.commons.lang.StringUtils.equals("admin",role)){
|
||||
for (String role : roleList) {
|
||||
if (org.apache.commons.lang.StringUtils.equals("admin", role)) {
|
||||
adminRole = "0";
|
||||
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>();
|
||||
queryWrapperCon.eq("gh",sysUser.getUsername());
|
||||
queryWrapperCon.eq("gh", sysUser.getUsername());
|
||||
queryWrapperCon.orderByDesc("create_time");
|
||||
queryWrapperCon.last("limit 1");
|
||||
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");
|
||||
queryWrapper.eq("xqxn",kcSysConfig.getFlag1());
|
||||
}else{
|
||||
queryWrapper.eq("xqxn",KccyglSys.getXqxn());
|
||||
queryWrapper.eq("xqxn", kcSysConfig.getFlag1());
|
||||
} else {
|
||||
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.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.getSkjs()),"skjs",KccyglSys.getSkjs());
|
||||
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.getKcbh()), "kcbh", KccyglSys.getKcbh());
|
||||
queryWrapper.like(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(KccyglSys.getSkjs()), "skjs", KccyglSys.getSkjs());
|
||||
|
||||
// Step.2 获取导出数据
|
||||
List<KccyglSys> exportList = service.exportSysXls(queryWrapper,KccyglSys);
|
||||
List<KccyglSys> exportList = service.exportSysXls(queryWrapper, KccyglSys);
|
||||
|
||||
// Step.3 AutoPoi 导出Excel
|
||||
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.CLASS, KccyglSys.class);
|
||||
//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);
|
||||
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
||||
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value="判断学生是否答过题", notes="判断学生是否答过题")
|
||||
@GetMapping(value = "/querySfdtById")
|
||||
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")
|
||||
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);
|
||||
if(WjxWjxx==null) {
|
||||
if (WjxWjxx == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.apply("a.xh = b.xh");
|
||||
queryWrapper.eq("b.KCAPZBBH",WjxWjxx.getRwbh());
|
||||
queryWrapper.eq("b.KCAPZBBH", WjxWjxx.getRwbh());
|
||||
WjxWjxx.setNum("0");//不是本次学生,不可以答卷
|
||||
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
|
||||
for(Xxhbbks par : list){
|
||||
for (Xxhbbks par : list) {
|
||||
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");
|
||||
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")
|
||||
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);
|
||||
if(wjxWjxx==null) {
|
||||
if (wjxWjxx == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(wjxWjxx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value="问卷信息-微信提醒", notes="微信提醒")
|
||||
@ApiOperation(value = "问卷信息-微信提醒", notes = "微信提醒")
|
||||
@GetMapping(value = "/sendWxtx")
|
||||
public void sendWxtx(@RequestParam(name="id",required=true) String id,@RequestParam(name="wjlx",required=true) String wjlx) {
|
||||
WjxWjxx wjxWjxx=wjxWjxxService.getById(id);
|
||||
public void sendWxtx(@RequestParam(name = "id", required = true) String id, @RequestParam(name = "wjlx", required = true) String wjlx) {
|
||||
WjxWjxx wjxWjxx = wjxWjxxService.getById(id);
|
||||
QueryWrapper<Xxhbbks> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.apply("a.xh = b.xh");
|
||||
queryWrapper.eq("b.KCAPZBBH",wjxWjxx.getRwbh());
|
||||
queryWrapper.eq("b.KCAPZBBH", wjxWjxx.getRwbh());
|
||||
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
|
||||
String content = "";
|
||||
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
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")+",请及时完成";
|
||||
}else{
|
||||
content = sysUser.getRealname()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”问卷,该问卷完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成";
|
||||
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") + ",请及时完成";
|
||||
} else {
|
||||
content = sysUser.getRealname() + "教师发起了[" + wjxWjxx.getKcmc() + "]课程“" + wjxWjxx.getTitle() + "”问卷,该问卷完成时间: " + DateUtils.formatDate(wjxWjxx.getStartTime(), "yyyy-MM-dd") + " ~ " + DateUtils.formatDate(wjxWjxx.getEndTime(), "yyyy-MM-dd") + ",请及时完成";
|
||||
}
|
||||
for(Xxhbbks xxhbbks:list){
|
||||
for (Xxhbbks xxhbbks : list) {
|
||||
|
||||
try {
|
||||
KcWechatSendLog kcWechatSendLog = new KcWechatSendLog();
|
||||
|
@ -694,7 +691,7 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
// kcWechatSendLog.setOpenid("2016900057");//指定曹老师账号
|
||||
kcWechatSendLog.setYtkcs(content);
|
||||
sendWxmessage(kcWechatSendLog);
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
|
@ -702,11 +699,11 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
}
|
||||
|
||||
|
||||
@ApiOperation(value="问卷信息-分页列表查询", notes="问卷信息-分页列表查询")
|
||||
@ApiOperation(value = "问卷信息-分页列表查询", notes = "问卷信息-分页列表查询")
|
||||
@GetMapping(value = "/listOther")
|
||||
public Result<IPage<WjxWjxx>> listOther(WjxWjxx wjxWjxx,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
wjxWjxx.setTeacherNo(user.getUsername());
|
||||
|
@ -716,8 +713,8 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
|
||||
@GetMapping(value = "/khclList")
|
||||
public Result<IPage<WjxWjxx>> khclList(WjxWjxx wjxWjxx,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
||||
QueryWrapper<WjxWjxx> queryWrapper = QueryGenerator.initQueryWrapper(wjxWjxx, req.getParameterMap());
|
||||
|
@ -730,13 +727,13 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
|
|||
@PostMapping(value = "/uploadSckhcl")
|
||||
public Result<String> uploadSckhcl(@RequestBody WjxWjxx wjxWjxx) {
|
||||
try {
|
||||
System.out.println("ids:"+wjxWjxx.getId());
|
||||
System.out.println("ids:" + wjxWjxx.getId());
|
||||
wjxWjxxService.batchZyinfoKhcl(wjxWjxx.getId());
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return Result.OK("考核材料上传成功!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,6 +105,10 @@ public class WjxWjxx implements Serializable {
|
|||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
|
||||
private Date endTime;
|
||||
@ApiModelProperty(value = "防作弊模式:Y-开启 N-关闭")
|
||||
private String fzbms;
|
||||
@ApiModelProperty(value = "作答时限(答题时间限制)")
|
||||
private Integer zdsx;
|
||||
|
||||
private String sort;//排序
|
||||
private String score;//占比
|
||||
|
@ -158,4 +162,6 @@ public class WjxWjxx implements Serializable {
|
|||
private String yuanTeacherNo;
|
||||
@TableField(exist = false)
|
||||
private String yuanTeacherName;
|
||||
@TableField(exist = false)
|
||||
private String ts;
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package org.jeecg.modules.kc.wjxWjxx.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.kc.wjxWjxx.entity.KccyglSys;
|
||||
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: 问卷信息
|
||||
|
|
|
@ -40,6 +40,8 @@
|
|||
a.kcmc,
|
||||
a.start_time,
|
||||
a.end_time,
|
||||
a.fzbms,
|
||||
a.zdsx,
|
||||
ifnull(b.flag,'-1') as flag,
|
||||
b.id as djId
|
||||
from wjx_wjxx a
|
||||
|
|
|
@ -3,13 +3,12 @@ package org.jeecg.modules.kc.wjxWjxx.service;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
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.IService;
|
||||
import org.jeecg.modules.kc.wjxWjxx.entity.KccyglSys;
|
||||
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.Map;
|
||||
|
||||
/**
|
||||
* @Description: 问卷信息
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
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.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 org.apache.shiro.SecurityUtils;
|
||||
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.zyDbtx.entity.ZyDbtx;
|
||||
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.service.IZyInfoScjlService;
|
||||
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
|
||||
import org.jeecg.modules.tools.dbsdkfzpt.RestTemplateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
|
@ -97,7 +91,7 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
this.uploadpath = uploadPath;
|
||||
}
|
||||
|
||||
@Value(value="${jeecg.uploadType}")
|
||||
@Value(value = "${jeecg.uploadType}")
|
||||
private String uploadType;
|
||||
@Value(value = "${jeecg.path.webapp}")
|
||||
private String downloadpath;
|
||||
|
@ -107,17 +101,17 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
private String upLoadPath;
|
||||
|
||||
@Override
|
||||
public Page<WjxWjxx> findPage(WjxWjxx wjxWjxx, Page<WjxWjxx> page){
|
||||
List<WjxWjxx> list = baseMapper.findPage(page,wjxWjxx);
|
||||
public Page<WjxWjxx> findPage(WjxWjxx wjxWjxx, Page<WjxWjxx> page) {
|
||||
List<WjxWjxx> list = baseMapper.findPage(page, wjxWjxx);
|
||||
page.setRecords(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
@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();
|
||||
wjxWjxx.setUserId(user.getUsername());
|
||||
List<WjxWjxx> list = baseMapper.findStuPage(page,wjxWjxx);
|
||||
List<WjxWjxx> list = baseMapper.findStuPage(page, wjxWjxx);
|
||||
page.setRecords(list);
|
||||
return page;
|
||||
}
|
||||
|
@ -284,92 +278,92 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
// }
|
||||
|
||||
@Override
|
||||
public WjxWjxx kcxx(String rwbh,String xqxn){
|
||||
return baseMapper.kcxx(rwbh,xqxn);
|
||||
public WjxWjxx kcxx(String rwbh, String xqxn) {
|
||||
return baseMapper.kcxx(rwbh, xqxn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String fbwj(String id,String wjlx) {
|
||||
public String fbwj(String id, String wjlx) {
|
||||
|
||||
WjxWjxx wjxWjxx = baseMapper.selectById(id);
|
||||
|
||||
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id", id);
|
||||
wjxWjxxTmlbQueryWrapper.orderByAsc("wj_index");
|
||||
List<WjxWjxxTmlb> wjxWjxxTmlbList =wjxWjxxTmlbMapper.selectList(wjxWjxxTmlbQueryWrapper);
|
||||
List<WjxWjxxTmlb> wjxWjxxTmlbList = wjxWjxxTmlbMapper.selectList(wjxWjxxTmlbQueryWrapper);
|
||||
|
||||
List<Map<String,Object>> questionsList = new ArrayList<>();
|
||||
for(WjxWjxxTmlb wWjxWjxxTmlb:wjxWjxxTmlbList){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("q_index",wWjxWjxxTmlb.getWjIndex());
|
||||
map.put("q_type",wWjxWjxxTmlb.getWjType());
|
||||
map.put("q_title",wWjxWjxxTmlb.getWjTitle());
|
||||
if(wWjxWjxxTmlb.getWjSubtype() != null){
|
||||
map.put("q_subtype",wWjxWjxxTmlb.getWjSubtype());
|
||||
List<Map<String, Object>> questionsList = new ArrayList<>();
|
||||
for (WjxWjxxTmlb wWjxWjxxTmlb : wjxWjxxTmlbList) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("q_index", wWjxWjxxTmlb.getWjIndex());
|
||||
map.put("q_type", wWjxWjxxTmlb.getWjType());
|
||||
map.put("q_title", wWjxWjxxTmlb.getWjTitle());
|
||||
if (wWjxWjxxTmlb.getWjSubtype() != null) {
|
||||
map.put("q_subtype", wWjxWjxxTmlb.getWjSubtype());
|
||||
}
|
||||
if(wjlx.equals("6")){
|
||||
if(wWjxWjxxTmlb.getWjType() != 8){
|
||||
if(wWjxWjxxTmlb.getWjScore()!=null){
|
||||
map.put("q_score",wWjxWjxxTmlb.getWjScore());
|
||||
if (wjlx.equals("6")) {
|
||||
if (wWjxWjxxTmlb.getWjType() != 8) {
|
||||
if (wWjxWjxxTmlb.getWjScore() != null) {
|
||||
map.put("q_score", wWjxWjxxTmlb.getWjScore());
|
||||
}
|
||||
map.put("is_requir",false);
|
||||
map.put("q_ceshi",true);
|
||||
map.put("is_toupiao",3);
|
||||
}else{
|
||||
map.put("is_requir",false);
|
||||
map.put("is_requir", false);
|
||||
map.put("q_ceshi", true);
|
||||
map.put("is_toupiao", 3);
|
||||
} else {
|
||||
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());
|
||||
for(WjxWjxxTmxx wjxWjxxTmxx:tmxxList){
|
||||
Map<String,Object> tmxxMap = new HashMap<>();
|
||||
tmxxMap.put("q_index",wjxWjxxTmxx.getWjIndex());
|
||||
tmxxMap.put("item_index",wjxWjxxTmxx.getItemIndex());
|
||||
tmxxMap.put("item_title",wjxWjxxTmxx.getItemTitle());
|
||||
tmxxMap.put("item_selected",Boolean.parseBoolean(wjxWjxxTmxx.getItemSelected()));
|
||||
tmxxMap.put("item_score",0);
|
||||
for (WjxWjxxTmxx wjxWjxxTmxx : tmxxList) {
|
||||
Map<String, Object> tmxxMap = new HashMap<>();
|
||||
tmxxMap.put("q_index", wjxWjxxTmxx.getWjIndex());
|
||||
tmxxMap.put("item_index", wjxWjxxTmxx.getItemIndex());
|
||||
tmxxMap.put("item_title", wjxWjxxTmxx.getItemTitle());
|
||||
tmxxMap.put("item_selected", Boolean.parseBoolean(wjxWjxxTmxx.getItemSelected()));
|
||||
tmxxMap.put("item_score", 0);
|
||||
JSONObject json = new JSONObject(tmxxMap);
|
||||
itemsList.add(json);
|
||||
}
|
||||
map.put("items",itemsList);
|
||||
}else if(wWjxWjxxTmlb.getWjType() == 5){
|
||||
map.put("items", itemsList);
|
||||
} else if (wWjxWjxxTmlb.getWjType() == 5) {
|
||||
//填空
|
||||
if(wWjxWjxxTmlb.getWjAnswer()!=null){
|
||||
map.put("answer",wWjxWjxxTmlb.getWjAnswer());
|
||||
}else{
|
||||
map.put("answer","跳过");
|
||||
if (wWjxWjxxTmlb.getWjAnswer() != null) {
|
||||
map.put("answer", wWjxWjxxTmlb.getWjAnswer());
|
||||
} else {
|
||||
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);
|
||||
questionsList.add(json);
|
||||
}
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//-----------题目必穿参数-------------
|
||||
map.put("creater","jwctest");
|
||||
map.put("atype",wjxWjxx.getAtype());
|
||||
map.put("title",wjxWjxx.getTitle());
|
||||
if(StringUtils.isNotEmpty(wjxWjxx.getContent())){
|
||||
map.put("desc",wjxWjxx.getContent());
|
||||
map.put("creater", "jwctest");
|
||||
map.put("atype", wjxWjxx.getAtype());
|
||||
map.put("title", wjxWjxx.getTitle());
|
||||
if (StringUtils.isNotEmpty(wjxWjxx.getContent())) {
|
||||
map.put("desc", wjxWjxx.getContent());
|
||||
}
|
||||
map.put("publish",true);
|
||||
map.put("questions",questionsList.toString());
|
||||
String result = wjxUtil.openapi(map,"1000101");
|
||||
map.put("publish", true);
|
||||
map.put("questions", questionsList.toString());
|
||||
String result = wjxUtil.openapi(map, "1000101");
|
||||
System.out.println(result);
|
||||
if(!result.equals("")){
|
||||
if (!result.equals("")) {
|
||||
JSONObject jsonResult = JSONObject.parseObject(result);
|
||||
if(jsonResult.getBoolean("result")){
|
||||
if (jsonResult.getBoolean("result")) {
|
||||
JSONObject dataJson = jsonResult.getJSONObject("data");
|
||||
String vid = dataJson.getString("vid");
|
||||
baseMapper.updateVid(id,vid);
|
||||
}else{
|
||||
baseMapper.updateVid(id, vid);
|
||||
} else {
|
||||
return jsonResult.getString("errormsg");
|
||||
}
|
||||
}
|
||||
|
@ -381,10 +375,10 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
|
||||
WjxWjxx wjxWjxx = baseMapper.selectById(id);
|
||||
String vid = wjxWjxx.getVid();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("vid",Integer.valueOf(vid));
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("vid", Integer.valueOf(vid));
|
||||
//调用接口,提交
|
||||
String result = wjxUtil.openapi(map,"1001101");
|
||||
String result = wjxUtil.openapi(map, "1001101");
|
||||
JSONObject jsonResult = JSONObject.parseObject(result);
|
||||
return jsonResult;
|
||||
}
|
||||
|
@ -393,13 +387,13 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
public JSONObject wjxxDownLoad(String id) {
|
||||
WjxWjxx wjxWjxx = baseMapper.selectById(id);
|
||||
String vid = wjxWjxx.getVid();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("vid",Integer.valueOf(vid));
|
||||
map.put("suffix",0);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("vid", Integer.valueOf(vid));
|
||||
map.put("suffix", 0);
|
||||
//调用接口,提交
|
||||
String result = wjxUtil.openapi(map,"1001004");
|
||||
String result = wjxUtil.openapi(map, "1001004");
|
||||
JSONObject jsonResult = JSONObject.parseObject(result);
|
||||
System.out.println("1----------->"+jsonResult.toString());
|
||||
System.out.println("1----------->" + jsonResult.toString());
|
||||
// if(StringUtils.equals("true",jsonResult.getString("result"))){
|
||||
// JSONObject data = jsonResult.getJSONObject("data");
|
||||
// String taskid = data.getString("taskid");
|
||||
|
@ -432,13 +426,13 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
}
|
||||
|
||||
@Override
|
||||
public IPage<KccyglSys> sysList(Page<KccyglSys> page, QueryWrapper<KccyglSys> queryWrapper,KccyglSys kccyglSys) {
|
||||
return baseMapper.sysList(page,queryWrapper,kccyglSys);
|
||||
public IPage<KccyglSys> sysList(Page<KccyglSys> page, QueryWrapper<KccyglSys> queryWrapper, KccyglSys kccyglSys) {
|
||||
return baseMapper.sysList(page, queryWrapper, kccyglSys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KccyglSys> exportSysXls(QueryWrapper<KccyglSys> queryWrapper,KccyglSys kccyglSys) {
|
||||
return baseMapper.exportSysXls(queryWrapper,kccyglSys);
|
||||
public List<KccyglSys> exportSysXls(QueryWrapper<KccyglSys> queryWrapper, KccyglSys kccyglSys) {
|
||||
return baseMapper.exportSysXls(queryWrapper, kccyglSys);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -448,7 +442,7 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
|
||||
@Override
|
||||
public String querySfdtById(String id, String username) {
|
||||
return baseMapper.querySfdtById(id,username);
|
||||
return baseMapper.querySfdtById(id, username);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -457,18 +451,17 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
WjxWjxx wjxWjxx = baseMapper.queryCyjgById(id);
|
||||
|
||||
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<WjxWjxxTmlb>();
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id",id);
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id", id);
|
||||
wjxWjxxTmlbQueryWrapper.orderByAsc("wj_index");
|
||||
List<WjxWjxxTmlb> list = wjxWjxxTmlbMapper.selectList(wjxWjxxTmlbQueryWrapper);
|
||||
|
||||
|
||||
|
||||
for(WjxWjxxTmlb WjxWjxxTmlb:list){
|
||||
for (WjxWjxxTmlb WjxWjxxTmlb : list) {
|
||||
String num = "0";
|
||||
String num2 = "0";
|
||||
// if(org.apache.commons.lang3.StringUtils.equals("5",WjxWjxxTmlb.getWjType()+"")){
|
||||
num= wjxDjxxMapper.getDjnumType(wjxWjxx.getVid(),WjxWjxxTmlb.getWjIndex(),null,"1");
|
||||
num2= wjxDjxxMapper.getDjnumType(wjxWjxx.getVid(),WjxWjxxTmlb.getWjIndex(),null,"2");
|
||||
num = wjxDjxxMapper.getDjnumType(wjxWjxx.getVid(), WjxWjxxTmlb.getWjIndex(), null, "1");
|
||||
num2 = wjxDjxxMapper.getDjnumType(wjxWjxx.getVid(), WjxWjxxTmlb.getWjIndex(), null, "2");
|
||||
WjxWjxxTmlb.setNum(num);
|
||||
WjxWjxxTmlb.setNum2(num2);
|
||||
// }
|
||||
|
@ -476,18 +469,18 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
int yzd = Integer.parseInt(num) + Integer.parseInt(num2);
|
||||
int ddrs = Integer.parseInt(num);
|
||||
int dcrs = Integer.parseInt(num2);
|
||||
List<WjxWjxxTmxx> list2= wjxWjxxTmxxMapper.selectByMainId(WjxWjxxTmlb.getId());
|
||||
List<WjxWjxxTmxx> list2 = wjxWjxxTmxxMapper.selectByMainId(WjxWjxxTmlb.getId());
|
||||
String itemSelected = "";
|
||||
for(WjxWjxxTmxx WjxWjxxTmxx:list2){
|
||||
String num3= wjxDjxxMapper.getDjnum(wjxWjxx.getVid(),WjxWjxxTmxx.getWjIndex(),WjxWjxxTmxx.getItemIndex());
|
||||
if(org.apache.commons.lang3.StringUtils.equals(WjxWjxxTmxx.getItemSelected(),"true")){
|
||||
itemSelected = itemSelected+WjxWjxxTmxx.getItemIndex()+",";
|
||||
for (WjxWjxxTmxx WjxWjxxTmxx : list2) {
|
||||
String num3 = wjxDjxxMapper.getDjnum(wjxWjxx.getVid(), WjxWjxxTmxx.getWjIndex(), WjxWjxxTmxx.getItemIndex());
|
||||
if (org.apache.commons.lang3.StringUtils.equals(WjxWjxxTmxx.getItemSelected(), "true")) {
|
||||
itemSelected = itemSelected + WjxWjxxTmxx.getItemIndex() + ",";
|
||||
|
||||
}
|
||||
WjxWjxxTmxx.setNum(num3);
|
||||
}
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(itemSelected)){
|
||||
itemSelected = itemSelected.substring(0, itemSelected.length()-1);
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(itemSelected)) {
|
||||
itemSelected = itemSelected.substring(0, itemSelected.length() - 1);
|
||||
}
|
||||
WjxWjxxTmlb.setItemSelected(itemSelected);
|
||||
WjxWjxxTmlb.setWjxWjxxTmxxList(list2);
|
||||
|
@ -505,29 +498,27 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
|
||||
|
||||
QueryWrapper<WjxWjxx> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.le("start_time",new Date());
|
||||
queryWrapper.eq("qpublish","0");
|
||||
queryWrapper.le("start_time", new Date());
|
||||
queryWrapper.eq("qpublish", "0");
|
||||
List<WjxWjxx> list = baseMapper.selectList(queryWrapper);
|
||||
for(WjxWjxx wjxWjxx : list){
|
||||
fbwj(wjxWjxx.getId(),wjxWjxx.getAtype());
|
||||
for (WjxWjxx wjxWjxx : list) {
|
||||
fbwj(wjxWjxx.getId(), wjxWjxx.getAtype());
|
||||
|
||||
QueryWrapper<Xxhbbks> queryWrapper2 = new QueryWrapper<>();
|
||||
queryWrapper2.apply("a.xh = b.xh");
|
||||
queryWrapper2.eq("b.KCAPZBBH",wjxWjxx.getRwbh());
|
||||
queryWrapper2.eq("b.KCAPZBBH", wjxWjxx.getRwbh());
|
||||
List<Xxhbbks> list2 = xxhbbksService.getXsxkbAllList(queryWrapper2);
|
||||
|
||||
|
||||
|
||||
|
||||
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
|
||||
kcKechengbiaoQueryWrapper.eq("rwbh",wjxWjxx.getRwbh());
|
||||
kcKechengbiaoQueryWrapper.eq("jgh",wjxWjxx.getCreateBy());
|
||||
kcKechengbiaoQueryWrapper.eq("xqxn",wjxWjxx.getXqxn());
|
||||
kcKechengbiaoQueryWrapper.eq("rwbh", wjxWjxx.getRwbh());
|
||||
kcKechengbiaoQueryWrapper.eq("jgh", wjxWjxx.getCreateBy());
|
||||
kcKechengbiaoQueryWrapper.eq("xqxn", wjxWjxx.getXqxn());
|
||||
kcKechengbiaoQueryWrapper.last("limit 1");
|
||||
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")+",请及时完成";
|
||||
for(Xxhbbks xxhbbks:list2){
|
||||
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) {
|
||||
try {
|
||||
//作业代办提醒
|
||||
ZyDbtx zyDbtx = new ZyDbtx();
|
||||
|
@ -540,7 +531,7 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
zyDbtx.setFbr(wjxWjxx.getCreateBy());
|
||||
zyDbtxService.save(zyDbtx);
|
||||
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -552,7 +543,7 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
|
||||
@Override
|
||||
public Page<WjxWjxx> listOther(WjxWjxx wjxWjxx, Page<Object> objectPage) {
|
||||
return baseMapper.listOther(wjxWjxx,objectPage);
|
||||
return baseMapper.listOther(wjxWjxx, objectPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -561,72 +552,71 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
|
||||
String token = getAccessToken();//获取东北师大开放平台token
|
||||
System.out.println("=======================================");
|
||||
System.out.println("token:"+token);
|
||||
System.out.println("token:" + token);
|
||||
System.out.println("=======================================");
|
||||
if(StringUtils.isNotEmpty(token)){//判断如果token不为空则继续操作
|
||||
if (StringUtils.isNotEmpty(token)) {//判断如果token不为空则继续操作
|
||||
|
||||
KcSysConfig kcSysConfig = kcSysConfigService.getById("1");
|
||||
String idsList[] = ids.split(",");
|
||||
if(idsList.length>0){
|
||||
String yyyy = DateUtils.formatDate(new Date(),"yyyy");
|
||||
String mm = DateUtils.formatDate(new Date(),"MM");
|
||||
for(String zyId:idsList){
|
||||
if (idsList.length > 0) {
|
||||
String yyyy = DateUtils.formatDate(new Date(), "yyyy");
|
||||
String mm = DateUtils.formatDate(new Date(), "MM");
|
||||
for (String zyId : idsList) {
|
||||
|
||||
|
||||
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<>();
|
||||
kcKechengbiaoQueryWrapper.eq("xqxn",kcSysConfig.getFlag1());
|
||||
kcKechengbiaoQueryWrapper.eq("rwbh",wjxWjxx.getRwbh());
|
||||
kcKechengbiaoQueryWrapper.eq("jgh",wjxWjxx.getCreateBy());
|
||||
kcKechengbiaoQueryWrapper.eq("xqxn", kcSysConfig.getFlag1());
|
||||
kcKechengbiaoQueryWrapper.eq("rwbh", wjxWjxx.getRwbh());
|
||||
kcKechengbiaoQueryWrapper.eq("jgh", wjxWjxx.getCreateBy());
|
||||
kcKechengbiaoQueryWrapper.last("limit 1");
|
||||
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
|
||||
|
||||
|
||||
//调用师大接口将数据上传
|
||||
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<>();
|
||||
paramMap.put("CJR",wjxWjxx.getCreateBy());//创建人
|
||||
paramMap.put("TEABH",wjxWjxx.getCreateBy());//教工号
|
||||
paramMap.put("FXCJMC","课程测验"+wjxWjxx.getSort());//分项成绩名称
|
||||
paramMap.put("TEADM",wjxWjxx.getCreateBy());//教工代码
|
||||
paramMap.put("TEAXM",kcKechengbiao.getSkjs());//教师姓名
|
||||
paramMap.put("FXCJBH",wjxWjxx.getId());//分项成绩编号
|
||||
paramMap.put("XNXQMC",kcKechengbiao.getXnxq());//学年学期
|
||||
paramMap.put("ZYYQ",null);//作业要求
|
||||
paramMap.put("CJSJ",DateUtils.formatDate(wjxWjxx.getCreateTime(),"yyyy-MM-dd"));//创建时间
|
||||
paramMap.put("FXCJBL",wjxWjxx.getScore());//比例,成绩占比
|
||||
paramMap.put("FXCJLXMC","3");//分项成绩类型
|
||||
paramMap.put("KCMC",kcKechengbiao.getKcmc());//课程名称
|
||||
paramMap.put("KCRWDM",wjxWjxx.getRwbh());//开课任务编号
|
||||
paramMap.put("PFBZ",null);//评分标准
|
||||
paramMap.put("FXCJDM",wjxWjxx.getId());//主键
|
||||
paramMap.put("CJR", wjxWjxx.getCreateBy());//创建人
|
||||
paramMap.put("TEABH", wjxWjxx.getCreateBy());//教工号
|
||||
paramMap.put("FXCJMC", "课程测验" + wjxWjxx.getSort());//分项成绩名称
|
||||
paramMap.put("TEADM", wjxWjxx.getCreateBy());//教工代码
|
||||
paramMap.put("TEAXM", kcKechengbiao.getSkjs());//教师姓名
|
||||
paramMap.put("FXCJBH", wjxWjxx.getId());//分项成绩编号
|
||||
paramMap.put("XNXQMC", kcKechengbiao.getXnxq());//学年学期
|
||||
paramMap.put("ZYYQ", null);//作业要求
|
||||
paramMap.put("CJSJ", DateUtils.formatDate(wjxWjxx.getCreateTime(), "yyyy-MM-dd"));//创建时间
|
||||
paramMap.put("FXCJBL", wjxWjxx.getScore());//比例,成绩占比
|
||||
paramMap.put("FXCJLXMC", "3");//分项成绩类型
|
||||
paramMap.put("KCMC", kcKechengbiao.getKcmc());//课程名称
|
||||
paramMap.put("KCRWDM", wjxWjxx.getRwbh());//开课任务编号
|
||||
paramMap.put("PFBZ", null);//评分标准
|
||||
paramMap.put("FXCJDM", wjxWjxx.getId());//主键
|
||||
// paramMap.put("OPERATE_STATUS","i");//操作状态
|
||||
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("data:"+data);
|
||||
System.out.println("data:" + data);
|
||||
System.out.println("=======================================");
|
||||
|
||||
|
||||
|
||||
QueryWrapper<WjxDjxx> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("vid",wjxWjxx.getVid());
|
||||
queryWrapper.eq("sfsckhcl","0");
|
||||
queryWrapper.eq("vid", wjxWjxx.getVid());
|
||||
queryWrapper.eq("sfsckhcl", "0");
|
||||
List<WjxDjxx> list = wjxDjxxMapper.selectList(queryWrapper);
|
||||
|
||||
List<Map<String, String>> paramsList2 =new ArrayList<>();
|
||||
for(WjxDjxx wjxDjxx:list){
|
||||
List<Map<String, String>> paramsList2 = new ArrayList<>();
|
||||
for (WjxDjxx wjxDjxx : list) {
|
||||
|
||||
|
||||
List<WjxDjxxTmxx> djxxTmxxList = wjxDjxxMapper.getDjxxTmxxWjt(wjxDjxx.getJid());
|
||||
if(djxxTmxxList!=null){
|
||||
for(WjxDjxxTmxx djxxTmxx:djxxTmxxList){
|
||||
if (djxxTmxxList != null) {
|
||||
for (WjxDjxxTmxx djxxTmxx : djxxTmxxList) {
|
||||
//上传作业文件
|
||||
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")){
|
||||
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")) {
|
||||
djxxTmxx.setFwqPath(uploadMap.get("data"));
|
||||
wjxDjxxMapper.updateDjxxTmxxFwqpath(djxxTmxx);
|
||||
}
|
||||
|
@ -652,32 +642,32 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
zyInfoScjlService.save(zyInfoScjl);
|
||||
|
||||
Map<String, String> paramMap2 = new HashMap<>();
|
||||
paramMap2.put("CJ",wjxDjxx.getScore()+"");//成绩
|
||||
paramMap2.put("CJR",wjxDjxx.getCreateBy());//创建人
|
||||
paramMap2.put("CJSJ",DateUtils.formatDate(wjxDjxx.getCreateTime(),"yyyy-MM-dd"));//创建时间
|
||||
paramMap2.put("KCRWDM",wjxWjxx.getRwbh());//开课任务编号
|
||||
paramMap2.put("KCMC",kcKechengbiao.getKcmc());//课程名称
|
||||
paramMap2.put("FXCJMC","课程测验"+wjxWjxx.getSort());//分项成绩名称
|
||||
paramMap2.put("TEAXM",kcKechengbiao.getSkjs());//教师姓名
|
||||
paramMap2.put("XSXM",wjxDjxx.getUserName());//学生姓名
|
||||
paramMap2.put("KID",wjxDjxx.getId());//主键
|
||||
paramMap2.put("XSBH",wjxDjxx.getCreateBy());//学号
|
||||
paramMap2.put("FXCJBH",wjxWjxx.getId());//分项成绩编号
|
||||
paramMap2.put("PATH","");//附件路径
|
||||
paramMap2.put("TEABH",wjxWjxx.getCreateBy());//教工号
|
||||
paramMap2.put("CJ", wjxDjxx.getScore() + "");//成绩
|
||||
paramMap2.put("CJR", wjxDjxx.getCreateBy());//创建人
|
||||
paramMap2.put("CJSJ", DateUtils.formatDate(wjxDjxx.getCreateTime(), "yyyy-MM-dd"));//创建时间
|
||||
paramMap2.put("KCRWDM", wjxWjxx.getRwbh());//开课任务编号
|
||||
paramMap2.put("KCMC", kcKechengbiao.getKcmc());//课程名称
|
||||
paramMap2.put("FXCJMC", "课程测验" + wjxWjxx.getSort());//分项成绩名称
|
||||
paramMap2.put("TEAXM", kcKechengbiao.getSkjs());//教师姓名
|
||||
paramMap2.put("XSXM", wjxDjxx.getUserName());//学生姓名
|
||||
paramMap2.put("KID", wjxDjxx.getId());//主键
|
||||
paramMap2.put("XSBH", wjxDjxx.getCreateBy());//学号
|
||||
paramMap2.put("FXCJBH", wjxWjxx.getId());//分项成绩编号
|
||||
paramMap2.put("PATH", "");//附件路径
|
||||
paramMap2.put("TEABH", wjxWjxx.getCreateBy());//教工号
|
||||
// paramMap2.put("OPERATE_STATUS","i");//操作状态
|
||||
paramsList2.add(paramMap2);
|
||||
|
||||
}
|
||||
|
||||
System.out.println("=======================================");
|
||||
System.out.println("paramsList2:"+paramsList2);
|
||||
System.out.println("paramsList2:" + paramsList2);
|
||||
System.out.println("=======================================");
|
||||
//调用师大接口进行上传
|
||||
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("data2:"+data2);
|
||||
System.out.println("data2:" + data2);
|
||||
System.out.println("=======================================");
|
||||
|
||||
wjxWjxx.setSfsckhcl("1");
|
||||
|
@ -690,14 +680,14 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
}
|
||||
|
||||
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String getAccessToken(){
|
||||
String token="";
|
||||
public String getAccessToken() {
|
||||
String token = "";
|
||||
try {
|
||||
// 获取令牌URL前缀
|
||||
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);
|
||||
// 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
|
||||
token = (String)map.get("access_token");
|
||||
token = (String) map.get("access_token");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -747,16 +738,16 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
|
||||
public void sendWxmessage(KcWechatSendLog kcWechatSendLog) {
|
||||
String openId = kcWechatSendLog.getOpenid();//曹老师账号
|
||||
System.out.println("openId:"+openId+"");
|
||||
if(org.apache.commons.lang3.StringUtils.isNotEmpty(openId)){
|
||||
System.out.println("openId:" + openId + "");
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(openId)) {
|
||||
try {
|
||||
String urlToken = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="+ appId +"&corpsecret=" + appIdSecret;
|
||||
System.out.println("urlToken: "+ urlToken);
|
||||
String urlToken = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + appId + "&corpsecret=" + appIdSecret;
|
||||
System.out.println("urlToken: " + urlToken);
|
||||
String res = HttpUtil.get(urlToken);
|
||||
JSONObject jsonObjectToken = JSONObject.parseObject(res);
|
||||
System.out.println("jsonObjectToken:{}"+ jsonObjectToken);
|
||||
System.out.println("jsonObjectToken:{}" + jsonObjectToken);
|
||||
String accessToken = jsonObjectToken.getString("access_token");
|
||||
System.out.println("accessToken:{}"+ accessToken);
|
||||
System.out.println("accessToken:{}" + accessToken);
|
||||
|
||||
// 微信的基础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
|
|||
|
||||
// 1、xx老师,你好,您本学期(2023秋)听课要求为:5次,当前实际听课次数:3次,请尽快完成本学期的听课任务。
|
||||
String html = kcWechatSendLog.getYtkcs();
|
||||
html = html + "\n<a href=\""+domainTo+"\">查看</a>";
|
||||
html = html + "\n<a href=\"" + domainTo + "\">查看</a>";
|
||||
sendMag.put("content", html);//授课老师推送内容
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
//拼接base参数
|
||||
|
@ -772,17 +763,17 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
|
|||
sendBody.put("touser", openId); // openId
|
||||
sendBody.put("msgtype", "text"); // 消息类型,此时固定为:text
|
||||
sendBody.put("agentid", agentid); // 企业id
|
||||
sendBody.put("text",sendMag); //发送内容
|
||||
sendBody.put("text", sendMag); //发送内容
|
||||
ResponseEntity<String> forEntity = restTemplate.postForEntity(url, sendBody, String.class);
|
||||
JSONObject jsonObject2 = JSONObject.parseObject(forEntity.getBody());
|
||||
System.out.println("jsonObject2 : " + jsonObject2);
|
||||
String messageCode = jsonObject2.getString("errcode");
|
||||
String msgId = jsonObject2.getString("msgid");
|
||||
System.out.println("messageCode : " + messageCode + ", msgId: " +msgId);
|
||||
}catch (Exception e) {
|
||||
System.out.println("messageCode : " + messageCode + ", msgId: " + msgId);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -120,6 +120,16 @@ public class ZyInfo implements Serializable {
|
|||
@Excel(name = "校内通过率", width = 15)
|
||||
@ApiModelProperty(value = "校内通过率")
|
||||
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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -7,10 +7,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.kc.zyInfo.entity.CyInfoSys;
|
||||
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
|
||||
import org.jeecg.modules.kc.zyInfo.entity.*;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys;
|
||||
|
||||
/**
|
||||
* @Description: 作业发布
|
||||
|
@ -20,7 +18,7 @@ import org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys;
|
|||
*/
|
||||
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);
|
||||
|
||||
|
@ -28,11 +26,11 @@ public interface ZyInfoMapper extends BaseMapper<ZyInfo> {
|
|||
|
||||
ZyInfo getKechengById(@Param("id") String id);
|
||||
|
||||
List<ZyInfo> zyzb(@Param("rwbh")String rwbh, @Param("xqxn")String xqxn, @Param("teano")String teano, @Param("zyLeixing")String zyLeixing);
|
||||
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);
|
||||
|
||||
|
@ -56,11 +54,21 @@ public interface ZyInfoMapper extends BaseMapper<ZyInfo> {
|
|||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -2,11 +2,48 @@
|
|||
<!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">
|
||||
|
||||
<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
|
||||
distinct
|
||||
a.*,b.id as stuId ,b.file_path as stuFilePath,b.score as stuscore,b.wwxsl,b.nwxsl,b.aigcxsl,b.xnxsl,b.pdf_path as stuPdfPath,b.zzdf,b.xshpfs,
|
||||
b.wwsftg,b.nwsftg,b.aigcsftg,b.xnsftg,round(ifnull(b.jxfs,'0') + ifnull(b.jxfs2,'0'),1) as jxfs, GREATEST(ifnull(b.wwxsl,0),ifnull(b.nwxsl,0),ifnull(b.aigcxsl,0),ifnull(b.xnxsl,0)) as zgccl,a.score as zyzb,b.score_fabu,b.py_content,b.py_file_path
|
||||
select distinct a.*,
|
||||
b.id as stuId,
|
||||
b.file_path as stuFilePath,
|
||||
b.score as stuscore,
|
||||
b.wwxsl,
|
||||
b.nwxsl,
|
||||
b.aigcxsl,
|
||||
b.xnxsl,
|
||||
b.pdf_path as stuPdfPath,
|
||||
b.zzdf,
|
||||
b.xshpfs,
|
||||
b.wwsftg,
|
||||
b.nwsftg,
|
||||
b.aigcsftg,
|
||||
b.xnsftg,
|
||||
round(ifnull(b.jxfs, '0') + ifnull(b.jxfs2, '0'), 1) as jxfs,
|
||||
GREATEST(ifnull(b.wwxsl, 0), ifnull(b.nwxsl, 0), ifnull(b.aigcxsl, 0),
|
||||
ifnull(b.xnxsl, 0)) as zgccl,
|
||||
a.score as zyzb,
|
||||
b.score_fabu,
|
||||
b.py_content,
|
||||
b.py_file_path
|
||||
from zy_info a
|
||||
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
|
||||
|
@ -14,86 +51,141 @@
|
|||
|
||||
</select>
|
||||
<select id="selectPage" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
|
||||
SELECT
|
||||
a.*,
|
||||
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
|
||||
FROM
|
||||
zy_info a
|
||||
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
|
||||
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
|
||||
SELECT a.*,
|
||||
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
|
||||
FROM zy_info a
|
||||
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
|
||||
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}
|
||||
|
||||
</select>
|
||||
|
||||
<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.zywccs, -- 作业完成次数
|
||||
b.cccs, -- 查重次数
|
||||
b.hpcs, -- 互评次数
|
||||
b.cswwccs -- 超时未完成次数
|
||||
FROM (
|
||||
select xnxq,rwbh,create_by,count(*) as num,
|
||||
FROM (select xnxq,
|
||||
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 = '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 xshpkg = '1' THEN 1 ELSE 0 END) AS hpcs,
|
||||
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 = '1' AND end_time < NOW() THEN 1
|
||||
ELSE 0
|
||||
END
|
||||
) AS cswwccs
|
||||
from zy_info GROUP BY xnxq,rwbh,create_by
|
||||
) b
|
||||
inner join (
|
||||
SELECT DISTINCT
|
||||
kcbh,kcmc,kkdw,kcxz,szkc,xqxn, rwbh, 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
|
||||
from zy_info
|
||||
GROUP BY xnxq, rwbh, create_by) b
|
||||
inner join (SELECT DISTINCT kcbh,
|
||||
kcmc,
|
||||
kkdw,
|
||||
kcxz,
|
||||
szkc,
|
||||
xqxn,
|
||||
rwbh,
|
||||
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 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.zywccs, -- 作业完成次数
|
||||
b.cccs, -- 查重次数
|
||||
b.hpcs, -- 互评次数
|
||||
b.cswwccs -- 超时未完成次数
|
||||
FROM (
|
||||
select xnxq,rwbh,create_by,count(*) as num,
|
||||
FROM (select xnxq,
|
||||
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 = '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 xshpkg = '1' THEN 1 ELSE 0 END) AS hpcs,
|
||||
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 = '1' AND end_time < NOW() THEN 1
|
||||
ELSE 0
|
||||
END
|
||||
) AS cswwccs
|
||||
from zy_info GROUP BY xnxq,rwbh,create_by
|
||||
) b
|
||||
inner join (
|
||||
SELECT DISTINCT
|
||||
kcbh,kcmc,kkdw,kcxz,szkc,xqxn, rwbh, 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
|
||||
from zy_info
|
||||
GROUP BY xnxq, rwbh, create_by) b
|
||||
inner join (SELECT DISTINCT kcbh,
|
||||
kcmc,
|
||||
kkdw,
|
||||
kcxz,
|
||||
szkc,
|
||||
xqxn,
|
||||
rwbh,
|
||||
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 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 = '0', '未发布', '已发布' ) as sffb,
|
||||
IF( a.xshpkg = '1', '是', '否' ) as sfhp,
|
||||
|
@ -108,7 +200,8 @@
|
|||
END
|
||||
) AS cswwccs
|
||||
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)
|
||||
<if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''">
|
||||
and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%')
|
||||
|
@ -138,40 +231,37 @@
|
|||
</select>
|
||||
|
||||
<select id="getKechengById" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
|
||||
select a.*,b.kcmc,b.skjs from zy_info a ,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 a.*, b.kcmc, b.skjs
|
||||
from zy_info a,
|
||||
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 id="zyzb" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
|
||||
SELECT
|
||||
sum( ifnull( score, '0' ) ) AS score,
|
||||
SELECT sum(ifnull(score, '0')) AS score,
|
||||
zy_leixing
|
||||
FROM
|
||||
zy_info
|
||||
WHERE
|
||||
xnxq = #{xqxn}
|
||||
FROM zy_info
|
||||
WHERE xnxq = #{xqxn}
|
||||
AND rwbh = #{rwbh}
|
||||
GROUP BY
|
||||
zy_leixing UNION ALL
|
||||
SELECT
|
||||
sum( ifnull( score, '0' ) ) AS score,
|
||||
GROUP BY zy_leixing
|
||||
UNION ALL
|
||||
SELECT sum(ifnull(score, '0')) AS score,
|
||||
CASE
|
||||
atype
|
||||
WHEN '1' THEN
|
||||
'2' ELSE '3'
|
||||
'2'
|
||||
ELSE '3'
|
||||
END zy_leixing
|
||||
FROM
|
||||
wjx_wjxx
|
||||
WHERE
|
||||
xqxn = #{xqxn}
|
||||
FROM wjx_wjxx
|
||||
WHERE xqxn = #{xqxn}
|
||||
AND rwbh = #{rwbh}
|
||||
GROUP BY
|
||||
atype
|
||||
GROUP BY atype
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="sysStaticList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
SELECT
|
||||
distinct a.id,
|
||||
|
@ -184,8 +274,10 @@
|
|||
a.start_time,
|
||||
a.end_time
|
||||
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
|
||||
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
|
||||
zy_info a, xxhbuser c,(select kcmc,rwbh,skjs,jgh from kc_kechengbiao where xqxn = #{zyInfoSys.xqxn} GROUP BY
|
||||
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 != ''">
|
||||
and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%')
|
||||
</if>
|
||||
|
@ -212,7 +304,6 @@
|
|||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="listOther" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
|
||||
select b.*,a.teacher_no,a.yuan_teacher_no,a.yuan_teacher_name from zy_cy_fenxiang a ,zy_info b
|
||||
where a.main_id = b.id
|
||||
|
@ -223,81 +314,170 @@
|
|||
|
||||
|
||||
<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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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 id="getXyZyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
select (@rownum:=@rownum + 1) AS rownum,t.* from (
|
||||
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
|
||||
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc
|
||||
select (@rownum:=@rownum + 1) AS rownum, t.*
|
||||
from (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) t,
|
||||
(SELECT @rownum:=0) AS r
|
||||
ORDER BY count - 0 desc
|
||||
</select>
|
||||
|
||||
<select id="getZyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
select (@rownum:=@rownum + 1) AS rownum,t.* from (
|
||||
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
|
||||
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc
|
||||
select (@rownum:=@rownum + 1) AS rownum, t.*
|
||||
from (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) t,
|
||||
(SELECT @rownum:=0) AS r
|
||||
ORDER BY count - 0 desc
|
||||
</select>
|
||||
|
||||
<select id="getZyTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
select (@rownum:=@rownum + 1) AS rownum,t.* from (
|
||||
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
|
||||
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc limit 10
|
||||
select (@rownum:=@rownum + 1) AS rownum, t.*
|
||||
from (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) t,
|
||||
(SELECT @rownum:=0) AS r
|
||||
ORDER BY count - 0 desc limit 10
|
||||
</select>
|
||||
|
||||
<select id="getCyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
select (@rownum:=@rownum + 1) AS rownum,t.* from (
|
||||
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
|
||||
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc
|
||||
select (@rownum:=@rownum + 1) AS rownum, t.*
|
||||
from (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) t,
|
||||
(SELECT @rownum:=0) AS r
|
||||
ORDER BY count - 0 desc
|
||||
</select>
|
||||
|
||||
<select id="getCyTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
select (@rownum:=@rownum + 1) AS rownum,t.* from (
|
||||
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
|
||||
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc limit 10
|
||||
select (@rownum:=@rownum + 1) AS rownum, t.*
|
||||
from (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) t,
|
||||
(SELECT @rownum:=0) AS r
|
||||
ORDER BY count - 0 desc limit 10
|
||||
</select>
|
||||
|
||||
<select id="getXYCyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
select (@rownum:=@rownum + 1) AS rownum,t.* from (
|
||||
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
|
||||
) t , (SELECT @rownum:=0) AS r ORDER BY count-0 desc
|
||||
select (@rownum:=@rownum + 1) AS rownum, t.*
|
||||
from (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) t,
|
||||
(SELECT @rownum:=0) AS r
|
||||
ORDER BY count - 0 desc
|
||||
</select>
|
||||
|
||||
<select id="getKcTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
SELECT
|
||||
( @rownum := @rownum + 1 ) AS rownum,
|
||||
SELECT (@rownum := @rownum + 1) AS rownum,
|
||||
t.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
b.kcmc,
|
||||
FROM (SELECT b.kcmc,
|
||||
count(*) AS count,
|
||||
b.kkdw
|
||||
FROM
|
||||
|
@ -305,35 +485,30 @@
|
|||
kc_kechengbiao b
|
||||
WHERE
|
||||
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
|
||||
|
||||
SELECT
|
||||
b.kcmc,
|
||||
count(*) AS count,
|
||||
count (*) AS count,
|
||||
b.kkdw
|
||||
FROM
|
||||
wjx_wjxx a,
|
||||
kc_kechengbiao b
|
||||
WHERE
|
||||
a.rwbh = b.rwbh
|
||||
AND a.xqxn = #{zyInfoSys.xqxn} GROUP BY b.kcmc,b.kkdw
|
||||
) t,
|
||||
( SELECT @rownum := 0 ) AS r
|
||||
ORDER BY
|
||||
count - 0 DESC
|
||||
LIMIT 10
|
||||
AND a.xqxn = #{zyInfoSys.xqxn}
|
||||
GROUP BY b.kcmc, b.kkdw) t,
|
||||
(SELECT @rownum := 0) AS r
|
||||
ORDER BY count - 0 DESC LIMIT 10
|
||||
</select>
|
||||
|
||||
<select id="getXnKcList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
SELECT
|
||||
( @rownum := @rownum + 1 ) AS rownum,
|
||||
SELECT (@rownum := @rownum + 1) AS rownum,
|
||||
t.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
b.kcmc,
|
||||
FROM (SELECT b.kcmc,
|
||||
count(*) AS count,
|
||||
b.kkdw
|
||||
FROM
|
||||
|
@ -341,34 +516,30 @@
|
|||
kc_kechengbiao b
|
||||
WHERE
|
||||
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
|
||||
|
||||
SELECT
|
||||
b.kcmc,
|
||||
count(*) AS count,
|
||||
count (*) AS count,
|
||||
b.kkdw
|
||||
FROM
|
||||
wjx_wjxx a,
|
||||
kc_kechengbiao b
|
||||
WHERE
|
||||
a.rwbh = b.rwbh
|
||||
AND a.xqxn = #{zyInfoSys.xqxn} GROUP BY b.kcmc,b.kkdw
|
||||
) t,
|
||||
( SELECT @rownum := 0 ) AS r
|
||||
ORDER BY
|
||||
count - 0 DESC
|
||||
AND a.xqxn = #{zyInfoSys.xqxn}
|
||||
GROUP BY b.kcmc, b.kkdw) t,
|
||||
(SELECT @rownum := 0) AS r
|
||||
ORDER BY count - 0 DESC
|
||||
</select>
|
||||
|
||||
<select id="getJsTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
SELECT
|
||||
( @rownum := @rownum + 1 ) AS rownum,
|
||||
SELECT (@rownum := @rownum + 1) AS rownum,
|
||||
t.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a.create_by,
|
||||
FROM (SELECT a.create_by,
|
||||
count(*) AS count,
|
||||
b.xm AS skjs,
|
||||
b.dwmc AS kkdw
|
||||
|
@ -377,13 +548,16 @@
|
|||
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
|
||||
AND xnxq = #{zyInfoSys.xqxn}
|
||||
and zy_status in (1
|
||||
, 2)
|
||||
GROUP BY a.create_by, b.xm, b.dwmc
|
||||
|
||||
union all
|
||||
|
||||
SELECT
|
||||
a.create_by,
|
||||
count(*) AS count,
|
||||
count (*) AS count,
|
||||
b.xm AS skjs,
|
||||
b.dwmc AS kkdw
|
||||
FROM
|
||||
|
@ -391,22 +565,18 @@
|
|||
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
|
||||
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 id="getXnJsList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
SELECT
|
||||
( @rownum := @rownum + 1 ) AS rownum,
|
||||
SELECT (@rownum := @rownum + 1) AS rownum,
|
||||
t.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a.create_by,
|
||||
FROM (SELECT a.create_by,
|
||||
count(*) AS count,
|
||||
b.xm AS skjs,
|
||||
b.dwmc AS kkdw
|
||||
|
@ -415,13 +585,16 @@
|
|||
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
|
||||
AND xnxq = #{zyInfoSys.xqxn}
|
||||
and zy_status in (1
|
||||
, 2)
|
||||
GROUP BY a.create_by, b.xm, b.dwmc
|
||||
|
||||
union all
|
||||
|
||||
SELECT
|
||||
a.create_by,
|
||||
count(*) AS count,
|
||||
count (*) AS count,
|
||||
b.xm AS skjs,
|
||||
b.dwmc AS kkdw
|
||||
FROM
|
||||
|
@ -429,11 +602,12 @@
|
|||
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
|
||||
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 id="sysStaticZyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
|
@ -442,7 +616,8 @@
|
|||
IF( a.zy_status = '0', '未发布', '已发布' ) as sffb,
|
||||
IF( a.xshpkg = '1', '是', '否' ) as sfhp
|
||||
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)
|
||||
<if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''">
|
||||
and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%')
|
||||
|
@ -465,7 +640,8 @@
|
|||
IF( a.qpublish = '2', '全部完成', '未全部完成' ) as sfwc,
|
||||
IF( a.qpublish = '0', '未发布', '已发布' ) as sffb
|
||||
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)
|
||||
<if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''">
|
||||
and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%')
|
||||
|
@ -485,7 +661,8 @@
|
|||
IF( a.qpublish = '2', '全部完成', '未全部完成' ) as sfwc,
|
||||
IF( a.qpublish = '0', '未发布', '已发布' ) as sffb
|
||||
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)
|
||||
<if test="zyInfoSys.kcmc != null and zyInfoSys.kcmc != ''">
|
||||
and a.kcmc like concat('%',#{zyInfoSys.kcmc},'%')
|
||||
|
@ -502,11 +679,62 @@
|
|||
</select>
|
||||
|
||||
<select id="listKhcl" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
zy_info
|
||||
${ew.customSqlSegment}
|
||||
SELECT *
|
||||
FROM zy_info ${ew.customSqlSegment}
|
||||
|
||||
</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>
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -7,6 +7,7 @@ import org.jeecg.modules.kc.zyInfo.entity.CyInfoSys;
|
|||
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys;
|
||||
import org.jeecg.modules.kc.zyInfo.entity.ZyXzInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -35,9 +36,9 @@ public interface IZyInfoService extends IService<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);
|
||||
|
||||
|
@ -46,4 +47,8 @@ public interface IZyInfoService extends IService<ZyInfo> {
|
|||
List<CyInfoSys> getStaticCyExportUrl(CyInfoSys cyInfoSys);
|
||||
|
||||
IPage<ZyInfo> listKhcl(Page<ZyInfo> page, QueryWrapper<ZyInfo> queryWrapper);
|
||||
|
||||
List<ZyXzInfo> getxzxx(ZyInfo zyInfo);
|
||||
|
||||
int saveData(String zyinfoId, Integer rs, List<ZyXzInfo> list);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg.modules.kc.zyInfo.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.zyDbtx.entity.ZyDbtx;
|
||||
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
|
||||
import org.jeecg.modules.kc.zyInfo.entity.CyInfoSys;
|
||||
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
|
||||
import org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys;
|
||||
import org.jeecg.modules.kc.zyInfo.entity.*;
|
||||
import org.jeecg.modules.kc.zyInfo.mapper.ZyInfoMapper;
|
||||
import org.jeecg.modules.kc.zyInfo.service.IZyInfoService;
|
||||
import org.jeecg.modules.tools.DateUtils;
|
||||
|
@ -27,9 +26,11 @@ import org.springframework.http.ResponseEntity;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 作业发布
|
||||
|
@ -253,12 +254,12 @@ public class ZyInfoServiceImpl extends ServiceImpl<ZyInfoMapper, ZyInfo> impleme
|
|||
map.put("jr_zy_ywczcs", jr_zy_ywczcs);//今日作业已完成总次数:
|
||||
map.put("jr_cy_syzcs", jr_cy_syzcs);//今日测验使用总次数:
|
||||
map.put("jr_cy_ywczcs", jr_cy_ywczcs);//今日测验已完成总次数:
|
||||
map.put("xn_kc_zyzxsrc",xn_kc_zyzxsrc );//使用课程作业总学生人次
|
||||
map.put("xn_kc_zyhp",xn_kc_zyhp );//使用课程作业互评总学生人次
|
||||
map.put("xn_kc_zycc",xn_kc_zycc );//使用课程作业查重总学生人次
|
||||
map.put("xn_kc_zywczxsrc",xn_kc_zywczxsrc );//完成课程作业总学生人次
|
||||
map.put("xn_kc_ktcy",xn_kc_ktcy );//使用课堂测验总学生人次
|
||||
map.put("xn_kc_wccy",xn_kc_wccy );//完成课堂测验总学生人次
|
||||
map.put("xn_kc_zyzxsrc", xn_kc_zyzxsrc);//使用课程作业总学生人次
|
||||
map.put("xn_kc_zyhp", xn_kc_zyhp);//使用课程作业互评总学生人次
|
||||
map.put("xn_kc_zycc", xn_kc_zycc);//使用课程作业查重总学生人次
|
||||
map.put("xn_kc_zywczxsrc", xn_kc_zywczxsrc);//完成课程作业总学生人次
|
||||
map.put("xn_kc_ktcy", xn_kc_ktcy);//使用课堂测验总学生人次
|
||||
map.put("xn_kc_wccy", xn_kc_wccy);//完成课堂测验总学生人次
|
||||
map.put("xntop10", list1);//本学年作业使用排行TOP10
|
||||
map.put("jrtop10", list2);//本学年测验使用排行TOP10
|
||||
map.put("kctop10", list3);//本学年课程使用排行TOP10
|
||||
|
@ -269,18 +270,18 @@ public class ZyInfoServiceImpl extends ServiceImpl<ZyInfoMapper, ZyInfo> impleme
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ZyInfoSys> getPHData(ZyInfoSys zyInfoSys,String tag) {
|
||||
public List<ZyInfoSys> getPHData(ZyInfoSys zyInfoSys, String tag) {
|
||||
List<ZyInfoSys> list = Lists.newArrayList();
|
||||
if("xntop10".equals(tag)){
|
||||
if ("xntop10".equals(tag)) {
|
||||
list = baseMapper.getZyList(zyInfoSys);
|
||||
}
|
||||
if("jrtop10".equals(tag)){
|
||||
if ("jrtop10".equals(tag)) {
|
||||
list = baseMapper.getCyList(zyInfoSys);
|
||||
}
|
||||
if("kctop10".equals(tag)){
|
||||
if ("kctop10".equals(tag)) {
|
||||
list = baseMapper.getXnKcList(zyInfoSys);
|
||||
}
|
||||
if("jstop10".equals(tag)){
|
||||
if ("jstop10".equals(tag)) {
|
||||
list = baseMapper.getXnJsList(zyInfoSys);
|
||||
}
|
||||
return list;
|
||||
|
@ -306,6 +307,48 @@ public class ZyInfoServiceImpl extends ServiceImpl<ZyInfoMapper, ZyInfo> impleme
|
|||
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
|
||||
private static final String appId = "wx031697a8ca09a5ce";//东师
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.collect.Maps;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.service.IZyDbtxService;
|
||||
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.zyInfoScjl.entity.ZyInfoScjl;
|
||||
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.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Description: 学生提交作业
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-05-06
|
||||
|
@ -846,7 +845,7 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
|
|||
@AutoLog(value = "作业驳回")
|
||||
@ApiOperation(value="作业驳回", notes="作业驳回")
|
||||
@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.set("file_path",null);
|
||||
updateWrapper.set("pdf_path",null);
|
||||
|
@ -886,10 +885,9 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
|
|||
zyDbtxService.save(zyDbtx);
|
||||
|
||||
|
||||
|
||||
//查重前删除原来的查重数据
|
||||
// zyCcjgService.deleteByZystuid(zyInfoStudent.getId(),response);
|
||||
return Result.OK("作业驳回成功!");
|
||||
return Result.OK(new HashMap());
|
||||
}
|
||||
|
||||
@AutoLog(value = "设置作业存档类型")
|
||||
|
@ -1235,4 +1233,21 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
|
|||
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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,5 +226,7 @@ public class ZyInfoStudent implements Serializable {
|
|||
private String ywid;//业务id
|
||||
@TableField(exist = false)
|
||||
private String stuId;//学生作业临时id
|
||||
@TableField(exist = false)
|
||||
private String sfzz;//是否是组长
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
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.ZyInfoStudentSys;
|
||||
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> cxtjByJccsbz();
|
||||
|
||||
List<ZyInfoStudent> getZyStuId(@Param("dto") ZyXzryInfo zyXzryInfo);
|
||||
|
||||
List<ZyInfoStudent> getZyStuIdById(@Param("dto") ZyXzryInfo zyXzryInfo);
|
||||
}
|
||||
|
|
|
@ -180,4 +180,54 @@
|
|||
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>
|
||||
<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>
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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 com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudentSys;
|
||||
|
@ -41,7 +42,7 @@ public interface IZyInfoStudentService extends IService<ZyInfoStudent> {
|
|||
|
||||
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);
|
||||
|
||||
|
@ -64,4 +65,8 @@ public interface IZyInfoStudentService extends IService<ZyInfoStudent> {
|
|||
List<JSONObject> getWpSycccs();
|
||||
|
||||
void getWpcccs();
|
||||
|
||||
List<ZyInfoStudent> getZyStuId(ZyXzryInfo zyXzryInfo);
|
||||
|
||||
List<ZyInfoStudent> getZyStuIdById(ZyXzryInfo zyXzryInfo);
|
||||
}
|
||||
|
|
|
@ -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.mapper.ZyCcjgMapper;
|
||||
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.zyInfoScjl.entity.ZyInfoScjl;
|
||||
import org.jeecg.modules.kc.zyInfoScjl.service.IZyInfoScjlService;
|
||||
|
@ -83,7 +84,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
this.uploadpath = uploadPath;
|
||||
}
|
||||
|
||||
@Value(value="${jeecg.uploadType}")
|
||||
@Value(value = "${jeecg.uploadType}")
|
||||
private String uploadType;
|
||||
|
||||
private static String weipuId;
|
||||
|
@ -95,6 +96,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
|
||||
|
||||
private static String weipuKey;
|
||||
|
||||
@Value("${weipu.userKey}")
|
||||
public void setWeipuKey(String weipuKey) {
|
||||
this.weipuKey = weipuKey;
|
||||
|
@ -136,7 +138,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
|
||||
@Override
|
||||
public IPage<ZyInfoStudent> cdxxlist(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper) {
|
||||
return baseMapper.cdxxlist(page,queryWrapper);
|
||||
return baseMapper.cdxxlist(page, queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -146,7 +148,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
|
||||
@Override
|
||||
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.setId(asList.get(i));
|
||||
zyInfoStudent.setScoreFabu("1");
|
||||
|
@ -166,23 +168,23 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
|
||||
@Override
|
||||
public boolean stuWpKsjc(ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
|
||||
String fileName = getFileName(zyInfoStudent.getFilePath(),response);
|
||||
String fileName = getFileName(zyInfoStudent.getFilePath(), response);
|
||||
zyInfoStudent.setFilePath(fileName);
|
||||
System.out.println("----------------1---------------------"+zyInfoStudent.getStuId());
|
||||
if(StringUtils.isEmpty(zyInfoStudent.getStuId())){
|
||||
System.out.println("----------------1---------------------" + zyInfoStudent.getStuId());
|
||||
if (StringUtils.isEmpty(zyInfoStudent.getStuId())) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
QueryWrapper<ZyInfoStudent> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("a.main_id",zyInfoStudent.getId());
|
||||
queryWrapper.eq("a.create_by",sysUser.getUsername());
|
||||
queryWrapper.eq("a.main_id", zyInfoStudent.getId());
|
||||
queryWrapper.eq("a.create_by", sysUser.getUsername());
|
||||
List<ZyInfoStudent> list1 = baseMapper.selectList(queryWrapper);
|
||||
zyInfoStudent = list1.get(0);
|
||||
}else{
|
||||
} else {
|
||||
zyInfoStudent = baseMapper.selectById(zyInfoStudent.getStuId());
|
||||
}
|
||||
|
||||
System.out.println("----------------2---------------------"+zyInfoStudent);
|
||||
System.out.println("----------------2---------------------" + zyInfoStudent);
|
||||
ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId());
|
||||
System.out.println("----------------3---------------------"+zyInfo);
|
||||
System.out.println("----------------3---------------------" + zyInfo);
|
||||
|
||||
|
||||
// String rwbh = zyInfo.getRwbh();
|
||||
|
@ -191,7 +193,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
// kcKechengbiaoQueryWrapper.eq("rwbh",rwbh);
|
||||
// kcKechengbiaoQueryWrapper.last("limit 1");
|
||||
// KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
|
||||
String cateid = zyInfo.getId()+""+zyInfo.getTitle();
|
||||
String cateid = zyInfo.getId() + "" + zyInfo.getTitle();
|
||||
String catename = zyInfo.getTitle();
|
||||
zyInfoStudent.setCateid(cateid);
|
||||
zyInfoStudent.setCatename(catename);
|
||||
|
@ -203,22 +205,22 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
System.out.println("----------------5---------------------");
|
||||
|
||||
//外网查重及提交检测
|
||||
if(StringUtils.equals(zyInfo.getWwcc(),"true")){
|
||||
wwccSave(zyInfoStudent,response);
|
||||
if (StringUtils.equals(zyInfo.getWwcc(), "true")) {
|
||||
wwccSave(zyInfoStudent, response);
|
||||
}
|
||||
//内网查重及提交检测
|
||||
if(StringUtils.equals(zyInfo.getNwcc(),"true")){
|
||||
nwccSave(zyInfoStudent,response);
|
||||
if (StringUtils.equals(zyInfo.getNwcc(), "true")) {
|
||||
nwccSave(zyInfoStudent, response);
|
||||
}
|
||||
//aigc查重及提交检测
|
||||
if(StringUtils.equals(zyInfo.getAigccc(),"true")){
|
||||
aigcSave(zyInfoStudent,response);
|
||||
if (StringUtils.equals(zyInfo.getAigccc(), "true")) {
|
||||
aigcSave(zyInfoStudent, response);
|
||||
}
|
||||
//校内查重及提交检测
|
||||
if(StringUtils.equals(zyInfo.getXncc(),"true")){
|
||||
if (StringUtils.equals(zyInfo.getXncc(), "true")) {
|
||||
zyInfoStudent.setCateid("DBSDQXZYBDK001");
|
||||
zyInfoStudent.setCatename("东北师大全校作业比对库");
|
||||
xnccSave(zyInfoStudent,"1",response);//提交比对
|
||||
xnccSave(zyInfoStudent, "1", response);//提交比对
|
||||
// }else{
|
||||
// zyInfoStudent.setCateid("DBSDQXZYBDK001");
|
||||
// zyInfoStudent.setCatename("东北师大全校作业比对库");
|
||||
|
@ -229,13 +231,13 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
}
|
||||
|
||||
@Override
|
||||
public IPage<ZyInfoStudent> getHpxxList(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper,String zyStuId) {
|
||||
return baseMapper.getHpxxList(page,queryWrapper,zyStuId);
|
||||
public IPage<ZyInfoStudent> getHpxxList(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper, String zyStuId) {
|
||||
return baseMapper.getHpxxList(page, queryWrapper, zyStuId);
|
||||
}
|
||||
|
||||
@Override
|
||||
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.setId(asList.get(i));
|
||||
zyInfoStudent.setSfsckhcl("1");
|
||||
|
@ -245,7 +247,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
|
||||
@Override
|
||||
public IPage<ZyInfoStudent> getList2(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper) {
|
||||
return baseMapper.getList2(page,queryWrapper);
|
||||
return baseMapper.getList2(page, queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -259,20 +261,19 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
|
||||
|
||||
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.eq("a.main_id",zyInfoStudent.getId());
|
||||
queryWrapper.eq("a.main_id", zyInfoStudent.getId());
|
||||
queryWrapper.isNotNull("a.file_path");
|
||||
List<ZyInfoStudent> list = baseMapper.selectList(queryWrapper);
|
||||
for(ZyInfoStudent par : list){
|
||||
for (ZyInfoStudent par : list) {
|
||||
par.setCateid("DBSDQXZYBDK001");
|
||||
par.setCatename("东北师大全校作业比对库");
|
||||
xnccUpdate(par,"1",response);//提交比对
|
||||
xnccUpdate(par, "1", response);//提交比对
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
|
@ -294,9 +295,9 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
try {
|
||||
String token = wjxWjxxService.getAccessToken();//获取东北师大开放平台token
|
||||
System.out.println("=======================================");
|
||||
System.out.println("token:"+token);
|
||||
System.out.println("token:" + token);
|
||||
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 yyyy = DateUtils.formatDate(new Date(), "yyyy");
|
||||
|
@ -322,10 +323,10 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
Map<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("CJR", 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("FXCJLXMC", "0");//分项成绩类型
|
||||
}else{
|
||||
} else {
|
||||
paramMap.put("FXCJMC", "期末考试" + zyInfo.getSort());//分项成绩名称
|
||||
paramMap.put("FXCJLXMC", "1");//分项成绩类型
|
||||
}
|
||||
|
@ -354,7 +355,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
List<ZyInfoStudent> list = baseMapper.selectList(queryWrapper);
|
||||
|
||||
|
||||
List<Map<String, String>> paramsList2 =new ArrayList<>();
|
||||
List<Map<String, String>> paramsList2 = new ArrayList<>();
|
||||
for (ZyInfoStudent zyInfoStudentPar2 : list) {
|
||||
if (StringUtils.isNotEmpty(zyInfoStudentPar2.getFilePath())) {
|
||||
//上传作业文件
|
||||
|
@ -394,23 +395,23 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
zyInfoScjlService.save(zyInfoScjl);
|
||||
|
||||
Map<String, String> paramMap2 = new HashMap<>();
|
||||
paramMap2.put("CJ",zyInfoStudentPar2.getZzdf()+"");//成绩
|
||||
paramMap2.put("CJR",zyInfoStudentPar2.getCreateBy());//创建人
|
||||
paramMap2.put("CJSJ",DateUtils.formatDate(zyInfoStudentPar2.getCreateTime(),"yyyy-MM-dd"));//创建时间
|
||||
paramMap2.put("KCRWDM",zyInfo.getRwbh());//开课任务编号
|
||||
paramMap2.put("KCMC",kcKechengbiao.getKcmc());//课程名称
|
||||
if(StringUtils.equals(zyInfo.getZyLeixing(),"0")){
|
||||
paramMap2.put("CJ", zyInfoStudentPar2.getZzdf() + "");//成绩
|
||||
paramMap2.put("CJR", zyInfoStudentPar2.getCreateBy());//创建人
|
||||
paramMap2.put("CJSJ", DateUtils.formatDate(zyInfoStudentPar2.getCreateTime(), "yyyy-MM-dd"));//创建时间
|
||||
paramMap2.put("KCRWDM", zyInfo.getRwbh());//开课任务编号
|
||||
paramMap2.put("KCMC", kcKechengbiao.getKcmc());//课程名称
|
||||
if (StringUtils.equals(zyInfo.getZyLeixing(), "0")) {
|
||||
paramMap2.put("FXCJMC", "课程作业" + zyInfo.getSort());//分项成绩名称
|
||||
}else{
|
||||
} else {
|
||||
paramMap2.put("FXCJMC", "期末考试" + zyInfo.getSort());//分项成绩名称
|
||||
}
|
||||
paramMap2.put("TEAXM",kcKechengbiao.getSkjs());//教师姓名
|
||||
paramMap2.put("XSXM",zyInfoStudentPar2.getStudentName());//学生姓名
|
||||
paramMap2.put("KID",zyInfoStudentPar2.getId());//主键
|
||||
paramMap2.put("XSBH",zyInfoStudentPar2.getCreateBy());//学号
|
||||
paramMap2.put("FXCJBH",zyInfoStudentPar2.getMainId());//分项成绩编号
|
||||
paramMap2.put("PATH",zyInfoStudentPar2.getFwqPath());//附件路径
|
||||
paramMap2.put("TEABH",zyInfo.getCreateBy());//教工号
|
||||
paramMap2.put("TEAXM", kcKechengbiao.getSkjs());//教师姓名
|
||||
paramMap2.put("XSXM", zyInfoStudentPar2.getStudentName());//学生姓名
|
||||
paramMap2.put("KID", zyInfoStudentPar2.getId());//主键
|
||||
paramMap2.put("XSBH", zyInfoStudentPar2.getCreateBy());//学号
|
||||
paramMap2.put("FXCJBH", zyInfoStudentPar2.getMainId());//分项成绩编号
|
||||
paramMap2.put("PATH", zyInfoStudentPar2.getFwqPath());//附件路径
|
||||
paramMap2.put("TEABH", zyInfo.getCreateBy());//教工号
|
||||
// paramMap2.put("OPERATE_STATUS","i");//操作状态
|
||||
paramsList2.add(paramMap2);
|
||||
// }
|
||||
|
@ -418,13 +419,13 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
}
|
||||
|
||||
System.out.println("=======================================");
|
||||
System.out.println("paramsList2:"+paramsList2);
|
||||
System.out.println("paramsList2:" + paramsList2);
|
||||
System.out.println("=======================================");
|
||||
//调用师大接口进行上传
|
||||
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("data2:"+data2);
|
||||
System.out.println("data2:" + data2);
|
||||
System.out.println("=======================================");
|
||||
|
||||
zyInfo.setSfsckhcl("1");
|
||||
|
@ -437,7 +438,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -449,13 +450,13 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
|
||||
@Override
|
||||
public void sysWpKsjc(ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
|
||||
String fileName = getFileName(zyInfoStudent.getFilePath(),response);
|
||||
String fileName = getFileName(zyInfoStudent.getFilePath(), response);
|
||||
zyInfoStudent.setFilePath(fileName);
|
||||
|
||||
ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId());
|
||||
|
||||
|
||||
String cateid = zyInfo.getId()+""+zyInfo.getTitle();
|
||||
String cateid = zyInfo.getId() + "" + zyInfo.getTitle();
|
||||
String catename = zyInfo.getTitle();
|
||||
zyInfoStudent.setCateid(cateid);
|
||||
zyInfoStudent.setCatename(catename);
|
||||
|
@ -473,8 +474,8 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
// nwccSave(zyInfoStudent,response);
|
||||
// }
|
||||
//aigc查重及提交检测
|
||||
if(StringUtils.equals(zyInfo.getAigccc(),"true")){
|
||||
aigcSave(zyInfoStudent,response);
|
||||
if (StringUtils.equals(zyInfo.getAigccc(), "true")) {
|
||||
aigcSave(zyInfoStudent, response);
|
||||
}
|
||||
// //校内查重及提交检测
|
||||
// if(StringUtils.equals(zyInfo.getXncc(),"true")){
|
||||
|
@ -490,11 +491,11 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
List<JSONObject> list = new ArrayList<>();
|
||||
|
||||
String url = "https://vims.fanyu.com/toole/jianceorgan/papercheckcount.aspx";
|
||||
JSONObject object= getSycs(url,"1");
|
||||
object.put("name","外网检测");
|
||||
JSONObject object = getSycs(url, "1");
|
||||
object.put("name", "外网检测");
|
||||
|
||||
JSONObject object2= getSycs(url,"3");
|
||||
object2.put("name","AIGC检测");
|
||||
JSONObject object2 = getSycs(url, "3");
|
||||
object2.put("name", "AIGC检测");
|
||||
|
||||
list.add(object);
|
||||
list.add(object2);
|
||||
|
@ -505,27 +506,37 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
public void getWpcccs() {
|
||||
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");
|
||||
if(wwremaincount<=200){
|
||||
if (wwremaincount <= 200) {
|
||||
KcWechatSendLog kcWechatSendLog = new KcWechatSendLog();
|
||||
kcWechatSendLog.setOpenid("2016900057");
|
||||
kcWechatSendLog.setYtkcs("维普【外网检测】查重次数不足,剩余"+wwremaincount+"次,请及时充值!");
|
||||
kcWechatSendLog.setYtkcs("维普【外网检测】查重次数不足,剩余" + wwremaincount + "次,请及时充值!");
|
||||
sendWxmessage(kcWechatSendLog);
|
||||
}
|
||||
|
||||
//获取AIGC检测剩余查重次数
|
||||
JSONObject object2= getSycs(url,"3");
|
||||
JSONObject object2 = getSycs(url, "3");
|
||||
int aigcremaincount = object2.getIntValue("remaincount");
|
||||
if(aigcremaincount<=200){
|
||||
if (aigcremaincount <= 200) {
|
||||
KcWechatSendLog kcWechatSendLog = new KcWechatSendLog();
|
||||
kcWechatSendLog.setOpenid("2016900057");
|
||||
kcWechatSendLog.setYtkcs("维普【AIGC检测】查重次数不足,剩余"+aigcremaincount+"次,请及时充值!");
|
||||
kcWechatSendLog.setYtkcs("维普【AIGC检测】查重次数不足,剩余" + aigcremaincount + "次,请及时充值!");
|
||||
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>();
|
||||
//可以设置多个input的name,value
|
||||
String sign = getSign();
|
||||
|
@ -533,40 +544,40 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
textMap.put("userid", weipuId);
|
||||
textMap.put("type", type);
|
||||
String contentType = "";//image/png
|
||||
String ret = formUpload(url, textMap, null,contentType);
|
||||
log.error("1-------->"+ret);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
String ret = formUpload(url, textMap, null, contentType);
|
||||
log.error("1-------->" + ret);
|
||||
JSONObject object = JSONObject.parseObject(ret);
|
||||
return object;
|
||||
}
|
||||
|
||||
private void delweipulunwen(ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
|
||||
zyInfoStudent.setQueryType("0");//外网查重数据
|
||||
String paperids = baseMapper.getWpFile(zyInfoStudent);
|
||||
if(StringUtils.isNotEmpty(paperids)){
|
||||
if (StringUtils.isNotEmpty(paperids)) {
|
||||
String url = "https://vims.fanyu.com/toole/jianceorgan/paperdel.aspx";
|
||||
delWpFile(url,paperids, response);
|
||||
delWpFile(url, paperids, response);
|
||||
}
|
||||
zyInfoStudent.setQueryType("1");//内网查重数据-作业内查重
|
||||
Map<String,String> paperids1 = baseMapper.getXfwWpFile(zyInfoStudent);
|
||||
if(paperids1 != null){
|
||||
Map<String, String> paperids1 = baseMapper.getXfwWpFile(zyInfoStudent);
|
||||
if (paperids1 != null) {
|
||||
String dataids = paperids1.get("paperid");
|
||||
String bdkbs = paperids1.get("bdkbs");
|
||||
String url = "https://vims.fanyu.com/toole/smallcheck/delData";
|
||||
delXfwWpFile(url,bdkbs,dataids, response);
|
||||
delXfwWpFile(url, bdkbs, dataids, response);
|
||||
}
|
||||
zyInfoStudent.setQueryType("3");//内网查重数据-全校内比对
|
||||
Map<String,String> paperids3 = baseMapper.getXfwWpFile(zyInfoStudent);
|
||||
if(paperids3 != null){
|
||||
Map<String, String> paperids3 = baseMapper.getXfwWpFile(zyInfoStudent);
|
||||
if (paperids3 != null) {
|
||||
String dataids = paperids3.get("paperid");
|
||||
String bdkbs = paperids3.get("bdkbs");
|
||||
String url = "https://vims.fanyu.com/toole/smallcheck/delData";
|
||||
delXfwWpFile(url,bdkbs,dataids, response);
|
||||
delXfwWpFile(url, bdkbs, dataids, response);
|
||||
}
|
||||
zyInfoStudent.setQueryType("2");//aigc查重数据
|
||||
String paperids2 = baseMapper.getWpFile(zyInfoStudent);
|
||||
if(StringUtils.isNotEmpty(paperids2)){
|
||||
if (StringUtils.isNotEmpty(paperids2)) {
|
||||
String url = "https://vims.fanyu.com/tool/AIGCCheck/paperDel";
|
||||
delWpFile(url,paperids2, response);
|
||||
delWpFile(url, paperids2, response);
|
||||
}
|
||||
zyCcjgMapper.deleteByZystuid(zyInfoStudent.getId());
|
||||
}
|
||||
|
@ -596,28 +607,28 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
// }
|
||||
zyInfoStudent.setQueryType("2");//aigc查重数据
|
||||
String paperids2 = baseMapper.getWpFile(zyInfoStudent);
|
||||
if(StringUtils.isNotEmpty(paperids2)){
|
||||
if (StringUtils.isNotEmpty(paperids2)) {
|
||||
String url = "https://vims.fanyu.com/tool/AIGCCheck/paperDel";
|
||||
delWpFile(url,paperids2, response);
|
||||
delWpFile(url, paperids2, response);
|
||||
}
|
||||
zyCcjgMapper.deleteByZystuid(zyInfoStudent.getId());
|
||||
}
|
||||
|
||||
//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 fileName = downloadpath+"/"+ zyInfoStudent.getFilePath();
|
||||
// if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
|
||||
// fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
|
||||
// }
|
||||
String fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
|
||||
String fileName = uploadpath + "/" + zyInfoStudent.getFilePath();
|
||||
Map<String, String> textMap = new HashMap<String, String>();
|
||||
//可以设置多个input的name,value
|
||||
String sign = getSign();
|
||||
textMap.put("userid", weipuId);
|
||||
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];
|
||||
textMap.put("title", title);
|
||||
|
||||
|
@ -628,18 +639,18 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
Map<String, String> fileMap = new HashMap<String, String>();
|
||||
fileMap.put("file", fileName);
|
||||
String contentType = "";//image/png
|
||||
String ret = formUpload(url, textMap, fileMap,contentType);
|
||||
log.info("aigc1-------->"+ret);
|
||||
log.error("aigcSave:ret-------->"+ret);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
if("true".equals(object.getString("success"))){
|
||||
String ret = formUpload(url, textMap, fileMap, contentType);
|
||||
log.info("aigc1-------->" + ret);
|
||||
log.error("aigcSave:ret-------->" + ret);
|
||||
JSONObject object = JSONObject.parseObject(ret);
|
||||
if ("true".equals(object.getString("success"))) {
|
||||
|
||||
|
||||
String listpaper = object.getString("listPaper");
|
||||
JSONArray jsonArray = (JSONArray) JSONArray.parse(listpaper);
|
||||
JSONObject object2= jsonArray.getJSONObject(0);
|
||||
JSONObject object2 = jsonArray.getJSONObject(0);
|
||||
String paperid = object2.getString("paperid");
|
||||
log.info("2-------->"+paperid);
|
||||
log.info("2-------->" + paperid);
|
||||
|
||||
ZyCcjg zyCcjg = new ZyCcjg();
|
||||
zyCcjg.setZyStuId(zyInfoStudent.getId());
|
||||
|
@ -650,8 +661,8 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
|
||||
//提交后直接开始检测
|
||||
String message = aigcKsjc(zyCcjg);
|
||||
log.info("21-------->"+message);
|
||||
}else{
|
||||
log.info("21-------->" + message);
|
||||
} else {
|
||||
log.info("3-------->");
|
||||
|
||||
ZyCcjg zyCcjg = new ZyCcjg();
|
||||
|
@ -677,23 +688,23 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
textMap.put("paperids", paperid);//资源id
|
||||
String contentType = "";//image/png
|
||||
Map<String, String> fileMap = new HashMap<String, String>();
|
||||
String ret = formUpload(url, textMap, fileMap,contentType);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
String ret = formUpload(url, textMap, fileMap, contentType);
|
||||
JSONObject object = JSONObject.parseObject(ret);
|
||||
String message = object.getString("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 fileName = downloadpath+"/"+ zyInfoStudent.getFilePath();
|
||||
// if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
|
||||
// fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
|
||||
// }
|
||||
String fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
|
||||
String fileName = uploadpath + "/" + zyInfoStudent.getFilePath();
|
||||
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];
|
||||
//可以设置多个input的name,value
|
||||
String sign = getSign();
|
||||
|
@ -709,12 +720,12 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
Map<String, String> fileMap = new HashMap<String, String>();
|
||||
fileMap.put("file", fileName);
|
||||
String contentType = "";//image/png
|
||||
String ret = formUpload(url, textMap, fileMap,contentType);
|
||||
log.error("nwccSave:ret-------->"+ret);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
if("true".equals(object.getString("success"))){
|
||||
String ret = formUpload(url, textMap, fileMap, contentType);
|
||||
log.error("nwccSave:ret-------->" + ret);
|
||||
JSONObject object = JSONObject.parseObject(ret);
|
||||
if ("true".equals(object.getString("success"))) {
|
||||
String listpaper = object.getString("datainfo");
|
||||
JSONObject object2= JSON.parseObject(listpaper);
|
||||
JSONObject object2 = JSON.parseObject(listpaper);
|
||||
String dataid = object2.getString("dataid");//资源id 后续提交比对/删除文档会试用
|
||||
|
||||
ZyCcjg zyCcjg = new ZyCcjg();
|
||||
|
@ -726,9 +737,9 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
zyCcjgMapper.insert(zyCcjg);
|
||||
|
||||
//提交后直接开始检测
|
||||
String message = xfwbdKsjc(zyCcjg,"1");
|
||||
log.info("21-------->"+message);
|
||||
}else{
|
||||
String message = xfwbdKsjc(zyCcjg, "1");
|
||||
log.info("21-------->" + message);
|
||||
} else {
|
||||
log.info("3-------->");
|
||||
ZyCcjg zyCcjg = new ZyCcjg();
|
||||
zyCcjg.setZyStuId(zyInfoStudent.getId());
|
||||
|
@ -740,16 +751,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 fileName = downloadpath+"/"+ zyInfoStudent.getFilePath();
|
||||
// if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
|
||||
// fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
|
||||
// }
|
||||
String fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
|
||||
String fileName = uploadpath + "/" + zyInfoStudent.getFilePath();
|
||||
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];
|
||||
//可以设置多个input的name,value
|
||||
String sign = getSign();
|
||||
|
@ -765,19 +776,19 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
Map<String, String> fileMap = new HashMap<String, String>();
|
||||
fileMap.put("file", fileName);
|
||||
String contentType = "";//image/png
|
||||
log.info("url--->"+url);
|
||||
log.info("textMap--->"+textMap);
|
||||
log.info("fileMap--->"+fileMap);
|
||||
String ret = formUpload(url, textMap, fileMap,contentType);
|
||||
log.error("xnccSave:ret-------->"+ret);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
if("true".equals(object.getString("success"))){
|
||||
log.info("url--->" + url);
|
||||
log.info("textMap--->" + textMap);
|
||||
log.info("fileMap--->" + fileMap);
|
||||
String ret = formUpload(url, textMap, fileMap, contentType);
|
||||
log.error("xnccSave:ret-------->" + ret);
|
||||
JSONObject object = JSONObject.parseObject(ret);
|
||||
if ("true".equals(object.getString("success"))) {
|
||||
String listpaper = object.getString("datainfo");
|
||||
JSONObject object2= JSON.parseObject(listpaper);
|
||||
JSONObject object2 = JSON.parseObject(listpaper);
|
||||
String dataid = object2.getString("dataid");//资源id 后续提交比对/删除文档会试用
|
||||
|
||||
//判断是否开始查重 1的时候进行查重,0不查重
|
||||
if(StringUtils.equals("1",type)){
|
||||
if (StringUtils.equals("1", type)) {
|
||||
ZyCcjg zyCcjg = new ZyCcjg();
|
||||
zyCcjg.setZyStuId(zyInfoStudent.getId());
|
||||
zyCcjg.setPaperid(dataid);
|
||||
|
@ -786,11 +797,11 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
zyCcjg.setBdkbs(zyInfoStudent.getCateid());
|
||||
zyCcjgMapper.insert(zyCcjg);
|
||||
//提交后直接开始检测
|
||||
String message = xfwbdKsjc(zyCcjg,"0");
|
||||
log.info("21-------->"+message);
|
||||
String message = xfwbdKsjc(zyCcjg, "0");
|
||||
log.info("21-------->" + message);
|
||||
}
|
||||
|
||||
}else{
|
||||
} else {
|
||||
log.info("3-------->");
|
||||
ZyCcjg zyCcjg = new ZyCcjg();
|
||||
zyCcjg.setZyStuId(zyInfoStudent.getId());
|
||||
|
@ -804,24 +815,25 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
|
||||
/**
|
||||
* 主要用于教师发布评分后,统一发往维普留存比对库
|
||||
*
|
||||
* @param zyInfoStudent
|
||||
* @param type
|
||||
* @param response
|
||||
*/
|
||||
private void xnccUpdate(ZyInfoStudent zyInfoStudent,String type,HttpServletResponse response) {
|
||||
private void xnccUpdate(ZyInfoStudent zyInfoStudent, String type, HttpServletResponse response) {
|
||||
|
||||
ZyCcjg zyCcjg = new ZyCcjg();
|
||||
try {
|
||||
QueryWrapper<ZyCcjg> zyCcjgQueryWrapper = new QueryWrapper<>();
|
||||
zyCcjgQueryWrapper.eq("zy_stu_id",zyInfoStudent.getId());
|
||||
zyCcjgQueryWrapper.eq("create_by",zyInfoStudent.getCreateBy());
|
||||
zyCcjgQueryWrapper.eq("cc_type","3");
|
||||
zyCcjgQueryWrapper.eq("zy_stu_id", zyInfoStudent.getId());
|
||||
zyCcjgQueryWrapper.eq("create_by", zyInfoStudent.getCreateBy());
|
||||
zyCcjgQueryWrapper.eq("cc_type", "3");
|
||||
zyCcjg = zyCcjgMapper.selectOne(zyCcjgQueryWrapper);
|
||||
if(zyCcjg.getPaperid() != null){
|
||||
if (zyCcjg.getPaperid() != null) {
|
||||
String dataids = zyCcjg.getPaperid();
|
||||
String bdkbs = zyCcjg.getBdkbs();
|
||||
String url2 = "https://vims.fanyu.com/toole/smallcheck/delData";
|
||||
delXfwWpFile(url2,bdkbs,dataids, null);
|
||||
delXfwWpFile(url2, bdkbs, dataids, null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -829,9 +841,9 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
|
||||
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>();
|
||||
String titlePar =fileName.substring(fileName.lastIndexOf("/")+1,fileName.length());
|
||||
String titlePar = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length());
|
||||
String title = titlePar.split("_")[0];
|
||||
//可以设置多个input的name,value
|
||||
String sign = getSign();
|
||||
|
@ -847,15 +859,15 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
Map<String, String> fileMap = new HashMap<String, String>();
|
||||
fileMap.put("file", fileName);
|
||||
String contentType = "";//image/png
|
||||
log.info("url--->"+url);
|
||||
log.info("textMap--->"+textMap);
|
||||
log.info("fileMap--->"+fileMap);
|
||||
String ret = formUpload(url, textMap, fileMap,contentType);
|
||||
log.info("ret--->"+ret);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
if("true".equals(object.getString("success"))){
|
||||
log.info("url--->" + url);
|
||||
log.info("textMap--->" + textMap);
|
||||
log.info("fileMap--->" + fileMap);
|
||||
String ret = formUpload(url, textMap, fileMap, contentType);
|
||||
log.info("ret--->" + ret);
|
||||
JSONObject object = JSONObject.parseObject(ret);
|
||||
if ("true".equals(object.getString("success"))) {
|
||||
String listpaper = object.getString("datainfo");
|
||||
JSONObject object2= JSON.parseObject(listpaper);
|
||||
JSONObject object2 = JSON.parseObject(listpaper);
|
||||
String dataid = object2.getString("dataid");//资源id 后续提交比对/删除文档会试用
|
||||
zyCcjg.setPaperid(dataid);
|
||||
zyCcjgMapper.updateById(zyCcjg);
|
||||
|
@ -863,7 +875,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 paperid = zyCcjg.getPaperid();
|
||||
|
@ -877,14 +889,14 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
textMap.put("exclude", sfpj);//是否排已(1:排已, 0:不排已)
|
||||
String contentType = "";//image/png
|
||||
Map<String, String> fileMap = new HashMap<String, String>();
|
||||
String ret = formUpload(url, textMap, fileMap,contentType);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
String ret = formUpload(url, textMap, fileMap, contentType);
|
||||
JSONObject object = JSONObject.parseObject(ret);
|
||||
String message = object.getString("message");
|
||||
return message;
|
||||
}
|
||||
|
||||
//外网查重提交方法
|
||||
private String wwccSave(ZyInfoStudent zyInfoStudent,HttpServletResponse response) {
|
||||
private String wwccSave(ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String url = "https://vims.fanyu.com/toole/jianceorgan/papersubmit.aspx";
|
||||
//文件路径,文件存在,不存在的话需要先下载下来
|
||||
|
@ -892,13 +904,13 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
// if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
|
||||
// fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
|
||||
// }
|
||||
String fileName = uploadpath+"/"+ zyInfoStudent.getFilePath();
|
||||
String fileName = uploadpath + "/" + zyInfoStudent.getFilePath();
|
||||
Map<String, String> textMap = new HashMap<String, String>();
|
||||
//可以设置多个input的name,value
|
||||
String sign = getSign();
|
||||
textMap.put("sign", sign);
|
||||
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];
|
||||
textMap.put("title", title);
|
||||
textMap.put("number", sysUser.getUsername());
|
||||
|
@ -907,16 +919,16 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
Map<String, String> fileMap = new HashMap<String, String>();
|
||||
fileMap.put("file", fileName);
|
||||
String contentType = "";//image/png
|
||||
log.error("fileMap-------->"+fileMap);
|
||||
String ret = formUpload(url, textMap, fileMap,contentType);
|
||||
log.error("1-------->"+ret);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
if("true".equals(object.getString("success"))){
|
||||
log.error("fileMap-------->" + fileMap);
|
||||
String ret = formUpload(url, textMap, fileMap, contentType);
|
||||
log.error("1-------->" + ret);
|
||||
JSONObject object = JSONObject.parseObject(ret);
|
||||
if ("true".equals(object.getString("success"))) {
|
||||
String listpaper = object.getString("listpaper");
|
||||
JSONArray jsonArray = (JSONArray) JSONArray.parse(listpaper);
|
||||
JSONObject object2= jsonArray.getJSONObject(0);
|
||||
JSONObject object2 = jsonArray.getJSONObject(0);
|
||||
String paperid = object2.getString("paperid");
|
||||
log.info("2-------->"+paperid);
|
||||
log.info("2-------->" + paperid);
|
||||
ZyCcjg zyCcjg = new ZyCcjg();
|
||||
zyCcjg.setZyStuId(zyInfoStudent.getId());
|
||||
zyCcjg.setPaperid(paperid);
|
||||
|
@ -925,9 +937,9 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
zyCcjgMapper.insert(zyCcjg);
|
||||
//提交后直接开始检测
|
||||
String message = wwKsjc(zyCcjg);
|
||||
log.info("21-------->"+message);
|
||||
log.info("21-------->" + message);
|
||||
return message;
|
||||
}else{
|
||||
} else {
|
||||
log.info("3-------->");
|
||||
ZyCcjg zyCcjg = new ZyCcjg();
|
||||
zyCcjg.setZyStuId(zyInfoStudent.getId());
|
||||
|
@ -952,31 +964,31 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
textMap.put("paperids", paperid);//资源id
|
||||
String contentType = "";//image/png
|
||||
Map<String, String> fileMap = new HashMap<String, String>();
|
||||
String ret = formUpload(url, textMap, fileMap,contentType);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
String ret = formUpload(url, textMap, fileMap, contentType);
|
||||
JSONObject object = JSONObject.parseObject(ret);
|
||||
String message = object.getString("message");
|
||||
return message;
|
||||
}
|
||||
|
||||
private String getFileName(String imgPath, HttpServletResponse response){
|
||||
private String getFileName(String imgPath, HttpServletResponse response) {
|
||||
String fileName = "";
|
||||
if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
|
||||
if (CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) {
|
||||
fileName = imgPath;
|
||||
log.info("1111111111111111----------->");
|
||||
}else if(CommonConstant.UPLOAD_TYPE_SFTP.equals(uploadType)){
|
||||
} else if (CommonConstant.UPLOAD_TYPE_SFTP.equals(uploadType)) {
|
||||
log.info("22222222222222----------->");
|
||||
InputStream inputStream = null;
|
||||
OutputStream outputStream = null;
|
||||
try{
|
||||
try {
|
||||
int index = imgPath.lastIndexOf("/");
|
||||
String path = "temp";
|
||||
if(index != -1){
|
||||
path = imgPath.substring(0,index);
|
||||
if (index != -1) {
|
||||
path = imgPath.substring(0, index);
|
||||
}
|
||||
|
||||
log.info("path----------->"+path);
|
||||
Map<String,String> map = SFTPUtil.download(sftpConfig,imgPath,getDownloadPath(path));
|
||||
log.info("map----------->"+map);
|
||||
log.info("path----------->" + path);
|
||||
Map<String, String> map = SFTPUtil.download(sftpConfig, imgPath, getDownloadPath(path));
|
||||
log.info("map----------->" + map);
|
||||
// if(!map.get("code").equals("0")){
|
||||
// response.setStatus(404);
|
||||
//// throw new RuntimeException(map.get("msg"));
|
||||
|
@ -1000,11 +1012,11 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
// }
|
||||
// response.flushBuffer();
|
||||
fileName = localFilePath;
|
||||
log.info("fileName----------->"+fileName);
|
||||
}catch (Exception e){
|
||||
log.info("catch----------->"+e);
|
||||
log.info("fileName----------->" + fileName);
|
||||
} catch (Exception e) {
|
||||
log.info("catch----------->" + e);
|
||||
// e.printStackTrace();
|
||||
}finally {
|
||||
} finally {
|
||||
SFTPUtil.disChannel();
|
||||
SFTPUtil.disSession();
|
||||
if (inputStream != null) {
|
||||
|
@ -1022,12 +1034,13 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
log.info("333333333333333----------->");
|
||||
}
|
||||
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";
|
||||
Map<String, String> textMap = new HashMap<String, String>();
|
||||
//可以设置多个input的name,value
|
||||
|
@ -1036,18 +1049,19 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
textMap.put("userid", weipuId);
|
||||
textMap.put("paperids", paperids);//文档paperid集合,多个请用英文逗号隔开
|
||||
String contentType = "";//image/png
|
||||
String ret = formUpload(url, textMap, null,contentType);
|
||||
log.error("1-------->"+ret);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
if("true".equals(object.getString("success"))){
|
||||
String ret = formUpload(url, textMap, null, contentType);
|
||||
log.error("1-------->" + ret);
|
||||
JSONObject object = JSONObject.parseObject(ret);
|
||||
if ("true".equals(object.getString("success"))) {
|
||||
String message = object.getString("message");
|
||||
log.info("2-------->"+message);
|
||||
log.info("2-------->" + message);
|
||||
return "success";
|
||||
}else{
|
||||
} else {
|
||||
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";
|
||||
Map<String, String> textMap = new HashMap<String, String>();
|
||||
//可以设置多个input的name,value
|
||||
|
@ -1057,31 +1071,33 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
textMap.put("cateid", cateid);
|
||||
textMap.put("dataid", paperids);//文档paperid集合,多个请用英文逗号隔开
|
||||
String contentType = "";//image/png
|
||||
String ret = formUpload(url, textMap, null,contentType);
|
||||
log.error("1-------->"+ret);
|
||||
JSONObject object= JSONObject.parseObject(ret);
|
||||
if("true".equals(object.getString("success"))){
|
||||
String ret = formUpload(url, textMap, null, contentType);
|
||||
log.error("1-------->" + ret);
|
||||
JSONObject object = JSONObject.parseObject(ret);
|
||||
if ("true".equals(object.getString("success"))) {
|
||||
String message = object.getString("message");
|
||||
log.info("2-------->"+message);
|
||||
log.info("2-------->" + message);
|
||||
return "success";
|
||||
}else{
|
||||
} else {
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件真实路径
|
||||
*
|
||||
* @param path
|
||||
* @return
|
||||
*/
|
||||
private String getDownloadPath(String path){
|
||||
private String getDownloadPath(String path) {
|
||||
String filePath = "";
|
||||
if(org.jeecg.common.util.text.StringUtils.isEmpty(path)){
|
||||
if (org.jeecg.common.util.text.StringUtils.isEmpty(path)) {
|
||||
return "";
|
||||
}
|
||||
int idx = path.indexOf(downloadpath);
|
||||
if(idx==-1){
|
||||
if (idx == -1) {
|
||||
filePath = downloadpath + File.separator + path;
|
||||
}else{
|
||||
} else {
|
||||
filePath = path;
|
||||
}
|
||||
return filePath;
|
||||
|
@ -1093,14 +1109,14 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
String userid = weipuId;
|
||||
String key = weipuKey;
|
||||
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 sign = org.springframework.util.DigestUtils.md5DigestAsHex((md5Text).getBytes()).toLowerCase();
|
||||
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 = "";
|
||||
HttpURLConnection conn = null;
|
||||
// boundary就是request头和上传文件内容的分隔符
|
||||
|
@ -1115,7 +1131,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
conn.setUseCaches(false);
|
||||
conn.setRequestMethod("POST");
|
||||
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());
|
||||
// text
|
||||
if (textMap != null) {
|
||||
|
@ -1150,14 +1166,14 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
//没有传入文件类型,同时根据文件获取不到类型,默认采用application/octet-stream
|
||||
contentType = new MimetypesFileTypeMap().getContentType(file);
|
||||
//contentType非空采用filename匹配默认的图片类型
|
||||
if(!"".equals(contentType)){
|
||||
if (!"".equals(contentType)) {
|
||||
if (filename.endsWith(".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";
|
||||
}else if (filename.endsWith(".gif")) {
|
||||
} else if (filename.endsWith(".gif")) {
|
||||
contentType = "image/gif";
|
||||
}else if (filename.endsWith(".ico")) {
|
||||
} else if (filename.endsWith(".ico")) {
|
||||
contentType = "image/image/x-icon";
|
||||
}
|
||||
}
|
||||
|
@ -1233,7 +1249,7 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
|
|||
|
||||
// 1、xx老师,你好,您本学期(2023秋)听课要求为:5次,当前实际听课次数:3次,请尽快完成本学期的听课任务。
|
||||
String html = kcWechatSendLog.getYtkcs();
|
||||
html = html ;
|
||||
html = html;
|
||||
sendMag.put("content", html);//授课老师推送内容
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
//拼接base参数
|
||||
|
|
|
@ -129,7 +129,9 @@ public class LoginController {
|
|||
//2. 校验用户名或密码是否正确
|
||||
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
||||
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 平台用户登录失败锁定用户
|
||||
addLoginFailOvertimes(username);
|
||||
//update-end-author:taoyan date:2022-11-7 for: issues/4109 平台用户登录失败锁定用户
|
||||
|
|
Loading…
Reference in New Issue