wxz 3 years ago
parent
commit
29cfd22128
  1. 1
      epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java
  2. 100
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCommentDTO.java
  3. 18
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCommentPageFormDTO.java
  4. 61
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCommentController.java
  5. 20
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCommentDao.java
  6. 54
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCommentEntity.java
  7. 37
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCommentService.java
  8. 72
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCommentServiceImpl.java
  9. 16
      epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.21__issue_comment.sql
  10. 36
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCommentDao.xml
  11. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java
  12. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java
  13. 34
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java
  14. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java
  15. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java
  16. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java
  17. 50
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java
  18. 8
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.48__ic_property_management.sql
  19. 19
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml
  20. 3
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  21. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java
  22. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java

1
epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java

@ -198,6 +198,7 @@ public class ThirdLoginController {
*
* @param formDTO
* @return
* 目前烟台用的这个
*/
@PostMapping("resilogin-internalding")
public Result<ResiDingAppLoginResDTO> resiLoginInternalDing(@RequestBody DingAppLoginMdFormDTO formDTO) {

100
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCommentDTO.java

@ -0,0 +1,100 @@
package com.epmet.dto;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 议题评论表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
@Data
public class IssueCommentDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
/**
* 议题ID
*/
@NotBlank(message = "issueId不能为空",groups = AddUserInternalGroup.class)
private String issueId;
/**
* 主键ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 评论内容至多200字
*/
@Length(max = 200,message = "评论内容最多输入200字",groups = AddUserShowGroup.class)
@NotBlank(message = "content不能为空",groups = AddUserInternalGroup.class)
private String content;
/**
* 评论用户id
*/
private String userId;
/**
* 姓名
*/
private String userName;
/**
* 头像
*/
private String headPhoto;
/**
* 删除标识 0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
private String commentId;
}

18
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCommentPageFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Description
* @Author yzm
* @Date 2023/2/2 13:45
*/
@Data
public class IssueCommentPageFormDTO extends PageFormDTO {
@NotBlank(message = "issueId不能为空",groups = AddUserInternalGroup.class)
private String issueId;
}

61
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCommentController.java

@ -0,0 +1,61 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
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.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.IssueCommentDTO;
import com.epmet.dto.form.IssueCommentPageFormDTO;
import com.epmet.service.IssueCommentService;
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 2023-02-02
*/
@RestController
@RequestMapping("issuecomment")
public class IssueCommentController {
@Autowired
private IssueCommentService issueCommentService;
/**
* 议题评论列表
* @param formDTO
* @return
*/
@RequestMapping("page")
public Result<PageData<IssueCommentDTO>> page(@RequestBody IssueCommentPageFormDTO formDTO){
PageData<IssueCommentDTO> page = issueCommentService.page(formDTO);
return new Result<PageData<IssueCommentDTO>>().ok(page);
}
/**
* 议题评论
* @param tokenDto
* @param dto
* @return
*/
@NoRepeatSubmit
@PostMapping("save")
public Result save(@LoginUser TokenDto tokenDto, @RequestBody IssueCommentDTO dto){
dto.setCustomerId(tokenDto.getCustomerId());
dto.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(dto,IssueCommentDTO.AddUserShowGroup.class,IssueCommentDTO.AddUserInternalGroup.class);
issueCommentService.save(dto);
return new Result();
}
}

20
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCommentDao.java

@ -0,0 +1,20 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IssueCommentDTO;
import com.epmet.entity.IssueCommentEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 议题评论表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
@Mapper
public interface IssueCommentDao extends BaseDao<IssueCommentEntity> {
List<IssueCommentDTO> selectCommentList(String issueId);
}

54
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCommentEntity.java

@ -0,0 +1,54 @@
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 2023-02-02
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("issue_comment")
public class IssueCommentEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 议题ID
*/
private String issueId;
/**
* 客户ID
*/
private String customerId;
/**
* 评论内容至多200字
*/
private String content;
/**
* 评论用户id
*/
private String userId;
/**
* 姓名
*/
private String userName;
/**
* 头像
*/
private String headPhoto;
}

37
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCommentService.java

@ -0,0 +1,37 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IssueCommentDTO;
import com.epmet.dto.form.IssueCommentPageFormDTO;
import com.epmet.entity.IssueCommentEntity;
/**
* 议题评论表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
public interface IssueCommentService extends BaseService<IssueCommentEntity> {
/**
* 默认分页
*
* @param formDTO
* @return PageData<IssueCommentDTO>
* @author generator
* @date 2023-02-02
*/
PageData<IssueCommentDTO> page(IssueCommentPageFormDTO formDTO);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2023-02-02
*/
void save(IssueCommentDTO dto);
}

72
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCommentServiceImpl.java

@ -0,0 +1,72 @@
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
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.IssueCommentDao;
import com.epmet.dto.IssueCommentDTO;
import com.epmet.dto.form.IssueCommentPageFormDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.entity.IssueCommentEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.IssueCommentService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* 议题评论表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
@Service
public class IssueCommentServiceImpl extends BaseServiceImpl<IssueCommentDao, IssueCommentEntity> implements IssueCommentService {
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
/**
* 议题评论列表
* @param formDTO
* @return
*/
@Override
public PageData<IssueCommentDTO> page(IssueCommentPageFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<IssueCommentDTO> list = baseDao.selectCommentList(formDTO.getIssueId());
PageInfo<IssueCommentDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
/**
* 议题评论
* 需求来源于烟台https://modao.cc/app/Uz9nPVerhvcupzLnhoiY#screen=sl8mfpxd863xmb5
* @param dto
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IssueCommentDTO dto) {
//查询用户信息
List<String> userIdList=new ArrayList<>();
userIdList.add(dto.getUserId());
Result<List<UserBaseInfoResultDTO>> userInfoRes= userOpenFeignClient.queryUserBaseInfo(userIdList);
if(!userInfoRes.success()|| CollectionUtils.isEmpty(userInfoRes.getData())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询用户信息异常userId:"+dto.getUserId(),"查询用户信息异常");
}
IssueCommentEntity entity = ConvertUtils.sourceToTarget(dto, IssueCommentEntity.class);
entity.setHeadPhoto(userInfoRes.getData().get(NumConstant.ZERO).getHeadImgUrl());
entity.setUserName(userInfoRes.getData().get(NumConstant.ZERO).getRealName());
insert(entity);
}
}

16
epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.21__issue_comment.sql

@ -0,0 +1,16 @@
CREATE TABLE `issue_comment` (
`ID` varchar(32) NOT NULL COMMENT '主键ID',
`ISSUE_ID` varchar(32) NOT NULL COMMENT '议题ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`CONTENT` varchar(255) NOT NULL COMMENT '评论内容至多200字',
`USER_ID` varchar(64) NOT NULL COMMENT '评论用户id',
`USER_NAME` varchar(64) DEFAULT NULL COMMENT '姓名',
`HEAD_PHOTO` varchar(255) DEFAULT NULL COMMENT '头像',
`DEL_FLAG` varchar(2) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`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='议题评论表';

36
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCommentDao.xml

@ -0,0 +1,36 @@
<?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.IssueCommentDao">
<resultMap type="com.epmet.entity.IssueCommentEntity" id="issueCommentMap">
<result property="id" column="ID"/>
<result property="issueId" column="ISSUE_ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="content" column="CONTENT"/>
<result property="userId" column="USER_ID"/>
<result property="userName" column="USER_NAME"/>
<result property="headPhoto" column="HEAD_PHOTO"/>
<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>
<select id="selectCommentList" parameterType="java.lang.String" resultType="com.epmet.dto.IssueCommentDTO">
SELECT
ic.id as commentId,
ic.*
FROM
issue_comment ic
WHERE
ic.DEL_FLAG = '0'
AND ic.ISSUE_ID = #{issueId}
ORDER BY
ic.CREATED_TIME DESC
</select>
</mapper>

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java

@ -43,6 +43,10 @@ public class IcPropertyManagementDTO implements Serializable {
* 物业名称
*/
private String name;
/**
* 客户id
*/
private String customerId;
/**
* 删除标识 0未删除1已删除
@ -73,5 +77,8 @@ public class IcPropertyManagementDTO implements Serializable {
* 更新时间
*/
private Date updatedTime;
/**
* 关联的小区数量
*/
private Integer totalNeighborHood;
}

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java

@ -22,6 +22,7 @@ import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@ -39,6 +40,8 @@ public class IcPropertyManagementFormDTO implements Serializable {
public interface UpdateShowGroup extends CustomerClientShowGroup {
}
public interface PageGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "物业id不能为空", groups = {DeleteGroup.class, UpdateShowGroup.class})
private String id;
@ -49,5 +52,11 @@ public class IcPropertyManagementFormDTO implements Serializable {
@Length(max = 50, message = "物业名称不能超过50个字", groups = {AddShowGroup.class})
private String name;
private String customerId;
@NotNull(message = "pageNo不能为空", groups = PageGroup.class)
private Integer pageNo;
@NotNull(message = "pageSize不能为空", groups = PageGroup.class)
private Integer pageSize;
}

34
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java

@ -18,12 +18,13 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
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.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.IcPropertyManagementDTO;
import com.epmet.dto.form.IcPropertyManagementFormDTO;
import com.epmet.dto.result.IcPropertyManagementResultDTO;
import com.epmet.service.IcPropertyManagementService;
import com.epmet.service.PropertyManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -45,33 +46,46 @@ import java.util.Map;
@RestController
@RequestMapping("propertymanagement")
public class PropertyManagementController {
@Autowired
private IcPropertyManagementService icPropertyManagementService;
@Autowired
private PropertyManagementService propertyManagementService;
/**
* 分页查询物业列表
*/
@PostMapping("page")
public Result<PageData<IcPropertyManagementDTO>> page(@RequestBody IcPropertyManagementFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,IcPropertyManagementFormDTO.PageGroup.class);
return new Result<PageData<IcPropertyManagementDTO>>().ok(propertyManagementService.page(formDTO.getPageNo(),formDTO.getPageSize(),formDTO.getName()));
}
/**
* 新增小区时下拉框调用此接口
* @return
*/
@PostMapping("list")
public Result<List<IcPropertyManagementResultDTO>> list(){
return new Result<List<IcPropertyManagementResultDTO>>().ok(propertyManagementService.getList());
}
/**
* 新增物业
* 新增小区页面添加小区也调用此接口
* @param tokenDTO
* @param formDTO
* @return
*/
@PostMapping("add")
public Result add(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){
//效验数据
formDTO.setCustomerId(tokenDTO.getCustomerId());
ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.AddShowGroup.class);
Map map=new HashMap<>();
map.put("propertyId",propertyManagementService.add(formDTO));
return new Result().ok(map);
}
@PostMapping("update")
public Result update(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){
public Result update(@RequestBody IcPropertyManagementFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.UpdateShowGroup.class);
propertyManagementService.update(formDTO);
@ -79,7 +93,7 @@ public class PropertyManagementController {
}
@PostMapping("delete")
public Result delete(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){
public Result delete(@RequestBody IcPropertyManagementFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.DeleteGroup.class);
propertyManagementService.delete(formDTO);

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java

@ -34,7 +34,7 @@ import java.util.List;
@Mapper
public interface IcPropertyManagementDao extends BaseDao<IcPropertyManagementEntity> {
IcPropertyManagementEntity selectByName(String name);
IcPropertyManagementEntity selectByName(String customerId,String name,String id);
/**
* @Description 根据物业名查询已存在的物业名
@ -58,4 +58,6 @@ public interface IcPropertyManagementDao extends BaseDao<IcPropertyManagementEnt
* @return
*/
List<IcPropertyManagementDTO> selectPropertyNameList(String neighborhoodId);
List<IcPropertyManagementDTO> queryList(@Param("customerId") String customerId,@Param("name")String name);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java

@ -39,5 +39,5 @@ public class IcPropertyManagementEntity extends BaseEpmetEntity {
* 物业名称
*/
private String name;
private String customerId;
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java

@ -17,6 +17,8 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcPropertyManagementDTO;
import com.epmet.dto.form.IcPropertyManagementFormDTO;
import com.epmet.dto.result.IcPropertyManagementResultDTO;
@ -36,4 +38,6 @@ public interface PropertyManagementService {
void update(IcPropertyManagementFormDTO formDTO);
void delete(IcPropertyManagementFormDTO formDTO);
PageData<IcPropertyManagementDTO> page(Integer pageNo, Integer pageSize, String name);
}

50
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java

@ -1,19 +1,24 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.exception.RenException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.dao.IcNeighborHoodPropertyDao;
import com.epmet.dao.IcPropertyManagementDao;
import com.epmet.dto.IcPropertyManagementDTO;
import com.epmet.dto.form.IcPropertyManagementFormDTO;
import com.epmet.dto.result.IcPropertyManagementResultDTO;
import com.epmet.entity.IcNeighborHoodPropertyEntity;
import com.epmet.entity.IcPropertyManagementEntity;
import com.epmet.service.PropertyManagementService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
@ -28,9 +33,15 @@ public class PropertyManagementServiceImpl implements PropertyManagementService
@Resource
private IcNeighborHoodPropertyDao icNeighborHoodPropertyDao;
/**
* 查询当前客户下的物业
* @return
*/
@Override
public List<IcPropertyManagementResultDTO> getList() {
List<IcPropertyManagementEntity> propertyManagementEntityList = icPropertyManagementDao.selectList(null);
LambdaQueryWrapper<IcPropertyManagementEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(IcPropertyManagementEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
List<IcPropertyManagementEntity> propertyManagementEntityList = icPropertyManagementDao.selectList(queryWrapper);
List<IcPropertyManagementResultDTO> list = new ArrayList<>();
propertyManagementEntityList.forEach(item->{
IcPropertyManagementResultDTO propertyManagementResultDTO = new IcPropertyManagementResultDTO();
@ -41,13 +52,19 @@ public class PropertyManagementServiceImpl implements PropertyManagementService
return list;
}
/**
* 新增物业
* 名称客户下唯一
* @param formDTO
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String add(IcPropertyManagementFormDTO formDTO) {
//物业名字平台内唯一
//如果输入的物业名字已经存在,直接返回物业id
formDTO.setName(formDTO.getName().trim());
IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getName());
IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getCustomerId(),formDTO.getName(),null);
if (null != entity) {
return entity.getId();
}
@ -59,17 +76,34 @@ public class PropertyManagementServiceImpl implements PropertyManagementService
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcPropertyManagementFormDTO formDTO) {
IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(EpmetRequestHolder.getLoginUserCustomerId(),formDTO.getName(),formDTO.getId());
if (null != entity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业名称已存在","物业名称已存在");
}
IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class);
icPropertyManagementDao.updateById(icPropertyManagementEntity);
}
/**
* 单个删除
* @param formDTO
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(IcPropertyManagementFormDTO formDTO) {
List<IcNeighborHoodPropertyEntity> list = icNeighborHoodPropertyDao.selectList(new QueryWrapper<IcNeighborHoodPropertyEntity>().lambda().eq(IcNeighborHoodPropertyEntity::getPropertyId, formDTO.getId()));
if(!CollectionUtils.isEmpty(list)){
throw new RenException("物业存在与小区关联,无法删除");
LambdaQueryWrapper<IcNeighborHoodPropertyEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(IcNeighborHoodPropertyEntity::getPropertyId,formDTO.getId());
if (icNeighborHoodPropertyDao.selectCount(queryWrapper) > 0) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业存在与小区关联,无法删除","已与小区关联,无法删除");
}
icPropertyManagementDao.deleteById(formDTO.getId());
}
@Override
public PageData<IcPropertyManagementDTO> page(Integer pageNo, Integer pageSize, String name) {
PageHelper.startPage(pageNo,pageSize);
List<IcPropertyManagementDTO> list=icPropertyManagementDao.queryList(EpmetRequestHolder.getLoginUserCustomerId(),name);
PageInfo<IcPropertyManagementDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
}

8
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.48__ic_property_management.sql

@ -0,0 +1,8 @@
alter table ic_property_management add COLUMN `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户id' after NAME;
update ic_property_management p,ic_neighbor_hood_property pr,ic_neighbor_hood h
set p.CUSTOMER_ID=h.CUSTOMER_ID
where p.DEL_FLAG='0'
and p.id=pr.PROPERTY_ID
and pr.NEIGHBOR_HOOD_ID=h.id;

19
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml

@ -14,14 +14,18 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectByName" parameterType="java.lang.String" resultType="com.epmet.entity.IcPropertyManagementEntity">
<select id="selectByName" parameterType="map" resultType="com.epmet.entity.IcPropertyManagementEntity">
SELECT
m.id
FROM
ic_property_management m
WHERE
m.DEL_FLAG = '0'
and m.customer_id = #{customerId}
AND m.`NAME` = #{name}
<if test="id != null and id != ''">
and m.id !=#{id}
</if>
</select>
<!-- 根据物业名查询已存在的物业名 -->
@ -65,4 +69,17 @@
AND p.DEL_FLAG = '0'
)
</select>
<select id="queryList" parameterType="map" resultType="com.epmet.dto.IcPropertyManagementDTO">
select m.*,(
select count(pr.NEIGHBOR_HOOD_ID) from ic_neighbor_hood_property pr where pr.PROPERTY_ID=m.id and pr.del_flag='0'
)as totalNeighborHood
from ic_property_management m
where m.del_flag='0'
and m.customer_id=#{customerId}
<if test="name != null and name != ''">
and m.name like concat('%',#{name},'%')
</if>
order by m.CREATED_TIME desc
</select>
</mapper>

3
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -1804,7 +1804,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
if(StringUtils.isNotBlank(imgUrl)){
//如果没有封面图片的话,更新
LambdaQueryWrapper<ArticleCoverEntity> queryWrapper=new LambdaQueryWrapper();
queryWrapper.eq(ArticleCoverEntity::getArticleId,articleEntity);
queryWrapper.eq(ArticleCoverEntity::getArticleId,articleId);
if (articleCoverDao.selectCount(queryWrapper) == 0) {
ArticleCoverEntity articleCoverEntity=new ArticleCoverEntity();
articleCoverEntity.setCustomerId(articleEntity.getCustomerId());
@ -1852,6 +1852,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
articleEntity.setOrgIdPath(StringUtils.isBlank(agencyInfo.getPids()) || agencyInfo.getPids().equals(NumConstant.ZERO_STR) ? agencyInfo.getId() : agencyInfo.getPids().concat(":").concat(agencyInfo.getId()));
articleEntity.setRichTextFlag(NumConstant.ONE_STR);
articleEntity.setIsTop(formDTO.getIsTop());
articleEntity.setTitle(formDTO.getTitle());
baseDao.updateById(articleEntity);
// 2.内容
ArticleContentEntity articleContent = articleContentDao.selectByArticleId(formDTO.getArticleId());

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java

@ -388,7 +388,7 @@ public class GuideServiceImpl extends BaseServiceImpl<GuideDao, GuideEntity> imp
if (null != guideCollectionService.getCollection(tokenDto, formDTO.getGuideId())) {
result.setCollectionFlag(NumConstant.ONE_STR);
}
//记录已读未读
//记录已读未读 来源于烟台
if (null == SpringContextUtils.getBean(GuideReaderService.class).get(formDTO.getGuideId(), tokenDto.getUserId())) {
GuideReaderEntity guideReaderEntity=new GuideReaderEntity();
guideReaderEntity.setGuideId(formDTO.getGuideId());

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java

@ -206,11 +206,9 @@ public class MyHomeServiceImpl implements MyHomeService {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getCustomerId, tokenDto.getCustomerId());
wrapper.eq(IcResiUserEntity::getIdCard, baseInfo.getIdNum());
wrapper.select(IcResiUserEntity::getId)
.select(IcResiUserEntity::getHomeId)
.select(IcResiUserEntity::getIdCard);
wrapper.select(IcResiUserEntity::getId,IcResiUserEntity::getHomeId,IcResiUserEntity::getIdCard);
IcResiUserEntity icUser = icResiUserDao.selectOne(wrapper);
if (null == icUser) {
if (null == icUser||StringUtils.isBlank(icUser.getHomeId())) {
log.warn(String.format("ic_resi_user is null id_card:%s",baseInfo.getIdNum()));
return null;
}

Loading…
Cancel
Save