瀏覽代碼

普通报销台账完善

chenjun 1 年之前
父節點
當前提交
5892c806aa

+ 3 - 3
client/src/views/OaSystem/financialManagement/ptbxPage/index.vue

@@ -123,16 +123,16 @@
           <el-table-column
             show-overflow-tooltip="true"
             align="center"
-            prop="xmjl"
+            prop="projectName"
             label="项目名称"
           />
           <el-table-column
             show-overflow-tooltip="true"
             align="center"
-            prop="lxsj"
+            prop="projectDeptName"
             label="项目部门"
           />
-          <el-table-column align="center" prop="yssj" label="状态" />
+          <el-table-column align="center" prop="status" label="状态" />
           <el-table-column align="center" label="操作" width="80">
             <template #default="scope">
               <div class="operateBtn" @click="operateClick(scope.row)">

+ 9 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/commoncost/controller/vo/CommonCostRespVO.java

@@ -18,4 +18,13 @@ public class CommonCostRespVO extends CommonCostBaseVO{
 
     @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4d5927b4014fbb98bf65f47a0f2bc28b")
     private String id;
+
+    @Schema(description = "项目名称")
+    private String projectName;
+
+    @Schema(description = "项目部门")
+    private String projectDeptName;
+
+    @Schema(description = "状态")
+    private String status;
 }

+ 6 - 3
zjugis-business/src/main/java/com/zjugis/business/flow/commoncost/dao/CommonCostDao.java

@@ -7,8 +7,7 @@ import com.zjugis.framework.mybatis.core.mapper.BaseMapperX;
 import com.zjugis.framework.mybatis.core.query.LambdaQueryWrapperX;
 import org.apache.ibatis.annotations.Mapper;
 
-import java.util.List;
-
+import static com.zjugis.business.constants.FlowStatusConstants.*;
 /**
  * @Author 陈俊
  * @Date 2023/12/12 11:13
@@ -16,11 +15,15 @@ import java.util.List;
  */
 @Mapper
 public interface CommonCostDao extends BaseMapperX<CommonCostDO> {
+
+
     default CommonCostDO findByInstanceId(String flowInstanceId) {
         return selectOne(new LambdaQueryWrapperX<CommonCostDO>().eqIfPresent(CommonCostDO::getInstanceId, flowInstanceId));
     }
 
     default PageResult<CommonCostDO> getCommonCostPage(CommonCostPageReqVO reqVO) {
-        return selectPage(reqVO, new LambdaQueryWrapperX<CommonCostDO>().orderByDesc(CommonCostDO::getApplyTime));
+        return selectPage(reqVO, new LambdaQueryWrapperX<CommonCostDO>()
+                .in(CommonCostDO::getFlowStatus, FLOW_FINISHED,FLOW_PROCESS)
+                .orderByDesc(CommonCostDO::getApplyTime));
     }
 }

+ 20 - 2
zjugis-business/src/main/java/com/zjugis/business/flow/commoncost/service/CommonCostServiceImpl.java

@@ -23,6 +23,7 @@ import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
 import com.zjugis.framework.workflow.utils.zTree;
 import com.zjugis.module.system.api.company.CompanyApi;
 import com.zjugis.module.system.api.company.dto.CompanyRespDTO;
+import com.zjugis.module.system.api.dept.DeptApi;
 import com.zjugis.module.system.api.dict.DictDataApi;
 import com.zjugis.module.system.api.dict.dto.DictDataRespDTO;
 import com.zjugis.module.system.api.user.AdminUserApi;
@@ -35,6 +36,7 @@ import javax.annotation.Resource;
 import java.time.LocalDateTime;
 import java.util.*;
 
+import static com.zjugis.business.constants.FlowStatusConstants.*;
 import static com.zjugis.business.enums.ErrorCodeConstants.COMMON_COST_NOT_EXISTS;
 import static com.zjugis.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static com.zjugis.framework.common.util.collection.CollectionUtils.convertSet;
@@ -80,7 +82,7 @@ public class CommonCostServiceImpl implements CommonCostService {
                 entity.setCommonCostNo(flowInstance.getCode());
                 entity.setApplyTime(LocalDateTime.now());
                 entity.setCreateTime(LocalDateTime.now());
-                entity.setFlowStatus(FlowStatusConstants.FLOW_NOT_START);
+                entity.setFlowStatus(FLOW_NOT_START);
                 CommonResult<AdminUserRespDTO> result = adminUserApi.getUser(userId);
                 if (result.isSuccess()) {
                     entity.setUserNickname(result.getData().getNickname());
@@ -178,6 +180,22 @@ public class CommonCostServiceImpl implements CommonCostService {
     @Override
     public PageResult<CommonCostRespVO> getCommonCostPage(CommonCostPageReqVO listVO) {
         PageResult<CommonCostDO> pageResult = commonCostDao.getCommonCostPage(listVO);
-        return CommonCostConvert.INSTANCE.convertPage(pageResult);
+        PageResult<CommonCostRespVO> commonCostRespVOPageResult = CommonCostConvert.INSTANCE.convertPage(pageResult);
+        List<CommonCostRespVO> resultList = commonCostRespVOPageResult.getList();
+        Set<String> projectIds = convertSet(resultList, CommonCostRespVO::getProjectId);
+        List<Project> projectList = projectService.selectByIds(projectIds);
+        resultList.forEach(commonCostRespVO -> {
+            Project projectDO = projectList.stream().filter(project -> project.getId().equals(commonCostRespVO.getProjectId())).findFirst().get();
+            commonCostRespVO.setProjectName(projectDO.getXmmc());
+            commonCostRespVO.setProjectDeptName(projectDO.getZrbm());
+            Integer flowStatus = commonCostRespVO.getFlowStatus();
+            if(FLOW_FINISHED==flowStatus){
+                commonCostRespVO.setStatus("已报");
+            }
+            if(FLOW_PROCESS==flowStatus){
+                commonCostRespVO.setStatus("办理中");
+            }
+        });
+        return commonCostRespVOPageResult;
     }
 }

+ 3 - 0
zjugis-business/src/main/java/com/zjugis/business/service/ProjectService.java

@@ -9,6 +9,7 @@ import com.zjugis.business.bean.response.ProjectCalculateResponse;
 import com.zjugis.business.bean.response.ProjectResponse;
 
 import java.util.List;
+import java.util.Set;
 
 /**
  * 项目表(Project)表服务接口
@@ -24,6 +25,8 @@ public interface ProjectService {
 
     Project selectById(String id);
 
+    List<Project> selectByIds(Set<String> ids);
+
     Project selectByInstanceId(String id);
 
     ProjectResponse selectWithChildren(String id);

+ 6 - 0
zjugis-business/src/main/java/com/zjugis/business/service/impl/ProjectServiceImpl.java

@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.Set;
 
 /**
  * 项目表(Project)表服务实现类
@@ -44,6 +45,11 @@ public class ProjectServiceImpl implements ProjectService {
         return projectMapper.selectById(id);
     }
 
+    @Override
+    public List<Project> selectByIds(Set<String> ids) {
+        return projectMapper.selectBatchIds(ids);
+    }
+
     /**
      * @param id
      * @return