parent
c08852989d
commit
8f0f8ca14d
9 changed files with 315 additions and 63 deletions
@ -0,0 +1,109 @@ |
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package org.springblade.modules.system.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import io.swagger.annotations.*; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.common.constant.CommonConstant; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.cache.utils.CacheUtil; |
||||
import org.springblade.core.launch.constant.AppConstant; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tenant.annotation.NonDS; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.constant.BladeConstant; |
||||
import org.springblade.core.tool.utils.BeanUtil; |
||||
import org.springblade.core.tool.utils.StringPool; |
||||
import org.springblade.modules.system.entity.DictBiz; |
||||
import org.springblade.modules.system.entity.User; |
||||
import org.springblade.modules.system.service.IDictBizService; |
||||
import org.springblade.modules.system.service.IUserService; |
||||
import org.springblade.modules.system.vo.DictBizVO; |
||||
import org.springblade.modules.system.vo.DictSimpleVO; |
||||
import org.springblade.modules.system.vo.ServerWindowVO; |
||||
import org.springblade.modules.system.wrapper.DictBizWrapper; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
import javax.validation.Valid; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
import static org.springblade.core.cache.constant.CacheConstant.DICT_CACHE; |
||||
|
||||
/** |
||||
* 控制器 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@NonDS |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME + "/dict/common") |
||||
@Api(value = "公共业务字典", tags = "公共业务字典") |
||||
public class DictCommonController extends BladeController { |
||||
|
||||
private final IUserService userService; |
||||
|
||||
private final IDictBizService dictService; |
||||
|
||||
/** |
||||
* 窗口列表 |
||||
*/ |
||||
@GetMapping("/getServerWindowList") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "获取窗口列表", notes = "获取窗口列表") |
||||
public R<List<ServerWindowVO>> getServerWindowList() { |
||||
String deptId = "1666621912872280065"; |
||||
List<User> userList = userService.list(Wrappers.<User>lambdaQuery().eq(User::getDeptId, deptId)); |
||||
|
||||
List<ServerWindowVO> dataList = new ArrayList<>(); |
||||
userList.forEach(user -> { |
||||
dataList.add(BeanUtil.copy(user, ServerWindowVO.class)); |
||||
}); |
||||
return R.data(dataList); |
||||
} |
||||
|
||||
/** |
||||
* 所有诉求类型列表 |
||||
*/ |
||||
@GetMapping("/getDisputeList") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "获取所有诉求类型列表", notes = "获取所有诉求类型列表") |
||||
public R<List<DictSimpleVO>> getDisputeList() { |
||||
String code = "dispute_type"; |
||||
List<DictBiz> dataList = dictService.getListThirdLevel(code); |
||||
return R.data(BeanUtil.copy(dataList, DictSimpleVO.class)); |
||||
} |
||||
|
||||
/** |
||||
* 街道列表 |
||||
*/ |
||||
@GetMapping("/getStreetList") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "获取街道列表列表", notes = "获取街道列表列表") |
||||
public R<List<DictSimpleVO>> getStreetList() { |
||||
String code = "street"; |
||||
List<DictBiz> dataList = dictService.getList(code); |
||||
return R.data(BeanUtil.copy(dataList, DictSimpleVO.class)); |
||||
} |
||||
} |
||||
@ -0,0 +1,53 @@ |
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package org.springblade.modules.system.vo; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tool.node.INode; |
||||
import org.springblade.modules.system.entity.Dict; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 视图实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@ApiModel(value = "DictSimpleVO对象", description = "DictSimpleVO对象") |
||||
public class DictSimpleVO implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
/** |
||||
* 主键ID |
||||
*/ |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
private Long id; |
||||
|
||||
/** |
||||
* 字典名称 |
||||
*/ |
||||
@ApiModelProperty(value = "字典名称") |
||||
private String dictValue; |
||||
} |
||||
@ -0,0 +1,56 @@ |
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package org.springblade.modules.system.vo; |
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import io.swagger.annotations.ApiModel; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* 视图实体类 |
||||
* |
||||
* @author Chill |
||||
*/ |
||||
@Data |
||||
@ApiModel(value = "ServerWindowVO对象", description = "ServerWindowVO对象") |
||||
public class ServerWindowVO implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键ID |
||||
*/ |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
private Long id; |
||||
|
||||
/** |
||||
* 账号 |
||||
*/ |
||||
private String account; |
||||
|
||||
/** |
||||
* 昵称 |
||||
*/ |
||||
private String name; |
||||
|
||||
/** |
||||
* 真名 |
||||
*/ |
||||
private String realName; |
||||
} |
||||
Loading…
Reference in new issue