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