parent
55877613de
commit
5df1c31817
15 changed files with 915 additions and 10 deletions
@ -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…
Reference in new issue