This commit is contained in:
杜建超 2020-12-15 11:55:46 +08:00
parent 9b8c07648e
commit 92520e8bd8
2 changed files with 49 additions and 0 deletions

View File

@ -48,6 +48,7 @@ import com.lz.modules.sys.service.app.ResultRecordService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
@ -134,6 +135,8 @@ public class ResultRecordController extends AbstractController {
private ResourceService resourceService;
@Autowired
private ChartResultService chartResultService;
@Autowired
private FlowStartService flowStartService;
@Autowired
private ResultTaskService resultTaskService;
@ -632,6 +635,38 @@ public class ResultRecordController extends AbstractController {
resultRecordDetailDto.setWeight(weight);
resultRecordDetailDto.setRecortModelDtos(resultRecortModelDtos);
//增加导出所需数据
List<String> depIds = Lists.newArrayList(resultRecord.getDepartmentId());
Map<Long, List<String>> map = departmentsService.selectDepartmentTreeByDepIds(depIds);
List<String> names = map.get(Long.valueOf(resultRecord.getDepartmentId()));
if(CollectionUtils.isNotEmpty(names)){
Collections.reverse(names);
int size = names.size();
if(size>0 && StringUtils.isNotBlank(names.get(0))){
resultRecordDetailDto.setDepartmentOne(names.get(0));
}
if(size>1 && StringUtils.isNotBlank(names.get(1))){
resultRecordDetailDto.setDepartmentTwo(names.get(1));
}
if(size>2 && StringUtils.isNotBlank(names.get(2))){
resultRecordDetailDto.setDepartmentThree(names.get(2));
}
}
FlowStart flowStart = flowStartService.selectFlowStartById(resultRecord.getStartId());
if(flowStart != null){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
String startDate = sdf.format(flowStart.getStartTime());
if(flowStart.getCycleType().intValue() != 0){
String endDate = sdf.format(flowStart.getEndTime());
resultRecordDetailDto.setAssessCycle(startDate + "" + endDate );
}else{
resultRecordDetailDto.setAssessCycle(startDate);
}
}
return R.ok().put("data", resultRecordDetailDto);
}

View File

@ -85,6 +85,20 @@ public class ResultRecordDetailDto {
List<ResultRecortModelDto> recortModelDtos;
@ApiModelProperty(value = "当前指标权重之和", name = "weight")
BigDecimal weight;
//新增导出所需数据
@ApiModelProperty(value = "考核周期", name = "assessCycle")
private String assessCycle;
//一级部门
@ApiModelProperty(value = "一级部门", name = "departmentOne")
private String departmentOne;
//二级部门
@ApiModelProperty(value = "二级部门", name = "departmentTwo")
private String departmentTwo;
//三级部门
@ApiModelProperty(value = "三级部门", name = "departmentThree")
private String departmentThree;
/**
*
* @return