|
|
|
@ -1,13 +1,21 @@
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesConfigService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesConfig;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesConfigRepository;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description:
|
|
|
|
@ -55,4 +63,23 @@ public class MesConfigService implements IMesConfigService {
|
|
|
|
|
}
|
|
|
|
|
return config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean checkCfgValueIsContainItem(String orginzeCode, String cfgCode, String cfgKey, String cfgType, String splitStr, String item) {
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(orginzeCode);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(cfgCode, MesPcnExtConstWords.CFG_CODE, packBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(cfgKey, MesPcnExtConstWords.CFG_KEY, packBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(cfgType, MesPcnExtConstWords.CFG_TYPE, packBean);
|
|
|
|
|
MesConfig config = configRepository.getByProperty(packBean);
|
|
|
|
|
if (null == config || StringUtils.isEmpty(config.getCfgValue())) return false;
|
|
|
|
|
List<String> cfgValueList = Arrays.asList(config.getCfgValue().split(splitStr));
|
|
|
|
|
return (!CollectionUtils.isEmpty(cfgValueList) && cfgValueList.contains(item)) ? true : false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean checkShardingTablesObjectCfg(String orginzeCode, String cfgKey, String item) {
|
|
|
|
|
return checkCfgValueIsContainItem(orginzeCode, MesPcnExtConstWords.MES_SHARDING_TABLES_OBJECT_CFG, cfgKey, CommonEnumUtil.SOFT_TYPE.MES_PCN.name(), MesPcnExtConstWords.SEMICOLON, item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|