17个文件已修改
22个文件已删除
2个文件已添加
| | |
| | | //传图片一步到位 |
| | | mf.transferTo(targetFile); |
| | | //拼接数据 |
| | | return "http://sales.chelota.com/images/" + TimeDir +"/"+ fileName; |
| | | return "http://eyes.chelota.com/images/" + TimeDir +"/"+ fileName; |
| | | } |
| | | @ApiOperation(value = "服务端上传", notes = "服务端上传") |
| | | @PostMapping(value = "upload") |
| | |
| | | private final PasswordEncoder passwordEncoder; |
| | | private final UserUtil userUtil; |
| | | private final SecUserRoleService secUserRoleService; |
| | | private final TDeptService deptService; |
| | | private final LoginInfoUtil loginInfoUtil; |
| | | private final RedisAutoTemplate redisAutoTemplate; |
| | | |
| | | @Autowired |
| | | public SecUserController(SecUserService secUserService, SecRoleService secRoleService, SecResourcesService secResourcesService, PasswordEncoder passwordEncoder, UserUtil userUtil, SecUserRoleService secUserRoleService, TDeptService deptService, LoginInfoUtil loginInfoUtil, RedisAutoTemplate redisAutoTemplate) { |
| | | public SecUserController(SecUserService secUserService, SecRoleService secRoleService, SecResourcesService secResourcesService, PasswordEncoder passwordEncoder, UserUtil userUtil, SecUserRoleService secUserRoleService, LoginInfoUtil loginInfoUtil, RedisAutoTemplate redisAutoTemplate) { |
| | | this.secUserService = secUserService; |
| | | this.secRoleService = secRoleService; |
| | | this.secResourcesService = secResourcesService; |
| | | this.passwordEncoder = passwordEncoder; |
| | | this.userUtil = userUtil; |
| | | this.secUserRoleService = secUserRoleService; |
| | | this.deptService = deptService; |
| | | this.loginInfoUtil = loginInfoUtil; |
| | | this.redisAutoTemplate = redisAutoTemplate; |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 人员新增列表 |
| | | */ |
| | | @ApiOperation(value = "人员新增列表",notes = "type 1=部门,2=用户") |
| | | @GetMapping("/userAddList") |
| | | public ApiResult userAddList(@RequestParam(required = false) String name) |
| | | { |
| | | UserAddListVO userAddListVO = new UserAddListVO(); |
| | | |
| | | // 获取当前用户所在部门 |
| | | SecUser loginUser = loginInfoUtil.getLoginUser(); |
| | | Long deptId = loginUser.getDeptId(); |
| | | List<TDept> deptList = new ArrayList<>(); |
| | | List<SecUser> userList = new ArrayList<>(); |
| | | List<UserLevelVO> userLevelVOS = new ArrayList<>(); |
| | | if(!loginUser.isAdmin()){ |
| | | userList = secUserService.selectListByNamePhoneDeptId(name,deptId); |
| | | if(CollectionUtils.isEmpty(userList)){ |
| | | return ApiResult.success(userAddListVO); |
| | | } |
| | | |
| | | TDept dept = deptService.getById(deptId); |
| | | UserLevelVO userLevelVO = new UserLevelVO(); |
| | | List<UserLevelVO> children = new ArrayList<>(); |
| | | for (SecUser user : userList) { |
| | | UserLevelVO userLevelVO1 = new UserLevelVO(); |
| | | userLevelVO1.setKey(user.getId()); |
| | | userLevelVO1.setTitle(user.getNickName()); |
| | | userLevelVO1.setAvatar(user.getAvatarUrl()); |
| | | userLevelVO1.setFlag(true); |
| | | userLevelVO1.setValue(CodeGenerateUtils.generateVolumeSn()); |
| | | children.add(userLevelVO1); |
| | | } |
| | | userLevelVO.setChildren(children); |
| | | userLevelVO.setKey(dept.getId()); |
| | | userLevelVO.setTitle(dept.getDeptName()); |
| | | userLevelVO.setValue(CodeGenerateUtils.generateVolumeSn()); |
| | | userLevelVOS.add(userLevelVO); |
| | | }else { |
| | | // 查询符合要求部门id |
| | | deptList = deptService.userAddListByDeptNameDeptIds(name,null); |
| | | List<Long> deptIds = deptList.stream().map(TDept::getId).collect(Collectors.toList()); |
| | | userList = secUserService.selectListByNamePhoneDeptIds(name,null); |
| | | deptIds.addAll(userList.stream().map(SecUser::getDeptId).collect(Collectors.toList())); |
| | | // 查询部门 |
| | | deptList = deptService.userAddListByDeptNameDeptIds(null,deptIds); |
| | | if(CollectionUtils.isEmpty(deptList)){ |
| | | return ApiResult.success(userAddListVO); |
| | | } |
| | | // 查询用户 |
| | | userList = secUserService.selectListByNamePhoneDeptIds(null,deptIds); |
| | | |
| | | for (TDept dept : deptList) { |
| | | List<SecUser> users; |
| | | if(StringUtils.hasLength(name) && !dept.getDeptName().contains(name)){ |
| | | users = userList.stream().filter(e -> dept.getId().equals(e.getDeptId()) |
| | | && (((StringUtils.hasLength(e.getNickName()) && e.getNickName().contains(name))) |
| | | || (StringUtils.hasLength(e.getPhone()) && e.getPhone().contains(name)))).collect(Collectors.toList()); |
| | | }else { |
| | | users = userList.stream().filter(e -> dept.getId().equals(e.getDeptId())).collect(Collectors.toList()); |
| | | } |
| | | UserLevelVO userLevelVO = new UserLevelVO(); |
| | | List<UserLevelVO> children = new ArrayList<>(); |
| | | for (SecUser user : users) { |
| | | UserLevelVO userLevelVO1 = new UserLevelVO(); |
| | | userLevelVO1.setKey(user.getId()); |
| | | userLevelVO1.setTitle(user.getNickName()); |
| | | userLevelVO1.setAvatar(user.getAvatarUrl()); |
| | | userLevelVO1.setFlag(true); |
| | | userLevelVO1.setValue(CodeGenerateUtils.generateVolumeSn()); |
| | | children.add(userLevelVO1); |
| | | } |
| | | userLevelVO.setChildren(children); |
| | | userLevelVO.setKey(dept.getId()); |
| | | userLevelVO.setTitle(dept.getDeptName()); |
| | | userLevelVO.setValue(CodeGenerateUtils.generateVolumeSn()); |
| | | userLevelVOS.add(userLevelVO); |
| | | } |
| | | } |
| | | userAddListVO.setUserLevelVOS(userLevelVOS); |
| | | return ApiResult.success(userAddListVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户导入") |
| | |
| | | @TableField("deptId") |
| | | private Long deptId; |
| | | |
| | | @ApiModelProperty(value = "用户类型 1=总经理,2=销售总监,3=客户经理") |
| | | @ApiModelProperty(value = "用户类型 1=平台管理员,2=验光师") |
| | | @TableField("userType") |
| | | private Integer userType; |
| | | @ApiModelProperty(value = "省code") |
| | |
| | | @ApiModelProperty(value = "区code") |
| | | @TableField("areaCode") |
| | | private String areaCode; |
| | | @ApiModelProperty(value = "1平台2销售员") |
| | | @TableField("roleType") |
| | | private Integer roleType; |
| | | |
| | | public boolean isAdmin() |
| | | { |
| | |
| | | private PasswordEncoder passwordEncoder; |
| | | @Autowired |
| | | private SecRoleMapper secRoleMapper; |
| | | @Autowired |
| | | private TDeptMapper deptMapper; |
| | | |
| | | @Override |
| | | public List<SecResourceVO> selectUserResourcesTag(Long uid) { |
| | |
| | | List<SecUsersVO> sysUserListVOS = secUserMapper.getSecUserList(dto, pageInfo); |
| | | List<SecRole> secRoles = secRoleMapper.selectList(Wrappers.lambdaQuery(SecRole.class)); |
| | | |
| | | List<TDept> tDepts = deptMapper.selectList(Wrappers.lambdaQuery(TDept.class)); |
| | | |
| | | for (SecUsersVO sysUserListVO : sysUserListVOS) { |
| | | List<SecRole> roles = secRoles.stream().filter(role -> Objects.nonNull(sysUserListVO.getRoleId()) && sysUserListVO.getRoleId().equals(role.getId())).collect(toList()); |
| | | sysUserListVO.setSecRole(CollectionUtils.isNotEmpty(roles) ? roles.get(0) : null); |
| | | tDepts.stream().filter(dept -> Objects.nonNull(sysUserListVO.getDeptId()) && sysUserListVO.getDeptId().equals(dept.getId())).forEach(dept -> { |
| | | sysUserListVO.setDeptName(dept.getDeptName()); |
| | | }); |
| | | } |
| | | // for (SecUsersVO sysUserListVO : sysUserListVOS) { |
| | | // List<SecRole> roles = secRoles.stream().filter(role -> Objects.nonNull(sysUserListVO.getRoleId()) && sysUserListVO.getRoleId().equals(role.getId())).collect(toList()); |
| | | // sysUserListVO.setSecRole(CollectionUtils.isNotEmpty(roles) ? roles.get(0) : null); |
| | | // tDepts.stream().filter(dept -> Objects.nonNull(sysUserListVO.getDeptId()) && sysUserListVO.getDeptId().equals(dept.getId())).forEach(dept -> { |
| | | // sysUserListVO.setDeptName(dept.getDeptName()); |
| | | // }); |
| | | // } |
| | | pageInfo.setRecords(sysUserListVOS); |
| | | // 获取列表 |
| | | return pageInfo; |
| | |
| | | package com.jilongda.manage.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TStore; |
| | | import com.jilongda.manage.query.TStoreQuery; |
| | | import com.jilongda.manage.service.TStoreService; |
| | | import com.jilongda.manage.utils.LoginInfoUtil; |
| | | import com.jilongda.manage.vo.TStoreVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "门店管理") |
| | | @RestController |
| | | @RequestMapping("/t-store") |
| | | public class TStoreController { |
| | | |
| | | @Autowired |
| | | private TStoreService storeService; |
| | | @Autowired |
| | | private LoginInfoUtil loginInfoUtil; |
| | | |
| | | /** |
| | | * 获取门店列表 |
| | | */ |
| | | @ApiOperation(value = "获取门店分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TStoreVO>> pageList(@RequestBody TStoreQuery query) { |
| | | Integer userType = loginInfoUtil.getLoginUser().getUserType(); |
| | | if(Objects.equals(userType,2)){ |
| | | query.setStatus(1); |
| | | } |
| | | return ApiResult.success(storeService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加门店 |
| | | */ |
| | | @ApiOperation(value = "添加门店") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@Validated @RequestBody TStore dto) { |
| | | storeService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改门店") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update(@Validated @RequestBody TStore dto) { |
| | | storeService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除门店") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public ApiResult<Boolean> deleteById(@RequestParam Long id) { |
| | | return ApiResult.success(storeService.removeById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除门店") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public ApiResult<Boolean> deleteByIds(@RequestBody List<Long> ids) { |
| | | return ApiResult.success(storeService.removeByIds(ids)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询门店详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult<TStore> getDetailById(@RequestParam Long id) { |
| | | return ApiResult.success(storeService.getById(id)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.jilongda.manage.mapper; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TStore; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.manage.query.TStoreQuery; |
| | | import com.jilongda.manage.vo.TStoreVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TStoreMapper extends BaseMapper<TStore> { |
| | | |
| | | /** |
| | | * 获取门店分页列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TStoreVO> pageList(@Param("query") TStoreQuery query, @Param("pageInfo")PageInfo<TStoreVO> pageInfo); |
| | | } |
| | |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_store") |
| | | @ApiModel(value="TStore对象", description="门店表") |
| | | public class TStore implements Serializable { |
| | | public class TStore extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "地址") |
| | | @TableField("address") |
| | | private Integer address; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @TableField("createTime") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "修改时间") |
| | | @TableField("updateTime") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField("createBy") |
| | | private String createBy; |
| | | |
| | | @TableField("updateBy") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty(value = "是否删除 0否1是") |
| | | @TableField("isDelete") |
| | | private Integer isDelete; |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "经度") |
| | | @TableField("lon") |
| | |
| | | @ApiModelProperty(value = "照片") |
| | | @TableField("img") |
| | | private String img; |
| | | @ApiModelProperty(value = "状态 1=启用 2=禁用") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.manage.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "门店查询参数") |
| | | public class TStoreQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String name; |
| | | @ApiModelProperty(value = "状态 1=启用 2=禁用") |
| | | private Integer status; |
| | | |
| | | } |
| | |
| | | package com.jilongda.manage.service; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TStore; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.manage.query.TStoreQuery; |
| | | import com.jilongda.manage.vo.TStoreVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TStoreService extends IService<TStore> { |
| | | |
| | | /** |
| | | * 获取门店分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TStoreVO> pageList(TStoreQuery query); |
| | | } |
| | |
| | | package com.jilongda.manage.service.impl; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.common.model.TCustomers; |
| | | import com.jilongda.manage.model.TStore; |
| | | import com.jilongda.manage.mapper.TStoreMapper; |
| | | import com.jilongda.manage.query.TStoreQuery; |
| | | import com.jilongda.manage.service.TStoreService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.manage.vo.TStoreVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TStoreServiceImpl extends ServiceImpl<TStoreMapper, TStore> implements TStoreService { |
| | | |
| | | @Override |
| | | public PageInfo<TStoreVO> pageList(TStoreQuery query) { |
| | | PageInfo<TStoreVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TStoreVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | @Slf4j |
| | | public class GoodsImportValidator { |
| | | |
| | | public static boolean validateGoods(TGoodsImportExcels goodsImportExcel) { |
| | | try { |
| | | return !isValidGoods(goodsImportExcel); |
| | | } catch (Exception e) { |
| | | // 记录日志,提供详细的错误信息 |
| | | log.error("Validation error in GoodsImportExcel: {}", e.getMessage()); |
| | | // 可以根据具体情况决定是否需要抛出异常或如何处理这些异常 |
| | | throw e; |
| | | } |
| | | } |
| | | public static boolean validateCustomers(TCustomers customers) { |
| | | try { |
| | | return !isValidCustomers(customers); |
| | |
| | | // 可以根据具体情况决定是否需要抛出异常或如何处理这些异常 |
| | | throw e; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 校验商品导入Excel数据 |
| | | * |
| | | * @param goodsImportExcel 商品导入Excel数据 |
| | | * @return 校验结果 |
| | | */ |
| | | private static boolean isValidGoods(TGoodsImportExcels goodsImportExcel) { |
| | | return hasLength(goodsImportExcel.getGoodsName()) |
| | | && hasLength(goodsImportExcel.getGoodsNo()) |
| | | && hasLength(goodsImportExcel.getGoodsBrand()) |
| | | && hasLength(goodsImportExcel.getGoodsNature()) |
| | | && hasLength(goodsImportExcel.getGoodsType()) |
| | | && hasLength(goodsImportExcel.getGoodsRemark()) |
| | | && isNotNullAndNonNegative(goodsImportExcel.getGoodsDosage()) |
| | | && hasLength(goodsImportExcel.getGoodsContent()) |
| | | && hasLength(goodsImportExcel.getGoodsSpecifications()) |
| | | && hasLength(goodsImportExcel.getWarehouse()) |
| | | && isNotNull(goodsImportExcel.getGeneralManagerPrice()) |
| | | && isNotNull(goodsImportExcel.getSalesDirector()) |
| | | && isNotNull(goodsImportExcel.getAccountManager()) |
| | | && hasLength(goodsImportExcel.getUserPhones()); |
| | | } |
| | | |
| | | /** |
New file |
| | |
| | | package com.jilongda.manage.vo; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import com.jilongda.manage.model.TStore; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "门店管理分页显示") |
| | | public class TStoreVO extends TStore { |
| | | } |
| | |
| | | port: 9090 |
| | | tomcat: |
| | | max-swallow-size: 500MB |
| | | servlet: |
| | | context-path: /api |
| | | # servlet: |
| | | # context-path: /api |
| | | spring: |
| | | thymeleaf: |
| | | cache: false |
| | |
| | | <?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.jilongda.manage.mapper.SecResourcesMapper"> |
| | | |
| | | <mapper namespace="com.jilongda.manage.authority.mapper.SecResourcesMapper"> |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.jilongda.manage.model.SecResources"> |
| | | <resultMap id="BaseResultMap" type="com.jilongda.manage.authority.model.SecResources"> |
| | | <id column="id" property="id" /> |
| | | <result column="createBy" property="createBy"/> |
| | | <result column="createTime" property="createTime"/> |
| | | <result column="updateBy" property="updateBy"/> |
| | | <result column="updateTime" property="updateTime"/> |
| | | <result column="isDelete" property="isDelete"/> |
| | | <result column="parent_id" property="parentId" /> |
| | | <result column="title" property="title" /> |
| | | <result column="descriptions" property="descriptions" /> |
| | |
| | | <result column="env_port" property="envPort" /> |
| | | <result column="path" property="path" /> |
| | | <result column="api_url" property="apiUrl" /> |
| | | <result column="createBy" property="createBy" /> |
| | | <result column="createTime" property="createTime" /> |
| | | <result column="updateBy" property="updateBy" /> |
| | | <result column="updateTime" property="updateTime" /> |
| | | <result column="isDelete" property="isDelete" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, parent_id, title, descriptions, sort, icon, name, menu, component, permit, cate, type, hidden, env_port, path, api_url, createBy, createTime, updateBy, updateTime, isDelete |
| | | createBy |
| | | , |
| | | createTime, |
| | | updateBy, |
| | | updateTime, |
| | | isDelete, |
| | | id, parent_id, title, descriptions, sort, icon, `name`, menu, component, permit, cate, `type`, hidden, env_port, `path`, api_url |
| | | </sql> |
| | | |
| | | <sql id="Base_Column_List_By_Uid"> |
| | | re.id, re.parent_id, title, re.descriptions, re.sort, re.icon, re.name, re.menu, re.component, re.permit, |
| | | re.cate, re.type, re.hidden, re.env_port, re.path, re.api_url, |
| | | re.isDelete, re.createTime, re.updateTime |
| | | </sql> |
| | | |
| | | <select id="selectResourceByUid" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List_By_Uid"/> |
| | | from sec_user_role ur left join sec_role sr on ur.role_id = sr.id |
| | | left join sec_role_resource rr on sr.id = rr.role_id |
| | | left join sec_resources re on rr.resource_id = re.id |
| | | where |
| | | ur.user_id = #{uid,jdbcType=INTEGER} |
| | | AND re.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | ORDER BY re.sort |
| | | </select> |
| | | |
| | | <select id="getList" resultType="com.jilongda.manage.authority.vo.SecResourceVO"> |
| | | select sr.createBy, |
| | | sr.createTime, |
| | | sr.updateBy, |
| | | sr.updateTime, |
| | | sr.isDelete, |
| | | sr.id, |
| | | sr.parent_id, |
| | | sr.title, |
| | | sr.descriptions, |
| | | sr.sort, |
| | | sr.icon, |
| | | sr.name, |
| | | sr.menu, |
| | | sr.component, |
| | | sr.permit, |
| | | sr.cate, |
| | | sr.type, |
| | | sr.hidden, |
| | | sr.env_port, |
| | | sr.path, |
| | | sr.api_url |
| | | from sec_role_resource srr |
| | | left join sec_resources sr on srr.resource_id = sr.id |
| | | where srr.role_id = #{rid,jdbcType=VARCHAR} |
| | | </select> |
| | | <select id="allList" resultType="com.jilongda.manage.authority.vo.SecResourceVO"> |
| | | select createBy, |
| | | createTime, |
| | | updateBy, |
| | | updateTime, |
| | | isDelete, |
| | | id, |
| | | parent_id AS parentId, |
| | | title, |
| | | descriptions, |
| | | sort, |
| | | icon, |
| | | `name`, |
| | | menu, |
| | | component, |
| | | permit, |
| | | cate, |
| | | `type`, |
| | | hidden, |
| | | env_port AS envPort, |
| | | `path`, |
| | | api_url AS apiUrl |
| | | from sec_resources |
| | | ORDER BY parent_id |
| | | </select> |
| | | </mapper> |
| | |
| | | <?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.jilongda.manage.mapper.SecRoleMapper"> |
| | | <mapper namespace="com.jilongda.manage.authority.mapper.SecRoleMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.jilongda.manage.model.SecRole"> |
| | | <resultMap id="BaseResultMap" type="com.jilongda.manage.authority.model.SecRole"> |
| | | <id column="id" property="id" /> |
| | | <result column="rolename" property="rolename" /> |
| | | <result column="role_desc" property="roleDesc" /> |
| | | <result column="role_state" property="roleState" /> |
| | | <result column="createBy" property="createBy" /> |
| | | <result column="createTime" property="createTime" /> |
| | | <result column="updateBy" property="updateBy" /> |
| | | <result column="updateTime" property="updateTime" /> |
| | | <result column="isDelete" property="isDelete" /> |
| | | <result column="rolename" property="rolename" /> |
| | | <result column="role_desc" property="roleDesc" /> |
| | | <result column="role_state" property="roleState" /> |
| | | <result column="sortBy" property="sortBy" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, rolename, role_desc, role_state, createBy, createTime, updateBy, updateTime, isDelete, sortBy |
| | | createBy, |
| | | createTime, |
| | | updateBy, |
| | | updateTime, |
| | | isDelete, |
| | | id, rolename, role_desc, role_state |
| | | </sql> |
| | | |
| | | <!--根据用户id查询所有集合--> |
| | | <select id="selectRolesByUid" resultMap="BaseResultMap"> |
| | | select |
| | | r.createBy, |
| | | r.createTime, |
| | | r.updateBy, |
| | | r.updateTime, |
| | | r.isDelete, |
| | | r.id, r.rolename, r.role_desc AS roleDesc, r.role_state AS roleState,r.sortBy |
| | | from sec_role r,sec_user_role u |
| | | <where> |
| | | r.id = u.role_id |
| | | and u.user_id = #{uid,jdbcType=INTEGER} |
| | | and r.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | ORDER BY r.sortBy DESC |
| | | </where> |
| | | </select> |
| | | <!--通过角色查找人员--> |
| | | <select id="getUserByRole" resultType="com.jilongda.manage.authority.vo.SecUserVO"> |
| | | SELECT sr.id AS roleId,su.id AS userId,su.account |
| | | FROM sec_role sr |
| | | LEFT JOIN sec_user_role sur ON sr.id = sur.role_id |
| | | LEFT JOIN sec_user su ON sur.user_id = su.id |
| | | <where> |
| | | <if test="dto.id != null"> |
| | | sr.id = #{dto.id} |
| | | </if> |
| | | and sr.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectResByRid" resultType="java.lang.Long"> |
| | | SELECT |
| | | resource_id |
| | | FROM sec_resources r,sec_role_resource srr |
| | | <where> |
| | | r.id = srr.resource_id |
| | | AND srr.role_id = #{rid,jdbcType=INTEGER} |
| | | AND r.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | GROUP BY r.id |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | <?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.jilongda.manage.mapper.SecRoleResourceMapper"> |
| | | <mapper namespace="com.jilongda.manage.authority.mapper.SecRoleResourceMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.jilongda.manage.model.SecRoleResource"> |
| | | <resultMap id="BaseResultMap" type="com.jilongda.manage.authority.model.SecRoleResource"> |
| | | <result column="role_id" property="roleId" /> |
| | | <result column="resource_id" property="resourceId" /> |
| | | </resultMap> |
| | |
| | | <?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.jilongda.manage.mapper.SecUserMapper"> |
| | | |
| | | <mapper namespace="com.jilongda.manage.authority.mapper.SecUserMapper"> |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.jilongda.manage.model.SecUser"> |
| | | <resultMap id="BaseResultMap" type="com.jilongda.manage.authority.model.SecUser"> |
| | | <id column="id" property="id" /> |
| | | <result column="createBy" property="createBy"/> |
| | | <result column="createTime" property="createTime"/> |
| | | <result column="updateBy" property="updateBy"/> |
| | | <result column="updateTime" property="updateTime"/> |
| | | <result column="isDelete" property="isDelete"/> |
| | | <result column="account" property="account" /> |
| | | <result column="description" property="description" /> |
| | | <result column="password" property="password" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="state" property="state" /> |
| | | <result column="last_login_time" property="lastLoginTime" /> |
| | | <result column="createBy" property="createBy" /> |
| | | <result column="createTime" property="createTime" /> |
| | | <result column="updateBy" property="updateBy" /> |
| | | <result column="updateTime" property="updateTime" /> |
| | | <result column="isDelete" property="isDelete" /> |
| | | <result column="nick_name" property="nickName" /> |
| | | <result column="avatar_url" property="avatarUrl" /> |
| | | <result column="province" property="province" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, account, description, password, phone, state, last_login_time, createBy, createTime, updateBy, updateTime, isDelete, nick_name, avatar_url, province, city, area, address, birthday, gender, deptId, userType, provinceCode, cityCode, areaCode |
| | | createBy |
| | | , |
| | | createTime, |
| | | updateBy, |
| | | updateTime, |
| | | isDelete, |
| | | id, account, description, password, phone, `state`, last_login_time AS lastLoginTime, |
| | | nick_name AS nickName, avatar_url AS avatarUrl, province, city, area, address, birthday, gender,deptId,userType, |
| | | provinceCode, cityCode, areaCode |
| | | </sql> |
| | | |
| | | <sql id="Base_Column_List_Other"> |
| | | su.createBy, |
| | | su.createTime, |
| | | su.updateBy, |
| | | su.updateTime, |
| | | su.isDelete, |
| | | su.id, su.account, su.description, su.password, su.phone, su.`state`, su.last_login_time AS lastLoginTime, |
| | | su.nick_name AS nickName, su.avatar_url AS avatarUrl, su.province, su.city, su.area, su.address, su.birthday, su.gender,su.deptId,su.userType, |
| | | su.provinceCode, su.cityCode, su.areaCode |
| | | </sql> |
| | | |
| | | <select id="getSecUserList" resultType="com.jilongda.manage.authority.vo.SecUsersVO"> |
| | | SELECT |
| | | su.createBy, |
| | | su.createTime, |
| | | su.updateBy, |
| | | su.updateTime, |
| | | su.isDelete, |
| | | su.id, |
| | | su.`account`, |
| | | su.`description`, |
| | | su.`password`, |
| | | su.phone, |
| | | su.state, |
| | | su.roleType, |
| | | su.last_login_time AS lastLoginTime, su.nick_name AS nickName, su.avatar_url AS avatarUrl, su.province, su.city, su.area, su.address, |
| | | su.birthday, su.gender,sr.id AS roleId,sr.rolename AS rolename,su.deptId,su.userType,su.provinceCode, su.cityCode, su.areaCode,td.deptName |
| | | FROM sec_user su |
| | | LEFT JOIN sec_user_role sur ON su.id = sur.user_id |
| | | LEFT JOIN sec_role sr ON sur.role_id = sr.id |
| | | LEFT JOIN t_dept td ON su.deptId = td.id |
| | | <where> |
| | | <if test="dto.account != null and dto.account != ''"> |
| | | AND su.account LIKE concat('%', #{dto.account,jdbcType=VARCHAR}, '%') |
| | | </if> |
| | | <if test="dto.nickName != null and dto.nickName != ''"> |
| | | AND su.nick_name LIKE concat('%', #{dto.nickName,jdbcType=VARCHAR}, '%') |
| | | </if> |
| | | <if test="dto.phone != null and dto.phone != ''"> |
| | | AND su.phone LIKE concat('%', #{dto.phone,jdbcType=VARCHAR}, '%') |
| | | </if> |
| | | <if test="dto.rolename != null and dto.rolename != ''"> |
| | | AND sr.rolename LIKE concat('%', #{dto.rolename,jdbcType=VARCHAR}, '%') |
| | | </if> |
| | | <if test="dto.state != null"> |
| | | AND su.state = #{dto.state} |
| | | </if> |
| | | AND su.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY su.createTime DESC |
| | | </select> |
| | | |
| | | <select id="queryLower" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"> |
| | | </include> |
| | | from sec_user |
| | | <where> |
| | | <if test="query.userType != null and query.userType == 6"> |
| | | AND user_type = #{query.userType} |
| | | and personnel_structure_id like concat('%','DR','%') |
| | | </if> |
| | | <if test="query.userType != null and query.userType == 7"> |
| | | AND user_type = #{query.userType} |
| | | and personnel_structure_id like concat('%','HC','%') |
| | | </if> |
| | | AND isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | </select> |
| | | <select id="getUserByRoleId" resultType="com.jilongda.manage.authority.model.SecUser"> |
| | | select <include refid="Base_Column_List_Other"></include> |
| | | from sec_user_role sur |
| | | left join sec_user su on sur.user_id = su.id |
| | | where sur.role_id = #{id,jdbcType=VARCHAR} |
| | | and su.id is not null |
| | | </select> |
| | | |
| | | <select id="selectListByNamePhoneDeptId" resultType="com.jilongda.manage.authority.model.SecUser"> |
| | | select <include refid="Base_Column_List"></include> |
| | | from sec_user |
| | | WHERE isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | <if test="name != null and name != ''"> |
| | | AND (nick_name LIKE concat('%',#{name},'%') |
| | | OR phone LIKE concat('%',#{name},'%')) |
| | | </if> |
| | | <if test="deptId != null"> |
| | | AND deptId = #{deptId} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectListByNamePhoneDeptIds" resultType="com.jilongda.manage.authority.model.SecUser"> |
| | | select <include refid="Base_Column_List"></include> |
| | | from sec_user |
| | | WHERE isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | <if test="name != null and name != ''"> |
| | | AND (nick_name LIKE concat('%',#{name},'%') |
| | | OR phone LIKE concat('%',#{name},'%')) |
| | | </if> |
| | | <if test="deptIds != null and deptIds.size()>0"> |
| | | AND deptId IN |
| | | <foreach collection="deptIds" close=")" open="(" item="id" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <select id="selectUserById" resultType="com.jilongda.manage.authority.model.SecUser"> |
| | | select <include refid="Base_Column_List"></include> |
| | | from sec_user |
| | | where id = #{orderingPersonId} |
| | | </select> |
| | | <select id="queryList" resultType="com.jilongda.manage.authority.model.SecUser"> |
| | | select <include refid="Base_Column_List"></include> |
| | | from sec_user |
| | | </select> |
| | | |
| | | <delete id="removeById"> |
| | | delete |
| | | from sec_user |
| | | where id = #{uid} |
| | | </delete> |
| | | </mapper> |
| | |
| | | <?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.jilongda.manage.mapper.SecUserRoleMapper"> |
| | | |
| | | <mapper namespace="com.jilongda.manage.authority.mapper.SecUserRoleMapper"> |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.jilongda.manage.model.SecUserRole"> |
| | | <resultMap id="BaseResultMap" type="com.jilongda.manage.authority.model.SecUserRole"> |
| | | <result column="role_id" property="roleId" /> |
| | | <result column="user_id" property="userId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | role_id, user_id |
| | | role_id |
| | | , user_id |
| | | </sql> |
| | | |
| | | <select id="getRoleByUserId" resultType="com.jilongda.manage.authority.model.SecRole"> |
| | | select sr.id, |
| | | sr.rolename, |
| | | sr.role_desc, |
| | | sr.createBy, |
| | | sr.createTime, |
| | | sr.updateBy, |
| | | sr.updateTime, |
| | | sr.isDelete, |
| | | sr.role_state |
| | | from sec_user su |
| | | left join sec_user_role sur on su.id = sur.user_id |
| | | left join sec_role sr on sur.role_id = sr.id |
| | | where su.id = #{userId,jdbcType=VARCHAR} |
| | | AND su.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | </select> |
| | | </mapper> |
| | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.jilongda.manage.model.TStore"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="`name`" property="name" /> |
| | | <result column="province" property="province" /> |
| | | <result column="provinceCode" property="provinceCode" /> |
| | | <result column="city" property="city" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, name, province, provinceCode, city, cityCode, area, areaCode, address, createTime, updateTime, createBy, updateBy, isDelete, lon, lat, img |
| | | id, `name`, province, provinceCode, city, cityCode, area, areaCode, address, createTime, updateTime, createBy, updateBy, isDelete, lon, lat, img |
| | | </sql> |
| | | <select id="pageList" resultType="com.jilongda.manage.vo.TStoreVO"> |
| | | select <include refid="Base_Column_List"></include> |
| | | from t_store |
| | | <where> |
| | | <if test="query.name != null and query.name != ''"> |
| | | and `name` like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and `status` = #{query.status} |
| | | </if> |
| | | AND isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY createTime DESC |
| | | </select> |
| | | |
| | | </mapper> |