|
|
@@ -18,9 +18,12 @@ import com.google.gson.Gson;
|
|
|
import com.google.gson.GsonBuilder;
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
import com.lc.ibps.base.db.util.TableMetaUtil;
|
|
|
+import com.lc.ibps.base.framework.table.ICommonDao;
|
|
|
import com.lc.ibps.cloud.redis.utils.RedisUtil;
|
|
|
+import com.lc.ibps.components.querybuilder.utils.CollectionUtils;
|
|
|
import net.sf.json.JSONArray;
|
|
|
import net.sf.json.JSONObject;
|
|
|
+import org.activiti.engine.impl.util.CollectionUtil;
|
|
|
import org.redisson.api.RedissonClient;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
@@ -239,6 +242,9 @@ public class BpmTaskProvider extends GenericProvider implements IBpmTaskService,
|
|
|
private IPartyEntityService partyEntityService;
|
|
|
@Autowired
|
|
|
private IPartyGroupService partyGroupService;
|
|
|
+ @Autowired
|
|
|
+ private ICommonDao commonDao;
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -2613,6 +2619,9 @@ public class BpmTaskProvider extends GenericProvider implements IBpmTaskService,
|
|
|
//// logger.error("AbstractTaskListener dataStr:"+dataStr);
|
|
|
// //boData.putAll(data);
|
|
|
// //boDataStr = com.alibaba.fastjson.JSON.toJSONString(boData);
|
|
|
+// if("resubmit".equals(agreeVo.getResubmit())){
|
|
|
+// dataStr = cloneData(dataStr);
|
|
|
+// }
|
|
|
dataObj1.put("boData",dataStr);
|
|
|
String redisDataStr = com.alibaba.fastjson.JSON.toJSONString(dataObj1);
|
|
|
//// logger.error("AbstractTaskListener redisDataStr:"+redisDataStr);
|
|
|
@@ -2682,6 +2691,16 @@ public class BpmTaskProvider extends GenericProvider implements IBpmTaskService,
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+// public String cloneData(String data){
|
|
|
+// String sql =" select l.liu_cheng_zhu_bia, l.suo_you_zi_biao_, l.zhu_zi_biao_guan_ " +
|
|
|
+// " from t_lcidglbdbb l join ibps_bpm_inst_his s on l.liu_cheng_xuan_ze = s.PROC_DEF_KEY_ " +
|
|
|
+// " where BIZ_KEY_ = '" + data +"'";
|
|
|
+// List<Map<String,Object>> list = (List<Map<String,Object>>) commonDao.query(sql);
|
|
|
+// String zhuTable = list.get(0).get("liu_cheng_zhu_bia").toString();
|
|
|
+//
|
|
|
+// return null;
|
|
|
+// }
|
|
|
|
|
|
@ApiOperation(value = "流程动作-异步同意", notes = "流程动作-异步同意", hidden = true,
|
|
|
extensions = {
|
|
|
@@ -2755,6 +2774,9 @@ public class BpmTaskProvider extends GenericProvider implements IBpmTaskService,
|
|
|
logger.error("AbstractTaskListener save dataStr:"+dataStr);
|
|
|
//boData.putAll(data);
|
|
|
//boDataStr = com.alibaba.fastjson.JSON.toJSONString(boData);
|
|
|
+// if("resubmit".equals(saveVo.getResubmit())){
|
|
|
+// dataStr = cloneData(dataStr);
|
|
|
+// }
|
|
|
dataObj1.put("boData",dataStr);
|
|
|
String redisDataStr = com.alibaba.fastjson.JSON.toJSONString(dataObj1);
|
|
|
logger.error("AbstractTaskListener save redisDataStr:"+redisDataStr);
|
|
|
@@ -3466,6 +3488,113 @@ public class BpmTaskProvider extends GenericProvider implements IBpmTaskService,
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "流程动作-撤回", notes = "流程动作-撤回",
|
|
|
+ extensions = {@Extension(properties = {
|
|
|
+ @ExtensionProperty(name = "submitCtrl", value = StringPool.Y)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ @Signature
|
|
|
+ @Override
|
|
|
+ public APIResult<Void> recall( BpmActionRejectStarterVo rejectStarterVo) {
|
|
|
+ APIResult<Void> result = new APIResult<>();
|
|
|
+ IHandlerValidator<UniqueHandlerValidation> validator = null;
|
|
|
+ String resultTaskId ="";
|
|
|
+ try {
|
|
|
+ String taskId = rejectStarterVo.getTaskId();
|
|
|
+ if(BeanUtils.isEmpty(taskId)){
|
|
|
+ result.setMessage("taskId 为空");
|
|
|
+ result.setState(StateEnum.ERROR_BPMN_INSTANCE.getCode());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ String sql = " select id_ from ibps_bpm_tasks where proc_inst_id_ = '"+ taskId + "' limit 1";
|
|
|
+ List<Map<String,Object>> taskList =(List<Map<String,Object>>) commonDao.query(sql);
|
|
|
+ if(com.lc.ibps.base.core.util.Collections.isEmpty(taskList)){
|
|
|
+ result.setMessage("taskId 为空");
|
|
|
+ result.setState(StateEnum.ERROR_BPMN_INSTANCE.getCode());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ resultTaskId=taskList.get(0).get("id_").toString();
|
|
|
+ rejectStarterVo.setTaskId(resultTaskId );
|
|
|
+ //rejectStarterVo.setTaskId(resultTaskId /*taskList.get(0).get("id_").toString()*/);
|
|
|
+ // 获取cmd对象。
|
|
|
+ IbpsTaskFinishCmd cmd = this.getCmd(
|
|
|
+ rejectStarterVo.getTaskId(),
|
|
|
+ null,
|
|
|
+ "rejectToStart",
|
|
|
+ null,
|
|
|
+ rejectStarterVo.getOpinion(),
|
|
|
+ rejectStarterVo.getData(),
|
|
|
+ null,
|
|
|
+ null,
|
|
|
+ null,
|
|
|
+ rejectStarterVo.getVersion(),
|
|
|
+ null,
|
|
|
+ rejectStarterVo.getBackHandMode(),
|
|
|
+ rejectStarterVo.getDestination(),
|
|
|
+ rejectStarterVo.getVariableMap(),
|
|
|
+ rejectStarterVo.getIsSaveBusinessData());
|
|
|
+ logger.debug("complete:" + cmd.getTaskId());
|
|
|
+
|
|
|
+ validator = validationForCount(cmd);
|
|
|
+ validation(validator, cmd.getTaskId());
|
|
|
+
|
|
|
+ bpmTaskActionService.finishTask(cmd);
|
|
|
+ result.setMessage(I18nUtil.getMessage("com.lc.ibps.bpmn.provider.BpmTaskProvider.complete"));
|
|
|
+ } catch (LockedTaskException e) {
|
|
|
+ setExceptionResult(result, StateEnum.ERROR_BPMN_LOCKED_TASK.getCode(), I18nUtil.getMessage(StateEnum.ERROR_BPMN_LOCKED_TASK.getCode()+"", ""), e);
|
|
|
+ }
|
|
|
+ catch (SuspendException e) {
|
|
|
+ setExceptionResult(result, StateEnum.ERROR_BPMN_SUSPEND_TASK.getCode(), I18nUtil.getMessage(StateEnum.ERROR_BPMN_SUSPEND_TASK.getCode()+""), e);
|
|
|
+ }
|
|
|
+ catch (PermissionException e) {
|
|
|
+ setExceptionResult(result, StateEnum.ERROR_BPMN_PERMISSION_TASK.getCode(), I18nUtil.getMessage(StateEnum.ERROR_BPMN_PERMISSION_TASK.getCode()+""), e);
|
|
|
+ }
|
|
|
+ catch (NoTaskException e) {
|
|
|
+ setExceptionResult(result, StateEnum.ERROR_BPMN_NO_TASK.getCode(), I18nUtil.getMessage(StateEnum.ERROR_BPMN_NO_TASK.getText()+"", ""), e);
|
|
|
+ }
|
|
|
+ catch (HandlingTaskException e) {
|
|
|
+ setExceptionResult(result, StateEnum.ERROR_BPMN_HANDLING_TASK.getCode(), I18nUtil.getMessage(StateEnum.ERROR_BPMN_HANDLING_TASK.getCode()+""), e);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ setExceptionResult(result, StateEnum.ERROR_BPMN_TASK.getCode(), I18nUtil.getMessage(StateEnum.ERROR_BPMN_TASK.getCode()+""), e);
|
|
|
+ }
|
|
|
+ finally {
|
|
|
+ HandlerValidationUtil.processAfterInvoke(validator);
|
|
|
+ }
|
|
|
+ if("第一个节点无法驳回发起人!".equals(result.getCause().toString())){
|
|
|
+ result.setCause("第一个节点不能进行撤回!");
|
|
|
+ }
|
|
|
+ HashMap<String, Object> map = new HashMap<>();
|
|
|
+ map.put("data",resultTaskId);
|
|
|
+ result.setVariables(map);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Signature
|
|
|
+ @Override
|
|
|
+ public APIResult<Void> modifyData(String instId) {
|
|
|
+ //依据instid查找biz
|
|
|
+ APIResult<Void> result = new APIResult<>();
|
|
|
+ if(BeanUtils.isNotEmpty(instId)){
|
|
|
+ String sql = " select h.id_, h.subject_,h.biz_key_, b.bo_code_ from ibps_bpm_inst_his h " +
|
|
|
+ " join ibps_form_bo b on b.form_id_ = (select id_ from ibps_form_def where key_ = h.form_key_) " +
|
|
|
+ " where h.id_ = '" + instId + "'";
|
|
|
+ List<Map<String,Object>> his = ( List<Map<String,Object>>) commonDao.query(sql);
|
|
|
+ if(com.lc.ibps.base.core.util.Collections.isNotEmpty(his)){
|
|
|
+ String fix = "(已废弃)";
|
|
|
+ String subject = his.get(0).get("subject_").toString();
|
|
|
+ String newSub = subject.replaceFirst("#", "#" + fix ).replace("#"+ fix + fix, "#"+fix);
|
|
|
+ String boCode = his.get(0).get("bo_code_").toString() ;
|
|
|
+ String upHis = " update ibps_bpm_inst_his set subject_ = '" + newSub + "' where id_ = '" + instId + "' ";
|
|
|
+ String upBo = " update " + "t_"+boCode + " set shi_fou_guo_shen_ = '已废弃' where id_ = '"+ his.get(0).get("biz_key_").toString() + "'" ;
|
|
|
+ commonDao.execute(upHis);
|
|
|
+ commonDao.execute(upBo);
|
|
|
+ result.setState(StateEnum.SUCCESS.getCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "流程动作-驳回发起人", notes = "流程动作-驳回发起人",
|
|
|
extensions = {
|
|
|
@Extension(properties = {
|