From 63dec04110dad7efb42a28766104e656bf7d348c Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 14 Nov 2022 12:07:35 +0800 Subject: [PATCH 01/36] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=89=93=E5=8D=B0?= =?UTF-8?q?listRemoteOptions()->ColumnWrapper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcResiUserImportServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index 2a57869b36..932baf369b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.hutool.core.bean.BeanUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcelFactory; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.epmet.bean.ResiImportCategoryData; @@ -1374,6 +1375,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res cascadeItemColumnWrapper = columnWrappers.get(cascadeItemId); } + log.info("【居民信息导入】#listRemoteOptions,columnWrappers:{},cascadeItemId:{}", JSON.toJSONString(columnWrappers), cascadeItemId); + List options = null; String optionTypeName = null; switch (pureUri) { From 60e91744d1e0f38e1c11b4bec01f9bf900638624 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 14 Nov 2022 12:53:39 +0800 Subject: [PATCH 02/36] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IcResiUserImportServiceImpl.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index 932baf369b..2486b306f0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -453,6 +453,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res String currUserAgencyPids, String currentUserId, String tableName) { String loginUserCustomerId = EpmetRequestHolder.getLoginUserCustomerId(); // 遍历每一行,将行内容转化为 + String idCard = null; for (Map row : dataRows) { LinkedHashMap columnAndValues = new LinkedHashMap<>(); @@ -463,7 +464,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res execSpecifiedCheckAndFill(columnAndValues); //默认新增 columnAndValues.put("SUB_STATUS", IcResiUserSubStatusEnum.IMPORT.getSubStatus()); - String idCard = columnAndValues.get("ID_CARD"); + idCard = columnAndValues.get("ID_CARD"); Map existingResiMap = icResiUserDao.selectResiInfoMap(loginUserCustomerId, idCard, null); if (existingResiMap == null) { @@ -580,7 +581,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res errorMsg = e.getMessage(); } else { errorMsg = "未知系统错误"; - log.error(ExceptionUtils.getErrorStackTrace(e)); + log.error("【居民信息导入】导入身份证为{}的居民基础信息出现未知错误:{}", idCard == null ? "" : idCard, ExceptionUtils.getErrorStackTrace(e)); } ErrorRow errorRow = new ErrorRow(); @@ -696,12 +697,12 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res // 遍历每一行,将行内容转化为 for (Map row : dataRows) { - + String idCard = null; try { convertColumnWrappers2Map4Persist(headerColumnWrapper, row, currUserAgencyId, checkBoxOptionColumnIdxAndLabel, columnAndValues, false); // 检验身份证号 - String idCard = columnAndValues.get("ID_CARD"); + idCard = columnAndValues.get("ID_CARD"); if (StringUtils.isBlank(idCard)) { String resiName = columnAndValues.get("NAME"); if (resiName == null) { @@ -755,7 +756,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res errorMsg = e.getMessage(); } else { errorMsg = "未知系统错误"; - log.error(ExceptionUtils.getErrorStackTrace(e)); + log.error("【居民信息导入】导入身份证为{}的居民扩展信息{}出现未知错误:{}", idCard == null ? "" : idCard, targetTableName, ExceptionUtils.getErrorStackTrace(e)); } ErrorRow errorRow = new ErrorRow(); @@ -1375,8 +1376,6 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res cascadeItemColumnWrapper = columnWrappers.get(cascadeItemId); } - log.info("【居民信息导入】#listRemoteOptions,columnWrappers:{},cascadeItemId:{}", JSON.toJSONString(columnWrappers), cascadeItemId); - List options = null; String optionTypeName = null; switch (pureUri) { From f989b014f2ffa1425d2badc507673197a4fb6aec Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 18 Nov 2022 10:25:52 +0800 Subject: [PATCH 03/36] =?UTF-8?q?ic=5Fform=5Fitem=5Fgroup=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0GROUP=5FCODE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/IcFormItemGroupDTO.java | 14 +++++ .../com/epmet/dto/result/FormGroupDTO.java | 5 ++ .../epmet/entity/IcFormItemGroupEntity.java | 10 ++++ .../db/migration/V0.0.40__itemgroup_code.sql | 56 +++++++++++++++++++ .../src/main/resources/mapper/IcFormDao.xml | 7 ++- 5 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.40__itemgroup_code.sql diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemGroupDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemGroupDTO.java index 660171fce0..fa39a45b01 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemGroupDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/IcFormItemGroupDTO.java @@ -78,4 +78,18 @@ public class IcFormItemGroupDTO implements Serializable { */ private Boolean display; + /** + * 政策人员信息组件;1:展示;0:不展示;默认0 + */ + private String policyFlag; + + /** + * 1展示,0不展示,默认0 + */ + private String childShowFlag; + + /** + * 组编码,唯一标识 + */ + private String groupCode; } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java index 1b2a6c8964..297b4e7163 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FormGroupDTO.java @@ -39,6 +39,11 @@ public class FormGroupDTO implements Serializable { */ private String tableName; + /** + *组编码,唯一标识 + */ + private String groupCode; + /** * 分组里面的组件 */ diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java index 0ce8f42320..9b0e91dde2 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormItemGroupEntity.java @@ -79,4 +79,14 @@ public class IcFormItemGroupEntity extends BaseEpmetEntity { * 政策人员信息组件;1:展示;0:不展示;默认0 */ private String policyFlag; + + /** + * 1展示,0不展示,默认0 + */ + private String childShowFlag; + + /** + * 组编码,唯一标识 + */ + private String groupCode; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.40__itemgroup_code.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.40__itemgroup_code.sql new file mode 100644 index 0000000000..0e11715c94 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.40__itemgroup_code.sql @@ -0,0 +1,56 @@ +alter table ic_form_item_group add COLUMN GROUP_CODE VARCHAR(32) DEFAULT '' COMMENT '组编码,唯一标识' after CHILD_SHOW_FLAG; + +update ic_form_item_group g set g.GROUP_CODE='jcxx' +where g.LABEL='基础信息'; + + +update ic_form_item_group g set g.GROUP_CODE='jyxx' +where g.LABEL='教育信息'; + +update ic_form_item_group g set g.GROUP_CODE='xqah' +where g.LABEL='兴趣爱好'; + +update ic_form_item_group g set g.GROUP_CODE='zjxy' +where g.LABEL='宗教信仰'; + +update ic_form_item_group g set g.GROUP_CODE='jkxx' +where g.LABEL='健康信息'; + +update ic_form_item_group g set g.GROUP_CODE='gzxx' +where g.LABEL='工作信息'; + +update ic_form_item_group g set g.GROUP_CODE='jjzk' +where g.LABEL='经济状况'; + +update ic_form_item_group g set g.GROUP_CODE='jzxx' +where g.LABEL='居住信息'; + +update ic_form_item_group g set g.GROUP_CODE='jtxx' +where g.LABEL='家庭信息'; + +update ic_form_item_group g set g.GROUP_CODE='dyxx' +where g.LABEL='党员信息'; + +update ic_form_item_group g set g.GROUP_CODE='bzfxx' +where g.LABEL='保障房信息'; + +update ic_form_item_group g set g.GROUP_CODE='syxx' +where g.LABEL='失业信息'; + +update ic_form_item_group g set g.GROUP_CODE='tyjrxx' +where g.LABEL='退役军人信息'; + +update ic_form_item_group g set g.GROUP_CODE='zyzxx' +where g.LABEL='志愿者信息'; + +update ic_form_item_group g set g.GROUP_CODE='tsrqxx' +where g.LABEL='特殊人群信息'; + +update ic_form_item_group g set g.GROUP_CODE='tzry' +where g.LABEL='统战人员'; + +update ic_form_item_group g set g.GROUP_CODE='lnrxx' +where g.LABEL='老年人信息'; + +update ic_form_item_group g set g.GROUP_CODE='resi_demand' +where g.LABEL='居民需求信息'; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml index d0cca510ad..6109c59bf5 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml @@ -66,7 +66,8 @@ g.LABEL, g.sort, g.SUPPORT_ADD, - g.TABLE_NAME AS TABLE_NAME + g.TABLE_NAME AS TABLE_NAME, + g.GROUP_CODE FROM ic_form_item_group g WHERE @@ -124,6 +125,7 @@ + @@ -200,7 +202,8 @@ case when g.table_name is null or g.table_name ='' then 'ic_resi_user' else g.TABLE_NAME end - ) AS TABLE_NAME + ) AS TABLE_NAME, + g.GROUP_CODE FROM ic_form_item_group g WHERE From 824b783c044d7245dcc5c2370b5dff0748360105 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 18 Nov 2022 10:44:38 +0800 Subject: [PATCH 04/36] =?UTF-8?q?=E6=95=B0=E5=AD=97=E7=A4=BE=E5=8C=BA?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/IcFormController.java | 3 +- .../epmet/service/impl/IcFormServiceImpl.java | 50 +++++++++---------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java index dcb08f35e7..28a82969e6 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormController.java @@ -52,9 +52,10 @@ public class IcFormController { /** * desc: 初始化 客户表单配置 + * 运营端-数字社区初始化 * * @param customerId - * @param formCode + * @param formCode value: resi_base_info * @return com.epmet.commons.tools.utils.Result * @author LiuJanJun * @date 2021/12/8 4:28 下午 diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java index 2871ac9a3e..be48d33692 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java @@ -172,7 +172,7 @@ public class IcFormServiceImpl extends BaseServiceImpl defaultIcForm.setCreatedTime(new Date()); defaultIcForm.setUpdatedBy("init_user"); defaultIcForm.setUpdatedTime(new Date()); - + // 1、设置ic_form int insert = baseDao.insert(defaultIcForm); log.info("insert icForm:" + insert); @@ -184,7 +184,7 @@ public class IcFormServiceImpl extends BaseServiceImpl return "默认配置错误"; } String defaultBaseInfoGroupId = "default_0"; - //设置ic_form_item + //2、设置ic_form_item itemList.forEach(item -> { item.setId(newPrefixed + item.getId()); item.setCustomerId(customerId); @@ -215,7 +215,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icFormItemDao.insert(item); }); - //设置ic_form_item_options + //3、设置ic_form_item_options LambdaQueryWrapper wrapperOptions = new LambdaQueryWrapper<>(); wrapperOptions.eq(IcFormItemOptionsEntity::getCustomerId, defaultCustomerId); wrapperOptions.eq(IcFormItemOptionsEntity::getFormCode, formCode); @@ -233,7 +233,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icFormItemOptionsDao.insert(item); }); - //设置ic_form_item_group + //4、设置ic_form_item_group LambdaQueryWrapper wrapperGroup = new LambdaQueryWrapper<>(); wrapperGroup.eq(IcFormItemGroupEntity::getCustomerId, defaultCustomerId); wrapperGroup.eq(IcFormItemGroupEntity::getFormCode, formCode); @@ -255,7 +255,7 @@ public class IcFormServiceImpl extends BaseServiceImpl icFormItemGroupDao.insert(item); }); - //设置ic_form_query_builder + //5、设置ic_form_query_builder LambdaQueryWrapper wrapperQuery = new LambdaQueryWrapper<>(); wrapperQuery.eq(IcFormQueryBuilderEntity::getCustomerId, defaultCustomerId); wrapperQuery.eq(IcFormQueryBuilderEntity::getFormCode, formCode); @@ -272,6 +272,26 @@ public class IcFormServiceImpl extends BaseServiceImpl icFormQueryBuilderDao.insert(item); }); + //6、设置ic_form_list_item + LambdaQueryWrapper listItemWapper = new LambdaQueryWrapper<>(); + listItemWapper.eq(IcFormListItemEntity::getCustomerId, defaultCustomerId); + listItemWapper.eq(IcFormListItemEntity::getFormCode, formCode); + List listItemList = icFormListItemDao.selectList(listItemWapper); + if (CollectionUtils.isEmpty(listItemList)) { + return "默认配置错误"; + } + listItemList.forEach(item -> { + item.setId(newPrefixed + item.getId()); + item.setCustomerId(customerId); + item.setFormItemId(newPrefixed + item.getFormItemId()); + item.setCreatedBy("init_user"); + item.setCreatedTime(new Date()); + item.setUpdatedBy("init_user"); + item.setUpdatedTime(new Date()); + log.debug("stats:"+ JSON.toJSONString(item)); + icFormListItemDao.insert(item); + }); + //设置ic_resi_category_stats_config LambdaQueryWrapper wrapperStats = new LambdaQueryWrapper<>(); wrapperStats.eq(IcResiCategoryStatsConfigEntity::getCustomerId, defaultCustomerId); @@ -302,26 +322,6 @@ public class IcFormServiceImpl extends BaseServiceImpl icResiCategoryWarnConfigDao.insert(item); }); - //设置ic_form_list_item - LambdaQueryWrapper listItemWapper = new LambdaQueryWrapper<>(); - listItemWapper.eq(IcFormListItemEntity::getCustomerId, defaultCustomerId); - listItemWapper.eq(IcFormListItemEntity::getFormCode, formCode); - List listItemList = icFormListItemDao.selectList(listItemWapper); - if (CollectionUtils.isEmpty(listItemList)) { - return "默认配置错误"; - } - listItemList.forEach(item -> { - item.setId(newPrefixed + item.getId()); - item.setCustomerId(customerId); - item.setFormItemId(newPrefixed + item.getFormItemId()); - item.setCreatedBy("init_user"); - item.setCreatedTime(new Date()); - item.setUpdatedBy("init_user"); - item.setUpdatedTime(new Date()); - log.debug("stats:"+ JSON.toJSONString(item)); - icFormListItemDao.insert(item); - }); - //设置ic_service_item_dict和ic_resi_demand_dict Result result = epmetHeartOpenFeignClient.customerInit(customerId); if (!result.success()) { From c9842b4f81ae42d0198565050ef9a20a2d5d3b25 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 18 Nov 2022 12:58:29 +0800 Subject: [PATCH 05/36] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/CustomerAgencyController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 6a8c433250..e9fb4e56ef 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -342,6 +342,7 @@ public class CustomerAgencyController { /** * @Description 获取客户下组织树不含网格和部门 + * 哪些地方用到了比如:办事指南-指南管理查询条件 * @Param tokenDTO * @Return {@link Result< AgencyTreeResultDTO >} * @Author zhaoqifeng From 6962566bcfc97e531c8053fccc777bf79b2cce18 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 18 Nov 2022 13:35:23 +0800 Subject: [PATCH 06/36] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/IcEventListFormDTO.java | 2 +- .../java/com/epmet/service/impl/IcEventServiceImpl.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java index c5330c05d8..b582675a11 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java @@ -1,7 +1,6 @@ package com.epmet.dto.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -28,6 +27,7 @@ public class IcEventListFormDTO implements Serializable { private String icEventId; /** * 所属组织 + * 前端传入,如果没传,默认查询登录用户所属组织及下级 */ private String agencyId; /** diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java index b37344a620..d40ff78a46 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -112,9 +112,11 @@ public class IcEventServiceImpl extends BaseServiceImpl list(IcEventListFormDTO formDTO) { - //获取当前工作人员缓存信息 - CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); - formDTO.setAgencyId(staffInfo.getAgencyId()); + if(StringUtils.isBlank(formDTO.getAgencyId())){ + //获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + formDTO.setAgencyId(staffInfo.getAgencyId()); + } //分页查询当前组织下网格内事件数据 PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); From 2031b00a2e34d3978be1158a322c5f8bd6c9bb8b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 18 Nov 2022 15:47:04 +0800 Subject: [PATCH 07/36] =?UTF-8?q?selectListResiMap=E5=B0=8F=E5=AF=A8?= =?UTF-8?q?=E5=AD=90=E5=86=99=E6=AD=BB=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/IcResiUserDao.xml | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 7c73dcb419..d0a425e4fe 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -182,6 +182,7 @@ + From cd9097dc5c60dd891441bc5d018803efe7e3e76e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 18 Nov 2022 16:02:29 +0800 Subject: [PATCH 08/36] IC_RESI_USER --- .../src/main/resources/mapper/IcResiUserDao.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index a9624783a8..ec51178649 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -216,12 +216,12 @@ ORDER BY - field( i.GRID_ID, '1537272060187049986', '1537272342477508609', '1537275342477501111', '1593432493598076929' ), - i.VILLAGE_ID ASC, - i.BUILD_ID ASC, - i.UNIT_ID ASC, - i.HOME_ID ASC, - i.ID ASC + field( IC_RESI_USER.GRID_ID, '1537272060187049986', '1537272342477508609', '1537275342477501111', '1593432493598076929' ), + IC_RESI_USER.VILLAGE_ID ASC, + IC_RESI_USER.BUILD_ID ASC, + IC_RESI_USER.UNIT_ID ASC, + IC_RESI_USER.HOME_ID ASC, + IC_RESI_USER.ID ASC ORDER BY From 43cace181653ebc9701fec868677dbbe3221e438 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Sun, 20 Nov 2022 22:56:54 +0800 Subject: [PATCH 09/36] =?UTF-8?q?=E6=8A=BD=E8=B1=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=A8=A1=E5=9D=97=EF=BC=8C=E5=B0=81=E8=A3=85?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dao/IcSyncJobDao.java | 6 +- .../com/epmet/entity/IcSyncJobEntity.java | 9 + .../AbstractDataSyncJobProcessor.java | 213 ++++++++++++++++++ .../processor/YanTaiNatSyncProcessor.java | 119 +++------- .../YanTaiResiComparisonSyncProcessor.java | 101 ++------- .../processor/YanTaiVaccineSyncProcessor.java | 107 +++------ .../main/resources/mapper/IcSyncJobDao.xml | 17 +- 7 files changed, 312 insertions(+), 260 deletions(-) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/processor/AbstractDataSyncJobProcessor.java diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSyncJobDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSyncJobDao.java index a8dfd6bee2..403ea9d1a8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSyncJobDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcSyncJobDao.java @@ -16,6 +16,8 @@ import java.util.List; @Mapper public interface IcSyncJobDao extends BaseDao { - List selectExecutableJobList(@Param("jobType") String jobType, - @Param("itemCount") int itemCount); + List selectJobListByStatus(@Param("status") String status, + @Param("jobType") String jobType, + @Param("processorIp") String processorIp, + @Param("itemCount") Integer itemCount); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSyncJobEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSyncJobEntity.java index 0a83b7aa56..e162ceeb4b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSyncJobEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcSyncJobEntity.java @@ -56,4 +56,13 @@ public class IcSyncJobEntity extends BaseEpmetEntity { */ private String operationStatus; + /** + * 处理实例的ip + * @author wxz + * @date 2022/11/19 下午11:02 + * * @param null + * + */ + private String processorIp; + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/AbstractDataSyncJobProcessor.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/AbstractDataSyncJobProcessor.java new file mode 100644 index 0000000000..950c397c2d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/AbstractDataSyncJobProcessor.java @@ -0,0 +1,213 @@ +package com.epmet.processor; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.constant.EpidemicConstant; +import com.epmet.dao.IcSyncJobDao; +import com.epmet.entity.IcSyncJobEntity; +import lombok.extern.slf4j.Slf4j; +import org.redisson.api.RLock; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; + +import javax.annotation.PostConstruct; +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.TimeUnit; + +/** + * @ClassName BaseSyncProcessor + * @Description 抽象数据同步处理器基类。所有基于该模式的同步器都应当继承该类。自定义Scheduler之后,调用基类的scanAndExeJobs()方法。 + * 实现需要实现的方法(定义分布式锁的key,定义同步数据的类型)。有特殊逻辑的可以重写相关方法 + * @Author wangxianzhang + * @Date 2022/11/19 下午11:16 + */ +@Slf4j +public abstract class AbstractDataSyncJobProcessor { + + @Autowired + private ExecutorService executorService; + + @Autowired + private IcSyncJobDao icSyncJobDao; + + @Autowired + private DistributedLock distributedLock; + + /** + * 最多能运行几条线程。如果有特殊情况,可以通过抽象方法每个子类单独定义 + */ + private int MAX_EXECUTING_NUMBER = 3; + + /** + * 本机ip + */ + private String localIp; + + { + try { + // 获取本机ip + InetAddress localHost = Inet4Address.getLocalHost(); + localIp = localHost.getHostAddress(); + log.info("【抽象定时数据同步器】获取本机ip为:{}", localIp); + } catch (UnknownHostException e) { + log.error("【抽象定时数据同步器】获取本机ip失败"); + } + + } + + /** + * 扫描并执行 + * @author wxz + * @date 2022/11/20 上午12:10 + * + * + */ + void scanAndExecWaitingJobs() { + + int executingTaskNumber = getExecutingTaskNumber(); + if (executingTaskNumber >= MAX_EXECUTING_NUMBER) { + // 单个实例下,最多只允许同时3条线程运行 + return; + } + + // 还可以运行几条线程 + int leftCount = MAX_EXECUTING_NUMBER - executingTaskNumber; + RLock lock = null; + try { + lock = distributedLock.getLock(getDistributeLockKey(), getDistributeLockLeaseTime(), getDistributeLockWaitTime(), TimeUnit.SECONDS); + // 查询可执行的任务列表,并且异步执行 + List icSyncJobToExec = icSyncJobDao.selectJobListByStatus("waiting", getJobType(), null, leftCount); + if (!CollectionUtils.isEmpty(icSyncJobToExec)) { + // 异步提交任务 + submitAsyncJob(icSyncJobToExec); + } + } catch (Exception e) { + log.error("【异步数据更新】出错:{}", ExceptionUtils.getErrorStackTrace(e)); + } finally { + if (lock != null) { + lock.unlock(); + } + } + } + + /** + * 扫描并且执行被中断的任务 + * @author wxz + * @date 2022/11/20 下午10:29 + * + * + */ + @PostConstruct + void scanAndContinueInteruptedJobs() { + // 此处不需要加锁,因为已经按照ip查询了,查到的一定是本机之前执行过的,其他机器查不到该条 + List interuptedJobs = icSyncJobDao.selectJobListByStatus("processing", getJobType(), localIp,null); + if (!CollectionUtils.isEmpty(interuptedJobs)) { + submitAsyncJob(interuptedJobs); + } + } + + /** + * 提交异步任务 + * @author wxz + * @date 2022/11/20 下午10:37 + * * @param icSyncJobToExec + * + */ + void submitAsyncJob(List icSyncJobToExec) { + for (IcSyncJobEntity jobEntity : icSyncJobToExec) { + // 将此任务状态修改为执行中 + updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_PROCESSING, localIp); + executorService.submit(() -> { + try { + execJobTask(jobEntity); + } finally { + // 更新任务状态为结束 + updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_FINISH, null); + } + }); + } + } + + /** + * 先检查一下,有几个任务需要执行 + * @author wxz + * @date 2022/11/19 下午10:57 + * @return int + */ + private int getExecutingTaskNumber() { + // 查询本机正在处理中的任务列表 + LambdaQueryWrapper executingListQuery = new LambdaQueryWrapper<>(); + executingListQuery.eq(IcSyncJobEntity::getOperationStatus, EpidemicConstant.OPERATION_STATUS_PROCESSING); + executingListQuery.eq(IcSyncJobEntity::getProcessorIp, localIp); + return icSyncJobDao.selectCount(executingListQuery); + } + + /** + * 更新任务状态 + * @author wxz + * @date 2022/11/8 下午8:25 + * @param id + * @param status + + */ + private void updateJobStatus(String id, String status, String processorIp) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcSyncJobEntity::getId, id); + + IcSyncJobEntity updateEntity = new IcSyncJobEntity(); + updateEntity.setOperationStatus(status); + updateEntity.setProcessorIp(processorIp); + icSyncJobDao.update(updateEntity, query); + } + + /** + * 执行任务 + * @author wxz + * @date 2022/11/20 上午12:06 + * + * + */ + protected abstract void execJobTask(IcSyncJobEntity jobEntity); + + /** + * 获取分布式锁的key + * @author wxz + * @date 2022/11/20 上午12:21 + * + * + */ + protected abstract String getDistributeLockKey(); + + /** + * 任务类型 + * @author wxz + * @date 2022/11/20 上午12:25 + * + * * @return String + */ + protected abstract String getJobType(); + + /** + * 分布式锁的续期时间 + * @author wxz + * @date 2022/11/20 下午10:52 + * + * * @return long + */ + protected abstract long getDistributeLockLeaseTime(); + + /** + * 分布式锁的等待时间 + * @author wxz + * @date 2022/11/20 下午10:52 + * + * * @return long + */ + protected abstract long getDistributeLockWaitTime(); + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiNatSyncProcessor.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiNatSyncProcessor.java index 1fbfb6a69f..97c0dec750 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiNatSyncProcessor.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiNatSyncProcessor.java @@ -1,49 +1,27 @@ package com.epmet.processor; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.epmet.commons.tools.distributedlock.DistributedLock; -import com.epmet.commons.tools.exception.ExceptionUtils; -import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.constant.EpidemicConstant; -import com.epmet.dao.IcSyncJobDao; import com.epmet.entity.IcSyncJobEntity; import com.epmet.service.DataSyncConfigService; import lombok.extern.slf4j.Slf4j; -import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; - -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.TimeUnit; import static com.epmet.constant.EpidemicConstant.JOB_TYPE_NAT; -// 烟台核酸检测数据同步处理器 +/** + * @Description 烟台核酸检测数据同步处理器 + * @Author wxz + * @Date 2022/11/20 上午11:43 + */ @Component @Slf4j -public class YanTaiNatSyncProcessor { - - public static final int MAX_EXECUTING_COUNT = 3; - - @Autowired - private ExecutorService executorService; - - @Autowired - private IcSyncJobDao icSyncJobDao; +public class YanTaiNatSyncProcessor extends AbstractDataSyncJobProcessor { @Autowired private DataSyncConfigService dataSyncConfigService; - @Autowired - private DistributedLock distributedLock; - - @Autowired - RedisUtils redisUtils; - /** * 定时扫描和执行同步任务 * 10s扫一次库 @@ -53,76 +31,31 @@ public class YanTaiNatSyncProcessor { */ @Scheduled(cron = "0/10 * * * * ? ") public void scanJobs() { - //log.info("【异步数据更新】开始同步任务"); - - //String dataSyncEnable = redisUtils.getString("data:sync:enable"); - //if (StringUtils.isEmpty(dataSyncEnable)) { - // return; - //} - - LambdaQueryWrapper executingListQuery = new LambdaQueryWrapper<>(); - executingListQuery.eq(IcSyncJobEntity::getOperationStatus, EpidemicConstant.OPERATION_STATUS_PROCESSING); - List executingJobList = icSyncJobDao.selectList(executingListQuery); - - if (!CollectionUtils.isEmpty(executingJobList) && executingJobList.size() >= MAX_EXECUTING_COUNT) { - // 最多只允许同时3条线程运行 - return; - } - - int executingCount = executingJobList.size(); - // 还可以运行几条线程 - int leftCount = MAX_EXECUTING_COUNT - executingCount; - - RLock lock = null; - try { - lock = distributedLock.getLock("data:sync:" + JOB_TYPE_NAT, 60L, 60L, TimeUnit.SECONDS); - // 查询可执行的任务列表,并且异步执行 - List icSyncJobToExec = icSyncJobDao.selectExecutableJobList( - EpidemicConstant.JOB_TYPE_NAT, - leftCount); - - if (!CollectionUtils.isEmpty(icSyncJobToExec)) { - // 异步提交任务 - for (IcSyncJobEntity jobEntity : icSyncJobToExec) { - - updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_PROCESSING); - executorService.submit(() -> { - // 将此任务状态修改为执行中 - - try { - dataSyncConfigService.execSyncByJobProcessor(jobEntity); - } finally { - // 更新任务状态为结束 - updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_FINISH); - } + scanAndExecWaitingJobs(); + } - }); - } - } - } catch (Exception e) { - log.error("【异步数据更新】出错:{}", ExceptionUtils.getErrorStackTrace(e)); - } finally { - if (lock != null) { - lock.unlock(); - } - } + @Override + protected void execJobTask(IcSyncJobEntity jobEntity) { + dataSyncConfigService.execSyncByJobProcessor(jobEntity); } - /** - * 更新任务状态 - * @author wxz - * @date 2022/11/8 下午8:25 - * @param id - * @param status + @Override + protected String getDistributeLockKey() { + return "data:sync:" + JOB_TYPE_NAT; + } - */ - private void updateJobStatus(String id, String status) { - LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(IcSyncJobEntity::getId, id); + @Override + protected String getJobType() { + return EpidemicConstant.JOB_TYPE_NAT; + } - IcSyncJobEntity updateEntity = new IcSyncJobEntity(); - updateEntity.setOperationStatus(status); - icSyncJobDao.update(updateEntity, query); + @Override + protected long getDistributeLockLeaseTime() { + return 60; } + @Override + protected long getDistributeLockWaitTime() { + return 60; + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiResiComparisonSyncProcessor.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiResiComparisonSyncProcessor.java index 8e57474606..cbf0810580 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiResiComparisonSyncProcessor.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiResiComparisonSyncProcessor.java @@ -1,23 +1,13 @@ package com.epmet.processor; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.epmet.commons.tools.distributedlock.DistributedLock; -import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.constant.EpidemicConstant; -import com.epmet.dao.IcSyncJobDao; import com.epmet.entity.IcSyncJobEntity; import com.epmet.service.IcResiComparisonRecordService; import lombok.extern.slf4j.Slf4j; -import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; - -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.TimeUnit; /** * @Description 居民一致性对比任务处理器 @@ -26,22 +16,11 @@ import java.util.concurrent.TimeUnit; */ @Component @Slf4j -public class YanTaiResiComparisonSyncProcessor { - - public static final int MAX_EXECUTING_COUNT = 3; - - @Autowired - private ExecutorService executorService; - - @Autowired - private IcSyncJobDao icSyncJobDao; +public class YanTaiResiComparisonSyncProcessor extends AbstractDataSyncJobProcessor { @Autowired private IcResiComparisonRecordService icResiComparisonRecordService; - @Autowired - private DistributedLock distributedLock; - @Autowired RedisUtils redisUtils; @@ -51,69 +30,31 @@ public class YanTaiResiComparisonSyncProcessor { */ @Scheduled(cron = "0/10 * * * * ? ") public void scanJobs() { - //log.info("【异步数据更新】开始同步任务"); - - LambdaQueryWrapper executingListQuery = new LambdaQueryWrapper<>(); - executingListQuery.eq(IcSyncJobEntity::getOperationStatus, EpidemicConstant.OPERATION_STATUS_PROCESSING); - List executingJobList = icSyncJobDao.selectList(executingListQuery); - - if (!CollectionUtils.isEmpty(executingJobList) && executingJobList.size() >= MAX_EXECUTING_COUNT) { - // 最多只允许同时3条线程运行 - return; - } - - int executingCount = executingJobList.size(); - // 还可以运行几条线程 - int leftCount = MAX_EXECUTING_COUNT - executingCount; - - RLock lock = null; - try { - lock = distributedLock.getLock("data:sync:comparison:resi", 60L, 60L, TimeUnit.SECONDS); - // 查询可执行的任务列表,并且异步执行 - List icSyncJobToExec = icSyncJobDao.selectExecutableJobList( - EpidemicConstant.JOB_TYPE_COMPARISON_RESI, - leftCount); - - if (!CollectionUtils.isEmpty(icSyncJobToExec)) { - // 异步提交任务 - for (IcSyncJobEntity jobEntity : icSyncJobToExec) { - - updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_PROCESSING); - executorService.submit(() -> { - // 将此任务状态修改为执行中 - - try { - icResiComparisonRecordService.comparisonUserData(jobEntity); - } finally { - // 更新任务状态为结束 - updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_FINISH); - } + scanAndExecWaitingJobs(); + } - }); - } - } - } catch (Exception e) { - log.error("【异步数据更新】出错:{}", ExceptionUtils.getErrorStackTrace(e)); - } finally { - if (lock != null) { - lock.unlock(); - } - } + @Override + protected void execJobTask(IcSyncJobEntity jobEntity) { + icResiComparisonRecordService.comparisonUserData(jobEntity); } - /** - * 更新任务状态 - * @param id - * @param status + @Override + protected String getDistributeLockKey() { + return "data:sync:comparison:resi"; + } - */ - private void updateJobStatus(String id, String status) { - LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(IcSyncJobEntity::getId, id); + @Override + protected String getJobType() { + return EpidemicConstant.JOB_TYPE_COMPARISON_RESI; + } - IcSyncJobEntity updateEntity = new IcSyncJobEntity(); - updateEntity.setOperationStatus(status); - icSyncJobDao.update(updateEntity, query); + @Override + protected long getDistributeLockLeaseTime() { + return 60; } + @Override + protected long getDistributeLockWaitTime() { + return 60; + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiVaccineSyncProcessor.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiVaccineSyncProcessor.java index e53a279a46..a8427d8c8e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiVaccineSyncProcessor.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/processor/YanTaiVaccineSyncProcessor.java @@ -1,49 +1,27 @@ package com.epmet.processor; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.epmet.commons.tools.distributedlock.DistributedLock; -import com.epmet.commons.tools.exception.ExceptionUtils; -import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.constant.EpidemicConstant; -import com.epmet.dao.IcSyncJobDao; import com.epmet.entity.IcSyncJobEntity; import com.epmet.service.DataSyncConfigService; import lombok.extern.slf4j.Slf4j; -import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.TimeUnit; - -import static com.epmet.constant.EpidemicConstant.JOB_TYPE_NAT; import static com.epmet.constant.EpidemicConstant.JOB_TYPE_VACCINE; -// 烟台核酸检测数据同步处理器 +/** + * @Description 烟台核酸检测数据同步处理器 + * @Author wxz + * @Date 2022/11/20 上午11:55 + */ @Component @Slf4j -public class YanTaiVaccineSyncProcessor { - - public static final int MAX_EXECUTING_COUNT = 3; - - @Autowired - private ExecutorService executorService; - - @Autowired - private IcSyncJobDao icSyncJobDao; +public class YanTaiVaccineSyncProcessor extends AbstractDataSyncJobProcessor { @Autowired private DataSyncConfigService dataSyncConfigService; - @Autowired - private DistributedLock distributedLock; - - @Autowired - RedisUtils redisUtils; - /** * @Description 定时扫描和执行同步任务【疫苗接种】 * @Author zxc @@ -51,62 +29,31 @@ public class YanTaiVaccineSyncProcessor { */ @Scheduled(cron = "0/10 * * * * ? ") public void scanJobs() { - LambdaQueryWrapper executingListQuery = new LambdaQueryWrapper<>(); - executingListQuery.eq(IcSyncJobEntity::getOperationStatus, EpidemicConstant.OPERATION_STATUS_PROCESSING); - List executingJobList = icSyncJobDao.selectList(executingListQuery); - if (!CollectionUtils.isEmpty(executingJobList) && executingJobList.size() >= MAX_EXECUTING_COUNT) { - // 最多只允许同时3条线程运行 - return; - } - int executingCount = executingJobList.size(); - // 还可以运行几条线程 - int leftCount = MAX_EXECUTING_COUNT - executingCount; - RLock lock = null; - try { - lock = distributedLock.getLock("data:sync:" + JOB_TYPE_VACCINE, 60L, 60L, TimeUnit.SECONDS); - // 查询可执行的任务列表,并且异步执行 - List icSyncJobToExec = icSyncJobDao.selectExecutableJobList( - EpidemicConstant.JOB_TYPE_VACCINE, - leftCount); - if (!CollectionUtils.isEmpty(icSyncJobToExec)) { - // 异步提交任务 - for (IcSyncJobEntity jobEntity : icSyncJobToExec) { - updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_PROCESSING); - executorService.submit(() -> { - // 将此任务状态修改为执行中 - try { - dataSyncConfigService.execSyncByJobProcessor(jobEntity); - } finally { - // 更新任务状态为结束 - updateJobStatus(jobEntity.getId(), EpidemicConstant.OPERATION_STATUS_FINISH); - } - }); - } - } - } catch (Exception e) { - log.error("【异步数据更新】出错:{}", ExceptionUtils.getErrorStackTrace(e)); - } finally { - if (lock != null) { - lock.unlock(); - } - } + scanAndExecWaitingJobs(); } - /** - * 更新任务状态 - * @author wxz - * @date 2022/11/8 下午8:25 - * @param id - * @param status + @Override + protected void execJobTask(IcSyncJobEntity jobEntity) { + dataSyncConfigService.execSyncByJobProcessor(jobEntity); + } - */ - private void updateJobStatus(String id, String status) { - LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(IcSyncJobEntity::getId, id); + @Override + protected String getDistributeLockKey() { + return "data:sync:" + JOB_TYPE_VACCINE; + } + + @Override + protected String getJobType() { + return EpidemicConstant.JOB_TYPE_VACCINE; + } - IcSyncJobEntity updateEntity = new IcSyncJobEntity(); - updateEntity.setOperationStatus(status); - icSyncJobDao.update(updateEntity, query); + @Override + protected long getDistributeLockLeaseTime() { + return 60; } + @Override + protected long getDistributeLockWaitTime() { + return 60; + } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcSyncJobDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcSyncJobDao.xml index 6ed0708d43..4b266d56c2 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcSyncJobDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcSyncJobDao.xml @@ -3,8 +3,8 @@ - - select id, customer_id, org_id, @@ -13,6 +13,7 @@ job_type, operator_id, operation_status, + processor_ip, del_flag, revision, created_by, @@ -20,10 +21,16 @@ updated_by, updated_time from ic_sync_job - where OPERATION_STATUS = 'waiting' + where + DEL_FLAG = 0 + and OPERATION_STATUS = #{status} and JOB_TYPE = #{jobType} - and DEL_FLAG = 0 + + and PROCESSOR_IP = #{processorIp} + order by CREATED_TIME asc - limit #{itemCount} + + limit #{itemCount} + \ No newline at end of file From ef4e64c8e3abdc41dd41f55ffffa18d510b9d4f3 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 21 Nov 2022 09:37:49 +0800 Subject: [PATCH 10/36] =?UTF-8?q?=E8=A1=A5=E5=85=85sync=5Fjob=E8=A1=A8?= =?UTF-8?q?=E7=9A=84flyway=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V0.0.89__data_sync_job_create.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.89__data_sync_job_create.sql diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.89__data_sync_job_create.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.89__data_sync_job_create.sql new file mode 100644 index 0000000000..e7ff4e1179 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.89__data_sync_job_create.sql @@ -0,0 +1,19 @@ +CREATE TABLE `ic_sync_job` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织ID', + `PID` varchar(255) NOT NULL COMMENT '组织ID的上级', + `ORG_ID_PATH` varchar(1024) NOT NULL COMMENT '组织ID的所有上级,包括org_id', + `JOB_TYPE` varchar(255) NOT NULL COMMENT '任务类型,残疾:disability;死亡:death;核酸:nat;', + `OPERATOR_ID` varchar(255) NOT NULL COMMENT '操作员ID【staffId】', + `OPERATION_STATUS` varchar(255) DEFAULT NULL COMMENT '操作状态,等待中:waiting;进行中:processing;结束:finish', + `PROCESSOR_IP` varchar(15) DEFAULT NULL COMMENT '处理器实例ip', + `DEL_FLAG` int(11) NOT NULL, + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`), + KEY `ORG_ID` (`ORG_ID`,`OPERATION_STATUS`,`JOB_TYPE`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='同步任务表' \ No newline at end of file From cfb4535ae6dac7f518ccf3b117283907eb5ab8c1 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 21 Nov 2022 10:06:36 +0800 Subject: [PATCH 11/36] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=B1=85=E6=B0=91=E6=94=AF=E6=8C=81=E6=A8=A1?= =?UTF-8?q?=E7=B3=8A=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcResiUserDao.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index d0a425e4fe..cb23078577 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -201,9 +201,9 @@ AND ( - NAME = #{keyword} - or MOBILE = #{keyword} - or ID_CARD = #{keyword} + NAME like concat('%', #{keyword},'%') + or MOBILE like concat('%', #{keyword},'%') + or ID_CARD like concat('%', #{keyword},'%') ) From 263d01ce52ffa6dc7284a2c58e4426c3b35cd7cf Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 21 Nov 2022 16:52:04 +0800 Subject: [PATCH 12/36] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E4=BF=A1=E6=81=AF-?= =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E5=88=97=E8=A1=A8=E6=8E=92=E5=BA=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=BA=E5=85=88=E6=8C=89=E7=85=A7=E7=BD=91=E6=A0=BC?= =?UTF-8?q?id=E5=8D=87=E5=BA=8F=EF=BC=8C=E6=9D=A5=E6=BA=90=E4=BA=8E?= =?UTF-8?q?=E5=B0=8F=E5=AF=A8=E5=AD=90=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcNeighborHoodDao.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index 0120d31bb0..326940bdd9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -160,7 +160,8 @@ AND a.DEL_FLAG = '0' - ORDER BY CAST(a.NEIGHBOR_HOOD_NAME AS SIGNED),CONVERT(a.NEIGHBOR_HOOD_NAME using gbk) + ORDER BY a.GRID_ID asc, + CAST(a.NEIGHBOR_HOOD_NAME AS SIGNED),CONVERT(a.NEIGHBOR_HOOD_NAME using gbk) + SELECT user_id AS "userId", - `password` AS "passWord" + `password` AS "passWord", + ENABLE_FLAG as enableFlag FROM `customer_staff` WHERE From 3945eb56a0e1d1ae56dfb74481822b7894caf268 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 23 Nov 2022 14:15:17 +0800 Subject: [PATCH 23/36] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF=E5=A4=B1=E8=B4=A5,?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7[13146409824],=E5=AE=A2=E6=88=B7id:[?= =?UTF-8?q?45687aa479955f9d06204d415238f7cc],code[8005],msg[=E6=82=A8?= =?UTF-8?q?=E5=A5=BD=EF=BC=8C=E6=82=A8=E7=9A=84=E8=B4=A6=E6=88=B7=E5=B7=B2?= =?UTF-8?q?=E8=A2=AB=E5=86=BB=E7=BB=93=EF=BC=8C=E8=AF=B7=E8=81=94=E7=B3=BB?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E3=80=82]=20warn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/SsoServiceImpl.java | 2 +- .../java/com/epmet/service/impl/ThirdLoginServiceImpl.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java index 29283f6b01..1d8cbf8b4f 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java @@ -478,7 +478,7 @@ public class SsoServiceImpl implements SsoService { customerStaffFormDTO.setMobile(formDTO.getMobile()); Result customerStaffDTOResult = epmetUserOpenFeignClient.getCustomerStaffInfo(customerStaffFormDTO); if (!customerStaffDTOResult.success() || null == customerStaffDTOResult.getData()) { - logger.error(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); + logger.warn(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); throw new RenException(customerStaffDTOResult.getCode()); } CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 3d2c2ebee0..585835f705 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -12,7 +12,6 @@ import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; -import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; @@ -20,7 +19,6 @@ import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.redis.common.CustomerDingDingRedis; -import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; @@ -403,7 +401,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol customerStaffFormDTO.setMobile(formDTO.getMobile()); Result customerStaffDTOResult = epmetUserOpenFeignClient.getCustomerStaffInfo(customerStaffFormDTO); if (!customerStaffDTOResult.success() || null == customerStaffDTOResult.getData()) { - logger.error(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); + logger.warn(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); throw new RenException(customerStaffDTOResult.getCode()); } CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); From d720e1254978f4e914a40c161e0314963eb9514d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 23 Nov 2022 14:27:06 +0800 Subject: [PATCH 24/36] =?UTF-8?q?=E8=A7=A3=E7=A6=81=EF=BC=9A/epmetuser/cus?= =?UTF-8?q?tomerstaff/enablestaff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java | 5 ++++- .../java/com/epmet/controller/CustomerStaffController.java | 1 + .../com/epmet/service/impl/CustomerStaffServiceImpl.java | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java index e2212b7608..52cda8c2a0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java @@ -18,5 +18,8 @@ public class EnableStaffFormDTO implements Serializable { * 被解禁用户Id */ private String staffId; - + /** + * token中获取 + */ + private String customerId; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 8bea2e4fbf..d037d1cd95 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -566,6 +566,7 @@ public class CustomerStaffController { @PostMapping("enablestaff") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_ENABLE) public Result enableStaff(@LoginUser TokenDto tokenDto, @RequestBody EnableStaffFormDTO fromDTO){ + fromDTO.setCustomerId(tokenDto.getCustomerId()); if (tokenDto.getUserId().equals(fromDTO.getStaffId())) { throw new RenException("工作人员自己不能解禁自己"); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 0bcb0b5eee..1ff4560c99 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -1055,6 +1055,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl Date: Wed, 23 Nov 2022 14:53:29 +0800 Subject: [PATCH 25/36] =?UTF-8?q?=E6=88=90=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=B0=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=87=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/IcResiUserServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 3e341bf86b..fb249f1184 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -2196,7 +2196,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl icResiUserAttachmentService.save(item)); // 如果是已经存在的居民,并且是租客状态,需要更新原本的状态 if (NumConstant.ONE_STR.equals(formDTO.getType())) { - IcResiUserEntity entity = new IcResiUserEntity(); +// IcResiUserEntity entity = new IcResiUserEntity(); + IcResiUserEntity entity = ConvertUtils.sourceToTarget(formDTO.getUser(), IcResiUserEntity.class); entity.setId(resiUserId); entity.setIsTenant(NumConstant.ONE_STR); entity.setIsFloating(NumConstant.ONE_STR); From 1d79ab764d9ddaa4693d665ae639113012072dcf Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 23 Nov 2022 15:18:43 +0800 Subject: [PATCH 26/36] =?UTF-8?q?=E8=A7=A3=E7=A6=81=E6=94=BE=E5=BC=80?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/CustomerStaffController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index d037d1cd95..6d01efdd7b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -564,7 +564,7 @@ public class CustomerStaffController { * @author sun */ @PostMapping("enablestaff") - @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_ENABLE) + // @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_ENABLE) public Result enableStaff(@LoginUser TokenDto tokenDto, @RequestBody EnableStaffFormDTO fromDTO){ fromDTO.setCustomerId(tokenDto.getCustomerId()); if (tokenDto.getUserId().equals(fromDTO.getStaffId())) { From 9b05acb74b4f38cd974b20099385dd970fe24daa Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 23 Nov 2022 15:20:15 +0800 Subject: [PATCH 27/36] =?UTF-8?q?=E8=A7=A3=E7=A6=81=E6=94=BE=E5=BC=80?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/CustomerStaffController.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 6d01efdd7b..45e9b098e7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -19,8 +19,6 @@ package com.epmet.controller; import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.annotation.RequirePermission; -import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; From 949f1d34587489a0da05329aa7512f8634ea8cc3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 23 Nov 2022 15:47:00 +0800 Subject: [PATCH 28/36] =?UTF-8?q?=E6=9C=AA=E7=A6=81=E7=94=A8enable,?= =?UTF-8?q?=E5=B7=B2=E7=A6=81=E7=94=A8disabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/GovWebServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index e83b6e78e7..c03bf7c629 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -84,7 +84,8 @@ public class GovWebServiceImpl implements GovWebService, ResultDataResolver { logger.warn("根据手机号查询PC工作端登陆人员信息失败,返回10003账号不存在"); throw new RenException(EpmetErrorCode.ERR10003.getCode()); } - if ("diabled".equals(result.getData().getEnableFlag())) { + //未禁用enable,已禁用disabled + if ("disabled".equals(result.getData().getEnableFlag())) { throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), String.format("当前账号已被禁用staffId:%s", result.getData().getUserId()), EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); From 692274c6b2313ddf32411191347b284cae71580d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 23 Nov 2022 16:16:03 +0800 Subject: [PATCH 29/36] =?UTF-8?q?8005:=E6=82=A8=E5=A5=BD=EF=BC=8C=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=88=B0=E6=9C=9F=EF=BC=8C=E8=B4=A6=E6=88=B7=E6=9A=82?= =?UTF-8?q?=E6=97=B6=E5=86=BB=E7=BB=93=EF=BC=8C=E8=AF=B7=E8=81=94=E7=B3=BB?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/exception/EpmetErrorCode.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 0463d290a2..499d4131b8 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -32,7 +32,8 @@ public enum EpmetErrorCode { CANNOT_CREATE_GROUP(8002, "只有党员和热心居民才能创建小组,请选择您的身份"), GROUP_ALREADY_EXISTED(8003,"组名已存在"), GOV_STAFF_NOT_EXISTS(8004,"手机号未注册,请联系贵单位管理员,确认其录入手机与您所持手机号相同"), - GOV_STAFF_DISABLED(8005,"您好,您的账户已被冻结,请联系管理员。"), + //您好,您的账户已被冻结,请联系管理员。=>您好,服务到期,账户暂时冻结,请联系管理员。 + GOV_STAFF_DISABLED(8005,"您好,服务到期,账户暂时冻结,请联系管理员。"), LOSE_EFFICACY(8006,"此邀请链接已过期"), ERROR_PHONE(8007,"请输入正确的手机号"), PLEASE_LOGIN(8008,"请重新登录"), From 936bab159692a9f83cc189d7d91824a4bb14d430 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Nov 2022 09:25:30 +0800 Subject: [PATCH 30/36] /auth/thirdlogin/worklogin+/getmyorg --- .../service/impl/ThirdLoginServiceImpl.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 585835f705..09ef64f67b 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.auth.constants.AuthOperationConstants; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.enums.EnvEnum; @@ -192,6 +193,19 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol throw new RenException(EpmetErrorCode.PLEASE_LOGIN.getCode()); } StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = latestStaffWechat.getData(); + //2022.11.24校验下用户是否被禁用 + //2.1根据手机号查询到用户信息 + ThirdCustomerStaffFormDTO dto = new ThirdCustomerStaffFormDTO(); + dto.setCustomerId(staffLatestAgencyResultDTO.getCustomerId()); + dto.setMobile(staffLatestAgencyResultDTO.getMobile()); + Result> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndPhone(dto); + if (!customerStaffResult.success()) { + logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]", staffLatestAgencyResultDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); + throw new RenException(customerStaffResult.getCode()); + } + if("disabled".equals(customerStaffResult.getData().get(NumConstant.ZERO).getEnableFlag())){ + throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } //3.记录staff_wechat this.savestaffwechat(staffLatestAgencyResultDTO.getStaffId(), userWechatDTO.getWxOpenId(), staffLatestAgencyResultDTO.getCustomerId()); @@ -538,7 +552,9 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]", formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); throw new RenException(customerStaffResult.getCode()); } - + if("disabled".equals(customerStaffResult.getData().get(NumConstant.ZERO).getEnableFlag())){ + throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } //3、查询用户所有的组织信息 List customerIdList = new ArrayList<>(); for (CustomerStaffDTO customerStaffDTO : customerStaffResult.getData()) { From 48c03d8e0eb0f496d240e4bf180ba5a5e7c632bc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Nov 2022 09:52:28 +0800 Subject: [PATCH 31/36] /gov/mine/agency/getlatestcustomer --- .../service/impl/CustomerStaffAgencyServiceImpl.java | 8 ++++++++ .../src/main/java/com/epmet/dto/CustomerStaffDTO.java | 1 + 2 files changed, 9 insertions(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index 7ddbadf0f9..c37f13d8ef 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -22,6 +22,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -140,6 +142,12 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl staffInfo = epmetUserFeignClient.getCustomerStaffInfoByUserId(customerStaffParam); + if(!staffInfo.success()||null==staffInfo.getData()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"userId:"+userId+"customer_staff is null","获取用户信息异常"); + } + if("disabled".equals(staffInfo.getData().getEnableFlag())){ + throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } resultDTO.setStaffHeadPhoto(staffInfo.getData().getHeadPhoto()); resultDTO.setGender(staffInfo.getData().getGender()); //获取客户名称 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java index 9f697c584e..cd042877ab 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java @@ -126,6 +126,7 @@ public class CustomerStaffDTO implements Serializable { /** * 未禁用enable,已禁用diabled + * disabled */ private String enableFlag; From aedd993f3105b15fc2ee24d19d9313ebf62dd2ae Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Nov 2022 09:56:20 +0800 Subject: [PATCH 32/36] =?UTF-8?q?thirdlogin/worklogin=E5=85=88=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/ThirdLoginServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 09ef64f67b..78ec8124d8 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -194,8 +194,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol } StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = latestStaffWechat.getData(); //2022.11.24校验下用户是否被禁用 - //2.1根据手机号查询到用户信息 - ThirdCustomerStaffFormDTO dto = new ThirdCustomerStaffFormDTO(); + //2.1根据手机号查询到用户信息 前端不跳转,暂时先注释吧 + /* ThirdCustomerStaffFormDTO dto = new ThirdCustomerStaffFormDTO(); dto.setCustomerId(staffLatestAgencyResultDTO.getCustomerId()); dto.setMobile(staffLatestAgencyResultDTO.getMobile()); Result> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndPhone(dto); @@ -205,7 +205,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol } if("disabled".equals(customerStaffResult.getData().get(NumConstant.ZERO).getEnableFlag())){ throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); - } + }*/ //3.记录staff_wechat this.savestaffwechat(staffLatestAgencyResultDTO.getStaffId(), userWechatDTO.getWxOpenId(), staffLatestAgencyResultDTO.getCustomerId()); From 5f0847e119a93575fe0c38420fd09157934e7b7c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Nov 2022 10:05:35 +0800 Subject: [PATCH 33/36] =?UTF-8?q?/agency/getlatestcustomer=EF=BC=8C10006?= =?UTF-8?q?=EF=BC=8C=E7=A6=81=E7=94=A8=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index c37f13d8ef..42028ec907 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -146,7 +146,7 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl Date: Thu, 24 Nov 2022 10:15:36 +0800 Subject: [PATCH 34/36] =?UTF-8?q?/thirdlogin/getmyorgbypassword=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E5=AF=86=E7=A0=81=E7=99=BB=E5=BD=95=EF=BC=8C=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/ThirdLoginServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 78ec8124d8..cef85d6713 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -587,12 +587,16 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol dto.setCustomerId(customer.getId()); dto.setMobile(formDTO.getMobile()); Result> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndPhone(dto); - if (!customerStaffResult.success()) { + if (!customerStaffResult.success()||CollectionUtils.isEmpty(customerStaffResult.getData())) { logger.warn(String.format("手机密码登录异常,手机号[%s],code[%s],msg[%s]", formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); throw new RenException(customerStaffResult.getCode()); } //2、密码是否正确 List customerStaffList=customerStaffResult.getData(); + // 禁用的给予提示 + if("disabled".equals(customerStaffList.get(NumConstant.ZERO).getEnableFlag())){ + throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } //3、查询用户所有的组织信息 List customerIdList = new ArrayList<>(); //是否设置过密码 From 8964058eecad6fcbc908a9bbc8416720e7207d2e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Nov 2022 10:24:38 +0800 Subject: [PATCH 35/36] =?UTF-8?q?/gov/mine/agency/getlatestcustomer?= =?UTF-8?q?=E8=BF=94=E5=9B=9E8005?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index 42028ec907..c37f13d8ef 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -146,7 +146,7 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl Date: Thu, 24 Nov 2022 10:44:06 +0800 Subject: [PATCH 36/36] =?UTF-8?q?thirdlogin/worklogin=EF=BC=8C=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E8=BF=94=E5=9B=9E8008=EF=BC=8C=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=A5=BD=E8=B7=B3=E8=BD=AC=E5=88=B0=E7=99=BB=E5=BD=95=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/ThirdLoginServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index cef85d6713..07f60c2ecd 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -195,7 +195,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = latestStaffWechat.getData(); //2022.11.24校验下用户是否被禁用 //2.1根据手机号查询到用户信息 前端不跳转,暂时先注释吧 - /* ThirdCustomerStaffFormDTO dto = new ThirdCustomerStaffFormDTO(); + ThirdCustomerStaffFormDTO dto = new ThirdCustomerStaffFormDTO(); dto.setCustomerId(staffLatestAgencyResultDTO.getCustomerId()); dto.setMobile(staffLatestAgencyResultDTO.getMobile()); Result> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndPhone(dto); @@ -203,9 +203,10 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]", staffLatestAgencyResultDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); throw new RenException(customerStaffResult.getCode()); } + // 8008 前端会提示:登录失效,请重新登录 跳转到登录界面。所以这里写死返回8008. if("disabled".equals(customerStaffResult.getData().get(NumConstant.ZERO).getEnableFlag())){ - throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); - }*/ + throw new EpmetException(EpmetErrorCode.PLEASE_LOGIN.getCode(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg(),EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } //3.记录staff_wechat this.savestaffwechat(staffLatestAgencyResultDTO.getStaffId(), userWechatDTO.getWxOpenId(), staffLatestAgencyResultDTO.getCustomerId());