Commit 72d8cea6 authored by tangwei's avatar tangwei

修改接口

parent 42d80bf0
package com.yeejoin.amos.boot.module.jcs.api.vo;
package com.yeejoin.amos.boot.biz.common.utils;
import java.util.List;
/**
* * 生成树返回对象
* @return
* <PRE>
* author tw
* date 2021/6/10
* </PRE>
*/
public class Menu {
public Long id;
public String name;
......
package com.yeejoin.amos.boot.module.jcs.api.vo;
package com.yeejoin.amos.boot.biz.common.utils;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import com.yeejoin.amos.boot.module.jcs.api.entity.DataDictionary;
import com.yeejoin.amos.boot.module.jcs.api.entity.FireTeam;
/**
* 生成树工具类
* @return
* <PRE>
* author tw
* date 2021/6/10
* </PRE>
*/
public class TreeParser{
// /**
// * 解析树形数据
......@@ -72,7 +75,7 @@ public class TreeParser{
/*
/**
* @param topId 父id
* @param entityList 数据集合
* @param packageURL 集合对象包名+类名
......@@ -99,7 +102,7 @@ public class TreeParser{
break;
case 3:
IDMethodNameme = clazz.getSuperclass().getSuperclass().getDeclaredMethod(IDMethodName);
break;
break;
default:
IDMethodNameme = clazz.getDeclaredMethod(IDMethodName);
break;
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -6,8 +8,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.service.IDataDictionaryService;
import com.yeejoin.amos.boot.module.jcs.api.vo.Menu;
import com.yeejoin.amos.boot.module.jcs.api.vo.TreeParser;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
......@@ -15,17 +15,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.entity.DataDictionary;
import com.yeejoin.amos.boot.module.jcs.api.entity.FireTeam;
import com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
......@@ -148,7 +144,7 @@ public class DataDictionaryController extends BaseController {
Map<String, Object> columnMap =new HashMap<>();
columnMap.put("type", type);
Collection<DataDictionary> list=iDataDictionaryService.listByMap(columnMap);
List<Menu> menus=TreeParser.getTree(null, list, DataDictionary.class.getName(),"getCode",0, "getName", "getParent");
List<Menu> menus =TreeParser.getTree(null, list, DataDictionary.class.getName(),"getCode",0, "getName", "getParent");
return CommonResponseUtil.success(menus);
}
}
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
......@@ -8,9 +10,6 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.service.IFireTeamService;
import com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamListVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FirefightersListVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.Menu;
import com.yeejoin.amos.boot.module.jcs.api.vo.TreeParser;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
......@@ -20,8 +19,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.jcs.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersJacket;
import com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -131,7 +128,7 @@ public class FireTeamController extends BaseController {
Collection<FireTeam> list =iFireTeamService.listByMap(columnMap);
FireTeam ll=new FireTeam();
//List<Menu> menus=TreeParser.getTree(null,list);
List<Menu> menus=TreeParser.getTree(null, list, FireTeam.class.getName(),"getSequenceNbr",3, "getName", "getParent");
List<Menu> menus= TreeParser.getTree(null, list, FireTeam.class.getName(),"getSequenceNbr",3, "getName", "getParent");
return CommonResponseUtil.success(menus);
}
......
......@@ -114,7 +114,7 @@ public class FirefightersContractController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
public IPage<FirefightersContract> listPage(String pageNum,String pageSize, FirefightersContract firefightersContract){
public ResponseModel listPage(String pageNum,String pageSize, FirefightersContract firefightersContract){
Page<FirefightersContract> pageBean;
QueryWrapper<FirefightersContract> firefightersContractQueryWrapper = new QueryWrapper<>();
......@@ -150,7 +150,7 @@ public class FirefightersContractController extends BaseController {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iFirefightersContractService.page(pageBean, firefightersContractQueryWrapper);
return page;
return CommonResponseUtil.success(page);
}
}
......@@ -107,7 +107,7 @@ public class FirefightersJacketController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
public IPage<FirefightersJacket> listPage(String pageNum, String pageSize, FirefightersJacket firefightersJacket) {
public ResponseModel listPage(String pageNum, String pageSize, FirefightersJacket firefightersJacket) {
Page<FirefightersJacket> pageBean;
QueryWrapper<FirefightersJacket> firefightersJacketQueryWrapper = new QueryWrapper<>();
......@@ -143,6 +143,8 @@ public class FirefightersJacketController extends BaseController {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iFirefightersJacketService.page(pageBean, firefightersJacketQueryWrapper);
return page;
return CommonResponseUtil.success(page);
}
}
......@@ -46,7 +46,9 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException;
......@@ -256,6 +258,7 @@ public class UserController extends BaseController {
@ApiOperation(value = "查询指定的字典信息", notes = "查询指定的字典信息")
@GetMapping(value = "listDictionaryByDictCode/{dictCode}")
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
public List<DictionarieValueModel> listDictionaryByDictCode(@PathVariable String dictCode) {
try {
List<DictionarieValueModel> list = remoteSecurityService.listDictionaryByDictCode(dictCode);
......
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