评分细则得分

main
Gitea 1 year ago
parent 55877613de
commit 5df1c31817
  1. 80
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/anncomgrotop/controller/AnnComGroTopController.java
  2. 76
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expscore/controller/ExpScoreController.java
  3. 4
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expscore/entity/ExpScore.java
  4. 208
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorestapoint/controller/ScoreStaPointController.java
  5. 70
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorestapoint/entity/ScoreStaPoint.java
  6. 17
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorestapoint/mapper/ScoreStaPointMapper.java
  7. 5
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorestapoint/mapper/xml/ScoreStaPointMapper.xml
  8. 14
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorestapoint/service/IScoreStaPointService.java
  9. 19
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorestapoint/service/impl/ScoreStaPointServiceImpl.java
  10. 284
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorestapointd/controller/ScoreStaPointDController.java
  11. 79
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorestapointd/entity/ScoreStaPointD.java
  12. 17
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorestapointd/mapper/ScoreStaPointDMapper.java
  13. 5
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorestapointd/mapper/xml/ScoreStaPointDMapper.xml
  14. 14
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorestapointd/service/IScoreStaPointDService.java
  15. 19
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorestapointd/service/impl/ScoreStaPointDServiceImpl.java

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.anncomgrotop.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -9,8 +10,11 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
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.modules.demo.anncomgrotop.entity.AnnComGroTop;
import org.jeecg.modules.demo.anncomgrotop.service.IAnnComGroTopService;
@ -20,6 +24,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint;
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService;
import org.jeecg.modules.demo.annualcompgroup.entity.AnnualCompGroup;
import org.jeecg.modules.demo.annualcompgroup.service.IAnnualCompGroupService;
import org.jeecg.modules.demo.expert.entity.Expert;
import org.jeecg.modules.demo.expert.service.IExpertService;
import org.jeecg.modules.demo.expgroup.entity.ExpGroup;
import org.jeecg.modules.demo.expgroup.service.IExpGroupService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -50,6 +62,14 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class AnnComGroTopController extends JeecgController<AnnComGroTop, IAnnComGroTopService> {
@Autowired
private IAnnComGroTopService annComGroTopService;
@Autowired
private IExpertService expertService;
@Autowired
private IExpGroupService expGroupService;
@Autowired
private IAnnualCompGroupService annualCompGroupService;
@Autowired
private IAnnualCompPointService annualCompPointService;
/**
* 分页列表查询
@ -73,6 +93,41 @@ public class AnnComGroTopController extends JeecgController<AnnComGroTop, IAnnCo
IPage<AnnComGroTop> pageList = annComGroTopService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 分页列表查询
*
* @param annComGroTop
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "专家组年度比赛项目题目-分页列表查询")
@ApiOperation(value="专家组年度比赛项目题目-分页列表查询", notes="专家组年度比赛项目题目-分页列表查询")
@GetMapping(value = "/list1")
public Result<IPage<AnnComGroTop>> queryPageList1(AnnComGroTop annComGroTop,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
Expert expert = new Expert();
QueryWrapper<Expert> queryWrapperep = QueryGenerator.initQueryWrapper(expert, req.getParameterMap());
queryWrapperep.eq("user_id",sysUser.getId());
List<Expert> listep = expertService.list(queryWrapperep);
ExpGroup expGroup = new ExpGroup();
QueryWrapper<ExpGroup> queryWrappereg = QueryGenerator.initQueryWrapper(expGroup, req.getParameterMap());
queryWrappereg.eq("grouid",listep.get(0).getId());
List<ExpGroup> listeg = expGroupService.list(queryWrappereg);
AnnualCompGroup annualCompGroup = annualCompGroupService.getById(listeg.get(0).getAnnCompGroupid());
QueryWrapper<AnnComGroTop> queryWrapper = QueryGenerator.initQueryWrapper(annComGroTop, req.getParameterMap());
queryWrapper.eq("ann_com_p_g",listeg.get(0).getAnnCompGroupid());
queryWrapper.eq("annid",annualCompGroup.getAnnal());
queryWrapper.eq("ann_com_p",annualCompGroup.getAnnCompP());
Page<AnnComGroTop> page = new Page<AnnComGroTop>(pageNo, pageSize);
IPage<AnnComGroTop> pageList = annComGroTopService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
@ -134,6 +189,31 @@ public class AnnComGroTopController extends JeecgController<AnnComGroTop, IAnnCo
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param zjpfid
* @return
*/
//@AutoLog(value = "专家组年度比赛项目题目-通过id查询")
@ApiOperation(value="专家组年度比赛项目题目-通过id查询", notes="专家组年度比赛项目题目-通过id查询")
@GetMapping(value = "/yzpf")
public Result<String> yzpf(@RequestParam(name="zjpfid",required=true) String zjpfid) {
AnnComGroTop annComGroTop = annComGroTopService.getById(zjpfid);
AnnualCompPoint annualCompPoint = annualCompPointService.getById(annComGroTop.getAnnComP());
if(annualCompPoint.getRequireScore().equals("Y")){
Date date = new Date();
if(date.getTime()>=annualCompPoint.getScoreStartTime().getTime()&&date.getTime()<=annualCompPoint.getScoreEndTime().getTime()){
return Result.OK("true");
}else{
return Result.OK("false");
}
}else{
return Result.OK("false");
}
}
/**
* 通过id查询
*

@ -12,6 +12,14 @@ 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.anncomgrotop.entity.AnnComGroTop;
import org.jeecg.modules.demo.anncomgrotop.service.IAnnComGroTopService;
import org.jeecg.modules.demo.anncomgrotopp.entity.AnnComGroTopP;
import org.jeecg.modules.demo.anncomgrotopp.service.IAnnComGroTopPService;
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService;
import org.jeecg.modules.demo.expert.service.IExpertService;
import org.jeecg.modules.demo.expgroup.entity.ExpGroup;
import org.jeecg.modules.demo.expgroup.service.IExpGroupService;
import org.jeecg.modules.demo.expscore.entity.ExpScore;
import org.jeecg.modules.demo.expscore.service.IExpScoreService;
@ -20,6 +28,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.scoresta.entity.ScoreSta;
import org.jeecg.modules.demo.scoresta.service.IScoreStaService;
import org.jeecg.modules.demo.upfile_persion.entity.UpfilePersion;
import org.jeecg.modules.demo.upfile_persion.service.IUpfilePersionService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -50,6 +62,20 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class ExpScoreController extends JeecgController<ExpScore, IExpScoreService> {
@Autowired
private IExpScoreService expScoreService;
@Autowired
private IExpGroupService expGroupService;
@Autowired
private IAnnComGroTopService annComGroTopService;
@Autowired
private IAnnualCompPointService annualCompPointService;
@Autowired
private IAnnComGroTopPService annComGroTopPService;
@Autowired
private IUpfilePersionService upfilePersionService;
@Autowired
private IScoreStaService scoreStaService;
@Autowired
private IExpertService expertService;
/**
* 分页列表查询
@ -66,8 +92,56 @@ public class ExpScoreController extends JeecgController<ExpScore, IExpScoreServi
public Result<IPage<ExpScore>> queryPageList(ExpScore expScore,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
HttpServletRequest req,@RequestParam(name="xmtmid",required=true) String xmtmid) {
AnnComGroTop annComGroTop = annComGroTopService.getById(xmtmid);
ExpGroup expGroup = new ExpGroup();
QueryWrapper<ExpGroup> queryWrappereg = QueryGenerator.initQueryWrapper(expGroup, req.getParameterMap());
queryWrappereg.eq("ann_comp_groupid",annComGroTop.getAnnComPG());
List<ExpGroup> listeg = expGroupService.list(queryWrappereg);
ExpScore expScorelist = new ExpScore();
QueryWrapper<ExpScore> queryWrapperlist = QueryGenerator.initQueryWrapper(expScorelist, req.getParameterMap());
queryWrapperlist.eq("annid",annComGroTop.getAnnid());
queryWrapperlist.eq("annal_comp",annualCompPointService.getById(annComGroTop.getAnnComP()).getAnnualCompId());
queryWrapperlist.eq("ann_com_p",annComGroTop.getAnnComP());
queryWrapperlist.eq("topid",annComGroTop.getTopid());
List<ExpScore> listeslist = expScoreService.list(queryWrapperlist);
if(listeslist.size()==0){
for (int i = 0 ; i < listeg.size();i++){
AnnComGroTopP annComGroTopP = new AnnComGroTopP();
QueryWrapper<AnnComGroTopP> queryWrapperacgtp = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap());
queryWrapperacgtp.eq("ann_com_gro_topid",xmtmid);
List<AnnComGroTopP> listacftp = annComGroTopPService.list(queryWrapperacgtp);
ExpScore expScore1 = new ExpScore();
expScore1.setAnnid(annComGroTop.getAnnid());
expScore1.setAnnComP(annComGroTop.getAnnComP());
expScore1.setAnnalComp(annualCompPointService.getById(annComGroTop.getAnnComP()).getAnnualCompId());
expScore1.setTopid(annComGroTop.getTopid());
expScore1.setBmcode(listacftp.get(0).getBmcode());
UpfilePersion upfilePersion = new UpfilePersion();
QueryWrapper<UpfilePersion> queryWrapperup = QueryGenerator.initQueryWrapper(upfilePersion, req.getParameterMap());
queryWrapperup.eq("apply_code",listacftp.get(0).getBmcode());
List<UpfilePersion> listup = upfilePersionService.list(queryWrapperup);
expScore1.setUpfilePersionId(listup.get(0).getId().toString());
ScoreSta scoreSta = new ScoreSta();
QueryWrapper<ScoreSta> queryWrapperss = QueryGenerator.initQueryWrapper(scoreSta, req.getParameterMap());
queryWrapperss.eq("annual_id",annComGroTop.getAnnid());
queryWrapperss.eq("annal_comp",annualCompPointService.getById(annComGroTop.getAnnComP()).getAnnualCompId());
queryWrapperss.eq("annual_compid",annComGroTop.getAnnComP());
queryWrapperss.eq("topicid",annComGroTop.getTopid());
List<ScoreSta> listss = scoreStaService.list(queryWrapperss);
expScore1.setScoreStaid(listss.get(0).getId());
expScore1.setScore(0);
expScore1.setUserid(expertService.getById(listeg.get(i).getGrouid()).getUserId());
expScore1.setIspf("0");
expScoreService.save(expScore1);
}
}
QueryWrapper<ExpScore> queryWrapper = QueryGenerator.initQueryWrapper(expScore, req.getParameterMap());
queryWrapper.eq("annid",annComGroTop.getAnnid());
queryWrapper.eq("annal_comp",annualCompPointService.getById(annComGroTop.getAnnComP()).getAnnualCompId());
queryWrapper.eq("ann_com_p",annComGroTop.getAnnComP());
queryWrapper.eq("topid",annComGroTop.getTopid());
Page<ExpScore> page = new Page<ExpScore>(pageNo, pageSize);
IPage<ExpScore> pageList = expScoreService.page(page, queryWrapper);
return Result.OK(pageList);

@ -93,8 +93,8 @@ public class ExpScore implements Serializable {
@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")
@Excel(name = "评分人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "id")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
@ApiModelProperty(value = "评分人")
private java.lang.String userid;
/**是否评分*/

@ -0,0 +1,208 @@
package org.jeecg.modules.demo.scorestapoint.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.scorestapoint.entity.ScoreStaPoint;
import org.jeecg.modules.demo.scorestapoint.service.IScoreStaPointService;
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-09
* @Version: V1.0
*/
@Api(tags="评分细则")
@RestController
@RequestMapping("/scorestapoint/scoreStaPoint")
@Slf4j
public class ScoreStaPointController extends JeecgController<ScoreStaPoint, IScoreStaPointService> {
@Autowired
private IScoreStaPointService scoreStaPointService;
/**
* 分页列表查询
*
* @param scoreStaPoint
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "评分细则-分页列表查询")
@ApiOperation(value="评分细则-分页列表查询", notes="评分细则-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<ScoreStaPoint>> queryPageList(ScoreStaPoint scoreStaPoint,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req,@RequestParam(name="pfbzid",required=true) String pfbzid) {
QueryWrapper<ScoreStaPoint> queryWrapper = QueryGenerator.initQueryWrapper(scoreStaPoint, req.getParameterMap());
queryWrapper.eq("score_sta_id",pfbzid);
Page<ScoreStaPoint> page = new Page<ScoreStaPoint>(pageNo, pageSize);
IPage<ScoreStaPoint> pageList = scoreStaPointService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param scoreStaPoint
* @return
*/
@AutoLog(value = "评分细则-添加")
@ApiOperation(value="评分细则-添加", notes="评分细则-添加")
//@RequiresPermissions("scorestapoint:score_sta_point:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ScoreStaPoint scoreStaPoint,
HttpServletRequest req) {
ScoreStaPoint scoreStaPoint1 = new ScoreStaPoint();
QueryWrapper<ScoreStaPoint> queryWrapper = QueryGenerator.initQueryWrapper(scoreStaPoint1, req.getParameterMap());
queryWrapper.eq("score_sta_id",scoreStaPoint.getScoreStaId());
List<ScoreStaPoint> list = scoreStaPointService.list(queryWrapper);
int num = 0;
for (int i = 0 ; i < list.size() ; i++){
num = num + list.get(i).getScore();
}
if(num+scoreStaPoint.getScore()>100){
return Result.error("评分细则总分数不得大于100");
}else {
scoreStaPointService.save(scoreStaPoint);
return Result.OK("添加成功!");
}
}
/**
* 编辑
*
* @param scoreStaPoint
* @return
*/
@AutoLog(value = "评分细则-编辑")
@ApiOperation(value="评分细则-编辑", notes="评分细则-编辑")
//@RequiresPermissions("scorestapoint:score_sta_point:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ScoreStaPoint scoreStaPoint,
HttpServletRequest req) {
ScoreStaPoint scoreStaPoint1 = new ScoreStaPoint();
QueryWrapper<ScoreStaPoint> queryWrapper = QueryGenerator.initQueryWrapper(scoreStaPoint1, req.getParameterMap());
queryWrapper.eq("score_sta_id",scoreStaPoint.getScoreStaId());
queryWrapper.ne("id",scoreStaPoint.getId());
List<ScoreStaPoint> list = scoreStaPointService.list(queryWrapper);
int num = 0;
for (int i = 0 ; i < list.size() ; i++){
num = num + list.get(i).getScore();
}
if(num+scoreStaPoint.getScore()>100){
return Result.error("评分细则总分数不得大于100");
}else {
scoreStaPointService.updateById(scoreStaPoint);
return Result.OK("编辑成功!");
}
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "评分细则-通过id删除")
@ApiOperation(value="评分细则-通过id删除", notes="评分细则-通过id删除")
//@RequiresPermissions("scorestapoint:score_sta_point:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
scoreStaPointService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "评分细则-批量删除")
@ApiOperation(value="评分细则-批量删除", notes="评分细则-批量删除")
//@RequiresPermissions("scorestapoint:score_sta_point:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.scoreStaPointService.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<ScoreStaPoint> queryById(@RequestParam(name="id",required=true) String id) {
ScoreStaPoint scoreStaPoint = scoreStaPointService.getById(id);
if(scoreStaPoint==null) {
return Result.error("未找到对应数据");
}
return Result.OK(scoreStaPoint);
}
/**
* 导出excel
*
* @param request
* @param scoreStaPoint
*/
//@RequiresPermissions("scorestapoint:score_sta_point:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ScoreStaPoint scoreStaPoint) {
return super.exportXls(request, scoreStaPoint, ScoreStaPoint.class, "评分细则");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("scorestapoint:score_sta_point:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ScoreStaPoint.class);
}
}

@ -0,0 +1,70 @@
package org.jeecg.modules.demo.scorestapoint.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-09
* @Version: V1.0
*/
@Data
@TableName("score_sta_point")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="score_sta_point对象", description="评分细则")
public class ScoreStaPoint 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)
@ApiModelProperty(value = "标准")
private java.lang.String standard;
/**分数*/
@Excel(name = "分数", width = 15)
@ApiModelProperty(value = "分数")
private java.lang.Integer score;
/**评分标准*/
@Excel(name = "评分标准", width = 15)
@ApiModelProperty(value = "评分标准")
private java.lang.String scoreStaId;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.scorestapoint.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.scorestapoint.entity.ScoreStaPoint;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 评分细则
* @Author: jeecg-boot
* @Date: 2023-11-09
* @Version: V1.0
*/
public interface ScoreStaPointMapper extends BaseMapper<ScoreStaPoint> {
}

@ -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.scorestapoint.mapper.ScoreStaPointMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.scorestapoint.service;
import org.jeecg.modules.demo.scorestapoint.entity.ScoreStaPoint;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 评分细则
* @Author: jeecg-boot
* @Date: 2023-11-09
* @Version: V1.0
*/
public interface IScoreStaPointService extends IService<ScoreStaPoint> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.scorestapoint.service.impl;
import org.jeecg.modules.demo.scorestapoint.entity.ScoreStaPoint;
import org.jeecg.modules.demo.scorestapoint.mapper.ScoreStaPointMapper;
import org.jeecg.modules.demo.scorestapoint.service.IScoreStaPointService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 评分细则
* @Author: jeecg-boot
* @Date: 2023-11-09
* @Version: V1.0
*/
@Service
public class ScoreStaPointServiceImpl extends ServiceImpl<ScoreStaPointMapper, ScoreStaPoint> implements IScoreStaPointService {
}

@ -0,0 +1,284 @@
package org.jeecg.modules.demo.scorestapointd.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.anncomgrotopp.entity.AnnComGroTopP;
import org.jeecg.modules.demo.anncomgrotopp.service.IAnnComGroTopPService;
import org.jeecg.modules.demo.expscore.entity.ExpScore;
import org.jeecg.modules.demo.expscore.service.IExpScoreService;
import org.jeecg.modules.demo.scoresta.entity.ScoreSta;
import org.jeecg.modules.demo.scoresta.service.IScoreStaService;
import org.jeecg.modules.demo.scorestapoint.entity.ScoreStaPoint;
import org.jeecg.modules.demo.scorestapoint.service.IScoreStaPointService;
import org.jeecg.modules.demo.scorestapointd.entity.ScoreStaPointD;
import org.jeecg.modules.demo.scorestapointd.service.IScoreStaPointDService;
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-10
* @Version: V1.0
*/
@Api(tags="评分细则得分")
@RestController
@RequestMapping("/scorestapointd/scoreStaPointD")
@Slf4j
public class ScoreStaPointDController extends JeecgController<ScoreStaPointD, IScoreStaPointDService> {
@Autowired
private IScoreStaPointDService scoreStaPointDService;
@Autowired
private IExpScoreService expScoreService;
@Autowired
private IScoreStaPointService scoreStaPointService;
@Autowired
private IAnnComGroTopPService annComGroTopPService;
/**
* 分页列表查询
*
* @param scoreStaPointD
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "评分细则得分-分页列表查询")
@ApiOperation(value="评分细则得分-分页列表查询", notes="评分细则得分-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<ScoreStaPointD>> queryPageList(ScoreStaPointD scoreStaPointD,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req,@RequestParam(name="zjpfid",required=true) String zjpfid) {
ExpScore expScore = expScoreService.getById(zjpfid);
ScoreStaPoint scoreStaPoint = new ScoreStaPoint();
QueryWrapper<ScoreStaPoint> queryWrapperssp = QueryGenerator.initQueryWrapper(scoreStaPoint, req.getParameterMap());
queryWrapperssp.eq("score_sta_id",expScore.getScoreStaid());
List<ScoreStaPoint> listssp = scoreStaPointService.list(queryWrapperssp);
ScoreStaPointD scoreStaPointDtem = new ScoreStaPointD();
QueryWrapper<ScoreStaPointD> queryWrapper1 = QueryGenerator.initQueryWrapper(scoreStaPointDtem, req.getParameterMap());
queryWrapper1.eq("exp_score_id",zjpfid);
queryWrapper1.eq("score_staid",expScore.getScoreStaid());
List<ScoreStaPointD> listtem = scoreStaPointDService.list(queryWrapper1);
if(listtem.size()==0){
for (int k = 0 ; k < listssp.size() ; k++){
ScoreStaPointD scoreStaPointD1 = new ScoreStaPointD();
scoreStaPointD1.setExpScoreId(zjpfid);
scoreStaPointD1.setScoreStaid(expScore.getScoreStaid());
scoreStaPointD1.setScoreStaPoint(listssp.get(k).getId());
scoreStaPointD1.setStandard(listssp.get(k).getScore());
scoreStaPointD1.setScore(0);
scoreStaPointDService.save(scoreStaPointD1);
}
}
QueryWrapper<ScoreStaPointD> queryWrapper = QueryGenerator.initQueryWrapper(scoreStaPointD, req.getParameterMap());
queryWrapper.eq("exp_score_id",zjpfid);
queryWrapper.eq("score_staid",expScore.getScoreStaid());
Page<ScoreStaPointD> page = new Page<ScoreStaPointD>(pageNo, pageSize);
IPage<ScoreStaPointD> pageList = scoreStaPointDService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 获取细则总分
*
* @param
* @return
*/
//@AutoLog(value = "评分细则得分-通过id查询")
@ApiOperation(value="获取细则总分", notes="获取细则总分")
@GetMapping(value = "/xzzf")
public Result<String> xzzf(HttpServletRequest req,@RequestParam(name="zjpfid",required=true) String zjpfid) {
ExpScore expScore = expScoreService.getById(zjpfid);
ScoreStaPoint scoreStaPoint = new ScoreStaPoint();
QueryWrapper<ScoreStaPoint> queryWrapperssp = QueryGenerator.initQueryWrapper(scoreStaPoint, req.getParameterMap());
queryWrapperssp.eq("score_sta_id",expScore.getScoreStaid());
List<ScoreStaPoint> listssp = scoreStaPointService.list(queryWrapperssp);
int sum = 0;
for (int i = 0 ; i < listssp.size() ; i++){
sum = sum+listssp.get(i).getScore();
}
if(sum==100){
return Result.OK("true");
}else{
return Result.OK("false");
}
}
/**
* 添加
*
* @param scoreStaPointD
* @return
*/
@AutoLog(value = "评分细则得分-添加")
@ApiOperation(value="评分细则得分-添加", notes="评分细则得分-添加")
//@RequiresPermissions("scorestapointd:score_sta_point_d:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ScoreStaPointD scoreStaPointD) {
scoreStaPointDService.save(scoreStaPointD);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param scoreStaPointD
* @return
*/
@AutoLog(value = "评分细则得分-编辑")
@ApiOperation(value="评分细则得分-编辑", notes="评分细则得分-编辑")
//@RequiresPermissions("scorestapointd:score_sta_point_d:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ScoreStaPointD scoreStaPointD) {
if(scoreStaPointD.getScore()>scoreStaPointDService.getById(scoreStaPointD.getId()).getStandard()){
return Result.error("得分不得大于细则标准分");
}else if(scoreStaPointD.getScore()<0){
return Result.error("得分不得小于0");
}else{
scoreStaPointDService.updateById(scoreStaPointD);
return Result.OK("设置得分成功!");
}
}
/**
* 编辑
*
* @param
* @return
*/
@AutoLog(value = "评分细则得分-编辑")
@ApiOperation(value="评分细则得分-编辑", notes="评分细则得分-编辑")
//@RequiresPermissions("scorestapointd:score_sta_point_d:edit")
@GetMapping(value = "/edit1")
public Result<String> edit1(@RequestParam(name="zjpfid",required=true) String zjpfid,HttpServletRequest req,@RequestParam(name="xmtmid",required=true) String xmtmid) {
ExpScore expScore = expScoreService.getById(zjpfid);
String ispf = expScore.getIspf();
ScoreStaPointD scoreStaPointD = new ScoreStaPointD();
QueryWrapper<ScoreStaPointD> queryWrapper = QueryGenerator.initQueryWrapper(scoreStaPointD, req.getParameterMap());
queryWrapper.eq("exp_score_id",zjpfid);
List<ScoreStaPointD> list = scoreStaPointDService.list(queryWrapper);
int sum = 0;
for (int i = 0 ; i < list.size() ; i++){
sum = sum+list.get(i).getScore();
}
expScore.setScore(sum);
expScore.setIspf("1");
expScoreService.updateById(expScore);
if(ispf.equals("0")){
AnnComGroTopP annComGroTopP = new AnnComGroTopP();
QueryWrapper<AnnComGroTopP> queryWrapperagtp = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap());
queryWrapperagtp.eq("ann_com_gro_topid",xmtmid);
queryWrapperagtp.eq("topid",expScore.getTopid());
queryWrapperagtp.eq("bmcode",expScore.getBmcode());
List<AnnComGroTopP> listagtp = annComGroTopPService.list(queryWrapperagtp);
annComGroTopP = listagtp.get(0);
annComGroTopP.setYpzj(listagtp.get(0).getYpzj()+1);
annComGroTopPService.updateById(annComGroTopP);
}
return Result.OK("设置细则得分成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "评分细则得分-通过id删除")
@ApiOperation(value="评分细则得分-通过id删除", notes="评分细则得分-通过id删除")
//@RequiresPermissions("scorestapointd:score_sta_point_d:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
scoreStaPointDService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "评分细则得分-批量删除")
@ApiOperation(value="评分细则得分-批量删除", notes="评分细则得分-批量删除")
//@RequiresPermissions("scorestapointd:score_sta_point_d:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.scoreStaPointDService.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<ScoreStaPointD> queryById(@RequestParam(name="id",required=true) String id) {
ScoreStaPointD scoreStaPointD = scoreStaPointDService.getById(id);
if(scoreStaPointD==null) {
return Result.error("未找到对应数据");
}
return Result.OK(scoreStaPointD);
}
/**
* 导出excel
*
* @param request
* @param scoreStaPointD
*/
//@RequiresPermissions("scorestapointd:score_sta_point_d:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ScoreStaPointD scoreStaPointD) {
return super.exportXls(request, scoreStaPointD, ScoreStaPointD.class, "评分细则得分");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("scorestapointd:score_sta_point_d:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ScoreStaPointD.class);
}
}

@ -0,0 +1,79 @@
package org.jeecg.modules.demo.scorestapointd.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-10
* @Version: V1.0
*/
@Data
@TableName("score_sta_point_d")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="score_sta_point_d对象", description="评分细则得分")
public class ScoreStaPointD 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)
@ApiModelProperty(value = "专家年度项目评分")
private java.lang.String expScoreId;
/**评分标准*/
@Excel(name = "评分标准", width = 15)
@ApiModelProperty(value = "评分标准")
private java.lang.String scoreStaid;
/**评分细则*/
@Excel(name = "评分细则", width = 15, dictTable = "score_sta_point", dicText = "standard", dicCode = "id")
@Dict(dictTable = "score_sta_point", dicText = "standard", dicCode = "id")
@ApiModelProperty(value = "评分细则")
private java.lang.String scoreStaPoint;
/**细则标准分*/
@Excel(name = "细则标准分", width = 15)
@ApiModelProperty(value = "细则标准分")
private java.lang.Integer standard;
/**得分*/
@Excel(name = "得分", width = 15)
@ApiModelProperty(value = "得分")
private java.lang.Integer score;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.scorestapointd.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.scorestapointd.entity.ScoreStaPointD;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 评分细则得分
* @Author: jeecg-boot
* @Date: 2023-11-10
* @Version: V1.0
*/
public interface ScoreStaPointDMapper extends BaseMapper<ScoreStaPointD> {
}

@ -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.scorestapointd.mapper.ScoreStaPointDMapper">
</mapper>

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.scorestapointd.service;
import org.jeecg.modules.demo.scorestapointd.entity.ScoreStaPointD;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 评分细则得分
* @Author: jeecg-boot
* @Date: 2023-11-10
* @Version: V1.0
*/
public interface IScoreStaPointDService extends IService<ScoreStaPointD> {
}

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.scorestapointd.service.impl;
import org.jeecg.modules.demo.scorestapointd.entity.ScoreStaPointD;
import org.jeecg.modules.demo.scorestapointd.mapper.ScoreStaPointDMapper;
import org.jeecg.modules.demo.scorestapointd.service.IScoreStaPointDService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 评分细则得分
* @Author: jeecg-boot
* @Date: 2023-11-10
* @Version: V1.0
*/
@Service
public class ScoreStaPointDServiceImpl extends ServiceImpl<ScoreStaPointDMapper, ScoreStaPointD> implements IScoreStaPointDService {
}
Loading…
Cancel
Save