Browse Source

fix:线下工作票作废环节名称赋值

zhongwei
haungxing 7 months ago
parent
commit
8780ed6c89
  1. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java
  2. 44
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

4
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java

@ -373,7 +373,9 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl<WorkTicketInfoMa
params.put("isStart",workTicketInfoEntity.getIsStart() ? "☑" : "□"); params.put("isStart",workTicketInfoEntity.getIsStart() ? "☑" : "□");
// 许可人许可环节 // 许可人许可环节
if(ObjectUtil.isNotEmpty(workTicketInfoEntity.getLicenseTime())) { if(ObjectUtil.isNotEmpty(workTicketInfoEntity.getLicenseTime())) {
params.put("licensorName",Optional.ofNullable(workTicketInfoEntity.getLicensor()).map(UserCache::getUser).map(User::getName).orElse(null)); String licensorName = StringUtil.isNotBlank(workTicketInfoEntity.getLicensorName()) && Func.isNotEmpty(workTicketInfoEntity.getLicensorName()) ?
workTicketInfoEntity.getLicensorName() : Optional.ofNullable(workTicketInfoEntity.getLicensor()).map(UserCache::getUser).map(User::getName).orElse(null);
params.put("licensorName",licensorName);
params.put("principalName1",params.get("principalName")); params.put("principalName1",params.get("principalName"));
} }
WorkTicketFinish finish = workTicketFinishService.selectByTicketId(ticketId); WorkTicketFinish finish = workTicketFinishService.selectByTicketId(ticketId);

44
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

@ -50,9 +50,7 @@ import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.log.logger.BladeLogger; import org.springblade.core.log.logger.BladeLogger;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.*;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.flow.core.entity.BladeFlow; import org.springblade.flow.core.entity.BladeFlow;
import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.system.feign.ISysClient; import org.springblade.system.feign.ISysClient;
@ -529,7 +527,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
return true; return true;
} }
workTicket.setProcessInstanceId(response.getProcessInstanceId()); workTicket.setProcessInstanceId(response.getProcessInstanceId());
this.saveWorkTicket(workTicket,response); this.fillCurrentFlowName(workTicket,response);
firstWorkTicketService.updateById(workTicket); firstWorkTicketService.updateById(workTicket);
List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList();
if(CollectionUtil.isNotEmpty(safetyMeasuresList)) { if(CollectionUtil.isNotEmpty(safetyMeasuresList)) {
@ -643,7 +641,43 @@ public class TicketProcessServiceImpl implements TicketProcessService {
} }
} }
/**
* 填充工作票当前流程环节名称
* @param workTicket 工作票
* @param response redis订阅消息
* @return 当前流程环节名称
*/
private void fillCurrentFlowName(WorkTicketInfoEntity workTicket, ProcessWorkFlowResponse response) {
String taskId = response.getTaskId();
Object variablesObj = response.getVariables();
JSONObject variable = JSONObject.parseObject(JSON.toJSONString(variablesObj));
Boolean signFlag = Func.isNotEmpty(variable.getBoolean("signFlag")) ? variable.getBoolean("signFlag") : true;
Boolean receiveFlag = Func.isNotEmpty(variable.getBoolean("recieveFlag")) ? variable.getBoolean("recieveFlag") : true;
if(StringUtil.isNotBlank(taskId)) {
workTicket.setFlowUserId(response.getUserId());
workTicket.setNextStepOperator(response.getNextStepOperator());
String flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(response.getNextStepOperator()).concat("审批");
workTicket.setFlowDescription(flowDescription);
workTicket.setFlowTaskId(taskId);
workTicket.setFlowTaskName(response.getTaskName());
}
else if(!signFlag || !receiveFlag ) {
// 作废
workTicket.setFlowDescription("作废");
workTicket.setFlowTaskName("作废");
workTicket.setNextStepOperator(null);
workTicket.setStepOperator(null);
}
else {
// 结束
workTicket.setFlowDescription("结束");
workTicket.setFlowTaskName("结束");
workTicket.setNextStepOperator(null);
workTicket.setStepOperator(null);
workTicket.setFlowStatus(999);
workTicket.setImplementStatus("3");
}
}
/** /**
* 获取描述信息 * 获取描述信息
* *

Loading…
Cancel
Save