站点配置
This commit is contained in:
parent
3280775f5d
commit
7bccf14ef2
|
|
@ -0,0 +1,69 @@
|
|||
package mybatis.bm;
|
||||
|
||||
import com.bonus.bm.beans.BmConfigBean;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 功能参数配置Mapper接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
*/
|
||||
public interface BmConfigMapper
|
||||
{
|
||||
/**
|
||||
* 查询功能参数配置
|
||||
*
|
||||
* @param id 功能参数配置主键
|
||||
* @return 功能参数配置
|
||||
*/
|
||||
public BmConfigBean selectBmConfigBeanById(Long id);
|
||||
|
||||
/**
|
||||
* 查询功能参数配置
|
||||
*
|
||||
* @param itemName 功能参数配置名称
|
||||
* @return 功能参数配置
|
||||
*/
|
||||
public BmConfigBean selectBmConfigBeanByItemName(String itemName);
|
||||
|
||||
/**
|
||||
* 查询功能参数配置列表
|
||||
*
|
||||
* @param BmConfigBean 功能参数配置
|
||||
* @return 功能参数配置集合
|
||||
*/
|
||||
public List<BmConfigBean> selectBmConfigBeanList(BmConfigBean BmConfigBean);
|
||||
|
||||
/**
|
||||
* 新增功能参数配置
|
||||
*
|
||||
* @param BmConfigBean 功能参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBmConfigBean(BmConfigBean BmConfigBean);
|
||||
|
||||
/**
|
||||
* 修改功能参数配置
|
||||
*
|
||||
* @param BmConfigBean 功能参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBmConfigBean(BmConfigBean BmConfigBean);
|
||||
|
||||
/**
|
||||
* 删除功能参数配置
|
||||
*
|
||||
* @param id 功能参数配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmConfigBeanById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除功能参数配置
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBmConfigBeanByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package com.bonus.bm.beans;
|
||||
|
||||
/**
|
||||
* 功能参数配置对象 bm_config
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
*/
|
||||
|
||||
public class BmConfigBean {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 参数主键 */
|
||||
private Long id;
|
||||
|
||||
/** 参数键名 */
|
||||
private String itemName;
|
||||
|
||||
/** 参数键值 */
|
||||
private String itemValue;
|
||||
|
||||
private String createBy;
|
||||
|
||||
private String createTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
private String updateTime;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public void setItemName(String itemName) {
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getItemValue() {
|
||||
return itemValue;
|
||||
}
|
||||
|
||||
public void setItemValue(String itemValue) {
|
||||
this.itemValue = itemValue;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
public String getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(String updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.bonus.bm.controller;
|
||||
|
||||
import com.bonus.bm.beans.BmConfigBean;
|
||||
import com.bonus.bm.service.BmConfigService;
|
||||
import com.bonus.sys.AjaxRes;
|
||||
import com.bonus.sys.BaseController;
|
||||
import com.bonus.sys.GlobalConst;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/bm_config")
|
||||
public class BmConfigController extends BaseController<BmConfigBean> {
|
||||
|
||||
@Autowired
|
||||
private BmConfigService service;
|
||||
|
||||
/**
|
||||
* 查询功能参数配置列表
|
||||
*/
|
||||
// @RequestMapping(value = "list")
|
||||
// public TableDataInfo list(BmConfigBean bmConfig)
|
||||
// {
|
||||
// startPage();
|
||||
// List<BmConfigBean> list = bmConfigService.selectBmConfigList(bmConfig);
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
|
||||
@RequestMapping(value = "find", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes find(BmConfigBean o) {
|
||||
AjaxRes ar = getAjaxRes();
|
||||
try {
|
||||
List<BmConfigBean> list = service.find(o);
|
||||
BmConfigBean bmConfigBean = list.get(0);
|
||||
ar.setSucceed(bmConfigBean);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value="update", method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes update(BmConfigBean o){
|
||||
AjaxRes ar=getAjaxRes();
|
||||
try {
|
||||
service.update(o);
|
||||
ar.setSucceedMsg(GlobalConst.UPDATE_SUCCEED);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(),e);
|
||||
ar.setFailMsg(GlobalConst.UPDATE_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value="add", method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes add(BmConfigBean o){
|
||||
AjaxRes ar=getAjaxRes();
|
||||
try {
|
||||
service.insert(o);
|
||||
ar.setSucceedMsg(GlobalConst.SAVE_SUCCEED);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(),e);
|
||||
ar.setFailMsg(GlobalConst.SAVE_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value="del", method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxRes del(BmConfigBean o){
|
||||
AjaxRes ar=getAjaxRes();
|
||||
try {
|
||||
service.delete(o);
|
||||
ar.setSucceedMsg(GlobalConst.DEL_SUCCEED);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(),e);
|
||||
ar.setFailMsg(GlobalConst.DEL_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.bonus.bm.dao;
|
||||
|
||||
import com.bonus.bm.beans.BmConfigBean;
|
||||
import com.bonus.core.BonusBatis;
|
||||
import com.bonus.sys.BaseDao;
|
||||
|
||||
|
||||
@BonusBatis
|
||||
public interface BmConfigDao extends BaseDao<BmConfigBean>{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.bonus.bm.service;
|
||||
|
||||
import com.bonus.bm.beans.BmConfigBean;
|
||||
import com.bonus.sys.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface BmConfigService extends BaseService<BmConfigBean> {
|
||||
|
||||
List<String> getLeaseTaskAuditRoleKeys();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.bonus.bm.service;
|
||||
|
||||
import com.bonus.bm.beans.BmConfigBean;
|
||||
import com.bonus.bm.dao.BmConfigDao;
|
||||
import com.bonus.sys.BaseServiceImp;
|
||||
import com.bonus.sys.GlobalConst;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Service("bmConfigServiceImp")
|
||||
public class BmConfigServiceImp extends BaseServiceImp<BmConfigBean> implements BmConfigService {
|
||||
|
||||
@Autowired
|
||||
BmConfigDao bmConfigDao;
|
||||
|
||||
private String getValueWithDefault (String value1, String value2) {
|
||||
if (StringUtils.isEmpty(value1)) {
|
||||
return value2;
|
||||
} else {
|
||||
return value1;
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getLeaseTaskAuditRoleKeys() {
|
||||
List<String> list = new ArrayList();
|
||||
BmConfigBean bmConfig = new BmConfigBean();
|
||||
bmConfig.setItemName(GlobalConst.LEASE_TASK_AUDIT_ROLE_KEYS);
|
||||
List<BmConfigBean> bmConfigs = bmConfigDao.find(bmConfig);
|
||||
if (CollectionUtils.isNotEmpty(bmConfigs)) {
|
||||
String value = getValueWithDefault(bmConfigs.get(0).getItemValue(), "");
|
||||
if (StringUtils.isNotEmpty(value)) {
|
||||
list = Arrays.asList(value.split(","));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -214,4 +214,7 @@ public class GlobalConst {
|
|||
*/
|
||||
public static final String AUDIT_FAILURE = "审核失败";
|
||||
|
||||
|
||||
public static final String LEASE_TASK_AUDIT_ROLE_KEYS = "LeaseTaskAuditRoleKeys";
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue