Commit bab2610e authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 854c2ded 421a9f6e
......@@ -12,13 +12,15 @@ import lombok.Getter;
@AllArgsConstructor
public enum PowerStationNodeEnum {
经销商审核("经销商审核", "0"),
设计审核("设计审核", "1"),
投融审核("投融审核", "2"),
法务审核("法务审核", "3"),
设计上传图纸("设计上传图纸", "4"),
经销商上传图纸("经销商上传图纸", "5"),
文件审核("文件审核", "6");
经销商审核("经销商确认", "hygf_02"),
设计审核("设计审核", "hygf_03"),
投融审核("投融审核", "hygf_05"),
法务审核("法务审核", "hygf_07"),
设计上传图纸("设计上传图纸", "hygf_09"),
经销商上传图纸("经销商上传图纸", "hygf_10"),
文件审核("文件审核", "hygf_11");
/**
* 名称,描述
......
......@@ -115,4 +115,10 @@ public class PowerStation extends BaseEntity {
*/
@TableField("next_process_node")
private String nextProcessNode;
/**
* 当前流程节点
*/
@TableField("flow_task_id")
private String flowTaskId;
}
package com.yeejoin.amos.boot.module.hygf.biz.feign;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(name = "${workflow.feign.name:AMOS-API-WORKFLOW}", path = "workflow", configuration = {MultipartSupportConfig.class})
public interface WorkflowFeignClient {
/***
* 根据task_id 获取节点信息
*
* */
@RequestMapping(value = "/history/task/nodeInfo", method = RequestMethod.GET)
JSONObject getNodeInfo(@RequestParam(value = "taskId") String taskId);
/***
*
* 查询当前流程对应的可执行任务,无权限级别
* */
@RequestMapping(value = "/task/getTaskNoAuth/{processInstanceId}", method = RequestMethod.GET)
JSONObject getTaskNoAuth(@PathVariable(value = "processInstanceId") String processInstanceId);
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationNodeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum;
......@@ -8,6 +9,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.PowerStation;
import com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PowerStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IPowerStationService;
import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -37,6 +39,8 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
private static final String VERIFY_RESULT_YES="yes";
private static final String VERIFY_RESULT_NO="no";
@Autowired
WorkflowFeignClient workflowFeignClient;
/**
* 分页查询
......@@ -61,7 +65,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
@Override
public PowerStation getObjByNhId(String id, String state) {
LambdaQueryWrapper<PowerStation> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PowerStation::getProcessStatus, state);
wrapper.ne(PowerStation::getProcessStatus, state);
wrapper.eq(PowerStation::getPeasantHouseholdId, id);
return this.baseMapper.selectOne(wrapper);
}
......@@ -101,6 +105,13 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
}
}
// 2. 更新流程状态
String code = null;
try{
......@@ -109,6 +120,13 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
if (IDX_REQUEST_STATE.equals(String.valueOf(submit.getStatus()))) {
code = submit.getResult();
log.info("流程执行成功:{}", code);
// 获取流程信息
FeignClientResult<JSONObject> record = idxFeginService.getRecord(code);
if (IDX_REQUEST_STATE.equals(String.valueOf(record.getStatus()))) {
JSONObject resultObj = record.getResult();
String flowTaskId = String.valueOf(resultObj.get("flowTaskId"));
powerStation.setFlowTaskId(flowTaskId);
}
powerStationService.savePowerStation(powerStation);
}
}catch (Exception e){
......
......@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.PowerStationProcessStateEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.*;
......@@ -185,17 +186,16 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
}
private void submitExamine(PeasantHousehold peasantHousehold) {
PowerStation powerStation = powerStationService.getObjByNhId(String.valueOf(peasantHousehold.getSequenceNbr()), PowerStationProcessStateEnum.进行中.getCode());
PowerStation powerStation = powerStationService.getObjByNhId(String.valueOf(peasantHousehold.getSequenceNbr()), PowerStationProcessStateEnum.作废.getCode());
String taskId = null;
Map<String, Object> objectMap = new HashMap<>();
Map<String, Object> objectMap = new HashMap<>(1);
objectMap.put("describe", "经销商已上传信息");
if (ObjectUtils.isNotEmpty(powerStation)) {
// 工作流执行一步
taskId = powerStation.getTaskId();
objectMap.put("approveStatus", "yes");
} else {
// 第一步启动工作流
objectMap.put("approveStatus", "yes");
powerStation = new PowerStation();
}
// 保存并审核
......@@ -210,7 +210,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
powerStation.setOwnersName(peasantHousehold.getOwnersName());
powerStation.setProjectAddress(peasantHousehold.getProjectAddressName());
powerStation.setPeasantHouseholdId(String.valueOf(peasantHousehold.getSequenceNbr()));
powerStation.setProcessStatus(PowerStationProcessStateEnum.进行中.getCode());
powerStation.setProcessStatus(PowerStationProcessStateEnum.进行中.getName());
log.info("流程执行成功:{}", code);
// 获取流程信息
FeignClientResult<JSONObject> record = idxFeginService.getRecord(code);
......@@ -218,8 +218,11 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
JSONObject resultObj = record.getResult();
String taskIdNew = String.valueOf(resultObj.get("taskId"));
String processInstanceId = String.valueOf(resultObj.get("processInstanceId"));
String flowTaskId = String.valueOf(resultObj.get("flowTaskId"));
powerStation.setTaskId(taskIdNew);
powerStation.setProcessInstanceId(processInstanceId);
powerStation.setFlowTaskId(flowTaskId);
powerStation.setNextProcessNode(PowerStationNodeEnum.设计审核.getCode());
}
powerStationService.savePowerStation(powerStation);
}
......
......@@ -65,3 +65,6 @@ amos.system.user.user-name=hygf_admin
amos.system.user.password=a1234567
amos.system.user.product=AMOS_STUDIO_WEB
amos.system.user.app-key=AMOS_STUDIO
workflow.feign.name=AMOS-API-WORKFLOW
\ No newline at end of file
......@@ -33,6 +33,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.elasticsearch.common.recycler.Recycler;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
......@@ -1021,6 +1022,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
resultMap.put("records", resultList);
resultMap.put("current", 1);
resultMap.put("size", resultList.size());
// 开关信息
Map<String, Object> switchUrl = getSwitchUrl(gatewayId, null);
BeanUtils.copyProperties(switchUrl, resultMap);
List<Map<String, Object>> finallyResultList = Collections.singletonList(resultMap);
// 主屏下方重复列表数据
IPage<Map<String, Object>> resultPage = new Page<>();
......
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