14 files added
1 files modified
New file |
| | |
| | | package com.oying.modules.system.domain; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.oying.base.BaseEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import cn.hutool.core.bean.copier.CopyOptions; |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * @description / |
| | | * @author lixin |
| | | * @date 2025-06-16 |
| | | **/ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sys_user_merchant") |
| | | public class UserMerchant extends BaseEntity implements Serializable { |
| | | |
| | | @TableId(value = "merchant_id") |
| | | @ApiModelProperty(value = "商户id") |
| | | private Long merchantId; |
| | | |
| | | @TableId(value = "user_id") |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long userId; |
| | | |
| | | @NotBlank |
| | | @ApiModelProperty(value = "角色类型(OWNER、ADMIN、FINANCE、OPERATOR)") |
| | | private String roleType; |
| | | |
| | | @ApiModelProperty(value = "权限集(备用)") |
| | | private String permissions; |
| | | |
| | | public void copy(UserMerchant source){ |
| | | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.oying.modules.system.domain; |
| | | |
| | | import com.oying.base.BaseEntity; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import cn.hutool.core.bean.copier.CopyOptions; |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * @description / |
| | | * @author lixin |
| | | * @date 2025-06-16 |
| | | **/ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sys_user_store") |
| | | public class UserStore extends BaseEntity implements Serializable { |
| | | |
| | | @TableId(value = "store_id") |
| | | @ApiModelProperty(value = "门店id") |
| | | private Long storeId; |
| | | |
| | | @TableId(value = "user_id") |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long userId; |
| | | |
| | | @NotBlank |
| | | @ApiModelProperty(value = "角色类型") |
| | | private String roleType; |
| | | |
| | | @ApiModelProperty(value = "权限集(备用)") |
| | | private String permissions; |
| | | |
| | | public void copy(UserStore source){ |
| | | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.oying.modules.system.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | import java.sql.Timestamp; |
| | | import java.util.List; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * @author lixin |
| | | * @date 2025-06-16 |
| | | **/ |
| | | @Data |
| | | public class UserMerchantQueryCriteria{ |
| | | |
| | | @ApiModelProperty(value = "页码", example = "1") |
| | | private Integer page = 1; |
| | | |
| | | @ApiModelProperty(value = "每页数据量", example = "10") |
| | | private Integer size = 10; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "角色类型(OWNER、ADMIN、FINANCE、OPERATOR)") |
| | | private String roleType; |
| | | private List<Timestamp> createTime; |
| | | } |
New file |
| | |
| | | package com.oying.modules.system.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | import java.sql.Timestamp; |
| | | import java.util.List; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * @author lixin |
| | | * @date 2025-06-16 |
| | | **/ |
| | | @Data |
| | | public class UserStoreQueryCriteria{ |
| | | |
| | | @ApiModelProperty(value = "页码", example = "1") |
| | | private Integer page = 1; |
| | | |
| | | @ApiModelProperty(value = "每页数据量", example = "10") |
| | | private Integer size = 10; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "角色类型") |
| | | private String roleType; |
| | | private List<Timestamp> createTime; |
| | | } |
New file |
| | |
| | | package com.oying.modules.system.mapper; |
| | | |
| | | import com.oying.modules.system.domain.UserMerchant; |
| | | import com.oying.modules.system.domain.dto.UserMerchantQueryCriteria; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | /** |
| | | * @author lixin |
| | | * @date 2025-06-16 |
| | | **/ |
| | | @Mapper |
| | | public interface UserMerchantMapper extends BaseMapper<UserMerchant> { |
| | | |
| | | IPage<UserMerchant> findAll(@Param("criteria") UserMerchantQueryCriteria criteria, Page<Object> page); |
| | | |
| | | List<UserMerchant> findAll(@Param("criteria") UserMerchantQueryCriteria criteria); |
| | | } |
New file |
| | |
| | | package com.oying.modules.system.mapper; |
| | | |
| | | import com.oying.modules.system.domain.UserStore; |
| | | import com.oying.modules.system.domain.dto.UserStoreQueryCriteria; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | /** |
| | | * @author lixin |
| | | * @date 2025-06-16 |
| | | **/ |
| | | @Mapper |
| | | public interface UserStoreMapper extends BaseMapper<UserStore> { |
| | | |
| | | IPage<UserStore> findAll(@Param("criteria") UserStoreQueryCriteria criteria, Page<Object> page); |
| | | |
| | | List<UserStore> findAll(@Param("criteria") UserStoreQueryCriteria criteria); |
| | | } |
New file |
| | |
| | | package com.oying.modules.system.rest; |
| | | |
| | | import com.oying.annotation.Log; |
| | | import com.oying.modules.system.domain.UserMerchant; |
| | | import com.oying.modules.system.service.UserMerchantService; |
| | | import com.oying.modules.system.domain.dto.UserMerchantQueryCriteria; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import io.swagger.annotations.*; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.oying.utils.PageResult; |
| | | |
| | | /** |
| | | * @author lixin |
| | | * @date 2025-06-16 |
| | | **/ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "系统:商户管理员信息") |
| | | @RequestMapping("/api/userMerchant") |
| | | public class UserMerchantController { |
| | | |
| | | private final UserMerchantService userMerchantService; |
| | | |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('userMerchant:list')") |
| | | public void exportUserMerchant(HttpServletResponse response, UserMerchantQueryCriteria criteria) throws IOException { |
| | | userMerchantService.download(userMerchantService.queryAll(criteria), response); |
| | | } |
| | | |
| | | @GetMapping |
| | | @ApiOperation("查询商户管理员信息") |
| | | @PreAuthorize("@el.check('userMerchant:list')") |
| | | public ResponseEntity<PageResult<UserMerchant>> queryUserMerchant(UserMerchantQueryCriteria criteria){ |
| | | Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); |
| | | return new ResponseEntity<>(userMerchantService.queryAll(criteria,page),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增商户管理员信息") |
| | | @ApiOperation("新增商户管理员信息") |
| | | @PreAuthorize("@el.check('userMerchant:add')") |
| | | public ResponseEntity<Object> createUserMerchant(@Validated @RequestBody UserMerchant resources){ |
| | | userMerchantService.create(resources); |
| | | return new ResponseEntity<>(HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Log("修改商户管理员信息") |
| | | @ApiOperation("修改商户管理员信息") |
| | | @PreAuthorize("@el.check('userMerchant:edit')") |
| | | public ResponseEntity<Object> updateUserMerchant(@Validated @RequestBody UserMerchant resources){ |
| | | userMerchantService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @Log("删除商户管理员信息") |
| | | @ApiOperation("删除商户管理员信息") |
| | | @PreAuthorize("@el.check('userMerchant:del')") |
| | | public ResponseEntity<Object> deleteUserMerchant(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) { |
| | | userMerchantService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | } |
New file |
| | |
| | | package com.oying.modules.system.rest; |
| | | |
| | | import com.oying.annotation.Log; |
| | | import com.oying.modules.system.domain.UserStore; |
| | | import com.oying.modules.system.service.UserStoreService; |
| | | import com.oying.modules.system.domain.dto.UserStoreQueryCriteria; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import io.swagger.annotations.*; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.oying.utils.PageResult; |
| | | |
| | | /** |
| | | * @author lixin |
| | | * @date 2025-06-16 |
| | | **/ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "系统:门店管理信息") |
| | | @RequestMapping("/api/userStore") |
| | | public class UserStoreController { |
| | | |
| | | private final UserStoreService userStoreService; |
| | | |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('userStore:list')") |
| | | public void exportUserStore(HttpServletResponse response, UserStoreQueryCriteria criteria) throws IOException { |
| | | userStoreService.download(userStoreService.queryAll(criteria), response); |
| | | } |
| | | |
| | | @GetMapping |
| | | @ApiOperation("查询门店管理信息") |
| | | @PreAuthorize("@el.check('userStore:list')") |
| | | public ResponseEntity<PageResult<UserStore>> queryUserStore(UserStoreQueryCriteria criteria){ |
| | | Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); |
| | | return new ResponseEntity<>(userStoreService.queryAll(criteria,page),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增门店管理信息") |
| | | @ApiOperation("新增门店管理信息") |
| | | @PreAuthorize("@el.check('userStore:add')") |
| | | public ResponseEntity<Object> createUserStore(@Validated @RequestBody UserStore resources){ |
| | | userStoreService.create(resources); |
| | | return new ResponseEntity<>(HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Log("修改门店管理信息") |
| | | @ApiOperation("修改门店管理信息") |
| | | @PreAuthorize("@el.check('userStore:edit')") |
| | | public ResponseEntity<Object> updateUserStore(@Validated @RequestBody UserStore resources){ |
| | | userStoreService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @Log("删除门店管理信息") |
| | | @ApiOperation("删除门店管理信息") |
| | | @PreAuthorize("@el.check('userStore:del')") |
| | | public ResponseEntity<Object> deleteUserStore(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) { |
| | | userStoreService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | } |
New file |
| | |
| | | package com.oying.modules.system.service; |
| | | |
| | | import com.oying.modules.system.domain.UserMerchant; |
| | | import com.oying.modules.system.domain.dto.UserMerchantQueryCriteria; |
| | | import java.util.List; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.oying.utils.PageResult; |
| | | |
| | | /** |
| | | * @description 服务接口 |
| | | * @author lixin |
| | | * @date 2025-06-16 |
| | | **/ |
| | | public interface UserMerchantService extends IService<UserMerchant> { |
| | | |
| | | /** |
| | | * 查询数据分页 |
| | | * @param criteria 条件 |
| | | * @param page 分页参数 |
| | | * @return PageResult |
| | | */ |
| | | PageResult<UserMerchant> queryAll(UserMerchantQueryCriteria criteria, Page<Object> page); |
| | | |
| | | /** |
| | | * 查询所有数据不分页 |
| | | * @param criteria 条件参数 |
| | | * @return List<UserMerchantDto> |
| | | */ |
| | | List<UserMerchant> queryAll(UserMerchantQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 创建 |
| | | * @param resources / |
| | | */ |
| | | void create(UserMerchant resources); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param resources / |
| | | */ |
| | | void update(UserMerchant resources); |
| | | |
| | | /** |
| | | * 多选删除 |
| | | * @param ids / |
| | | */ |
| | | void deleteAll(List<Long> ids); |
| | | |
| | | /** |
| | | * 导出数据 |
| | | * @param all 待导出的数据 |
| | | * @param response / |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<UserMerchant> all, HttpServletResponse response) throws IOException; |
| | | } |
New file |
| | |
| | | package com.oying.modules.system.service; |
| | | |
| | | import com.oying.modules.system.domain.UserStore; |
| | | import com.oying.modules.system.domain.dto.UserStoreQueryCriteria; |
| | | import java.util.List; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.oying.utils.PageResult; |
| | | |
| | | /** |
| | | * @description 服务接口 |
| | | * @author lixin |
| | | * @date 2025-06-16 |
| | | **/ |
| | | public interface UserStoreService extends IService<UserStore> { |
| | | |
| | | /** |
| | | * 查询数据分页 |
| | | * @param criteria 条件 |
| | | * @param page 分页参数 |
| | | * @return PageResult |
| | | */ |
| | | PageResult<UserStore> queryAll(UserStoreQueryCriteria criteria, Page<Object> page); |
| | | |
| | | /** |
| | | * 查询所有数据不分页 |
| | | * @param criteria 条件参数 |
| | | * @return List<UserStoreDto> |
| | | */ |
| | | List<UserStore> queryAll(UserStoreQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 创建 |
| | | * @param resources / |
| | | */ |
| | | void create(UserStore resources); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param resources / |
| | | */ |
| | | void update(UserStore resources); |
| | | |
| | | /** |
| | | * 多选删除 |
| | | * @param ids / |
| | | */ |
| | | void deleteAll(List<Long> ids); |
| | | |
| | | /** |
| | | * 导出数据 |
| | | * @param all 待导出的数据 |
| | | * @param response / |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<UserStore> all, HttpServletResponse response) throws IOException; |
| | | } |
New file |
| | |
| | | package com.oying.modules.system.service.impl; |
| | | |
| | | import com.oying.modules.system.domain.UserMerchant; |
| | | import com.oying.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.oying.modules.system.service.UserMerchantService; |
| | | import com.oying.modules.system.domain.dto.UserMerchantQueryCriteria; |
| | | import com.oying.modules.system.mapper.UserMerchantMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.oying.utils.PageUtil; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import com.oying.utils.PageResult; |
| | | |
| | | /** |
| | | * @description 服务实现 |
| | | * @author lixin |
| | | * @date 2025-06-16 |
| | | **/ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class UserMerchantServiceImpl extends ServiceImpl<UserMerchantMapper, UserMerchant> implements UserMerchantService { |
| | | |
| | | private final UserMerchantMapper userMerchantMapper; |
| | | |
| | | @Override |
| | | public PageResult<UserMerchant> queryAll(UserMerchantQueryCriteria criteria, Page<Object> page){ |
| | | return PageUtil.toPage(userMerchantMapper.findAll(criteria, page)); |
| | | } |
| | | |
| | | @Override |
| | | public List<UserMerchant> queryAll(UserMerchantQueryCriteria criteria){ |
| | | return userMerchantMapper.findAll(criteria); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void create(UserMerchant resources) { |
| | | userMerchantMapper.insert(resources); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(UserMerchant resources) { |
| | | UserMerchant userMerchant = getById(resources.getUserId()); |
| | | userMerchant.copy(resources); |
| | | userMerchantMapper.updateById(userMerchant); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteAll(List<Long> ids) { |
| | | userMerchantMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void download(List<UserMerchant> all, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (UserMerchant userMerchant : all) { |
| | | Map<String, Object> map = new LinkedHashMap<>(); |
| | | map.put("角色类型(OWNER、ADMIN、FINANCE、OPERATOR)", userMerchant.getRoleType()); |
| | | map.put("权限集(备用)", userMerchant.getPermissions()); |
| | | map.put("创建者", userMerchant.getCreateBy()); |
| | | map.put("创建时间", userMerchant.getCreateTime()); |
| | | map.put("更新者", userMerchant.getUpdateBy()); |
| | | map.put("更新时间", userMerchant.getUpdateTime()); |
| | | list.add(map); |
| | | } |
| | | FileUtil.downloadExcel(list, response); |
| | | } |
| | | } |
New file |
| | |
| | | package com.oying.modules.system.service.impl; |
| | | |
| | | import com.oying.modules.system.domain.UserStore; |
| | | import com.oying.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.oying.modules.system.service.UserStoreService; |
| | | import com.oying.modules.system.domain.dto.UserStoreQueryCriteria; |
| | | import com.oying.modules.system.mapper.UserStoreMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.oying.utils.PageUtil; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import com.oying.utils.PageResult; |
| | | |
| | | /** |
| | | * @description 服务实现 |
| | | * @author lixin |
| | | * @date 2025-06-16 |
| | | **/ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class UserStoreServiceImpl extends ServiceImpl<UserStoreMapper, UserStore> implements UserStoreService { |
| | | |
| | | private final UserStoreMapper userStoreMapper; |
| | | |
| | | @Override |
| | | public PageResult<UserStore> queryAll(UserStoreQueryCriteria criteria, Page<Object> page){ |
| | | return PageUtil.toPage(userStoreMapper.findAll(criteria, page)); |
| | | } |
| | | |
| | | @Override |
| | | public List<UserStore> queryAll(UserStoreQueryCriteria criteria){ |
| | | return userStoreMapper.findAll(criteria); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void create(UserStore resources) { |
| | | userStoreMapper.insert(resources); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(UserStore resources) { |
| | | UserStore userStore = getById(resources.getUserId()); |
| | | userStore.copy(resources); |
| | | userStoreMapper.updateById(userStore); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteAll(List<Long> ids) { |
| | | userStoreMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void download(List<UserStore> all, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (UserStore userStore : all) { |
| | | Map<String, Object> map = new LinkedHashMap<>(); |
| | | map.put("角色类型", userStore.getRoleType()); |
| | | map.put("权限集(备用)", userStore.getPermissions()); |
| | | map.put("创建者", userStore.getCreateBy()); |
| | | map.put("创建时间", userStore.getCreateTime()); |
| | | map.put("更新者", userStore.getUpdateBy()); |
| | | map.put("更新时间", userStore.getUpdateTime()); |
| | | list.add(map); |
| | | } |
| | | FileUtil.downloadExcel(list, response); |
| | | } |
| | | } |
| | |
| | | server: |
| | | port: 8000 |
| | | port: 8088 |
| | | http2: |
| | | # 启用 HTTP/2 支持,提升传输效率 |
| | | enabled: true |
New file |
| | |
| | | <?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.oying.modules.system.mapper.UserMerchantMapper"> |
| | | <resultMap id="BaseResultMap" type="com.oying.modules.system.domain.UserMerchant"> |
| | | <id column="merchant_id" property="merchantId"/> |
| | | <id column="user_id" property="userId"/> |
| | | <result column="role_type" property="roleType"/> |
| | | <result column="permissions" property="permissions"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | merchant_id, user_id, role_type, permissions, create_by, create_time, update_by, update_time |
| | | </sql> |
| | | |
| | | <select id="findAll" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from sys_user_merchant |
| | | <where> |
| | | <if test="criteria.userId != null"> |
| | | and user_id = #{criteria.userId} |
| | | </if> |
| | | <if test="criteria.roleType != null"> |
| | | and role_type = #{criteria.roleType} |
| | | </if> |
| | | <if test="criteria.createTime != null and criteria.createTime.size() > 0"> |
| | | AND create_time BETWEEN #{criteria.createTime[0]} AND #{criteria.createTime[1]} |
| | | </if> |
| | | </where> |
| | | order by user_id desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?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.oying.modules.system.mapper.UserStoreMapper"> |
| | | <resultMap id="BaseResultMap" type="com.oying.modules.system.domain.UserStore"> |
| | | <id column="store_id" property="storeId"/> |
| | | <id column="user_id" property="userId"/> |
| | | <result column="role_type" property="roleType"/> |
| | | <result column="permissions" property="permissions"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | store_id, user_id, role_type, permissions, create_by, create_time, update_by, update_time |
| | | </sql> |
| | | |
| | | <select id="findAll" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from sys_user_store |
| | | <where> |
| | | <if test="criteria.userId != null"> |
| | | and user_id = #{criteria.userId} |
| | | </if> |
| | | <if test="criteria.roleType != null"> |
| | | and role_type = #{criteria.roleType} |
| | | </if> |
| | | <if test="criteria.createTime != null and criteria.createTime.size() > 0"> |
| | | AND create_time BETWEEN #{criteria.createTime[0]} AND #{criteria.createTime[1]} |
| | | </if> |
| | | </where> |
| | | order by user_id desc |
| | | </select> |
| | | </mapper> |