瀏覽代碼

增加流程

zt 7 月之前
父節點
當前提交
53d9d4879e

+ 3 - 2
pro-base/src/main/java/com/idea/oa/activiti/service/ProActiService.java

@@ -1189,8 +1189,9 @@ public class ProActiService {
                 //  2.如果大于1就是非正常流程需要把目标人填自己直到自己流转到自己流程上
                 // 需要进行循环审核过程
                 boolean isZhuYaoLingDao="flow_zyld".equals(currRole)?true:false; //2023年5月17日 章总修改,在开始申请的时候不判断身份是否是该节点本身份,而是必须要进行审核,所以注释掉下面的判断
-               if(isZhuYaoLingDao) {//2023年7月5日 章总在第七批次又改回来了 //2023年5月17日 章总修改,在开始申请的时候不判断身份是否是该节点本身份,而是必须要进行审核,所以注释掉下面的判断
-                targetUser = currUser;
+// 现在没有:开始申请的时候不判断身份是否是该节点本身份 的判断了              if(isZhuYaoLingDao) {//2023年7月5日 章总在第七批次又改回来了 //2023年5月17日 章总修改,在开始申请的时候不判断身份是否是该节点本身份,而是必须要进行审核,所以注释掉下面的判断
+                   if(true) {
+                   targetUser = currUser;
                 startTask = flowService.startTask(processDefine, null, businessId, targetUser, currUser);
                 if (!startTask.isEmpty()) {
                     {

+ 1 - 1
pro-base/src/main/java/com/idea/oa/apply/controller/ApplyAddWorkController.java

@@ -48,7 +48,7 @@ import java.util.Map;
  */
 @Controller
 @RequestMapping(value = "/ApplyAddWorkController")
-@Api(value = "分表_付款申请")
+@Api(value = "分表_加班申请")
 public class ApplyAddWorkController extends BaseController {
 //    @Autowired
 //    private WorkAttendanceLogService workAttendanceLogService;

+ 347 - 0
pro-base/src/main/java/com/idea/oa/apply/controller/ApplyPaymentSettleController.java

@@ -0,0 +1,347 @@
+package com.idea.oa.apply.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+
+import com.idea.oa.apply.model.inout.AddConfirmResult;
+import com.idea.oa.apply.model.inout.ApplyPaymentSettleIn;
+import com.idea.oa.apply.service.ApplyPaymentSettleService;
+import com.idea.oa.apply.util.constant.ConstantFlowType;
+import com.idea.oa.flow2.model.FlowMain;
+import com.idea.oa.flow2.model.FlowMainPush;
+import com.idea.oa.flow2.model.in.FlowMainCcVo;
+import com.idea.oa.flow2.service.FlowMainCcService;
+import com.idea.oa.flow2.service.FlowMainPushService;
+import com.idea.oa.flow2.service.FlowMainService;
+import com.rockstar.common.base.BaseController;
+import com.rockstar.common.domain.AjaxResult;
+import com.rockstar.flow.exception.FlowException;
+import com.rockstar.frame.service.FrameUserService;
+import com.rockstar.shiro.util.ShiroUtils;
+import com.rockstar.util.UUIDUtils;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.math.BigDecimal;
+import java.math.MathContext;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by zt on 2023
+ */
+@Controller
+@RequestMapping(value = "/ApplyPaymentSettleController")
+@Api(value = "分表_付款申请")
+public class ApplyPaymentSettleController extends BaseController {
+
+    //主表
+    @Autowired
+    private ApplyPaymentSettleService modelService;
+
+    @Autowired
+    private FlowMainCcService flowMainCcService;
+    @Autowired
+    private FlowMainPushService flowMainPushService;
+    @Autowired
+    private FlowMainService flowMainService;
+
+
+    @Autowired
+    private FrameUserService frameUserService;
+
+    /**
+     * 添加审核结果
+     * 根据不同的状态值confirmResult判断是 1:审核通过,转下一步;2:退回发起人;3:退回上节点;4:结束流程;
+     *
+     * @param addConfirmResult
+     * @return
+     */
+    @PostMapping(value = "AddConfirmResult", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    @Transactional
+    public AjaxResult AddConfirmResult(AddConfirmResult addConfirmResult) throws FlowException {
+        System.out.println("AddConfirmResult");
+        System.out.println(addConfirmResult);
+        if (addConfirmResult.getConfirmResult() == null) {
+            return result(-1);
+        }
+//        String deploymentid = ConstantFlowType.USE_MONEY_DEPLOYMENTID;
+//        String constantFlowType = ConstantFlowType.USE_MONEY;
+        FlowMainPush flowMainPush = flowMainPushService.selectByPrimaryKey(addConfirmResult.getFlowMainPushId());
+
+
+
+
+        String isOkString = null;
+        {//进行审核判断
+
+            //添加判断条件
+            HashMap<String, Object> feeMoneyTotalMap = null;//new HashMap<>();
+
+            isOkString = flowMainService.doConfirmResult(addConfirmResult, ConstantFlowType.PAYMENT_DEPLOYMENTID, ConstantFlowType.PAYMENT, flowMainPush, feeMoneyTotalMap);
+            if (!"ok_end".equals(isOkString) && !"ok_noEnd".equals(isOkString)) {
+                return AjaxResult.error(isOkString);
+            }
+        }
+
+
+        Boolean isEnd = false;//是否结束
+        Boolean isAgree = false;//是否同意
+        if (addConfirmResult.getConfirmResult().equals("4")) {//结束流程
+            isEnd = true;
+            isAgree = false;
+        } else if (addConfirmResult.getConfirmResult().equals("1")) {//1:审核通过,转下一步
+            if ("ok_end".equals(isOkString)) {
+                isEnd = true;
+                isAgree = true;
+            }
+        }
+        //添加业务信息(将请假信息中的修改掉,剩余年假,剩余调休,冻结年假,冻结调休都修改掉)
+        if (isEnd) {
+
+        }
+
+        return result(1);
+    }
+
+
+
+
+    /**
+     * 发起付款申请流程
+     *
+     * @param record
+     * @return
+     */
+    @PostMapping(value = "addApplyPaymentSettle", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    @Transactional
+    public AjaxResult addApplyPaymentSettle(ApplyPaymentSettleIn record) throws FlowException {
+        System.out.println("addApplyPaymentSettle");
+        System.out.println(record);
+        if (false) {
+            return AjaxResult.error("这是一个错误测试信息");
+        }
+        return myaddApplyPayment(record,null);
+    }
+
+    /**
+     * 申请人重新发起申请
+     *
+     * @param record
+     * @return
+     */
+    @PostMapping(value = "addApplyPaymentSettleAgain", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    @Transactional
+    public AjaxResult addApplyPaymentSettleAgain(ApplyPaymentSettleIn record) throws FlowException {
+        System.out.println("addApplyPaymentSettleAgain");
+        if (StringUtils.isEmpty(record.getFlowMainId())) {
+            return AjaxResult.error("没有传入flowMainId的值");
+        }
+        System.out.println(record);
+//        record.setRemark("重新发起申请[" + record.getFlowMainId() + "],");
+        {//修改重新发起前的表状态
+            FlowMain flowMain1 = new FlowMain();
+            flowMain1.setId(record.getFlowMainId());
+            flowMain1.setReturnStatus(1);//0/null无状态,1已撤回并且已重新发起
+            flowMain1.setUpdatedAt(new Date());
+            flowMain1.setUpdatedBy(ShiroUtils.getUser().getId());
+            flowMainService.updateByPrimaryKeySelective(flowMain1);
+        }
+        return myaddApplyPayment(record,"重新发起申请[" + record.getFlowMainId() + "],");
+    }
+
+    /**
+     * 发起请假申请流程
+     *
+     * @param record
+     * @return
+     */
+    public AjaxResult myaddApplyPayment(ApplyPaymentSettleIn record,String addSystemRemark) throws FlowException {
+
+
+
+        {
+            record.setUpdatedAt(new Date());
+            record.setCreatedAt(record.getUpdatedAt());
+            record.setCreatedBy(ShiroUtils.getUser().getId());
+            record.setUpdatedBy(record.getCreatedBy());
+            record.setCreatedByDept(ShiroUtils.getUser().getDepartment());
+            record.setFlowNum(UUIDUtils.middleUUID());
+            record.setStatus(0);
+            modelService.insert(record);
+        }
+
+        HashMap<String, Object> feeMoneyTotalMap = null;//new HashMap<>();
+//        if (totalTiaoXiu.doubleValue() > 0 && totalNianJia.doubleValue() <= 0 && totalShiJia.doubleValue() <= 0) {
+//            //假别仅有调休假
+////            String isExchangeOnly = conditionMap.get("isExchangeOnly").toString();
+////            Integer applyDay = Integer.valueOf(conditionMap.get("applyDay").toString());
+//            feeMoneyTotalMap.put("isExchangeOnly", "yes");
+//            feeMoneyTotalMap.put("applyDay", 0);
+//        } else if (totalTiaoXiu.add(totalNianJia).add(totalShiJia).doubleValue() > 3) {
+////            假期天数合计>3天
+//            feeMoneyTotalMap.put("isExchangeOnly", "no");
+//            feeMoneyTotalMap.put("applyDay", 4);
+//        } else {
+//            feeMoneyTotalMap.put("isExchangeOnly", "no");
+//            feeMoneyTotalMap.put("applyDay", 0);
+//        }
+//        feeMoneyTotalMap.put("billMoney", feeMoneyTotalDouble);
+        String applyTheme = "" + ShiroUtils.getUser().getTruename() + "的付款申请单";
+        AjaxResult ajaxResult = flowMainService.doFlowMain(applyTheme, record.getId(), addSystemRemark, record.getCcList(),
+                ConstantFlowType.PAYMENT_PROCESSDEFINE, ConstantFlowType.PAYMENT_DEPLOYMENTID,
+                feeMoneyTotalMap, ConstantFlowType.PAYMENT_NAME, ConstantFlowType.PAYMENT,ShiroUtils.getUser());
+
+        if (ajaxResult.get("code").equals(1688)) {
+//            //表成功了 且已经审核完成
+////            需要进行后续的处理
+//            Boolean isEnd = true;//是否结束
+//            Boolean isAgree = true;//是否同意
+//
+//            //添加业务信息(将请假信息中的修改掉,剩余年假,剩余调休,冻结年假,冻结调休都修改掉)
+//            if (isEnd) {
+//
+//                if (isAgree) {//如果是最后   并且同意了,就进行下面的操作,或者不同意就进行另一种操作,
+
+//
+//
+//                } else {
+//                    //如果是不同意
+//                    {
+////                    不需要做什么
+//                    }
+//                }
+//            }
+
+            return AjaxResult.success();
+        } else {
+
+            return ajaxResult;
+        }
+
+    }
+
+
+    /**
+     * 根据推送表的FlowMainPushId获取信息
+     *
+     * @param flowMainPushId
+     * @return
+     */
+    @PostMapping(value = "getInfoByFlowMainPushId", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public ApplyPaymentSettleIn getInfoByFlowMainPushId(String flowMainPushId) {
+        ApplyPaymentSettleIn myApplyPaymentSettleIn = modelService.getInfoByFlowMainPushId(flowMainPushId);
+        if (myApplyPaymentSettleIn != null) {
+            {//获取抄送人
+
+                List<FlowMainCcVo> flowMainCcList = flowMainCcService.selectVoByFlowMainId(myApplyPaymentSettleIn.getFlowMainId());
+
+                myApplyPaymentSettleIn.setFlowMainCcList(flowMainCcList);
+
+            }
+
+        }
+        return myApplyPaymentSettleIn;
+    }
+
+
+
+    /**
+     * 根据主表的FlowMainId获取信息
+     *
+     * @param flowMainId
+     * @return
+     */
+    @PostMapping(value = "getInfoByFlowMainId", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public ApplyPaymentSettleIn getInfoByFlowMainId(String flowMainId) {
+        ApplyPaymentSettleIn myApplyPaymentSettleIn = modelService.getInfoByFlowMainId(flowMainId);
+        if (myApplyPaymentSettleIn != null) {
+            {//获取抄送人
+
+                List<FlowMainCcVo> flowMainCcList = flowMainCcService.selectVoByFlowMainId(myApplyPaymentSettleIn.getFlowMainId());
+
+                myApplyPaymentSettleIn.setFlowMainCcList(flowMainCcList);
+
+            }
+
+
+        }
+        return myApplyPaymentSettleIn;
+    }
+
+    /**
+     * 根据用户id获取用户姓名和部门名称,岗位信息
+     *
+     * @param userId
+     * @return
+     */
+    @PostMapping(value = "getUserInfoByUserId", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public Map<String, Object> getUserInfoByUserId(String userId) {
+        if (StringUtils.isEmpty(userId)) {
+            userId = ShiroUtils.getUser().getId();
+        }
+        return modelService.getUserInfoByUserId(userId);
+    }
+
+
+    //=====下面原生的=============================================================================================================
+
+
+//    @PostMapping(value = "list",produces = {"application/json;charset=UTF-8"})
+//    @ResponseBody
+//    public Object list(Tablepar tablepar, ApplyPaymentSettle model, DateTrans dt){
+//        PageInfo<ApplyPaymentSettle> page= modelService.list(tablepar,model,dt);
+//        TableSplitResult<ApplyPaymentSettle> result=new TableSplitResult<ApplyPaymentSettle>(page.getPageNum(), page.getTotal(), page.getList());
+//        return  result;
+//    }
+//
+//    @PostMapping(value = "listAll",produces = {"application/json;charset=UTF-8"})
+//    @ResponseBody
+//    public Object listAll(ApplyPaymentSettle model, DateTrans dt){
+//        return  modelService.listAll(model,dt);
+//    }
+//
+//    @PostMapping(value = "add",produces = {"application/json;charset=UTF-8"})
+//    @ResponseBody
+//    public AjaxResult add(ApplyPaymentSettle record){
+//        record.setCreatedAt(new Date());
+//        int result = modelService.insert(record);
+//        return result(result);
+//    }
+//
+//    @PostMapping(value = "remove/{id}",produces = {"application/json;charset=UTF-8"})
+//    @ResponseBody
+//    public AjaxResult remove(@PathVariable("id") String id){
+//        int result = -1;//modelService.deleteByPrimaryKey(id);
+//        return result(result);
+//    }
+//
+//    @PostMapping(value = "edit",produces = {"application/json;charset=UTF-8"})
+//    @ResponseBody
+//    public AjaxResult editSave(ApplyPaymentSettle model){
+//        int result = modelService.updateByPrimaryKeySelective(model);
+//        return result(result);
+//    }
+//
+//    @PostMapping(value = "getById",produces = {"application/json;charset=UTF-8"})
+//    @ResponseBody
+//    public ApplyPaymentSettle getById(String id) {
+//        return modelService.selectByPrimaryKey(id);
+//    }
+
+
+}

+ 25 - 0
pro-base/src/main/java/com/idea/oa/apply/mapper/ApplyPaymentSettleExtendMapper.java

@@ -0,0 +1,25 @@
+package com.idea.oa.apply.mapper;
+
+import com.idea.oa.apply.model.inout.ApplyAddWorkIn;
+import com.idea.oa.apply.model.inout.ApplyPaymentSettleIn;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+@Component
+public interface ApplyPaymentSettleExtendMapper {
+    @Select("SELECT flow_main_push.id AS flowMainPushId,frame_user.truename AS createdByString,flow_main_push.flow_main_id AS flowMainId,apply_payment_settle.*FROM flow_main_push LEFT JOIN apply_payment_settle ON apply_payment_settle.id=flow_main_push.form_id LEFT JOIN frame_user ON frame_user.id=apply_payment_settle.created_by WHERE flow_main_push.id=#{flowMainPushId}")
+    ApplyPaymentSettleIn getInfoByFlowMainPushId(String flowMainPushId);
+
+    @Select("SELECT flow_main.id AS flowMainId,frame_user.truename AS createdByString,apply_payment_settle.*FROM flow_main LEFT JOIN apply_payment_settle ON apply_payment_settle.id=flow_main.form_id LEFT JOIN frame_user ON frame_user.id=apply_payment_settle.created_by WHERE flow_main.id=#{flowMainId}")
+    ApplyPaymentSettleIn getInfoByFlowMainId(String flowMainId);
+
+
+
+//    frame_user.posts,frame_post.post_name,frame_user.id,frame_user.truename,frame_user.department,sys_dept.dept_name as deptName
+    @Select("SELECT frame_user.posts,frame_post.post_name as postName,frame_user.id,frame_user.truename,frame_user.department,sys_dept.dept_name as deptName  FROM frame_user LEFT JOIN sys_dept ON sys_dept.id=frame_user.department LEFT JOIN frame_post ON frame_post.id=frame_user.posts WHERE frame_user.id=#{userId}")
+    Map<String, Object> getUserInfoByUserId(@Param("userId")  String userId);
+
+}

+ 2 - 0
pro-base/src/main/java/com/idea/oa/apply/mapper/ApplyPaymentSettleMapper.java

@@ -4,7 +4,9 @@ import com.idea.oa.apply.model.ApplyPaymentSettle;
 import com.idea.oa.apply.model.ApplyPaymentSettleExample;
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Component;
 
+@Component
 public interface ApplyPaymentSettleMapper {
     long countByExample(ApplyPaymentSettleExample example);
 

+ 67 - 0
pro-base/src/main/java/com/idea/oa/apply/model/inout/ApplyPaymentSettleIn.java

@@ -0,0 +1,67 @@
+package com.idea.oa.apply.model.inout;
+
+import com.idea.oa.apply.model.ApplyAddWork;
+import com.idea.oa.apply.model.ApplyAddWorkTime;
+import com.idea.oa.apply.model.ApplyPaymentSettle;
+import com.idea.oa.flow2.model.in.FlowMainCcVo;
+
+import java.util.List;
+
+public class ApplyPaymentSettleIn extends ApplyPaymentSettle {
+    private String createdByString;
+
+
+
+    // 抄送人列表格式例如:,张三,李四, 传入的
+    private String ccList;
+
+    private List<FlowMainCcVo> flowMainCcList;
+
+    // 推送表id
+    private String flowMainPushId;
+
+    // 原来的流程id
+    private String flowMainId;
+
+    public String getCreatedByString() {
+        return createdByString;
+    }
+
+    public void setCreatedByString(String createdByString) {
+        this.createdByString = createdByString;
+    }
+
+
+
+    public String getCcList() {
+        return ccList;
+    }
+
+    public void setCcList(String ccList) {
+        this.ccList = ccList;
+    }
+
+    public List<FlowMainCcVo> getFlowMainCcList() {
+        return flowMainCcList;
+    }
+
+    public void setFlowMainCcList(List<FlowMainCcVo> flowMainCcList) {
+        this.flowMainCcList = flowMainCcList;
+    }
+
+    public String getFlowMainPushId() {
+        return flowMainPushId;
+    }
+
+    public void setFlowMainPushId(String flowMainPushId) {
+        this.flowMainPushId = flowMainPushId;
+    }
+
+    public String getFlowMainId() {
+        return flowMainId;
+    }
+
+    public void setFlowMainId(String flowMainId) {
+        this.flowMainId = flowMainId;
+    }
+}

+ 147 - 0
pro-base/src/main/java/com/idea/oa/apply/service/ApplyPaymentSettleService.java

@@ -0,0 +1,147 @@
+package com.idea.oa.apply.service;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.idea.oa.apply.mapper.ApplyPaymentSettleExtendMapper;
+import com.idea.oa.apply.mapper.ApplyPaymentSettleMapper;
+import com.idea.oa.apply.model.ApplyPaymentSettle;
+import com.idea.oa.apply.model.ApplyPaymentSettleExample;
+import com.idea.oa.apply.model.inout.ApplyPaymentSettleIn;
+import com.rockstar.common.base.BaseService;
+import com.rockstar.common.support.Convert;
+import com.rockstar.frame.model.extend.DateTrans;
+import com.rockstar.frame.model.extend.Tablepar;
+import com.rockstar.util.UUIDUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class ApplyPaymentSettleService implements BaseService<ApplyPaymentSettle, ApplyPaymentSettleExample> {
+
+    //文件mapper
+    @Autowired
+    private ApplyPaymentSettleMapper modelMapper;
+
+    @Autowired
+    private ApplyPaymentSettleExtendMapper ApplyPaymentSettleExtendMapper;
+
+
+    /**
+     * 分页查询
+     *
+     * @return
+     */
+    public PageInfo<ApplyPaymentSettle> list(Tablepar tablepar, ApplyPaymentSettle model, DateTrans dt) {
+        PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
+        List<ApplyPaymentSettle> list = null;//modelMapper.selectByExample(getCondition(model,dt));
+        PageInfo<ApplyPaymentSettle> pageInfo = new PageInfo<>(list);
+        return pageInfo;
+    }
+
+    public Object listAll(ApplyPaymentSettle model, DateTrans dt) {
+        List<ApplyPaymentSettle> list = null;//modelMapper.selectByExample(getCondition(model,dt));
+        return list;
+    }
+
+
+    @Override
+    public int deleteByPrimaryKey(String ids) {
+        List<String> lista = Convert.toListStrArray(ids);
+        ApplyPaymentSettleExample example = new ApplyPaymentSettleExample();
+        example.createCriteria().andIdIn(lista);
+        return modelMapper.deleteByExample(example);
+    }
+
+    @Override
+    public ApplyPaymentSettle selectByPrimaryKey(String id) {
+        return modelMapper.selectByPrimaryKey(id);
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(ApplyPaymentSettle record) {
+        return modelMapper.updateByPrimaryKeySelective(record);
+    }
+
+    @Override
+    public int updateByExampleSelective(ApplyPaymentSettle record, ApplyPaymentSettleExample example) {
+        return modelMapper.updateByExampleSelective(record, example);
+    }
+
+    @Override
+    public int updateByExample(ApplyPaymentSettle record, ApplyPaymentSettleExample example) {
+        return modelMapper.updateByExample(record, example);
+    }
+
+    @Override
+    public List<ApplyPaymentSettle> selectByExample(ApplyPaymentSettleExample example) {
+        return modelMapper.selectByExample(example);
+    }
+
+    @Override
+    public long countByExample(ApplyPaymentSettleExample example) {
+        return modelMapper.countByExample(example);
+    }
+
+
+    @Override
+    public int deleteByExample(ApplyPaymentSettleExample example) {
+        return modelMapper.deleteByExample(example);
+    }
+
+    public int insert(ApplyPaymentSettle record) {
+        record.setId(UUIDUtils.middleUUID());
+        return insertWithoutId(record);
+    }
+
+    public int insertWithoutId(ApplyPaymentSettle record) {
+        record.setCreatedAt(new Date());
+        return modelMapper.insert(record);
+    }
+
+    @Override
+    public int insertSelective(ApplyPaymentSettle record) {
+        record.setId(UUIDUtils.middleUUID());
+        record.setCreatedAt(new Date());
+        return modelMapper.insertSelective(record);
+    }
+
+    public ApplyPaymentSettleIn getInfoByFlowMainId(String flowMainId) {
+        return ApplyPaymentSettleExtendMapper.getInfoByFlowMainId(flowMainId);
+    }
+
+    public ApplyPaymentSettleIn getInfoByFlowMainPushId(String flowMainPushId) {
+        return ApplyPaymentSettleExtendMapper.getInfoByFlowMainPushId(flowMainPushId);
+    }
+
+
+    public Map<String, Object> getUserInfoByUserId(String userId) {
+        Map<String, Object> userInfoByUserId = ApplyPaymentSettleExtendMapper.getUserInfoByUserId(userId);
+//        if (userInfoByUserId.get("posts") == null) {
+//            userInfoByUserId.put("posts", null);
+//        }
+//
+//        if (userInfoByUserId.get("postName") == null) {
+//            userInfoByUserId.put("postName", null);
+//        }
+//
+//        if (userInfoByUserId.get("truename") == null) {
+//            userInfoByUserId.put("truename", null);
+//        }
+//
+//        if (userInfoByUserId.get("department") == null) {
+//            userInfoByUserId.put("department", null);
+//        }
+//        if (userInfoByUserId.get("deptName") == null) {
+//            userInfoByUserId.put("deptName", null);
+//        }
+
+
+        return userInfoByUserId;
+    }
+
+
+}

+ 3 - 3
pro-base/src/main/java/com/idea/oa/apply/util/constant/ConstantFlowType.java

@@ -32,10 +32,10 @@ public class ConstantFlowType {
     public final static String ADMINID = "1";
     //注意,部门和部门主管的角色是写死的
     //获取用户流程类型
-    public final static String[] FLOW_ROLES = {"flow_fgld", "flow_sjfgld", "flow_zyld"};//领导查看
+    public final static String[] FLOW_ROLES = {"flow_cwld","flow_fgld", "flow_sjfgld", "flow_zyld"};//领导查看
     public final static String[] FLOW_ROLES_DEPT = {"curr_user", "dept_superior", "dept_head"};//部门查看
     public final static String[] FLOW_ROLES_CHECK = {"flow_cnzf", "flow_zffh"};//出纳查看
-    public final static String[] ROLES = {"fgld", "sjfgld", "zyld"};//领导查看(不带主类型)
+    public final static String[] ROLES = {"cwld","fgld", "sjfgld", "zyld"};//领导查看(不带主类型)
     public final static String[] ROLES_CHECK = {"cnzf", "zffh"};//出纳查看(不带主类型)
     public final static String[] PURCHASE_FLOW_ROLES_CHECK = {"flow_cgzy"};// 采购申请用
     public final static String[] PURCHASE_ROLES_CHECK = {"cgzy"};//采购申请用
@@ -143,7 +143,7 @@ public class ConstantFlowType {
     public final static String PAYMENT_PROCESSDEFINE = "applyPayment";//自己瞎写的  todo 要对应resources/processes目录下的对应bpmn文件 process id="xxx"
     public static String PAYMENT_DEPLOYMENTID = "20004";//自己瞎写的
     //流程顺序
-    public static String[] PAYMENT_FLOWSTEPS={"curr_user", "dept_superior_1_0_1", "dept_head_1_0_1", "flow_fgld_1_0_1", "flow_sjfgld_1_0_1", "flow_zyld_1_0_1"};
+    public static String[] PAYMENT_FLOWSTEPS={"curr_user",  "dept_head_1_0_1","flow_cwld_1_0_1", "flow_fgld_1_0_1", "flow_sjfgld_1_0_1", "flow_zyld_1_0_1"};
 //    key="curr_user"      name="申请人发起"
 //    key="dept_superior_1_0_1"      name="直接上级审核"
 //    key="dept_head_1_0_1"      name="部门负责人审核"

+ 1 - 68
pro-base/src/main/java/com/idea/oa/flow2/controller/FlowMainController.java

@@ -158,74 +158,7 @@ public class FlowMainController extends BaseController {
     public AjaxResult recallApply(String flowMainid) {
         return modelService.recallApply(flowMainid);
 
-//        if (StringUtils.isEmpty(flowMainid)) {
-//            return AjaxResult.error("数据不能为空");
-//        }
-//        FlowMain flowMain = modelService.selectByPrimaryKey(flowMainid);
-//        //流转状态为审核中时,可以由发起人撤回。ok
-//        if (!flowMain.getFlowStatus().equals(1)){
-//            return AjaxResult.error("流程状态不在审核中,请重新确认");
-//        }
-//        {//开始申请人撤回申请
-//            //1.关闭所有推送人数据信息表 ok
-//            {
-//                flowMainPushService.updateStatusThreeByFlowMainId(ShiroUtils.getUser().getId(),flowMain.getId());
-//            }
-//            //2.关闭主流程 ok
-//            {// 发起流程引擎操作 并结束该流程
-//
-//                try {
-//                    flowService.deleteInstance(flowMain.getFlowId(), "申请人撤回申请_结束流程");
-//                } catch (Exception e) {
-//                    System.err.println("流程引擎异常");
-//                    e.printStackTrace();
-////                    throw new RuntimeException(e);
-//                }
-//            }
-//            //3.关闭主流程表 ok
-//            //存入流程日志表的id
-//            String flowMainLogUuid = UUIDUtils.middleUUID();
-//            {
-//                FlowMain flowMain1 = new FlowMain();
-//                flowMain1.setId(flowMain.getId());
-//                flowMain1.setFlowStatus(4);//申请状态(1审批中,2,退回发起人,3,已结束,4已撤回)
-//                flowMain1.setLastMainLogId(flowMainLogUuid);
-//                flowMain1.setUpdatedAt(new Date());
-//                flowMain1.setUpdatedBy(ShiroUtils.getUser().getId());
-//                modelService.updateByPrimaryKeySelective(flowMain1);
-//            }
-//            //4 添加日志表
-//            FlowMainLog flowMainLog = new FlowMainLog();
-//            {//其表单对应的流转历史该节点审核结果显示为”发起人撤回”
-////                flowMainLogUuid
-//                flowMainLog.setId(flowMainLogUuid);
-//                flowMainLog.setFlowMainId(flowMain.getId());
-//                flowMainLog.setFormId(flowMain.getFormId());
-//                flowMainLog.setAuditUser(ShiroUtils.getUser().getId());
-//                flowMainLog.setAuditContent(null);
-//                flowMainLog.setAuditResult(null);
-//                //审批类型(0流程开始状态还是1流程审核状态还是2流程结束状态还是3申请人暂停状态4申请人结束状态
-//                flowMainLog.setAuditType("4");
-//                flowMainLog.setFlowType(flowMain.getFlowType());
-//                flowMainLog.setFlowPost(ShiroUtils.getUser().getId());
-//                {// 需要工作流引擎的支持
-//                    flowMainLog.setFlowId(flowMain.getFlowId());
-//                    flowMainLog.setTaskId(null);
-//                    flowMainLog.setNodeName("发起人撤回");
-//                }
-////            下一环节操作人(审核人/委托人/退回申请人),列表例如:,张三,李四,
-////            因为感觉用不到,暂时不放进去
-////            flowMainLog.setNextPersons();
-//                flowMainLog.setUpMainLogId(flowMain.getLastMainLogId());
-//                flowMainLog.setCcList(null);
-//                flowMainLog.setCreatedAt(new Date());
-//                flowMainLog.setCreatedBy(ShiroUtils.getUser().getId());
-//                flowMainLog.setGroupId(ShiroUtils.getUser().getGroupId());
-//                flowMainLog.setStatus(0);
-//                flowMainLogService.insertWithoutId(flowMainLog);
-//            }
-//        }
-//        return result(1);
+
     }
 
 

+ 2 - 81
pro-base/src/main/java/com/idea/oa/flow2/service/FlowMainService.java

@@ -1248,87 +1248,8 @@ public class FlowMainService implements BaseService<FlowMain, FlowMainExample> {
 //            判断流程是哪种流程
         String[] flowStep = null;
         {
-            if (flowMain.getFlowType().equals(ConstantFlowType.ADD_WORK)) {
-                flowStep = ConstantFlowType.ADD_WORK_FLOWSTEPS;
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.OFF_WORK)) {
-//
-//
-//                ApplyOffWorkTimeExample example = new ApplyOffWorkTimeExample();
-//                example.createCriteria().andOffWorkIdEqualTo(flowMain.getFormId());
-//                List<ApplyOffWorkTime> applyOffWorkTimes = applyOffWorkTimeService.selectByExample(example);
-//                BigDecimal hour_totalTiaoXiu = new BigDecimal(0);//所有调休假小时
-//                BigDecimal day_totalNianJia = new BigDecimal(0);//所有年假天数
-//                BigDecimal hour_totalShiJia = new BigDecimal(0);//所有事假天数
-//                BigDecimal day_total_BingJia_hunjia_chanjia_peichanjia_sangjia = new BigDecimal(0);//所有,4病假,5婚假,6产假,7陪产假,8丧假 ,最小为0.5天
-//
-//
-//
-//
-//
-//                    {
-//
-////            ApplyOffWork applyOffWork = modelService.selectByPrimaryKey(flowMainPush.getFormId());
-//                        for (ApplyOffWorkTime applyOffWorkTime : applyOffWorkTimes) {
-//                            {//修改请假表,将请假表的对应数据添加冻结时间,并减去可用时间
-//                                if (applyOffWorkTime.getOffWorkType().equals("1")) {//1年假
-//                                    day_totalNianJia = day_totalNianJia.add(new BigDecimal(applyOffWorkTime.getUseTime().toString()), MathContext.DECIMAL32);
-//                                } else if (applyOffWorkTime.getOffWorkType().equals("3")) {//3调休
-//                                    hour_totalTiaoXiu = hour_totalTiaoXiu.add(new BigDecimal(applyOffWorkTime.getUseTime().toString()), MathContext.DECIMAL32);
-//                                } else if (applyOffWorkTime.getOffWorkType().equals("2")) {//2事假
-//                                    hour_totalShiJia = hour_totalShiJia.add(new BigDecimal(applyOffWorkTime.getUseTime().toString()), MathContext.DECIMAL32);
-//                                } else if (applyOffWorkTime.getOffWorkType().equals("4") || applyOffWorkTime.getOffWorkType().equals("4")||applyOffWorkTime.getOffWorkType().equals("5") || applyOffWorkTime.getOffWorkType().equals("5")
-//                                        ||applyOffWorkTime.getOffWorkType().equals("6") || applyOffWorkTime.getOffWorkType().equals("6")||applyOffWorkTime.getOffWorkType().equals("7") || applyOffWorkTime.getOffWorkType().equals("7")
-//                                        ||applyOffWorkTime.getOffWorkType().equals("8") || applyOffWorkTime.getOffWorkType().equals("8")) {//4病假,5婚假,6产假,7陪产假,8丧假 ,最小为0.5天
-//                                    day_total_BingJia_hunjia_chanjia_peichanjia_sangjia = day_total_BingJia_hunjia_chanjia_peichanjia_sangjia.add(new BigDecimal(applyOffWorkTime.getUseTime().toString()), MathContext.DECIMAL32);
-//                                }
-//                            }
-//                        }
-//                    }
-//                    //添加判断条件
-//                    HashMap<String, Object> feeMoneyTotalMap = new HashMap<>();
-//                    if (hour_totalTiaoXiu.doubleValue() > 0 && day_totalNianJia.doubleValue() <= 0 && hour_totalShiJia.doubleValue() <= 0 && day_total_BingJia_hunjia_chanjia_peichanjia_sangjia.doubleValue() <= 0) {
-//                        //假别仅有调休假
-//
-//                        feeMoneyTotalMap.put("isExchangeOnly", "yes");
-//                        feeMoneyTotalMap.put("applyDay", 0);
-//                        flowStep = ConstantFlowType.OFF_WORK_FLOWSTEPS_noenough;
-//                    } else {
-//                        BigDecimal addDay = hour_totalTiaoXiu.add(hour_totalShiJia).divide(new BigDecimal(ConstantFlowType.ONE_DAY_TIME), 2, BigDecimal.ROUND_HALF_UP);
-//                        if (addDay.add(day_totalNianJia).add(day_total_BingJia_hunjia_chanjia_peichanjia_sangjia).doubleValue() > 3) {
-////            假期天数合计>3天
-//                            feeMoneyTotalMap.put("isExchangeOnly", "no");
-//                            feeMoneyTotalMap.put("applyDay", 4);
-//                            flowStep = ConstantFlowType.OFF_WORK_FLOWSTEPS_enough;
-//                        } else {
-//                            feeMoneyTotalMap.put("isExchangeOnly", "no");
-//                            feeMoneyTotalMap.put("applyDay", 0);
-//                            flowStep = ConstantFlowType.OFF_WORK_FLOWSTEPS_noenough2;
-//                        }
-//                    }
-
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.PAYMEN)) {
-                flowStep = ConstantFlowType.PAYMEN_FLOWSTEPS;
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.USE_MONEY)) {
-//                ApplyUseMoneyDetailExample example = new ApplyUseMoneyDetailExample();
-//                example.createCriteria().andUseMoneyIdEqualTo(flowMain.getFormId());
-//                List<ApplyUseMoneyDetail> applyUseMoneyDetails = applyUseMoneyDetailService.selectByExample(example);
-//                // 付款总金额
-//                BigDecimal feeMoneyTotal = new BigDecimal(0);
-//                for (ApplyUseMoneyDetail applyUseMoneyDetail : applyUseMoneyDetails) {
-//                    BigDecimal feeMoney = applyUseMoneyDetail.getFeeMoney() == null ? new BigDecimal(0) : applyUseMoneyDetail.getFeeMoney();
-//                    feeMoneyTotal = feeMoneyTotal.add(feeMoney, MathContext.DECIMAL32);
-//                }
-//                double feeMoneyTotalDouble = feeMoneyTotal.doubleValue();
-//                //添加判断条件
-////                HashMap<String, Object> conditionMap = new HashMap<>();
-////                conditionMap.put("billMoney", feeMoneyTotalDouble);
-//                if (feeMoneyTotalDouble < 3000) {
-//                    flowStep = ConstantFlowType.USE_MONEY_FLOWSTEPS_noenough;
-//                } else {
-//                    flowStep = ConstantFlowType.USE_MONEY_FLOWSTEPS_enough;
-//                }
-            } else if (flowMain.getFlowType().equals(ConstantFlowType.PURCHASE_WORK)){
-                flowStep = ConstantFlowType.PURCHASE_WORK_FLOW_STEPS;
+            if (flowMain.getFlowType().equals(ConstantFlowType.PAYMENT)) {
+                flowStep = ConstantFlowType.PAYMENT_FLOWSTEPS;
             }
         }
 

+ 38 - 0
pro-base/src/main/java/com/idea/oa/searchuser/CheckBizUserController.java

@@ -0,0 +1,38 @@
+package com.idea.oa.searchuser;
+
+import com.rockstar.biz.model.BizUser;
+import com.rockstar.biz.model.BizUserExample;
+import com.rockstar.biz.service.BizUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 暂用- bizUser用户名重复校验
+ */
+@RestController
+@RequestMapping("captcha")
+@Validated
+public class CheckBizUserController {
+
+    @Autowired
+    private BizUserService bizUserService;
+
+    @PostMapping(value = "checkBizUserByBizUserName",produces = {"application/json;charset=UTF-8"})
+    public Object getBizUserByBizUserName(String userName) {
+        BizUserExample bizUserExample = new BizUserExample();
+        bizUserExample.createCriteria().andUsernameEqualTo(userName);
+        List<BizUser> bizUsers = bizUserService.selectByExample(bizUserExample);
+        if(bizUsers!=null&&bizUsers.size()>0){
+            return 0;
+        }else {
+            return 1;
+        }
+
+    }
+
+}

+ 50 - 0
pro-base/src/main/java/com/idea/oa/searchuser/FrameExclusiveUserController.java

@@ -0,0 +1,50 @@
+package com.idea.oa.searchuser;
+
+import com.rockstar.common.base.BaseController;
+import com.rockstar.shiro.util.ShiroUtils;
+import com.rockstar.util.ResponseUtil;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * 2021.7.15
+ */
+@Controller
+@RequestMapping(value = "FrameExclusiveUserController")
+@Api(value="用户页面专属配置")
+public class FrameExclusiveUserController extends BaseController {
+
+    //主表
+    @Autowired
+    private FrameExclusiveUserService modelService;
+
+
+    @Autowired
+    private FrameRoleDataUserExtendService frameRoleDataUserExtendService;
+
+
+    @PostMapping(value = "getUserListGroupType",produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public Object getUserListGroupType(String groupType,String groupId) {
+        if(!frameRoleDataUserExtendService.userHasRole(ShiroUtils.getUserId(),"GROUPCG")){
+            groupId = ShiroUtils.getUser().getGroupId();
+        }
+        return ResponseUtil.ok(modelService.getUserListGroupType(groupType,groupId));
+    }
+
+    @PostMapping(value = "getBizUserList",produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public Object getBizUserList() {
+        return ResponseUtil.ok(modelService.getBizUserList());
+    }
+
+    @PostMapping(value = "getUserBranch",produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public Object getUserBranch() {
+        return ResponseUtil.ok(modelService.getUserBranch(ShiroUtils.getUserId()));
+    }
+}

+ 266 - 0
pro-base/src/main/java/com/idea/oa/searchuser/FrameExclusiveUserService.java

@@ -0,0 +1,266 @@
+package com.idea.oa.searchuser;
+
+import com.rockstar.biz.model.BizMain;
+import com.rockstar.biz.model.BizUser;
+import com.rockstar.biz.service.BizMainService;
+import com.rockstar.biz.service.BizUserService;
+import com.rockstar.frame.model.FramePost;
+import com.rockstar.frame.model.FrameUser;
+import com.rockstar.frame.model.FrameUserExample;
+import com.rockstar.frame.service.FramePostService;
+import com.rockstar.frame.service.FrameUserService;
+import com.rockstar.shiro.util.ShiroUtils;
+import com.rockstar.system.model.SysDept;
+import com.rockstar.system.service.SysDeptService;
+import com.rockstar.util.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+@Service
+public class FrameExclusiveUserService {
+
+    //文件mapper
+    @Autowired
+    private SysDeptService sysDeptService;
+    @Autowired
+    private FrameUserService frameUserService;
+    @Autowired
+    private FramePostService framePostService;
+
+    @Autowired
+    private BizMainService bizMainService;
+
+    @Autowired
+    private BizUserService bizUserService;
+
+    //按组织
+    public List<Map<String, Object>> deptRecursion(String parentid,String groupId){
+        List<Map<String, Object>> result = new ArrayList<>();
+        SysDept reqData = new SysDept();
+        reqData.setGroupId(groupId);
+        reqData.setParentId(parentid);
+        List<SysDept> deptList = sysDeptService.listAll(reqData);
+        FrameUser fuser = null;
+        if(deptList.size() > 0){
+            for (SysDept sysDept : deptList) {
+                //部门
+                Map<String, Object> dept = new HashMap<>();
+                dept.put("id", sysDept.getId());
+                dept.put("label", sysDept.getDeptName());
+                dept.put("selectType", false);
+                dept.put("children", deptRecursion(sysDept.getId(),groupId));
+                result.add(dept);
+
+            }
+            //人员
+            fuser = new FrameUser();
+            fuser.setDelFlag("0");
+            fuser.setStatus("1");
+            fuser.setDepartment(parentid);
+            List<FrameUser> userList = frameUserService.listAll(fuser, null);
+            if (userList.size() > 0) {
+                for (FrameUser frameUser : userList) {
+                    Map<String, Object> user = new HashMap<>();
+                    user.put("id", frameUser.getId());
+                    user.put("label", frameUser.getTruename());
+                    user.put("selectType", true);
+                    result.add(user);
+                }
+            }
+        } else {
+            //人员
+            fuser = new FrameUser();
+            fuser.setDelFlag("0");
+            fuser.setStatus("1");
+            fuser.setGroupId(groupId);
+            fuser.setDepartment(parentid);
+            List<FrameUser> userList = frameUserService.listAll(fuser, null);
+            if (userList.size() > 0) {
+                for (FrameUser frameUser : userList) {
+                    Map<String, Object> user = new HashMap<>();
+                    user.put("id", frameUser.getId());
+                    user.put("label", frameUser.getTruename());
+                    user.put("selectType", true);
+                    result.add(user);
+                }
+            }
+        }
+        return result;
+    }
+
+
+
+    //按岗位
+    public List<Map<String, Object>> postRecursion(String groupId){
+        List<Map<String, Object>> result = new ArrayList<>();
+        FramePost reqDate = new FramePost();
+        reqDate.setStatus("0");
+        reqDate.setGroupId(groupId);
+        List<FramePost> postList = framePostService.listAll(reqDate, null);
+        for (FramePost framePost : postList) {
+            Map<String, Object> post = new HashMap<>();
+            post.put("id", framePost.getId());
+            post.put("label", framePost.getPostName());
+            post.put("selectType", false);
+            //组织人员
+            FrameUser postFrameUser = new FrameUser();
+            postFrameUser.setDelFlag("0");
+            postFrameUser.setStatus("1");
+            postFrameUser.setGroupId(groupId);
+            postFrameUser.setPosts(framePost.getId());
+            List<FrameUser> userList = frameUserService.listAll(postFrameUser, framePost.getId());
+            if(userList.size()>0){
+                List<Map<String, Object>> children = new ArrayList<>();
+                for (FrameUser frameUser : userList) {
+                    Map<String, Object> user = new HashMap<>();
+                    user.put("id", frameUser.getId());
+                    user.put("label", frameUser.getTruename());
+                    user.put("selectType", true);
+                    children.add(user);
+                }
+                post.put("children", children);
+            }
+            result.add(post);
+        }
+        return result;
+    }
+
+    //我的下属
+    public List<Map<String, Object>> userRecursion(FrameUser user){
+        List<Map<String, Object>> result = new ArrayList<>();
+        FrameUserExample reqDate = new FrameUserExample();
+        FrameUserExample.Criteria criteria = reqDate.createCriteria();
+        List<String> strings = frameUserService.genStaffUserIds(user.getId());
+        Iterator<String> iter = strings.iterator();
+        while (iter.hasNext()) {
+            String item = iter.next();
+            if (item.equals(user.getId())) {
+                iter.remove();
+            }
+        }
+        criteria.andStatusEqualTo("1");
+        criteria.andIdIn(strings);
+        List<FrameUser> userList = frameUserService.selectByExample(reqDate);
+        if(userList.size() > 0){
+            for (FrameUser frameUser : userList) {
+                Map<String, Object> userMap = new HashMap<>();
+                userMap.put("id", frameUser.getId());
+                userMap.put("label", frameUser.getTruename());
+                userMap.put("selectType", true);
+                result.add(userMap);
+            }
+            return result;
+        }else{
+            return null;
+        }
+    }
+
+    public List<Map<String, Object>> getUserListGroupType(String groupType,String groupId) {
+        List<Map<String, Object>> result = new ArrayList<>();
+        List<Map<String, Object>>  all = new ArrayList<>();
+        Map<String,Object> allMap = new HashMap<>();
+        allMap.put("id", "0");
+        allMap.put("label", "全部");
+        allMap.put("selectType", false);
+        if("1".equals(groupType)){ //按组织
+            all = deptRecursion("0",groupId);
+            allMap.put("children", all);
+            result.add(allMap);
+        }else if("2".equals(groupType)){
+            //按岗位
+            all = postRecursion(groupId);
+            allMap.put("children", all);
+            result.add(allMap);
+        }else if("3".equals(groupType)){
+            //我的下属
+            FrameUser nowUser = frameUserService.selectByPrimaryKey(ShiroUtils.getUserId());
+            if(null != nowUser){
+                all = userRecursion(nowUser);
+                allMap.put("children", all);
+                result.add(allMap);
+            }
+        }else if("4".equals(groupType)){
+            //我的部门
+            FrameUser nowUser = frameUserService.selectByPrimaryKey(ShiroUtils.getUserId());
+            if(null != nowUser){
+                if(StringUtils.isNotBlank(nowUser.getDepartment())){
+                    all = deptRecursion(nowUser.getDepartment(),groupId);
+                    allMap.put("children", all);
+                    result.add(allMap);
+                }
+            }
+        }
+        return result;
+    }
+
+    public List<Map<String, Object>> getBizUserList(){
+        List<Map<String, Object>> result = new ArrayList<>();
+        List<BizMain> bizMains = bizMainService.listAll(new BizMain());
+        List<BizUser> bizUsers = bizUserService.listAll(new BizUser());
+        List<Map<String, Object>>  all = new ArrayList<>();
+        for(BizMain bizMain:bizMains){
+            Map<String, Object> userMap = new HashMap<>();
+            userMap.put("id", bizMain.getId());
+            userMap.put("label", bizMain.getBusinessName());
+            userMap.put("selectType", false);
+            userMap.put("children", bizUserList(bizUsers,bizMain.getId()));
+            all.add(userMap);
+        }
+        Map<String,Object> allMap = new HashMap<>();
+        allMap.put("id", "0");
+        allMap.put("label", "全部");
+        allMap.put("selectType", false);
+        allMap.put("children", all);
+        result.add(allMap);
+        return result;
+    }
+
+    public List<Map<String, Object>> bizUserList(List<BizUser> bizUsers,String bizMainId){
+        List<Map<String, Object>> result = new ArrayList<>();
+        for(BizUser bizUser:bizUsers){
+            if(bizUser.getMainId().equals(bizMainId)){
+                Map<String,Object> user = new HashMap<>();
+                user.put("id", bizUser.getId());
+                user.put("label", bizUser.getDispName());
+                user.put("selectType", true);
+                result.add(user);
+            }
+        }
+        return result;
+    }
+
+    // 获取我及我的下属id
+    public List<String> getMyBelow(List<String> users, String userId){
+        users.add(userId);
+        FrameUserExample example = new FrameUserExample();
+        example.createCriteria().andLeaderEqualTo(userId).andDelFlagEqualTo("0").andStatusEqualTo("1");
+        List<FrameUser> userList = frameUserService.selectByExample(example);
+        if(null == userList || null == userList)
+            return users;
+        for (FrameUser user : userList) {
+            getMyBelow(users, user.getId());
+        }
+        return users;
+    }
+
+    // 获取我的直系下属
+    public List<FrameUser> getUserBranch(String userId){
+        FrameUserExample example = new FrameUserExample();
+        example.createCriteria().andLeaderEqualTo(userId).andStatusEqualTo("1");
+        List<FrameUser> userList = frameUserService.selectByExample(example);
+        return userList;
+    }
+
+    // 获取我的所有下属
+    public void getUserBranchAll(String userId, List<String> userList){
+        FrameUserExample example = new FrameUserExample();
+        example.createCriteria().andLeaderEqualTo(userId).andStatusEqualTo("1");
+        List<FrameUser> users = frameUserService.selectByExample(example);
+        for (FrameUser user : users) {
+            userList.add(user.getId());
+            getUserBranchAll(user.getId(), userList);
+        }
+    }
+}

+ 67 - 0
pro-base/src/main/java/com/idea/oa/searchuser/FrameRoleDataUserExtendService.java

@@ -0,0 +1,67 @@
+package com.idea.oa.searchuser;
+
+import com.rockstar.frame.model.*;
+import com.rockstar.frame.service.FrameRoleDataService;
+import com.rockstar.frame.service.FrameRoleDataUserService;
+import com.rockstar.frame.service.FrameUserService;
+import com.rockstar.shiro.util.ShiroUtils;
+import com.rockstar.util.StringUtils;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class FrameRoleDataUserExtendService {
+    @Autowired
+    private FrameRoleDataUserService frameRoleDataUserService;
+
+    @Autowired
+    private FrameRoleDataService frameRoleDataService;
+    @Autowired
+    private FrameUserService frameUserService;
+
+    //人员是否有权限
+    public boolean userHasRole(String userId,String roleKey){
+        List<String> roleIds = frameRoleDataUserService.selectRoleDataByUserId(userId);
+        if(roleIds!=null&&roleIds.size()>0){
+            FrameRoleDataExample frameRoleDataExample = new FrameRoleDataExample();
+            frameRoleDataExample.createCriteria().andIdIn(roleIds);
+            List<FrameRoleData> frameRoleData = frameRoleDataService.selectByExample(frameRoleDataExample);
+            List<String>  roleKeys = frameRoleData.stream().map(FrameRoleData::getRoleKey).collect(Collectors.toList());
+            if(roleKeys.contains(roleKey)){
+                return true;
+            }else{
+                return false;
+            }
+        }else{
+            return false;
+        }
+    }
+
+    //获取人员根据角色
+    public List<String> userByRole(String groupId,List<String> roleKeys){
+        List<String> collect = new ArrayList<>();
+        FrameRoleDataExample frameRoleDataExample = new FrameRoleDataExample();
+        frameRoleDataExample.createCriteria().andRoleTypeEqualTo("DATA").andRoleKeyIn(roleKeys);
+        List<FrameRoleData> frameRoleData = frameRoleDataService.selectByExample(frameRoleDataExample);
+        List<String>  roleIds = frameRoleData.stream().map(FrameRoleData::getId).collect(Collectors.toList());
+        FrameRoleDataUserExample frameRoleDataUserExample = new FrameRoleDataUserExample();
+        frameRoleDataUserExample.createCriteria().andRoleDataIdIn(roleIds);
+        List<FrameRoleDataUser> frameRoleDataUsers = frameRoleDataUserService.selectByExample(frameRoleDataUserExample);
+        if(CollectionUtils.isNotEmpty(frameRoleDataUsers)){
+            List<String>  userIds = frameRoleDataUsers.stream().map(FrameRoleDataUser::getUserId).collect(Collectors.toList());
+            if(CollectionUtils.isNotEmpty(userIds)){
+                FrameUserExample frameUserExample = new FrameUserExample();
+                frameUserExample.createCriteria().andGroupIdEqualTo(StringUtils.isNotEmpty(groupId)?groupId:ShiroUtils.getUser().getGroupId()).andStatusEqualTo("1");
+                List<FrameUser> frameUserList = frameUserService.selectByExample(frameUserExample);
+                List<String> collect1 = frameUserList.stream().map(FrameUser::getId).collect(Collectors.toList());
+                collect = collect1.stream().filter(userIds::contains).collect(Collectors.toList());
+            }
+        }
+        return collect;
+    }
+}

+ 69 - 0
pro-base/src/main/java/com/idea/util/FileZtController.java

@@ -0,0 +1,69 @@
+package com.idea.util;
+
+import com.rockstar.common.domain.AjaxResult;
+import com.rockstar.frame.model.FrameData;
+import com.rockstar.frame.model.FrameDataExample;
+import com.rockstar.frame.service.FrameDataService;
+import com.rockstar.util.StringUtils;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.*;
+
+/**
+ * 自用文件相关的方法
+ */
+@Controller
+@RequestMapping(value = "FileZtController")
+@Api(value = "文件相关信息")
+public class FileZtController {
+    @Autowired
+    private FrameDataService frameDataService;
+
+    /**
+     * 通过文件id获取文件的文件名,创建时间的信息
+     *
+     * @param ids
+     * @param response
+     * @param request
+     */
+    @PostMapping(value = "findFileInfoByIds/{ids}",produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public AjaxResult findFileInfoByIds(@PathVariable("ids") String ids, HttpServletResponse response, HttpServletRequest request) {
+        System.out.println("findFileInfoByIds start");
+        //        for (String id : split) {
+//            FrameData frameData = frameDataService.selectByPrimaryKey(id);
+//            HashMap<String,Object> map=new HashMap<>();
+//            map.put("fileName", frameData.getFileName());
+//            map.put("createdAt",frameData.getCreatedAt());
+//            map.put("id",id);
+//        }
+        if (StringUtils.isEmpty(ids)) {
+            return AjaxResult.error("请传入文件id");
+        }
+        String[] split = ids.split(",");
+        FrameDataExample example = new FrameDataExample();
+        example.setOrderByClause("created_at");
+        example.createCriteria().andIdIn(Arrays.asList(split));
+        List<FrameData> frameDatas = frameDataService.selectByExample(example);
+        ArrayList<Map<String, Object>> list_map = new ArrayList<>();
+       Map<String, Object> map=null;
+        for (FrameData frameData : frameDatas) {
+         map = new HashMap<>();
+            map.put("fileName", frameData.getFileName());
+            map.put("createdAt", frameData.getCreatedAt());
+            map.put("id", frameData.getId());
+            list_map.add(map);
+        }
+
+
+        return AjaxResult.success(list_map);
+    }
+}

+ 63 - 7
pro-main/src/main/resources/processes/applyPayment.bpmn

@@ -3,16 +3,32 @@
   <process id="applyPayment" name="付款申请" processType="None" isClosed="false" isExecutable="true">
     <startEvent id="_2" name="发起申请" />
     <endEvent id="_26" name="结束" />
-    <userTask id="_34" name="经办人" activiti:candidateGroups="curr_user" />
+    <userTask id="_34" name="经办人" activiti:candidateGroups="curr_user">
+      <incoming>Flow_1u7oj37</incoming>
+    </userTask>
     <sequenceFlow id="_35" sourceRef="_2" targetRef="_34" />
-    <userTask id="_3" name="部门负责人" activiti:assignee="${userId}" activiti:candidateGroups="dept_superior_1_0_1" />
+    <userTask id="_3" name="部门负责人" activiti:assignee="${userId}" activiti:candidateGroups="dept_head_1_0_1">
+      <incoming>Flow_0tf77t6</incoming>
+      <outgoing>Flow_1u7oj37</outgoing>
+    </userTask>
     <sequenceFlow id="_4" name="申请" sourceRef="_34" targetRef="_3">
       <conditionExpression xsi:type="tFormalExpression">${agree=='yes'}</conditionExpression>
     </sequenceFlow>
-    <userTask id="_5" name="财务负责人" activiti:assignee="${userId}" activiti:candidateGroups="dept_head_1_0_1" />
-    <userTask id="_6" name="分管领导" activiti:assignee="${userId}" activiti:candidateGroups="flow_fgld_1_0_1" />
-    <userTask id="_7" name="总经理" activiti:assignee="${userId}" activiti:candidateGroups="flow_sjfgld_1_0_1" />
-    <userTask id="_9" name="董事长" activiti:assignee="${userId}" activiti:candidateGroups="flow_zyld_1_0_1" />
+    <userTask id="_5" name="财务负责人" activiti:assignee="${userId}" activiti:candidateGroups="flow_cwld_1_0_1">
+      <incoming>Flow_0sq564u</incoming>
+      <outgoing>Flow_0tf77t6</outgoing>
+    </userTask>
+    <userTask id="_6" name="分管领导" activiti:assignee="${userId}" activiti:candidateGroups="flow_fgld_1_0_1">
+      <incoming>Flow_1yk6pxs</incoming>
+      <outgoing>Flow_0sq564u</outgoing>
+    </userTask>
+    <userTask id="_7" name="总经理" activiti:assignee="${userId}" activiti:candidateGroups="flow_sjfgld_1_0_1">
+      <incoming>Flow_0huyir4</incoming>
+      <outgoing>Flow_1yk6pxs</outgoing>
+    </userTask>
+    <userTask id="_9" name="董事长" activiti:assignee="${userId}" activiti:candidateGroups="flow_zyld_1_0_1">
+      <outgoing>Flow_0huyir4</outgoing>
+    </userTask>
     <sequenceFlow id="_8" name="同意" sourceRef="_3" targetRef="_5">
       <conditionExpression xsi:type="tFormalExpression">${agree=='yes'}</conditionExpression>
     </sequenceFlow>
@@ -43,6 +59,21 @@
     <sequenceFlow id="_19" name="不同意" sourceRef="_9" targetRef="_34">
       <conditionExpression xsi:type="tFormalExpression">${agree=='no'}</conditionExpression>
     </sequenceFlow>
+    <sequenceFlow id="Flow_0tf77t6" sourceRef="_5" targetRef="_3">
+      <conditionExpression xsi:type="tFormalExpression">${agree=='back'}</conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="Flow_0sq564u" sourceRef="_6" targetRef="_5">
+      <conditionExpression xsi:type="tFormalExpression">${agree=='back'}</conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="Flow_1yk6pxs" sourceRef="_7" targetRef="_6">
+      <conditionExpression xsi:type="tFormalExpression">${agree=='back'}</conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="Flow_0huyir4" sourceRef="_9" targetRef="_7">
+      <conditionExpression xsi:type="tFormalExpression">${agree=='back'}</conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="Flow_1u7oj37" sourceRef="_3" targetRef="_34">
+      <conditionExpression xsi:type="tFormalExpression">${agree=='back'}</conditionExpression>
+    </sequenceFlow>
   </process>
   <bpmndi:BPMNDiagram id="Diagram-_1" name="New Diagram" documentation="background=#FFFFFF;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0">
     <bpmndi:BPMNPlane bpmnElement="applyPayment">
@@ -134,7 +165,7 @@
         <omgdi:waypoint x="1040" y="272.5" />
         <omgdi:waypoint x="1140" y="272.5" />
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds x="0" y="0" width="0" height="0" />
+          <omgdc:Bounds x="-11" y="0" width="23" height="14" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="BPMNEdge__13" bpmnElement="_13" sourceElement="_9" targetElement="_26">
@@ -184,6 +215,31 @@
           <omgdc:Bounds x="0" y="0" width="0" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0tf77t6_di" bpmnElement="Flow_0tf77t6">
+        <omgdi:waypoint x="521" y="295" />
+        <omgdi:waypoint x="468" y="320" />
+        <omgdi:waypoint x="413" y="295" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0sq564u_di" bpmnElement="Flow_0sq564u">
+        <omgdi:waypoint x="731" y="294" />
+        <omgdi:waypoint x="673" y="320" />
+        <omgdi:waypoint x="613" y="295" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1yk6pxs_di" bpmnElement="Flow_1yk6pxs">
+        <omgdi:waypoint x="931" y="292" />
+        <omgdi:waypoint x="880" y="310" />
+        <omgdi:waypoint x="824" y="299" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_0huyir4_di" bpmnElement="Flow_0huyir4">
+        <omgdi:waypoint x="1143" y="296" />
+        <omgdi:waypoint x="1090" y="320" />
+        <omgdi:waypoint x="1020" y="300" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1u7oj37_di" bpmnElement="Flow_1u7oj37">
+        <omgdi:waypoint x="331" y="293" />
+        <omgdi:waypoint x="275" y="320" />
+        <omgdi:waypoint x="217" y="297" />
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </definitions>