Merge remote-tracking branch 'origin/dev' into dev
commit
888db0baf7
|
|
@ -535,7 +535,7 @@ CREATE TABLE `qual_filing` (
|
|||
`reject_reason` varchar(500) DEFAULT NULL COMMENT '打回原因',
|
||||
`submit_time` datetime DEFAULT NULL COMMENT '最近提交时间',
|
||||
`approve_time` datetime DEFAULT NULL COMMENT '最近审核通过时间',
|
||||
`filing_status_code` int DEFAULT NULL COMMENT '备案状态编码(1申请中2审核中3已打回4变更审核中)',
|
||||
`filing_status_code` int DEFAULT NULL COMMENT '备案状态编码(1已备案2审核中3已打回4变更审核中5暂存)',
|
||||
`filing_status_name` varchar(50) DEFAULT NULL COMMENT '备案状态名称',
|
||||
`apply_type_code` int DEFAULT NULL COMMENT '申请类型编码(1资质备案申请2变更备案草稿3已备案资质填报)',
|
||||
`apply_type_name` varchar(50) DEFAULT NULL COMMENT '申请类型名称',
|
||||
|
|
@ -668,6 +668,8 @@ CREATE TABLE `qual_filing_commitment` (
|
|||
`commitment_content` text COMMENT '承诺内容',
|
||||
`legal_rep_signature_url` varchar(500) DEFAULT NULL COMMENT '法定代表人签名图片地址',
|
||||
`sign_date` date DEFAULT NULL COMMENT '签署日期',
|
||||
`legal_rep_personnel_id` bigint DEFAULT NULL COMMENT '法定代表人机构人员id',
|
||||
`legal_rep_name` varchar(100) DEFAULT NULL COMMENT '法定代表人姓名',
|
||||
`delete_enum` varchar(32) DEFAULT NULL COMMENT '删除标识true false',
|
||||
`remarks` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
`create_name` varchar(50) DEFAULT NULL COMMENT '创建人姓名',
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ qual_filing (1) ── (N) qual_filing_change ── (N) qual_filing_change_deta
|
|||
|
||||
**作用:** 资质备案申请、已备案资质管理、变更草稿的主表;含备案属地、备案单位、备案编号、业务范围及统一备案状态。
|
||||
|
||||
**备案状态 `filing_status_code`:** 1申请中 / 2审核中 / 3已打回 / 4变更审核中(全模块统一四态)。
|
||||
**备案状态 `filing_status_code`:** 1已备案 / 2审核中 / 3已打回 / 4变更审核中 / 5暂存(全模块统一五态)。
|
||||
|
||||
**申请类型 `apply_type_code`:** 1资质备案申请 / 2变更备案草稿 / 3已备案资质填报。
|
||||
|
||||
|
|
|
|||
|
|
@ -1,59 +0,0 @@
|
|||
package org.qinan.safetyeval.adapter.web;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.qinan.safetyeval.client.api.OrgPersonnelApi;
|
||||
import org.qinan.safetyeval.client.co.OrgPersonnelCO;
|
||||
import org.qinan.safetyeval.client.dto.OrgPersonnelAddCmd;
|
||||
import org.qinan.safetyeval.client.dto.OrgPersonnelModifyCmd;
|
||||
import org.qinan.safetyeval.client.dto.OrgPersonnelPageQuery;
|
||||
import org.qinan.safetyeval.client.dto.PageResponse;
|
||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Api(tags = "公开人员信息管理")
|
||||
@RestController
|
||||
@RequestMapping("/public/org-personnel")
|
||||
public class PublicOrgPersonnelController {
|
||||
|
||||
@Resource
|
||||
private OrgPersonnelApi orgPersonnelApi;
|
||||
|
||||
@ApiOperation("公开新增人员信息")
|
||||
@PostMapping("/save")
|
||||
public SingleResponse<OrgPersonnelCO> add(@Validated @RequestBody OrgPersonnelAddCmd cmd) {
|
||||
return orgPersonnelApi.add(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("公开查询人员详情")
|
||||
@GetMapping("/get")
|
||||
public SingleResponse<OrgPersonnelCO> get(@RequestParam Long id) {
|
||||
return orgPersonnelApi.get(id);
|
||||
}
|
||||
|
||||
@ApiOperation("公开修改人员信息")
|
||||
@PostMapping("/modify")
|
||||
public SingleResponse<OrgPersonnelCO> modify(@Validated @RequestBody OrgPersonnelModifyCmd cmd) {
|
||||
return orgPersonnelApi.modify(cmd);
|
||||
}
|
||||
|
||||
@ApiOperation("公开删除人员信息")
|
||||
@PostMapping("/delete")
|
||||
public SingleResponse<Void> delete(@RequestParam Long id) {
|
||||
return orgPersonnelApi.delete(id);
|
||||
}
|
||||
|
||||
@ApiOperation("公开分页查询人员信息")
|
||||
@GetMapping("/page")
|
||||
public PageResponse<OrgPersonnelCO> page(@Validated OrgPersonnelPageQuery query) {
|
||||
return orgPersonnelApi.page(query);
|
||||
}
|
||||
}
|
||||
|
|
@ -13,10 +13,13 @@ import org.qinan.safetyeval.client.dto.QualFilingModifyCmd;
|
|||
import org.qinan.safetyeval.client.dto.QualFilingPageQuery;
|
||||
import org.qinan.safetyeval.client.dto.QualFilingRejectCmd;
|
||||
import org.qinan.safetyeval.domain.constant.QualFilingApplyTypeEnum;
|
||||
import org.qinan.safetyeval.domain.constant.QualFilingStatusEnum;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资质备案申请适配层(Controller)
|
||||
|
|
@ -88,9 +91,29 @@ public class QualFilingController {
|
|||
@GetMapping("/filed/page")
|
||||
public PageResponse<QualFilingCO> filedPage(@Validated QualFilingPageQuery query) {
|
||||
query.setApplyTypeCode(QualFilingApplyTypeEnum.FILED_MANAGE.getCode());
|
||||
applyDefaultStatusCodes(query, Arrays.asList(
|
||||
QualFilingStatusEnum.FILED.getCode(),
|
||||
QualFilingStatusEnum.REVIEWING.getCode()));
|
||||
return qualFilingApi.page(query);
|
||||
}
|
||||
|
||||
@ApiOperation("备案变更管理-分页")
|
||||
@GetMapping("/change/page")
|
||||
public PageResponse<QualFilingCO> changePage(@Validated QualFilingPageQuery query) {
|
||||
query.setScene("change");
|
||||
applyDefaultStatusCodes(query, Arrays.asList(
|
||||
QualFilingStatusEnum.FILED.getCode(),
|
||||
QualFilingStatusEnum.CHANGE_REVIEWING.getCode()));
|
||||
return qualFilingApi.page(query);
|
||||
}
|
||||
|
||||
private void applyDefaultStatusCodes(QualFilingPageQuery query, List<Integer> defaults) {
|
||||
if (query.getFilingStatusCode() == null
|
||||
&& (query.getFilingStatusCodes() == null || query.getFilingStatusCodes().isEmpty())) {
|
||||
query.setFilingStatusCodes(defaults);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("查询资质备案申请详情")
|
||||
@GetMapping("/get")
|
||||
public SingleResponse<QualFilingCO> get(@RequestParam Long id) {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ public class QualFilingCommitmentExecutor implements QualFilingCommitmentApi {
|
|||
entity.setCommitmentContent(cmd.getCommitmentContent());
|
||||
entity.setLegalRepSignatureUrl(cmd.getLegalRepSignatureUrl());
|
||||
entity.setSignDate(cmd.getSignDate());
|
||||
entity.setLegalRepPersonnelId(cmd.getLegalRepPersonnelId());
|
||||
entity.setLegalRepName(cmd.getLegalRepName());
|
||||
|
||||
QualFilingCommitmentEntity result = qualFilingCommitmentDomainService.add(entity);
|
||||
return SingleResponse.success(toCO(result));
|
||||
|
|
@ -52,6 +54,8 @@ public class QualFilingCommitmentExecutor implements QualFilingCommitmentApi {
|
|||
entity.setCommitmentContent(cmd.getCommitmentContent());
|
||||
entity.setLegalRepSignatureUrl(cmd.getLegalRepSignatureUrl());
|
||||
entity.setSignDate(cmd.getSignDate());
|
||||
entity.setLegalRepPersonnelId(cmd.getLegalRepPersonnelId());
|
||||
entity.setLegalRepName(cmd.getLegalRepName());
|
||||
|
||||
QualFilingCommitmentEntity result = qualFilingCommitmentDomainService.modify(entity);
|
||||
return SingleResponse.success(toCO(result));
|
||||
|
|
@ -116,11 +120,15 @@ public class QualFilingCommitmentExecutor implements QualFilingCommitmentApi {
|
|||
entity.setCommitmentContent(cmd.getCommitmentContent());
|
||||
entity.setLegalRepSignatureUrl(cmd.getLegalRepSignatureUrl());
|
||||
entity.setSignDate(cmd.getSignDate());
|
||||
entity.setLegalRepPersonnelId(cmd.getLegalRepPersonnelId());
|
||||
entity.setLegalRepName(cmd.getLegalRepName());
|
||||
return SingleResponse.success(toCO(qualFilingCommitmentDomainService.add(entity)));
|
||||
}
|
||||
existing.setCommitmentContent(cmd.getCommitmentContent());
|
||||
existing.setLegalRepSignatureUrl(cmd.getLegalRepSignatureUrl());
|
||||
existing.setSignDate(cmd.getSignDate());
|
||||
existing.setLegalRepPersonnelId(cmd.getLegalRepPersonnelId());
|
||||
existing.setLegalRepName(cmd.getLegalRepName());
|
||||
return SingleResponse.success(toCO(qualFilingCommitmentDomainService.modify(existing)));
|
||||
}
|
||||
|
||||
|
|
@ -146,6 +154,8 @@ public class QualFilingCommitmentExecutor implements QualFilingCommitmentApi {
|
|||
co.setCommitmentContent(entity.getCommitmentContent());
|
||||
co.setLegalRepSignatureUrl(entity.getLegalRepSignatureUrl());
|
||||
co.setSignDate(entity.getSignDate());
|
||||
co.setLegalRepPersonnelId(entity.getLegalRepPersonnelId());
|
||||
co.setLegalRepName(entity.getLegalRepName());
|
||||
co.setTenantId(entity.getTenantId());
|
||||
return co;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,8 +120,8 @@ public class QualFilingOrchestrator {
|
|||
QualFilingEntity entity = new QualFilingEntity();
|
||||
entity.setApplyTypeCode(applyType.getCode());
|
||||
entity.setApplyTypeName(applyType.getName());
|
||||
entity.setFilingStatusCode(QualFilingStatusEnum.APPLYING.getCode());
|
||||
entity.setFilingStatusName(QualFilingStatusEnum.APPLYING.getName());
|
||||
entity.setFilingStatusCode(QualFilingStatusEnum.DRAFT.getCode());
|
||||
entity.setFilingStatusName(QualFilingStatusEnum.DRAFT.getName());
|
||||
entity.setOrgId(resolveOrgId());
|
||||
entity.setTenantId(resolveTenantId());
|
||||
prefillFromOrgInfo(entity);
|
||||
|
|
@ -134,10 +134,20 @@ public class QualFilingOrchestrator {
|
|||
QualFilingEntity existing = qualFilingGateway.get(cmd.getId());
|
||||
statusGuard.ensureEditable(existing);
|
||||
applyModifyFields(existing, cmd);
|
||||
markDraftSaved(existing);
|
||||
QualFilingEntity saved = qualFilingGateway.modify(existing);
|
||||
return toCO(saved);
|
||||
}
|
||||
|
||||
/** 用户点击暂存:暂存保持;已打回保持原状态 */
|
||||
private void markDraftSaved(QualFilingEntity filing) {
|
||||
Integer code = filing.getFilingStatusCode();
|
||||
if (code == null || code == QualFilingStatusEnum.DRAFT.getCode()) {
|
||||
filing.setFilingStatusCode(QualFilingStatusEnum.DRAFT.getCode());
|
||||
filing.setFilingStatusName(QualFilingStatusEnum.DRAFT.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public QualFilingCO submit(Long id) {
|
||||
QualFilingEntity filing = qualFilingGateway.get(id);
|
||||
|
|
@ -157,8 +167,8 @@ public class QualFilingOrchestrator {
|
|||
|| filing.getFilingStatusCode() != QualFilingStatusEnum.REVIEWING.getCode()) {
|
||||
throw new BizException(ErrorCode.QUAL_FILING_STATUS_INVALID);
|
||||
}
|
||||
filing.setFilingStatusCode(QualFilingStatusEnum.APPLYING.getCode());
|
||||
filing.setFilingStatusName(QualFilingStatusEnum.APPLYING.getName());
|
||||
filing.setFilingStatusCode(QualFilingStatusEnum.FILED.getCode());
|
||||
filing.setFilingStatusName(QualFilingStatusEnum.FILED.getName());
|
||||
filing.setApproveTime(LocalDateTime.now());
|
||||
QualFilingEntity saved = qualFilingGateway.modify(filing);
|
||||
if (QualFilingApplyTypeEnum.APPLICATION.getCode() == saved.getApplyTypeCode()) {
|
||||
|
|
@ -209,8 +219,10 @@ public class QualFilingOrchestrator {
|
|||
domainQuery.setFilingNo(query.getFilingNo());
|
||||
domainQuery.setFilingUnitName(query.getFilingUnitName());
|
||||
domainQuery.setFilingStatusCode(query.getFilingStatusCode());
|
||||
domainQuery.setFilingStatusCodes(query.getFilingStatusCodes());
|
||||
domainQuery.setApplyTypeCode(query.getApplyTypeCode());
|
||||
domainQuery.setFilingTerritoryCode(query.getFilingTerritoryCode());
|
||||
domainQuery.setScene(query.getScene());
|
||||
PageResult<QualFilingEntity> pageResult = qualFilingGateway.page(domainQuery);
|
||||
List<QualFilingCO> records = pageResult.getRecords().stream()
|
||||
.map(entity -> {
|
||||
|
|
@ -281,13 +293,14 @@ public class QualFilingOrchestrator {
|
|||
if (origin == null) {
|
||||
throw new BizException(ErrorCode.QUAL_FILING_NOT_FOUND);
|
||||
}
|
||||
statusGuard.ensureFiled(origin);
|
||||
statusGuard.ensureNotChangeReviewing(origin);
|
||||
QualFilingEntity draft = cloneFiling(origin);
|
||||
draft.setOriginFilingId(originFilingId);
|
||||
draft.setApplyTypeCode(QualFilingApplyTypeEnum.CHANGE_DRAFT.getCode());
|
||||
draft.setApplyTypeName(QualFilingApplyTypeEnum.CHANGE_DRAFT.getName());
|
||||
draft.setFilingStatusCode(QualFilingStatusEnum.APPLYING.getCode());
|
||||
draft.setFilingStatusName(QualFilingStatusEnum.APPLYING.getName());
|
||||
draft.setFilingStatusCode(QualFilingStatusEnum.DRAFT.getCode());
|
||||
draft.setFilingStatusName(QualFilingStatusEnum.DRAFT.getName());
|
||||
QualFilingEntity savedDraft = qualFilingGateway.save(draft);
|
||||
cloneChildren(originFilingId, savedDraft.getId());
|
||||
return savedDraft.getId();
|
||||
|
|
@ -317,6 +330,7 @@ public class QualFilingOrchestrator {
|
|||
throw new BizException(ErrorCode.QUAL_FILING_CHANGE_NO_DIFF);
|
||||
}
|
||||
for (QualFilingChangeDetailEntity detail : details) {
|
||||
detail.setCreateName(resolveOperatorName());
|
||||
qualFilingChangeDetailGateway.save(detail);
|
||||
}
|
||||
|
||||
|
|
@ -340,13 +354,13 @@ public class QualFilingOrchestrator {
|
|||
QualFilingEntity origin = qualFilingGateway.get(change.getOriginFilingId());
|
||||
applyDraftToOrigin(origin, draft);
|
||||
replaceChildrenFromDraft(origin.getId(), draft.getId());
|
||||
origin.setFilingStatusCode(QualFilingStatusEnum.APPLYING.getCode());
|
||||
origin.setFilingStatusName(QualFilingStatusEnum.APPLYING.getName());
|
||||
origin.setFilingStatusCode(QualFilingStatusEnum.FILED.getCode());
|
||||
origin.setFilingStatusName(QualFilingStatusEnum.FILED.getName());
|
||||
origin.setApproveTime(LocalDateTime.now());
|
||||
qualFilingGateway.modify(origin);
|
||||
|
||||
change.setFilingStatusCode(QualFilingStatusEnum.APPLYING.getCode());
|
||||
change.setFilingStatusName(QualFilingStatusEnum.APPLYING.getName());
|
||||
change.setFilingStatusCode(QualFilingStatusEnum.FILED.getCode());
|
||||
change.setFilingStatusName(QualFilingStatusEnum.FILED.getName());
|
||||
qualFilingChangeGateway.modify(change);
|
||||
}
|
||||
|
||||
|
|
@ -419,8 +433,8 @@ public class QualFilingOrchestrator {
|
|||
QualFilingEntity filed = cloneFiling(application);
|
||||
filed.setApplyTypeCode(QualFilingApplyTypeEnum.FILED_MANAGE.getCode());
|
||||
filed.setApplyTypeName(QualFilingApplyTypeEnum.FILED_MANAGE.getName());
|
||||
filed.setFilingStatusCode(QualFilingStatusEnum.APPLYING.getCode());
|
||||
filed.setFilingStatusName(QualFilingStatusEnum.APPLYING.getName());
|
||||
filed.setFilingStatusCode(QualFilingStatusEnum.FILED.getCode());
|
||||
filed.setFilingStatusName(QualFilingStatusEnum.FILED.getName());
|
||||
filed.setOriginFilingId(null);
|
||||
QualFilingEntity savedFiled = qualFilingGateway.save(filed);
|
||||
cloneChildren(application.getId(), savedFiled.getId());
|
||||
|
|
@ -480,7 +494,7 @@ public class QualFilingOrchestrator {
|
|||
}
|
||||
QualFilingCommitmentEntity commitment = qualFilingCommitmentGateway.getByFilingId(filingId);
|
||||
if (commitment != null) {
|
||||
qualFilingCommitmentGateway.delete(commitment.getId());
|
||||
qualFilingCommitmentGateway.physicalDeleteByFilingId(filingId);
|
||||
}
|
||||
for (QualFilingPersonnelEntity person : qualFilingPersonnelGateway.listByFilingId(filingId)) {
|
||||
for (QualFilingPersonnelCertEntity cert : qualFilingPersonnelCertGateway.listByFilingPersonnelId(person.getId())) {
|
||||
|
|
@ -617,10 +631,15 @@ public class QualFilingOrchestrator {
|
|||
item.setChangeItemName(StringUtils.hasText(entity.getFormStepName())
|
||||
? entity.getFormStepName() : entity.getChangeItemName());
|
||||
item.setChangeTime(entity.getCreateTime());
|
||||
item.setOperatorName(entity.getCreateName());
|
||||
item.setOperatorName(StringUtils.hasText(entity.getCreateName()) ? entity.getCreateName() : resolveOperatorName());
|
||||
return item;
|
||||
}
|
||||
|
||||
private String resolveOperatorName() {
|
||||
String userName = AuthUserContextAdapter.getCurrentUserName();
|
||||
return StringUtils.hasText(userName) ? userName : "系统";
|
||||
}
|
||||
|
||||
private QualFilingCO toCO(QualFilingEntity entity) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
|
|
@ -684,6 +703,8 @@ public class QualFilingOrchestrator {
|
|||
co.setCommitmentContent(entity.getCommitmentContent());
|
||||
co.setLegalRepSignatureUrl(entity.getLegalRepSignatureUrl());
|
||||
co.setSignDate(entity.getSignDate());
|
||||
co.setLegalRepPersonnelId(entity.getLegalRepPersonnelId());
|
||||
co.setLegalRepName(entity.getLegalRepName());
|
||||
co.setTenantId(entity.getTenantId());
|
||||
return co;
|
||||
}
|
||||
|
|
@ -745,10 +766,6 @@ public class QualFilingOrchestrator {
|
|||
}
|
||||
|
||||
private Long resolveOrgId() {
|
||||
Long authOrgId = AuthUserContextAdapter.getCurrentOrgId();
|
||||
if (authOrgId != null) {
|
||||
return authOrgId;
|
||||
}
|
||||
return orgContextResolver.resolveOrgId(null);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,8 @@ public class QualFilingChangeDiffer {
|
|||
if (entity == null) {
|
||||
return "";
|
||||
}
|
||||
return entity.getCommitmentContent() + "|" + entity.getLegalRepSignatureUrl() + "|" + entity.getSignDate();
|
||||
return entity.getCommitmentContent() + "|" + entity.getLegalRepSignatureUrl() + "|" + entity.getSignDate()
|
||||
+ "|" + entity.getLegalRepPersonnelId() + "|" + entity.getLegalRepName();
|
||||
}
|
||||
|
||||
private boolean personnelChanged(Long originId, Long draftId) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package org.qinan.safetyeval.app.support;
|
||||
|
||||
import org.qinan.safetyeval.domain.constant.QualFilingFormStepEnum;
|
||||
import org.qinan.safetyeval.domain.constant.QualFilingStatusEnum;
|
||||
import org.qinan.safetyeval.domain.entity.QualFilingEntity;
|
||||
import org.qinan.safetyeval.domain.exception.BizException;
|
||||
|
|
@ -28,12 +27,21 @@ public class QualFilingStatusGuard {
|
|||
}
|
||||
Integer code = filing.getFilingStatusCode();
|
||||
if (code == null
|
||||
|| (code != QualFilingStatusEnum.APPLYING.getCode()
|
||||
|| (code != QualFilingStatusEnum.DRAFT.getCode()
|
||||
&& code != QualFilingStatusEnum.REJECTED.getCode())) {
|
||||
throw new BizException(ErrorCode.QUAL_FILING_STATUS_INVALID);
|
||||
}
|
||||
}
|
||||
|
||||
public void ensureFiled(QualFilingEntity filing) {
|
||||
if (filing == null) {
|
||||
throw new BizException(ErrorCode.QUAL_FILING_NOT_FOUND);
|
||||
}
|
||||
if (!QualFilingStatusEnum.isFiled(filing.getFilingStatusCode())) {
|
||||
throw new BizException(ErrorCode.QUAL_FILING_STATUS_INVALID);
|
||||
}
|
||||
}
|
||||
|
||||
public void ensureNotChangeReviewing(QualFilingEntity filing) {
|
||||
if (filing != null
|
||||
&& filing.getFilingStatusCode() != null
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@ public class QualFilingCommitmentCO {
|
|||
/** signDate */
|
||||
private LocalDate signDate;
|
||||
|
||||
/** 法定代表人机构人员id */
|
||||
private Long legalRepPersonnelId;
|
||||
|
||||
/** 法定代表人姓名 */
|
||||
private String legalRepName;
|
||||
|
||||
/** 租户ID */
|
||||
private Long tenantId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,4 +19,10 @@ public class QualFilingCommitmentAddCmd {
|
|||
|
||||
/** signDate */
|
||||
private LocalDate signDate;
|
||||
|
||||
/** 法定代表人机构人员id */
|
||||
private Long legalRepPersonnelId;
|
||||
|
||||
/** 法定代表人姓名 */
|
||||
private String legalRepName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@ public class QualFilingCommitmentModifyCmd {
|
|||
/** signDate */
|
||||
private LocalDate signDate;
|
||||
|
||||
/** 法定代表人机构人员id */
|
||||
private Long legalRepPersonnelId;
|
||||
|
||||
/** 法定代表人姓名 */
|
||||
private String legalRepName;
|
||||
|
||||
/** 租户ID */
|
||||
private Long tenantId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package org.qinan.safetyeval.client.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
|
@ -24,9 +26,15 @@ public class QualFilingPageQuery extends BasePageQuery {
|
|||
/** 备案状态 */
|
||||
private Integer filingStatusCode;
|
||||
|
||||
/** 备案状态多选 */
|
||||
private List<Integer> filingStatusCodes;
|
||||
|
||||
/** 申请类型 */
|
||||
private Integer applyTypeCode;
|
||||
|
||||
/** 备案属地编码 */
|
||||
private String filingTerritoryCode;
|
||||
|
||||
/** 分页场景:change=备案变更列表 */
|
||||
private String scene;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
package org.qinan.safetyeval.domain.constant;
|
||||
|
||||
/**
|
||||
* 备案状态(全模块统一四态)
|
||||
* 备案状态(全模块统一五态)
|
||||
*/
|
||||
public enum QualFilingStatusEnum {
|
||||
|
||||
APPLYING(1, "申请中"),
|
||||
FILED(1, "已备案"),
|
||||
REVIEWING(2, "审核中"),
|
||||
REJECTED(3, "已打回"),
|
||||
CHANGE_REVIEWING(4, "变更审核中");
|
||||
CHANGE_REVIEWING(4, "变更审核中"),
|
||||
DRAFT(5, "暂存");
|
||||
|
||||
private final int code;
|
||||
private final String name;
|
||||
|
|
@ -38,7 +39,13 @@ public enum QualFilingStatusEnum {
|
|||
return null;
|
||||
}
|
||||
|
||||
/** 表单可编辑:暂存、已打回 */
|
||||
public static boolean isEditable(Integer code) {
|
||||
return code != null && (code == APPLYING.code || code == REJECTED.code);
|
||||
return code != null && (code == DRAFT.code || code == REJECTED.code);
|
||||
}
|
||||
|
||||
/** 已备案稳定态,可发起变更 */
|
||||
public static boolean isFiled(Integer code) {
|
||||
return code != null && code == FILED.code;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,12 @@ public class QualFilingCommitmentEntity {
|
|||
/** 签署日期 */
|
||||
private LocalDate signDate;
|
||||
|
||||
/** 法定代表人机构人员id */
|
||||
private Long legalRepPersonnelId;
|
||||
|
||||
/** 法定代表人姓名 */
|
||||
private String legalRepName;
|
||||
|
||||
/** 租户ID */
|
||||
private Long tenantId;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,5 +21,8 @@ public interface QualFilingCommitmentGateway {
|
|||
|
||||
void delete(Long id);
|
||||
|
||||
/** 按备案单物理删除承诺书(变更审核通过替换子表时使用) */
|
||||
void physicalDeleteByFilingId(Long filingId);
|
||||
|
||||
PageResult<QualFilingCommitmentEntity> page(QualFilingCommitmentQuery query);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package org.qinan.safetyeval.domain.query;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
|
@ -31,9 +33,15 @@ public class QualFilingQuery {
|
|||
/** 备案状态 */
|
||||
private Integer filingStatusCode;
|
||||
|
||||
/** 备案状态多选(与 filingStatusCode 互斥,优先 in 查询) */
|
||||
private List<Integer> filingStatusCodes;
|
||||
|
||||
/** 申请类型 */
|
||||
private Integer applyTypeCode;
|
||||
|
||||
/** 备案属地编码 */
|
||||
private String filingTerritoryCode;
|
||||
|
||||
/** 分页场景:change=备案变更列表 */
|
||||
private String scene;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ public class QualFilingCommitmentDO {
|
|||
private String commitmentContent;
|
||||
private String legalRepSignatureUrl;
|
||||
private LocalDate signDate;
|
||||
private Long legalRepPersonnelId;
|
||||
private String legalRepName;
|
||||
|
||||
// ---- GBS默认字段 ----
|
||||
private String deleteEnum;
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ public class QualFilingChangeDetailGatewayImpl implements QualFilingChangeDetail
|
|||
dataObject.setAfterValue(entity.getAfterValue());
|
||||
dataObject.setTenantId(entity.getTenantId());
|
||||
dataObject.setOrgId(entity.getOrgId());
|
||||
dataObject.setCreateName(entity.getCreateName());
|
||||
return dataObject;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,13 @@ public class QualFilingCommitmentGatewayImpl implements QualFilingCommitmentGate
|
|||
qualFilingCommitmentMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void physicalDeleteByFilingId(Long filingId) {
|
||||
if (filingId != null) {
|
||||
qualFilingCommitmentMapper.physicalDeleteByFilingId(filingId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<QualFilingCommitmentEntity> page(QualFilingCommitmentQuery query) {
|
||||
LambdaQueryWrapper<QualFilingCommitmentDO> wrapper = new LambdaQueryWrapper<>();
|
||||
|
|
@ -89,6 +96,8 @@ public class QualFilingCommitmentGatewayImpl implements QualFilingCommitmentGate
|
|||
dataObject.setCommitmentContent(entity.getCommitmentContent());
|
||||
dataObject.setLegalRepSignatureUrl(entity.getLegalRepSignatureUrl());
|
||||
dataObject.setSignDate(entity.getSignDate());
|
||||
dataObject.setLegalRepPersonnelId(entity.getLegalRepPersonnelId());
|
||||
dataObject.setLegalRepName(entity.getLegalRepName());
|
||||
dataObject.setTenantId(entity.getTenantId());
|
||||
return dataObject;
|
||||
}
|
||||
|
|
@ -103,6 +112,8 @@ public class QualFilingCommitmentGatewayImpl implements QualFilingCommitmentGate
|
|||
entity.setCommitmentContent(dataObject.getCommitmentContent());
|
||||
entity.setLegalRepSignatureUrl(dataObject.getLegalRepSignatureUrl());
|
||||
entity.setSignDate(dataObject.getSignDate());
|
||||
entity.setLegalRepPersonnelId(dataObject.getLegalRepPersonnelId());
|
||||
entity.setLegalRepName(dataObject.getLegalRepName());
|
||||
entity.setTenantId(dataObject.getTenantId());
|
||||
return entity;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ import org.springframework.stereotype.Component;
|
|||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -25,6 +28,13 @@ import java.util.stream.Collectors;
|
|||
@Component
|
||||
public class QualFilingGatewayImpl implements QualFilingGateway {
|
||||
|
||||
private static final String SCENE_CHANGE = "change";
|
||||
|
||||
private static final int APPLY_TYPE_APPLICATION = 1;
|
||||
private static final int APPLY_TYPE_FILED_MANAGE = 3;
|
||||
private static final int STATUS_FILED = 1;
|
||||
private static final int STATUS_CHANGE_REVIEWING = 4;
|
||||
|
||||
@Resource
|
||||
private QualFilingMapper qualFilingMapper;
|
||||
|
||||
|
|
@ -78,15 +88,26 @@ public class QualFilingGatewayImpl implements QualFilingGateway {
|
|||
if (StringUtils.hasText(query.getFilingUnitName())) {
|
||||
wrapper.like(QualFilingDO::getFilingUnitName, query.getFilingUnitName());
|
||||
}
|
||||
if (query.getFilingStatusCode() != null) {
|
||||
wrapper.eq(QualFilingDO::getFilingStatusCode, query.getFilingStatusCode());
|
||||
}
|
||||
if (query.getApplyTypeCode() != null) {
|
||||
wrapper.eq(QualFilingDO::getApplyTypeCode, query.getApplyTypeCode());
|
||||
}
|
||||
if (StringUtils.hasText(query.getFilingTerritoryCode())) {
|
||||
wrapper.eq(QualFilingDO::getFilingTerritoryCode, query.getFilingTerritoryCode());
|
||||
}
|
||||
if (SCENE_CHANGE.equals(query.getScene())) {
|
||||
applyChangeListFilter(wrapper, query);
|
||||
}
|
||||
else {
|
||||
if (query.getFilingStatusCodes() != null && !query.getFilingStatusCodes().isEmpty()) {
|
||||
wrapper.in(QualFilingDO::getFilingStatusCode, query.getFilingStatusCodes());
|
||||
}
|
||||
else if (query.getFilingStatusCode() != null) {
|
||||
wrapper.eq(QualFilingDO::getFilingStatusCode, query.getFilingStatusCode());
|
||||
}
|
||||
if (query.getApplyTypeCode() != null) {
|
||||
wrapper.eq(QualFilingDO::getApplyTypeCode, query.getApplyTypeCode());
|
||||
if (query.getApplyTypeCode() == APPLY_TYPE_FILED_MANAGE) {
|
||||
wrapper.isNull(QualFilingDO::getOriginFilingId);
|
||||
}
|
||||
}
|
||||
}
|
||||
wrapper.orderByDesc(QualFilingDO::getCreateTime);
|
||||
|
||||
Page<QualFilingDO> page = new Page<>(query.getPageNum(), query.getPageSize());
|
||||
|
|
@ -99,6 +120,40 @@ public class QualFilingGatewayImpl implements QualFilingGateway {
|
|||
return PageResult.of(entities, result.getTotal(), result.getCurrent(), result.getSize());
|
||||
}
|
||||
|
||||
/**
|
||||
* 备案变更列表:优先展示已备案主记录(applyType=3);
|
||||
* 若仅有资质备案申请(applyType=1)为已备案、尚无主记录时,回退展示申请单。
|
||||
*/
|
||||
private void applyChangeListFilter(LambdaQueryWrapper<QualFilingDO> wrapper, QualFilingQuery query) {
|
||||
List<Integer> statuses = resolveStatusFilter(query, Arrays.asList(STATUS_FILED, STATUS_CHANGE_REVIEWING));
|
||||
wrapper.and(w -> {
|
||||
w.nested(n -> n
|
||||
.eq(QualFilingDO::getApplyTypeCode, APPLY_TYPE_FILED_MANAGE)
|
||||
.isNull(QualFilingDO::getOriginFilingId)
|
||||
.in(QualFilingDO::getFilingStatusCode, statuses));
|
||||
if (statuses.contains(STATUS_FILED)) {
|
||||
w.or(n -> n
|
||||
.eq(QualFilingDO::getApplyTypeCode, APPLY_TYPE_APPLICATION)
|
||||
.eq(QualFilingDO::getFilingStatusCode, STATUS_FILED)
|
||||
.apply("NOT EXISTS (SELECT 1 FROM qual_filing f2 WHERE f2.org_id = qual_filing.org_id"
|
||||
+ " AND f2.apply_type_code = " + APPLY_TYPE_FILED_MANAGE
|
||||
+ " AND f2.origin_filing_id IS NULL"
|
||||
+ " AND f2.delete_enum = 'false'"
|
||||
+ " AND f2.filing_status_code IN (" + STATUS_FILED + "," + STATUS_CHANGE_REVIEWING + "))"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private List<Integer> resolveStatusFilter(QualFilingQuery query, List<Integer> defaults) {
|
||||
if (query.getFilingStatusCodes() != null && !query.getFilingStatusCodes().isEmpty()) {
|
||||
return query.getFilingStatusCodes();
|
||||
}
|
||||
if (query.getFilingStatusCode() != null) {
|
||||
return Collections.singletonList(query.getFilingStatusCode());
|
||||
}
|
||||
return new ArrayList<>(defaults);
|
||||
}
|
||||
|
||||
private QualFilingDO toDO(QualFilingEntity entity) {
|
||||
QualFilingDO dataObject = new QualFilingDO();
|
||||
dataObject.setOrgId(entity.getOrgId());
|
||||
|
|
|
|||
|
|
@ -1,9 +1,15 @@
|
|||
package org.qinan.safetyeval.infrastructure.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.qinan.safetyeval.infrastructure.dataobject.QualFilingCommitmentDO;
|
||||
|
||||
@Mapper
|
||||
public interface QualFilingCommitmentMapper extends BaseMapper<QualFilingCommitmentDO> {
|
||||
|
||||
/** 物理删除:变更审核通过需替换承诺书,逻辑删会占用 filing_id 唯一键 */
|
||||
@Delete("DELETE FROM qual_filing_commitment WHERE filing_id = #{filingId}")
|
||||
int physicalDeleteByFilingId(@Param("filingId") Long filingId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public final class InsertFieldDefaults {
|
|||
if (tenantId != null) {
|
||||
setIfNull(dataObject, "tenantId", tenantId);
|
||||
}
|
||||
if (orgId != null) {
|
||||
if (orgInfoId != null) {
|
||||
// 机构信息id
|
||||
setIfNull(dataObject, "orgId", orgInfoId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
<result column="commitment_content" property="commitmentContent"/>
|
||||
<result column="legal_rep_signature_url" property="legalRepSignatureUrl"/>
|
||||
<result column="sign_date" property="signDate"/>
|
||||
<result column="legal_rep_personnel_id" property="legalRepPersonnelId"/>
|
||||
<result column="legal_rep_name" property="legalRepName"/>
|
||||
<result column="delete_enum" property="deleteEnum"/>
|
||||
<result column="remarks" property="remarks"/>
|
||||
<result column="create_name" property="createName"/>
|
||||
|
|
@ -25,7 +27,7 @@
|
|||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
`id`, `filing_id`, `commitment_content`, `legal_rep_signature_url`, `sign_date`, `delete_enum`, `remarks`, `create_name`, `update_name`, `tenant_id`, `org_id`, `version`, `create_time`, `update_time`, `create_id`, `update_id`, `env`
|
||||
`id`, `filing_id`, `commitment_content`, `legal_rep_signature_url`, `sign_date`, `legal_rep_personnel_id`, `legal_rep_name`, `delete_enum`, `remarks`, `create_name`, `update_name`, `tenant_id`, `org_id`, `version`, `create_time`, `update_time`, `create_id`, `update_id`, `env`
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.qinan.safetyeval.start;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
|
|
@ -24,10 +25,13 @@ import java.util.List;
|
|||
@SpringBootApplication(scanBasePackages = {"org.qinan.safetyeval", "com.jjb.saas"})
|
||||
@EnableDubbo
|
||||
@EnableFeignClients(basePackages = {"org.qinan.safetyeval", "com.jjb.saas"})
|
||||
@Slf4j
|
||||
public class SafetyEvalApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
long startTimeMillis = System.currentTimeMillis();
|
||||
SpringApplication.run(SafetyEvalApplication.class, args);
|
||||
log.info("SafetyEvalApplication-启动成功-耗时:{} min", (((float)(System.currentTimeMillis() - startTimeMillis))/60000L));
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
|
|
|||
Loading…
Reference in New Issue