Commit ed6ce31b authored by 赵啸非's avatar 赵啸非

修改站点权限分配

parent dcf776e4
package com.mortals.xhx.module.business.service;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.business.model.BusinessEntity;
import com.mortals.xhx.module.business.model.BusinessTreeSelect;
......@@ -23,4 +25,7 @@ public interface BusinessService extends ICRUDService<BusinessEntity,Long>{
* @param context
*/
void addBusinessToSite(String businessIds, Long siteId,Context context);
Result<BusinessEntity> flatList(BusinessEntity query, PageInfo pageInfo, Context context);
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.mortals.xhx.module.business.service.impl;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.common.code.IsBusinessEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.site.model.SiteBusinessEntity;
......@@ -42,7 +43,6 @@ public class BusinessServiceImpl extends AbstractCRUDServiceImpl<BusinessDao, Bu
@Autowired
private SiteService siteService;
@Override
protected void findAfter(BusinessEntity params, PageInfo pageInfo, Context context, List<BusinessEntity> list) throws AppException {
list.stream().peek(item -> {
......@@ -119,6 +119,12 @@ public class BusinessServiceImpl extends AbstractCRUDServiceImpl<BusinessDao, Bu
});
}
@Override
public Result<BusinessEntity> flatList(BusinessEntity query,PageInfo pageInfo, Context context) {
Result<BusinessEntity> result = this.dao.getList(query, pageInfo);
return result;
}
private void updateOrSave(BusinessEntity item, Long siteId, Context context) {
SiteBusinessEntity siteBusinessEntity = new SiteBusinessEntity();
......
......@@ -3,6 +3,8 @@ package com.mortals.xhx.module.business.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
......@@ -85,5 +87,30 @@ public class BusinessController extends BaseCRUDJsonBodyMappingController<Busine
/**
* 查询业务扁平结构
*/
@PostMapping(value = "flatList")
public String flatList(@RequestBody BusinessEntity query) {
JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
String busiDesc = "查询" + this.getModuleDesc();
try {
PageInfo pageInfo = buildPageInfo(query);
Result<BusinessEntity> result = this.service.flatList(query, pageInfo, getContext());
model.put(KEY_RESULT_DATA, result.getList());
parsePageInfo(model, result.getPageInfo());
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_DATA, model);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "查询站点列表成功!");
} catch (Exception e) {
log.error("获取异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
}
\ No newline at end of file
......@@ -101,17 +101,21 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
public SiteTreeSelect reFucurs(List<SiteTreeSelect> siteTree, String siteId) {
SiteTreeSelect temp=null;
for (SiteTreeSelect site : siteTree) {
if (site.getId() == siteId) {
if (site.getId().equals(siteId)) {
log.info("curTree:{}", JSON.toJSONString(site));
return site;
temp=site;
break;
} else {
if (!ObjectUtils.isEmpty(site.getChildren())) {
reFucurs(site.getChildren(), siteId);
temp=reFucurs(site.getChildren(), siteId);
if(temp!=null){
break;
}
}
}
return null;
}
return temp;
}
}
\ No newline at end of file
###站点业务列表
POST {{baseUrl}}/business/list
Authorization: Bearer {{authToken}}
Content-Type: application/json
{
"page":1,
"size":-1
}
###站点业务列表
POST {{baseUrl}}/business/flatList
Authorization: Bearer {{authToken}}
Content-Type: application/json
{
"name":"测试业务",
"flownum":"k39shb",
"page":1,
"size":10
}
......
......@@ -1643,19 +1643,79 @@ dict|object|字典对象|-
**响应消息样例:**
```
{
"code":1,
"data":{
"per_page":10,
"total":0,
"data":[],
"last_page":0,
"current_page":1
},
"query":{
"modelCode":"phxt1",
"modelName":"排号系统"
```
### 查询业务列表(非树形)
**请求URL:** business/flatList
**请求方式:** POST
**内容类型:** application/json;charset=utf-8
**简要描述:** 查询站点业务
**请求参数:**
参数名称|类型|备注|必填|其它
---|---|---|---|---
page|Integer|当前页|否|-
size|Integer|每页条数|否|-1查询全部
name|String|业务名称|否|-
**请求样例:**
```
{
"name":"q6pduw",
"flownum":"twqunp",
"page":1,
"size":10
}
```
**响应参数:**
参数名称 |参数类型|备注|其它
---|---|---|---
code|Integer|结果码(-1.失败,1.成功)|-
msg|String|消息|-
data|object|数据对象|-
&emsp;per_page|Integer|每页条数|-
&emsp;total|Integer|总条数|-
&emsp;last_page|Integer|总页数|-
&emsp;current_page|Integer|当前页|-
&emsp;data|array|结果集列表|数组
&emsp;&emsp;id|Long|序号,主键,自增长|-
&emsp;&emsp;parentId|Long|父级ID|-
&emsp;&emsp;ancestors|String|祖级列表,逗号分隔|-
&emsp;&emsp;isBusiness|Integer|业务类型(0.一级业务,1.二级业务)|-
&emsp;&emsp;name|String|业务名称|-
&emsp;&emsp;remark|String|备注|-
&emsp;&emsp;canorder|Integer|是否允许预约(1.允许,0.不允许)|-
&emsp;&emsp;cantake|Integer|是否允许取号(1.允许,0.不允许)|-
&emsp;&emsp;datashow|Integer|大厅情况展示 (1.展示,0.不展示)|-
&emsp;&emsp;englishname|String|英语业务名|-
&emsp;&emsp;flownum|String|流水编号如A、B|-
&emsp;&emsp;businessType|Integer|业务类型 (0.一体化业务,1.自建业务)|-
&emsp;&emsp;status|Integer|业务状态 (0.停用,1.正常)|-
&emsp;&emsp;createTime|Date|创建时间|-
&emsp;&emsp;createUserId|Long|创建用户|-
&emsp;&emsp;updateTime|Date|修改时间|-
dict|object|字典对象|-
&emsp;isBusiness|object|字典属性对象,详见附录|-
&emsp;canorder|object|字典属性对象,详见附录|-
&emsp;cantake|object|字典属性对象,详见附录|-
&emsp;datashow|object|字典属性对象,详见附录|-
&emsp;businessType|object|字典属性对象,详见附录|-
&emsp;status|object|字典属性对象,详见附录|-
**响应消息样例:**
```
{
}
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment