Browse Source

Merge remote-tracking branch 'origin/master'

master
PoffyZhang 1 year ago
parent
commit
2bc4098b45
13 changed files with 435 additions and 168 deletions
  1. +162
    -144
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java
  2. +21
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ReviewTemplateSettingsController.java
  3. +63
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ReviewTemplateSettingsManage.java
  4. +22
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ReviewTemplateSettings.java
  5. +46
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/enumeration/ReviewTemplateTypeEnum.java
  6. +32
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ReviewTemplateReq.java
  7. +34
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ReviewTemplateVO.java
  8. +6
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/organization/model/entity/DingEmployeeInfo.java
  9. +38
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/RegionController.java
  10. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/RegionManage.java
  11. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Menu.java
  12. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java
  13. +6
    -5
      pmapi/src/test/java/com/ningdatech/pmapi/sys/service/IMenuServiceTest.java

+ 162
- 144
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java View File

@@ -1,144 +1,162 @@
//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.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 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());
}
}
}

// 批量查询 成员的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());
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);
}
}
}
}

+ 21
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ReviewTemplateSettingsController.java View File

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


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.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 +25,18 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/v1/reviewTemplateSettings")
public class ReviewTemplateSettingsController {

private final ReviewTemplateSettingsManage reviewTemplateSettingsManage;

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

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

}

+ 63
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ReviewTemplateSettingsManage.java View File

@@ -0,0 +1,63 @@
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.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) {
LambdaUpdateWrapper<ReviewTemplateSettings> update = Wrappers.lambdaUpdate(ReviewTemplateSettings.class)
.eq(ReviewTemplateSettings::getTemplateType, req.getTemplateType())
.eq(ReviewTemplateSettings::getIsLast, Boolean.TRUE)
.set(ReviewTemplateSettings::getIsLast, Boolean.FALSE)
.last(BizConst.LIMIT_1);
reviewTemplateSettingsService.update(update);
ReviewTemplateSettings settings = new ReviewTemplateSettings();
settings.setTemplateType(req.getTemplateType());
settings.setIsLast(Boolean.TRUE);
settings.setContent(JSONUtil.toJsonStr(req.getTemplates()));
reviewTemplateSettingsService.save(settings);
}

public ReviewTemplateVO getReviewTemplateSettings(Integer templateType) {
LambdaQueryWrapper<ReviewTemplateSettings> query = Wrappers.lambdaQuery(ReviewTemplateSettings.class)
.eq(ReviewTemplateSettings::getIsLast, Boolean.TRUE)
.eq(ReviewTemplateSettings::getTemplateType, templateType)
.last(BizConst.LIMIT_1);
ReviewTemplateSettings settings = reviewTemplateSettingsService.getOne(query);
if (settings == null) {
throw BizException.wrap("模版不存在");
}
return ReviewTemplateVO.builder()
.templateId(settings.getId())
.templateType(settings.getTemplateType())
.templates(JSONUtil.toList(settings.getContent(), ReviewTemplateSettingsDTO.class))
.build();
}

}

+ 22
- 11
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/entity/ReviewTemplateSettings.java View File

@@ -1,11 +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 java.io.Serializable;
import java.time.LocalDateTime;

/**
* <p>
* 评审模版配置表
@@ -21,6 +24,7 @@ public class ReviewTemplateSettings implements Serializable {
private static final long serialVersionUID = 1L;

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

@ApiModelProperty("模版类型:1 初步方案评审模版、2 建设方案评审模版、3 验收方案评审模版")
@@ -47,6 +51,7 @@ public class ReviewTemplateSettings implements Serializable {
public void setId(Long id) {
this.id = id;
}

public Integer getTemplateType() {
return templateType;
}
@@ -54,6 +59,7 @@ public class ReviewTemplateSettings implements Serializable {
public void setTemplateType(Integer templateType) {
this.templateType = templateType;
}

public String getContent() {
return content;
}
@@ -61,6 +67,7 @@ public class ReviewTemplateSettings implements Serializable {
public void setContent(String content) {
this.content = content;
}

public Long getCreateBy() {
return createBy;
}
@@ -68,6 +75,7 @@ public class ReviewTemplateSettings implements Serializable {
public void setCreateBy(Long createBy) {
this.createBy = createBy;
}

public Long getUpdateBy() {
return updateBy;
}
@@ -75,6 +83,7 @@ public class ReviewTemplateSettings implements Serializable {
public void setUpdateBy(Long updateBy) {
this.updateBy = updateBy;
}

public LocalDateTime getCreateOn() {
return createOn;
}
@@ -82,6 +91,7 @@ public class ReviewTemplateSettings implements Serializable {
public void setCreateOn(LocalDateTime createOn) {
this.createOn = createOn;
}

public LocalDateTime getUpdateOn() {
return updateOn;
}
@@ -89,6 +99,7 @@ public class ReviewTemplateSettings implements Serializable {
public void setUpdateOn(LocalDateTime updateOn) {
this.updateOn = updateOn;
}

public Boolean getIsLast() {
return isLast;
}
@@ -100,14 +111,14 @@ public class ReviewTemplateSettings implements Serializable {
@Override
public String toString() {
return "NdReviewTemplateSettings{" +
"id=" + id +
", templateType=" + templateType +
", content=" + content +
", createBy=" + createBy +
", updateBy=" + updateBy +
", createOn=" + createOn +
", updateOn=" + updateOn +
", isLast=" + isLast +
"}";
"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 View File

@@ -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("评审模版类型编码无效"));
}

}

+ 32
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ReviewTemplateReq.java View File

@@ -0,0 +1,32 @@
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.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;

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

}

+ 34
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ReviewTemplateVO.java View File

@@ -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;

}

+ 6
- 4
pmapi/src/main/java/com/ningdatech/pmapi/organization/model/entity/DingEmployeeInfo.java View File

@@ -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
@@ -68,4 +68,6 @@ public class DingEmployeeInfo implements Serializable {

private String empStatus;

private Long accountId;

}

+ 38
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/RegionController.java View File

@@ -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 View File

@@ -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 View File

@@ -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")


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java View File

@@ -76,4 +76,7 @@ public class UserInfo implements Serializable {
@ApiModelProperty("身份证号")
private String idCard;

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

}

+ 6
- 5
pmapi/src/test/java/com/ningdatech/pmapi/sys/service/IMenuServiceTest.java View File

@@ -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…
Cancel
Save