Pārlūkot izejas kodu

11482-【CR】【投资系统】增加审批流程-后端

hxy 3 mēneši atpakaļ
vecāks
revīzija
17b52abb66

+ 22 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/TerminationController.java

@@ -6,13 +6,16 @@ import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.flowable.service.IApprovalService;
 import com.ruoyi.flowable.service.IDecisionService;
+import com.ruoyi.flowable.service.IInvestmentOpportunityService;
 import com.ruoyi.flowable.service.ITerminationService;
 import com.ruoyi.invest.domain.*;
 import com.ruoyi.invest.domain.dto.DecisionDto;
 import com.ruoyi.invest.domain.dto.TerminationDto;
 import com.ruoyi.invest.domain.vo.ProjectDecisionVo;
 import com.ruoyi.invest.domain.vo.ProjectTerminationVo;
+import com.ruoyi.invest.service.ITProjectPoolService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,8 +37,26 @@ import java.util.List;
 public class TerminationController extends BaseController {
     @Autowired
     private ITerminationService terminationService;
+    @Autowired
+    private ITProjectPoolService tProjectPoolService;
+    @Autowired
+    private IInvestmentOpportunityService investmentOpportunityService;
 
-
+    /**
+     * 查询项目终止列表
+     */
+    @ApiOperation("查询项目终止列表")
+    @PreAuthorize("@ss.hasPermi('invest:pool:list')")
+    @GetMapping("/listTermination")
+    public TableDataInfo listTermination(TProjectPool tProjectPool)
+    {
+        startPage();
+        //tProjectPool.setProjectStage("8");
+        tProjectPool.setDelFlag("0");
+        //List<TProjectPool> list = tProjectPoolService.selectTProjectPoolList(tProjectPool);
+        List<TProjectPool> list = investmentOpportunityService.selectTProjectList(tProjectPool);
+        return getDataTable(list);
+    }
     //我的待办任务
     @ApiOperation("我的待办任务列表")
     @PreAuthorize("@ss.hasPermi('invest:pool:list')")

+ 1 - 0
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IInvestmentOpportunityService.java

@@ -18,6 +18,7 @@ import java.util.Map;
  */
 public interface IInvestmentOpportunityService
 {
+    List<TProjectPool> selectTProjectList(TProjectPool tProjectPool);
     List<TProjectPoolVo> getMyTaskList(String userId, TProjectPool tProjectPool);
     List<TProjectPoolVo> getMyDoneTaskList(String userId, TProjectPool tProjectPool);
     List<TProjectPoolVo> getMyList(String userId,TProjectPool tProjectPool);

+ 10 - 9
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/ApprovalServiceImpl.java

@@ -237,14 +237,12 @@ public class ApprovalServiceImpl extends FlowServiceFactory implements IApproval
         if (status) {
             TProjectPool tProjectPool=new TProjectPool();
             tProjectPool.setId(tProjectApproval.getProjectPoolId());
-            if("modifyApply".equals(task.getTaskDefinitionKey())){
-                // todo 保存立项资料
-                tUnifyFileService.insertTUnifyFileList(tProjectApproval.getListFile(),
-                        tProjectApproval.getProjectPoolId(),
-                        tProjectApproval.getId(),
-                        String.valueOf(FileType.APPROVAL.ordinal()),
-                        userInfo.getNickName());
-            }
+            // todo 保存立项资料
+            tUnifyFileService.insertTUnifyFileList(tProjectApproval.getListFile(),
+                    tProjectApproval.getProjectPoolId(),
+                    tProjectApproval.getId(),
+                    String.valueOf(FileType.APPROVAL.ordinal()),
+                    userInfo.getNickName());
             //发起会议
             if ("meeting".equals(task.getTaskDefinitionKey())) {
                 if(tProjectMeeting!=null&&StringUtils.isNotBlank(tProjectMeeting.getId())){
@@ -355,7 +353,7 @@ public class ApprovalServiceImpl extends FlowServiceFactory implements IApproval
             // 表示流程已经审批结束了
             if (processInstance == null) {
                 flow.setStatus(FlowStatusEnum.ENDED.getName());
-                if (!"modifyApply".equals(task.getTaskDefinitionKey())) {
+                if (!"modifyApply".equals(task.getTaskDefinitionKey())&&!"president".equals(task.getTaskDefinitionKey())) {
                     tProjectApproval.setStatus(3);
                     tProjectPool.setProjectStage("4");//项目阶段-尽调背调
                     tProjectPool.setProjectState("f");//项目状态-尽调背调
@@ -366,6 +364,9 @@ public class ApprovalServiceImpl extends FlowServiceFactory implements IApproval
                     tProjectPool.setProjectState("c");//项目状态-准备立项材料
                     tProjectPool.setApprovalFlag("0");
                     tProjectPool.setUpdateBy(userInfo.getNickName());
+                    if("president".equals(task.getTaskDefinitionKey())){
+                        tProjectApproval.setStatus(4);//关闭
+                    }
                 }
                 tProjectPoolService.updateTProjectPool(tProjectPool);
             }

+ 10 - 5
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/DecisionServiceImpl.java

@@ -6,20 +6,16 @@ import com.ruoyi.common.enums.FileType;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.common.utils.sms.SmsSenderUtils;
 import com.ruoyi.common.utils.uuid.IdUtils;
 import com.ruoyi.flowable.common.constant.ProcessConstants;
 import com.ruoyi.flowable.common.constant.UUIDGenerator;
 import com.ruoyi.flowable.common.enums.FlowStatusEnum;
 import com.ruoyi.flowable.factory.FlowServiceFactory;
-import com.ruoyi.flowable.service.IApprovalService;
 import com.ruoyi.flowable.service.IDecisionService;
 import com.ruoyi.flowable.service.IFlowInstanceService;
 import com.ruoyi.flowable.service.IFlowService;
 import com.ruoyi.invest.domain.*;
-import com.ruoyi.invest.domain.vo.ProjectApprovalVo;
 import com.ruoyi.invest.domain.vo.ProjectDecisionVo;
-import com.ruoyi.invest.mapper.ApprovalMapper;
 import com.ruoyi.invest.mapper.DecisionMapper;
 import com.ruoyi.invest.mapper.TProjectPoolMapper;
 import com.ruoyi.invest.mapper.TProjectScoringMapper;
@@ -253,6 +249,12 @@ public class DecisionServiceImpl extends FlowServiceFactory implements IDecision
         if (status) {
             TProjectPool tProjectPool=new TProjectPool();
             tProjectPool.setId(tProjectDecision.getProjectPoolId());
+            // todo 保存投决资料
+            tUnifyFileService.insertTUnifyFileList(tProjectDecision.getListFile(),
+                    tProjectDecision.getProjectPoolId(),
+                    tProjectDecision.getId(),
+                    String.valueOf(FileType.DECISION.ordinal()),
+                    userInfo.getNickName());
             //发起会议
             if ("meeting".equals(task.getTaskDefinitionKey())) {
                 tProjectMeeting.setId(IdUtils.fastSimpleUUID());
@@ -350,7 +352,7 @@ public class DecisionServiceImpl extends FlowServiceFactory implements IDecision
             // 表示流程已经审批结束了
             if (processInstance == null) {
                 flow.setStatus(FlowStatusEnum.ENDED.getName());
-                if (!"modifyApply".equals(task.getTaskDefinitionKey())) {
+                if (!"modifyApply".equals(task.getTaskDefinitionKey())&&!"president".equals(task.getTaskDefinitionKey())) {
                     tProjectDecision.setStatus(3);
                     tProjectPool.setProjectStage("6");//项目阶段-项目终止
                     tProjectPool.setProjectState("j");//项目状态-签约协议沟通中
@@ -361,6 +363,9 @@ public class DecisionServiceImpl extends FlowServiceFactory implements IDecision
                     tProjectPool.setProjectState("c");//项目状态-
                     tProjectPool.setDecisionFlag("0");
                     tProjectPool.setUpdateBy(userInfo.getNickName());
+                    if("president".equals(task.getTaskDefinitionKey())){
+                        tProjectDecision.setStatus(4);//关闭
+                    }
                 }
                 tProjectPoolService.updateTProjectPool(tProjectPool);
             }

+ 11 - 0
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/InvestmentOpportunityServiceImpl.java

@@ -73,6 +73,17 @@ public class InvestmentOpportunityServiceImpl extends FlowServiceFactory impleme
 
     @Autowired
     private IFlowService flowService;
+    /**
+     * 查询项目阶段为投资机会、项目立项、尽职背调、项目投决、并不是关闭的流程、并没有终止的项目列表
+     *
+     * @param tProjectPool 项目池
+     * @return 项目池
+     */
+    @Override
+    public List<TProjectPool> selectTProjectList(TProjectPool tProjectPool)
+    {
+        return investmentOpportunityMapper.selectTProjectList(tProjectPool);
+    }
     @Override
     public List<TProjectPoolVo> getMyTaskList(String userId, TProjectPool tProjectPool){
         return investmentOpportunityMapper.getMyTaskList(userId, tProjectPool);

+ 2 - 0
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/TerminationServiceImpl.java

@@ -249,6 +249,8 @@ public class TerminationServiceImpl extends FlowServiceFactory implements ITermi
             if (processInstance == null) {
                 flow.setStatus(FlowStatusEnum.ENDED.getName());
                 if (!"modifyApply".equals(task.getTaskDefinitionKey())) {
+                    //关闭该项目存在的流程(投资机会、项目立项、尽职背调、项目投决)
+
                     tProjectTermination.setStatus(3);
                     tProjectPool.setProjectStage("8");//项目阶段-项目终止
                     tProjectPool.setProjectState("p");//项目状态-终止通过

+ 2 - 1
ruoyi-system/src/main/java/com/ruoyi/invest/mapper/InvestmentOpportunityMapper.java

@@ -13,7 +13,8 @@ import java.util.List;
  * @date 2024-02-21
  */
 public interface InvestmentOpportunityMapper {
-
+    /*查询任务终止列表*/
+    List<TProjectPool> selectTProjectList(TProjectPool tProjectPool);
     /*待办任务*/
     List<TProjectPoolVo> getMyTaskList(@Param("userId") String userId,@Param("projectPool")TProjectPool tProjectPool);
     /*已办任务*/

+ 7 - 5
ruoyi-system/src/main/resources/mapper/invest/DecisionMapper.xml

@@ -64,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="getMyTaskList" resultMap="ProjectDecisionVoResult">
         select a.id,a.proc_inst_id, a.project_pool_id,tp.project_name, tp.industry,tp.project_stage,
         tp.project_state,tp.invest_head, a.participants_id,a.participants,
-        a.provision, a.remark, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,
+        a.provision, a.remark, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,a.status,
         p.PROC_INST_ID_ as 'procInsId',
         p.PROC_DEF_ID_ as 'procDefId',
         date_format(p.START_TIME_, '%Y-%m-%d %H:%i:%s') as 'applyTime',
@@ -102,11 +102,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         )
         and a.del_flag="0"
         <include refid="where_sql"></include>
+        order by a.create_time desc
     </select>
     <select id="getMyDoneTaskList" resultMap="ProjectDecisionVoResult">
         select a.id,a.proc_inst_id, a.project_pool_id,tp.project_name, tp.industry,tp.project_stage,
         tp.project_state,tp.invest_head,a.participants_id,a.participants,
-        a.provision, a.remark, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,
+        a.provision, a.remark, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,a.status,
         p.PROC_INST_ID_ as 'procInsId',
         p.PROC_DEF_ID_ as 'procDefId',
         date_format(p.START_TIME_, '%Y-%m-%d %H:%i:%s') as 'applyTime',
@@ -134,12 +135,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and a.del_flag="0"
         <include refid="where_sql"></include>
         GROUP BY a.id
-        ORDER BY ht.END_TIME_ DESC;
+        order by a.create_time desc
     </select>
     <select id="getMyList" resultMap="ProjectDecisionVoResult">
         select a.id,a.proc_inst_id, a.project_pool_id,tp.project_name, tp.industry,tp.project_stage,
         tp.project_state,tp.invest_head, a.participants_id, a.participants,
-        a.provision, a.remark, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,
+        a.provision, a.remark, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,a.status,
         u.nick_name as 'applyUserName',
         p.PROC_INST_ID_ as 'procInsId',
         p.PROC_DEF_ID_ as 'procDefId',
@@ -171,6 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and a.del_flag="0"
         <include refid="where_sql"></include>
         GROUP BY a.id
+        order by a.create_time desc
     </select>
     <!--<select id="selectTProjectPoolById" parameterType="String" resultMap="TProjectPoolResult">
         <include refid="selectTProjectPoolVo"/>
@@ -178,7 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>-->
     <select id="selectTProjectDecisionByProcInstId" parameterType="java.lang.String" resultMap="TProjectDecisionResult">
         select a.id,a.proc_inst_id, a.project_pool_id, a.participants_id,a.participants,
-               a.provision, a.remark, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,
+               a.provision, a.remark, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,a.need_meeting,
                t.TASK_DEF_KEY_ as 'taskDefKey'
         from t_project_decision a
         left join ACT_RU_TASK t on a.proc_inst_id = t.PROC_INST_ID_

+ 29 - 0
ruoyi-system/src/main/resources/mapper/invest/InvestmentOpportunityMapper.xml

@@ -214,6 +214,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="projectPool.projectState != null  and projectPool.projectState != ''"> and a.project_state = #{projectPool.projectState}</if>
         <if test="projectPool.delFlag != null  and projectPool.delFlag != ''"> and a.del_flag = #{projectPool.delFlag}</if>
     </sql>
+    <select id="selectTProjectList" parameterType="TProjectPool" resultMap="TProjectPoolResult">
+        <include refid="selectTProjectPoolVo"/>
+        <where>
+            a.project_state != '1'
+            <if test="projectName != null  and projectName != ''"> and a.project_name like concat('%', #{projectName}, '%')</if>
+            <if test="projectGroup != null  and projectGroup != ''"> and a.project_group = #{projectGroup}</if>
+            <if test="projectCode != null  and projectCode != ''"> and a.project_code = #{projectCode}</if>
+            <if test="channel != null  and channel != ''"> and a.channel = #{channel}</if>
+            <if test="contactDate != null "> and a.contact_date = #{contactDate}</if>
+            <if test="projectDate != null "> and a.project_date = #{projectDate}</if>
+            <if test="decisionDate != null "> and a.decision_date = #{decisionDate}</if>
+            <if test="industry != null  and industry != ''"> and a.industry = #{industry}</if>
+            <if test="company != null  and company != ''"> and b.company_name like concat('%', #{company}, '%')</if>
+            <if test="projectContacts != null  and projectContacts != ''"> and c.name like concat('%', #{projectContacts}, '%')</if>
+            <if test="investHead != null  and investHead != ''"> and a.invest_head like concat('%', #{investHead}, '%')</if>
+            <if test="previousFinancing != null  and previousFinancing != ''"> and a.previous_financing = #{previousFinancing}</if>
+            <if test="financingStage != null  and financingStage != ''"> and a.financing_stage = #{financingStage}</if>
+            <if test="financingMoney != null  and financingMoney != ''"> and a.financing_money = #{financingMoney}</if>
+            <if test="financingDate != null "> and a.financing_date = #{financingDate}</if>
+            <if test="investValuation != null  and investValuation != ''"> and a.invest_valuation = #{investValuation}</if>
+            <if test="investMoney != null  and investMoney != ''"> and a.invest_money = #{investMoney}</if>
+            <if test="investType != null  and investType != ''"> and a.invest_type = #{investType}</if>
+            <if test="investPloy != null  and investPloy != ''"> and a.invest_ploy = #{investPloy}</if>
+            <if test="investWorth != null  and investWorth != ''"> and a.invest_worth = #{investWorth}</if>
+            <if test="projectStage != null  and projectStage != ''"> and a.project_stage = #{projectStage}</if>
+            <if test="projectState != null  and projectState != ''"> and a.project_state = #{projectState}</if>
+            <if test="delFlag != null  and delFlag != ''"> and a.del_flag = #{delFlag}</if>
+        </where>
+    </select>
 
     <select id="getMyTaskList" resultMap="TProjectPoolVoResult">
         select a.id,a.proc_inst_id,a.project_name, d.channel_group project_group, a.record_date, a.project_code, a.channel, a.contact_date, a.project_date, a.decision_date, a.industry, a.company, a.description, a.project_contacts,

+ 7 - 4
ruoyi-system/src/main/resources/mapper/invest/TerminationMapper.xml

@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
 
+
         <result property="projectName"    column="project_name"    />
         <result property="industry"    column="industry"    />
         <result property="investHead"    column="invest_head"    />
@@ -99,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="getMyTaskList" resultMap="ProjectTerminationVoResult">
         select a.id,a.proc_inst_id, a.project_pool_id,tp.project_name, tp.industry,tp.project_stage,
         tp.project_state,tp.invest_head,a.reason,
-        a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,
+        a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,a.status,
         p.PROC_INST_ID_ as 'procInsId',
         p.PROC_DEF_ID_ as 'procDefId',
         date_format(p.START_TIME_, '%Y-%m-%d %H:%i:%s') as 'applyTime',
@@ -137,11 +138,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         )
         and a.del_flag="0"
         <include refid="where_sql"></include>
+        order by a.create_time desc
     </select>
     <select id="getMyDoneTaskList" resultMap="ProjectTerminationVoResult">
         select a.id,a.proc_inst_id, a.project_pool_id,tp.project_name, tp.industry,tp.project_stage,
         tp.project_state,tp.invest_head,a.reason,
-        a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,
+        a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,a.status,
         p.PROC_INST_ID_ as 'procInsId',
         p.PROC_DEF_ID_ as 'procDefId',
         date_format(p.START_TIME_, '%Y-%m-%d %H:%i:%s') as 'applyTime',
@@ -169,12 +171,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and a.del_flag="0"
         <include refid="where_sql"></include>
         GROUP BY a.id
-        ORDER BY ht.END_TIME_ DESC;
+        order by a.create_time desc
     </select>
     <select id="getMyList" resultMap="ProjectTerminationVoResult">
         select a.id,a.proc_inst_id, a.project_pool_id,tp.project_name, tp.industry,tp.project_stage,
         tp.project_state,tp.invest_head,a.reason,
-        a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,
+        a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time ,a.status,
         u.nick_name as 'applyUserName',
         p.PROC_INST_ID_ as 'procInsId',
         p.PROC_DEF_ID_ as 'procDefId',
@@ -206,6 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and a.del_flag="0"
         <include refid="where_sql"></include>
         GROUP BY a.id
+        order by a.create_time desc
     </select>
     <!--<select id="selectTProjectPoolById" parameterType="String" resultMap="TProjectPoolResult">
         <include refid="selectTProjectPoolVo"/>