公共接口及接口文档完成

master
liuqingkun 3 years ago
parent c08852989d
commit 8f0f8ca14d
  1. 128
      doc/api.md
  2. 109
      src/main/java/org/springblade/modules/system/controller/DictCommonController.java
  3. 9
      src/main/java/org/springblade/modules/system/mapper/DictBizMapper.java
  4. 8
      src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml
  5. 8
      src/main/java/org/springblade/modules/system/service/IDictBizService.java
  6. 5
      src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java
  7. 53
      src/main/java/org/springblade/modules/system/vo/DictSimpleVO.java
  8. 56
      src/main/java/org/springblade/modules/system/vo/ServerWindowVO.java
  9. 2
      src/main/resources/application.yml

@ -13,8 +13,16 @@
"success": true,
"data": [
{
"id": "1666625605998895105",
"name": "信访办"
"id": "1666702140550336513",
"account": "srmfy",
"name": "市法院",
"realName": "市法院"
},
{
"id": "1666740731569688578",
"account": "sjdl",
"name": "市级导览员",
"realName": "市级导览员"
}
],
"msg": "操作成功"
@ -35,13 +43,12 @@
"success": true,
"data": [
{
"id": "1666625605998895105",
"name": "法律咨询",
"is_link": 0
},{
"id": "166662560599889515",
"name": "邻里纠纷",
"is_link": 1
"id": "1666700063321280514",
"dictValue": "其他事项"
},
{
"id": "1666626705640546306",
"dictValue": "婚恋家庭纠纷"
}
],
"msg": "操作成功"
@ -62,11 +69,12 @@
"success": true,
"data": [
{
"id": "1666625605998895105",
"name": "胶西街道"
},{
"id": "166662560599889515",
"name": "洋河镇"
"id": "1666632074840399874",
"dictValue": "阜安街道"
},
{
"id": "1666697016771792897",
"dictValue": "洋河街道"
}
],
"msg": "操作成功"
@ -92,15 +100,28 @@
"success": true,
"data": [
{
"id": "1666625605998895105",
"serverWindowName": "市交通局",
"disputeNames": "交通事故,道路纠纷",
"status": 1
},{
"id": "166662560599889515",
"serverWindowName": "市住建局",
"disputeNames": "地界线因发争执",
"status": 1
"id": "1666700063321280514",
"tenantId": "000000",
"parentId": "1666626082400526337",
"code": "dispute_type",
"dictKey": "401",
"dictValue": "其他事项",
"sort": 401,
"remark": "",
"isSealed": 0,
"isDeleted": 0
},
{
"id": "1666626705640546306",
"tenantId": "000000",
"parentId": "1666625859938836481",
"code": "dispute_type",
"dictKey": "101",
"dictValue": "婚恋家庭纠纷",
"sort": 1,
"remark": "",
"isSealed": 0,
"isDeleted": 0
}
],
"msg": "操作成功"
@ -724,42 +745,13 @@
}
```
### 8. 矛盾热点排行(按照解决的矛盾数量, 返回排序后的列表), 查询条件: 部门(市, 镇)
### 8. 矛盾热点排行(按照解决的矛盾数量, 返回排序后的列表)
- 请求地址
`GET` `/blade-business/report/getAppealHot`
- 请求参数
|参数名称|参数类型|允许为空|参数说明|
| ---- | ---- | ---- | ---- |
| addressType | String | Y | 上报地分类, 1:镇街, 2:部门, 传空统计全部上报地 |
- 返回示例
```json
{
"code": 200,
"success": true,
"data": [
{
"streetName": "洋河镇",
"num": 20
},{
"streetName": "胶东街道",
"num": 13
}
],
"msg": "操作成功"
}
```
### 9. 矛盾严重程度占比统计
- 请求地址
`GET` `/blade-business/report/getAppealCountBySeverity`
- 请求参数
`无`
- 返回示例
@ -767,16 +759,26 @@
{
"code": 200,
"success": true,
"data": [
{
"disputeLevelName": "简单",
"percent": 0.58
},{
"disputeLevelName": "一般",
"percent": 0.3
}
],
"data": {
"town": [
{
"streetName": "信访办",
"num": 20
},{
"streetName": "卫健委",
"num": 13
}
],
"street": [
{
"streetName": "洋河镇",
"num": 20
},{
"streetName": "胶东街道",
"num": 13
}
]
},
"msg": "操作成功"
}
```

@ -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));
}
}

@ -17,6 +17,7 @@
package org.springblade.modules.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.system.entity.DictBiz;
import org.springblade.modules.system.vo.DictBizVO;
@ -46,6 +47,14 @@ public interface DictBizMapper extends BaseMapper<DictBiz> {
*/
List<DictBiz> getList(String code);
/**
* 获取第三级字典表
*
* @param code 字典编号
* @return
*/
List<DictBiz> getListThirdLevel(@Param("dictCode") String code);
/**
* 获取树形节点
*

@ -40,6 +40,14 @@
select id, tenant_id, parent_id, code, dict_key, dict_value, sort, remark from blade_dict_biz where code = #{param1} and parent_id > 0 and is_sealed = 0 and is_deleted = 0
</select>
<select id="getListThirdLevel" resultMap="dictResultMap">
SELECT biz3.*
FROM blade_dict_biz biz
LEFT JOIN blade_dict_biz biz2 ON biz.id = biz2.parent_id
LEFT JOIN blade_dict_biz biz3 ON biz2.id = biz3.parent_id
WHERE biz.code = #{dictCode} AND biz.parent_id = 0
</select>
<select id="tree" resultMap="treeNodeResultMap">
select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict_biz where is_deleted = 0
</select>

@ -63,6 +63,14 @@ public interface IDictBizService extends IService<DictBiz> {
*/
List<DictBiz> getList(String code);
/**
* 获取第三级字典表
*
* @param code 字典编号
* @return
*/
List<DictBiz> getListThirdLevel(String code);
/**
* 新增或修改
*

@ -71,6 +71,11 @@ public class DictBizServiceImpl extends ServiceImpl<DictBizMapper, DictBiz> impl
return baseMapper.getList(code);
}
@Override
public List<DictBiz> getListThirdLevel(String code) {
return baseMapper.getListThirdLevel(code);
}
@Override
public boolean submit(DictBiz dict) {
LambdaQueryWrapper<DictBiz> lqw = Wrappers.<DictBiz>query().lambda().eq(DictBiz::getCode, dict.getCode()).eq(DictBiz::getDictKey, dict.getDictKey());

@ -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;
}

@ -186,6 +186,8 @@ blade:
#接口放行
skip-url:
- /blade-test/**
- /blade-business/**
- /blade-system/dict/common/**
#授权认证配置
auth:
- method: ALL

Loading…
Cancel
Save