mirror of
https://github.com/weizhiqiang1995/erp-pro.git
synced 2025-02-21 22:13:31 +08:00
属性代码更新
This commit is contained in:
parent
e6fdcd0163
commit
9f2a6ac0d5
3 changed files with 41 additions and 17 deletions
|
@ -20,12 +20,14 @@ import java.util.Map;
|
|||
*/
|
||||
public interface AttrTransformTableService extends SkyeyeBusinessService<AttrTransformTable> {
|
||||
|
||||
void saveAttrTransformTable(String serviceClassName, String parentAttrKey, List<AttrTransformTable> attrTransformTableList);
|
||||
void saveAttrTransformTable(String parentServiceClassName, String parentAttrKey, List<AttrTransformTable> attrTransformTableList);
|
||||
|
||||
void deleteAttrTransformTable(String serviceClassName, String parentAttrKey);
|
||||
void deleteAttrTransformTable(String parentServiceClassName, String parentAttrKey);
|
||||
|
||||
List<AttrTransformTable> queryAttrTransformTable(String serviceClassName, String parentAttrKey);
|
||||
List<AttrTransformTable> queryAttrTransformTable(String parentServiceClassName, String parentAttrKey);
|
||||
|
||||
Map<String, List<AttrTransformTable>> queryAttrTransformTable(String serviceClassName, List<String> parentAttrKey);
|
||||
Map<String, List<AttrTransformTable>> queryAttrTransformTable(String parentServiceClassName, List<String> parentAttrKey);
|
||||
|
||||
List<String> queryParentServiceName(String serviceClassName, String attrKey);
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
package com.skyeye.attr.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.skyeye.attr.dao.AttrDefinitionCustomDao;
|
||||
|
@ -11,6 +12,7 @@ import com.skyeye.attr.entity.AttrDefinition;
|
|||
import com.skyeye.attr.entity.AttrDefinitionCustom;
|
||||
import com.skyeye.attr.service.AttrDefinitionCustomService;
|
||||
import com.skyeye.attr.service.AttrDefinitionService;
|
||||
import com.skyeye.attr.service.AttrTransformTableService;
|
||||
import com.skyeye.attr.service.IAttrTransformService;
|
||||
import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl;
|
||||
import com.skyeye.common.constans.CommonNumConstants;
|
||||
|
@ -41,11 +43,22 @@ public class AttrDefinitionCustomServiceImpl extends SkyeyeBusinessServiceImpl<A
|
|||
@Autowired
|
||||
private IAttrTransformService iAttrTransformService;
|
||||
|
||||
@Autowired
|
||||
private AttrTransformTableService attrTransformTableService;
|
||||
|
||||
@Override
|
||||
public void writePostpose(AttrDefinitionCustom entity, String userId) {
|
||||
super.writePostpose(entity, userId);
|
||||
// 1. 删除当前业务对象的工作流缓存属性信息
|
||||
String cacheKey = iAttrTransformService.getCacheKey(entity.getClassName(), "*");
|
||||
jedisClientService.delKeys(cacheKey);
|
||||
// 2. 获取该业务对象所属父类的信息
|
||||
List<String> list = attrTransformTableService.queryParentServiceName(entity.getClassName(), entity.getAttrKey());
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
list.forEach(str -> {
|
||||
jedisClientService.delKeys(iAttrTransformService.getCacheKey(str, "*"));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,15 +39,15 @@ public class AttrTransformTableServiceImpl extends SkyeyeBusinessServiceImpl<Att
|
|||
/**
|
||||
* 批量保存表格模型属性
|
||||
*
|
||||
* @param serviceClassName
|
||||
* @param parentServiceClassName
|
||||
* @param parentAttrKey
|
||||
* @param attrTransformTableList
|
||||
*/
|
||||
@Override
|
||||
public void saveAttrTransformTable(String serviceClassName, String parentAttrKey, List<AttrTransformTable> attrTransformTableList) {
|
||||
deleteAttrTransformTable(serviceClassName, parentAttrKey);
|
||||
public void saveAttrTransformTable(String parentServiceClassName, String parentAttrKey, List<AttrTransformTable> attrTransformTableList) {
|
||||
deleteAttrTransformTable(parentServiceClassName, parentAttrKey);
|
||||
attrTransformTableList.forEach(attrTransformTable -> {
|
||||
attrTransformTable.setParentClassName(serviceClassName);
|
||||
attrTransformTable.setParentClassName(parentServiceClassName);
|
||||
attrTransformTable.setParentAttrKey(parentAttrKey);
|
||||
});
|
||||
String userId = InputObject.getLogParamsStatic().get("id").toString();
|
||||
|
@ -57,13 +57,13 @@ public class AttrTransformTableServiceImpl extends SkyeyeBusinessServiceImpl<Att
|
|||
/**
|
||||
* 根据父节点的属性字段删除表格模型属性
|
||||
*
|
||||
* @param serviceClassName
|
||||
* @param parentServiceClassName
|
||||
* @param parentAttrKey
|
||||
*/
|
||||
@Override
|
||||
public void deleteAttrTransformTable(String serviceClassName, String parentAttrKey) {
|
||||
public void deleteAttrTransformTable(String parentServiceClassName, String parentAttrKey) {
|
||||
QueryWrapper<AttrTransformTable> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(MybatisPlusUtil.toColumns(AttrTransformTable::getParentClassName), serviceClassName);
|
||||
queryWrapper.eq(MybatisPlusUtil.toColumns(AttrTransformTable::getParentClassName), parentServiceClassName);
|
||||
queryWrapper.eq(MybatisPlusUtil.toColumns(AttrTransformTable::getParentAttrKey), parentAttrKey);
|
||||
remove(queryWrapper);
|
||||
}
|
||||
|
@ -71,14 +71,14 @@ public class AttrTransformTableServiceImpl extends SkyeyeBusinessServiceImpl<Att
|
|||
/**
|
||||
* 根据父节点的属性字段查询表格模型属性
|
||||
*
|
||||
* @param serviceClassName
|
||||
* @param parentServiceClassName
|
||||
* @param parentAttrKey
|
||||
*/
|
||||
@Override
|
||||
public List<AttrTransformTable> queryAttrTransformTable(String serviceClassName, String parentAttrKey) {
|
||||
public List<AttrTransformTable> queryAttrTransformTable(String parentServiceClassName, String parentAttrKey) {
|
||||
QueryWrapper<AttrTransformTable> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.orderByAsc(MybatisPlusUtil.toColumns(AttrTransformTable::getOrderBy));
|
||||
queryWrapper.eq(MybatisPlusUtil.toColumns(AttrTransformTable::getParentClassName), serviceClassName);
|
||||
queryWrapper.eq(MybatisPlusUtil.toColumns(AttrTransformTable::getParentClassName), parentServiceClassName);
|
||||
queryWrapper.eq(MybatisPlusUtil.toColumns(AttrTransformTable::getParentAttrKey), parentAttrKey);
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
@ -86,14 +86,14 @@ public class AttrTransformTableServiceImpl extends SkyeyeBusinessServiceImpl<Att
|
|||
/**
|
||||
* 根据父节点的属性字段查询表格模型属性
|
||||
*
|
||||
* @param serviceClassName
|
||||
* @param parentServiceClassName
|
||||
* @param parentAttrKey
|
||||
*/
|
||||
@Override
|
||||
public Map<String, List<AttrTransformTable>> queryAttrTransformTable(String serviceClassName, List<String> parentAttrKey) {
|
||||
public Map<String, List<AttrTransformTable>> queryAttrTransformTable(String parentServiceClassName, List<String> parentAttrKey) {
|
||||
QueryWrapper<AttrTransformTable> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.orderByAsc(MybatisPlusUtil.toColumns(AttrTransformTable::getOrderBy));
|
||||
queryWrapper.eq(MybatisPlusUtil.toColumns(AttrTransformTable::getParentClassName), serviceClassName);
|
||||
queryWrapper.eq(MybatisPlusUtil.toColumns(AttrTransformTable::getParentClassName), parentServiceClassName);
|
||||
queryWrapper.in(MybatisPlusUtil.toColumns(AttrTransformTable::getParentAttrKey), parentAttrKey);
|
||||
List<AttrTransformTable> attrTransformTableList = list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(attrTransformTableList)) {
|
||||
|
@ -114,4 +114,13 @@ public class AttrTransformTableServiceImpl extends SkyeyeBusinessServiceImpl<Att
|
|||
return attrTransformTableList.stream().collect(Collectors.groupingBy(AttrTransformTable::getParentAttrKey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryParentServiceName(String serviceClassName, String attrKey) {
|
||||
QueryWrapper<AttrTransformTable> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(MybatisPlusUtil.toColumns(AttrTransformTable::getClassName), serviceClassName);
|
||||
queryWrapper.eq(MybatisPlusUtil.toColumns(AttrTransformTable::getAttrKey), attrKey);
|
||||
List<AttrTransformTable> attrTransformTableList = list(queryWrapper);
|
||||
return attrTransformTableList.stream().map(AttrTransformTable::getParentClassName).distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue