Browse Source

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

master
PoffyZhang 1 year ago
parent
commit
324478f7f8
25 changed files with 967 additions and 47 deletions
  1. +200
    -0
      hs_err_pid50732.log
  2. +1
    -1
      ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java
  3. +38
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/constant/BizConst.java
  4. +18
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/OrgSelfAppraisalController.java
  5. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/performance/convert/PerformanceAppraisalConveter.java
  6. +42
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/AppraisalTypeEnum.java
  7. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/helper/TemplateDetailBuildHelper.java
  8. +90
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/helper/impl/TemplateDetailBuildHelperImpl.java
  9. +38
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java
  10. +202
    -22
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java
  11. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java
  12. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalScoreInfoMapper.java
  13. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalScoreInfoMapper.xml
  14. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectTemplateSaveDTO.java
  15. +36
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/ProjectAppraisalDTO.java
  16. +37
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/ProjectAppraisalInfoDTO.java
  17. +28
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProject.java
  18. +64
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalScoreInfo.java
  19. +3
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java
  20. +26
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectVO.java
  21. +43
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectAppraisalIndexDetailVO.java
  22. +3
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java
  23. +15
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectTemplateDetailVO.java
  24. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalScoreInfoService.java
  25. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalScoreInfoServiceImpl.java

+ 200
- 0
hs_err_pid50732.log View File

@@ -0,0 +1,200 @@
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 532676608 bytes for Failed to commit area from 0x0000000604400000 to 0x0000000624000000 of length 532676608.
# Possible reasons:
# The system is out of physical RAM or swap space
# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
# Decrease Java heap size (-Xmx/-Xms)
# Decrease number of Java threads
# Decrease Java thread stack sizes (-Xss)
# Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
# Out of Memory Error (src/hotspot/os/windows/os_windows.cpp:3627), pid=50732, tid=468
#
# JRE version: (11.0.15+10) (build )
# Java VM: OpenJDK 64-Bit Server VM (11.0.15+10-b2043.56, mixed mode, sharing, tiered, compressed oops, g1 gc, windows-amd64)
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#

--------------- S U M M A R Y ------------

Command Line: git4idea.http.GitAskPassApp Username for 'http://git.ningdatech.com':

Host: 12th Gen Intel(R) Core(TM) i9-12900H, 20 cores, 31G, Windows 11 , 64 bit Build 22621 (10.0.22621.1928)
Time: Mon Aug 7 10:27:38 2023 Windows 11 , 64 bit Build 22621 (10.0.22621.1928) elapsed time: 0.022779 seconds (0d 0h 0m 0s)

--------------- T H R E A D ---------------

Current thread (0x000002df0ddfd800): JavaThread "Unknown thread" [_thread_in_vm, id=468, stack(0x000000e5e2300000,0x000000e5e2400000)]

Stack: [0x000000e5e2300000,0x000000e5e2400000]
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0x61612a]
V [jvm.dll+0x79c450]
V [jvm.dll+0x79da6d]
V [jvm.dll+0x79e143]
V [jvm.dll+0x24cc18]
V [jvm.dll+0x613174]
V [jvm.dll+0x607e55]
V [jvm.dll+0x30b1cb]
V [jvm.dll+0x30b13a]
V [jvm.dll+0x30b012]
V [jvm.dll+0x30ff76]
V [jvm.dll+0x35b4c3]
V [jvm.dll+0x35bbc6]
V [jvm.dll+0x35b5c3]
V [jvm.dll+0x2e5918]
V [jvm.dll+0x2e6ab7]
V [jvm.dll+0x7794f7]
V [jvm.dll+0x77acec]
V [jvm.dll+0x368a59]
V [jvm.dll+0x75ce8e]
V [jvm.dll+0x3d6a33]
V [jvm.dll+0x3d9001]
C [jli.dll+0x536b]
C [ucrtbase.dll+0x29363]
C [KERNEL32.DLL+0x126ad]
C [ntdll.dll+0x5aa68]


--------------- P R O C E S S ---------------

Threads class SMR info:
_java_thread_list=0x000002df0ba385e0, length=0, elements={
}

Java Threads: ( => current thread )

Other Threads:
0x000002df0de18000 GCTaskThread "GC Thread#0" [stack: 0x000000e5e2400000,0x000000e5e2500000] [id=2344]
0x000002df0de98000 ConcurrentGCThread "G1 Main Marker" [stack: 0x000000e5e2500000,0x000000e5e2600000] [id=43216]
0x000002df0de9a800 ConcurrentGCThread "G1 Conc#0" [stack: 0x000000e5e2600000,0x000000e5e2700000] [id=30344]

[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffe70616017]

VM state:not at safepoint (not fully initialized)

VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
[0x000002df0ddfad60] Heap_lock - owner thread: 0x000002df0ddfd800

Heap address: 0x0000000604400000, size: 8124 MB, Compressed Oops mode: Non-zero based: 0x0000000604400000
Narrow klass base: 0x0000000000000000, Narrow klass shift: 0

GC Heap History (0 events):
No events

Deoptimization events (0 events):
No events

Classes redefined (0 events):
No events

Internal exceptions (0 events):
No events

Events (1 events):
Event: 0.016 Loaded shared library C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\zip.dll


Dynamic libraries:
0x00007ff796130000 - 0x00007ff79613a000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\java.exe
0x00007fff205f0000 - 0x00007fff20804000 C:\WINDOWS\SYSTEM32\ntdll.dll
0x00007fff1f640000 - 0x00007fff1f702000 C:\WINDOWS\System32\KERNEL32.DLL
0x00007fff1d9f0000 - 0x00007fff1dd93000 C:\WINDOWS\System32\KERNELBASE.dll
0x00007fff1e0f0000 - 0x00007fff1e201000 C:\WINDOWS\System32\ucrtbase.dll
0x00007fff035a0000 - 0x00007fff035b9000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\jli.dll
0x00007ffef11a0000 - 0x00007ffef11b6000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\VCRUNTIME140.dll
0x00007fff1f000000 - 0x00007fff1f1aa000 C:\WINDOWS\System32\USER32.dll
0x00007fff1de60000 - 0x00007fff1de86000 C:\WINDOWS\System32\win32u.dll
0x00007fff1ed90000 - 0x00007fff1edb9000 C:\WINDOWS\System32\GDI32.dll
0x00007fff07f70000 - 0x00007fff081fe000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.1635_none_270f70857386168e\COMCTL32.dll
0x00007fff1e2b0000 - 0x00007fff1e3c9000 C:\WINDOWS\System32\gdi32full.dll
0x00007fff1edc0000 - 0x00007fff1ee67000 C:\WINDOWS\System32\msvcrt.dll
0x00007fff1e210000 - 0x00007fff1e2aa000 C:\WINDOWS\System32\msvcp_win.dll
0x00007fff1e440000 - 0x00007fff1e471000 C:\WINDOWS\System32\IMM32.DLL
0x00007ffea1c40000 - 0x00007ffea1cea000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\msvcp140.dll
0x00007ffe70320000 - 0x00007ffe70e9b000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\server\jvm.dll
0x00007fff20390000 - 0x00007fff2043e000 C:\WINDOWS\System32\ADVAPI32.dll
0x00007fff1fea0000 - 0x00007fff1ff44000 C:\WINDOWS\System32\sechost.dll
0x00007fff1eee0000 - 0x00007fff1eff7000 C:\WINDOWS\System32\RPCRT4.dll
0x00007fff1f1b0000 - 0x00007fff1f1b8000 C:\WINDOWS\System32\PSAPI.DLL
0x00007fff168f0000 - 0x00007fff168f9000 C:\WINDOWS\SYSTEM32\WSOCK32.dll
0x00007fff20440000 - 0x00007fff204b1000 C:\WINDOWS\System32\WS2_32.dll
0x00007fff0ea00000 - 0x00007fff0ea34000 C:\WINDOWS\SYSTEM32\WINMM.dll
0x00007fff1a930000 - 0x00007fff1a93a000 C:\WINDOWS\SYSTEM32\VERSION.dll
0x00007fff1ca90000 - 0x00007fff1caa8000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll
0x00007fff10140000 - 0x00007fff10151000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\verify.dll
0x00007fff1b360000 - 0x00007fff1b58e000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL
0x00007fff1f8d0000 - 0x00007fff1fc59000 C:\WINDOWS\System32\combase.dll
0x00007fff1ff90000 - 0x00007fff20067000 C:\WINDOWS\System32\OLEAUT32.dll
0x00007ffefbaa0000 - 0x00007ffefbad2000 C:\WINDOWS\SYSTEM32\dbgcore.DLL
0x00007fff1df00000 - 0x00007fff1df7a000 C:\WINDOWS\System32\bcryptPrimitives.dll
0x00007fff10110000 - 0x00007fff10139000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\java.dll
0x00007fff17290000 - 0x00007fff1729b000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\jimage.dll
0x00007fff03580000 - 0x00007fff03599000 C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\zip.dll

dbghelp: loaded successfully - version: 4.0.5 - missing functions: none
symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.1635_none_270f70857386168e;C:\IDEA\IntelliJ IDEA 2022.1.4\jbr\bin\server

VM Arguments:
java_command: git4idea.http.GitAskPassApp Username for 'http://git.ningdatech.com':
java_class_path (initial): C:/IDEA/IntelliJ IDEA 2022.1.4/plugins/git4idea/lib/git4idea-rt.jar;C:/IDEA/IntelliJ IDEA 2022.1.4/lib/externalProcess-rt.jar;C:/IDEA/IntelliJ IDEA 2022.1.4/lib/app.jar;C:/IDEA/IntelliJ IDEA 2022.1.4/lib/3rd-party-rt.jar
Launcher Type: SUN_STANDARD

[Global flags]
intx CICompilerCount = 12 {product} {ergonomic}
uint ConcGCThreads = 4 {product} {ergonomic}
uint G1ConcRefinementThreads = 15 {product} {ergonomic}
size_t G1HeapRegionSize = 2097152 {product} {ergonomic}
uintx GCDrainStackTargetSize = 64 {product} {ergonomic}
size_t InitialHeapSize = 532676608 {product} {ergonomic}
size_t MarkStackSize = 4194304 {product} {ergonomic}
size_t MaxHeapSize = 8518631424 {product} {ergonomic}
size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic}
uintx NonNMethodCodeHeapSize = 7594288 {pd product} {ergonomic}
uintx NonProfiledCodeHeapSize = 122031976 {pd product} {ergonomic}
uintx ProfiledCodeHeapSize = 122031976 {pd product} {ergonomic}
uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic}
bool SegmentedCodeCache = true {product} {ergonomic}
bool UseCompressedClassPointers = true {lp64_product} {ergonomic}
bool UseCompressedOops = true {lp64_product} {ergonomic}
bool UseG1GC = true {product} {ergonomic}
bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic}

Logging:
Log output configuration:
#0: stdout all=warning uptime,level,tags
#1: stderr all=off uptime,level,tags

Environment Variables:
JAVA_HOME=C:\IDEA\jdk\jdk-11.0.17
CLASSPATH=.;C:\IDEA\jdk\jdk-11.0.17\lib\dt.jar;C:\IDEA\jdk\jdk-11.0.17\lib\tools.jar;
PATH=D:\soft\Git\Git\mingw64\libexec\git-core;D:\soft\Git\Git\mingw64\libexec\git-core;D:\soft\Git\Git\mingw64\bin;D:\soft\Git\Git\usr\bin;C:\Users\CMM\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\IDEA\jdk\jdk-11.0.17\bi;C:\IDEA\jdk\jdk-11.0.17\jre\bin";D:\soft\Git\Git\cmd;D:\soft\Git\Git\usr\bin;D:\soft\Maven\apache-maven-3.8.6-bin\apache-maven-3.8.6\bin;D:\soft\MySQL Installer\MySQL8.0\bin;D:\soft\Nodejs;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;D:\soft\putty;C:\Users\CMM\AppData\Local\Microsoft\WindowsApps;C:\Users\CMM\AppData\Roaming\npm;D:\soft\GoLand\GoLand 2019.3.3\bin;D:\soft\Pycharm\PyCharm Community Edition 2022.3.3\bin
USERNAME=CMM
DISPLAY=:0.0
LC_ALL=en_US.UTF-8
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 154 Stepping 3, GenuineIntel



--------------- S Y S T E M ---------------

OS: Windows 11 , 64 bit Build 22621 (10.0.22621.1928)
OS uptime: 11 days 17:18 hours

CPU:total 20 (initial active 20) (10 cores per cpu, 2 threads per core) family 6 model 154 stepping 3 microcode 0x41c, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx, sha, fma

Memory: 4k page, system-wide physical 32492M (784M free)
TotalPageFile size 58070M (AvailPageFile size 32M)
current process WorkingSet (physical memory assigned to process): 11M, peak: 11M
current process commit charge ("private bytes"): 76M, peak: 584M

vm_info: OpenJDK 64-Bit Server VM (11.0.15+10-b2043.56) for windows-amd64 JRE (11.0.15+10-b2043.56), built on May 16 2022 02:28:12 by "" with MS VC++ 14.0 (VS2015)

END.

+ 1
- 1
ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java View File

@@ -57,7 +57,7 @@ public class GeneratorCodeKingbaseConfig {

public static void main(String[] args) {
//generate("Liuxinxin", "expert", PATH_LXX, "expert_gov_business_strip");
generate("CMM", "test", PATH_CMM, "nd_performance_appraisal_app_indicator");
generate("CMM", "test", PATH_CMM, "nd_performance_appraisal_score_info");
}

}

+ 38
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/constant/BizConst.java View File

@@ -0,0 +1,38 @@
package com.ningdatech.pmapi.performance.constant;

/**
* 常量
* @return
* @author CMM
* @since 2023/08/08 17:53
*/
public interface BizConst {

/**
* 500万
*/
Integer FIVE_MILLION = 5000000;
/**
* 2000万
*/
Integer TWENTY_MILLION = 20000000;

/**
* 立项批复金额在500万以下
*/
Integer AMOUNT_RANGE_ONE = 1;

/**
* 立项批复金额在500万-2000万之间
*/
Integer AMOUNT_RANGE_TWO = 2;

/**
* 立项批复金额大于2000万
*/
Integer AMOUNT_RANGE_THREE = 3;
/**
* 复评员
*/
String REAPPRAISAL_ROLE = "复评员";
}

+ 18
- 1
pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/OrgSelfAppraisalController.java View File

@@ -2,14 +2,18 @@ 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.dto.ProjectAppraisalDTO;
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.model.vo.ProjectAppraisalIndexDetailVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
* @Classname OrgSelfAppraisalController
* @Description
@@ -39,6 +43,19 @@ public class OrgSelfAppraisalController {
@GetMapping("/appraisaled-list/{planId}")
@ApiOperation("当前绩效评价已自评列表")
public PageVo<PerformanceAppraisalProjectVO> appraisaledList(@PathVariable Long planId,PerformanceAppraisalListReq req) {
return selfAppraisalManage.appraisaledList(planId);
return selfAppraisalManage.appraisaledList(planId,req);
}

@GetMapping("/get-appraisal-template-detail/{projectCode}")
@ApiOperation("获取自评模版详情")
public ProjectAppraisalIndexDetailVO getAppraisalTemplateDetail(@PathVariable String projectCode){
return selfAppraisalManage.getAppraisalTemplateDetail(projectCode);
}

@PostMapping("/submit-self-appraisal")
@ApiOperation("提交自评")
public String submitSelfAppraisal(@Valid @RequestBody ProjectAppraisalDTO param){
return selfAppraisalManage.submitSelfAppraisal(param);
}

}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/performance/convert/PerformanceAppraisalConveter.java View File

@@ -34,7 +34,7 @@ public class PerformanceAppraisalConveter {
PerformanceAppraisalProjectVO vo = new PerformanceAppraisalProjectVO();
vo.setIsReAppraisal(p.getIsReAppraisal());
vo.setCanSelfAppraisal(checkCanSelfAppraisal(p));
vo.setId(p.getProjectId());
vo.setProjectId(p.getProjectId());
if(map.containsKey(p.getProjectCode())){
Project project = map.get(p.getProjectCode());
vo.setProjectCode(project.getProjectCode());


+ 42
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/AppraisalTypeEnum.java View File

@@ -0,0 +1,42 @@
package com.ningdatech.pmapi.performance.enumration;

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
* AppraisalTypeEnum
* @return
* @author CMM
* @since 2023/07/26 16:44
*/
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum AppraisalTypeEnum {
/**
* 评价类型
*/
SELF_APPRAISAL(1, "单位自评"),
RE_APPRAISAL(2, "人工复评"),
EXPERT_VERIFY(3, "专家核查");

private Integer code;
private String desc;

public static String getDesc(Integer code) {
if (Objects.isNull(code)) {
return StringUtils.EMPTY;
}
for (AppraisalTypeEnum t : AppraisalTypeEnum.values()) {
if (code.equals(t.getCode())) {
return t.desc;
}
}
return StringUtils.EMPTY;
}
}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/helper/TemplateDetailBuildHelper.java View File

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

import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplateDetail;
import com.ningdatech.pmapi.performance.model.vo.ProjectTemplateDetailVO;

import java.util.List;

/**
* 模板详情构建helper
* @return
* @author CMM
* @since 2023/08/09 22:28
*/
public interface TemplateDetailBuildHelper {
/**
* 构建评价模板详情信息
* @param templateDetails
* @return
*/
List<ProjectTemplateDetailVO> buildTemplateDetail(List<PerformanceIndicatorProjectTemplateDetail> templateDetails);
}

+ 90
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/helper/impl/TemplateDetailBuildHelperImpl.java View File

@@ -0,0 +1,90 @@
package com.ningdatech.pmapi.performance.helper.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.ningdatech.pmapi.performance.enumration.AppraisalTypeEnum;
import com.ningdatech.pmapi.performance.enumration.PerformanceTemplateTypeEnum;
import com.ningdatech.pmapi.performance.helper.TemplateDetailBuildHelper;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalScoreInfo;
import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplateDetail;
import com.ningdatech.pmapi.performance.model.vo.ProjectTemplateDetailVO;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalScoreInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* @author CMM
* @since 2023/08/09 22:31
*/
@Component
@RequiredArgsConstructor
public class TemplateDetailBuildHelperImpl implements TemplateDetailBuildHelper {

private final IPerformanceAppraisalScoreInfoService performanceAppraisalScoreInfoService;

@Override
public List<ProjectTemplateDetailVO> buildTemplateDetail(List<PerformanceIndicatorProjectTemplateDetail> templateDetails) {

List<ProjectTemplateDetailVO> res = Lists.newArrayList();
//第一层是 一级的
for (PerformanceIndicatorProjectTemplateDetail templateDetailFirst : templateDetails) {
if (PerformanceTemplateTypeEnum.FIRST_INDEX.getCode().equals(templateDetailFirst.getType())) {
ProjectTemplateDetailVO detailFirstVo = BeanUtil.copyProperties(templateDetailFirst, ProjectTemplateDetailVO.class);
List<ProjectTemplateDetailVO> firstList = Lists.newArrayList();
// 该层循环筛选出第二 指标
for (PerformanceIndicatorProjectTemplateDetail templateDetailSecond : templateDetails) {
if (Objects.nonNull(templateDetailSecond.getParentId()) &&
templateDetailSecond.getParentId().equals(templateDetailFirst.getId())) {
ProjectTemplateDetailVO detailSecondVo = BeanUtil.copyProperties(templateDetailSecond, ProjectTemplateDetailVO.class);
List<ProjectTemplateDetailVO> secondList = Lists.newArrayList();
// 该层循环筛选出第三 指标
for (PerformanceIndicatorProjectTemplateDetail templateDetailThird : templateDetails) {
if (Objects.nonNull(templateDetailThird.getParentId()) &&
templateDetailThird.getParentId().equals(templateDetailSecond.getId())) {
ProjectTemplateDetailVO detailThirdVo = BeanUtil.copyProperties(templateDetailThird, ProjectTemplateDetailVO.class);
// 如果有单位自评、复评、核查分数信息,各自装配信息
// 获取自评分数信息
List<PerformanceAppraisalScoreInfo> selfAppraisalScoreInfo = performanceAppraisalScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class)
.eq(PerformanceAppraisalScoreInfo::getTemplateDetailId, templateDetailThird.getId())
.eq(PerformanceAppraisalScoreInfo::getAppraisalType, AppraisalTypeEnum.SELF_APPRAISAL.getCode()));
if (CollUtil.isNotEmpty(selfAppraisalScoreInfo)) {
detailThirdVo.setSelfAppraisalScoreInfo(selfAppraisalScoreInfo);
}
// 按照复评人员分组 获取复评分数信息
List<PerformanceAppraisalScoreInfo> reAppraisalScoreInfo = performanceAppraisalScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class)
.eq(PerformanceAppraisalScoreInfo::getTemplateDetailId, templateDetailThird.getId())
.eq(PerformanceAppraisalScoreInfo::getAppraisalType, AppraisalTypeEnum.RE_APPRAISAL.getCode()));
if (CollUtil.isNotEmpty(reAppraisalScoreInfo)) {
Map<String, List<PerformanceAppraisalScoreInfo>> reAppScoreInfoMap = reAppraisalScoreInfo.stream().collect(Collectors.groupingBy(PerformanceAppraisalScoreInfo::getAppraisalEmployeeName));
detailThirdVo.setReAppraisalScoreInfo(reAppScoreInfoMap);
}
// 按照核查人员分组 获取核查分数信息
List<PerformanceAppraisalScoreInfo> verifyScoreInfo = performanceAppraisalScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class)
.eq(PerformanceAppraisalScoreInfo::getTemplateDetailId, templateDetailThird.getId())
.eq(PerformanceAppraisalScoreInfo::getAppraisalType, AppraisalTypeEnum.EXPERT_VERIFY.getCode()));
if (CollUtil.isNotEmpty(verifyScoreInfo)) {
Map<String, List<PerformanceAppraisalScoreInfo>> verifyScoreInfoMap = verifyScoreInfo.stream().collect(Collectors.groupingBy(PerformanceAppraisalScoreInfo::getAppraisalEmployeeName));
detailThirdVo.setVerifyScoreInfo(verifyScoreInfoMap);
}
secondList.add(detailThirdVo);
}
}
detailSecondVo.setChildren(secondList);
firstList.add(detailSecondVo);
}
}
detailFirstVo.setChildren(firstList);
res.add(detailFirstVo);

}
}
return res;
}
}

+ 38
- 5
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java View File

@@ -9,10 +9,12 @@ import com.google.common.collect.Lists;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.enumeration.CommonEnum;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.performance.enumration.PerformanceTemplateTypeEnum;
import com.ningdatech.pmapi.performance.helper.TemplateDetailBuildHelper;
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorAppIndexSaveDTO;
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectIndexSaveDTO;
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectTemplateSaveDTO;
@@ -42,6 +44,7 @@ import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -60,6 +63,7 @@ public class IndicatorConfigManage {
private final IPerformanceIndicatorProjectTemplateDetailService indicatorProjectTemplateDetailService;
private final IPerformanceAppraisalProjectIndicatorService projectIndicatorService;
private final IPerformanceAppraisalAppIndicatorService appIndicatorService;
private final TemplateDetailBuildHelper templateDetailBuildHelper;

/**
* 模板列表
@@ -97,19 +101,27 @@ public class IndicatorConfigManage {
}
ProjectIndexTemplateVO vo = BeanUtil.copyProperties(template,
ProjectIndexTemplateVO.class);
String projectTagIds = template.getProjectTagIds();
if (StringUtils.isNotBlank(projectTagIds)){
List<Long> proTagIdList = Arrays.stream(projectTagIds.split(StrPool.COMMA)).map(Long::valueOf).collect(Collectors.toList());
vo.setProjectTagIds(proTagIdList);
}
// 获取模版绩效指标详情
List<PerformanceIndicatorProjectTemplateDetail> templateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, id));
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, id)
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.FALSE));
// 获取模版附加绩效指标详情
List<PerformanceIndicatorProjectTemplateDetail> additionalTemplateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, id)
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.TRUE));
if(CollUtil.isNotEmpty(templateDetails)){
vo.setTemplateDetails(buildTemplateDetail(templateDetails));
List<ProjectTemplateDetailVO> templateDetailVos = templateDetailBuildHelper.buildTemplateDetail(templateDetails);
vo.setTemplateDetails(templateDetailVos);
}

if (CollUtil.isNotEmpty(additionalTemplateDetails)){
vo.setAdditionalIndexDetails(buildTemplateDetail(additionalTemplateDetails));
List<ProjectTemplateDetailVO> additionalTemplateDetailVos = templateDetailBuildHelper.buildTemplateDetail(additionalTemplateDetails);
vo.setAdditionalIndexDetails(additionalTemplateDetailVos);
}
return vo;
}
@@ -123,6 +135,13 @@ public class IndicatorConfigManage {
public String projectTemplateSave(PerformanceIndicatorProjectTemplateSaveDTO dto) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
PerformanceIndicatorProjectTemplate template = BeanUtil.copyProperties(dto, PerformanceIndicatorProjectTemplate.class);
List<Long> projectTagIds = dto.getProjectTagIds();
List<String> tagIdList = projectTagIds.stream().map(String::valueOf).collect(Collectors.toList());
template.setProjectTagIds(String.join(StrPool.COMMA, tagIdList));
if (Objects.isNull(dto.getStatus())){
// 默认模版禁用
template.setStatus(0);
}
if(Objects.nonNull(dto.getId())){
PerformanceIndicatorProjectTemplate old = indicatorProjectTemplateService.getById(dto.getId());
VUtils.isTrue(Objects.isNull(old)).throwMessage("该模板不存在!");
@@ -139,10 +158,13 @@ public class IndicatorConfigManage {
if(CollUtil.isNotEmpty(dto.getTemplateDetails())){
//先删除
indicatorProjectTemplateDetailService.remove(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId,dto.getId()));
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId,dto.getId())
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.FALSE));
analysisTemplateDetails(dto.getTemplateDetails(),template.getId());
//校检 所有3级指标(不包括附加指标) 总分是不是100
List<PerformanceIndicatorProjectTemplateDetail> indexList = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, template.getId())
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.FALSE)
.eq(PerformanceIndicatorProjectTemplateDetail::getType,PerformanceTemplateTypeEnum.THIRD_INDEX.getCode()));
if(CollUtil.isNotEmpty(indexList)){
BigDecimal sum = indexList.stream()
@@ -152,7 +174,6 @@ public class IndicatorConfigManage {
boolean score = (BigDecimal.valueOf(100)).equals(sum);
VUtils.isTrue(Boolean.FALSE.equals(score)).throwMessage("总分不是100 操作失败!");
}
analysisTemplateDetails(dto.getTemplateDetails(),template.getId());
}
// 保存 模版附加指标详情
if (CollUtil.isNotEmpty(dto.getAdditionalIndexDetails())){
@@ -208,6 +229,7 @@ public class IndicatorConfigManage {
templateDetail.setTemplateId(templateId);
// 一级指标的父ID为null
templateDetail.setParentId(parentId);
templateDetail.setIsAdditional(Boolean.FALSE);

indicatorProjectTemplateDetailService.save(templateDetail);

@@ -316,6 +338,17 @@ public class IndicatorConfigManage {
public Boolean enOrDisProjectIndexTemplate(Long templateId, boolean active) {
PerformanceIndicatorProjectTemplate projectTemplate = indicatorProjectTemplateService.getById(templateId);
if (Boolean.TRUE.equals(active)){
// 根据创建模板时选择的项目类型、预算年度、项目金额、项目标签
// 判断模板是否可以启用(同一套组合只能启用一套模板)
PerformanceIndicatorProjectTemplate template = indicatorProjectTemplateService.getOne(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplate.class)
.eq(PerformanceIndicatorProjectTemplate::getProjectType, projectTemplate.getProjectType())
.eq(PerformanceIndicatorProjectTemplate::getProjectYear, projectTemplate.getProjectYear())
.eq(PerformanceIndicatorProjectTemplate::getAmountRange, projectTemplate.getAmountRange())
.eq(PerformanceIndicatorProjectTemplate::getProjectTagIds, projectTemplate.getProjectTagIds())
.eq(PerformanceIndicatorProjectTemplate::getStatus,CommonEnum.YES.getCode()));
if (Objects.nonNull(template)){
throw new BizException("相同配置的模板已存在,当前模板无法启用!");
}
projectTemplate.setStatus(CommonEnum.YES.getCode());
}else {
projectTemplate.setStatus(CommonEnum.NO.getCode());


+ 202
- 22
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java View File

@@ -8,14 +8,18 @@ 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.entity.PerformanceAppraisal;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProject;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.performance.constant.BizConst;
import com.ningdatech.pmapi.performance.enumration.AppraisalTypeEnum;
import com.ningdatech.pmapi.performance.helper.TemplateDetailBuildHelper;
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalDTO;
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalInfoDTO;
import com.ningdatech.pmapi.performance.model.entity.*;
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.performance.model.vo.*;
import com.ningdatech.pmapi.performance.service.*;
import com.ningdatech.pmapi.portrait.model.entity.ProjectTag;
import com.ningdatech.pmapi.portrait.service.IProjectTagService;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
@@ -30,7 +34,9 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@@ -47,16 +53,14 @@ import java.util.stream.Collectors;
public class OrgSelfAppraisalManage {

private final IPerformanceAppraisalService performanceAppraisalService;

private final IPerformanceAppraisalProjectService performanceAppraisalProjectService;

private final IPerformanceAppraisalApplicationService performanceAppraisalApplicationService;

private final IProjectService projectService;

private final IProjectApplicationService applicationService;
private final IRoleService roleService;

private final IPerformanceIndicatorProjectTemplateService indicatorProjectTemplateService;
private final TemplateDetailBuildHelper templateDetailBuildHelper;
private final IPerformanceIndicatorProjectTemplateDetailService indicatorProjectTemplateDetailService;
private final IProjectTagService projectTagService;
private final IPerformanceAppraisalScoreInfoService performanceAppraisalScoreInfoService;
/**
* 绩效列表
* @param req
@@ -73,7 +77,7 @@ public class OrgSelfAppraisalManage {
Role role = roleService.getOne(Wrappers.lambdaQuery(Role.class)
.eq(Role::getName, RoleEnum.COMPANY_MANAGER.getDesc()));
if (Objects.isNull(role)){
throw new BizException("系统没有单位管理员角色!");
throw new BizException("登录用户没有单位管理员角色!");
}

// 登录用户不是单位管理员,不能查看本单位的自评计划列表
@@ -121,7 +125,8 @@ public class OrgSelfAppraisalManage {

// 获取评价计划内已添加的待评价项目信息
List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId, plan.getId()));
.eq(PerformanceAppraisalProject::getAppraisalId, plan.getId())).stream()
.filter(p -> Objects.isNull(p.getSelfAppraisalScoreTime())).collect(Collectors.toList());
Map<Long, PerformanceAppraisalProject> papsMap = paps.stream().collect(Collectors.toMap(PerformanceAppraisalProject::getProjectId, p -> p));

if(CollUtil.isEmpty(paps)){
@@ -146,11 +151,11 @@ public class OrgSelfAppraisalManage {
.map(p -> {
PerformanceAppraisalProjectVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalProjectVO.class);
PerformanceAppraisalProject appraisalProject = papsMap.get(p.getId());
BeanUtil.copyProperties(appraisalProject,vo);
vo.setProjectId(appraisalProject.getProjectId());
vo.setProjectTypeName(ProjectTypeEnum.getDesc(p.getProjectType()));
vo.setIsReAppraisal(appraisalProject.getIsReAppraisal());
vo.setSelfAppraisalStart(appraisalProject.getSelfAppraisalStart());
vo.setSelfAppraisalEnd(appraisalProject.getSelfAppraisalEnd());
vo.setCanSelfAppraisal(checkCanSelfAppraisal(appraisalProject));
vo.setAppraisalId(planId);
return vo;
})
.collect(Collectors.toList());
@@ -160,12 +165,54 @@ public class OrgSelfAppraisalManage {

/**
* 已经自评表
*
* @param planId
* @param req
* @return
*/
public PageVo<PerformanceAppraisalProjectVO> appraisaledList(Long planId) {
public PageVo<PerformanceAppraisalProjectVO> appraisaledList(Long planId, PerformanceAppraisalListReq req) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();

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

// 获取评价计划内已添加的已评价项目信息
List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId, plan.getId())).stream()
.filter(p -> Objects.nonNull(p.getSelfAppraisalScoreTime())).collect(Collectors.toList());
Map<Long, PerformanceAppraisalProject> papsMap = paps.stream().collect(Collectors.toMap(PerformanceAppraisalProject::getProjectId, p -> p));

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

return PageVo.empty();
// 获取本单位在当前评价计划内的项目
Set<String> projectCodes = paps.stream().map(PerformanceAppraisalProject::getProjectCode).collect(Collectors.toSet());
Page<Project> page = req.page();
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class)
.in(Project::getProjectCode, projectCodes)
.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();
}
List<PerformanceAppraisalProjectVO> res = page.getRecords().stream()
.map(p -> {
PerformanceAppraisalProjectVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalProjectVO.class);
PerformanceAppraisalProject appraisalProject = papsMap.get(p.getId());
BeanUtil.copyProperties(appraisalProject,vo);
vo.setProjectId(appraisalProject.getProjectId());
vo.setProjectTypeName(ProjectTypeEnum.getDesc(p.getProjectType()));
vo.setCanSelfAppraisal(checkCanSelfAppraisal(appraisalProject));
vo.setAppraisalId(planId);
return vo;
})
.collect(Collectors.toList());

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

/**
@@ -174,10 +221,143 @@ public class OrgSelfAppraisalManage {
* @return
*/
private Boolean checkCanSelfAppraisal(PerformanceAppraisalProject appraisalProject) {
// 在自评时间段内,且是首次自评(打分时间为空)
if(LocalDateTime.now().compareTo(appraisalProject.getSelfAppraisalStart()) > 0 &&
LocalDateTime.now().compareTo(appraisalProject.getSelfAppraisalEnd()) < 0){
LocalDateTime.now().compareTo(appraisalProject.getSelfAppraisalEnd()) < 0 &&
Objects.isNull(appraisalProject.getSelfAppraisalScoreTime())){
return Boolean.TRUE;
}
return Boolean.FALSE;
}

public ProjectAppraisalIndexDetailVO getAppraisalTemplateDetail(String projectCode) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
String regionCode = user.getRegionCode();

ProjectAppraisalIndexDetailVO vo = new ProjectAppraisalIndexDetailVO();

// 根据项目编码获取最新版本的项目信息
Project project = projectService.getProjectByCode(projectCode);
VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!");
// 根据项目类型、预算年度、批复金额、项目标签匹配本区域指标模版
Integer projectType = project.getProjectType();
Integer projectYear = project.getProjectYear();
BigDecimal approvalAmount = project.getApprovalAmount();
VUtils.isTrue(Objects.isNull(approvalAmount)).throwMessage("未获取到该项目的立项批复金额");
// 根据项目code获取项目标签ID列表
List<Long> tagIdList = projectTagService.list(Wrappers.lambdaQuery(ProjectTag.class)
.eq(ProjectTag::getProjectCode, projectCode)).stream()
.map(ProjectTag::getTagId).collect(Collectors.toList());
VUtils.isTrue(CollUtil.isEmpty(tagIdList)).throwMessage("当前项目未设置标签,匹配不到指标模板,请至项目库或评价计划编辑页面设置标签!");

List<String> strIdList = tagIdList.stream().map(String::valueOf).collect(Collectors.toList());
String projectTagIds = String.join(StrPool.COMMA, strIdList);

Integer amountRange = null;
if (approvalAmount.compareTo(BigDecimal.valueOf(BizConst.FIVE_MILLION)) < 0){
amountRange = BizConst.AMOUNT_RANGE_ONE;
} else if (approvalAmount.compareTo(BigDecimal.valueOf(BizConst.FIVE_MILLION)) >= 0 &&
approvalAmount.compareTo(BigDecimal.valueOf(BizConst.TWENTY_MILLION)) < 0) {
amountRange = BizConst.AMOUNT_RANGE_TWO;
}else if (approvalAmount.compareTo(BigDecimal.valueOf(BizConst.TWENTY_MILLION)) >= 0){
amountRange = BizConst.AMOUNT_RANGE_THREE;
}
LambdaQueryWrapper<PerformanceIndicatorProjectTemplate> wrapper = Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplate.class)
.eq(PerformanceIndicatorProjectTemplate::getRegionCode, regionCode)
.eq(PerformanceIndicatorProjectTemplate::getProjectType, projectType)
.eq(PerformanceIndicatorProjectTemplate::getProjectYear, projectYear)
.eq(PerformanceIndicatorProjectTemplate::getAmountRange, amountRange)
.eq(PerformanceIndicatorProjectTemplate::getProjectTagIds,projectTagIds)
.orderByDesc(PerformanceIndicatorProjectTemplate::getUpdateOn);
PerformanceIndicatorProjectTemplate projectTemplate = indicatorProjectTemplateService.getOne(wrapper);

if (Objects.isNull(projectTemplate)){
throw new BizException("该项目匹配不到指标模板,请返回上一页或者刷新重试。");
}
// 装配项目指标详情及分数信息
// 获取模版绩效指标详情
List<PerformanceIndicatorProjectTemplateDetail> templateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, projectTemplate.getId()));
// 获取模版附加绩效指标详情
List<PerformanceIndicatorProjectTemplateDetail> additionalTemplateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, projectTemplate.getId())
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.TRUE));
List<ProjectTemplateDetailVO> templateDetailVos = templateDetailBuildHelper.buildTemplateDetail(templateDetails);
List<ProjectTemplateDetailVO> additionalTemplateDetailVos = templateDetailBuildHelper.buildTemplateDetail(additionalTemplateDetails);
vo.setProjectName(project.getProjectName());
vo.setBuildOrgName(project.getBuildOrgName());
vo.setProjectStatus(project.getStatus());
vo.setProjectYear(projectYear);
vo.setApprovalAmount(approvalAmount);
vo.setTemplateDetails(templateDetailVos);
vo.setAdditionalIndexDetails(additionalTemplateDetailVos);
return vo;
}

@Transactional(rollbackFor = Exception.class)
public String submitSelfAppraisal(ProjectAppraisalDTO param) {
UserInfoDetails userDetail = LoginUserUtil.loginUserDetail();
String employeeCode = userDetail.getEmployeeCode();
String username = userDetail.getUsername();
Long appraisalId = param.getAppraisalId();
Long appraisalProjectId = param.getAppraisalProjectId();
List<ProjectAppraisalInfoDTO> appraisalInfoList = param.getAppraisalInfoList();
// 判断该项目是否还存在于计划或分组中
PerformanceAppraisalProject appraisalProject = performanceAppraisalProjectService.getOne(Wrappers.lambdaQuery(PerformanceAppraisalProject.class)
.eq(PerformanceAppraisalProject::getAppraisalId, appraisalId)
.eq(PerformanceAppraisalProject::getProjectId, appraisalProjectId));
if (Objects.isNull(appraisalProject)){
throw new BizException("该项目已被移除评价计划,请返回上一页或者刷新重试!");
}
// 根据项目模板详情ID保存自评得分、打分时间
if (CollUtil.isEmpty(appraisalInfoList)){
throw new BizException("填写所有自评得分后才能提交!");
}
List<Long> ids = appraisalInfoList.stream()
.map(ProjectAppraisalInfoDTO::getProjectTemplateDetailId)
.collect(Collectors.toList());
// 查出项目模版详情信息
List<PerformanceIndicatorProjectTemplateDetail> detailList = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.in(PerformanceIndicatorProjectTemplateDetail::getId, ids));
if (CollUtil.isEmpty(detailList)){
throw new BizException("评价指标不存在!");
}
Map<Long, PerformanceIndicatorProjectTemplateDetail> detailMap = detailList.stream().collect(Collectors.toMap(PerformanceIndicatorProjectTemplateDetail::getId, d -> d));
List<PerformanceAppraisalScoreInfo> scoreInfos = appraisalInfoList.stream().map(a -> {
PerformanceIndicatorProjectTemplateDetail templateDetail = detailMap.get(a.getProjectTemplateDetailId());
BigDecimal score = a.getScore();
BigDecimal indexScore = templateDetail.getIndexScore();
if (score.compareTo(indexScore) > 0 || score.compareTo(BigDecimal.ZERO) < 0){
throw new BizException("自评得分必须大于等于0且小于等于指标分值!");
}
// 保存自评分数信息
PerformanceAppraisalScoreInfo scoreInfo = new PerformanceAppraisalScoreInfo();
scoreInfo.setAppraisalBasis(a.getAppraisalBasis());
scoreInfo.setAppraisalScore(a.getScore());
scoreInfo.setAppraisalBasisAppendix(a.getAppraisalBasisAppendix());
scoreInfo.setAppraisalType(AppraisalTypeEnum.SELF_APPRAISAL.getCode());
scoreInfo.setTemplateDetailId(templateDetail.getId());
scoreInfo.setTemplateId(templateDetail.getTemplateId());
scoreInfo.setAppraisalEmployeeCode(employeeCode);
scoreInfo.setAppraisalEmployeeName(username);
scoreInfo.setCreateOn(LocalDateTime.now());
scoreInfo.setCreateBy(username);
return scoreInfo;
}).collect(Collectors.toList());

if (performanceAppraisalScoreInfoService.saveBatch(scoreInfos)){
// 计算自评总分并保存
BigDecimal selfAppraisalTotalScore = appraisalInfoList.stream()
.map(ProjectAppraisalInfoDTO::getScore)
.filter(Objects::nonNull)
.reduce(BigDecimal.ZERO, BigDecimal::add);
appraisalProject.setSelfAppraisalTotalScore(selfAppraisalTotalScore);
appraisalProject.setSelfAppraisalScoreTime(LocalDateTime.now());
appraisalProject.setUpdateOn(LocalDateTime.now());
appraisalProject.setUpdateBy(username);
performanceAppraisalProjectService.updateById(appraisalProject);
return "提交成功";
}
return "提交失败";
}
}

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

@@ -708,7 +708,7 @@ public class PerformanceAppraisalPlanManage {
vo.setProjectName(project.getProjectName());
vo.setProjectTypeName(BizUtils.getProjectTypeName(project.getProjectType()));
vo.setProjectType(project.getProjectType());
vo.setId(project.getId());
vo.setProjectId(project.getId());
vo.setProjectCode(projectCode);
vo.setProjectYear(project.getProjectYear());
vo.setDeclareAmount(project.getDeclareAmount());


+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalScoreInfoMapper.java View File

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

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

/**
* <p>
* Mapper 接口
* </p>
*
* @author CMM
* @since 2023-08-09
*/
public interface PerformanceAppraisalScoreInfoMapper extends BaseMapper<PerformanceAppraisalScoreInfo> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalScoreInfoMapper.xml View 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.PerformanceAppraisalScoreInfoMapper">

</mapper>

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

@@ -48,4 +48,7 @@ public class PerformanceIndicatorProjectTemplateSaveDTO implements Serializable

@ApiModelProperty("附加绩效指标详情")
private List<ProjectTemplateDetailDTO> additionalIndexDetails;

@ApiModelProperty("项目标签信息")
private List<Long> projectTagIds;
}

+ 36
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/ProjectAppraisalDTO.java View File

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

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

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
* 项目评价信息
* @return
* @author CMM
* @since 2023/08/08 18:46
*/
@Data
public class ProjectAppraisalDTO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("评价项目ID")
private Long appraisalProjectId;

@ApiModelProperty("评价计划ID")
private Long appraisalId;

@ApiModelProperty("项目模板指标详情评价信息集合")
private List<ProjectAppraisalInfoDTO> appraisalInfoList;

@ApiModelProperty("项目是否需要整改")
private Boolean isRectify;

@ApiModelProperty("整改意见")
private String rectifyOpinion;
}

+ 37
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/ProjectAppraisalInfoDTO.java View File

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

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

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

/**
* 项目评价信息
* @return
* @author CMM
* @since 2023/08/08 18:46
*/
@Data
public class ProjectAppraisalInfoDTO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("项目模板指标详情ID")
private Long projectTemplateDetailId;

@ApiModelProperty("评价得分")
@NotNull(message = "得分不能为空!")
private BigDecimal score;

@ApiModelProperty("评价依据")
@Size(max = 500)
private String appraisalBasis;

@ApiModelProperty("评价依据附件")
private String appraisalBasisAppendix;
}

+ 28
- 1
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProject.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.performance.model.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
@@ -8,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
@@ -41,7 +43,7 @@ public class PerformanceAppraisalProject implements Serializable {
@ApiModelProperty("项目编码")
private String projectCode;

@ApiModelProperty("是否核查")
@ApiModelProperty("是否复评")
private Boolean isReAppraisal;

@ApiModelProperty("自评开始时间")
@@ -49,4 +51,29 @@ public class PerformanceAppraisalProject implements Serializable {

@ApiModelProperty("自评结束时间")
private LocalDateTime selfAppraisalEnd;

@ApiModelProperty("自评总分")
private BigDecimal selfAppraisalTotalScore;

@ApiModelProperty("自评打分时间")
private LocalDateTime selfAppraisalScoreTime;

@ApiModelProperty("复评总分")
private BigDecimal reAppraisalTotalScore;

@ApiModelProperty("复评打分时间")
private LocalDateTime reAppraisalScoreTime;

@ApiModelProperty("核查总分")
private BigDecimal verifyTotalScore;

@ApiModelProperty("核查打分时间")
private LocalDateTime verifyScoreTime;

@ApiModelProperty("项目是否需要整改")
private Boolean isRectify;

@ApiModelProperty("整改意见")
private String rectifyOpinion;

}

+ 64
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalScoreInfo.java View File

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

import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* <p>
*
* </p>
*
* @author CMM
* @since 2023-08-09
*/
@Data
@TableName("nd_performance_appraisal_score_info")
@ApiModel(value = "NdPerformanceAppraisalScoreInfo对象", description = "")
public class PerformanceAppraisalScoreInfo implements Serializable {

private static final long serialVersionUID = 1L;

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

@ApiModelProperty("创建时间")
private LocalDateTime createOn;

@ApiModelProperty("创建人")
private String createBy;

@ApiModelProperty("创建时间")
private LocalDateTime updateOn;

@ApiModelProperty("更新人")
private String updateBy;

@ApiModelProperty("项目评价计划模板ID")
private Long templateId;

@ApiModelProperty("项目评价计划模板详情ID")
private Long templateDetailId;

@ApiModelProperty("评价得分")
private BigDecimal appraisalScore;

@ApiModelProperty("评价依据")
private String appraisalBasis;

@ApiModelProperty("评价依据附件")
private String appraisalBasisAppendix;

@ApiModelProperty("评价人员code")
private String appraisalEmployeeCode;

@ApiModelProperty("评价人员姓名")
private String appraisalEmployeeName;

@ApiModelProperty("评价类型 1 单位自评、2 复评人员复评、3 专家核查")
private Integer appraisalType;
}

+ 3
- 5
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java View File

@@ -10,6 +10,7 @@ import lombok.Data;

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

/**
* @Classname PerformanceIndicatorTemplate
@@ -54,9 +55,6 @@ public class PerformanceIndicatorProjectTemplate implements Serializable {
@ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上")
private Integer amountRange;

@ApiModelProperty("项目标签ID")
private Long projectTagId;

@ApiModelProperty("项目标签名称")
private String projectTagName;
@ApiModelProperty("项目标签信息")
private String projectTagIds;
}

+ 26
- 6
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceAppraisalProjectVO.java View File

@@ -1,7 +1,6 @@
package com.ningdatech.pmapi.performance.model.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -9,7 +8,6 @@ import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
* @Classname PerformanceAppraisalProjectVO
@@ -24,7 +22,7 @@ public class PerformanceAppraisalProjectVO implements Serializable {
private static final long serialVersionUID = 1L;

@ApiModelProperty("项目ID")
private Long id;
private Long projectId;

@ApiModelProperty("项目编码")
private String projectCode;
@@ -60,11 +58,33 @@ public class PerformanceAppraisalProjectVO implements Serializable {
private LocalDateTime selfAppraisalEnd;

@ApiModelProperty("自评总分")
private BigDecimal selfAppraisalScore;
private BigDecimal selfAppraisalTotalScore;

@ApiModelProperty("打分时间")
@ApiModelProperty("自评打分时间")
@JSONField(format = "yyyy-MM-dd HH:mm")
private LocalDateTime scoreTime;
private LocalDateTime selfAppraisalScoreTime;

@ApiModelProperty("复评总分")
private BigDecimal reAppraisalTotalScore;

@ApiModelProperty("复评打分时间")
@JSONField(format = "yyyy-MM-dd HH:mm")
private LocalDateTime reAppraisalScoreTime;

@ApiModelProperty("核查总分")
private BigDecimal verifyTotalScore;

@ApiModelProperty("核查打分时间")
@JSONField(format = "yyyy-MM-dd HH:mm")
private LocalDateTime verifyScoreTime;

@ApiModelProperty("项目是否需要整改")
private Boolean isRectify;

@ApiModelProperty("整改意见")
private String rectifyOpinion;

@ApiModelProperty("评价计划ID")
private Long appraisalId;

}

+ 43
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectAppraisalIndexDetailVO.java View File

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

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

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

/**
* 项目评价指标
* @return
* @author CMM
* @since 2023/08/08 8:55
*/
@Data
@ApiModel(value = "项目自(复)评项目指标模版详情", description = "项目自(复)评项目指标模版详情")
public class ProjectAppraisalIndexDetailVO implements Serializable {

private static final long serialVersionUID = 1L;

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

@ApiModelProperty("申报单位")
private String buildOrgName;

@ApiModelProperty("项目状态")
private Integer projectStatus;

@ApiModelProperty("批复金额")
private BigDecimal approvalAmount;

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

@ApiModelProperty("绩效指标详情")
private List<ProjectTemplateDetailVO> templateDetails;

@ApiModelProperty("附加绩效指标详情")
private List<ProjectTemplateDetailVO> additionalIndexDetails;
}

+ 3
- 4
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java View File

@@ -50,15 +50,14 @@ public class ProjectIndexTemplateVO implements Serializable {
@ApiModelProperty("状态 0关闭 1开启")
private Integer status;

@ApiModelProperty("项目标签信息")
private List<Long> projectTagIds;

@ApiModelProperty("绩效指标详情")
private List<ProjectTemplateDetailVO> templateDetails;

@ApiModelProperty("附加绩效指标详情")
private List<ProjectTemplateDetailVO> additionalIndexDetails;

@ApiModelProperty("项目标签ID")
private Long projectTagId;

@ApiModelProperty("项目标签名称")
private String projectTagName;
}

+ 15
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectTemplateDetailVO.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.performance.model.vo;

import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalScoreInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -7,6 +8,7 @@ import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
* @Classname PerformanceIndicatorProjectTemplateDetail
@@ -20,6 +22,9 @@ public class ProjectTemplateDetailVO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("id")
private Long id;

@ApiModelProperty("关联模板ID")
private Long templateId;

@@ -52,4 +57,14 @@ public class ProjectTemplateDetailVO implements Serializable {

@ApiModelProperty("子指标")
private List<ProjectTemplateDetailVO> children;

@ApiModelProperty("自评分数信息")
private List<PerformanceAppraisalScoreInfo> selfAppraisalScoreInfo;

@ApiModelProperty("复评分数信息")
private Map<String, List<PerformanceAppraisalScoreInfo>> reAppraisalScoreInfo;

@ApiModelProperty("核查分数信息")
private Map<String, List<PerformanceAppraisalScoreInfo>> verifyScoreInfo;

}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalScoreInfoService.java View File

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

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

/**
* <p>
* 服务类
* </p>
*
* @author CMM
* @since 2023-08-09
*/
public interface IPerformanceAppraisalScoreInfoService extends IService<PerformanceAppraisalScoreInfo> {

}

+ 20
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalScoreInfoServiceImpl.java View File

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

import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalScoreInfo;
import com.ningdatech.pmapi.performance.mapper.PerformanceAppraisalScoreInfoMapper;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalScoreInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author CMM
* @since 2023-08-09
*/
@Service
public class PerformanceAppraisalScoreInfoServiceImpl extends ServiceImpl<PerformanceAppraisalScoreInfoMapper, PerformanceAppraisalScoreInfo> implements IPerformanceAppraisalScoreInfoService {

}

Loading…
Cancel
Save