Commit 9a256400 authored by suhuiguang's avatar suhuiguang

refact(注册开通):流程调整

1.去掉fulladress业务自己处理
parent 236e34be
package com.yeejoin.amos.boot.module.jyjc.biz.feign;
import com.yeejoin.amos.boot.module.jyjc.biz.config.XidFeignConfiguration;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.List;
/**
* @author LiuLin
* @apiNote 待办Feign调用
* @date 2024-05-16
*/
@FeignClient(name = "AMOS-API-PRIVILEGE", path = "/systemctl/v2/task", configuration = {XidFeignConfiguration.class})
public interface TaskV2FeignService {
/**
* 批量新增任务
*
* @param modelList 新增待办
* @return TaskV2Model
* @throws InnerInvokException e
*/
@RequestMapping(value = "/batch/add", method = RequestMethod.POST)
FeignClientResult<List<TaskV2Model>> batchAdd(@RequestBody List<TaskV2Model> modelList) throws InnerInvokException;
/**
* 更新任务
*
* @param model 待办信息
* @param sequenceNbr 主键
* @return TaskV2Model
* @throws InnerInvokException e
*/
@RequestMapping(value = "/{sequenceNbr}", method = RequestMethod.PUT)
FeignClientResult<TaskV2Model> update(@RequestBody TaskV2Model model, @PathVariable("sequenceNbr") Long sequenceNbr) throws InnerInvokException;
/**
* 创建任务
*
* @param model 待办
* @return
* @throws InnerInvokException
*/
@RequestMapping(value = "", method = RequestMethod.POST)
FeignClientResult<TaskV2Model> create(@RequestBody TaskV2Model model) throws InnerInvokException;
/**
* 批量删除任务
*
* @param ids 主键
* @return Long
* @throws InnerInvokException e
*/
@RequestMapping(value = "/{ids}", method = RequestMethod.DELETE)
FeignClientResult<List<Long>> delete(@PathVariable("ids") String ids) throws InnerInvokException;
/**
* 查询指定任务
*
* @param relationId 关联Id
* @return List<TaskV2Model>
* @throws InnerInvokException
*/
@RequestMapping(value = "/queryByRelationId/{relationId}", method = RequestMethod.GET)
FeignClientResult<List<TaskV2Model>> selectListByRelationId(@PathVariable("relationId") String relationId) throws InnerInvokException;
/**
* 批量修改任务
*/
@RequestMapping(value = "/batch/update", method = RequestMethod.PUT)
FeignClientResult<List<TaskV2Model>> batchUpdate(@RequestBody List<TaskV2Model> modelList) throws InnerInvokException;
}
......@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcBaseMapper;
import com.yeejoin.amos.boot.module.jyjc.api.model.InstanceRuntimeData;
import com.yeejoin.amos.boot.module.jyjc.api.model.TaskModelDto;
import com.yeejoin.amos.boot.module.jyjc.api.model.WorkflowResultDto;
import com.yeejoin.amos.boot.module.jyjc.biz.feign.TaskV2FeignService;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CmWorkflowServiceImpl;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jyjc.biz.util.JsonUtils;
......@@ -54,7 +55,7 @@ public class TaskModelServiceImpl {
CommonServiceImpl commonService;
@Autowired
IDataDictionaryService iDataDictionaryService;
private TaskV2FeignService taskV2FeignService;
@Value("classpath:/json/bizTypeInfo.json")
private Resource urlInfo;
......@@ -70,11 +71,11 @@ public class TaskModelServiceImpl {
public void deleteTaskModel(String id) {
List<TaskV2Model> result = Systemctl.taskV2Client.selectListByRelationId(id).getResult();
List<TaskV2Model> result = taskV2FeignService.selectListByRelationId(id).getResult();
if (!result.isEmpty()) {
List<Long> idList = result.stream().map(TaskV2Model::getSequenceNbr).collect(Collectors.toList());
String ids = idList.stream().map(Object::toString).collect(Collectors.joining(","));
Systemctl.taskV2Client.delete(ids);
taskV2FeignService.delete(ids);
}
}
......@@ -88,11 +89,11 @@ public class TaskModelServiceImpl {
//判断是否是暂存 新增若无下一节点执行人即为暂存
boolean flag = StringUtils.isEmpty(obj.getNextExecuteUser());
if (flag) {
List<TaskV2Model> result = Systemctl.taskV2Client.selectListByRelationId(obj.getRelationId()).getResult();
List<TaskV2Model> result = taskV2FeignService.selectListByRelationId(obj.getRelationId()).getResult();
if (CollectionUtil.isNotEmpty(result) && !result.isEmpty()) {
TaskV2Model taskV2Model = result.get(0);
taskV2Model.setTaskContent(obj.getTaskContent());
Systemctl.taskV2Client.update(taskV2Model, taskV2Model.getSequenceNbr());
taskV2FeignService.update(taskV2Model, taskV2Model.getSequenceNbr());
break;
}
}
......@@ -148,16 +149,16 @@ public class TaskModelServiceImpl {
taskV2Models.add(model);
}
Systemctl.taskV2Client.batchAdd(taskV2Models);
taskV2FeignService.batchAdd(taskV2Models);
}
public void updateTaskContentById(Map<String, Object> params) {
List<TaskV2Model> result = Systemctl.taskV2Client.selectListByRelationId(params.get("relationId").toString()).getResult();
List<TaskV2Model> result = taskV2FeignService.selectListByRelationId(params.get("relationId").toString()).getResult();
List<TaskV2Model> collect = result.stream().sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r1.getSequenceNbr())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(collect)) {
collect.get(0).setTaskContent(params.getOrDefault("taskContent", "").toString());
Systemctl.taskV2Client.update(collect.get(0), collect.get(0).getSequenceNbr());
taskV2FeignService.update(collect.get(0), collect.get(0).getSequenceNbr());
}
}
......@@ -172,7 +173,7 @@ public class TaskModelServiceImpl {
**/
public TaskV2Model updateTaskModel(Map<String, Object> params) {
String exeUserId = RequestContext.getExeUserId();
List<TaskV2Model> collect = Systemctl.taskV2Client.selectListByRelationId(params.get("relationId").toString()).getResult();
List<TaskV2Model> collect = taskV2FeignService.selectListByRelationId(params.get("relationId").toString()).getResult();
if (collect == null || collect.isEmpty()) {
return null;
}
......@@ -211,10 +212,10 @@ public class TaskModelServiceImpl {
taskV2Model.setFlowStatusLabel((FlowStatusEnum.TO_BE_FINISHED.getName()));
taskV2Model.setFlowStatus(FlowStatusEnum.TO_BE_FINISHED.getCode());
}
Systemctl.taskV2Client.batchUpdate(collect);
taskV2FeignService.batchUpdate(collect);
} else {
collect.get(0).setRoutePath(collect.get(0).getRoutePath().replace("roleIds=", "roleIds=55555&fq="));
Systemctl.taskV2Client.update(collect.get(0), collect.get(0).getSequenceNbr());
taskV2FeignService.update(collect.get(0), collect.get(0).getSequenceNbr());
}
//修改model并返回 用于组装新待办
collect.get(0).setEndUserId(null);
......@@ -234,9 +235,9 @@ public class TaskModelServiceImpl {
*/
public void rollbackTask(String id, JSONObject obj) {
this.removeNoUsedKey(obj);
List<TaskV2Model> list = Systemctl.taskV2Client.selectListByRelationId(id).getResult();
List<TaskV2Model> list = taskV2FeignService.selectListByRelationId(id).getResult();
TaskV2Model model = list.get(0);
Systemctl.taskV2Client.delete(String.valueOf(model.getSequenceNbr()));
taskV2FeignService.delete(String.valueOf(model.getSequenceNbr()));
String urlParams = "";
urlParams = "&" + toQueryParams2(obj);
......@@ -262,7 +263,7 @@ public class TaskModelServiceImpl {
break;
}
}
Systemctl.taskV2Client.update(lastTaskModel, lastTaskModel.getSequenceNbr());
taskV2FeignService.update(lastTaskModel, lastTaskModel.getSequenceNbr());
} else if (list.size() == 1) {
model.setExecuteUserIds(model.getStartUserId());
model.setTaskStatusLabel("重新提交");
......@@ -280,7 +281,7 @@ public class TaskModelServiceImpl {
break;
}
}
Systemctl.taskV2Client.create(model);
taskV2FeignService.create(model);
}
}
......@@ -424,7 +425,7 @@ public class TaskModelServiceImpl {
flowTaskVo.setAssignee(assignee);
ProcessTaskDTO processTaskDTO = cmWorkflowService.assign(flowTaskVo);
//修改待办
List<TaskV2Model> collect = Systemctl.taskV2Client.selectListByRelationId(instanceId).getResult();
List<TaskV2Model> collect = taskV2FeignService.selectListByRelationId(instanceId).getResult();
if (collect.isEmpty()) {
return null;
}
......@@ -436,7 +437,7 @@ public class TaskModelServiceImpl {
taskV2Model.setEndDate(new Date());
String routhPath = taskV2Model.getRoutePath().replace("nextExecuteUserIds", "executeUserId") + "&nextExecuteUserIds=" + assignee;
taskV2Model.setRoutePath(routhPath);
Systemctl.taskV2Client.update(taskV2Model, taskV2Model.getSequenceNbr());
taskV2FeignService.update(taskV2Model, taskV2Model.getSequenceNbr());
//创建新待办
taskV2Model.setExecuteUserIds(assignee);
String nextTaskId = processTaskDTO.getNextTask().get(0).getId();
......@@ -449,7 +450,7 @@ public class TaskModelServiceImpl {
taskV2Model.setEndUserId(null);
taskV2Model.setEndDate(null);
taskV2Model.setSequenceNbr(null);
Systemctl.taskV2Client.create(taskV2Model);
taskV2FeignService.create(taskV2Model);
String key = map.get("key").toString();
String id = jyjcBaseMapper.selectBusinessData(tableName, instanceId, key);
......@@ -499,7 +500,7 @@ public class TaskModelServiceImpl {
flowTaskVo.setAssignee(assignee);
ProcessTaskDTO processTaskDTO = cmWorkflowService.assign(flowTaskVo);
//修改待办
List<TaskV2Model> collect = Systemctl.taskV2Client.selectListByRelationId(instanceId).getResult();
List<TaskV2Model> collect = taskV2FeignService.selectListByRelationId(instanceId).getResult();
if (collect.isEmpty()) {
return null;
}
......@@ -511,7 +512,7 @@ public class TaskModelServiceImpl {
taskV2Model.setEndDate(new Date());
String routhPath = taskV2Model.getRoutePath().replace("nextExecuteUserIds", "executeUserId") + "&nextExecuteUserIds=" + assignee;
taskV2Model.setRoutePath(routhPath);
Systemctl.taskV2Client.update(taskV2Model, taskV2Model.getSequenceNbr());
taskV2FeignService.update(taskV2Model, taskV2Model.getSequenceNbr());
//创建新待办
taskV2Model.setExecuteUserIds(assignee);
String nextTaskId = processTaskDTO.getNextTask().get(0).getId();
......@@ -524,7 +525,7 @@ public class TaskModelServiceImpl {
taskV2Model.setEndUserId(null);
taskV2Model.setEndDate(null);
taskV2Model.setSequenceNbr(null);
Systemctl.taskV2Client.create(taskV2Model);
taskV2FeignService.create(taskV2Model);
String key = map.get("key").toString();
String id = jyjcBaseMapper.selectBusinessData(tableName, instanceId, key);
......
......@@ -469,7 +469,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
if (baseEnterpriseInfo != null) {
jyjcOpeningApplicationModel.setUseContact(baseEnterpriseInfo.getUseContact());
jyjcOpeningApplicationModel.setContactPhone(baseEnterpriseInfo.getContactPhone());
jyjcOpeningApplicationModel.setUnitAddress(baseEnterpriseInfo.getFullAddress());
jyjcOpeningApplicationModel.setUnitAddress(this.buildFullAddress(baseEnterpriseInfo));
if (StringUtils.isNotBlank(baseEnterpriseInfo.getIndustrySupervisor())) {
DataDictionary dict = dataDictionaryMapper.getByCode(baseEnterpriseInfo.getIndustrySupervisor(), INDUSTRY_SUPERVISOR_DICT_TYPE);
if (dict != null) {
......@@ -490,6 +490,10 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
}
}
private String buildFullAddress(TzBaseEnterpriseInfo baseEnterpriseInfo) {
return baseEnterpriseInfo.getAddress();
}
private String caseRegionCode2Name(String officeRegion) {
StringBuilder fullName = new StringBuilder();
if (StringUtils.isNotBlank(officeRegion)) {
......@@ -886,6 +890,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
taskCode = resultDto.get(0).getNextTaskCode();
jyjcOpeningApplication.setNextTaskId(resultDto.get(0).getNextTaskId());
jyjcOpeningApplication.setNextExecuteUserIds(resultDto.get(0).getNextExecutorUserIds());
jyjcOpeningApplication.setNextExecuteIds(resultDto.get(0).getNextExecutorRoleIds());
}
if (StringUtils.isNotEmpty(taskCode)) {
jyjcOpeningApplication.setStatus(WorkFlowStatusEnum.getMessage(taskCode).getRollBack());
......@@ -893,7 +898,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
jyjcOpeningApplication.setPromoter("");
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(jyjcOpeningApplication));
jsonObject.put("nextTaskId", jyjcOpeningApplication.getNextTaskId());
jsonObject.put("nextExecuteUserIds", jyjcOpeningApplication.getNextExecuteUserIds());
jsonObject.put("nextExecuteUser", jyjcOpeningApplication.getNextExecuteIds());
jsonObject.put("taskType", BusinessTypeEnum.JY_OPENING_APPLICATION.getCode());
jsonObject.put("flowStatus", commonService.getDictionaryCodeByName(jyjcOpeningApplication.getStatus()));
jsonObject.put("flowStatusLabel", jyjcOpeningApplication.getStatus());
......
......@@ -213,10 +213,4 @@ public class TzBaseEnterpriseInfo extends BaseEntity {
*/
@TableField(value = "org_code")
protected String orgCode;
/**
* 完整地址
*/
@TableField(value = "full_address")
private String fullAddress;
}
......@@ -78,9 +78,6 @@ public class TzBaseEnterpriseInfo extends BaseEntity {
@ApiModelProperty(value = "单位详细地址")
private String address;
@ApiModelProperty(value = "完整地址")
private String fullAddress;
@ApiModelProperty(value = "使用单位法人")
private String legalPerson;
......
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