关联项目
This commit is contained in:
@ -6,6 +6,8 @@ import io.github.linpeilie.annotations.AutoMapper;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||||
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.project.domain.BusProject;
|
import org.dromara.project.domain.BusProject;
|
||||||
import org.dromara.project.domain.bo.Punchrange;
|
import org.dromara.project.domain.bo.Punchrange;
|
||||||
import org.dromara.system.domain.vo.SysRoleVo;
|
import org.dromara.system.domain.vo.SysRoleVo;
|
||||||
@ -92,6 +94,12 @@ public class BusProjectVo implements Serializable {
|
|||||||
@ExcelDictFormat(dictType = "project_type")
|
@ExcelDictFormat(dictType = "project_type")
|
||||||
private String projectType;
|
private String projectType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目类型名称
|
||||||
|
*/
|
||||||
|
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "projectType", other = "project_type")
|
||||||
|
private String projectTypeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目阶段
|
* 项目阶段
|
||||||
*/
|
*/
|
||||||
@ -99,6 +107,12 @@ public class BusProjectVo implements Serializable {
|
|||||||
@ExcelDictFormat(dictType = "project_stage")
|
@ExcelDictFormat(dictType = "project_stage")
|
||||||
private String projectStage;
|
private String projectStage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目类型名称
|
||||||
|
*/
|
||||||
|
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "projectType", other = "project_stage")
|
||||||
|
private String projectStageName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目地址
|
* 项目地址
|
||||||
*/
|
*/
|
||||||
@ -218,6 +232,17 @@ public class BusProjectVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private List<Long> deptIds;
|
private List<Long> deptIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门列表
|
||||||
|
*/
|
||||||
|
private String deptStr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称列表
|
||||||
|
*/
|
||||||
|
@Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "deptStr")
|
||||||
|
private String deptNames;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 某个用户在此项目下的所有角色
|
* 某个用户在此项目下的所有角色
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import cn.dev33.satoken.stp.StpUtil;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.PhoneUtil;
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@ -644,7 +643,7 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
|
|||||||
String projectName = entity.getProjectName();
|
String projectName = entity.getProjectName();
|
||||||
String principalPhone = entity.getPrincipalPhone();
|
String principalPhone = entity.getPrincipalPhone();
|
||||||
// 新增项目参数验证
|
// 新增项目参数验证
|
||||||
if (create) {
|
/* if (create) {
|
||||||
if (StringUtils.isBlank(projectName)) {
|
if (StringUtils.isBlank(projectName)) {
|
||||||
throw new ServiceException("项目名称不能为空", HttpStatus.BAD_REQUEST);
|
throw new ServiceException("项目名称不能为空", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
@ -654,7 +653,7 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
|
|||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(principalPhone) && !PhoneUtil.isPhone(principalPhone)) {
|
if (StringUtils.isNotBlank(principalPhone) && !PhoneUtil.isPhone(principalPhone)) {
|
||||||
throw new ServiceException("负责人手机号格式不正确", HttpStatus.BAD_REQUEST);
|
throw new ServiceException("负责人手机号格式不正确", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -741,7 +740,12 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
|
|||||||
List<BusProjectDept> deptList = projectDeptService.lambdaQuery()
|
List<BusProjectDept> deptList = projectDeptService.lambdaQuery()
|
||||||
.eq(BusProjectDept::getProjectId, project.getId())
|
.eq(BusProjectDept::getProjectId, project.getId())
|
||||||
.list();
|
.list();
|
||||||
projectVo.setDeptIds(deptList.stream().map(BusProjectDept::getDeptId).toList());
|
List<Long> deptIds = deptList.stream().map(BusProjectDept::getDeptId).toList();
|
||||||
|
projectVo.setDeptIds(deptIds);
|
||||||
|
if (CollUtil.isNotEmpty(deptIds)) {
|
||||||
|
String deptStr = deptIds.stream().map(String::valueOf).collect(Collectors.joining(","));
|
||||||
|
projectVo.setDeptStr(deptStr);
|
||||||
|
}
|
||||||
return projectVo;
|
return projectVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,8 @@ import org.dromara.common.log.enums.BusinessType;
|
|||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectVo;
|
||||||
|
import org.dromara.project.service.IBusProjectService;
|
||||||
import org.dromara.xzd.domain.bo.XzdProjectBo;
|
import org.dromara.xzd.domain.bo.XzdProjectBo;
|
||||||
import org.dromara.xzd.domain.bo.XzdProjectManagerApprovalBo;
|
import org.dromara.xzd.domain.bo.XzdProjectManagerApprovalBo;
|
||||||
import org.dromara.xzd.domain.bo.XzdProjectTypeBo;
|
import org.dromara.xzd.domain.bo.XzdProjectTypeBo;
|
||||||
@ -43,6 +45,7 @@ import java.util.List;
|
|||||||
@RequestMapping("/xzd/project")
|
@RequestMapping("/xzd/project")
|
||||||
public class XzdProjectController extends BaseController {
|
public class XzdProjectController extends BaseController {
|
||||||
|
|
||||||
|
private final IBusProjectService projectService;
|
||||||
private final IXzdProjectService xzdProjectService;
|
private final IXzdProjectService xzdProjectService;
|
||||||
private final IXzdProjectTypeService xzdProjectTypeService;
|
private final IXzdProjectTypeService xzdProjectTypeService;
|
||||||
private final IXzdProjectManagerApprovalService xzdProjectManagerApprovalService;
|
private final IXzdProjectManagerApprovalService xzdProjectManagerApprovalService;
|
||||||
@ -75,7 +78,7 @@ public class XzdProjectController extends BaseController {
|
|||||||
// @SaCheckPermission("xzd:project:query")
|
// @SaCheckPermission("xzd:project:query")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public R<XzdProjectVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<XzdProjectVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Long id) {
|
@PathVariable Long id) {
|
||||||
return R.ok(xzdProjectService.queryById(id));
|
return R.ok(xzdProjectService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,5 +155,16 @@ public class XzdProjectController extends BaseController {
|
|||||||
return xzdProjectManagerApprovalService.queryPageList(bo, pageQuery);
|
return xzdProjectManagerApprovalService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目详细信息
|
||||||
|
*
|
||||||
|
* @param sysProjectId 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("xzd:project:list")
|
||||||
|
@GetMapping("/sysProject/{sysProjectId}")
|
||||||
|
public R<BusProjectVo> getSysProjectInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long sysProjectId) {
|
||||||
|
return R.ok(projectService.queryById(sysProjectId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,45 +6,46 @@
|
|||||||
|
|
||||||
<select id="search" resultType="org.dromara.xzd.domain.vo.XzdProjectVo">
|
<select id="search" resultType="org.dromara.xzd.domain.vo.XzdProjectVo">
|
||||||
SELECT
|
SELECT
|
||||||
project.id,
|
project.id,
|
||||||
project.city_code as cityCode,
|
project.city_code as cityCode,
|
||||||
project.shzt as shzt,
|
project.shzt as shzt,
|
||||||
# profile.parent_project_id as fjxm,
|
project.sys_project_id as sysProjectId,
|
||||||
(SELECT project_name FROM xzd_project WHERE id = profile.parent_project_id) as fjxm,
|
# profile.parent_project_id as fjxm,
|
||||||
project.project_attribute as projectAttribute,
|
(SELECT project_name FROM xzd_project WHERE id = profile.parent_project_id) as fjxm,
|
||||||
project.project_number as projectNumber,
|
project.project_attribute as projectAttribute,
|
||||||
project.project_name as projectName,
|
project.project_number as projectNumber,
|
||||||
project.file_id as fileId,
|
project.project_name as projectName,
|
||||||
project.filing_manager as filingManager,
|
project.file_id as fileId,
|
||||||
project.manager_execution as managerExecution,
|
project.filing_manager as filingManager,
|
||||||
project.manager_responsible as managerResponsible,
|
project.manager_execution as managerExecution,
|
||||||
project.audit_status as auditStatus,
|
project.manager_responsible as managerResponsible,
|
||||||
project.project_abbreviation as projectAbbreviation,
|
project.audit_status as auditStatus,
|
||||||
project.project_status as projectStatus,
|
project.project_abbreviation as projectAbbreviation,
|
||||||
type.type_name as projectTypeName,
|
project.project_status as projectStatus,
|
||||||
profile.contract_amount as targetContractAmount,
|
type.type_name as projectTypeName,
|
||||||
project.planned_start_date as plannedStartDate,
|
profile.contract_amount as targetContractAmount,
|
||||||
project.planned_completion_date as plannedCompletionDate,
|
project.planned_start_date as plannedStartDate,
|
||||||
project.actual_start_date as actualStartDate,
|
project.planned_completion_date as plannedCompletionDate,
|
||||||
project.actual_completion_date as actualCompletionDate,
|
project.actual_start_date as actualStartDate,
|
||||||
approval1.prospective_manager_name as filingManagerName,
|
project.actual_completion_date as actualCompletionDate,
|
||||||
approval2.prospective_manager_name as managerExecutionName,
|
approval1.prospective_manager_name as filingManagerName,
|
||||||
profile.project_address as xmdz,
|
approval2.prospective_manager_name as managerExecutionName,
|
||||||
project.management_organization as managementOrganization,
|
profile.project_address as xmdz,
|
||||||
dept.dept_name as managementOrganizationName,
|
project.management_organization as managementOrganization,
|
||||||
project.construction_unit as constructionUnit,
|
dept.dept_name as managementOrganizationName,
|
||||||
profile.country as gj,
|
project.construction_unit as constructionUnit,
|
||||||
profile.province as sheng,
|
profile.country as gj,
|
||||||
profile.city as cs,
|
profile.province as sheng,
|
||||||
user2.nick_name as managerResponsibleName,
|
profile.city as cs,
|
||||||
user3.nick_name as lrr,
|
user2.nick_name as managerResponsibleName,
|
||||||
project.create_time as createTime,
|
user3.nick_name as lrr,
|
||||||
project.project_amount as projectAmount,
|
project.create_time as createTime,
|
||||||
profile.height as gd,
|
project.project_amount as projectAmount,
|
||||||
project.contracting_method as contractingMethod,
|
profile.height as gd,
|
||||||
project.manager_execution_phone as managerExecutionPhone,
|
project.contracting_method as contractingMethod,
|
||||||
project.gov_filing_project_name as govFilingProjectName,
|
project.manager_execution_phone as managerExecutionPhone,
|
||||||
project.business_model as businessModel
|
project.gov_filing_project_name as govFilingProjectName,
|
||||||
|
project.business_model as businessModel
|
||||||
|
|
||||||
FROM xzd_project as project
|
FROM xzd_project as project
|
||||||
|
|
||||||
@ -58,57 +59,57 @@
|
|||||||
|
|
||||||
<where>
|
<where>
|
||||||
|
|
||||||
<if test='ssgs != null and projectAttribute != ""'>
|
<if test='ssgs != null and projectAttribute != ""'>
|
||||||
AND project.ssgs = #{ssgs}
|
AND project.ssgs = #{ssgs}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test='projectNumber != null and projectNumber != ""'>
|
<if test='projectNumber != null and projectNumber != ""'>
|
||||||
AND project.project_number LIKE CONCAT('%',#{projectNumber},'%')
|
AND project.project_number LIKE CONCAT('%',#{projectNumber},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="cityCode != null and cityCode != ''">
|
<if test="cityCode != null and cityCode != ''">
|
||||||
AND project.city_code = #{cityCode}
|
AND project.city_code = #{cityCode}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test='projectName != null and projectName != ""'>
|
<if test='projectName != null and projectName != ""'>
|
||||||
AND project.project_name LIKE CONCAT('%',#{projectName},'%')
|
AND project.project_name LIKE CONCAT('%',#{projectName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test='managementOrganization != null and managementOrganization != ""'>
|
<if test='managementOrganization != null and managementOrganization != ""'>
|
||||||
AND project.management_organization = #{managementOrganization}
|
AND project.management_organization = #{managementOrganization}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test='constructionUnit != null and constructionUnit != ""'>
|
<if test='constructionUnit != null and constructionUnit != ""'>
|
||||||
AND project.construction_unit = #{constructionUnit}
|
AND project.construction_unit = #{constructionUnit}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test='gj != null and gj != ""'>
|
<if test='gj != null and gj != ""'>
|
||||||
AND profile.country = #{gj}
|
AND profile.country = #{gj}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test='sheng != null and sheng != ""'>
|
<if test='sheng != null and sheng != ""'>
|
||||||
AND profile.province = #{sheng}
|
AND profile.province = #{sheng}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test='cs != null and cs != ""'>
|
<if test='cs != null and cs != ""'>
|
||||||
AND profile.city = #{cs}
|
AND profile.city = #{cs}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test='qx != null and qx != ""'>
|
<if test='qx != null and qx != ""'>
|
||||||
AND profile.district = #{qx}
|
AND profile.district = #{qx}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test='xmbajl != null and xmbajl != ""'>
|
<if test='xmbajl != null and xmbajl != ""'>
|
||||||
AND approval1.id = #{xmbajl}
|
AND approval1.id = #{xmbajl}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test='selfId != null and selfId != ""'>
|
<if test='selfId != null and selfId != ""'>
|
||||||
AND project.id != #{selfId}
|
AND project.id != #{selfId}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test='constructionUnit != null and constructionUnit != ""'>
|
<if test='constructionUnit != null and constructionUnit != ""'>
|
||||||
AND project.construction_unit = #{constructionUnit}
|
AND project.construction_unit = #{constructionUnit}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user