Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

tags/24080901
CMM 1 anno fa
parent
commit
9ba964366c
31 ha cambiato i file con 635 aggiunte e 134 eliminazioni
  1. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertAdminExpertManageAssembler.java
  2. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAdminManageMapper.java
  3. +18
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAdminManageMapper.xml
  4. +21
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertAdminManageServiceImpl.java
  5. +8
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/GovBusinessStripManage.java
  6. +15
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/mapper/ProvincialGovBusinessStripMapper.java
  7. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/mapper/ProvincialGovBusinessStripMapper.xml
  8. +29
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/model/entity/ProvincialGovBusinessStrip.java
  9. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IProvincialGovBusinessStripService.java
  10. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/ProvincialGovBusinessStripServiceImpl.java
  11. +11
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/OrgSelfAppraisalController.java
  12. +40
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceIndicatorTemplateController.java
  13. +89
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorTemplateManage.java
  14. +70
    -95
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java
  15. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java
  16. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceIndicatorProjectTemplateMapper.java
  17. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceIndicatorProjectTemplateMapper.xml
  18. +35
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectTemplateSaveDTO.java
  19. +46
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java
  20. +10
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java
  21. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectVO.java
  22. +41
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceIndicatorProjectTemplateVO.java
  23. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceIndicatorProjectTemplateService.java
  24. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceIndicatorProjectTemplateServiceImpl.java
  25. +0
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java
  26. +38
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/utils/GenerateProjectCodeUtil.java
  27. +11
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectCollectionManage.java
  28. +12
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectCollectionSaveDTO.java
  29. +12
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectCollection.java
  30. +10
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectCollectionVO.java
  31. +3
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/handler/DefaultExpiredSessionStrategy.java

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertAdminExpertManageAssembler.java Vedi File

@@ -103,6 +103,9 @@ public class ExpertAdminExpertManageAssembler {
}

public List<DictionaryFieldInfo> assembleDictionaryName(List<DictionaryFieldInfo> collect) {
if (CollectionUtil.isEmpty(collect)){
return new ArrayList<>();
}
return collect.stream().peek(r -> {
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode());
if (Objects.nonNull(dictionaryDTO)) {
@@ -113,6 +116,9 @@ public class ExpertAdminExpertManageAssembler {


public List<TagFieldInfo> assembleTagName(List<TagFieldInfo> collect) {
if (CollectionUtil.isEmpty(collect)){
return new ArrayList<>();
}
return collect.stream().peek(r -> {
TagDTO tagDTO = tagCache.getByTagCode(r.getTagCode());
if (Objects.nonNull(tagDTO)) {


+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAdminManageMapper.java Vedi File

@@ -18,4 +18,10 @@ public interface ExpertAdminManageMapper {
* @return
*/
List<Long> listExpertUserId(@Param("query") ListExpertQuery query);

List<Long> listExpertDictionaryUserId(@Param("query") ListExpertQuery query);

List<Long> listExpertTagUserId(@Param("query") ListExpertQuery query);


}

+ 18
- 8
pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAdminManageMapper.xml Vedi File

@@ -103,14 +103,24 @@
<select id="listExpertUserId" resultType="java.lang.Long"
parameterType="com.ningdatech.pmapi.expert.model.query.ListExpertQuery">
<include refid="Expert_Full_Info_Region"/>
<if test="query.expertTagQueryList != null and query.expertTagQueryList.size >0 ">
INTERSECT
<include refid="Expert_Tag_Relation"/>
</if>
<if test="query.expertDictionaryQueryList != null and query.expertDictionaryQueryList.size >0 ">
INTERSECT
<include refid="Expert_Dictionary_Relation"/>
</if>
<!-- <if test="query.expertTagQueryList != null and query.expertTagQueryList.size >0 ">-->
<!-- INTERSECT-->
<!-- <include refid="Expert_Tag_Relation"/>-->
<!-- </if>-->
<!-- <if test="query.expertDictionaryQueryList != null and query.expertDictionaryQueryList.size >0 ">-->
<!-- INTERSECT-->
<!-- <include refid="Expert_Dictionary_Relation"/>-->
<!-- </if>-->
</select>

<select id="listExpertDictionaryUserId" resultType="java.lang.Long"
parameterType="com.ningdatech.pmapi.expert.model.query.ListExpertQuery">
<include refid="Expert_Dictionary_Relation"/>
</select>

<select id="listExpertTagUserId" resultType="java.lang.Long"
parameterType="com.ningdatech.pmapi.expert.model.query.ListExpertQuery">
<include refid="Expert_Tag_Relation"/>
</select>

</mapper>

+ 21
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertAdminManageServiceImpl.java Vedi File

@@ -13,6 +13,8 @@ import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo;
import com.ningdatech.pmapi.expert.mapper.ExpertAdminManageMapper;
import com.ningdatech.pmapi.expert.model.cmd.ExpertAdminExpertManageQueryCmd;
import com.ningdatech.pmapi.expert.model.dto.ExpertAdminExpertManageListDTO;
import com.ningdatech.pmapi.expert.model.query.ExpertDictionaryQuery;
import com.ningdatech.pmapi.expert.model.query.ExpertTagQuery;
import com.ningdatech.pmapi.expert.model.query.ListExpertQuery;
import com.ningdatech.pmapi.expert.service.ExpertAdminManageService;
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService;
@@ -42,11 +44,28 @@ public class ExpertAdminManageServiceImpl implements ExpertAdminManageService {
private final IExpertTagService iExpertTagService;
private final ExpertAdminManageMapper expertAdminManageMapper;

private List<Long> listExpertUserId(ListExpertQuery listExpertQuery) {
List<Long> userIdList = expertAdminManageMapper.listExpertUserId(listExpertQuery);

List<ExpertTagQuery> expertTagQueryList = listExpertQuery.getExpertTagQueryList();
if (CollectionUtils.isNotEmpty(expertTagQueryList)) {
List<Long> tagUserIdList = expertAdminManageMapper.listExpertTagUserId(listExpertQuery);
userIdList.retainAll(tagUserIdList);
}

List<ExpertDictionaryQuery> expertDictionaryQueryList = listExpertQuery.getExpertDictionaryQueryList();
if (CollectionUtils.isNotEmpty(expertDictionaryQueryList)) {
List<Long> dictionaryUserIdList = expertAdminManageMapper.listExpertDictionaryUserId(listExpertQuery);
userIdList.retainAll(dictionaryUserIdList);
}
return userIdList;
}


@Override
public CommonPage<ExpertAdminExpertManageListDTO> getExpertLibraryList(ExpertAdminExpertManageQueryCmd req) {
ListExpertQuery listExpertQuery = buildListExpertQuery(req);
List<Long> userIdList = expertAdminManageMapper.listExpertUserId(listExpertQuery);
List<Long> userIdList = listExpertUserId(listExpertQuery);

List<ExpertUserFullInfo> evidenceHasBeenSubmittedExpertInfoList = iExpertUserFullInfoService.list(Wrappers.lambdaQuery(ExpertUserFullInfo.class)
.eq(ExpertUserFullInfo::getUserInfoStep, ExpertUserInfoStepEnum.EVIDENCE_HAS_BEEN_SUBMITTED.getKey()));
@@ -113,6 +132,6 @@ public class ExpertAdminManageServiceImpl implements ExpertAdminManageService {
@Override
public List<Long> filterExpertUserIdList(ExpertAdminExpertManageQueryCmd queryCmd) {
ListExpertQuery listExpertQuery = buildListExpertQuery(queryCmd);
return expertAdminManageMapper.listExpertUserId(listExpertQuery);
return listExpertUserId(listExpertQuery);
}
}

+ 8
- 7
pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/GovBusinessStripManage.java Vedi File

@@ -1,10 +1,13 @@
package com.ningdatech.pmapi.organization.manage;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.organization.entity.GovBusinessStrip;
import com.ningdatech.pmapi.organization.model.entity.ProvincialGovBusinessStrip;
import com.ningdatech.pmapi.organization.model.vo.GovBusinessStripTreeVO;
import com.ningdatech.pmapi.organization.model.vo.ProvincialGovBusinessStripVO;
import com.ningdatech.pmapi.organization.service.IGovBusinessStripService;
import com.ningdatech.pmapi.organization.service.IProvincialGovBusinessStripService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
@@ -25,6 +28,7 @@ public class GovBusinessStripManage {

private final IGovBusinessStripService iGovBusinessStripService;

private final IProvincialGovBusinessStripService provincialGovBusinessStripService;

public List<GovBusinessStripTreeVO> getChildOrganizationList(String parentCode) {
if (Objects.isNull(parentCode)) {
@@ -44,15 +48,12 @@ public class GovBusinessStripManage {
}

public List<ProvincialGovBusinessStripVO> getProvincialGovBusinessStripList(String businessStripName) {
List<ProvincialGovBusinessStripVO> provincialGovBusinessStripVOList = new ArrayList<>();
ProvincialGovBusinessStripVO provincialGovBusinessStripVO = new ProvincialGovBusinessStripVO();
provincialGovBusinessStripVO.setBusinessStripCode("test_provincial_manage_org_code");
provincialGovBusinessStripVO.setBusinessStripName("测试省局条线主管单位");
provincialGovBusinessStripVOList.add(provincialGovBusinessStripVO);
List<ProvincialGovBusinessStrip> strips = provincialGovBusinessStripService.list(Wrappers.lambdaQuery(ProvincialGovBusinessStrip.class)
.orderByAsc(ProvincialGovBusinessStrip::getBusinessStripName));

provincialGovBusinessStripVOList = provincialGovBusinessStripVOList.stream()
return strips.stream()
.filter(b -> StringUtils.isBlank(businessStripName) || b.getBusinessStripName().contains(businessStripName))
.map(p -> BeanUtil.copyProperties(p,ProvincialGovBusinessStripVO.class))
.collect(Collectors.toList());
return provincialGovBusinessStripVOList;
}
}

+ 15
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/mapper/ProvincialGovBusinessStripMapper.java Vedi File

@@ -0,0 +1,15 @@
package com.ningdatech.pmapi.organization.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ningdatech.pmapi.organization.model.entity.ProvincialGovBusinessStrip;

/**
* <p>
* Mapper 接口
* </p>
* @author zpf
* @since 2023-06-25
*/
public interface ProvincialGovBusinessStripMapper extends BaseMapper<ProvincialGovBusinessStrip> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/mapper/ProvincialGovBusinessStripMapper.xml Vedi File

@@ -0,0 +1,5 @@
<?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.ningdatech.pmapi.organization.mapper.ProvincialGovBusinessStripMapper">

</mapper>

+ 29
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/model/entity/ProvincialGovBusinessStrip.java Vedi File

@@ -0,0 +1,29 @@
package com.ningdatech.pmapi.organization.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* @author Liuxinxin
* @since 2023-03-08
*/
@TableName("nd_provincial_gov_business_strip")
@Data
@ApiModel(value = "省级条线实体", description = "省级条线实体")
public class ProvincialGovBusinessStrip {

@ApiModelProperty("主键")
@TableId(type = IdType.AUTO)
private Long id;

@ApiModelProperty("条线code")
private String businessStripCode;

@ApiModelProperty("条线名称")
private String businessStripName;

}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IProvincialGovBusinessStripService.java Vedi File

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.organization.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.organization.model.entity.ProvincialGovBusinessStrip;

/**
* <p>
* 服务类
* </p>
*
* @author zpf
* @since 2023-03-08
*/
public interface IProvincialGovBusinessStripService extends IService<ProvincialGovBusinessStrip> {

}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/ProvincialGovBusinessStripServiceImpl.java Vedi File

@@ -0,0 +1,21 @@
package com.ningdatech.pmapi.organization.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.organization.mapper.ProvincialGovBusinessStripMapper;
import com.ningdatech.pmapi.organization.model.entity.ProvincialGovBusinessStrip;
import com.ningdatech.pmapi.organization.service.IProvincialGovBusinessStripService;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author zpf
* @since 2023-03-08
*/
@Service
public class ProvincialGovBusinessStripServiceImpl extends ServiceImpl<ProvincialGovBusinessStripMapper, ProvincialGovBusinessStrip>
implements IProvincialGovBusinessStripService {

}

+ 11
- 4
pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/OrgSelfAppraisalController.java Vedi File

@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.performance.controller;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.performance.manage.OrgSelfAppraisalManage;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -29,9 +30,15 @@ public class OrgSelfAppraisalController {
return selfAppraisalManage.list(req);
}

@GetMapping("/detail/{id}")
@ApiOperation("当前用户的绩效评价计划详情")
public PerformanceAppraisalVO detail(@PathVariable Long id) {
return selfAppraisalManage.detail(id);
@GetMapping("/pending-list/{planId}")
@ApiOperation("当前绩效评价待自评列表")
public PageVo<PerformanceAppraisalProjectVO> pendingList(@PathVariable Long planId, PerformanceAppraisalListReq req) {
return selfAppraisalManage.pendingList(planId,req);
}

@GetMapping("/appraisaled-list/{planId}")
@ApiOperation("当前绩效评价已自评列表")
public PageVo<PerformanceAppraisalProjectVO> appraisaledList(@PathVariable Long planId,PerformanceAppraisalListReq req) {
return selfAppraisalManage.appraisaledList(planId);
}
}

+ 40
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceIndicatorTemplateController.java Vedi File

@@ -0,0 +1,40 @@
package com.ningdatech.pmapi.performance.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.performance.manage.IndicatorTemplateManage;
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectTemplateSaveDTO;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
import com.ningdatech.pmapi.performance.model.vo.PerformanceIndicatorProjectTemplateVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
* @Classname PerformanceIndicatorTemplateController
* @Description
* @Date 2023/6/25 14:16
* @Author PoffyZhang
*/
@RestController
@RequiredArgsConstructor
@Api(tags = "绩效评价-指标配置")
@RequestMapping("/api/v1/indicator-template")
public class PerformanceIndicatorTemplateController {

private final IndicatorTemplateManage indicatorTemplateManage;

@GetMapping("/project/list")
@ApiOperation("项目指标配置模板列表")
public PageVo<PerformanceIndicatorProjectTemplateVO> projectList(PerformanceAppraisalListReq req) {
return indicatorTemplateManage.projectList(req);
}

@PostMapping("/project/save")
@ApiOperation("项目指标配置模板保存")
public String projectTemplateSave(@Valid @RequestBody PerformanceIndicatorProjectTemplateSaveDTO dto) {
return indicatorTemplateManage.projectTemplateSave(dto);
}
}

+ 89
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorTemplateManage.java Vedi File

@@ -0,0 +1,89 @@
package com.ningdatech.pmapi.performance.manage;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectTemplateSaveDTO;
import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplate;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
import com.ningdatech.pmapi.performance.model.vo.PerformanceIndicatorProjectTemplateVO;
import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateService;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* @Classname IndicatorTemplateManage
* @Description
* @Date 2023/6/26 14:15
* @Author PoffyZhang
*/
@Slf4j
@Component
@AllArgsConstructor
public class IndicatorTemplateManage {
private final IPerformanceIndicatorProjectTemplateService indicatorTemplateService;

/**
* 模板列表
* @param req
* @return
*/
public PageVo<PerformanceIndicatorProjectTemplateVO> projectList(PerformanceAppraisalListReq req) {
Page<PerformanceIndicatorProjectTemplate> page = req.page();
LambdaQueryWrapper<PerformanceIndicatorProjectTemplate> wrapper = Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplate.class)
.like(StringUtils.isNotBlank(req.getTemplateName()), PerformanceIndicatorProjectTemplate::getName, req.getTemplateName())
.eq(StringUtils.isNotBlank(req.getRegionCode()), PerformanceIndicatorProjectTemplate::getRegionCode,req.getRegionCode());
indicatorTemplateService.page(page,wrapper);

if(0L == page.getTotal()){
return PageVo.empty();
}

List<PerformanceIndicatorProjectTemplateVO> res = page.getRecords().stream()
.map(p -> BeanUtil.copyProperties(p, PerformanceIndicatorProjectTemplateVO.class))
.collect(Collectors.toList());

return PageVo.of(res,page.getTotal());
}

/**
* 项目指标 模板保存
* @param dto
* @return
*/
public String projectTemplateSave(PerformanceIndicatorProjectTemplateSaveDTO dto) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
PerformanceIndicatorProjectTemplate template = BeanUtil.copyProperties(dto, PerformanceIndicatorProjectTemplate.class);

if(Objects.nonNull(dto.getId())){
PerformanceIndicatorProjectTemplate old = indicatorTemplateService.getById(dto.getId());
VUtils.isTrue(Objects.isNull(old)).throwMessage("该模板不存在!");
template.setId(old.getId());
}else{
template.setId(null);
template.setCreateOn(LocalDateTime.now());
template.setCreateBy(user.getUsername());
}

template.setUpdateOn(LocalDateTime.now());
template.setUpdateBy(user.getUsername());
if(indicatorTemplateService.saveOrUpdate(template)){
return "保存成功";
}

throw new BizException("保存失败!");
}
}

+ 70
- 95
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java Vedi File

@@ -3,30 +3,29 @@ package com.ningdatech.pmapi.performance.manage;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.performance.convert.PerformanceAppraisalConveter;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisal;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalApplication;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalProjectVO;
import com.ningdatech.pmapi.performance.model.vo.PerformanceAppraisalVO;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalApplicationService;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectService;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalService;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

@@ -61,120 +60,96 @@ public class OrgSelfAppraisalManage {

//当前登录用户 单位code
String empPosUnitCode = user.getEmpPosUnitCode();
projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getBuildOrgCode,empPosUnitCode));
List<Project> projectLists = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getBuildOrgCode, empPosUnitCode));

if(CollUtil.isEmpty(projectLists)){
return PageVo.empty();
}

List<Long> projectIds = projectLists.stream().map(Project::getId).collect(Collectors.toList());

List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.in(PerformanceAppraisalProject::getProjectId, projectIds));
if(CollUtil.isEmpty(paps)){
return PageVo.empty();
}

Set<Long> paIds = paps.stream().map(PerformanceAppraisalProject::getAppraisalId).collect(Collectors.toSet());

Page<PerformanceAppraisal> page = req.page();
LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class)
.like(StringUtils.isNotBlank(req.getName()),PerformanceAppraisal::getName,req.getName())
.ge(Objects.nonNull(req.getStart()),PerformanceAppraisal::getCreateOn,req.getStart())
.le(Objects.nonNull(req.getEnd()),PerformanceAppraisal::getCreateOn,req.getEnd())
.in(PerformanceAppraisal::getId,paIds)
.orderByDesc(PerformanceAppraisal::getUpdateOn);
performanceAppraisalService.page(page,wrapper);
if(0L == page.getTotal()){
return PageVo.empty();
}

List<Long> paIds = page.getRecords().stream().map(PerformanceAppraisal::getId).collect(Collectors.toList());
List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.in(PerformanceAppraisalProject::getAppraisalId, paIds));

Map<String,Project> projectMap = Maps.newHashMap();
Map<Long,List<PerformanceAppraisalProject>> papsGroupMap = Maps.newHashMap();
if(CollUtil.isNotEmpty(paps)){
papsGroupMap = paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId));

List<String> projectCodes = paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toList());
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.in(Project::getProjectCode, projectCodes)
.eq(Project::getNewest, Boolean.TRUE));
if(CollUtil.isNotEmpty(projects)){
projectMap = projects.stream().collect(Collectors.toMap(Project::getProjectCode,p -> p));
}
}

List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.in(PerformanceAppraisalApplication::getAppraisalId, paIds));
Map<Long,ProjectApplication> applicationMap = Maps.newHashMap();
Map<Long,List<PerformanceAppraisalApplication>> paasGroupMap = Maps.newHashMap();
if(CollUtil.isNotEmpty(paas)){
paasGroupMap = paas.stream().collect(Collectors.groupingBy(PerformanceAppraisalApplication::getAppraisalId));

List<Long> applicationIds = paas.stream().map(PerformanceAppraisalApplication::getApplicationId).collect(Collectors.toList());
List<ProjectApplication> apps = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.in(ProjectApplication::getId, applicationIds));
if(CollUtil.isNotEmpty(apps)){
applicationMap = apps.stream().collect(Collectors.toMap(ProjectApplication::getId,a -> a));
}
}

Map<Long, List<PerformanceAppraisalProject>> finalPapsGroupMap = papsGroupMap;
Map<Long,List<PerformanceAppraisalApplication>> finalPaasGroupMap = paasGroupMap;
Map<String,Project> finalProjectMap = projectMap;
Map<Long,ProjectApplication> finalApplicationMap = applicationMap;
List<PerformanceAppraisalVO> res = page.getRecords().stream().map(p -> {
PerformanceAppraisalVO vo = BeanUtil.copyProperties(p,PerformanceAppraisalVO.class);
if(finalPapsGroupMap.containsKey(p.getId())){
vo.setProjects(PerformanceAppraisalConveter.convertProjects(finalPapsGroupMap.get(p.getId()),finalProjectMap));
}
if(finalPaasGroupMap.containsKey(p.getId())){
vo.setApplications(PerformanceAppraisalConveter.convertApplications(finalPaasGroupMap.get(p.getId()),finalApplicationMap));
}
return vo;
}).collect(Collectors.toList());
return PageVo.of(res,page.getTotal());
}

public PerformanceAppraisalVO detail(Long id) {
public PageVo<PerformanceAppraisalProjectVO> pendingList(Long planId, PerformanceAppraisalListReq req) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();

PerformanceAppraisal pa = performanceAppraisalService.getById(id);
VUtils.isTrue(Objects.isNull(pa)).throwMessage("该计划不存在");
PerformanceAppraisal plan = performanceAppraisalService.getById(planId);
VUtils.isTrue(Objects.isNull(plan)).throwMessage("该计划不存在!");

PerformanceAppraisalVO vo = BeanUtil.copyProperties(pa,PerformanceAppraisalVO.class);
//绩效关联的项目
List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId, id));
Map<String,Project> projectMap = Maps.newHashMap();
Map<Long,List<PerformanceAppraisalProject>> papsGroupMap = Maps.newHashMap();
if(CollUtil.isNotEmpty(paps)){
papsGroupMap = paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId));

List<String> projectCodes = paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toList());
List<Project> projects = projectService.list(Wrappers.lambdaQuery(Project.class)
.in(Project::getProjectCode, projectCodes)
.eq(Project::getNewest, Boolean.TRUE));
if(CollUtil.isNotEmpty(projects)){
projectMap = projects.stream().collect(Collectors.toMap(Project::getProjectCode,p -> p));
}
}
.eq(PerformanceAppraisalProject::getAppraisalId, plan.getId()));

//绩效关联的应用
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.eq(PerformanceAppraisalApplication::getAppraisalId, id));
Map<Long,ProjectApplication> applicationMap = Maps.newHashMap();
Map<Long,List<PerformanceAppraisalApplication>> paasGroupMap = Maps.newHashMap();
if(CollUtil.isNotEmpty(paas)){
paasGroupMap = paas.stream().collect(Collectors.groupingBy(PerformanceAppraisalApplication::getAppraisalId));

List<Long> applicationIds = paas.stream().map(PerformanceAppraisalApplication::getApplicationId).collect(Collectors.toList());
List<ProjectApplication> apps = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.in(ProjectApplication::getId, applicationIds));
if(CollUtil.isNotEmpty(apps)){
applicationMap = apps.stream().collect(Collectors.toMap(ProjectApplication::getId,a -> a));
}
if(CollUtil.isEmpty(paps)){
return PageVo.empty();
}
Set<String> projectIds = paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toSet());

Map<Long, List<PerformanceAppraisalProject>> finalPapsGroupMap = papsGroupMap;
Map<Long,List<PerformanceAppraisalApplication>> finalPaasGroupMap = paasGroupMap;
Map<String,Project> finalProjectMap = projectMap;
Map<Long,ProjectApplication> finalApplicationMap = applicationMap;
if(finalPapsGroupMap.containsKey(vo.getId())){
vo.setProjects(PerformanceAppraisalConveter.convertProjects(finalPapsGroupMap.get(vo.getId()),finalProjectMap));
Page<Project> page = req.page();
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class)
.in(Project::getProjectCode, projectIds)
.eq(Project::getNewest, Boolean.TRUE)
.eq(Project::getBuildOrgCode, user.getEmpPosUnitCode())
.like(StringUtils.isNotBlank(req.getProjectName()),Project::getProjectName,req.getProjectName());
projectService.page(page,wrapper);

if(0L == page.getTotal()){
return PageVo.empty();
}
if(finalPaasGroupMap.containsKey(vo.getId())){
vo.setApplications(PerformanceAppraisalConveter.convertApplications(finalPaasGroupMap.get(vo.getId()),finalApplicationMap));

List<PerformanceAppraisalProjectVO> res = page.getRecords().stream()
.map(p -> {
PerformanceAppraisalProjectVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalProjectVO.class);
vo.setCanSelfAppraisal(checkCanSelfAppraisal(plan));
return vo;
})
.collect(Collectors.toList());

return PageVo.of(res,page.getTotal());
}

/**
* 已经自评表
* @param planId
* @return
*/
public PageVo<PerformanceAppraisalProjectVO> appraisaledList(Long planId) {

return PageVo.empty();
}

/**
* 是否可以自评
* @param plan
* @return
*/
private Boolean checkCanSelfAppraisal(PerformanceAppraisal plan) {
if(LocalDateTime.now().compareTo(plan.getSelfAppraisalStart()) > 0 &&
LocalDateTime.now().compareTo(plan.getSelfAppraisalEnd()) < 0){
return Boolean.TRUE;
}
return vo;
return Boolean.FALSE;
}
}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java Vedi File

@@ -80,7 +80,7 @@ public class PerformanceAppraisalPlanManage {
public PageVo<PerformanceAppraisalVO> list(PerformanceAppraisalListReq req) {
Page<PerformanceAppraisal> page = req.page();
LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class)
.like(StringUtils.isNotBlank(req.getName()),PerformanceAppraisal::getName,req.getName())
.like(StringUtils.isNotBlank(req.getPlanName()),PerformanceAppraisal::getName,req.getPlanName())
.ge(Objects.nonNull(req.getStart()),PerformanceAppraisal::getCreateOn,req.getStart())
.le(Objects.nonNull(req.getEnd()),PerformanceAppraisal::getCreateOn,req.getEnd())
.orderByDesc(PerformanceAppraisal::getUpdateOn);


+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceIndicatorProjectTemplateMapper.java Vedi File

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.performance.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplate;

/**
* <p>
* Mapper 接口
* </p>
*
* @author Zpf
* @since 2023-06-03
*/
public interface PerformanceIndicatorProjectTemplateMapper extends BaseMapper<PerformanceIndicatorProjectTemplate> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceIndicatorProjectTemplateMapper.xml Vedi File

@@ -0,0 +1,5 @@
<?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.ningdatech.pmapi.performance.mapper.PerformanceIndicatorProjectTemplateMapper">

</mapper>

+ 35
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectTemplateSaveDTO.java Vedi File

@@ -0,0 +1,35 @@
package com.ningdatech.pmapi.performance.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
* @Classname PerformanceIndicatorProjectTemplateSaveDTO
* @Description 绩效评价考核模板 保存
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "绩效评价考核项目指标模板", description = "绩效评价考核项目指标模板")
public class PerformanceIndicatorProjectTemplateSaveDTO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
private Long id;

@ApiModelProperty("模板名称")
private String name;

@ApiModelProperty("丽水 区域code")
private String regionCode;

@ApiModelProperty("项目年度")
private Integer projectYear;

@ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上")
private Integer amountRange;
}

+ 46
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java Vedi File

@@ -0,0 +1,46 @@
package com.ningdatech.pmapi.performance.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
* @Classname PerformanceIndicatorTemplate
* @Description 绩效评价考核项目指标模板
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@TableName("nd_performance_indicator_project_template")
@ApiModel(value = "绩效评价考核项目指标模板", description = "绩效评价考核项目指标模板")
public class PerformanceIndicatorProjectTemplate implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
@TableId(type = IdType.AUTO)
private Long id;

private LocalDateTime createOn;
private LocalDateTime updateOn;
private String createBy;
private String updateBy;

@ApiModelProperty("模板名称")
private String name;

@ApiModelProperty("丽水 区域code")
private String regionCode;

@ApiModelProperty("项目年度")
private Integer projectYear;

@ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上")
private Integer amountRange;
}

+ 10
- 1
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java Vedi File

@@ -17,11 +17,20 @@ import java.time.LocalDateTime;
public class PerformanceAppraisalListReq extends PagePo {

@ApiModelProperty("计划名称")
private String name;
private String planName;

@ApiModelProperty("开始时间")
private String start;

@ApiModelProperty("结束时间")
private String end;

@ApiModelProperty("项目名称")
private String projectName;

@ApiModelProperty("模板名称")
private String templateName;

@ApiModelProperty("区域code")
private String regionCode;
}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectVO.java Vedi File

@@ -48,4 +48,7 @@ public class PerformanceAppraisalProjectVO implements Serializable {

@ApiModelProperty("预算年度")
private Integer projectYear;

@ApiModelProperty("是否可自评")
private Boolean canSelfAppraisal = Boolean.FALSE;
}

+ 41
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceIndicatorProjectTemplateVO.java Vedi File

@@ -0,0 +1,41 @@
package com.ningdatech.pmapi.performance.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
* @Classname PerformanceIndicatorTemplateVO
* @Description 绩效评价考核项目指标模板
* @Date 2023/6/19 14:02
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "绩效评价考核项目指标模板", description = "绩效评价考核项目指标模板")
public class PerformanceIndicatorProjectTemplateVO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
private Long id;

private LocalDateTime createOn;
private LocalDateTime updateOn;
private String createBy;
private String updateBy;

@ApiModelProperty("模板名称")
private String name;

@ApiModelProperty("丽水 区域code")
private String regionCode;

@ApiModelProperty("项目年度")
private Integer projectYear;

@ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上")
private Integer amountRange;
}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceIndicatorProjectTemplateService.java Vedi File

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.performance.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplate;

/**
* <p>
* 服务类
* </p>
*
* @author PoffyZhang
* @since 2023-06-03
*/
public interface IPerformanceIndicatorProjectTemplateService extends IService<PerformanceIndicatorProjectTemplate> {

}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceIndicatorProjectTemplateServiceImpl.java Vedi File

@@ -0,0 +1,21 @@
package com.ningdatech.pmapi.performance.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.performance.mapper.PerformanceIndicatorProjectTemplateMapper;
import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplate;
import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateService;
import org.springframework.stereotype.Service;

/**
* <p>
* 绩效评价 服务实现类
* </p>
*
* @author ZPF
* @since 2023-06-15
*/
@Service
public class PerformanceIndicatorProjectTemplateServiceImpl extends ServiceImpl<PerformanceIndicatorProjectTemplateMapper, PerformanceIndicatorProjectTemplate>
implements IPerformanceIndicatorProjectTemplateService {

}

+ 0
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java Vedi File

@@ -130,8 +130,6 @@ public class DeclaredProjectManage {
projectInfo.setId(null);
}

// defaultDeclaredProjectManage.startProcess(projectInfo,user,ProjectProcessStageEnum.ORG_INTERNAL_APPROVAL_PROCESS.getCode());

String regionCode = user.getRegionCode();

WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class)


+ 38
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/utils/GenerateProjectCodeUtil.java Vedi File

@@ -10,6 +10,8 @@ import com.ningdatech.pmapi.projectdeclared.contants.DeclaredProjectContant;
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectCollection;
import com.ningdatech.pmapi.projectlib.service.IProjectCollectionService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -31,6 +33,9 @@ public class GenerateProjectCodeUtil {
@Autowired
private IProjectService projectService;

@Autowired
private IProjectCollectionService projectCollectionService;

public String generateProjectCode(ProjectDTO project){
// 获取所属行政区划代码(6位)
String areaCode = project.getAreaCode();
@@ -63,4 +68,37 @@ public class GenerateProjectCodeUtil {
// 生成21位的项目编号
return areaCode + year + fixedNumber + fiscalCode + projectIdStr;
}

public String generateProjectCode(ProjectCollection project){
// 获取所属行政区划代码(6位)
String areaCode = project.getAreaCode();
// 获取建设年度后两位
String year = String.valueOf(project.getProjectYear() % DeclaredProjectContant.Project.YEAR_DRAW_SURPLUS);
// 9-12位固定
String fixedNumber = DeclaredProjectContant.Project.FIXED_NUMBER;
// 获取公司的财政编码
CompanyFiscalCode companyFiscalCode = companyFiscalCodeService.getByOrganizationCode(project.getBuildOrgCode());

// 从表中查出单位配置的财政编码
if (Objects.isNull(companyFiscalCode)){
throw new BizException("申报单位未配置财政编码!");
}

String fiscalCode = companyFiscalCode.getFiscalCode();
// 获取项目编号
String projectIdStr;
// 获取项目库当前最大项目序号
List<ProjectCollection> projectList = projectCollectionService.list(Wrappers.lambdaQuery(ProjectCollection.class).orderByDesc(ProjectCollection::getId));
ProjectCollection maxProject = CollUtil.isEmpty(projectList) ? null : projectList.get(0);
Long projectId = Objects.isNull(maxProject) ? DeclaredProjectContant.Project.MIN_PROJECT_ID : maxProject.getId() + 1;
if (projectId > DeclaredProjectContant.Project.MAX_PROJECT_ID){
// 超过999的项目号从1开始 1
Long newProjectId = projectId % DeclaredProjectContant.Project.MAX_PROJECT_ID;
projectIdStr = String.format(StrPool.FORMAT_NUMBER_THREE, newProjectId);
}else {
projectIdStr = String.format(StrPool.FORMAT_NUMBER_THREE, projectId);
}
// 生成21位的项目编号
return areaCode + year + fixedNumber + fiscalCode + projectIdStr;
}
}

+ 11
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectCollectionManage.java Vedi File

@@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.common.constant.RegionConst;
import com.ningdatech.pmapi.common.helper.RegionCacheHelper;
import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectCollectionSaveDTO;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectCollection;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
@@ -40,6 +42,8 @@ public class ProjectCollectionManage {

private final RegionCacheHelper regionCacheHelper;

private final GenerateProjectCodeUtil generateProjectCodeUtil;

/**
* 项目归集
* @param req
@@ -57,7 +61,7 @@ public class ProjectCollectionManage {

LambdaQueryWrapper<ProjectCollection> wrapper = Wrappers.lambdaQuery(ProjectCollection.class)
.like(StringUtils.isNotBlank(req.getProjectName()), ProjectCollection::getProjectName, req.getProjectName())
.like(StringUtils.isNotBlank(req.getBuildOrgName()), ProjectCollection::getBuildOrgName, req.getBuildOrgName())
.like(StringUtils.isNotBlank(req.getBuildOrgName()), ProjectCollection::getBuildOrg, req.getBuildOrgName())
.eq(Objects.nonNull(buildOrgCode), ProjectCollection::getBuildOrgCode, buildOrgCode);
//处理 行政区域
if(StringUtils.isNotBlank(req.getRegionCode())){
@@ -75,7 +79,11 @@ public class ProjectCollectionManage {
}

List<ProjectCollectionVO> res = page.getRecords().stream()
.map(record -> BeanUtil.copyProperties(record,ProjectCollectionVO.class))
.map(record -> {
ProjectCollectionVO vo = BeanUtil.copyProperties(record, ProjectCollectionVO.class);
vo.setArea(regionCacheHelper.getDisplayName(record.getAreaCode(), RegionConst.RL_COUNTY));
return vo;
})
.collect(Collectors.toList());

return PageVo.of(res,page.getTotal());
@@ -106,6 +114,7 @@ public class ProjectCollectionManage {
VUtils.isTrue(Objects.isNull(old)).throwMessage("该项目归集不存在!");
projectCollection.setId(dto.getId());
}else{
projectCollection.setProjectCode(generateProjectCodeUtil.generateProjectCode(projectCollection));
projectCollection.setCreateBy(user.getUsername());
projectCollection.setCreateOn(LocalDateTime.now());
}


+ 12
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectCollectionSaveDTO.java Vedi File

@@ -58,12 +58,12 @@ public class ProjectCollectionSaveDTO implements Serializable {
@ApiModelProperty("项目联系人手机号码")
private String contactPhone;

@ApiModelProperty("建设单位名称")
private String buildOrgName;

@ApiModelProperty("建设单位统一社会信用代码")
private String orgCreditCode;

@ApiModelProperty("建设单位名称")
private String buildOrg;

@ApiModelProperty("公司编码code")
private String buildOrgCode;

@@ -73,6 +73,9 @@ public class ProjectCollectionSaveDTO implements Serializable {
@ApiModelProperty("建设类型 1软件,2硬件,3服务")
private Integer constructionType;

@ApiModelProperty("预算来源")
private Integer budgetSource;

@ApiModelProperty("是否首次新建 0:否 1:是")
private Integer isFirst;

@@ -142,6 +145,12 @@ public class ProjectCollectionSaveDTO implements Serializable {
@ApiModelProperty("主管部门Code")
private String superOrgCode;

@ApiModelProperty("上级条线主管部门")
private String higherSuperOrg;

@ApiModelProperty("上级主管部门Code")
private String higherSuperOrgCode;

private String projectTypeName;

public String getProjectTypeName() {


+ 12
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectCollection.java Vedi File

@@ -59,7 +59,7 @@ public class ProjectCollection implements Serializable {
private String contactPhone;

@ApiModelProperty("建设单位名称")
private String buildOrgName;
private String buildOrg;

@ApiModelProperty("建设单位统一社会信用代码")
private String orgCreditCode;
@@ -73,6 +73,9 @@ public class ProjectCollection implements Serializable {
@ApiModelProperty("建设类型 1软件,2硬件,3服务")
private Integer constructionType;

@ApiModelProperty("预算来源")
private Integer budgetSource;

@ApiModelProperty("是否首次新建 0:否 1:是")
private Integer isFirst;

@@ -141,9 +144,15 @@ public class ProjectCollection implements Serializable {
@ApiModelProperty("监理单位统一信用编码")
private String supervisorOrgCreditCode;

@ApiModelProperty("主管部门名称")
@ApiModelProperty("本级主管部门名称")
private String superOrg;

@ApiModelProperty("主管部门Code")
@ApiModelProperty("本级主管部门Code")
private String superOrgCode;

@ApiModelProperty("上级条线主管部门")
private String higherSuperOrg;

@ApiModelProperty("上级主管部门Code")
private String higherSuperOrgCode;
}

+ 10
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectCollectionVO.java Vedi File

@@ -59,7 +59,7 @@ public class ProjectCollectionVO implements Serializable {
private String contactPhone;

@ApiModelProperty("建设单位名称")
private String buildOrgName;
private String buildOrg;

@ApiModelProperty("建设单位统一社会信用代码")
private String orgCreditCode;
@@ -73,6 +73,9 @@ public class ProjectCollectionVO implements Serializable {
@ApiModelProperty("建设类型 1软件,2硬件,3服务")
private Integer constructionType;

@ApiModelProperty("预算来源")
private Integer budgetSource;

@ApiModelProperty("是否首次新建 0:否 1:是")
private Integer isFirst;

@@ -147,6 +150,12 @@ public class ProjectCollectionVO implements Serializable {
@ApiModelProperty("主管部门Code")
private String superOrgCode;

@ApiModelProperty("上级条线主管部门")
private String higherSuperOrg;

@ApiModelProperty("上级主管部门Code")
private String higherSuperOrgCode;

private String projectTypeName;

public String getProjectTypeName() {


+ 3
- 5
pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/handler/DefaultExpiredSessionStrategy.java Vedi File

@@ -6,11 +6,11 @@ import com.ningdatech.pmapi.user.security.auth.errorcode.AuthErrorCodeEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.web.session.SessionInformationExpiredEvent;
import org.springframework.security.web.session.SessionInformationExpiredStrategy;
import org.springframework.stereotype.Component;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@@ -29,11 +29,9 @@ public class DefaultExpiredSessionStrategy implements SessionInformationExpiredS

@Override
public void onExpiredSessionDetected(SessionInformationExpiredEvent sessionInformationExpiredEvent)
throws IOException, ServletException {
if (LOG.isInfoEnabled()) {
LOG.info("session is expired");
}
throws IOException {
HttpServletResponse response = sessionInformationExpiredEvent.getResponse();
response.setStatus(HttpStatus.UNAUTHORIZED.value());
response.setContentType("application/json;charset=UTF-8");
response.getWriter().write(objectMapper.writeValueAsString(
ApiResponse.of(AuthErrorCodeEnum.SESSION_EXPIRED.getCode(), AuthErrorCodeEnum.SESSION_EXPIRED.getMsg(), null)));


Loading…
Annulla
Salva