企标评分
This commit is contained in:
+43
@@ -0,0 +1,43 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.xml.ws.Response;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|EvaluationIndex|")
|
||||
@RequestMapping("/${restPath}/sarEnterpriseStandardEvaluation/evaluation-index")
|
||||
public class EvaluationIndexController extends BaseController<EvaluationIndex> {
|
||||
@Autowired
|
||||
private IEvaluationIndexService iEvaluationIndexService;
|
||||
|
||||
|
||||
@ApiOperation("获取评价指标")
|
||||
@GetMapping("getEvaluationIndex")
|
||||
public ResponseMessage<List<EvaluationIndex>> getEvaluationIndex(EvaluationIndex query){
|
||||
List<EvaluationIndex> evaluationIndex = iEvaluationIndexService.getEvaluationIndex(query);
|
||||
|
||||
return Result.success(evaluationIndex);
|
||||
}
|
||||
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|QualityEvaluation|")
|
||||
@RequestMapping("/${restPath}/sarEnterpriseStandardEvaluation/quality-evaluation")
|
||||
public class QualityEvaluationController extends BaseController<QualityEvaluation> {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IQualityEvaluationService iQualityEvaluationService;
|
||||
|
||||
|
||||
@ApiOperation("提交评价表")
|
||||
@PostMapping("submitEvaluationForm")
|
||||
public ResponseMessage submitEvaluationForm(@RequestBody FormVO form){
|
||||
List<QualityEvaluation> tableData = form.getTableData();
|
||||
String standId = form.getStandId();
|
||||
String userId = form.getUserId();
|
||||
|
||||
tableData.forEach(item->{
|
||||
item.setUserId(userId);
|
||||
item.setLawId(standId);
|
||||
|
||||
if ( item.getEvaluationIndex()!=null && item.getScore()!=null && "3U9lb".equals( item.getEvaluationIndex() ) ){
|
||||
|
||||
switch (item.getScore()){
|
||||
case "0":
|
||||
item.setScore("-1");
|
||||
case "1":
|
||||
item.setScore("-2");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//
|
||||
// Optional.ofNullable(item.getEvaluationIndex())
|
||||
// .map(u-> {
|
||||
//
|
||||
// return null;
|
||||
// })
|
||||
// .map(a-> {
|
||||
//
|
||||
// }).orElseThrow(()->new Exception("取指错误"));
|
||||
|
||||
Boolean i = iQualityEvaluationService.submitEvaluationForm(tableData);
|
||||
|
||||
return Result.success(i);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询评分表")
|
||||
@PostMapping("getEvaluationForm")
|
||||
public ResponseMessage getEvaluationForm(@RequestBody FormVO form){
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查看评分历史")
|
||||
@GetMapping("getHistory")
|
||||
public ResponseMessage<IPage<QualityEvaluation>> getHistory(QualityEvaluation query){
|
||||
IPage<QualityEvaluation> history = iQualityEvaluationService.getHistory(query);
|
||||
|
||||
return Result.success(history);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface EvaluationIndexDao extends BaseMapper<EvaluationIndex> {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface QualityEvaluationDao extends BaseMapper<QualityEvaluation> {
|
||||
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="EvaluationIndex对象", description="")
|
||||
public class EvaluationIndex extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("code") //评价指标编码
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
@TableField("index_sort")
|
||||
private Integer indexSort;
|
||||
|
||||
@ApiModelProperty(value = "权重")
|
||||
@TableField("weight")
|
||||
private String weight;
|
||||
|
||||
@ApiModelProperty(value = "指标类型(动态评价指标,质量评价指标")
|
||||
@TableField("index_type")
|
||||
private String indexType;
|
||||
|
||||
@ApiModelProperty(value = "一级指标名称")
|
||||
@TableField("one_index_title")
|
||||
private String oneIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "二级指标名称")
|
||||
@TableField("two_index_title")
|
||||
private String twoIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "三级指标名称")
|
||||
@TableField("three_index_title")
|
||||
private String threeIndexTitle;
|
||||
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FormVO {
|
||||
|
||||
private List<QualityEvaluation> tableData;
|
||||
|
||||
private String standId;
|
||||
|
||||
private String userId;
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="QualityEvaluation对象", description="")
|
||||
public class QualityEvaluation extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
@TableField("law_id")
|
||||
@ApiModelProperty(value = "企标id")
|
||||
private String lawId;
|
||||
|
||||
@TableField("user_id")
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
|
||||
@TableField("is_need_revise")
|
||||
@ApiModelProperty(value = "是否需要修订(废弃)")
|
||||
private String isNeedRevise;
|
||||
|
||||
@JsonProperty("code") //前后分离 前端字段
|
||||
@TableField("evaluation_index")
|
||||
@ApiModelProperty(value = "评价指标")
|
||||
private String evaluationIndex;
|
||||
|
||||
@JsonProperty("indexType") //前后分离 前端字段
|
||||
@TableField("evaluation_type")
|
||||
@ApiModelProperty(value = "评价类型")
|
||||
private String evaluationType;
|
||||
|
||||
@JsonProperty("commentReason") //前后分离 前端字段
|
||||
@TableField("reason")
|
||||
@ApiModelProperty(value = "打分理由")
|
||||
private String reason;
|
||||
|
||||
@JsonProperty("targetScore") //前后分离 前端字段
|
||||
@TableField("score")
|
||||
@ApiModelProperty(value = "打分")
|
||||
private String score;
|
||||
|
||||
|
||||
@TableField("process_node")
|
||||
@ApiModelProperty(value = "流程节点")
|
||||
private String processNode;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date modifyTime;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer page;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer pageSize;
|
||||
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface IEvaluationIndexService extends IService<EvaluationIndex> {
|
||||
|
||||
|
||||
public List<EvaluationIndex> getEvaluationIndex(EvaluationIndex query);
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface IQualityEvaluationService extends IService<QualityEvaluation> {
|
||||
|
||||
public Boolean submitEvaluationForm(List<QualityEvaluation> form);
|
||||
|
||||
public IPage<QualityEvaluation> getHistory(QualityEvaluation query);
|
||||
|
||||
|
||||
public List<QualityEvaluation> getEvaluationForm(QualityEvaluation query);
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.EvaluationIndexDao;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Service
|
||||
public class EvaluationIndexServiceImpl extends ServiceImpl<EvaluationIndexDao, EvaluationIndex> implements IEvaluationIndexService {
|
||||
|
||||
|
||||
// @Autowired
|
||||
// private EvaluationIndexDao evaluationIndexDao;
|
||||
|
||||
@Override
|
||||
public List<EvaluationIndex> getEvaluationIndex(EvaluationIndex query) {
|
||||
QueryWrapper<EvaluationIndex> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (query.getIndexType()!=null){
|
||||
queryWrapper.eq("index_type",query.getIndexType());
|
||||
}
|
||||
|
||||
queryWrapper.orderByAsc("index_sort");
|
||||
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Service
|
||||
public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationDao, QualityEvaluation> implements IQualityEvaluationService {
|
||||
|
||||
@Autowired
|
||||
private QualityEvaluationDao qualityEvaluationDao;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean submitEvaluationForm(List<QualityEvaluation> form) {
|
||||
form.forEach(item->item.setId( UUIDUtils.randomUUID20()));
|
||||
return this.saveBatch(form);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<QualityEvaluation> getHistory(QualityEvaluation query) {
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
Page<QualityEvaluation> page = new Page<>(query.getPage(), query.getPageSize());
|
||||
|
||||
queryWrapper.select("UNAME as userName","score","reason","create_time","modify_time")
|
||||
.eq("law_id",query.getLawId()) //企标id
|
||||
.last("JOIN ts_user user ON quality_evaluation.user_id = user.USID");
|
||||
|
||||
|
||||
if (query.getUserId()!=null){ //指定用户
|
||||
queryWrapper.eq("user_id", query.getUserId())
|
||||
.orderBy(true,true, "crate_time","modify_time");
|
||||
}
|
||||
|
||||
if (query.getEvaluationType()!=null){ //指定评价指标
|
||||
queryWrapper.eq("evaluation_type",query.getEvaluationType());
|
||||
}
|
||||
|
||||
|
||||
|
||||
return this.baseMapper.selectPage(page,queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QualityEvaluation> getEvaluationForm(QualityEvaluation query) {
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("law_id",query.getLawId());
|
||||
|
||||
List<QualityEvaluation> qualityEvaluations = this.baseMapper.selectList(queryWrapper);
|
||||
Map<String, List<QualityEvaluation>> collect = qualityEvaluations.stream()
|
||||
.collect(Collectors.groupingBy(QualityEvaluation::getEvaluationType));
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user