Commit 42e451f6 authored by 高建强's avatar 高建强

item:新增获取用户单位归属接口

parent 192065d7
package com.yeejoin.amos.boot.module.common.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 单位归属
*
* @author gaojianqiang
* @date 2021-08-19
*/
@Data
@ApiModel(value = "UserUnitDto", description = "用户单位归属")
public class UserUnitDto {
@ApiModelProperty(value = "人员类型1-维保公司;2-业主单位")
private String identityType;
@ApiModelProperty(value = "人员id")
private String personSeq;
@ApiModelProperty(value = "人员名称")
private String personName;
@ApiModelProperty(value = "公司id")
private String companyId;
}
package com.yeejoin.amos.boot.module.common.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum UserUnitTypeEnum {
MAINTENANCE_COMPANY("1", "维保公司"),
OWNER_UNIT("2", "业主单位");
private String value;
private String name;
}
...@@ -68,4 +68,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -68,4 +68,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
* 查询单位基本信息列表和单位下所有的重点部位数量。 * 查询单位基本信息列表和单位下所有的重点部位数量。
*/ */
List<OrgUsrTreeDto> getCompanyAndKeySite(Long companyId); List<OrgUsrTreeDto> getCompanyAndKeySite(Long companyId);
List<UserUnitDto> getUserUnit(String id, String type, String code);
} }
package com.yeejoin.amos.boot.module.common.api.service; package com.yeejoin.amos.boot.module.common.api.service;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/** /**
* 机构/部门/人员表 服务类 * 机构/部门/人员表 服务类
...@@ -18,163 +16,172 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; ...@@ -18,163 +16,172 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
* @date 2021-06-18 * @date 2021-06-18
*/ */
public interface IOrgUsrService { public interface IOrgUsrService {
/** /**
* 查询上级单位 * 查询上级单位
* @param parent_id *
* @return * @param parent_id
*/ * @return
*/
String selectUpUnitByParam(String parent_id); String selectUpUnitByParam(String parent_id);
/** /**
* 获取父级 * 获取父级
* @param topId *
* @param entityList * @param topId
* @param packageURL * @param entityList
* @param IDMethodName * @param packageURL
* @param IDHierarchy * @param IDMethodName
* @param NAMEMethodName * @param IDHierarchy
* @param PARENTIDMethodName * @param NAMEMethodName
* @param OrgTypeMethodName * @param PARENTIDMethodName
* @return * @param OrgTypeMethodName
* @throws Exception * @return
*/ * @throws Exception
List<OrgMenuDto> getTree(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy, */
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception; List<OrgMenuDto> getTree(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
/**
* 获取子数据集合
*
* @param topId
* @param entityList
* @param packageURL
* @param IDMethodName
* @param IDHierarchy
* @param NAMEMethodName
* @param PARENTIDMethodName
* @param OrgTypeMethodName
* @return
* @throws Exception
*/
List<OrgMenuDto> getSub(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
/**
* 组装融合调度单位人员信息
*
* @param ids
* @return
* @throws Exception
*/
List<Map<String, Object>> returnCompanyPersonMsg(List<Long> ids) throws Exception;
/**
* 获取动态表单数据
*
* @param id
* @return
* @throws Exception
*/
List<FormValue> getFormValue(Long id) throws Exception;
/**
* 保存 机构/部门/人员基本信息
*
* @param
* @throws Exception
*/
void saveOrgUsr(OrgUsr orgUsr, OrgUsr oriOrgUsr) throws Exception;
/**
* 新增机构/部门/人员基本信息和动态表单数据
*
* @param orgUsr
* @param alertFromValuelist
*/
void saveOrgUsrDynamicFormInstance(OrgUsr orgUsr, List<DynamicFormInstance> alertFromValuelist) throws Exception;
/**
* 更新机构/部门/人员基本信息和动态表单数据
*
* @param instanceId 实例id
* @param fromValueList 动态表单数据列表
* @throws Exception
*/
void updateDynamicFormInstance(Long instanceId, List<DynamicFormInstance> fromValueList) throws Exception;
/**
* @param id
* @throws Exception
*/
Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception;
List<OrgUsr> selectCompanyDepartmentMsg();
void saveOrgUsr(OrgUsrDto OrgUsrDto) throws Exception;
void saveOrgPerson(OrgPersonDto OrgPersonDto) throws Exception;
void updateByIdOrgUsr(OrgUsrDto OrgUsrDto, Long id) throws Exception;
void updateByIdOrgPerson(OrgPersonDto OrgPersonDto, Long id) throws Exception;
OrgUsrFormDto selectCompanyById(Long id) throws Exception;
IPage bizOrgTypeListPage(String pageNum, String pageSize, String bizOrgType) throws Exception;
void saveDepartment(List<OrgDepartmentDto> OrgDepartmentDto, Long id) throws Exception;
void saveCompany(List<OrgUsrDto> OrgUsrDto) throws Exception;
OrgPersonFormDto selectPersonById(Long id) throws Exception;
OrgPersonFormDto selectPersonByIdDetail(Long id) throws Exception;
List<OrgMenuDto> selectPersonTree() throws Exception;
void savePersonList(List<OrgPersonDto> OrgPersonDto) throws Exception;
void saveOrgDepartment(OrgDepartmentDto OrgDepartmentDto) throws Exception;
void updateByIdOrgDepartment(OrgDepartmentDto OrgDepartmentDto, Long id) throws Exception;
OrgDepartmentFormDto selectDepartmentById(Long id) throws Exception;
List<Map<String, Object>> selectForShowByListId(List<Long> ids) throws Exception;
/**
* * @param null
*
* @return <PRE>
* author tw
* date 2021/7/20
* </PRE>
* 列表
*/
List<CompanyDto> listContractDto(Integer pageNum, Integer pageSize, RequestData requestData);
/** /**
* 获取子数据集合 * * @param null
* @param topId *
* @param entityList * @return <PRE>
* @param packageURL * author tw
* @param IDMethodName * date 2021/7/20
* @param IDHierarchy * </PRE>
* @param NAMEMethodName * 统计
* @param PARENTIDMethodName */
* @param OrgTypeMethodName Integer listContractDtoCount(RequestData par);
* @return
* @throws Exception
*/
List<OrgMenuDto> getSub(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
/** /**
* 组装融合调度单位人员信息 * * @param null
* @param ids *
* @return * @return <PRE>
* @throws Exception * author tw
*/ * date 2021/7/26
List<Map<String, Object>> returnCompanyPersonMsg(List<Long> ids) throws Exception; * </PRE>
*/
/** List<OrgUsrzhDto> getOrgUsrzhDto(String name);
* 获取动态表单数据
* @param id
* @return
* @throws Exception
*/
List<FormValue> getFormValue(Long id) throws Exception;
/** List<ESOrgUsrDto> selectByIddata(String name);
* 保存 机构/部门/人员基本信息
* @param
* @throws Exception
*/
void saveOrgUsr (OrgUsr orgUsr, OrgUsr oriOrgUsr) throws Exception;
/** List<Map<String, Object>> getparent();
* 新增机构/部门/人员基本信息和动态表单数据
* @param orgUsr
* @param alertFromValuelist
*/
void saveOrgUsrDynamicFormInstance (OrgUsr orgUsr,List<DynamicFormInstance> alertFromValuelist)throws Exception;
/** List<OrgUsrExcelDto> exportToExcel();
* 更新机构/部门/人员基本信息和动态表单数据
*
* @param instanceId 实例id
* @param fromValueList 动态表单数据列表
* @throws Exception
*/
void updateDynamicFormInstance(Long instanceId, List<DynamicFormInstance> fromValueList)throws Exception;
/** UserUnitDto getUserUnit(String id, String type, String code);
*
* @param id
* @throws Exception
*/
Map<String, Object> selectForShowById (OrgUsr orgUsr,Long id) throws Exception;
List<OrgUsr> selectCompanyDepartmentMsg();
void saveOrgUsr( OrgUsrDto OrgUsrDto) throws Exception;
void saveOrgPerson( OrgPersonDto OrgPersonDto) throws Exception;
void updateByIdOrgUsr(OrgUsrDto OrgUsrDto,Long id) throws Exception;
void updateByIdOrgPerson(OrgPersonDto OrgPersonDto,Long id) throws Exception;
OrgUsrFormDto selectCompanyById(Long id) throws Exception;
IPage bizOrgTypeListPage(String pageNum, String pageSize, String bizOrgType) throws Exception;
void saveDepartment(List<OrgDepartmentDto> OrgDepartmentDto, Long id)throws Exception;
void saveCompany(List<OrgUsrDto> OrgUsrDto)throws Exception;
OrgPersonFormDto selectPersonById(Long id) throws Exception;
OrgPersonFormDto selectPersonByIdDetail(Long id) throws Exception;
List<OrgMenuDto> selectPersonTree() throws Exception;
void savePersonList (List <OrgPersonDto> OrgPersonDto)throws Exception;
void saveOrgDepartment(OrgDepartmentDto OrgDepartmentDto) throws Exception;
void updateByIdOrgDepartment ( OrgDepartmentDto OrgDepartmentDto,Long id) throws Exception;
OrgDepartmentFormDto selectDepartmentById(Long id) throws Exception;
List<Map<String, Object>> selectForShowByListId(List<Long> ids) throws Exception;
/**
* * @param null
* @return
* <PRE>
* author tw
* date 2021/7/20
* </PRE>
* 列表
*/
List<CompanyDto> listContractDto(Integer pageNum, Integer pageSize, RequestData requestData);
/**
* * @param null
* @return
* <PRE>
* author tw
* date 2021/7/20
* </PRE>
* 统计
*/
Integer listContractDtoCount(RequestData par);
/**
* * @param null
* @return
* <PRE>
* author tw
* date 2021/7/26
* </PRE>
*/
List<OrgUsrzhDto> getOrgUsrzhDto(String name);
List<ESOrgUsrDto> selectByIddata(String name);
List< Map<String,Object>> getparent();
List< OrgUsrExcelDto> exportToExcel();
/** /**
* 根据登陆人获取公司部门人员树 * 根据登陆人获取公司部门人员树
......
...@@ -307,8 +307,28 @@ LEFT JOIN ( ...@@ -307,8 +307,28 @@ LEFT JOIN (
FROM important_companys FROM important_companys
</select> </select>
<select id="getUserUnit" resultType="com.yeejoin.amos.boot.module.common.api.dto.UserUnitDto">
SELECT
u.sequence_nbr AS personSeq,
u.biz_org_name AS personName,
'2' AS identityType,
IFNULL( LEFT ( u.biz_org_code, 6 ), '' ) AS companyId
FROM
`cb_org_usr` u
<where>
<if test="id != null and id != ''">
u.amos_org_id = #{id}
</if>
<if test="type != null and type != ''">
AND u.biz_org_type = #{type}
</if>
<if test="code != null and code != ''">
AND u.biz_org_code LIKE CONCAT(#{code}, '%')
</if>
</where>
ORDER BY
u.sequence_nbr DESC
</select>
<select id="exportToExcel" resultType="com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto"> <select id="exportToExcel" resultType="com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto">
select select
a.biz_org_name bizOrgName, a.biz_org_name bizOrgName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment