Преглед на файлове

数据库修改为动态数据库

lixing преди 4 години
родител
ревизия
1dce9670e9
променени са 24 файла, в които са добавени 354 реда и са изтрити 211 реда
  1. 5 0
      fm-person/src/main/java/com/persagy/fm/common/constant/DefaultValueConstants.java
  2. 49 2
      fm-person/src/main/java/com/persagy/fm/common/jms/MsgBaseHandler.java
  3. 5 0
      fm-person/src/main/java/com/persagy/fm/common/jms/model/BaseMsg.java
  4. 32 11
      fm-person/src/main/java/com/persagy/fm/department/jms/handler/GroupMsgHandler.java
  5. 0 5
      fm-person/src/main/java/com/persagy/fm/department/jms/model/GroupCreateMsg.java
  6. 0 5
      fm-person/src/main/java/com/persagy/fm/department/jms/model/GroupUpdateMsg.java
  7. 3 0
      fm-person/src/main/java/com/persagy/fm/department/model/vo/ResponseDepartmentTreeItemVO.java
  8. 29 1
      fm-person/src/main/java/com/persagy/fm/department/service/IDepartmentService.java
  9. 14 9
      fm-person/src/main/java/com/persagy/fm/department/service/impl/DepartmentServiceImpl.java
  10. 3 2
      fm-person/src/main/java/com/persagy/fm/person/constant/PersonJmsType.java
  11. 25 10
      fm-person/src/main/java/com/persagy/fm/person/jms/handler/AccountMsgHandler.java
  12. 2 6
      fm-person/src/main/java/com/persagy/fm/person/jms/model/AccountCreateMsg.java
  13. 1 6
      fm-person/src/main/java/com/persagy/fm/person/jms/model/AccountUpdateMsg.java
  14. 5 3
      fm-person/src/main/java/com/persagy/fm/person/model/ConvertPersonTool.java
  15. 1 0
      fm-person/src/main/java/com/persagy/fm/person/model/Person.java
  16. 3 0
      fm-person/src/main/java/com/persagy/fm/person/model/dto/QueryPersonDTO.java
  17. 3 0
      fm-person/src/main/java/com/persagy/fm/person/model/dto/UpsertPersonDTO.java
  18. 29 0
      fm-person/src/main/java/com/persagy/fm/person/service/IPersonService.java
  19. 22 0
      fm-person/src/main/java/com/persagy/fm/person/service/impl/PersonServiceImpl.java
  20. 30 0
      fm-person/src/main/java/com/persagy/fm/saas/role/constant/enums/RoleTypeEnum.java
  21. 1 0
      fm-person/src/main/resources/bootstrap.yml
  22. 0 39
      fm-person/src/main/resources/db/init/data.sql
  23. 92 96
      fm-person/src/main/resources/db/init/table.sql
  24. 0 16
      fm-person/src/main/resources/mapper/ITranslateDao.xml

+ 5 - 0
fm-person/src/main/java/com/persagy/fm/common/constant/DefaultValueConstants.java

@@ -11,4 +11,9 @@ public class DefaultValueConstants {
      * 没有父节点时,父节点存储的默认值
      */
     public static final String NO_PARENT_ID = "0";
+
+    /**
+     * 默认的appId
+     */
+    public static final String DEFAULT_APP_ID = "PC";
 }

+ 49 - 2
fm-person/src/main/java/com/persagy/fm/common/jms/MsgBaseHandler.java

@@ -1,7 +1,12 @@
 package com.persagy.fm.common.jms;
 
 import com.google.gson.Gson;
+import com.persagy.fm.common.constant.DefaultValueConstants;
+import com.persagy.fm.common.context.AppContext;
 import com.persagy.fm.common.jms.model.BaseMsg;
+import com.persagy.fm.mybatis.handler.DynamicDataSourceHandler;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 
 /**
  * 消息处理基类
@@ -9,7 +14,36 @@ import com.persagy.fm.common.jms.model.BaseMsg;
  * @author lixing
  * @version V1.0 2021/3/18 5:42 下午
  **/
+@Service
 public class MsgBaseHandler {
+    @Autowired
+    DynamicDataSourceHandler dynamicDataSourceHandler;
+
+    /**
+     * 重置数据源
+     *
+     * @param groupCode 集团编码
+     * @author lixing
+     * @version V1.0 2021/3/30 5:22 下午
+     */
+    private void resetDataSource(String groupCode) {
+        AppContext.getContext().setGroupCode(groupCode);
+        AppContext.getContext().setAppId(DefaultValueConstants.DEFAULT_APP_ID);
+        dynamicDataSourceHandler.resetDataSource();
+    }
+
+    /**
+     * 根据消息重置数据源
+     *
+     * @param message rabbitMQ消息
+     * @author lixing
+     * @version V1.0 2021/3/30 5:47 下午
+     */
+    public void resetDataSourceByMsg(String message) {
+        BaseMsg baseMsg = getBaseMsg(message);
+        resetDataSource(baseMsg.getGroupCode());
+    }
+
     /**
      * 获取消息类型
      *
@@ -19,8 +53,21 @@ public class MsgBaseHandler {
      * @version V1.0 2021/3/18 6:16 下午
      */
     public String getMsgType(String message) {
-        Gson gson = new Gson();
-        BaseMsg baseMsg = gson.fromJson(message, BaseMsg.class);
+        BaseMsg baseMsg = getBaseMsg(message);
         return baseMsg.getType();
     }
+
+    /**
+     * message转换为BaseMsg对象
+     *
+     * @param message rabbitMQ消息
+     * @return BaseMsg对象
+     * @author lixing
+     * @version V1.0 2021/3/30 5:46 下午
+     */
+    private BaseMsg getBaseMsg(String message) {
+        Gson gson = new Gson();
+        return gson.fromJson(message, BaseMsg.class);
+    }
+
 }

+ 5 - 0
fm-person/src/main/java/com/persagy/fm/common/jms/model/BaseMsg.java

@@ -17,4 +17,9 @@ public class BaseMsg {
      * 消息类型
      */
     private String type;
+
+    /**
+     * 集团编码
+     */
+    private String groupCode;
 }

+ 32 - 11
fm-person/src/main/java/com/persagy/fm/department/jms/handler/GroupMsgHandler.java

@@ -3,6 +3,7 @@ package com.persagy.fm.department.jms.handler;
 import com.google.gson.Gson;
 import com.persagy.common.enums.ResponseCode;
 import com.persagy.common.exception.BusinessException;
+import com.persagy.fm.common.context.AppContext;
 import com.persagy.fm.common.context.DefaultAppContext;
 import com.persagy.fm.common.jms.MsgBaseHandler;
 import com.persagy.fm.department.constant.DepJmsTypeConstants;
@@ -11,15 +12,20 @@ import com.persagy.fm.department.constant.enums.ResourceFromEnum;
 import com.persagy.fm.department.jms.model.GroupCreateMsg;
 import com.persagy.fm.department.jms.model.GroupUpdateMsg;
 import com.persagy.fm.department.model.ConvertDepartmentTool;
+import com.persagy.fm.department.model.Department;
 import com.persagy.fm.department.model.dto.AddDepartmentDTO;
+import com.persagy.fm.department.model.dto.QueryDepartmentDTO;
 import com.persagy.fm.department.service.IDepartmentService;
+import com.persagy.fm.mybatis.handler.DynamicDataSourceHandler;
 import com.rabbitmq.client.Channel;
 import org.springframework.amqp.core.Message;
 import org.springframework.amqp.rabbit.annotation.RabbitListener;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.util.CollectionUtils;
 
 import java.io.IOException;
+import java.util.List;
 
 /**
  * 集团消息处理类
@@ -28,9 +34,11 @@ import java.io.IOException;
  * @version V1.0 2021/3/18 6:18 下午
  **/
 @Configuration
-public class GroupMsgHandler extends MsgBaseHandler {
+public class GroupMsgHandler{
     @Autowired
     IDepartmentService departmentService;
+    @Autowired
+    MsgBaseHandler msgBaseHandler;
 
     /**
      * 监听saas队列
@@ -44,7 +52,11 @@ public class GroupMsgHandler extends MsgBaseHandler {
     @RabbitListener(queues = "${dep.amqp.queue.saas}")
     public void process(String message, Channel channel, Message msg) {
         try {
-            String msgType = getMsgType(message);
+            // 切换数据源
+            msgBaseHandler.resetDataSourceByMsg(message);
+            // 获取消息类型
+            String msgType = msgBaseHandler.getMsgType(message);
+
             Gson gson = new Gson();
             switch (msgType) {
                 case DepJmsTypeConstants.GROUP_CREATE:
@@ -79,7 +91,17 @@ public class GroupMsgHandler extends MsgBaseHandler {
      */
     private void updateGroup(GroupUpdateMsg groupUpdateMsg) {
         // 找到部门类型为集团的部门
+        QueryDepartmentDTO queryDepartmentDTO = new QueryDepartmentDTO();
+        queryDepartmentDTO.setType(DepTypeEnum.GROUP.getType());
+        List<Department> departments = departmentService.queryDepartmentList(queryDepartmentDTO);
         // 更新部门的名称
+        if(CollectionUtils.isEmpty(departments)) {
+            return;
+        }
+        Department department = departments.get(0);
+        department.setName(groupUpdateMsg.getGroupName());
+        department.setFullPath(groupUpdateMsg.getGroupName());
+        departmentService.updateDepartment(department);
     }
 
     /**
@@ -87,16 +109,15 @@ public class GroupMsgHandler extends MsgBaseHandler {
      * @param groupCreateMsg 集团创建消息
      */
     private void createGroup(GroupCreateMsg groupCreateMsg) {
-        AddDepartmentDTO addDepartmentDTO = ConvertDepartmentTool.INSTANCE.convert2AddDto(groupCreateMsg);
-        addDepartmentDTO.setType(DepTypeEnum.GROUP.getType());
-        addDepartmentDTO.setResourceFrom(ResourceFromEnum.USER_CREATE.getType());
-        addDepartmentDTO.setFullPath(addDepartmentDTO.getName());
+        // 给appContext赋值
+        AppContext.getContext().setAccountId(groupCreateMsg.getUpdateUser());
 
-        // 给全局参数赋值
-        DefaultAppContext.getContext().setAppId("pc");
-        DefaultAppContext.getContext().setGroupCode(groupCreateMsg.getGroupCode());
-        DefaultAppContext.getContext().setAccountId(groupCreateMsg.getUpdateUser());
+        Department department = new Department();
+        departmentService.setDefaultValue(department);
+        department.setType(DepTypeEnum.GROUP.getType());
+        department.setName(groupCreateMsg.getGroupName());
+        department.setFullPath(groupCreateMsg.getGroupName());
 
-        departmentService.createDepartment(addDepartmentDTO);
+        departmentService.createDepartment(department);
     }
 }

+ 0 - 5
fm-person/src/main/java/com/persagy/fm/department/jms/model/GroupCreateMsg.java

@@ -15,11 +15,6 @@ import lombok.Setter;
 @Getter
 public class GroupCreateMsg extends BaseMsg {
     /**
-     * 集团编码
-     */
-    private String groupCode;
-
-    /**
      * 集团名称
      */
     private String groupName;

+ 0 - 5
fm-person/src/main/java/com/persagy/fm/department/jms/model/GroupUpdateMsg.java

@@ -15,11 +15,6 @@ import lombok.Setter;
 @Getter
 public class GroupUpdateMsg extends BaseMsg {
     /**
-     * 集团编码
-     */
-    private String groupCode;
-
-    /**
      * 集团名称
      */
     private String groupName;

+ 3 - 0
fm-person/src/main/java/com/persagy/fm/department/model/vo/ResponseDepartmentTreeItemVO.java

@@ -24,6 +24,9 @@ public class ResponseDepartmentTreeItemVO {
     @ApiModelProperty("部门名称")
     private String name;
 
+    @ApiModelProperty("父部门id")
+    private String parentId;
+
     @ApiModelProperty("是否包含下级部门")
     private String hasChildren;
 

+ 29 - 1
fm-person/src/main/java/com/persagy/fm/department/service/IDepartmentService.java

@@ -21,13 +21,23 @@ public interface IDepartmentService {
      * 创建部门
      *
      * @param addDepartmentDTO 创建部门入参
-     * @return Long 部门主键
+     * @return 部门主键
      * @author lixing
      * @version V1.0 2021-03-11 15:09:17
      */
     String createDepartment(AddDepartmentDTO addDepartmentDTO);
 
     /**
+     * 创建部门
+     *
+     * @param department 部门对象
+     * @return 部门主键
+     * @author lixing
+     * @version V1.0 2021/3/30 5:51 下午
+     */
+    String createDepartment(Department department);
+
+    /**
      * 部门详情
      *
      * @param id 主键
@@ -47,6 +57,15 @@ public interface IDepartmentService {
     void updateDepartment(UpdateDepartmentDTO updateDepartmentDTO);
 
     /**
+     * 更新部门
+     *
+     * @param department 部门实体
+     * @author lixing
+     * @version V1.0 2021/3/30 3:50 下午
+     */
+    void updateDepartment(Department department);
+
+    /**
      * 删除部门
      *
      * @param id 主键
@@ -104,4 +123,13 @@ public interface IDepartmentService {
      * @version V1.0 2021/3/12 11:02 上午
      */
     Department checkDeletable(String id);
+
+    /**
+     * 如果某些字段没有赋值,使用默认的值
+     *
+     * @param department 部门实体
+     * @author lixing
+     * @version V1.0 2021/3/12 12:29 下午
+     */
+    void setDefaultValue(Department department);
 }

+ 14 - 9
fm-person/src/main/java/com/persagy/fm/department/service/impl/DepartmentServiceImpl.java

@@ -63,6 +63,12 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
         return depId;
     }
 
+    @Override
+    public String createDepartment(Department department) {
+        save(department);
+        return department.getId();
+    }
+
     private void saveDepProject(List<String> projectIds, String depId) {
         if (CollectionUtils.isEmpty(projectIds)) {
             return;
@@ -130,14 +136,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
         }
     }
 
-    /**
-     * 如果某些字段没有赋值,使用默认的值
-     *
-     * @param department 部门实体
-     * @author lixing
-     * @version V1.0 2021/3/12 12:29 下午
-     */
-    private void setDefaultValue(Department department) {
+    @Override
+    public void setDefaultValue(Department department) {
         if (StringUtils.isBlank(department.getResourceFrom())) {
             department.setResourceFrom(ResourceFromEnum.USER_CREATE.getType());
         }
@@ -182,7 +182,6 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
     @Override
     @Transactional
     public void updateDepartment(UpdateDepartmentDTO updateDepartmentDTO) {
-        // TODO: 2021/3/22 上级部门只能选择大于等于当前部门等级的部门,通过fullPath包含的分隔符个数判断
         Department department = getById(updateDepartmentDTO.getId());
         String nameBeforeChange = department.getName();
         department = ConvertDepartmentTool.INSTANCE.convertUpdateDto2Entity(department, updateDepartmentDTO);
@@ -197,6 +196,12 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
         updateDepProject(projectIds, depId);
     }
 
+    @Override
+    public void updateDepartment(Department department) {
+        updateById(department);
+    }
+
+
     /**
      * 更新部门关联的项目
      *

+ 3 - 2
fm-person/src/main/java/com/persagy/fm/person/constant/PersonJmsType.java

@@ -10,9 +10,10 @@ public class PersonJmsType {
     /**
      * 超级管理员账号创建
      */
-    public static final String ACCOUNT_CREATE = "accountCreate";
+    public static final String ACCOUNT_CREATE = "create";
+
     /**
      * 超级管理员账号更新
      */
-    public static final String ACCOUNT_UPDATE = "accountUpdate";
+    public static final String ACCOUNT_UPDATE = "update";
 }

+ 25 - 10
fm-person/src/main/java/com/persagy/fm/person/jms/handler/AccountMsgHandler.java

@@ -4,20 +4,21 @@ import com.google.gson.Gson;
 import com.persagy.common.enums.ResponseCode;
 import com.persagy.common.exception.BusinessException;
 import com.persagy.fm.common.jms.MsgBaseHandler;
-import com.persagy.fm.common.jms.model.BaseMsg;
 import com.persagy.fm.person.constant.PersonJmsType;
 import com.persagy.fm.person.jms.model.AccountCreateMsg;
 import com.persagy.fm.person.jms.model.AccountUpdateMsg;
 import com.persagy.fm.person.model.ConvertPersonTool;
-import com.persagy.fm.person.model.dto.AddPersonDTO;
+import com.persagy.fm.person.model.Person;
 import com.persagy.fm.person.service.IPersonService;
 import com.rabbitmq.client.Channel;
 import org.springframework.amqp.core.Message;
 import org.springframework.amqp.rabbit.annotation.RabbitListener;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 import java.io.IOException;
+import java.util.List;
 
 /**
  * 账号消息处理类
@@ -26,9 +27,11 @@ import java.io.IOException;
  * @version V1.0 2021/3/18 11:38 上午
  **/
 @Service
-public class AccountMsgHandler extends MsgBaseHandler {
+public class AccountMsgHandler {
     @Autowired
     private IPersonService personService;
+    @Autowired
+    MsgBaseHandler msgBaseHandler;
 
     /**
      * 处理账号创建消息
@@ -38,10 +41,11 @@ public class AccountMsgHandler extends MsgBaseHandler {
      * @version V1.0 2021/3/18 11:40 上午
      */
     public void createAccount(AccountCreateMsg accountCreateMsg) {
-        AddPersonDTO addPersonDTO = ConvertPersonTool.INSTANCE.convert2AddDTO(accountCreateMsg);
-        personService.createPerson(addPersonDTO);
+        Person person = ConvertPersonTool.INSTANCE.convert2Entity(accountCreateMsg);
+        personService.createPerson(person);
     }
 
+
     /**
      * 处理账号更新消息
      *
@@ -51,7 +55,15 @@ public class AccountMsgHandler extends MsgBaseHandler {
      */
     public void updateAccount(AccountUpdateMsg accountUpdateMsg) {
         // 根据账号id找到对应的人员信息
-        // 更细人员的账号信息
+        List<Person> people = personService.queryByAccountId(accountUpdateMsg.getId());
+        // 更新人员的账号信息
+        if (!CollectionUtils.isEmpty(people)) {
+            Person person = people.get(0);
+            person.setUsername(accountUpdateMsg.getUsername());
+            person.setName(accountUpdateMsg.getUsername());
+            person.setNamePinyin(accountUpdateMsg.getUsername());
+            personService.updatePerson(person);
+        }
     }
 
     /**
@@ -59,14 +71,17 @@ public class AccountMsgHandler extends MsgBaseHandler {
      *
      * @param message 消息体字符串
      * @param channel 通道对象
-     * @param msg 消息对象
+     * @param msg     消息对象
      * @author lixing
      * @version V1.0 2021/3/17 9:47 上午
      */
     @RabbitListener(queues = "${person.amqp.queue.saas}")
     public void process(String message, Channel channel, Message msg) {
         try {
-            String msgType = getMsgType(message);
+            // 切换数据源
+            msgBaseHandler.resetDataSourceByMsg(message);
+            // 获取消息类型
+            String msgType = msgBaseHandler.getMsgType(message);
             Gson gson = new Gson();
             switch (msgType) {
                 case PersonJmsType.ACCOUNT_CREATE:
@@ -81,11 +96,11 @@ public class AccountMsgHandler extends MsgBaseHandler {
                     break;
             }
             // 手动确认消息已消费
-            channel.basicAck(msg.getMessageProperties().getDeliveryTag(),false);
+            channel.basicAck(msg.getMessageProperties().getDeliveryTag(), false);
         } catch (Exception e) {
             try {
                 // 将消费失败的消息移除消息队列,避免重复消费
-                channel.basicReject(msg.getMessageProperties().getDeliveryTag(),false);
+                channel.basicReject(msg.getMessageProperties().getDeliveryTag(), false);
             } catch (IOException ex) {
                 throw new BusinessException(ResponseCode.C0001.getCode(),
                         "账号消息从队列中移除失败," + ex.getMessage());

+ 2 - 6
fm-person/src/main/java/com/persagy/fm/person/jms/model/AccountCreateMsg.java

@@ -15,11 +15,6 @@ import lombok.Setter;
 @Getter
 public class AccountCreateMsg extends BaseMsg {
     /**
-     * 集团编码
-     */
-    private String groupCode;
-
-    /**
      * 账号id
      */
     private String id;
@@ -27,5 +22,6 @@ public class AccountCreateMsg extends BaseMsg {
     /**
      * 账号
      */
-    private String accountName;
+    private String username;
+
 }

+ 1 - 6
fm-person/src/main/java/com/persagy/fm/person/jms/model/AccountUpdateMsg.java

@@ -16,11 +16,6 @@ import lombok.Setter;
 @Getter
 public class AccountUpdateMsg extends BaseMsg {
     /**
-     * 集团编码
-     */
-    private String groupCode;
-
-    /**
      * 账号id
      */
     private String id;
@@ -28,5 +23,5 @@ public class AccountUpdateMsg extends BaseMsg {
     /**
      * 账号
      */
-    private String accountName;
+    private String username;
 }

+ 5 - 3
fm-person/src/main/java/com/persagy/fm/person/model/ConvertPersonTool.java

@@ -95,10 +95,12 @@ public interface ConvertPersonTool {
      * @version V1.0 2021/3/22 7:59 下午
      */
     @Mappings({
-            @Mapping(source = "id", target = "username"),
-            @Mapping(source = "accountName", target = "name")
+            @Mapping(source = "id", target = "accountId"),
+            @Mapping(source = "username", target = "name"),
+            @Mapping(source = "username", target = "username"),
+            @Mapping(source = "username", target = "namePinyin")
     })
-    AddPersonDTO convert2AddDTO(AccountCreateMsg accountCreateMsg);
+    Person convert2Entity(AccountCreateMsg accountCreateMsg);
 
     /**
      * 实体对象列表转换为SimplePersonListItemVO列表

+ 1 - 0
fm-person/src/main/java/com/persagy/fm/person/model/Person.java

@@ -65,6 +65,7 @@ public class Person extends AuditableEntity<Person> implements Serializable {
 
     public static String PROP_NAME = "name";
     public static String PROP_USERNAME = "username";
+    public static String PROP_ACCOUNT_ID = "account_id";
     public static String PROP_ID_NUMBER = "id_number";
     public static String PROP_GENDER = "gender";
     public static String PROP_BIRTHDAY = "birthday";

+ 3 - 0
fm-person/src/main/java/com/persagy/fm/person/model/dto/QueryPersonDTO.java

@@ -16,6 +16,9 @@ public class QueryPersonDTO {
     @ApiModelProperty(value = "姓名")
     private String name;
 
+    @ApiModelProperty(value = "账号id")
+    private String accountId;
+
     @ApiModelProperty(value = "账号")
     private String username;
 

+ 3 - 0
fm-person/src/main/java/com/persagy/fm/person/model/dto/UpsertPersonDTO.java

@@ -94,4 +94,7 @@ public class UpsertPersonDTO {
 
     @ApiModelProperty(value = "账号来源", required = true)
     private String userFrom;
+
+    @ApiModelProperty("账号id")
+    private String accountId;
 }

+ 29 - 0
fm-person/src/main/java/com/persagy/fm/person/service/IPersonService.java

@@ -26,6 +26,16 @@ public interface IPersonService {
     String createPerson(AddPersonDTO addPersonDTO);
 
     /**
+     * 创建人员
+     *
+     * @param person 人员对象
+     * @return 人员主键
+     * @author lixing
+     * @version V1.0 2021-03-15 17:20:31
+     */
+    String createPerson(Person person);
+
+    /**
      * 人员详情
      *
      * @param id 主键
@@ -52,6 +62,15 @@ public interface IPersonService {
     void updatePerson(UpdatePersonDTO updatePersonDTO);
 
     /**
+     * 更新人员
+     *
+     * @param person 人员对象
+     * @author lixing
+     * @version V1.0 2021/3/30 5:05 下午
+     */
+    void updatePerson(Person person);
+
+    /**
      * 删除人员
      *
      * @param id 主键
@@ -70,6 +89,16 @@ public interface IPersonService {
      */
     IPage<ResponsePersonListItemVO> pageQueryPerson(PageQueryPersonDTO pageQueryPersonDTO);
 
+    /**
+     * 根据账号id,查询人员列表
+     *
+     * @param accountId 账号id
+     * @return 人员列表
+     * @author lixing
+     * @version V1.0 2021/3/30 5:00 下午
+     */
+    List<Person> queryByAccountId(String accountId);
+
 //    /**
 //     * 重置人员账号的密码
 //     *

+ 22 - 0
fm-person/src/main/java/com/persagy/fm/person/service/impl/PersonServiceImpl.java

@@ -1,6 +1,7 @@
 package com.persagy.fm.person.service.impl;
 
 import cn.hutool.extra.pinyin.PinyinUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -56,6 +57,12 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person>
     @Autowired
     private SaasAccountProjectClient saasAccountProjectClient;
 
+    @Override
+    public String createPerson(Person person) {
+        save(person);
+        return person.getId();
+    }
+
     /**
      * 创建人员
      *
@@ -287,6 +294,16 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person>
         updateById(person);
     }
 
+    @Override
+    public List<Person> queryByAccountId(String accountId) {
+        if(StringUtils.isBlank(accountId)) {
+            throw new IllegalArgumentException("根据账号id查询人员,账号id为空");
+        }
+        QueryWrapper<Person> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(Person.PROP_ACCOUNT_ID, accountId);
+        return list(queryWrapper);
+    }
+
     /**
      * 校验人员是否可删除
      *
@@ -373,4 +390,9 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person>
     public void enablePerson(String personId) {
         // TODO: 2021/3/26 解禁人员
     }
+
+    @Override
+    public void updatePerson(Person person) {
+        updateById(person);
+    }
 }

+ 30 - 0
fm-person/src/main/java/com/persagy/fm/saas/role/constant/enums/RoleTypeEnum.java

@@ -0,0 +1,30 @@
+package com.persagy.fm.saas.role.constant.enums;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 角色类型枚举类
+ *
+ * @author lixing
+ * @version V1.0 2021/3/25 10:16 上午
+ **/
+public enum RoleTypeEnum {
+    /**
+     * 账号角色关联类型
+     */
+    SYS_ROLE("0", "系统角色"),
+    BUSINESS("1", "业务角色");
+
+    @Setter
+    @Getter
+    private String type;
+    @Setter
+    @Getter
+    private String desc;
+
+    RoleTypeEnum(String type, String desc) {
+        this.type = type;
+        this.desc = desc;
+    }
+}

+ 1 - 0
fm-person/src/main/resources/bootstrap.yml

@@ -16,6 +16,7 @@ spring:
         sessionStatMaxCount: 1000
         profileEnable: true
     dynamic:
+      enabled: true
       primary: fm-person
       strict: false
       druid: #以下是支持的全局默认值

+ 0 - 39
fm-person/src/main/resources/db/init/data.sql

@@ -1,56 +1,6 @@
-/*
-Navicat MySQL Data Transfer
-
-Source Server         : 标准产品-config
-Source Server Version : 50730
-Source Host           : 192.168.64.15:9934
-Source Database       : fm-person
-
-Target Server Type    : MYSQL
-Target Server Version : 50730
-File Encoding         : 65001
-
-Date: 2021-03-30 09:55:01
-*/
-INSERT INTO `department` VALUES ('1372751438137982978', '部门2', '0', '0', '0', '1374611634976149506', '部门2', '0', null, null, '1', '2021-03-19 11:27:02', '1', '2021-03-24 14:41:51', '1');
-INSERT INTO `department` VALUES ('1372751497730654210', '部门2_1', '1', '1372751438137982978', '0', null, '部门2-部门2_1', '0', null, null, '1', '2021-03-19 11:27:16', '1', '2021-03-24 14:41:51', '1');
-INSERT INTO `department` VALUES ('1372751527287914498', '部门2_1.1', '1', '1372751497730654210', '0', null, '部门2-部门2_1-部门2_1.1', '0', null, null, '1', '2021-03-19 11:27:23', '1', '2021-03-24 14:41:51', '1');
-INSERT INTO `department` VALUES ('1375280091291934722', '部门2_2', '1', '1372751438137982978', '0', null, '部门2-部门2_2', '0', null, null, 'AC1372371635352403969', '2021-03-26 10:55:00', null, '2021-03-26 10:55:00', '1');
-INSERT INTO `department` VALUES ('1375280134614900737', '部门2_2.1', '1', '1375280091291934722', '0', null, '部门2-部门2_2-部门2_2.1', '0', null, null, 'AC1372371635352403969', '2021-03-26 10:55:10', null, '2021-03-26 10:55:10', '1');
-INSERT INTO `department` VALUES ('1375280151765409794', '部门2_2.2', '1', '1375280091291934722', '0', null, '部门2-部门2_2-部门2_2.2', '0', null, null, 'AC1372371635352403969', '2021-03-26 10:55:14', null, '2021-03-26 10:55:14', '1');
-INSERT INTO `department` VALUES ('1375280193490345985', '部门2_2.2.1', '1', '1375280151765409794', '0', null, '部门2-部门2_2-部门2_2.2-部门2_2.2.1', '0', null, null, 'AC1372371635352403969', '2021-03-26 10:55:24', null, '2021-03-26 10:55:24', '1');
-INSERT INTO `department` VALUES ('1375280212515708930', '部门2_2.2.2', '1', '1375280151765409794', '0', null, '部门2-部门2_2-部门2_2.2-部门2_2.2.2', '0', null, null, 'AC1372371635352403969', '2021-03-26 10:55:29', null, '2021-03-26 10:55:29', '1');
-
-INSERT INTO `person` VALUES ('1374611634976149506', '人员a', 'renyuana', 'account1', null, null, null, null, null, null, null, null, null, null, null, null, '2021-03-24 14:38:47', '1', null, '2021-03-24 14:38:47', '1');
-
 INSERT INTO `profession` VALUES ('1372835761096679425', '强电', '0', null, '1', '2021-03-19 17:02:06', null, '2021-03-19 17:02:06', '1');
 INSERT INTO `profession` VALUES ('1372835809620582402', '暖通', '0', null, '1', '2021-03-19 17:02:18', null, '2021-03-19 17:02:18', '1');
 INSERT INTO `profession` VALUES ('1372835835038064642', '弱电', '0', null, '1', '2021-03-19 17:02:24', null, '2021-03-19 17:02:24', '1');
 INSERT INTO `profession` VALUES ('1372835863060209665', '综合', '0', null, '1', '2021-03-19 17:02:30', null, '2021-03-19 17:02:30', '1');
 INSERT INTO `profession` VALUES ('1372835888351862786', '保安', '0', null, '1', '2021-03-19 17:02:36', null, '2021-03-19 17:02:36', '1');
 INSERT INTO `profession` VALUES ('1372835910363570178', '保洁', '0', null, '1', '2021-03-19 17:02:42', null, '2021-03-19 17:02:42', '1');
- ----------------------------
-INSERT INTO `work_resume` VALUES ('1374611635504631809', '1374611634976149506', '1372751438137982978', '0', '2021-03-24 14:38:48', null, null, null, '1', '2021-03-24 14:38:48', null, '2021-03-24 14:38:48', '1');
-INSERT INTO `work_resume` VALUES ('1374650120881999873', '1374650120391266305', '1372751438137982978', '0', '2021-03-24 17:11:43', null, null, null, '1', '2021-03-24 17:11:43', null, '2021-03-24 17:11:43', '1');
-INSERT INTO `work_resume` VALUES ('1374650644486328321', '1374650644431802369', '1372751438137982978', '0', '2021-03-24 17:13:48', null, null, null, '1', '2021-03-24 17:13:48', null, '2021-03-24 17:13:48', '1');
-INSERT INTO `work_resume` VALUES ('1374650976788451329', '1374650976478072833', '1372751438137982978', '0', '2021-03-24 17:15:07', null, null, null, '1', '2021-03-24 17:15:07', null, '2021-03-24 17:15:07', '1');
-INSERT INTO `work_resume` VALUES ('1374651167553785857', '1374651167503454210', '1372751438137982978', '0', '2021-03-24 17:15:53', null, null, null, '1', '2021-03-24 17:15:53', null, '2021-03-24 17:15:53', '1');
-INSERT INTO `work_resume` VALUES ('1374658317776756737', '1374658317093085186', '1372751438137982978', '0', '2021-03-24 17:44:18', null, null, null, '1', '2021-03-24 17:44:18', null, '2021-03-24 17:44:18', '1');
-INSERT INTO `work_resume` VALUES ('1374661787598626817', '1374661787523129346', '1372751438137982978', '0', '2021-03-24 17:58:05', null, null, null, '1', '2021-03-24 17:58:05', null, '2021-03-24 17:58:05', '1');
-INSERT INTO `work_resume` VALUES ('1374663554826670081', '1374663554239467522', '1372751438137982978', '0', '2021-03-24 18:05:06', null, null, null, '1', '2021-03-24 18:05:06', null, '2021-03-24 18:05:06', '1');
-INSERT INTO `work_resume` VALUES ('1374664666476683266', '1374664665981755393', '1372751438137982978', '0', '2021-03-24 18:09:31', null, null, null, '1', '2021-03-24 18:09:31', null, '2021-03-24 18:09:31', '1');
-INSERT INTO `work_resume` VALUES ('1374671336204316674', '1374671335839412225', '1372751438137982978', '0', '2021-03-24 18:36:01', null, null, null, '1', '2021-03-24 18:36:01', null, '2021-03-24 18:36:01', '1');
-INSERT INTO `work_resume` VALUES ('1374672209361920002', '1374672208929906689', '1372751438137982978', '0', '2021-03-24 18:39:30', null, null, null, '1', '2021-03-24 18:39:30', null, '2021-03-24 18:39:30', '1');
-INSERT INTO `work_resume` VALUES ('1374673094087524354', '1374673093638733826', '1372751438137982978', '0', '2021-03-24 18:43:00', null, null, null, '1', '2021-03-24 18:43:00', null, '2021-03-24 18:43:00', '1');
-INSERT INTO `work_resume` VALUES ('1374676187260792833', '1374676166096334850', '1372751438137982978', '0', '2021-03-24 18:55:18', null, null, null, '1', '2021-03-24 18:55:18', null, '2021-03-24 18:55:18', '1');

+ 92 - 96
fm-person/src/main/resources/db/init/table.sql

@@ -1,119 +1,100 @@
-/*
-Navicat MySQL Data Transfer
 
-Source Server         : 标准产品-config
-Source Server Version : 50730
-Source Host           : 192.168.64.15:9934
-Source Database       : fm-person
+CREATE TABLE IF NOT EXISTS `dep_project`
+(
+    `id`            varchar(64) NOT NULL DEFAULT '' COMMENT '主键',
+    `dep_id`        varchar(64)          DEFAULT NULL COMMENT '部门id',
+    `project_id`    varchar(80)          DEFAULT NULL COMMENT '项目id',
+    `ts`            timestamp   NULL     DEFAULT NULL COMMENT '乐观锁',
+    `creator`       varchar(32)          DEFAULT NULL COMMENT '创建人',
+    `creation_time` timestamp   NULL     DEFAULT NULL COMMENT '创建时间',
+    `modifier`      varchar(32)          DEFAULT NULL COMMENT '最后修改人',
+    `modified_time` datetime             DEFAULT NULL COMMENT '最后修改时间',
+    `valid`         int(11)              DEFAULT NULL COMMENT '合法标识',
+    PRIMARY KEY (`id`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='部门项目';
 
-Target Server Type    : MYSQL
-Target Server Version : 50730
-File Encoding         : 65001
+CREATE TABLE IF NOT EXISTS `department`
+(
+    `id`            varchar(64)  NOT NULL DEFAULT '' COMMENT 'id',
+    `name`          varchar(100) NOT NULL DEFAULT '' COMMENT '部门名称',
+    `type`          varchar(10)  NOT NULL DEFAULT '' COMMENT '部门类型',
+    `parent_id`     varchar(64)  NOT NULL DEFAULT '0' COMMENT '上级部门id',
+    `resource_from` varchar(10)  NOT NULL DEFAULT '0' COMMENT '数据来源',
+    `managers`      text COMMENT '负责人',
+    `full_path`     text COMMENT '部门全路径',
+    `staff_count`   int(11)      NOT NULL DEFAULT '0' COMMENT '编制人数',
+    `project_ids`   json                  DEFAULT NULL COMMENT '关联的项目',
+    `ts`            timestamp    NULL     DEFAULT NULL COMMENT '乐观锁',
+    `creator`       varchar(32)           DEFAULT NULL COMMENT '创建人',
+    `creation_time` timestamp    NULL     DEFAULT NULL COMMENT '创建时间',
+    `modifier`      varchar(32)           DEFAULT NULL COMMENT '最后修改人',
+    `modified_time` datetime              DEFAULT NULL COMMENT '最后修改时间',
+    `valid`         int(11)               DEFAULT NULL COMMENT '合法标识',
+    PRIMARY KEY (`id`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='部门';
 
-Date: 2021-03-30 09:55:01
-*/
 
-SET FOREIGN_KEY_CHECKS=0;
+CREATE TABLE IF NOT EXISTS `person`
+(
+    `id`               varchar(64) NOT NULL DEFAULT '' COMMENT 'id',
+    `name`             varchar(80)          DEFAULT NULL COMMENT '姓名',
+    `name_pinyin`      varchar(200)         DEFAULT NULL COMMENT '姓名拼音',
+    `username`         varchar(80)          DEFAULT NULL COMMENT '账号',
+    `account_id`       varchar(80)          DEFAULT NULL COMMENT '账号id',
+    `id_number`        varchar(80)          DEFAULT NULL COMMENT '证件号码',
+    `certificate_type` varchar(10)          DEFAULT NULL COMMENT '证件类型',
+    `gender`           int(11)              DEFAULT NULL COMMENT '性别',
+    `birthday`         timestamp   NULL     DEFAULT NULL COMMENT '生日',
+    `job_number`       varchar(80)          DEFAULT NULL COMMENT '工号',
+    `person_type`      varchar(10)          DEFAULT NULL COMMENT '员工类型',
+    `user_from`        varchar(80)          DEFAULT NULL COMMENT '账号来源',
+    `leader`           bigint(20)           DEFAULT NULL COMMENT '直接领导',
+    `remark`           varchar(500)         DEFAULT NULL COMMENT '备注',
+    `profession`       text COMMENT '专业',
+    `ts`               timestamp   NULL     DEFAULT NULL COMMENT '乐观锁',
+    `creation_time`    timestamp   NULL     DEFAULT NULL COMMENT '创建时间',
+    `creator`          varchar(80)          DEFAULT NULL COMMENT '创建用户',
+    `modifier`         varchar(80)          DEFAULT NULL COMMENT '更新用户',
+    `modified_time`    timestamp   NULL     DEFAULT NULL COMMENT '更新时间',
+    `valid`            int(11)              DEFAULT NULL COMMENT '合法标识',
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='人员';
 
-CREATE TABLE IF NOT EXISTS `department` (
-  `id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'id',
-  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '部门名称',
-  `type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '部门类型',
-  `parent_id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0' COMMENT '上级部门id',
-  `resource_from` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0' COMMENT '数据来源',
-  `managers` text COLLATE utf8mb4_unicode_ci COMMENT '负责人',
-  `full_path` text COLLATE utf8mb4_unicode_ci COMMENT '部门全路径',
-  `staff_count` int(11) NOT NULL DEFAULT '0' COMMENT '编制人数',
-  `project_ids` json DEFAULT NULL COMMENT '关联的项目',
-  `ts` timestamp NULL DEFAULT NULL COMMENT '乐观锁',
-  `creator` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '创建人',
-  `creation_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
-  `modifier` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '最后修改人',
-  `modified_time` datetime DEFAULT NULL COMMENT '最后修改时间',
-  `valid` int(11) DEFAULT NULL COMMENT '合法标识',
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='部门';
 
-CREATE TABLE IF NOT EXISTS `dep_project` (
-  `id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '主键',
-  `dep_id` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '部门id',
-  `project_id` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '项目id',
-  `ts` timestamp NULL DEFAULT NULL COMMENT '乐观锁',
-  `creator` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '创建人',
-  `creation_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
-  `modifier` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '最后修改人',
-  `modified_time` datetime DEFAULT NULL COMMENT '最后修改时间',
-  `valid` int(11) DEFAULT NULL COMMENT '合法标识',
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='部门项目';
+CREATE TABLE IF NOT EXISTS `profession`
+(
+    `id`            varchar(64) NOT NULL DEFAULT '' COMMENT '主键',
+    `name`          varchar(20) NOT NULL DEFAULT '' COMMENT '专业名称',
+    `editable`      char(11)    NOT NULL DEFAULT '' COMMENT '是否可编辑',
+    `ts`            timestamp   NULL     DEFAULT NULL COMMENT '乐观锁',
+    `creator`       varchar(32)          DEFAULT NULL COMMENT '创建人',
+    `creation_time` timestamp   NULL     DEFAULT NULL COMMENT '创建时间',
+    `modifier`      varchar(32)          DEFAULT NULL COMMENT '最后修改人',
+    `modified_time` datetime             DEFAULT NULL COMMENT '最后修改时间',
+    `valid`         int(11)              DEFAULT NULL COMMENT '合法标识',
+    PRIMARY KEY (`id`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='专业';
 
 
-CREATE TABLE IF NOT EXISTS `person` (
-  `id` varchar(64) NOT NULL DEFAULT '' COMMENT 'id',
-  `name` varchar(80) DEFAULT NULL COMMENT '姓名',
-  `name_pinyin` varchar(200) DEFAULT NULL COMMENT '姓名拼音',
-  `username` varchar(80) DEFAULT NULL COMMENT '账号',
-  `account_id` varchar(80) DEFAULT NULL COMMENT '账号id',
-  `id_number` varchar(80) DEFAULT NULL COMMENT '证件号码',
-  `certificate_type` varchar(10) DEFAULT NULL COMMENT '证件类型',
-  `gender` int(11) DEFAULT NULL COMMENT '性别',
-  `birthday` timestamp NULL DEFAULT NULL COMMENT '生日',
-  `job_number` varchar(80) DEFAULT NULL COMMENT '工号',
-  `person_type` varchar(10) DEFAULT NULL COMMENT '员工类型',
-  `user_from` varchar(80) DEFAULT NULL COMMENT '账号来源',
-  `leader` bigint(20) DEFAULT NULL COMMENT '直接领导',
-  `remark` varchar(500) DEFAULT NULL COMMENT '备注',
-  `profession` text COMMENT '专业',
-  `ts` timestamp NULL DEFAULT NULL COMMENT '乐观锁',
-  `creation_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
-  `creator` varchar(80) DEFAULT NULL COMMENT '创建用户',
-  `modifier` varchar(80) DEFAULT NULL COMMENT '更新用户',
-  `modified_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
-  `valid` int(11) DEFAULT NULL COMMENT '合法标识',
-  PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='人员';
-
-CREATE TABLE IF NOT EXISTS `profession` (
-  `id` varchar(64) NOT NULL DEFAULT '' COMMENT '主键',
-  `name` varchar(20) NOT NULL DEFAULT '' COMMENT '专业名称',
-  `editable` char(11) NOT NULL DEFAULT '' COMMENT '是否可编辑',
-  `ts` timestamp NULL DEFAULT NULL COMMENT '乐观锁',
-  `creator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '创建人',
-  `creation_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
-  `modifier` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '最后修改人',
-  `modified_time` datetime DEFAULT NULL COMMENT '最后修改时间',
-  `valid` int(11) DEFAULT NULL COMMENT '合法标识',
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='专业';
-
-CREATE TABLE IF NOT EXISTS `work_resume` (
-  `id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'id',
-  `person_id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '人员主键',
-  `dep_id` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '部门主键',
-  `state` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0' COMMENT '状态',
-  `hired_date` timestamp NULL DEFAULT NULL COMMENT '入职时间',
-  `departure_date` timestamp NULL DEFAULT NULL COMMENT '离职时间',
-  `is_leader` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '是否是部门主管',
-  `ts` timestamp NULL DEFAULT NULL COMMENT '乐观锁',
-  `creator` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '创建人',
-  `creation_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
-  `modifier` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '最后修改人',
-  `modified_time` datetime DEFAULT NULL COMMENT '最后修改时间',
-  `valid` int(11) DEFAULT NULL COMMENT '合法标识',
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='工作信息';
+CREATE TABLE IF NOT EXISTS `work_resume`
+(
+    `id`             varchar(64) NOT NULL DEFAULT '' COMMENT 'id',
+    `person_id`      varchar(64) NOT NULL DEFAULT '' COMMENT '人员主键',
+    `dep_id`         varchar(64) NOT NULL DEFAULT '' COMMENT '部门主键',
+    `state`          varchar(10) NOT NULL DEFAULT '0' COMMENT '状态',
+    `hired_date`     timestamp   NULL     DEFAULT NULL COMMENT '入职时间',
+    `departure_date` timestamp   NULL     DEFAULT NULL COMMENT '离职时间',
+    `is_leader`      varchar(10)          DEFAULT NULL COMMENT '是否是部门主管',
+    `ts`             timestamp   NULL     DEFAULT NULL COMMENT '乐观锁',
+    `creator`        varchar(32)          DEFAULT NULL COMMENT '创建人',
+    `creation_time`  timestamp   NULL     DEFAULT NULL COMMENT '创建时间',
+    `modifier`       varchar(32)          DEFAULT NULL COMMENT '最后修改人',
+    `modified_time`  datetime             DEFAULT NULL COMMENT '最后修改时间',
+    `valid`          int(11)              DEFAULT NULL COMMENT '合法标识',
+    PRIMARY KEY (`id`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='工作信息';

+ 0 - 16
fm-person/src/main/resources/mapper/ITranslateDao.xml

@@ -1,16 +0,0 @@
-<?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.persagy.fm.translate.dao.ITranslateDao">
-	<select id="findTransBySql" resultType="map">
-		${sql}
-	</select>
-	<select id="findBatchTransBySql" resultType="map">
-		${sql}
-		<foreach collection="parameter" index="index" item="item" open="(" separator="," close=")">
-			${item}
-		</foreach>
-	</select>
-</mapper>