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()); + } +}