|
|
@@ -129,15 +129,8 @@ public class BpmProcInstServiceImpl implements BpmProcInstService {
|
|
|
try {
|
|
|
StopWatchUtil.initAndStartLocal(stepId, Level.DEBUG, step, "getBpmInst");
|
|
|
instance = getBpmInst(procInstCmd, false);//TODO 性能点
|
|
|
- //名称后拼接年份,部门,人员名称
|
|
|
|
|
|
- APIResult<PartyEmployeePo> user = iPartyEmployeeService.get(ContextUtil.getCurrentUserId());
|
|
|
- String orgName =user.getData().getOrgName();
|
|
|
- String name = user.getData().getName();
|
|
|
-// if(name==null||name.equals("")){ //回滚已办事宜任务发起人数据不对问题
|
|
|
-// name="张维敏";
|
|
|
-// }
|
|
|
- instance.setSubject(instance.getSubject()+"{"+this.getSysYear()+"/"+orgName+"/"+name+"}");
|
|
|
+ instance.setSubject(instance.getSubject());
|
|
|
|
|
|
StopWatchUtil.stopAndStartNewLocal(stepId, step, "baseActionCmd");
|
|
|
// 当前用户
|
|
|
@@ -240,10 +233,7 @@ public class BpmProcInstServiceImpl implements BpmProcInstService {
|
|
|
if(StringUtil.isNotEmpty(subject)) {
|
|
|
instance.setSubject(subject); //设置标题
|
|
|
}else{
|
|
|
- APIResult<PartyEmployeePo> user = iPartyEmployeeService.get(ContextUtil.getCurrentUserId());
|
|
|
- String orgName = user.getData().getOrgName();
|
|
|
- String name = user.getData().getName();
|
|
|
- instance.setSubject(instance.getSubject()+"{"+this.getSysYear()+"/"+orgName+"/"+name+"}");
|
|
|
+ instance.setSubject(instance.getSubject());
|
|
|
}
|
|
|
StopWatchUtil.stopAndStartNewLocal(stepId, step, "baseActionCmd");
|
|
|
String curUser = StringUtil.isNotEmpty(userId) ? userId : procInstCmd.getCurUser();
|
|
|
@@ -434,16 +424,29 @@ public class BpmProcInstServiceImpl implements BpmProcInstService {
|
|
|
* @param instance
|
|
|
* @param procInstCmd
|
|
|
*/
|
|
|
- private void saveSubject(BpmInstPo instance, ProcInstCmd procInstCmd) {
|
|
|
+ @Override
|
|
|
+ public void saveSubject(IBpmProcInst instance, ProcInstCmd procInstCmd) {
|
|
|
// 设置实例标题
|
|
|
- IBpmProcDefine<IBpmProcExtendDefine> processDef = bpmDefineReader.getBpmProcDefine(instance.getProcDefId());
|
|
|
- String subject = bpmInstRepository.getSubject(processDef, procInstCmd, instance);
|
|
|
- instance.setSubject(subject);
|
|
|
- BpmInst bpmInst = bpmInstRepository.newInstance(instance);
|
|
|
+ if(!(instance instanceof BpmInstPo)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //名称后拼接年份,部门,人员名称
|
|
|
+ APIResult<PartyEmployeePo> user = iPartyEmployeeService.get(ContextUtil.getCurrentUserId());
|
|
|
+ String orgName =user.getData().getOrgName();
|
|
|
+ String name = user.getData().getName();
|
|
|
+ String moreInfo = "{"+this.getSysYear()+"/"+orgName+"/"+name+"}";
|
|
|
+
|
|
|
+ BpmInstPo bpmInstPo = (BpmInstPo)instance;
|
|
|
+ IBpmProcDefine<IBpmProcExtendDefine> processDef = bpmDefineReader.getBpmProcDefine(bpmInstPo.getProcDefId());
|
|
|
+ String subject = bpmInstRepository.getSubject(processDef, procInstCmd, bpmInstPo);
|
|
|
+ subject = subject + moreInfo;
|
|
|
+
|
|
|
+ bpmInstPo.setSubject(subject);
|
|
|
+ BpmInst bpmInst = bpmInstRepository.newInstance(bpmInstPo);
|
|
|
bpmInst.update();
|
|
|
// 修改任务标题
|
|
|
bpmTaskRepository.setForUpdate();
|
|
|
- List<BpmTaskPo> listTasks = bpmTaskRepository.findByInstId(instance.getId());
|
|
|
+ List<BpmTaskPo> listTasks = bpmTaskRepository.findByInstId(bpmInstPo.getId());
|
|
|
bpmTaskRepository.removeForUpdate();
|
|
|
for (BpmTaskPo defaultBpmTask : listTasks) {
|
|
|
defaultBpmTask.setSubject(subject);
|