wangxianzhang 3 years ago
parent
commit
45f6ca2632
  1. 103
      epmet-cloud-generator/src/main/resources/template/index.vue.vm
  2. 17
      epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JiMuReportBriefResultDTO.java
  3. 8
      epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java
  4. 7
      epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallback.java
  5. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CoveragePlaceTypeEnum.java
  6. 16
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  7. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcPointNucleicMonitoringDao.java
  8. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcPointVaccinesInoculationDao.java
  9. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java
  10. 77
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcPointNucleicMonitoringEntity.java
  11. 102
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcPointVaccinesInoculationEntity.java
  12. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  13. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  14. 48
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  15. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  16. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  17. 22
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java
  18. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
  19. 1
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
  20. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/PingYinConstant.java
  21. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java
  22. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java
  23. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java
  24. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml
  25. 9
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  26. 7
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  27. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  28. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  29. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  30. 46
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/enums/ProjectOriginEnum.java
  31. 11
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
  32. 28
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  33. 12
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  34. 6
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java
  35. 6
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java
  36. 6
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java
  37. 8
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java
  38. 3
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/EventreportPingyinServiceImpl.java
  39. 11
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridInfoPingyinServiceImpl.java
  40. 9
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridstaffInfoPingyinServiceImpl.java
  41. 6
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridstaffWorkInfoPingyinServiceImpl.java
  42. 4
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/EventreportPingyinDao.xml
  43. 9
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridInfoPingyinDao.xml
  44. 4
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridstaffInfoPingyinDao.xml
  45. 4
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridstaffWorkInfoPingyinDao.xml
  46. 121
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java
  47. 7
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java
  48. 39
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DhTokenDTO.java
  49. 184
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVaccinePrarmeterDTO.java
  50. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/SaveCollectVisitorFormDTO.java
  51. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java
  52. 27
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhAuthFormDTO.java
  53. 29
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhCardPageFormDTO.java
  54. 23
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhChannelFormDTO.java
  55. 25
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhChannelPageFormDTO.java
  56. 25
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhDeptFormDTO.java
  57. 29
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhIdentityFormDTO.java
  58. 23
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhLoginPassFormDTO.java
  59. 23
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhNodeFormDTO.java
  60. 39
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPersonCardFormDTO.java
  61. 22
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPersonCardListFormDTO.java
  62. 22
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPersonDelFormDTO.java
  63. 39
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPersonFormDTO.java
  64. 23
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPersonImgFormDTO.java
  65. 25
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPersonPageFormDTO.java
  66. 27
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPlanFormDTO.java
  67. 25
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPlanPageFormDTO.java
  68. 21
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPublicKeyFormDTO.java
  69. 14
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitListFormDTO.java
  70. 24
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitVisitorChartFormDTO.java
  71. 51
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitVisitorFormDTO.java
  72. 14
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitorInfoFormDTO.java
  73. 23
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DhChannelResultDTO.java
  74. 30
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VisitVisitorChartResultDTO.java
  75. 80
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java
  76. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  77. 82
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccinePrarmeterController.java
  78. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectVisitorDao.java
  79. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  80. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java
  81. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java
  82. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserTransferRecordDao.java
  83. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccinePrarmeterDao.java
  84. 154
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVaccinePrarmeterEntity.java
  85. 117
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVaccinePrarmeterExcel.java
  86. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcVaccinePrarmeterRedis.java
  87. 53
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectVisitorService.java
  88. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java
  89. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java
  90. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserTransferRecordService.java
  91. 78
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccinePrarmeterService.java
  92. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  93. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java
  94. 56
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectVisitorServiceImpl.java
  95. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  96. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java
  97. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java
  98. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java
  99. 87
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccinePrarmeterServiceImpl.java
  100. 768
      epmet-user/epmet-user-server/src/main/java/com/epmet/util/dh/Base64Util.java

103
epmet-cloud-generator/src/main/resources/template/index.vue.vm

@ -1,52 +1,52 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-${moduleName}__${pathName}}">
<div class="mod-${moduleName}__${pathName}} resi-container">
<el-card ref="searchCard" class="search-card">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.${pk.attrname}" placeholder="${pk.attrname}" clearable></el-input>
<el-input size="small" v-model="dataForm.${pk.attrname}" placeholder="${pk.attrname}" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('${moduleName}:${pathName}:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('${moduleName}:${pathName}:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
<el-button type="primary" size="small" @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
</el-card>
<el-card class="resi-card-table">
<div class="resi-row-btn">
<el-button class="diy-button--add" type="primary" size="small" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
<el-button class="diy-button--add" type="danger" size="small" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</div>
<el-table v-loading="dataListLoading" class="resi-table" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%" :height="tableHeight">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
#foreach($column in $columns)
<el-table-column prop="${column.attrname}" label="${column.comments}" header-align="center" align="center"></el-table-column>
#end
#foreach($column in $columns)
<el-table-column prop="${column.attrname}" label="${column.comments}" header-align="center" align="center"></el-table-column>
#end
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('${moduleName}:${pathName}:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('${moduleName}:${pathName}:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</el-card>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './'
export default {
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './${pathName}-add-or-update'
import { mapGetters } from 'vuex'
export default {
mixins: [mixinViewModule],
data () {
return {
@ -56,13 +56,52 @@
deleteURL: '/${moduleName}/${pathName}',
deleteIsBatch: true
},
dataForm: {;
dataForm: {
${pk.attrname}: ''
}
}
},
components: {
AddOrUpdate
},
computed: {
...mapGetters(["clientHeight", "iframeHeight"]),
tableHeight() {
const h = this.clientHeight - 360 + this.iframeHeight;
const _h = this.clientHeight - 360;
return this.$store.state.inIframe ? h : _h;
},
}
}
</script>
<style lang="scss" scoped>
@import "@/assets/scss/buttonstyle.scss";
.resi-container .resi-card-table {
::v-deep .el-table th {
color: #fff;
background-color: rgba(33, 149, 254, 1);
}
}
.resi-table {
::v-deep .el-button--text {
text-decoration: underline;
}
}
.search-card {
.el-card__body {
padding: 20px 20px 0 20px;
}
}
.resi-row-btn {
margin-bottom: 13px;
.upload-btn {
display: inline-block;
margin: 0 10px;
}
}
</style>

17
epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/dtos/result/JiMuReportBriefResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.commons.feignclient.dtos.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 报表简要信息result dto
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class JiMuReportBriefResultDTO {
private String id;
private String code;
private String name;
}

8
epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/JiMuReportOpenFeignClient.java

@ -3,6 +3,7 @@ package com.epmet.commons.feignclient.feigns;
import com.epmet.commons.feignclient.dtos.JiMuPage;
import com.epmet.commons.feignclient.dtos.JiMuResult;
import com.epmet.commons.feignclient.dtos.form.JimuReportExportRequestDTO;
import com.epmet.commons.feignclient.dtos.result.JiMuReportBriefResultDTO;
import com.epmet.commons.feignclient.dtos.result.JiMuReportDetailResultDTO;
import com.epmet.commons.feignclient.dtos.result.JimuReportDbDataResultDTO;
import com.epmet.commons.feignclient.dtos.result.JimuReportFieldTreeResultDTO;
@ -44,4 +45,11 @@ public interface JiMuReportOpenFeignClient {
@PostMapping("jmreport/exportAllExcelStream")
Response exportAllExcelStream(JimuReportExportRequestDTO param);
/**
* 报表简要信息
* @return
*/
@GetMapping("jmreport/get/{report-id}")
JiMuResult<JiMuReportBriefResultDTO> getReportBrief(@PathVariable("report-id") String reportId);
}

7
epmet-commons/epmet-commons-feignclient/src/main/java/com/epmet/commons/feignclient/feigns/fallback/JiMuReportOpenFeignClientFallback.java

@ -3,6 +3,7 @@ package com.epmet.commons.feignclient.feigns.fallback;
import com.epmet.commons.feignclient.dtos.JiMuPage;
import com.epmet.commons.feignclient.dtos.JiMuResult;
import com.epmet.commons.feignclient.dtos.form.JimuReportExportRequestDTO;
import com.epmet.commons.feignclient.dtos.result.JiMuReportBriefResultDTO;
import com.epmet.commons.feignclient.dtos.result.JiMuReportDetailResultDTO;
import com.epmet.commons.feignclient.dtos.result.JimuReportDbDataResultDTO;
import com.epmet.commons.feignclient.dtos.result.JimuReportFieldTreeResultDTO;
@ -48,4 +49,10 @@ public class JiMuReportOpenFeignClientFallback implements JiMuReportOpenFeignCli
JiMuResult rst = new JiMuResult<>(false, "请求失败", 200, null,null);
return rst;
}
@Override
public JiMuResult<JiMuReportBriefResultDTO> getReportBrief(String reportID) {
JiMuResult rst = new JiMuResult<>(false, "请求失败", 200, null,null);
return rst;
}
}

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CoveragePlaceTypeEnum.java

@ -18,7 +18,9 @@ public enum CoveragePlaceTypeEnum {
VOLUNTEER("volunteer", "志愿者"),
GROUP_RENT("group_rent", "群租房"),
EVENT("event", "城市管理事件"),
ZHZL_RQ("zhzl_rq", "综合治理人群");
ZHZL_RQ("zhzl_rq", "综合治理人群"),
NUCLEIC_POINT("nucleic_point", "核酸检测点"),
VACCINE_POINT("vaccine_point", "疫苗接种点");
private final String code;
private final String name;

16
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -856,4 +856,20 @@ public class RedisKeys {
}
return rootPrefix.concat("staffbaseinfo:")+userId;
}
/**
* 大华publicKey
*/
public static String getDhPublicKey() {
return rootPrefix.concat("dh:public");
}
/**
* 大华token
*/
public static String getDhToken() {
return rootPrefix.concat("dh:token");
}
}

17
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcPointNucleicMonitoringDao.java

@ -0,0 +1,17 @@
package com.epmet.dataaggre.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.entity.epmetuser.IcPointNucleicMonitoringEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 核酸监测点
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-20
*/
@Mapper
public interface IcPointNucleicMonitoringDao extends BaseDao<IcPointNucleicMonitoringEntity> {
}

17
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcPointVaccinesInoculationDao.java

@ -0,0 +1,17 @@
package com.epmet.dataaggre.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.entity.epmetuser.IcPointVaccinesInoculationEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 疫苗接种点
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-20
*/
@Mapper
public interface IcPointVaccinesInoculationDao extends BaseDao<IcPointVaccinesInoculationEntity> {
}

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java

@ -86,4 +86,5 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
CustomerGridDTO getGridInfo(@Param("gridId") String gridId);
List<ScreenCustomerGridDTO> getSubGridList(@Param("customerId") String customerId, @Param("agencyId") String agencyId);
List<ScreenCustomerGridDTO> getAllSubGridList(@Param("customerId") String customerId, @Param("agencyId") String agencyId);
}

77
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcPointNucleicMonitoringEntity.java

@ -0,0 +1,77 @@
package com.epmet.dataaggre.entity.epmetuser;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 核酸监测点
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_point_nucleic_monitoring")
public class IcPointNucleicMonitoringEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 所属组织ID
*/
private String orgId;
/**
* 所属组织名称
*/
private String orgName;
/**
* 组织ID上级
*/
private String pid;
/**
* 组织ID所有上级
*/
private String pids;
/**
* 核酸监测点名称
*/
private String name;
/**
* 服务时间
*/
private String serveTime;
/**
* 咨询电话
*/
private String mobile;
/**
* 监测点地址
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
}

102
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcPointVaccinesInoculationEntity.java

@ -0,0 +1,102 @@
package com.epmet.dataaggre.entity.epmetuser;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 疫苗接种点
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-20
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_point_vaccines_inoculation")
public class IcPointVaccinesInoculationEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 所属组织ID
*/
private String orgId;
/**
* 所属组织名称
*/
private String orgName;
/**
* 组织ID上级
*/
private String pid;
/**
* 组织ID所有上级
*/
private String pids;
/**
* 疫苗接种点名称
*/
private String name;
/**
* 接种日期
*/
private String inoculationDate;
/**
* 接种上午开始时间
*/
private String moStartTime;
/**
* 接种上午结束时间
*/
private String moEndTime;
/**
* 接种下午开始时间
*/
private String afStartTime;
/**
* 接种下午结束时间
*/
private String afEndTime;
/**
* 暂无疫苗12
*/
private String noAvailableVaccines;
/**
* 咨询电话
*/
private String mobile;
/**
* 接种点地址
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
}

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -2011,10 +2011,15 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
}
//2.查询组织信息,判断查询下级组织还是网格数据
ScreenAgencyOrGridListDTO agencyGrid = indexService.getSubAgencyOrGridList(formDTO.getAgencyId(), formDTO.isExport());
//2022.8.17 屏蔽查询组织、网格逻辑,直接以org库的组织网格为准
ScreenAgencyOrGridListDTO agencyGrid = govOrgService.getSubAgencyOrGridList(formDTO.getCustomerId(), formDTO.getAgencyId(), formDTO.isExport());
if (null == agencyGrid) {
return new CustomerDataManageResultDTO();
}
/*ScreenAgencyOrGridListDTO agencyGrid = indexService.getSubAgencyOrGridList(formDTO.getAgencyId(), formDTO.isExport());
if (null == agencyGrid) {
return new CustomerDataManageResultDTO();
}*/
//组织或网格Id集合
List<String> idList = agencyGrid.getAgencyGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getOrgId).collect(Collectors.toList());
formDTO.setDataType(!OrgLevelEnum.COMMUNITY.getCode().equals(agencyGrid.getLevel()) ? OrgTypeEnum.AGENCY.getCode() : OrgTypeEnum.GRID.getCode());
@ -2329,7 +2334,7 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
}
//2.查询组织信息,判断要查询下级是组织还是网格数据
ScreenAgencyOrGridListDTO agencyGrid = govOrgService.getSubAgencyOrGridList(formDTO.getCustomerId(), formDTO.getAgencyId());
ScreenAgencyOrGridListDTO agencyGrid = govOrgService.getSubAgencyOrGridList(formDTO.getCustomerId(), formDTO.getAgencyId(), false);
if (null == agencyGrid) {
return new ArrayList<>();
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java

@ -15,6 +15,8 @@ import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.MemberProjectInfoResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO;
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity;
import com.epmet.dataaggre.entity.epmetuser.IcPointNucleicMonitoringEntity;
import com.epmet.dataaggre.entity.epmetuser.IcPointVaccinesInoculationEntity;
import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.UserBaseInfoDTO;
@ -240,4 +242,12 @@ public interface EpmetUserService {
List<IcResiUserEntity> listVolunteers(String customerId, String agencyId, String staffOrgIds, String search, String resiCategory);
List<NowStatsDataResultDTO> getNowResiUser(NowStatsDataFormDTO formDTO);
Integer countVaccinePoint(String customerId, String agencyId, String staffOrgIds, String search);
Integer countNucleicPoint(String customerId, String agencyId, String staffOrgIds, String search);
List<IcPointVaccinesInoculationEntity> listVaccinePoints(String customerId, String agencyId, String staffOrgIds, String search);
List<IcPointNucleicMonitoringEntity> listNucleicPoints(String customerId, String agencyId,String staffOrgIds, String search);
}

48
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -94,6 +94,10 @@ public class EpmetUserServiceImpl implements EpmetUserService {
private CustomerFootBarService customerFootBarService;
@Resource
private RegisterRelationDao registerRelationDao;
@Resource
private IcPointVaccinesInoculationDao pointVaccinesInoculationDao;
@Resource
private IcPointNucleicMonitoringDao pointNucleicMonitoringDao;
/**
* @Description 根据UserIds查询
@ -923,4 +927,48 @@ public class EpmetUserServiceImpl implements EpmetUserService {
List<NowStatsDataResultDTO> list = registerRelationDao.selectNowResiUser(formDTO);
return list;
}
@Override
public Integer countVaccinePoint(String customerId, String agencyId, String staffOrgIds, String search) {
LambdaQueryWrapper<IcPointVaccinesInoculationEntity> query = new LambdaQueryWrapper<>();
query.eq(IcPointVaccinesInoculationEntity::getCustomerId, customerId);
query.and(w -> w.likeRight(IcPointVaccinesInoculationEntity::getPids, staffOrgIds)
.or()
.eq(IcPointVaccinesInoculationEntity::getOrgId, agencyId));
query.like(StringUtils.isNotBlank(search), IcPointVaccinesInoculationEntity::getName, search);
return pointVaccinesInoculationDao.selectCount(query);
}
@Override
public Integer countNucleicPoint(String customerId, String agencyId, String staffOrgIds, String search) {
LambdaQueryWrapper<IcPointNucleicMonitoringEntity> query = new LambdaQueryWrapper<>();
query.eq(IcPointNucleicMonitoringEntity::getCustomerId, customerId);
query.and(w -> w.likeRight(IcPointNucleicMonitoringEntity::getPids, staffOrgIds)
.or()
.eq(IcPointNucleicMonitoringEntity::getOrgId, agencyId));
query.like(StringUtils.isNotBlank(search), IcPointNucleicMonitoringEntity::getName, search);
return pointNucleicMonitoringDao.selectCount(query);
}
@Override
public List<IcPointVaccinesInoculationEntity> listVaccinePoints(String customerId, String agencyId, String staffOrgIds, String search) {
LambdaQueryWrapper<IcPointVaccinesInoculationEntity> query = new LambdaQueryWrapper<>();
query.eq(IcPointVaccinesInoculationEntity::getCustomerId, customerId);
query.and(w -> w.likeRight(IcPointVaccinesInoculationEntity::getPids, staffOrgIds)
.or()
.eq(IcPointVaccinesInoculationEntity::getOrgId, agencyId));
query.like(StringUtils.isNotBlank(search), IcPointVaccinesInoculationEntity::getName, search);
return pointVaccinesInoculationDao.selectList(query);
}
@Override
public List<IcPointNucleicMonitoringEntity> listNucleicPoints(String customerId, String agencyId, String staffOrgIds, String search) {
LambdaQueryWrapper<IcPointNucleicMonitoringEntity> query = new LambdaQueryWrapper<>();
query.eq(IcPointNucleicMonitoringEntity::getCustomerId, customerId);
query.and(w -> w.likeRight(IcPointNucleicMonitoringEntity::getPids, staffOrgIds)
.or()
.eq(IcPointNucleicMonitoringEntity::getOrgId, agencyId));
query.like(StringUtils.isNotBlank(search), IcPointNucleicMonitoringEntity::getName, search);
return pointNucleicMonitoringDao.selectList(query);
}
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -290,6 +290,6 @@ public interface GovOrgService {
List<ResourceInfoResultDTO> getEnterpriseInfos(CoverageHomeSearchFormDTO formDTO);
Integer getEnterpriseInfosCount(CoverageHomeSearchFormDTO formDTO);
ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId);
ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId, Boolean isGetSubAllGrid);
}

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

@ -1473,7 +1473,7 @@ public class GovOrgServiceImpl implements GovOrgService {
}
@Override
public ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId) {
public ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId, Boolean isGetSubAllGrid) {
ScreenAgencyOrGridListDTO resultDTO = new ScreenAgencyOrGridListDTO();
List<ScreenAgencyOrGridListDTO.AgencyGrid> agencyGridList = new ArrayList<>();
//1.查询组织信息
@ -1485,10 +1485,22 @@ public class GovOrgServiceImpl implements GovOrgService {
//2.根据组织级别判断查询直属组织或网格列表
List<ScreenCustomerAgencyDTO> agencyList = new ArrayList<>();
List<ScreenCustomerGridDTO> gridList = new ArrayList<>();
//组织级别为街道的查询下级所有网格
if (isGetSubAllGrid && (OrgLevelEnum.STREET.getCode().equals(dto.getLevel()))) {
gridList = customerGridDao.getAllSubGridList(customerId, agencyId);
List<ScreenAgencyOrGridListDTO.AgencyGrid> allGridList = new ArrayList<>();
gridList.forEach(gr -> {
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getGridId());
org.setOrgName(gr.getGridName());
allGridList.add(org);
});
resultDTO.setAllGridList(allGridList);
}
if (!"community".equals(dto.getLevel())) {
//2-1.直属下级组织列表
agencyList = customerAgencyDao.getSubAgencyListByAgency(customerId, agencyId);
agencyList.forEach(gr->{
agencyList.forEach(gr -> {
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getAgencyId());
org.setOrgName(gr.getAgencyName());
@ -1497,7 +1509,7 @@ public class GovOrgServiceImpl implements GovOrgService {
} else {
//2-2.直属下级网格列表
gridList = customerGridDao.getSubGridList(customerId, agencyId);
gridList.forEach(gr->{
gridList.forEach(gr -> {
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getGridId());
org.setOrgName(gr.getGridName());

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

@ -30,6 +30,8 @@ import com.epmet.dataaggre.dto.govorg.form.DataListLeftSubTotalFormDTO;
import com.epmet.dataaggre.dto.govorg.form.SearchDetailFormDTO;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.epmetuser.IcPointNucleicMonitoringEntity;
import com.epmet.dataaggre.entity.epmetuser.IcPointVaccinesInoculationEntity;
import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity;
import com.epmet.dataaggre.entity.govorg.*;
import com.epmet.dataaggre.entity.govproject.IcEventEntity;
@ -628,6 +630,12 @@ public class CoverageServiceImpl implements CoverageService {
// 志愿者
String[] parts = categoryKey.split("_");
return epmetUserService.countVolunteers(customerId, agencyId, staffOrgIds, search, parts[1]);
} else if (CoveragePlaceTypeEnum.VACCINE_POINT.getCode().equals(placeType)) {
// 疫苗接种点
return epmetUserService.countVaccinePoint(customerId, agencyId, staffOrgIds, search);
} else if (CoveragePlaceTypeEnum.NUCLEIC_POINT.getCode().equals(placeType)) {
// 核酸检测点
return epmetUserService.countNucleicPoint(customerId, agencyId, staffOrgIds, search);
}
return 0;
@ -805,6 +813,20 @@ public class CoverageServiceImpl implements CoverageService {
coordinates[1], coordinates[0]);
}).collect(Collectors.toList());
} else if (CoveragePlaceTypeEnum.VACCINE_POINT.getCode().equals(placeType)) {
// 疫苗接种点
List<IcPointVaccinesInoculationEntity> vps = epmetUserService.listVaccinePoints(customerId, agencyId, staffOrgIds, search);
return vps.stream()
.map(vp -> new CoverageAnalisisDataListResultDTO(vp.getId(), categoryKey, isPage ? categoryDict.getCategoryName() : null,
placeType, vp.getName(), vp.getLatitude(), vp.getLongitude()))
.collect(Collectors.toList());
} else if (CoveragePlaceTypeEnum.NUCLEIC_POINT.getCode().equals(placeType)) {
// 核酸检测点
List<IcPointNucleicMonitoringEntity> nps = epmetUserService.listNucleicPoints(customerId, agencyId, staffOrgIds, search);
return nps.stream()
.map(np -> new CoverageAnalisisDataListResultDTO(np.getId(), categoryKey, isPage ? categoryDict.getCategoryName() : null,
placeType, np.getName(), np.getLatitude(), np.getLongitude()))
.collect(Collectors.toList());
}
return new ArrayList<>();
}

17
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml

@ -194,6 +194,23 @@
del_flag = '0'
AND customer_id = #{customerId}
AND pid = #{agencyId}
ORDER BY pid, grid_name
</select>
<select id="getAllSubGridList" resultType="com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO">
SELECT
customer_id AS customerId,
id AS gridId,
grid_name AS gridName,
pid AS parentAgencyId,
pids AS allParentIds
FROM
customer_grid
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND pids LIKE concat('%',#{agencyId},'%')
ORDER BY pid, grid_name
</select>
</mapper>

1
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java

@ -206,4 +206,5 @@ public class ScreenProjectDataDTO implements Serializable {
private String orgIdPath;
private String finishOrgType;
private Date processTime;
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/PingYinConstant.java

@ -18,4 +18,8 @@ public interface PingYinConstant {
String TEST_PING_YIN_CUSTOMER_ID = "78e2b2227c07de1fe54da14e2b2d9eb6";
String PROD_PING_YIN_CUSTOMER_ID = "6f203e30de1a65aab7e69c058826cd80";
String KC = "2fe0065f70ca0e23ce4c26fca5f1d933";
String YS = "46c55cb862d6d5e6d05d2ab61a1cc07e";
String JS = "44876154d10d7cb7affd92000f84f833";
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java

@ -5,6 +5,7 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.constant.PingYinConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dto.basereport.form.EventInfoFormDTO;
import com.epmet.dto.basereport.result.EventInfoResultDTO;
@ -243,7 +244,7 @@ public class DataReportingServiceImpl implements DataReportingService {
if (CollectionUtils.isNotEmpty(formDTO.getProjectId())) {
list = projectList.stream().map(project -> {
EventInfoResultDTO dto = getEventInfoResultDTO(project, finalEpmetCodeMap, codeMap);
ScreenCustomerGridDTO grid = screenCustomerGridService.getGridById(project.getOrgId());
CustomerGridDTO grid = customerGridService.getGridById(project.getOrgId());
dto.setOrgId(project.getOrgId());
if (null != grid) {
dto.setOrgCode(grid.getCode());
@ -254,10 +255,10 @@ public class DataReportingServiceImpl implements DataReportingService {
} else {
//项目ID不为空时,提前取出客户下的组织和网格
Map<String, ScreenCustomerAgencyEntity> agencyMap = screenCustomerAgencyService.getAgencyList(formDTO.getCustomerId());
Map<String, ScreenCustomerGridDTO> gridMap = screenCustomerGridService.getGridList(formDTO.getCustomerId());
Map<String, CustomerGridDTO> gridMap = customerGridService.getGridMap(PingYinConstant.PROD_PING_YIN_CUSTOMER_ID);
list = projectList.stream().map(project -> {
EventInfoResultDTO dto = getEventInfoResultDTO(project, finalEpmetCodeMap, codeMap);
ScreenCustomerGridDTO grid = gridMap.get(project.getOrgId());
CustomerGridDTO grid = gridMap.get(project.getOrgId());
dto.setOrgId(project.getOrgId());
if (null != grid) {
dto.setOrgCode(grid.getCode());
@ -319,12 +320,16 @@ public class DataReportingServiceImpl implements DataReportingService {
dto.setHappenPlace(project.getProjectAddress());
dto.setEventDescription(project.getProjectContent());
dto.setSuccessfulOrNo(ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())?"Y":"N");
if (ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())) {
dto.setStatus(getProjectStatus(project.getProjectStatusCode()));
dto.setCompleteTime(project.getCloseCaseTime());
if (ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode()) ||
ProjectConstant.CLOSED.equals(project.getProjectStatusCode())) {
//办结组织是机关时,办结层级为机关的层级
if (OrgTypeConstant.AGENCY.equals(project.getFinishOrgType())) {
dto.setWaysOfResolving(ProjectConstant.PROJECT_REPORT);
//如果是孔村的项目办结层级需要降一级
if("2fe0065f70ca0e23ce4c26fca5f1d933".equals(project.getCustomerId())) {
if(PingYinConstant.KC.equals(project.getCustomerId())) {
if (StringUtils.isNotBlank(project.getFinishOrgLevel())) {
switch (project.getFinishOrgLevel()) {
case OrgTypeConstant.DISTRICT:
@ -355,9 +360,12 @@ public class DataReportingServiceImpl implements DataReportingService {
//办结组织是网格时,办结层级为网格
dto.setCompleteLevel("5");
}
if (ProjectConstant.CLOSED.equals(project.getProjectStatusCode()) &&(PingYinConstant.KC.equals(project.getCustomerId()) ||
PingYinConstant.YS.equals(project.getCustomerId()) || PingYinConstant.JS.equals(project.getCustomerId()))) {
dto.setCompleteTime(project.getProcessTime());
}
}
dto.setStatus(getProjectStatus(project.getProjectStatusCode()));
dto.setCompleteTime(project.getCloseCaseTime());
dto.setLat(project.getLatitude());
dto.setLng(project.getLongitude());
dto.setWaysOfResolving(ProjectConstant.PROJECT_SELF_CLOSED);

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java

@ -15,6 +15,7 @@ import com.epmet.entity.org.CustomerGridEntity;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface CustomerGridService extends BaseService<CustomerGridEntity> {
/**
@ -106,4 +107,9 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @Description 查询客户下有效网格列表
**/
List<DimGridDTO> gridListByCustomerId(String customerId);
CustomerGridDTO getGridById(String gridId);
Map<String, CustomerGridDTO> getGridMap(String customerId);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java

@ -1,8 +1,10 @@
package com.epmet.service.org.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.org.CustomerGridDao;
import com.epmet.dto.group.AgencyDTO;
@ -18,12 +20,13 @@ import com.epmet.dto.user.result.GridUserInfoDTO;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.service.Issue.IssueService;
import com.epmet.service.org.CustomerGridService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
@DataSource(DataSourceConstant.GOV_ORG)
@ -157,4 +160,20 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
return customerGridDao.gridListByCustomerId(customerId);
}
@Override
public CustomerGridDTO getGridById(String gridId) {
return ConvertUtils.sourceToTarget(baseDao.selectById(gridId), CustomerGridDTO.class);
}
@Override
public Map<String, CustomerGridDTO> getGridMap(String customerId) {
LambdaQueryWrapper<CustomerGridEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CustomerGridEntity::getCustomerId, customerId);
List<CustomerGridEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
return ConvertUtils.sourceToTarget(list, CustomerGridDTO.class).stream().collect(Collectors.toMap(CustomerGridDTO::getId, Function.identity()));
}
}

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

@ -300,7 +300,8 @@
b.HANDLER_ID AS finishOrg,
b.HANDLER_TYPE AS finishOrgType,
b.ORG_ID_PATH AS orgIdPath,
c.`LEVEL` AS finishOrgLevel
c.`LEVEL` AS finishOrgLevel,
b.PROCESS_TIME
FROM
screen_project_data a
LEFT JOIN (
@ -309,12 +310,13 @@
PROJECT_ID,
HANDLER_ID,
HANDLER_TYPE,
ORG_ID_PATH
ORG_ID_PATH,
PROCESS_TIME
FROM
screen_project_process spp
WHERE
(( spp.CUSTOMER_ID = '2fe0065f70ca0e23ce4c26fca5f1d933' OR spp.CUSTOMER_ID = '44876154d10d7cb7affd92000f84f833' OR spp.CUSTOMER_ID = '46c55cb862d6d5e6d05d2ab61a1cc07e' )
AND OPERATION = 'closed_case')
AND (OPERATION = 'closed_case' OR OPERATION = 'close'))
OR
(( spp.CUSTOMER_ID != '2fe0065f70ca0e23ce4c26fca5f1d933' AND spp.CUSTOMER_ID != '44876154d10d7cb7affd92000f84f833' AND spp.CUSTOMER_ID != '46c55cb862d6d5e6d05d2ab61a1cc07e' )
AND OPERATION = 'close')

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

@ -171,4 +171,13 @@ public interface EpmetHeartOpenFeignClient {
@PostMapping("/heart/icpartyunit/editpartyorcommunity")
Result editPartyOrCommunity(@RequestBody CheckStaffInfoResultDTO formDTO);
/**
* desc:根据来源id 删除需求 只删主表
* @param originId
* @param origin
* @return
*/
@PostMapping("/heart/userdemand/deleteByOriginId/{originId}/{origin}")
Result<Integer> deleteUserDemandByOriginId(@PathVariable("originId") String originId, @PathVariable("origin")String origin);
}

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

@ -13,7 +13,6 @@ import com.epmet.dto.form.IcDemandFormDTO;
import com.epmet.dto.form.PartyUnitListFormDTO;
import com.epmet.dto.form.demand.DemandRecId;
import com.epmet.dto.form.demand.IcEventCommentToDemandFromDTO;
import com.epmet.dto.form.demand.ServiceItemSelectFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO;
@ -21,7 +20,6 @@ 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;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
@ -172,4 +170,9 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result editPartyOrCommunity(CheckStaffInfoResultDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "editPartyOrCommunity", formDTO);
}
@Override
public Result<Integer> deleteUserDemandByOriginId(String originId, String origin) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "deleteUserDemandByOriginId", originId,origin);
}
}

19
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java

@ -47,10 +47,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
@ -399,5 +396,17 @@ public class IcUserDemandRecController implements ResultDataResolver {
return new Result();
}
/**
* desc:根据来源id 删除需求 只删主表
* @param originId
* @param origin
* @return
*/
@PostMapping("deleteByOriginId/{originId}/{origin}")
public Result<Integer> deleteByOriginId(@PathVariable("originId") String originId, @PathVariable("origin")String origin) {
Integer effectRow = icUserDemandRecService.deleteByOriginId(originId,origin);
return new Result().ok(effectRow);
}
}
}

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

@ -265,4 +265,13 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
Integer selectCountByServerId(String serverId);
ServerInfoDTO queryServiceName(String serverId, String serviceType);
}
/**
* desc:根据来源id 删除需求 只删主表
* @param originId
* @param origin
* @return
*/
Integer deleteByOriginId(String originId, String origin);
}

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

@ -19,6 +19,7 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
@ -38,6 +39,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
@ -113,6 +115,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
private String textSyncScanMethod;
@Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient;
@Autowired
private LoginUserUtil loginUserUtil;
@Override
@ -467,6 +471,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
* @param serviceType
* @return
*/
@Override
public ServerInfoDTO queryServiceName(String serverId, String serviceType) {
String serviceName="";
String mobile="";
@ -515,6 +520,20 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return serverInfoDTO;
}
@Override
public Integer deleteByOriginId(String originId, String origin) {
if(StringUtils.isBlank(originId) || StringUtils.isBlank(origin)){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误","参数错误");
}
LambdaUpdateWrapper<IcUserDemandRecEntity> wrapper = new LambdaUpdateWrapper();
wrapper.eq(IcUserDemandRecEntity::getOriginId, originId)
.eq(IcUserDemandRecEntity::getOrigin,origin)
.set(IcUserDemandRecEntity::getUpdatedTime,new Date())
.set(IcUserDemandRecEntity::getCreatedBy,loginUserUtil.getLoginUserId())
.set(IcUserDemandRecEntity::getDelFlag,NumConstant.ONE_STR);
return baseDao.update(null, wrapper);
}
/**
* 完成并评价
*

46
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/enums/ProjectOriginEnum.java

@ -0,0 +1,46 @@
package com.epmet.enums;
/**
* 项目来源枚举
* @author liujianjun
*/
public enum ProjectOriginEnum {
/**
* 项目来源
*/
ISSUE("issue", "议题上报"),
AGENCY("agency", "直接立项"),
WORK_EVENT("work_event", "巡查上报"),
IC_EVENT("ic_event", "居民上报"),
RESI_EVENT("resi_event", "旧的居民上报(已废弃)");
private String code;
private String name;
ProjectOriginEnum(String code, String name) {
this.code = code;
this.name = name;
}
/**
* 根据sourceType查询对应的枚举对象
* @param code
* @return
*/
public static ProjectOriginEnum getEnumByCode(String code) {
for (ProjectOriginEnum e : ProjectOriginEnum.values()) {
if (e.getCode().equals(code)) {
return e;
}
}
return null;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}

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

@ -397,4 +397,13 @@ public interface ProjectService extends BaseService<ProjectEntity> {
List<ProjectDTO> staffPendingProject(ProjectListFromDTO fromDTO);
PageData<OrgProjectListResultDTO> orgProjectList(OrgProjectListFormDTO formDTO);
}
/**
* desc:根据来源id和类型 删除项目 只删了主表
* @param originId
* @param origin
* @return
*/
Integer deleteByOriginId(String originId, String origin);
}

28
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.*;
@ -19,6 +20,7 @@ import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.*;
import com.epmet.constant.*;
import com.epmet.dao.IcEventDao;
@ -29,6 +31,7 @@ import com.epmet.dto.form.demand.IcEventCommentToDemandFromDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.enums.EcEventProcessStatusEnum;
import com.epmet.enums.ProjectOriginEnum;
import com.epmet.feign.*;
import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.service.*;
@ -94,6 +97,8 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Autowired
private ProjectSatisfactionDetailService projectSatisfactionDetailService;
@Autowired
private LoginUserUtil loginUserUtil;
public CustomerStaffInfoCacheResult getStaffInfo(String customerId,String staffId){
@ -407,8 +412,27 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
//已立项、已转服务的事件删除时,同时删除关联的服务和项目
for (String id : ids) {
IcEventEntity entity = baseDao.selectById(id);
if (null == entity){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"数据不存在","数据不存在");
}
//1:已转项目 2:已转需求
if (NumConstant.ONE_STR.equals(entity.getOperationType())){
ProjectService projectService = SpringContextUtils.getBean(ProjectService.class);
Integer effectRow = projectService.deleteByOriginId(entity.getId(), ProjectOriginEnum.IC_EVENT.getCode());
log.info("delete project effectRow:{},eventId:{}", effectRow, id);
} else if (NumConstant.TWO_STR.equals(entity.getOperationType())){
Result<Integer> effectRow = epmetHeartOpenFeignClient.deleteUserDemandByOriginId(entity.getId(), ProjectOriginEnum.IC_EVENT.getCode());
log.info("delete userDemand result:{},eventId:{}", effectRow, id);
}
LambdaUpdateWrapper<IcEventEntity> wrapper = new LambdaUpdateWrapper();
wrapper.eq(IcEventEntity::getId,id).set(IcEventEntity::getUpdatedTime,new Date())
.set(IcEventEntity::getCreatedBy,loginUserUtil.getLoginUserId())
.set(IcEventEntity::getDelFlag,NumConstant.ONE_STR);
baseDao.update(null,wrapper);
}
}
/**

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

@ -20,6 +20,7 @@ package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg;
@ -3562,5 +3563,16 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
return new PageData<>(list, pageInfo.getTotal());
}
@Override
public Integer deleteByOriginId(String originId, String origin) {
LambdaUpdateWrapper<ProjectEntity> wrapper = new LambdaUpdateWrapper();
wrapper.eq(ProjectEntity::getOriginId, originId)
.eq(ProjectEntity::getOrigin,origin)
.set(ProjectEntity::getUpdatedTime,new Date())
.set(ProjectEntity::getCreatedBy,loginUserUtil.getLoginUserId())
.set(ProjectEntity::getDelFlag,NumConstant.ONE_STR);
return baseDao.update(null, wrapper);
}
}

6
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java

@ -6,7 +6,6 @@ import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
@ -106,12 +105,9 @@ public class OpenDataOrgChangeEventListener implements MessageListenerConcurrent
SpringContextUtils.getBean(GridInfoPingyinService.class).exractGrid(extractFormDto);
}
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
logger.error("【开放数据事件监听器】-组织信息变更-同步信息到中间库失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
} catch (Exception e) {
// 不是我们自己抛出的异常,可以让MQ重试
logger.error("【开放数据事件监听器】-组织信息变更-同步信息到中间库失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
logger.warn("【开放数据事件监听器】-组织信息变更-同步信息到中间库失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
throw e;
} finally {
distributedLock.unLock(lock);

6
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java

@ -9,7 +9,6 @@ import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
@ -109,12 +108,9 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"消费失败!");
}
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
logger.error("【开放数据事件监听器】-巡查记录信息变更-失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
} catch (Exception e) {
// 不是我们自己抛出的异常,可以让MQ重试
logger.error("【开放数据事件监听器】-巡查记录信息变更-失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
logger.warn("【开放数据事件监听器】-巡查记录信息变更-失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
throw e;
} finally {
distributedLock.unLock(lock);

6
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java

@ -5,7 +5,6 @@ import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.DisputeProcessMQMsg;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -77,12 +76,9 @@ public class OpenDataProjectChangeEventListener implements MessageListenerConcur
30L, 30L, TimeUnit.SECONDS);
//SpringContextUtils.getBean(BaseDisputeProcessService.class).getEventinfo(formDTO);
SpringContextUtils.getBean(EventreportPingyinService.class).getEventInfo(formDTO);
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
logger.error("【开放数据事件监听器】-项目信息变更-上报项目信息失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
} catch (Exception e) {
// 不是我们自己抛出的异常,可以让MQ重试
logger.error("【开放数据事件监听器】-项目信息变更-上报项目信息失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
logger.warn("【开放数据事件监听器】-项目信息变更-上报项目信息失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
throw e;
} finally {
distributedLock.unLock(lock);

8
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java

@ -6,12 +6,10 @@ import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO;
import com.epmet.opendata.service.ExUserService;
import com.epmet.opendata.service.GridstaffInfoPingyinService;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
@ -22,7 +20,6 @@ import org.redisson.api.RLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
@ -90,12 +87,9 @@ public class OpenDataStaffChangeEventListener implements MessageListenerConcurre
SpringContextUtils.getBean(ExUserService.class).getStaffBaseInfo(dto);*/
dto.setStaffIdList(obj.getStaffIdList());
SpringContextUtils.getBean(GridstaffInfoPingyinService.class).getStaffBaseInfo(dto);
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
logger.error("【开放数据事件监听器】-工作人员信息变更-初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
} catch (Exception e) {
// 不是我们自己抛出的异常,可以让MQ重试
logger.error("【开放数据事件监听器】-工作人员信息变更-初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
logger.warn("【开放数据事件监听器】-工作人员信息变更-初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
throw e;
} finally {
distributedLock.unLock(lock);

3
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/EventreportPingyinServiceImpl.java

@ -21,7 +21,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -135,7 +134,7 @@ public class EventreportPingyinServiceImpl extends BaseServiceImpl<EventreportPi
entity.setLng(item.getLng());
entity.setLat(item.getLat());
entity.setIsDel("N");
entity.setUpdateTime(new Date());
entity.setUpdateTime(null);
//业务不包含 一级分类里 如果是03 矛盾纠纷 则涉及人数写2(目前业务不支持 所以应产品需求 填2)
if ("03".equals(item.getParentEventCategory())) {

11
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridInfoPingyinServiceImpl.java

@ -32,7 +32,6 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -187,7 +186,7 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
entity.setGridName(ag.getGridName());
entity.setGridLevel("07");
entity.setIsDel("N");
entity.setUpdateTime(new Date());
entity.setUpdateTime(null);
if (ag.getLatitude().length() > 10) {
entity.setLat(new BigDecimal(ag.getLatitude().substring(0, 10)));
} else {
@ -256,7 +255,7 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
if (StringUtils.isNotBlank(formDTO.getOldCode()) && !formDTO.getOldCode().equals(entity.getGridCode())){
GridInfoPingyinEntity gridInfoEntity = new GridInfoPingyinEntity();
gridInfoEntity.setGridCode(entity.getGridCode());
gridInfoEntity.setUpdateTime(new Date());
gridInfoEntity.setUpdateTime(null);
LambdaUpdateWrapper<GridInfoPingyinEntity> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(GridInfoPingyinEntity::getGridCode,formDTO.getOldCode());
int update = baseDao.update(gridInfoEntity, updateWrapper);
@ -265,7 +264,7 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
GridstaffInfoPingyinEntity staffInfo = new GridstaffInfoPingyinEntity();
staffInfo.setGridCode(entity.getGridCode());
staffInfo.setUpdateTime(new Date());
staffInfo.setUpdateTime(null);
LambdaUpdateWrapper<GridstaffInfoPingyinEntity> staffInfoWrapper = new LambdaUpdateWrapper<>();
staffInfoWrapper.eq(GridstaffInfoPingyinEntity::getGridCode,formDTO.getOldCode());
@ -274,7 +273,7 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
GridstaffWorkInfoPingyinEntity workInfo = new GridstaffWorkInfoPingyinEntity();
workInfo.setGridCode(entity.getGridCode());
workInfo.setUpdateTime(new Date());
workInfo.setUpdateTime(null);
LambdaUpdateWrapper<GridstaffWorkInfoPingyinEntity> workInfoWrapper = new LambdaUpdateWrapper<>();
workInfoWrapper.eq(GridstaffWorkInfoPingyinEntity::getGridCode,formDTO.getOldCode());
@ -283,7 +282,7 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
EventreportPingyinEntity eventEntity = new EventreportPingyinEntity();
eventEntity.setGridCode(entity.getGridCode());
eventEntity.setUpdateTime(new Date());
eventEntity.setUpdateTime(null);
LambdaUpdateWrapper<EventreportPingyinEntity> eventWrapper = new LambdaUpdateWrapper<>();
eventWrapper.eq(EventreportPingyinEntity::getGridCode,formDTO.getOldCode());

9
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridstaffInfoPingyinServiceImpl.java

@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.CustomerGridStaffListFormDTO;
import com.epmet.dto.form.GridStaffUploadtFormDTO;
@ -21,12 +20,12 @@ import com.epmet.opendata.entity.GridstaffInfoPingyinEntity;
import com.epmet.opendata.service.GridstaffInfoPingyinService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -130,11 +129,15 @@ public class GridstaffInfoPingyinServiceImpl extends BaseServiceImpl<GridstaffIn
entity.setLeaveDate(r.getLeaveDate());
entity.setGridUserId(r.getStaffId());
entity.setCardNum(r.getIdCard());
if (StringUtils.isBlank(r.getIdCard())){
log.warn("getStaffBaseInfo 身份证号是空的,{}", JSON.toJSONString(entity));
return;
}
//按网格查询人员是否存在,存在更新否则新增
GridstaffInfoPingyinEntity gs = baseDao.selectByCodeAndStaffId(r.getCode(), r.getStaffId());
log.info(String.format("网格工作人员信息同步,当前操作人员信息,姓名:%s staffId:%s", entity.getNickName(), entity.getGridUserId()));
if (null != gs) {
entity.setUpdateTime(new Date());
entity.setUpdateTime(null);
baseDao.edit(entity);
} else {
insert(entity);

6
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridstaffWorkInfoPingyinServiceImpl.java

@ -73,6 +73,10 @@ public class GridstaffWorkInfoPingyinServiceImpl extends BaseServiceImpl<Gridsta
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode());
}
data.forEach(d -> {
if (StringUtils.isBlank(d.getGridId())){
log.warn("data is null string:{}",JSON.toJSONString(d));
return;
}
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(d.getGridId());
if (null == gridInfo) {
log.warn("未查询到网格信息:" + d.getGridId());
@ -131,7 +135,7 @@ public class GridstaffWorkInfoPingyinServiceImpl extends BaseServiceImpl<Gridsta
entity.setWorkResult(NumConstant.ONE == record.getIsNormal() ? "Y" : "N");
entity.setWorkType(record.getWorkTypeSecondCode());
entity.setRecoredInsertTime(record.getCreatedTime());
entity.setUpdateTime(record.getUpdatedTime());
entity.setUpdateTime(null);
entity.setId(null);
entity.setIsDel("N");
return entity;

4
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/EventreportPingyinDao.xml

@ -40,8 +40,8 @@
<result property="recoredInsertTime" column="recored_insert_time"/>
</resultMap>
<delete id="deleteAllData">
DELETE FROM eventreport_pingyin
update eventreport_pingyin SET is_del = 'Y'
</delete>
</mapper>
</mapper>

9
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridInfoPingyinDao.xml

@ -4,12 +4,12 @@
<mapper namespace="com.epmet.opendata.dao.GridInfoPingyinDao">
<delete id="deleteAllAgencyData">
delete from grid_info_pingyin where grid_level !='07'
update grid_info_pingyin set is_del = 'Y' where grid_level !='07'
</delete>
<delete id="deleteAllGridData">
delete from grid_info_pingyin where grid_level ='07'
update grid_info_pingyin set is_del = 'Y' where grid_level ='07'
</delete>
<select id="selectByGridCode" parameterType="java.lang.String" resultType="com.epmet.opendata.entity.GridInfoPingyinEntity">
@ -22,13 +22,12 @@
set grid_name = #{gridName},
grid_level = #{gridLevel},
lng = #{lng},
lat = #{lat},
update_time = now()
lat = #{lat}
where grid_code = #{gridCode} and is_del = 'N'
</update>
<update id="deleteByCode">
update grid_info_pingyin set is_del = 'Y',update_time = now()
update grid_info_pingyin set is_del = 'Y'
where grid_code = #{gridCode}
</update>
</mapper>

4
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridstaffInfoPingyinDao.xml

@ -16,7 +16,7 @@
</update>
<delete id="del">
delete from gridstaff_info_pingyin
UPDATE gridstaff_info_pingyin set IS_LEAVE = 'Y'
</delete>
<select id="selectByCodeAndStaffId" resultType="com.epmet.opendata.entity.GridstaffInfoPingyinEntity">
@ -35,4 +35,4 @@
LIMIT 1
</select>
</mapper>
</mapper>

4
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridstaffWorkInfoPingyinDao.xml

@ -19,8 +19,8 @@
<result property="recoredInsertTime" column="recored_insert_time"/>
</resultMap>
<delete id="delAllGridStaffWorkInfoPY">
delete from gridstaff_work_info_pingyin LIMIT 1000
update gridstaff_work_info_pingyin SET is_del = 'Y' LIMIT 1000
</delete>
</mapper>
</mapper>

121
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcCustomerReportServiceImpl.java

@ -9,10 +9,7 @@ import com.epmet.commons.feignclient.dtos.JiMuPage;
import com.epmet.commons.feignclient.dtos.JiMuResult;
import com.epmet.commons.feignclient.dtos.form.JiMuReportFormDTO;
import com.epmet.commons.feignclient.dtos.form.JimuReportExportRequestDTO;
import com.epmet.commons.feignclient.dtos.result.JiMuReportDetailResultDTO;
import com.epmet.commons.feignclient.dtos.result.JiMuReportResultDTO;
import com.epmet.commons.feignclient.dtos.result.JimuReportDbDataResultDTO;
import com.epmet.commons.feignclient.dtos.result.JimuReportFieldTreeResultDTO;
import com.epmet.commons.feignclient.dtos.result.*;
import com.epmet.commons.feignclient.feigns.JiMuReportOpenFeignClient;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.*;
@ -280,45 +277,63 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor
// 1. 首先去积木服务,查询出报表数据源的详细信息,包括报表url,isList;获取到哪一列是id(idFieldName)
// 根据报表id查询数据源列表,取出第一个
// 查询报表的字段列表(含数据源列表)
JiMuResult<List<List<JimuReportFieldTreeResultDTO>>> fResult = jiMuReportOpenFeignClient.fieldTree(reportId);
if (fResult == null || !fResult.isSuccess()) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "根据报表id未找到字段列表,报表ID:" + reportId, "根据报表id未找到字段列表,报表ID:" + reportId);
}
String datasourceId = fResult.getResult().get(0).get(0).getDbId();
// 根据数据源ID查询数据源信息
// 报表数据源信息
JiMuResult<JimuReportDbDataResultDTO> dbData = jiMuReportOpenFeignClient.loadDbData(datasourceId);
if (fResult == null || !fResult.isSuccess()) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "根据报表id未找到数据源,报表ID:" + reportId, "根据报表id未找到数据源,报表ID:" + reportId);
}
JimuReportDbDataResultDTO.ReportDB reportDb = dbData.getResult().getReportDb();
// 报表简要信息
JiMuResult<JiMuReportBriefResultDTO> reportBriefResult = jiMuReportOpenFeignClient.getReportBrief(reportId);
if (fResult == null || !fResult.isSuccess()) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "根据报表id未找到报表信息,报表ID:" + reportId, "根据报表id未找到报表信息,报表ID:" + reportId);
}
JiMuReportBriefResultDTO reportBrief = reportBriefResult.getResult();
// api的url
String apiUrl = reportDb.getApiUrl();
// api方法
//String apiMethod = reportDb.getApiMethod();
String apiMethod = reportDb.getApiMethod();
// 是否是集合
//String isList = reportDb.getIsList();
// 返回的列表中,哪个字段是ID
String idFieldName = null;
String nameFieldName = null;
boolean isHttps = false;
Matcher matcher = Pattern.compile("(http://|https://).+idFieldName=(\\w+).*").matcher(apiUrl);
Matcher matcher = Pattern.compile("(http://|https://).+idFieldName=(\\w+).+nameFieldName=(\\w+).*").matcher(apiUrl);
if (matcher.matches()) {
String proto = matcher.group(1);
if ("https://".equals(proto)) {
isHttps = true;
}
idFieldName = matcher.group(2);
nameFieldName = matcher.group(3);
}
if (StringUtils.isBlank(idFieldName)) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "配置的业务api url缺少idFieldName列");
}
if (StringUtils.isBlank(idFieldName)) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "配置的业务api url缺少nameFieldName列");
}
// 2. 调用该url的接口,获取到一个列表,根据idFieldName取出ID列
List<String> ids = listIds(bizId, paramKey, apiUrl, isHttps, idFieldName);
HashMap<String, String> idAndNames = listBizObjectIdAndName(bizId, paramKey, apiUrl, isHttps, idFieldName, nameFieldName, apiMethod);
// 3. 然后以这一列作为查询条件,循环,继续调用该接口,得到单条数据,每一条数据都下载一个excel,最后将其打包为一个压缩包下载
Path storePath = makeTemporaryDownloadDir(reportId);
// 4.生成压缩文件
Path zipFile = downloadAndComppress(storePath, reportId, reportDb.getDbChName(), paramKey, ids);
Path zipFile = downloadAndCompress(storePath, reportId, reportBrief.getName(), paramKey, idAndNames);
// 5.下载
try (FileInputStream fis = new FileInputStream(zipFile.toFile())) {
@ -342,10 +357,9 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor
/**
* 批量下载
* @param storePath 本次导出文件的存储路径子目录包括zip文件时间戳命名的子目录用于存放临时excel(导出完成会删掉)
* @param ids
* @return 压缩文件路径
*/
private Path downloadAndComppress(Path storePath, String reportId, String reportName, String paramKey, List<String> ids) {
private Path downloadAndCompress(Path storePath, String reportId, String reportName, String paramKey, HashMap<String, String> idAndNames) {
// 请求头
Map<String, Object> headers = new HashMap<>();
headers.put(Constant.AUTHORIZATION_HEADER, EpmetRequestHolder.getHeader(Constant.AUTHORIZATION_HEADER));
@ -360,7 +374,7 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor
param.getQueryParam().setParamKey(paramKey);
param.getQueryParam().setToken(EpmetRequestHolder.getLoginUserAuthorizationToken());
ArrayList<File> files = new ArrayList<>();
HashMap<String, File> files = new HashMap<>();
String currentTimeStr = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd_HHmmss"));
@ -373,9 +387,11 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor
}
// 将所有id分片,交给多个线程并行处理
List<List<String>> idParts = ListUtils.partition(ids, 100);
ArrayList<String> idList = new ArrayList<>();
idList.addAll(idAndNames.keySet());
List<List<String>> idParts = ListUtils.partition(idList, 100);
// 1. 循环下载所有id对应的excel
// 1. 循环下载所有id对应的excel(积木报表的导出接口有并发问题,多线程会导出空表,暂时不用多线程了)
CountDownLatch cdl = new CountDownLatch(idParts.size());
for (List<String> idPart : idParts) {
CompletableFuture.runAsync(() -> {
@ -397,9 +413,15 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor
final ZipOutputStream zos = new ZipOutputStream(fos)) {
// 循环每一个文件
for (File file : files) {
try (final FileInputStream fis = new FileInputStream(file.getAbsolutePath())) {
zos.putNextEntry(new ZipEntry(reportName + "_" + currentTimeStr + "/" + file.getName()));
HashMap<String, Integer> bizObjNameAndCount = new HashMap<>(32);
for (Map.Entry<String, File> entry : files.entrySet()) {
String bizObjectId = entry.getKey();
File file = entry.getValue();
String bizObjName = getNumberedObjName(bizObjNameAndCount, idAndNames.get(bizObjectId));
try (FileInputStream fis = new FileInputStream(file.getAbsolutePath())) {
zos.putNextEntry(new ZipEntry(String.format("%s_%s/%s_%s.xlsx", reportName, currentTimeStr, reportName, bizObjName)));
final byte[] buffer = new byte[10240];
for (int len; (len = fis.read(buffer)) > 0; ) {
zos.write(buffer, 0, len);
@ -421,6 +443,28 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor
return zipFile;
}
/**
* 为业务对象名称编号解决重名对象问题
* @param bizObjNameAndCount 业务对象名称/出现次数map
* @param bizObjName 原始业务对象名
* @return
*/
public String getNumberedObjName(HashMap<String, Integer> bizObjNameAndCount, String bizObjName) {
Integer nameCount = bizObjNameAndCount.get(bizObjName);
if (nameCount == null) {
nameCount = 1;
bizObjNameAndCount.put(bizObjName, nameCount);
} else {
bizObjNameAndCount.put(bizObjName, ++nameCount);
}
if (nameCount > 1) {
bizObjName = String.format("%s(%d)", bizObjName, nameCount);
}
return bizObjName;
}
/**
* 批量下载xlsx
* @param reportId
@ -429,21 +473,9 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor
* @param xlsxStorePath
* @param files
*/
public void downloadXlsByBatchByBizId(String reportId, List<String> bizIds, JimuReportExportRequestDTO param, Path xlsxStorePath, ArrayList<File> files,
CountDownLatch cdl) {
public void downloadXlsByBatchByBizId(String reportId, List<String> bizIds, JimuReportExportRequestDTO param,
Path xlsxStorePath, Map<String, File> files, CountDownLatch cdl) {
for (String id : bizIds) {
try {
Thread.sleep(200l);
} catch (InterruptedException e) {
final String errorMsg = ExceptionUtils.getErrorStackTrace(e);
log.error("【报表批量导出】循环导出-请求jmreport,等待过程中睡眠发生意外:{}", errorMsg);
}
//if (!Arrays.asList("1501821697823608834","1501821694665297922","1501821695114088450","1501821695177003009","1501821695269277697","1501821695344775169","1501821695579656193","1501821695676125186","1501821695755816962","1501821695843897346","1501821695978115074","1501821696108138497","1501821696179441665","1501821696229773313","1501821696284299266","1501821696334630913","1501821696393351170","1501821696452071426","1501821696502403073","1501821696582094849","1501821696645009409","1501821696758255617","1501821696871501826","1501821696917639169","1501821696955387906","1501821696993136641","1501821697135742977","1501821697181880321","1501821697232211969","1501821697274155009").contains(id)) {
// continue;
//}
param.getQueryParam().setId(id);
final Response response = jiMuReportOpenFeignClient.exportAllExcelStream(param);
// 取出文件后缀
@ -456,7 +488,7 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor
final File excelFile = xlsxStorePath.resolve("file_" + id + matcher.group(2)).toFile();
files.add(excelFile);
files.put(id, excelFile);
try (FileOutputStream fos = new FileOutputStream(excelFile)) {
IOUtils.copy(response.body().asInputStream(), fos);
} catch (Exception e) {
@ -507,26 +539,33 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor
}
/**
* 列出id列表批量下载用
* 列出id和name列表(生成文件用到了name)批量下载用
*
* @param apiUrl
* @param isHttps
* @param idFieldName
* @return
*/
public List<String> listIds(String id, String paramKey, String apiUrl, boolean isHttps, String idFieldName) {
public HashMap<String, String> listBizObjectIdAndName(String id, String paramKey, String apiUrl, boolean isHttps, String idFieldName, String nameFieldName, String apiMethod) {
apiUrl = apiUrl.replace("'${id}'", id == null ? "" : id);
apiUrl = apiUrl.replace("'${paramKey}'", paramKey);
Map<String, Object> headers = new HashMap<>();
headers.put(Constant.AUTHORIZATION_HEADER, EpmetRequestHolder.getHeader(Constant.AUTHORIZATION_HEADER));
Result<String> stringResult = HttpClientManager.getInstance().sendPost(apiUrl, isHttps, "{\"id\":" + id + "}", headers);
Result<String> stringResult;
// 请求方法0-get,1-post
if (NumConstant.ONE_STR.equals(apiMethod)) {
stringResult = HttpClientManager.getInstance().sendPost(apiUrl, isHttps, "{\"id\":\"" + (id == null ? "" : id) + "\"}", headers);
} else {
stringResult = HttpClientManager.getInstance().sendGet(apiUrl, isHttps, null, headers);
}
JSONObject dataJsonObject = JSON.parseObject(stringResult.getData());
Object data = dataJsonObject.get("data");
JSONArray array = new JSONArray();
ArrayList<String> ids = new ArrayList<>();
JSONArray array;
HashMap<String, String> idAndNames = new HashMap<>();
if (data instanceof JSONObject) {
// 这种可能是pageData的
@ -539,8 +578,10 @@ public class IcCustomerReportServiceImpl extends BaseServiceImpl<IcCustomerRepor
for (ListIterator<Object> it = array.listIterator(); it.hasNext(); ) {
JSONObject e = (JSONObject) it.next();
ids.add(e.getString(idFieldName));
String idValue = e.getString(idFieldName);
String nameValue = e.getString(nameFieldName);
idAndNames.put(idValue, nameValue);
}
return ids;
return idAndNames;
}
}

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

@ -158,6 +158,12 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
IcPartymemberStyleEntity entity = baseDao.selectById(id);
IcPartymemberStyleDTO dto = ConvertUtils.sourceToTarget(entity, IcPartymemberStyleDTO.class);
dto.setImageList(icPartymemberStyleImageService.getByStyleId(id));
GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(dto.getGridId());
if (null != gridInfoCache) {
dto.setGridName(gridInfoCache.getGridName());
}
IcPartymemberStyleCategoryDictEntity dict = icPartymemberStyleCategoryDictService.get(dto.getCategoryId());
dto.setCategoryName(null == dict ? StrConstant.EPMETY_STR : dict.getCategoryName());
return dto;
}
@ -240,6 +246,7 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
item.setGridName(gridInfo.getGridName());
IcPartymemberStyleCategoryDictEntity dict = icPartymemberStyleCategoryDictService.get(item.getCategoryId());
item.setCategoryName(null == dict ? StrConstant.EPMETY_STR : dict.getCategoryName());
item.setImageList(icPartymemberStyleImageService.getByStyleId(item.getId()));
}
});
return new PageData<>(dtoList, pageInfo.getTotal());

39
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DhTokenDTO.java

@ -0,0 +1,39 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 大华设备鉴权信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-04-22
*/
@Data
public class DhTokenDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* loginName
*/
private String loginName;
/**
* token
*/
private String token;
/**
* publicKey
*/
private String publicKey;
}

184
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVaccinePrarmeterDTO.java

@ -0,0 +1,184 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 新冠病毒疫苗接种人员信息台账
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-22
*/
@Data
public class IcVaccinePrarmeterDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织的pids
*/
private String pids;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属小区名称
*/
private String villageName;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 所属楼宇名称
*/
private String buildName;
/**
* 单元id
*/
private String unitId;
/**
* 单元名
*/
private String unitName;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 房间名
*/
private String homeName;
/**
* 户口性质0户籍 1外来
*/
private String householdType;
/**
* 姓名
*/
private String name;
/**
* 联系电话
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 是否接种0否1是
*/
private String isVaccination;
/**
* 第一次接种时间
*/
private String firstVacTime;
/**
* 第一次接种地点
*/
private String firstVacSite;
/**
* 第二次接种时间
*/
private String secondVacTime;
/**
* 第二次接种地点
*/
private String secondVacSite;
/**
* 第三次接种时间
*/
private String thirdVacTime;
/**
* 第三次接种地点
*/
private String thirdVacSite;
/**
* 原因禁忌症/拒绝接种/其他原因
*/
private String reason;
/**
* 备注
*/
private String note;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -52,43 +52,36 @@ public class SaveCollectVisitorFormDTO implements Serializable {
/**
* 所属楼宇Id
*/
@NotBlank(message = "楼宇Id不能为空")
private String buildId;
/**
* 所属楼宇名称
*/
@NotBlank(message = "楼宇名称不能为空")
private String buildName;
/**
* 单元id
*/
@NotBlank(message = "单元id不能为空")
private String unitId;
/**
* 单元名
*/
@NotBlank(message = "单元名不能为空")
private String unitName;
/**
* 所属家庭Id
*/
@NotBlank(message = "家庭Id不能为空")
private String homeId;
/**
* 房间名
*/
@NotBlank(message = "房间名不能为空")
private String homeName;
/**
* 详细地址
*/
@NotBlank(message = "家庭地址不能为空")
private String address;
/**
@ -106,6 +99,7 @@ public class SaveCollectVisitorFormDTO implements Serializable {
/**
* 身份证号
*/
@NotBlank(message = "身份证号不能为空")
private String idCard;
/**

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

@ -29,5 +29,6 @@ public class DelIcResiUserFormDTO implements Serializable {
private String customerId;
private String formCode= IcFormCodeEnum.RESI_BASE_INFO.getCode();
private String currentStaffId;
}

27
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhAuthFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import com.epmet.dto.result.DhChannelResultDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhAuthFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String cardNumber;
private String timeQuantumId;
private List<DhChannelResultDTO> cardPrivilegeDetails;
}

29
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhCardPageFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhCardPageFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer pageNum;
private Integer pageSize;
private String personCode;
private String cardNumber;
private String cardStatus;
}

23
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhChannelFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhChannelFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String interfaceId;
private String jsonParam;
}

25
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhChannelPageFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhChannelPageFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer pageNum;
private Integer pageSize;
private String deviceGenre;
}

25
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhDeptFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhDeptFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private String description;
private Long parentId;
}

29
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhIdentityFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhIdentityFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private Double subsidyAmount;
private Integer isCashRecharge;
private Integer isMachineRecharge;
private String description;
}

23
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhLoginPassFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhLoginPassFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String loginName;
private String loginPass;
}

23
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhNodeFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhNodeFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String typeCode;
private String nodeId;
}

39
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPersonCardFormDTO.java

@ -0,0 +1,39 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhPersonCardFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Long personId;
private String personName;
private String cardNumber;
private String cardType;
private String category;
private String cardStatus;
private String startDate;
private String endDate;
private String cardPassword;
private String subSystems;
}

22
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPersonCardListFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhPersonCardListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private List<DhPersonCardFormDTO> objectList;
}

22
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPersonDelFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhPersonDelFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private List<Integer> personIds;
}

39
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPersonFormDTO.java

@ -0,0 +1,39 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhPersonFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String paperType;
private String paperNumber;
private String name;
private String code;
private Long deptId;
private String sex;
private String birthday;
private String phone;
private String status;
private String personIdentityId;
}

23
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPersonImgFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhPersonImgFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String personCode;
private String base64file;
}

25
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPersonPageFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhPersonPageFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer pageNum;
private Integer pageSize;
private String code;
}

27
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPlanFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhPlanFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String detail;
private String memo;
private String name;
private Integer type;
}

25
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPlanPageFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhPlanPageFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer pageNum;
private Integer pageSize;
private String singleCondition;
}

21
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DhPublicKeyFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhPublicKeyFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String loginName;
}

14
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitListFormDTO.java

@ -23,4 +23,18 @@ public class VisitListFormDTO extends PageFormDTO {
private String orgId;
private String idCard;
private String name;
private String villageId;
private String buildId;
private String unitId;
private String homeId;
private String mobile;
}

24
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitVisitorChartFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 租客表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-07-26
*/
@Data
public class VisitVisitorChartFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 时间
*/
private String date;
}

51
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitVisitorFormDTO.java

@ -0,0 +1,51 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 租客表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-07-26
*/
@Data
public class VisitVisitorFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 姓名
*/
@NotBlank(message = "姓名不能为空",groups = {AddGroup.class, DefaultGroup.class})
private String name;
/**
* 身份证
*/
@NotBlank(message = "身份证号不能为空",groups = {AddGroup.class, DefaultGroup.class})
private String idCard;
/**
* 手机号
*/
@NotBlank(message = "联系方式不能为空",groups = {AddGroup.class, DefaultGroup.class})
private String mobile;
/**
* 头像
*/
private String faceImg;
/**
* 节点
*/
private String node;
}

14
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VisitorInfoFormDTO.java

@ -0,0 +1,14 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
@Data
public class VisitorInfoFormDTO implements Serializable {
private String userId;
private String customerId;
}

23
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DhChannelResultDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 海康社区人员信息下放
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-20
*/
@Data
public class DhChannelResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String privilegeType;
private String resouceCode;
}

30
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VisitVisitorChartResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 租客表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-07-26
*/
@Data
public class VisitVisitorChartResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 时间
*/
private String hour;
/**
* 数量
*/
private String num;
}

80
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectVisitorController.java

@ -1,7 +1,6 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
@ -14,10 +13,8 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcResiCollectVisitorDTO;
import com.epmet.dto.SaveCollectVisitorFormDTO;
import com.epmet.dto.form.CollectDetailFormDTO;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.VisitListFormDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.VisitVisitorChartResultDTO;
import com.epmet.excel.IcResiCollectVisitorExcel;
import com.epmet.service.IcResiCollectVisitorService;
import org.springframework.beans.factory.annotation.Autowired;
@ -42,7 +39,7 @@ public class IcResiCollectVisitorController {
private IcResiCollectVisitorService icResiCollectVisitorService;
@RequestMapping("page")
public Result<PageData<IcResiCollectVisitorDTO>> page(@RequestParam Map<String, Object> params){
public Result<PageData<IcResiCollectVisitorDTO>> page(@RequestParam Map<String, Object> params) {
// PageData<IcResiCollectVisitorDTO> page = icResiCollectVisitorService.page(params);
PageData<IcResiCollectVisitorDTO> page = icResiCollectVisitorService.getPhrasePage(params);
return new Result<PageData<IcResiCollectVisitorDTO>>().ok(page);
@ -52,6 +49,7 @@ public class IcResiCollectVisitorController {
/**
* Desc: 访客记录列表
*
* @param formDTO
* @param tokenDto
* @author wgf
@ -60,22 +58,22 @@ public class IcResiCollectVisitorController {
@PostMapping("list")
// @MaskResponse(fieldNames = { "memberIdNum", "memberMobile" },
// fieldsMaskType = { MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE })
public Result<PageData<IcResiCollectVisitorDTO>> getVisitorList(@RequestBody VisitListFormDTO formDTO, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO,CollectListFormDTO.CollectListForm.class);
public Result<PageData<IcResiCollectVisitorDTO>> getVisitorList(@RequestBody VisitListFormDTO formDTO, @LoginUser TokenDto tokenDto) {
ValidatorUtils.validateEntity(formDTO, CollectListFormDTO.CollectListForm.class);
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<PageData<IcResiCollectVisitorDTO>>().ok(icResiCollectVisitorService.getVisitorList(formDTO));
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcResiCollectVisitorDTO> get(@PathVariable("id") String id){
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
public Result<IcResiCollectVisitorDTO> get(@PathVariable("id") String id) {
IcResiCollectVisitorDTO data = icResiCollectVisitorService.get(id);
return new Result<IcResiCollectVisitorDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcResiCollectVisitorDTO dto){
public Result save(@RequestBody IcResiCollectVisitorDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icResiCollectVisitorService.save(dto);
@ -84,7 +82,7 @@ public class IcResiCollectVisitorController {
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcResiCollectVisitorDTO dto){
public Result update(@RequestBody IcResiCollectVisitorDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icResiCollectVisitorService.update(dto);
@ -92,7 +90,7 @@ public class IcResiCollectVisitorController {
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
public Result delete(@RequestBody String[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icResiCollectVisitorService.delete(ids);
@ -106,32 +104,62 @@ public class IcResiCollectVisitorController {
}
/**
* @describe: 保存访客信息
* @author wangtong
* @date 2022/8/3 10:33
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
* @return com.epmet.commons.tools.utils.Result
* @describe: 保存访客信息
* @author wangtong
* @date 2022/8/3 10:33
* @params [dto]
*/
@NoRepeatSubmit
@PostMapping("saveInfo")
public Result saveInfo(@RequestBody SaveCollectVisitorFormDTO dto){
public Result saveInfo(@RequestBody SaveCollectVisitorFormDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto);
return icResiCollectVisitorService.saveInfo(dto);
}
/**
* @describe: 访客信息详情
* @author wangtong
* @date 2022/8/3 15:41
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
* @return com.epmet.commons.tools.utils.Result
* @describe: 访客信息详情
* @author wangtong
* @date 2022/8/3 15:41
* @params [dto]
*/
@PostMapping("getVisitorDetail")
public Result getVisitorDetail(@RequestBody CollectDetailFormDTO dto) {
ValidatorUtils.validateEntity(dto);
return icResiCollectVisitorService.getVisitorDetail(dto);
}
/**
* 登陆访客用户信息
*
* @param tokenDto
* @param dto
* @return com.epmet.commons.tools.utils.Result
* @author zhy
* @date 2022/8/19 15:24
*/
@PostMapping("visitorinfo")
public Result getVisitorInfo(@LoginUser TokenDto tokenDto, @RequestBody VisitorInfoFormDTO dto) {
ValidatorUtils.validateEntity(dto);
return icResiCollectVisitorService.getVisitorInfo(tokenDto, dto);
}
/**
* 访客折线图
*
* @param dto
* @return com.epmet.commons.tools.utils.Result<java.util.List<VisitVisitorChartResultDTO>>
* @author zhy
* @date 2022/8/22 9:56
*/
@NoRepeatSubmit
@PostMapping("chart/traffic")
public Result<List<VisitVisitorChartResultDTO>> getTraffic(@RequestBody VisitVisitorChartFormDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
return new Result<List<VisitVisitorChartResultDTO>>().ok(icResiCollectVisitorService.getTraffic(dto));
}
}

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

@ -200,6 +200,7 @@ public class IcResiUserController implements ResultDataResolver {
@PostMapping("delete")
public Result delete(@LoginUser TokenDto tokenDto, @RequestBody DelIcResiUserFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setCurrentStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, DelIcResiUserFormDTO.IdGroup.class);
formDTO.getUserIds().forEach(userId -> {
formDTO.setIcResiUserId(userId);
@ -559,7 +560,7 @@ public class IcResiUserController implements ResultDataResolver {
* @remark 用于报表调用的接口 试试
*/
@ReportRequest
@NoRepeatSubmit
//@NoRepeatSubmit
@RequestMapping(value = "/exportExcelCustomData")
public Map<String, Object> exportExcelCustomData(@LoginUser TokenDto tokenDto, @RequestParam("templateId") String templateId,
@RequestBody ExportResiUserFormDTO pageFormDTO) throws Exception {

82
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVaccinePrarmeterController.java

@ -0,0 +1,82 @@
package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcVaccinePrarmeterDTO;
import com.epmet.excel.IcVaccinePrarmeterExcel;
import com.epmet.service.IcVaccinePrarmeterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 新冠病毒疫苗接种人员信息台账
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-22
*/
@RestController
@RequestMapping("icVaccinePrarmeter")
public class IcVaccinePrarmeterController {
@Autowired
private IcVaccinePrarmeterService icVaccinePrarmeterService;
@RequestMapping("page")
public Result<PageData<IcVaccinePrarmeterDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcVaccinePrarmeterDTO> page = icVaccinePrarmeterService.page(params);
return new Result<PageData<IcVaccinePrarmeterDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcVaccinePrarmeterDTO> get(@PathVariable("id") String id){
IcVaccinePrarmeterDTO data = icVaccinePrarmeterService.get(id);
return new Result<IcVaccinePrarmeterDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcVaccinePrarmeterDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icVaccinePrarmeterService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PutMapping("update")
public Result update(@RequestBody IcVaccinePrarmeterDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icVaccinePrarmeterService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icVaccinePrarmeterService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcVaccinePrarmeterDTO> list = icVaccinePrarmeterService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IcVaccinePrarmeterExcel.class);
}
}

27
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectVisitorDao.java

@ -2,9 +2,10 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcResiCollectVisitorDTO;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.VisitListFormDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.form.VisitVisitorChartFormDTO;
import com.epmet.dto.form.VisitorInfoFormDTO;
import com.epmet.dto.result.VisitVisitorChartResultDTO;
import com.epmet.entity.IcResiCollectVisitorEntity;
import org.apache.ibatis.annotations.Mapper;
@ -22,6 +23,7 @@ public interface IcResiCollectVisitorDao extends BaseDao<IcResiCollectVisitorEnt
/**
* 条件查询
*
* @param params
* @return
*/
@ -29,10 +31,31 @@ public interface IcResiCollectVisitorDao extends BaseDao<IcResiCollectVisitorEnt
/**
* Desc: 查询访客信息
*
* @param formDTO
* @author wgf
* @date 2022/8/5 8:41
*/
List<IcResiCollectVisitorDTO> getCollectList(VisitListFormDTO formDTO);
/**
* 最新一条访客信息
*
* @param formDTO
* @return com.epmet.entity.IcResiCollectVisitorEntity
* @author zhy
* @date 2022/8/19 15:33
*/
IcResiCollectVisitorEntity getLastInfo(VisitorInfoFormDTO formDTO);
/**
* 人流量
*
* @param dto
* @return void
* @author generator
* @date 2022-07-26
*/
List<VisitVisitorChartResultDTO> getTraffic(VisitVisitorChartFormDTO dto);
}

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

@ -96,9 +96,9 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
@Param("icResiUserId") String icResiUserId,
@Param("subTableName") String subTableName);
int updateToDel(String icResiUserId);
int updateToDel(@Param("icResiUserId") String icResiUserId,@Param("currentStaffId") String currentStaffId);
int updateSubTableToDel(@Param("subTalbeName") String subTalbeName, @Param("icResiUserId") String icResiUserId);
int updateSubTableToDel(@Param("subTalbeName") String subTalbeName, @Param("icResiUserId") String icResiUserId,@Param("currentStaffId")String currentStaffId);
/**
* 接口名称

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

@ -40,5 +40,5 @@ public interface IcUserChangeDetailedDao extends BaseDao<IcUserChangeDetailedEnt
**/
void delByCustomerId(@Param("customerId") String customerId, @Param("type") String type, @Param("icUserIds") List<String> icUserIds);
int deleteByIcResiUserId(String icResiUserId);
int deleteByIcResiUserId(@Param("icResiUserId")String icResiUserId,@Param("currentStaffId")String currentStaffId);
}

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

@ -50,5 +50,5 @@ public interface IcUserChangeRecordDao extends BaseDao<IcUserChangeRecordEntity>
**/
void delByCustomerId(@Param("customerId") String customerId, @Param("type") String type, @Param("icUserIds") List<String> icUserIds);
int deleteByIcResiUserId(String icResiUserId);
int deleteByIcResiUserId(@Param("icResiUserId") String icResiUserId,@Param("currentStaffId")String currentStaffId);
}

3
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserTransferRecordDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcUserTransferRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 居民调动记录表
@ -30,5 +31,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface IcUserTransferRecordDao extends BaseDao<IcUserTransferRecordEntity> {
int deleteByIcResiUserId(String icResiUserId);
int deleteByIcResiUserId(@Param("icResiUserId") String icResiUserId, @Param("currentStaffId")String currentStaffId);
}

16
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccinePrarmeterDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcVaccinePrarmeterEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 新冠病毒疫苗接种人员信息台账
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-22
*/
@Mapper
public interface IcVaccinePrarmeterDao extends BaseDao<IcVaccinePrarmeterEntity> {
}

154
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVaccinePrarmeterEntity.java

@ -0,0 +1,154 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 新冠病毒疫苗接种人员信息台账
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-22
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_vaccine_prarmeter")
public class IcVaccinePrarmeterEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 组织Id
*/
private String agencyId;
/**
* 组织的pids
*/
private String pids;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属小区名称
*/
private String villageName;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 所属楼宇名称
*/
private String buildName;
/**
* 单元id
*/
private String unitId;
/**
* 单元名
*/
private String unitName;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 房间名
*/
private String homeName;
/**
* 户口性质0户籍 1外来
*/
private String householdType;
/**
* 姓名
*/
private String name;
/**
* 联系电话
*/
private String mobile;
/**
* 身份证号
*/
private String idCard;
/**
* 是否接种0否1是
*/
private String isVaccination;
/**
* 第一次接种时间
*/
private String firstVacTime;
/**
* 第一次接种地点
*/
private String firstVacSite;
/**
* 第二次接种时间
*/
private String secondVacTime;
/**
* 第二次接种地点
*/
private String secondVacSite;
/**
* 第三次接种时间
*/
private String thirdVacTime;
/**
* 第三次接种地点
*/
private String thirdVacSite;
/**
* 原因禁忌症/拒绝接种/其他原因
*/
private String reason;
/**
* 备注
*/
private String note;
}

117
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcVaccinePrarmeterExcel.java

@ -0,0 +1,117 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 新冠病毒疫苗接种人员信息台账
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-22
*/
@Data
public class IcVaccinePrarmeterExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "客户Id customer.id")
private String customerId;
@Excel(name = "网格ID")
private String gridId;
@Excel(name = "网格名称")
private String gridName;
@Excel(name = "组织Id")
private String agencyId;
@Excel(name = "组织的pids")
private String pids;
@Excel(name = "所属小区ID;")
private String villageId;
@Excel(name = "所属小区名称")
private String villageName;
@Excel(name = "所属楼宇Id")
private String buildId;
@Excel(name = "所属楼宇名称")
private String buildName;
@Excel(name = "单元id")
private String unitId;
@Excel(name = "单元名")
private String unitName;
@Excel(name = "所属家庭Id")
private String homeId;
@Excel(name = "房间名")
private String homeName;
@Excel(name = "户口性质:0户籍 1外来")
private String householdType;
@Excel(name = "姓名")
private String name;
@Excel(name = "联系电话")
private String mobile;
@Excel(name = "身份证号")
private String idCard;
@Excel(name = "是否接种:0否1是")
private String isVaccination;
@Excel(name = "第一次接种时间")
private String firstVacTime;
@Excel(name = "第一次接种地点")
private String firstVacSite;
@Excel(name = "第二次接种时间")
private String secondVacTime;
@Excel(name = "第二次接种地点")
private String secondVacSite;
@Excel(name = "第三次接种时间")
private String thirdVacTime;
@Excel(name = "第三次接种地点")
private String thirdVacSite;
@Excel(name = "原因:禁忌症/拒绝接种/其他原因")
private String reason;
@Excel(name = "备注")
private String note;
@Excel(name = "删除标识 0.未删除 1.已删除")
private Integer delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

30
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcVaccinePrarmeterRedis.java

@ -0,0 +1,30 @@
package com.epmet.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 新冠病毒疫苗接种人员信息台账
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-22
*/
@Component
public class IcVaccinePrarmeterRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

53
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiCollectVisitorService.java

@ -2,13 +2,15 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcResiCollectVisitorDTO;
import com.epmet.dto.SaveCollectVisitorFormDTO;
import com.epmet.dto.form.CollectDetailFormDTO;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.VisitListFormDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.form.VisitVisitorChartFormDTO;
import com.epmet.dto.form.VisitorInfoFormDTO;
import com.epmet.dto.result.VisitVisitorChartResultDTO;
import com.epmet.entity.IcResiCollectVisitorEntity;
import java.util.List;
@ -34,6 +36,7 @@ public interface IcResiCollectVisitorService extends BaseService<IcResiCollectVi
/**
* 分页条件查询
*
* @param params
* @return
*/
@ -92,20 +95,42 @@ public interface IcResiCollectVisitorService extends BaseService<IcResiCollectVi
void delete(String[] ids);
/**
* @describe: 保存访客信息
* @author wangtong
* @date 2022/8/3 10:44
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
* @return com.epmet.commons.tools.utils.Result
* @describe: 保存访客信息
* @author wangtong
* @date 2022/8/3 10:44
* @params [dto]
*/
Result saveInfo(SaveCollectVisitorFormDTO dto);
/**
* @describe: 访客信息详情
* @author wangtong
* @date 2022/8/3 15:43
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
* @return com.epmet.commons.tools.utils.Result
* @describe: 访客信息详情
* @author wangtong
* @date 2022/8/3 15:43
* @params [dto]
*/
Result getVisitorDetail(CollectDetailFormDTO dto);
/**
* 登陆访客用户信息
*
* @param tokenDto
* @param dto
* @return com.epmet.commons.tools.utils.Result
* @author zhy
* @date 2022/8/19 15:24
*/
Result getVisitorInfo(TokenDto tokenDto, VisitorInfoFormDTO dto);
/**
* 人流量
*
* @param dto
* @return void
* @author generator
* @date 2022-07-26
*/
List<VisitVisitorChartResultDTO> getTraffic(VisitVisitorChartFormDTO dto);
}

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

@ -37,5 +37,5 @@ public interface IcUserChangeDetailedService extends BaseService<IcUserChangeDet
**/
void delByCustomerId(String customerId, String type, List<String> icUserIds);
int deleteByIcResiUserId(String icResiUserId);
int deleteByIcResiUserId(String icResiUserId,String currentStaffId);
}

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

@ -55,5 +55,5 @@ public interface IcUserChangeRecordService extends BaseService<IcUserChangeRecor
**/
void icUserChangeRecordInit(IcUserChangeRecordInitFormDTO formDTO) throws ParseException;
int deleteByIcResiUserId(String icResiUserId);
int deleteByIcResiUserId(String icResiUserId,String currentStaffId);
}

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

@ -48,5 +48,5 @@ public interface IcUserTransferRecordService extends BaseService<IcUserTransferR
*/
void moveResi(IcResiUserTransferFormDTO formDTO);
int deleteByIcResiUserId(String icResiUserId);
int deleteByIcResiUserId(String icResiUserId,String currentStaffId);
}

78
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVaccinePrarmeterService.java

@ -0,0 +1,78 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcVaccinePrarmeterDTO;
import com.epmet.entity.IcVaccinePrarmeterEntity;
import java.util.List;
import java.util.Map;
/**
* 新冠病毒疫苗接种人员信息台账
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-22
*/
public interface IcVaccinePrarmeterService extends BaseService<IcVaccinePrarmeterEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcVaccinePrarmeterDTO>
* @author generator
* @date 2022-08-22
*/
PageData<IcVaccinePrarmeterDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcVaccinePrarmeterDTO>
* @author generator
* @date 2022-08-22
*/
List<IcVaccinePrarmeterDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcVaccinePrarmeterDTO
* @author generator
* @date 2022-08-22
*/
IcVaccinePrarmeterDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-08-22
*/
void save(IcVaccinePrarmeterDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-08-22
*/
void update(IcVaccinePrarmeterDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-08-22
*/
void delete(String[] ids);
}

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

@ -794,6 +794,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
resultDTO.setCustomerName(customerResult.getData().getCustomerName());
}
}
redisUtils.delete(userBaseInfoKey);
redisUtils.set(userBaseInfoKey,resultDTO);
return resultDTO;
}

20
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java

@ -31,6 +31,7 @@ import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.IcResiCollectService;
import com.epmet.service.IcUserChangeRecordService;
import com.epmet.util.dh.DhDeviceUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
@ -71,6 +72,8 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
@Autowired
private IcUserChangeRecordService icUserChangeRecordService;
@Autowired
private DhDeviceUtil dhDeviceUtil;
@Override
@Transactional(rollbackFor = Exception.class)
@ -175,7 +178,7 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
}
});
} else {
IcResiCollectEntity collectInfo = baseDao.selectByAddress(formDTO.getAddress());
IcResiCollectEntity collectInfo = baseDao.selectById(formDTO.getId());
//更新主表
baseDao.updateRec(collectInfo.getId(), formDTO.getHouseType(), formDTO.getHouseHolderName(), formDTO.getTotalResi(),null);
List<IcResiMemberEntity> newMemberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class);
@ -183,6 +186,21 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
Map<String, IcResiMemberEntity> memMap = queryOriginMem(collectInfo.getId());
saveOrUpdateMem(newMemberList, memMap,collectInfo);
}
// 如果是顺德居小区的人还要下放门禁
if (formDTO.getVillageName().contains("顺德居")) {
formDTO.getMemberList().forEach(item -> {
if (StringUtils.isNotBlank(item.getFaceImg())) {
VisitVisitorFormDTO visitor = new VisitVisitorFormDTO();
visitor.setIdCard(item.getIdNum());
visitor.setMobile(item.getMobile());
visitor.setName(item.getName());
visitor.setFaceImg(item.getFaceImg());
dhDeviceUtil.sendAuth(visitor);
}
});
}
return new Result().ok("提交成功");
}

56
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectVisitorServiceImpl.java

@ -8,19 +8,20 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiCollectVisitorDao;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.IcResiCollectVisitorDTO;
import com.epmet.dto.SaveCollectVisitorFormDTO;
import com.epmet.dto.form.CollectDetailFormDTO;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.VisitListFormDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.VisitVisitorChartResultDTO;
import com.epmet.entity.IcResiCollectVisitorEntity;
import com.epmet.redis.IcResiCollectVisitorRedis;
import com.epmet.service.IcResiCollectVisitorService;
import com.epmet.util.dh.DhDeviceUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
@ -28,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -48,6 +50,12 @@ public class IcResiCollectVisitorServiceImpl extends BaseServiceImpl<IcResiColle
@Autowired
private IcResiCollectServiceImpl icResiCollectServiceImpl;
@Autowired
private LoginUserUtil loginUserUtil;
@Autowired
private DhDeviceUtil dhDeviceUtil;
@Override
public PageData<IcResiCollectVisitorDTO> page(Map<String, Object> params) {
IPage<IcResiCollectVisitorEntity> page = baseDao.selectPage(
@ -59,11 +67,13 @@ public class IcResiCollectVisitorServiceImpl extends BaseServiceImpl<IcResiColle
/**
* 条件查询
*
* @param params
* @return
*/
@Override
public PageData<IcResiCollectVisitorDTO> getPhrasePage(Map<String, Object> params) {
params.put("customerId", loginUserUtil.getLoginUserCustomerId());
IPage<IcResiCollectVisitorDTO> page = getPage(params);
List<IcResiCollectVisitorDTO> list = baseDao.getPhrasePage(params);
return new PageData<>(list, page.getTotal());
@ -71,6 +81,7 @@ public class IcResiCollectVisitorServiceImpl extends BaseServiceImpl<IcResiColle
/**
* Desc: 查询访客信息
*
* @param formDTO
* @author wgf
* @date 2022/8/5 8:23
@ -78,10 +89,10 @@ public class IcResiCollectVisitorServiceImpl extends BaseServiceImpl<IcResiColle
@Override
public PageData<IcResiCollectVisitorDTO> getVisitorList(VisitListFormDTO formDTO) {
PageData<IcResiCollectVisitorDTO> result = new PageData<>(new ArrayList<>(), 0);
if (StringUtils.isBlank(formDTO.getStartTime()) && StringUtils.isBlank(formDTO.getEndTime()) ){
if (StringUtils.isBlank(formDTO.getStartTime()) && StringUtils.isBlank(formDTO.getEndTime())) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo){
throw new EpmetException("查询人员信息失败"+formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException("查询人员信息失败" + formDTO.getUserId());
}
formDTO.setOrgId(staffInfo.getAgencyId());
}
@ -98,8 +109,8 @@ public class IcResiCollectVisitorServiceImpl extends BaseServiceImpl<IcResiColle
return ConvertUtils.sourceToTarget(entityList, IcResiCollectVisitorDTO.class);
}
private QueryWrapper<IcResiCollectVisitorEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<IcResiCollectVisitorEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcResiCollectVisitorEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -146,6 +157,16 @@ public class IcResiCollectVisitorServiceImpl extends BaseServiceImpl<IcResiColle
entity.setPids(neighborHoodDTO.getAgencyPids());
entity.setCustomerId(neighborHoodDTO.getCustomerId());
insert(entity);
// 如果是顺德居小区的人还要下放门禁
if (dto.getVillageName().contains("顺德居") && StringUtils.isNotBlank(dto.getFaceImg())) {
VisitVisitorFormDTO visitor = new VisitVisitorFormDTO();
visitor.setMobile(dto.getMobile());
visitor.setName(dto.getName());
visitor.setIdCard(dto.getIdCard());
visitor.setFaceImg(dto.getFaceImg());
dhDeviceUtil.sendAuth(visitor);
}
return new Result().ok("提交成功");
}
@ -155,4 +176,21 @@ public class IcResiCollectVisitorServiceImpl extends BaseServiceImpl<IcResiColle
return new Result().ok(entity);
}
@Override
public Result getVisitorInfo(TokenDto tokenDto, VisitorInfoFormDTO dto) {
dto.setUserId(tokenDto.getUserId());
dto.setCustomerId(tokenDto.getCustomerId());
IcResiCollectVisitorEntity entity = baseDao.getLastInfo(dto);
return new Result().ok(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public List<VisitVisitorChartResultDTO> getTraffic(VisitVisitorChartFormDTO dto) {
if (StringUtils.isBlank(dto.getDate())) {
dto.setDate(LocalDate.now().toString());
}
return baseDao.getTraffic(dto);
}
}

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

@ -176,18 +176,18 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(DelIcResiUserFormDTO formDTO) {
baseDao.updateToDel(formDTO.getIcResiUserId());
baseDao.updateToDel(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId());
CustomerFormQueryDTO queryDTO = ConvertUtils.sourceToTarget(formDTO, CustomerFormQueryDTO.class);
Result<Set<String>> subTableRes = operCustomizeOpenFeignClient.queryIcResiSubTables(queryDTO);
if (subTableRes.success() && !CollectionUtils.isEmpty(subTableRes.getData())) {
for (String subTalbeName : subTableRes.getData()) {
baseDao.updateSubTableToDel(subTalbeName, formDTO.getIcResiUserId());
baseDao.updateSubTableToDel(subTalbeName, formDTO.getIcResiUserId(),formDTO.getCurrentStaffId());
}
}
//删除ic_user_transfer_record、ic_user_change_record、ic_user_change_detailed
icUserTransferRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId());
icUserChangeRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId());
icUserChangeDetailedService.deleteByIcResiUserId(formDTO.getIcResiUserId());
icUserTransferRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId());
icUserChangeRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId());
icUserChangeDetailedService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId());
}
/**

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

@ -45,7 +45,7 @@ public class IcUserChangeDetailedServiceImpl extends BaseServiceImpl<IcUserChang
}
@Override
public int deleteByIcResiUserId(String icResiUserId) {
return baseDao.deleteByIcResiUserId(icResiUserId);
public int deleteByIcResiUserId(String icResiUserId,String currentStaffId) {
return baseDao.deleteByIcResiUserId(icResiUserId,currentStaffId);
}
}

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

@ -172,8 +172,8 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl<IcUserChangeR
}
@Override
public int deleteByIcResiUserId(String icResiUserId) {
return baseDao.deleteByIcResiUserId(icResiUserId);
public int deleteByIcResiUserId(String icResiUserId,String currentStaffId) {
return baseDao.deleteByIcResiUserId(icResiUserId,currentStaffId);
}
/**

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

@ -412,8 +412,8 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans
}
@Override
public int deleteByIcResiUserId(String icResiUserId) {
return baseDao.deleteByIcResiUserId(icResiUserId);
public int deleteByIcResiUserId(String icResiUserId,String currentStaffId) {
return baseDao.deleteByIcResiUserId(icResiUserId,currentStaffId);
}

87
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVaccinePrarmeterServiceImpl.java

@ -0,0 +1,87 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.IcVaccinePrarmeterDao;
import com.epmet.dto.IcVaccinePrarmeterDTO;
import com.epmet.entity.IcVaccinePrarmeterEntity;
import com.epmet.redis.IcVaccinePrarmeterRedis;
import com.epmet.service.IcVaccinePrarmeterService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 新冠病毒疫苗接种人员信息台账
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-22
*/
@Service
public class IcVaccinePrarmeterServiceImpl extends BaseServiceImpl<IcVaccinePrarmeterDao, IcVaccinePrarmeterEntity> implements IcVaccinePrarmeterService {
@Autowired
private IcVaccinePrarmeterRedis icVaccinePrarmeterRedis;
@Override
public PageData<IcVaccinePrarmeterDTO> page(Map<String, Object> params) {
IPage<IcVaccinePrarmeterEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcVaccinePrarmeterDTO.class);
}
@Override
public List<IcVaccinePrarmeterDTO> list(Map<String, Object> params) {
List<IcVaccinePrarmeterEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcVaccinePrarmeterDTO.class);
}
private QueryWrapper<IcVaccinePrarmeterEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcVaccinePrarmeterEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcVaccinePrarmeterDTO get(String id) {
IcVaccinePrarmeterEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcVaccinePrarmeterDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcVaccinePrarmeterDTO dto) {
IcVaccinePrarmeterEntity entity = ConvertUtils.sourceToTarget(dto, IcVaccinePrarmeterEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcVaccinePrarmeterDTO dto) {
IcVaccinePrarmeterEntity entity = ConvertUtils.sourceToTarget(dto, IcVaccinePrarmeterEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

768
epmet-user/epmet-user-server/src/main/java/com/epmet/util/dh/Base64Util.java

@ -0,0 +1,768 @@
package com.epmet.util.dh;
import java.math.BigInteger;
/**
* Provides Base64 encoding and decoding as defined by <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>.
*
* <p>
* This class implements section <cite>6.8. Base64 Content-Transfer-Encoding</cite> from RFC 2045 <cite>Multipurpose
* Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</cite> by Freed and Borenstein.
* </p>
* <p>
* The class can be parameterized in the following manner with various constructors:
* </p>
* <ul>
* <li>URL-safe mode: Default off.</li>
* <li>Line length: Default 76. Line length that aren't multiples of 4 will still essentially end up being multiples of
* 4 in the encoded data.
* <li>Line separator: Default is CRLF ("\r\n")</li>
* </ul>
* <p>
* The URL-safe parameter is only applied to encode operations. Decoding seamlessly handles both modes.
* </p>
* <p>
* Since this class operates directly on byte streams, and not character streams, it is hard-coded to only
* encode/decode character encodings which are compatible with the lower 127 ASCII chart (ISO-8859-1, Windows-1252,
* UTF-8, etc).
* </p>
* <p>
* This class is thread-safe.
* </p>
*
* @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
* @since 1.0
* @version $Id: Base64.java 1635986 2014-11-01 16:27:52Z tn $
*/
public class Base64Util extends BaseNCodec {
/**
* BASE32 characters are 6 bits in length.
* They are formed by taking a block of 3 octets to form a 24-bit string,
* which is converted into 4 BASE64 characters.
*/
private static final int BITS_PER_ENCODED_BYTE = 6;
private static final int BYTES_PER_UNENCODED_BLOCK = 3;
private static final int BYTES_PER_ENCODED_BLOCK = 4;
/**
* Chunk separator per RFC 2045 section 2.1.
*
* <p>
* N.B. The next major release may break compatibility and make this field private.
* </p>
*
* @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045 section 2.1</a>
*/
static final byte[] CHUNK_SEPARATOR = {'\r', '\n'};
/**
* This array is a lookup table that translates 6-bit positive integer index values into their "Base64 Alphabet"
* equivalents as specified in Table 1 of RFC 2045.
*
* Thanks to "commons" project in ws.apache.org for this code.
* http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/
*/
private static final byte[] STANDARD_ENCODE_TABLE = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
};
/**
* This is a copy of the STANDARD_ENCODE_TABLE above, but with + and /
* changed to - and _ to make the encoded Base64 results more URL-SAFE.
* This table is only used when the Base64's mode is set to URL-SAFE.
*/
private static final byte[] URL_SAFE_ENCODE_TABLE = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_'
};
/**
* This array is a lookup table that translates Unicode characters drawn from the "Base64 Alphabet" (as specified
* in Table 1 of RFC 2045) into their 6-bit positive integer equivalents. Characters that are not in the Base64
* alphabet but fall within the bounds of the array are translated to -1.
*
* Note: '+' and '-' both decode to 62. '/' and '_' both decode to 63. This means decoder seamlessly handles both
* URL_SAFE and STANDARD base64. (The encoder, on the other hand, needs to know ahead of time what to emit).
*
* Thanks to "commons" project in ws.apache.org for this code.
* http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/
*/
private static final byte[] DECODE_TABLE = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 62, -1, 63, 52, 53, 54,
55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, -1, -1, -1, -1, 63, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
};
/**
* Base64 uses 6-bit fields.
*/
/** Mask used to extract 6 bits, used when encoding */
private static final int MASK_6BITS = 0x3f;
// The static final fields above are used for the original static byte[] methods on Base64.
// The private member fields below are used with the new streaming approach, which requires
// some state be preserved between calls of encode() and decode().
/**
* Encode table to use: either STANDARD or URL_SAFE. Note: the DECODE_TABLE above remains static because it is able
* to decode both STANDARD and URL_SAFE streams, but the encodeTable must be a member variable so we can switch
* between the two modes.
*/
private final byte[] encodeTable;
// Only one decode table currently; keep for consistency with Base32 code
private final byte[] decodeTable = DECODE_TABLE;
/**
* Line separator for encoding. Not used when decoding. Only used if lineLength &gt; 0.
*/
private final byte[] lineSeparator;
/**
* Convenience variable to help us determine when our buffer is going to run out of room and needs resizing.
* <code>decodeSize = 3 + lineSeparator.length;</code>
*/
private final int decodeSize;
/**
* Convenience variable to help us determine when our buffer is going to run out of room and needs resizing.
* <code>encodeSize = 4 + lineSeparator.length;</code>
*/
private final int encodeSize;
/**
* Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode.
* <p>
* When encoding the line length is 0 (no chunking), and the encoding table is STANDARD_ENCODE_TABLE.
* </p>
*
* <p>
* When decoding all variants are supported.
* </p>
*/
public Base64Util() {
this(0);
}
/**
* Creates a Base64 codec used for decoding (all modes) and encoding in the given URL-safe mode.
* <p>
* When encoding the line length is 76, the line separator is CRLF, and the encoding table is STANDARD_ENCODE_TABLE.
* </p>
*
* <p>
* When decoding all variants are supported.
* </p>
*
* @param urlSafe
* if <code>true</code>, URL-safe encoding is used. In most cases this should be set to
* <code>false</code>.
* @since 1.4
*/
public Base64Util(final boolean urlSafe) {
this(MIME_CHUNK_SIZE, CHUNK_SEPARATOR, urlSafe);
}
/**
* Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode.
* <p>
* When encoding the line length is given in the constructor, the line separator is CRLF, and the encoding table is
* STANDARD_ENCODE_TABLE.
* </p>
* <p>
* Line lengths that aren't multiples of 4 will still essentially end up being multiples of 4 in the encoded data.
* </p>
* <p>
* When decoding all variants are supported.
* </p>
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* 4). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
* @since 1.4
*/
public Base64Util(final int lineLength) {
this(lineLength, CHUNK_SEPARATOR);
}
/**
* Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode.
* <p>
* When encoding the line length and line separator are given in the constructor, and the encoding table is
* STANDARD_ENCODE_TABLE.
* </p>
* <p>
* Line lengths that aren't multiples of 4 will still essentially end up being multiples of 4 in the encoded data.
* </p>
* <p>
* When decoding all variants are supported.
* </p>
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* 4). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
* @param lineSeparator
* Each line of encoded data will end with this sequence of bytes.
* @throws IllegalArgumentException
* Thrown when the provided lineSeparator included some base64 characters.
* @since 1.4
*/
public Base64Util(final int lineLength, final byte[] lineSeparator) {
this(lineLength, lineSeparator, false);
}
/**
* Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode.
* <p>
* When encoding the line length and line separator are given in the constructor, and the encoding table is
* STANDARD_ENCODE_TABLE.
* </p>
* <p>
* Line lengths that aren't multiples of 4 will still essentially end up being multiples of 4 in the encoded data.
* </p>
* <p>
* When decoding all variants are supported.
* </p>
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* 4). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
* @param lineSeparator
* Each line of encoded data will end with this sequence of bytes.
* @param urlSafe
* Instead of emitting '+' and '/' we emit '-' and '_' respectively. urlSafe is only applied to encode
* operations. Decoding seamlessly handles both modes.
* <b>Note: no padding is added when using the URL-safe alphabet.</b>
* @throws IllegalArgumentException
* The provided lineSeparator included some base64 characters. That's not going to work!
* @since 1.4
*/
public Base64Util(final int lineLength, final byte[] lineSeparator, final boolean urlSafe) {
super(BYTES_PER_UNENCODED_BLOCK, BYTES_PER_ENCODED_BLOCK,
lineLength,
lineSeparator == null ? 0 : lineSeparator.length);
// TODO could be simplified if there is no requirement to reject invalid line sep when length <=0
// @see test case Base64Test.testConstructors()
if (lineSeparator != null) {
if (containsAlphabetOrPad(lineSeparator)) {
final String sep = newStringUtf8(lineSeparator);
throw new IllegalArgumentException("lineSeparator must not contain base64 characters: [" + sep + "]");
}
if (lineLength > 0){ // null line-sep forces no chunking rather than throwing IAE
this.encodeSize = BYTES_PER_ENCODED_BLOCK + lineSeparator.length;
this.lineSeparator = new byte[lineSeparator.length];
System.arraycopy(lineSeparator, 0, this.lineSeparator, 0, lineSeparator.length);
} else {
this.encodeSize = BYTES_PER_ENCODED_BLOCK;
this.lineSeparator = null;
}
} else {
this.encodeSize = BYTES_PER_ENCODED_BLOCK;
this.lineSeparator = null;
}
this.decodeSize = this.encodeSize - 1;
this.encodeTable = urlSafe ? URL_SAFE_ENCODE_TABLE : STANDARD_ENCODE_TABLE;
}
/**
* Returns our current encode mode. True if we're URL-SAFE, false otherwise.
*
* @return true if we're in URL-SAFE mode, false otherwise.
* @since 1.4
*/
public boolean isUrlSafe() {
return this.encodeTable == URL_SAFE_ENCODE_TABLE;
}
/**
* <p>
* Encodes all of the provided data, starting at inPos, for inAvail bytes. Must be called at least twice: once with
* the data to encode, and once with inAvail set to "-1" to alert encoder that EOF has been reached, to flush last
* remaining bytes (if not multiple of 3).
* </p>
* <p><b>Note: no padding is added when encoding using the URL-safe alphabet.</b></p>
* <p>
* Thanks to "commons" project in ws.apache.org for the bitwise operations, and general approach.
* http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/
* </p>
*
* @param in
* byte[] array of binary data to base64 encode.
* @param inPos
* Position to start reading data from.
* @param inAvail
* Amount of bytes available from input for encoding.
* @param context
* the context to be used
*/
@Override
void encode(final byte[] in, int inPos, final int inAvail, final Context context) {
if (context.eof) {
return;
}
// inAvail < 0 is how we're informed of EOF in the underlying data we're
// encoding.
if (inAvail < 0) {
context.eof = true;
if (0 == context.modulus && lineLength == 0) {
return; // no leftovers to process and not using chunking
}
final byte[] buffer = ensureBufferSize(encodeSize, context);
final int savedPos = context.pos;
switch (context.modulus) { // 0-2
case 0 : // nothing to do here
break;
case 1 : // 8 bits = 6 + 2
// top 6 bits:
buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 2) & MASK_6BITS];
// remaining 2:
buffer[context.pos++] = encodeTable[(context.ibitWorkArea << 4) & MASK_6BITS];
// URL-SAFE skips the padding to further reduce size.
if (encodeTable == STANDARD_ENCODE_TABLE) {
buffer[context.pos++] = pad;
buffer[context.pos++] = pad;
}
break;
case 2 : // 16 bits = 6 + 6 + 4
buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 10) & MASK_6BITS];
buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 4) & MASK_6BITS];
buffer[context.pos++] = encodeTable[(context.ibitWorkArea << 2) & MASK_6BITS];
// URL-SAFE skips the padding to further reduce size.
if (encodeTable == STANDARD_ENCODE_TABLE) {
buffer[context.pos++] = pad;
}
break;
default:
throw new IllegalStateException("Impossible modulus "+context.modulus);
}
context.currentLinePos += context.pos - savedPos; // keep track of current line position
// if currentPos == 0 we are at the start of a line, so don't add CRLF
if (lineLength > 0 && context.currentLinePos > 0) {
System.arraycopy(lineSeparator, 0, buffer, context.pos, lineSeparator.length);
context.pos += lineSeparator.length;
}
} else {
for (int i = 0; i < inAvail; i++) {
final byte[] buffer = ensureBufferSize(encodeSize, context);
context.modulus = (context.modulus+1) % BYTES_PER_UNENCODED_BLOCK;
int b = in[inPos++];
if (b < 0) {
b += 256;
}
context.ibitWorkArea = (context.ibitWorkArea << 8) + b; // BITS_PER_BYTE
if (0 == context.modulus) { // 3 bytes = 24 bits = 4 * 6 bits to extract
buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 18) & MASK_6BITS];
buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 12) & MASK_6BITS];
buffer[context.pos++] = encodeTable[(context.ibitWorkArea >> 6) & MASK_6BITS];
buffer[context.pos++] = encodeTable[context.ibitWorkArea & MASK_6BITS];
context.currentLinePos += BYTES_PER_ENCODED_BLOCK;
if (lineLength > 0 && lineLength <= context.currentLinePos) {
System.arraycopy(lineSeparator, 0, buffer, context.pos, lineSeparator.length);
context.pos += lineSeparator.length;
context.currentLinePos = 0;
}
}
}
}
}
/**
* <p>
* Decodes all of the provided data, starting at inPos, for inAvail bytes. Should be called at least twice: once
* with the data to decode, and once with inAvail set to "-1" to alert decoder that EOF has been reached. The "-1"
* call is not necessary when decoding, but it doesn't hurt, either.
* </p>
* <p>
* Ignores all non-base64 characters. This is how chunked (e.g. 76 character) data is handled, since CR and LF are
* silently ignored, but has implications for other bytes, too. This method subscribes to the garbage-in,
* garbage-out philosophy: it will not check the provided data for validity.
* </p>
* <p>
* Thanks to "commons" project in ws.apache.org for the bitwise operations, and general approach.
* http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/
* </p>
*
* @param in
* byte[] array of ascii data to base64 decode.
* @param inPos
* Position to start reading data from.
* @param inAvail
* Amount of bytes available from input for encoding.
* @param context
* the context to be used
*/
@Override
void decode(final byte[] in, int inPos, final int inAvail, final Context context) {
if (context.eof) {
return;
}
if (inAvail < 0) {
context.eof = true;
}
for (int i = 0; i < inAvail; i++) {
final byte[] buffer = ensureBufferSize(decodeSize, context);
final byte b = in[inPos++];
if (b == pad) {
// We're done.
context.eof = true;
break;
} else {
if (b >= 0 && b < DECODE_TABLE.length) {
final int result = DECODE_TABLE[b];
if (result >= 0) {
context.modulus = (context.modulus+1) % BYTES_PER_ENCODED_BLOCK;
context.ibitWorkArea = (context.ibitWorkArea << BITS_PER_ENCODED_BYTE) + result;
if (context.modulus == 0) {
buffer[context.pos++] = (byte) ((context.ibitWorkArea >> 16) & MASK_8BITS);
buffer[context.pos++] = (byte) ((context.ibitWorkArea >> 8) & MASK_8BITS);
buffer[context.pos++] = (byte) (context.ibitWorkArea & MASK_8BITS);
}
}
}
}
}
// Two forms of EOF as far as base64 decoder is concerned: actual
// EOF (-1) and first time '=' character is encountered in stream.
// This approach makes the '=' padding characters completely optional.
if (context.eof && context.modulus != 0) {
final byte[] buffer = ensureBufferSize(decodeSize, context);
// We have some spare bits remaining
// Output all whole multiples of 8 bits and ignore the rest
switch (context.modulus) {
// case 0 : // impossible, as excluded above
case 1 : // 6 bits - ignore entirely
// TODO not currently tested; perhaps it is impossible?
break;
case 2 : // 12 bits = 8 + 4
context.ibitWorkArea = context.ibitWorkArea >> 4; // dump the extra 4 bits
buffer[context.pos++] = (byte) ((context.ibitWorkArea) & MASK_8BITS);
break;
case 3 : // 18 bits = 8 + 8 + 2
context.ibitWorkArea = context.ibitWorkArea >> 2; // dump 2 bits
buffer[context.pos++] = (byte) ((context.ibitWorkArea >> 8) & MASK_8BITS);
buffer[context.pos++] = (byte) ((context.ibitWorkArea) & MASK_8BITS);
break;
default:
throw new IllegalStateException("Impossible modulus "+context.modulus);
}
}
}
/**
* Tests a given byte array to see if it contains only valid characters within the Base64 alphabet. Currently the
* method treats whitespace as valid.
*
* @param arrayOctet
* byte array to test
* @return <code>true</code> if all bytes are valid characters in the Base64 alphabet or if the byte array is empty;
* <code>false</code>, otherwise
* @deprecated 1.5 Use {@link #isBase64(byte[])}, will be removed in 2.0.
*/
@Deprecated
public static boolean isArrayByteBase64(final byte[] arrayOctet) {
return isBase64(arrayOctet);
}
/**
* Returns whether or not the <code>octet</code> is in the base 64 alphabet.
*
* @param octet
* The value to test
* @return <code>true</code> if the value is defined in the the base 64 alphabet, <code>false</code> otherwise.
* @since 1.4
*/
public static boolean isBase64(final byte octet) {
return octet == PAD_DEFAULT || (octet >= 0 && octet < DECODE_TABLE.length && DECODE_TABLE[octet] != -1);
}
/**
* Tests a given String to see if it contains only valid characters within the Base64 alphabet. Currently the
* method treats whitespace as valid.
*
* @param base64
* String to test
* @return <code>true</code> if all characters in the String are valid characters in the Base64 alphabet or if
* the String is empty; <code>false</code>, otherwise
* @since 1.5
*/
public static boolean isBase64(final String base64) {
return isBase64(getBytesUtf8(base64));
}
/**
* Tests a given byte array to see if it contains only valid characters within the Base64 alphabet. Currently the
* method treats whitespace as valid.
*
* @param arrayOctet
* byte array to test
* @return <code>true</code> if all bytes are valid characters in the Base64 alphabet or if the byte array is empty;
* <code>false</code>, otherwise
* @since 1.5
*/
public static boolean isBase64(final byte[] arrayOctet) {
for (int i = 0; i < arrayOctet.length; i++) {
if (!isBase64(arrayOctet[i]) && !isWhiteSpace(arrayOctet[i])) {
return false;
}
}
return true;
}
/**
* Encodes binary data using the base64 algorithm but does not chunk the output.
*
* @param binaryData
* binary data to encode
* @return byte[] containing Base64 characters in their UTF-8 representation.
*/
public static byte[] encodeBase64(final byte[] binaryData) {
return encodeBase64(binaryData, false);
}
/**
* Encodes binary data using the base64 algorithm but does not chunk the output.
*
* NOTE: We changed the behaviour of this method from multi-line chunking (commons-codec-1.4) to
* single-line non-chunking (commons-codec-1.5).
*
* @param binaryData
* binary data to encode
* @return String containing Base64 characters.
* @since 1.4 (NOTE: 1.4 chunked the output, whereas 1.5 does not).
*/
public static String encodeBase64String(final byte[] binaryData) {
return newStringUtf8(encodeBase64(binaryData, false));
}
/**
* Encodes binary data using a URL-safe variation of the base64 algorithm but does not chunk the output. The
* url-safe variation emits - and _ instead of + and / characters.
* <b>Note: no padding is added.</b>
* @param binaryData
* binary data to encode
* @return byte[] containing Base64 characters in their UTF-8 representation.
* @since 1.4
*/
public static byte[] encodeBase64URLSafe(final byte[] binaryData) {
return encodeBase64(binaryData, false, true);
}
/**
* Encodes binary data using a URL-safe variation of the base64 algorithm but does not chunk the output. The
* url-safe variation emits - and _ instead of + and / characters.
* <b>Note: no padding is added.</b>
* @param binaryData
* binary data to encode
* @return String containing Base64 characters
* @since 1.4
*/
public static String encodeBase64URLSafeString(final byte[] binaryData) {
return newStringUtf8(encodeBase64(binaryData, false, true));
}
/**
* Encodes binary data using the base64 algorithm and chunks the encoded output into 76 character blocks
*
* @param binaryData
* binary data to encode
* @return Base64 characters chunked in 76 character blocks
*/
public static byte[] encodeBase64Chunked(final byte[] binaryData) {
return encodeBase64(binaryData, true);
}
/**
* Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks.
*
* @param binaryData
* Array containing binary data to encode.
* @param isChunked
* if <code>true</code> this encoder will chunk the base64 output into 76 character blocks
* @return Base64-encoded data.
* @throws IllegalArgumentException
* Thrown when the input array needs an output array bigger than {@link Integer#MAX_VALUE}
*/
public static byte[] encodeBase64(final byte[] binaryData, final boolean isChunked) {
return encodeBase64(binaryData, isChunked, false);
}
/**
* Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks.
*
* @param binaryData
* Array containing binary data to encode.
* @param isChunked
* if <code>true</code> this encoder will chunk the base64 output into 76 character blocks
* @param urlSafe
* if <code>true</code> this encoder will emit - and _ instead of the usual + and / characters.
* <b>Note: no padding is added when encoding using the URL-safe alphabet.</b>
* @return Base64-encoded data.
* @throws IllegalArgumentException
* Thrown when the input array needs an output array bigger than {@link Integer#MAX_VALUE}
* @since 1.4
*/
public static byte[] encodeBase64(final byte[] binaryData, final boolean isChunked, final boolean urlSafe) {
return encodeBase64(binaryData, isChunked, urlSafe, Integer.MAX_VALUE);
}
/**
* Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks.
*
* @param binaryData
* Array containing binary data to encode.
* @param isChunked
* if <code>true</code> this encoder will chunk the base64 output into 76 character blocks
* @param urlSafe
* if <code>true</code> this encoder will emit - and _ instead of the usual + and / characters.
* <b>Note: no padding is added when encoding using the URL-safe alphabet.</b>
* @param maxResultSize
* The maximum result size to accept.
* @return Base64-encoded data.
* @throws IllegalArgumentException
* Thrown when the input array needs an output array bigger than maxResultSize
* @since 1.4
*/
public static byte[] encodeBase64(final byte[] binaryData, final boolean isChunked,
final boolean urlSafe, final int maxResultSize) {
if (binaryData == null || binaryData.length == 0) {
return binaryData;
}
// Create this so can use the super-class method
// Also ensures that the same roundings are performed by the ctor and the code
final Base64Util b64 = isChunked ? new Base64Util(urlSafe) : new Base64Util(0, CHUNK_SEPARATOR, urlSafe);
final long len = b64.getEncodedLength(binaryData);
if (len > maxResultSize) {
throw new IllegalArgumentException("Input array too big, the output array would be bigger (" +
len +
") than the specified maximum size of " +
maxResultSize);
}
return b64.encode(binaryData);
}
/**
* Decodes a Base64 String into octets.
* <p>
* <b>Note:</b> this method seamlessly handles data encoded in URL-safe or normal mode.
* </p>
*
* @param base64String
* String containing Base64 data
* @return Array containing decoded data.
* @since 1.4
*/
public static byte[] decodeBase64(final String base64String) {
return new Base64Util().decode(base64String);
}
/**
* Decodes Base64 data into octets.
* <p>
* <b>Note:</b> this method seamlessly handles data encoded in URL-safe or normal mode.
* </p>
*
* @param base64Data
* Byte array containing Base64 data
* @return Array containing decoded data.
*/
public static byte[] decodeBase64(final byte[] base64Data) {
return new Base64Util().decode(base64Data);
}
// Implementation of the Encoder Interface
// Implementation of integer encoding used for crypto
/**
* Decodes a byte64-encoded integer according to crypto standards such as W3C's XML-Signature.
*
* @param pArray
* a byte array containing base64 character data
* @return A BigInteger
* @since 1.4
*/
public static BigInteger decodeInteger(final byte[] pArray) {
return new BigInteger(1, decodeBase64(pArray));
}
/**
* Encodes to a byte64-encoded integer according to crypto standards such as W3C's XML-Signature.
*
* @param bigInt
* a BigInteger
* @return A byte array containing base64 character data
* @throws NullPointerException
* if null is passed in
* @since 1.4
*/
public static byte[] encodeInteger(final BigInteger bigInt) {
if (bigInt == null) {
throw new NullPointerException("encodeInteger called with null parameter");
}
return encodeBase64(toIntegerBytes(bigInt), false);
}
/**
* Returns a byte-array representation of a <code>BigInteger</code> without sign bit.
*
* @param bigInt
* <code>BigInteger</code> to be converted
* @return a byte array representation of the BigInteger parameter
*/
static byte[] toIntegerBytes(final BigInteger bigInt) {
int bitlen = bigInt.bitLength();
// round bitlen
bitlen = ((bitlen + 7) >> 3) << 3;
final byte[] bigBytes = bigInt.toByteArray();
if (((bigInt.bitLength() % 8) != 0) && (((bigInt.bitLength() / 8) + 1) == (bitlen / 8))) {
return bigBytes;
}
// set up params for copying everything but sign bit
int startSrc = 0;
int len = bigBytes.length;
// if bigInt is exactly byte-aligned, just skip signbit in copy
if ((bigInt.bitLength() % 8) == 0) {
startSrc = 1;
len--;
}
final int startDst = bitlen / 8 - len; // to pad w/ nulls as per spec
final byte[] resizedBytes = new byte[bitlen / 8];
System.arraycopy(bigBytes, startSrc, resizedBytes, startDst, len);
return resizedBytes;
}
/**
* Returns whether or not the <code>octet</code> is in the Base64 alphabet.
*
* @param octet
* The value to test
* @return <code>true</code> if the value is defined in the the Base64 alphabet <code>false</code> otherwise.
*/
@Override
protected boolean isInAlphabet(final byte octet) {
return octet >= 0 && octet < decodeTable.length && decodeTable[octet] != -1;
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save