feat: There is no way the, bug #52376
This commit is contained in:
+57
-22
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.commons.collections.IterableMap;
|
import org.apache.commons.collections.IterableMap;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -43,30 +44,61 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
|||||||
// queryWrapper.eq("user_id",form.get)
|
// queryWrapper.eq("user_id",form.get)
|
||||||
// .eq("evaluation_type","dynamic");
|
// .eq("evaluation_type","dynamic");
|
||||||
|
|
||||||
Optional.ofNullable(form.getEvaluationType())
|
// Optional.ofNullable(form.getEvaluationType())
|
||||||
.ifPresent( item->{
|
// .ifPresent( item->{
|
||||||
if ("dynamic".equals(form.getEvaluationType())){
|
// if ("dynamic".equals(form.getEvaluationType())){
|
||||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
// QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("law_id",form.getLawId()) //清除此用户在动态评分中已存在的评分
|
// queryWrapper.eq("law_id",form.getLawId()) //清除此用户在动态评分中已存在的评分
|
||||||
.eq("user_id",form.getUserId())
|
// .eq("user_id",form.getUserId())
|
||||||
.eq("evaluation_type","dynamic");
|
// .eq("evaluation_type","dynamic");
|
||||||
this.remove(queryWrapper);
|
// this.remove(queryWrapper);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<QualityEvaluation> qw = new QueryWrapper();
|
||||||
|
qw.eq("law_id",form.getLawId());
|
||||||
|
qw.eq("evaluation_type","dynamic");
|
||||||
|
List<QualityEvaluation> list = this.baseMapper.selectList(qw);
|
||||||
|
|
||||||
List<QualityEvaluation> tableData = form.getTableData();
|
List<QualityEvaluation> tableData = form.getTableData();
|
||||||
tableData.forEach(item->{
|
|
||||||
|
|
||||||
item.setCreateTime(new Date());
|
if(!list.isEmpty()){
|
||||||
item.setModifyTime(new Date());
|
List<QualityEvaluation> updSetList = tableData.stream()
|
||||||
item.setId( UUIDUtils.randomUUID20());
|
.map(upObj -> list.stream()
|
||||||
if ("number".equals(item.getValueType()) ){
|
.filter(stateQueryObj -> upObj.getEvaluationIndex().equals(stateQueryObj.getEvaluationIndex()))
|
||||||
item.setScore(String.valueOf (Double.valueOf(item.getScore()) * 2) );
|
.findFirst()
|
||||||
|
.map(stateQueryObj -> {
|
||||||
|
// 集合交集 stream 重新赋值更新字段
|
||||||
|
upObj.setId(stateQueryObj.getId());
|
||||||
|
upObj.setCreateTime(new Date());
|
||||||
|
upObj.setModifyTime(new Date());
|
||||||
|
if ("number".equals(upObj.getValueType()) ){
|
||||||
|
upObj.setScore(String.valueOf (Double.parseDouble(upObj.getScore()) * 2) );
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(upObj.getReason())){
|
||||||
|
upObj.setReason(upObj.getReason());
|
||||||
|
}else {
|
||||||
|
upObj.setReason("-");
|
||||||
|
}
|
||||||
|
return upObj;
|
||||||
|
}).orElse(null))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
}
|
return this.updateBatchById(updSetList);
|
||||||
});
|
}else {
|
||||||
return this.saveBatch(tableData);
|
tableData.forEach(item->{
|
||||||
|
|
||||||
|
item.setCreateTime(new Date());
|
||||||
|
item.setModifyTime(new Date());
|
||||||
|
item.setId( UUIDUtils.randomUUID20());
|
||||||
|
if ("number".equals(item.getValueType()) ){
|
||||||
|
item.setScore(String.valueOf (Double.parseDouble(item.getScore()) * 2) );
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return this.saveBatch(tableData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -170,13 +202,16 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
|||||||
value=item.getProcessNode();
|
value=item.getProcessNode();
|
||||||
}
|
}
|
||||||
switch (value){
|
switch (value){
|
||||||
case "会签征求意见":
|
case "征求意见":
|
||||||
score=Double.valueOf(item.getScore()) * 0.3;
|
score=Double.valueOf(item.getScore()) * 0.3;
|
||||||
break;
|
break;
|
||||||
case "技术委员会评审/评审意见修改评审":
|
case "技术委员会评审、评审意见修改":
|
||||||
score=Double.valueOf(item.getScore()) * 0.4;
|
score=Double.valueOf(item.getScore()) * 0.4;
|
||||||
break;
|
break;
|
||||||
case "标准法规部标准化工程师复审":
|
case "重新技术委员会评审、评审意见修改":
|
||||||
|
score=Double.valueOf(item.getScore()) * 0.4;
|
||||||
|
break;
|
||||||
|
case "标准化复审":
|
||||||
score=Double.valueOf(item.getScore()) * 0.15;
|
score=Double.valueOf(item.getScore()) * 0.15;
|
||||||
break;
|
break;
|
||||||
case "标准法规部高级经理审核":
|
case "标准法规部高级经理审核":
|
||||||
|
|||||||
Reference in New Issue
Block a user