|
|
@ -1185,12 +1185,21 @@ public class HarvestBatchServiceImpl implements HarvestBatchService {
|
|
|
|
|
|
|
|
|
|
|
|
PreviewRespVO previewResp = new PreviewRespVO();
|
|
|
|
PreviewRespVO previewResp = new PreviewRespVO();
|
|
|
|
previewResp.setBlockState(harvestBatch.getBlockState());
|
|
|
|
previewResp.setBlockState(harvestBatch.getBlockState());
|
|
|
|
|
|
|
|
if (harvestBatch.getTemplateId() != null) {
|
|
|
|
// 查询模板
|
|
|
|
// 查询模板
|
|
|
|
UniTemplateDTO uniTemplateDTO = uniTemplateApi.getTemplateById(harvestBatch.getTemplateId()).getData();
|
|
|
|
UniTemplateDTO uniTemplateDTO = uniTemplateApi.getTemplateById(harvestBatch.getTemplateId()).getData();
|
|
|
|
|
|
|
|
if (uniTemplateDTO == null) {
|
|
|
|
|
|
|
|
throw ServiceExceptionUtil.exception(ErrorCodeConstants.CAN_NOT_FIND__UNI_TEMPLATE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
previewResp.setUniTemplate(uniTemplateDTO);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// 查询默认模板
|
|
|
|
|
|
|
|
UniTemplateDTO uniTemplateDTO = uniTemplateApi.getDefaultTemplate().getData();
|
|
|
|
if (uniTemplateDTO == null) {
|
|
|
|
if (uniTemplateDTO == null) {
|
|
|
|
throw ServiceExceptionUtil.exception(ErrorCodeConstants.CAN_NOT_FIND_DEFAULT_UNI_TEMPLATE);
|
|
|
|
throw ServiceExceptionUtil.exception(ErrorCodeConstants.CAN_NOT_FIND_DEFAULT_UNI_TEMPLATE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
previewResp.setUniTemplate(uniTemplateDTO);
|
|
|
|
previewResp.setUniTemplate(uniTemplateDTO);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.getAndSetBlockCertificateData(harvestBatch, previewResp, Boolean.FALSE, languageTypeId);
|
|
|
|
this.getAndSetBlockCertificateData(harvestBatch, previewResp, Boolean.FALSE, languageTypeId);
|
|
|
|
return previewResp;
|
|
|
|
return previewResp;
|
|
|
@ -1388,11 +1397,21 @@ public class HarvestBatchServiceImpl implements HarvestBatchService {
|
|
|
|
public void updateHarvestBatchConfig(HarvestBatchConfigSaveReqVO saveReqVO) {
|
|
|
|
public void updateHarvestBatchConfig(HarvestBatchConfigSaveReqVO saveReqVO) {
|
|
|
|
// 获得数据库已有的配置信息
|
|
|
|
// 获得数据库已有的配置信息
|
|
|
|
HarvestBatchConfigRespVO configRespVO = this.getHarvestBatchConfig(saveReqVO.getId(), saveReqVO.getLanguageTypeId());
|
|
|
|
HarvestBatchConfigRespVO configRespVO = this.getHarvestBatchConfig(saveReqVO.getId(), saveReqVO.getLanguageTypeId());
|
|
|
|
|
|
|
|
// 校验所选的模板是否存在
|
|
|
|
|
|
|
|
UniTemplateDTO templateDTO = uniTemplateApi.getTemplateById(saveReqVO.getTemplateId()).getData();
|
|
|
|
|
|
|
|
if (templateDTO == null) {
|
|
|
|
|
|
|
|
throw ServiceExceptionUtil.exception(ErrorCodeConstants.SELECTED_UNI_TEMPLATE_NOT_EXITS);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取数据库对应的批次配置
|
|
|
|
|
|
|
|
HarvestBatchConfigDO harvestBatchConfig = harvestBatchConfigMapper.selectOne(new LambdaQueryWrapperX<HarvestBatchConfigDO>()
|
|
|
|
|
|
|
|
.eq(HarvestBatchConfigDO::getHarvestBatchId, configRespVO.getHarvestBatchId()).eq(HarvestBatchConfigDO::getLanguageTypeId, saveReqVO.getLanguageTypeId()));
|
|
|
|
|
|
|
|
|
|
|
|
HarvestBatchRespVO harvestBatch = new HarvestBatchRespVO();
|
|
|
|
HarvestBatchRespVO harvestBatch = new HarvestBatchRespVO();
|
|
|
|
BeanUtil.copyProperties(configRespVO, harvestBatch);
|
|
|
|
BeanUtil.copyProperties(configRespVO, harvestBatch);
|
|
|
|
// 获取环境配置
|
|
|
|
// 获取环境配置
|
|
|
|
List<EnvTypeDeviceConfigRespVO> envTypeConfigs = envTypeService.getEnvTypeConfigGroupByLandId(harvestBatch.getBelongBusinessId());
|
|
|
|
List<EnvTypeDeviceConfigRespVO> envTypeConfigs = envTypeService.getEnvTypeConfigGroupByLandId(harvestBatch.getBelongBusinessId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Long> willUpdateVerifyIds = new ArrayList<>();// 将要更新的商品认证id集合
|
|
|
|
List<Long> willUpdateVerifyIds = new ArrayList<>();// 将要更新的商品认证id集合
|
|
|
|
Map<Long, BlockCertificateSaveReqVO> verifyDBMaps = new HashMap<>(); // 数据库中已有的商品认证信息配置
|
|
|
|
Map<Long, BlockCertificateSaveReqVO> verifyDBMaps = new HashMap<>(); // 数据库中已有的商品认证信息配置
|
|
|
|
configRespVO.getGoodsVerifys().forEach(verify -> verifyDBMaps.put(verify.getId(), verify));
|
|
|
|
configRespVO.getGoodsVerifys().forEach(verify -> verifyDBMaps.put(verify.getId(), verify));
|
|
|
@ -2059,6 +2078,18 @@ public class HarvestBatchServiceImpl implements HarvestBatchService {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (harvestBatchConfig != null) {
|
|
|
|
|
|
|
|
harvestBatchConfig.setTemplateId(saveReqVO.getTemplateId());
|
|
|
|
|
|
|
|
// 插入批次配置表
|
|
|
|
|
|
|
|
harvestBatchConfigMapper.updateById(harvestBatchConfig);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
harvestBatchConfig = new HarvestBatchConfigDO();
|
|
|
|
|
|
|
|
harvestBatchConfig.setTemplateId(saveReqVO.getTemplateId());
|
|
|
|
|
|
|
|
harvestBatchConfig.setHarvestBatchId(configRespVO.getHarvestBatchId());
|
|
|
|
|
|
|
|
harvestBatchConfig.setLanguageTypeId(saveReqVO.getLanguageTypeId());
|
|
|
|
|
|
|
|
harvestBatchConfigMapper.insert(harvestBatchConfig);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(!deleteCertificateIds.isEmpty()) {
|
|
|
|
if(!deleteCertificateIds.isEmpty()) {
|
|
|
|
blockCertificateApi.deleteBlockCertificateBatch(deleteCertificateIds);
|
|
|
|
blockCertificateApi.deleteBlockCertificateBatch(deleteCertificateIds);
|
|
|
|
}
|
|
|
|
}
|
|
|
|