Commit 26c6d998 authored by 鲁鑫's avatar 鲁鑫

变更单审批节点完成更新签名确认

parent afd75c54
......@@ -25,6 +25,7 @@ import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.uasp.bpm.engine.domain.model.ProcUnitHandler;
import com.huigou.uasp.bpm.engine.domain.model.TaskExtension;
import com.huigou.util.ClassHelper;
import com.huigou.util.DateUtil;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -105,12 +106,12 @@ public class EpChangeFormApplicationImpl extends FlowBroker implements EpChangeF
cn.hutool.core.lang.Assert.notNull(te, String.format("未查询到流程任务【%s】的扩展信息", delegateTask.getId()));
// 获取流程任务对应的审批环节信息
ProcUnitHandler procUnitHandler = procUnitHandlerApplication.loadProcUnitHandler(te.getProcUnitHandlerId());
String subProcUnitId = procUnitHandler.getSubProcUnitId();
String subProcUnitName = procUnitHandler.getSubProcUnitName();
//查询到审批人组织信息
String fullId = delegateTask.getAssignee();
Org org = orgApplication.loadOrgByFullId(fullId);
if (ObjectUtil.isNotNull(org)){
if ("executor".equals(subProcUnitId)){
if ("执行人".equals(subProcUnitName)){
//匹配部门执行人审批完,更新确认状态是时间
List<EpChangeFormImplItem> formImplItemList = epChangeFormImplItemRepository.findByEpChangeFormId(bizId);
for (EpChangeFormImplItem epChangeFormImplItem : formImplItemList) {
......@@ -121,7 +122,7 @@ public class EpChangeFormApplicationImpl extends FlowBroker implements EpChangeF
}
changeFormImplItemApplication.saveEpChangeFormImplItems(bizId,formImplItemList);
}
if ("store".equals(subProcUnitId)){
if ("库存".equals(subProcUnitName)){
//匹配仓库环节审批完,更新确认状态是时间
List<EpChangeFormStockItem> stockItemList = epChangeFormStockItemRepository.findByEpChangeFormId(bizId);
for (EpChangeFormStockItem epChangeFormStockItem : stockItemList) {
......@@ -189,6 +190,29 @@ public class EpChangeFormApplicationImpl extends FlowBroker implements EpChangeF
}
}
/**
* 设置任务名称
*/
@Override
protected void setTaskDescription(DelegateTask delegateTask) {
String bizId = delegateTask.getExecution().getProcessBusinessKey();
delegateTask.setDescription(this.getApprovalSubjectName(bizId));
}
/**
* 获取任务标题
*
* @param bizId
* @return
*/
private String getApprovalSubjectName(String bizId) {
EpChangeForm epChangeForm = this.epChangeFormRepository.findOne(bizId);
//查询 单据日期
String fillinDateStr = DateUtil.getDateFormat("yyyy-MM-dd HH:mm:ss", epChangeForm.getFillinDate());
//设置标题
return String.format("%s-%s(%s)", "宝绅内部变更申请/通知单", epChangeForm.getBillCode(), fillinDateStr);
}
@Override
public EpChangeForm findEpChangeFormById(String id) {
return epChangeFormRepository.findOne(id);
......
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