Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into 市北测试

release
jianjun 4 years ago
parent
commit
c75a9ec222
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/DingDingRobotConstant.java
  2. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 49
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  4. 16
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  5. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DataCheckDTO.java
  6. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ProjectDataServiceImpl.java
  7. 43
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml
  8. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java
  9. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  10. 30
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/NeighborHoodManageDelFormDTO.java
  11. 22
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodManageDelResultDTO.java
  12. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerGridConstant.java
  13. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  14. 26
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  15. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  16. 87
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  17. 43
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  18. 6
      epmet-module/resi-partymember/resi-partymember-server/pom.xml
  19. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/ResiPartyMemberApplication.java
  20. 1
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java
  21. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java
  22. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  23. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  24. 33
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  25. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  26. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  27. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  28. 13
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/DingDingRobotConstant.java

@ -22,4 +22,7 @@ public interface DingDingRobotConstant {
* 开发测试-报警群的服务监控助理机器人
*/
String DEPLOY_ROBOT="https://oapi.dingtalk.com/robot/send?access_token=5dfbde0c814a43d72e3e7f02385db87df1fc8231cff30728d8df1d1b58a00998";
String SELF_ROBOT_URL="https://oapi.dingtalk.com/robot/send?access_token=ffd7c972b0525e249283df1a16b65a8b9d0012601f3a458dfc588c2eac497bb5";
String SELF_ROBOT_SECRET=null;
}

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -250,6 +250,7 @@ public enum EpmetErrorCode {
ORG_ADD_FAILED(8919,"添加失败"),
ORG_EDIT_FAILED(8920,"编辑失败"),
ORG_DEL_FAILED(8921,"删除失败"),
NEIGHBORHOOD_DEL_FAILED(8922,""),
//通用错误码 start

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

@ -18,7 +18,6 @@ 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.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.constant.DataSourceConstant;
@ -829,15 +828,7 @@ public class GovOrgServiceImpl implements GovOrgService {
return;
}
//3.生成多sheet页excel文件并写入数据导出文件
List<Map<String,Object>> headerList = new ArrayList<>();
String titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"网格活跃度统计表");
headerList.add(getHaderMap(resultDTO.getLivelyExcelList(), titleName, "各街镇网格运行情况", GridLivelyExcel.class));
titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"活跃网格明细");
headerList.add(getHaderMap(resultDTO.getLivelyGrid(), titleName, "活跃网格统计", GridLivelyDetailExcel.LivelyGrid.class));
titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"正常运行网格明细");
headerList.add(getHaderMap(resultDTO.getOrdinaryGrid(), titleName, "正常运行网格统计", GridLivelyDetailExcel.OrdinaryGrid.class));
titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"僵尸网格明细");
headerList.add(getHaderMap(resultDTO.getLazyGrid(), titleName, "僵尸网格统计", GridLivelyDetailExcel.LazyGrid.class));
List<Map<String,Object>> headerList = getHeaderList(formDTO,agencyInfo,resultDTO);
try {
Workbook workbook = ExcelExportUtil.exportExcel(headerList, ExcelType.XSSF);
response.setCharacterEncoding("UTF-8");
@ -852,6 +843,20 @@ public class GovOrgServiceImpl implements GovOrgService {
log.error("网格活跃度导出失败", e);
}
}
private List<Map<String, Object>> getHeaderList(GridLivelyFormDTO formDTO, AgencyInfoCache agencyInfo,GridLivelyDetailExcel resultDTO) {
List<Map<String,Object>> headerList = new ArrayList<>();
String titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"网格活跃度统计表");
headerList.add(getHaderMap(resultDTO.getLivelyExcelList(), titleName, "各街镇网格运行情况", GridLivelyExcel.class));
titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"活跃网格明细");
headerList.add(getHaderMap(resultDTO.getLivelyGrid(), titleName, "活跃网格统计", GridLivelyDetailExcel.LivelyGrid.class));
titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"正常运行网格明细");
headerList.add(getHaderMap(resultDTO.getOrdinaryGrid(), titleName, "正常运行网格统计", GridLivelyDetailExcel.OrdinaryGrid.class));
titleName = excelTitleName(formDTO.getStartTime(), formDTO.getEndTime(), agencyInfo.getOrganizationName()+"僵尸网格明细");
headerList.add(getHaderMap(resultDTO.getLazyGrid(), titleName, "僵尸网格统计", GridLivelyDetailExcel.LazyGrid.class));
return headerList;
}
/**
* @Author sun
* data 业务数据集合
@ -902,25 +907,38 @@ public class GovOrgServiceImpl implements GovOrgService {
**/
@Override
public void pcworkRecordListExportSendMsg(GridLivelyFormDTO formDTO) {
List<GridLivelyExcel> data = ConvertUtils.sourceToTarget(grdiLively(formDTO), GridLivelyExcel.class);
/*List<GridLivelyExcel> data = ConvertUtils.sourceToTarget(grdiLively(formDTO), GridLivelyExcel.class);
if(CollectionUtils.isEmpty(data)){
log.warn(String.format("网格员活跃度统计数据查询为空,入参【%s】", JSON.toJSONString(formDTO)));
return;
}
ExportParams exportParams = new ExportParams();
String sheetName = excelSheetName(formDTO);
exportParams.setSheetName(sheetName);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams,
GridLivelyExcel.class, data);
GridLivelyExcel.class, data);*/
//1.获取当前组织缓存信息
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId());
if (null == agencyInfo) {
throw new RenException(String.format("获取组织缓存信息失败%s", formDTO.getAgencyId()));
}
//2.查询网格活跃度数据
GridLivelyDetailExcel resultDTO = gridActiveList(formDTO);
if (null == resultDTO || CollectionUtils.isEmpty(resultDTO.getLivelyExcelList())) {
log.warn(String.format("网格员活跃度统计数据为空,入参【%s】", JSON.toJSONString(formDTO)));
return;
}
//3.生成多sheet页excel文件并写入数据导出文件
List<Map<String,Object>> headerList = getHeaderList(formDTO,agencyInfo,resultDTO);
// 文件名
String resultDescFileName = sheetName.concat(".xls");
String sheetName = excelSheetName(formDTO);
String resultDescFileName = sheetName.concat(".xlsx");
FileItemFactory factory = new DiskFileItemFactory(16, null);
FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, resultDescFileName);
OutputStream os = null;
Result<UploadImgResultDTO> uploadResult = null;
try {
Workbook workbook = ExcelExportUtil.exportExcel(headerList, ExcelType.XSSF);
os = fileItem.getOutputStream();
workbook.write(os);
uploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
@ -957,6 +975,7 @@ public class GovOrgServiceImpl implements GovOrgService {
//小雷哥手机号:18660295251,
OapiRobotSendRequest.At at = new OapiRobotSendRequest.At();
at.setAtMobiles(Arrays.asList("18660295251"));
// at.setAtMobiles(Arrays.asList("15764229697"));
at.setIsAtAll(false);
dingTalkTextMsg.setAt(at);

16
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml

@ -1033,7 +1033,13 @@
<if test='endTime != "" and endTime != null '>
AND date_id <![CDATA[<=]]> #{endTime}
</if>
GROUP BY date_id, agency_id
<!-- 平阴的三个街道的数据在表里同一天会存在两条,一条是上报的一条是小程序统计的,所以查询时需要sum,此处就得分组 -->
<if test='dataType == "agency"'>
GROUP BY date_id, agency_id
</if>
<if test='dataType == "grid"'>
GROUP BY date_id, grid_id
</if>
ORDER BY date_id ASC
</if>
<if test='sourceType != "" and sourceType == "end" and endTime != "" and endTime != null '>
@ -1041,7 +1047,13 @@
AND date_id <![CDATA[>=]]> #{startTime}
</if>
AND date_id <![CDATA[<=]]> #{endTime}
GROUP BY date_id, agency_id
<!-- 平阴的三个街道的数据在表里同一天会存在两条,一条是上报的一条是小程序统计的,所以查询时需要sum,此处就得分组 -->
<if test='dataType == "agency"'>
GROUP BY date_id, agency_id
</if>
<if test='dataType == "grid"'>
GROUP BY date_id, grid_id
</if>
ORDER BY date_id DESC
</if>
<choose>

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DataCheckDTO.java

@ -16,10 +16,14 @@ public class DataCheckDTO implements Serializable {
* 客户ID
*/
private String customerId;
/**
* 客户ID
*/
private String agencyId;
/**
* 客户名
*/
private String customerName;
private String agencyName;
/**
* 日期
*/

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ProjectDataServiceImpl.java

@ -18,12 +18,14 @@
package com.epmet.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiRobotSendRequest;
import com.dingtalk.api.response.OapiRobotSendResponse;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.DingDingRobotConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
@ -31,6 +33,7 @@ import com.epmet.dto.screen.result.DataCheckDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
import com.epmet.service.evaluationindex.screen.ProjectDataService;
import com.epmet.util.DimIdGenerator;
import com.taobao.api.ApiException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -69,25 +72,31 @@ public class ProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectDataDao
}
}
List<DataCheckDTO> list = baseDao.getCheckResult(formDTO);
//群机器人
String url = DingDingRobotConstant.SELF_ROBOT_URL;
DingTalkClient client = new DefaultDingTalkClient(url);
if (CollectionUtils.isNotEmpty(list)) {
//发送钉钉消息
//EPMETV3群机器人
String secret = DingDingRobotConstant.V3_ROBOT_SECRET;
String url = DingDingRobotConstant.V3_ROBOT_URL;
for (DataCheckDTO dto : list) {
OapiRobotSendRequest request = new OapiRobotSendRequest();
request.setMsgtype("markdown");
OapiRobotSendRequest.Markdown markdown = new OapiRobotSendRequest.Markdown();
markdown.setTitle("平阴三个街道项目日统计数据上报比对结果");
markdown.setText("客户ID:" + dto.getCustomerId() +"\n\n"+
"> 客户名称:" + dto.getCustomerName() +"\n\n"+
"> 日期:" + dto.getDateId() + "\n\n"+
"> 上报项目数:" + dto.getReportCount() + "\n\n"+
markdown.setTitle("数据异常");
markdown.setText("数据异常:" + "\n\n" +
"> 所属客户ID:" + dto.getCustomerId() + "\n\n" +
"> 组织ID:" + dto.getAgencyId() + "\n\n" +
"> 组织名称:" + dto.getAgencyName() + "\n\n" +
"> 日期:" + dto.getDateId() + "\n\n" +
"> 上报项目数:" + dto.getReportCount() + "\n\n" +
"> 表中项目数:" + dto.getCount());
request.setMarkdown(markdown);
log.info("robot需要发送的内容为:"+markdown.getText());
HttpClientManager.getInstance().sendDingMsg(JSON.toJSONString(request),url,secret);
try {
OapiRobotSendResponse execute = client.execute(request);
log.info("=====通知结果===>" + JSON.toJSONString(execute));
} catch (ApiException e) {
log.error("sendDingMarkDownMsg exception", e);
}
}
}
}

43
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml

@ -395,16 +395,28 @@
</select>
<select id="getCheckResult" resultType="com.epmet.dto.screen.result.DataCheckDTO">
SELECT
CUSTOMER_ID AS customerId,
CUSTOMER_ID,
AGENCY_ID AS agencyId,
CASE
CUSTOMER_ID
WHEN '46c55cb862d6d5e6d05d2ab61a1cc07e' THEN
AGENCY_ID
WHEN '1258587398679126017' THEN
'榆山'
WHEN '44876154d10d7cb7affd92000f84f833' THEN
WHEN '1215437824174608386' THEN
'锦水'
WHEN '6f203e30de1a65aab7e69c058826cd80' THEN
'平阴' ELSE '孔村'
END AS customerName,
WHEN '1234085031077498881' THEN
'孔村'
WHEN 'f8d4a6af53b3fc5991ab1434b6ad39b8' THEN
'东阿镇'
WHEN 'f279343a67653fc20d8333c6b2e4dbee' THEN
'孝直镇'
WHEN 'ea78a8e9252f567517c4a8d60250c714' THEN
'安城镇'
WHEN 'c259c3b1d27f960b9b379fb2886179ba' THEN
'洪范池镇'
WHEN 'd20a7488eedf5bcfd5231c3771bc0e3d' THEN
'玫瑰镇'
ELSE '未知'
END AS agencyName,
PROJECT_TOTAL AS reportCount,
DATE_ID,
(
@ -414,21 +426,22 @@
screen_project_data
WHERE
1 = 1
AND customer_id = a.CUSTOMER_ID
AND CUSTOMER_ID = a.CUSTOMER_ID
AND ALL_PARENT_IDS LIKE CONCAT( '%', a.AGENCY_ID, '%' )
AND DEL_FLAG = '0'
AND DATE_FORMAT( PROJECT_CREATE_TIME, '%Y%m%d' ) &lt;= DATE_ID
GROUP BY
CUSTOMER_ID
AGENCY_ID
ORDER BY
CUSTOMER_ID
AGENCY_ID
) AS count
FROM
epmet_data_statistical.fact_agency_project_daily a
WHERE
1 = 1
AND del_flag = '0'
AND customer_id IN ( '2fe0065f70ca0e23ce4c26fca5f1d933', '44876154d10d7cb7affd92000f84f833', '46c55cb862d6d5e6d05d2ab61a1cc07e' )
AND AGENCY_ID IN ( '1234085031077498881', '1215437824174608386', '1258587398679126017' )
AND customer_id IN ( '2fe0065f70ca0e23ce4c26fca5f1d933', '44876154d10d7cb7affd92000f84f833', '46c55cb862d6d5e6d05d2ab61a1cc07e', '6f203e30de1a65aab7e69c058826cd80' )
AND AGENCY_ID IN ( '1234085031077498881', '1215437824174608386', '1258587398679126017', 'c259c3b1d27f960b9b379fb2886179ba', 'd20a7488eedf5bcfd5231c3771bc0e3d', 'ea78a8e9252f567517c4a8d60250c714', 'f279343a67653fc20d8333c6b2e4dbee', 'f8d4a6af53b3fc5991ab1434b6ad39b8' )
<if test='null != dateId and "" != dateId'>
AND DATE_ID = #{dateId}
</if>
@ -436,13 +449,13 @@
AND DATE_ID BETWEEN #{startDate} AND #{endDate}
</if>
GROUP BY
CUSTOMER_ID,
AGENCY_ID,
DATE_ID
HAVING
1 = 1
AND reportCount != count
ORDER BY
CUSTOMER_ID,
DATE_ID DESC
AGENCY_ID,
DATE_ID DESC
</select>
</mapper>

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java

@ -13,6 +13,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
/**
* 模块
@ -24,6 +25,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
@EnableAsync
public class EpmetHeartApplication {
public static void main(String[] args) {

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

@ -84,7 +84,6 @@ import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN;
*/
@Service
@Slf4j
@EnableAsync
public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCommunitySelfOrganizationDao, IcCommunitySelfOrganizationEntity> implements IcCommunitySelfOrganizationService {
@Autowired

30
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/NeighborHoodManageDelFormDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/3/1 4:35 下午
* @DESC
*/
@Data
public class NeighborHoodManageDelFormDTO implements Serializable {
private static final long serialVersionUID = 405799151478155056L;
public interface NeighborHoodManageDelForm{}
@NotNull(message = "ids不能为空" , groups = NeighborHoodManageDelForm.class)
private List<String> ids;
/**
* 小区neighborHood楼栋building房屋house
*/
@NotBlank(message = "type不能为空" , groups = NeighborHoodManageDelForm.class)
private String type;
}

22
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodManageDelResultDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/2 10:05 上午
* @DESC
*/
@Data
public class NeighborHoodManageDelResultDTO implements Serializable {
private static final long serialVersionUID = -4248802585738319974L;
private String neighborHoodId;
private String buildingId;
private String houseId;
private String name;
}

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerGridConstant.java

@ -19,4 +19,5 @@ public interface CustomerGridConstant {
String NEIGHBORHOOD = "neighborHood";
String BUILDING = "building";
String HOUSE = "house";
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -289,4 +289,17 @@ public class HouseController implements ResultDataResolver {
return new Result<>();
}
/**
* Desc 小区管理中批量删除
* @param formDTO
* @author zxc
* @date 2022/3/1 4:57 下午
*/
@PostMapping("delete")
public Result allDelete(@RequestBody NeighborHoodManageDelFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, NeighborHoodManageDelFormDTO.NeighborHoodManageDelForm.class);
houseService.allDelete(formDTO);
return new Result();
}
}

26
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.NeighborHoodManageDelResultDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.excel.IcHouseExcel;
import org.apache.ibatis.annotations.Mapper;
@ -74,4 +75,29 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
@Param("buildingUnitId")String buildingUnitId,
@Param("doorName")String doorName,
@Param("houseId")String houseId);
/**
* Desc: 根据小区IDs查询小区下是否有存在楼栋的
* @param ids
* @author zxc
* @date 2022/3/2 9:51 上午
*/
List<NeighborHoodManageDelResultDTO> selectExistBuildingByNeighborHoodIds(@Param("ids")List<String> ids);
/**
* Desc: 根据楼栋IDs查询楼栋下是否有存在房屋的
* @param ids
* @author zxc
* @date 2022/3/2 9:53 上午
*/
List<NeighborHoodManageDelResultDTO> selectExistHouseByBuildingIds(@Param("ids")List<String> ids);
/**
* Desc: 根据房屋ID查询名字
* @param ids
* @author zxc
* @date 2022/3/2 11:00 上午
*/
List<String> selectHouseNames(@Param("ids")List<String> ids);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java

@ -21,6 +21,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.IcHouseFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.form.NeighborHoodManageDelFormDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
@ -69,4 +70,12 @@ public interface HouseService {
List<HouseInfoDTO> queryListHouseInfo(Set<String> houseIds, String customerId);
Result dispose(InputStream inputStream, ImportInfoFormDTO formDTO, Result<ImportTaskCommonResultDTO> importTask);
/**
* Desc 小区管理中批量删除
* @param formDTO
* @author zxc
* @date 2022/3/1 4:57 下午
*/
void allDelete(NeighborHoodManageDelFormDTO formDTO);
}

87
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -19,6 +19,8 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerGridConstant;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dao.IcBuildingUnitDao;
import com.epmet.dao.IcHouseDao;
@ -31,15 +33,18 @@ import com.epmet.dto.form.IcHouseFormDTO;
import com.epmet.dto.form.ImportInfoFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.ListIcNeighborHoodFormDTO;
import com.epmet.dto.form.NeighborHoodManageDelFormDTO;
import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.NeighborHoodManageDelResultDTO;
import com.epmet.entity.IcHouseEntity;
import com.epmet.enums.HousePurposeEnums;
import com.epmet.enums.HouseRentFlagEnums;
import com.epmet.enums.HouseTypeEnums;
import com.epmet.excel.IcHouseExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.model.HouseInfoModel;
import com.epmet.model.ImportHouseInfoListener;
@ -101,6 +106,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
@Autowired
private ExecutorService executorService;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
@ -382,4 +389,84 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
});
return new Result();
}
/**
* Desc 小区管理中批量删除
* @param formDTO
* @author zxc
* @date 2022/3/1 4:57 下午
*/
@Override
public void allDelete(NeighborHoodManageDelFormDTO formDTO) {
if (CollectionUtils.isEmpty(formDTO.getIds())){
return;
}
List<String> ids = formDTO.getIds();
if (formDTO.getType().equals(CustomerGridConstant.NEIGHBORHOOD)){
List<NeighborHoodManageDelResultDTO> exists = icHouseDao.selectExistBuildingByNeighborHoodIds(ids);
if (!CollectionUtils.isEmpty(exists)){
exists.forEach(e -> {
for (int i = NumConstant.ZERO; i < ids.size(); i++) {
if (ids.get(i).equals(e.getNeighborHoodId())){
ids.remove(i);
continue;
}
}
});
}
if (!CollectionUtils.isEmpty(ids)){
icNeighborHoodDao.deleteBatchIds(ids);
}
if (!CollectionUtils.isEmpty(exists)){
String collect = exists.stream().map(m -> m.getName()).collect(Collectors.joining(","));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含楼宇信息,暂无法删除",collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}else if (formDTO.getType().equals(CustomerGridConstant.BUILDING)){
List<NeighborHoodManageDelResultDTO> exists = icHouseDao.selectExistHouseByBuildingIds(ids);
if (!CollectionUtils.isEmpty(exists)){
exists.forEach(e -> {
for (int i = NumConstant.ZERO; i < ids.size(); i++) {
if (ids.get(i).equals(e.getBuildingId())){
ids.remove(i);
continue;
}
}
});
}
if (!CollectionUtils.isEmpty(ids)){
icBuildingDao.deleteBatchIds(ids);
}
if (!CollectionUtils.isEmpty(exists)){
String collect = exists.stream().map(m -> m.getName()).collect(Collectors.joining(","));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含房屋信息,暂无法删除",collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}else if (formDTO.getType().equals(CustomerGridConstant.HOUSE)){
Result<List<String>> existUsers = epmetUserOpenFeignClient.getExistUserByHouseIds(ids);
if (!existUsers.success()){
throw new EpmetException("根据房屋IDs查询房屋下是否有存在居民失败...");
}
List<String> exists = existUsers.getData();
if (!CollectionUtils.isEmpty(exists)){
exists.forEach(e -> {
for (int i = NumConstant.ZERO; i < ids.size(); i++) {
if (ids.get(i).equals(e)){
ids.remove(i);
continue;
}
}
});
}
if (!CollectionUtils.isEmpty(ids)){
icHouseDao.deleteBatchIds(ids);
}
if (!CollectionUtils.isEmpty(exists)){
List<String> list = icHouseDao.selectHouseNames(exists);
String collect = list.stream().collect(Collectors.joining(","));
EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.setMsg(String.format("%s内包含居民信息,暂无法删除",collect));
throw new EpmetException(EpmetErrorCode.NEIGHBORHOOD_DEL_FAILED.getCode());
}
}
}
}

43
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -333,4 +333,47 @@
ih.DEL_FLAG = '0'
AND ih.ID = #{houseId}
</select>
<!-- 根据小区IDs查询小区下是否有存在楼栋的 -->
<select id="selectExistBuildingByNeighborHoodIds" resultType="com.epmet.dto.result.NeighborHoodManageDelResultDTO">
SELECT
nh.ID AS neighborHoodId,
nh.NEIGHBOR_HOOD_NAME AS name
FROM ic_neighbor_hood nh
INNER JOIN ic_building b ON (nh.id = b.NEIGHBOR_HOOD_ID AND b.DEL_FLAG = '0')
WHERE nh.DEL_FLAG = '0'
AND nh.ID IN (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
GROUP BY nh.id
</select>
<!-- 根据楼栋IDs查询楼栋下是否有存在房屋的 -->
<select id="selectExistHouseByBuildingIds" resultType="com.epmet.dto.result.NeighborHoodManageDelResultDTO">
SELECT
b.ID AS buildingId,
b.BUILDING_NAME AS name
FROM ic_building b
INNER JOIN ic_house h ON (h.BUILDING_ID = b.ID AND h.DEL_FLAG = '0')
WHERE b.DEL_FLAG = '0'
AND b.ID IN (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
GROUP BY b.id
</select>
<!-- 根据房屋ID查询名字 -->
<select id="selectHouseNames" resultType="java.lang.String">
SELECT HOUSE_NAME FROM ic_house
WHERE DEL_FLAG = '0'
AND id IN (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</select>
</mapper>

6
epmet-module/resi-partymember/resi-partymember-server/pom.xml

@ -64,12 +64,6 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>resi-partymember--client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>info.debatty</groupId>
<artifactId>java-string-similarity</artifactId>

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/ResiPartyMemberApplication.java

@ -13,6 +13,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
/**
* 模块
@ -24,6 +25,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@EnableDiscoveryClient
@EnableFeignClients
@ServletComponentScan
@EnableAsync
public class ResiPartyMemberApplication {
public static void main(String[] args) {

1
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java

@ -95,7 +95,6 @@ import java.util.stream.Collectors;
*/
@Slf4j
@Service
@EnableAsync
public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymemberStyleDao, IcPartymemberStyleEntity> implements IcPartymemberStyleService {
@Resource

8
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java

@ -4,7 +4,9 @@ import com.epmet.commons.tools.enums.IcFormCodeEnum;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Description 删除居民
@ -18,10 +20,14 @@ public class DelIcResiUserFormDTO implements Serializable {
public interface IdGroup {
}
@NotBlank(message = "icResiUserId不能为空", groups = IdGroup.class)
private String icResiUserId;
@NotNull(message = "userIds不能为空", groups = IdGroup.class)
private List<String> userIds;
@NotBlank(message = "token获取的customerId不能为空", groups = IdGroup.class)
private String customerId;
private String formCode= IcFormCodeEnum.RESI_BASE_INFO.getCode();
}

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

@ -712,4 +712,13 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("/epmetuser/statsresiwarn/list2")
Result<List<IcStatsResiResultDTO>> getPersonCategoryList(@RequestBody StatsResiListFormDTO formDTO);
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
*/
@PostMapping("/epmetuser/icresiuser/getexistuserbyhouseids")
Result<List<String>> getExistUserByHouseIds(@RequestBody List<String> ids);
}

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

@ -527,4 +527,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<List<IcStatsResiResultDTO>> getPersonCategoryList(StatsResiListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getPersonCategoryList", formDTO);
}
@Override
public Result<List<String>> getExistUserByHouseIds(List<String> ids) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getExistUserByHouseIds", ids);
}
}

33
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -189,15 +189,19 @@ public class IcResiUserController implements ResultDataResolver {
public Result delete(@LoginUser TokenDto tokenDto, @RequestBody DelIcResiUserFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, DelIcResiUserFormDTO.IdGroup.class);
icResiUserService.delete(formDTO);
//推送MQ事件
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg();
mqMsg.setCustomerId(tokenDto.getCustomerId());
mqMsg.setIcResiUser(formDTO.getIcResiUserId());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.IC_RESI_USER_DEL);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
formDTO.getUserIds().forEach(userId -> {
formDTO.setIcResiUserId(userId);
icResiUserService.delete(formDTO);
//推送MQ事件
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg();
mqMsg.setCustomerId(tokenDto.getCustomerId());
mqMsg.setIcResiUser(userId);
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.IC_RESI_USER_DEL);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
});
return new Result();
}
@ -748,4 +752,15 @@ public class IcResiUserController implements ResultDataResolver {
ValidatorUtils.validateEntity(formDTO, PersonWarnRightListFormDTO.PersonWarnRightListForm.class);
return new Result<PersonWarnRightListResultDTO>().ok(icResiUserService.personWarnRightList(formDTO,tokenDto));
}
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
*/
@PostMapping("getexistuserbyhouseids")
public Result<List<String>> getExistUserByHouseIds(@RequestBody List<String> ids){
return new Result<List<String>>().ok(icResiUserService.getExistUserByHouseIds(ids));
}
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -262,4 +262,13 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
Map<String, BigDecimal> getDataAnalyseCount(@Param("customerId") String customerId, @Param("tableName") String tableName,
@Param("columnList") List<String> columnList, @Param("id") String id, @Param("level") String level);
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
*/
List<String> getExistUserByHouseIds(@Param("ids") List<String> ids);
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -209,4 +209,11 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
*/
PersonWarnRightListResultDTO personWarnRightList(PersonWarnRightListFormDTO formDTO, TokenDto tokenDto);
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
*/
List<String> getExistUserByHouseIds(List<String> ids);
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -1204,6 +1204,17 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return result;
}
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
*/
@Override
public List<String> getExistUserByHouseIds(List<String> ids) {
return baseDao.getExistUserByHouseIds(ids);
}
/**
* @Description 居民分类 网格名 处理
* @param list

13
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -628,4 +628,17 @@
)
</if>
</select>
<!-- 根据房屋IDs查询房屋下是否有存在居民的 -->
<select id="getExistUserByHouseIds" resultType="java.lang.String">
SELECT
DISTINCT home_id
FROM ic_resi_user
WHERE DEL_FLAG = '0'
AND home_id IN (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</select>
</mapper>

Loading…
Cancel
Save