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,126 +21,127 @@ 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
|
||||
* @Date: 2023-04-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="同步数据表(bks)")
|
||||
@Api(tags = "同步数据表(bks)")
|
||||
@RestController
|
||||
@RequestMapping("/grab/xxhbbks")
|
||||
@Slf4j
|
||||
public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService> {
|
||||
@Autowired
|
||||
private IXxhbbksService xxhbbksService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param xxhbbks
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "同步数据表(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,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<Xxhbbks> queryWrapper = QueryGenerator.initQueryWrapper(xxhbbks, req.getParameterMap());
|
||||
Page<Xxhbbks> page = new Page<Xxhbbks>(pageNo, pageSize);
|
||||
IPage<Xxhbbks> pageList = xxhbbksService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param xxhbbks
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-添加")
|
||||
@ApiOperation(value="同步数据表(bks)-添加", notes="同步数据表(bks)-添加")
|
||||
@RequiresPermissions("grab:xxhbbks:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody Xxhbbks xxhbbks) {
|
||||
xxhbbksService.save(xxhbbks);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param xxhbbks
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-编辑")
|
||||
@ApiOperation(value="同步数据表(bks)-编辑", notes="同步数据表(bks)-编辑")
|
||||
@RequiresPermissions("grab:xxhbbks:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody Xxhbbks xxhbbks) {
|
||||
xxhbbksService.updateById(xxhbbks);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(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) {
|
||||
xxhbbksService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-批量删除")
|
||||
@ApiOperation(value="同步数据表(bks)-批量删除", notes="同步数据表(bks)-批量删除")
|
||||
@RequiresPermissions("grab:xxhbbks:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.xxhbbksService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "同步数据表(bks)-通过id查询")
|
||||
@ApiOperation(value="同步数据表(bks)-通过id查询", notes="同步数据表(bks)-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<Xxhbbks> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
Xxhbbks xxhbbks = xxhbbksService.getById(id);
|
||||
if(xxhbbks==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(xxhbbks);
|
||||
}
|
||||
@Autowired
|
||||
private IXxhbbksService xxhbbksService;
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param xxhbbks
|
||||
*/
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param xxhbbks
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "同步数据表(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,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<Xxhbbks> queryWrapper = QueryGenerator.initQueryWrapper(xxhbbks, req.getParameterMap());
|
||||
Page<Xxhbbks> page = new Page<Xxhbbks>(pageNo, pageSize);
|
||||
IPage<Xxhbbks> pageList = xxhbbksService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param xxhbbks
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-添加")
|
||||
@ApiOperation(value = "同步数据表(bks)-添加", notes = "同步数据表(bks)-添加")
|
||||
@RequiresPermissions("grab:xxhbbks:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody Xxhbbks xxhbbks) {
|
||||
xxhbbksService.save(xxhbbks);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param xxhbbks
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-编辑")
|
||||
@ApiOperation(value = "同步数据表(bks)-编辑", notes = "同步数据表(bks)-编辑")
|
||||
@RequiresPermissions("grab:xxhbbks:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody Xxhbbks xxhbbks) {
|
||||
xxhbbksService.updateById(xxhbbks);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(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) {
|
||||
xxhbbksService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "同步数据表(bks)-批量删除")
|
||||
@ApiOperation(value = "同步数据表(bks)-批量删除", notes = "同步数据表(bks)-批量删除")
|
||||
@RequiresPermissions("grab:xxhbbks:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.xxhbbksService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "同步数据表(bks)-通过id查询")
|
||||
@ApiOperation(value = "同步数据表(bks)-通过id查询", notes = "同步数据表(bks)-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<Xxhbbks> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
Xxhbbks xxhbbks = xxhbbksService.getById(id);
|
||||
if (xxhbbks == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(xxhbbks);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param xxhbbks
|
||||
*/
|
||||
@RequiresPermissions("grab:xxhbbks:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, Xxhbbks xxhbbks) {
|
||||
|
@ -149,12 +149,12 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
|
|||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("grab:xxhbbks:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
|
@ -162,20 +162,30 @@ public class XxhbbksController extends JeecgController<Xxhbbks, IXxhbbksService>
|
|||
}
|
||||
|
||||
|
||||
@AutoLog(value = "获取本科生选课人员信息")
|
||||
@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,
|
||||
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());
|
||||
Page<Xxhbbks> page = new Page<Xxhbbks>(pageNo, pageSize);
|
||||
IPage<Xxhbbks> pageList = xxhbbksService.getXsxkbList(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "获取本科生选课人员信息")
|
||||
@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,
|
||||
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());
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.util.concurrent.TimeUnit;
|
|||
/**
|
||||
* @Description: 答卷信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-05-07
|
||||
* @Date: 2024-05-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
|
@ -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,129 +871,86 @@ 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));
|
||||
//调用接口,查询答卷结果
|
||||
String answerStr = wjxUtil.openapi(selMap,"1001002");
|
||||
if(!answerStr.equals("")) {
|
||||
JSONObject ansJsonResult = JSONObject.parseObject(answerStr);
|
||||
if (ansJsonResult.getBoolean("result")) {
|
||||
JSONObject ansDataJson = ansJsonResult.getJSONObject("data");
|
||||
String answerVid = ansDataJson.getString("vid");
|
||||
JSONObject answerJsonArray = ansDataJson.getJSONObject("answers");
|
||||
for (String key1 : answerJsonArray.keySet()) {
|
||||
JSONObject answer = answerJsonArray.getJSONObject(key1);
|
||||
String jidAns = answer.getString("jid");
|
||||
Integer answerSeconds = answer.getInteger("answer_seconds");
|
||||
Double score = answer.getDouble("score");
|
||||
Double totalScore = answer.getDouble("total_score");
|
||||
WjxDjxx wjxDjxx = new WjxDjxx();
|
||||
wjxDjxx.setVid(answerVid);
|
||||
wjxDjxx.setJid(jidAns);
|
||||
wjxDjxx.setAnswerSeconds(answerSeconds);
|
||||
wjxDjxx.setScore(score);
|
||||
wjxDjxx.setTotalScore(totalScore);
|
||||
//删除选项信息
|
||||
//调用接口,答卷查询
|
||||
Map<String, Object> selMap = new HashMap<>();
|
||||
selMap.put("vid", Integer.valueOf(vid));
|
||||
selMap.put("jid", Long.valueOf(jidRes));
|
||||
//调用接口,查询答卷结果
|
||||
String answerStr = wjxUtil.openapi(selMap, "1001002");
|
||||
if (!answerStr.equals("")) {
|
||||
JSONObject ansJsonResult = JSONObject.parseObject(answerStr);
|
||||
if (ansJsonResult.getBoolean("result")) {
|
||||
JSONObject ansDataJson = ansJsonResult.getJSONObject("data");
|
||||
String answerVid = ansDataJson.getString("vid");
|
||||
JSONObject answerJsonArray = ansDataJson.getJSONObject("answers");
|
||||
for (String key1 : answerJsonArray.keySet()) {
|
||||
JSONObject answer = answerJsonArray.getJSONObject(key1);
|
||||
String jidAns = answer.getString("jid");
|
||||
Integer answerSeconds = answer.getInteger("answer_seconds");
|
||||
Double score = answer.getDouble("score");
|
||||
Double totalScore = answer.getDouble("total_score");
|
||||
WjxDjxx wjxDjxx = new WjxDjxx();
|
||||
wjxDjxx.setVid(answerVid);
|
||||
wjxDjxx.setJid(jidAns);
|
||||
wjxDjxx.setAnswerSeconds(answerSeconds);
|
||||
wjxDjxx.setScore(score);
|
||||
wjxDjxx.setTotalScore(totalScore);
|
||||
//删除选项信息
|
||||
// baseMapper.deleteDjItem(wjxDjxx);
|
||||
//处理选项
|
||||
JSONObject answerItemJson = answer.getJSONObject("answer_items");
|
||||
if(answerItemJson!=null){
|
||||
for (String key2 : answerItemJson.keySet()) {
|
||||
JSONObject answerItem = answerItemJson.getJSONObject(key2);
|
||||
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
|
||||
wjxDjxxTmxx.setVid(answerVid);
|
||||
wjxDjxxTmxx.setJid(jidAns);
|
||||
wjxDjxxTmxx.setUserId(wjxDjxxPar.getUserId());
|
||||
wjxDjxxTmxx.setCreateBy(wjxDjxxPar.getUserId());
|
||||
wjxDjxxTmxx.setCreateTime(new Date());
|
||||
//处理选项
|
||||
JSONObject answerItemJson = answer.getJSONObject("answer_items");
|
||||
if (answerItemJson != null) {
|
||||
for (String key2 : answerItemJson.keySet()) {
|
||||
JSONObject answerItem = answerItemJson.getJSONObject(key2);
|
||||
WjxDjxxTmxx wjxDjxxTmxx = new WjxDjxxTmxx();
|
||||
wjxDjxxTmxx.setVid(answerVid);
|
||||
wjxDjxxTmxx.setJid(jidAns);
|
||||
wjxDjxxTmxx.setUserId(wjxDjxxPar.getUserId());
|
||||
wjxDjxxTmxx.setCreateBy(wjxDjxxPar.getUserId());
|
||||
wjxDjxxTmxx.setCreateTime(new Date());
|
||||
|
||||
if (answerItem.get("q_index") != null) {
|
||||
Integer wjIndex = answerItem.getInteger("q_index");
|
||||
wjxDjxxTmxx.setWjIndex(wjIndex);
|
||||
}
|
||||
if (answerItem.get("title") != null) {
|
||||
String wjTitle = answerItem.getString("title");
|
||||
wjxDjxxTmxx.setWjTitle(wjTitle);
|
||||
}
|
||||
if (answerItem.get("q_index") != null) {
|
||||
Integer wjIndex = answerItem.getInteger("q_index");
|
||||
wjxDjxxTmxx.setWjIndex(wjIndex);
|
||||
}
|
||||
if (answerItem.get("title") != null) {
|
||||
String wjTitle = answerItem.getString("title");
|
||||
wjxDjxxTmxx.setWjTitle(wjTitle);
|
||||
}
|
||||
|
||||
if (answerItem.get("item_value") != null) {
|
||||
Double itemScore = answerItem.getDouble("item_value");
|
||||
wjxDjxxTmxx.setItemScore(itemScore);
|
||||
}
|
||||
if (answerItem.get("answer_text") != null) {
|
||||
String answerText = answerItem.getString("answer_text");
|
||||
wjxDjxxTmxx.setAnswerText(answerText);
|
||||
}
|
||||
if (answerItem.get("item_index") != null) {
|
||||
JSONArray itemIndex = answerItem.getJSONArray("item_index");
|
||||
if (answerItem.get("item_value") != null) {
|
||||
Double itemScore = answerItem.getDouble("item_value");
|
||||
wjxDjxxTmxx.setItemScore(itemScore);
|
||||
}
|
||||
if (answerItem.get("answer_text") != null) {
|
||||
String answerText = answerItem.getString("answer_text");
|
||||
wjxDjxxTmxx.setAnswerText(answerText);
|
||||
}
|
||||
if (answerItem.get("item_index") != null) {
|
||||
JSONArray itemIndex = answerItem.getJSONArray("item_index");
|
||||
|
||||
QueryWrapper<WjxWjxx> wjxWjxxQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxQueryWrapper.eq("vid", vid);
|
||||
wjxWjxxQueryWrapper.last("limit 1");
|
||||
WjxWjxx wjxxPar = wjxWjxxMapper.selectOne(wjxWjxxQueryWrapper);
|
||||
QueryWrapper<WjxWjxx> wjxWjxxQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxQueryWrapper.eq("vid", vid);
|
||||
wjxWjxxQueryWrapper.last("limit 1");
|
||||
WjxWjxx wjxxPar = wjxWjxxMapper.selectOne(wjxWjxxQueryWrapper);
|
||||
|
||||
|
||||
if (itemIndex.size() > 0) {
|
||||
for (Object index : itemIndex) {
|
||||
Integer ti = (Integer) index;
|
||||
if (itemIndex.size() > 0) {
|
||||
for (Object index : itemIndex) {
|
||||
Integer ti = (Integer) index;
|
||||
|
||||
|
||||
wjxDjxxTmxx.setItemIndex(ti);
|
||||
String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString();
|
||||
wjxDjxxTmxx.setId(id);
|
||||
|
||||
try {
|
||||
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id", wjxxPar.getId());
|
||||
wjxWjxxTmlbQueryWrapper.eq("wj_index", wjxDjxxTmxx.getWjIndex());
|
||||
wjxWjxxTmlbQueryWrapper.last("limit 1");
|
||||
WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectOne(wjxWjxxTmlbQueryWrapper);
|
||||
wjxDjxxTmxx.setPicPath(tmlb.getPicPath());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx);
|
||||
if(djxxTmxx==null){
|
||||
baseMapper.addDjTmxx(wjxDjxxTmxx);
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString();
|
||||
|
||||
try {
|
||||
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id", wjxxPar.getId());
|
||||
wjxWjxxTmlbQueryWrapper.eq("wj_index", wjxDjxxTmxx.getWjIndex());
|
||||
wjxWjxxTmlbQueryWrapper.last("limit 1");
|
||||
WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectOne(wjxWjxxTmlbQueryWrapper);
|
||||
wjxDjxxTmxx.setPicPath(tmlb.getPicPath());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
wjxDjxxTmxx.setId(id);
|
||||
WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx);
|
||||
if(djxxTmxx==null){
|
||||
baseMapper.addDjTmxx(wjxDjxxTmxx);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
wjxDjxxTmxx.setItemIndex(ti);
|
||||
String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString();
|
||||
wjxDjxxTmxx.setId(id);
|
||||
|
||||
try {
|
||||
QueryWrapper<WjxWjxx> wjxWjxxQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxQueryWrapper.eq("vid", vid);
|
||||
wjxWjxxQueryWrapper.last("limit 1");
|
||||
WjxWjxx wjxxPar = wjxWjxxMapper.selectOne(wjxWjxxQueryWrapper);
|
||||
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id", wjxxPar.getId());
|
||||
wjxWjxxTmlbQueryWrapper.eq("wj_index", wjxDjxxTmxx.getWjIndex());
|
||||
|
@ -1006,47 +960,96 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
|
|||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
wjxDjxxTmxx.setId(id);
|
||||
|
||||
WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx);
|
||||
if(djxxTmxx==null){
|
||||
if (djxxTmxx == null) {
|
||||
baseMapper.addDjTmxx(wjxDjxxTmxx);
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString();
|
||||
|
||||
try {
|
||||
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id", wjxxPar.getId());
|
||||
wjxWjxxTmlbQueryWrapper.eq("wj_index", wjxDjxxTmxx.getWjIndex());
|
||||
wjxWjxxTmlbQueryWrapper.last("limit 1");
|
||||
WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectOne(wjxWjxxTmlbQueryWrapper);
|
||||
wjxDjxxTmxx.setPicPath(tmlb.getPicPath());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
wjxDjxxTmxx.setId(id);
|
||||
WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx);
|
||||
if (djxxTmxx == null) {
|
||||
baseMapper.addDjTmxx(wjxDjxxTmxx);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String id = new DefaultIdentifierGenerator().nextId(new WjxDjxxTmxx()).toString();
|
||||
|
||||
try {
|
||||
QueryWrapper<WjxWjxx> wjxWjxxQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxQueryWrapper.eq("vid", vid);
|
||||
wjxWjxxQueryWrapper.last("limit 1");
|
||||
WjxWjxx wjxxPar = wjxWjxxMapper.selectOne(wjxWjxxQueryWrapper);
|
||||
QueryWrapper<WjxWjxxTmlb> wjxWjxxTmlbQueryWrapper = new QueryWrapper<>();
|
||||
wjxWjxxTmlbQueryWrapper.eq("main_id", wjxxPar.getId());
|
||||
wjxWjxxTmlbQueryWrapper.eq("wj_index", wjxDjxxTmxx.getWjIndex());
|
||||
wjxWjxxTmlbQueryWrapper.last("limit 1");
|
||||
WjxWjxxTmlb tmlb = wjxWjxxTmlbMapper.selectOne(wjxWjxxTmlbQueryWrapper);
|
||||
wjxDjxxTmxx.setPicPath(tmlb.getPicPath());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
wjxDjxxTmxx.setId(id);
|
||||
WjxDjxxTmxx djxxTmxx = baseMapper.getSfysj(wjxDjxxTmxx);
|
||||
if (djxxTmxx == null) {
|
||||
baseMapper.addDjTmxx(wjxDjxxTmxx);
|
||||
}
|
||||
}
|
||||
|
||||
//修改答卷信息
|
||||
baseMapper.updateAnswer(wjxDjxx);
|
||||
}
|
||||
} else {
|
||||
baseMapper.updateErrMsg(wjxDjxxPar.getUserId(), vid, ansJsonResult.getString("errormsg"));
|
||||
return ansJsonResult.getString("errormsg");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if(StringUtils.isNotBlank(jidRes)){
|
||||
jsscore(jidRes);
|
||||
//修改答卷信息
|
||||
baseMapper.updateAnswer(wjxDjxx);
|
||||
}
|
||||
} else {
|
||||
baseMapper.updateErrMsg(wjxDjxxPar.getUserId(), vid, ansJsonResult.getString("errormsg"));
|
||||
return ansJsonResult.getString("errormsg");
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
if (StringUtils.isNotBlank(jidRes)) {
|
||||
jsscore(jidRes);
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -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,25 +34,21 @@ 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.*;
|
||||
|
||||
/**
|
||||
* @Description: 问卷信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-04-26
|
||||
* @Date: 2024-04-26
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
|
@ -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,37 +451,36 @@ 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");
|
||||
WjxWjxxTmlb.setNum(num);
|
||||
WjxWjxxTmlb.setNum2(num2);
|
||||
num = wjxDjxxMapper.getDjnumType(wjxWjxx.getVid(), WjxWjxxTmlb.getWjIndex(), null, "1");
|
||||
num2 = wjxDjxxMapper.getDjnumType(wjxWjxx.getVid(), WjxWjxxTmlb.getWjIndex(), null, "2");
|
||||
WjxWjxxTmlb.setNum(num);
|
||||
WjxWjxxTmlb.setNum2(num2);
|
||||
// }
|
||||
|
||||
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,20 +7,18 @@ 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: 作业发布
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-05-06
|
||||
* @Date: 2024-05-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
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);
|
||||
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,98 +2,190 @@
|
|||
<!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
|
||||
${ew.customSqlSegment}
|
||||
LEFT JOIN xxhbxsxkb c on a.rwbh = c.KCAPZBBH
|
||||
left join zy_info_student b on a.id = b.main_id and b.create_by = c.xh
|
||||
${ew.customSqlSegment}
|
||||
|
||||
</select>
|
||||
<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
|
||||
${ew.customSqlSegment}
|
||||
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,
|
||||
b.fbzycs, -- 发布作业次数
|
||||
b.zywccs, -- 作业完成次数
|
||||
b.cccs, -- 查重次数
|
||||
b.hpcs, -- 互评次数
|
||||
b.cswwccs -- 超时未完成次数
|
||||
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 = '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
|
||||
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,
|
||||
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 = '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
|
||||
|
||||
</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,
|
||||
b.fbzycs, -- 发布作业次数
|
||||
b.zywccs, -- 作业完成次数
|
||||
b.cccs, -- 查重次数
|
||||
b.hpcs, -- 互评次数
|
||||
b.cswwccs -- 超时未完成次数
|
||||
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 = '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
|
||||
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,
|
||||
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 = '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
|
||||
|
||||
</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,8 +200,9 @@
|
|||
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
|
||||
where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xnxq = #{zyInfoSys.xqxn} and a.zy_status in (1,2)
|
||||
(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},'%')
|
||||
</if>
|
||||
|
@ -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,
|
||||
zy_leixing
|
||||
FROM
|
||||
zy_info
|
||||
WHERE
|
||||
xnxq = #{xqxn}
|
||||
AND rwbh = #{rwbh}
|
||||
GROUP BY
|
||||
zy_leixing UNION ALL
|
||||
SELECT
|
||||
sum( ifnull( score, '0' ) ) AS score,
|
||||
CASE
|
||||
atype
|
||||
WHEN '1' THEN
|
||||
'2' ELSE '3'
|
||||
END zy_leixing
|
||||
FROM
|
||||
wjx_wjxx
|
||||
WHERE
|
||||
xqxn = #{xqxn}
|
||||
AND rwbh = #{rwbh}
|
||||
GROUP BY
|
||||
atype
|
||||
SELECT sum(ifnull(score, '0')) AS score,
|
||||
zy_leixing
|
||||
FROM zy_info
|
||||
WHERE xnxq = #{xqxn}
|
||||
AND rwbh = #{rwbh}
|
||||
GROUP BY zy_leixing
|
||||
UNION ALL
|
||||
SELECT sum(ifnull(score, '0')) AS score,
|
||||
CASE
|
||||
atype
|
||||
WHEN '1' THEN
|
||||
'2'
|
||||
ELSE '3'
|
||||
END zy_leixing
|
||||
FROM wjx_wjxx
|
||||
WHERE xqxn = #{xqxn}
|
||||
AND rwbh = #{rwbh}
|
||||
GROUP BY atype
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="sysStaticList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
SELECT
|
||||
distinct a.id,
|
||||
|
@ -179,13 +269,15 @@
|
|||
IF( a.zy_status = '2', '全部完成', '未全部完成' ) as sfwc,
|
||||
IF( a.zy_status = '0', '未发布', '已发布' ) as sffb,
|
||||
IF( a.xshpkg = '1', '是', '否' ) as sfhp,
|
||||
a.create_by as jgh,c.xm as skjs, c.dwmc as kkdw ,
|
||||
a.create_by as jgh,c.xm as skjs, c.dwmc as kkdw ,
|
||||
if(a.sfcc = 1,'查重','不查重') as sfcc,
|
||||
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,217 +314,300 @@
|
|||
|
||||
|
||||
<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,
|
||||
t.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
b.kcmc,
|
||||
count(*) AS count,
|
||||
SELECT (@rownum := @rownum + 1) AS rownum,
|
||||
t.*
|
||||
FROM (SELECT b.kcmc,
|
||||
count(*) AS count,
|
||||
b.kkdw
|
||||
FROM
|
||||
zy_info a,
|
||||
kc_kechengbiao b
|
||||
WHERE
|
||||
a.rwbh = b.rwbh
|
||||
AND a.xnxq = #{zyInfoSys.xqxn} GROUP BY b.kcmc,b.kkdw
|
||||
FROM
|
||||
zy_info a,
|
||||
kc_kechengbiao b
|
||||
WHERE
|
||||
a.rwbh = b.rwbh
|
||||
AND a.xnxq = #{zyInfoSys.xqxn}
|
||||
GROUP BY b.kcmc, b.kkdw
|
||||
|
||||
union all
|
||||
union all
|
||||
|
||||
SELECT
|
||||
b.kcmc,
|
||||
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
|
||||
SELECT
|
||||
b.kcmc,
|
||||
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
|
||||
</select>
|
||||
|
||||
<select id="getXnKcList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
SELECT
|
||||
( @rownum := @rownum + 1 ) AS rownum,
|
||||
t.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
b.kcmc,
|
||||
count(*) AS count,
|
||||
SELECT (@rownum := @rownum + 1) AS rownum,
|
||||
t.*
|
||||
FROM (SELECT b.kcmc,
|
||||
count(*) AS count,
|
||||
b.kkdw
|
||||
FROM
|
||||
zy_info a,
|
||||
kc_kechengbiao b
|
||||
WHERE
|
||||
a.rwbh = b.rwbh
|
||||
AND a.xnxq = #{zyInfoSys.xqxn} GROUP BY b.kcmc,b.kkdw
|
||||
FROM
|
||||
zy_info a,
|
||||
kc_kechengbiao b
|
||||
WHERE
|
||||
a.rwbh = b.rwbh
|
||||
AND a.xnxq = #{zyInfoSys.xqxn}
|
||||
GROUP BY b.kcmc, b.kkdw
|
||||
|
||||
union all
|
||||
union all
|
||||
|
||||
SELECT
|
||||
b.kcmc,
|
||||
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
|
||||
SELECT
|
||||
b.kcmc,
|
||||
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
|
||||
</select>
|
||||
|
||||
<select id="getJsTopList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
SELECT
|
||||
( @rownum := @rownum + 1 ) AS rownum,
|
||||
t.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a.create_by,
|
||||
count(*) AS count,
|
||||
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
|
||||
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
|
||||
|
||||
union all
|
||||
union all
|
||||
|
||||
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
|
||||
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="getXnJsList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
SELECT
|
||||
( @rownum := @rownum + 1 ) AS rownum,
|
||||
t.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a.create_by,
|
||||
count(*) AS count,
|
||||
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
|
||||
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
|
||||
|
||||
union all
|
||||
union all
|
||||
|
||||
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
|
||||
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="sysStaticZyList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfoSys">
|
||||
|
@ -442,8 +616,9 @@
|
|||
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
|
||||
where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xnxq = #{zyInfoSys.xqxn} and a.zy_status in (1,2)
|
||||
(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},'%')
|
||||
</if>
|
||||
|
@ -465,8 +640,9 @@
|
|||
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
|
||||
where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xqxn = #{zyInfoSys.xqxn} and a.qpublish in (1,2)
|
||||
(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},'%')
|
||||
</if>
|
||||
|
@ -485,8 +661,9 @@
|
|||
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
|
||||
where a.rwbh = b.rwbh and a.create_by = b.jgh and a.xqxn = #{zyInfoSys.xqxn} and a.qpublish in (1,2)
|
||||
(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},'%')
|
||||
</if>
|
||||
|
@ -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;
|
||||
|
@ -14,7 +15,7 @@ import java.util.Map;
|
|||
/**
|
||||
* @Description: 作业发布
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-05-06
|
||||
* @Date: 2024-05-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IZyInfoService extends IService<ZyInfo> {
|
||||
|
@ -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;
|
||||
|
@ -16,7 +17,7 @@ import java.util.Map;
|
|||
/**
|
||||
* @Description: 学生提交作业
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-05-06
|
||||
* @Date: 2024-05-06
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IZyInfoStudentService extends IService<ZyInfoStudent> {
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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