站点配置参数获取的方法化
This commit is contained in:
parent
00103789d7
commit
16c396b577
|
|
@ -5,6 +5,6 @@ package com.bonus.common.biz.constant;
|
||||||
* @author bonus
|
* @author bonus
|
||||||
*/
|
*/
|
||||||
public class BmConfigItems {
|
public class BmConfigItems {
|
||||||
public final String LEASE_AUDIT_ROLE_KEYS = "LeaseAuditRoleKeys";
|
public static final String LEASE_AUDIT_ROLE_KEYS = "LeaseAuditRoleKeys";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,14 @@ public interface BmConfigMapper
|
||||||
*/
|
*/
|
||||||
public BmConfig selectBmConfigById(Long id);
|
public BmConfig selectBmConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询功能参数配置
|
||||||
|
*
|
||||||
|
* @param itemName 功能参数配置名称
|
||||||
|
* @return 功能参数配置
|
||||||
|
*/
|
||||||
|
public BmConfig selectBmConfigByItemName(String itemName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询功能参数配置列表
|
* 查询功能参数配置列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
package com.bonus.material.basic.service.impl;
|
package com.bonus.material.basic.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.common.biz.constant.BmConfigItems;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.basic.mapper.BmConfigMapper;
|
import com.bonus.material.basic.mapper.BmConfigMapper;
|
||||||
|
|
@ -93,4 +96,17 @@ public class BmConfigServiceImpl implements IBmConfigService
|
||||||
{
|
{
|
||||||
return bmConfigMapper.deleteBmConfigById(id);
|
return bmConfigMapper.deleteBmConfigById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getValueWithDefault (String value1, String value2) {
|
||||||
|
if (StringUtils.isEmpty(value1)) {
|
||||||
|
return value2;
|
||||||
|
} else {
|
||||||
|
return value1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLeaseAuditRoleKeys() {
|
||||||
|
String value = bmConfigMapper.selectBmConfigByItemName(BmConfigItems.LEASE_AUDIT_ROLE_KEYS).getItemValue();
|
||||||
|
return getValueWithDefault(value, "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<include refid="selectBmConfigVo"/>
|
<include refid="selectBmConfigVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBmConfigByItemName" parameterType="String" resultMap="BmConfigResult">
|
||||||
|
<include refid="selectBmConfigVo"/>
|
||||||
|
where itemName = #{itemName}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertBmConfig" parameterType="com.bonus.material.basic.domain.BmConfig" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertBmConfig" parameterType="com.bonus.material.basic.domain.BmConfig" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into bm_config
|
insert into bm_config
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue