diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffOrgRelationDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffOrgRelationDTO.java
new file mode 100644
index 0000000000..9e29a92560
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffOrgRelationDTO.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 工作人员注册组织关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-08-19
+ */
+@Data
+public class StaffOrgRelationDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 所有上级组织机构ID(以英文:隔开)部门/网格得拼上所属组织Id
+ */
+ private String pids;
+
+ /**
+ * 工作人员Id
+ */
+ private String staffId;
+
+ /**
+ * 工作人员添加入口Id(agencyId;deptId;gridId)
+ */
+ private String orgId;
+
+ /**
+ * 工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
+ */
+ private String orgType;
+
+ /**
+ * 删除标识
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffOrgRelationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffOrgRelationController.java
new file mode 100644
index 0000000000..065ad9d578
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffOrgRelationController.java
@@ -0,0 +1,85 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.controller;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.dto.StaffOrgRelationDTO;
+import com.epmet.service.StaffOrgRelationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+
+/**
+ * 工作人员注册组织关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-08-19
+ */
+@RestController
+@RequestMapping("stafforgrelation")
+public class StaffOrgRelationController {
+
+ @Autowired
+ private StaffOrgRelationService staffOrgRelationService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = staffOrgRelationService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ StaffOrgRelationDTO data = staffOrgRelationService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody StaffOrgRelationDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ staffOrgRelationService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody StaffOrgRelationDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ staffOrgRelationService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ staffOrgRelationService.delete(ids);
+ return new Result();
+ }
+
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java
new file mode 100644
index 0000000000..a4d6610658
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.StaffOrgRelationEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 工作人员注册组织关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-08-19
+ */
+@Mapper
+public interface StaffOrgRelationDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffOrgRelationEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffOrgRelationEntity.java
new file mode 100644
index 0000000000..f9c31b49d9
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffOrgRelationEntity.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 工作人员注册组织关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-08-19
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("staff_org_relation")
+public class StaffOrgRelationEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 所有上级组织机构ID(以英文:隔开)部门/网格得拼上所属组织Id
+ */
+ private String pids;
+
+ /**
+ * 工作人员Id
+ */
+ private String staffId;
+
+ /**
+ * 工作人员添加入口Id(agencyId;deptId;gridId)
+ */
+ private String orgId;
+
+ /**
+ * 工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
+ */
+ private String orgType;
+
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffOrgRelationService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffOrgRelationService.java
new file mode 100644
index 0000000000..ce5d6ba496
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffOrgRelationService.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.StaffOrgRelationDTO;
+import com.epmet.entity.StaffOrgRelationEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 工作人员注册组织关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-08-19
+ */
+public interface StaffOrgRelationService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2021-08-19
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2021-08-19
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return StaffOrgRelationDTO
+ * @author generator
+ * @date 2021-08-19
+ */
+ StaffOrgRelationDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2021-08-19
+ */
+ void save(StaffOrgRelationDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2021-08-19
+ */
+ void update(StaffOrgRelationDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2021-08-19
+ */
+ void delete(String[] ids);
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffOrgRelationServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffOrgRelationServiceImpl.java
new file mode 100644
index 0000000000..a4e528a1cc
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffOrgRelationServiceImpl.java
@@ -0,0 +1,100 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.dao.StaffOrgRelationDao;
+import com.epmet.dto.StaffOrgRelationDTO;
+import com.epmet.entity.StaffOrgRelationEntity;
+import com.epmet.service.StaffOrgRelationService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 工作人员注册组织关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-08-19
+ */
+@Service
+public class StaffOrgRelationServiceImpl extends BaseServiceImpl implements StaffOrgRelationService {
+
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, StaffOrgRelationDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, StaffOrgRelationDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public StaffOrgRelationDTO get(String id) {
+ StaffOrgRelationEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, StaffOrgRelationDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(StaffOrgRelationDTO dto) {
+ StaffOrgRelationEntity entity = ConvertUtils.sourceToTarget(dto, StaffOrgRelationEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(StaffOrgRelationDTO dto) {
+ StaffOrgRelationEntity entity = ConvertUtils.sourceToTarget(dto, StaffOrgRelationEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
index 2004327484..2c9bcd51b0 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
@@ -66,6 +66,8 @@ public class StaffServiceImpl implements StaffService {
private CustomerStaffDepartmentService customerStaffDepartmentService;
@Autowired
private CustomerStaffGridService customerStaffGridService;
+ @Autowired
+ private StaffOrgRelationService staffOrgRelationService;
@Override
public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) {
@@ -374,6 +376,19 @@ public class StaffServiceImpl implements StaffService {
customerGridService.updateById(gridEntity);
}
+ //5.工作人员注册组织关系表新增数据
+ StaffOrgRelationEntity staffOrgRelationEntity = new StaffOrgRelationEntity();
+ staffOrgRelationEntity.setCustomerId(fromDTO.getCustomerId());
+ if("agency".equals(fromDTO.getOrgType())){
+ staffOrgRelationEntity.setPids(("".equals(orgDTO.getPids()) ? "" : orgDTO.getPids() + ":"));
+ }else {
+ staffOrgRelationEntity.setPids(("".equals(orgDTO.getPids()) ? "" : orgDTO.getPids() + ":") + orgDTO.getAgencyId());
+ }
+ staffOrgRelationEntity.setStaffId(result.getData().getUserId());
+ staffOrgRelationEntity.setOrgId(fromDTO.getOrgId());
+ staffOrgRelationEntity.setOrgType(fromDTO.getOrgType());
+ staffOrgRelationService.insert(staffOrgRelationEntity);
+
return new Result();
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml
new file mode 100644
index 0000000000..350dae73ac
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file