法规技术评估,展示数据处理。

This commit is contained in:
wangzhijiang
2022-07-12 17:45:36 +08:00
parent ea19496982
commit 71f659b5f9
4 changed files with 68 additions and 2 deletions
@@ -53,10 +53,12 @@ public class LawsTechnologyEvaluationEOController extends JeroController<LawsTec
public Result<?> queryPageList(LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO, public Result<?> queryPageList(LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
@RequestParam(name="cut", defaultValue="cn") String cut,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<LawsTechnologyEvaluationEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationEO, req.getParameterMap()); QueryWrapper<LawsTechnologyEvaluationEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationEO, req.getParameterMap());
Page<LawsTechnologyEvaluationEO> page = new Page<LawsTechnologyEvaluationEO>(pageNo, pageSize); Page<LawsTechnologyEvaluationEO> page = new Page<LawsTechnologyEvaluationEO>(pageNo, pageSize);
IPage<LawsTechnologyEvaluationEO> pageList = lawsTechnologyEvaluationEOService.page(page, queryWrapper); IPage<LawsTechnologyEvaluationEO> pageList = lawsTechnologyEvaluationEOService.page(page, queryWrapper);
this.lawsTechnologyEvaluationEOService.disposeData(pageList.getRecords(),cut);
return Result.OK(pageList); return Result.OK(pageList);
} }
@@ -6,6 +6,7 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@@ -82,16 +83,22 @@ public class LawsTechnologyEvaluationEO implements Serializable {
@Excel(name = "技术领域", width = 15) @Excel(name = "技术领域", width = 15)
@ApiModelProperty(value = "技术领域") @ApiModelProperty(value = "技术领域")
private String technologyTerritory; private String technologyTerritory;
@TableField(exist = false)
private String technologyTerritoryName;
/**评估方式*/ /**评估方式*/
@Excel(name = "评估方式", width = 15) @Excel(name = "评估方式", width = 15)
@ApiModelProperty(value = "评估方式") @ApiModelProperty(value = "评估方式")
private String evaluationMethods; private String evaluationMethods;
@TableField(exist = false)
private String evaluationMethodsName;
/**流程状态*/ /**流程状态*/
@Excel(name = "流程状态", width = 15) @Excel(name = "流程状态", width = 15)
@ApiModelProperty(value = "流程状态") @ApiModelProperty(value = "流程状态")
private String flowStatus; private String flowStatus;
@TableField(exist = false)
private String flowStatusName;
/**发起日期*/ /**发起日期*/
@Excel(name = "发起日期", width = 15, format = "yyyy-MM-dd") @Excel(name = "发起日期", width = 15, format = "yyyy-MM-dd")
@@ -67,4 +67,11 @@ public interface ILawsTechnologyEvaluationEOService extends IService<LawsTechnol
* @return * @return
*/ */
Result<?> processCall(JSONObject jsonObject); Result<?> processCall(JSONObject jsonObject);
/**
* 处理数据
* @param records
* @param cut
*/
void disposeData(List<LawsTechnologyEvaluationEO> records, String cut);
} }
@@ -3,20 +3,26 @@ package com.jero.modules.lawsTechnologyEvaluation.service.impl;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO; import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationFlowDetailEO;
import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationEOMapper; import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationEOMapper;
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService; import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService;
import com.jero.modules.project.enums.OperatorTypeEnum; import com.jero.modules.project.enums.OperatorTypeEnum;
import com.jero.modules.project.enums.RequestSourceEnum; import com.jero.modules.project.enums.RequestSourceEnum;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Date; import java.util.Date;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/** /**
@@ -28,6 +34,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service @Service
public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechnologyEvaluationEOMapper, LawsTechnologyEvaluationEO> implements ILawsTechnologyEvaluationEOService { public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechnologyEvaluationEOMapper, LawsTechnologyEvaluationEO> implements ILawsTechnologyEvaluationEOService {
@Autowired
private SysCategoryServiceImpl sysCategoryService;
/** /**
* 保存 * 保存
* *
@@ -122,4 +131,45 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
return new Result<>().success("调用成功!"); return new Result<>().success("调用成功!");
} }
@Override
public void disposeData(List<LawsTechnologyEvaluationEO> datas, String cut) {
if(CollectionUtils.isNotEmpty(datas)){
List<SysCategory> categoryList = sysCategoryService.list();
for (LawsTechnologyEvaluationEO data : datas) {
if(StringUtils.isNotEmpty(data.getEvaluationMethods())){
List<String> evaluationMethodsList = Arrays.asList(data.getEvaluationMethods().split(","));
String name = getTreeName(cut, categoryList, evaluationMethodsList);
data.setEvaluationMethodsName(name);
}
if(StringUtils.isNotEmpty(data.getFlowStatus())){
data.setFlowStatusName(GatherResultEnum.getTextByValue(data.getFlowStatus(),cut));
}
if(StringUtils.isNotEmpty(data.getTechnologyTerritory())){
List<String> technologyTerritory = Arrays.asList(data.getTechnologyTerritory().split(","));
String name = getTreeName(cut, categoryList, technologyTerritory);
data.setTechnologyTerritoryName(name);
}
}
}
}
private String getTreeName(String cut, List<SysCategory> categoryList, List<String> technologyTerritoryList) {
StringBuilder sb = new StringBuilder();
for (String technologyTerritory : technologyTerritoryList) {
List<SysCategory> collect = categoryList.stream().filter(e -> technologyTerritory.equals(e.getId())).collect(Collectors.toList());
if(collect.size() != 0){
if (CutEnum.CN.getValue().equals(cut)) {
sb.append(collect.get(0).getName() + ",");
} else {
sb.append(collect.get(0).getEnName()+ ",");
}
}
}
String technologyTerritoryName = "";
if (StringUtils.isNotBlank(sb)) {
technologyTerritoryName = sb.substring(0, sb.length() - 1);
}
return technologyTerritoryName;
}
} }