job
parent
5391d208de
commit
5d601c0aa4
|
|
@ -25,16 +25,12 @@ import org.qinan.safetyeval.domain.service.QualFilingReviewDomainService;
|
||||||
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
import org.qinan.safetyeval.infrastructure.adapter.ThreadLocalUserInfoAdapter;
|
||||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||||
import org.qinan.safetyeval.infrastructure.dataobject.*;
|
import org.qinan.safetyeval.infrastructure.dataobject.*;
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.QualFilingChangeMapper;
|
import org.qinan.safetyeval.infrastructure.mapper.*;
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.QualFilingMapper;
|
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.QualFilingMaterialMapper;
|
|
||||||
import org.qinan.safetyeval.infrastructure.mapper.QualFilingPersonnelCertMapper;
|
|
||||||
import org.qinan.safetyeval.infrastructure.persistence.mapper.QualFilingPersonnelChangeMapper;
|
import org.qinan.safetyeval.infrastructure.persistence.mapper.QualFilingPersonnelChangeMapper;
|
||||||
import org.qinan.safetyeval.infrastructure.support.InsertFieldDefaults;
|
import org.qinan.safetyeval.infrastructure.support.InsertFieldDefaults;
|
||||||
import org.qinan.safetyeval.infrastructure.utils.CommonUtil;
|
import org.qinan.safetyeval.infrastructure.utils.CommonUtil;
|
||||||
import org.qinan.safetyeval.infrastructure.utils.ComplianceCheckUtil;
|
import org.qinan.safetyeval.infrastructure.utils.ComplianceCheckUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -105,8 +101,8 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
||||||
@Resource
|
@Resource
|
||||||
private QualFilingChangeDetailGateway qualFilingChangeDetailGateway;
|
private QualFilingChangeDetailGateway qualFilingChangeDetailGateway;
|
||||||
|
|
||||||
@Value("${def.reviewEnable:false}")
|
@Resource
|
||||||
private Boolean reviewEnable;
|
private QualFilingCommitmentMapper qualFilingCommitmentMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SingleResponse<QualFilingChangeCO> add(QualFilingChangeAddCmd cmd) {
|
public SingleResponse<QualFilingChangeCO> add(QualFilingChangeAddCmd cmd) {
|
||||||
|
|
@ -344,6 +340,8 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
||||||
Long changeId = cmd.getOriginChangeFilingId();
|
Long changeId = cmd.getOriginChangeFilingId();
|
||||||
List<QualFilingChangeDetailDO> details = new ArrayList<>();
|
List<QualFilingChangeDetailDO> details = new ArrayList<>();
|
||||||
details.addAll(diffBasicInfoDetail(changeId, entity, cmd));
|
details.addAll(diffBasicInfoDetail(changeId, entity, cmd));
|
||||||
|
details.addAll(diffCommitmentDetail(changeId, commitmentEntity, cmd));
|
||||||
|
details.addAll(diffEquipmentDetail(changeId, equipmentEntities, cmd));
|
||||||
details.addAll(diffMaterialDetail(changeId, materialEntities, cmd));
|
details.addAll(diffMaterialDetail(changeId, materialEntities, cmd));
|
||||||
details.addAll(diffManagementPersonnelDetail(changeId, personnelEntities, cmd));
|
details.addAll(diffManagementPersonnelDetail(changeId, personnelEntities, cmd));
|
||||||
// 根据changeId先删除原有变更明细,再新增
|
// 根据changeId先删除原有变更明细,再新增
|
||||||
|
|
@ -599,6 +597,42 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
||||||
return diffBasicInfo(changeId, filingDO, newEntity);
|
return diffBasicInfo(changeId, filingDO, newEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法定代表人承诺书变更明细(对比原表 qual_filing_commitment,根据 filing_id 查询)
|
||||||
|
*/
|
||||||
|
private List<QualFilingChangeDetailDO> diffCommitmentDetail(
|
||||||
|
Long changeId, QualFilingCommitmentChangeE newCommitment, AggregationSaveOrEditQualFilingChangeCmd cmd) {
|
||||||
|
QualFilingCommitmentDO existCommitment = qualFilingCommitmentMapper.selectOne(
|
||||||
|
new LambdaQueryWrapper<QualFilingCommitmentDO>()
|
||||||
|
.select(QualFilingCommitmentDO::getLegalRepPersonnelId,
|
||||||
|
QualFilingCommitmentDO::getLegalRepName)
|
||||||
|
.eq(QualFilingCommitmentDO::getFilingId, cmd.getQualFilingChangeAddCmd().getFilingId()));
|
||||||
|
if (existCommitment == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<QualFilingChangeDetailDO> details = new ArrayList<>();
|
||||||
|
// 法定代表人机构人员id
|
||||||
|
if (!Objects.equals(existCommitment.getLegalRepPersonnelId(), newCommitment != null ? newCommitment.getLegalRepPersonnelId() : null)) {
|
||||||
|
String beforeName = Objects.toString(existCommitment.getLegalRepName(), "");
|
||||||
|
String afterName = Objects.toString(newCommitment != null ? newCommitment.getLegalRepName() : null, "");
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.COMMITMENT, "法定代表人承诺书变更",
|
||||||
|
"法定代表人", beforeName, afterName));
|
||||||
|
}
|
||||||
|
return details;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装备清单变更明细(对比原表 qual_filing_equipment,根据 filing_id 查询)
|
||||||
|
* 检测装备的增减和字段修改
|
||||||
|
*/
|
||||||
|
private List<QualFilingChangeDetailDO> diffEquipmentDetail(
|
||||||
|
Long changeId, List<QualFilingEquipmentChangeE> newEquipments, AggregationSaveOrEditQualFilingChangeCmd cmd) {
|
||||||
|
List<QualFilingEquipmentDO> existingEquipments = qualFilingEquipmentMapper.selectList(
|
||||||
|
new LambdaQueryWrapper<QualFilingEquipmentDO>()
|
||||||
|
.eq(QualFilingEquipmentDO::getFilingId, cmd.getQualFilingChangeAddCmd().getFilingId()));
|
||||||
|
return diffEquipment(changeId, existingEquipments, newEquipments);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 材料变更明细
|
* 材料变更明细
|
||||||
*/
|
*/
|
||||||
|
|
@ -624,10 +658,89 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基本信息变更明细(仅对比法定代表人、专职安全评价师数量、注册安全工程师数量)
|
* 基本信息变更明细
|
||||||
*/
|
*/
|
||||||
private List<QualFilingChangeDetailDO> diffBasicInfo(Long changeId, QualFilingDO exist, QualFilingChangeEntity newEntity) {
|
private List<QualFilingChangeDetailDO> diffBasicInfo(Long changeId, QualFilingDO exist, QualFilingChangeEntity newEntity) {
|
||||||
List<QualFilingChangeDetailDO> details = new ArrayList<>();
|
List<QualFilingChangeDetailDO> details = new ArrayList<>();
|
||||||
|
// 备案属地编码
|
||||||
|
if (!Objects.equals(exist.getFilingTerritoryCode(), newEntity.getFilingTerritoryCode())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"备案属地编码",
|
||||||
|
Objects.toString(exist.getFilingTerritoryCode(), ""),
|
||||||
|
Objects.toString(newEntity.getFilingTerritoryCode(), "")));
|
||||||
|
}
|
||||||
|
// 备案属地名称
|
||||||
|
if (!Objects.equals(exist.getFilingTerritoryName(), newEntity.getFilingTerritoryName())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"备案属地名称",
|
||||||
|
Objects.toString(exist.getFilingTerritoryName(), ""),
|
||||||
|
Objects.toString(newEntity.getFilingTerritoryName(), "")));
|
||||||
|
}
|
||||||
|
// 备案单位
|
||||||
|
if (!Objects.equals(exist.getFilingUnitName(), newEntity.getFilingUnitName())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"备案单位",
|
||||||
|
Objects.toString(exist.getFilingUnitName(), ""),
|
||||||
|
Objects.toString(newEntity.getFilingUnitName(), "")));
|
||||||
|
}
|
||||||
|
// 备案单位类型编码
|
||||||
|
if (!Objects.equals(exist.getFilingUnitTypeCode(), newEntity.getFilingUnitTypeCode())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"备案单位类型编码",
|
||||||
|
Objects.toString(exist.getFilingUnitTypeCode(), ""),
|
||||||
|
Objects.toString(newEntity.getFilingUnitTypeCode(), "")));
|
||||||
|
}
|
||||||
|
// 备案单位类型名称
|
||||||
|
if (!Objects.equals(exist.getFilingUnitTypeName(), newEntity.getFilingUnitTypeName())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"备案单位类型名称",
|
||||||
|
Objects.toString(exist.getFilingUnitTypeName(), ""),
|
||||||
|
Objects.toString(newEntity.getFilingUnitTypeName(), "")));
|
||||||
|
}
|
||||||
|
// 备案编号
|
||||||
|
if (!Objects.equals(exist.getFilingNo(), newEntity.getFilingNo())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"备案编号",
|
||||||
|
Objects.toString(exist.getFilingNo(), ""),
|
||||||
|
Objects.toString(newEntity.getFilingNo(), "")));
|
||||||
|
}
|
||||||
|
// 备案安全评价业务范围
|
||||||
|
String existBusinessScope = exist.getBusinessScope();
|
||||||
|
String newBusinessScope = newEntity.getBusinessScope() != null ? String.join(",", newEntity.getBusinessScope()) : "";
|
||||||
|
if (!Objects.equals(existBusinessScope, newBusinessScope)) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"备案安全评价业务范围",
|
||||||
|
Objects.toString(existBusinessScope, ""),
|
||||||
|
newBusinessScope));
|
||||||
|
}
|
||||||
|
// 注册地址
|
||||||
|
if (!Objects.equals(exist.getRegisterAddress(), newEntity.getRegisterAddress())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"注册地址",
|
||||||
|
Objects.toString(exist.getRegisterAddress(), ""),
|
||||||
|
Objects.toString(newEntity.getRegisterAddress(), "")));
|
||||||
|
}
|
||||||
|
// 办公地址
|
||||||
|
if (!Objects.equals(exist.getOfficeAddress(), newEntity.getOfficeAddress())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"办公地址",
|
||||||
|
Objects.toString(exist.getOfficeAddress(), ""),
|
||||||
|
Objects.toString(newEntity.getOfficeAddress(), "")));
|
||||||
|
}
|
||||||
|
// 统一社会信用代码
|
||||||
|
if (!Objects.equals(exist.getCreditCode(), newEntity.getCreditCode())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"统一社会信用代码",
|
||||||
|
Objects.toString(exist.getCreditCode(), ""),
|
||||||
|
Objects.toString(newEntity.getCreditCode(), "")));
|
||||||
|
}
|
||||||
|
// 资质证书编号
|
||||||
|
if (!Objects.equals(exist.getQualCertNo(), newEntity.getQualCertNo())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"资质证书编号",
|
||||||
|
Objects.toString(exist.getQualCertNo(), ""),
|
||||||
|
Objects.toString(newEntity.getQualCertNo(), "")));
|
||||||
|
}
|
||||||
// 法定代表人
|
// 法定代表人
|
||||||
if (!Objects.equals(exist.getLegalRepresentative(), newEntity.getLegalRepresentative())) {
|
if (!Objects.equals(exist.getLegalRepresentative(), newEntity.getLegalRepresentative())) {
|
||||||
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
|
@ -635,6 +748,55 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
||||||
Objects.toString(exist.getLegalRepresentative(), ""),
|
Objects.toString(exist.getLegalRepresentative(), ""),
|
||||||
Objects.toString(newEntity.getLegalRepresentative(), "")));
|
Objects.toString(newEntity.getLegalRepresentative(), "")));
|
||||||
}
|
}
|
||||||
|
// 法人代表及电话
|
||||||
|
if (!Objects.equals(exist.getLegalPersonPhone(), newEntity.getLegalPersonPhone())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"法人代表及电话",
|
||||||
|
Objects.toString(exist.getLegalPersonPhone(), ""),
|
||||||
|
Objects.toString(newEntity.getLegalPersonPhone(), "")));
|
||||||
|
}
|
||||||
|
// 联系人
|
||||||
|
if (!Objects.equals(exist.getContactName(), newEntity.getContactName())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"联系人",
|
||||||
|
Objects.toString(exist.getContactName(), ""),
|
||||||
|
Objects.toString(newEntity.getContactName(), "")));
|
||||||
|
}
|
||||||
|
// 联系人及电话
|
||||||
|
if (!Objects.equals(exist.getContactPhone(), newEntity.getContactPhone())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"联系人及电话",
|
||||||
|
Objects.toString(exist.getContactPhone(), ""),
|
||||||
|
Objects.toString(newEntity.getContactPhone(), "")));
|
||||||
|
}
|
||||||
|
// 传真
|
||||||
|
if (!Objects.equals(exist.getFax(), newEntity.getFax())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"传真",
|
||||||
|
Objects.toString(exist.getFax(), ""),
|
||||||
|
Objects.toString(newEntity.getFax(), "")));
|
||||||
|
}
|
||||||
|
// 信息公开网址
|
||||||
|
if (!Objects.equals(exist.getInfoDisclosureUrl(), newEntity.getInfoDisclosureUrl())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"信息公开网址",
|
||||||
|
Objects.toString(exist.getInfoDisclosureUrl(), ""),
|
||||||
|
Objects.toString(newEntity.getInfoDisclosureUrl(), "")));
|
||||||
|
}
|
||||||
|
// 固定资产总值
|
||||||
|
if (!Objects.equals(exist.getFixedAssetAmount(), newEntity.getFixedAssetAmount())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"固定资产总值(单位:分)",
|
||||||
|
Objects.toString(exist.getFixedAssetAmount(), ""),
|
||||||
|
Objects.toString(newEntity.getFixedAssetAmount(), "")));
|
||||||
|
}
|
||||||
|
// 档案室面积(平方米)
|
||||||
|
if (!Objects.equals(exist.getArchiveRoomArea(), newEntity.getArchiveRoomArea())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"档案室面积(平方米)",
|
||||||
|
Objects.toString(exist.getArchiveRoomArea(), ""),
|
||||||
|
Objects.toString(newEntity.getArchiveRoomArea(), "")));
|
||||||
|
}
|
||||||
// 专职安全评价师数量(人)
|
// 专职安全评价师数量(人)
|
||||||
if (!Objects.equals(exist.getFulltimeEvaluatorCount(), newEntity.getFulltimeEvaluatorCount())) {
|
if (!Objects.equals(exist.getFulltimeEvaluatorCount(), newEntity.getFulltimeEvaluatorCount())) {
|
||||||
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
|
@ -649,6 +811,27 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
||||||
Objects.toString(exist.getRegisteredEngineerCount(), ""),
|
Objects.toString(exist.getRegisteredEngineerCount(), ""),
|
||||||
Objects.toString(newEntity.getRegisteredEngineerCount(), "")));
|
Objects.toString(newEntity.getRegisteredEngineerCount(), "")));
|
||||||
}
|
}
|
||||||
|
// 工作场所建筑面积(平方米)
|
||||||
|
if (!Objects.equals(exist.getWorkplaceArea(), newEntity.getWorkplaceArea())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"工作场所建筑面积(平方米)",
|
||||||
|
Objects.toString(exist.getWorkplaceArea(), ""),
|
||||||
|
Objects.toString(newEntity.getWorkplaceArea(), "")));
|
||||||
|
}
|
||||||
|
// 单位基本情况介绍
|
||||||
|
if (!Objects.equals(exist.getUnitIntro(), newEntity.getUnitIntro())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"单位基本情况介绍",
|
||||||
|
Objects.toString(exist.getUnitIntro(), ""),
|
||||||
|
Objects.toString(newEntity.getUnitIntro(), "")));
|
||||||
|
}
|
||||||
|
// 单位基本情况附件地址
|
||||||
|
if (!Objects.equals(exist.getAttachmentUrl(), newEntity.getAttachmentUrl())) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
|
||||||
|
"单位基本情况附件地址",
|
||||||
|
Objects.toString(exist.getAttachmentUrl(), ""),
|
||||||
|
Objects.toString(newEntity.getAttachmentUrl(), "")));
|
||||||
|
}
|
||||||
return details;
|
return details;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -705,6 +888,84 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
|
||||||
return details;
|
return details;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装备清单变更明细。
|
||||||
|
* existList 为原表 qual_filing_equipment 数据,newList 为本次提交的装备变更。
|
||||||
|
* 按 sourceEquipmentId 对比增减,对共有装备逐字段对比修改。
|
||||||
|
*/
|
||||||
|
private List<QualFilingChangeDetailDO> diffEquipment(Long changeId
|
||||||
|
, List<QualFilingEquipmentDO> existList, List<QualFilingEquipmentChangeE> newList) {
|
||||||
|
List<QualFilingChangeDetailDO> details = new ArrayList<>();
|
||||||
|
// 原始装备: sourceEquipmentId -> DO
|
||||||
|
Map<Long, QualFilingEquipmentDO> existingMap = safeList(existList).stream()
|
||||||
|
.filter(e -> e.getSourceEquipmentId() != null)
|
||||||
|
.collect(Collectors.toMap(QualFilingEquipmentDO::getSourceEquipmentId, e -> e, (a, b) -> a));
|
||||||
|
// 新装备: sourceEquipmentId -> ChangeE
|
||||||
|
Map<Long, QualFilingEquipmentChangeE> newMap = safeList(newList).stream()
|
||||||
|
.filter(e -> e.getSourceEquipmentId() != null)
|
||||||
|
.collect(Collectors.toMap(QualFilingEquipmentChangeE::getSourceEquipmentId, e -> e, (a, b) -> a));
|
||||||
|
|
||||||
|
// 增加
|
||||||
|
for (Map.Entry<Long, QualFilingEquipmentChangeE> entry : newMap.entrySet()) {
|
||||||
|
if (!existingMap.containsKey(entry.getKey())) {
|
||||||
|
QualFilingEquipmentChangeE e = entry.getValue();
|
||||||
|
String desc = equipmentDesc(e.getDeviceName(), e.getDeviceModel());
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.EQUIPMENT, "装备清单变更",
|
||||||
|
"增加", "", desc));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 减少
|
||||||
|
for (Map.Entry<Long, QualFilingEquipmentDO> entry : existingMap.entrySet()) {
|
||||||
|
if (!newMap.containsKey(entry.getKey())) {
|
||||||
|
QualFilingEquipmentDO e = entry.getValue();
|
||||||
|
String desc = equipmentDesc(e.getDeviceName(), e.getDeviceModel());
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.EQUIPMENT, "装备清单变更",
|
||||||
|
"减少", desc, ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 修改(逐字段对比)
|
||||||
|
for (Map.Entry<Long, QualFilingEquipmentChangeE> entry : newMap.entrySet()) {
|
||||||
|
QualFilingEquipmentDO oldE = existingMap.get(entry.getKey());
|
||||||
|
if (oldE == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
QualFilingEquipmentChangeE newE = entry.getValue();
|
||||||
|
String prefix = equipmentDesc(oldE.getDeviceName(), oldE.getDeviceModel());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "设备名称", oldE.getDeviceName(), newE.getDeviceName());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "设备型号", oldE.getDeviceModel(), newE.getDeviceModel());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "仪器类型编码", oldE.getInstrumentTypeCode(), newE.getInstrumentTypeCode());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "仪器类型名称", oldE.getInstrumentTypeName(), newE.getInstrumentTypeName());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "设备类型编码", oldE.getDeviceTypeCode(), newE.getDeviceTypeCode());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "设备类型名称", oldE.getDeviceTypeName(), newE.getDeviceTypeName());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "厂家", oldE.getManufacturer(), newE.getManufacturer());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "设备价值", oldE.getEquipmentValue(), newE.getEquipmentValue());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "设备流量说明", oldE.getFlowDesc(), newE.getFlowDesc());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "最小流量", oldE.getMinFlow(), newE.getMinFlow());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "最大流量", oldE.getMaxFlow(), newE.getMaxFlow());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "校准单位", oldE.getCalibrationUnit(), newE.getCalibrationUnit());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "校准初始值", oldE.getCalibrationInitValue(), newE.getCalibrationInitValue());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "现场校验类型编码", oldE.getFieldCalibrationTypeCode(), newE.getFieldCalibrationTypeCode());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "现场校验类型名称", oldE.getFieldCalibrationTypeName(), newE.getFieldCalibrationTypeName());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "是否双路", oldE.getDualChannelFlag(), newE.getDualChannelFlag());
|
||||||
|
diffEquipmentField(details, changeId, prefix, "计量检定报告地址", oldE.getCalibrationReportUrl(), newE.getCalibrationReportUrl());
|
||||||
|
}
|
||||||
|
return details;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void diffEquipmentField(List<QualFilingChangeDetailDO> details, Long changeId,
|
||||||
|
String prefix, String fieldName, Object before, Object after) {
|
||||||
|
if (!Objects.equals(before, after)) {
|
||||||
|
details.add(fieldDetail(changeId, QualFilingFormStepEnum.EQUIPMENT, "装备清单变更",
|
||||||
|
prefix + "-" + fieldName,
|
||||||
|
Objects.toString(before, ""),
|
||||||
|
Objects.toString(after, "")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String equipmentDesc(String deviceName, String deviceModel) {
|
||||||
|
return Objects.toString(deviceName, "") + (deviceModel != null ? "(" + deviceModel + ")" : "");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理人员变更明细。
|
* 管理人员变更明细。
|
||||||
* existList 为从 qual_filing_personnel 关联 org_personnel 查出的管理人员,newList 为本次提交的人员变更。
|
* existList 为从 qual_filing_personnel 关联 org_personnel 查出的管理人员,newList 为本次提交的人员变更。
|
||||||
|
|
|
||||||
|
|
@ -185,8 +185,9 @@ public class QualFilingExecutor implements QualFilingApi {
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public SingleResponse<List<QualFilingComplianceCheckResultCO>> aggregationSaveOrEdit(AggregationSaveOrEditQualFilingCmd cmd) {
|
public SingleResponse<List<QualFilingComplianceCheckResultCO>> aggregationSaveOrEdit(AggregationSaveOrEditQualFilingCmd cmd) {
|
||||||
if (cmd.getQualFilingAddCmd().getFilingStatusCode() != null
|
boolean nonDraft = cmd.getQualFilingAddCmd().getFilingStatusCode() != null
|
||||||
&& cmd.getQualFilingAddCmd().getFilingStatusCode() != QualFilingStatusEnum.DRAFT.getCode()) {
|
&& cmd.getQualFilingAddCmd().getFilingStatusCode() != QualFilingStatusEnum.DRAFT.getCode();
|
||||||
|
if (nonDraft) {
|
||||||
List<QualFilingComplianceCheckResultCO> complianceResults = ComplianceCheckUtil.complianceCheck(cmd, false);
|
List<QualFilingComplianceCheckResultCO> complianceResults = ComplianceCheckUtil.complianceCheck(cmd, false);
|
||||||
complianceResults = complianceResults.stream()
|
complianceResults = complianceResults.stream()
|
||||||
.filter(r -> QualFilingComplianceCheckEnum.STATUS_FAIL.equals(r.getStatus()))
|
.filter(r -> QualFilingComplianceCheckEnum.STATUS_FAIL.equals(r.getStatus()))
|
||||||
|
|
@ -198,12 +199,14 @@ public class QualFilingExecutor implements QualFilingApi {
|
||||||
// 新增时校验:用当前id查询记录获取org_id,若同机构已存在其他资质备案记录则不允许新增
|
// 新增时校验:用当前id查询记录获取org_id,若同机构已存在其他资质备案记录则不允许新增
|
||||||
Long currentId = cmd.getQualFilingAddCmd().getId();
|
Long currentId = cmd.getQualFilingAddCmd().getId();
|
||||||
if (currentId == null) {
|
if (currentId == null) {
|
||||||
Long count = qualFilingMapper.selectCount(new LambdaQueryWrapper<QualFilingDO>()
|
QualFilingDO one = qualFilingMapper.selectOne(new LambdaQueryWrapper<QualFilingDO>()
|
||||||
|
.select(QualFilingDO::getId)
|
||||||
.eq(QualFilingDO::getOrgId, ThreadLocalUserInfoAdapter.getOrgId())
|
.eq(QualFilingDO::getOrgId, ThreadLocalUserInfoAdapter.getOrgId())
|
||||||
.eq(QualFilingDO::getDeleteEnum, BooleanQAEnum.FALSE.getValue()));
|
.eq(QualFilingDO::getDeleteEnum, BooleanQAEnum.FALSE.getValue()));
|
||||||
if (count != null && count > 0) {
|
if (nonDraft && one != null) {
|
||||||
throw new BizException(ErrorCode.QUAL_FILING_ALREADY_EXISTS);
|
throw new BizException(ErrorCode.QUAL_FILING_ALREADY_EXISTS);
|
||||||
}
|
}
|
||||||
|
cmd.getQualFilingAddCmd().setId(one != null ? one.getId() : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
QualFilingCO co = qualFilingAddCmdConvertor.convertFilingCmdToCO(cmd.getQualFilingAddCmd());
|
QualFilingCO co = qualFilingAddCmdConvertor.convertFilingCmdToCO(cmd.getQualFilingAddCmd());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue