forked from wangjiadong/comp
parent
ad2edd5d6e
commit
ef51b262cd
21 changed files with 1641 additions and 0 deletions
@ -0,0 +1,178 @@ |
||||
package org.jeecg.modules.demo.expscore.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.demo.expscore.entity.ExpScore; |
||||
import org.jeecg.modules.demo.expscore.service.IExpScoreService; |
||||
|
||||
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: 专家评分 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-11-03 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="专家评分") |
||||
@RestController |
||||
@RequestMapping("/expscore/expScore") |
||||
@Slf4j |
||||
public class ExpScoreController extends JeecgController<ExpScore, IExpScoreService> { |
||||
@Autowired |
||||
private IExpScoreService expScoreService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param expScore |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
//@AutoLog(value = "专家评分-分页列表查询")
|
||||
@ApiOperation(value="专家评分-分页列表查询", notes="专家评分-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<IPage<ExpScore>> queryPageList(ExpScore expScore, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<ExpScore> queryWrapper = QueryGenerator.initQueryWrapper(expScore, req.getParameterMap()); |
||||
Page<ExpScore> page = new Page<ExpScore>(pageNo, pageSize); |
||||
IPage<ExpScore> pageList = expScoreService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param expScore |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "专家评分-添加") |
||||
@ApiOperation(value="专家评分-添加", notes="专家评分-添加") |
||||
//@RequiresPermissions("expscore:exp_score:add")
|
||||
@PostMapping(value = "/add") |
||||
public Result<String> add(@RequestBody ExpScore expScore) { |
||||
expScoreService.save(expScore); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param expScore |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "专家评分-编辑") |
||||
@ApiOperation(value="专家评分-编辑", notes="专家评分-编辑") |
||||
//@RequiresPermissions("expscore:exp_score:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
||||
public Result<String> edit(@RequestBody ExpScore expScore) { |
||||
expScoreService.updateById(expScore); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "专家评分-通过id删除") |
||||
@ApiOperation(value="专家评分-通过id删除", notes="专家评分-通过id删除") |
||||
//@RequiresPermissions("expscore:exp_score:delete")
|
||||
@DeleteMapping(value = "/delete") |
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
||||
expScoreService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "专家评分-批量删除") |
||||
@ApiOperation(value="专家评分-批量删除", notes="专家评分-批量删除") |
||||
//@RequiresPermissions("expscore:exp_score:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.expScoreService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
//@AutoLog(value = "专家评分-通过id查询")
|
||||
@ApiOperation(value="专家评分-通过id查询", notes="专家评分-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<ExpScore> queryById(@RequestParam(name="id",required=true) String id) { |
||||
ExpScore expScore = expScoreService.getById(id); |
||||
if(expScore==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(expScore); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param expScore |
||||
*/ |
||||
//@RequiresPermissions("expscore:exp_score:exportXls")
|
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, ExpScore expScore) { |
||||
return super.exportXls(request, expScore, ExpScore.class, "专家评分"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
//@RequiresPermissions("expscore:exp_score:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, ExpScore.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,105 @@ |
||||
package org.jeecg.modules.demo.expscore.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: 专家评分 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-11-03 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("exp_score") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="exp_score对象", description="专家评分") |
||||
public class ExpScore implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private java.lang.String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private java.util.Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private java.lang.String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private java.util.Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private java.lang.String sysOrgCode; |
||||
/**年度*/ |
||||
@Excel(name = "年度", width = 15, dictTable = "annual", dicText = "annual_name", dicCode = "id") |
||||
@Dict(dictTable = "annual", dicText = "annual_name", dicCode = "id") |
||||
@ApiModelProperty(value = "年度") |
||||
private java.lang.String annid; |
||||
/**年度比赛*/ |
||||
@Excel(name = "年度比赛", width = 15, dictTable = "annual_comp", dicText = "name", dicCode = "id") |
||||
@Dict(dictTable = "annual_comp", dicText = "name", dicCode = "id") |
||||
@ApiModelProperty(value = "年度比赛") |
||||
private java.lang.String annalComp; |
||||
/**年度比赛项目*/ |
||||
@Excel(name = "年度比赛项目", width = 15, dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id") |
||||
@Dict(dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id") |
||||
@ApiModelProperty(value = "年度比赛项目") |
||||
private java.lang.String annComP; |
||||
/**题目*/ |
||||
@Excel(name = "题目", width = 15, dictTable = "topic", dicText = "name", dicCode = "id") |
||||
@Dict(dictTable = "topic", dicText = "name", dicCode = "id") |
||||
@ApiModelProperty(value = "题目") |
||||
private java.lang.String topid; |
||||
/**报名编号*/ |
||||
@Excel(name = "报名编号", width = 15) |
||||
@ApiModelProperty(value = "报名编号") |
||||
private java.lang.String bmcode; |
||||
/**作品*/ |
||||
@Excel(name = "作品", width = 15, dictTable = "upfile_persion", dicText = "topic_name", dicCode = "id") |
||||
@Dict(dictTable = "upfile_persion", dicText = "topic_name", dicCode = "id") |
||||
@ApiModelProperty(value = "作品") |
||||
private java.lang.String upfilePersionId; |
||||
/**评分标准id*/ |
||||
@Excel(name = "评分标准id", width = 15) |
||||
@ApiModelProperty(value = "评分标准id") |
||||
private java.lang.String scoreStaid; |
||||
/**成绩*/ |
||||
@Excel(name = "成绩", width = 15) |
||||
@ApiModelProperty(value = "成绩") |
||||
private java.lang.Integer score; |
||||
/**评分人*/ |
||||
@Excel(name = "评分人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") |
||||
@ApiModelProperty(value = "评分人") |
||||
private java.lang.String userid; |
||||
/**是否评分*/ |
||||
@Excel(name = "是否评分", width = 15, dicCode = "yn") |
||||
@Dict(dicCode = "yn") |
||||
@ApiModelProperty(value = "是否评分") |
||||
private java.lang.String ispf; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.expscore.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.expscore.entity.ExpScore; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 专家评分 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-11-03 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ExpScoreMapper extends BaseMapper<ExpScore> { |
||||
|
||||
} |
@ -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.demo.expscore.mapper.ExpScoreMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.expscore.service; |
||||
|
||||
import org.jeecg.modules.demo.expscore.entity.ExpScore; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 专家评分 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-11-03 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IExpScoreService extends IService<ExpScore> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.expscore.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.expscore.entity.ExpScore; |
||||
import org.jeecg.modules.demo.expscore.mapper.ExpScoreMapper; |
||||
import org.jeecg.modules.demo.expscore.service.IExpScoreService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 专家评分 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-11-03 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ExpScoreServiceImpl extends ServiceImpl<ExpScoreMapper, ExpScore> implements IExpScoreService { |
||||
|
||||
} |
@ -0,0 +1,332 @@ |
||||
package org.jeecg.modules.demo.scorepersion.controller; |
||||
|
||||
import java.text.DecimalFormat; |
||||
import java.util.ArrayList; |
||||
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.annotation.Resource; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
import org.apache.shiro.SecurityUtils; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.system.vo.LoginUser; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
import org.jeecg.config.JeecgBaseConfig; |
||||
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; |
||||
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService; |
||||
import org.jeecg.modules.demo.annualcompaward.entity.AnnualCompAward; |
||||
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration; |
||||
import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService; |
||||
import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; |
||||
import org.jeecg.modules.demo.awardpersion.entity.AwardPersionMb; |
||||
import org.jeecg.modules.demo.scorepersion.entity.ScorePersion; |
||||
import org.jeecg.modules.demo.scorepersion.entity.ScorePersionMb; |
||||
import org.jeecg.modules.demo.scorepersion.service.IScorePersionService; |
||||
|
||||
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: 成绩管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="成绩管理") |
||||
@RestController |
||||
@RequestMapping("/scorepersion/scorePersion") |
||||
@Slf4j |
||||
public class ScorePersionController extends JeecgController<ScorePersion, IScorePersionService> { |
||||
@Autowired |
||||
private IScorePersionService scorePersionService; |
||||
@Autowired |
||||
private IAnnualCompetitionProjectRegistrationService annualCompetitionProjectRegistrationService; |
||||
@Autowired |
||||
private IAnnualCompPointService annualCompPointService; |
||||
@Resource |
||||
private JeecgBaseConfig jeecgBaseConfig; |
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param scorePersion |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
//@AutoLog(value = "成绩管理-分页列表查询")
|
||||
@ApiOperation(value="成绩管理-分页列表查询", notes="成绩管理-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<IPage<ScorePersion>> queryPageList(ScorePersion scorePersion, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<ScorePersion> queryWrapper = QueryGenerator.initQueryWrapper(scorePersion, req.getParameterMap()); |
||||
Page<ScorePersion> page = new Page<ScorePersion>(pageNo, pageSize); |
||||
IPage<ScorePersion> pageList = scorePersionService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param scorePersion |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "成绩管理-添加") |
||||
@ApiOperation(value="成绩管理-添加", notes="成绩管理-添加") |
||||
//@RequiresPermissions("scorepersion:score_persion:add")
|
||||
@PostMapping(value = "/add") |
||||
public Result<String> add(@RequestBody ScorePersion scorePersion,HttpServletRequest req) { |
||||
AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); |
||||
QueryWrapper<AnnualCompetitionProjectRegistration> queryWrappera = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); |
||||
queryWrappera.eq("annual_compid",scorePersion.getAnnualCompP()); |
||||
queryWrappera.eq("enroll_static","2"); |
||||
queryWrappera.eq("enroll_code",scorePersion.getEnrollCode()); |
||||
List<AnnualCompetitionProjectRegistration> lista = annualCompetitionProjectRegistrationService.list(queryWrappera); |
||||
if(lista.size()==0){ |
||||
return Result.error("报名编号不存在"); |
||||
}else { |
||||
if(scorePersion.getSort()<1){ |
||||
return Result.error("排名不可小于1"); |
||||
}else { |
||||
DecimalFormat decimalFormat = new DecimalFormat("0.00"); |
||||
String dfstr = decimalFormat.format(Double.valueOf(scorePersion.getScore())); |
||||
scorePersion.setScore(dfstr); |
||||
scorePersionService.save(scorePersion); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param scorePersion |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "成绩管理-编辑") |
||||
@ApiOperation(value="成绩管理-编辑", notes="成绩管理-编辑") |
||||
//@RequiresPermissions("scorepersion:score_persion:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
||||
public Result<String> edit(@RequestBody ScorePersion scorePersion,HttpServletRequest req) { |
||||
AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); |
||||
QueryWrapper<AnnualCompetitionProjectRegistration> queryWrappera = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); |
||||
queryWrappera.eq("annual_compid",scorePersion.getAnnualCompP()); |
||||
queryWrappera.eq("enroll_static","2"); |
||||
queryWrappera.eq("enroll_code",scorePersion.getEnrollCode()); |
||||
List<AnnualCompetitionProjectRegistration> lista = annualCompetitionProjectRegistrationService.list(queryWrappera); |
||||
if(lista.size()==0){ |
||||
return Result.error("报名编号不存在"); |
||||
}else { |
||||
if(scorePersion.getSort()<1){ |
||||
return Result.error("排名不可小于1"); |
||||
}else { |
||||
DecimalFormat decimalFormat = new DecimalFormat("0.00"); |
||||
String dfstr = decimalFormat.format(Double.valueOf(scorePersion.getScore())); |
||||
scorePersion.setScore(dfstr); |
||||
scorePersionService.updateById(scorePersion); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "成绩管理-通过id删除") |
||||
@ApiOperation(value="成绩管理-通过id删除", notes="成绩管理-通过id删除") |
||||
//@RequiresPermissions("scorepersion:score_persion:delete")
|
||||
@DeleteMapping(value = "/delete") |
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
||||
scorePersionService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "成绩管理-批量删除") |
||||
@ApiOperation(value="成绩管理-批量删除", notes="成绩管理-批量删除") |
||||
//@RequiresPermissions("scorepersion:score_persion:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.scorePersionService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
//@AutoLog(value = "成绩管理-通过id查询")
|
||||
@ApiOperation(value="成绩管理-通过id查询", notes="成绩管理-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<ScorePersion> queryById(@RequestParam(name="id",required=true) String id) { |
||||
ScorePersion scorePersion = scorePersionService.getById(id); |
||||
if(scorePersion==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(scorePersion); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param scorePersion |
||||
*/ |
||||
//@RequiresPermissions("scorepersion:score_persion:exportXls")
|
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, ScorePersion scorePersion) { |
||||
return super.exportXls(request, scorePersion, ScorePersion.class, "成绩管理"); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel模板 |
||||
* |
||||
*/ |
||||
//@RequiresPermissions("awardpersion:award_persion:exportXls")
|
||||
@RequestMapping(value = "/exportXlsMb") |
||||
public ModelAndView exportXlsMb(HttpServletRequest request, ScorePersion scorePersion) { |
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
||||
// Step.2 获取导出数据
|
||||
List<ScorePersionMb> exportList = new ArrayList<>(); |
||||
|
||||
// Step.3 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
||||
//此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "成绩管理模板"); |
||||
mv.addObject(NormalExcelConstants.CLASS, ScorePersionMb.class); |
||||
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
||||
ExportParams exportParams=new ExportParams("成绩管理模板" + "报表", "导出人:" + sysUser.getRealname(), "成绩管理模板"); |
||||
exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload()); |
||||
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
||||
mv.addObject(NormalExcelConstants.PARAMS,exportParams); |
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList); |
||||
return mv; |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
//@RequiresPermissions("scorepersion:score_persion:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); |
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { |
||||
// 获取上传文件对象
|
||||
MultipartFile file = entity.getValue(); |
||||
ImportParams params = new ImportParams(); |
||||
params.setTitleRows(2); |
||||
params.setHeadRows(1); |
||||
params.setNeedSave(true); |
||||
try { |
||||
List<ScorePersion> list = ExcelImportUtil.importExcel(file.getInputStream(), ScorePersion.class, params); |
||||
for(int i = 0 ; i < list.size() ; i++){ |
||||
AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); |
||||
QueryWrapper<AnnualCompetitionProjectRegistration> queryWrappera = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, request.getParameterMap()); |
||||
queryWrappera.eq("annual_compid",list.get(i).getAnnualCompP()); |
||||
queryWrappera.eq("enroll_static","2"); |
||||
queryWrappera.eq("enroll_code",list.get(i).getEnrollCode()); |
||||
List<AnnualCompetitionProjectRegistration> lista = annualCompetitionProjectRegistrationService.list(queryWrappera); |
||||
if(lista.size()==0){ |
||||
return Result.error("文件导入失败:第"+(i+1)+"行报名编号不存在"); |
||||
} |
||||
ScorePersion sp = new ScorePersion(); |
||||
QueryWrapper<ScorePersion> queryWrappersp = QueryGenerator.initQueryWrapper(sp, request.getParameterMap()); |
||||
queryWrappersp.eq("enroll_code",list.get(i).getEnrollCode()); |
||||
List<ScorePersion> listsp = scorePersionService.list(queryWrappersp); |
||||
if(listsp.size()>0){ |
||||
return Result.error("文件导入失败:第"+(i+1)+"行报名编号重复"); |
||||
} |
||||
String regex = "^[0-9]+(.[0-9]{2})?$"; |
||||
if(!list.get(i).getScore().matches(regex)){ |
||||
return Result.error("文件导入失败:第"+(i+1)+"行得分格式不正确"); |
||||
}else { |
||||
DecimalFormat decimalFormat = new DecimalFormat("0.00"); |
||||
String dfstr = decimalFormat.format(Double.valueOf(list.get(i).getScore())); |
||||
list.get(i).setScore(dfstr); |
||||
} |
||||
if(list.get(i).getSort()<1){ |
||||
return Result.error("文件导入失败:第"+(i+1)+"行排名不能小于1"); |
||||
} |
||||
|
||||
} |
||||
//update-begin-author:taoyan date:20190528 for:批量插入数据
|
||||
long start = System.currentTimeMillis(); |
||||
scorePersionService.saveBatch(list); |
||||
for (int k = 0 ; k < list.size() ; k++){ |
||||
AnnualCompPoint annualCompPoint = annualCompPointService.getById(list.get(k).getAnnualCompP()); |
||||
annualCompPoint.setIsCjhz(1); |
||||
annualCompPointService.updateById(annualCompPoint); |
||||
} |
||||
|
||||
//400条 saveBatch消耗时间1592毫秒 循环插入消耗时间1947毫秒
|
||||
//1200条 saveBatch消耗时间3687毫秒 循环插入消耗时间5212毫秒
|
||||
log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒"); |
||||
//update-end-author:taoyan date:20190528 for:批量插入数据
|
||||
return Result.ok("文件导入成功!数据行数:" + list.size()); |
||||
} catch (Exception e) { |
||||
//update-begin-author:taoyan date:20211124 for: 导入数据重复增加提示
|
||||
String msg = e.getMessage(); |
||||
log.error(msg, e); |
||||
if(msg!=null && msg.indexOf("Duplicate entry")>=0){ |
||||
return Result.error("文件导入失败:有重复数据!"); |
||||
}else{ |
||||
return Result.error("文件导入失败:" + e.getMessage()); |
||||
} |
||||
//update-end-author:taoyan date:20211124 for: 导入数据重复增加提示
|
||||
} finally { |
||||
try { |
||||
file.getInputStream().close(); |
||||
} catch (IOException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
} |
||||
return Result.error("文件导入失败!"); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,85 @@ |
||||
package org.jeecg.modules.demo.scorepersion.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: 成绩管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("score_persion") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="score_persion对象", description="成绩管理") |
||||
public class ScorePersion implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private java.lang.String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private java.util.Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private java.lang.String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private java.util.Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private java.lang.String sysOrgCode; |
||||
/**年度*/ |
||||
@Excel(name = "年度", width = 15, dictTable = "annual", dicText = "annual_name", dicCode = "id") |
||||
@Dict(dictTable = "annual", dicText = "annual_name", dicCode = "id") |
||||
@ApiModelProperty(value = "年度") |
||||
private java.lang.String annualid; |
||||
/**年度比赛*/ |
||||
@Excel(name = "年度比赛", width = 15, dictTable = "annual_comp", dicText = "name", dicCode = "id") |
||||
@Dict(dictTable = "annual_comp", dicText = "name", dicCode = "id") |
||||
@ApiModelProperty(value = "年度比赛") |
||||
private java.lang.String annualCompid; |
||||
/**年度比赛项目*/ |
||||
@Excel(name = "年度比赛项目", width = 15, dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id") |
||||
@Dict(dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id") |
||||
@ApiModelProperty(value = "年度比赛项目") |
||||
private java.lang.String annualCompP; |
||||
/**报名编号*/ |
||||
@Excel(name = "报名编号", width = 15) |
||||
@ApiModelProperty(value = "报名编号") |
||||
private java.lang.String enrollCode; |
||||
/**得分*/ |
||||
@Excel(name = "得分", width = 15) |
||||
@ApiModelProperty(value = "得分") |
||||
private java.lang.String score; |
||||
/**排名*/ |
||||
@Excel(name = "排名", width = 15) |
||||
@ApiModelProperty(value = "排名") |
||||
private java.lang.Integer sort; |
||||
} |
@ -0,0 +1,88 @@ |
||||
package org.jeecg.modules.demo.scorepersion.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.jeecg.common.aspect.annotation.Dict; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @Description: 成绩管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("score_persion") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="score_persion对象", description="成绩管理") |
||||
public class ScorePersionMb implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private String sysOrgCode; |
||||
/**年度*/ |
||||
@Excel(name = "年度", width = 15, dictTable = "annual", dicText = "annual_name", dicCode = "id") |
||||
@Dict(dictTable = "annual", dicText = "annual_name", dicCode = "id") |
||||
@ApiModelProperty(value = "年度") |
||||
private String annualid; |
||||
/**年度比赛*/ |
||||
@Excel(name = "年度比赛", width = 15, dictTable = "annual_comp", dicText = "name", dicCode = "id") |
||||
@Dict(dictTable = "annual_comp", dicText = "name", dicCode = "id") |
||||
@ApiModelProperty(value = "年度比赛") |
||||
private String annualCompid; |
||||
/**年度比赛项目*/ |
||||
@Excel(name = "年度比赛项目", width = 15, dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id") |
||||
@Dict(dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id") |
||||
@ApiModelProperty(value = "年度比赛项目") |
||||
private String annualCompP; |
||||
/**报名编号*/ |
||||
@Excel(name = "报名编号", width = 15) |
||||
@ApiModelProperty(value = "报名编号") |
||||
private String enrollCode; |
||||
/**得分*/ |
||||
@Excel(name = "得分", width = 15) |
||||
@ApiModelProperty(value = "得分") |
||||
private String score; |
||||
/**排名*/ |
||||
@Excel(name = "排名", width = 15) |
||||
@ApiModelProperty(value = "排名") |
||||
private Integer sort; |
||||
/**学生姓名*/ |
||||
@Excel(name = "学生姓名", width = 15) |
||||
@TableField(exist = false) |
||||
private String studentname; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.scorepersion.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.scorepersion.entity.ScorePersion; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 成绩管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ScorePersionMapper extends BaseMapper<ScorePersion> { |
||||
|
||||
} |
@ -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.demo.scorepersion.mapper.ScorePersionMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.scorepersion.service; |
||||
|
||||
import org.jeecg.modules.demo.scorepersion.entity.ScorePersion; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 成绩管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IScorePersionService extends IService<ScorePersion> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.scorepersion.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.scorepersion.entity.ScorePersion; |
||||
import org.jeecg.modules.demo.scorepersion.mapper.ScorePersionMapper; |
||||
import org.jeecg.modules.demo.scorepersion.service.IScorePersionService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 成绩管理 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-11-01 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ScorePersionServiceImpl extends ServiceImpl<ScorePersionMapper, ScorePersion> implements IScorePersionService { |
||||
|
||||
} |
@ -0,0 +1,178 @@ |
||||
package org.jeecg.modules.demo.scoresta.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.demo.scoresta.entity.ScoreSta; |
||||
import org.jeecg.modules.demo.scoresta.service.IScoreStaService; |
||||
|
||||
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: 评分标准 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-10-25 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="评分标准") |
||||
@RestController |
||||
@RequestMapping("/scoresta/scoreSta") |
||||
@Slf4j |
||||
public class ScoreStaController extends JeecgController<ScoreSta, IScoreStaService> { |
||||
@Autowired |
||||
private IScoreStaService scoreStaService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param scoreSta |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
//@AutoLog(value = "评分标准-分页列表查询")
|
||||
@ApiOperation(value="评分标准-分页列表查询", notes="评分标准-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<IPage<ScoreSta>> queryPageList(ScoreSta scoreSta, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<ScoreSta> queryWrapper = QueryGenerator.initQueryWrapper(scoreSta, req.getParameterMap()); |
||||
Page<ScoreSta> page = new Page<ScoreSta>(pageNo, pageSize); |
||||
IPage<ScoreSta> pageList = scoreStaService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param scoreSta |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "评分标准-添加") |
||||
@ApiOperation(value="评分标准-添加", notes="评分标准-添加") |
||||
//@RequiresPermissions("scoresta:score_sta:add")
|
||||
@PostMapping(value = "/add") |
||||
public Result<String> add(@RequestBody ScoreSta scoreSta) { |
||||
scoreStaService.save(scoreSta); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param scoreSta |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "评分标准-编辑") |
||||
@ApiOperation(value="评分标准-编辑", notes="评分标准-编辑") |
||||
//@RequiresPermissions("scoresta:score_sta:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
||||
public Result<String> edit(@RequestBody ScoreSta scoreSta) { |
||||
scoreStaService.updateById(scoreSta); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "评分标准-通过id删除") |
||||
@ApiOperation(value="评分标准-通过id删除", notes="评分标准-通过id删除") |
||||
//@RequiresPermissions("scoresta:score_sta:delete")
|
||||
@DeleteMapping(value = "/delete") |
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
||||
scoreStaService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "评分标准-批量删除") |
||||
@ApiOperation(value="评分标准-批量删除", notes="评分标准-批量删除") |
||||
//@RequiresPermissions("scoresta:score_sta:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.scoreStaService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
//@AutoLog(value = "评分标准-通过id查询")
|
||||
@ApiOperation(value="评分标准-通过id查询", notes="评分标准-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<ScoreSta> queryById(@RequestParam(name="id",required=true) String id) { |
||||
ScoreSta scoreSta = scoreStaService.getById(id); |
||||
if(scoreSta==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(scoreSta); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param scoreSta |
||||
*/ |
||||
//@RequiresPermissions("scoresta:score_sta:exportXls")
|
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, ScoreSta scoreSta) { |
||||
return super.exportXls(request, scoreSta, ScoreSta.class, "评分标准"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
//@RequiresPermissions("scoresta:score_sta:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, ScoreSta.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,78 @@ |
||||
package org.jeecg.modules.demo.scoresta.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: 评分标准 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-10-25 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("score_sta") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="score_sta对象", description="评分标准") |
||||
public class ScoreSta implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private java.lang.String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private java.util.Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private java.lang.String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private java.util.Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private java.lang.String sysOrgCode; |
||||
/**年度*/ |
||||
@Excel(name = "年度", width = 15, dictTable = "annual", dicText = "annual_name", dicCode = "id") |
||||
@Dict(dictTable = "annual", dicText = "annual_name", dicCode = "id") |
||||
@ApiModelProperty(value = "年度") |
||||
private java.lang.String annualId; |
||||
/**年度比赛*/ |
||||
@Excel(name = "年度比赛", width = 15, dictTable = "annual_comp", dicText = "name", dicCode = "id") |
||||
@Dict(dictTable = "annual_comp", dicText = "name", dicCode = "id") |
||||
@ApiModelProperty(value = "年度比赛") |
||||
private java.lang.String annalComp; |
||||
/**年度比赛项目*/ |
||||
@Excel(name = "年度比赛项目", width = 15, dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id") |
||||
@Dict(dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id") |
||||
@ApiModelProperty(value = "年度比赛项目") |
||||
private java.lang.String annualCompid; |
||||
/**题目*/ |
||||
@Excel(name = "题目", width = 15, dictTable = "topic", dicText = "name", dicCode = "id") |
||||
@Dict(dictTable = "topic", dicText = "name", dicCode = "id") |
||||
@ApiModelProperty(value = "题目") |
||||
private java.lang.String topicid; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.scoresta.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.scoresta.entity.ScoreSta; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 评分标准 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-10-25 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ScoreStaMapper extends BaseMapper<ScoreSta> { |
||||
|
||||
} |
@ -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.demo.scoresta.mapper.ScoreStaMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.scoresta.service; |
||||
|
||||
import org.jeecg.modules.demo.scoresta.entity.ScoreSta; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 评分标准 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-10-25 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IScoreStaService extends IService<ScoreSta> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.scoresta.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.scoresta.entity.ScoreSta; |
||||
import org.jeecg.modules.demo.scoresta.mapper.ScoreStaMapper; |
||||
import org.jeecg.modules.demo.scoresta.service.IScoreStaService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 评分标准 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-10-25 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ScoreStaServiceImpl extends ServiceImpl<ScoreStaMapper, ScoreSta> implements IScoreStaService { |
||||
|
||||
} |
Loading…
Reference in new issue