Browse Source

居民端entergrid、工作端profile接口增加返参供调查问卷提交问卷时使用

dev_shibei_match
sunyuchao 4 years ago
parent
commit
2e8d2ac5fa
  1. 45
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgNameResultDTO.java
  2. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java
  3. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  4. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  5. 77
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml
  6. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java
  7. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java

45
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgNameResultDTO.java

@ -0,0 +1,45 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 查询工作人员注册组织信息
* @author sun
*/
@Data
public class StaffOrgNameResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
//工作人员所属组织Id
private String agencyId = "";
//人员Id
private String staffId = "";
//人员注册时所属组织名【组织-组织,组织-部门,组织-网格】
private String orgName = "";
//工作人员添加入口Id(agencyId;deptId;gridId)
private String orgId = "";
//工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
private String orgType = "";
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java

@ -18,8 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.StaffOrgNameResultDTO;
import com.epmet.entity.StaffOrgRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 工作人员注册组织关系表
@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface StaffOrgRelationDao extends BaseDao<StaffOrgRelationEntity> {
/**
* @Description 批量查询工作人员注册组织信息
* @author sun
*/
List<StaffOrgNameResultDTO> selelctStaffOrg(@Param("staffIdList") List<String> staffIdList);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -36,6 +36,7 @@ import com.epmet.dao.CustomerStaffGridDao;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
@ -712,7 +713,12 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
@Override
public Result<CustomerGridDTO> getBaseInfo(CustomerGridFormDTO customerGridFormDTO) {
return new Result<CustomerGridDTO>().ok(ConvertUtils.sourceToTarget(baseDao.selectById(customerGridFormDTO.getGridId()), CustomerGridDTO.class));
CustomerGridDTO restltDTO = ConvertUtils.sourceToTarget(baseDao.selectById(customerGridFormDTO.getGridId()), CustomerGridDTO.class);
if (null != restltDTO) {
CustomerAgencyEntity entity = customerAgencyService.selectById(restltDTO.getPid());
restltDTO.setAgencyName(null != entity ? entity.getOrganizationName() : "");
}
return new Result<CustomerGridDTO>().ok(restltDTO);
}
/**

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -15,6 +15,7 @@ import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dao.CustomerStaffAgencyDao;
import com.epmet.dao.StaffOrgRelationDao;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -75,6 +76,8 @@ public class StaffServiceImpl implements StaffService {
private StaffOrgRelationService staffOrgRelationService;
@Resource
private CustomerStaffRedis customerStaffRedis;
@Resource
private StaffOrgRelationDao staffOrgRelationDao;
@Override
public Result<StaffsInAgencyResultDTO> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) {
@ -243,6 +246,18 @@ public class StaffServiceImpl implements StaffService {
result.setRootAgencyName(agency.getOrganizationName());
}
//2021.08.27 zhaoqf end
//2021.9.17 sun 添加工作人员注册组织、类型、id返参 start
List<String> staffIdList = new ArrayList<>();
staffIdList.add(result.getStaffId());
List<StaffOrgNameResultDTO> list = staffOrgRelationDao.selelctStaffOrg(staffIdList);
list.forEach(l->{
if(l.getStaffId().equals(result.getStaffId())){
result.setOrgId(l.getOrgId());
result.setOrgName(l.getOrgName());
result.setOrgType(l.getOrgType());
}
});
//2021.9.17 sun 添加工作人员注册组织、类型、id返参 end
return result;
}

77
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml

@ -3,6 +3,81 @@
<mapper namespace="com.epmet.dao.StaffOrgRelationDao">
<select id="selelctStaffOrg" resultType="com.epmet.dto.result.StaffOrgNameResultDTO">
SELECT
ca.id agencyId,
sor.staff_id staffId,
IF(
ca.pid = '0',
ca.organization_name,
CONCAT(
(select organization_name from customer_agency where id = ca.pid),
'-',
ca.organization_name
)
)orgName,
sor.org_id orgId,
'agency' orgType
FROM
staff_org_relation sor
INNER JOIN customer_agency ca ON sor.org_id = ca.id
WHERE
sor.org_type = 'agency'
<if test="staffIdList != null and staffIdList.size() > 0">
AND sor.staff_id IN (
<foreach collection="staffIdList" item="staffId" separator=",">
#{staffId}
</foreach>
)
</if>
UNION
SELECT
ca.ID agencyId,
sor.staff_id staffId,
CONCAT(
ca.organization_name,
'-',
cd.department_name
)orgName,
sor.org_id orgId,
'dept' orgType
FROM
staff_org_relation sor
INNER JOIN customer_department cd ON sor.org_id = cd.id
INNER JOIN customer_agency ca ON cd.agency_id = ca.id
WHERE
sor.org_type = 'dept'
<if test="staffIdList != null and staffIdList.size() > 0">
AND sor.staff_id IN (
<foreach collection="staffIdList" item="staffId" separator=",">
#{staffId}
</foreach>
)
</if>
UNION
SELECT
ca.ID agencyId,
sor.staff_id staffId,
CONCAT(
ca.organization_name,
'-',
cg.grid_name
)orgName,
sor.org_id orgId,
'grid' orgType
FROM
staff_org_relation sor
INNER JOIN customer_grid cg ON sor.org_id = cg.id
INNER JOIN customer_agency ca ON cg.pid = ca.id
WHERE
sor.org_type = 'grid'
<if test="staffIdList != null and staffIdList.size() > 0">
AND sor.staff_id IN (
<foreach collection="staffIdList" item="staffId" separator=",">
#{staffId}
</foreach>
)
</if>
</select>
</mapper>

7
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java

@ -58,4 +58,11 @@ public class UserInfoOnEnterGridResultDTO implements Serializable{
* XX街道-YYY 如果是未认证居民这一列为空
*/
private String userStreetTrueName;
//工作人员添加入口Id(agencyId;deptId;gridId)
private String orgId = "";
//人员注册时所属组织名【组织-组织,组织-部门,组织-网格】
private String orgName = "";
//工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
private String orgType = "";
}

3
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java

@ -301,6 +301,9 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl<RegisterRelatio
Result<CustomerGridDTO> gridDTOResult = govOrgFeignClient.getGridBaseInfoByGridId(customerGridFormDTO);
if(gridDTOResult.success() && null != gridDTOResult.getData()){
resultObj.setCurrentGridName(gridDTOResult.getData().getGridName());
resultObj.setOrgId(resultObj.getCurrentGridId());
resultObj.setOrgName(gridDTOResult.getData().getAgencyName()+"-"+gridDTOResult.getData().getGridName());
resultObj.setOrgType("grid");
}else{
//查询网格名称失败
log.warn(String.format("查找网格信息失败,网格Id:【%s】",gridId));

Loading…
Cancel
Save