田源
2023-06-19 49f6fd9f5f8ae4f30799c9fc27278796a927744d
Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs
已修改18个文件
已重命名1个文件
已添加3个文件
636 ■■■■ 文件已修改
Source/UBCS-WEB/src/api/resource/file.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/file/inDialog.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/file/main.vue 198 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/business/service/impl/FlowBusinessServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/controller/FlowProcessTSController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/controller/FlowTaskUserController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/controller/VCIFlowController.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/entity/FlowTaskUser.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/entity/FlowTaskUserC.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/FlowEngineService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/FlowTaskUserService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/VICFlowService.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/FlowEngineServiceImpl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/FlowTaskUserServiceImpl.java 77 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/VCIFlowserviceImpl.java 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/enumpck/ProcessTemplateTypeEnum.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeClassifyTemplateMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/controller/UserController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/mapper/UserMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/IUserService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-user/src/main/resources/mapper/UserMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/resource/file.js
@@ -15,35 +15,35 @@
export const remove = (oids) => {
  return request({
    url: '/api/ubcs-resource/fileController/deleteFile',
    method: 'post',
    method: 'delete',
    params: {
      oids
    }
  })
}
export const upload = (row) => {
export const upload = (file) => {
  return request({
    url: '/api/ubcs-resource/fileController/uploadFile',
    method: 'post',
    data: row
    data: file
  })
}
export const update = (row) => {
export const update = (file) => {
  return request({
    url: '/api/ubcs-resource/fileController/uploadFile',
    method: 'post',
    data: row
    data: file
  })
}
export const download = (oids) => {
export const download = (fileOids) => {
  return request({
    url: '/api/ubcs-resource/fileController/downloadFilesByOids',
    method: 'get',
    params: {
      oids
      fileOids
    }
  })
}
Source/UBCS-WEB/src/components/file/inDialog.vue
@@ -1,6 +1,6 @@
<template>
  <div>
  <el-dialog :title="options.title|| '附件管理'"
  <el-dialog :title="options.title|| '附件列表'"
             :visible.sync="visible"
             append-to-body
             class="avue-dialog avue-dialog--top"
Source/UBCS-WEB/src/components/file/main.vue
@@ -44,7 +44,7 @@
        </el-button>
      </template>
    </avue-crud>
    <el-dialog title="上传附件列表"
    <el-dialog title="附件管理"
               append-to-body
               :visible.sync="attachBox"
               width="555px">
@@ -140,6 +140,16 @@
          },
        ]
      },
      columnType: {
        text: "input",
        combox: "select",
        truefalse: "switch",
        number: "number",
        textarea: "textarea",
        datetime: "datetime",
        date: "date",
        refer: "refer",
      },
      data: [{
        btmname: "fileobject",
        createTime: "2023-06-14 16:08:50.002",
@@ -161,18 +171,41 @@
      }],
      attachForm: {},
      attachOption: {
        submitBtn: true,
        emptyBtn: true,
        column: [
          {
        submitBtn: false,
        emptyBtn: false,
        column: [{
          prop: 'fileDocClassify',
          label: '文件类型',
          props: {
            label: 'value',
            value: 'key'
          },
          change: () => {
            (!!this.options.fileDocClassifyCombox) && this.changeFun('fileDocClassify');
          },
          blur: () => {
            (!this.options.fileDocClassifyCombox) && this.changeFun('fileDocClassify');
          },
          value: this.options.fileDocClassify || "ADMIN_SHARE",
          type: (!this.options.fileDocClassifyCombox) ? 'input' : 'select',
          dicData: (this.options.fileDocClassifyCombox || []),//[{key: 'text', value: '文本框'}]
          display: (!!this.options.fileDocClassifyCombox)
        }, {
            label: '附件上传',
            prop: 'attachFile',
            type: 'upload',
            dragFile: true,
          accept: this.options.uploadAccept || 'file',
            loadText: '文件上传中,请稍等',
            span: 24,
            propsHttp: {
              res: 'data'
          },
          data: {
            ownbizOid:this.options.ownbizOid || "share",
            ownBtmname:this.options.ownbizBtm || "share",
            fileDocClassify:this.options.fileDocClassify || "ADMIN_SHARE",
            fileDocClassifyName:this.options.fileDocClassifyName || "管理员共享文件"
            },
            action: "/api/ubcs-resource/fileController/uploadFile"
          }
@@ -190,48 +223,144 @@
        delBtn: this.vaildData(this.permission.attach_delete, false)
      };
    },
    ids() {
      let ids = [];
    oids() {
      let oids = [];
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
        oids.push(ele.oid);
      });
      return ids.join(",");
      return oids.join(",");
    }
  },
  mounted() {
    this.setFormItem();
    this.setParams()
  },
  methods: {
    setParams(){
      var params={
        ownbizOid:options.ownbizOid || '6EF696C3-CD87-0E7C-1EA1-8DE3913A95C9',
        ownbizBtm:options.ownbizBtm || 'wupin',
        fileDocClassify:options.fileDocClassify || '!=processAuditSuggest'
    setFormItem(){
      /*this.options.formItems=[{
        field: 'fileDocClassify11',
        title: '文件类型',
        type:  'combox',
        data: [{key: 'text', value: '文本框'},{key: 'number', value: '数字框'}]
      }]*/
      if(this.options && this.options.formItems){
        this.options.formItems.forEach(item => {
          // è®¾ç½®è¡¨å•校验的规则,文本
          let message = "请选择";
          let trigger = "change";
          if (item.type === "text") {
            message = "请输入";
            trigger = "blur";
      }
      this.params=params;
          this.attachOption.column.push( {
            ...item,
            label: item.title,
            prop: item.field,
            display: !item.hidden,
            value: item.defaultValue,
            disabled: item.readOnly,
            type: this.columnType[item.type],
            dicData: this.getDataList(item.type, item.data),
            change: () => {
              if(item.type !== "text"  && item.type !== "number" && item.type !== "textarea"){
                this.changeFun(item.field);
              }
            },
            blur: () => {
              if(item.type == "text"  || item.type == "number" || item.type == "textarea"){
                this.changeFun(item.field);
              }
            },
            rules: [
              {
                required: item.required,
                message: `请${message}${item.title}`,
                trigger,
              },
              {
                // å¦‚果没有正则则匹配任何字符
                pattern: item.verify ? item.verify : /[\s\S.]*/g,
                message: item.tooltips,
                trigger,
              },
            ],
            props: {
              label: 'value',
              value: 'key'
            }
          })
        })
      }
    },
    changeFun( prop) {
      this.attachOption.column[1].data[prop]=this.attachForm[prop]
    },
    getDataList(type, dicData) {
      if (type === "truefalse") {
        return [
          {
            key: false,
            value: "否",
          },
          {
            key: true,
            value: "是",
          },
        ];
      } else if (type === "combox") {
        return dicData;
      }
      return [];
    },
    setParams(){
      var queryMap = {
        currentButtonKey:'VIEW',
        ownbizOid:this.options.ownbizOid,
        ownbizBtm:this.options.ownbizBtm
      };
      if(this.options.where){
        Object.assign(queryMap,this.options.where);
      }
      this.params=queryMap;
    },
    handleUpload() {
      this.attachOption.column[1].data.fileOid='';
      delete this.attachOption.column[1].data.oid;
      delete this.attachOption.column[1].data.updateFileFlag;
      this.attachBox = true;
    },
    handleEdit() {
      if(this.selectionList.length==0){
        this.$message.error('请选择需要修改的文件')
        return false;
      }else if(this.selectionList.length>1){
        this.$message.error('请选择一条数据')
        return false;
      }
      this.attachOption.column[1].data.fileOid=this.oids;
      this.attachOption.column[1].data.oid=this.oids;
      this.attachOption.column[1].data.updateFileFlag=true
      this.attachBox = true;
    },
    uploadBefore(file, done, loading,column) {
      console.log(file,column)
      //如果你想修改file文件,由于上传的file是只读文件,必须复制新的file才可以修改名字,完后赋值到done函数里,如果不修改的话直接写done()即可
      var newFile = new File([file], '1234', { type: file.type });
      done(newFile)
      this.$message.success('上传前的方法')
      done();
    },
    uploadAfter(res, done, loading, column) {
      window.console.log(column);
      if(res.success){
      this.attachBox = false;
        this.$message.success('文件上传成功')
      }else{
        this.$message.error(res.msg);
      }
      this.refreshChange();
      done();
    },
    uploadError(error, column) {
      this.$message.success('上传失败回调')
      console.log(error, column)
      this.$message.error('上传文件出现了异常')
    },
    handleDownload(row) {
      window.open(`${row.link}`);
      //window.open(`${row.link}`);
      download(row.oid)
    },
    rowDel(row) {
      this.$confirm("确定将选择文件删除?", {
@@ -240,7 +369,7 @@
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
          return remove(row.oid);
        })
        .then(() => {
          this.onLoad(this.page);
@@ -261,7 +390,7 @@
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
          return remove(this.oids);
        })
        .then(() => {
          this.onLoad(this.page);
@@ -287,7 +416,7 @@
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      this.onLoad(this.page);
      done();
    },
    selectionChange(list) {
@@ -306,16 +435,21 @@
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params) {
      //this.loading = true;
      params=this.params || {}
      /*getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
    onLoad(page, params={}) {
      this.loading = true;
      var query={}
      if (this.query) {
        for (var key in this.query) {
          query['conditionMap["' + key + '"]'] = this.query[key];
        }
      }
      getList(page.currentPage, page.pageSize, Object.assign(params,this.params, query,this.query)).then(res => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });*/
      });
    }
  }
};
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/business/service/impl/FlowBusinessServiceImpl.java
@@ -25,6 +25,7 @@
import com.vci.ubcs.flow.engine.entity.FlowProcess;
import com.vci.ubcs.flow.engine.utils.FlowCache;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.flowable.engine.HistoryService;
import org.flowable.engine.TaskService;
import org.flowable.engine.history.HistoricProcessInstance;
@@ -117,7 +118,7 @@
        HistoricProcessInstanceQuery historyQuery = historyService.createHistoricProcessInstanceQuery().startedBy(taskUser).orderByProcessInstanceStartTime().desc();
        if (bladeFlow.getCategory() != null) {
        if (StringUtils.isNotEmpty(bladeFlow.getCategory())) {
            historyQuery.processDefinitionCategory(bladeFlow.getCategory());
        }
        if (bladeFlow.getProcessDefinitionName() != null) {
@@ -142,7 +143,7 @@
            String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey());
            if (businessKey.length > 1) {
                flow.setBusinessTable(businessKey[0]);
                flow.setBusinessId(businessKey[1]);
                flow.setBusinessId(businessKey.length>1?businessKey[1]:"1");
            }
            flow.setHistoryActivityName(historicProcessInstance.getName());
            flow.setProcessInstanceId(historicProcessInstance.getId());
@@ -190,7 +191,7 @@
        HistoricTaskInstanceQuery doneQuery = historyService.createHistoricTaskInstanceQuery().taskAssignee(taskUser).finished()
            .includeProcessVariables().orderByHistoricTaskInstanceEndTime().desc();
        if (bladeFlow.getCategory() != null) {
        if (StringUtils.isNotEmpty(bladeFlow.getCategory())) {
            doneQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory()));
        }
        if (bladeFlow.getProcessDefinitionName() != null) {
@@ -230,7 +231,7 @@
            if (Func.isNotEmpty(historicProcessInstance)) {
                String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey());
                flow.setBusinessTable(businessKey[0]);
                flow.setBusinessId(businessKey[1]);
                flow.setBusinessId(businessKey.length>1?businessKey[1]:"1");
                if (historicProcessInstance.getEndActivityId() != null) {
                    flow.setProcessIsFinished(FlowEngineConstant.STATUS_FINISHED);
                } else {
@@ -278,7 +279,8 @@
     * @param status    çŠ¶æ€
     */
    private void buildFlowTaskList(BladeFlow bladeFlow, List<BladeFlow> flowList, TaskQuery taskQuery, String status) {
        if (bladeFlow.getCategory() != null) {
//        if (bladeFlow.getCategory() != null) {
        if (StringUtils.isNotEmpty(bladeFlow.getCategory())) {
            taskQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory()));
        }
        if (bladeFlow.getProcessDefinitionName() != null) {
@@ -305,7 +307,7 @@
            if (Func.isNotEmpty(historicProcessInstance)) {
                String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey());
                flow.setBusinessTable(businessKey[0]);
                flow.setBusinessId(businessKey[1]);
                flow.setBusinessId(businessKey.length>1?businessKey[1]:"1");
            }
            FlowProcess processDefinition = FlowCache.getProcessDefinition(task.getProcessDefinitionId());
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/controller/FlowProcessTSController.java
ÎļþÃû´Ó Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/controller/ProcessTSController.java ÐÞ¸Ä
@@ -29,7 +29,7 @@
@RestController
@RequestMapping("processTS")
@AllArgsConstructor
public class ProcessTSController {
public class FlowProcessTSController {
    private final FlowEngineService flowEngineService;
    private final ProcessTemplateService processTemplateService;
@@ -41,7 +41,7 @@
    @GetMapping("/tlist")
    public R<IPage<ProcessTemplate>> tlist(@RequestParam Map<String, Object> flow, Query query) {
        IPage<ProcessTemplate> pages = processTemplateService.page(Condition.getPage(query), Condition.getQueryWrapper(flow, ProcessTemplate.class)
            .select("id,model_key modelKey,model_name modelName,button_Type_Key buttonTypeKey,button_Type_value buttonTypeValue")
            .select("id,model_key modelKey,model_name modelName,button_Type_Key buttonTypeKey,button_Type_value buttonTypeValue,description")
            .orderByDesc("last_updated"));
        return R.data(pages);
    }
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/controller/FlowTaskUserController.java
@@ -8,6 +8,8 @@
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * æµç¨‹task审批控制
@@ -24,11 +26,12 @@
    /**
     * æµç¨‹task审批人员列表
     * ProcessTemplateTypeEnum
     * @return
     */
    @GetMapping("list")
    public R<FlowTaskUserC> list() {
        return R.data(taskUserService.getUser());
    public R<Object> list(String type,String templateId) {
        return R.data(taskUserService.getUser(type,templateId));
    }
    /**
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/controller/VCIFlowController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
package com.vci.ubcs.flow.engine.controller;
import com.vci.ubcs.flow.core.entity.BladeFlow;
import com.vci.ubcs.flow.engine.entity.FlowTaskUserC;
import com.vci.ubcs.flow.engine.service.FlowTaskUserService;
import com.vci.ubcs.flow.engine.service.VICFlowService;
import lombok.AllArgsConstructor;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * å®šåˆ¶æµç¨‹ã€å¯åŠ¨ã€è½¬å‘ã€å®ŒæˆæŽ§åˆ¶å™¨
 *
 * @author wang1
 */
@NonDS
@RestController
@RequestMapping("vciflow")
@AllArgsConstructor
public class VCIFlowController {
    private final VICFlowService vicFlowService;
    /**
     * å¯åЍ
     * @return
     */
    @PostMapping("start")
    public R<BladeFlow> list(@RequestBody FlowTaskUserC flowTaskUserC) {
        return vicFlowService.startProcess(flowTaskUserC);
    }
    /**
     * æµç¨‹é¢„测
     */
    @PostMapping("a")
    public R<BladeFlow> a(@RequestBody FlowTaskUserC flowTaskUserC) {
        return vicFlowService.startProcess(flowTaskUserC);
    }
}
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/entity/FlowTaskUser.java
@@ -37,6 +37,7 @@
    private String id;
    private String name;//保存的这个收藏名称
    private String modelKey;
    private String modelName;
    private String classifyId;
    private String templateId;
    private String taskId;//流程taskid
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/entity/FlowTaskUserC.java
@@ -34,10 +34,17 @@
    private String createdBy;
    private String name;//保存的这个收藏名称
    private String modelKey;
    private String modelName;
    private String processName;
    private String processDesc;
    private String topName;
    private String classifyId;
    private String templateId;
    private String taskId;//阶段id,就是流程taskid
    private String taskName;//阶段名称
    private List<FlowTaskUser> flowTaskUsers;//每个节点收藏人
    private List<ProcessStageAttr> processStageAttr;//流程阶段保存的属性
    private List<String> ids;//流程发起中传递过来的数据id
}
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/FlowEngineService.java
@@ -173,4 +173,6 @@
     */
    List<Map<String,String>> getNodeByFlowableKey(String key);
    String getTaskIdString();
}
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/FlowTaskUserService.java
@@ -35,9 +35,10 @@
    /**
     * æŸ¥è¯¢å½“前登陆人对这个流程的taskUser
     * @param type ProcessTemplateTypeEnum
     * @return
     */
    FlowTaskUserC getUser();
    Object getUser(String type,String templateId);
    /**
     * æ–°å¢ž/修改流程节点审核人配置、并且修改流程xml部署文件
@@ -51,4 +52,12 @@
     * @param name
     */
    void deleteUser(String name);
    /**
     * é€šè¿‡æ¨¡æ¿id和模型key查询审批人
     * @param templateId
     * @param modelKey
     * @return
     */
    List<FlowTaskUser> getTaskUserByTemplateAndModelKey(String templateId,String modelKey);
}
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/VICFlowService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,37 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill åº„骞 (smallchill@163.com)
 */
package com.vci.ubcs.flow.engine.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.vci.ubcs.flow.core.entity.BladeFlow;
import com.vci.ubcs.flow.engine.entity.FlowTaskUser;
import com.vci.ubcs.flow.engine.entity.FlowTaskUserC;
import org.springblade.core.tool.api.R;
/**
 * FlowService
 *
 * @author wang1
 */
public interface VICFlowService{
    /**
     * å¯åŠ¨æµç¨‹
     * @return
     */
    R<BladeFlow> startProcess(FlowTaskUserC flowTaskUserC);
}
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/FlowEngineServiceImpl.java
@@ -93,6 +93,8 @@
    private static final String USR_TASK = "userTask";
    private static final String IMAGE_NAME = "image";
    private static final String XML_NAME = "xml";
    private static final String TASKID = "taskId";
    private static final String TASKNAME = "taskName";
    private static final Integer INT_1024 = 1024;
    private static final BpmnJsonConverter BPMN_JSON_CONVERTER = new BpmnJsonConverter();
    private static final BpmnXMLConverter BPMN_XML_CONVERTER = new BpmnXMLConverter();
@@ -508,16 +510,19 @@
            for (FlowElement flowElement : process.getFlowElements()) {
                if (flowElement instanceof UserTask) {
                    Map<String,String> mi = new HashMap<>();
                    mi.put("taskId",flowElement.getId());
                    mi.put("taskName",flowElement.getName());
                    mi.put(TASKID,flowElement.getId());
                    mi.put(TASKNAME,flowElement.getName());
                    ll.add(mi);
                }
            }
        }
        return ll;
    }
    @Override
    public String getTaskIdString(){
        return TASKID;
    }
    /**
     * æ˜¯å¦å·²å®Œç»“
     *
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/FlowTaskUserServiceImpl.java
@@ -28,6 +28,7 @@
import com.vci.ubcs.flow.engine.entity.*;
import com.vci.ubcs.flow.engine.mapper.FlowMapper;
import com.vci.ubcs.flow.engine.mapper.FlowTaskUserMapper;
import com.vci.ubcs.flow.engine.mapper.ProcessTemplateMapper;
import com.vci.ubcs.flow.engine.service.FlowEngineService;
import com.vci.ubcs.flow.engine.service.FlowTaskUserService;
import com.vci.ubcs.flow.engine.utils.FlowCache;
@@ -92,23 +93,62 @@
    private FlowEngineService flowEngineService;
    private FlowTaskUserMapper flowTaskUserMapper;
    private ProcessTemplateMapper processTemplateMapper;
    /**
     * æŸ¥è¯¢å½“前登陆人对这个流程的taskUser
     * @param type ProcessTemplateTypeEnum
     * @return
     */
    @Override
    public FlowTaskUserC getUser(){
        QueryWrapper<FlowTaskUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("CREATED_BY", AuthUtil.getUserId());
        List<FlowTaskUser> flowTaskUsers = baseMapper.selectList(queryWrapper);
        FlowTaskUserC flowTaskUserCR = new FlowTaskUserC();
        if(flowTaskUsers.size()==0){
            return flowTaskUserCR;
    public Object getUser(String type,String templateId){
        Map kv = new HashMap();
        //根据type查询top流程数据
        Map<String, Object> m = new HashMap<>();
        m.put("button_type_key", type);
        m.put("template_id", templateId);
        List<ProcessTemplate> processTemplates = processTemplateMapper.selectByMap(m);
         if(processTemplates.size()==0){
            throw new ServiceException("主题库定义-模板管理-流程模板,没有绑定流程!");
        }
        flowTaskUserCR.setName(flowTaskUsers.get(0).getName());//收藏名称
        flowTaskUserCR.setFlowTaskUsers(flowTaskUsers);
        return flowTaskUserCR;
        ProcessTemplate processTemplate = processTemplates.get(0);
        kv.put("flow",processTemplate);
        //top收藏部分数据
        QueryWrapper<FlowTaskUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("CREATED_BY", TaskUtil.getTaskUser());
        List<FlowTaskUser> flowTaskUsers = baseMapper.selectList(queryWrapper);
        List<FlowTaskUserC> cl = new ArrayList<>();
        Map<String,List<FlowTaskUser>> nameMap = new HashMap<>();
        for(FlowTaskUser flowTaskUser:flowTaskUsers){
            String name = flowTaskUser.getName();//收藏名称
            List<FlowTaskUser> flowTaskUserListo = null;
            if(nameMap.get(name)==null){
                flowTaskUserListo = new ArrayList<>();
            }else {
                flowTaskUserListo = nameMap.get(name);
            }
            flowTaskUserListo.add(flowTaskUser);
            nameMap.put(name,flowTaskUserListo);
        }
        for (String name:nameMap.keySet()){
            FlowTaskUserC flowTaskUserCR = new FlowTaskUserC();
            flowTaskUserCR.setName(name);//收藏名称
            flowTaskUserCR.setModelKey(nameMap.get(name).get(0).getModelKey());
            flowTaskUserCR.setModelName(nameMap.get(name).get(0).getModelName());
            flowTaskUserCR.setFlowTaskUsers(nameMap.get(name));
            cl.add(flowTaskUserCR);
        }
        kv.put("collect",cl);
        //数据节点数据
        List<Map<String,String>> tl = flowEngineService.getNodeByFlowableKey(processTemplate.getModelKey());
        kv.put("user",tl);
        return kv;
    }
    @Override
@@ -117,17 +157,20 @@
        String name = flowTaskUserC.getName();//收藏名称
        //新增情况下验证收藏名称不重复
        if(flowTaskUsers.get(0).getId()!=null) {
            Map<String, Object> m = new HashMap<>();
            m.put("name", name);
        m.put("created_by", TaskUtil.getTaskUser());
            QueryWrapper q = Condition.getQueryWrapper(m, FlowTaskUser.class)
                .select("id,model_key modelKey,name,description,version,created,last_updated lastUpdated");
            .select("1");
            if(flowTaskUserMapper.selectCount(q)>0){
                throw new ServiceException("收藏名称已经存在!");
            }
        }
        for (FlowTaskUser flowTaskUseri:flowTaskUsers){
            flowTaskUseri.setName(name);
            flowTaskUseri.setCreatedBy(TaskUtil.getTaskUser());
            flowTaskUseri.setTemplateId(flowTaskUserC.getTemplateId());
            flowTaskUseri.setModelKey(flowTaskUserC.getModelKey());
        }
        //新增、修改
        this.saveOrUpdateBatch(flowTaskUsers);
@@ -139,8 +182,14 @@
    public void deleteUser(String name){
        Map<String, Object> m = new HashMap<>();
        m.put("name", name);
        m.put("created_by", AuthUtil.getUserId());
        m.put("created_by", TaskUtil.getTaskUser());
        baseMapper.deleteByMap(m);
    }
    public List<FlowTaskUser> getTaskUserByTemplateAndModelKey(String templateId,String modelKey){
        Map<String, Object> m = new HashMap<>();
        m.put("template_id", templateId);
        m.put("model_key", modelKey);
        return baseMapper.selectByMap(m);
    }
}
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/VCIFlowserviceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,145 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill åº„骞 (smallchill@163.com)
 */
package com.vci.ubcs.flow.engine.service.impl;
import com.vci.ubcs.flow.core.constant.ProcessConstant;
import com.vci.ubcs.flow.core.entity.BladeFlow;
import com.vci.ubcs.flow.core.utils.TaskUtil;
import com.vci.ubcs.flow.engine.entity.*;
import com.vci.ubcs.flow.engine.service.FlowEngineService;
import com.vci.ubcs.flow.engine.service.FlowTaskUserService;
import com.vci.ubcs.flow.engine.service.VICFlowService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.flowable.bpmn.model.*;
import org.flowable.engine.*;
import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.api.Task;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.support.Kv;
import org.springframework.stereotype.Service;
import java.util.*;
/**
 * å·¥ä½œæµæœåŠ¡å®žçŽ°ç±»
 *
 * @author Chill
 */
@Slf4j
@Service
@AllArgsConstructor
public class VCIFlowserviceImpl implements VICFlowService {
    private final RuntimeService runtimeService;
    private final IdentityService identityService;
    private final RepositoryService repositoryService;
    private final TaskService taskService;
    private final FlowTaskUserService flowTaskUserService;
    private final FlowEngineService flowEngineService;
    private final HistoryService historyService;
    @Override
    public R<BladeFlow> startProcess(FlowTaskUserC flowTaskUserC){
        String modelKey = flowTaskUserC.getModelKey();
        String templateId = flowTaskUserC.getTemplateId();
        Kv kv = Kv.create()
            .set(ProcessConstant.TASK_VARIABLE_CREATE_USER, AuthUtil.getUserName());
        // è®¾ç½®æµç¨‹å¯åŠ¨ç”¨æˆ·
        identityService.setAuthenticatedUserId(TaskUtil.getTaskUser());
        // å¼€å¯æµç¨‹
        //查询最新的流程部署id
        ProcessDefinition latesDefinition = repositoryService.createProcessDefinitionQuery().latestVersion().processDefinitionKey(modelKey).singleResult();
        String processDefinitionId = latesDefinition.getId();
        //查询每一步审核人
        List<FlowTaskUser> taskUsers = flowTaskUserService.getTaskUserByTemplateAndModelKey(templateId,modelKey);
        Set<String> taskIdSet = new HashSet<>();
        for (FlowTaskUser taskUser:taskUsers){
            kv.put(taskUser.getTaskId(),TaskUtil.getTaskUser(taskUser.getUserId()));
            taskIdSet.add(taskUser.getTaskId());
        }
        //对比配置的审核人员和流程中节点是否一致,可能存在流程节点变更了,多了或者少了节点,但是配置审核人员的节点没有变
        List<Map<String,String>> processTasks = flowEngineService.getNodeByFlowableKey(modelKey);
        for (Map<String,String> mi:processTasks){
            String taskId = mi.get(flowEngineService.getTaskIdString());
            if(!taskIdSet.contains(taskId)){
                throw new ServiceException("流程已重新部署,节点已改变,请设置审核人员!");
            }
        }
        if(taskIdSet.size()!=processTasks.size()){
            throw new ServiceException("流程已重新部署,节点已改变,请设置审核人员!");
        }
        //流程中文件、变量等
        //do..
        ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinitionId, modelKey, kv);
        // ç»„装流程通用类
        BladeFlow flow = new BladeFlow();
        flow.setProcessInstanceId(processInstance.getId());
        nextFlowNode("next","039ac1d8-0c1e-11ee-bebb-5c3a4570456d");
        return R.data(flow);
    }
    /**
     * èŽ·å–ä»»åŠ¡èŠ‚ç‚¹
     *
     * @param node   æŸ¥è¯¢èŠ‚ç‚¹é€‰æ‹©
     * @param processInstanceId æµç¨‹å®žä¾‹id
     */
    public void nextFlowNode(String node, String processInstanceId) {
        Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).active().singleResult();
        ExecutionEntity ee = (ExecutionEntity) runtimeService.createExecutionQuery()
            .executionId(task.getExecutionId()).singleResult();
        // å½“前审批节点
        String crruentActivityId = ee.getActivityId();
        BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());
        FlowNode flowNode = (FlowNode) bpmnModel.getFlowElement(crruentActivityId);
        // è¾“出连线
        List<SequenceFlow> outFlows = flowNode.getOutgoingFlows();
        for (SequenceFlow sequenceFlow : outFlows) {
            //当前审批节点
            if ("now".equals(node)) {
                FlowElement sourceFlowElement = sequenceFlow.getSourceFlowElement();
                System.out.println("当前节点: id=" + sourceFlowElement.getId() + ",name=" + sourceFlowElement.getName());
            } else if ("next".equals(node)) {
                // ä¸‹ä¸€ä¸ªå®¡æ‰¹èŠ‚ç‚¹
                FlowElement targetFlow = sequenceFlow.getTargetFlowElement();
                if (targetFlow instanceof UserTask) {
                    System.out.println("下一节点: id=" + targetFlow.getId() + ",name=" + targetFlow.getName());
                }
                // å¦‚果下个审批节点为结束节点
                if (targetFlow instanceof EndEvent) {
                    System.out.println("下一节点为结束节点:id=" + targetFlow.getId() + ",name=" + targetFlow.getName());
                }
            }
        }
    }
}
Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/enumpck/ProcessTemplateTypeEnum.java
@@ -20,12 +20,12 @@
    /**
     * åœç”¨
     */
    ENABLE("ENABLE","停用"),
    ENABLE("ENABLE","启用"),
    /**
     * å¯ç”¨
     */
    DISABLE("DISABLE","启用");
    DISABLE("DISABLE","停用");
    /**
     * æžšä¸¾çš„值
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeClassifyTemplateMapper.xml
@@ -100,11 +100,11 @@
    <select id="selectChildHasReleaseTemplate" resultType="list">
    <select id="selectChildHasReleaseTemplate" resultType="map">
        select t.oid as oid, cls.oid as clsoid
        from platformbtm_codeclstemplate t
        from pl_code_clstemplate t
                 left join (select oid
                            from platformbtm_codeclassify
                            from pl_code_classify
                            where lcstatus = #{lcstatus}
                                start with oid = #{classifyoid}
                            connect by prior oid = parentcodeclassifyoid) cls
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/controller/UserController.java
@@ -142,6 +142,12 @@
        return R.data(UserWrapper.build().pageVO(pages));
    }
    @GetMapping("/allPage")
    public R<List<UserVO>> allPage(User user,Long deptId) {
        List<User> userss = userService.selectAllUser(user,deptId);
        return R.data(UserWrapper.build().listVO(userss));
    }
    /**
     * æ–°å¢žæˆ–修改
     */
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/mapper/UserMapper.java
@@ -43,6 +43,8 @@
     */
    List<User> selectUserPage(IPage<User> page, @Param("user") User user, @Param("deptIdList") List<Long> deptIdList, @Param("tenantId") String tenantId);
    List<User> selectUserPage(@Param("user") User user, @Param("deptIdList") List<Long> deptIdList, @Param("tenantId") String tenantId);
    /**
     * èŽ·å–ç”¨æˆ·
     *
@@ -50,7 +52,7 @@
     * @param account
     * @return
     */
    User getUser(String tenantId, String account);
    User getUser(String tenantId, String account,String name);
    /**
     * èŽ·å–å¯¼å‡ºç”¨æˆ·æ•°æ®
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/IUserService.java
@@ -84,6 +84,15 @@
     * è‡ªå®šä¹‰åˆ†é¡µ
     *
     * @param user
     * @param deptId
     * @return
     */
    List<User> selectAllUser(User user, Long deptId);
    /**
     * è‡ªå®šä¹‰åˆ†é¡µ
     *
     * @param user
     * @param query
     * @return
     */
@@ -107,6 +116,15 @@
    UserInfo userInfo(String tenantId, String account);
    /**
     * ç”¨æˆ·ä¿¡æ¯,为啥不删了上边那个方法呢,因为我不敢,牵扯有点多
     *
     * @param tenantId
     * @param account
     * @return
     */
    UserInfo userInfo(String tenantId, String account,String name);
    /**
     * ç”¨æˆ·ä¿¡æ¯
     *
     * @param tenantId
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserServiceImpl.java
@@ -162,6 +162,13 @@
    }
    @Override
    public List<User> selectAllUser(User user, Long deptId){
        List<Long> deptIdList = SysCache.getDeptChildIds(deptId);
        List<User> users = baseMapper.selectUserPage(user, deptIdList, (AuthUtil.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : AuthUtil.getTenantId()));
        return users;
    }
    @Override
    public IPage<UserVO> selectUserSearch(UserVO user, Query query) {
        LambdaQueryWrapper<User> queryWrapper = Wrappers.<User>query().lambda();
        String tenantId = AuthUtil.getTenantId();
@@ -206,13 +213,20 @@
    @Override
    public UserInfo userInfo(String tenantId, String account) {
        User user = baseMapper.getUser(tenantId, account);
        User user = baseMapper.getUser(tenantId, account,null);
        return buildUserInfo(user);
    }
    @Override
    public UserInfo userInfo(String tenantId, String account,String name) {
        User user = baseMapper.getUser(tenantId, account,name);
        UserInfo userInfo = buildUserInfo(user);
        return null;
    }
    @Override
    public UserInfo userInfo(String tenantId, String account, UserEnum userEnum) {
        User user = baseMapper.getUser(tenantId, account);
        User user = baseMapper.getUser(tenantId, account,null);
        return buildUserInfo(user, userEnum);
    }
Source/UBCS/ubcs-service/ubcs-user/src/main/resources/mapper/UserMapper.xml
@@ -77,7 +77,11 @@
            LEFT JOIN PL_SYS_USER_PWDSTRATEGY plup on plup.USER_ID=pou.ID
            LEFT JOIN PL_SYS_PWDSTRATEGY pss on pss.ID=plup.PWDSTRATEGY_ID
        WHERE
            tenant_id = #{param1} and account = #{param2} and is_deleted = 0
            tenant_id = #{param1} and account = #{param2}
            <if test="param3!=null and param3 != ''">
                and name = #{param3}
            </if>
          and is_deleted = 0
    </select>
    <select id="exportUser" resultType="com.vci.ubcs.system.user.excel.UserExcel">