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

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
#	pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.java
#	pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/impl/StatisticsServiceImpl.java
master
CMM пре 1 година
родитељ
комит
7d81b58828
5 измењених фајлова са 55 додато и 91 уклоњено
  1. +2
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java
  2. +46
    -74
      pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java
  3. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqSynthesizePO.java
  4. +1
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  5. +4
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.xml

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

@@ -6,7 +6,6 @@ import com.ningdatech.pmapi.organization.manage.OrganizationManage;
import com.ningdatech.pmapi.organization.model.po.ReqOrganizationListPO;
import com.ningdatech.pmapi.organization.model.po.ReqSynthesizePO;
import com.ningdatech.pmapi.organization.model.vo.KeyTreeVO;
import com.ningdatech.pmapi.organization.model.vo.OrganizationSynthesizeTreeVO;
import com.ningdatech.pmapi.organization.model.vo.OrganizationTreeVO;
import com.ningdatech.pmapi.organization.model.vo.ResOrganizationListVO;
import io.swagger.annotations.Api;
@@ -50,15 +49,9 @@ public class DingOrganizationController {
return organizationManage.getChildOrganizationList(parentCode);
}

@ApiOperation("综合列表筛选")
@PostMapping("/synthesize-list")
public List<OrganizationSynthesizeTreeVO> organizationSynthesizeList(@Valid @RequestBody ReqSynthesizePO request) {
return organizationManage.organizationSynthesizeList(request);
}

@ApiOperation("组织树状列表筛选")
@ApiOperation("组织树状列表筛选(前端定制化接口不可复用)")
@PostMapping("/tree-list")
public List<KeyTreeVO> treeVOList(@Valid @RequestBody ReqSynthesizePO request) {
return organizationManage.treeVOList(request);
return organizationManage.treeRubbishVOList(request);
}
}

+ 46
- 74
pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java Прегледај датотеку

@@ -13,8 +13,6 @@ import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.model.po.ReqOrganizationListPO;
import com.ningdatech.pmapi.organization.model.po.ReqSynthesizePO;
import com.ningdatech.pmapi.organization.model.vo.KeyTreeVO;
import com.ningdatech.pmapi.organization.model.vo.OrganizationSynthesizeTreeVO;
import com.ningdatech.pmapi.organization.model.vo.OrganizationSynthesizeTreeVO.OrganizationMemberInfo;
import com.ningdatech.pmapi.organization.model.vo.OrganizationTreeVO;
import com.ningdatech.pmapi.organization.model.vo.ResOrganizationListVO;
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService;
@@ -26,7 +24,6 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
@@ -110,88 +107,63 @@ public class OrganizationManage {
}).collect(Collectors.toList());
}

public List<OrganizationSynthesizeTreeVO> organizationSynthesizeList(ReqSynthesizePO request) {
String parentCode = request.getParentCode();
Boolean needMember = request.getNeedMember();
public List<KeyTreeVO> treeRubbishVOList(ReqSynthesizePO request) {
String organizationCode = request.getOrganizationCode();

List<OrganizationTreeVO> childOrganizationList = getChildOrganizationList(parentCode);

List<OrganizationSynthesizeTreeVO> organizationSynthesizeTreeVOList = childOrganizationList.stream().map(r -> {
OrganizationSynthesizeTreeVO organizationSynthesizeTreeVO = new OrganizationSynthesizeTreeVO();
organizationSynthesizeTreeVO.setName(r.getName());
organizationSynthesizeTreeVO.setOrganizationCode(r.getOrganizationCode());
organizationSynthesizeTreeVO.setParentCode(r.getParentCode());
return organizationSynthesizeTreeVO;
}).collect(Collectors.toList());

if (needMember && organizationSynthesizeTreeVOList.size() > 0) {
List<String> organizationCodeList = organizationSynthesizeTreeVOList.stream()
.map(OrganizationSynthesizeTreeVO::getOrganizationCode).collect(Collectors.toList());
List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class)
.eq(DingEmployeeInfo::getMainJob, "true")
.in(DingEmployeeInfo::getOrganizationCode, organizationCodeList));

Map<String, List<DingEmployeeInfo>> organizationCodeGroupMap = dingEmployeeInfoList.stream()
.collect(Collectors.groupingBy(DingEmployeeInfo::getOrganizationCode));

for (OrganizationSynthesizeTreeVO organizationSynthesizeTreeVO : organizationSynthesizeTreeVOList) {
String organizationCode = organizationSynthesizeTreeVO.getOrganizationCode();
List<DingEmployeeInfo> dingEmployeeInfoGroupList = organizationCodeGroupMap.get(organizationCode);
if (CollUtil.isNotEmpty(dingEmployeeInfoGroupList)) {
List<OrganizationMemberInfo> organizationMemberInfoList = dingEmployeeInfoGroupList.stream().map(r -> {
OrganizationMemberInfo organizationMemberInfo = new OrganizationMemberInfo();
organizationMemberInfo.setEmployeeCode(r.getEmployeeCode());
organizationMemberInfo.setName(r.getEmployeeName());
return organizationMemberInfo;
}).collect(Collectors.toList());
organizationSynthesizeTreeVO.setMemberList(organizationMemberInfoList);
}
}
List<DingOrganization> dingOrganizationList = new ArrayList<>();
List<String> organizationCodeList = new ArrayList<>();
if (StrUtils.isBlank(organizationCode)) {
organizationCodeList = dingOrganizationProperties.getDeptVisibleScopes();
} else {
organizationCodeList = CollectionUtil.toList(organizationCode);
}
dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class)
.in(DingOrganization::getOrganizationCode, organizationCodeList));

return organizationSynthesizeTreeVOList;
}

public List<KeyTreeVO> treeVOList(ReqSynthesizePO request) {
String parentCode = request.getParentCode();
Boolean needMember = request.getNeedMember();

List<OrganizationTreeVO> childOrganizationList = getChildOrganizationList(parentCode);

List<KeyTreeVO> orgKeyTreeVOList = childOrganizationList.stream().map(r -> {
List<KeyTreeVO> orgKeyTreeVOList = dingOrganizationList.stream().map(r -> {
KeyTreeVO keyTreeVO = new KeyTreeVO();
keyTreeVO.setTitle(r.getName());
keyTreeVO.setTitle(r.getOrganizationName());
keyTreeVO.setKey(r.getOrganizationCode());
keyTreeVO.setType("ORGANIZATION");
return keyTreeVO;
}).collect(Collectors.toList());
treeVOList(request.getNeedMember(), orgKeyTreeVOList);
return orgKeyTreeVOList;
}

public void treeVOList(Boolean needMember, List<KeyTreeVO> basicOrgKeyTreeVOList) {
for (KeyTreeVO basicOrgKeyTreeVO : basicOrgKeyTreeVOList) {
String parentCode = basicOrgKeyTreeVO.getKey();
List<OrganizationTreeVO> childOrganizationList = getChildOrganizationList(parentCode);

List<KeyTreeVO> orgKeyTreeVOList = childOrganizationList.stream().map(r -> {
KeyTreeVO keyTreeVO = new KeyTreeVO();
keyTreeVO.setTitle(r.getName());
keyTreeVO.setKey(r.getOrganizationCode());
keyTreeVO.setType("ORGANIZATION");
return keyTreeVO;
}).collect(Collectors.toList());

if (needMember && orgKeyTreeVOList.size() > 0) {
List<String> organizationCodeList = orgKeyTreeVOList.stream()
.map(KeyTreeVO::getKey).collect(Collectors.toList());
List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class)
.eq(DingEmployeeInfo::getMainJob, "true")
.in(DingEmployeeInfo::getOrganizationCode, organizationCodeList));

Map<String, List<DingEmployeeInfo>> organizationCodeGroupMap = dingEmployeeInfoList.stream()
.collect(Collectors.groupingBy(DingEmployeeInfo::getOrganizationCode));

for (KeyTreeVO keyTreeVO : orgKeyTreeVOList) {
String organizationCode = keyTreeVO.getKey();
List<DingEmployeeInfo> dingEmployeeInfoGroupList = organizationCodeGroupMap.get(organizationCode);
if (CollUtil.isNotEmpty(dingEmployeeInfoGroupList)) {
List<KeyTreeVO> memberChildren = dingEmployeeInfoGroupList.stream().map(r -> {
KeyTreeVO child = new KeyTreeVO();
child.setKey(r.getEmployeeCode());
child.setTitle(r.getEmployeeName());
child.setType("MEMBER");
return child;
}).collect(Collectors.toList());
keyTreeVO.setChildren(memberChildren);
if (StringUtils.isNotBlank(parentCode) && needMember) {
List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class)
.eq(DingEmployeeInfo::getMainJob, "true")
.eq(DingEmployeeInfo::getOrganizationCode, parentCode));

List<KeyTreeVO> memberChildren = dingEmployeeInfoList.stream().map(r -> {
KeyTreeVO child = new KeyTreeVO();
child.setKey(r.getEmployeeCode());
child.setTitle(r.getEmployeeName());
child.setType("MEMBER");
return child;
}).collect(Collectors.toList());

if (CollUtil.isNotEmpty(memberChildren)) {
orgKeyTreeVOList.addAll(memberChildren);
}
}
basicOrgKeyTreeVO.setChildren(orgKeyTreeVOList);
}

return orgKeyTreeVOList;
}


}

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqSynthesizePO.java Прегледај датотеку

@@ -15,8 +15,8 @@ import javax.validation.constraints.NotBlank;
@ApiModel("单位列表综合筛选请求")
public class ReqSynthesizePO {

@ApiModelProperty("组织code")
private String parentCode;
@ApiModelProperty("组织code")
private String organizationCode;

@ApiModelProperty("是否需要组织成员列表")
private Boolean needMember = false;


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

@@ -3,8 +3,6 @@ package com.ningdatech.pmapi.todocenter.manage;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.StopWatch;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
@@ -1070,6 +1068,7 @@ public class TodoCenterManage {
req.setUserId(String.valueOf(userId));
req.setEmployeeCode(employeeCode);
req.setInstCodes(instCodes);
// req.setInstCodes(instCodes);
BeanUtils.copyProperties(param,req);
List<ProcessInstanceVo> ccMeList = processInstanceService.getCcMeList(req);



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

@@ -1,7 +1,7 @@
<?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.todocenter.mapper.StatisticsMapper">
<select id="getStatistics" parameterType="java.lang.Long"
<select id="getStatistics" parameterType="java.lang.String"
resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO">
SELECT
sum(CASE WHEN tol.todoNum IS NOT NULL AND tol.todoNum > 0 THEN 1 ELSE 0 end) todoNum,
@@ -24,7 +24,7 @@
) tol
</select>

<select id="getTodoOrIdo" parameterType="java.lang.Long"
<select id="getTodoOrIdo" parameterType="java.lang.String"
resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO">
SELECT
sum(CASE WHEN ht.assignee_ = #{employeeCode} AND ht.end_time_ is NULL THEN 1 end) todoNum,
@@ -33,7 +33,7 @@
act_hi_taskinst ht
</select>

<select id="mysubmitNum" parameterType="java.lang.Long"
<select id="mysubmitNum" parameterType="java.lang.String"
resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO">
SELECT
sum(CASE WHEN tol.mysubmitNum IS NOT NULL AND tol.mysubmitNum > 0 THEN 1 ELSE 0 end) mysubmitNum
@@ -49,7 +49,7 @@
</select>


<select id="ccNums" parameterType="java.lang.Long"
<select id="ccNums" parameterType="java.lang.String"
resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO">
SELECT
count(0) ccmeNum


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