Эх сурвалжийг харах

Merge remote-tracking branch 'origin/dev' into dev

yangdamao 2 жил өмнө
parent
commit
9d3f303095
15 өөрчлөгдсөн 144 нэмэгдсэн , 4 устгасан
  1. 12 0
      zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/financial/TopCostInstTpController.java
  2. 9 0
      zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/top/TopInstitutionController.java
  3. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/bo/TopCostInstTpItemQueryBo.java
  4. 8 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/mapper/TopCostInstTpItemMapper.java
  5. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/service/ITopCostInstTpItemService.java
  6. 16 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/service/impl/TopCostInstTpItemServiceImpl.java
  7. 9 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/service/impl/TopCostInstTpServiceImpl.java
  8. 4 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/vo/TopCostInstTpVo.java
  9. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/bo/TopInstitutionQueryBo.java
  10. 5 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/mapper/TopInstitutionMapper.java
  11. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/ITopInstitutionService.java
  12. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/impl/TopInstitutionServiceImpl.java
  13. 50 0
      zhongzheng-system/src/main/resources/mapper/modules/top/TopCostInstTpItemMapper.xml
  14. 3 0
      zhongzheng-system/src/main/resources/mapper/modules/top/TopCostInstTpMapper.xml
  15. 13 1
      zhongzheng-system/src/main/resources/mapper/modules/top/TopInstitutionMapper.xml

+ 12 - 0
zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/financial/TopCostInstTpController.java

@@ -4,8 +4,10 @@ import java.util.List;
 import java.util.Arrays;
 
 import com.zhongzheng.modules.top.financial.bo.*;
+import com.zhongzheng.modules.top.financial.service.ITopCostInstTpItemService;
 import com.zhongzheng.modules.top.financial.service.ITopCostInstTpService;
 import com.zhongzheng.modules.top.financial.vo.TopCostInstTpVo;
+import com.zhongzheng.modules.top.goods.vo.TopCourseEducationTypeVo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,6 +42,8 @@ public class TopCostInstTpController extends BaseController {
 
     private final ITopCostInstTpService iTopCostInstTpService;
 
+    private final ITopCostInstTpItemService iTopCostInstTpItemService;
+
     /**
      * 查询供应商成本模板列表
      */
@@ -52,6 +56,14 @@ public class TopCostInstTpController extends BaseController {
         return getDataTable(list);
     }
 
+    @ApiOperation("查询供应商成本模板所有业务层次列表")
+    @PreAuthorize("@ss.hasPermi('system:tp:list')")
+    @GetMapping("/businessList")
+    public AjaxResult<List<TopCourseEducationTypeVo>> businessList(TopCostInstTpItemQueryBo bo) {
+        List<TopCourseEducationTypeVo> list = iTopCostInstTpItemService.queryEduList(bo);
+        return AjaxResult.success(list);
+    }
+
 
     /**
      * 获取供应商成本模板详细信息

+ 9 - 0
zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/top/TopInstitutionController.java

@@ -55,6 +55,15 @@ public class TopInstitutionController extends BaseController {
         return getDataTable(list);
     }
 
+    @ApiOperation("成本分类查询职能机构列表")
+    @PreAuthorize("@ss.hasPermi('system:institution:list')")
+    @GetMapping("/listByCat")
+    public TableDataInfo<TopInstitutionVo> listByCat(TopInstitutionQueryBo bo) {
+        startPage();
+        List<TopInstitutionVo> list = iTopInstitutionService.listByCat(bo);
+        return getDataTable(list);
+    }
+
 
 
     /**

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/bo/TopCostInstTpItemQueryBo.java

@@ -61,4 +61,6 @@ public class TopCostInstTpItemQueryBo extends BaseEntity {
 	/** 项目ID */
 	@ApiModelProperty("项目ID")
 	private Long projectId;
+	@ApiModelProperty("供应商ID")
+	private Long instId;
 }

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/mapper/TopCostInstTpItemMapper.java

@@ -1,7 +1,12 @@
 package com.zhongzheng.modules.top.financial.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpItemQueryBo;
 import com.zhongzheng.modules.top.financial.domain.TopCostInstTpItem;
+import com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo;
+import com.zhongzheng.modules.top.goods.vo.TopCourseEducationTypeVo;
+
+import java.util.List;
 
 /**
  * 供应商成本模板子项Mapper接口
@@ -10,5 +15,8 @@ import com.zhongzheng.modules.top.financial.domain.TopCostInstTpItem;
  * @date 2023-07-24
  */
 public interface TopCostInstTpItemMapper extends BaseMapper<TopCostInstTpItem> {
+    List<TopCourseEducationTypeVo> queryEduList(TopCostInstTpItemQueryBo bo);
+
+    List<TopCourseBusinessVo> queryBusinessList(TopCostInstTpItemQueryBo bo);
 
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/service/ITopCostInstTpItemService.java

@@ -7,6 +7,7 @@ import com.zhongzheng.modules.top.financial.bo.TopCostInstTpItemEditBo;
 import com.zhongzheng.modules.top.financial.bo.TopCostInstTpItemQueryBo;
 import com.zhongzheng.modules.top.financial.domain.TopCostInstTpItem;
 import com.zhongzheng.modules.top.financial.vo.TopCostInstTpItemVo;
+import com.zhongzheng.modules.top.goods.vo.TopCourseEducationTypeVo;
 
 import java.util.Collection;
 import java.util.List;
@@ -50,4 +51,7 @@ public interface ITopCostInstTpItemService extends IService<TopCostInstTpItem> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+
+	List<TopCourseEducationTypeVo> queryEduList(TopCostInstTpItemQueryBo bo);
 }

+ 16 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/service/impl/TopCostInstTpItemServiceImpl.java

@@ -10,6 +10,8 @@ import com.zhongzheng.modules.top.financial.domain.TopCostInstTpItem;
 import com.zhongzheng.modules.top.financial.mapper.TopCostInstTpItemMapper;
 import com.zhongzheng.modules.top.financial.service.ITopCostInstTpItemService;
 import com.zhongzheng.modules.top.financial.vo.TopCostInstTpItemVo;
+import com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo;
+import com.zhongzheng.modules.top.goods.vo.TopCourseEducationTypeVo;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -103,4 +105,18 @@ public class TopCostInstTpItemServiceImpl extends ServiceImpl<TopCostInstTpItemM
         }
         return this.removeByIds(ids);
     }
+
+    @Override
+    public List<TopCourseEducationTypeVo> queryEduList(TopCostInstTpItemQueryBo bo) {
+        List<TopCourseEducationTypeVo> list = baseMapper.queryEduList(bo);
+        for(TopCourseEducationTypeVo vo : list){
+            TopCostInstTpItemQueryBo queryBo = new TopCostInstTpItemQueryBo();
+            queryBo.setInstId(bo.getInstId());
+            queryBo.setCostCatId(bo.getCostCatId());
+            queryBo.setEducationTypeId(vo.getId());
+            List<TopCourseBusinessVo> bList = baseMapper.queryBusinessList(queryBo);
+            vo.setBusinessList(bList);
+        }
+        return list;
+    }
 }

+ 9 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/service/impl/TopCostInstTpServiceImpl.java

@@ -15,7 +15,10 @@ import com.zhongzheng.modules.top.financial.mapper.TopCostInstTpMapper;
 import com.zhongzheng.modules.top.financial.service.ITopCostInstTpItemService;
 import com.zhongzheng.modules.top.financial.service.ITopCostInstTpService;
 import com.zhongzheng.modules.top.financial.service.ITopCostTpItemService;
+import com.zhongzheng.modules.top.financial.vo.TopCostInstTpItemVo;
 import com.zhongzheng.modules.top.financial.vo.TopCostInstTpVo;
+import com.zhongzheng.modules.top.financial.vo.TopCostTpItemVo;
+import com.zhongzheng.modules.top.financial.vo.TopCostTpVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -45,7 +48,12 @@ public class TopCostInstTpServiceImpl extends ServiceImpl<TopCostInstTpMapper, T
     @Override
     public TopCostInstTpVo queryById(Long tpId){
         TopCostInstTp db = this.baseMapper.selectById(tpId);
-        return BeanUtil.toBean(db, TopCostInstTpVo.class);
+        TopCostInstTpItemQueryBo itemQueryBo = new TopCostInstTpItemQueryBo();
+        itemQueryBo.setTpId(db.getTpId());
+        List<TopCostInstTpItemVo> itemList = iTopCostInstTpItemService.queryList(itemQueryBo);
+        TopCostInstTpVo vo = BeanUtil.toBean(db, TopCostInstTpVo.class);
+        vo.setItemList(itemList);
+        return vo;
     }
 
     @Override

+ 4 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/vo/TopCostInstTpVo.java

@@ -2,11 +2,12 @@ package com.zhongzheng.modules.top.financial.vo;
 
 import com.zhongzheng.common.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpItemAddBo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import java.util.Date;
-
+import java.util.List;
 
 
 /**
@@ -42,4 +43,6 @@ public class TopCostInstTpVo {
 	private Long instId;
 	@ApiModelProperty("供应商名称")
 	private String instName;
+	@ApiModelProperty("子项数组")
+	private List<TopCostInstTpItemVo> itemList;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/bo/TopInstitutionQueryBo.java

@@ -56,4 +56,6 @@ public class TopInstitutionQueryBo extends BaseEntity {
 	private Long instId;
 	@ApiModelProperty("$column.columnComment")
 	private List<Long> instIds;
+	@ApiModelProperty("供应商成本分类id")
+	private Long costCatId;
 }

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/mapper/TopInstitutionMapper.java

@@ -1,7 +1,11 @@
 package com.zhongzheng.modules.top.system.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.top.system.bo.TopInstitutionQueryBo;
 import com.zhongzheng.modules.top.system.domain.TopInstitution;
+import com.zhongzheng.modules.top.system.vo.TopInstitutionVo;
+
+import java.util.List;
 
 /**
  * 职能机构Mapper接口
@@ -10,5 +14,5 @@ import com.zhongzheng.modules.top.system.domain.TopInstitution;
  * @date 2023-07-17
  */
 public interface TopInstitutionMapper extends BaseMapper<TopInstitution> {
-
+    List<TopInstitutionVo> listByCat(TopInstitutionQueryBo bo);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/ITopInstitutionService.java

@@ -29,6 +29,8 @@ public interface ITopInstitutionService extends IService<TopInstitution> {
 	 */
 	List<TopInstitutionVo> queryList(TopInstitutionQueryBo bo);
 
+	List<TopInstitutionVo> listByCat(TopInstitutionQueryBo bo);
+
 	/**
 	 * 根据新增业务对象插入职能机构
 	 * @param bo 职能机构新增业务对象

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/impl/TopInstitutionServiceImpl.java

@@ -51,6 +51,11 @@ public class TopInstitutionServiceImpl extends ServiceImpl<TopInstitutionMapper,
         return entity2Vo(this.list(lqw));
     }
 
+    @Override
+    public List<TopInstitutionVo> listByCat(TopInstitutionQueryBo bo) {
+        return baseMapper.listByCat(bo);
+    }
+
     /**
     * 实体类转化成视图对象
     *

+ 50 - 0
zhongzheng-system/src/main/resources/mapper/modules/top/TopCostInstTpItemMapper.xml

@@ -18,5 +18,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="projectId" column="project_id"/>
     </resultMap>
 
+    <select id="queryEduList" parameterType="com.zhongzheng.modules.top.financial.bo.TopCostInstTpItemQueryBo"  resultType="com.zhongzheng.modules.top.goods.vo.TopCourseEducationTypeVo">
+        SELECT
+            ce.id,
+            ce.education_name
+        FROM
+            top_cost_inst_tp it
+                LEFT JOIN top_cost_inst_tp_item iti ON it.tp_id = iti.tp_id
+                LEFT JOIN top_course_education_type ce ON iti.education_type_id = ce.id
+        WHERE
+            it.`status` = 1
+          AND ce.`status` = 1
+        <if test="instId != null and instId != ''">
+            AND it.inst_id = #{instId}
+        </if>
+        <if test="costCatId != null and costCatId != ''">
+            AND iti.cost_cat_id = #{costCatId}
+        </if>
+        GROUP BY
+            ce.id,
+            ce.education_name
+    </select>
 
+    <select id="queryBusinessList" parameterType="com.zhongzheng.modules.top.financial.bo.TopCostInstTpItemQueryBo"  resultType="com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo">
+        SELECT
+        iti.project_id,
+        iti.business_id,
+        b.business_name,
+        p.project_name
+        FROM
+        top_cost_inst_tp it
+        LEFT JOIN top_cost_inst_tp_item iti ON it.tp_id = iti.tp_id
+        LEFT JOIN top_course_project_type p on iti.project_id =p.id
+        LEFT JOIN top_course_business b ON iti.business_id = b.id
+        WHERE
+        it.`status` = 1
+        AND b.`status` = 1
+        <if test="instId != null and instId != ''">
+            AND it.inst_id = #{instId}
+        </if>
+        <if test="costCatId != null and costCatId != ''">
+            AND iti.cost_cat_id = #{costCatId}
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND iti.education_type_id = #{educationTypeId}
+        </if>
+        GROUP BY
+        iti.project_id,
+        iti.business_id,
+        b.business_name,
+        p.project_name
+    </select>
 </mapper>

+ 3 - 0
zhongzheng-system/src/main/resources/mapper/modules/top/TopCostInstTpMapper.xml

@@ -32,6 +32,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="instName != null and instName != ''">
             AND ti.inst_name  like concat('%', #{instName}, '%')
         </if>
+        <if test="tpName != null and tpName != ''">
+            AND ct.tp_name  like concat('%', #{tpName}, '%')
+        </if>
         <if test="instId != null and instId != ''">
             AND ti.inst_id  = #{instId}
         </if>

+ 13 - 1
zhongzheng-system/src/main/resources/mapper/modules/top/TopInstitutionMapper.xml

@@ -15,5 +15,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="status" column="status"/>
     </resultMap>
 
-
+    <select id="listByCat" parameterType="com.zhongzheng.modules.top.system.bo.TopInstitutionQueryBo"  resultType="com.zhongzheng.modules.top.system.vo.TopInstitutionVo">
+        SELECT
+        i.*
+        FROM
+        top_cost_inst_tp it
+        LEFT JOIN top_cost_inst_tp_item iti ON it.tp_id = iti.tp_id
+        LEFT JOIN top_institution i ON it.inst_id = i.inst_id
+        WHERE
+        it.`status` = 1
+        <if test="costCatId != null and costCatId != ''">
+            AND iti.cost_cat_id = #{costCatId}
+        </if>
+    </select>
 </mapper>