| | |
| | | /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ |
| | | @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") |
| | | private String dataScope; |
| | | /**员工端数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限)*/ |
| | | private String dataScopeEmployee; |
| | | |
| | | /** 子部门 */ |
| | | private List<SysDept> children = new ArrayList<SysDept>(); |
| | |
| | | this.wxDeptId = wxDeptId; |
| | | } |
| | | |
| | | public String getDataScopeEmployee() { |
| | | return dataScopeEmployee; |
| | | } |
| | | |
| | | public void setDataScopeEmployee(String dataScopeEmployee) { |
| | | this.dataScopeEmployee = dataScopeEmployee; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("dataScope", getDataScope()) |
| | | .append("wxDeptId", getWxDeptId()) |
| | | .append("dataScopeEmployee", getDataScopeEmployee()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | /** 角色ID */ |
| | | private Long roleId; |
| | | |
| | | /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ |
| | | /** 平台数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ |
| | | @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") |
| | | private String dataScope; |
| | | /**员工端数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限)*/ |
| | | private String dataScopeEmployee; |
| | | |
| | | public SysUser() |
| | | { |
| | |
| | | this.dataScope = dataScope; |
| | | } |
| | | |
| | | public String getDataScopeEmployee() { |
| | | return dataScopeEmployee; |
| | | } |
| | | |
| | | public void setDataScopeEmployee(String dataScopeEmployee) { |
| | | this.dataScopeEmployee = dataScopeEmployee; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | |
| | | .append("dept", getDept()) |
| | | .append("userType", getUserType()) |
| | | .append("dataScope", getDataScope()) |
| | | .append("dataScopeEmployee", getDataScopeEmployee()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | .collect(Collectors.toMap(MgtSimpleShopVo::getShopId, Function.identity())); |
| | | for(MgtCouponAuditPageVo mgtCouponAuditPageVo : mgtCouponAuditPageVoList){ |
| | | if(mgtCouponAuditPageVo.getShopId()!=null){ |
| | | mgtCouponAuditPageVo.setShopName(shopMap.get(mgtCouponAuditPageVo.getShopId()).getShopName()); |
| | | MgtSimpleShopVo mgtSimpleShopVo = shopMap.get(mgtCouponAuditPageVo.getShopId()); |
| | | if(null != mgtSimpleShopVo){ |
| | | mgtCouponAuditPageVo.setShopName(mgtSimpleShopVo.getShopName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <if test="param.goodsType != null and param.goodsType !=''"> |
| | | AND tog.goods_type = #{param.goodsType} |
| | | </if> |
| | | <!--<if test="param.shopId != null and param.shopId != ''">--> |
| | | <!--AND toc.shop_id = #{param.shopId}--> |
| | | <!--</if>--> |
| | | <if test="param.shopId != null and param.shopId != ''"> |
| | | AND toc.shop_id = #{param.shopId} |
| | | AND toc.shop_id = #{param.shopId} AND (toc.unbinding_flag = 0 OR (toc.unbinding_flag = 1 AND toc.order_from = 1) OR (toc.unbinding_flag = 1 AND toc.order_from = 2 AND toc.order_status = 3)) |
| | | </if> |
| | | <if test="param.shopIds != null and param.shopIds != ''"> |
| | | AND FIND_IN_SET(toc.shop_id, #{param.shopIds}) > 0 |
| | |
| | | <if test="param.goodsType != null and param.goodsType !=''"> |
| | | AND tog.goods_type = #{param.goodsType} |
| | | </if> |
| | | <!--<if test="param.shopId != null and param.shopId != ''">--> |
| | | <!--AND toc.shop_id = #{param.shopId}--> |
| | | <!--</if>--> |
| | | <if test="param.shopId != null and param.shopId != ''"> |
| | | AND toc.shop_id = #{param.shopId} |
| | | AND toc.shop_id = #{param.shopId} AND (toc.unbinding_flag = 0 OR (toc.unbinding_flag = 1 AND toc.order_from = 1) OR (toc.unbinding_flag = 1 AND toc.order_from = 2 AND toc.order_status = 3)) |
| | | </if> |
| | | <if test="param.shopIds != null and param.shopIds != ''"> |
| | | AND FIND_IN_SET(toc.shop_id, #{param.shopIds}) > 0 |
| | |
| | | <if test="param.goodsType != null and param.goodsType !=''"> |
| | | AND tog.goods_type = #{param.goodsType} |
| | | </if> |
| | | <!--<if test="param.shopId != null and param.shopId != ''">--> |
| | | <!--AND toc.shop_id = #{param.shopId}--> |
| | | <!--</if>--> |
| | | <if test="param.shopId != null and param.shopId != ''"> |
| | | AND toc.shop_id = #{param.shopId} |
| | | AND toc.shop_id = #{param.shopId} AND (toc.unbinding_flag = 0 OR (toc.unbinding_flag = 1 AND toc.order_from = 1) OR (toc.unbinding_flag = 1 AND toc.order_from = 2 AND toc.order_status = 3)) |
| | | </if> |
| | | <if test="param.shopIds != null and param.shopIds != ''"> |
| | | AND FIND_IN_SET(toc.shop_id, #{param.shopIds}) > 0 |
| | |
| | | import com.ruoyi.shop.domain.vo.*; |
| | | import com.ruoyi.shop.service.shop.ShopService; |
| | | import com.ruoyi.system.api.domain.dto.StaffBaseGetDto; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.api.service.RemoteSysStaffService; |
| | | import com.ruoyi.system.api.service.RemoteUserService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @ApiOperation(value = "分页获取员工端商户列表") |
| | | public R<Page<StaffShopPageVo>> listStaffShop(@RequestBody StaffShopPageDto staffShopPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (remoteSysStaffService.isLeader()) { |
| | | // if (remoteSysStaffService.isLeader()) { |
| | | // List<Long> userIds = sysUserService.getUserIdsByDept(userId).getData(); |
| | | // userIds.add(userId); |
| | | // staffShopPageDto.setUserIdList(userIds); |
| | | // } else { |
| | | // staffShopPageDto.setBelongUserId(userId); |
| | | // } |
| | | |
| | | // TODO: 2023/12/5 统一改成使用权限来控制数据 |
| | | R<SysUser> sysUser = sysUserService.getSysUser(userId); |
| | | if(sysUser.getCode() != 200){ |
| | | return R.fail(sysUser.getMsg()); |
| | | } |
| | | //员工端数据权限(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) |
| | | //2/4暂未使用 |
| | | String dataScopeEmployee = sysUser.getData().getDataScopeEmployee(); |
| | | if(dataScopeEmployee.equals("1")){ |
| | | staffShopPageDto.setUserIdList(null); |
| | | } |
| | | if(dataScopeEmployee.equals("3")){ |
| | | List<Long> userIds = sysUserService.getUserIdsByDept(userId).getData(); |
| | | userIds.add(userId); |
| | | staffShopPageDto.setUserIdList(userIds); |
| | | } else { |
| | | } |
| | | if(dataScopeEmployee.equals("5")){ |
| | | staffShopPageDto.setBelongUserId(userId); |
| | | } |
| | | |
| | | Page<StaffShopPageVo> page = new Page<>(); |
| | | page.setSize(staffShopPageDto.getPageSize()); |
| | | page.setCurrent(staffShopPageDto.getPageNum()); |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.ExceptionUtil; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | |
| | | }else if(StringUtils.isNotBlank(appNearbyShopDto.getLatitude())&&StringUtils.isNotBlank(appNearbyShopDto.getLongitude())){ |
| | | List<AppNearShopVo> appNearShopVos = shopMapper.getNearbyShops(appNearbyShopDto); |
| | | if(appNearShopVos.size() > 0){ |
| | | log.info("候选店铺:{}", JSON.toJSONString(appNearShopVos)); |
| | | StringBuffer to = new StringBuffer(); |
| | | for (AppNearShopVo appNearShopVo : appNearShopVos) { |
| | | to.append(appNearShopVo.getLatitude() + "," + appNearShopVo.getLongitude() + ";"); |
| | |
| | | List<TencentDistanceMatrixElements> elements = data.get(0).getElements(); |
| | | for (int i = 0; i < elements.size(); i++) { |
| | | TencentDistanceMatrixElements matrix = elements.get(i); |
| | | if(dis.compareTo(BigDecimal.ZERO) == 0 || dis.compareTo(new BigDecimal(matrix.getDistance())) > 0){ |
| | | if(i == 0 || dis.compareTo(new BigDecimal(matrix.getDistance())) > 0){ |
| | | dis = new BigDecimal(matrix.getDistance()); |
| | | appNearShopVo = appNearShopVos.get(i); |
| | | } |
| | |
| | | List<Long> userIds = new ArrayList<>(); |
| | | List<Long> shopIds = new ArrayList<>(); |
| | | //如果是leader 查询leader下面所有的员工下的所有shopId |
| | | if(remoteSysStaffService.isLeader()){ |
| | | // if(remoteSysStaffService.isLeader()){ |
| | | // userIds = sysUserService.getUserIdsByDept(userId).getData(); |
| | | // //根据用户所有id查询关联的商户id |
| | | // MgtBasePlatformDto mgtBasePlatformDto = new MgtBasePlatformDto(); |
| | | // mgtBasePlatformDto.setUserIdList(userIds); |
| | | // shopIds = shopMapper.listShopIdByTotal(mgtBasePlatformDto); |
| | | // List<Shop> shopList = this.getShopByBelongUserId(userId); |
| | | // if(shopList!=null&&!shopList.isEmpty()){ |
| | | // for(Shop shop : shopList){ |
| | | // shopIds.add(shop.getShopId()); |
| | | // } |
| | | // userIds.add(userId); |
| | | // } |
| | | // }else { |
| | | // //普通员工查询商户归属的shopId |
| | | // List<Shop> shopList = this.getShopByBelongUserId(userId); |
| | | // if(shopList!=null&&!shopList.isEmpty()){ |
| | | // for(Shop shop : shopList){ |
| | | // shopIds.add(shop.getShopId()); |
| | | // } |
| | | // userIds.add(userId); |
| | | // } |
| | | // } |
| | | |
| | | // TODO: 2023/12/5 统一改成使用权限来控制数据 |
| | | R<SysUser> sysUser = sysUserService.getSysUser(userId); |
| | | if(sysUser.getCode() != 200){ |
| | | throw new RuntimeException(sysUser.getMsg()); |
| | | } |
| | | //员工端数据权限(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) |
| | | //2/4暂未使用 |
| | | String dataScopeEmployee = sysUser.getData().getDataScopeEmployee(); |
| | | if(dataScopeEmployee.equals("1")){ |
| | | userIds = null; |
| | | shopIds = null; |
| | | } |
| | | if(dataScopeEmployee.equals("3")){ |
| | | userIds = sysUserService.getUserIdsByDept(userId).getData(); |
| | | //根据用户所有id查询关联的商户id |
| | | MgtBasePlatformDto mgtBasePlatformDto = new MgtBasePlatformDto(); |
| | |
| | | } |
| | | userIds.add(userId); |
| | | } |
| | | }else { |
| | | //普通员工查询商户归属的shopId |
| | | } |
| | | if(dataScopeEmployee.equals("5")){ |
| | | List<Shop> shopList = this.getShopByBelongUserId(userId); |
| | | if(shopList!=null&&!shopList.isEmpty()){ |
| | | for(Shop shop : shopList){ |
| | |
| | | userIds.add(userId); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //分别查询 |
| | | StaffHomeShopTotalVo staffHomeShopTotalVo = new StaffHomeShopTotalVo(); |
| | | if(userIds!=null&&!userIds.isEmpty()){ |
| | |
| | | } |
| | | Integer shopTaskCount = 0; |
| | | if(shopIds!=null&&!shopIds.isEmpty()){ |
| | | shopTaskService.getShopIngTotal(shopIds); |
| | | shopTaskCount = shopTaskService.getShopIngTotal(shopIds); |
| | | } |
| | | staffHomeShopTotalVo.setFollowMember(0); |
| | | staffHomeShopTotalVo.setNewMember(0); |
| | |
| | | */ |
| | | @Override |
| | | public void mgtShopHFTXAuth(MgtShopHFTXAuthDto mgtShopHFTXAuthDto) { |
| | | ShopAuthenticationHftx shopAuthenticationHftx = shopAuthenticationHftxService.getOne(new QueryWrapper<ShopAuthenticationHftx>().eq("shop_id", mgtShopHFTXAuthDto.getShopId())); |
| | | if(null != shopAuthenticationHftx && "U".equals(shopAuthenticationHftx.getAuditStatus())){ |
| | | ShopAuthenticationHftx shopAuthenticationHftx = shopAuthenticationHftxService.getOne(new QueryWrapper<ShopAuthenticationHftx>() |
| | | .eq("shop_id", mgtShopHFTXAuthDto.getShopId()).eq("is_delete", 0)); |
| | | if(null != shopAuthenticationHftx && Arrays.asList("U", "Y").contains(shopAuthenticationHftx.getAuditStatus())){ |
| | | throw new ServiceException("不能重复进件"); |
| | | } |
| | | if(null == shopAuthenticationHftx){ |
| | | shopAuthenticationHftx = new ShopAuthenticationHftx(); |
| | | shopAuthenticationHftx.setIsDelete(0); |
| | | shopAuthenticationHftx.setInsertTime(new Date()); |
| | | shopAuthenticationHftx.setAuditStatus("U"); |
| | | } |
| | | String auditStatus = shopAuthenticationHftx.getAuditStatus(); |
| | | BeanUtils.copyProperties(mgtShopHFTXAuthDto, shopAuthenticationHftx); |
| | | shopAuthenticationHftx.setReqSeqId(IdUtils.simpleUUID()); |
| | | shopAuthenticationHftx.setAuditStatus(""); |
| | | shopAuthenticationHftx.setAuditDesc(""); |
| | | if(Arrays.asList("N", "F").contains(shopAuthenticationHftx.getAuditStatus())){ |
| | | shopAuthenticationHftx.setAuditStatus(""); |
| | | shopAuthenticationHftx.setAuditDesc(""); |
| | | } |
| | | /** |
| | | * 开始调起进件接口 |
| | | */ |
| | |
| | | @Override |
| | | public StaffShopSimpleTotalVo getStaffSimpleTotal(Long userId){ |
| | | List<Long> userIdList = new ArrayList<>(); |
| | | if(remoteSysStaffService.isLeader()){ |
| | | // if(remoteSysStaffService.isLeader()){ |
| | | // userIdList = sysUserService.getUserIdsByDept(userId).getData(); |
| | | // userIdList.add(userId); |
| | | // }else { |
| | | // userIdList.add(userId); |
| | | // } |
| | | |
| | | // TODO: 2023/12/5 统一改成使用权限来控制数据 |
| | | R<SysUser> sysUser = sysUserService.getSysUser(userId); |
| | | if(sysUser.getCode() != 200){ |
| | | throw new RuntimeException(sysUser.getMsg()); |
| | | } |
| | | //员工端数据权限(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) |
| | | //2/4暂未使用 |
| | | String dataScopeEmployee = sysUser.getData().getDataScopeEmployee(); |
| | | if(dataScopeEmployee.equals("1")){ |
| | | userIdList = null; |
| | | } |
| | | if(dataScopeEmployee.equals("3")){ |
| | | userIdList = sysUserService.getUserIdsByDept(userId).getData(); |
| | | userIdList.add(userId); |
| | | }else { |
| | | } |
| | | if(dataScopeEmployee.equals("5")){ |
| | | userIdList.add(userId); |
| | | } |
| | | |
| | | |
| | | StaffShopSimpleTotalVo shopTotal = shopMapper.getStaffSimpleTotal(1,userIdList); |
| | | StaffShopSimpleTotalVo agencyTotal = shopMapper.getStaffSimpleTotal(2,userIdList); |
| | | shopTotal.setAgencyTotal(agencyTotal.getShopTotal()); |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.shop.util.map.vo.TencentDistanceMatrix; |
| | | import com.ruoyi.shop.util.map.vo.TencentDistanceMatrixElements; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | * @Date 2023/10/30 9:44 |
| | | */ |
| | | public class MapUtil { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(MapUtil.class); |
| | | |
| | | private static final String tencentKey = "FATBZ-V3AWH-7IJDS-WC7NC-QXY3Q-TQFDJ"; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public static R<List<TencentDistanceMatrix>> tencentDistanceMatrix(String form, String to, String mode){ |
| | | logger.info("起点经纬度:{} 终点经纬度:{}", form, to); |
| | | String url = "https://apis.map.qq.com/ws/distance/v1/matrix"; |
| | | HttpRequest get = HttpUtil.createGet(url) |
| | | .form("key", tencentKey) |
| | |
| | | .form("to", to) |
| | | .form("mode", mode); |
| | | HttpResponse execute = get.execute(); |
| | | logger.info("返回结果:{}", execute.body()); |
| | | JSONObject jsonObject = JSON.parseObject(execute.body()); |
| | | Integer status = jsonObject.getInteger("status"); |
| | | String message = jsonObject.getString("message"); |
| | |
| | | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.domain.pojo.sys.SysMenu; |
| | | import com.ruoyi.system.service.sys.ISysMenuService; |
| | | import com.ruoyi.system.service.sys.ISysUserService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "加载对应部门员工菜单列表树") |
| | | @GetMapping(value = "/roleStaffMenuTreeselect/{deptId}") |
| | | public AjaxResult deptStaffMenuTreeselect(@PathVariable("deptId") Long deptId) |
| | |
| | | public AjaxResult deptUserStaffMenuTreeselect(@PathVariable("deptUserId") Long deptUserId) |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | SysUser sysUser = sysUserService.selectUserById(deptUserId); |
| | | List<SysMenu> menus = menuService.selectStaffDeptMenuList(deptUserId); |
| | | AjaxResult ajax = success(); |
| | | ajax.put("checkedKeys", menuService.selectStaffMenuListByDeptUserId(deptUserId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | ajax.put("dataScopeEmployee", sysUser.getDataScopeEmployee()); |
| | | return ajax; |
| | | } |
| | | |
| | |
| | | package com.ruoyi.system.controller.sys; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.domain.pojo.sys.SysMenu; |
| | | import com.ruoyi.system.service.sys.ISysMenuService; |
| | | import com.ruoyi.system.service.sys.ISysUserService; |
| | | 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 javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | { |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | /** |
| | | * 获取菜单列表 |
| | |
| | | public AjaxResult deptUserMenuTreeselect(@PathVariable("deptUserId") Long deptUserId) |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | SysUser sysUser = sysUserService.selectUserById(deptUserId); |
| | | List<SysMenu> menus = menuService.selectDeptMenuList(deptUserId); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", menuService.selectMenuListByDeptUserId(deptUserId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | ajax.put("dataScope", sysUser.getDataScope()); |
| | | return ajax; |
| | | } |
| | | |
| | |
| | | |
| | | private String dataScope; |
| | | |
| | | private String dataScopeEmployee; |
| | | |
| | | } |
| | |
| | | public void editUserMenu(UserMenuEditDto userMenuEditDto){ |
| | | SysUser sysUser = this.selectUserById(userMenuEditDto.getUserId()); |
| | | sysUser.setDataScope(userMenuEditDto.getDataScope()); |
| | | sysUser.setDataScopeEmployee(userMenuEditDto.getDataScopeEmployee()); |
| | | userMapper.updateUser(sysUser); |
| | | userMenuMapper.deleteUserMenuByUserId(userMenuEditDto.getUserId()); |
| | | int rows = 1; |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="dataScope" column="data_scope" /> |
| | | <result property="wxDeptId" column="wx_dept_id" /> |
| | | <result property="dataScopeEmployee" column="data_scope_employee" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectDeptVo"> |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time ,d.data_scope,d.wx_dept_id |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time ,d.data_scope,d.wx_dept_id,d.data_scope_employee |
| | | from sys_dept d |
| | | </sql> |
| | | |
| | |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="dataScope != null and dataScope != ''">data_scope,</if> |
| | | <if test="wxDeptId != null and wxDeptId != ''">wx_dept_id,</if> |
| | | <if test="dataScopeEmployee != null and dataScopeEmployee != ''">data_scope_employee,</if> |
| | | create_time |
| | | )values( |
| | | <if test="deptId != null and deptId != 0">#{deptId},</if> |
| | |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="dataScope != null and dataScope != ''">#{dataScope},</if> |
| | | <if test="wxDeptId != null and wxDeptId != ''">#{wxDeptId},</if> |
| | | <if test="dataScopeEmployee != null and dataScopeEmployee != ''">#{dataScopeEmployee},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if> |
| | | <if test="wxDeptId != null and wxDeptId != ''">wx_dept_id = #{wxDeptId},</if> |
| | | <if test="dataScopeEmployee != null and dataScopeEmployee != ''">data_scope_employee = #{dataScopeEmployee},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where dept_id = #{deptId} |
| | |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="dataScope" column="user_data_scope" /> |
| | | <result property="dataScope" column="data_scope"/> |
| | | <result property="dataScopeEmployee" column="data_scope_employee"/> |
| | | <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | | </resultMap> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name,u.user_type, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.data_scope as user_data_scope, |
| | | select u.user_id, u.dept_id, u.user_name,u.user_type, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.data_scope, u.data_scope_employee, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status |
| | | from sys_user u |
| | |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="dataScope != null and dataScope != ''">data_scope,</if> |
| | | <if test="userType != null and userType != ''">user_type,</if> |
| | | <if test="dataScopeEmployee != null and dataScopeEmployee != ''">data_scope_employee,</if> |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="dataScope != null and dataScope != ''">#{dataScope},</if> |
| | | <if test="userType != null and userType != ''">#{userType},</if> |
| | | <if test="dataScopeEmployee != null and dataScopeEmployee != ''">#{dataScopeEmployee},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if> |
| | | <if test="dataScopeEmployee != null and dataScopeEmployee != ''">data_scope_employee = #{dataScopeEmployee},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |
| | |
| | | //package com.ruoyi.system; |
| | | // |
| | | // |
| | | //import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | //import com.ruoyi.system.domain.pojo.sys.SysMenu; |
| | | //import com.ruoyi.system.domain.vo.RouterVo; |
| | | //import com.ruoyi.system.service.staff.SysStaffService; |
| | | //import com.ruoyi.system.service.staff.SysWxCpService; |
| | | //import com.ruoyi.system.service.sys.ISysMenuService; |
| | | //import com.ruoyi.system.service.sys.ISysUserService; |
| | | //import org.junit.Test; |
| | | //import org.junit.runner.RunWith; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.boot.test.context.SpringBootTest; |
| | | //import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
| | | // |
| | |
| | | // @Resource |
| | | // private ISysMenuService menuService; |
| | | // |
| | | // @Autowired |
| | | // private ISysUserService sysUserService; |
| | | // |
| | | // @Test |
| | | // public void main() { |
| | | // //List<SysMenu> menus = menuService.selectMenuTreeByUserId(1L); |
| | | // List<SysMenu> menus = menuService.selectStaffMenuTreeByUserId(164L); |
| | | // List<RouterVo> list = menuService.buildMenus(menus); |
| | | // System.out.println(list); |
| | | // SysUser sysUser = sysUserService.selectUserById(6323L); |
| | | // System.out.println(sysUser.getDataScopeEmployee()); |
| | | // } |
| | | // |
| | | //} |