Commit 57e9ba3d authored by xixinzhao's avatar xixinzhao

提交启动工作流

parent 8797a06d
......@@ -50,12 +50,15 @@ public class PowerStationDto extends BaseDto {
@ApiModelProperty(value = "技术审核状态")
private String technologyStatus;
@ApiModelProperty(value = "流程id")
private String workflowId;
@ApiModelProperty(value = "流程实例id")
private String processInstanceId;
@ApiModelProperty(value = "农户id")
private String peasantHouseholdId;
@ApiModelProperty(value = "待执行节点小程序 路由信息")
private String nodeRouting;
@ApiModelProperty(value = "任务id")
private String taskId;
@ApiModelProperty(value = "流程定义id")
private String processDefinitionId;
}
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -79,8 +80,8 @@ public class PowerStation extends BaseEntity {
/**
* 流程id
*/
@TableField("workflow_id")
private String workflowId;
@TableField("process_instance_id")
private String processInstanceId;
/**
* 农户id
......@@ -88,8 +89,22 @@ public class PowerStation extends BaseEntity {
@TableField("peasant_household_id")
private String peasantHouseholdId;
/**
* 任务id
*/
@TableField("task_id")
private String taskId;
/**
* 流程定义id
*/
@TableField("process_definition_id")
private String processDefinitionId;
/**
* 小程序路由
*/
@TableField("node_routing")
private String nodeRouting;
}
package com.yeejoin.amos.boot.module.hygf.api.fegin;
import com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map;
@FeignClient(value = "AMOS-IDX", path = "idx", configuration = {MultipartSupportConfig.class})
public interface IdxFeginService {
/**
*通用表单提交 数据填报
*/
@RequestMapping(value = "/table/submit", method = RequestMethod.POST)
FeignClientResult<String> submit(@RequestParam(value = "pageId") long pageId,
@RequestParam(value = "taskId",required = false) String taskId,
@RequestParam(value = "planInstanceId", required = false) String planInstanceId,
@RequestParam(value = "bizField", required = false) String bizField,
@RequestParam(value = "topic", required = false) String topic,
@RequestParam(value = "tableName", required = false) String tableName,
@RequestBody Map<String, Object> kv) throws Exception;
}
package com.yeejoin.amos.boot.module.hygf.api.service;
import com.yeejoin.amos.boot.module.hygf.api.entity.PowerStation;
/**
* 接口类
*
......@@ -9,4 +11,11 @@ package com.yeejoin.amos.boot.module.hygf.api.service;
*/
public interface IPowerStationService {
/**
* 保存审核实例
* @param powerStation 审核对象
* @return 状态
*/
boolean savePowerStation(PowerStation powerStation);
}
......@@ -30,4 +30,10 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
public List<PowerStationDto> queryForPowerStationList() {
return this.queryForList("" , false);
}
@Override
public boolean savePowerStation(PowerStation powerStation) {
return this.save(powerStation);
}
}
\ No newline at end of file
......@@ -7,7 +7,9 @@ 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.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService;
import com.yeejoin.amos.boot.module.hygf.api.mapper.SurveyInformationMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IPowerStationService;
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.jxiop.api.dto.DesignInformationDto;
......@@ -17,7 +19,7 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.commons.beanutils.ConvertUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -25,11 +27,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.*;
/**
* 勘察信息服务实现类
......@@ -38,6 +36,7 @@ import java.util.List;
* @date 2023-07-07
*/
@Service
@Slf4j
public class SurveyInformationServiceImpl extends BaseService<SurveyInformationDto,SurveyInformation,SurveyInformationMapper> implements ISurveyInformationService {
......@@ -62,8 +61,16 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
@Autowired
RedisUtils redisUtils;
private static final String regionRedis="app_region_redis";
@Autowired
IdxFeginService idxFeginService;
@Autowired
IPowerStationService powerStationService;
private static final String regionRedis="app_region_redis";
private static final String OPERATION_TYPE_SUBMIT="submit";
private static final String OPERATION_TYPE_APPLY="apply";
private static final String IDX_REQUEST_STATE="200";
/**
* 分页查询
......@@ -157,12 +164,30 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
}
peasantHousehold.setPermanentAddressName(permanentAddressName.substring(0, permanentAddressName.length() - 2));
if("submit".equals(operationType)){
if(OPERATION_TYPE_SUBMIT.equals(operationType)){
peasantHousehold.setSurveyOrNot(1);
}else if("apply".equals(operationType)){
peasantHousehold.setSurveyOrNot(2);
peasantHousehold.setReview(1);
}else if(OPERATION_TYPE_APPLY.equals(operationType)){
Map<String, Object> objectMap = new HashMap<>();
objectMap.put("approveStatus", "yes");
// 保存并审核
try {
FeignClientResult<String> submit = idxFeginService.submit(1679778420550037506L, null, "c4ed1873-0dc6-4518-a7a9-dbc588ef35e5", null, null, null, objectMap);
if (IDX_REQUEST_STATE.equals(String.valueOf(submit.getStatus()))) {
String code = submit.getResult();
peasantHousehold.setSurveyOrNot(2);
peasantHousehold.setReview(1);
// 插入记录表
PowerStation powerStationDto = new PowerStation();
powerStationDto.setPowerStationCode(peasantHousehold.getPeasantHouseholdNo());
powerStationDto.setOwnersName(peasantHousehold.getOwnersName());
powerStationDto.setProjectAddress(peasantHousehold.getProjectAddressName());
powerStationDto.setProcessStatus("进行中");
powerStationService.savePowerStation(powerStationDto);
log.info("启动流程成功:{}", code);
}
} catch (Exception e){
e.getMessage();
}
}
peasantHouseholdServiceImpl.saveOrUpdate(peasantHousehold);
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