【feat】增加判断对象是否可创建字段逻辑
This commit is contained in:
parent
87f1863d01
commit
1e91bbb67b
@ -0,0 +1,46 @@
|
|||||||
|
package com.celnet.datadump.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Kris
|
||||||
|
* @date 2025/07/10
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("metaclass_config")
|
||||||
|
@ApiModel(value = "元数据对象表")
|
||||||
|
public class MetaclassConfig implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代码
|
||||||
|
*/
|
||||||
|
@TableId("name")
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 值
|
||||||
|
*/
|
||||||
|
@TableField("label")
|
||||||
|
@ApiModelProperty(value = "标签")
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("remark")
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.celnet.datadump.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.celnet.datadump.entity.MetaclassConfig;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface MetaclassConfigMapper extends BaseMapper<MetaclassConfig> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package com.celnet.datadump.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.celnet.datadump.entity.MetaclassConfig;
|
||||||
|
|
||||||
|
public interface MetaclassConfigService extends IService<MetaclassConfig> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -81,6 +81,8 @@ public class CommonServiceImpl implements CommonService {
|
|||||||
private DataReportDetailService dataReportDetailService;
|
private DataReportDetailService dataReportDetailService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SalesforceTargetConnect salesforceTargetConnect;
|
private SalesforceTargetConnect salesforceTargetConnect;
|
||||||
|
@Autowired
|
||||||
|
private MetaclassConfigService metaclassConfigService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ReturnT<String> increment(SalesforceParam param) throws Exception {
|
public ReturnT<String> increment(SalesforceParam param) throws Exception {
|
||||||
@ -818,6 +820,11 @@ public class CommonServiceImpl implements CommonService {
|
|||||||
// 加个锁 避免重复执行创建api
|
// 加个锁 避免重复执行创建api
|
||||||
reentrantLock.lock();
|
reentrantLock.lock();
|
||||||
log.info("check api:{}", apiName);
|
log.info("check api:{}", apiName);
|
||||||
|
|
||||||
|
QueryWrapper<MetaclassConfig> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("name",apiName);
|
||||||
|
long count = metaclassConfigService.count(queryWrapper);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
boolean hasCreatedDate = false;
|
boolean hasCreatedDate = false;
|
||||||
|
|
||||||
@ -1035,6 +1042,9 @@ public class CommonServiceImpl implements CommonService {
|
|||||||
update.setName(apiName);
|
update.setName(apiName);
|
||||||
update.setLastUpdateDate(endCreateDate);
|
update.setLastUpdateDate(endCreateDate);
|
||||||
update.setBlobField(blobField);
|
update.setBlobField(blobField);
|
||||||
|
if (count>0){
|
||||||
|
update.setIsEditable(false);
|
||||||
|
}
|
||||||
dataObjectService.saveOrUpdate(update);
|
dataObjectService.saveOrUpdate(update);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.celnet.datadump.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.celnet.datadump.entity.MetaclassConfig;
|
||||||
|
import com.celnet.datadump.mapper.MetaclassConfigMapper;
|
||||||
|
import com.celnet.datadump.service.MetaclassConfigService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MetaclassConfigServiceImpl extends ServiceImpl<MetaclassConfigMapper, MetaclassConfig> implements MetaclassConfigService {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user