Commit af5af936 authored by leizhan's avatar leizhan

添加:电站管理列表和详情接口

parent 27461971
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.LinkedHashMap;
import java.util.List;
/**
* @author fengwang
* @date 2023/7/17.
*/
@Data
@ApiModel(value="LoggerDto", description="审核日志")
public class LoggerDto {
//订单跟踪
List<LinkedHashMap> logger;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
* 订单跟踪【任务审核记录】
* @author fengwang
* @date 2023/7/17.
*/
@Data
@ApiModel(value="OrderTrackingDto", description="订单跟踪")
public class OrderTrackingDto {
@ApiModelProperty(value = "组件唯一标识")
private String Symbol_key;
@ApiModelProperty(value = "审核节点Id")
private String taskId;
@ApiModelProperty(value = "审核节点")
private String taskName;
@ApiModelProperty(value = "审核人")
private String operator;
@ApiModelProperty(value = "审核时间")
private String operateDate;
@ApiModelProperty(value = "审核状态")
private String approvalStatue;
}
...@@ -10,7 +10,7 @@ import lombok.EqualsAndHashCode; ...@@ -10,7 +10,7 @@ import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
/** /**
* *
* *
* @author system_generator * @author system_generator
* @date 2023-07-15 * @date 2023-07-15
...@@ -41,13 +41,13 @@ public class PowerStationDto extends BaseDto { ...@@ -41,13 +41,13 @@ public class PowerStationDto extends BaseDto {
@ApiModelProperty(value = "流程状态") @ApiModelProperty(value = "流程状态")
private String processStatus; private String processStatus;
@ApiModelProperty(value = "设计审核状态") @ApiModelProperty(value = "投融资审核")
private String designStatus; private String designStatus;
@ApiModelProperty(value = "商务审核状态") @ApiModelProperty(value = "法务审核")
private String businessStatus; private String businessStatus;
@ApiModelProperty(value = "技术审核状态") @ApiModelProperty(value = "设计审核")
private String technologyStatus; private String technologyStatus;
@ApiModelProperty(value = "流程实例id") @ApiModelProperty(value = "流程实例id")
......
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.yeejoin.amos.boot.module.hygf.api.dto.DesignInformationDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data; import lombok.Data;
...@@ -27,4 +25,7 @@ public class SurveyInfoAllDto { ...@@ -27,4 +25,7 @@ public class SurveyInfoAllDto {
//设计信息 //设计信息
DesignInformationDto designInformation; DesignInformationDto designInformation;
//订单跟踪
LoggerDto orderTracking;
} }
...@@ -138,9 +138,11 @@ public class SurveyInformationController extends BaseController { ...@@ -138,9 +138,11 @@ public class SurveyInformationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "勘察信息编辑", notes = "勘察信息编辑") @ApiOperation(httpMethod = "GET",value = "勘察信息编辑", notes = "勘察信息编辑")
@GetMapping(value = "/surveyQuery") @GetMapping(value = "/surveyQuery")
public ResponseModel<SurveyInfoAllDto> surveyQuery(@RequestParam String surveyInformationId) { public ResponseModel<SurveyInfoAllDto> surveyQuery(@RequestParam(value = "surveyInformationId",required = false ) String surveyInformationId,
@RequestParam(value = "peasantHouseholdId",required = false ) String peasantHouseholdId,
@RequestParam(value = "processInstanceId",required = false)String processInstanceId) {
AgencyUserModel userInfo = getUserInfo(); AgencyUserModel userInfo = getUserInfo();
SurveyInfoAllDto returnDto = surveyInformationServiceImpl.querySurveyInfo(surveyInformationId,userInfo); SurveyInfoAllDto returnDto = surveyInformationServiceImpl.querySurveyInfo(surveyInformationId,peasantHouseholdId,processInstanceId,userInfo);
return ResponseHelper.buildResponse(returnDto); return ResponseHelper.buildResponse(returnDto);
} }
} }
...@@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map;
@FeignClient(name = "${workflow.feign.name:AMOS-API-WORKFLOW}", path = "workflow", configuration = {MultipartSupportConfig.class}) @FeignClient(name = "${workflow.feign.name:AMOS-API-WORKFLOW}", path = "workflow", configuration = {MultipartSupportConfig.class})
public interface WorkflowFeignClient { public interface WorkflowFeignClient {
...@@ -28,6 +30,13 @@ public interface WorkflowFeignClient { ...@@ -28,6 +30,13 @@ public interface WorkflowFeignClient {
@RequestMapping(value = "/task/getTaskNoAuth/{processInstanceId}", method = RequestMethod.GET) @RequestMapping(value = "/task/getTaskNoAuth/{processInstanceId}", method = RequestMethod.GET)
JSONObject getTaskNoAuth(@PathVariable(value = "processInstanceId") String processInstanceId); JSONObject getTaskNoAuth(@PathVariable(value = "processInstanceId") String processInstanceId);
/***
*
* 获取流程审批日志
* */
@RequestMapping(value = "/task/flowLogger/{procInsId}", method = RequestMethod.GET)
FeignClientResult<Map<String,Object>> getFlowLogger(@PathVariable(value = "procInsId") String procInsId);
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationNodeEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationNodeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum;
...@@ -17,11 +18,12 @@ import com.yeejoin.amos.boot.module.hygf.api.service.ISurveyInformationService; ...@@ -17,11 +18,12 @@ import com.yeejoin.amos.boot.module.hygf.api.service.ISurveyInformationService;
import com.yeejoin.amos.boot.module.hygf.api.util.BeanDtoUtils; import com.yeejoin.amos.boot.module.hygf.api.util.BeanDtoUtils;
import com.yeejoin.amos.boot.module.hygf.api.dto.DesignInformationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.DesignInformationDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.DesignInformation; import com.yeejoin.amos.boot.module.hygf.api.entity.DesignInformation;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.DesignInformationServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import jdk.internal.org.objectweb.asm.TypeReference;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -33,6 +35,7 @@ import org.springframework.stereotype.Service; ...@@ -33,6 +35,7 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 勘察信息服务实现类 * 勘察信息服务实现类
...@@ -64,6 +67,9 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -64,6 +67,9 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
DesignInformationServiceImpl designInformationService; DesignInformationServiceImpl designInformationService;
@Autowired @Autowired
WorkflowFeignClient workflowFeignClient;
@Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired @Autowired
...@@ -231,18 +237,26 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -231,18 +237,26 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
} }
} }
public SurveyInfoAllDto querySurveyInfo(String surveyInformationId,AgencyUserModel userInfo) { public SurveyInfoAllDto querySurveyInfo(String surveyInformationId,String peasantHouseholdId,String processInstanceId,AgencyUserModel userInfo) {
SurveyInfoAllDto surveyInfoAllDto = new SurveyInfoAllDto(); SurveyInfoAllDto surveyInfoAllDto = new SurveyInfoAllDto();
PeasantHousehold peasantHousehold = new PeasantHousehold();
if(!StringUtils.isEmpty(peasantHouseholdId)){
LambdaQueryWrapper<PeasantHousehold> peasantHouseholdWrapper = new LambdaQueryWrapper<>();
peasantHouseholdWrapper.eq(PeasantHousehold::getSequenceNbr, peasantHouseholdId);
peasantHousehold = peasantHouseholdServiceImpl.getBaseMapper().selectOne(peasantHouseholdWrapper);
surveyInformationId = String.valueOf(peasantHousehold.getSurveyInformationId());
}else {
QueryWrapper<PeasantHousehold> peasantHouseholdQueryWrapper = new QueryWrapper<>();
peasantHouseholdQueryWrapper.eq("survey_information_id", surveyInformationId);
peasantHousehold = peasantHouseholdServiceImpl.getBaseMapper().selectOne(peasantHouseholdQueryWrapper);
}
//勘察基本信息
LambdaQueryWrapper<SurveyInformation> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SurveyInformation> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SurveyInformation::getSequenceNbr, surveyInformationId); queryWrapper.eq(SurveyInformation::getSequenceNbr, surveyInformationId);
SurveyInformation surveyInformation = this.baseMapper.selectOne(queryWrapper); SurveyInformation surveyInformation = this.baseMapper.selectOne(queryWrapper);
surveyInfoAllDto.setSurveyInformation(BeanDtoUtils.convert(surveyInformation, SurveyInformationDto.class)); surveyInfoAllDto.setSurveyInformation(BeanDtoUtils.convert(surveyInformation, SurveyInformationDto.class));
//农户信息
QueryWrapper<PeasantHousehold> peasantHouseholdQueryWrapper = new QueryWrapper<>();
peasantHouseholdQueryWrapper.eq("survey_information_id", surveyInformationId);
PeasantHousehold peasantHousehold = peasantHouseholdServiceImpl.getBaseMapper().selectOne(peasantHouseholdQueryWrapper);
BeanUtils.copyProperties(peasantHousehold, surveyInfoAllDto.getSurveyInformation()); BeanUtils.copyProperties(peasantHousehold, surveyInfoAllDto.getSurveyInformation());
surveyInfoAllDto.getSurveyInformation().setDeveloperName(userInfo.getCompanys().get(0).getCompanyName()); surveyInfoAllDto.getSurveyInformation().setDeveloperName(userInfo.getCompanys().get(0).getCompanyName());
surveyInfoAllDto.getSurveyInformation().setDeveloperCode(userInfo.getCompanys().get(0).getOrgCode()); surveyInfoAllDto.getSurveyInformation().setDeveloperCode(userInfo.getCompanys().get(0).getOrgCode());
...@@ -261,6 +275,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -261,6 +275,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
surveyInfoAllDto.getSurveyInformation().setIsPermanent("1"); surveyInfoAllDto.getSurveyInformation().setIsPermanent("1");
} }
surveyInfoAllDto.getSurveyInformation().setSequenceNbr(surveyInformation.getSequenceNbr()); surveyInfoAllDto.getSurveyInformation().setSequenceNbr(surveyInformation.getSequenceNbr());
surveyInfoAllDto.getSurveyInformation().setCreatorTime(new Date()); surveyInfoAllDto.getSurveyInformation().setCreatorTime(new Date());
QueryWrapper<SurveyDetails> surveyDetailsQueryWrapper = new QueryWrapper<>(); QueryWrapper<SurveyDetails> surveyDetailsQueryWrapper = new QueryWrapper<>();
...@@ -307,13 +322,25 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD ...@@ -307,13 +322,25 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
} }
QueryWrapper<DesignInformation> designInformationQueryWrapper = new QueryWrapper<>(); QueryWrapper<DesignInformation> designInformationQueryWrapper = new QueryWrapper<>();
designInformationQueryWrapper.eq("survey_information_id", surveyInformationId); designInformationQueryWrapper.eq("peasant_household_id", peasantHousehold.getSequenceNbr());
DesignInformation designInformation = designInformationService.getBaseMapper().selectOne(designInformationQueryWrapper); DesignInformation designInformation = designInformationService.getBaseMapper().selectOne(designInformationQueryWrapper);
if(designInformation == null){ if(designInformation == null){
surveyInfoAllDto.setDesignInformation(new DesignInformationDto()); surveyInfoAllDto.setDesignInformation(new DesignInformationDto());
}else { }else {
surveyInfoAllDto.setDesignInformation(BeanDtoUtils.convert(designInformation, DesignInformationDto.class)); surveyInfoAllDto.setDesignInformation(BeanDtoUtils.convert(designInformation, DesignInformationDto.class));
} }
if(!StringUtils.isEmpty(processInstanceId)){
Map<String, Object> flowLoggerMap = workflowFeignClient.getFlowLogger(processInstanceId).getResult();
List<LinkedHashMap> flowLogger = (List<LinkedHashMap>) flowLoggerMap.get("flowLogger");
flowLogger = flowLogger.stream().map(i -> {
i.put("approvalStatue",i.get("approvalStatue").toString());
return i;
}).collect(Collectors.toList());
LoggerDto loggerDto =new LoggerDto();
loggerDto.setLogger(flowLogger);
surveyInfoAllDto.setOrderTracking(loggerDto);
}
return surveyInfoAllDto; return surveyInfoAllDto;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment