Browse Source

Merge remote-tracking branch 'origin/master'

master
niohe·erbao 1 year ago
parent
commit
7e683c62ef
25 changed files with 625 additions and 24 deletions
  1. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java
  2. +5
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java
  3. +95
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java
  4. +44
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/controller/DocumentationController.java
  5. +46
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/controller/ProjectFileController.java
  6. +121
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/DocumentationManage.java
  7. +61
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java
  8. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/mapper/DocumentationGroupMapper.java
  9. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/mapper/DocumentationGroupMapper.xml
  10. +22
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/dto/DocumentationGroupSaveDTO.java
  11. +29
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/dto/DocumentationSaveDTO.java
  12. +5
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/entity/Documentation.java
  13. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/entity/DocumentationGroup.java
  14. +22
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/param/ProjectFileListParam.java
  15. +33
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/DocumentationGroupVO.java
  16. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/DocumentationVO.java
  17. +36
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/ProjectFileListVO.java
  18. +36
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/ProjectFileVO.java
  19. +9
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/service/IDocumentationGroupService.java
  20. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/service/impl/DocumentationGroupServiceImpl.java
  21. +3
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CommonLogTask.java
  22. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  23. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java
  24. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java
  25. +4
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java

+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java View File

@@ -27,7 +27,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
"com.ningdatech.pmapi.expert.controller",
"com.ningdatech.pmapi.sms.controller",
"com.ningdatech.pmapi.workbench.controller",
"com.ningdatech.pmapi.ding.controller"
"com.ningdatech.pmapi.ding.controller",
"com.ningdatech.pmapi.filemanage.controller"
})
public class GlobalResponseHandler implements ResponseBodyAdvice<Object> {



+ 5
- 3
pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java View File

@@ -4,9 +4,7 @@ import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask;
import com.ningdatech.pmapi.ding.task.GovBusinessStripsTask;
import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;

/**
* <p>
@@ -41,4 +39,8 @@ public class DingInfoPullController {
organizationBatchGetTask.batchGetOrganizationTask();
}

@GetMapping("/employee/{regionCode}")
public void employeeBatchGetByRegionCode(@PathVariable String regionCode) {
employeeBatchGetTask.batchGetEmployeeTaskByRegionCode(regionCode);
}
}

+ 95
- 5
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java View File

@@ -194,7 +194,7 @@ public class EmployeeBatchGetTask {
dingEmployeeInfoSaveRecordList = dingEmployeeInfoSaveRecordList.stream()
.filter(r -> "true".equals(r.getMainJob())
&& "A".equals(r.getEmpStatus())
&& StringUtils.isNotBlank(r.getOrganizationCode())
&& StringUtils.isNotBlank(r.getEmpPosUnitCode())
&& StringUtils.isNotBlank(r.getEmployeeCode())
).collect(Collectors.toList());

@@ -203,16 +203,19 @@ public class EmployeeBatchGetTask {
List<DingEmployeeInfo> saveList = new ArrayList<>();

for (DingEmployeeInfo dingEmployeeInfo : dingEmployeeInfoSaveRecordList) {
if (uniqueKeySet.add(dingEmployeeInfo.getEmployeeCode() + dingEmployeeInfo.getOrganizationCode())) {
if (uniqueKeySet.add(dingEmployeeInfo.getEmployeeCode() + dingEmployeeInfo.getEmpPosUnitCode())) {
saveList.add(dingEmployeeInfo);
}
}

List<DingOrganization> organizations = iDingOrganizationService.list();
Map<String, DingOrganization> organizationMap = organizations.stream().collect(Collectors.toMap(DingOrganization::getOrganizationCode, o -> o));

for (DingEmployeeInfo dingEmployeeInfo : saveList) {
String employeeCode = dingEmployeeInfo.getEmployeeCode();

DingEmployeeInfo employeeInfo = iDingEmployeeInfoService.getOne(Wrappers.lambdaQuery(DingEmployeeInfo.class)
.eq(DingEmployeeInfo::getOrganizationCode, dingEmployeeInfo.getOrganizationCode())
.eq(DingEmployeeInfo::getEmpPosUnitCode, dingEmployeeInfo.getEmpPosUnitCode())
.eq(DingEmployeeInfo::getEmployeeCode, employeeCode));
if (Objects.isNull(employeeInfo)) {
iDingEmployeeInfoService.save(dingEmployeeInfo);
@@ -220,11 +223,11 @@ public class EmployeeBatchGetTask {
dingEmployeeInfo.setId(employeeInfo.getId());
iDingEmployeeInfoService.saveOrUpdate(dingEmployeeInfo);
}
generateOrUpdateUserInfo(dingEmployeeInfo);
generateOrUpdateUserInfo(dingEmployeeInfo,organizationMap);
}
}

public void generateOrUpdateUserInfo(DingEmployeeInfo dingEmployeeInfo) {
public void generateOrUpdateUserInfo(DingEmployeeInfo dingEmployeeInfo,Map<String, DingOrganization> organizationMap) {
String employeeCode = dingEmployeeInfo.getEmployeeCode();
UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class)
.eq(UserInfo::getEmployeeCode, employeeCode));
@@ -239,11 +242,98 @@ public class EmployeeBatchGetTask {
.updateBy(-1L)
.createOn(LocalDateTime.now())
.updateOn(LocalDateTime.now())
.empPosUnitCode(dingEmployeeInfo.getEmpPosUnitCode())
.build();
if(StringUtils.isNotBlank(userInfo.getEmpPosUnitCode()) && organizationMap.containsKey(userInfo.getEmpPosUnitCode())){
DingOrganization dingOrganization = organizationMap.get(userInfo.getEmpPosUnitCode());
userInfo.setEmpPosUnitName(dingOrganization.getOrganizationName());
userInfo.setRegionCode(dingOrganization.getDivisionCode());
}
iUserInfoService.save(userInfo);
}
}

/**
* 按区域 来更新员工
* @param regionCode
*/
public void batchGetEmployeeTaskByRegionCode(String regionCode) {
List<DingOrganization> units = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class)
.eq(DingOrganization::getTypeCode, "GOV_UNIT")
.eq(DingOrganization::getDivisionCode, regionCode));


log.info("所有地区 {} 待更新员工的单位数:{}",regionCode,units.size());
if (CollUtil.isNotEmpty(units)) {
//记录任务 单位数
Integer index = 0;
for (DingOrganization dingOrganization : units) {
log.info("当前单位:{},下标数,{}",dingOrganization.getOrganizationName(),index);
index++;
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 (Objects.isNull(data)){
log.info("响应为空:{}",organizationCode);
continue;
}
if (CollUtil.isNotEmpty(data.getData())) {
allOrganizationEmployeePositionList.addAll(data.getData());
}
Long totalSize = data.getTotalSize();

log.info("dingOrganization :{}", JSON.toJSONString(dingOrganization));

log.info("totalSize :{},{}", totalSize,dingOrganization.getOrganizationName());
if (totalSize > PAGE_SIZE) {
if (totalSize > MAX_SIZE) {
//超过1万 按1万的处理
totalSize = MAX_SIZE.longValue();
}

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(pageNo);
GenericResult<Page<OrganizationEmployeePosition>> pageGenericResult = zwddClient.pageOrganizationEmployeePositions(query);
// log.info("pageGenericResult :{}", JSON.toJSONString(pageGenericResult));
if(pageGenericResult.isSuccess()){
allOrganizationEmployeePositionList.addAll(pageGenericResult.getData().getData());
}else{
log.error(pageGenericResult.getMsg());
}
}
}

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

// if (saveList.size() <= GROUP_SIZE) {
// iDingEmployeeInfoService.saveBatch(saveList);
// } else {


+ 44
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/controller/DocumentationController.java View File

@@ -2,11 +2,17 @@ package com.ningdatech.pmapi.filemanage.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.filemanage.manage.DocumentationManage;
import com.ningdatech.pmapi.filemanage.model.dto.DocumentationGroupSaveDTO;
import com.ningdatech.pmapi.filemanage.model.dto.DocumentationSaveDTO;
import com.ningdatech.pmapi.filemanage.model.param.DocumentationListParam;
import com.ningdatech.pmapi.filemanage.model.vo.DocumentationGroupVO;
import com.ningdatech.pmapi.filemanage.model.vo.DocumentationVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
* @Classname DocumentationController
@@ -18,12 +24,50 @@ import org.springframework.web.bind.annotation.*;
@AllArgsConstructor
@Api(tags = "档案管理-资料文档控制器")
@RequestMapping("/api/v1/file-manage/documentation")
@Validated
public class DocumentationController {

private final DocumentationManage documentationManage;

@GetMapping("/group/list")
@ApiOperation(value = "分组列表", notes = "分组列表")
public List<DocumentationGroupVO> groupList(){
return documentationManage.groupList();
}

@PostMapping("/group/add")
@ApiOperation(value = "分组添加", notes = "分组添加")
public String addGroup(@Validated @RequestBody DocumentationGroupSaveDTO dto){
return documentationManage.addGroup(dto);
}

@PostMapping("/group/delete/{id}")
@ApiOperation(value = "分组删除", notes = "分组删除")
public String deleteGroup(@PathVariable Long id){
return documentationManage.deleteGroup(id);
}

@GetMapping("/list")
@ApiOperation(value = "文档列表", notes = "文档列表")
public PageVo<DocumentationVO> list(@ModelAttribute DocumentationListParam param){
return documentationManage.list(param);
}

@GetMapping("/detail/{id}")
@ApiOperation(value = "文档详情", notes = "文档详情")
public DocumentationVO detail(@PathVariable Long id){
return documentationManage.detail(id);
}

@PostMapping("/add")
@ApiOperation(value = "文档添加", notes = "文档添加")
public String addDoc(@Validated @RequestBody DocumentationSaveDTO dto){
return documentationManage.addDoc(dto);
}

@PostMapping("/delete/{id}")
@ApiOperation(value = "文档删除", notes = "文档删除")
public String deleteDoc(@PathVariable Long id){
return documentationManage.deleteDoc(id);
}
}

+ 46
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/controller/ProjectFileController.java View File

@@ -0,0 +1,46 @@
package com.ningdatech.pmapi.filemanage.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.filemanage.manage.ProjectFileManage;
import com.ningdatech.pmapi.filemanage.model.param.ProjectFileListParam;
import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileListVO;
import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
* @Classname ProjectFileController
* @Description
* @Date 2023/6/6 15:48
* @Author PoffyZhang
*/
@RestController
@AllArgsConstructor
@Api(tags = "档案管理-项目档案")
@RequestMapping("/api/v1/file-manage/project-file")
@Validated
public class ProjectFileController {

private final ProjectFileManage projectFileManage;

@GetMapping("/list")
@ApiOperation(value = "档案列表", notes = "档案列表")
public PageVo<ProjectFileListVO> list(@ModelAttribute ProjectFileListParam param){
return projectFileManage.list(param);
}

@GetMapping("/{projectId}")
@ApiOperation(value = "档案详情", notes = "档案详情")
public ProjectFileVO file(@PathVariable Long projectId){
return projectFileManage.file(projectId);
}

@PostMapping("/want-read/{projectId}")
@ApiOperation(value = "申请借阅", notes = "申请借阅")
public String wantRead(@PathVariable Long projectId){
return projectFileManage.wantRead(projectId);
}
}

+ 121
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/DocumentationManage.java View File

@@ -3,15 +3,28 @@ package com.ningdatech.pmapi.filemanage.manage;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.file.entity.File;
import com.ningdatech.file.service.FileService;
import com.ningdatech.pmapi.filemanage.model.dto.DocumentationGroupSaveDTO;
import com.ningdatech.pmapi.filemanage.model.dto.DocumentationSaveDTO;
import com.ningdatech.pmapi.filemanage.model.entity.Documentation;
import com.ningdatech.pmapi.filemanage.model.entity.DocumentationGroup;
import com.ningdatech.pmapi.filemanage.model.param.DocumentationListParam;
import com.ningdatech.pmapi.filemanage.model.vo.DocumentationGroupVO;
import com.ningdatech.pmapi.filemanage.model.vo.DocumentationVO;
import com.ningdatech.pmapi.filemanage.service.IDocumentationGroupService;
import com.ningdatech.pmapi.filemanage.service.IDocumentationService;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -29,6 +42,20 @@ public class DocumentationManage {

private final IDocumentationService documentationService;

private final IDocumentationGroupService documentationGroupService;

private final FileService fileService;

/**
*
* @return
*/
public List<DocumentationGroupVO> groupList() {
List<DocumentationGroup> list = documentationGroupService.list();

return list.stream().map(g -> BeanUtil.copyProperties(g,DocumentationGroupVO.class)).collect(Collectors.toList());
}

/**
* 文档列表
* @param param
@@ -49,4 +76,98 @@ public class DocumentationManage {

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

/**
* 增加分组
* @param dto
* @return
*/
public String addGroup(DocumentationGroupSaveDTO dto) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
if(documentationGroupService.count(Wrappers.lambdaQuery(DocumentationGroup.class)
.eq(DocumentationGroup::getName,dto.getName())) > 0){
throw new BizException("此分组名 已经存在");
}

DocumentationGroup documentationGroup = BeanUtil.copyProperties(dto, DocumentationGroup.class);
documentationGroup.setCreateBy(user.getRealName());
documentationGroup.setCreateOn(LocalDateTime.now());
if(documentationGroupService.save(documentationGroup)){
return "添加成功";
}
return "添加失败";
}

/**
* 删除分组 同时删除文档
* @param id
* @return
*/
@Transactional
public String deleteGroup(Long id) {
DocumentationGroup group = documentationGroupService.getById(id);
VUtils.isTrue(Objects.isNull(group)).throwMessage("该分组不存在!");

//
documentationService.remove(Wrappers.lambdaQuery(Documentation.class)
.eq(Documentation::getGroupId, id));
documentationGroupService.removeById(id);

return "删除成功";
}

/**
* 上传文档
* @param dto
* @return
*/
public String addDoc(DocumentationSaveDTO dto) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();

Long fileId = dto.getFileId();
File file = fileService.getById(fileId);

VUtils.isTrue(Objects.isNull(file)).throwMessage("该文件不存在!");

DocumentationGroup group = documentationGroupService.getById(dto.getGroupId());

VUtils.isTrue(Objects.isNull(group)).throwMessage("分组不存在!");

Documentation documentation = new Documentation();
documentation.setCreateBy(user.getRealName());
documentation.setCreateOn(LocalDateTime.now());
documentation.setSize(Objects.nonNull(file.getSize()) ? file.getSize()/1000L : 0L);
documentation.setFileId(fileId);
documentation.setGroupId(dto.getGroupId());
documentation.setFileName(file.getOriginalFileName());
if(documentationService.save(documentation)){
documentation.setSort(documentation.getId().intValue());
documentationService.updateById(documentation);
}

return "添加成功";
}

/**
* 删除文档
* @param id
* @return
*/
public String deleteDoc(Long id) {
Documentation doc = documentationService.getById(id);
VUtils.isTrue(Objects.isNull(doc)).throwMessage("该文档不存在!");

if(documentationService.removeById(id)){
return "删除成功";
}
return "删除失败";
}

public DocumentationVO detail(Long id) {
Documentation doc = documentationService.getById(id);
if(Objects.isNull(doc)){
return null;
}
return BeanUtil.copyProperties(doc,DocumentationVO.class);
}
}

+ 61
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java View File

@@ -0,0 +1,61 @@
package com.ningdatech.pmapi.filemanage.manage;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.filemanage.model.param.ProjectFileListParam;
import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileListVO;
import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileVO;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

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

/**
* @Classname ProjectFileManage
* @Description
* @Date 2023/6/6 16:04
* @Author PoffyZhang
*/
@Component
@AllArgsConstructor
@Slf4j
public class ProjectFileManage {

private final IProjectService projectService;

public PageVo<ProjectFileListVO> list(ProjectFileListParam param) {
Page<Project> page = param.page();
projectService.page(page,Wrappers.lambdaQuery(Project.class)
.like(StringUtils.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName())
.like(StringUtils.isNotBlank(param.getBuildOrgName()),Project::getBuildOrgName,param.getBuildOrgName())
.orderByDesc(Project::getUpdateOn));

if(0L == page.getTotal()){
return PageVo.empty();
}
List<ProjectFileListVO> vos = page.getRecords().stream().map(p -> {
ProjectFileListVO vo = new ProjectFileListVO();
vo.setId(p.getId());
vo.setCanRead(Boolean.TRUE);
vo.setBuildOrgName(p.getBuildOrgName());
vo.setPojectCode(p.getProjectCode());
vo.setProjectName(p.getProjectName());
return vo;
}).collect(Collectors.toList());
return PageVo.of(vos,page.getTotal());
}

public ProjectFileVO file(Long projectId) {
return null;
}

public String wantRead(Long projectId) {
return "申请成功";
}
}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/mapper/DocumentationGroupMapper.java View File

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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ningdatech.pmapi.filemanage.model.entity.DocumentationGroup;

/**
* <p>
* Mapper 接口
* </p>
*
* @author CMM
* @since 2023-02-27
*/
public interface DocumentationGroupMapper extends BaseMapper<DocumentationGroup> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/mapper/DocumentationGroupMapper.xml View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ningdatech.pmapi.filemanage.mapper.DocumentationGroupMapper">

</mapper>

+ 22
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/dto/DocumentationGroupSaveDTO.java View File

@@ -0,0 +1,22 @@
package com.ningdatech.pmapi.filemanage.model.dto;

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

/**
* @Classname Documentation
* @Description
* @Date 2023/6/6 14:41
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "DocumentationGroupSaveDTO", description = "DocumentationGroupSaveDTO")
public class DocumentationGroupSaveDTO {

@ApiModelProperty("分组名")
private String name;

@ApiModelProperty("排序")
private Integer sort;
}

+ 29
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/dto/DocumentationSaveDTO.java View File

@@ -0,0 +1,29 @@
package com.ningdatech.pmapi.filemanage.model.dto;

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

import javax.validation.constraints.NotNull;

/**
* @Classname Documentation
* @Description
* @Date 2023/6/6 14:41
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "DocumentationSaveDTO", description = "DocumentationSaveDTO")
public class DocumentationSaveDTO {

@ApiModelProperty("文档分类ID")
@NotNull(message = "请传分组ID")
private Long groupId;

@ApiModelProperty("文档ID")
@NotNull(message = "请传文档ID")
private Long fileId;

@ApiModelProperty("排序")
private Integer sort;
}

+ 5
- 2
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/entity/Documentation.java View File

@@ -28,10 +28,10 @@ public class Documentation {
private String fileName;

@ApiModelProperty("上传人")
private String creatBy;
private String createBy;

@ApiModelProperty("上传时间")
private LocalDateTime creatOn;
private LocalDateTime createOn;

@ApiModelProperty("文档大小 kb")
private Long size;
@@ -39,6 +39,9 @@ public class Documentation {
@ApiModelProperty("文档分类ID")
private Long groupId;

@ApiModelProperty("文档ID")
private Long fileId;

@ApiModelProperty("排序")
private Integer sort;
}

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/entity/DocumentationGroup.java View File

@@ -25,10 +25,10 @@ public class DocumentationGroup {
private Long id;

@ApiModelProperty("上传人")
private String creatBy;
private String createBy;

@ApiModelProperty("上传时间")
private LocalDateTime creatOn;
private LocalDateTime createOn;

@ApiModelProperty("分组名")
private String name;


+ 22
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/param/ProjectFileListParam.java View File

@@ -0,0 +1,22 @@
package com.ningdatech.pmapi.filemanage.model.param;

import com.ningdatech.basic.model.PagePo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* @Classname ProjectFileListParam
* @Description
* @Date 2023/6/6 16:06
* @Author PoffyZhang
*/
@Data
public class ProjectFileListParam extends PagePo {

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

@ApiModelProperty("项目单位")
private String buildOrgName;

}

+ 33
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/DocumentationGroupVO.java View File

@@ -0,0 +1,33 @@
package com.ningdatech.pmapi.filemanage.model.vo;

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

import java.time.LocalDateTime;

/**
* @Classname Documentation
* @Description
* @Date 2023/6/6 14:41
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "nd_documentation_group", description = "资料文档分组")
public class DocumentationGroupVO {

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

@ApiModelProperty("上传人")
private String createBy;

@ApiModelProperty("上传时间")
private LocalDateTime createOn;

@ApiModelProperty("分组名")
private String name;

@ApiModelProperty("排序")
private Integer sort;
}

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/DocumentationVO.java View File

@@ -23,10 +23,10 @@ public class DocumentationVO {
private String fileName;

@ApiModelProperty("上传人")
private String creatBy;
private String createBy;

@ApiModelProperty("上传时间")
private LocalDateTime creatOn;
private LocalDateTime createOn;

@ApiModelProperty("文档大小 kb")
private Long size;


+ 36
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/ProjectFileListVO.java View File

@@ -0,0 +1,36 @@
package com.ningdatech.pmapi.filemanage.model.vo;

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

import java.time.LocalDateTime;

/**
* @Classname Documentation
* @Description
* @Date 2023/6/6 14:41
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "ProjectFileListVO", description = "资料文档")
public class ProjectFileListVO {

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

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

@ApiModelProperty("项目单位")
private String buildOrgName;

@ApiModelProperty("项目编号")
private String pojectCode;

@ApiModelProperty("是否可阅")
private Boolean canRead = Boolean.FALSE;

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

+ 36
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/ProjectFileVO.java View File

@@ -0,0 +1,36 @@
package com.ningdatech.pmapi.filemanage.model.vo;

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

import java.time.LocalDateTime;

/**
* @Classname ProjectFileVO
* @Description
* @Date 2023/6/6 14:41
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "ProjectFileVO", description = "项目档案")
public class ProjectFileVO {

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

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

@ApiModelProperty("项目单位")
private String buildOrgName;

@ApiModelProperty("项目编号")
private String pojectCode;

@ApiModelProperty("是否可阅")
private Boolean canRead = Boolean.FALSE;

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

+ 9
- 0
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/service/IDocumentationGroupService.java View File

@@ -0,0 +1,9 @@
package com.ningdatech.pmapi.filemanage.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.filemanage.model.entity.DocumentationGroup;

public interface IDocumentationGroupService extends IService<DocumentationGroup> {


}

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

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

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.filemanage.mapper.DocumentationGroupMapper;
import com.ningdatech.pmapi.filemanage.model.entity.DocumentationGroup;
import com.ningdatech.pmapi.filemanage.service.IDocumentationGroupService;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author Poffy
* @since 2023-02-13
*/
@Service
public class DocumentationGroupServiceImpl extends ServiceImpl<DocumentationGroupMapper, DocumentationGroup> implements IDocumentationGroupService {

}

+ 3
- 1
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CommonLogTask.java View File

@@ -90,7 +90,7 @@ public class CommonLogTask {
commonLog.setActionTime(df.format(optLog.getStartTime()));
commonLog.setActionDuration(optLog.getConsumingTime());
commonLog.setActionStatus(0);
commonLog.setAppCode("");
commonLog.setAppCode("A331101453557202109017383");
//判断当天日志文件是否存在
DateTimeFormatter dfNow = DateTimeFormatter.ofPattern("yyyyMMdd");
String fileName = LOG_RECORD_ADDRESS + LOG_FILE + dfNow.format(LocalDateTime.now()) + ".log";
@@ -102,11 +102,13 @@ public class CommonLogTask {
//写入通用规则
FileWriter writer = new FileWriter(fileName);
writer.append(JSONUtil.toJsonStr(commonLog));
writer.append("\n");
if (commonLog.getActionType() == 3){
CommonLog commonLogEnd = new CommonLog();
BeanUtil.copyProperties(commonLog,commonLogEnd);
commonLogEnd.setActionType(4);
writer.append(JSONUtil.toJsonStr(commonLogEnd));
writer.append("\n");
}
}
//记录最后一个节点位置


+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -224,6 +224,7 @@ public class TodoCenterManage {
res.setProcessDefName(d.getProcessDefName());
res.setTaskId(d.getTaskId());
res.setNodeName(findSubProcessName(d));
res.setPretrialFileId(projectInfo.getPretrialFileId());
return res;
}).collect(Collectors.toList());
return PageVo.of(resVos, list.size());


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java View File

@@ -69,4 +69,7 @@ public class ResToBeProcessedVO implements Serializable {

@ApiModelProperty("流程定义名称")
private String processDefName;

@ApiModelProperty("项目预审申请单文件ID")
private Long pretrialFileId;
}

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

@@ -45,6 +45,9 @@ public class UserInfo implements Serializable {

private String regionCode;

private String empPosUnitCode;
private String empPosUnitName;

@TableField(fill = FieldFill.INSERT)
private LocalDateTime createOn;



+ 4
- 8
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java View File

@@ -63,6 +63,7 @@ public class UserInfoManage {
String phoneNo = req.getPhoneNo();
String orgCode = req.getOrgCode();
String name = req.getName();
String orgName = req.getOrgName();
Long regionId = req.getRegionId();

List<Long> userIdList = getRoleCompliantUserIdList(req.getUserRoleList());
@@ -71,19 +72,14 @@ public class UserInfoManage {
pageVo.setTotal(0L);
return pageVo;
}
List<String> compliantOrgEmpCodeList = getCompliantOrgEmpCodeList(req.getOrgName(), orgCode);
if (compliantOrgEmpCodeList != null && compliantOrgEmpCodeList.size() == 0) {
pageVo.setRecords(new ArrayList<>());
pageVo.setTotal(0L);
return pageVo;
}

LambdaQueryWrapper<UserInfo> wrapper = Wrappers.lambdaQuery(UserInfo.class)
.like(StringUtils.isNotBlank(phoneNo), UserInfo::getMobile, phoneNo)
.like(StringUtils.isNotBlank(name), UserInfo::getRealName, name)
.in(Objects.nonNull(userIdList), UserInfo::getId, userIdList)
.eq(Objects.nonNull(regionId), UserInfo::getRegionCode,regionId)
.in(Objects.nonNull(compliantOrgEmpCodeList), UserInfo::getEmployeeCode, compliantOrgEmpCodeList)
.like(StringUtils.isNotBlank(orgName), UserInfo::getEmpPosUnitName, orgName)
.eq(StringUtils.isNotBlank(orgCode), UserInfo::getEmpPosUnitCode, orgCode)
.orderByDesc(UserInfo::getUpdateOn);

Page<UserInfo> page = iUserInfoService.page(new Page<>(req.getPageNumber(), req.getPageSize()), wrapper);
@@ -136,7 +132,7 @@ public class UserInfoManage {
if (StringUtils.isNotBlank(orgName)) {
List<DingOrganization> dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class)
.like(DingOrganization::getOrganizationName, orgName)
.notIn(DingOrganization::getTypeCode, "GOV_INTERNAL_INSTITUTION")
.eq(DingOrganization::getTypeCode, "GOV_UNIT")
);

List<String> compliantOrgNameCodeList = dingOrganizationList.stream()


Loading…
Cancel
Save