Commit 455277dc authored by 周健威's avatar 周健威

修改

parent bcec2f8f
package com.github.wxiaoqi.security.common.vo;
import com.github.wxiaoqi.security.common.util.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -10,5 +11,7 @@ public class PageParam {
@ApiModelProperty("每页限制")
Integer limit;
public Query initQuery() {
return new Query(this);
}
}
......@@ -4,13 +4,18 @@ import com.github.wxiaoqi.security.admin.biz.GroupBiz;
import com.github.wxiaoqi.security.admin.biz.ResourceAuthorityBiz;
import com.github.wxiaoqi.security.admin.constant.AdminCommonConstant;
import com.github.wxiaoqi.security.admin.entity.Group;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.admin.vo.AuthorityMenuTree;
import com.github.wxiaoqi.security.admin.vo.GroupTree;
import com.github.wxiaoqi.security.admin.vo.GroupUsers;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.TreeUtil;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.github.wxiaoqi.security.common.vo.PageParam;
import io.swagger.annotations.Api;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -30,16 +35,24 @@ import java.util.List;
@Controller
@RequestMapping("group")
@Api("群组模块")
public class GroupController extends BaseController<GroupBiz, Group> {
public class GroupController extends BaseController<GroupBiz, Group> implements UserRestInterface {
@Autowired
private ResourceAuthorityBiz resourceAuthorityBiz;
@Autowired
UserFeign userFeign;
@Override
public UserFeign getUserFeign() {
return userFeign;
}
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public List<Group> list(String name,String groupType) {
if(StringUtils.isBlank(name)&&StringUtils.isBlank(groupType)) {
return new ArrayList<Group>();
}
// if(StringUtils.isBlank(name)&&StringUtils.isBlank(groupType)) {
// return new ArrayList<Group>();
// }
Example example = new Example(Group.class);
if (StringUtils.isNotBlank(name)) {
example.createCriteria().andLike("name", "%" + name + "%");
......@@ -50,13 +63,19 @@ public class GroupController extends BaseController<GroupBiz, Group> {
return baseBiz.selectByExample(example);
}
@RequestMapping(value = "/listPage", method = RequestMethod.GET)
@ResponseBody
public ObjectRestResponse<PageDataVO<Group>> listPage(ListPageDTO dto) {
return ObjectRestResponse.succ(PageDataVO.pageInfo(dto.initQuery(), () -> list(dto.getName(), dto.getGroupType())));
}
@GetMapping(value = "/list_all")
@ResponseBody
public List<Group> listAll() {
return baseBiz.selectListAll();
}
@RequestMapping(value = "/{id}/user", method = RequestMethod.PUT)
@ResponseBody
public ObjectRestResponse modifiyUsers(@PathVariable int id,String members,String leaders){
......@@ -158,4 +177,10 @@ public class GroupController extends BaseController<GroupBiz, Group> {
}
return TreeUtil.bulid(trees,root) ;
}
@Data
static public class ListPageDTO extends PageParam {
String name;
String groupType;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.upyuns.platform.rs.universal.mapper.DictionaryMapper" >
<resultMap id="BaseResultMap" type="Dictionary" >
<resultMap id="BaseResultMap" type="com.upyuns.platform.rs.universal.entity.Dictionary" >
<!--
WARNING - @mbg.generated
-->
......@@ -13,7 +13,7 @@
<result column="detail" property="detail" jdbcType="VARCHAR" />
</resultMap>
<select id="selectByCodeAndType" parameterType="Dictionary" resultType="Dictionary">
<select id="selectByCodeAndType" parameterType="com.upyuns.platform.rs.universal.entity.Dictionary" resultType="com.upyuns.platform.rs.universal.entity.Dictionary">
select * from data_dictionary
<where>
<if test="type != null">
......@@ -28,7 +28,7 @@
</where>
</select>
<select id = "selectByPid" parameterType="java.lang.Integer" resultType="Dictionary">
<select id = "selectByPid" parameterType="java.lang.Integer" resultType="com.upyuns.platform.rs.universal.entity.Dictionary">
select * from data_dictionary
where pid = #{pid}
</select>
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.upyuns.platform.rs.universal.mapper.IdInformationMapper">
<resultMap type="IdInformation" id="IdInformation">
<resultMap type="com.upyuns.platform.rs.universal.entity.IdInformation" id="IdInformation">
<result property="id" column="id"/>
<result property="idNumber" column="id_number"/>
<result property="name" column="name"/>
......@@ -13,7 +13,7 @@
<result property="expirationDate" column="expiration_date"/>
<result property="authenticationMethods" column="authentication_methods"/>
</resultMap>
<select id="selectByUserId" resultType="IdInformation" parameterType="java.lang.Integer">
<select id="selectByUserId" resultType="com.upyuns.platform.rs.universal.entity.IdInformation" parameterType="java.lang.Integer">
select * from id_information where user_login_id = #{userLoginId}
</select>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.upyuns.platform.rs.universal.mapper.MemberFamilyInfoMapper">
<resultMap id="BaseResultMap" type="MemberFamilyInfo">
<resultMap id="BaseResultMap" type="com.upyuns.platform.rs.universal.entity.MemberFamilyInfo">
<!--
WARNING - @mbg.generated
-->
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.upyuns.platform.rs.universal.mapper.MemberInfoMapper">
<resultMap id="BaseResultMap" type="MemberInfo">
<resultMap id="BaseResultMap" type="com.upyuns.platform.rs.universal.entity.MemberInfo">
<!--
WARNING - @mbg.generated
-->
......@@ -41,7 +41,7 @@
create_user_name, state
</sql>
<resultMap id="MemberInfoVoResultMap" type="MemberInfoVo">
<resultMap id="MemberInfoVoResultMap" type="com.upyuns.platform.rs.universal.vo.MemberInfoVo">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="sex" jdbcType="BIT" property="sex" />
......
......@@ -4,7 +4,7 @@
<mapper namespace="com.upyuns.platform.rs.universal.mapper.OrderPayMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="OrderPay" id="orderPayMap">
<resultMap type="com.upyuns.platform.rs.universal.entity.OrderPay" id="orderPayMap">
<result property="id" column="id"/>
<result property="tradeNo" column="trade_no"/>
<result property="orderNo" column="order_no"/>
......
......@@ -4,7 +4,7 @@
<mapper namespace="com.upyuns.platform.rs.universal.mapper.OrderRefundMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="OrderRefund" id="orderRefundMap">
<resultMap type="com.upyuns.platform.rs.universal.entity.OrderRefund" id="orderRefundMap">
<result property="id" column="id"/>
<result property="refundTradeNo" column="refund_trade_no"/>
<result property="orderNo" column="order_no"/>
......
......@@ -3,12 +3,12 @@
<mapper namespace="com.upyuns.platform.rs.universal.mapper.SysRegionMapper">
<select id="getAllByPage" parameterType="java.util.Map"
resultType="SysRegion">
resultType="com.upyuns.platform.rs.universal.entity.SysRegion">
select `id`, parent_id, `name`, `type`, agency_id from sys_region limit #{pageStart},${pageSize}
</select>
<select id="getByIdList" parameterType="java.util.List"
resultType="SysRegion">
resultType="com.upyuns.platform.rs.universal.entity.SysRegion">
select `id`, parent_id, `name`, `type`, agency_id from sys_region where id in
<foreach collection="list" index="i" item="item" open="(" close=")" separator=",">
#{item}
......@@ -22,7 +22,7 @@
select `id` from sys_region where name like CONCAT('%',#{name},'%') and type=#{type} limit 1
</select>
<select id="findByCityName" resultType="RegionDTO">
<select id="findByCityName" resultType="com.upyuns.platform.rs.universal.dto.RegionDTO">
select `id`,`parent_id` as `parentId` from `sys_region` where `type`=2 and `name` like concat('%',#{city} ,'%')
</select>
</mapper>
\ No newline at end of file
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