Browse Source

暂存1

dev
yinzuomei 5 years ago
parent
commit
c80183c7cd
  1. 4
      epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
  2. 4
      epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java
  3. 6
      epmet-cloud-generator/src/main/resources/application.yml
  4. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerDepartmentDTO.java
  5. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java
  6. 34
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql
  7. 13
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffAgencyVisitedDTO.java
  8. 86
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffGridVisitedDTO.java
  9. 17
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java
  10. 39
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java
  11. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java
  12. 33
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java
  13. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffAgencyVisitedEntity.java
  14. 56
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffGridVisitedEntity.java
  15. 39
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java
  16. 95
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java
  17. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiRegisterVisitService.java
  18. 48
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java
  19. 99
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffGridVisitedServiceImpl.java
  20. 20
      epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql
  21. 6
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml
  22. 20
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml

4
epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

@ -85,7 +85,7 @@ public interface EpmetUserFeignClient {
* @Description 获取当前微信上次登录的账号信息
* @Date 2020/4/20 12:53
**/
@GetMapping(value = "epmetuser/staffagencyhistory/getlatest/{openId}")
@GetMapping(value = "epmetuser/staffagencyvisited/getlatest/{openId}")
Result<StaffLatestAgencyResultDTO> getLatestStaffWechatLoginRecord(@PathVariable("openId") String openId);
/**
@ -105,6 +105,6 @@ public interface EpmetUserFeignClient {
* @Description 保存登录日志
* @Date 2020/4/20 14:38
**/
@PostMapping(value = "epmetuser/staffagencyhistory/saveStaffLoginRecord", consumes = MediaType.APPLICATION_JSON_VALUE)
@PostMapping(value = "epmetuser/staffagencyvisited/saveStaffLoginRecord", consumes = MediaType.APPLICATION_JSON_VALUE)
Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO staffLoginHistoryFormDTO);
}

4
epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java

@ -149,7 +149,7 @@ public class GovLoginServiceImpl implements GovLoginService {
GovTokenDto govTokenDto = new GovTokenDto();
govTokenDto.setApp(LoginConstant.APP_GOV);
govTokenDto.setClient(LoginConstant.CLIENT_WXMP);
govTokenDto.setStaffId(staffLatestAgency.getStaffId());
govTokenDto.setUserId(staffLatestAgency.getStaffId());
govTokenDto.setOpenId(wxMaJscode2SessionResult.getOpenid());
govTokenDto.setSessionKey(wxMaJscode2SessionResult.getSessionKey());
govTokenDto.setUnionId(wxMaJscode2SessionResult.getUnionid());
@ -256,7 +256,7 @@ public class GovLoginServiceImpl implements GovLoginService {
GovTokenDto govTokenDto = new GovTokenDto();
govTokenDto.setApp(LoginConstant.APP_GOV);
govTokenDto.setClient(LoginConstant.CLIENT_WXMP);
govTokenDto.setStaffId(staffId);
govTokenDto.setUserId(staffId);
govTokenDto.setOpenId(wxMaJscode2SessionResult.getOpenid());
govTokenDto.setSessionKey(wxMaJscode2SessionResult.getSessionKey());
govTokenDto.setUnionId(wxMaJscode2SessionResult.getUnionid());

6
epmet-cloud-generator/src/main/resources/application.yml

@ -9,9 +9,9 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
#MySQL配置
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: epmet
password: elink@833066
url: jdbc:mysql://192.168.1.130:3306/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: epmet_dba
password: EpmEt-dbA-UsEr
#oracle配置
# driverClassName: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@192.168.10.10:1521:helowin

7
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerDepartmentDTO.java

@ -17,9 +17,10 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -44,9 +45,9 @@ public class CustomerDepartmentDTO implements Serializable {
private String customerId;
/**
* 所属组织机构IDcustomer_organization.id
* 所属组织机构IDcustomer_organization.idAGENCY_ID
*/
private String orgId;
private String agencyId;
/**
* 部门名称

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java

@ -18,13 +18,10 @@
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;
/**
* 客户部门表
*
@ -46,7 +43,7 @@ public class CustomerDepartmentEntity extends BaseEpmetEntity {
/**
* 所属组织机构IDcustomer_organization.id
*/
private String orgId;
private String agencyId;
/**
* 部门名称

34
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/epmet_gov_org.sql

@ -2,7 +2,7 @@ DROP TABLE IF EXISTS `customer_department`;
CREATE TABLE `customer_department` (
`ID` varchar(64) NOT NULL COMMENT 'ID 唯一标识',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`ORG_ID` varchar(64) NOT NULL COMMENT '所属组织机构ID(customer_organization.id)',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '所属机关ID(customer_agency.id)',
`DEPARTMENT_NAME` varchar(128) NOT NULL COMMENT '部门名称',
`DEPARTMENT_DUTY` varchar(255) NOT NULL COMMENT '部门职责',
`TOTAL_USER` int(11) NOT NULL COMMENT '总人数',
@ -12,19 +12,19 @@ CREATE TABLE `customer_department` (
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户部门表 ';
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='客户部门表 ';
-- -----------------------------------------------------------------------
-- -----------------------------------------------------------------------
DROP TABLE IF EXISTS `customer_organization`;
CREATE TABLE `customer_organization` (
DROP TABLE IF EXISTS `customer_agency`;
CREATE TABLE `customer_agency` (
`ID` varchar(64) NOT NULL COMMENT 'ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`PID` varchar(64) NOT NULL COMMENT '上级组织机构ID',
`PIDS` varchar(1024) NOT NULL COMMENT '所有上级组织机构ID(以英文:隔开)',
`ALL_PARENT_NAME` varchar(1024) DEFAULT NULL COMMENT '所有上级名称,以-连接',
`ORGANIZATION_NAME` varchar(64) NOT NULL COMMENT '组织名称',
`LEVEL` int(10) NOT NULL COMMENT '机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province)',
`LEVEL` varchar(30) NOT NULL COMMENT '机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province)',
`AREA_CODE` int(10) NOT NULL COMMENT '地区编码',
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识',
`REVISION` int(10) NOT NULL COMMENT '乐观锁',
@ -33,8 +33,8 @@ CREATE TABLE `customer_organization` (
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
`TOTAL_USER` int(11) DEFAULT NULL COMMENT '总人数',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组织机构表 ';
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='机关单位信息表';
-- -----------------------------------------------------------------------
-- -----------------------------------------------------------------------
DROP TABLE IF EXISTS `customer_staff_department`;
@ -49,8 +49,8 @@ CREATE TABLE `customer_staff_department` (
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门人员关系表 ';
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='部门人员关系表 ';
-- -----------------------------------------------------------------------
-- -----------------------------------------------------------------------
@ -66,24 +66,24 @@ CREATE TABLE `customer_staff_grid` (
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网格人员关系表 ';
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='网格人员关系表 ';
-- -----------------------------------------------------------------------
-- -----------------------------------------------------------------------
DROP TABLE IF EXISTS `customer_staff_organization`;
CREATE TABLE `customer_staff_organization` (
DROP TABLE IF EXISTS `customer_staff_agency`;
CREATE TABLE `customer_staff_agency` (
`ID` varchar(64) NOT NULL COMMENT 'ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`USER_ID` varchar(64) NOT NULL COMMENT '用户ID',
`ORG_ID` varchar(64) NOT NULL COMMENT '组织机构ID customer_organization.id',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '组织机构ID customer_agency.id',
`DEL_FLAG` int(10) NOT NULL COMMENT '删除标识',
`REVISION` int(10) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组织人员关系表 ';
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='人员-机关单位关系表';
-- -----------------------------------------------------------------------
-- -----------------------------------------------------------------------

13
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffAgencyHistoryDTO.java → epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffAgencyVisitedDTO.java

@ -17,20 +17,19 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 工作人员登录组织日志表
* 工作人员进入组织日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
* @since v1.0.0 2020-04-21
*/
@Data
public class StaffAgencyHistoryDTO implements Serializable {
public class StaffAgencyVisitedDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ -60,9 +59,9 @@ public class StaffAgencyHistoryDTO implements Serializable {
private String mobile;
/**
* 组织机构id
* 机关单位id来源于customer_agency.id
*/
private String orgId;
private String agencyId;
/**
* 删除标识0.未删除 1.已删除

86
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StaffGridVisitedDTO.java

@ -0,0 +1,86 @@
/**
* 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;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 工作人员进入网格日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-21
*/
@Data
public class StaffGridVisitedDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* customer_staff.userId
*/
private String staffId;
/**
* 删除标识0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间,登录时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

17
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyHistoryController.java → epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java

@ -20,24 +20,23 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO;
import com.epmet.dto.result.StaffLatestAgencyResultDTO;
import com.epmet.service.StaffAgencyHistoryService;
import com.epmet.service.StaffAgencyVisitedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 工作人员登录组织日志表
* 工作人员进入组织日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
* @since v1.0.0 2020-04-21
*/
@RestController
@RequestMapping("staffagencyhistory")
public class StaffAgencyHistoryController {
@RequestMapping("staffagencyvisited")
public class StaffAgencyVisitedController {
@Autowired
private StaffAgencyHistoryService staffAgencyHistoryService;
private StaffAgencyVisitedService staffAgencyVisitedService;
/**
* @param openId
@ -48,7 +47,7 @@ public class StaffAgencyHistoryController {
**/
@GetMapping(value = "getlatest/{openId}")
public Result<StaffLatestAgencyResultDTO> getLatestStaffWechatLoginRecord(@PathVariable("openId") String openId) {
return staffAgencyHistoryService.getLatestStaffWechatLoginRecord(openId);
return staffAgencyVisitedService.getLatestStaffWechatLoginRecord(openId);
}
/**
@ -60,6 +59,6 @@ public class StaffAgencyHistoryController {
**/
@PostMapping(value = "saveStaffLoginRecord")
public Result saveStaffLoginRecord(@RequestBody StaffLoginAgencyRecordFormDTO formDTO) {
return staffAgencyHistoryService.saveStaffLoginRecord(formDTO);
return staffAgencyVisitedService.saveStaffLoginRecord(formDTO);
}
}

39
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffGridVisitedController.java

@ -0,0 +1,39 @@
/**
* 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.controller;
import com.epmet.service.StaffGridVisitedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 工作人员进入网格日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-21
*/
@RestController
@RequestMapping("staffgridvisited")
public class StaffGridVisitedController {
@Autowired
private StaffGridVisitedService staffGridVisitedService;
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyHistoryDao.java → epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java

@ -19,17 +19,17 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.StaffLatestAgencyResultDTO;
import com.epmet.entity.StaffAgencyHistoryEntity;
import com.epmet.entity.StaffAgencyVisitedEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 工作人员登录组织日志表
* 工作人员进入组织日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
* @since v1.0.0 2020-04-21
*/
@Mapper
public interface StaffAgencyHistoryDao extends BaseDao<StaffAgencyHistoryEntity> {
public interface StaffAgencyVisitedDao extends BaseDao<StaffAgencyVisitedEntity> {
/**
* @param openId
* @return com.epmet.dto.result.LatestStaffWechatLoginDTO

33
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java

@ -0,0 +1,33 @@
/**
* 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.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.StaffGridVisitedEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 工作人员进入网格日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-21
*/
@Mapper
public interface StaffGridVisitedDao extends BaseDao<StaffGridVisitedEntity> {
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffAgencyHistoryEntity.java → epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffAgencyVisitedEntity.java

@ -26,15 +26,15 @@ import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 工作人员登录组织日志表
* 工作人员进入组织日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
* @since v1.0.0 2020-04-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("staff_agency_history")
public class StaffAgencyHistoryEntity extends BaseEpmetEntity {
@TableName("staff_agency_visited")
public class StaffAgencyVisitedEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
@ -59,8 +59,8 @@ public class StaffAgencyHistoryEntity extends BaseEpmetEntity {
private String mobile;
/**
* 组织机构id
* 机关单位id来源于customer_agency.id
*/
private String orgId;
private String agencyId;
}

56
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffGridVisitedEntity.java

@ -0,0 +1,56 @@
/**
* 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.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 2020-04-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("staff_grid_visited")
public class StaffGridVisitedEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* customer_staff.userId
*/
private String staffId;
}

39
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyHistoryService.java → epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java

@ -20,51 +20,51 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StaffAgencyHistoryDTO;
import com.epmet.dto.StaffAgencyVisitedDTO;
import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO;
import com.epmet.dto.result.StaffLatestAgencyResultDTO;
import com.epmet.entity.StaffAgencyHistoryEntity;
import com.epmet.entity.StaffAgencyVisitedEntity;
import java.util.List;
import java.util.Map;
/**
* 工作人员登录组织日志表
* 工作人员进入组织日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
* @since v1.0.0 2020-04-21
*/
public interface StaffAgencyHistoryService extends BaseService<StaffAgencyHistoryEntity> {
public interface StaffAgencyVisitedService extends BaseService<StaffAgencyVisitedEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<StaffAgencyHistoryDTO>
* @return PageData<StaffAgencyVisitedDTO>
* @author generator
* @date 2020-04-20
* @date 2020-04-21
*/
PageData<StaffAgencyHistoryDTO> page(Map<String, Object> params);
PageData<StaffAgencyVisitedDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<StaffAgencyHistoryDTO>
* @return java.util.List<StaffAgencyVisitedDTO>
* @author generator
* @date 2020-04-20
* @date 2020-04-21
*/
List<StaffAgencyHistoryDTO> list(Map<String, Object> params);
List<StaffAgencyVisitedDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return StaffAgencyHistoryDTO
* @return StaffAgencyVisitedDTO
* @author generator
* @date 2020-04-20
* @date 2020-04-21
*/
StaffAgencyHistoryDTO get(String id);
StaffAgencyVisitedDTO get(String id);
/**
* 默认保存
@ -72,9 +72,9 @@ public interface StaffAgencyHistoryService extends BaseService<StaffAgencyHistor
* @param dto
* @return void
* @author generator
* @date 2020-04-20
* @date 2020-04-21
*/
void save(StaffAgencyHistoryDTO dto);
void save(StaffAgencyVisitedDTO dto);
/**
* 默认更新
@ -82,9 +82,9 @@ public interface StaffAgencyHistoryService extends BaseService<StaffAgencyHistor
* @param dto
* @return void
* @author generator
* @date 2020-04-20
* @date 2020-04-21
*/
void update(StaffAgencyHistoryDTO dto);
void update(StaffAgencyVisitedDTO dto);
/**
* 批量删除
@ -92,11 +92,10 @@ public interface StaffAgencyHistoryService extends BaseService<StaffAgencyHistor
* @param ids
* @return void
* @author generator
* @date 2020-04-20
* @date 2020-04-21
*/
void delete(String[] ids);
/**
* @param openId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.LatestStaffWechatLoginDTO>

95
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffGridVisitedService.java

@ -0,0 +1,95 @@
/**
* 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.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.StaffGridVisitedDTO;
import com.epmet.entity.StaffGridVisitedEntity;
import java.util.List;
import java.util.Map;
/**
* 工作人员进入网格日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-21
*/
public interface StaffGridVisitedService extends BaseService<StaffGridVisitedEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<StaffGridVisitedDTO>
* @author generator
* @date 2020-04-21
*/
PageData<StaffGridVisitedDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<StaffGridVisitedDTO>
* @author generator
* @date 2020-04-21
*/
List<StaffGridVisitedDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return StaffGridVisitedDTO
* @author generator
* @date 2020-04-21
*/
StaffGridVisitedDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-04-21
*/
void save(StaffGridVisitedDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-04-21
*/
void update(StaffGridVisitedDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-04-21
*/
void delete(String[] ids);
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiRegisterVisitService.java

@ -19,12 +19,10 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.UserResiRegisterVisitDTO;
import com.epmet.dto.form.ResiRegisterFormDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.VerificationCodeFormDTO;
import com.epmet.dto.result.ResiRegisterResultDTO;
import com.epmet.entity.UserResiRegisterVisitEntity;

48
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyHistoryServiceImpl.java → epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java

@ -24,12 +24,12 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.StaffAgencyHistoryDao;
import com.epmet.dto.StaffAgencyHistoryDTO;
import com.epmet.dao.StaffAgencyVisitedDao;
import com.epmet.dto.StaffAgencyVisitedDTO;
import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO;
import com.epmet.dto.result.StaffLatestAgencyResultDTO;
import com.epmet.entity.StaffAgencyHistoryEntity;
import com.epmet.service.StaffAgencyHistoryService;
import com.epmet.entity.StaffAgencyVisitedEntity;
import com.epmet.service.StaffAgencyVisitedService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -41,57 +41,57 @@ import java.util.List;
import java.util.Map;
/**
* 工作人员登录组织日志表
* 工作人员进入组织日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
* @since v1.0.0 2020-04-21
*/
@Service
public class StaffAgencyHistoryServiceImpl extends BaseServiceImpl<StaffAgencyHistoryDao, StaffAgencyHistoryEntity> implements StaffAgencyHistoryService {
private static final Logger logger = LoggerFactory.getLogger(StaffAgencyHistoryServiceImpl.class);
public class StaffAgencyVisitedServiceImpl extends BaseServiceImpl<StaffAgencyVisitedDao, StaffAgencyVisitedEntity> implements StaffAgencyVisitedService {
private static final Logger logger = LoggerFactory.getLogger(StaffAgencyVisitedServiceImpl.class);
@Override
public PageData<StaffAgencyHistoryDTO> page(Map<String, Object> params) {
IPage<StaffAgencyHistoryEntity> page = baseDao.selectPage(
public PageData<StaffAgencyVisitedDTO> page(Map<String, Object> params) {
IPage<StaffAgencyVisitedEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, StaffAgencyHistoryDTO.class);
return getPageData(page, StaffAgencyVisitedDTO.class);
}
@Override
public List<StaffAgencyHistoryDTO> list(Map<String, Object> params) {
List<StaffAgencyHistoryEntity> entityList = baseDao.selectList(getWrapper(params));
public List<StaffAgencyVisitedDTO> list(Map<String, Object> params) {
List<StaffAgencyVisitedEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, StaffAgencyHistoryDTO.class);
return ConvertUtils.sourceToTarget(entityList, StaffAgencyVisitedDTO.class);
}
private QueryWrapper<StaffAgencyHistoryEntity> getWrapper(Map<String, Object> params){
private QueryWrapper<StaffAgencyVisitedEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<StaffAgencyHistoryEntity> wrapper = new QueryWrapper<>();
QueryWrapper<StaffAgencyVisitedEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public StaffAgencyHistoryDTO get(String id) {
StaffAgencyHistoryEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, StaffAgencyHistoryDTO.class);
public StaffAgencyVisitedDTO get(String id) {
StaffAgencyVisitedEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, StaffAgencyVisitedDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(StaffAgencyHistoryDTO dto) {
StaffAgencyHistoryEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyHistoryEntity.class);
public void save(StaffAgencyVisitedDTO dto) {
StaffAgencyVisitedEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyVisitedEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(StaffAgencyHistoryDTO dto) {
StaffAgencyHistoryEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyHistoryEntity.class);
public void update(StaffAgencyVisitedDTO dto) {
StaffAgencyVisitedEntity entity = ConvertUtils.sourceToTarget(dto, StaffAgencyVisitedEntity.class);
updateById(entity);
}
@ -114,7 +114,7 @@ public class StaffAgencyHistoryServiceImpl extends BaseServiceImpl<StaffAgencyHi
@Override
public Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO formDTO) {
StaffAgencyHistoryEntity entity = ConvertUtils.sourceToTarget(formDTO, StaffAgencyHistoryEntity.class);
StaffAgencyVisitedEntity entity = ConvertUtils.sourceToTarget(formDTO, StaffAgencyVisitedEntity.class);
insert(entity);
return new Result();
}

99
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffGridVisitedServiceImpl.java

@ -0,0 +1,99 @@
/**
* 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.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.StaffGridVisitedDao;
import com.epmet.dto.StaffGridVisitedDTO;
import com.epmet.entity.StaffGridVisitedEntity;
import com.epmet.service.StaffGridVisitedService;
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 2020-04-21
*/
@Service
public class StaffGridVisitedServiceImpl extends BaseServiceImpl<StaffGridVisitedDao, StaffGridVisitedEntity> implements StaffGridVisitedService {
@Override
public PageData<StaffGridVisitedDTO> page(Map<String, Object> params) {
IPage<StaffGridVisitedEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, StaffGridVisitedDTO.class);
}
@Override
public List<StaffGridVisitedDTO> list(Map<String, Object> params) {
List<StaffGridVisitedEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, StaffGridVisitedDTO.class);
}
private QueryWrapper<StaffGridVisitedEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<StaffGridVisitedEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public StaffGridVisitedDTO get(String id) {
StaffGridVisitedEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, StaffGridVisitedDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(StaffGridVisitedDTO dto) {
StaffGridVisitedEntity entity = ConvertUtils.sourceToTarget(dto, StaffGridVisitedEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(StaffGridVisitedDTO dto) {
StaffGridVisitedEntity entity = ConvertUtils.sourceToTarget(dto, StaffGridVisitedEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

20
epmet-user/epmet-user-server/src/main/resources/db/migration/epmet_user.sql

@ -57,13 +57,13 @@ CREATE TABLE `staff_login_history` (
drop table if EXISTS staff_login_history;
CREATE TABLE `staff_agency_history` (
CREATE TABLE `staff_agency_visited` (
`ID` varchar(64) NOT NULL COMMENT '唯一标识',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`STAFF_ID` varchar(64) NOT NULL COMMENT 'customer_staff.userId',
`WX_OPEN_ID` varchar(64) NOT NULL COMMENT '微信openId',
`MOBILE` varchar(20) NOT NULL COMMENT '手机号',
`ORG_ID` varchar(64) NOT NULL COMMENT '组织机构id',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '机关单位id来源于customer_agency.id',
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
@ -71,4 +71,18 @@ CREATE TABLE `staff_agency_history` (
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人',
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员登录组织日志表';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员进入组织日志表';
CREATE TABLE `staff_grid_visited` (
`ID` varchar(64) NOT NULL COMMENT '唯一标识',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`GRID_ID` varchar(64) NOT NULL COMMENT '网格ID',
`STAFF_ID` varchar(64) NOT NULL COMMENT 'customer_staff.userId',
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间,登录时间',
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人',
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='工作人员进入网格日志表';

6
epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyHistoryDao.xml → epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml

@ -1,15 +1,15 @@
<?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.epmet.dao.StaffAgencyHistoryDao">
<mapper namespace="com.epmet.dao.StaffAgencyVisitedDao">
<resultMap type="com.epmet.entity.StaffAgencyHistoryEntity" id="staffAgencyHistoryMap">
<resultMap type="com.epmet.entity.StaffAgencyVisitedEntity" id="staffAgencyVisitedMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="staffId" column="STAFF_ID"/>
<result property="wxOpenId" column="WX_OPEN_ID"/>
<result property="mobile" column="MOBILE"/>
<result property="orgId" column="ORG_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>

20
epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml

@ -0,0 +1,20 @@
<?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.epmet.dao.StaffGridVisitedDao">
<resultMap type="com.epmet.entity.StaffGridVisitedEntity" id="staffGridVisitedMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="staffId" column="STAFF_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>
Loading…
Cancel
Save