Browse Source

Merge remote-tracking branch 'origin/dev_visit_group' into dev

dev_shibei_match
yinzuomei 4 years ago
parent
commit
8f45230cc3
  1. 7
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupDTO.java
  2. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupEntity.java
  3. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupStateConstant.java
  4. 23
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupVisitConstant.java
  5. 8
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupDTO.java
  6. 4
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java
  7. 16
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ManageInitFormDTO.java
  8. 16
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ManageInitResultDTO.java
  9. 92
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/GroupVisitRecordDTO.java
  10. 97
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/GroupVisitorDTO.java
  11. 25
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/UserAndGroupRelFormDTO.java
  12. 32
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/VisitFormDTO.java
  13. 20
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/GroupInfoResultDTO.java
  14. 21
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/UserAndGroupRelResultDTO.java
  15. 25
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/VisitResultDTO.java
  16. 25
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  17. 4
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java
  18. 18
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  19. 39
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  20. 80
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/GroupVisitorController.java
  21. 33
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/GroupVisitRecordDao.java
  22. 61
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/GroupVisitorDao.java
  23. 58
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/GroupVisitRecordEntity.java
  24. 66
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/GroupVisitorEntity.java
  25. 85
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/GroupVisitRecordService.java
  26. 107
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/GroupVisitorService.java
  27. 92
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupVisitRecordServiceImpl.java
  28. 179
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupVisitorServiceImpl.java
  29. 36
      epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.14__visit_group.sql
  30. 8
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/GroupVisitRecordDao.xml
  31. 35
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/GroupVisitorDao.xml
  32. 2
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml

7
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupDTO.java

@ -17,9 +17,10 @@
package com.epmet.dataaggre.dto.resigroup;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -109,4 +110,8 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审
*/
private Date updatedTime;
/**
* VISIT_SWITCH 小组是否允许参观:允许open;不允许closed
*/
private String visitSwitch;
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupEntity.java

@ -79,4 +79,8 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审
*/
private String auditSwitch;
/**
* VISIT_SWITCH 小组是否允许参观:允许open;不允许closed
*/
private String visitSwitch;
}

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupStateConstant.java

@ -57,4 +57,6 @@ public interface GroupStateConstant {
* 进组审核open开启close关闭
*/
String AUDIT_SWITCH_CLOSED = "close";
String CLOSED="closed";
}

23
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/GroupVisitConstant.java

@ -0,0 +1,23 @@
package com.epmet.resi.group.constant;
/**
* @Author zxc
* @DateTime 2021/4/7 下午1:47
* @DESC
*/
public interface GroupVisitConstant {
/**
* 小组是否允许参观:允许open;不允许closed
*/
String VISIT_SWITCH_OPEN = "open";
String VISIT_SWITCH_CLOSED = "closed";
/**
* 参观模式visit ; 已入组 in_group未知unknown
*/
String VISIT = "visit";
String VISIT_IN_GROUP = "in_group";
String VISIT_UNKNOWN = "unknown";
}

8
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupDTO.java

@ -17,9 +17,10 @@
package com.epmet.resi.group.dto.group;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -79,6 +80,11 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审
*/
private String auditSwitch;
/**
* VISIT_SWITCH 小组是否允许参观:允许open;不允许closed
*/
private String visitSwitch;
/**
* 删除标记 0未删除1已删除
*/

4
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java

@ -65,4 +65,8 @@ public class ApplyCreateGroupFormDTO implements Serializable {
@NotBlank(message = "app不能为空")
private String app;
/**
* 小组是否允许参观:允许open;不允许closed
*/
private String visitSwitch;
}

16
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ManageInitFormDTO.java

@ -0,0 +1,16 @@
package com.epmet.resi.group.dto.group.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/4/7 10:54
*/
@Data
public class ManageInitFormDTO implements Serializable {
private static final long serialVersionUID = -5535489295806473761L;
private String groupId;
}

16
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ManageInitResultDTO.java

@ -0,0 +1,16 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/4/7 10:55
*/
@Data
public class ManageInitResultDTO implements Serializable {
private static final long serialVersionUID = 2981099696943155870L;
private String visitSwitch;
}

92
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/GroupVisitRecordDTO.java

@ -0,0 +1,92 @@
/**
* 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.resi.group.dto.member;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 小组参观记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-07
*/
@Data
public class GroupVisitRecordDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键(点击参观加入记录)
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 小组所属网格id
*/
private String gridId;
/**
* 小组id
*/
private String groupId;
/**
* 用户id
*/
private String userId;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 当前访问用户id
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

97
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/GroupVisitorDTO.java

@ -0,0 +1,97 @@
/**
* 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.resi.group.dto.member;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 小组参观者记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-07
*/
@Data
public class GroupVisitorDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 小组id
*/
private String groupId;
/**
* 小组所属网格id
*/
private String gridId;
/**
* 用户id
*/
private String userId;
/**
* 最近一次访问的时间
*/
private Date latestVisitTime;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 当前操作人id即组长id
*/
private String createdBy;
/**
* 创建时间:第一次参观的时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

25
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/UserAndGroupRelFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.resi.group.dto.member.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/4/7 上午11:02
* @DESC
*/
@Data
public class UserAndGroupRelFormDTO implements Serializable {
private static final long serialVersionUID = -8406731503470703549L;
public interface UserAndGroupRelForm{}
@NotBlank(message = "小组ID不能为空",groups = UserAndGroupRelForm.class)
private String groupId;
@NotBlank(message = "tokenDto获取userId为空",groups = UserAndGroupRelForm.class)
private String userId;
}

32
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/VisitFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.resi.group.dto.member.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/4/7 上午10:49
* @DESC
*/
@Data
public class VisitFormDTO implements Serializable {
private static final long serialVersionUID = 3516659225931215600L;
public interface VisitForm{}
/**
* 小组ID
*/
@NotBlank(message = "小组ID不能为空",groups = VisitForm.class)
private String groupId;
@NotBlank(message = "tokenDto获取userId为空",groups = VisitForm.class)
private String userId;
@NotBlank(message = "tokenDto获取customerId为空",groups = VisitForm.class)
private String customerId;
}

20
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/GroupInfoResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.resi.group.dto.member.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/4/7 下午2:08
* @DESC
*/
@Data
public class GroupInfoResultDTO implements Serializable {
private static final long serialVersionUID = -6300305692117164080L;
private String visitSwitch;
private String gridId;
}

21
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/UserAndGroupRelResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.resi.group.dto.member.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/4/7 上午11:05
* @DESC
*/
@Data
public class UserAndGroupRelResultDTO implements Serializable {
private static final long serialVersionUID = 8162347909790178255L;
/**
* 参观模式visit ; 已入组 in_group未知unknown
*/
private String pattern;
}

25
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/VisitResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.resi.group.dto.member.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/4/7 上午10:52
* @DESC
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class VisitResultDTO implements Serializable {
private static final long serialVersionUID = -6532744066209112808L;
/**
* 小组是否允许参观:允许open;不允许closed
*/
private String visitSwitch;
}

25
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java

@ -477,4 +477,29 @@ public class ResiGroupController {
return new Result<HashMap<String, ResiGroupDTO>>().ok(resiGroupService.getGroupInfo(groupIds));
}
/**
* 小组管理-界面初始化
* @author zhaoqifeng
* @date 2021/4/7 10:56
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.group.dto.group.result.ManageInitResultDTO>
*/
@PostMapping("manageinit")
public Result<ManageInitResultDTO> manageInit(@RequestBody ManageInitFormDTO formDTO){
return new Result<ManageInitResultDTO>().ok(resiGroupService.manageInit(formDTO));
}
/**
* 小组管理-设置是否允许参观
* @author zhaoqifeng
* @date 2021/4/7 13:50
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("setvisitswitch")
public Result setVisitSwitch(@RequestBody ManageInitFormDTO formDTO){
resiGroupService.setVisitSwitch(formDTO);
return new Result();
}
}

4
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java

@ -79,4 +79,8 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审
*/
private String auditSwitch;
/**
* VISIT_SWITCH 小组是否允许参观:允许open;不允许closed
*/
private String visitSwitch;
}

18
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java

@ -352,4 +352,22 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
* @Date 2020/11/23 10:03
**/
HashMap<String, ResiGroupDTO> getGroupInfo(List<String> groupIds);
/**
* 小组管理-界面初始化
* @author zhaoqifeng
* @date 2021/4/7 10:57
* @param formDTO
* @return com.epmet.resi.group.dto.group.result.ManageInitResultDTO
*/
ManageInitResultDTO manageInit(ManageInitFormDTO formDTO);
/**
* 小组管理-设置是否允许参观
* @author zhaoqifeng
* @date 2021/4/7 13:50
* @param formDTO
* @return void
*/
void setVisitSwitch(ManageInitFormDTO formDTO);
}

39
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -517,6 +517,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
resiGroupEntity.setGroupIntroduction(applyCreateGroupFormDTO.getGroupIntroduction());
resiGroupEntity.setCreatedBy(applyCreateGroupFormDTO.getUserId());
resiGroupEntity.setState(GroupStateConstant.GROUP_UNDER_AUDITTING);
resiGroupEntity.setVisitSwitch(StringUtils.isNotBlank(applyCreateGroupFormDTO.getVisitSwitch()) ? applyCreateGroupFormDTO.getVisitSwitch() : GroupStateConstant.CLOSED);
return resiGroupEntity;
}
@ -1127,6 +1128,44 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
return maps;
}
/**
* 小组管理-界面初始化
*
* @param formDTO
* @return com.epmet.resi.group.dto.group.result.ManageInitResultDTO
* @author zhaoqifeng
* @date 2021/4/7 10:57
*/
@Override
public ManageInitResultDTO manageInit(ManageInitFormDTO formDTO) {
ManageInitResultDTO resultDTO = new ManageInitResultDTO();
ResiGroupDTO groupInfo = get(formDTO.getGroupId());
resultDTO.setVisitSwitch(groupInfo.getVisitSwitch());
return resultDTO;
}
/**
* 小组管理-设置是否允许参观
*
* @param formDTO
* @return void
* @author zhaoqifeng
* @date 2021/4/7 13:50
*/
@Override
public void setVisitSwitch(ManageInitFormDTO formDTO) {
ResiGroupDTO before = get(formDTO.getGroupId());
ResiGroupDTO after =ConvertUtils.sourceToTarget(before, ResiGroupDTO.class);
after.setId(formDTO.getGroupId());
if (GroupStateConstant.AUDIT_SWITCH_OPEN.equals(before.getVisitSwitch())) {
after.setVisitSwitch(GroupStateConstant.CLOSED);
} else {
after.setVisitSwitch(GroupStateConstant.AUDIT_SWITCH_OPEN);
}
update(after);
}
@Override
public GroupDetailResultDTO getGroupDetail(String groupId) {
GroupDetailResultDTO groupDetail = new GroupDetailResultDTO();

80
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/controller/GroupVisitorController.java

@ -0,0 +1,80 @@
/**
* 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.modules.member.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.modules.member.service.GroupVisitorService;
import com.epmet.resi.group.dto.member.form.UserAndGroupRelFormDTO;
import com.epmet.resi.group.dto.member.form.VisitFormDTO;
import com.epmet.resi.group.dto.member.result.UserAndGroupRelResultDTO;
import com.epmet.resi.group.dto.member.result.VisitResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 小组参观者记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-07
*/
@RestController
@RequestMapping("groupvisitor")
public class GroupVisitorController {
@Autowired
private GroupVisitorService groupVisitorService;
/**
* @Description 参观小组(记录日志)
* 推荐小组界面点击参观按钮调用此接口 如果开关开启的情况下需要记录到
* @Param formDTO
* @Param tokenDto
* @author zxc
* @date 2021/4/7 上午10:57
*/
@PostMapping("visit")
public Result<VisitResultDTO> visit(@RequestBody VisitFormDTO formDTO, @LoginUser TokenDto tokenDto) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, VisitFormDTO.VisitForm.class);
return new Result<VisitResultDTO>().ok(groupVisitorService.visit(formDTO));
}
/**
* @Description 获取当前在组模式发话题分享评论时调用
* 发表话题评论话题分享话题按下先调用此接口
* @Param formDTO
* @author zxc
* @date 2021/4/7 上午11:09
*/
@PostMapping("userandgrouprel")
public Result<UserAndGroupRelResultDTO> userAndGroupRel(@RequestBody UserAndGroupRelFormDTO formDTO,@LoginUser TokenDto tokenDto){
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, UserAndGroupRelFormDTO.UserAndGroupRelForm.class);
return new Result<UserAndGroupRelResultDTO>().ok(groupVisitorService.userAndGroupRel(formDTO));
}
}

33
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/GroupVisitRecordDao.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.modules.member.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.member.entity.GroupVisitRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 小组参观记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-07
*/
@Mapper
public interface GroupVisitRecordDao extends BaseDao<GroupVisitRecordEntity> {
}

61
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/GroupVisitorDao.java

@ -0,0 +1,61 @@
/**
* 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.modules.member.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.member.entity.GroupVisitorEntity;
import com.epmet.resi.group.dto.member.result.GroupInfoResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 小组参观者记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-07
*/
@Mapper
public interface GroupVisitorDao extends BaseDao<GroupVisitorEntity> {
/**
* @Description 查询小组是否允许参观:允许open;不允许closed
* @Param groupId
* @author zxc
* @date 2021/4/7 下午1:44
*/
GroupInfoResultDTO selectVisitSwitch(@Param("groupId")String groupId);
/**
* @Description 查询用户是否访问过此小组
* @Param userId
* @Param groupId
* @author zxc
* @date 2021/4/7 下午2:02
*/
Integer selectVisitCount(@Param("userId")String userId,@Param("groupId")String groupId);
/**
* @Description 更新最后一次访问时间
* @Param userId
* @Param groupId
* @author zxc
* @date 2021/4/7 下午2:13
*/
void updateLatestTime(@Param("userId")String userId,@Param("groupId")String groupId);
}

58
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/GroupVisitRecordEntity.java

@ -0,0 +1,58 @@
/**
* 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.modules.member.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 小组参观记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-07
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("group_visit_record")
public class GroupVisitRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 小组所属网格id
*/
private String gridId;
/**
* 小组id
*/
private String groupId;
/**
* 用户id
*/
private String userId;
}

66
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/GroupVisitorEntity.java

@ -0,0 +1,66 @@
/**
* 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.modules.member.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-04-07
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("group_visitor")
public class GroupVisitorEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 小组id
*/
private String groupId;
/**
* 小组所属网格id
*/
private String gridId;
/**
* 用户id
*/
private String userId;
/**
* 最近一次访问的时间
*/
private Date latestVisitTime;
}

85
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/GroupVisitRecordService.java

@ -0,0 +1,85 @@
/**
* 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.modules.member.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.modules.member.entity.GroupVisitRecordEntity;
import com.epmet.resi.group.dto.member.GroupVisitRecordDTO;
import java.util.List;
import java.util.Map;
/**
* 小组参观记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-07
*/
public interface GroupVisitRecordService extends BaseService<GroupVisitRecordEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<GroupVisitRecordDTO>
* @author generator
* @date 2021-04-07
*/
PageData<GroupVisitRecordDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<GroupVisitRecordDTO>
* @author generator
* @date 2021-04-07
*/
List<GroupVisitRecordDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return GroupVisitRecordDTO
* @author generator
* @date 2021-04-07
*/
GroupVisitRecordDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-04-07
*/
void save(GroupVisitRecordDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-04-07
*/
void update(GroupVisitRecordDTO dto);
}

107
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/GroupVisitorService.java

@ -0,0 +1,107 @@
/**
* 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.modules.member.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.modules.member.entity.GroupVisitorEntity;
import com.epmet.resi.group.dto.member.GroupVisitorDTO;
import com.epmet.resi.group.dto.member.form.UserAndGroupRelFormDTO;
import com.epmet.resi.group.dto.member.form.VisitFormDTO;
import com.epmet.resi.group.dto.member.result.UserAndGroupRelResultDTO;
import com.epmet.resi.group.dto.member.result.VisitResultDTO;
import java.util.List;
import java.util.Map;
/**
* 小组参观者记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-07
*/
public interface GroupVisitorService extends BaseService<GroupVisitorEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<GroupVisitorDTO>
* @author generator
* @date 2021-04-07
*/
PageData<GroupVisitorDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<GroupVisitorDTO>
* @author generator
* @date 2021-04-07
*/
List<GroupVisitorDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return GroupVisitorDTO
* @author generator
* @date 2021-04-07
*/
GroupVisitorDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-04-07
*/
void save(GroupVisitorDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-04-07
*/
void update(GroupVisitorDTO dto);
/**
* @Description 参观小组(记录日志)
* 推荐小组界面点击参观按钮调用此接口 如果开关开启的情况下需要记录到
* @Param formDTO
* @author zxc
* @date 2021/4/7 上午10:58
*/
VisitResultDTO visit( VisitFormDTO formDTO);
/**
* @Description 获取当前在组模式发话题分享评论时调用
* 发表话题评论话题分享话题按下先调用此接口
* @Param formDTO
* @author zxc
* @date 2021/4/7 上午11:09
*/
UserAndGroupRelResultDTO userAndGroupRel(UserAndGroupRelFormDTO formDTO);
}

92
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupVisitRecordServiceImpl.java

@ -0,0 +1,92 @@
/**
* 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.modules.member.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.modules.member.dao.GroupVisitRecordDao;
import com.epmet.modules.member.entity.GroupVisitRecordEntity;
import com.epmet.modules.member.service.GroupVisitRecordService;
import com.epmet.resi.group.dto.member.GroupVisitRecordDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* 小组参观记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-07
*/
@Service
public class GroupVisitRecordServiceImpl extends BaseServiceImpl<GroupVisitRecordDao, GroupVisitRecordEntity> implements GroupVisitRecordService {
@Override
public PageData<GroupVisitRecordDTO> page(Map<String, Object> params) {
IPage<GroupVisitRecordEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, GroupVisitRecordDTO.class);
}
@Override
public List<GroupVisitRecordDTO> list(Map<String, Object> params) {
List<GroupVisitRecordEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, GroupVisitRecordDTO.class);
}
private QueryWrapper<GroupVisitRecordEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<GroupVisitRecordEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public GroupVisitRecordDTO get(String id) {
GroupVisitRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, GroupVisitRecordDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(GroupVisitRecordDTO dto) {
GroupVisitRecordEntity entity = ConvertUtils.sourceToTarget(dto, GroupVisitRecordEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(GroupVisitRecordDTO dto) {
GroupVisitRecordEntity entity = ConvertUtils.sourceToTarget(dto, GroupVisitRecordEntity.class);
updateById(entity);
}
}

179
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupVisitorServiceImpl.java

@ -0,0 +1,179 @@
/**
* 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.modules.member.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.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.modules.group.service.ResiGroupService;
import com.epmet.modules.member.dao.GroupVisitRecordDao;
import com.epmet.modules.member.dao.GroupVisitorDao;
import com.epmet.modules.member.entity.GroupVisitRecordEntity;
import com.epmet.modules.member.entity.GroupVisitorEntity;
import com.epmet.modules.member.service.GroupVisitorService;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.resi.group.constant.GroupVisitConstant;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.member.GroupVisitorDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.member.form.UserAndGroupRelFormDTO;
import com.epmet.resi.group.dto.member.form.VisitFormDTO;
import com.epmet.resi.group.dto.member.result.GroupInfoResultDTO;
import com.epmet.resi.group.dto.member.result.UserAndGroupRelResultDTO;
import com.epmet.resi.group.dto.member.result.VisitResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 小组参观者记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-07
*/
@Service
public class GroupVisitorServiceImpl extends BaseServiceImpl<GroupVisitorDao, GroupVisitorEntity> implements GroupVisitorService {
@Autowired
private GroupVisitRecordDao groupVisitRecordDao;
@Autowired
private ResiGroupService resiGroupService;
@Autowired
private ResiGroupMemberService resiGroupMemberService;
@Override
public PageData<GroupVisitorDTO> page(Map<String, Object> params) {
IPage<GroupVisitorEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, GroupVisitorDTO.class);
}
@Override
public List<GroupVisitorDTO> list(Map<String, Object> params) {
List<GroupVisitorEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, GroupVisitorDTO.class);
}
private QueryWrapper<GroupVisitorEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<GroupVisitorEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public GroupVisitorDTO get(String id) {
GroupVisitorEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, GroupVisitorDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(GroupVisitorDTO dto) {
GroupVisitorEntity entity = ConvertUtils.sourceToTarget(dto, GroupVisitorEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(GroupVisitorDTO dto) {
GroupVisitorEntity entity = ConvertUtils.sourceToTarget(dto, GroupVisitorEntity.class);
updateById(entity);
}
/**
* @Description 参观小组(记录日志)
* 推荐小组界面点击参观按钮调用此接口 如果开关开启的情况下需要记录到
* @Param formDTO
* @author zxc
* @date 2021/4/7 上午10:58
*/
@Override
@Transactional(rollbackFor = Exception.class)
public VisitResultDTO visit(VisitFormDTO formDTO) {
// 查询小组是否允许参观,open:允许,closed:不允许
GroupInfoResultDTO visitSwitch = baseDao.selectVisitSwitch(formDTO.getGroupId());
if (null == visitSwitch || (null != visitSwitch && StringUtils.isNotEmpty(visitSwitch.getVisitSwitch()) && visitSwitch.equals(GroupVisitConstant.VISIT_SWITCH_CLOSED))){
return new VisitResultDTO(visitSwitch.getVisitSwitch());
}
Integer visitCount = baseDao.selectVisitCount(formDTO.getUserId(), formDTO.getGroupId());
if (visitCount > NumConstant.ZERO){
// 已存在记录,更新最近一次访问时间
baseDao.updateLatestTime(formDTO.getUserId(),formDTO.getGroupId());
}else {
// 插入一条新纪录
GroupVisitorEntity entity = new GroupVisitorEntity();
entity.setLatestVisitTime(new Date());
entity.setCustomerId(formDTO.getCustomerId());
entity.setGridId(visitSwitch.getGridId());
entity.setGroupId(formDTO.getGroupId());
entity.setUserId(formDTO.getUserId());
baseDao.insert(entity);
}
GroupVisitRecordEntity groupVisitRecordEntity = new GroupVisitRecordEntity();
groupVisitRecordEntity.setCustomerId(formDTO.getCustomerId());
groupVisitRecordEntity.setGridId(visitSwitch.getGridId());
groupVisitRecordEntity.setGroupId(formDTO.getGroupId());
groupVisitRecordEntity.setUserId(formDTO.getUserId());
groupVisitRecordDao.insert(groupVisitRecordEntity);
return new VisitResultDTO(visitSwitch.getVisitSwitch());
}
/**
* @Description 获取当前在组模式发话题分享评论时调用
* 发表话题评论话题分享话题按下先调用此接口
* @Param formDTO
* @author zxc
* @date 2021/4/7 上午11:09
*/
@Override
public UserAndGroupRelResultDTO userAndGroupRel(UserAndGroupRelFormDTO formDTO) {
ResiGroupDTO resiGroupDTO = resiGroupService.get(formDTO.getGroupId());
if (null == resiGroupDTO) {
throw new RenException(EpmetErrorCode.GROUP_NOT_EXISTS.getCode(), EpmetErrorCode.GROUP_NOT_EXISTS.getMsg());
}
UserAndGroupRelResultDTO result = new UserAndGroupRelResultDTO();
result.setPattern(GroupVisitConstant.VISIT_UNKNOWN);
ResiGroupMemberDTO resiGroupMemberDTO = resiGroupMemberService.getResiGroupMember(formDTO.getGroupId(), formDTO.getUserId());
if (null != resiGroupMemberDTO) {
result.setPattern(GroupVisitConstant.VISIT_IN_GROUP);
} else {
if (baseDao.selectVisitCount(formDTO.getUserId(), formDTO.getGroupId()) > NumConstant.ZERO) {
result.setPattern(GroupVisitConstant.VISIT);
}
}
return result;
}
}

36
epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.14__visit_group.sql

@ -0,0 +1,36 @@
DROP TABLE IF EXISTS `group_visitor`;
CREATE TABLE `group_visitor` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`GROUP_ID` varchar(64) NOT NULL COMMENT '小组id',
`GRID_ID` varchar(64) NOT NULL COMMENT '小组所属网格id',
`USER_ID` varchar(64) NOT NULL COMMENT '用户id',
`LATEST_VISIT_TIME` datetime NOT NULL COMMENT '最近一次访问的时间',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识',
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '当前操作人id即组长id',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次参观的时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小组参观者记录';
DROP TABLE IF EXISTS `group_visit_record`;
CREATE TABLE `group_visit_record` (
`ID` varchar(64) NOT NULL COMMENT '主键(点击参观,加入记录)',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`GRID_ID` varchar(64) NOT NULL COMMENT '小组所属网格id',
`GROUP_ID` varchar(64) NOT NULL COMMENT '小组id',
`USER_ID` varchar(64) NOT NULL COMMENT '用户id',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识',
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '当前访问用户id',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小组参观记录表';
alter table resi_group add COLUMN VISIT_SWITCH VARCHAR(6)
NOT NULL DEFAULT 'closed' comment '小组是否允许参观:允许:open;不允许:closed' AFTER AUDIT_SWITCH;

8
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/GroupVisitRecordDao.xml

@ -0,0 +1,8 @@
<?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.modules.member.dao.GroupVisitRecordDao">
</mapper>

35
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/GroupVisitorDao.xml

@ -0,0 +1,35 @@
<?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.modules.member.dao.GroupVisitorDao">
<!-- 更新最后一次访问时间 -->
<update id="updateLatestTime">
UPDATE group_visitor
SET latest_visit_time = NOW(),UPDATED_TIME=NOW()
WHERE DEL_FLAG = '0'
AND GROUP_ID = #{groupId}
AND user_id = #{userId}
</update>
<!-- 查询小组是否允许参观:允许:open;不允许:closed -->
<select id="selectVisitSwitch" resultType="com.epmet.resi.group.dto.member.result.GroupInfoResultDTO">
SELECT
visit_switch,
grid_id
FROM resi_group
WHERE DEL_FLAG = '0'
AND ID = #{groupId}
</select>
<!-- 查询用户是否访问过此小组 -->
<select id="selectVisitCount" resultType="java.lang.Integer">
SELECT
COUNT(ID)
FROM group_visitor
WHERE DEL_FLAG = '0'
AND GROUP_ID = #{groupId}
AND user_id = #{userId}
</select>
</mapper>

2
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml

@ -162,7 +162,7 @@
WHERE DEL_FLAG = '0'
AND CUSTOMER_USER_ID = #{userId}
AND RESI_GROUP_ID = #{groupId}
AND `STATUS` = 'approved'
AND `STATUS` != 'removed'
</select>
<!-- 修改群成员关系数据状态 -->

Loading…
Cancel
Save