Beispiel #1
0
  /** 设置为生效 */
  @RemoteMethod
  public void updateById(String id) {
    BpmConfig bpmConfig = bpmConfigDaoImpl.findById(id);
    bpmConfigDaoImpl.updateByEntityId(bpmConfig.getFormEntity().getId());

    bpmConfig.setEnabled("已启用");
    bpmConfig.setModify_date(new Date());
    bpmConfig.setModify_user_id(getUser().getId());
    bpmConfigDaoImpl.update(bpmConfig);
  }
Beispiel #2
0
 private void del(String id) {
   bpmConfigDaoImpl.updateToDelete(BusinessConstant.DELETE_YES, id);
   List<BpmConfigRange> list = bpmConfigRangeDaoImpl.findByConfigId(id);
   for (BpmConfigRange bpmConfigRange : list) {
     bpmConfigRangeDaoImpl.updateToDelete(BusinessConstant.DELETE_YES, bpmConfigRange.getId());
   }
 }
Beispiel #3
0
 /**
  * @throws Exception
  *     <p>getBpmInfoByBpmPrimary 根据bpm模型id获取流程的所有信息 @param bpmId @return @return String @exception
  */
 public String saveAndGetBpmInfoByBpmPrimary(String processDefinitionId) throws Exception {
   String result = "";
   // 根据流程主键数据库获取流程信息
   BpmFlowInfo bpmFlowInfo = bpmConfigDaoImpl.getBpmFlowInfoByBpmId(processDefinitionId);
   if (bpmFlowInfo != null) {
     result = bpmFlowInfo.getText();
   } else {
     NodeDefinition procDef = bpmService.queryProcessDefinition(processDefinitionId);
     if (procDef != null && !"".equals(procDef)) {
       // 插入数据库
       bpmFlowInfo = new BpmFlowInfo();
       bpmFlowInfo.setId(UUID.randomUUID().toString());
       bpmFlowInfo.setBpmid(processDefinitionId);
       bpmFlowInfo.setBpmkey(processDefinitionId.substring(0, processDefinitionId.indexOf(":")));
       bpmFlowInfo.setText(HttpHelper.getMapper().writeValueAsString(procDef));
       result = bpmFlowInfo.getText();
       bpmConfigDaoImpl.insertIntoBpmFlowInfo(bpmFlowInfo);
     }
   }
   return result;
 }
Beispiel #4
0
  /** 添加 */
  @RemoteMethod
  public void save(BpmConfigDto bpmConfigDto) {
    // 判断是否排序唯一
    String entityId = null;
    if (bpmConfigDto.getTreeDto() != null
        && StringUtils.isNotEmpty(bpmConfigDto.getTreeDto().getId()))
      entityId = bpmConfigDto.getTreeDto().getId();
    boolean exist =
        bpmConfigDaoImpl.sortExist(bpmConfigDto.getSort(), bpmConfigDto.getId(), entityId);
    if (exist) throw new BusinessException(ERR_COMPONENT + "101");

    BpmConfig bpmConfig = null;
    FormEntity formEntity = null;
    if (StringUtils.isNotEmpty(entityId)) {
      formEntity = formEntityDaoImpl.findByFormTree(bpmConfigDto.getTreeDto().getId());
    }
    if (StringUtils.isEmpty(bpmConfigDto.getId())) {
      bpmConfig = new BpmConfig();
      bpmConfig = dozerAssembly.dto2Bean(bpmConfigDto, BpmConfig.class);
      bpmConfig.setCreate_date(new Date());
      bpmConfig.setCreate_user_id(getUser().getId());
      bpmConfig.setFlow_code(bpmConfigDto.getBpmTemplateDto().getId());
      bpmConfig.setFormEntity(formEntity);
      bpmConfigDaoImpl.add(bpmConfig);
    } else {
      bpmConfig = bpmConfigDaoImpl.findById(bpmConfigDto.getId());
      bpmConfig.setFlow_code(bpmConfigDto.getBpmTemplateDto().getId());
      bpmConfig.setBpmkey(bpmConfigDto.getBpmkey());
      bpmConfig.setFormEntity(formEntity);
      bpmConfig.setModify_date(new Date());
      bpmConfig.setModify_user_id(getUser().getId());
      bpmConfig.setRangeJson(bpmConfigDto.getRangeJson());
      bpmConfig.setSort(bpmConfigDto.getSort());
      bpmConfigDaoImpl.update(bpmConfig);
    }
    bpmConfigRangeDaoImpl.saveRange(bpmConfig);
  }
Beispiel #5
0
 /** 根据ID查询 */
 @RemoteMethod
 public BpmConfigDto findById(String id) {
   BpmConfig bpmConfig = bpmConfigDaoImpl.findById(id);
   BpmConfigDto templateConfigDto = dozerAssembly.bean2Dto(bpmConfig, BpmConfigDto.class);
   templateConfigDto.setBpmTemplateDto(esbService.getBpmTemplateDto(bpmConfig.getFlow_code()));
   // templateConfigDto.setFlow_code(DictionaryUtils.getItemNameByGroupCode("flow",
   // templateConfigDto.getFlow_code()));
   if (bpmConfig.getFormEntity() != null && bpmConfig.getFormEntity().getFormTree() != null) {
     FormTree formTree = bpmConfig.getFormEntity().getFormTree();
     TreeDto treeDto = new TreeDto();
     treeDto.setId(formTree.getId());
     treeDto.setText(formTreeService.getParentText(formTree.getId()) + "/" + formTree.getText());
     treeDto.setPath(
         formTreeService.getParentPath(formTree.getId()) + "/" + formTree.getId() + "/");
     templateConfigDto.setTreeDto(treeDto);
   }
   return templateConfigDto;
 }
Beispiel #6
0
 public BpmConfig findByFormEntityId(String entityId) {
   BpmConfig bpmConfig = bpmConfigDaoImpl.findByFormEntityId(entityId);
   return bpmConfig;
 }