From c3ece5270fe7c42cd0f187b8067beb92227d1606 Mon Sep 17 00:00:00 2001 From: Wayne Date: Wed, 8 May 2024 09:58:51 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=81=E4=B8=9A=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=A1=AB=E6=8A=A5=E4=B8=AD=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=B6=89=E5=8F=8A=E5=8D=B1=E5=8C=96=E8=AF=81?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=202=E3=80=81=E4=BC=81=E4=B8=9A=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E4=BF=A1=E6=81=AF=E4=B8=AD=E6=96=B0=E5=A2=9E=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E7=9B=91=E5=90=AC=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/EnterpriseInformationPageReqVO.java | 3 ++ .../vo/EnterpriseInformationRespVO.java | 9 ++++++ .../vo/EnterpriseInformationSaveReqVO.java | 4 +++ .../EnterpriseInformationDO.java | 6 ++++ .../EnterpriseInformationMapper.java | 3 +- .../EnterpriseInformationService.java | 9 +++++- .../EnterpriseInformationServiceImpl.java | 13 ++++++++ ...taEnterpriseInformationStatusListener.java | 31 +++++++++++++++++++ 8 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/oa/listener/FtaEnterpriseInformationStatusListener.java diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationPageReqVO.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationPageReqVO.java index 244f37c..6c18452 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationPageReqVO.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationPageReqVO.java @@ -34,6 +34,9 @@ public class EnterpriseInformationPageReqVO extends PageParam { @Schema(description = "经营状态") private Integer operateState; + @Schema(description = "是否涉及危化证") + private Integer isSecure; + @Schema(description = "成立日期") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDate[] establishDate; diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationRespVO.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationRespVO.java index 8fc10e0..685bd0c 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationRespVO.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationRespVO.java @@ -58,6 +58,11 @@ public class EnterpriseInformationRespVO { @DictFormat("enterprise_operate_state") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 private Integer operateState; + @Schema(description = "是否涉及危化证", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty(value = "是否涉及危化证", converter = DictConvert.class) + @DictFormat("enterprise_is_secure") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer isSecure; + @Schema(description = "成立日期", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("成立日期") private LocalDate establishDate; @@ -71,6 +76,10 @@ public class EnterpriseInformationRespVO { @ExcelProperty("企业所属行业") private String enterpriseBelongingToIndustry; + @Schema(description = "企业所属地区", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("企业所属地区") + private String enterpriseBelongingToRegion; + @Schema(description = "登记机关", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("登记机关") private String registerOffice; diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationSaveReqVO.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationSaveReqVO.java index 5f10a8a..7d94248 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationSaveReqVO.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/controller/admin/enterpriseinformation/vo/EnterpriseInformationSaveReqVO.java @@ -46,6 +46,10 @@ public class EnterpriseInformationSaveReqVO { @NotNull(message = "经营状态不能为空") private Integer operateState; + @Schema(description = "是否涉及危化证", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否涉及危化证不能为空") + private Integer isSecure; + @Schema(description = "成立日期", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "成立日期不能为空") private LocalDate establishDate; diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/dal/dataobject/enterpriseinformation/EnterpriseInformationDO.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/dal/dataobject/enterpriseinformation/EnterpriseInformationDO.java index d2178ad..1278ecb 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/dal/dataobject/enterpriseinformation/EnterpriseInformationDO.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/dal/dataobject/enterpriseinformation/EnterpriseInformationDO.java @@ -64,6 +64,12 @@ public class EnterpriseInformationDO extends BaseDO { * 枚举 */ private Integer operateState; + /** + * 是否涉及危化证 + * + * 枚举 + */ + private Integer isSecure; /** * 成立日期 */ diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/dal/mysql/enterpriseinformation/EnterpriseInformationMapper.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/dal/mysql/enterpriseinformation/EnterpriseInformationMapper.java index ef16de1..23b43f3 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/dal/mysql/enterpriseinformation/EnterpriseInformationMapper.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/dal/mysql/enterpriseinformation/EnterpriseInformationMapper.java @@ -24,6 +24,7 @@ public interface EnterpriseInformationMapper extends BaseMapperX getEnterpriseInformationPage(EnterpriseInformationPageReqVO pageReqVO); -} \ No newline at end of file + /** + * 更新企业基本信息申请的状态 + * + * @param id 编号 + * @param status 结果 + */ + void updateEnterpriseInformationStatus(long id, Integer status); +} diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationServiceImpl.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationServiceImpl.java index 30e8f0e..681d085 100644 --- a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationServiceImpl.java +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/enterpriseinformation/EnterpriseInformationServiceImpl.java @@ -19,6 +19,7 @@ import cn.iocoder.yudao.module.fta.dal.mysql.enterpriseinformation.EnterpriseInf import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_LEAVE_NOT_EXISTS; import static cn.iocoder.yudao.module.fta.enums.ErrorCodeConstants.*; /** @@ -95,4 +96,16 @@ public class EnterpriseInformationServiceImpl implements EnterpriseInformationSe return enterpriseInformationMapper.selectPage(pageReqVO); } + @Override + public void updateEnterpriseInformationStatus(long id, Integer status) { + validateLeaveExists(id); + enterpriseInformationMapper.updateById(new EnterpriseInformationDO().setId(id).setStatus(status)); + } + + private void validateLeaveExists(Long id) { + if (enterpriseInformationMapper.selectById(id) == null) { + throw exception(ENTERPRISE_INFORMATION_NOT_EXISTS); + } + } + } diff --git a/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/oa/listener/FtaEnterpriseInformationStatusListener.java b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/oa/listener/FtaEnterpriseInformationStatusListener.java new file mode 100644 index 0000000..a83cc16 --- /dev/null +++ b/yudao-module-fta/yudao-module-fta-biz/src/main/java/cn/iocoder/yudao/module/fta/service/oa/listener/FtaEnterpriseInformationStatusListener.java @@ -0,0 +1,31 @@ +package cn.iocoder.yudao.module.fta.service.oa.listener; + +import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEvent; +import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEventListener; +import cn.iocoder.yudao.module.fta.service.enterpriseinformation.EnterpriseInformationService; +import cn.iocoder.yudao.module.fta.service.enterpriseinformation.EnterpriseInformationServiceImpl; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * FTA 企业基本信息流程的结果的监听器实现类 + * + * @author 王长久 + */ +@Component +public class FtaEnterpriseInformationStatusListener extends BpmProcessInstanceStatusEventListener { + + @Resource + private EnterpriseInformationService enterpriseInformationService; + + @Override + protected String getProcessDefinitionKey() { + return EnterpriseInformationServiceImpl.PROCESS_KEY; + } + + @Override + protected void onEvent(BpmProcessInstanceStatusEvent event) { + enterpriseInformationService.updateEnterpriseInformationStatus(Long.parseLong(event.getBusinessKey()), event.getStatus()); + } +}