Commit 56677fe9 authored by 朱晨阳's avatar 朱晨阳

电站管理列表添加字段

parent 763a1e03
......@@ -94,4 +94,7 @@ public class PowerStationDto extends BaseDto {
@ApiModelProperty(value = "合同状态")
private String status;
@ApiModelProperty(value = "电站安装规模")
private String scale;
}
......@@ -94,7 +94,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
private RedisLockUtil redisLockUtil;
public Page<PowerStationDto> queryForPowerStationUserRoles(Page<PowerStationDto> page, String powerStationCode,
String ownersName, AgencyUserModel userInfo, String serviceAgent, String regionalCompaniesName, String processStatus) {
String ownersName, AgencyUserModel userInfo, String serviceAgent, String regionalCompaniesName, String processStatus) {
// Map<Long, List<RoleModel>> orgRoles = userInfo.getOrgRoles();
// Collection<List<RoleModel>> roleModels = orgRoles.values();
// if(roleModels !=null){
......@@ -118,13 +118,26 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
// return
// this.queryForPowerStationPage(page,powerStationCode,ownersName,serviceAgent);
return this.queryPage((int) page.getCurrent(), (int) page.getSize(), powerStationCode, ownersName,
serviceAgent,regionalCompaniesName,processStatus);
Page<PowerStationDto> powerStationDtoPage = this.queryPage((int) page.getCurrent(), (int) page.getSize(), powerStationCode, ownersName,
serviceAgent, regionalCompaniesName, processStatus);
if(powerStationDtoPage.getRecords() != null && powerStationDtoPage.getRecords().size() > 0) {
powerStationDtoPage.getRecords().forEach(e -> {
if(e.getPowerStationCode() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPowerStationCode()));
}
});
}
return powerStationDtoPage;
}
// 查询电站审核记录
public Page<PowerStationDto> queryPage(int current, int size, String powerStationCode, String ownersName,
String serviceAgent,String regionalCompaniesName,String processStatus) {
String serviceAgent,String regionalCompaniesName,String processStatus) {
PageHelper.startPage(current, size);
List<PowerStationDto> list = powerStationMapper.queryPage(powerStationCode, ownersName, serviceAgent,regionalCompaniesName,processStatus);
......@@ -241,7 +254,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
@Override
public String powerStationExamine(long pageId, String nodeCode, String stationId, String taskId,
String planInstanceId, Map<String, Object> kv) {
String planInstanceId, Map<String, Object> kv) {
String lockName = String.format("LockName:powerStationExamine:%s", stationId);
Boolean isLocked = redisLockUtil.tryLock(lockName, lockName, 10, 1);
if (BooleanUtils.isNotTrue(isLocked)) {
......@@ -266,33 +279,33 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
}
PowerStationProcessStateEnum resultObj = PowerStationProcessStateEnum.getStateByResult(result);
switch (nodeByCode) {
case 设计审核:
powerStation.setTechnologyStatus(resultObj.getName());
break;
case 投融审核:
powerStation.setDesignStatus(resultObj.getName());
break;
case 法务审核:
powerStation.setBusinessStatus(resultObj.getName());
if (VERIFY_RESULT_YES.equals(result)) {
LambdaUpdateWrapper<HouseholdContract> lambdaUw = new LambdaUpdateWrapper<>();
lambdaUw.eq(HouseholdContract::getPeasantHouseholdId, powerStation.getPeasantHouseholdId());
lambdaUw.set(HouseholdContract::getSurveyStatus, HouseholdContractEnum.勘察状态_已勘察.getCode());
householdContractServiceImpl.update(lambdaUw);
}
case 设计审核:
powerStation.setTechnologyStatus(resultObj.getName());
break;
case 投融审核:
powerStation.setDesignStatus(resultObj.getName());
break;
case 法务审核:
powerStation.setBusinessStatus(resultObj.getName());
if (VERIFY_RESULT_YES.equals(result)) {
LambdaUpdateWrapper<HouseholdContract> lambdaUw = new LambdaUpdateWrapper<>();
lambdaUw.eq(HouseholdContract::getPeasantHouseholdId, powerStation.getPeasantHouseholdId());
lambdaUw.set(HouseholdContract::getSurveyStatus, HouseholdContractEnum.勘察状态_已勘察.getCode());
householdContractServiceImpl.update(lambdaUw);
}
break;
case 文件审核:
if (VERIFY_RESULT_YES.equals(result)) {
flag = false;
powerStation.setProcessStatus(PowerStationProcessStateEnum.完成.getName());
}
powerStation.setDrawingReview(resultObj.getName());
break;
default:
break;
break;
case 文件审核:
if (VERIFY_RESULT_YES.equals(result)) {
flag = false;
powerStation.setProcessStatus(PowerStationProcessStateEnum.完成.getName());
}
powerStation.setDrawingReview(resultObj.getName());
break;
default:
break;
}
}
meg = "任务明细:" + nodeByCode + (VERIFY_RESULT_YES.equals(result) ? "通过" : "不通过");
......@@ -462,45 +475,45 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
public WorkDto getNodeInfoCode(String flowTaskId) {
WorkDto workDto = null;
FeignClientResult<JSONObject> jSONObject = workflowFeignClient.getNodeInfo(flowTaskId);
if (IDX_REQUEST_STATE.equals(String.valueOf(jSONObject.getStatus()))) {
JSONObject js = jSONObject.getResult();
if (js == null) {
throw new BaseException("获取工作流节点失败!", "400", "获取工作流节点失败!");
}
LinkedHashMap taskInfo = js.get("taskInfo") != null ? (LinkedHashMap) js.get("taskInfo") : null;
String nextProcessNode = taskInfo != null ? taskInfo.get("taskDefinitionKey").toString() : null;
List<LinkedHashMap> executor = js.get("executor") != null ? (List<LinkedHashMap>) js.get("executor")
: null;
String nodeRole = null;
if (!executor.isEmpty()) {
List<String> idList = executor.stream().map(e -> e.get("groupId").toString())
.collect(Collectors.toList());
nodeRole = StringUtils.join(idList, ",");
}
LinkedHashMap extensionInfo = js.get("extensionInfo") != null ? (LinkedHashMap) js.get("extensionInfo")
: null;
String nodeRouting = extensionInfo != null ? extensionInfo.get("nodeRole").toString() : null;
workDto = new WorkDto(nodeRouting, nodeRole, nextProcessNode);
FeignClientResult<JSONObject> jSONObject = workflowFeignClient.getNodeInfo(flowTaskId);
if (IDX_REQUEST_STATE.equals(String.valueOf(jSONObject.getStatus()))) {
JSONObject js = jSONObject.getResult();
if (js == null) {
throw new BaseException("获取工作流节点失败!", "400", "获取工作流节点失败!");
}
LinkedHashMap taskInfo = js.get("taskInfo") != null ? (LinkedHashMap) js.get("taskInfo") : null;
String nextProcessNode = taskInfo != null ? taskInfo.get("taskDefinitionKey").toString() : null;
List<LinkedHashMap> executor = js.get("executor") != null ? (List<LinkedHashMap>) js.get("executor")
: null;
String nodeRole = null;
if (!executor.isEmpty()) {
List<String> idList = executor.stream().map(e -> e.get("groupId").toString())
.collect(Collectors.toList());
nodeRole = StringUtils.join(idList, ",");
}
LinkedHashMap extensionInfo = js.get("extensionInfo") != null ? (LinkedHashMap) js.get("extensionInfo")
: null;
String nodeRouting = extensionInfo != null ? extensionInfo.get("nodeRole").toString() : null;
workDto = new WorkDto(nodeRouting, nodeRole, nextProcessNode);
}
return workDto;
return workDto;
}
public String getTaskNoAuth(String processInstanceId) {
String flowTaskId = null;
JSONObject jSONObject = workflowFeignClient.getTaskNoAuth(processInstanceId);
if (IDX_REQUEST_STATE.equals(String.valueOf(jSONObject.get("code")))) {
LinkedHashMap jsd = jSONObject.get("data") != null ? (LinkedHashMap) jSONObject.get("data") : null;
flowTaskId = jsd != null ? jsd.get("id").toString() : null;
}
if (flowTaskId == null) {
throw new BaseException("获取工作流节点失败!", "400", "获取工作流节点失败!");
}
return flowTaskId;
JSONObject jSONObject = workflowFeignClient.getTaskNoAuth(processInstanceId);
if (IDX_REQUEST_STATE.equals(String.valueOf(jSONObject.get("code")))) {
LinkedHashMap jsd = jSONObject.get("data") != null ? (LinkedHashMap) jSONObject.get("data") : null;
flowTaskId = jsd != null ? jsd.get("id").toString() : null;
}
if (flowTaskId == null) {
throw new BaseException("获取工作流节点失败!", "400", "获取工作流节点失败!");
}
return flowTaskId;
}
......
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