Browse Source

Merge branch 'dev_five_coverage' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_five_coverage

 Conflicts:
	epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java
master
wangxianzhang 3 years ago
parent
commit
c87bf8e540
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java
  2. 3
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java
  3. 9
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/CoverageAnalisisDataListFormDTO.java
  4. 44
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/CoverageAnalisisDataListLeftFormDTO.java
  5. 19
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/CoverageAnalisisDataListResultDTO.java
  6. 26
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/CoverageAnalisisDataListResultDTOV2.java
  7. 26
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/CoverageController.java
  8. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcEnterprisePatrolRecordDao.java
  9. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/CoverageService.java
  10. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgCoverageService.java
  11. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgCoverageServiceImpl.java
  12. 131
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java
  13. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcEnterprisePatrolRecordDao.xml
  14. 15
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java
  15. 15
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java
  16. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  17. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  18. 16
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  19. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java
  20. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitEntity.java
  21. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
  22. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  23. 30
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  24. 62
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  25. 51
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java
  26. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  27. 8
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java
  28. 6
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendSmsFormDTO.java
  29. 10
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java
  30. 5
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleDTO.java
  31. 5
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleEntity.java
  32. 7
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java
  33. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java
  34. 38
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CheckStaffInfoFormDTO.java
  35. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java
  36. 37
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CheckStaffInfoResultDTO.java
  37. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  38. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  39. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java
  40. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/DepartmentService.java
  41. 216
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java
  42. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java
  43. 5
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java
  44. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java
  45. 1
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
  46. 9
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  47. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  48. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  49. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  50. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
  51. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java
  52. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  53. 15
      epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java

@ -110,4 +110,6 @@ public interface StrConstant {
String YES = "是";
String NO = "否";
String ELLIPSIS="......";
}

3
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java

@ -14,4 +14,7 @@ public interface OrgConstant {
String GRID_ID="GRID_ID";
String GENDER="GENDER";
String HOUSE_TYPE_KEY="HOUSE_TYPE";
String AGENCY_ID="agencyId";
String AGENC_PATH="agencyPath";
}

9
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/CoverageAnalisisDataListFormDTO.java

@ -9,7 +9,16 @@ import java.util.List;
*/
@Data
public class CoverageAnalisisDataListFormDTO {
/**
* 目前都是组织id
*/
private String orgId;
/**
* agency
* grid
*/
private String orgType;
/**
* 图层类型列表
*/

44
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/CoverageAnalisisDataListLeftFormDTO.java

@ -0,0 +1,44 @@
package com.epmet.dataaggre.dto.govorg.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2022/7/28 11:09
*/
@Data
public class CoverageAnalisisDataListLeftFormDTO {
public interface ShowGroup extends CustomerClientShowGroup {
}
/**
* 目前都是组织id
*/
@NotBlank(message = "组织不能为空", groups = ShowGroup.class)
private String orgId;
/**
* agency
* grid
*/
@NotBlank(message = "组织类型不能为空", groups = ShowGroup.class)
private String orgType;
/**
* 图层类型列表
*/
private List<String> coverageTypes;
/**
* 分类key
*/
private List<String> categoryKeys;
private String customerId;
private String staffId;
}

19
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/CoverageAnalisisDataListResultDTO.java

@ -1,8 +1,10 @@
package com.epmet.dataaggre.dto.govorg.result;
import com.epmet.commons.tools.constant.StrConstant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
@Data
@NoArgsConstructor
@ -40,4 +42,21 @@ public class CoverageAnalisisDataListResultDTO {
*/
private String longitude;
/**
* 经度,纬度120.38862649282282,36.07138835989835
*/
private String longLat;
public CoverageAnalisisDataListResultDTO(String id, String categoryKey, String categoryName, String placeType, String content, String latitude, String longitude) {
this.id=id;
this.categoryKey=categoryKey;
this.categoryName=categoryName;
this.placeType=placeType;
this.content=content;
this.latitude=latitude;
this.longitude=longitude;
if(StringUtils.isNotBlank(latitude)&&StringUtils.isNotBlank(longitude)){
this.longLat=longitude.concat(StrConstant.COMMA).concat(latitude);
}
}
}

26
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/CoverageAnalisisDataListResultDTOV2.java

@ -0,0 +1,26 @@
package com.epmet.dataaggre.dto.govorg.result;
import lombok.Data;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2022/7/28 11:13
*/
@Data
public class CoverageAnalisisDataListResultDTOV2 {
/**
* 维度
*/
private String latitude;
/**
* 经度
*/
private String longitude;
private List<CoverageAnalisisDataListResultDTO> dataList;
}

26
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/CoverageController.java

@ -5,12 +5,15 @@ import com.epmet.commons.tools.dto.result.ZhzlCategorySelectDTO;
import com.epmet.commons.tools.enums.ZhzlResiCategoryEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.dto.coverage.AnalysisGovernedTargetsResult;
import com.epmet.dataaggre.dto.coverage.AnalysisResourceCategoriesResult;
import com.epmet.dataaggre.dto.govorg.form.CoverageAnalisisDataListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.CoverageAnalisisDataListLeftFormDTO;
import com.epmet.dataaggre.dto.govorg.form.CoverageHomeSearchFormDTO;
import com.epmet.dataaggre.dto.govorg.result.CoverageAnalisisDataListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.CoverageAnalisisDataListResultDTOV2;
import com.epmet.dataaggre.dto.govorg.result.CoverageHomeSearchResultDTO;
import com.epmet.dataaggre.service.CoverageService;
import org.apache.commons.collections4.CollectionUtils;
@ -40,13 +43,16 @@ public class CoverageController {
*/
@RequestMapping("dataList")
public Result<PageData<CoverageAnalisisDataListResultDTO>> dataList(@RequestBody CoverageAnalisisDataListFormDTO input) {
// 获取跟组织的坐标
String customerId = EpmetRequestHolder.getLoginUserCustomerId();
String staffId = EpmetRequestHolder.getLoginUserId();
List<String> coverageTypes = input.getCoverageTypes();
List<String> categoryKeys = input.getCategoryKeys();
if (CollectionUtils.isEmpty(coverageTypes)) {
return new Result().ok(new PageData<>(new ArrayList<>(), 0));
}
PageData<CoverageAnalisisDataListResultDTO> page = coverageService.analysisDataList(coverageTypes, categoryKeys,
PageData<CoverageAnalisisDataListResultDTO> page = coverageService.analysisDataList(customerId,staffId,input.getOrgId(),input.getOrgType(),coverageTypes, categoryKeys,
input.getSearch(), input.getPageNo(), input.getPageSize(), input.getIsPage());
return new Result<PageData<CoverageAnalisisDataListResultDTO>>().ok(page);
}
@ -94,4 +100,22 @@ public class CoverageController {
return new Result<List<AnalysisGovernedTargetsResult>>().ok(r);
}
/**
* 五大图层左侧菜单点击事件查询人.事的分布
*
* @param formDTO
* @return
*/
@RequestMapping("dataList-left")
public Result<PageData<CoverageAnalisisDataListResultDTOV2>> dataListLeft(@LoginUser TokenDto tokenDto, @RequestBody CoverageAnalisisDataListLeftFormDTO formDTO) {
List<String> coverageTypes = formDTO.getCoverageTypes();
List<String> categoryKeys = formDTO.getCategoryKeys();
if (CollectionUtils.isEmpty(coverageTypes)||CollectionUtils.isEmpty(categoryKeys)) {
return new Result().ok(new PageData<>(new ArrayList<>(), 0));
}
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
PageData<CoverageAnalisisDataListResultDTOV2> page = coverageService.dataListLeft(formDTO);
return new Result<PageData<CoverageAnalisisDataListResultDTOV2>>().ok(page);
}
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcEnterprisePatrolRecordDao.java

@ -26,7 +26,7 @@ public interface IcEnterprisePatrolRecordDao extends BaseDao<IcEnterprisePatrolR
*/
Integer countEnterprisePatrol(@Param("customerId") String customerId, @Param("agencyId") String agencyId,
@Param("staffOrgIds") String staffOrgIds, @Param("search") String search,
@Param("categoryKey") String categoryKey);
@Param("categoryKey") String categoryKey,@Param("latestResult")String latestResult);
/**
* 企事业单位巡查列表
@ -38,5 +38,5 @@ public interface IcEnterprisePatrolRecordDao extends BaseDao<IcEnterprisePatrolR
*/
List<IcEnterisePatrolResultDTO> listEnterprisePatrol(@Param("customerId") String customerId, @Param("agencyId") String agencyId,
@Param("staffOrgIds") String staffOrgIds, @Param("search") String search,
@Param("categoryKey") String categoryKey);
@Param("categoryKey") String categoryKey, @Param("latestResult") String latestResult);
}

12
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/CoverageService.java

@ -3,8 +3,10 @@ package com.epmet.dataaggre.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dataaggre.dto.coverage.AnalysisGovernedTargetsResult;
import com.epmet.dataaggre.dto.coverage.AnalysisResourceCategoriesResult;
import com.epmet.dataaggre.dto.govorg.form.CoverageAnalisisDataListLeftFormDTO;
import com.epmet.dataaggre.dto.govorg.form.CoverageHomeSearchFormDTO;
import com.epmet.dataaggre.dto.govorg.result.CoverageAnalisisDataListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.CoverageAnalisisDataListResultDTOV2;
import com.epmet.dataaggre.dto.govorg.result.CoverageHomeSearchResultDTO;
import java.util.List;
@ -22,7 +24,8 @@ public interface CoverageService {
* @param pageSize 页面大小
* @return
*/
PageData<CoverageAnalisisDataListResultDTO> analysisDataList(List<String> coverageTypes, List<String> categoryKeys,
PageData<CoverageAnalisisDataListResultDTO> analysisDataList(String customerId,String staffId,String orgId,String orgType,
List<String> coverageTypes, List<String> categoryKeys,
String search, Integer pageNo, Integer pageSize, Boolean isPage);
/**
@ -40,4 +43,11 @@ public interface CoverageService {
List<AnalysisResourceCategoriesResult> listAnalysisResourceCategories();
List<AnalysisGovernedTargetsResult> listGovernedTargetCategories();
/**
* 五大图层左侧菜单点击事件查询人.事的分布
* @param formDTO
* @return
*/
PageData<CoverageAnalisisDataListResultDTOV2> dataListLeft(CoverageAnalisisDataListLeftFormDTO formDTO);
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgCoverageService.java

@ -1,16 +1,13 @@
package com.epmet.dataaggre.service.govorg;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dataaggre.dto.govorg.result.IcEnterisePatrolResultDTO;
import com.epmet.dataaggre.entity.govorg.*;
import com.epmet.dataaggre.entity.heart.IcCommunitySelfOrganizationEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* org库的图层service
@ -115,11 +112,11 @@ public interface GovOrgCoverageService {
Integer countSuporiorResourceEntities(String customerId, String staffOrgIds, String search, String categoryKey);
Integer countEnterprisePatrol(String customerId, String agencyId, String staffOrgIds, String search, String categoryKey);
Integer countEnterprisePatrol(String customerId, String agencyId, String staffOrgIds, String search, String categoryKey,String latestResult);
List<IcEnterisePatrolResultDTO> listEnterprisePatrol(String customerId, String agencyId, String staffOrgIds,
String search, String categoryKey, Boolean isPage, Integer pageNo,
Integer pageSize);
Integer pageSize, String latestResult);
/**
* 通过居民数量等条件查询房屋数量

14
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgCoverageServiceImpl.java

@ -1,7 +1,6 @@
package com.epmet.dataaggre.service.govorg.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.enums.CoverageEnums;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
@ -15,7 +14,10 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* org 图层service
@ -291,18 +293,18 @@ public class GovOrgCoverageServiceImpl implements GovOrgCoverageService {
}
@Override
public Integer countEnterprisePatrol(String customerId, String agencyId, String staffOrgIds, String search, String categoryKey) {
return enterprisePatrolRecordDao.countEnterprisePatrol(customerId, agencyId, staffOrgIds, search, categoryKey);
public Integer countEnterprisePatrol(String customerId, String agencyId, String staffOrgIds, String search, String categoryKey,String latestResult) {
return enterprisePatrolRecordDao.countEnterprisePatrol(customerId, agencyId, staffOrgIds, search, categoryKey,latestResult);
}
@Override
public List<IcEnterisePatrolResultDTO> listEnterprisePatrol(String customerId, String agencyId, String staffOrgIds,
String search, String categoryKey, Boolean isPage,
Integer pageNo, Integer pageSize) {
Integer pageNo, Integer pageSize, String latestResult) {
if (isPage) {
PageHelper.startPage(pageNo, pageSize);
}
return enterprisePatrolRecordDao.listEnterprisePatrol(customerId, agencyId, staffOrgIds, search, categoryKey);
return enterprisePatrolRecordDao.listEnterprisePatrol(customerId, agencyId, staffOrgIds, search, categoryKey, latestResult);
}
@Override

131
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java

@ -1,19 +1,26 @@
package com.epmet.dataaggre.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.CoverageEnums;
import com.epmet.commons.tools.enums.CoveragePlaceTypeEnum;
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.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.dataaggre.constant.OrgConstant;
import com.epmet.dataaggre.dto.coverage.AnalysisGovernedTargetsResult;
import com.epmet.dataaggre.dto.coverage.AnalysisResourceCategoriesResult;
import com.epmet.dataaggre.dto.epmetuser.result.IcResiInfoResultDTO;
import com.epmet.dataaggre.dto.govorg.form.CoverageAnalisisDataListLeftFormDTO;
import com.epmet.dataaggre.dto.govorg.form.CoverageHomeSearchFormDTO;
import com.epmet.dataaggre.dto.govorg.result.CoverageAnalisisDataListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.CoverageAnalisisDataListResultDTOV2;
import com.epmet.dataaggre.dto.govorg.result.CoverageHomeSearchResultDTO;
import com.epmet.dataaggre.dto.govorg.result.IcEnterisePatrolResultDTO;
import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity;
@ -29,17 +36,14 @@ import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.govproject.GovProjectService;
import com.epmet.dataaggre.service.heart.HeartService;
import com.epmet.dataaggre.service.opercustomize.IcResiCategoryWarnService;
import jodd.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@ -96,12 +100,11 @@ public class CoverageServiceImpl implements CoverageService {
* @return
*/
@Override
public PageData<CoverageAnalisisDataListResultDTO> analysisDataList(List<String> coverageTypes, List<String> categoryKeys,
public PageData<CoverageAnalisisDataListResultDTO> analysisDataList(String customerId,String staffId,String orgId,String orgType,
List<String> coverageTypes, List<String> categoryKeys,
String search, Integer pageNo, Integer pageSize, Boolean isPage) {
// 获取跟组织的坐标
String customerId = EpmetRequestHolder.getLoginUserCustomerId();
String staffId = EpmetRequestHolder.getLoginUserId();
CustomerAgencyEntity rootAgency = govOrgService.getRootAgencyByCustomerId(customerId);
// 1.根据categoryKeys分类key列表,查询他们和图层时间的关系,映射为一个map
@ -121,15 +124,9 @@ public class CoverageServiceImpl implements CoverageService {
}
// 2.循环coverageTypes,使用key到map中查询(为了顺序),得到categoryKeys列表之后,根据实际情况做相应的查询
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId);
if (staffInfo == null) {
String msg = "未找到当前登录人信息。staffId:" + EpmetRequestHolder.getLoginUserId();
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg);
}
String staffPids = getStaffPidsFromStaffInfo(staffInfo);
String agencyId = staffInfo.getAgencyId();
Map<String,String> agencyMap=getStaffPidsFromStaffInfo(customerId,staffId,orgId,orgType);
String agencyPath = agencyMap.get(OrgConstant.AGENC_PATH);
String agencyId = agencyMap.get(OrgConstant.AGENCY_ID);
// 分页不太好分,先查出所有的数据,然后partation()吧
int start = (pageNo - 1) * pageSize;
@ -157,7 +154,7 @@ public class CoverageServiceImpl implements CoverageService {
}
for (GovOrgCoverageService.CategoryCoverageMapping e : ccm) {
Integer tempCount = doDataListCount(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, staffPids, e.getPlaceType(),
Integer tempCount = doDataListCount(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, agencyPath, e.getPlaceType(),
e.getCategoryKey(), search);
lastTotalCount = totalCount;
totalCount += tempCount;
@ -166,7 +163,7 @@ public class CoverageServiceImpl implements CoverageService {
// 不分页,查询所有
// 检索数据
List<CoverageAnalisisDataListResultDTO> dataSegment = doDataListSearch(
EpmetRequestHolder.getLoginUserCustomerId(), agencyId, staffPids, e.getPlaceType(),
EpmetRequestHolder.getLoginUserCustomerId(), agencyId, agencyPath, e.getPlaceType(),
e.getCategoryKey(), search, null, null, isPage, rootAgency);
rls.addAll(dataSegment);
continue;
@ -188,7 +185,7 @@ public class CoverageServiceImpl implements CoverageService {
// 检索数据
List<CoverageAnalisisDataListResultDTO> dataSegment = doDataListSearch(
EpmetRequestHolder.getLoginUserCustomerId(), agencyId, staffPids, e.getPlaceType(),
EpmetRequestHolder.getLoginUserCustomerId(), agencyId, agencyPath, e.getPlaceType(),
e.getCategoryKey(), search, 1, end, isPage, rootAgency);
if (firstTimeDataAppear) {
@ -238,6 +235,41 @@ public class CoverageServiceImpl implements CoverageService {
}
}
private Map<String, String> getStaffPidsFromStaffInfo(String customerId, String staffId, String orgId, String orgType) {
Map<String, String> map = new HashMap<>();
String agencyPath = StrConstant.EPMETY_STR;
String agencyId = StrConstant.EPMETY_STR;
if (StringUtils.isBlank(orgId)) {
// 默认查询的是当前登录用户所属组织及下级
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId);
if (staffInfo == null) {
String msg = "未找到当前登录人信息。staffId:" + EpmetRequestHolder.getLoginUserId();
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg);
}
// staffPids
agencyPath = getStaffPidsFromStaffInfo(staffInfo);
agencyId = staffInfo.getAgencyId();
} else {
// 根据传入的组织id来
if (OrgConstant.AGENCY.equals(orgType)) {
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(orgId);
if (agencyInfoCache == null) {
String msg = "查询组织缓存信息异常。orgId:" + orgId;
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg);
}
agencyId = orgId;
if (StringUtils.isNotBlank(agencyInfoCache.getPids()) && !"0".equals(agencyInfoCache.getPids()) && !"0".equals(agencyInfoCache)) {
agencyPath = agencyInfoCache.getPids().concat(":").concat(agencyId);
} else {
agencyPath = orgId;
}
}
}
map.put(OrgConstant.AGENCY_ID, agencyId);
map.put(OrgConstant.AGENC_PATH, agencyPath);
return map;
}
/**
* 计算数据条数
* @param customerId
@ -278,7 +310,7 @@ public class CoverageServiceImpl implements CoverageService {
return orgCoverageService.countDangerousChemicalEntities(customerId, staffOrgIds, search, categoryKey);
} else if (CoveragePlaceTypeEnum.ENTERPRISE_PATROL.getCode().equals(placeType)) {
// 企事业单位巡查
return orgCoverageService.countEnterprisePatrol(customerId, agencyId, staffOrgIds, search, categoryKey);
return orgCoverageService.countEnterprisePatrol(customerId, agencyId, staffOrgIds, search, categoryKey,null);
} else if (CoveragePlaceTypeEnum.GROUP_RENT.getCode().equals(placeType)) {
// 群租房。出租的房屋,住的人口超过5人属于群租房(是个规定
return orgCoverageService.countByResiNumber(customerId, staffOrgIds, search, 5, HOUSE_RENT_FLAG_RENT);
@ -288,6 +320,10 @@ public class CoverageServiceImpl implements CoverageService {
} else if (CoveragePlaceTypeEnum.SUPERIOR_RESOURCE.getCode().equals(placeType)) {
// 优势资源
return orgCoverageService.countSuporiorResourceEntities(customerId, staffOrgIds, search, categoryKey);
} else if(CoveragePlaceTypeEnum.ENTERPRISE_PATROL_UNQUALIFIED.getCode().equals(placeType)){
// 企事业单位巡查
// 最新巡查结果【0:合格 1:不合格】
return orgCoverageService.countEnterprisePatrol(customerId, agencyId, staffOrgIds, search, categoryKey,NumConstant.ONE_STR );
}
return 0;
@ -345,7 +381,8 @@ public class CoverageServiceImpl implements CoverageService {
return icEventEntities.stream()
.map(e -> new CoverageAnalisisDataListResultDTO(
e.getId(), categoryKey, isPage ? categoryDict.getCategoryName() : null, placeType, isPage ? e.getName() : null,
e.getId(), categoryKey, isPage ? categoryDict.getCategoryName() : null, placeType,
e.getEventContent().length() < 21 ? e.getEventContent() : e.getEventContent().substring(NumConstant.ZERO, 20).concat(StrConstant.ELLIPSIS),
e.getLatitude(), e.getLongitude()))
.collect(Collectors.toList());
@ -396,7 +433,7 @@ public class CoverageServiceImpl implements CoverageService {
} else if (CoveragePlaceTypeEnum.ENTERPRISE_PATROL.getCode().equals(placeType)) {
// 企事业单位巡查
List<IcEnterisePatrolResultDTO> list = orgCoverageService.listEnterprisePatrol(
customerId, agencyId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize);
customerId, agencyId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize,null);
return list.stream()
.map(dc -> new CoverageAnalisisDataListResultDTO(dc.getEnterpriseId(), categoryKey,
@ -437,6 +474,17 @@ public class CoverageServiceImpl implements CoverageService {
.map(dc -> new CoverageAnalisisDataListResultDTO(dc.getId(), categoryKey,
isPage ? categoryDict.getCategoryName() : null, placeType, isPage ? dc.getName() : null, dc.getLatitude(), dc.getLongitude()))
.collect(Collectors.toList());
} else if(CoveragePlaceTypeEnum.ENTERPRISE_PATROL_UNQUALIFIED.getCode().equals(placeType)){
//最新巡查结果【0:合格 1:不合格】
List<IcEnterisePatrolResultDTO> list = orgCoverageService.listEnterprisePatrol(
customerId, agencyId, staffOrgIds, search, categoryKey, isPage, pageNo, pageSize,NumConstant.ONE_STR);
return list.stream()
.map(dc -> new CoverageAnalisisDataListResultDTO(dc.getEnterpriseId(), categoryKey,
isPage ? categoryDict.getCategoryName() : null, placeType, dc.getPlaceOrgName() ,
StringUtils.isNotBlank(dc.getLatitude()) ? dc.getLatitude() : rootAgency.getLatitude(),
StringUtils.isNotBlank(dc.getLongitude()) ? dc.getLongitude() : rootAgency.getLongitude()))
.collect(Collectors.toList());
}
return new ArrayList<>();
}
@ -591,4 +639,41 @@ public class CoverageServiceImpl implements CoverageService {
results.add(ggfwRq);
return results;
}
/**
* 五大图层左侧菜单点击事件查询人.事的分布
*
* @param formDTO
* @return
*/
@Override
public PageData<CoverageAnalisisDataListResultDTOV2> dataListLeft(CoverageAnalisisDataListLeftFormDTO formDTO) {
PageData<CoverageAnalisisDataListResultDTO> page = analysisDataList(formDTO.getCustomerId(), formDTO.getStaffId(), formDTO.getOrgId(), formDTO.getOrgType(),
formDTO.getCoverageTypes(), formDTO.getCategoryKeys(),
StrConstant.EPMETY_STR,// 搜索关键词 默认空字符串
NumConstant.ONE,
NumConstant.TWENTY,
false // 不分页
);
List<CoverageAnalisisDataListResultDTOV2> list = new ArrayList<>();
if (CollectionUtils.isNotEmpty(page.getList())) {
Map<String, List<CoverageAnalisisDataListResultDTO>> group = page.getList().stream().collect(Collectors.groupingBy(x->Optional.ofNullable(x.getLongLat()).orElse("O")));
if (MapUtils.isNotEmpty(group)) {
for (Map.Entry<String, List<CoverageAnalisisDataListResultDTO>> entry : group.entrySet()) {
if (CollectionUtils.isEmpty(entry.getValue())) {
continue;
}
CoverageAnalisisDataListResultDTOV2 res = new CoverageAnalisisDataListResultDTOV2();
res.setLatitude(entry.getValue().get(NumConstant.ZERO).getLatitude());
res.setLongitude(entry.getValue().get(NumConstant.ZERO).getLongitude());
res.setDataList(entry.getValue());
list.add(res);
}
}
}
// int totalCount = CollectionUtils.isNotEmpty(list) ? list.size() : NumConstant.ZERO;//这个是实际返回的几个坐标点
// page.getTotal()是多少条业务数据
return new PageData<>(list, page.getTotal());
}
}

14
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcEnterprisePatrolRecordDao.xml

@ -10,8 +10,13 @@
where e.CUSTOMER_ID = #{customerId}
and e.PLACE_ORG_NAME like CONCAT('%',#{search},'%')
and (e.AGENCY_ID = #{agencyId} or e.AGENCY_PIDS like CONCAT(#{staffOrgIds}, '%'))
and e.PLACE_TYPE = #{categoryKey}
<if test="'enterprise_patrol_unqualified'!= categoryKey">
and e.PLACE_TYPE = #{categoryKey}
</if>
and e.DEL_FLAG = '0'
<if test='null != latestResult and "" != latestResult'>
and e.LATEST_RESULT = #{latestResult}
</if>
</select>
<!--企事业单位巡查列表-->
@ -32,7 +37,12 @@
where e.CUSTOMER_ID = #{customerId}
and e.PLACE_ORG_NAME like CONCAT('%',#{search},'%')
and (e.AGENCY_ID = #{agencyId} or e.AGENCY_PIDS like CONCAT(#{staffOrgIds}, '%'))
and e.PLACE_TYPE = #{categoryKey}
<if test="'enterprise_patrol_unqualified'!= categoryKey">
and e.PLACE_TYPE = #{categoryKey}
</if>
and e.DEL_FLAG = '0'
<if test='null != latestResult and "" != latestResult'>
and e.LATEST_RESULT = #{latestResult}
</if>
</select>
</mapper>

15
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationDTO.java

@ -104,6 +104,21 @@ public class IcCommunitySelfOrganizationDTO implements Serializable {
*/
private String latitude;
/**
* 同步状态已同步:sync 未同步:not_sync
*/
private String syncType;
/**
* 部门ID customer_department.id
*/
private String deptId;
/**
* 部门下工作人员Id
*/
private String deptStaffId;
/**
*
*/

15
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java

@ -134,6 +134,21 @@ public class IcPartyUnitDTO implements Serializable {
*/
private String remark;
/**
* 同步状态已同步:sync 未同步:not_sync
*/
private String syncType;
/**
* 部门ID customer_department.id
*/
private String deptId;
/**
* 部门下工作人员Id
*/
private String deptStaffId;
/**
* 删除标识 0未删除1已删除
*/

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -16,6 +16,7 @@ import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.CheckStaffInfoResultDTO;
import com.epmet.dto.result.PartyUnitListResultDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
@ -166,4 +167,8 @@ public interface EpmetHeartOpenFeignClient {
*/
@PostMapping("/heart/policy/rules4ResiListAndExport/{ruleId}")
Result<ResisByPolicyRulesFormDTO.RuleList> listPolicyRules4QueryAndExport(@PathVariable("ruleId") String ruleId);
@PostMapping("/heart/icpartyunit/editpartyorcommunity")
Result editPartyOrCommunity(@RequestBody CheckStaffInfoResultDTO formDTO);
}

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -18,6 +18,7 @@ import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.CheckStaffInfoResultDTO;
import com.epmet.dto.result.PartyUnitListResultDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.demand.OptionDTO;
@ -166,4 +167,9 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result<ResisByPolicyRulesFormDTO.RuleList> listPolicyRules4QueryAndExport(String ruleId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "listPolicyRules4QueryAndExport", ruleId);
}
@Override
public Result editPartyOrCommunity(CheckStaffInfoResultDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "editPartyOrCommunity", formDTO);
}
}

16
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java

@ -22,11 +22,7 @@ import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.PartyUnitListFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.PartyTypepercentResultDTO;
import com.epmet.dto.result.PartyUnitDistributionResultDTO;
import com.epmet.dto.result.PartyUnitListResultDTO;
import com.epmet.dto.result.PartyUnitListbrieResultDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.excel.IcPartyUnitExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -312,4 +308,14 @@ public class IcPartyUnitController {
return new Result<List<PartyUnitListResultDTO>>().ok(icPartyUnitService.getAssistanceUnitList(tokenDto));
}
/**
* Desc: 联建单位社会自组织同步/取消同步到通讯录部门后相应的修改业务数据
* @author sun
*/
@PostMapping("editpartyorcommunity")
public Result editPartyOrCommunity(@RequestBody CheckStaffInfoResultDTO formDTO){
icPartyUnitService.editPartyOrCommunity(formDTO);
return new Result();
}
}

15
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcCommunitySelfOrganizationEntity.java

@ -117,4 +117,19 @@ public class IcCommunitySelfOrganizationEntity extends BaseEpmetEntity {
*/
private String remark;
/**
* 同步状态已同步:sync 未同步:not_sync
*/
private String syncType;
/**
* 部门ID customer_department.id
*/
private String deptId;
/**
* 部门下工作人员Id
*/
private String deptStaffId;
}

15
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitEntity.java

@ -105,4 +105,19 @@ public class IcPartyUnitEntity extends BaseEpmetEntity {
*/
private String remark;
/**
* 同步状态已同步:sync 未同步:not_sync
*/
private String syncType;
/**
* 部门ID customer_department.id
*/
private String deptId;
/**
* 部门下工作人员Id
*/
private String deptStaffId;
}

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java

@ -12,10 +12,7 @@ import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.PartyUnitListFormDTO;
import com.epmet.dto.form.PartyUnitListbriefFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.PartyTypepercentResultDTO;
import com.epmet.dto.result.PartyUnitDistributionResultDTO;
import com.epmet.dto.result.PartyUnitListResultDTO;
import com.epmet.dto.result.PartyUnitListbrieResultDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyUnitEntity;
import org.springframework.web.multipart.MultipartFile;
@ -182,4 +179,6 @@ public interface IcPartyUnitService extends BaseService<IcPartyUnitEntity> {
* @param form
*/
List<PartyTypepercentResultDTO> getTypepercent(PartyTypepercentFormDTO form);
void editPartyOrCommunity(CheckStaffInfoResultDTO formDTO);
}

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java

@ -25,6 +25,7 @@ import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.PointRecordResultDTO;
import com.epmet.dto.result.demand.*;
import com.epmet.entity.IcUserDemandRecEntity;
import com.epmet.entity.ServerInfoDTO;
import java.util.List;
import java.util.Map;
@ -262,4 +263,6 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
void icEventComment(IcEventCommentToDemandFromDTO formDTO);
Integer selectCountByServerId(String serverId);
ServerInfoDTO queryServiceName(String serverId, String serviceType);
}

30
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

@ -41,10 +41,12 @@ import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcCommunitySelfOrganizationEntity;
import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity;
import com.epmet.entity.IcPartyUnitEntity;
import com.epmet.excel.CommunitySelfOrgImportExcel;
import com.epmet.excel.ImportCommunitySelfOrganization;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.service.IcCommunitySelfOrganizationPersonnelService;
import com.epmet.service.IcCommunitySelfOrganizationService;
@ -66,6 +68,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
@ -97,6 +100,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Resource
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override
public PageData<IcCommunitySelfOrganizationDTO> page(Map<String, Object> params) {
@ -374,8 +379,29 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
if (icUserDemandRecDao.selectCountByServerId(formDTO.getOrgId()) > NumConstant.ZERO) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除");
}
baseDao.deleteById(formDTO.getOrgId());
personnelService.deleteByOrgId(formDTO.getOrgId());
//校验是否有同步到通讯录,是否存在工作人员下有未处理项目数据【社会自组织被同步到通讯录部门的,如果部门下人员存在未办结项目则不允许删除】
boolean bl = true;
IcCommunitySelfOrganizationEntity entity = baseDao.selectById(formDTO.getOrgId());
if (null != entity && "sync".equals(entity.getSyncType())) {
CheckStaffInfoFormDTO dto = new CheckStaffInfoFormDTO();
dto.setId(formDTO.getOrgId());
dto.setDeptId(entity.getDeptId());
dto.setDeptType("community_org");
dto.setDeptStaffId(entity.getDeptStaffId());
Result<CheckStaffInfoResultDTO> result = govOrgOpenFeignClient.notSyncDept(dto);
if (!result.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社会自组织删除,取消同步到通讯录数据失败", "社会自组织删除,取消同步到通讯录数据失败");
}
if (!result.getData().getType()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), result.getData().getMsg(), result.getData().getMsg());
}
bl = result.getData().getType();
}
if (bl) {
baseDao.deleteById(formDTO.getOrgId());
personnelService.deleteByOrgId(formDTO.getOrgId());
}
}
/**

62
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -55,13 +55,12 @@ import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.demand.ServiceStatDTO;
import com.epmet.entity.IcCommunitySelfOrganizationEntity;
import com.epmet.entity.IcPartyUnitEntity;
import com.epmet.excel.IcPartyUnitImportExcel;
import com.epmet.excel.IcPartyUnitImportFailedExcel;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.feign.*;
import com.epmet.service.IcCommunitySelfOrganizationService;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcServiceItemDictService;
import com.epmet.service.IcUserDemandRecService;
@ -78,6 +77,7 @@ import org.apache.http.entity.ContentType;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
@ -111,6 +111,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Resource
private EpmetHeartOpenFeignClient heartOpenFeignClient;
@Resource
private IcCommunitySelfOrganizationService icCommunitySelfOrganizationService;
@Resource
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override
public PageData<IcPartyUnitDTO> search(PartyUnitFormDTO formDTO) {
@ -257,8 +261,28 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
if (icUserDemandRecService.selectCountByServerId(id) > NumConstant.ZERO) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除");
}
// 逻辑删除(@TableLogic 注解)
baseDao.deleteById(id);
//校验是否有同步到通讯录,是否存在工作人员下有未处理项目数据【联建单位被同步到通讯录部门的,如果部门下人员存在未办结项目则不允许删除】
boolean bl = true;
IcPartyUnitEntity entity = baseDao.selectById(id);
if (null != entity && "sync".equals(entity.getSyncType())) {
CheckStaffInfoFormDTO dto = new CheckStaffInfoFormDTO();
dto.setId(id);
dto.setDeptId(entity.getDeptId());
dto.setDeptType("party_unit");
dto.setDeptStaffId(entity.getDeptStaffId());
Result<CheckStaffInfoResultDTO> result = govOrgOpenFeignClient.notSyncDept(dto);
if (!result.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "联建单位删除,取消同步到通讯录数据失败", "联建单位删除,取消同步到通讯录数据失败");
}
if (!result.getData().getType()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), result.getData().getMsg(), result.getData().getMsg());
}
}
if (bl) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteById(id);
}
}
/**
@ -711,4 +735,30 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
return StringUtils.join(list, StrConstant.COMMA);
}
@Override
public void editPartyOrCommunity(CheckStaffInfoResultDTO formDTO) {
//联建单位
if("party_unit".equals(formDTO.getDeptType())){
IcPartyUnitEntity partyUnitEntity = new IcPartyUnitEntity();
partyUnitEntity.setId(formDTO.getId());
partyUnitEntity.setSyncType(formDTO.getSyncType());
partyUnitEntity.setDeptId(formDTO.getDeptId());
partyUnitEntity.setDeptStaffId(formDTO.getDeptStaffId());
partyUnitEntity.setUpdatedBy(formDTO.getUserId());
partyUnitEntity.setUpdatedTime(new Date());
updateById(partyUnitEntity);
}
//社会自组织
if("community_org".equals(formDTO.getDeptType())){
IcCommunitySelfOrganizationEntity communityEntity = new IcCommunitySelfOrganizationEntity();
communityEntity.setId(formDTO.getId());
communityEntity.setSyncType(formDTO.getSyncType());
communityEntity.setDeptId(formDTO.getDeptId());
communityEntity.setDeptStaffId(formDTO.getDeptStaffId());
communityEntity.setUpdatedBy(formDTO.getUserId());
communityEntity.setUpdatedTime(new Date());
icCommunitySelfOrganizationService.updateById(communityEntity);
}
}
}

51
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java

@ -14,6 +14,8 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.dao.IcServiceFeedbackV2Dao;
import com.epmet.dao.IcServiceRecordV2Dao;
import com.epmet.dao.IcServiceScopeDao;
@ -22,19 +24,15 @@ import com.epmet.dto.IcServiceFeedbackV2DTO;
import com.epmet.dto.IcServiceRecordV2DTO;
import com.epmet.dto.IcServiceScopeV2DTO;
import com.epmet.dto.form.IcServiceRecordV2AddEditFormDTO;
import com.epmet.dto.form.SendSmsFormDTO;
import com.epmet.dto.form.ServiceRecordV2DetailFormDTO;
import com.epmet.dto.form.ServiceRecordV2ListFormDTO;
import com.epmet.dto.result.ServiceRecordV2DetailResultDTO;
import com.epmet.dto.result.ServiceRecordV2ListResultDTO;
import com.epmet.entity.HeartAttachmentEntity;
import com.epmet.entity.IcServiceFeedbackV2Entity;
import com.epmet.entity.IcServiceRecordV2Entity;
import com.epmet.entity.IcServiceScopeV2Entity;
import com.epmet.entity.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.redis.IcPartyUnitRedis;
import com.epmet.service.HeartAttachmentService;
import com.epmet.service.IcServiceFeedbackV2Service;
import com.epmet.service.IcServiceRecordV2Service;
import com.epmet.service.IcServiceScopeV2Service;
import com.epmet.service.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -44,10 +42,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 服务记录表
@ -75,6 +70,8 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl<IcServiceRecor
private IcServiceFeedbackV2Dao serviceFeedbackV2Dao;
@Autowired
private IcServiceScopeV2Dao icServiceScopeV2Dao;
@Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Override
public PageData<IcServiceRecordV2DTO> page(Map<String, Object> params) {
@ -156,7 +153,35 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl<IcServiceRecor
}
insert(entity);
// 未直接反馈的,给服务组织发送短信
// XXX社区发起一个【服务名称】服务,请服务完成后尽快反馈,谢谢合作。
if(null==formDTO.getFeedback()){
sendPhoneMsgToServiceOrg(formDTO.getCustomerId(),formDTO.getUserId(),formDTO.getServiceOrgId(),formDTO.getServiceOrgType(),formDTO.getServiceName());
}
}
/**
* 未直接反馈的给服务组织(社区自组织联建单位志愿者)发送短信
*/
private void sendPhoneMsgToServiceOrg(String customerId, String staffId, String serviceOrgId, String serviceOrgType, String serviceName) {
ServerInfoDTO serverInfoDTO = SpringContextUtils.getBean(IcUserDemandRecService.class).queryServiceName(serviceOrgId, serviceOrgType);
if (null == serverInfoDTO || StringUtils.isBlank(serverInfoDTO.getMobile()) || serverInfoDTO.getMobile().length() < 11 || serverInfoDTO.getMobile().contains("-")) {
return;
}
// XXX社区发起一个【服务名称】服务,请服务完成后尽快反馈,谢谢合作。
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, staffId);
if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyName())) {
return;
}
List<SendSmsFormDTO> smsList = new ArrayList<>();
SendSmsFormDTO sms = new SendSmsFormDTO();
sms.setCustomerId(customerId);
sms.setMobile(serverInfoDTO.getMobile());
sms.setAliyunTemplateCode(SmsTemplateConstant.COMMON_SMS_TEM);
Map<String, String> paramMap = new HashMap<>();
paramMap.put("content", String.format("%s发起一个【%s】服务,请服务完成后尽快反馈,谢谢合作。", staffInfoCacheResult.getAgencyName(), serviceName));
sms.setParamMap(paramMap);
smsList.add(sms);
messageOpenFeignClient.sendMsg(smsList);
}
@Override

14
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -441,6 +441,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
* @param mobile
*/
private void sendPhoneMsgToServer(String customerId,String staffId, String mobile) {
if (StringUtils.isBlank(mobile) || mobile.length() < 11 || mobile.contains("-")) {
return;
}
// XXX社区给您指派了一个新的需求,请查看
CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(customerId,staffId);
if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyName())) {
@ -450,13 +453,12 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
SendSmsFormDTO sms = new SendSmsFormDTO();
sms.setCustomerId(customerId);
sms.setMobile(mobile);
sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_TRANSFER);
List<String> paramsContent=new ArrayList<>();
paramsContent.add(String.format("%s给您指派了一个新的需求,请查看",staffInfoCacheResult.getAgencyName()));
sms.setParamsContent(paramsContent);
sms.setAliyunTemplateCode(SmsTemplateConstant.COMMON_SMS_TEM);
Map<String, String> paramMap = new HashMap<>();
paramMap.put("content", String.format("%s给您指派了一个新的需求,请查看", staffInfoCacheResult.getAgencyName()));
sms.setParamMap(paramMap);
smsList.add(sms);
messageOpenFeignClient.sendMsg(smsList);
}
/**
@ -465,7 +467,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
* @param serviceType
* @return
*/
private ServerInfoDTO queryServiceName(String serverId, String serviceType) {
public ServerInfoDTO queryServiceName(String serverId, String serviceType) {
String serviceName="";
String mobile="";
switch (serviceType)

8
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java

@ -37,4 +37,12 @@ public interface SmsTemplateConstant {
* 项目滞留提醒
*/
String PROJECT_OVERDUE = "SMS_206885207";
/**
* 通用的短信模板翻出来的内容
*党群e事通:XXXXX
* 参数keycontent
*/
// todo
String COMMON_SMS_TEM="";
}

6
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendSmsFormDTO.java

@ -5,7 +5,7 @@ import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* @Description
@ -35,8 +35,8 @@ public class SendSmsFormDTO implements Serializable {
/**
* 如果短信模板内有参数按序传入
*/
private List<String> paramsContent;
// private List<String> paramsContent;
private Map<String,String> paramMap;
private String customerId;
}

10
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java

@ -13,7 +13,6 @@ 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.Constant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.exception.RenException;
@ -333,16 +332,15 @@ public class SysSmsServiceImpl extends BaseServiceImpl<SysSmsDao, SysSmsEntity>
public void sendMsg(List<SendSmsFormDTO> formDTOList) {
try {
for(SendSmsFormDTO formDTO:formDTOList){
if (StringUtils.isBlank(formDTO.getAliyunTemplateCode())) {
continue;
}
SysSmsDTO sysSmsDTO = new SysSmsDTO();
sysSmsDTO.setMobile(formDTO.getMobile());
sysSmsDTO.setAliyunTemplateCode(formDTO.getAliyunTemplateCode());
sysSmsDTO.setCustomerId(formDTO.getCustomerId());
HashMap<String, String> map = new HashMap<>();
try{
if(SmsTemplateConstant.PROJECT_TRANSFER.equals(formDTO.getAliyunTemplateCode())){
map.put("params1", formDTO.getParamsContent().get(NumConstant.ZERO));
}
String paramJson = new ObjectMapper().writeValueAsString(map);
String paramJson = new ObjectMapper().writeValueAsString(formDTO.getParamMap());
sysSmsDTO.setParams(paramJson);
} catch (JsonProcessingException e) {
log.warn("sendMsg JsonProcessingException", e);

5
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleDTO.java

@ -60,6 +60,11 @@ public class GovRoleDTO implements Serializable {
*/
private Long deptId;
/**
* 是否默认角色0: 1:
*/
private String defaultRole;
/**
* 删除标识0.未删除 1.已删除
*/

5
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleEntity.java

@ -46,4 +46,9 @@ public class GovRoleEntity extends BaseEpmetEntity {
*/
private String customerId;
/**
* 是否默认角色0: 1:
*/
private String defaultRole;
}

7
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java

@ -22,6 +22,8 @@ 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.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
@ -116,6 +118,11 @@ public class GovRoleServiceImpl extends BaseServiceImpl<GovRoleDao, GovRoleEntit
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
//联建单位负责人、社区自组织负责人两个默认解释不允许删除
GovRoleEntity entity = baseDao.selectById(ids[0]);
if(null!=entity && "1".equals(entity.getDefaultRole())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "系统默认角色,不允许删除", "系统默认角色,不允许删除");
}
baseDao.deleteBatchIds(Arrays.asList(ids));
govRoleMenuService.deleteByRoleIds(ids);

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java

@ -67,5 +67,10 @@ public class AddDepartmentFormDTO implements Serializable {
*/
private String mobile;
/**
* 总人数
*/
private Integer totalUser;
}

38
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CheckStaffInfoFormDTO.java

@ -28,22 +28,48 @@ import java.io.Serializable;
public class CheckStaffInfoFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface Check extends CustomerClientShowGroup {}
public interface CheckAdd extends CustomerClientShowGroup {}
public interface CheckEdit extends CustomerClientShowGroup {}
/**
* 联建单位社会自组织Id
*/
@NotBlank(message = "id不能为空", groups = {CheckAdd.class, CheckEdit.class})
private String id;
/**
* 部门名称
*/
@NotBlank(message = "部门名称不能为空", groups = CheckAdd.class)
private String deptName;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空", groups = Check.class)
@NotBlank(message = "手机号不能为空", groups = CheckAdd.class)
private String mobile;
/**
* 人名姓名
*/
@NotBlank(message = "姓名不能为空", groups = Check.class)
@NotBlank(message = "姓名不能为空", groups = CheckAdd.class)
private String personName;
/**
* 联建单位: party_unit
* 社会自组织: community_org
*/
@NotBlank(message = "部门类型不能为空", groups = {CheckAdd.class, CheckEdit.class})
private String deptType;
/**
* 部门Id [取消同步时必填]
*/
@NotBlank(message = "部门类型不能为空", groups = CheckEdit.class)
private String deptId;
/**
* 部门下工作人员Id
*/
@NotBlank(message = "工作人员Id不能为空", groups = CheckEdit.class)
private String deptStaffId;
//token中信息
private String customerId;
private String staffId;
private String userId;
}

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java

@ -68,4 +68,10 @@ public class StaffSubmitFromDTO implements Serializable {
private String client;
private List<String> newRoles;
/**
* 部门类型
* 联建单位: party_unit
* 社会自组织: community_org
*/
private String deptType;
}

37
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CheckStaffInfoResultDTO.java

@ -17,8 +17,10 @@
package com.epmet.dto.result;
import com.epmet.dto.form.CheckStaffInfoFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@ -41,10 +43,41 @@ public class CheckStaffInfoResultDTO implements Serializable {
* 数据库中工作人员姓名返参姓名有值的则需要更新工作人员信息
*/
private String personName;
/**
* 联建单位社会自组织Id
*/
private String id;
/**
* 部门Id
*/
private String deptId;
/**
* 联建单位: party_unit
* 社会自组织: community_org
*/
private String deptType;
/**
* 部门下工作人员Id
*/
private String deptStaffId;
/**
* 已同步:sync 未同步:not_sync
*/
private String syncType;
//token中信息
private String customerId;
private String userId;
/**
* 类型后端使用
* 后端使用
*/
private Boolean key = true;
//工作人员添加入口Id(agencyId;deptId;gridId)
private String orgId = "";
//工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
private String orgType = "";
//工作人员Id,后端使用
private String staffId = "";
}

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -705,4 +705,7 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/ichouse/getOwnerHouseList")
Result<List<HouseInfoDTO>> getOwnerHouseList(@RequestBody IcHouseDTO formDTO);
@PostMapping("/gov/org/department/notsyncdept")
Result<CheckStaffInfoResultDTO> notSyncDept(@RequestBody CheckStaffInfoFormDTO formDTO);
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -459,4 +459,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getOwnerHouseList", formDTO);
}
@Override
public Result<CheckStaffInfoResultDTO> notSyncDept(CheckStaffInfoFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "notSyncDept", formDTO);
}
}

32
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java

@ -162,16 +162,42 @@ public class DepartmentController {
return new Result<List<DepartmentListResultDTO>>().ok(deptList);
}
/**
* @Author sun
* @Description 根据手机号姓名查询人员信息联建单位社会自组织新增使用
*/
@PostMapping("checkstaffinfo")
public Result<CheckStaffInfoResultDTO> checkStaffInfo(@LoginUser TokenDto tokenDTO, @RequestBody CheckStaffInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CheckStaffInfoFormDTO.Check.class);
ValidatorUtils.validateEntity(formDTO, CheckStaffInfoFormDTO.CheckAdd.class);
formDTO.setCustomerId(tokenDTO.getCustomerId());
formDTO.setStaffId(tokenDTO.getUserId());
formDTO.setUserId(tokenDTO.getUserId());
return new Result<CheckStaffInfoResultDTO>().ok(departmentService.checkStaffInfo(formDTO));
}
/**
* @Author sun
* @Description 联建单位社会自组织同步到通讯录操作
*/
@PostMapping("syncdept")
public Result<CheckStaffInfoResultDTO> syncDept(@LoginUser TokenDto tokenDTO, @RequestBody CheckStaffInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CheckStaffInfoFormDTO.CheckAdd.class);
formDTO.setCustomerId(tokenDTO.getCustomerId());
formDTO.setUserId(tokenDTO.getUserId());
return new Result<CheckStaffInfoResultDTO>().ok(departmentService.syncDept(formDTO));
}
/**
* @Author sun
* @Description 联建单位社会自组织取消同步
*/
@PostMapping("notsyncdept")
public Result<CheckStaffInfoResultDTO> notSyncDept(@LoginUser TokenDto tokenDTO, @RequestBody CheckStaffInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CheckStaffInfoFormDTO.CheckEdit.class);
formDTO.setCustomerId(tokenDTO.getCustomerId());
formDTO.setUserId(tokenDTO.getUserId());
return new Result<CheckStaffInfoResultDTO>().ok(departmentService.notSyncDept(formDTO));
}
}

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

@ -103,4 +103,8 @@ public interface DepartmentService {
List<DepartmentListResultDTO> listDepartmentListByStaffId(String staffId);
CheckStaffInfoResultDTO checkStaffInfo(CheckStaffInfoFormDTO formDTO);
CheckStaffInfoResultDTO syncDept(CheckStaffInfoFormDTO formDTO);
CheckStaffInfoResultDTO notSyncDept(CheckStaffInfoFormDTO formDTO);
}

216
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@ -33,20 +34,15 @@ import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dao.CustomerDepartmentDao;
import com.epmet.dao.CustomerStaffDepartmentDao;
import com.epmet.dao.StaffOrgRelationDao;
import com.epmet.dto.CustomerDepartmentDTO;
import com.epmet.dto.CustomerIdDTO;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.CustomerStaffDepartmentDTO;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerDepartmentEntity;
import com.epmet.entity.CustomerStaffDepartmentEntity;
import com.epmet.entity.*;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.CustomerDepartmentService;
import com.epmet.service.CustomerStaffDepartmentService;
import com.epmet.service.DepartmentService;
import com.epmet.feign.GovProjectOpenFeignClient;
import com.epmet.service.*;
import com.epmet.util.ModuleConstant;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -55,8 +51,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -86,6 +84,17 @@ public class DepartmentServiceImpl implements DepartmentService {
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private StaffOrgRelationDao staffOrgRelationDao;
@Autowired
private CustomerStaffAgencyService customerStaffAgencyService;
@Autowired
private CustomerAgencyService customerAgencyService;
@Autowired
private StaffOrgRelationService staffOrgRelationService;
@Autowired
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
@Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient;
/**
* @param formDTO
* @return
@ -294,6 +303,13 @@ public class DepartmentServiceImpl implements DepartmentService {
@Override
public CheckStaffInfoResultDTO checkStaffInfo(CheckStaffInfoFormDTO formDTO) {
CheckStaffInfoResultDTO resultDTO = new CheckStaffInfoResultDTO();
resultDTO.setCustomerId(formDTO.getCustomerId());
resultDTO.setUserId(formDTO.getUserId());
//座机号的直接返回
if(formDTO.getMobile().startsWith("0")){
resultDTO.setMsg("座机账号无法创建账号,建议使用填写手机号,否则将无法获取通知信息");
return resultDTO;
}
//1.根据手机号查询客户下工作人员信息
CustomerStaffFormDTO user = new CustomerStaffFormDTO();
user.setCustomerId(formDTO.getCustomerId());
@ -314,29 +330,29 @@ public class DepartmentServiceImpl implements DepartmentService {
if (CollectionUtils.isEmpty(list)) {
return resultDTO;
}
resultDTO.setOrgId(list.get(0).getOrgId());
resultDTO.setOrgType(list.get(0).getOrgType());
resultDTO.setStaffId(list.get(0).getStaffId());
//3.校验工作人员的注册关系【从哪里新增进来的工作人员】
//获取当前操作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getStaffId()));
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
//所属组织信息不同的给提示【所属组织不同时则不新增部门、不新增工作人员】
if (!list.get(0).getAgencyId().equals(staffInfo.getAgencyId())) {
resultDTO.setMsg("联系电话已存在其他组织工作账号中,请使用其他手机号,否则将无法获取通知信息");
resultDTO.setKey(false);
return resultDTO;
}
//从网格下添加的人给提示【网格下加的人时则不新增部门、不新增工作人员】
if ("gridId".equals(list.get(0).getOrgType())) {
if (!"agency".equals(list.get(0).getOrgType())) {
resultDTO.setMsg("联系电话已存在其他部门工作账号中,请先将该工作人员调动至本组织下,再次添加");
resultDTO.setKey(false);
return resultDTO;
}
//账号被禁用的给提示【人员被禁用的则不新增部门、不新增工作人员】
if ("disabled".equals(userResult.getData().getEnableFlag())) {
resultDTO.setMsg("该工作人员账号已被禁用,请使用其他联系电话,否则将无法获取通知信息");
resultDTO.setKey(false);
return resultDTO;
}
//姓名不一样的给反馈
@ -348,5 +364,173 @@ public class DepartmentServiceImpl implements DepartmentService {
return resultDTO;
}
@Override
@Transactional(rollbackFor = Exception.class)
public CheckStaffInfoResultDTO syncDept(CheckStaffInfoFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
//1.校验当前数据是否允许操作
CheckStaffInfoResultDTO resultDTO = checkStaffInfo(formDTO);
if(!resultDTO.getType()){
return resultDTO;
}
//2.根据校验结果操作数据
//2-1.没查到人的直接新增部门、人员
if(StringUtils.isBlank(resultDTO.getOrgType())){
//一、新增工作人员
StaffSubmitFromDTO submitDTO = ConvertUtils.sourceToTarget(formDTO, StaffSubmitFromDTO.class);
submitDTO.setName(formDTO.getPersonName());
submitDTO.setAgencyId(staffInfo.getAgencyId());
submitDTO.setGender(0);
submitDTO.setWorkType("fulltime");
Result<CustomerStaffDTO> staffResult = epmetUserOpenFeignClient.deptToAddStaff(submitDTO);
if (!staffResult.success()) {
throw new RenException("人员添加失败" + staffResult.getMsg());
}
//二、新增部门
AddDepartmentFormDTO deptDTO = new AddDepartmentFormDTO();
deptDTO.setAgencyId(staffInfo.getAgencyId());
deptDTO.setDepartmentDuty("");
deptDTO.setDepartmentName(formDTO.getDeptName());
deptDTO.setTotalUser(1);
Result<AddDepartmentResultDTO> deptResult = addDepartment(deptDTO);
//三、新增组织人员关系数据
//人员机关关系表
CustomerStaffAgencyEntity customerStaffAgencyEntity = new CustomerStaffAgencyEntity();
customerStaffAgencyEntity.setCustomerId(formDTO.getCustomerId());
customerStaffAgencyEntity.setUserId(staffResult.getData().getUserId());
customerStaffAgencyEntity.setAgencyId(staffInfo.getAgencyId());
customerStaffAgencyService.insert(customerStaffAgencyEntity);
//机关总人数加一
OrgResultDTO orgDTO = customerAgencyDao.selectAgencyDetail(staffInfo.getAgencyId(), "agency");
CustomerAgencyEntity agencyEntity = new CustomerAgencyEntity();
agencyEntity.setId(staffInfo.getAgencyId());
agencyEntity.setTotalUser(orgDTO.getTotalUser() + 1);
customerAgencyService.updateById(agencyEntity);
//工作人员注册组织关系表新增数据
StaffOrgRelationEntity staffOrgRelationEntity = new StaffOrgRelationEntity();
staffOrgRelationEntity.setCustomerId(formDTO.getCustomerId());
staffOrgRelationEntity.setPids(("".equals(orgDTO.getPids()) ? "" : orgDTO.getPids()));
staffOrgRelationEntity.setStaffId(staffResult.getData().getUserId());
staffOrgRelationEntity.setOrgId(staffInfo.getAgencyId());
staffOrgRelationEntity.setOrgType("agency");
staffOrgRelationService.insert(staffOrgRelationEntity);
//四、部门下新增人员关系数据
CustomerStaffDepartmentEntity dept = new CustomerStaffDepartmentEntity();
dept.setCustomerId(formDTO.getCustomerId());
dept.setUserId(staffResult.getData().getUserId());
dept.setDepartmentId(deptResult.getData().getDepartmentId());
customerStaffDepartmentService.insert(dept);
//修改联建单位/社会自组织业务数据
resultDTO.setId(formDTO.getId());
resultDTO.setDeptId(deptResult.getData().getDepartmentId());
resultDTO.setDeptType(formDTO.getDeptType());
resultDTO.setDeptStaffId(staffResult.getData().getUserId());
resultDTO.setSyncType("sync");
Result heartResult = epmetHeartOpenFeignClient.editPartyOrCommunity(resultDTO);
if (!heartResult.success()) {
throw new RenException("修改联建单位/社会自组织业务数据失败" + heartResult.getMsg());
}
}
//2-2.查到是组织下的人,新增部门,绑定部门人员关系
if(("agency".equals(resultDTO.getOrgType()))){
//一、更新人员基础数据[姓名 手机号信息]
CustomerStaffDTO staffDTO = new CustomerStaffDTO();
staffDTO.setCustomerId(formDTO.getCustomerId());
staffDTO.setUserId(resultDTO.getStaffId());
staffDTO.setRealName(formDTO.getPersonName());
staffDTO.setMobile(formDTO.getMobile());
staffDTO.setUpdatedTime(new Date());
staffDTO.setUpdatedBy(resultDTO.getUserId());
Result result = epmetUserOpenFeignClient.editToStaff(staffDTO);
if (!result.success()) {
throw new RenException("更新工作人员基础信息失败" + result.getMsg());
}
//二、新增部门数据
AddDepartmentFormDTO deptDTO = new AddDepartmentFormDTO();
deptDTO.setAgencyId(staffInfo.getAgencyId());
deptDTO.setDepartmentDuty("");
deptDTO.setDepartmentName(formDTO.getDeptName());
deptDTO.setTotalUser(1);
Result<AddDepartmentResultDTO> deptResult = addDepartment(deptDTO);
//三、部门下新增人员关系数据
CustomerStaffDepartmentEntity dept = new CustomerStaffDepartmentEntity();
dept.setCustomerId(formDTO.getCustomerId());
dept.setUserId(resultDTO.getStaffId());
dept.setDepartmentId(deptResult.getData().getDepartmentId());
customerStaffDepartmentService.insert(dept);
//修改联建单位/社会自组织业务数据
resultDTO.setId(formDTO.getId());
resultDTO.setDeptId(deptResult.getData().getDepartmentId());
resultDTO.setDeptType(formDTO.getDeptType());
resultDTO.setDeptStaffId(resultDTO.getStaffId());
resultDTO.setSyncType("sync");
Result heartResult = epmetHeartOpenFeignClient.editPartyOrCommunity(resultDTO);
if (!heartResult.success()) {
throw new RenException("修改联建单位/社会自组织业务数据失败" + heartResult.getMsg());
}
}
return resultDTO;
}
@Override
@Transactional(rollbackFor = Exception.class)
public CheckStaffInfoResultDTO notSyncDept(CheckStaffInfoFormDTO formDTO) {
CheckStaffInfoResultDTO resultDTO = new CheckStaffInfoResultDTO();
//1.校验当前部门下工作人员是否有代办项目
ProjectListFromDTO project = new ProjectListFromDTO();
project.setUserId(formDTO.getDeptStaffId());
Result<List<ProjectDTO>> projectResult = govProjectOpenFeignClient.staffPendingProject(project);
if (!projectResult.success()) {
throw new RenException("获取工作人员代办项目数据失败" + projectResult.getMsg());
}
if(projectResult.getData().size()>NumConstant.ZERO){
String msg = String.format("当前%s下负责人存在未办结的项目,请先将待处理项目办结后再操作",("party_unit".equals(formDTO.getDeptType())?"联建单位":"社会自组织"));
resultDTO.setMsg(msg);
}
//2.无代办项目的则删除部门、工作人员信息、修改联建单位/社会自组织业务数据
//2-1.删除部门
customerDepartmentDao.deleteById(formDTO.getId());
//2-2.删除部门人员关系数据
LambdaQueryWrapper<CustomerStaffDepartmentEntity> query = new LambdaQueryWrapper<>();
query.eq(CustomerStaffDepartmentEntity::getDepartmentId, formDTO.getDeptId());
query.eq(CustomerStaffDepartmentEntity::getUserId, formDTO.getDeptStaffId());
customerStaffDepartmentDao.delete(query);
//2-3.删除人员注册关系数据
LambdaQueryWrapper<StaffOrgRelationEntity> StaffOrgRelation = new LambdaQueryWrapper<>();
StaffOrgRelation.eq(StaffOrgRelationEntity::getOrgId, formDTO.getDeptId());
StaffOrgRelation.eq(StaffOrgRelationEntity::getStaffId, formDTO.getDeptStaffId());
staffOrgRelationDao.delete(StaffOrgRelation);
//2-4.删除工作人员数据
CustomerStaffDTO staffDTO = new CustomerStaffDTO();
staffDTO.setCustomerId(formDTO.getCustomerId());
staffDTO.setUserId(formDTO.getDeptStaffId());
staffDTO.setDelFlag(1);
staffDTO.setUpdatedTime(new Date());
staffDTO.setUpdatedBy(formDTO.getUserId());
Result result = epmetUserOpenFeignClient.editToStaff(staffDTO);
if (!result.success()) {
throw new RenException("更新工作人员基础信息失败" + result.getMsg());
}
//2-5.修改联建单位/社会自组织业务数据
resultDTO.setId(formDTO.getId());
resultDTO.setDeptId(formDTO.getDeptId());
resultDTO.setDeptType(formDTO.getDeptType());
resultDTO.setDeptStaffId(formDTO.getDeptStaffId());
resultDTO.setSyncType("not_sync");
Result heartResult = epmetHeartOpenFeignClient.editPartyOrCommunity(resultDTO);
if (!heartResult.success()) {
throw new RenException("修改联建单位/社会自组织业务数据失败" + heartResult.getMsg());
}
resultDTO.setType(true);
return resultDTO;
}
}

2
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java

@ -175,5 +175,7 @@ public interface GovProjectOpenFeignClient {
@PostMapping("gov/project/icEvent/closeprojectordemand")
Result closeProjectOrDemand(@RequestBody ColseProjectOrDemandFormDTO formDTO);
@PostMapping("gov/project/project/staffpendingproject")
Result<List<ProjectDTO>> staffPendingProject(@RequestBody ProjectListFromDTO formDTO);
}

5
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java

@ -169,4 +169,9 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli
public Result closeProjectOrDemand(ColseProjectOrDemandFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "closeProjectOrDemand",formDTO);
}
@Override
public Result<List<ProjectDTO>> staffPendingProject(ProjectListFromDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "staffPendingProject",formDTO);
}
}

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java

@ -379,4 +379,12 @@ public class ProjectController {
ValidatorUtils.validateEntity(formDTO, SatisfactionEvaluationListFormDTO.SatisfactionEvaluationListForm.class);
return new Result<PageData>().ok(projectService.satisfactionEvaluationList(formDTO));
}
/**
* Desc: 查询客户下工作人员是否有代办项目
*/
@PostMapping("staffpendingproject")
public Result<List<ProjectDTO>> staffPendingProject(@RequestBody ProjectListFromDTO fromDTO){
return new Result<List<ProjectDTO>>().ok(projectService.staffPendingProject(fromDTO));
}
}

1
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java

@ -395,4 +395,5 @@ public interface ProjectService extends BaseService<ProjectEntity> {
*/
void projectListExport(HttpServletResponse response,ProjectManageListFormDTO formDTO) throws IOException;
List<ProjectDTO> staffPendingProject(ProjectListFromDTO fromDTO);
}

9
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -3445,4 +3445,13 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
return simpleDateFormat.format(date);
}
@Override
public List<ProjectDTO> staffPendingProject(ProjectListFromDTO fromDTO) {
fromDTO.setPageNo(0);
fromDTO.setPageSize(1);
List<ProjectDTO> projectList = baseDao.selectPendList(fromDTO);
return projectList;
}
}

6
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -859,4 +859,10 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("/epmetuser/customerstaff/staffdetailinfo")
Result<CustomerStaffDTO> staffDetailInfo(@RequestBody CustomerStaffFormDTO formDTO);
@PostMapping("/epmetuser/customerstaff/depttoaddstaff")
Result<CustomerStaffDTO> deptToAddStaff(@RequestBody StaffSubmitFromDTO fromDTO);
@PostMapping("/epmetuser/customerstaff/edittostaff")
Result editToStaff(@RequestBody CustomerStaffDTO formDTO);
}

10
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -651,4 +651,14 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "staffDetailInfo", formDTO);
}
@Override
public Result<CustomerStaffDTO> deptToAddStaff(StaffSubmitFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "deptToAddStaff", fromDTO);
}
@Override
public Result editToStaff(CustomerStaffDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editToStaff", formDTO);
}
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -498,5 +498,17 @@ public class CustomerStaffController {
return new Result<CustomerStaffDTO>().ok(customerStaffService.staffDetailInfo(formDTO));
}
@PostMapping("depttoaddstaff")
public Result<CustomerStaffDTO> dedittostaffeptToAddStaff(@RequestBody StaffSubmitFromDTO fromDTO){
Result<CustomerStaffDTO> result = customerStaffService.deptToAddStaff(fromDTO);
return result;
}
@PostMapping(value = "edittostaff")
public Result editToStaff(@RequestBody CustomerStaffDTO formDTO) {
customerStaffService.editToStaff(formDTO);
return new Result();
}
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java

@ -229,4 +229,6 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @Description 工作人员基本信息
**/
List<GridMobileListResultDTO> gridStaffMobileList(List<String> staffIdList);
void edit(CustomerStaffDTO formDTO);
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java

@ -349,4 +349,8 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
List<GridMobileListResultDTO> gridMobileList(String gridId, String userId);
CustomerStaffDTO staffDetailInfo(CustomerStaffFormDTO formDTO);
Result<CustomerStaffDTO> deptToAddStaff(StaffSubmitFromDTO fromDTO);
void editToStaff(CustomerStaffDTO formDTO);
}

30
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -60,12 +60,14 @@ import com.epmet.service.UserService;
import com.epmet.util.ModuleConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.*;
import java.util.stream.Collectors;
@ -874,4 +876,32 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
return baseDao.selectListCustomerStaffInfo(formDTO);
}
@Override
public Result<CustomerStaffDTO> deptToAddStaff(StaffSubmitFromDTO fromDTO) {
//1.查询客户小程序端'工作人员'角色
GovStaffRoleDTO govRole = govStaffRoleDao.getRoleByCustomerIdAndRoleKey(fromDTO.getCustomerId(), "staff");
List<String> roles = new ArrayList<>();
roles.add(govRole.getId());
fromDTO.setRoles(roles);
//2.查询客户管理平台对应角色【联建单位负责人、社区自组织负责人】
GovRoleListDTO roleDTO = new GovRoleListDTO();
roleDTO.setName("party_unit".equals(fromDTO.getDeptType())?"联建单位负责人":"社区自组织负责人");
Result<GovRoleDTO> resultRole = govAccessFeignClient.getGovRole(roleDTO);
if (!resultRole.success()) {
throw new RenException("人员添加失败" + resultRole.getMsg());
}
List<String> newRoles = new ArrayList<>();
newRoles.add(resultRole.getData().getId());
//3.新增工作人员
Result<CustomerStaffDTO> result = addStaff(fromDTO);
return result;
}
@Override
public void editToStaff(CustomerStaffDTO formDTO) {
baseDao.edit(formDTO);
}
}

15
epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

@ -456,4 +456,19 @@
</select>
<select id="gridStaffMobileList" resultType="com.epmet.dto.result.GridMobileListResultDTO"></select>
<update id="edit">
UPDATE customer_staff
<set>
<if test ='null != realName and "" != realName'>real_name = #{realName},</if>
<if test ='null != mobile and "" != mobile'>mobile = #{mobile},</if>
<if test ='null != updatedBy and "" != updatedBy'>updated_by = #{updatedBy},</if>
<if test ='null != updatedTime'>updated_time = #{updatedTime},</if>
<if test ='null != delFlag and "" != delFlag'>del_flag = #{delFlag}</if>
</set>
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND user_id = #{userId}
</update>
</mapper>

Loading…
Cancel
Save