| New file |
| | |
| | | package com.ycl.controller; |
| | | |
| | | import com.ycl.common.group.Update; |
| | | import com.ycl.common.group.Add; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import com.ycl.service.ProjectEngineeringService; |
| | | import com.ycl.common.base.Result; |
| | | import com.ycl.domain.form.ProjectEngineeringForm; |
| | | import com.ycl.domain.query.ProjectEngineeringQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 项目工程 前端控制器 |
| | | * |
| | | * @author xp |
| | | * @since 2025-02-26 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "项目工程", tags = "项目工程管理") |
| | | @RestController |
| | | @RequestMapping("/project-engineering") |
| | | public class ProjectEngineeringController { |
| | | |
| | | private final ProjectEngineeringService projectEngineeringService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | // @PreAuthorize("@ss.hasPermi('projectEngineering:add')") |
| | | public Result add(@RequestBody @Validated(Add.class) ProjectEngineeringForm form) { |
| | | return projectEngineeringService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | // @PreAuthorize("@ss.hasPermi('projectEngineering:edit')") |
| | | public Result update(@RequestBody @Validated(Update.class) ProjectEngineeringForm form) { |
| | | return projectEngineeringService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | // @PreAuthorize("@ss.hasPermi('projectEngineering:del')") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return projectEngineeringService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | // @PreAuthorize("@ss.hasPermi('projectEngineering:del:batch')") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return projectEngineeringService.remove(ids); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | // @PreAuthorize("@ss.hasPermi('projectEngineering:page')") |
| | | public Result page(ProjectEngineeringQuery query) { |
| | | return projectEngineeringService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | // @PreAuthorize("@ss.hasPermi('projectEngineering:detail')") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return projectEngineeringService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | // @PreAuthorize("@ss.hasPermi('projectEngineering:list')") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return projectEngineeringService.all(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.ycl.domain.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | import com.ycl.system.domain.base.AbsEntity; |
| | | import com.ycl.system.domain.base.AbsUUIDEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 项目工程 |
| | | * |
| | | * @author xp |
| | | * @since 2025-02-26 |
| | | */ |
| | | @Data |
| | | @TableName("t_project_engineering") |
| | | public class ProjectEngineering extends AbsUUIDEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("project_info_id") |
| | | /** 项目id */ |
| | | private Long projectInfoId; |
| | | |
| | | @TableField("project_name") |
| | | /** 工程名称 */ |
| | | private String projectName; |
| | | |
| | | @TableField("project_type") |
| | | /** 项目推进类型 */ |
| | | private String projectType; |
| | | |
| | | @TableField("investment_amount") |
| | | /** 投资额 */ |
| | | private String investmentAmount; |
| | | |
| | | @TableField("status") |
| | | /** 状态 */ |
| | | private String status; |
| | | |
| | | |
| | | } |
| | |
| | | /** 投资类别(0企业投资,1政府投资,2外商投资,3境外投资) */ |
| | | private String investType; |
| | | |
| | | // @TableField("project_phase") |
| | | // /** 项目阶段(0储备规划阶段, 1项目前期阶段, 2实施阶段, 3竣工投用阶段) */ |
| | | // private String projectPhase; |
| | | @TableField("project_phase") |
| | | /** 项目阶段(1储备规划阶段, 2项目前期阶段, 3实施阶段, 4竣工投用阶段) */ |
| | | private String projectPhase; |
| | | |
| | | @TableField("tag") |
| | | /** 标签 */ |
| | |
| | | @TableField("competent_department") |
| | | /** 主管部门(对应审批部门id) */ |
| | | private String competentDepartment; |
| | | |
| | | @TableField("competent_department_person") |
| | | /** 主管部门联系人 */ |
| | | private String competentDepartmentPerson; |
| | | |
| | | @TableField("competent_department_phone") |
| | | /** 主管部门联系方式 */ |
| | | private String competentDepartmentPhone; |
| | | |
| | | @TableField("area") |
| | | /** 行政区域 */ |
| | |
| | | @TableField("remark") |
| | | /** 审核信息 */ |
| | | private String remark; |
| | | |
| | | @TableField("industry_competent_department") |
| | | /** 行业主管部门 */ |
| | | private Long industryCompetentDepartment; |
| | | |
| | | @TableField("industry_competent_department_person") |
| | | private Long industryCompetentDepartmentPerson; |
| | | /** 行业主管部门联系人 */ |
| | | private String industryCompetentDepartmentPerson; |
| | | |
| | | @TableField("department_person_phone") |
| | | /** 行业主管部门联系方式 */ |
| | | private String departmentPersonPhone; |
| | | } |
| | |
| | | /** 超长期特别国债 */ |
| | | private String nationalDebt; |
| | | |
| | | @TableField("additional_national_debt") |
| | | /** 2023年增发国债资金 */ |
| | | private String additionalNationalDebt; |
| | | |
| | | @TableField("total_investment") |
| | | /** 项目总投资额 */ |
| | | private String totalInvestment; |
| New file |
| | |
| | | package com.ycl.domain.form; |
| | | |
| | | import com.ycl.common.group.Update; |
| | | import com.ycl.common.group.Add; |
| | | import com.ycl.system.domain.base.AbsForm; |
| | | import com.ycl.domain.entity.ProjectEngineering; |
| | | import com.ycl.system.domain.base.AbsUUIDForm; |
| | | import org.springframework.beans.BeanUtils; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 项目工程表单 |
| | | * |
| | | * @author xp |
| | | * @since 2025-02-26 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "ProjectEngineering表单", description = "项目工程表单") |
| | | public class ProjectEngineeringForm extends AbsUUIDForm { |
| | | |
| | | @NotNull(message = "项目id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("项目id") |
| | | private Long projectInfoId; |
| | | |
| | | @NotBlank(message = "工程名称不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("工程名称") |
| | | private String projectName; |
| | | |
| | | @NotBlank(message = "项目推进类型不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("项目推进类型") |
| | | private String projectType; |
| | | |
| | | @NotBlank(message = "投资额不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("投资额") |
| | | private String investmentAmount; |
| | | |
| | | @NotBlank(message = "状态不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("状态") |
| | | private String status; |
| | | |
| | | public static ProjectEngineering getEntityByForm(@NonNull ProjectEngineeringForm form, ProjectEngineering entity) { |
| | | if(entity == null) { |
| | | entity = new ProjectEngineering(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | @ApiModelProperty("投资类别(0企业投资,1政府投资,2外商投资,3境外投资)") |
| | | private String investType; |
| | | |
| | | @ApiModelProperty("项目阶段(0储备规划阶段, 1项目前期阶段, 2实施阶段, 3竣工投用阶段)") |
| | | @ApiModelProperty("项目阶段(1储备规划阶段, 2项目前期阶段, 3实施阶段, 4竣工投用阶段)") |
| | | private String projectPhase; |
| | | |
| | | @ApiModelProperty("标签") |
| | | private String tag; |
| | | |
| | | @ApiModelProperty("主管部门(对应审批部门id)") |
| | | private List<Long> competentDepartmentList; |
| | | private String competentDepartment; |
| | | |
| | | @ApiModelProperty("主管部门联系人") |
| | | /** 主管部门联系人 */ |
| | | private String competentDepartmentPerson; |
| | | |
| | | @ApiModelProperty("主管部门联系方式") |
| | | /** 主管部门联系方式 */ |
| | | private String competentDepartmentPhone; |
| | | |
| | | @ApiModelProperty("行政区域") |
| | | private String area; |
| | |
| | | @ApiModelProperty("行业主管部门") |
| | | private Long industryCompetentDepartment; |
| | | @ApiModelProperty("行业主管部门联系人") |
| | | private Long industryCompetentDepartmentPerson; |
| | | private String industryCompetentDepartmentPerson; |
| | | @ApiModelProperty("行业主管部门联系方式") |
| | | private String departmentPersonPhone; |
| | | |
| | |
| | | entity = new ProjectInfo(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | //审核部门转换 |
| | | List<Long> competentDepartmentList = form.getCompetentDepartmentList(); |
| | | if(!CollectionUtils.isEmpty(competentDepartmentList)){ |
| | | entity.setCompetentDepartment(StringUtils.join(competentDepartmentList, ",")); |
| | | } |
| | | //资金类型转换 |
| | | List<String> fundTypeList = form.getFundTypeList(); |
| | | if(!CollectionUtils.isEmpty(fundTypeList)){ |
| | | entity.setFundType(StringUtils.join(fundTypeList, ",")); |
| | | } else { |
| | | entity.setFundType(""); |
| | | } |
| | | //重点分类转换 |
| | | List<String> importanceTypeList = form.getImportanceTypeList(); |
| | | if(!CollectionUtils.isEmpty(importanceTypeList)){ |
| | | entity.setImportanceType(StringUtils.join(importanceTypeList, ",")); |
| | | } else { |
| | | entity.setImportanceType(""); |
| | | } |
| | | //管理归口转换 |
| | | List<String> managementCentralizationList = form.getManagementCentralizationList(); |
| | | if(!CollectionUtils.isEmpty(managementCentralizationList)){ |
| | | entity.setManagementCentralization(StringUtils.join(managementCentralizationList, ",")); |
| | | } else { |
| | | entity.setManagementCentralization(""); |
| | | } |
| | | return entity; |
| | | } |
| | |
| | | @ApiModelProperty("超长期特别国债") |
| | | private String nationalDebt; |
| | | |
| | | @ApiModelProperty("2023年增发国债资金") |
| | | private String additionalNationalDebt; |
| | | |
| | | @ApiModelProperty("项目总投资额") |
| | | private String totalInvestment; |
| | | |
| New file |
| | |
| | | package com.ycl.domain.query; |
| | | |
| | | import com.ycl.system.domain.base.AbsQuery; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 项目工程查询 |
| | | * |
| | | * @author xp |
| | | * @since 2025-02-26 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "ProjectEngineering查询参数", description = "项目工程查询参数") |
| | | public class ProjectEngineeringQuery extends AbsQuery { |
| | | |
| | | @ApiModelProperty("主项目") |
| | | private Long projectInfoId; |
| | | |
| | | @ApiModelProperty("工程名") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty("开工状态") |
| | | private String status; |
| | | |
| | | @ApiModelProperty("流程推进类型") |
| | | private String projectType; |
| | | } |
| | | |
| | |
| | | private Integer usedStatus; |
| | | //查询条件主管部门 |
| | | private Long competentDepartment; |
| | | |
| | | @ApiModelProperty("是否是异常项目查询:0 不是 1是") |
| | | private Integer exe; |
| | | |
| | | @ApiModelProperty("是否是项目中心查询:0 不是 1是") |
| | | private Integer center; |
| | | } |
| | | |
| | |
| | | private String fundType; |
| | | |
| | | |
| | | /** 项目阶段(0储备规划阶段, 1项目前期阶段, 2实施阶段, 3竣工投用阶段) */ |
| | | /** 项目阶段(1储备规划阶段, 2项目前期阶段, 3实施阶段, 4竣工投用阶段) */ |
| | | private String projectPhase; |
| | | |
| | | /** 投资类别(0企业投资,1政府投资,2外商投资,3境外投资) */ |
| | |
| | | /** |
| | | * 发起人姓名 |
| | | */ |
| | | private String promoterName; |
| | | private List<String> promoterName; |
| | | |
| | | /** |
| | | * 发起人单位 |
| | | */ |
| | | private String promoterUnitId; |
| | | private List<String> promoterUnitId; |
| | | |
| | | /** |
| | | * 发起人单位名称 |
| | | */ |
| | | private String promoterUnitName; |
| | | private List<String> promoterUnitName; |
| | | |
| | | /** |
| | | * 处理人 |
| New file |
| | |
| | | package com.ycl.domain.vo; |
| | | |
| | | import com.ycl.system.domain.base.AbsUUIDVo; |
| | | import com.ycl.system.domain.base.AbsVo; |
| | | import com.ycl.domain.entity.ProjectEngineering; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 项目工程展示 |
| | | * |
| | | * @author xp |
| | | * @since 2025-02-26 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "项目工程响应数据", description = "项目工程响应数据") |
| | | public class ProjectEngineeringVO extends AbsUUIDVo { |
| | | |
| | | /** 项目id */ |
| | | @ApiModelProperty("项目id") |
| | | private Long projectInfoId; |
| | | |
| | | @ApiModelProperty("主项目名称") |
| | | private String projectInfoName; |
| | | |
| | | /** 工程名称 */ |
| | | @ApiModelProperty("工程名称") |
| | | private String projectName; |
| | | |
| | | /** 项目推进类型 */ |
| | | @ApiModelProperty("项目推进类型") |
| | | private String projectType; |
| | | |
| | | /** 投资额 */ |
| | | @ApiModelProperty("投资额") |
| | | private String investmentAmount; |
| | | |
| | | /** 状态 */ |
| | | @ApiModelProperty("状态") |
| | | private String status; |
| | | |
| | | public static ProjectEngineeringVO getVoByEntity(@NonNull ProjectEngineering entity, ProjectEngineeringVO vo) { |
| | | if(vo == null) { |
| | | vo = new ProjectEngineeringVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("投资类别(0企业投资,1政府投资,2外商投资,3境外投资)") |
| | | private String investType; |
| | | |
| | | /** 项目阶段(0储备规划阶段, 1项目前期阶段, 2实施阶段, 3竣工投用阶段) */ |
| | | @ApiModelProperty("项目阶段(0储备规划阶段, 1项目前期阶段, 2实施阶段, 3竣工投用阶段)") |
| | | /** 项目阶段(1储备规划阶段, 2项目前期阶段, 3实施阶段, 4竣工投用阶段) */ |
| | | @ApiModelProperty("项目阶段(1储备规划阶段, 2项目前期阶段, 3实施阶段, 4竣工投用阶段)") |
| | | private String projectPhase; |
| | | |
| | | /** 标签 */ |
| | |
| | | |
| | | /** 主管部门(对应审批部门id) */ |
| | | @ApiModelProperty("主管部门(对应审批部门id)") |
| | | private List<Long> competentDepartmentList; |
| | | |
| | | |
| | | |
| | | |
| | | private String competentDepartment; |
| | | |
| | | @ApiModelProperty("主管部门联系人") |
| | | /** 主管部门联系人 */ |
| | | private String competentDepartmentPerson; |
| | | |
| | | @ApiModelProperty("主管部门联系方式") |
| | | /** 主管部门联系方式 */ |
| | | private String competentDepartmentPhone; |
| | | |
| | | /** 行政区域 */ |
| | | @ApiModelProperty("行政区域") |
| | | private String area; |
| | |
| | | @ApiModelProperty("行业主管部门") |
| | | private Long industryCompetentDepartment; |
| | | @ApiModelProperty("行业主管部门联系人") |
| | | private Long industryCompetentDepartmentPerson; |
| | | private String industryCompetentDepartmentPerson; |
| | | @ApiModelProperty("行业主管部门联系方式") |
| | | private String departmentPersonPhone; |
| | | |
| | |
| | | } |
| | | |
| | | BeanUtils.copyProperties(entity, vo); |
| | | //主管部门转成list |
| | | String competentDepartment = entity.getCompetentDepartment(); |
| | | if(!StringUtils.isBlank(competentDepartment)){ |
| | | List<Long> list = Arrays.stream(competentDepartment.split(",")) |
| | | .map(Long::parseLong) |
| | | .collect(Collectors.toList()); |
| | | vo.setCompetentDepartmentList(list); |
| | | } |
| | | |
| | | //管理归口转换 |
| | | String managementCentralization = entity.getManagementCentralization(); |
| | | if(!StringUtils.isBlank(managementCentralization)){ |
| | |
| | | } |
| | | //转换字符串集合字段 |
| | | public static void transform(@NonNull ProjectInfoVO vo) { |
| | | //主管部门转成list |
| | | String competentDepartment = vo.getCompetentDepartment(); |
| | | if(!StringUtils.isBlank(competentDepartment)){ |
| | | List<Long> list = Arrays.stream(competentDepartment.split(",")) |
| | | .map(Long::parseLong) |
| | | .collect(Collectors.toList()); |
| | | vo.setCompetentDepartmentList(list); |
| | | } |
| | | //管理归口转换 |
| | | String managementCentralization = vo.getManagementCentralization(); |
| | | if(!StringUtils.isBlank(managementCentralization)){ |
| | |
| | | } |
| | | |
| | | //分类类型转换 |
| | | |
| | | String importanceType = vo.getImportanceType(); |
| | | if (!StringUtils.isBlank(importanceType)) { |
| | | vo.setImportanceTypeList(Arrays.asList(importanceType.split(","))); |
| | |
| | | @ApiModelProperty("超长期特别国债") |
| | | private String nationalDebt; |
| | | |
| | | @ApiModelProperty("2023年增发国债资金") |
| | | private String additionalNationalDebt; |
| | | |
| | | /** 项目总投资额 */ |
| | | @ApiModelProperty("项目总投资额") |
| | | private String totalInvestment; |
| | |
| | | import org.springframework.lang.NonNull; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 流程推进列表信息表展示 |
| | |
| | | |
| | | @ApiModelProperty("流程是否挂起/暂停") |
| | | private boolean suspended; |
| | | |
| | | @ApiModelProperty("投资额") |
| | | private String investmentAmount; |
| | | |
| | | @ApiModelProperty("开工状态") |
| | | private String status; |
| | | |
| | | @ApiModelProperty("工程列表") |
| | | private List<ProjectEngineeringVO> children = new ArrayList<>(); |
| | | } |
| New file |
| | |
| | | package com.ycl.mapper; |
| | | |
| | | import com.ycl.domain.entity.ProjectEngineering; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ycl.domain.vo.ProjectEngineeringVO; |
| | | import com.ycl.domain.form.ProjectEngineeringForm; |
| | | import com.ycl.domain.query.ProjectEngineeringQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 项目工程 Mapper 接口 |
| | | * |
| | | * @author xp |
| | | * @since 2025-02-26 |
| | | */ |
| | | @Mapper |
| | | public interface ProjectEngineeringMapper extends BaseMapper<ProjectEngineering> { |
| | | |
| | | /** |
| | | * id查找项目工程 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ProjectEngineeringVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") ProjectEngineeringQuery query); |
| | | |
| | | } |
| | |
| | | * 分页 |
| | | */ |
| | | @DataScope(deptAlias = "d") |
| | | @InterceptorIgnore(tenantLine = "true") |
| | | // @InterceptorIgnore(tenantLine = "true") |
| | | IPage getPage(@Param("query") ProjectInfoQuery query, IPage page); |
| | | |
| | | @DataScope(deptAlias = "d") |
| New file |
| | |
| | | package com.ycl.service; |
| | | |
| | | import com.ycl.domain.entity.ProjectEngineering; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ycl.common.base.Result; |
| | | import com.ycl.domain.form.ProjectEngineeringForm; |
| | | import com.ycl.domain.query.ProjectEngineeringQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 项目工程 服务类 |
| | | * |
| | | * @author xp |
| | | * @since 2025-02-26 |
| | | */ |
| | | public interface ProjectEngineeringService extends IService<ProjectEngineering> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(ProjectEngineeringForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(ProjectEngineeringForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(ProjectEngineeringQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | } |
| | |
| | | |
| | | import java.io.InputStream; |
| | | import java.lang.reflect.Field; |
| | | import java.math.BigDecimal; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | |
| | | newV.put(task.getTaskDefinitionKey() + "&" + key, variables.get(key)); |
| | | //字典里有就放入流程变量中 |
| | | if (!CollectionUtils.isEmpty(dictList) && dictList.contains(key)) { |
| | | processVariables.put(key,variables.get(key)); |
| | | if ("money".equals(key)) { |
| | | // 万元转元 |
| | | Object w = variables.get(key); |
| | | BigDecimal y = new BigDecimal(w.toString()).multiply(new BigDecimal(10000)); |
| | | processVariables.put(key, y); |
| | | } else { |
| | | processVariables.put(key,variables.get(key)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // 判断前置任务是不是和当前任务为同一个executeId |
| | | // 判断当前任务是否被挂起中 |
| | | String finalProcessInsId = processInsId; |
| | | beforeNodes.stream().filter(node -> { |
| | | beforeNodes = beforeNodes.stream().filter(node -> { |
| | | if (node.getCurrent()) { |
| | | return Boolean.TRUE; |
| | | } |
| | | HistoricTaskInstance beforeTask = historyService.createHistoricTaskInstanceQuery().processInstanceId(finalProcessInsId).finished().taskDefinitionKey(node.getBeforeNodeDefId()).singleResult(); |
| | | return Objects.nonNull(beforeTask); |
| | | }).forEach(node -> { |
| | | }).collect(Collectors.toList()); |
| | | beforeNodes.forEach(node -> { |
| | | if (node.getCurrent()) { |
| | | if (processLogService.taskIsHangup(taskId, finalProcessInsId)) { |
| | | node.setTaskStatus(TaskStatusEnum.HANGUP); |
| New file |
| | |
| | | package com.ycl.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ycl.domain.entity.ProjectEngineering; |
| | | import com.ycl.mapper.ProjectEngineeringMapper; |
| | | import com.ycl.service.ProjectEngineeringService; |
| | | import com.ycl.common.base.Result; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.domain.form.ProjectEngineeringForm; |
| | | import com.ycl.domain.vo.ProjectEngineeringVO; |
| | | import com.ycl.domain.query.ProjectEngineeringQuery; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import com.ycl.framework.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 项目工程 服务实现类 |
| | | * |
| | | * @author xp |
| | | * @since 2025-02-26 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ProjectEngineeringServiceImpl extends ServiceImpl<ProjectEngineeringMapper, ProjectEngineering> implements ProjectEngineeringService { |
| | | |
| | | private final ProjectEngineeringMapper projectEngineeringMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(ProjectEngineeringForm form) { |
| | | ProjectEngineering entity = ProjectEngineeringForm.getEntityByForm(form, null); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(ProjectEngineeringForm form) { |
| | | ProjectEngineering entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result remove(List<String> ids) { |
| | | baseMapper.deleteBatchIds(ids); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result removeById(String id) { |
| | | baseMapper.deleteById(id); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result page(ProjectEngineeringQuery query) { |
| | | IPage<ProjectEngineeringVO> page = PageUtil.getPage(query, ProjectEngineeringVO.class); |
| | | baseMapper.getPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | ProjectEngineeringVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<ProjectEngineering> entities = baseMapper.selectList(null); |
| | | List<ProjectEngineeringVO> vos = entities.stream() |
| | | .map(entity -> ProjectEngineeringVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.common.base.Result; |
| | | import com.ycl.common.config.SysConfig; |
| | | import com.ycl.common.constant.Constants; |
| | | import com.ycl.common.core.domain.BaseEntity; |
| | | import com.ycl.common.core.domain.entity.SysDictData; |
| | | import com.ycl.common.enums.YesOrNo; |
| | | import com.ycl.common.enums.business.FileTypeEnum; |
| | | import com.ycl.common.enums.business.ImportanceTypeEnum; |
| | | import com.ycl.common.enums.business.ProjectCategoryEnum; |
| | |
| | | //添加基本信息 |
| | | ProjectInfo entity = ProjectInfoForm.getEntityByForm(form, null); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | // Long deptId = SecurityUtils.getDeptId(); |
| | | // entity.setProjectOwnerUnit(deptId); |
| | | entity.setCreateBy(userId); |
| | | entity.setUpdateBy(userId); |
| | | //如果是储备项目(未开工项目)不需要审核 |
| | |
| | | } |
| | | baseMapper.insert(entity); |
| | | addPlan(entity.getId()); //添加计划表 |
| | | //添加文件 |
| | | List<File> fileList = form.getFileList(); |
| | | fileList.forEach(item -> { |
| | | item.setBusId(entity.getId()); |
| | | item.setType(FileTypeEnum.PROJECT_INFO); |
| | | }); |
| | | fileService.saveBatch(fileList); |
| | | |
| | | //添加项目中标单位 |
| | | saveUnit(entity.getId(), form.getWinUnitList()); |
| | | List<ProjectInfoWinUnit> projectInfoWinUnits = new ArrayList<>(); |
| | | for (ProjectInfoWinUnitForm winUnitForm : form.getWinUnitList()) { |
| | | ProjectInfoWinUnit projectInfoWinUnit = ProjectInfoWinUnitForm.getEntityByForm(winUnitForm, null); |
| | | projectInfoWinUnit.setId(null); |
| | | projectInfoWinUnit.setProjectInfoId(entity.getId()); |
| | | projectInfoWinUnits.add(projectInfoWinUnit); |
| | | } |
| | | if (!CollectionUtils.isEmpty(projectInfoWinUnits)) { |
| | | projectInfoWinUnitService.saveBatch(projectInfoWinUnits); |
| | | } |
| | | //添加年度投资计划 |
| | | saveYearPlan(entity.getId(), form.getYearPlanList()); |
| | | List<ProjectInfoYearPlan> projectInfoYearPlans = new ArrayList<>(); |
| | | for (ProjectInfoYearPlanForm yearPlanForm : form.getYearPlanList()) { |
| | | ProjectInfoYearPlan yearPlan = ProjectInfoYearPlanForm.getEntityByForm(yearPlanForm, null); |
| | | yearPlan.setId(null); |
| | | yearPlan.setProjectInfoId(entity.getId()); |
| | | projectInfoYearPlans.add(yearPlan); |
| | | } |
| | | if (!CollectionUtils.isEmpty(projectInfoYearPlans)) { |
| | | projectInfoYearPlanService.saveBatch(projectInfoYearPlans); |
| | | } |
| | | return Result.ok("添加成功").data(entity.getId()); |
| | | } |
| | | |
| | |
| | | public boolean checkProjectNameAndIdIsUnique(ProjectInfo entity,Long updateId){ |
| | | LambdaQueryWrapper<ProjectInfo> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (updateId == null) { |
| | | queryWrapper.eq(ProjectInfo::getProjectName, entity.getProjectName()); |
| | | queryWrapper.eq(ProjectInfo::getDeleted,0); |
| | | if (StringUtils.isNotEmpty(entity.getProjectCode())) { |
| | | queryWrapper.eq(ProjectInfo::getProjectCode, entity.getProjectCode()); |
| | | } |
| | | |
| | | List<ProjectInfo> project = projectInfoMapper.selectList(queryWrapper); |
| | | |
| | | return project == null || project.isEmpty(); |
| | | }else { |
| | | |
| | | List<ProjectInfo> project = projectInfoMapper.checkProjectNameAndIdIsUnique(updateId,entity.getProjectName(),entity.getProjectCode()); |
| | | |
| | | return project == null || project.isEmpty(); |
| | | List<ProjectInfo> list = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProjectInfo::getProjectName, entity.getProjectName()) |
| | | .eq(ProjectInfo::getProjectCode, entity.getProjectCode()) |
| | | .list(); |
| | | return list == null || list.isEmpty(); |
| | | } else { |
| | | List<ProjectInfo> list = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProjectInfo::getProjectName, entity.getProjectName()) |
| | | .eq(ProjectInfo::getProjectCode, entity.getProjectCode()) |
| | | .ne(ProjectInfo::getId, updateId) |
| | | .list(); |
| | | return list == null || list.isEmpty(); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | //更新项目信息 |
| | | baseMapper.updateById(entity); |
| | | List<File> fileList = form.getFileList(); |
| | | fileList.forEach(item -> { |
| | | item.setId(null); |
| | | item.setBusId(entity.getId()); |
| | | item.setType(FileTypeEnum.PROJECT_INFO); |
| | | }); |
| | | //删除原有文件 |
| | | QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>(); |
| | | fileQueryWrapper.eq("type", FileTypeEnum.PROJECT_INFO.getType()); |
| | | fileQueryWrapper.eq("bus_id", entity.getId()); |
| | | fileMapper.delete(fileQueryWrapper); |
| | | //替换成现有 |
| | | fileService.saveBatch(fileList); |
| | | |
| | | //修改项目中标单位 |
| | | //删除原数据 |
| | | QueryWrapper<ProjectInfoWinUnit> unitWrapper = new QueryWrapper<>(); |
| | | unitWrapper.eq("project_info_id", form.getId()); |
| | | projectInfoWinUnitService.remove(unitWrapper); |
| | | new LambdaUpdateChainWrapper<>(projectInfoWinUnitService.getBaseMapper()) |
| | | .eq(ProjectInfoWinUnit::getProjectInfoId, entity.getId()) |
| | | .remove(); |
| | | //添加项目中标单位 |
| | | saveUnit(entity.getId(), form.getWinUnitList()); |
| | | List<ProjectInfoWinUnit> projectInfoWinUnits = new ArrayList<>(); |
| | | for (ProjectInfoWinUnitForm winUnitForm : form.getWinUnitList()) { |
| | | ProjectInfoWinUnit projectInfoWinUnit = ProjectInfoWinUnitForm.getEntityByForm(winUnitForm, null); |
| | | projectInfoWinUnit.setId(null); |
| | | projectInfoWinUnit.setProjectInfoId(entity.getId()); |
| | | projectInfoWinUnits.add(projectInfoWinUnit); |
| | | } |
| | | if (!CollectionUtils.isEmpty(projectInfoWinUnits)) { |
| | | projectInfoWinUnitService.saveBatch(projectInfoWinUnits); |
| | | } |
| | | |
| | | //修改年度投资计划 |
| | | //删除原数据 |
| | | QueryWrapper<ProjectInfoYearPlan> yearPlanWrapper = new QueryWrapper<>(); |
| | | unitWrapper.eq("project_info_id", form.getId()); |
| | | projectInfoYearPlanService.remove(yearPlanWrapper); |
| | | new LambdaUpdateChainWrapper<>(projectInfoYearPlanService.getBaseMapper()) |
| | | .eq(ProjectInfoYearPlan::getProjectInfoId, entity.getId()) |
| | | .remove(); |
| | | //添加年度投资计划 |
| | | saveYearPlan(entity.getId(), form.getYearPlanList()); |
| | | List<ProjectInfoYearPlan> projectInfoYearPlans = new ArrayList<>(); |
| | | for (ProjectInfoYearPlanForm yearPlanForm : form.getYearPlanList()) { |
| | | ProjectInfoYearPlan yearPlan = ProjectInfoYearPlanForm.getEntityByForm(yearPlanForm, null); |
| | | yearPlan.setId(null); |
| | | yearPlan.setProjectInfoId(entity.getId()); |
| | | projectInfoYearPlans.add(yearPlan); |
| | | } |
| | | if (!CollectionUtils.isEmpty(projectInfoYearPlans)) { |
| | | projectInfoYearPlanService.saveBatch(projectInfoYearPlans); |
| | | } |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | |
| | | if (query.getProjectEndTime() != null) { |
| | | query.setProjectEndTime(DateUtils.getDayEnd(query.getProjectEndTime())); |
| | | } |
| | | String projectCategory = query.getProjectCategory(); |
| | | //实施阶段有两个值放在sql处理 |
| | | if (ProjectCategoryEnum.RESERVE.getType().equals(projectCategory)) { |
| | | query.setProjectStatus(ProjectCategoryEnum.RESERVE.getStatus()); |
| | | query.setReserveOrPrevious(ProjectCategoryEnum.RESERVE.getCode()); |
| | | } else if (ProjectCategoryEnum.PREVIOUS.getType().equals(projectCategory)) { |
| | | query.setProjectStatus(ProjectCategoryEnum.PREVIOUS.getStatus()); |
| | | query.setReserveOrPrevious(ProjectCategoryEnum.PREVIOUS.getCode()); |
| | | } else if (ProjectCategoryEnum.FINISH.getType().equals(projectCategory)) { |
| | | query.setProjectStatus(ProjectCategoryEnum.FINISH.getStatus()); |
| | | } else if (ProjectCategoryEnum.EXCEPTION.getType().equals(projectCategory)) { |
| | | //TODO |
| | | //先查出异常流程或者异常进度或者异常计划的projectId和异常种类 |
| | | //通过projectId查出项目数据 |
| | | //补充相应的异常数据(异常种类、异常流程节点等) |
| | | List<ProjectVO> list = new ArrayList<>(); |
| | | return Result.ok().data(list).total(0); |
| | | if (YesOrNo.YES.getCode().equals(query.getCenter())) { |
| | | query.setProjectPhase("6"); |
| | | } |
| | | |
| | | // 异常项目暂时返回空 |
| | | if (YesOrNo.YES.getCode().equals(query.getExe())) { |
| | | return Result.ok().data(new ArrayList<>()).total(0); |
| | | } |
| | | Long userId = SecurityUtils.getUserId(); |
| | | String ancestors = sysDeptMapper.selectAncestors(userId); |
| | | String[] ancestorArr = ancestors.split(","); |
| | |
| | | query.setProjectOwnerUnit(SecurityUtils.getDeptId()); |
| | | //业主 |
| | | query.setRole(0); |
| | | } else if (!CollectionUtils.isEmpty(ancestorList) && ancestorList.contains("102")) { |
| | | } else if ((!CollectionUtils.isEmpty(ancestorList) && ancestorList.contains("102"))) { |
| | | query.setCompetentDepartment(SecurityUtils.getDeptId()); |
| | | //审批 对应主管部门 |
| | | query.setRole(1); |
| | | } else if (SecurityUtils.isAdmin(userId)) { |
| | | query.setRole(3); |
| | | } |
| | | |
| | | IPage<ProjectInfoVO> page = PageUtil.getPage(query, ProjectInfoVO.class); |
| | |
| | | ProjectInfoVO.transform(vo); |
| | | ProjectVO projectVO = new ProjectVO(); |
| | | copyToProjectVO(vo, projectVO); |
| | | List<Long> departmentList = vo.getCompetentDepartmentList(); |
| | | projectVO.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (!CollectionUtils.isEmpty(departmentList) && departmentList.contains(SecurityUtils.getDeptId()))); |
| | | String competentDepartment = vo.getCompetentDepartment(); |
| | | projectVO.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (StringUtils.isNotEmpty(competentDepartment) && competentDepartment.equals(SecurityUtils.getDeptId() + ""))); |
| | | // 翻译项目阶段 |
| | | String phase = ProjectCategoryEnum.getPhaseByProjectStatus(projectVO.getProjectStatus(), projectVO.getProcessId() != null); |
| | | String phase = ProjectCategoryEnum.getPhaseByProjectStatus(projectVO.getProjectPhase()); |
| | | projectVO.setProjectPhase(phase); |
| | | if (StringUtils.isNotEmpty(projectVO.getProjectSubType())) { |
| | | // 翻译项目子类型 |
| | |
| | | ProjectInfo entity = baseMapper.getById(id); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | ProjectInfoVO vo = ProjectInfoVO.getVoByEntity(entity, null); |
| | | List<Long> departmentList = vo.getCompetentDepartmentList(); |
| | | vo.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (!CollectionUtils.isEmpty(departmentList) && departmentList.contains(SecurityUtils.getDeptId()))); |
| | | String competentDepartment = vo.getCompetentDepartment(); |
| | | vo.setAuditRole(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || (StringUtils.isNotEmpty(competentDepartment) && competentDepartment.equals(SecurityUtils.getDeptId() + ""))); |
| | | QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>(); |
| | | fileQueryWrapper.eq("type", FileTypeEnum.PROJECT_INFO.getType()); |
| | | fileQueryWrapper.eq("bus_id", vo.getId()); |
| | | |
| | | List<File> files = fileMapper.selectList(fileQueryWrapper); |
| | | vo.setFileList(files); |
| | | |
| | | //中标单位 |
| | | List<ProjectInfoWinUnitVO> unitVOS = new ArrayList<>(); |
| | |
| | | List<ProjectVO> city = new ArrayList<>(); |
| | | List<ProjectVO> county = new ArrayList<>(); |
| | | projectVOS.forEach(item -> { |
| | | if (ProjectCategoryEnum.RESERVE.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null))) { |
| | | if (ProjectCategoryEnum.RESERVE.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()))) { |
| | | reserve.add(item); |
| | | } else if (ProjectCategoryEnum.PREVIOUS.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null))) { |
| | | } else if (ProjectCategoryEnum.PREVIOUS.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()))) { |
| | | previous.add(item); |
| | | } else if (ProjectCategoryEnum.IMPLEMENT.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null))) { |
| | | } else if (ProjectCategoryEnum.IMPLEMENT.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()))) { |
| | | implement.add(item); |
| | | } else if (ProjectCategoryEnum.FINISH.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null))) { |
| | | } else if (ProjectCategoryEnum.FINISH.getDesc().equals(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase()))) { |
| | | finish.add(item); |
| | | } |
| | | |
| | | if (ImportanceTypeEnum.PROVINCIAL_KEY.getType().equals(item.getImportanceType())) { |
| | | province.add(item); |
| | | } else if (ImportanceTypeEnum.SUINING_KEY.getType().equals(item.getImportanceType())) { |
| | | city.add(item); |
| | | } else if (ImportanceTypeEnum.SHEHONG_KEY.getType().equals(item.getImportanceType())) { |
| | | county.add(item); |
| | | } else // if (ImportanceTypeEnum.NORMAL.getType().equals(item.getImportanceType())) |
| | | { |
| | | if (StringUtils.isBlank(item.getImportanceType())) { |
| | | normal.add(item); |
| | | // 使用contains,因为重点分类可多选,使用,分割存储的 |
| | | } else { |
| | | if (item.getImportanceType().contains(ImportanceTypeEnum.PROVINCIAL_KEY.getType())) { |
| | | province.add(item); |
| | | } |
| | | if (item.getImportanceType().contains(ImportanceTypeEnum.SUINING_KEY.getType())) { |
| | | city.add(item); |
| | | } |
| | | if (item.getImportanceType().contains(ImportanceTypeEnum.SHEHONG_KEY.getType())) { |
| | | county.add(item); |
| | | } |
| | | if (item.getImportanceType().contains(ImportanceTypeEnum.NORMAL.getType())) { |
| | | normal.add(item); |
| | | } |
| | | } |
| | | }); |
| | | //单位先默认为元 |
| | |
| | | ProjectExcelTemplate excel = new ProjectExcelTemplate(); |
| | | BeanUtils.copyProperties(item, excel); |
| | | //项目阶段 |
| | | excel.setProjectPhase(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectStatus(), item.getProcessId() != null)); |
| | | excel.setProjectPhase(ProjectCategoryEnum.getPhaseByProjectStatus(item.getProjectPhase())); |
| | | excelList.add(excel); |
| | | }); |
| | | Set<Integer> indexes = OutputExcelUtils.getSelectFields(query.getFieldList(), ProjectExcelTemplate.class); |
| | |
| | | if (ObjectUtil.isNotNull(form.getProjectInfoForm())) { |
| | | if (ObjectUtil.isNull(form.getProjectInfoForm().getId())) { |
| | | //新增 |
| | | projectId = (Long) ((ProjectInfoServiceImpl) AopContext.currentProxy()).add(form.getProjectInfoForm()).get("data"); |
| | | ProjectInfo entity = ProjectInfoForm.getEntityByForm(form.getProjectInfoForm(), null); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | entity.setCreateBy(userId); |
| | | entity.setUpdateBy(userId); |
| | | //如果是储备项目(未开工项目)不需要审核 |
| | | if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase())) { |
| | | entity.setUsedStatus(ProjectConstant.PASS); |
| | | } |
| | | // 管理员修改的直接通过 |
| | | if (SecurityUtils.isAdmin(SecurityUtils.getUserId())) { |
| | | entity.setUsedStatus(ProjectConstant.PASS); |
| | | } |
| | | if(!checkProjectNameAndIdIsUnique(entity,null)){ |
| | | throw new RuntimeException("项目重复,项目名称、项目码已存在"); |
| | | } |
| | | baseMapper.insert(entity); |
| | | projectId = entity.getId(); |
| | | addPlan(entity.getId()); //添加计划表 |
| | | //添加项目中标单位 |
| | | List<ProjectInfoWinUnit> projectInfoWinUnits = new ArrayList<>(); |
| | | for (ProjectInfoWinUnitForm winUnitForm : form.getProjectInfoForm().getWinUnitList()) { |
| | | ProjectInfoWinUnit projectInfoWinUnit = ProjectInfoWinUnitForm.getEntityByForm(winUnitForm, null); |
| | | projectInfoWinUnit.setId(null); |
| | | projectInfoWinUnit.setProjectInfoId(entity.getId()); |
| | | projectInfoWinUnits.add(projectInfoWinUnit); |
| | | } |
| | | if (!CollectionUtils.isEmpty(projectInfoWinUnits)) { |
| | | projectInfoWinUnitService.saveBatch(projectInfoWinUnits); |
| | | } |
| | | //添加年度投资计划 |
| | | List<ProjectInfoYearPlan> projectInfoYearPlans = new ArrayList<>(); |
| | | for (ProjectInfoYearPlanForm yearPlanForm : form.getProjectInfoForm().getYearPlanList()) { |
| | | ProjectInfoYearPlan yearPlan = ProjectInfoYearPlanForm.getEntityByForm(yearPlanForm, null); |
| | | yearPlan.setId(null); |
| | | yearPlan.setProjectInfoId(entity.getId()); |
| | | projectInfoYearPlans.add(yearPlan); |
| | | } |
| | | if (!CollectionUtils.isEmpty(projectInfoYearPlans)) { |
| | | projectInfoYearPlanService.saveBatch(projectInfoYearPlans); |
| | | } |
| | | } else { |
| | | //更新 |
| | | ((ProjectInfoServiceImpl) AopContext.currentProxy()).update(form.getProjectInfoForm()); |
| | | } |
| | | } |
| | | if (ObjectUtil.isNotNull(form.getProjectInvestmentInfoForm())) { |
| | | if (ObjectUtil.isNull(form.getProjectInvestmentInfoForm().getId())) { |
| | | form.getProjectInvestmentInfoForm().setProjectId(projectId); |
| | | projectInvestmentInfoServiceImpl.add(form.getProjectInvestmentInfoForm()); |
| | | } else { |
| | | projectInvestmentInfoServiceImpl.update(form.getProjectInvestmentInfoForm()); |
| | | } |
| | | } |
| | | if (ObjectUtil.isNotNull(form.getProjectInvestmentFundingForm())) { |
| | | if (ObjectUtil.isNull(form.getProjectInvestmentFundingForm().getId())) { |
| | | form.getProjectInvestmentFundingForm().setProjectId(projectId); |
| | | projectInvestmentFundingServiceImpl.add(form.getProjectInvestmentFundingForm()); |
| | | } else { |
| | | projectInvestmentFundingServiceImpl.update(form.getProjectInvestmentFundingForm()); |
| | | } |
| | | } |
| | | if (ObjectUtil.isNotNull(form.getProjectInvestmentPolicyComplianceForm())) { |
| | | if (ObjectUtil.isNull(form.getProjectInvestmentPolicyComplianceForm().getId())) { |
| | | form.getProjectInvestmentPolicyComplianceForm().setProjectId(projectId); |
| | | projectInvestmentPolicyComplianceServiceImpl.add(form.getProjectInvestmentPolicyComplianceForm()); |
| | | } else { |
| | | projectInvestmentPolicyComplianceServiceImpl.update(form.getProjectInvestmentPolicyComplianceForm()); |
| | | } |
| | | } |
| | | if (ObjectUtil.isNotNull(form.getProjectUnitRegistrationInfoForm())) { |
| | | if (ObjectUtil.isNull(form.getProjectUnitRegistrationInfoForm().getId())) { |
| | | form.getProjectUnitRegistrationInfoForm().setProjectId(projectId); |
| | | projectUnitRegistrationInfoServiceImpl.add(form.getProjectUnitRegistrationInfoForm()); |
| | | } else { |
| | | projectUnitRegistrationInfoServiceImpl.update(form.getProjectUnitRegistrationInfoForm()); |
| | | } |
| | | } |
| | | if (ObjectUtil.isNotNull(form.getDocumentInfoForm())) { |
| | | if (ObjectUtil.isNull(form.getDocumentInfoForm().getProjectId())) { |
| | | return Result.error("请先保存投资管理基本信息"); |
| | | } else { |
| | | addDoc(form.getDocumentInfoForm()); |
| | | } |
| | | } |
| | | ProjectInfo entity = baseMapper.selectById(form.getProjectInfoForm().getId()); |
| | | |
| | | return Result.ok("提交成功"); |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | ProjectInfoForm.getEntityByForm(form.getProjectInfoForm(), entity); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | entity.setUpdateBy(userId); |
| | | //如果是储备项目(未开工项目)不需要审核 |
| | | if (ProjectCategoryEnum.RESERVE.getType().equals(entity.getProjectPhase())) { |
| | | entity.setUsedStatus(ProjectConstant.PASS); |
| | | } |
| | | // 管理员修改的直接通过 |
| | | if (SecurityUtils.isAdmin(SecurityUtils.getUserId())) { |
| | | entity.setUsedStatus(ProjectConstant.PASS); |
| | | } |
| | | if(!checkProjectNameAndIdIsUnique(entity, entity.getId())){ |
| | | throw new RuntimeException("项目重复,项目名称、项目码已存在"); |
| | | } |
| | | //更新项目信息 |
| | | baseMapper.updateById(entity); |
| | | //修改项目中标单位 |
| | | //删除原数据 |
| | | new LambdaUpdateChainWrapper<>(projectInfoWinUnitService.getBaseMapper()) |
| | | .eq(ProjectInfoWinUnit::getProjectInfoId, entity.getId()) |
| | | .remove(); |
| | | //添加项目中标单位 |
| | | List<ProjectInfoWinUnit> projectInfoWinUnits = new ArrayList<>(); |
| | | for (ProjectInfoWinUnitForm winUnitForm : form.getProjectInfoForm().getWinUnitList()) { |
| | | ProjectInfoWinUnit projectInfoWinUnit = ProjectInfoWinUnitForm.getEntityByForm(winUnitForm, null); |
| | | projectInfoWinUnit.setId(null); |
| | | projectInfoWinUnit.setProjectInfoId(entity.getId()); |
| | | projectInfoWinUnits.add(projectInfoWinUnit); |
| | | } |
| | | if (!CollectionUtils.isEmpty(projectInfoWinUnits)) { |
| | | projectInfoWinUnitService.saveBatch(projectInfoWinUnits); |
| | | } |
| | | |
| | | //修改年度投资计划 |
| | | //删除原数据 |
| | | new LambdaUpdateChainWrapper<>(projectInfoYearPlanService.getBaseMapper()) |
| | | .eq(ProjectInfoYearPlan::getProjectInfoId, entity.getId()) |
| | | .remove(); |
| | | //添加年度投资计划 |
| | | List<ProjectInfoYearPlan> projectInfoYearPlans = new ArrayList<>(); |
| | | for (ProjectInfoYearPlanForm yearPlanForm : form.getProjectInfoForm().getYearPlanList()) { |
| | | ProjectInfoYearPlan yearPlan = ProjectInfoYearPlanForm.getEntityByForm(yearPlanForm, null); |
| | | yearPlan.setId(null); |
| | | yearPlan.setProjectInfoId(entity.getId()); |
| | | projectInfoYearPlans.add(yearPlan); |
| | | } |
| | | if (!CollectionUtils.isEmpty(projectInfoYearPlans)) { |
| | | projectInfoYearPlanService.saveBatch(projectInfoYearPlans); |
| | | } |
| | | } |
| | | |
| | | // 更新其它项目信息表 |
| | | if (Objects.nonNull(form.getProjectInvestmentFundingForm())) { |
| | | if (Objects.nonNull(form.getProjectInvestmentFundingForm().getId())) { |
| | | projectInvestmentFundingServiceImpl.update(form.getProjectInvestmentFundingForm()); |
| | | } else { |
| | | form.getProjectInvestmentFundingForm().setProjectId(projectId); |
| | | projectInvestmentFundingServiceImpl.add(form.getProjectInvestmentFundingForm()); |
| | | } |
| | | } |
| | | if (Objects.nonNull(form.getProjectUnitRegistrationInfoForm())) { |
| | | if (Objects.nonNull(form.getProjectUnitRegistrationInfoForm().getId())) { |
| | | projectUnitRegistrationInfoServiceImpl.update(form.getProjectUnitRegistrationInfoForm()); |
| | | } else { |
| | | form.getProjectUnitRegistrationInfoForm().setProjectId(projectId); |
| | | projectUnitRegistrationInfoServiceImpl.add(form.getProjectUnitRegistrationInfoForm()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | return Result.ok("保存成功"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.ycl.common.utils.SecurityUtils; |
| | | import com.ycl.domain.entity.ProjectInvestmentFunding; |
| | | import com.ycl.domain.entity.ProjectInvestmentInfo; |
| | |
| | | */ |
| | | @Override |
| | | public Result detail(Integer id) { |
| | | QueryWrapper<ProjectInvestmentFunding> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("project_id",id); |
| | | ProjectInvestmentFunding entity = baseMapper.selectOne(queryWrapper); |
| | | ProjectInvestmentFunding entity = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProjectInvestmentFunding::getProjectId, id) |
| | | .one(); |
| | | ProjectInvestmentFundingVO vo =new ProjectInvestmentFundingVO(); |
| | | if(entity!=null){ |
| | | vo = ProjectInvestmentFundingVO.getVoByEntity(entity, null); |
| | |
| | | IPage<ProjectProcessVO> page = PageUtil.getPage(query, ProjectProcessVO.class); |
| | | baseMapper.getPage(query, page); |
| | | for (ProjectProcessVO vo : page.getRecords()) { |
| | | vo.setStatus(vo.getProjectStatus()); |
| | | if (Objects.nonNull(vo.getProcessDefId())) { |
| | | ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(vo.getProcessDefId()).singleResult(); |
| | | if (Objects.nonNull(processDefinition)) { |
| | |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | identityService.setAuthenticatedUserId(sysUser.getUserId().toString()); |
| | | variables.put(ProcessConstants.PROCESS_INITIATOR, sysUser.getUserId()); |
| | | //测试容缺 |
| | | variables.put("miss", true); |
| | | // 将该项目的申请人(业主方)作为流程中某些环节的处理人 |
| | | variables.put(ProcessConstants.DATA_LAUNCH, "dept:" + createBy); |
| | | ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefId, projectId + "", variables); |
| | |
| | | this.getRemainingTask(query.getProjectId(), query.getProcessDefId(), projectProcess.getProcessInsId(), query.getTaskName(), (int) query.getCurrentPage(), (int) query.getPageSize(), ok); |
| | | break; |
| | | case TaskTypeConstant.TIMELY: |
| | | this.getTimelyTask(query.getProcessDefId(), projectProcess.getProcessInsId(), query.getTaskName(), (int) query.getCurrentPage(), (int) query.getPageSize(), ok); |
| | | this.getTimelyTask(query.getProjectId(), query.getProcessDefId(), projectProcess.getProcessInsId(), query.getTaskName(), (int) query.getCurrentPage(), (int) query.getPageSize(), ok); |
| | | break; |
| | | case TaskTypeConstant.OVERTIME: |
| | | this.getOvertimeTask(query.getProjectId(), query.getProcessDefId(), projectProcess.getProcessInsId(), query.getTaskName(), (int) query.getCurrentPage(), (int) query.getPageSize(), ok); |
| | |
| | | List<String> handlerNames = new ArrayList<>(2); |
| | | List<Long> handlerUnitIds = new ArrayList<>(2); |
| | | List<String> handlerUnitNames = new ArrayList<>(2); |
| | | List<String> promoterNames = new ArrayList<>(2); |
| | | List<String> promoterUnitNames = new ArrayList<>(2); |
| | | vo.setHandlerId(handlerIds); |
| | | vo.setHandlerName(handlerNames); |
| | | vo.setHandlerUnitId(handlerUnitIds); |
| | | vo.setHandlerUnitName(handlerUnitNames); |
| | | vo.setPromoterName(promoterNames); |
| | | vo.setPromoterUnitName(promoterUnitNames); |
| | | |
| | | this.setCandidateInfo(userTask, vo, projectId, processInsId); |
| | | if (Objects.isNull(task)) { |
| | | // 如果任务在运行时没找到,那么可能为未开始或者已完成,需要从历史任务中再找一下 |
| | | List<HistoricTaskInstance> historicTasks = historyService.createHistoricTaskInstanceQuery() |
| | |
| | | .desc() |
| | | .list(); |
| | | if (CollectionUtils.isEmpty(historicTasks)) { |
| | | vo.setPromoterName("暂无"); |
| | | vo.setPromoterUnitName("暂无"); |
| | | // 未开始的任务,其关联的用户组这些都可以从UserTask中拿到,因为本身未开始的任务是没有task的,所以这里直接查 |
| | | if (StringUtils.isNotBlank(userTask.getAssignee())) { |
| | | vo.setHandlerType(HandlerTypeEnum.USER); |
| | | SysUser sysUser = sysUserService.selectUserById(Long.parseLong(userTask.getAssignee())); |
| | | if (Objects.nonNull(sysUser)) { |
| | | handlerIds.add(sysUser.getUserId()); |
| | | handlerNames.add(sysUser.getNickName()); |
| | | handlerNames.add(this.getUserShowName(sysUser)); |
| | | if (Objects.nonNull(sysUser.getDept())) { |
| | | handlerUnitIds.add(sysUser.getDept().getDeptId()); |
| | | handlerUnitNames.add(sysUser.getDept().getDeptName()); |
| | | } |
| | | } |
| | | |
| | | } else if (CollectionUtil.isNotEmpty(userTask.getCandidateGroups())) { |
| | | List<String> groupIds = userTask.getCandidateGroups(); |
| | | for (String groupId : groupIds) { |
| | | // 处理变量表达式,DATA_LAUNCH只可能是部门不会是角色,因为代表的是业主部门 |
| | | if (groupId.contains(ProcessConstants.DATA_LAUNCH)) { |
| | | vo.setHandlerType(HandlerTypeEnum.DEPT); |
| | | this.varYzReview(vo, projectId, processInsId, HandlerTypeEnum.DEPT); |
| | | this.varYzReview(vo, projectId, processInsId, HandlerTypeEnum.DEPT, 1); |
| | | } else if (groupId.startsWith("dept")) { // 部门的id是加了前缀的如:dept:1 |
| | | vo.setHandlerType(HandlerTypeEnum.DEPT); |
| | | String[] split = groupId.split(":"); |
| | |
| | | if (Objects.nonNull(dept)) { |
| | | handlerUnitIds.add(dept.getDeptId()); |
| | | handlerUnitNames.add(dept.getDeptName()); |
| | | handlerNames.add(this.getDeptLeaderShowName(dept)); |
| | | } |
| | | } |
| | | } else { |
| | |
| | | SysUser handlerUser = sysUserService.selectUserById(handlerUserId); |
| | | if (Objects.nonNull(handlerUser)) { |
| | | handlerIds.add(handlerUserId); |
| | | handlerNames.add(handlerUser.getNickName()); |
| | | vo.setActualHandlerUserId(historicTasks.get(0).getAssignee()); |
| | | vo.setActualHandlerUserName(handlerUser.getNickName()); |
| | | handlerNames.add(this.getUserShowName(handlerUser)); |
| | | if (Objects.nonNull(handlerUser.getDept())) { |
| | | handlerUnitNames.add(handlerUser.getDept().getDeptName()); |
| | | handlerUnitIds.add(handlerUser.getDept().getDeptId()); |
| | | } |
| | | } |
| | | vo.setTaskDefinitionKey(historicTasks.get(0).getTaskDefinitionKey()); |
| | | this.setPromoterAndHandler(vo, historicTasks.get(0).getIdentityLinks()); |
| | |
| | | */ |
| | | private List<CustomerTaskVO> getFinishedProcessTaskInfo(List<UserTask> userTasks, String processInsId, String processDefId) { |
| | | HistoricProcessInstance hisProcess = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInsId).singleResult(); |
| | | if (Objects.isNull(hisProcess)) { |
| | | return new ArrayList<>(); |
| | | } |
| | | List<CustomerTaskVO> vos = userTasks.stream().map(userTask -> { |
| | | CustomerTaskVO vo = new CustomerTaskVO(); |
| | | vo.setProcessInsId(hisProcess.getId()); |
| | |
| | | taskVO.setProcessInsId(task.getProcessInstanceId()); |
| | | taskVO.setTaskDefinitionKey(task.getTaskDefinitionKey()); |
| | | |
| | | // 流程发起人信息 |
| | | this.setPromoterInfo(taskVO); |
| | | |
| | | // 一个任务可能有多个候选人/组,所以需要使用list |
| | | List<Long> handlerIds = new ArrayList<>(2); |
| | | List<String> handlerNames = new ArrayList<>(2); |
| | | List<Long> handlerUnitIds = new ArrayList<>(2); |
| | | List<String> handlerUnitNames = new ArrayList<>(2); |
| | | List<String> promoterNames = new ArrayList<>(2); |
| | | List<String> promoterUnitNames = new ArrayList<>(2); |
| | | taskVO.setHandlerId(handlerIds); |
| | | taskVO.setHandlerName(handlerNames); |
| | | taskVO.setHandlerUnitId(handlerUnitIds); |
| | | taskVO.setHandlerUnitName(handlerUnitNames); |
| | | taskVO.setPromoterName(promoterNames); |
| | | taskVO.setPromoterUnitName(promoterUnitNames); |
| | | |
| | | // 流程处理人信息 |
| | | List<IdentityLink> identityLinksForTask = taskService.getIdentityLinksForTask(task.getId()); |
| | |
| | | SysUser sysUser = sysUserService.selectUserById(Long.parseLong(identityLink.getUserId())); |
| | | if (Objects.nonNull(sysUser)) { |
| | | taskVO.getHandlerId().add(sysUser.getUserId()); |
| | | taskVO.getHandlerName().add(sysUser.getNickName()); |
| | | taskVO.getHandlerName().add(this.getUserShowName(sysUser)); |
| | | if (Objects.nonNull(sysUser.getDept())) { |
| | | taskVO.getHandlerUnitId().add(sysUser.getDept().getDeptId()); |
| | | taskVO.getHandlerUnitName().add(sysUser.getDept().getDeptName()); |
| | | taskVO.getPromoterName().add(this.getUserShowName(sysUser)); |
| | | taskVO.getPromoterUnitName().add(sysUser.getDept().getDeptName()); |
| | | } |
| | | } |
| | | // 绑定的是角色或者部门 |
| | |
| | | if (Objects.nonNull(dept)) { |
| | | taskVO.getHandlerUnitId().add(dept.getDeptId()); |
| | | taskVO.getHandlerUnitName().add(dept.getDeptName()); |
| | | taskVO.getPromoterName().add(this.getDeptLeaderShowName(dept)); |
| | | taskVO.getPromoterUnitName().add(dept.getDeptName()); |
| | | } |
| | | } |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | this.distinctVo(taskVO); |
| | | } |
| | | } |
| | |
| | | * @param result |
| | | * @return |
| | | */ |
| | | private List<CustomerTaskVO> getTimelyTask(String processDefinitionId, String processInsId, String taskName, Integer pageNum, Integer pageSize, Result result) { |
| | | private List<CustomerTaskVO> getTimelyTask(Long projectId, String processDefinitionId, String processInsId, String taskName, Integer pageNum, Integer pageSize, Result result) { |
| | | int startNum = pageSize * (pageNum - 1); |
| | | int endNum = startNum + pageSize; |
| | | |
| | |
| | | List<String> handlerNames = new ArrayList<>(2); |
| | | List<Long> handlerUnitIds = new ArrayList<>(2); |
| | | List<String> handlerUnitNames = new ArrayList<>(2); |
| | | List<String> promoterNames = new ArrayList<>(2); |
| | | List<String> promoterUnitNames = new ArrayList<>(2); |
| | | vo.setHandlerId(handlerIds); |
| | | vo.setHandlerName(handlerNames); |
| | | vo.setHandlerUnitId(handlerUnitIds); |
| | | vo.setHandlerUnitName(handlerUnitNames); |
| | | vo.setPromoterName(promoterNames); |
| | | vo.setPromoterUnitName(promoterUnitNames); |
| | | |
| | | this.setCandidateInfo(userTask, vo, projectId, processInsId); |
| | | HistoricTaskInstance hisTask = keyMap.get(userTask.getId()); |
| | | if (Objects.nonNull(hisTask)) { |
| | | vo.setTaskStatus(TaskStatusEnum.FINISHED); |
| | |
| | | SysUser handlerUser = sysUserService.selectUserById(handlerUserId); |
| | | if (Objects.nonNull(handlerUser)) { |
| | | vo.getHandlerId().add(handlerUserId); |
| | | vo.getHandlerName().add(handlerUser.getNickName()); |
| | | vo.setActualHandlerUserId(hisTask.getAssignee()); |
| | | vo.setActualHandlerUserName(handlerUser.getNickName()); |
| | | vo.getHandlerName().add(this.getUserShowName(handlerUser)); |
| | | } |
| | | vo.setTaskDefinitionKey(hisTask.getTaskDefinitionKey()); |
| | | this.setPromoterAndHandler(vo, hisTask.getIdentityLinks()); |
| | |
| | | }).collect(Collectors.toList()); |
| | | result.data(vos); |
| | | return vos; |
| | | } |
| | | |
| | | /** |
| | | * 用户名称后面跟电话号码 |
| | | * |
| | | * @param user |
| | | * @return |
| | | */ |
| | | private String getUserShowName(SysUser user) { |
| | | return user.getNickName() + (StringUtils.isNotBlank(user.getPhonenumber()) ? "(" + user.getPhonenumber() + ")" : ""); |
| | | } |
| | | |
| | | /** |
| | | * 部门负责人名称后面跟电话号码 |
| | | * |
| | | * @param dept |
| | | * @return |
| | | */ |
| | | private String getDeptLeaderShowName(SysDept dept) { |
| | | return dept.getLeader() + (StringUtils.isNotBlank(dept.getPhone()) ? "(" + dept.getPhone() + ")" : ""); |
| | | } |
| | | |
| | | /** |
| | |
| | | List<String> handlerNames = new ArrayList<>(2); |
| | | List<Long> handlerUnitIds = new ArrayList<>(2); |
| | | List<String> handlerUnitNames = new ArrayList<>(2); |
| | | List<String> promoterNames = new ArrayList<>(2); |
| | | List<String> promoterUnitNames = new ArrayList<>(2); |
| | | vo.setHandlerId(handlerIds); |
| | | vo.setHandlerName(handlerNames); |
| | | vo.setHandlerUnitId(handlerUnitIds); |
| | | vo.setHandlerUnitName(handlerUnitNames); |
| | | vo.setPromoterName(promoterNames); |
| | | vo.setPromoterUnitName(promoterUnitNames); |
| | | |
| | | vo.setProcessInsId(process.getId()); |
| | | vo.setProcessDefId(processDefinitionId); |
| | |
| | | vo.setTaskName(userTask.getName()); |
| | | vo.setProcessName(process.getProcessDefinitionName()); |
| | | vo.setTaskStatus(TaskStatusEnum.NOT_START); |
| | | |
| | | this.setCandidateInfo(userTask, vo, projectId, processInsId); |
| | | |
| | | // 未开始的任务,其关联的用户组这些都可以从UserTask中拿到,因为本身未开始的任务是没有task的,所以这里直接查 |
| | | if (StringUtils.isNotBlank(userTask.getAssignee())) { |
| | | vo.setHandlerType(HandlerTypeEnum.USER); |
| | |
| | | // 处理变量表达式,DATA_LAUNCH只可能是部门不会是角色,因为代表的是业主部门 |
| | | if (groupId.contains(ProcessConstants.DATA_LAUNCH)) { |
| | | vo.setHandlerType(HandlerTypeEnum.DEPT); |
| | | this.varYzReview(vo, projectId, processInsId, HandlerTypeEnum.DEPT); |
| | | this.varYzReview(vo, projectId, processInsId, HandlerTypeEnum.DEPT, 1); |
| | | } else if (groupId.startsWith("dept")) { // 部门的id是加了前缀的如:dept:1 |
| | | vo.setHandlerType(HandlerTypeEnum.DEPT); |
| | | String[] split = groupId.split(":"); |
| | |
| | | |
| | | /** |
| | | * 处理流程变量-业主单位 |
| | | * |
| | | * @param setType 0 设置责任单位 1 设置办理单位 |
| | | * @param vo |
| | | */ |
| | | private void varYzReview(CustomerTaskVO vo, Long projectId, String processInsId, HandlerTypeEnum type) { |
| | | private void varYzReview(CustomerTaskVO vo, Long projectId, String processInsId, HandlerTypeEnum type, Integer setType) { |
| | | ProjectProcess projectProcess = new LambdaQueryChainWrapper<>(projectProcessMapper) |
| | | .eq(ProjectProcess::getProjectId, projectId) |
| | | .eq(ProjectProcess::getProcessInsId, processInsId) |
| | |
| | | } else if (HandlerTypeEnum.DEPT.equals(type)) { |
| | | SysDept dept = deptService.selectDeptById(projectProcess.getDataLaunch()); |
| | | if (Objects.nonNull(dept)) { |
| | | vo.getHandlerUnitId().add(dept.getDeptId()); |
| | | vo.getHandlerUnitName().add(dept.getDeptName()); |
| | | if (setType == 1) { |
| | | vo.getHandlerUnitId().add(dept.getDeptId()); |
| | | vo.getHandlerUnitName().add(dept.getDeptName()); |
| | | vo.getHandlerName().add(this.getDeptLeaderShowName(dept)); |
| | | } else { |
| | | vo.getPromoterUnitName().add(dept.getDeptName()); |
| | | vo.getPromoterName().add(this.getDeptLeaderShowName(dept)); |
| | | } |
| | | } |
| | | } else if (HandlerTypeEnum.ROLE.equals(type)) { |
| | | SysRole role = sysRoleService.selectRoleById(projectProcess.getDataLaunch()); |
| | |
| | | return totalNum - num; |
| | | } |
| | | |
| | | /** |
| | | * 设置候选人信息/责任单位 |
| | | * |
| | | * @param userTask |
| | | * @param vo |
| | | * @param projectId |
| | | * @param processInsId |
| | | */ |
| | | private void setCandidateInfo(UserTask userTask, CustomerTaskVO vo, Long projectId, String processInsId) { |
| | | if (StringUtils.isNotBlank(userTask.getAssignee())) { |
| | | SysUser sysUser = sysUserService.selectUserById(Long.parseLong(userTask.getAssignee())); |
| | | if (Objects.nonNull(sysUser)) { |
| | | if (Objects.nonNull(sysUser.getDept())) { |
| | | // 如果是指定的某个人,那么责任单位是这个人所在的部门 |
| | | vo.getPromoterUnitName().add(sysUser.getDept().getDeptName()); |
| | | vo.getPromoterName().add(this.getUserShowName(sysUser)); |
| | | } |
| | | } |
| | | } else if (CollectionUtil.isNotEmpty(userTask.getCandidateGroups())) { |
| | | List<String> groupIds = userTask.getCandidateGroups(); |
| | | for (String groupId : groupIds) { |
| | | // 处理变量表达式,DATA_LAUNCH只可能是部门不会是角色,因为代表的是业主部门 |
| | | if (groupId.contains(ProcessConstants.DATA_LAUNCH)) { |
| | | vo.setHandlerType(HandlerTypeEnum.DEPT); |
| | | this.varYzReview(vo, projectId, processInsId, HandlerTypeEnum.DEPT, 0); |
| | | } else if (groupId.startsWith("dept")) { // 部门的id是加了前缀的如:dept:1 |
| | | vo.setHandlerType(HandlerTypeEnum.DEPT); |
| | | String[] split = groupId.split(":"); |
| | | if (split.length > 1) { |
| | | // 部门 |
| | | SysDept dept = sysDeptService.selectDeptById(Long.parseLong(split[1])); |
| | | if (Objects.nonNull(dept)) { |
| | | vo.getPromoterUnitName().add(dept.getDeptName()); |
| | | vo.getPromoterName().add(this.getDeptLeaderShowName(dept)); |
| | | } |
| | | } |
| | | } else { |
| | | vo.setHandlerType(HandlerTypeEnum.ROLE); |
| | | SysRole role = sysRoleService.selectRoleById(Long.parseLong(groupId)); |
| | | if (Objects.nonNull(role)) { |
| | | vo.getPromoterUnitName().add(role.getRoleName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置任务的发起人&处理人 只有待办任务和已完成任务才会掉这个方法 |
| | |
| | | * @param identityLinkInfos 如果是已完成的任务,用这个去取关联的用户/用户组 |
| | | */ |
| | | private void setPromoterAndHandler(CustomerTaskVO taskVO, List<? extends IdentityLinkInfo> identityLinkInfos) { |
| | | this.setPromoterInfo(taskVO); |
| | | // this.setPromoterInfo(taskVO); |
| | | |
| | | // 一个任务可能有多个候选人/组,所以需要使用list |
| | | List<Long> handlerIds = new ArrayList<>(2); |
| | |
| | | if (Objects.nonNull(sysUser)) { |
| | | taskVO.setHandlerType(HandlerTypeEnum.USER); |
| | | handlerIds.add(sysUser.getUserId()); |
| | | handlerNames.add(sysUser.getNickName()); |
| | | handlerNames.add(this.getUserShowName(sysUser)); |
| | | if (Objects.nonNull(sysUser.getDept())) { |
| | | handlerUnitIds.add(sysUser.getDept().getDeptId()); |
| | | handlerUnitNames.add(sysUser.getDept().getDeptName()); |
| | |
| | | SysUser sysUser = sysUserService.selectUserById(Long.parseLong(identityLink.getUserId())); |
| | | if (Objects.nonNull(sysUser)) { |
| | | handlerIds.add(sysUser.getUserId()); |
| | | handlerNames.add(sysUser.getNickName()); |
| | | handlerNames.add(this.getUserShowName(sysUser)); |
| | | if (Objects.nonNull(sysUser.getDept())) { |
| | | handlerUnitIds.add(sysUser.getDept().getDeptId()); |
| | | handlerUnitNames.add(sysUser.getDept().getDeptName()); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | this.distinctVo(taskVO); |
| | | } |
| | | |
| | |
| | | * @param taskVO |
| | | */ |
| | | private void setPromoterInfo(CustomerTaskVO taskVO) { |
| | | // 发起人应为上一节点的处理人 |
| | | List<String> beforeNodeKey = taskCommonService.getBeforeNodeInfo(taskVO.getProcessDefId(), taskVO.getTaskDefinitionKey()); |
| | | List<SysUser> userList = beforeNodeKey.stream().map(key -> { |
| | | List<HistoricTaskInstance> historicTaskInstances = historyService.createHistoricTaskInstanceQuery() |
| | | .processInstanceId(taskVO.getProcessInsId()) |
| | | .taskDefinitionKey(key) |
| | | .orderByHistoricTaskInstanceStartTime() |
| | | .desc() |
| | | .list(); // 之所以用list是因为如果某个任务被驳回过,且如果该任务再次执行时会有多条数据,取最新的一条 |
| | | if (!CollectionUtils.isEmpty(historicTaskInstances)) { |
| | | // 实际领取这个任务的人,也就是处理人 |
| | | String assignee = historicTaskInstances.get(0).getAssignee(); |
| | | SysUser startUser = sysUserService.selectUserById(Long.parseLong(assignee)); |
| | | return startUser; |
| | | } else { |
| | | return null; |
| | | } |
| | | }).filter(user -> Objects.nonNull(user)).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(userList)) { |
| | | taskVO.setPromoterName("暂无"); |
| | | taskVO.setPromoterUnitName("暂无"); |
| | | } else { |
| | | taskVO.setPromoterId(userList.stream().map(user -> { |
| | | return user.getUserId() + ""; |
| | | }).collect(Collectors.joining("、"))); |
| | | taskVO.setPromoterName(userList.stream().map(user -> { |
| | | return user.getNickName(); |
| | | }).collect(Collectors.joining("、"))); |
| | | taskVO.setPromoterUnitId(userList.stream().filter(user -> Objects.nonNull(user.getDept())).map(user -> { |
| | | return user.getDept().getDeptId() + ""; |
| | | }).collect(Collectors.joining("、"))); |
| | | taskVO.setPromoterUnitName(userList.stream().filter(user -> Objects.nonNull(user.getDept())).map(user -> { |
| | | return user.getDept().getDeptName() + ""; |
| | | }).collect(Collectors.joining("、"))); |
| | | } |
| | | // // 发起人应为上一节点的处理人 |
| | | // List<String> beforeNodeKey = taskCommonService.getBeforeNodeInfo(taskVO.getProcessDefId(), taskVO.getTaskDefinitionKey()); |
| | | // List<SysUser> userList = beforeNodeKey.stream().map(key -> { |
| | | // List<HistoricTaskInstance> historicTaskInstances = historyService.createHistoricTaskInstanceQuery() |
| | | // .processInstanceId(taskVO.getProcessInsId()) |
| | | // .taskDefinitionKey(key) |
| | | // .orderByHistoricTaskInstanceStartTime() |
| | | // .desc() |
| | | // .list(); // 之所以用list是因为如果某个任务被驳回过,且如果该任务再次执行时会有多条数据,取最新的一条 |
| | | // if (!CollectionUtils.isEmpty(historicTaskInstances)) { |
| | | // // 实际领取这个任务的人,也就是处理人 |
| | | // String assignee = historicTaskInstances.get(0).getAssignee(); |
| | | // SysUser startUser = sysUserService.selectUserById(Long.parseLong(assignee)); |
| | | // return startUser; |
| | | // } else { |
| | | // return null; |
| | | // } |
| | | // }).filter(user -> Objects.nonNull(user)).collect(Collectors.toList()); |
| | | // if (CollectionUtils.isEmpty(userList)) { |
| | | // taskVO.setPromoterName("暂无"); |
| | | // taskVO.setPromoterUnitName("暂无"); |
| | | // } else { |
| | | // taskVO.setPromoterId(userList.stream().map(user -> { |
| | | // return user.getUserId() + ""; |
| | | // }).collect(Collectors.joining("、"))); |
| | | // taskVO.setPromoterName(userList.stream().map(user -> { |
| | | // return this.getUserShowName(user); |
| | | // }).collect(Collectors.joining("、"))); |
| | | // taskVO.setPromoterUnitId(userList.stream().filter(user -> Objects.nonNull(user.getDept())).map(user -> { |
| | | // return user.getDept().getDeptId() + ""; |
| | | // }).collect(Collectors.joining("、"))); |
| | | // taskVO.setPromoterUnitName(userList.stream().filter(user -> Objects.nonNull(user.getDept())).map(user -> { |
| | | // return user.getDept().getDeptName() + ""; |
| | | // }).collect(Collectors.joining("、"))); |
| | | // } |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.ycl.common.utils.SecurityUtils; |
| | | import com.ycl.domain.entity.ProjectInvestmentInfo; |
| | | import com.ycl.domain.entity.ProjectUnitRegistrationInfo; |
| | |
| | | */ |
| | | @Override |
| | | public Result detail(Integer id) { |
| | | QueryWrapper<ProjectUnitRegistrationInfo> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("project_id", id); |
| | | ProjectUnitRegistrationInfo entity = baseMapper.selectOne(queryWrapper); |
| | | ProjectUnitRegistrationInfo entity = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ProjectUnitRegistrationInfo::getProjectId, id) |
| | | .one(); |
| | | ProjectUnitRegistrationInfoVO vo = new ProjectUnitRegistrationInfoVO(); |
| | | if (entity != null) { |
| | | vo = ProjectUnitRegistrationInfoVO.getVoByEntity(entity, null); |
| New file |
| | |
| | | <?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.ycl.mapper.ProjectEngineeringMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ycl.domain.vo.ProjectEngineeringVO"> |
| | | <result column="project_info_id" property="projectInfoId" /> |
| | | <result column="projectInfoName" property="projectInfoName" /> |
| | | <result column="project_name" property="projectName" /> |
| | | <result column="project_type" property="projectType" /> |
| | | <result column="investment_amount" property="investmentAmount" /> |
| | | <result column="status" property="status" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | TPE.project_info_id, |
| | | TPE.project_name, |
| | | TPE.project_type, |
| | | TPE.investment_amount, |
| | | TPE.status, |
| | | TPE.id |
| | | FROM |
| | | t_project_engineering TPE |
| | | WHERE |
| | | TPE.id = #{id} AND TPE.deleted = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | TPE.project_info_id, |
| | | TPE.project_name, |
| | | TPE.project_type, |
| | | TPE.investment_amount, |
| | | TPE.status, |
| | | TPE.id, |
| | | TPI.project_name as projectInfoName |
| | | FROM |
| | | t_project_engineering TPE |
| | | INNER JOIN t_project_info TPI ON TPI.id = TPE.project_info_id AND TPI.deleted = 0 |
| | | WHERE |
| | | TPE.deleted = 0 |
| | | <if test="query.projectName != null and query.projectName != ''"> |
| | | AND TPE.project_name LIKE concat('%', #{query.projectName}, '%') |
| | | </if> |
| | | <if test="query.projectInfoId != null"> |
| | | AND TPE.project_info_id = #{query.projectInfoId} |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | AND TPE.status = #{query.status} |
| | | </if> |
| | | <if test="query.projectType != null and query.projectType != ''"> |
| | | AND TPE.project_type = #{query.projectType} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | TPI.project_phase, |
| | | TPI.tag, |
| | | TPI.competent_department, |
| | | TPI.competent_department_phone, |
| | | TPI.competent_department_person, |
| | | TPI.area, |
| | | TPI.management_centralization, |
| | | TPI.project_approval_type, |
| | |
| | | TPIF.county_fiscal_investment as TPIF_county_fiscal_investment,TPIF.county_special_fund_investment as TPIF_county_special_fund_investment, |
| | | TPIF.domestic_loan_total as TPIF_domestic_loan_total,TPIF.bank_loan as TPIF_bank_loan,TPIF.foreign_investment_total as TPIF_foreign_investment_total, |
| | | TPIF.enterprise_self_raised_total as TPIF_enterprise_self_raised_total,TPIF.other_investment_total as TPIF_other_investment_total, |
| | | TPIF.dept_bond as TPIF_dept_bond,TPIF.national_debt as TPID_national_debt, |
| | | TPIF.dept_bond as TPIF_dept_bond,TPIF.national_debt as TPIF_national_debt, TPIF.additional_national_debt as TPIF_additional_national_debt, |
| | | TPII.be_cross_region as TPII_be_cross_region,TPII.construction_location as TPII_construction_location, |
| | | TPII.detailed_address as TPII_detailed_address,TPII.be_compensation_project as TPII_be_compensation_project,TPII.compensation_reason as TPII_compensation_reason, |
| | | TPII.planned_start_date as TPII_planned_start_date,TPII.expected_completion_date as TPII_expected_completion_date, |
| | |
| | | and TPI.project_type = #{query.projectType} |
| | | </if> |
| | | <if test="query.importanceType !=null and query.importanceType!=''"> |
| | | and TPI.importance_type = #{query.importanceType} |
| | | and ( |
| | | TPI.importance_type like concat('%',#{query.importanceType},'%') |
| | | <if test="query.importanceType == 'normal'"> |
| | | or TPI.importance_type is null or TPI.importance_type = '' |
| | | </if> |
| | | ) |
| | | </if> |
| | | <if test="query.tag !=null and query.tag!=''"> |
| | | and TPI.tag like concat('%',#{query.tag},'%') |
| | |
| | | <if test="query.projectStatus !=null and query.projectStatus!=''"> |
| | | and TPI.project_status = #{query.projectStatus} |
| | | </if> |
| | | <if test="query.projectPhase !=null and query.projectPhase!=''"> |
| | | <if test="query.projectPhase !=null and query.projectPhase!='' and query.projectPhase!=6 and query.projectPhase!=5"> |
| | | and TPI.project_phase = #{query.projectPhase} |
| | | </if> |
| | | <!-- <if test=" assignmentStatus !=null and assignmentStatus!=''">--> |
| | | <!-- and TPI.project_phase = #{projectPhase}--> |
| | | <!-- </if>--> |
| | | /* 只要不是6就查审核通过的,6是项目中心 */ |
| | | <if test="query.projectPhase != 6"> |
| | | and TPI.used_status = 2 |
| | | </if> |
| | | <if test="query.fundType !=null and query.fundType!=''"> |
| | | and TPI.fund_type = #{query.fundType} |
| | | </if> |
| | | <if test="query.projectPhase !=null and query.projectPhase!=''"> |
| | | and TPI.project_phase = #{query.projectPhase} |
| | | </if> |
| | | <if test="query.investType !=null and query.investType!=''"> |
| | | and TPI.invest_type = #{query.investType} |
| | |
| | | <if test="query.projectStartTime !=null and query.projectEndTime !=null"> |
| | | and TPI.create_project_time between #{query.projectStartTime} and #{query.projectEndTime} |
| | | </if> |
| | | <if test="query.reserveOrPrevious != null and query.reserveOrPrevious == 'reserve'"> |
| | | and TPP.process_ins_id is null |
| | | </if> |
| | | <if test="query.reserveOrPrevious != null and query.reserveOrPrevious == 'previous'"> |
| | | and TPP.process_ins_id is not null |
| | | </if> |
| | | <if test="query.projectCategory != 6"> |
| | | and TPI.used_status = 2 |
| | | </if> |
| | | <if test="query.projectCategory == 3"> |
| | | and (TPI.project_status = 'working' or TPI.project_status = 'stop') |
| | | </if> |
| | | <if test="query.projectCategory == 6"> |
| | | <!-- <if test="query.role == 0">--> |
| | | <!-- and TPI.used_status != 2--> |
| | | <!-- <if test="query.reserveOrPrevious != null and query.reserveOrPrevious == 'reserve'">--> |
| | | <!-- and TPP.process_ins_id is null--> |
| | | <!-- </if>--> |
| | | <!-- <if test="query.reserveOrPrevious != null and query.reserveOrPrevious == 'previous'">--> |
| | | <!-- and TPP.process_ins_id is not null--> |
| | | <!-- </if>--> |
| | | <!-- <if test="query.projectPhase == 3">--> |
| | | <!-- and (TPI.project_status = 'working' or TPI.project_status = 'stop')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="query.role != null and query.role == 1">--> |
| | | <!-- and TPI.competent_department = #{query.competentDepartment}--> |
| | | <!-- </if>--> |
| | | <if test="query.role == 1"> |
| | | and TPI.used_status = 1 and FIND_IN_SET(#{query.competentDepartment}, TPI.competent_department) > 0 |
| | | </if> |
| | | </if> |
| | | <!-- 业主数据权限 --> |
| | | <if test="query.role == 0"> |
| | | <if test="query.role != null and query.role == 0"> |
| | | ${query.params.dataScope} |
| | | </if> |
| | | </where> |
| | |
| | | <select id="selectProjectDetailByIds" resultType="com.ycl.domain.vo.ProjectVO"> |
| | | select |
| | | TPI.id as id,TPI.project_name,TPI.project_code,TPI.attract_investment,TPI.content,TPI.construction_nature,TPI.project_type,TPI.project_sub_type,TPI.project_status,TPI.fund_type,TPI.invest_type,TPI.project_phase, |
| | | TPI.tag,TPI.competent_department,TPI.area,TPI.management_centralization,TPI.project_approval_type,TPI.importance_type,TPI.year,TPI.year_invest_amount,TPI.create_project_time,TPI.plan_start_time, |
| | | TPI.tag,TPI.competent_department, TPI.competent_department_person, TPI.competent_department_phone, |
| | | TPI.area,TPI.management_centralization,TPI.project_approval_type,TPI.importance_type,TPI.year,TPI.year_invest_amount,TPI.create_project_time,TPI.plan_start_time, |
| | | TPI.plan_complete_time,TPI.win_unit,TPI.win_amount,TPI.win_time,TPI.project_address,TPI.longitude,TPI.latitude, |
| | | TPI.project_owner_unit,TPI.project_contact_person,TPI.contact,TPI.gmt_create,TPI.gmt_update,TPI.update_by,TPI.create_by, |
| | | TPIF.id,TPIF.project_id,TPIF.total_investment,TPIF.principal,TPIF.government_investment_total,TPIF.central_investment_total,TPIF.central_budget_investment,TPIF.central_fiscal_investment,TPIF.central_special_bond_investment, |
| | |
| | | TPIF.create_by,TPIF.gmt_update,TPIF.update_by, |
| | | TPIF.dept_bond, |
| | | TPIF.national_debt, |
| | | TPIF.additional_national_debt, |
| | | TPII.id,TPII.project_id,TPII.be_cross_region,TPII.construction_location,TPII.detailed_address,TPII.be_compensation_project,TPII.compensation_reason,TPII.planned_start_date, |
| | | TPII.expected_completion_date,TPII.national_industry_classification,TPII.industry_classification,TPII.project_nature,TPII.project_attribute, |
| | | TPII.use_earth,TPII.content_scale,TPII.code,TPII.gmt_create,TPII.create_by,TPII.gmt_update, TPII.update_by, |
| | |
| | | <result column="principal" property="principal" /> |
| | | <result column="dept_bond" property="deptBond" /> |
| | | <result column="national_debt" property="nationalDebt" /> |
| | | <result column="additional_national_debt" property="additionalNationalDebt" /> |
| | | <result column="government_investment_total" property="governmentInvestmentTotal" /> |
| | | <result column="central_investment_total" property="centralInvestmentTotal" /> |
| | | <result column="central_budget_investment" property="centralBudgetInvestment" /> |
| | |
| | | TPIF.project_id, |
| | | TPIF.dept_bond, |
| | | TPIF.national_debt, |
| | | TPIF.additional_national_debt, |
| | | TPIF.total_investment, |
| | | TPIF.principal, |
| | | TPIF.government_investment_total, |
| | |
| | | TPIF.project_id, |
| | | TPIF.dept_bond, |
| | | TPIF.national_debt, |
| | | TPIF.additional_national_debt, |
| | | TPIF.total_investment, |
| | | TPIF.principal, |
| | | TPIF.government_investment_total, |
| | |
| | | <result column="project_code" property="projectCode" /> |
| | | <result column="content" property="content" /> |
| | | <result column="project_type" property="projectType" /> |
| | | <result column="investmentAmount" property="investmentAmount" /> |
| | | <result column="project_status" property="projectStatus" /> |
| | | <result column="fund_type" property="fundType" /> |
| | | <result column="invest_type" property="investType" /> |
| | | <result column="project_phase" property="projectPhase" /> |
| | | <result column="tag" property="tag" /> |
| | | <!-- <result column="competent_department" property="competentDepartment" />--> |
| | | <!-- <result column="management_centralization" property="managementCentralization" />--> |
| | | <result column="project_approval_type" property="projectApprovalType" /> |
| | | <result column="importance_type" property="importanceType" /> |
| | | <!-- <result column="year" property="year" />--> |
| | | <!-- <result column="year_invest_amount" property="yearInvestAmount" />--> |
| | | <result column="create_project_time" property="createProjectTime" /> |
| | | <result column="plan_start_time" property="planStartTime" /> |
| | | <result column="plan_complete_time" property="planCompleteTime" /> |
| | |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="process_def_id" property="processDefId" /> |
| | | <result column="process_ins_id" property="processInsId" /> |
| | | <!-- <association property="id" column=""--> |
| | | </resultMap> |
| | | |
| | | <resultMap id="PageResultMap" type="com.ycl.domain.vo.ProjectProcessVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="project_name" property="projectName" /> |
| | | <result column="project_code" property="projectCode" /> |
| | | <result column="content" property="content" /> |
| | | <result column="project_type" property="projectType" /> |
| | | <result column="investmentAmount" property="investmentAmount" /> |
| | | <result column="project_status" property="projectStatus" /> |
| | | <result column="fund_type" property="fundType" /> |
| | | <result column="invest_type" property="investType" /> |
| | | <result column="project_phase" property="projectPhase" /> |
| | | <result column="tag" property="tag" /> |
| | | <result column="project_approval_type" property="projectApprovalType" /> |
| | | <result column="importance_type" property="importanceType" /> |
| | | <result column="create_project_time" property="createProjectTime" /> |
| | | <result column="plan_start_time" property="planStartTime" /> |
| | | <result column="plan_complete_time" property="planCompleteTime" /> |
| | | <result column="project_address" property="projectAddress" /> |
| | | <result column="longitude" property="longitude" /> |
| | | <result column="latitude" property="latitude" /> |
| | | <result column="project_owner_unit" property="projectOwnerUnit" /> |
| | | <result column="project_owner_unit_name" property="projectOwnerUnitName" /> |
| | | <result column="project_contact_person" property="projectContactPerson" /> |
| | | <result column="contact" property="contact" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="process_def_id" property="processDefId" /> |
| | | <result column="process_ins_id" property="processInsId" /> |
| | | <collection property="children" ofType="com.ycl.domain.vo.ProjectEngineeringVO" select="getProjectEngineering" column="id"></collection> |
| | | </resultMap> |
| | | |
| | | <select id="getProjectEngineering" parameterType="long" resultMap="com.ycl.mapper.ProjectEngineeringMapper.BaseResultMap"> |
| | | SELECT * FROM t_project_engineering WHERE project_info_id = #{id} and deleted = 0 ORDER BY gmt_create |
| | | </select> |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | <select id="getPage" resultMap="PageResultMap"> |
| | | SELECT |
| | | PI.*, |
| | | TPP.process_def_id, |
| | | TPP.process_ins_id, |
| | | TPIF.total_investment as investmentAmount, |
| | | d.dept_name as project_owner_unit_name |
| | | FROM |
| | | t_project_info PI |
| | | LEFT JOIN t_project_investment_funding TPIF ON TPIF.project_id = PI.id AND TPIF.deleted = 0 |
| | | LEFT JOIN t_project_process TPP ON TPP.project_id = PI.id AND TPP.deleted = 0 |
| | | LEFT JOIN sys_dept d ON d.dept_id = PI.project_owner_unit |
| | | <where> |
| | |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-boot-starter</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>jsqlparser</artifactId> |
| | | <groupId>com.github.jsqlparser</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.jsqlparser</groupId> |
| | | <artifactId>jsqlparser</artifactId> |
| | | <version>4.2</version> |
| | | </dependency> |
| | | |
| | | <!-- lombok --> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| New file |
| | |
| | | package com.ycl.common.enums; |
| | | |
| | | /** |
| | | * 是/否 |
| | | * |
| | | * @author ycl |
| | | */ |
| | | public enum YesOrNo |
| | | { |
| | | NO(0, "不是"), |
| | | YES(1, "是") |
| | | ; |
| | | |
| | | private final Integer code; |
| | | private final String info; |
| | | |
| | | YesOrNo(Integer code, String info) |
| | | { |
| | | this.code = code; |
| | | this.info = info; |
| | | } |
| | | |
| | | public Integer getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public String getInfo() |
| | | { |
| | | return info; |
| | | } |
| | | } |
| | |
| | | @AllArgsConstructor |
| | | public enum ProjectCategoryEnum { |
| | | |
| | | RESERVE("1", "pendding", "储备项目","reserve","储备规划阶段"), |
| | | PREVIOUS("2", "pendding","前期项目","previous","项目前期阶段"), |
| | | RESERVE("1", "pendding", "储备项目","reserve","储备阶段"), |
| | | PREVIOUS("2", "pendding","前期项目","previous","前期阶段"), |
| | | IMPLEMENT("3", "working,stop","实施项目","implement","实施阶段"), |
| | | FINISH("4", "finish","竣工项目","finish","竣工投用阶段"), |
| | | FINISH("4", "finish","竣工项目","finish","竣工阶段"), |
| | | EXCEPTION("5", "","异常项目","exception",""); |
| | | |
| | | |
| | |
| | | private final String status; |
| | | private final String name; |
| | | private final String code; |
| | | private final String desc; |
| | | private final String desc; |
| | | |
| | | //判断传入数据是否存在四种项目推进状态 |
| | | public static boolean isValidType(String type) { |
| | |
| | | |
| | | /** |
| | | * 获取项目阶段 |
| | | * @param projectStatus |
| | | * @param hasProcess 是否启动流程 |
| | | * @param projectPhase |
| | | * @return |
| | | */ |
| | | public static String getPhaseByProjectStatus(String projectStatus, boolean hasProcess) { |
| | | public static String getPhaseByProjectStatus(String projectPhase) { |
| | | for (ProjectCategoryEnum projectCategoryEnum : ProjectCategoryEnum.values()) { |
| | | if (hasProcess && PREVIOUS.status.contains(projectStatus)) { |
| | | return PREVIOUS.desc; |
| | | } |
| | | if (projectCategoryEnum.status.contains(projectStatus)) { |
| | | if (projectCategoryEnum.type.equals(projectPhase)) { |
| | | return projectCategoryEnum.desc; |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ycl.common.enums.business.TaskStatusEnum; |
| | | import lombok.Data; |
| | | import org.flowable.bpmn.model.UserTask; |
| | | |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | private Map<String, Object> formJsonObj; |
| | | |
| | | |
| | | /** |
| | | * 任务元数据 |
| | | * |
| | | */ |
| | | private UserTask userTask; |
| | | } |
| | |
| | | formDetailVO.setCanJump(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_JUMP_TEXT)); |
| | | formDetailVO.setCanWait(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_WAIT_TEXT)); |
| | | formDetailVO.setCanHangup(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_HANGUP_TEXT)); |
| | | |
| | | formDetailVO.setUserTask(currentElement); |
| | | defKeys.add(formDetailVO); |
| | | this.beforeNodeInfo(currentElement, defKeys); |
| | | |
| | |
| | | formDetailVO.setBeforeNodeName(incomingFlow.getSourceFlowElement().getName()); |
| | | formDetailVO.setCanJump(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_JUMP_TEXT)); |
| | | formDetailVO.setCanWait(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_WAIT_TEXT)); |
| | | formDetailVO.setUserTask((UserTask) incomingFlow.getSourceFlowElement()); |
| | | defKeys.add(formDetailVO); |
| | | } else { |
| | | beforeNodeInfo(incomingFlow.getSourceFlowElement(), defKeys); |
| | |
| | | formDetailVO.setBeforeNodeName(incomingFlow.getSourceFlowElement().getName()); |
| | | formDetailVO.setCanJump(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_JUMP_TEXT)); |
| | | formDetailVO.setCanWait(this.checkHasExeProperty(currentElement.getExtensionElements().get("properties"), ProcessConstants.EXTENSION_PROPERTY_CAN_WAIT_TEXT)); |
| | | formDetailVO.setUserTask((UserTask) incomingFlow.getSourceFlowElement()); |
| | | defKeys.add(formDetailVO); |
| | | } else { |
| | | beforeNodeInfo(incomingFlow.getSourceFlowElement(), defKeys); |
| | |
| | | |
| | | |
| | | /** |
| | | * 获取当前节点的上一节点id,不反悔当前节点信息,如果前面是并行,那么会返回多个 |
| | | * 获取当前节点的上一节点id,不返回当前节点信息,如果前面是并行,那么会返回多个 |
| | | * |
| | | * @param processDefId 流程定义id |
| | | * @param currentNodeDefId 当前节点定义id |
| | |
| | | `project_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT '项目状态 (0未开工,1已开工,2已竣工,3暂停)', |
| | | `fund_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资金类型(0中预资金,1国债资金,2超长期国债,3地方政府专项债)', |
| | | `invest_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '投资类别(0企业投资,1政府投资,2外商投资,3境外投资)', |
| | | `project_phase` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目阶段(0储备规划阶段, 1项目前期阶段, 2实施阶段, 3竣工投用阶段)', |
| | | `project_phase` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目阶段(1储备规划阶段, 2项目前期阶段, 3实施阶段, 4竣工投用阶段)', |
| | | `tag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签', |
| | | `competent_department` int NULL DEFAULT NULL COMMENT '主管部门(对应审批部门id)', |
| | | `area_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '行政区域', |
| | |
| | | * @author ycl |
| | | */ |
| | | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class},proxyBeanMethods = false) |
| | | @EnableAspectJAutoProxy(exposeProxy = true) |
| | | //@EnableAspectJAutoProxy(exposeProxy = true) |
| | | public class Application |
| | | { |
| | | public static void main(String[] args) |
| | |
| | | private final static Long userPortId = 101L; |
| | | //审批端id |
| | | private final static Long approvalPortId = 102L; |
| | | |
| | | /** |
| | | * 获取部门列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | // @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysDept dept) |
| | | { |
| | |
| | | public Result approvalList() { |
| | | SysDept dept = new SysDept(); |
| | | dept.setParentId(approvalPortId); |
| | | return deptService.all(dept); |
| | | return Result.ok().data(deptService.selectDeptListNoAuth(dept)); |
| | | } |
| | | } |
| | |
| | | configuration: |
| | | shrink-whitespaces-in-sql: true #从SQL中删除多余的空格字符 |
| | | default-enum-type-handler: com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler # 通用枚举处理器 |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 日志打印 |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 日志打印 |
| | | global-config: |
| | | db-config: |
| | | id-type: auto |
| | |
| | | logging: |
| | | level: |
| | | com.ruoyi: debug |
| | | com.ycl: debug |
| | | org.springframework: warn |
| | | org.flowable.engine.impl.persistence.entity.*: debug |
| | | org.flowable.task.service.impl.persistence.entity.*: debug |
| New file |
| | |
| | | package com.ycl.system.domain.base; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author xp |
| | | * @date 2022/11/29 |
| | | */ |
| | | @Data |
| | | public abstract class AbsUUIDEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_UUID) |
| | | private String id; |
| | | |
| | | /** 创建时间 */ |
| | | @TableField(value = "gmt_create", fill = FieldFill.INSERT) |
| | | private Date gmtCreate; |
| | | |
| | | /** 修改时间 */ |
| | | @TableField(value = "gmt_update", fill = FieldFill.INSERT_UPDATE) |
| | | private Date gmtUpdate; |
| | | |
| | | @TableField(value = "deleted", fill = FieldFill.INSERT) |
| | | private Integer deleted; |
| | | |
| | | } |
| New file |
| | |
| | | package com.ycl.system.domain.base; |
| | | |
| | | import com.ycl.common.group.Update; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author xp |
| | | * @date 2022/11/29 |
| | | */ |
| | | @Data |
| | | public abstract class AbsUUIDForm { |
| | | |
| | | @ApiModelProperty(value = "id,修改必传", required = false) |
| | | @NotNull(message = "请选择数据", groups = {Update.class}) |
| | | private String id; |
| | | |
| | | } |
| New file |
| | |
| | | package com.ycl.system.domain.base; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author xp |
| | | * @date 2022/11/29 |
| | | */ |
| | | @Data |
| | | public abstract class AbsUUIDVo { |
| | | |
| | | @ApiModelProperty("id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | private Date gmtCreate; |
| | | |
| | | @ApiModelProperty("修改时间") |
| | | private Date gmtUpdate; |
| | | |
| | | } |
| | |
| | | */ |
| | | public List<SysDept> selectDeptList(SysDept dept); |
| | | |
| | | public List<SysDept> selectDeptListNoAuth(SysDept dept); |
| | | |
| | | /** |
| | | * 根据角色ID查询部门树信息 |
| | | * |
| | |
| | | public List<SysDept> selectDeptList(SysDept dept); |
| | | |
| | | /** |
| | | * 查询部门管理数据-无数据权限 |
| | | * |
| | | * @param dept |
| | | * @return |
| | | */ |
| | | public List<SysDept> selectDeptListNoAuth(SysDept dept); |
| | | |
| | | /** |
| | | * 查询部门树结构信息 |
| | | * |
| | | * @param dept 部门信息 |
| | |
| | | return deptMapper.selectDeptList(dept); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysDept> selectDeptListNoAuth(SysDept dept) { |
| | | return deptMapper.selectDeptListNoAuth(dept); |
| | | } |
| | | |
| | | /** |
| | | * 查询部门树结构信息 |
| | | * |
| | |
| | | order by d.parent_id, d.order_num |
| | | </select> |
| | | |
| | | <select id="selectDeptListNoAuth" parameterType="SysDept" resultMap="SysDeptResult"> |
| | | <include refid="selectDeptVo"/> |
| | | where d.del_flag = '0' |
| | | <if test="parentId != null"> |
| | | AND FIND_IN_SET(#{parentId}, ancestors) > 0 |
| | | </if> |
| | | <if test="deptName != null and deptName != ''"> |
| | | AND dept_name like concat('%', #{deptName}, '%') |
| | | </if> |
| | | order by d.parent_id, d.order_num |
| | | </select> |
| | | |
| | | <select id="selectDeptListByRoleId" resultType="Long"> |
| | | select d.dept_id |
| | | from sys_dept d |
| | |
| | | where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 |
| | | </select> |
| | | <select id="selectAncestors" resultType="java.lang.String"> |
| | | select ancestors |
| | | select SD.ancestors |
| | | from sys_user SU |
| | | INNER JOIN sys_dept SD ON SU.dept_id = SD.dept_id |
| | | where SU.user_id = #{userId} |
| | |
| | | <result property="ancestors" column="ancestors" /> |
| | | <result property="orderNum" column="order_num" /> |
| | | <result property="leader" column="leader" /> |
| | | <result property="phone" column="phone" /> |
| | | <result property="status" column="dept_status" /> |
| | | </resultMap> |
| | | |
| | |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | |
| | | </delete> |
| | | |
| | | <select id="getByDept" resultMap="SysUserResult"> |
| | | select * from sys_user where dept_id = #{deptId} |
| | | select * from sys_user where dept_id = #{deptId} and del_flag = '0' |
| | | </select> |
| | | </mapper> |