平台件项目库

This commit is contained in:
zhn
2023-09-12 17:07:38 +08:00
parent 16f14af3a4
commit f680da60e6
5 changed files with 4410 additions and 0 deletions
@@ -0,0 +1,311 @@
package com.jero.modules.projectPlatform.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.vo.DictModel;
import com.jero.modules.project.entity.ProjectLibraryBase;
import com.jero.modules.project.service.IProjectLibraryBaseService;
import com.jero.modules.projectPlatform.service.IProjectPlatformService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @Description: 项目库基础表
* @Author: jero-boot
* @Date: 2022-04-11
* @Version: V1.0
*/
@Api(tags="平台件项目库")
@RestController
@RequestMapping("/project/platform")
@Slf4j
public class ProjectPlatformController extends JeroController<ProjectLibraryBase, IProjectPlatformService> {
@Autowired
private IProjectPlatformService projectPlatformService;
/**
* 分页列表查询
*
* @return
*/
@AutoLog(value = "项目库基础表-分页列表查询")
@ApiOperation(value="项目库基础表-分页列表查询", notes="项目库基础表-分页列表查询")
@PostMapping(value = "/page")
public Result<?> queryPageList(@RequestBody Map<String,Object> params) {
List<ProjectLibraryBase> pageList= projectPlatformService.queryPageList(params);
Page pages = projectPlatformService.getPages(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()), pageList);
return Result.OK(params.get("cut").toString(),pages);
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "项目库基础表-列表查询")
@ApiOperation(value="项目库基础表-列表查询", notes="项目库基础表-列表查询")
@GetMapping(value = "/list")
public Result<List<ProjectLibraryBase>> queryList(ProjectLibraryBase projectLibraryBase) {
List<ProjectLibraryBase> list = projectPlatformService.getList(projectLibraryBase);
return Result.OK(list);
}
/**
* 添加
*
* @param projectLibraryBase
* @return
*/
@AutoLog(value = "项目库基础表-添加")
@ApiOperation(value="项目库基础表-添加", notes="项目库基础表-添加")
@RequiresPermissions("projectLibraryBase:add")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) throws ParseException {
projectPlatformService.add(projectLibraryBase);
return Result.OK("添加成功!");
}
/**
* 项目扩展(添加子项目子项目基本信息、相关人员名单、法规/认证任务计划与被扩展项目保持一致)
*
* @param projectLibraryBase
* @return
*/
@AutoLog(value = "项目扩展(添加子项目)")
@ApiOperation(value="项目扩展(添加子项目)", notes="项目扩展(添加子项目)")
@RequiresPermissions("projectLibraryBase:add")
@PostMapping(value = "/addChild")
public Result<?> addChild(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) throws ParseException {
projectPlatformService.addChild(projectLibraryBase);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param projectLibraryBase
* @return
*/
@AutoLog(value = "项目库基础表-编辑")
@ApiOperation(value="项目库基础表-编辑", notes="项目库基础表-编辑")
@RequiresPermissions("projectLibraryBase:edit")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) {
projectPlatformService.editById(projectLibraryBase);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "项目库基础表-通过id删除")
@ApiOperation(value="项目库基础表-通过id删除", notes="项目库基础表-通过id删除")
@RequiresPermissions("projectLibraryBase:delete")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id,
@RequestParam(name="cut",required=true) String cut) {
projectPlatformService.deleteById(id,cut);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "项目库基础表-批量删除")
@ApiOperation(value="项目库基础表-批量删除", notes="项目库基础表-批量删除")
@RequiresPermissions("projectLibraryBase:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids,
@RequestParam(name="cut",required=true) String cut) {
this.projectPlatformService.deleteByIds(Arrays.asList(ids.split(",")),cut);
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "项目库基础表-通过id查询")
@ApiOperation(value="项目库基础表-通过id查询", notes="项目库基础表-通过id查询")
@RequiresPermissions("projectLibraryBase:queryById")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id,
@RequestParam(name="cut",required=true) String cut) {
List<ProjectLibraryBase> data = projectPlatformService.queryById(id,cut);
if(data==null) {
return Result.error("未找到对应数据");
}
return Result.OK(cut,data);
}
/**
* 导出excel
*
* @param request
* @param projectLibraryBase
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ProjectLibraryBase projectLibraryBase) {
return super.exportXls(request, projectLibraryBase, ProjectLibraryBase.class, "项目库基础表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ProjectLibraryBase.class);
}
/**
* 项目详情-统计接口
* @param id 项目库id
* @return
*/
@AutoLog(value = "项目详情-统计接口")
@ApiOperation(value="项目详情-统计接口", notes="项目详情-统计接口")
@GetMapping(value = "/getProjectDetailsStatistics")
public Result<?> getProjectDetailsStatistics(@RequestParam(name="id",required=true) String id,
@RequestParam(name="cut",required=true) String cut) {
Map<String,Object> data = projectPlatformService.getProjectDetailsStatistics(id);
return Result.OK(cut,data);
}
/**
* 项目详情-统计接口-根据领域分组
* @return
*/
@AutoLog(value = "项目详情-统计接口-根据领域分组")
@ApiOperation(value="项目详情-统计接口-根据领域分组", notes="项目详情-统计接口-根据领域分组")
@GetMapping(value = "/getProjectDetailsStatisticsGroupByTerritory")
public Result<?> getProjectDetailsStatisticsGroupByTerritory(@RequestParam Map<String,Object> params) {
Map<String,Object> data = projectPlatformService.getProjectDetailsStatisticsGroupByTerritory(params);
return Result.OK((String)params.get("cut"),data);
}
/**
* 导出excel
*
* @param request
* @param params
*/
@RequestMapping(value = "/exportProjectDetailsStatisticsGroupByTerritoryXls")
public void exportProjectDetailsStatisticsGroupByTerritoryXls(HttpServletResponse response,HttpServletRequest request, @RequestParam Map<String,Object> params) {
projectPlatformService.exportProjectDetailsStatisticsGroupByTerritoryXls(response,request, params);
}
/**
* 项目置顶,取消置顶(只置顶主项目)
* @param id
* @param flag 0为置顶, 1为取消置顶
* @return
*/
@AutoLog(value = "项目置顶,取消置顶(只置顶主项目)")
@ApiOperation(value="项目置顶,取消置顶(只置顶主项目)", notes="项目置顶,取消置顶(只置顶主项目)")
@GetMapping(value = "/top")
public Result<?> top(String id,String flag) {
projectPlatformService.top(id,flag);
return Result.OK("编辑成功!");
}
/**
* 获取项目所有的版本(主版本和子版本的集合)
* @param id 项目id
* @return
*/
@AutoLog(value = "获取项目所有的版本(主版本和子版本的集合)")
@ApiOperation(value="获取项目所有的版本(主版本和子版本的集合)", notes="获取项目所有的版本(主版本和子版本的集合)")
@GetMapping(value = "/getVersionsInfo")
public Result<?> getVersionsInfo(String id) {
List<String> versionsInfoList = projectPlatformService.getVersionsInfo(id);
return Result.OK(versionsInfoList);
}
/**
* 版本统计
* @return
*/
@AutoLog(value = "版本统计")
@ApiOperation(value="版本统计)", notes="版本统计")
@PostMapping(value = "/versionStatistics")
public Result<?> versionStatistics(@RequestBody Map<String,Object> params) {
List<ProjectLibraryBase> projectLibraryBasesList = projectPlatformService.versionStatistics(String.valueOf(params.get("id")));
Page pages = projectPlatformService.getPages(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()), projectLibraryBasesList);
return Result.OK(pages);
}
@AutoLog(value = "对接火山引擎接口getProjectInfo")
@ApiOperation(value="对接火山引擎接口-获取项目统计信息1", notes="对接火山引擎接口-获取项目统计信息1")
@PostMapping(value = "/getProjectInfo")
public Result<?> getProjectInfo(){
JSONArray resList = projectPlatformService.getProjectInfo();
return Result.OK(resList);
}
@AutoLog(value = "对接火山引擎接口getProjectProgressInfo")
@ApiOperation(value="对接火山引擎接口-获取项目统计信息2", notes="对接火山引擎接口-获取项目统计信息2")
@PostMapping(value = "/getProjectProgressInfo")
public Result<?> getProjectProgressInfo(){
JSONArray resList = this.projectPlatformService.getProjectProgressInfo();
return Result.OK(resList);
}
// 导出项目进度统计(状态导出)
@RequestMapping(value = "/exportProjectProgressStatisticsXls")
public void exportProjectProgressStatisticsXls(HttpServletResponse response,HttpServletRequest request, @RequestParam Map<String,Object> params) {
this.projectPlatformService.exportProjectProgressStatisticsXls(response,request, params);
}
@AutoLog(value = "获取用户在该项目中所有的责任领域")
@ApiOperation(value="获取用户在该项目中所有的责任领域", notes="获取用户在该项目中所有的责任领域")
@GetMapping(value = "/getUserAllDutyTerritoryList")
public Result<List<DictModel>> getUserAllDutyTerritoryList(@RequestParam Map<String,Object> params){
List<DictModel> resList = this.projectPlatformService.getUserAllDutyTerritoryList(params);
return Result.OK(resList);
}
@AutoLog(value = "全局替换用户")
@ApiOperation(value="全局替换用户", notes="全局替换用户")
@PostMapping(value = "/overallReplacementUser")
public Result<?> overallReplacementUser(@RequestBody JSONObject json){
return this.projectPlatformService.overallReplacementUser(json);
}
}
@@ -0,0 +1,32 @@
package com.jero.modules.projectPlatform.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jero.modules.project.entity.ProjectLibraryBase;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @Description: 项目库基础表
* @Author: jero-boot
* @Date: 2022-04-11
* @Version: V1.0
*/
public interface ProjectPlatformMapper extends BaseMapper<ProjectLibraryBase> {
/**分页列表*/
List<ProjectLibraryBase> queryPageList(@Param("params") Map<String, Object> params);
List<ProjectLibraryBase> queryMaimList();
// IPage<ProjectLibraryBase> queryPageList(IPage page, Map<String, Object> params);
List<ProjectLibraryBase> getList(@Param("projectLibraryBase") ProjectLibraryBase projectLibraryBase);
/**根据id查询*/
List<ProjectLibraryBase> queryById(String id);
ProjectLibraryBase selectProjectName(@Param("projectLibraryId") String projectLibraryId);
List<ProjectLibraryBase> getListByIds(@Param("idList") List<String> idList);
}
@@ -0,0 +1,303 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jero.modules.projectPlatform.mapper.ProjectPlatformMapper">
<resultMap id="ProjectLibraryBaseResultMap" type="com.jero.modules.project.entity.ProjectLibraryBase">
<id column="id" property="id" />
<result column="project_name_id" property="projectNameId" />
<result column="year_name_id" property="yearNameId" />
<result column="target_market" property="targetMarket" />
<result column="project_status" property="projectStatus" />
<result column="studio_engineer" property="studioEngineer" />
<result column="certification_engineer" property="certificationEngineer" />
<result column="vehicle_platform" property="vehiclePlatform" />
<result column="digital_platform" property="digitalPlatform" />
<result column="ipd_info" property="ipdInfo" />
<result column="vehicle_development_plan" property="vehicleDevelopmentPlan" />
<result column="attestation_plan" property="attestationPlan" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="sys_org_code" property="sysOrgCode" />
<result column="brand" property="brand" />
</resultMap>
<sql id="select_item">
select
plb.id,
plb.project_name_id,
pni.project_name as project_name,
pyni.id as year_name_id,
pyni.year_name,
plb.target_market,
plb.project_status,
plb.studio_engineer,
studiouser.username as studio_engineer_name,
plb.certification_engineer,
plb.vehicle_platform,
plb.digital_platform,
plb.ipd_info,
plb.vehicle_development_plan,
plb.attestation_plan,
plb.create_by,
plb.create_time,
plb.sys_org_code,
plb.update_by,
plb.update_time,
plb.parent_id,
plb.project_version,
plb.explanation,
plb.software_version,
plb.sort,
plb.flag,
plb.brand,
sdi.item_text brandText,
sdi.en_name brandTextEn
from project_library_base as plb
left join project_name_info as pni on plb.project_name_id=pni.id
left join sys_user as studiouser on plb.studio_engineer=studiouser.id
left join project_year_name_info as pyni on plb.year_name_id=pyni.id
left join sys_dict_item as sdi on sdi.item_value = plb.brand
</sql>
<select id="queryPageList" resultType="com.jero.modules.project.entity.ProjectLibraryBase">
<include refid="select_item"/>
<where>
<if test="params.projectName != null and params.projectName != ''">
<!--搜索条件:项目名称,包含%,单独搜索-->
<choose>
<when test='params.projectName != null and params.projectName != "" and params.projectName.contains("%")'>
( pni.project_name like '%1%%' escape '1' or pni.project_name like '%1%%' escape '1')
</when>
<otherwise>
<!--(pni.project_name like concat('%',#{params.projectName},'%') or pyni.year_name like concat('%',#{params.projectName},'%'))-->
</otherwise>
</choose>
</if>
<!--搜索条件:目标市场-->
<if test="params.targetMarket != null and params.targetMarket != '' ">
and plb.target_market like concat('%',#{params.targetMarket},'%')
</if>
<!--搜索条件:项目状态-->
<if test="params.projectStatus != null and params.projectStatus != '' ">
and plb.project_status like concat('%',#{params.projectStatus},'%')
</if>
<if test="params.studioEngineer != null and params.studioEngineer != ''">
<!--搜索条件:studio工程师,包含%,单独搜索-->
<choose>
<when test='params.studioEngineer != null and params.studioEngineer != "" and params.studioEngineer.contains("%")'>
and plb.studio_engineer like '%1%%' escape '1'
</when>
<otherwise>
and plb.studio_engineer like concat('%',#{params.studioEngineer},'%')
</otherwise>
</choose>
</if>
<if test="params.certificationEngineer != null and params.certificationEngineer != ''">
<!--搜索条件:认证工程师,包含%,单独搜索-->
<choose>
<when test='params.certificationEngineer != null and params.certificationEngineer != "" and params.certificationEngineer.contains("%")'>
and plb.certification_engineer like '%1%%' escape '1'
</when>
<otherwise>
and plb.certification_engineer like concat('%',#{params.certificationEngineer},'%')
</otherwise>
</choose>
</if>
<!--搜索条件:车型平台-->
<if test="params.vehiclePlatform != null and params.vehiclePlatform != '' ">
and plb.vehicle_platform like concat('%',#{params.vehiclePlatform},'%')
</if>
<!--搜索条件:数字平台-->
<if test="params.digitalPlatform != null and params.digitalPlatform != '' ">
and plb.digital_platform like concat('%',#{params.digitalPlatform},'%')
</if>
<!--搜索条件:品牌-->
<if test="params.brand != null and params.brand != '' ">
and plb.brand = #{params.brand}
</if>
</where>
order by plb.sort desc, plb.create_time desc
</select>
<select id="queryMaimList" resultType="com.jero.modules.project.entity.ProjectLibraryBase">
<include refid="select_item"/>
<where>
parent_id = '' or parent_id is null
</where>
order by plb.create_time desc
</select>
<!-- <select id="queryPageList" resultType="com.jero.modules.project.entity.ProjectLibraryBase">-->
<!-- <include refid="select_item"/>-->
<!-- <where>-->
<!-- <if test="params.projectName != null and params.projectName != ''">-->
<!-- &lt;!&ndash;搜索条件:项目名称,包含%,单独搜索&ndash;&gt;-->
<!-- <choose>-->
<!-- <when test='params.projectName != null and params.projectName != "" and params.projectName.contains("%")'>-->
<!-- ( pni.project_name like '%1%%' escape '1' or pni.project_name like '%1%%' escape '1')-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- (pni.project_name like concat('%',#{params.projectName},'%') or pyni.year_name like concat('%',#{params.projectName},'%'))-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </if>-->
<!-- &lt;!&ndash;搜索条件:目标市场&ndash;&gt;-->
<!-- <if test="params.targetMarket != null and params.targetMarket != '' ">-->
<!-- and plb.target_market like concat('%',#{params.targetMarket},'%')-->
<!-- </if>-->
<!-- &lt;!&ndash;搜索条件:项目状态&ndash;&gt;-->
<!-- <if test="params.projectStatus != null and params.projectStatus != '' ">-->
<!-- and plb.project_status like concat('%',#{params.projectStatus},'%')-->
<!-- </if>-->
<!-- <if test="params.studioEngineer != null and params.studioEngineer != ''">-->
<!-- &lt;!&ndash;搜索条件:studio工程师,包含%,单独搜索&ndash;&gt;-->
<!-- <choose>-->
<!-- <when test='params.studioEngineer != null and params.studioEngineer != "" and params.studioEngineer.contains("%")'>-->
<!-- and plb.studio_engineer like '%1%%' escape '1'-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- and plb.studio_engineer like concat('%',#{params.studioEngineer},'%')-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </if>-->
<!-- <if test="params.certificationEngineer != null and params.certificationEngineer != ''">-->
<!-- &lt;!&ndash;搜索条件:认证工程师,包含%,单独搜索&ndash;&gt;-->
<!-- <choose>-->
<!-- <when test='params.certificationEngineer != null and params.certificationEngineer != "" and params.certificationEngineer.contains("%")'>-->
<!-- and plb.certification_engineer like '%1%%' escape '1'-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- and plb.certification_engineer like concat('%',#{params.certificationEngineer},'%')-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </if>-->
<!-- &lt;!&ndash;搜索条件:车型平台&ndash;&gt;-->
<!-- <if test="params.vehiclePlatform != null and params.vehiclePlatform != '' ">-->
<!-- and plb.vehicle_platform like concat('%',#{params.vehiclePlatform},'%')-->
<!-- </if>-->
<!-- &lt;!&ndash;搜索条件:数字平台&ndash;&gt;-->
<!-- <if test="params.digitalPlatform != null and params.digitalPlatform != '' ">-->
<!-- and plb.digital_platform like concat('%',#{params.digitalPlatform},'%')-->
<!-- </if>-->
<!-- </where>-->
<!-- order by plb.create_time desc-->
<!-- </select>-->
<select id="getList" resultType="com.jero.modules.project.entity.ProjectLibraryBase">
<include refid="select_item"/>
<where>
<if test="projectLibraryBase.projectName != null and projectLibraryBase.projectName != ''">
<!--搜索条件:项目名称,包含%,单独搜索-->
<choose>
<when test='projectLibraryBase.projectName != null and projectLibraryBase.projectName != "" and projectLibraryBase.projectName.contains("%")'>
and pni.project_name like '%1%%' escape '1'
</when>
<otherwise>
and pni.project_name like concat('%',#{projectLibraryBase.projectName},'%')
</otherwise>
</choose>
</if>
<!--搜索条件:目标市场-->
<if test="projectLibraryBase.targetMarket != null and projectLibraryBase.targetMarket != '' ">
and plb.target_market like concat('%',#{projectLibraryBase.targetMarket},'%')
</if>
<!--搜索条件:项目状态-->
<if test="projectLibraryBase.projectStatus != null and projectLibraryBase.projectStatus != '' ">
and plb.project_status like concat('%',#{projectLibraryBase.projectStatus},'%')
</if>
<!--搜索条件:品牌-->
<if test="projectLibraryBase.brand != null and projectLibraryBase.brand != '' ">
and plb.brand = #{projectLibraryBase.brand}
</if>
<if test="projectLibraryBase.studioEngineer != null and projectLibraryBase.studioEngineer != ''">
<!--搜索条件:studio工程师,包含%,单独搜索-->
<choose>
<when test='projectLibraryBase.studioEngineer != null and projectLibraryBase.studioEngineer != "" and projectLibraryBase.studioEngineer.contains("%")'>
and plb.studio_engineer like '%1%%' escape '1'
</when>
<otherwise>
and plb.studio_engineer like concat('%',#{projectLibraryBase.studioEngineer},'%')
</otherwise>
</choose>
</if>
<if test="projectLibraryBase.certificationEngineer != null and projectLibraryBase.certificationEngineer != ''">
<!--搜索条件:认证工程师,包含%,单独搜索-->
<choose>
<when test='projectLibraryBase.certificationEngineer != null and projectLibraryBase.certificationEngineer != "" and projectLibraryBase.certificationEngineer.contains("%")'>
and plb.certification_engineer like '%1%%' escape '1'
</when>
<otherwise>
and plb.certification_engineer like concat('%',#{projectLibraryBase.certificationEngineer},'%')
</otherwise>
</choose>
</if>
<!--搜索条件:车型平台-->
<!-- <if test="projectLibraryBase.vehiclePlatform != null and projectLibraryBase.vehiclePlatform != '' ">-->
<!-- and plb.vehicle_platform like concat('%',#{projectLibraryBase.vehiclePlatform},'%')-->
<!-- </if>-->
<!--搜索条件:数字平台-->
<!-- <if test="projectLibraryBase.digitalPlatform != null and projectLibraryBase.digitalPlatform != '' ">-->
<!-- and plb.digital_platform like concat('%',#{projectLibraryBase.digitalPlatform},'%')-->
<!-- </if>-->
</where>
order by plb.create_time desc
</select>
<select id="queryById" resultType="com.jero.modules.project.entity.ProjectLibraryBase">
<include refid="select_item"/>
<where>
<if test="id != null and id != '' ">
plb.id=#{id}
</if>
</where>
order by plb.create_time desc
</select>
<select id="selectProjectName" resultType="com.jero.modules.project.entity.ProjectLibraryBase">
SELECT
concat( pni.project_name, '-', pyni.year_name ) AS project_name
FROM
project_library_base plb
LEFT JOIN project_name_info pni ON plb.project_name_id = pni.id
LEFT JOIN project_year_name_info pyni ON plb.year_name_id = pyni.id
WHERE
plb.id = #{projectLibraryId}
</select>
<select id="getListByIds" resultType="com.jero.modules.project.entity.ProjectLibraryBase">
<include refid="select_item"/>
where plb.id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
order by plb.create_time desc
</select>
</mapper>
@@ -0,0 +1,191 @@
package com.jero.modules.projectPlatform.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.api.vo.Result;
import com.jero.common.system.vo.DictModel;
import com.jero.modules.project.entity.ProjectLibraryBase;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
/**
* @Description: 项目库基础表
* @Author: jero-boot
* @Date: 2022-04-11
* @Version: V1.0
*/
public interface IProjectPlatformService extends IService<ProjectLibraryBase> {
/**
* 保存
*
* @param projectLibraryBase
* @return
*/
void add(ProjectLibraryBase projectLibraryBase) throws ParseException;
/**
* 项目扩展(添加子项目-子项目基本信息、相关人员名单、法规/认证任务计划与被扩展项目保持一致)
*
* @param projectLibraryBase
* @return
*/
void addChild(ProjectLibraryBase projectLibraryBase) throws ParseException;
/**
* 更新
*
* @param projectLibraryBase
* @return
*/
void editById(ProjectLibraryBase projectLibraryBase);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id, String cut);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids,String cut);
/**
* 通过id查询
*
* @param id
* @return
*/
List<ProjectLibraryBase> queryById(String id,String cut);
/**
* 列表查询
*
* @return
*/
List<ProjectLibraryBase> getList(ProjectLibraryBase projectLibraryBase);
/**
* 分页列表查询
*
* @return
*/
List<ProjectLibraryBase> queryPageList(Map<String, Object> params);
// IPage<ProjectLibraryBase> queryPageList(Map<String, Object> params);
/**
* 项目详情-统计接口
* @param id
* @return
*/
Map<String, Object> getProjectDetailsStatistics(String id);
/**
* 项目详情-统计接口-根据领域分组
* @param params
* @return
*/
Map<String, Object> getProjectDetailsStatisticsGroupByTerritory(Map<String, Object> params);
void exportProjectDetailsStatisticsGroupByTerritoryXls(HttpServletResponse response, HttpServletRequest request, Map<String, Object> params);
void checkData(String id, String cut);
void disposeData(List<ProjectLibraryBase> records,String cut,boolean disposeTargetMarketFlag);
Page getPages(Integer currentPage, Integer pageSize, List<ProjectLibraryBase> list);
/**
* 项目置顶,取消置顶(只置顶主项目)
* @param id
* @param flag 0为置顶, 1为取消置顶
* @return
*/
void top(String id,String flag);
/**
* 获取项目所有的版本(主版本和子版本的集合)
* @param id
* @return
*/
List<String> getVersionsInfo(String id);
/**
* 版本统计
* @param id
* @return
*/
List<ProjectLibraryBase> versionStatistics(String id);
/**
* 通过主项目id和子项目版本号
* @param version
* @param parentId
* @return
*/
String getIdByVersionAndParentId(String version, String parentId);
/**
* 查询主项目及其所有子项目
* @param parentId
* @return
*/
List<ProjectLibraryBase> getParentAndChildern(String parentId);
/**
* 根据id查询项目库详情信息 发送飞书消息时使用,之前的 queryById不太兼容
* @param projectLibraryId
* @return
*/
ProjectLibraryBase selectById(String projectLibraryId);
/**
* 对接火山引擎接口-获取项目统计信息
* @return
*/
JSONArray getProjectInfo();
/**
* 对接火山引擎接口-获取项目统计信息
* @return
*/
JSONArray getProjectProgressInfo();
/**
* 导出项目进度统计(状态导出)
* @param response
* @param request
* @param params
*/
void exportProjectProgressStatisticsXls(HttpServletResponse response, HttpServletRequest request, Map<String, Object> params);
/**
* 获取用户在该项目中所有的责任领域数组
* @param params
* @return
*/
List<DictModel> getUserAllDutyTerritoryList(Map<String, Object> params);
/**
* 全局替换用户
* @param json
* @return
*/
Result<?> overallReplacementUser(JSONObject json);
List<ProjectLibraryBase> queryList(List<String> projectIdList);
List<ProjectLibraryBase> getListByIds(List<String> projectIdList);
}