修改bug
This commit is contained in:
parent
8a9375d4fd
commit
a8f11a5800
|
@ -107,4 +107,8 @@ public class KcGongkaike implements Serializable {
|
|||
|
||||
@TableField(exist = false)
|
||||
private String type;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String logcount;
|
||||
|
||||
}
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
SELECT * from (
|
||||
SELECT * from (
|
||||
select * from (
|
||||
select *,'1' as type from kc_gongkaike where rq >= DATE_FORMAT(now(),'%Y-%m-%d') ORDER BY rq asc,kssj asc
|
||||
select *,'1' as type,( SELECT count( DISTINCT usercode ) AS logcount from kc_gongkaikelog where gkkid=a.id ) as logcount
|
||||
from kc_gongkaike a where rq >= DATE_FORMAT(now(),'%Y-%m-%d') ORDER BY rq asc,kssj asc limit 99999999999
|
||||
) a2
|
||||
union
|
||||
select * from (
|
||||
select *,'2' as type from kc_gongkaike where rq < DATE_FORMAT(now(),'%Y-%m-%d') ORDER BY rq desc,kssj desc
|
||||
select *,'2' as type,( SELECT count( DISTINCT usercode ) AS logcount from kc_gongkaikelog where gkkid=a.id ) as logcount
|
||||
from kc_gongkaike a where rq < DATE_FORMAT(now(),'%Y-%m-%d') ORDER BY rq desc,kssj desc limit 99999999999
|
||||
) a3
|
||||
) a ORDER BY type asc
|
||||
) a
|
||||
|
|
|
@ -0,0 +1,176 @@
|
|||
package org.jeecg.modules.kc.kcGongkaikelog.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.kc.kcGongkaikelog.entity.KcGongkaikelog;
|
||||
import org.jeecg.modules.kc.kcGongkaikelog.service.IKcGongkaikelogService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: kc_gongkaikelog
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-06-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="kc_gongkaikelog")
|
||||
@RestController
|
||||
@RequestMapping("/kcGongkaikelog/kcGongkaikelog")
|
||||
@Slf4j
|
||||
public class KcGongkaikelogController extends JeecgController<KcGongkaikelog, IKcGongkaikelogService> {
|
||||
@Autowired
|
||||
private IKcGongkaikelogService kcGongkaikelogService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param kcGongkaikelog
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "kc_gongkaikelog-分页列表查询")
|
||||
@ApiOperation(value="kc_gongkaikelog-分页列表查询", notes="kc_gongkaikelog-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<KcGongkaikelog>> queryPageList(KcGongkaikelog kcGongkaikelog,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<KcGongkaikelog> queryWrapper = QueryGenerator.initQueryWrapper(kcGongkaikelog, req.getParameterMap());
|
||||
Page<KcGongkaikelog> page = new Page<KcGongkaikelog>(pageNo, pageSize);
|
||||
IPage<KcGongkaikelog> pageList = kcGongkaikelogService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param kcGongkaikelog
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "kc_gongkaikelog-添加")
|
||||
@ApiOperation(value="kc_gongkaikelog-添加", notes="kc_gongkaikelog-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody KcGongkaikelog kcGongkaikelog) {
|
||||
kcGongkaikelogService.save(kcGongkaikelog);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param kcGongkaikelog
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "kc_gongkaikelog-编辑")
|
||||
@ApiOperation(value="kc_gongkaikelog-编辑", notes="kc_gongkaikelog-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody KcGongkaikelog kcGongkaikelog) {
|
||||
kcGongkaikelogService.updateById(kcGongkaikelog);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "kc_gongkaikelog-通过id删除")
|
||||
@ApiOperation(value="kc_gongkaikelog-通过id删除", notes="kc_gongkaikelog-通过id删除")
|
||||
@RequiresPermissions("kcGongkaikelog:kc_gongkaikelog:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
kcGongkaikelogService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "kc_gongkaikelog-批量删除")
|
||||
@ApiOperation(value="kc_gongkaikelog-批量删除", notes="kc_gongkaikelog-批量删除")
|
||||
@RequiresPermissions("kcGongkaikelog:kc_gongkaikelog:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.kcGongkaikelogService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "kc_gongkaikelog-通过id查询")
|
||||
@ApiOperation(value="kc_gongkaikelog-通过id查询", notes="kc_gongkaikelog-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<KcGongkaikelog> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
KcGongkaikelog kcGongkaikelog = kcGongkaikelogService.getById(id);
|
||||
if(kcGongkaikelog==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(kcGongkaikelog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param kcGongkaikelog
|
||||
*/
|
||||
@RequiresPermissions("kcGongkaikelog:kc_gongkaikelog:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, KcGongkaikelog kcGongkaikelog) {
|
||||
return super.exportXls(request, kcGongkaikelog, KcGongkaikelog.class, "kc_gongkaikelog");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("kcGongkaikelog:kc_gongkaikelog:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, KcGongkaikelog.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package org.jeecg.modules.kc.kcGongkaikelog.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: kc_gongkaikelog
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-06-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("kc_gongkaikelog")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="kc_gongkaikelog对象", description="kc_gongkaikelog")
|
||||
public class KcGongkaikelog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**账号*/
|
||||
@Excel(name = "账号", width = 15)
|
||||
@ApiModelProperty(value = "账号")
|
||||
private java.lang.String usercode;
|
||||
/**用户名*/
|
||||
@Excel(name = "用户名", width = 15)
|
||||
@ApiModelProperty(value = "用户名")
|
||||
private java.lang.String username;
|
||||
/**时间*/
|
||||
@Excel(name = "时间", width = 15)
|
||||
@ApiModelProperty(value = "时间")
|
||||
private java.lang.String shijian;
|
||||
/**公开课id*/
|
||||
@Excel(name = "公开课id", width = 15)
|
||||
@ApiModelProperty(value = "公开课id")
|
||||
private java.lang.String gkkid;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package org.jeecg.modules.kc.kcGongkaikelog.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.kc.kcGongkaikelog.entity.KcGongkaikelog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: kc_gongkaikelog
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-06-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface KcGongkaikelogMapper extends BaseMapper<KcGongkaikelog> {
|
||||
|
||||
}
|
|
@ -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.kcGongkaikelog.mapper.KcGongkaikelogMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package org.jeecg.modules.kc.kcGongkaikelog.service;
|
||||
|
||||
import org.jeecg.modules.kc.kcGongkaikelog.entity.KcGongkaikelog;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: kc_gongkaikelog
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-06-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IKcGongkaikelogService extends IService<KcGongkaikelog> {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.jeecg.modules.kc.kcGongkaikelog.service.impl;
|
||||
|
||||
import org.jeecg.modules.kc.kcGongkaikelog.entity.KcGongkaikelog;
|
||||
import org.jeecg.modules.kc.kcGongkaikelog.mapper.KcGongkaikelogMapper;
|
||||
import org.jeecg.modules.kc.kcGongkaikelog.service.IKcGongkaikelogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: kc_gongkaikelog
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-06-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class KcGongkaikelogServiceImpl extends ServiceImpl<KcGongkaikelogMapper, KcGongkaikelog> implements IKcGongkaikelogService {
|
||||
|
||||
}
|
Loading…
Reference in New Issue