Преглед изворни кода

待办中心用户相关修改

tags/24080901
CMM пре 1 година
родитељ
комит
09fd5cc4f8
68 измењених фајлова са 1349 додато и 829 уклоњено
  1. +1
    -1
      ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java
  2. +1
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/App.java
  3. +3
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DingConstant.java
  4. +167
    -144
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java
  5. +40
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertReviewController.java
  6. +30
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ReviewTemplateSettingsController.java
  7. +73
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java
  8. +76
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ReviewTemplateSettingsManage.java
  9. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertReviewMapper.java
  10. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertReviewMapper.xml
  11. +70
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ExpertReview.java
  12. +14
    -75
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ReviewTemplateSettings.java
  13. +46
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/enumeration/ReviewTemplateTypeEnum.java
  14. +67
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertReviewDetailReq.java
  15. +37
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ReviewTemplateReq.java
  16. +34
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ReviewTemplateVO.java
  17. +28
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertReviewService.java
  18. +33
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertReviewServiceImpl.java
  19. +7
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/organization/model/entity/DingEmployeeInfo.java
  20. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ProjectAdjustmentController.java
  21. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java
  22. +9
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java
  23. +13
    -27
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java
  24. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java
  25. +23
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ProjectAdjustmentManage.java
  26. +9
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DeclaredProjectListParamDTO.java
  27. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DefaultDeclaredDTO.java
  28. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ProjectDraftSaveDTO.java
  29. +47
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/utils/ReStartProcessMapUtil.java
  30. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectRenewalFundDeclarationController.java
  31. +23
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectRenewalApprovalStatusEnum.java
  32. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectRenewalFundDeclarationMapper.java
  33. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectRenewalFundDeclarationMapper.xml
  34. +0
    -10
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDTO.java
  35. +0
    -23
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java
  36. +173
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectRenewalFundDeclaration.java
  37. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectRenewalFundDeclarationService.java
  38. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectRenewalFundDeclarationServiceImpl.java
  39. +38
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/RegionController.java
  40. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RegionManage.java
  41. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Menu.java
  42. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/entity/ProgressNode.java
  43. +0
    -35
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/entity/UserInfoVO.java
  44. +1
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProcessProgressDetailVo.java
  45. +1
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProgressNodeAuditInfoVo.java
  46. +97
    -70
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  47. +6
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java
  48. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java
  49. +0
    -99
      pmapi/src/main/java/com/ningdatech/pmapi/user/entity/NdUserAuth.java
  50. +0
    -109
      pmapi/src/main/java/com/ningdatech/pmapi/user/entity/NdUserInfo.java
  51. +5
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserAuth.java
  52. +5
    -42
      pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java
  53. +0
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java
  54. +0
    -16
      pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/NdUserAuthMapper.java
  55. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/NdUserInfoMapper.java
  56. +4
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserAuthMapper.java
  57. +0
    -16
      pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserInfoMapper.java
  58. +0
    -16
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/INdUserAuthService.java
  59. +0
    -16
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/INdUserInfoService.java
  60. +9
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserAuthService.java
  61. +4
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java
  62. +0
    -20
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/NdUserAuthServiceImpl.java
  63. +0
    -20
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/NdUserInfoServiceImpl.java
  64. +20
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserAuthServiceImpl.java
  65. +7
    -10
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java
  66. +6
    -0
      pmapi/src/main/resources/application-dev.yml
  67. +7
    -7
      pmapi/src/test/java/com/ningdatech/pmapi/organization/OrganizationTest.java
  68. +6
    -5
      pmapi/src/test/java/com/ningdatech/pmapi/sys/service/IMenuServiceTest.java

+ 1
- 1
ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java Прегледај датотеку

@@ -56,7 +56,7 @@ public class GeneratorCodeKingbaseConfig {
}

public static void main(String[] args) {
generate("WendyYang", "expert", PATH_YYD, "nd_review_template_settings");
generate("WendyYang", "projectlib", PATH_YYD, "nd_project_renewal_fund_declaration");
}

}

+ 1
- 2
pmapi/src/main/java/com/ningdatech/pmapi/App.java Прегледај датотеку

@@ -3,7 +3,6 @@ package com.ningdatech.pmapi;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
@@ -23,7 +22,7 @@ public class App {
protected static final String MAPPER_PACKAGES = "com.ningdatech.pmapi.**.mapper";

public static void main(String[] args) {
System.setProperty("druid.mysql.usePingMethod", "false");
SpringApplication.run(App.class, args);
}

}

+ 3
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/constant/DingConstant.java Прегледај датотеку

@@ -1,6 +1,8 @@
package com.ningdatech.pmapi.common.constant;

/**
* 浙政钉常量
*
* @author CMM
* @since 2023/02/01 14:49
*/
@@ -9,4 +11,4 @@ public interface DingConstant {
* 工作通知
*/
String WORKING_NOTICE = "/message/workNotification";
}
}

+ 167
- 144
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java Прегледај датотеку

@@ -1,144 +1,167 @@
//package com.ningdatech.pmapi.ding.task;
//
//import cn.hutool.core.collection.CollUtil;
//import com.ningdatech.basic.model.GenericResult;
//import com.ningdatech.pmapi.organization.entity.DingEmployeeInfo;
//import com.ningdatech.pmapi.organization.entity.DingOrganization;
//import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService;
//import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
//import com.ningdatech.zwdd.client.ZwddClient;
//import com.ningdatech.zwdd.model.Page;
//import com.ningdatech.zwdd.model.dto.EmployeeAccountIdDTO;
//import com.ningdatech.zwdd.model.query.PageOrganizationEmployeePositionsQuery;
//import com.ningdatech.zwdd.model.response.OrganizationEmployeePosition;
//import com.ningdatech.zwdd.model.response.OrganizationEmployeePosition.GovEmployeePosition;
//import org.springframework.beans.BeanUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//import org.springframework.transaction.annotation.Transactional;
//
//import java.util.ArrayList;
//import java.util.List;
//import java.util.stream.Collectors;
//
///**
// * @author liuxinxin
// * @date 2023/2/10 上午9:52
// */
//
//@Component
//public class EmployeeBatchGetTask {
//
// private final static Integer PAGE_SIZE = 20;
//
// private final static Integer GROUP_SIZE = 100;
//
// @Autowired
// private ZwddClient zwddClient;
//
// @Autowired
// private IDingOrganizationService iDingOrganizationService;
//
// @Autowired
// private IDingEmployeeInfoService iDingEmployeeInfoService;
//
// @Transactional(rollbackFor = Exception.class)
// public void batchGetEmployeeTask() {
//
// // 获取所有的组织列表用户获取组织下的 用户信息
// List<DingOrganization> dingOrganizationList = iDingOrganizationService.list();
// if (CollUtil.isNotEmpty(dingOrganizationList)) {
// for (DingOrganization dingOrganization : dingOrganizationList) {
// List<OrganizationEmployeePosition> allOrganizationEmployeePositionList = new ArrayList<>();
// String organizationCode = dingOrganization.getOrganizationCode();
// PageOrganizationEmployeePositionsQuery query = new PageOrganizationEmployeePositionsQuery();
// query.setEmployeeStatus("A");
// query.setOrganizationCode(organizationCode);
// query.setReturnTotalSize(true);
//// query.setTenantId(GovDingProperties.tenantId);
// int pageNo = 1;
// query.setPageNo(pageNo);
// query.setPageSize(PAGE_SIZE);
//
// // 查询组织下 用户信息
// GenericResult<Page<OrganizationEmployeePosition>> firstPageGenericResult = zwddClient.pageOrganizationEmployeePositions(query);
// Page<OrganizationEmployeePosition> data = firstPageGenericResult.getData();
// if (CollUtil.isNotEmpty(data.getData())) {
//
// allOrganizationEmployeePositionList.addAll(data.getData());
// }
// Long totalSize = data.getTotalSize();
// if (totalSize > PAGE_SIZE) {
// int maxPageNo = (int) Math.ceil(totalSize / PAGE_SIZE);
// for (pageNo = 2; pageNo <= maxPageNo; pageNo++) {
// query.setPageNo(maxPageNo);
// GenericResult<Page<OrganizationEmployeePosition>> pageGenericResult = zwddClient.pageOrganizationEmployeePositions(query);
// if (CollUtil.isNotEmpty(pageGenericResult.getData().getData())) {
// allOrganizationEmployeePositionList.addAll(pageGenericResult.getData().getData());
// }
// }
// }
//
// List<DingEmployeeInfo> dingEmployeeInfoList = new ArrayList<>();
// if (allOrganizationEmployeePositionList.size() <= GROUP_SIZE) {
// List<String> employeeCodes = allOrganizationEmployeePositionList.stream().map(OrganizationEmployeePosition::getEmployeeCode).collect(Collectors.toList());
// GenericResult<List<EmployeeAccountIdDTO>> listGenericResult = zwddClient.listEmployeeAccountIds(employeeCodes);
//// List<EmployeeAccountIdDTO> employeeAccountIdDTOList = listGenericResult.getData();
// } else {
//// iDingEmployeeInfoService.saveBatch();
// }
// // 批量保存用户信息
// saveBatch(allOrganizationEmployeePositionList);
// }
//
// }
//
//
// }
//
// private List<DingEmployeeInfo> buildDingEmployeeInfoRecord(List<OrganizationEmployeePosition> allOrganizationEmployeePositionList) {
// List<DingEmployeeInfo> saveRecordList = new ArrayList<>();
// for (OrganizationEmployeePosition organizationEmployeePosition : allOrganizationEmployeePositionList) {
// List<GovEmployeePosition> govEmployeePositions = organizationEmployeePosition.getGovEmployeePositions();
// if (CollUtil.isNotEmpty(govEmployeePositions)) {
// List<DingEmployeeInfo> segmentSaveRecordList = new ArrayList<>();
// for (GovEmployeePosition govEmployeePosition : govEmployeePositions) {
// DingEmployeeInfo dingEmployeeInfo = new DingEmployeeInfo();
// BeanUtils.copyProperties(organizationEmployeePosition, dingEmployeeInfo);
// dingEmployeeInfo.setMainJob(govEmployeePosition.getMainJob());
// dingEmployeeInfo.setEmpPosUnitCode(govEmployeePosition.getEmpPosUnitCode());
// dingEmployeeInfo.setEmpPosEmployeeRoleCode(govEmployeePosition.getEmpPosEmployeeRoleCode());
// dingEmployeeInfo.setEmpPosInnerInstitutionCode(govEmployeePosition.getEmpPosInnerInstitutionCode());
// dingEmployeeInfo.setEmployeeCode(govEmployeePosition.getEmployeeCode());
// dingEmployeeInfo.setJobAttributesCode(govEmployeePosition.getJobAttributesCode());
// dingEmployeeInfo.setOrganizationCode(govEmployeePosition.getOrganizationCode());
// dingEmployeeInfo.setEmpPosVirtualOrganizationCode(govEmployeePosition.getEmpPosVirtualOrganizationCode());
// dingEmployeeInfo.setEmpStatus(govEmployeePosition.getStatus());
// segmentSaveRecordList.add(dingEmployeeInfo);
// }
// saveRecordList.addAll(segmentSaveRecordList);
// } else {
// DingEmployeeInfo dingEmployeeInfo = new DingEmployeeInfo();
// BeanUtils.copyProperties(organizationEmployeePosition, dingEmployeeInfo);
// saveRecordList.add(dingEmployeeInfo);
// }
//
//
// }
// return null;
// }
//
// private void saveBatch(List<OrganizationEmployeePosition> allOrganizationEmployeePositionList) {
//
//// // 批量保存
//// if (saveRecordList.size() <= GROUP_SIZE) {
//// iDingOrganizationService.saveBatch(saveRecordList);
//// } else {
//// List<List<DingOrganization>> split = Lists.partition(saveRecordList, GROUP_SIZE);
//// for (List<DingOrganization> segment : split) {
//// iDingOrganizationService.saveBatch(segment);
//// }
//// }
//
// }
//}
package com.ningdatech.pmapi.ding.task;

import cn.hutool.core.collection.CollUtil;
import com.google.common.collect.Lists;
import com.ningdatech.basic.model.GenericResult;
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
import com.ningdatech.zwdd.ZwddIntegrationProperties;
import com.ningdatech.zwdd.client.ZwddClient;
import com.ningdatech.zwdd.model.Page;
import com.ningdatech.zwdd.model.dto.EmployeeAccountIdDTO;
import com.ningdatech.zwdd.model.query.PageOrganizationEmployeePositionsQuery;
import com.ningdatech.zwdd.model.response.OrganizationEmployeePosition;
import com.ningdatech.zwdd.model.response.OrganizationEmployeePosition.GovEmployeePosition;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
* @author liuxinxin
* @date 2023/2/10 上午9:52
*/

@Component
public class EmployeeBatchGetTask {

private final static Integer PAGE_SIZE = 20;

private final static Integer GROUP_SIZE = 100;

@Autowired
private ZwddClient zwddClient;

@Autowired
private IDingOrganizationService iDingOrganizationService;

@Autowired
private IDingEmployeeInfoService iDingEmployeeInfoService;

@Autowired
private ZwddIntegrationProperties zwddIntegrationProperties;

@Transactional(rollbackFor = Exception.class)
public void batchGetEmployeeTask() {

// 获取所有的组织列表用户获取组织下的 用户信息
List<DingOrganization> dingOrganizationList = iDingOrganizationService.list();
if (CollUtil.isNotEmpty(dingOrganizationList)) {
for (DingOrganization dingOrganization : dingOrganizationList) {
List<OrganizationEmployeePosition> allOrganizationEmployeePositionList = new ArrayList<>();
String organizationCode = dingOrganization.getOrganizationCode();
PageOrganizationEmployeePositionsQuery query = new PageOrganizationEmployeePositionsQuery();
query.setEmployeeStatus("A");
query.setOrganizationCode(organizationCode);
query.setReturnTotalSize(true);
query.setTenantId(zwddIntegrationProperties.getTenantId());
int pageNo = 1;
query.setPageNo(pageNo);
query.setPageSize(PAGE_SIZE);

// 查询组织下 用户信息
GenericResult<Page<OrganizationEmployeePosition>> firstPageGenericResult = zwddClient.pageOrganizationEmployeePositions(query);
Page<OrganizationEmployeePosition> data = firstPageGenericResult.getData();
if (CollUtil.isNotEmpty(data.getData())) {

allOrganizationEmployeePositionList.addAll(data.getData());
}
Long totalSize = data.getTotalSize();
if (totalSize > PAGE_SIZE) {
int restPageNo = totalSize % PAGE_SIZE > 0 ? 1 : 0;
int maxPageNo = (int) Math.ceil(totalSize / PAGE_SIZE) + restPageNo;
for (pageNo = 2; pageNo <= maxPageNo; pageNo++) {
query.setPageNo(maxPageNo);
GenericResult<Page<OrganizationEmployeePosition>> pageGenericResult = zwddClient.pageOrganizationEmployeePositions(query);
if (CollUtil.isNotEmpty(pageGenericResult.getData().getData())) {
allOrganizationEmployeePositionList.addAll(pageGenericResult.getData().getData());
}
}
}

// 批量查询 成员的accountId
List<DingEmployeeInfo> dingEmployeeInfoSaveRecordList = new ArrayList<>();
if (allOrganizationEmployeePositionList.size() <= GROUP_SIZE) {
assemblerAccountId(allOrganizationEmployeePositionList, dingEmployeeInfoSaveRecordList);
} else {
List<List<OrganizationEmployeePosition>> split = Lists.partition(allOrganizationEmployeePositionList, GROUP_SIZE);
for (List<OrganizationEmployeePosition> segment : split) {
assemblerAccountId(segment, dingEmployeeInfoSaveRecordList);
}
}
// 批量保存用户信息
saveBatch(dingEmployeeInfoSaveRecordList);
}
}
}


private void assemblerAccountId(List<OrganizationEmployeePosition> segment, List<DingEmployeeInfo> dingEmployeeInfoSaveRecordList) {
List<String> employeeCodes = segment.stream().map(OrganizationEmployeePosition::getEmployeeCode).distinct().collect(Collectors.toList());
GenericResult<List<EmployeeAccountIdDTO>> listGenericResult = zwddClient.listEmployeeAccountIds(employeeCodes);
List<EmployeeAccountIdDTO> employeeAccountIdDTOList = listGenericResult.getData();
Map<String, Long> employeeCodeAccountIdMap = employeeAccountIdDTOList.stream()
.collect(Collectors.toMap(EmployeeAccountIdDTO::getEmployeeCode, EmployeeAccountIdDTO::getAccountId));

List<DingEmployeeInfo> dingEmployeeInfos = buildDingEmployeeInfoRecordList(segment);

dingEmployeeInfos = dingEmployeeInfos.stream().map(r -> {
r.setAccountId(employeeCodeAccountIdMap.get(r.getEmployeeCode()));
return r;
}).collect(Collectors.toList());
dingEmployeeInfoSaveRecordList.addAll(dingEmployeeInfos);
}

private List<DingEmployeeInfo> buildDingEmployeeInfoRecordList(List<OrganizationEmployeePosition> allOrganizationEmployeePositionList) {
List<DingEmployeeInfo> saveRecordList = new ArrayList<>();
for (OrganizationEmployeePosition organizationEmployeePosition : allOrganizationEmployeePositionList) {
List<GovEmployeePosition> govEmployeePositions = organizationEmployeePosition.getGovEmployeePositions();
if (CollUtil.isNotEmpty(govEmployeePositions)) {
List<DingEmployeeInfo> segmentSaveRecordList = new ArrayList<>();
for (GovEmployeePosition govEmployeePosition : govEmployeePositions) {
DingEmployeeInfo dingEmployeeInfo = new DingEmployeeInfo();
BeanUtils.copyProperties(organizationEmployeePosition, dingEmployeeInfo);
dingEmployeeInfo.setMainJob(govEmployeePosition.getMainJob());
dingEmployeeInfo.setEmpPosUnitCode(govEmployeePosition.getEmpPosUnitCode());
dingEmployeeInfo.setEmpPosEmployeeRoleCode(govEmployeePosition.getEmpPosEmployeeRoleCode());
dingEmployeeInfo.setEmpPosInnerInstitutionCode(govEmployeePosition.getEmpPosInnerInstitutionCode());
dingEmployeeInfo.setEmployeeCode(govEmployeePosition.getEmployeeCode());
dingEmployeeInfo.setJobAttributesCode(govEmployeePosition.getJobAttributesCode());
dingEmployeeInfo.setOrganizationCode(govEmployeePosition.getOrganizationCode());
dingEmployeeInfo.setEmpPosVirtualOrganizationCode(govEmployeePosition.getEmpPosVirtualOrganizationCode());
dingEmployeeInfo.setEmpStatus(govEmployeePosition.getStatus());
dingEmployeeInfo.setCreateOn(LocalDateTime.now());
dingEmployeeInfo.setUpdateOn(LocalDateTime.now());
dingEmployeeInfo.setCreateBy(-1L);
dingEmployeeInfo.setUpdateBy(-1L);
segmentSaveRecordList.add(dingEmployeeInfo);
}
saveRecordList.addAll(segmentSaveRecordList);
} else {
DingEmployeeInfo dingEmployeeInfo = new DingEmployeeInfo();
BeanUtils.copyProperties(organizationEmployeePosition, dingEmployeeInfo);
saveRecordList.add(dingEmployeeInfo);
}
}
return saveRecordList;
}

private void saveBatch(List<DingEmployeeInfo> dingEmployeeInfoSaveRecordList) {
if (dingEmployeeInfoSaveRecordList.size() <= GROUP_SIZE) {
iDingEmployeeInfoService.saveBatch(dingEmployeeInfoSaveRecordList);
} else {
List<List<DingEmployeeInfo>> split = Lists.partition(dingEmployeeInfoSaveRecordList, GROUP_SIZE);
for (List<DingEmployeeInfo> segment : split) {
iDingEmployeeInfoService.saveBatch(segment);
}
}
}
}

+ 40
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertReviewController.java Прегледај датотеку

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


import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.expert.manage.ExpertReviewManage;
import com.ningdatech.pmapi.expert.model.req.ExpertReviewDetailReq;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
* <p>
* 前端控制器
* </p>
*
* @author WendyYang
* @since 2023-02-15
*/
@RestController
@AllArgsConstructor
@Api(tags = "专家评审")
@RequestMapping("/api/v1/expertReview")
public class ExpertReviewController {

private final ExpertReviewManage expertReviewManage;

@PostMapping("/save")
@ApiOperation("填写评审意见")
@WebLog("填写评审意见")
public void expertReview(@RequestBody @Valid ExpertReviewDetailReq req) {
expertReviewManage.expertReview(req);
}

}

+ 30
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ReviewTemplateSettingsController.java Прегледај датотеку

@@ -1,10 +1,17 @@
package com.ningdatech.pmapi.expert.controller;


import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.expert.manage.ReviewTemplateSettingsManage;
import com.ningdatech.pmapi.expert.model.req.ReviewTemplateReq;
import com.ningdatech.pmapi.expert.model.vo.ReviewTemplateVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
* <p>
@@ -20,4 +27,25 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/v1/reviewTemplateSettings")
public class ReviewTemplateSettingsController {

private final ReviewTemplateSettingsManage reviewTemplateSettingsManage;

@GetMapping("/template/{templateType}/{regionCode}")
@ApiOperation("根据模版类型获取模版")
public ReviewTemplateVO getReviewTemplateByType(@PathVariable Integer templateType, @PathVariable String regionCode) {
return reviewTemplateSettingsManage.getReviewTemplateSettings(templateType, regionCode);
}

@PostMapping("/modify")
@ApiOperation("修改或保存模版配置")
@WebLog("修改或保存模版配置")
public void modifyReviewTemplateSettings(@RequestBody @Valid ReviewTemplateReq req) {
reviewTemplateSettingsManage.saveOrUpdate(req);
}

@GetMapping("/template/{templateId}")
@ApiModelProperty("根据模版ID获取评审模版")
public ReviewTemplateVO getTemplateById(@PathVariable Long templateId) {
return reviewTemplateSettingsManage.getReviewTemplateSettings(templateId);
}

}

+ 73
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java Прегледај датотеку

@@ -0,0 +1,73 @@
package com.ningdatech.pmapi.expert.manage;

import cn.hutool.json.JSONUtil;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.cache.lock.DistributedLock;
import com.ningdatech.pmapi.expert.model.entity.ExpertReview;
import com.ningdatech.pmapi.expert.model.req.ExpertReviewDetailReq;
import com.ningdatech.pmapi.expert.service.IExpertReviewService;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;

/**
* <p>
* ExpertReviewManage
* </p>
*
* @author WendyYang
* @since 14:25 2023/2/15
*/
@Component
@RequiredArgsConstructor
public class ExpertReviewManage {

private final IExpertReviewService expertReviewService;
private final DistributedLock distributedLock;

private static final String EXPERT_REVIEW_KEY = "expert_review:";

private String buildExpertReviewKey(Long projectId, Long expertId) {
return EXPERT_REVIEW_KEY + projectId + ":" + expertId;
}

public void expertReview(ExpertReviewDetailReq req) {
Long userId = LoginUserUtil.getUserId();
Long projectId = req.getProjectId();
String expertReviewKey = buildExpertReviewKey(projectId, userId);
if (!distributedLock.lock(expertReviewKey)) {
throw BizException.wrap("保存评审意见失败,请重试");
}
try {
List<ExpertReview> reviews = expertReviewService.listByProjectIdAndExpertId(projectId, userId);
if (req.getIsFinal()) {
// TODO 判断所有专家是否都已评价
if (reviews.isEmpty()) {
throw BizException.wrap("请先填写个人评审意见");
}
if (reviews.size() > 1) {
throw BizException.wrap("不可重复填写最终评审意见");
}
} else {
if (!reviews.isEmpty()) {
throw BizException.wrap("不可重复填写评审意见");
}
}
ExpertReview review = new ExpertReview();
review.setReviewResult(req.getReviewResult());
review.setContent(JSONUtil.toJsonStr(req.getReviewTemplateOptions()));
review.setProjectId(req.getProjectId());
review.setTemplateId(req.getTemplateId());
review.setAdvice(req.getOtherAdvice());
review.setAttachFileId(req.getAttachFileId());
review.setIsFinal(req.getIsFinal());
review.setCreator(LoginUserUtil.getUsername());
expertReviewService.save(review);
} finally {
distributedLock.releaseLock(expertReviewKey);
}
}

}

+ 76
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ReviewTemplateSettingsManage.java Прегледај датотеку

@@ -0,0 +1,76 @@
package com.ningdatech.pmapi.expert.manage;

import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateSettingsDTO;
import com.ningdatech.pmapi.expert.model.entity.ReviewTemplateSettings;
import com.ningdatech.pmapi.expert.model.enumeration.ReviewTemplateTypeEnum;
import com.ningdatech.pmapi.expert.model.req.ReviewTemplateReq;
import com.ningdatech.pmapi.expert.model.vo.ReviewTemplateVO;
import com.ningdatech.pmapi.expert.service.IReviewTemplateSettingsService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
* <p>
* ReviewTemplateSettingsManage
* </p>
*
* @author WendyYang
* @since 09:41 2023/2/15
*/
@Component
@AllArgsConstructor
public class ReviewTemplateSettingsManage {

private final IReviewTemplateSettingsService reviewTemplateSettingsService;

@Transactional(rollbackFor = Exception.class)
public void saveOrUpdate(ReviewTemplateReq req) {
ReviewTemplateTypeEnum type = ReviewTemplateTypeEnum.getByCode(req.getTemplateType());
LambdaUpdateWrapper<ReviewTemplateSettings> update = Wrappers.lambdaUpdate(ReviewTemplateSettings.class)
.eq(ReviewTemplateSettings::getTemplateType, type.getCode())
.eq(ReviewTemplateSettings::getRegionCode, req.getRegionCode())
.eq(ReviewTemplateSettings::getIsLast, Boolean.TRUE)
.set(ReviewTemplateSettings::getIsLast, Boolean.FALSE);
reviewTemplateSettingsService.update(update);
ReviewTemplateSettings settings = new ReviewTemplateSettings();
settings.setTemplateType(type.getCode());
settings.setRegionCode(req.getRegionCode());
settings.setIsLast(Boolean.TRUE);
settings.setContent(JSONUtil.toJsonStr(req.getTemplates()));
reviewTemplateSettingsService.save(settings);
}

public ReviewTemplateVO getReviewTemplateSettings(Integer templateType, String regionCode) {
LambdaQueryWrapper<ReviewTemplateSettings> query = Wrappers.lambdaQuery(ReviewTemplateSettings.class)
.eq(ReviewTemplateSettings::getIsLast, Boolean.TRUE)
.eq(ReviewTemplateSettings::getRegionCode, regionCode)
.eq(ReviewTemplateSettings::getTemplateType, templateType)
.last(BizConst.LIMIT_1);
ReviewTemplateSettings settings = reviewTemplateSettingsService.getOne(query);
return buildTemplateDetail(settings);
}

public ReviewTemplateVO getReviewTemplateSettings(Long templateId) {
ReviewTemplateSettings settings = reviewTemplateSettingsService.getById(templateId);
return buildTemplateDetail(settings);
}

private ReviewTemplateVO buildTemplateDetail(ReviewTemplateSettings settings) {
if (settings == null) {
throw BizException.wrap("模版不存在");
}
return ReviewTemplateVO.builder()
.templateId(settings.getId())
.templateType(settings.getTemplateType())
.templates(JSONUtil.toList(settings.getContent(), ReviewTemplateSettingsDTO.class))
.build();
}

}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertReviewMapper.java Прегледај датотеку

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

import com.ningdatech.pmapi.expert.model.entity.ExpertReview;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* <p>
* Mapper 接口
* </p>
*
* @author WendyYang
* @since 2023-02-15
*/
public interface ExpertReviewMapper extends BaseMapper<ExpertReview> {

}

pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/NdUserAuthMapper.xml → pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertReviewMapper.xml Прегледај датотеку

@@ -1,5 +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.user.mapper.NdUserAuthMapper">
<mapper namespace="com.ningdatech.pmapi.expert.mapper.ExpertReviewMapper">

</mapper>

+ 70
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ExpertReview.java Прегледај датотеку

@@ -0,0 +1,70 @@
package com.ningdatech.pmapi.expert.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
* <p>
* 专家评价
* </p>
*
* @author WendyYang
* @since 2023-02-15
*/
@Data
@TableName("nd_expert_review")
@ApiModel(value = "ExpertReview对象", description = "专家评价")
public class ExpertReview implements Serializable {

private static final long serialVersionUID = 1L;

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

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

@ApiModelProperty("评审模版配置ID")
private Long templateId;

@ApiModelProperty("评审内容")
private String content;

@ApiModelProperty("意见或建议")
private String advice;

@ApiModelProperty("附件ID")
private Long attachFileId;

@ApiModelProperty("评审结果")
private Integer reviewResult;

@ApiModelProperty("创建人姓名")
private String creator;

@ApiModelProperty("创建人")
@TableField(fill = FieldFill.INSERT)
private Long createBy;

@ApiModelProperty("创建时间")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createOn;

@ApiModelProperty("修改人")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Long updateBy;

@ApiModelProperty("是否是最终意见")
private Boolean isFinal;

@ApiModelProperty("修改时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateOn;

}

+ 14
- 75
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ReviewTemplateSettings.java Прегледај датотеку

@@ -1,10 +1,14 @@
package com.ningdatech.pmapi.expert.model.entity;

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

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

/**
* <p>
@@ -14,6 +18,7 @@ import io.swagger.annotations.ApiModelProperty;
* @author WendyYang
* @since 2023-02-14
*/
@Data
@TableName("nd_review_template_settings")
@ApiModel(value = "NdReviewTemplateSettings对象", description = "评审模版配置表")
public class ReviewTemplateSettings implements Serializable {
@@ -21,6 +26,7 @@ public class ReviewTemplateSettings implements Serializable {
private static final long serialVersionUID = 1L;

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

@ApiModelProperty("模版类型:1 初步方案评审模版、2 建设方案评审模版、3 验收方案评审模版")
@@ -29,85 +35,18 @@ public class ReviewTemplateSettings implements Serializable {
@ApiModelProperty("模版内容")
private String content;

private Long createBy;

private Long updateBy;

private LocalDateTime createOn;

private LocalDateTime updateOn;

@ApiModelProperty("是否是最新")
private Boolean isLast;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}
public Integer getTemplateType() {
return templateType;
}

public void setTemplateType(Integer templateType) {
this.templateType = templateType;
}
public String getContent() {
return content;
}

public void setContent(String content) {
this.content = content;
}
public Long getCreateBy() {
return createBy;
}
@ApiModelProperty("区域编码")
private String regionCode;

public void setCreateBy(Long createBy) {
this.createBy = createBy;
}
public Long getUpdateBy() {
return updateBy;
}

public void setUpdateBy(Long updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getCreateOn() {
return createOn;
}
private Long createBy;

public void setCreateOn(LocalDateTime createOn) {
this.createOn = createOn;
}
public LocalDateTime getUpdateOn() {
return updateOn;
}
private Long updateBy;

public void setUpdateOn(LocalDateTime updateOn) {
this.updateOn = updateOn;
}
public Boolean getIsLast() {
return isLast;
}
private LocalDateTime createOn;

public void setIsLast(Boolean isLast) {
this.isLast = isLast;
}
private LocalDateTime updateOn;

@Override
public String toString() {
return "NdReviewTemplateSettings{" +
"id=" + id +
", templateType=" + templateType +
", content=" + content +
", createBy=" + createBy +
", updateBy=" + updateBy +
", createOn=" + createOn +
", updateOn=" + updateOn +
", isLast=" + isLast +
"}";
}
}

+ 46
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/enumeration/ReviewTemplateTypeEnum.java Прегледај датотеку

@@ -0,0 +1,46 @@
package com.ningdatech.pmapi.expert.model.enumeration;

import lombok.Getter;

import java.util.Arrays;

/**
* <p>
* ReviewTemplateTypeEnum
* </p>
*
* @author WendyYang
* @since 09:48 2023/2/15
*/
@Getter
public enum ReviewTemplateTypeEnum {
/**
* 评审模版类型
*/
PRELIMINARY_SCHEME_REVIEW("初步方案评审", 1),

CONSTRUCTION_SCHEME_REVIEW("建设方案评审", 2),

ACCEPTANCE_SCHEME_REVIEW("验收方案评审", 3);


private final String value;
private final Integer code;

ReviewTemplateTypeEnum(String value, Integer code) {
this.value = value;
this.code = code;
}

public boolean eq(Integer code) {
return this.getCode().equals(code);
}

public static ReviewTemplateTypeEnum getByCode(Integer code) {
return Arrays.stream(values())
.filter(w -> w.getCode().equals(code))
.findFirst()
.orElseThrow(() -> new IllegalArgumentException("评审模版类型编码无效"));
}

}

+ 67
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertReviewDetailReq.java Прегледај датотеку

@@ -0,0 +1,67 @@
package com.ningdatech.pmapi.expert.model.req;

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

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
* <p>
* ExpertReviewDetailVO
* </p>
*
* @author WendyYang
* @since 14:37 2023/2/15
*/
@Data
public class ExpertReviewDetailReq {

@ApiModelProperty("模版ID")
@NotNull(message = "模版ID不能为空")
private Long templateId;

@ApiModelProperty("项目ID")
@NotNull(message = "项目ID不能为空")
private Long projectId;

@Valid
@ApiModelProperty("配置模版")
@NotEmpty(message = "配置不能为空")
private List<ReviewTemplateOptionVO> reviewTemplateOptions;

@ApiModelProperty("其他意见或建议")
@NotEmpty(message = "其他意见或建议不能为空")
private String otherAdvice;

@ApiModelProperty("附件ID")
private Long attachFileId;

@ApiModelProperty("评审结果:1 通过、2 需复核、3 不通过")
@NotNull(message = "评审结果不能为空")
private Integer reviewResult;

@ApiModelProperty("是否是最终意见")
@NotNull(message = "是否是最终意见不能为空")
private Boolean isFinal;

@Data
public static class ReviewTemplateOptionVO {

@ApiModelProperty("问题序号")
@NotNull(message = "问题序号不能为空")
private Integer questionSerialNo;

@ApiModelProperty("选项序号")
@NotEmpty(message = "选项序号不能为空")
private List<Integer> optionSerialNo;

@ApiModelProperty("其他意见或建议")
private String otherAdvice;

}


}

+ 37
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ReviewTemplateReq.java Прегледај датотеку

@@ -0,0 +1,37 @@
package com.ningdatech.pmapi.expert.model.req;

import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateSettingsDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
* <p>
* ReviewTemplateReq
* </p>
*
* @author WendyYang
* @since 10:11 2023/2/15
*/
@Data
public class ReviewTemplateReq {

@ApiModelProperty("模版类型")
@NotNull(message = "模版类型不能为空")
private Integer templateType;

@ApiModelProperty("区域编码")
@NotBlank(message = "区域编码不能为空")
private String regionCode;

@Valid
@NotEmpty(message = "模版不能为空")
@ApiModelProperty("模版数据")
private List<ReviewTemplateSettingsDTO> templates;

}

+ 34
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ReviewTemplateVO.java Прегледај датотеку

@@ -0,0 +1,34 @@
package com.ningdatech.pmapi.expert.model.vo;

import com.ningdatech.pmapi.expert.model.dto.ReviewTemplateSettingsDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
* <p>
* ReviewTemplateReq
* </p>
*
* @author WendyYang
* @since 10:11 2023/2/15
*/
@Data
@Builder
public class ReviewTemplateVO {

@ApiModelProperty("模版ID")
private Long templateId;

@ApiModelProperty("模版类型")
private Integer templateType;

@ApiModelProperty("模版数据")
private List<ReviewTemplateSettingsDTO> templates;

}

+ 28
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertReviewService.java Прегледај датотеку

@@ -0,0 +1,28 @@
package com.ningdatech.pmapi.expert.service;

import com.ningdatech.pmapi.expert.model.entity.ExpertReview;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
* <p>
* 服务类
* </p>
*
* @author WendyYang
* @since 2023-02-15
*/
public interface IExpertReviewService extends IService<ExpertReview> {

/**
* 根据项目ID和专家ID获取评审记录
*
* @param projectId 项目ID
* @param expertId 专家ID
* @return 评审记录
* @author WendyYang
**/
List<ExpertReview> listByProjectIdAndExpertId(Long projectId, Long expertId);

}

+ 33
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertReviewServiceImpl.java Прегледај датотеку

@@ -0,0 +1,33 @@
package com.ningdatech.pmapi.expert.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.expert.mapper.ExpertReviewMapper;
import com.ningdatech.pmapi.expert.model.entity.ExpertReview;
import com.ningdatech.pmapi.expert.service.IExpertReviewService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* <p>
* 服务实现类
* </p>
*
* @author WendyYang
* @since 2023-02-15
*/
@Service
public class ExpertReviewServiceImpl extends ServiceImpl<ExpertReviewMapper, ExpertReview> implements IExpertReviewService {

@Override
public List<ExpertReview> listByProjectIdAndExpertId(Long projectId, Long expertId) {
LambdaQueryWrapper<ExpertReview> query = Wrappers.lambdaQuery(ExpertReview.class);
query.eq(ExpertReview::getProjectId, projectId);
query.eq(ExpertReview::getCreateBy, expertId);
query.orderByAsc(ExpertReview::getCreateOn);
return list(query);
}

}

+ 7
- 5
pmapi/src/main/java/com/ningdatech/pmapi/organization/model/entity/DingEmployeeInfo.java Прегледај датотеку

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

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

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

/**
* <p>
*
*
* </p>
*
* @author Lierbao
@@ -32,7 +32,7 @@ public class DingEmployeeInfo implements Serializable {

private Long updateBy;

private String emplyeeName;
private String employeeName;

private String gmtCreate;

@@ -68,4 +68,6 @@ public class DingEmployeeInfo implements Serializable {

private String empStatus;

private Long accountId;

}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ProjectAdjustmentController.java Прегледај датотеку

@@ -56,6 +56,6 @@ public class ProjectAdjustmentController {
@PostMapping
public String startTheProcess(@Validated @RequestBody DefaultDeclaredDTO dto) {
String instanceId = projectAdjustmentManage.adjustment(dto);
return "建设方案申报 【" + instanceId + "】 成功";
return "项目内容调整并且重新申报 【" + instanceId + "】 成功";
}
}

+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java Прегледај датотеку

@@ -24,6 +24,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.Collections;
@@ -57,6 +58,7 @@ public class ConstructionPlanManage {
* @param dto
* @return
*/
@Transactional(rollbackFor = Exception.class)
public String startTheProcess(DefaultDeclaredDTO dto) {
ProjectDTO projectDto = dto.getProjectInfo();
VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!");


+ 9
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java Прегледај датотеку

@@ -34,6 +34,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.Collections;
@@ -65,6 +66,8 @@ public class DeclaredProjectManage {

private final IProjectInstService projectInstService;

private final DefaultDeclaredProjectManage defaultDeclaredProjectManage;

public PageVo<ProjectDraftVO> pageDraft(DeclaredProjectListParamDTO params) {
Page<ProjectDraft> page = params.page();
LambdaQueryWrapper<ProjectDraft> wrapper = Wrappers.lambdaQuery(ProjectDraft.class)
@@ -108,6 +111,7 @@ public class DeclaredProjectManage {
* @param dto
* @return
*/
@Transactional(rollbackFor = Exception.class)
public String startTheProcess(DefaultDeclaredDTO dto) {
ProjectDTO projectInfo = dto.getProjectInfo();
String regionCode = projectInfo.getAreaCode();
@@ -122,6 +126,9 @@ public class DeclaredProjectManage {
throw new BusinessException(String.format("此 【%s】区域找不到单位流程配置", regionCode));
}

//项目名称去重
defaultDeclaredProjectManage.checkDuplication(projectInfo);

ProcessStartParamsVo params = new ProcessStartParamsVo();
params.setUser(dto.getUser());
params.setProcessUsers(Collections.emptyMap());
@@ -133,6 +140,7 @@ public class DeclaredProjectManage {
})
);
params.setFormData(dto.getFormData());
//开始申报
String instanceId = processService.startProcess(model.getProcessDefId(), params);
log.info("申报项目成功 【{}】", instanceId);

@@ -148,6 +156,7 @@ public class DeclaredProjectManage {
* @param dto
* @return
*/
@Transactional(rollbackFor = Exception.class)
public String reStartTheProcess(DefaultDeclaredDTO dto) {
ProjectDTO projectDto = dto.getProjectInfo();
VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!");


+ 13
- 27
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java Прегледај датотеку

@@ -1,14 +1,14 @@
package com.ningdatech.pmapi.projectdeclared.manage;

import com.google.common.collect.Maps;
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Map;
import java.util.function.Function;
import java.util.Objects;

/**
* @Classname DefaultDeclaredProjectManage
@@ -22,28 +22,14 @@ import java.util.function.Function;
@RequiredArgsConstructor
public class DefaultDeclaredProjectManage {

private final DeclaredProjectManage declaredProjectManage;
private final IProjectService projectService;

private final ConstructionPlanManage constructionPlanManage;

private final PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage;
public Map<Integer, Function<DefaultDeclaredDTO,String>> startProcessMap = Maps.newHashMap();

/**
* 初始化业务分派逻辑,代替了if-else部分
* key: 枚举 状态值
* value: lambda表达式,最终会获取发起实例的函数
*/
@PostConstruct
public void startProcessInit(){
startProcessMap.put(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(),
dto->declaredProjectManage.reStartTheProcess(dto));
startProcessMap.put(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode(),
dto->constructionPlanManage.startTheProcess(dto));
startProcessMap.put(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(),
dto->prequalificationDeclaredProjectManage.startTheProcess(dto));
startProcessMap.put(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(),
dto->null);
//项目名称去重
public void checkDuplication(ProjectDTO project){
VUtils.isTrue(projectService.count(Wrappers.lambdaQuery(Project.class)
.eq(Project::getProjectName,project.getProjectName())
.ne(Objects.nonNull(project.getId()),Project::getId,project.getId())) > 0)
.throwMessage(String.format("修改失败 此项目名 【%s】 已存在!",project.getProjectName()));
}

}

+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java Прегледај датотеку

@@ -24,6 +24,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.Collections;
@@ -57,6 +58,7 @@ public class PrequalificationDeclaredProjectManage {
* @param dto
* @return
*/
@Transactional(rollbackFor = Exception.class)
public String startTheProcess(DefaultDeclaredDTO dto) {
ProjectDTO projectDto = dto.getProjectInfo();
VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!");


+ 23
- 6
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ProjectAdjustmentManage.java Прегледај датотеку

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.ningdatech.pmapi.projectdeclared.utils.ReStartProcessMapUtil;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
@@ -14,6 +15,8 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
@@ -35,6 +38,8 @@ public class ProjectAdjustmentManage {

private final IProjectApplicationService projectApplicationService;

private final ReStartProcessMapUtil reStartProcessMapUtil;

private final DefaultDeclaredProjectManage defaultDeclaredProjectManage;

/**
@@ -42,12 +47,29 @@ public class ProjectAdjustmentManage {
* @param dto
* @return
*/
@Transactional(rollbackFor = Exception.class)
public String adjustment(DefaultDeclaredDTO dto) {
ProjectDTO projectDto = dto.getProjectInfo();
Project projectInfo = projectService.getById(projectDto.getId());

VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("调整失败 此项目不存在!");

//项目名称去重
defaultDeclaredProjectManage.checkDuplication(projectDto);

//修改项目内容
if(!modifyProject(projectDto)){
throw new BusinessException("调整项目失败!");
}

//最后去重新 提交项目流程 不同的状态 提交到不同的工作流去
Function<DefaultDeclaredDTO, String> declaredFunction =
reStartProcessMapUtil.reStartProcessMap.get(projectInfo.getStatus());
VUtils.isTrue(Objects.isNull(declaredFunction)).throwMessage("状态不正常 没有找到对应申报函数!");
return declaredFunction.apply(dto);
}

private Boolean modifyProject(ProjectDTO projectDto) {
//先修改项目信息
Project project = new Project();
BeanUtils.copyProperties(projectDto,project);
@@ -69,11 +91,6 @@ public class ProjectAdjustmentManage {
}).collect(Collectors.toList());
projectApplicationService.saveBatch(applications);
}

//最后去重新 提交项目流程 不同的状态 提交到不同的工作流去
Function<DefaultDeclaredDTO, String> declaredFunction =
defaultDeclaredProjectManage.startProcessMap.get(project.getStatus());
VUtils.isTrue(Objects.isNull(declaredFunction)).throwMessage("状态不正常 没有找到对应申报函数!");
return declaredFunction.apply(dto);
return Boolean.TRUE;
}
}

+ 9
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DeclaredProjectListParamDTO.java Прегледај датотеку

@@ -1,6 +1,7 @@
package com.ningdatech.pmapi.projectdeclared.model.dto;

import com.ningdatech.basic.model.PagePo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -19,21 +20,29 @@ import org.springframework.format.annotation.DateTimeFormat;
@AllArgsConstructor
public class DeclaredProjectListParamDTO extends PagePo {

@ApiModelProperty("用户ID")
private String userId;

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

@ApiModelProperty("项目类型 1建设 2运维")
private Integer projectType;

@ApiModelProperty("项目阶段")
private Integer projectStage;

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

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

@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("开始时间")
private String startTime;

@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("结束时间")
private String endTime;
}

+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DefaultDeclaredDTO.java Прегледај датотеку

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import com.google.common.collect.Maps;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -24,11 +25,14 @@ import java.util.Map;
public class DefaultDeclaredDTO implements Serializable {

@NotNull
@ApiModelProperty("项目信息")
private ProjectDTO projectInfo;

@ApiModelProperty("表单信息 保留")
private Map<String,Object> formData;

@NotNull
@ApiModelProperty("用户信息 暂时填一下")
private ProcessInstanceUserDto user;

public Map<String,Object> getFormData(){


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ProjectDraftSaveDTO.java Прегледај датотеку

@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.projectdeclared.model.dto;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@@ -26,9 +27,11 @@ public class ProjectDraftSaveDTO implements Serializable {
private static final long serialVersionUID = 1L;

@NotNull
@ApiModelProperty("项目信息")
private ProjectDTO projectInfo;

@NotNull
@ApiModelProperty("用户信息")
private ProcessInstanceUserDto user;

}

+ 47
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/utils/ReStartProcessMapUtil.java Прегледај датотеку

@@ -0,0 +1,47 @@
package com.ningdatech.pmapi.projectdeclared.utils;

import com.google.common.collect.Maps;
import com.ningdatech.pmapi.projectdeclared.manage.ConstructionPlanManage;
import com.ningdatech.pmapi.projectdeclared.manage.DeclaredProjectManage;
import com.ningdatech.pmapi.projectdeclared.manage.PrequalificationDeclaredProjectManage;
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.Map;
import java.util.function.Function;

/**
* @Classname ReSubmitProcessMap
* @Description 项目调整 重新提交时的 事件函数MAP
* @Date 2023/2/15 11:19
* @Author PoffyZhang
*/
@Component
@RequiredArgsConstructor
public class ReStartProcessMapUtil {
private final DeclaredProjectManage declaredProjectManage;

private final ConstructionPlanManage constructionPlanManage;

private final PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage;
public Map<Integer, Function<DefaultDeclaredDTO,String>> reStartProcessMap = Maps.newHashMap();
/**
* 初始化业务分派逻辑,代替了if-else部分
* key: 枚举 状态值
* value: lambda表达式,最终会获取发起实例的函数
*/
@PostConstruct
public void reStartProcessInit(){
reStartProcessMap.put(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(),
dto->declaredProjectManage.reStartTheProcess(dto));
reStartProcessMap.put(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode(),
dto->constructionPlanManage.startTheProcess(dto));
reStartProcessMap.put(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(),
dto->prequalificationDeclaredProjectManage.startTheProcess(dto));
reStartProcessMap.put(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(),
dto->null);
}
}

+ 20
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectRenewalFundDeclarationController.java Прегледај датотеку

@@ -0,0 +1,20 @@
package com.ningdatech.pmapi.projectlib.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

/**
* <p>
* 续建项目资金申请表 前端控制器
* </p>
*
* @author WendyYang
* @since 2023-02-15
*/
@Controller
@RequestMapping("/pmapi.projectlib/nd-project-renewal-fund-declaration")
public class ProjectRenewalFundDeclarationController {

}

+ 23
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/ProjectRenewalApprovalStatusEnum.java Прегледај датотеку

@@ -0,0 +1,23 @@
package com.ningdatech.pmapi.projectlib.enumeration;


/**
* <p>
* ProjectRenewalApprovalStatusEnum
* </p>
*
* @author Poffy
* @since 16:54 2023/2/11
*/
public enum ProjectRenewalApprovalStatusEnum {
/**
* 续建项目 审核状态
* 审核中
* 通过
* 不通过
*/
PENDING,
PASS,
NOT_PASS;

}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectRenewalFundDeclarationMapper.java Прегледај датотеку

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

import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* <p>
* 续建项目资金申请表 Mapper 接口
* </p>
*
* @author WendyYang
* @since 2023-02-15
*/
public interface ProjectRenewalFundDeclarationMapper extends BaseMapper<ProjectRenewalFundDeclaration> {

}

pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserInfoMapper.xml → pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectRenewalFundDeclarationMapper.xml Прегледај датотеку

@@ -1,5 +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.user.mapper.UserInfoMapper">
<mapper namespace="com.ningdatech.pmapi.projectlib.mapper.ProjectRenewalFundDeclarationMapper">

</mapper>

+ 0
- 10
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDTO.java Прегледај датотеку

@@ -36,12 +36,6 @@ public class ProjectApplicationDTO implements Serializable {
@ApiModelProperty("创建时间")
private LocalDateTime createOn;

@ApiModelProperty("更新时间")
private LocalDateTime updateOn;

@ApiModelProperty("删除时间")
private LocalDateTime deleteOn;

@ApiModelProperty("关联IRS现有应用")
private String relatedExistsApplication;

@@ -162,8 +156,4 @@ public class ProjectApplicationDTO implements Serializable {
@ApiModelProperty("试点文件")
private String experimentsFile;

private Long createBy;

private Long updateBy;

}

+ 0
- 23
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java Прегледај датотеку

@@ -34,12 +34,6 @@ public class ProjectDTO implements Serializable {
@ApiModelProperty("所属地区名称")
private String area;

@ApiModelProperty("项目阶段")
private Integer stage;

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

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

@@ -231,13 +225,6 @@ public class ProjectDTO implements Serializable {
@ApiModelProperty("一地创新全省共享项目-是否开启 false:关闭 true:开启")
private Boolean isInnovateWholeProvinceShare;

private LocalDateTime createOn;

private LocalDateTime updateOn;

@ApiModelProperty("流程实例编号")
private String instCode;

@ApiModelProperty("安全投入-模块信息")
private String safetyInputModular;

@@ -274,12 +261,6 @@ public class ProjectDTO implements Serializable {
@ApiModelProperty("前端所需验证字段")
private Integer allApplicationsDone;

@ApiModelProperty("流程实例id")
private String processInsId;

@ApiModelProperty("流程实例 formId")
private String formId;

@ApiModelProperty("项目应用实例")
private List<ProjectApplicationDTO> applicationList;

@@ -289,8 +270,4 @@ public class ProjectDTO implements Serializable {
@ApiModelProperty("动态表单 json")
private Map<String,Object> dynamicForm;

private Long createBy;

private Long updateBy;

}

+ 173
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectRenewalFundDeclaration.java Прегледај датотеку

@@ -0,0 +1,173 @@
package com.ningdatech.pmapi.projectlib.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;

/**
* <p>
* 续建项目资金申请表
* </p>
*
* @author WendyYang
* @since 2023-02-15
*/
@TableName("nd_project_renewal_fund_declaration")
@ApiModel(value = "NdProjectRenewalFundDeclaration对象", description = "续建项目资金申请表")
public class ProjectRenewalFundDeclaration implements Serializable {

private static final long serialVersionUID = 1L;

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

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

@ApiModelProperty("修改时间")
private LocalDateTime updateOn;

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

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

@ApiModelProperty("年度支付金额")
private BigDecimal annualPaymentAmount;

@ApiModelProperty("自有资金")
private BigDecimal haveAmount;

@ApiModelProperty("政府投资 本级财务金额")
private BigDecimal govOwnFinanceAmount;

@ApiModelProperty("政府投资 上级财务金额")
private BigDecimal govSuperiorFinanceAmount;

@ApiModelProperty("银行贷款金额")
private BigDecimal bankLendingAmount;

@ApiModelProperty("其它金额")
private BigDecimal otherAmount;

@ApiModelProperty("审核状态 待审核PENGING 审核通过PASS 审核不通过NO_PASS")
private String approvalStatus;

@ApiModelProperty("是否删除 false未删 true已删")
private Boolean deleted;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}
public LocalDateTime getCreateOn() {
return createOn;
}

public void setCreateOn(LocalDateTime createOn) {
this.createOn = createOn;
}
public LocalDateTime getUpdateOn() {
return updateOn;
}

public void setUpdateOn(LocalDateTime updateOn) {
this.updateOn = updateOn;
}
public Long getProjectId() {
return projectId;
}

public void setProjectId(Long projectId) {
this.projectId = projectId;
}
public Integer getProjectYear() {
return projectYear;
}

public void setProjectYear(Integer projectYear) {
this.projectYear = projectYear;
}
public BigDecimal getAnnualPaymentAmount() {
return annualPaymentAmount;
}

public void setAnnualPaymentAmount(BigDecimal annualPaymentAmount) {
this.annualPaymentAmount = annualPaymentAmount;
}
public BigDecimal getHaveAmount() {
return haveAmount;
}

public void setHaveAmount(BigDecimal haveAmount) {
this.haveAmount = haveAmount;
}
public BigDecimal getGovOwnFinanceAmount() {
return govOwnFinanceAmount;
}

public void setGovOwnFinanceAmount(BigDecimal govOwnFinanceAmount) {
this.govOwnFinanceAmount = govOwnFinanceAmount;
}
public BigDecimal getGovSuperiorFinanceAmount() {
return govSuperiorFinanceAmount;
}

public void setGovSuperiorFinanceAmount(BigDecimal govSuperiorFinanceAmount) {
this.govSuperiorFinanceAmount = govSuperiorFinanceAmount;
}
public BigDecimal getBankLendingAmount() {
return bankLendingAmount;
}

public void setBankLendingAmount(BigDecimal bankLendingAmount) {
this.bankLendingAmount = bankLendingAmount;
}
public BigDecimal getOtherAmount() {
return otherAmount;
}

public void setOtherAmount(BigDecimal otherAmount) {
this.otherAmount = otherAmount;
}
public String getApprovalStatus() {
return approvalStatus;
}

public void setApprovalStatus(String approvalStatus) {
this.approvalStatus = approvalStatus;
}
public Boolean getDeleted() {
return deleted;
}

public void setDeleted(Boolean deleted) {
this.deleted = deleted;
}

@Override
public String toString() {
return "NdProjectRenewalFundDeclaration{" +
"id=" + id +
", createOn=" + createOn +
", updateOn=" + updateOn +
", projectId=" + projectId +
", projectYear=" + projectYear +
", annualPaymentAmount=" + annualPaymentAmount +
", haveAmount=" + haveAmount +
", govOwnFinanceAmount=" + govOwnFinanceAmount +
", govSuperiorFinanceAmount=" + govSuperiorFinanceAmount +
", bankLendingAmount=" + bankLendingAmount +
", otherAmount=" + otherAmount +
", approvalStatus=" + approvalStatus +
", deleted=" + deleted +
"}";
}
}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectRenewalFundDeclarationService.java Прегледај датотеку

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

import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* <p>
* 续建项目资金申请表 服务类
* </p>
*
* @author WendyYang
* @since 2023-02-15
*/
public interface IProjectRenewalFundDeclarationService extends IService<ProjectRenewalFundDeclaration> {

}

+ 20
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectRenewalFundDeclarationServiceImpl.java Прегледај датотеку

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

import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.ningdatech.pmapi.projectlib.mapper.ProjectRenewalFundDeclarationMapper;
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
* <p>
* 续建项目资金申请表 服务实现类
* </p>
*
* @author WendyYang
* @since 2023-02-15
*/
@Service
public class ProjectRenewalFundDeclarationServiceImpl extends ServiceImpl<ProjectRenewalFundDeclarationMapper, ProjectRenewalFundDeclaration> implements IProjectRenewalFundDeclarationService {

}

+ 38
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/RegionController.java Прегледај датотеку

@@ -0,0 +1,38 @@
package com.ningdatech.pmapi.sys.controller;

import com.ningdatech.pmapi.sys.manage.RegionManage;
import com.ningdatech.pmapi.sys.model.vo.RegionTreeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
* <p>
* 前端控制器
* </p>
*
* @author LiuXinXin
* @since 2022-10-08
*/
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/region")
@Api(tags = "系统管理-地域管理")
public class RegionController {

private final RegionManage regionManage;

@GetMapping("/tree")
@ApiOperation("获取区域编码的树状结构")
public List<RegionTreeVO> getRegionTree() {
return regionManage.getRegionTree();
}

}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RegionManage.java Прегледај датотеку

@@ -24,7 +24,7 @@ public class RegionManage {

private final IRegionService regionService;

private final static Long ROOT_PARENT_ID = 1L;
private final static Long ROOT_PARENT_ID = 0L;

public List<RegionTreeVO> getRegionTree() {
List<RegionDTO> regions = regionService.queryAll();


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Menu.java Прегледај датотеку

@@ -46,7 +46,7 @@ public class Menu extends MenuTreeEntity<Menu, Long> {

@ApiModelProperty(value = "是否隐藏")
@TableField(value = "hidden")
private Boolean hidden;
private Integer hidden;

@ApiModelProperty(value = "activeMenu")
@TableField(value = "active_menu")


+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/entity/ProgressNode.java Прегледај датотеку

@@ -4,6 +4,7 @@ import com.ningdatech.pmapi.todocenter.bean.vo.ProgressNodeAuditInfoVo;
import com.wflow.workflow.bean.process.OrgUser;
import com.wflow.workflow.bean.process.enums.ApprovalModeEnum;
import com.wflow.workflow.bean.process.enums.NodeTypeEnum;
import com.wflow.workflow.bean.vo.UserInfoVO;
import com.wflow.workflow.enums.ProcessHandlerEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;


+ 0
- 35
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/entity/UserInfoVO.java Прегледај датотеку

@@ -1,35 +0,0 @@
package com.ningdatech.pmapi.todocenter.bean.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* 节点用户相关信息
*
* @author CMM
* @since 2023/02/15 14:28
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserInfoVO {

@ApiModelProperty("用户ID")
private Long userId;

@ApiModelProperty("用户真实姓名")
private String realName;

@ApiModelProperty("浙政钉accountId")
private Long accountId;

@ApiModelProperty("用户部门编号")
private String organizationCode;

@ApiModelProperty("用户部门名称")
private String organizationName;
}

+ 1
- 4
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProcessProgressDetailVo.java Прегледај датотеку

@@ -1,12 +1,9 @@
package com.ningdatech.pmapi.todocenter.bean.vo;


import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode;
import com.ningdatech.pmapi.todocenter.bean.entity.UserInfoVO;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.wflow.workflow.bean.process.OrgUser;
import com.wflow.workflow.bean.process.form.Form;
import com.wflow.workflow.bean.vo.UserInfoVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;


+ 1
- 3
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProgressNodeAuditInfoVo.java Прегледај датотеку

@@ -1,9 +1,7 @@
package com.ningdatech.pmapi.todocenter.bean.vo;

import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment;
import com.ningdatech.pmapi.todocenter.bean.entity.UserInfoVO;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.wflow.workflow.bean.process.OrgUser;
import com.wflow.workflow.bean.vo.UserInfoVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;


+ 97
- 70
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java Прегледај датотеку

@@ -24,7 +24,6 @@ import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment;
import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode;
import com.ningdatech.pmapi.todocenter.bean.entity.UserInfoVO;
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo;
import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo;
import com.ningdatech.pmapi.todocenter.bean.vo.ProgressNodeAuditInfoVo;
@@ -37,13 +36,10 @@ import com.ningdatech.pmapi.todocenter.model.dto.req.ReqProcessHandlerDTO;
import com.ningdatech.pmapi.todocenter.model.dto.req.ReqToBeProcessedDTO;
import com.ningdatech.pmapi.todocenter.model.dto.req.ReqToBeProcessedExportDTO;
import com.ningdatech.pmapi.todocenter.model.dto.res.ResToBeProcessedDTO;
import com.ningdatech.pmapi.user.entity.NdUserInfo;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.service.INdUserInfoService;
import com.ningdatech.pmapi.user.service.IUserInfoService;
import com.ningdatech.zwdd.client.ZwddClient;
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.wflow.bean.do_.UserDo;
import com.wflow.bean.entity.WflowCcTasks;
import com.wflow.bean.entity.WflowModelHistorys;
import com.wflow.bean.entity.WflowModels;
@@ -52,7 +48,6 @@ import com.wflow.mapper.WflowCcTasksMapper;
import com.wflow.mapper.WflowModelHistorysMapper;
import com.wflow.service.OrgRepositoryService;
import com.wflow.utils.CodeUtil;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import com.wflow.workflow.bean.process.OrgUser;
import com.wflow.workflow.bean.process.ProcessNode;
import com.wflow.workflow.bean.process.enums.ApprovalModeEnum;
@@ -61,6 +56,7 @@ import com.wflow.workflow.bean.process.form.Form;
import com.wflow.workflow.bean.process.props.ApprovalProps;
import com.wflow.workflow.bean.vo.ProcessInstanceVo;
import com.wflow.workflow.bean.vo.ProcessTaskVo;
import com.wflow.workflow.bean.vo.UserInfoVO;
import com.wflow.workflow.config.WflowGlobalVarDef;
import com.wflow.workflow.enums.ProcessHandlerEnum;
import com.wflow.workflow.service.FormService;
@@ -118,7 +114,7 @@ public class TodoCenterManage {
private final OrgRepositoryService orgRepositoryService;
private final WflowCcTasksMapper ccTasksMapper;
private final ProcessModelService processModelService;
private final INdUserInfoService userInfoService;
private final IUserInfoService userInfoService;
private final IProjectService projectService;
private final StateMachineUtils stateMachineUtils;
private final ZwddClient zwddClient;
@@ -181,31 +177,45 @@ public class TodoCenterManage {
// 从待办任务列表中取出当前登录用户及项目实例对应的任务
Task task = taskMap.get(d.getInstCode());
HistoricProcessInstance instance = instanceMap.get(task.getProcessInstanceId());
//HashSet<String> userSet = new HashSet<>();
//userSet.add(instance.getStartUserId()) ;
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet);
//res.setOwner(userMap.get(Long.valueOf(instance.getStartUserId())));
UserInfoVO owner = new UserInfoVO();
owner.setUserId(Long.valueOf(instance.getStartUserId()));
res.setOwner(owner);
// 从缓存取
staterUsers.add(String.valueOf(userId));
ProcessTaskVo processTaskVo = ProcessTaskVo.builder().taskId(task.getId()).taskName(task.getName())
.taskDefKey(task.getTaskDefinitionKey()).processDefId(task.getProcessDefinitionId())
.executionId(task.getExecutionId()).nodeId(task.getTaskDefinitionKey())
.deployId(instance.getDeploymentId()).processDefName(instance.getProcessDefinitionName())
.version(instance.getProcessDefinitionVersion()).instanceId(task.getProcessInstanceId())
.ownerId(instance.getStartUserId()).createTime(instance.getStartTime())
.taskCreateTime(task.getCreateTime()).build();
ProcessTaskVo processTaskVo = ProcessTaskVo.builder()
.taskId(task.getId())
.taskName(task.getName())
.taskDefKey(task.getTaskDefinitionKey())
.processDefId(task.getProcessDefinitionId())
.executionId(task.getExecutionId())
.nodeId(task.getTaskDefinitionKey())
.deployId(instance.getDeploymentId())
.processDefName(instance.getProcessDefinitionName())
.version(instance.getProcessDefinitionVersion())
.instanceId(task.getProcessInstanceId())
.ownerId(instance.getStartUserId())
.createTime(instance.getStartTime())
.taskCreateTime(task.getCreateTime())
.build();
res.setProcessTaskInfo(processTaskVo);
return res;
}).collect(Collectors.toList());
// 取用户信息,减少数据库查询,一次构建
if (isNotEmpty(staterUsers)) {
Map<String, OrgUser> userMap = userDeptOrLeaderService.getUserMapByIds(staterUsers);
resVos.stream()
.peek(v -> v.getProcessTaskInfo().setOwner(userMap.get(v.getProcessTaskInfo().getOwnerId())))
.collect(Collectors.toList());
// Map<Long,UserInfo> userMap = userInfoService.getUserMapByIds(staterUsers);
// result = resVos.stream().peek(v -> v.setOwner(userMap.get(userId)))
// .collect(Collectors.toList());
}
if (isEmpty(resVos)) {
return PageVo.empty();
}
// 取用户信息,减少数据库查询,一次构建
List<ResToBeProcessedDTO> result = null;
if (isNotEmpty(staterUsers)) {
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(staterUsers);
//result = resVos.stream()
// .peek(v -> v.getProcessTaskInfo().setStartUser(userMap.get(Long.valueOf(v.getProcessTaskInfo().getOwnerId()))))
// .collect(Collectors.toList());
}
// return PageVo.of(result, total);
return PageVo.of(resVos, total);
}

@@ -383,7 +393,7 @@ public class TodoCenterManage {
// 流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被驳回,请及时处理。
String startUserId = getRootUserId(rootNode, task.getProcessInstanceId());
// 获取浙政钉用户ID
NdUserInfo auditUserInfo = userInfoService.getById(Long.valueOf(startUserId));
UserInfo auditUserInfo = userInfoService.getById(Long.valueOf(startUserId));
WorkNoticeInfo sendWorkNoticeInfo = getSendWorkNoticeInfo(auditUserInfo);
WflowModels wflowModels = getLastWflowModels(task);
String formName = wflowModels.getFormName();
@@ -496,7 +506,7 @@ public class TodoCenterManage {
Task currentTask = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
// 获取审核人信息,向审核人发送工作通知
String currentUserId = currentTask.getAssignee();
NdUserInfo auditUserInfo = userInfoService.getById(Long.valueOf(currentUserId));
UserInfo auditUserInfo = userInfoService.getById(Long.valueOf(currentUserId));
// 获取发送浙政钉工作通知必要信息
WorkNoticeInfo sendWorkNoticeInfo = getSendWorkNoticeInfo(auditUserInfo);
String msg = String.format(PASS_MSG_TEMPLATE, null, projectName);
@@ -542,7 +552,7 @@ public class TodoCenterManage {
String nextUserId = getNextUserId(currentNode, processInstanceId);
if (Objects.nonNull(nextUserId)) {
// 获取浙政钉用户ID
NdUserInfo auditUserInfo = userInfoService.getById(Long.valueOf(nextUserId));
UserInfo auditUserInfo = userInfoService.getById(Long.valueOf(nextUserId));
WorkNoticeInfo sendWorkNoticeInfo = getSendWorkNoticeInfo(auditUserInfo);
String msg = String.format(PASS_MSG_TEMPLATE, null, projectName);
zwddClient.sendWorkNotice(sendWorkNoticeInfo.getReceiverUserId(),sendWorkNoticeInfo.getBizMsgId(),msg);
@@ -553,7 +563,7 @@ public class TodoCenterManage {
FlowNode rootNode = (FlowNode) bpmnModel.getFlowElement("root");
String startUserId = getRootUserId(rootNode, task.getProcessInstanceId());
// 获取浙政钉用户ID
NdUserInfo auditUserInfo = userInfoService.getById(Long.valueOf(startUserId));
UserInfo auditUserInfo = userInfoService.getById(Long.valueOf(startUserId));
WorkNoticeInfo sendWorkNoticeInfo = getSendWorkNoticeInfo(auditUserInfo);
WflowModels wflowModels = getLastWflowModels(task);
String formName = wflowModels.getFormName();
@@ -569,7 +579,7 @@ public class TodoCenterManage {
* @author CMM
* @since 2023/02/15 14:04
*/
private WorkNoticeInfo getSendWorkNoticeInfo(NdUserInfo auditUserInfo) {
private WorkNoticeInfo getSendWorkNoticeInfo(UserInfo auditUserInfo) {
WorkNoticeInfo workNoticeInfo = new WorkNoticeInfo();
Long accountId = auditUserInfo.getAccountId();
if (Objects.isNull(accountId)){
@@ -872,7 +882,7 @@ public class TodoCenterManage {
projectService.updateById(declaredProject);
// TODO 给项目创建人、流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被退回,请及时处理。
String startUserId = getRootUserId(rootNode, task.getProcessInstanceId());
NdUserInfo auditUserInfo = userInfoService.getById(Long.valueOf(startUserId));
UserInfo auditUserInfo = userInfoService.getById(Long.valueOf(startUserId));
WorkNoticeInfo sendWorkNoticeInfo = getSendWorkNoticeInfo(auditUserInfo);
WflowModels wflowModels = getLastWflowModels(task);
String formName = wflowModels.getFormName();
@@ -925,11 +935,11 @@ public class TodoCenterManage {
.build()));
currentNode = nodeCatchService.reloadProcessByStr(modelHistory.getProcess()).get(nodeId);
}
NdUserInfo userInfo = userInfoService.getById(Long.valueOf(instance.getStartUserId()));
HashSet<String> userSet = new HashSet<>();
userSet.add(String.valueOf(userInfo.getId()));
Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet);
UserInfoVO userInfoVO = userMap.get(userInfo.getId());
//UserInfo userInfo = userInfoService.getById(Long.valueOf(instance.getStartUserId()));
//HashSet<String> userSet = new HashSet<>();
//userSet.add(String.valueOf(userInfo.getId()));
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet);
//UserInfoVO userInfoVO = userMap.get(userInfo.getId());
List<ProgressNode> taskRecords = getHisTaskRecords(instanceId, nodePropsValue);
// 获取添加抄送任务
taskRecords.addAll(getCcTaskRecords(instanceId));
@@ -943,7 +953,7 @@ public class TodoCenterManage {
taskRecords.add(0, ProgressNode.builder()
.nodeId("root")
.name("提交申请")
.user(userInfoVO)
//.user(userInfoVO)
.nodeType(NodeTypeEnum.ROOT)
.startTime(instance.getStartTime())
.finishTime(instance.getStartTime())
@@ -962,7 +972,7 @@ public class TodoCenterManage {
.startTime(instance.getStartTime())
.progress(taskRecords)
.build();
res.setStartUser(userInfoVO);
//res.setStartUser(userInfoVO);
if (Objects.isNull(instance.getEndActivityId())) {
res.setStatus(ProcessStatusEnum.UNDER_REVIEW.name());
} else if (HisProInsEndActId.BACK.equals(instance.getEndActivityId())) {
@@ -1151,6 +1161,13 @@ public class TodoCenterManage {
// 从已处理任务实例列表中取出当前登录用户及项目实例对应的任务实例
HistoricTaskInstance task = taskInstanceMap.get(d.getInstCode());
HistoricProcessInstance instance = instanceMap.get(task.getProcessInstanceId());
//HashSet<String> userSet = new HashSet<>();
//userSet.add(instance.getStartUserId()) ;
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet);
//res.setOwner(userMap.get(Long.valueOf(instance.getStartUserId())));
UserInfoVO owner = new UserInfoVO();
owner.setUserId(Long.valueOf(instance.getStartUserId()));
res.setOwner(owner);
// 从缓存取
staterUsers.add(instance.getStartUserId());
ProcessTaskVo processTaskVo = ProcessTaskVo.builder().taskId(task.getId()).taskName(task.getName())
@@ -1163,19 +1180,18 @@ public class TodoCenterManage {
res.setProcessTaskInfo(processTaskVo);
return res;
}).collect(Collectors.toList());
// 取用户信息,减少数据库查询,一次构建
if (isNotEmpty(staterUsers)) {
Map<String, OrgUser> userMap = userDeptOrLeaderService.getUserMapByIds(staterUsers);
resVos.stream()
.peek(v -> v.getProcessTaskInfo().setOwner(userMap.get(v.getProcessTaskInfo().getOwnerId())))
.collect(Collectors.toList());
// Map<Long,UserInfo> userMap = userInfoService.getUserMapByIds(staterUsers);
// result = resVos.stream().peek(v -> v.setOwner(userMap.get(userId)))
// .collect(Collectors.toList());
}
if (isEmpty(resVos)) {
return PageVo.empty();
}
// 取用户信息,减少数据库查询,一次构建
List<ResToBeProcessedDTO> result = null;
if (isNotEmpty(staterUsers)) {
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(staterUsers);
//result = resVos.stream().peek(v -> v.getProcessTaskInfo()
// .setStartUser(userMap.get(Long.valueOf(v.getProcessTaskInfo().getOwnerId()))))
// .collect(Collectors.toList());
}
// return PageVo.of(result, total);
return PageVo.of(resVos, total);
}

@@ -1328,24 +1344,30 @@ public class TodoCenterManage {
res.setProcessLaunchTime(launchTime);
HistoricProcessInstance ist = instanceMap.get(d.getInstCode());
staterUsers.add(ist.getStartUserId());
//HashSet<String> userSet = new HashSet<>();
//userSet.add(instance.getStartUserId()) ;
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet);
//res.setOwner(userMap.get(Long.valueOf(ist.getStartUserId())));
UserInfoVO owner = new UserInfoVO();
owner.setUserId(Long.valueOf(ist.getStartUserId()));
res.setOwner(owner);
ProcessInstanceVo processInstanceVo = getProcessInstanceVos(ist);
res.setProcessInstanceInfo(processInstanceVo);
return res;
}).collect(Collectors.toList());

if (isEmpty(resVos)) {
return PageVo.empty();
}
// 取用户信息,减少数据库查询,一次构建
List<ResToBeProcessedDTO> result = null;
if (isNotEmpty(staterUsers)) {
Map<String, OrgUser> userMap = userDeptOrLeaderService.getUserMapByIds(staterUsers);
resVos.stream().map(v -> {
v.getProcessInstanceInfo().setStaterUser(userMap.get(v.getProcessInstanceInfo().getStaterUserId()));
return v;
}).collect(Collectors.toList());
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(staterUsers);
//result = resVos.stream()
// .peek(v -> v.getProcessTaskInfo().setStartUser(userMap.get(Long.valueOf(v.getProcessTaskInfo().getOwnerId()))))
// .collect(Collectors.toList());
}

// if (CollectionUtil.isNotEmpty(staterUsers)) {
// Map<Long, UserInfo> userMap = userInfoService.getUserMapByIds(staterUsers);
// resVos.stream().peek(v -> v.setOwner(userMap.get(startUserId)))
// .collect(Collectors.toList());
// }
// return PageVo.of(result, total);
return PageVo.of(resVos, total);
}

@@ -1545,24 +1567,29 @@ public class TodoCenterManage {
res.setProcessLaunchTime(launchTime);
HistoricProcessInstance ist = instanceMap.get(d.getInstCode());
staterUsers.add(ist.getStartUserId());
//HashSet<String> userSet = new HashSet<>();
//userSet.add(instance.getStartUserId()) ;
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet);
//res.setOwner(userMap.get(Long.valueOf(ist.getStartUserId())));
UserInfoVO owner = new UserInfoVO();
owner.setUserId(Long.valueOf(ist.getStartUserId()));
res.setOwner(owner);
ProcessInstanceVo processInstanceVo = getProcessInstanceVos(ist);
res.setProcessInstanceInfo(processInstanceVo);
return res;
}).collect(Collectors.toList());

if (isEmpty(resVos)) {
return PageVo.empty();
}
// 取用户信息,减少数据库查询,一次构建
List<ResToBeProcessedDTO> result = null;
if (isNotEmpty(staterUsers)) {
Map<String, OrgUser> userMap = userDeptOrLeaderService.getUserMapByIds(staterUsers);
resVos.stream().map(v -> {
v.getProcessInstanceInfo().setStaterUser(userMap.get(v.getProcessInstanceInfo().getStaterUserId()));
return v;
}).collect(Collectors.toList());
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(staterUsers);
//result = resVos.stream()
// .peek(v -> v.getProcessTaskInfo().setStartUser(userMap.get(Long.valueOf(v.getProcessTaskInfo().getOwnerId()))))
// .collect(Collectors.toList());
}

// if (CollectionUtil.isNotEmpty(staterUsers)) {
// Map<Long, UserInfo> userMap = userInfoService.getUserMapByIds(staterUsers);
// resVos.stream().peek(v -> v.setOwner(userMap.get(startUserId)))
// .collect(Collectors.toList());
// }
// return PageVo.of(result, total);
return PageVo.of(resVos, total);
}



+ 6
- 8
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java Прегледај датотеку

@@ -1,20 +1,18 @@
package com.ningdatech.pmapi.todocenter.model.dto.res;

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

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.wflow.workflow.bean.vo.ProcessInstanceVo;
import com.wflow.workflow.bean.vo.ProcessTaskVo;
import com.wflow.workflow.bean.vo.UserInfoVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

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

/**
* 待办中心-待我处理返回实体信息
@@ -71,5 +69,5 @@ public class ResToBeProcessedDTO implements Serializable {
private ProcessInstanceVo processInstanceInfo;

@ApiModelProperty("流程发起人信息")
private UserInfo owner;
private UserInfoVO owner;
}

+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java Прегледај датотеку

@@ -15,6 +15,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@@ -26,7 +27,7 @@ import javax.validation.Valid;
* @author Liuxinxin
* @since 2023-01-04
*/
@Controller
@RestController
@RequestMapping("/api/v1/user-info")
@RequiredArgsConstructor
@Api(value = "UserInfoController", tags = "用户管理")


+ 0
- 99
pmapi/src/main/java/com/ningdatech/pmapi/user/entity/NdUserAuth.java Прегледај датотеку

@@ -1,99 +0,0 @@
package com.ningdatech.pmapi.user.entity;

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

/**
* <p>
*
* </p>
*
* @author Lierbao
* @since 2023-02-01
*/
@TableName("nd_user_auth")
@ApiModel(value = "NdUserAuth对象", description = "")
public class NdUserAuth implements Serializable {

private static final long serialVersionUID = 1L;

private Long id;

private LocalDateTime createOn;

private LocalDateTime updateOn;

private Long userId;

private String authType;

private String identifier;

private String credential;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}
public LocalDateTime getCreateOn() {
return createOn;
}

public void setCreateOn(LocalDateTime createOn) {
this.createOn = createOn;
}
public LocalDateTime getUpdateOn() {
return updateOn;
}

public void setUpdateOn(LocalDateTime updateOn) {
this.updateOn = updateOn;
}
public Long getUserId() {
return userId;
}

public void setUserId(Long userId) {
this.userId = userId;
}
public String getAuthType() {
return authType;
}

public void setAuthType(String authType) {
this.authType = authType;
}
public String getIdentifier() {
return identifier;
}

public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getCredential() {
return credential;
}

public void setCredential(String credential) {
this.credential = credential;
}

@Override
public String toString() {
return "NdUserAuth{" +
"id=" + id +
", createOn=" + createOn +
", updateOn=" + updateOn +
", userId=" + userId +
", authType=" + authType +
", identifier=" + identifier +
", credential=" + credential +
"}";
}
}

+ 0
- 109
pmapi/src/main/java/com/ningdatech/pmapi/user/entity/NdUserInfo.java Прегледај датотеку

@@ -1,109 +0,0 @@
package com.ningdatech.pmapi.user.entity;

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

/**
* <p>
*
* </p>
*
* @author Lierbao
* @since 2023-02-01
*/
@TableName("nd_user_info")
@ApiModel(value = "NdUserInfo对象", description = "")
public class NdUserInfo implements Serializable {

private static final long serialVersionUID = 1L;

private Long id;

private LocalDateTime createOn;

private LocalDateTime updateOn;

private Long createBy;

private Long updateBy;

private String username;

private String mobile;

private String realName;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}
public LocalDateTime getCreateOn() {
return createOn;
}

public void setCreateOn(LocalDateTime createOn) {
this.createOn = createOn;
}
public LocalDateTime getUpdateOn() {
return updateOn;
}

public void setUpdateOn(LocalDateTime updateOn) {
this.updateOn = updateOn;
}
public Long getCreateBy() {
return createBy;
}

public void setCreateBy(Long createBy) {
this.createBy = createBy;
}
public Long getUpdateBy() {
return updateBy;
}

public void setUpdateBy(Long updateBy) {
this.updateBy = updateBy;
}
public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}
public String getMobile() {
return mobile;
}

public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getRealName() {
return realName;
}

public void setRealName(String realName) {
this.realName = realName;
}

@Override
public String toString() {
return "NdUserInfo{" +
"id=" + id +
", createOn=" + createOn +
", updateOn=" + updateOn +
", createBy=" + createBy +
", updateBy=" + updateBy +
", username=" + username +
", mobile=" + mobile +
", realName=" + realName +
"}";
}
}

+ 5
- 9
pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserAuth.java Прегледај датотеку

@@ -1,7 +1,5 @@
package com.ningdatech.pmapi.user.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 lombok.Data;
@@ -11,20 +9,19 @@ import java.time.LocalDateTime;

/**
* <p>
* 用户鉴权表
*
* </p>
*
* @author Liuxinxin
* @since 2023-01-04
* @author Lierbao
* @since 2023-02-01
*/
@Data
@TableName("nd_user_auth")
@ApiModel(value = "UserAuth对象", description = "用户鉴权表")
@Data
@ApiModel(value = "NdUserAuth对象", description = "")
public class UserAuth implements Serializable {

private static final long serialVersionUID = 1L;

@TableId(value = "id", type = IdType.AUTO)
private Long id;

private LocalDateTime createOn;
@@ -38,5 +35,4 @@ public class UserAuth implements Serializable {
private String identifier;

private String credential;

}

+ 5
- 42
pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java Прегледај датотеку

@@ -1,10 +1,7 @@
package com.ningdatech.pmapi.user.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.Builder;
import lombok.Data;

@@ -13,70 +10,36 @@ import java.time.LocalDateTime;

/**
* <p>
* 用户信息表
*
* </p>
*
* @author Liuxinxin
* @since 2023-01-04
* @author Lierbao
* @since 2023-02-01
*/
@Data
@TableName("nd_user_info")
@ApiModel(value = "UserInfo对象", description = "用户信息表")
@Builder
@Data
@ApiModel(value = "NdUserInfo对象", description = "")
public class UserInfo implements Serializable {

private static final long serialVersionUID = 1L;

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

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

@ApiModelProperty("最后修改时间")
private LocalDateTime updateOn;

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

@ApiModelProperty("最后修改人")
private Long updateBy;

@ApiModelProperty("用户名(登陆账号)")
private String username;

@ApiModelProperty("手机")
private String mobile;

@ApiModelProperty("用户真实姓名")
private String realName;

@ApiModelProperty("所属公司id")
private Long companyId;

@ApiModelProperty("所属公司名称")
private String companyName;

@ApiModelProperty("用户角色")
private String role;

@ApiModelProperty("区域id")
private Long regionCode;

@ApiModelProperty("头像文件id")
private Long avatarFileId;

@ApiModelProperty("所负责的公司id列表")
private String manageCompanyIds;

@ApiModelProperty("是否删除")
private Boolean deleted;

@ApiModelProperty("身份证号")
private String idCard;

@ApiModelProperty("浙政钉accountId")
private Long accountId;

}

+ 0
- 3
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java Прегледај датотеку

@@ -1,7 +1,6 @@
package com.ningdatech.pmapi.user.manage;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.user.mapper.UserInfoMapper;
import com.ningdatech.pmapi.user.model.po.ReqUserDetailEditPO;
import com.ningdatech.pmapi.user.model.po.ReqUserDisablePO;
import com.ningdatech.pmapi.user.model.po.ReqUserInfoListPO;
@@ -17,8 +16,6 @@ import org.springframework.stereotype.Component;
@Component
@RequiredArgsConstructor
public class UserInfoManage {
private final UserInfoMapper userInfoMapper;


public PageVo<ResUserInfoListVO> list(ReqUserInfoListPO reqUserInfoListPO) {



+ 0
- 16
pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/NdUserAuthMapper.java Прегледај датотеку

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

import com.ningdatech.pmapi.user.entity.NdUserAuth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* <p>
* Mapper 接口
* </p>
*
* @author Lierbao
* @since 2023-02-01
*/
public interface NdUserAuthMapper extends BaseMapper<NdUserAuth> {

}

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/NdUserInfoMapper.java Прегледај датотеку

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.user.mapper;

import com.ningdatech.pmapi.user.entity.NdUserInfo;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author Lierbao
* @since 2023-02-01
*/
public interface NdUserInfoMapper extends BaseMapper<NdUserInfo> {
public interface NdUserInfoMapper extends BaseMapper<UserInfo> {

}

+ 4
- 4
pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserAuthMapper.java Прегледај датотеку

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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ningdatech.pmapi.user.entity.UserAuth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* <p>
* 用户鉴权表 Mapper 接口
* Mapper 接口
* </p>
*
* @author Liuxinxin
* @since 2023-01-04
* @author Lierbao
* @since 2023-02-01
*/
public interface UserAuthMapper extends BaseMapper<UserAuth> {



+ 0
- 16
pmapi/src/main/java/com/ningdatech/pmapi/user/mapper/UserInfoMapper.java Прегледај датотеку

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

import com.ningdatech.pmapi.user.entity.UserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* <p>
* 用户信息表 Mapper 接口
* </p>
*
* @author Liuxinxin
* @since 2023-01-04
*/
public interface UserInfoMapper extends BaseMapper<UserInfo> {

}

+ 0
- 16
pmapi/src/main/java/com/ningdatech/pmapi/user/service/INdUserAuthService.java Прегледај датотеку

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

import com.ningdatech.pmapi.user.entity.NdUserAuth;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* <p>
* 服务类
* </p>
*
* @author Lierbao
* @since 2023-02-01
*/
public interface INdUserAuthService extends IService<NdUserAuth> {

}

+ 0
- 16
pmapi/src/main/java/com/ningdatech/pmapi/user/service/INdUserInfoService.java Прегледај датотеку

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

import com.ningdatech.pmapi.user.entity.NdUserInfo;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* <p>
* 服务类
* </p>
*
* @author Lierbao
* @since 2023-02-01
*/
public interface INdUserInfoService extends IService<NdUserInfo> {

}

+ 9
- 4
pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserAuthService.java Прегледај датотеку

@@ -1,16 +1,21 @@
package com.ningdatech.pmapi.user.service;

import com.ningdatech.pmapi.user.entity.UserAuth;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.user.entity.UserAuth;
import com.ningdatech.pmapi.user.entity.UserInfo;

import java.util.Map;
import java.util.Set;

/**
* <p>
* 用户鉴权表 服务类
* 服务类
* </p>
*
* @author Liuxinxin
* @since 2023-01-04
* @author Lierbao
* @since 2023-02-01
*/
public interface IUserAuthService extends IService<UserAuth> {

Map<Long, UserInfo> getUserMapByIds(Set<String> staterUsers);
}

+ 4
- 5
pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java Прегледај датотеку

@@ -1,21 +1,20 @@
package com.ningdatech.pmapi.user.service;

import com.ningdatech.pmapi.todocenter.bean.entity.UserInfoVO;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wflow.workflow.bean.vo.UserInfoVO;

import java.util.Map;
import java.util.Set;

/**
* <p>
* 用户信息表 服务类
* 服务类
* </p>
*
* @author Liuxinxin
* @since 2023-01-04
* @author Lierbao
* @since 2023-02-01
*/
public interface IUserInfoService extends IService<UserInfo> {

Map<Long, UserInfoVO> getUserMapByIds(Set<String> staterUsers);
}

+ 0
- 20
pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/NdUserAuthServiceImpl.java Прегледај датотеку

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

import com.ningdatech.pmapi.user.entity.NdUserAuth;
import com.ningdatech.pmapi.user.mapper.NdUserAuthMapper;
import com.ningdatech.pmapi.user.service.INdUserAuthService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author Lierbao
* @since 2023-02-01
*/
@Service
public class NdUserAuthServiceImpl extends ServiceImpl<NdUserAuthMapper, NdUserAuth> implements INdUserAuthService {

}

+ 0
- 20
pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/NdUserInfoServiceImpl.java Прегледај датотеку

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

import com.ningdatech.pmapi.user.entity.NdUserInfo;
import com.ningdatech.pmapi.user.mapper.NdUserInfoMapper;
import com.ningdatech.pmapi.user.service.INdUserInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author Lierbao
* @since 2023-02-01
*/
@Service
public class NdUserInfoServiceImpl extends ServiceImpl<NdUserInfoMapper, NdUserInfo> implements INdUserInfoService {

}

+ 20
- 4
pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserAuthServiceImpl.java Прегледај датотеку

@@ -1,20 +1,36 @@
package com.ningdatech.pmapi.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.user.entity.UserAuth;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.mapper.UserAuthMapper;
import com.ningdatech.pmapi.user.mapper.NdUserInfoMapper;
import com.ningdatech.pmapi.user.service.IUserAuthService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

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

/**
* <p>
* 用户鉴权表 服务实现类
* 服务实现类
* </p>
*
* @author Liuxinxin
* @since 2023-01-04
* @author Lierbao
* @since 2023-02-01
*/
@Service
@RequiredArgsConstructor
public class UserAuthServiceImpl extends ServiceImpl<UserAuthMapper, UserAuth> implements IUserAuthService {

private final NdUserInfoMapper userInfoMapper;

@Override
public Map<Long, UserInfo> getUserMapByIds(Set<String> staterUsers) {
List<UserInfo> userInfos = userInfoMapper.selectBatchIds(staterUsers);
return userInfos.stream().collect(Collectors.toMap(UserInfo::getId, u -> u));
}
}

+ 7
- 10
pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java Прегледај датотеку

@@ -6,32 +6,29 @@ import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
import com.ningdatech.pmapi.todocenter.bean.entity.UserInfoVO;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.mapper.UserInfoMapper;
import com.ningdatech.pmapi.user.mapper.NdUserInfoMapper;
import com.ningdatech.pmapi.user.service.IUserInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wflow.workflow.bean.vo.UserInfoVO;
import lombok.RequiredArgsConstructor;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
* <p>
* 用户信息表 服务实现类
* 服务实现类
* </p>
*
* @author Liuxinxin
* @since 2023-01-04
* @author Lierbao
* @since 2023-02-01
*/
@Service
@RequiredArgsConstructor
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements IUserInfoService {
private final UserInfoMapper userInfoMapper;
public class UserInfoServiceImpl extends ServiceImpl<NdUserInfoMapper, UserInfo> implements IUserInfoService {

private final NdUserInfoMapper userInfoMapper;
private final IDingEmployeeInfoService dingEmployeeInfoService;

private final IDingOrganizationService dingOrganizationService;


+ 6
- 0
pmapi/src/main/resources/application-dev.yml Прегледај датотеку

@@ -102,6 +102,12 @@ logging:
file:
path: logs
nd:
cache:
type: REDIS
serializerType: ProtoStuff
cacheNullVal: true
def:
keyPrefix: pm
log:
enabled: true
type: DB


+ 7
- 7
pmapi/src/test/java/com/ningdatech/pmapi/organization/OrganizationTest.java Прегледај датотеку

@@ -1,7 +1,7 @@
package com.ningdatech.pmapi.organization;

import com.ningdatech.pmapi.AppTests;
//import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask;
import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask;
import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask;
import com.ningdatech.zwdd.client.ZwddAuthClient;
import com.ningdatech.zwdd.client.ZwddClient;
@@ -24,17 +24,17 @@ class OrganizationTest extends AppTests {
@Autowired
private OrganizationBatchGetTask organizationBatchGetTask;

// @Autowired
// private EmployeeBatchGetTask employeeBatchGetTask;
@Autowired
private EmployeeBatchGetTask employeeBatchGetTask;

@Test
public void testBatchGetOrganization() {
organizationBatchGetTask.batchGetOrganizationTask();
}

// @Test
// public void testEmployeeBatchGetTask(){
// employeeBatchGetTask.batchGetEmployeeTask();
// }
@Test
public void testEmployeeBatchGetTask(){
employeeBatchGetTask.batchGetEmployeeTask();
}

}

+ 6
- 5
pmapi/src/test/java/com/ningdatech/pmapi/sys/service/IMenuServiceTest.java Прегледај датотеку

@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.db.Db;
import cn.hutool.db.Entity;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.ningdatech.pmapi.AppTests;
@@ -46,11 +45,13 @@ class IMenuServiceTest extends AppTests {

@Test
public void initMenu() {
/*String str = FileUtil.readString("/Users/wendy/Desktop/long_text_2023-02-13-15-28-42.txt", "UTF-8");
menuService.remove(null);
roleMenuService.remove(null);
String str = FileUtil.readString("/Users/wendy/Desktop/long_text_2023-02-13-15-28-42.txt", "UTF-8");
List<JSONObject> obj = JSONUtil.toList(str, JSONObject.class);
save(obj, 0);*/
save(obj, 0);
menuService.list().forEach(w -> {
roleMenuService.save(new RoleMenu(){{
roleMenuService.save(new RoleMenu() {{
setRoleId(1L);
setMenuId(w.getId());
}});
@@ -67,7 +68,7 @@ class IMenuServiceTest extends AppTests {
menu.setName(w.getStr("path").replace("/", ""));
menu.setTopMenu(w.getStr("topMenu"));
menu.setTitle(w.getStr("title"));
menu.setHidden(w.getBool("hidden"));
menu.setHidden(w.getInt("hidden"));
menu.setPid(parentId);
menu.setRedirect(w.getStr("redirect"));
menu.setSort(w.getInt("sort"));


Loading…
Откажи
Сачувај