| | |
| | | |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | /** 菜单组 */ |
| | | private Long[] menuIds; |
| | | |
| | | /** 菜单组 */ |
| | | private Long[] staffMenuIds; |
| | | |
| | | public Long getDeptId() |
| | | { |
| | | return deptId; |
| | |
| | | this.deptName = deptName; |
| | | } |
| | | |
| | | @NotNull(message = "显示顺序不能为空") |
| | | //@NotNull(message = "显示顺序不能为空") |
| | | public Integer getOrderNum() |
| | | { |
| | | return orderNum; |
| | |
| | | this.menuIds = menuIds; |
| | | } |
| | | |
| | | public Long[] getStaffMenuIds() { |
| | | return staffMenuIds; |
| | | } |
| | | |
| | | public void setStaffMenuIds(Long[] staffMenuIds) { |
| | | this.staffMenuIds = staffMenuIds; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
New file |
| | |
| | | package com.ruoyi.system.api.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName MgtSysSimpleVo |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/25 14:31 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtSysSimpleUserVo { |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "用户名称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "部门id") |
| | | private Long deptId; |
| | | |
| | | @ApiModelProperty(value = "部门名称") |
| | | private String deptName; |
| | | } |
| | |
| | | package com.ruoyi.system.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseBathDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtUserIdByDept; |
| | | import com.ruoyi.system.api.domain.poji.config.Activeness; |
| | | import com.ruoyi.system.api.domain.poji.config.SysClassification; |
| | | import com.ruoyi.system.api.domain.vo.MgtSysSimpleUserVo; |
| | | import com.ruoyi.system.api.service.RemoteConfigService; |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import org.slf4j.Logger; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<MgtSysSimpleUserVo>> listSimpleUserVo(MgtBaseBathDto mgtBaseBathDto) { |
| | | return R.fail("获取用户列表失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<SysTag>> listSysTag(Integer tagType) { |
| | | return R.fail("获取标签失败:" + throwable.getMessage()); |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseBathDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtUserIdByDept; |
| | | import com.ruoyi.system.api.domain.poji.config.Activeness; |
| | | import com.ruoyi.system.api.domain.poji.config.SysClassification; |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import com.ruoyi.system.api.domain.vo.MgtSysSimpleUserVo; |
| | | import com.ruoyi.system.api.factory.RemoteConfigFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | */ |
| | | @PostMapping("/config/getUserIdByDept") |
| | | public R<MgtUserIdByDept> getUserIdByDept(@RequestBody MgtUserIdByDept userIdByDept); |
| | | |
| | | |
| | | /** |
| | | * @description 通过id获取用户简易信息 |
| | | * @author jqs |
| | | * @date 2023/6/25 14:41 |
| | | * @param mgtBaseBathDto |
| | | * @return R<List<MgtSysSimpleUserVo>> |
| | | */ |
| | | @PostMapping("/listSimpleUserVo") |
| | | public R<List<MgtSysSimpleUserVo>> listSimpleUserVo(@RequestBody MgtBaseBathDto mgtBaseBathDto); |
| | | } |
| | |
| | | import com.ruoyi.system.api.domain.dto.MgtBasePlatformDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseShopDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtPlActivityAgeDto; |
| | | import com.ruoyi.system.api.domain.vo.MerHomeShopTotalVo; |
| | | import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo; |
| | | import com.ruoyi.system.api.domain.vo.MgtMapTotalVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | * @date 2023/6/19 22:48 |
| | | */ |
| | | List<MgtMapTotalPlusVo> listPlTotalActivitySalesRank(@Param("param") MgtBasePlatformDto mgtBasePlatformDto); |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/6/25 17:28 |
| | | * @param shopId |
| | | * @return MerHomeShopTotalVo |
| | | */ |
| | | MerHomeShopTotalVo getMerHomeShopTotalVo(Long shopId); |
| | | } |
| | |
| | | */ |
| | | MgtMemberServiceTotalVo getMgtMemberServiceTotal(@Param("userId")Long userId); |
| | | |
| | | |
| | | /** |
| | | * @description 统计商户到店人数 |
| | | * @author jqs |
| | | * @date 2023/6/25 17:17 |
| | | * @param shopId |
| | | * @return Integer |
| | | */ |
| | | Integer countShopServicePerson(@Param("shopId")Long shopId); |
| | | } |
| | |
| | | import com.ruoyi.order.service.order.ConsumerGoodsService; |
| | | import com.ruoyi.order.service.order.OrderGoodsService; |
| | | import com.ruoyi.common.security.utils.CodeFactoryUtil; |
| | | import com.ruoyi.order.service.order.UserServiceRecordService; |
| | | import com.ruoyi.system.api.domain.dto.*; |
| | | import com.ruoyi.system.api.domain.vo.*; |
| | | import com.ruoyi.system.api.domain.vo.MgtMapTotalVo; |
| | |
| | | |
| | | @Resource |
| | | private RemoteConfigService remoteConfigService; |
| | | |
| | | @Resource |
| | | private UserServiceRecordService userServiceRecordService; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public MerHomeShopTotalVo getMerHomeTotal(MerHomeShopTotalVo merHomeShopTotalVo) { |
| | | Long shopId = merHomeShopTotalVo.getShopId(); |
| | | Integer todayShop = 0; |
| | | Integer unHandleOrder = 0; |
| | | BigDecimal shopTurnover = new BigDecimal("0.00"); |
| | | Integer cycleSurp = 0; |
| | | Integer explorationSurp = 0; |
| | | Integer todayShop = userServiceRecordService.countShopServicePerson(shopId); |
| | | merHomeShopTotalVo.setTodayShop(todayShop); |
| | | merHomeShopTotalVo.setUnHandleOrder(unHandleOrder); |
| | | merHomeShopTotalVo.setShopTurnover(shopTurnover); |
| | | merHomeShopTotalVo.setCycleSurp(cycleSurp); |
| | | merHomeShopTotalVo.setExplorationSurp(explorationSurp); |
| | | merHomeShopTotalVo = orderMapper.getMerHomeShopTotalVo(shopId); |
| | | return merHomeShopTotalVo; |
| | | } |
| | | |
| | |
| | | return userServiceRecordMapper.getMgtMemberServiceTotal(userId); |
| | | } |
| | | |
| | | /** |
| | | * @description 统计商户到店人数 |
| | | * @author jqs |
| | | * @date 2023/6/25 17:17 |
| | | * @param shopId |
| | | * @return Integer |
| | | */ |
| | | @Override |
| | | public Integer countShopServicePerson(Long shopId){ |
| | | return userServiceRecordMapper.countShopServicePerson(shopId); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | MgtMemberServiceTotalVo getMgtMemberServiceTotal(Long userId); |
| | | |
| | | /** |
| | | * @description 统计商户到店人数 |
| | | * @author jqs |
| | | * @date 2023/6/25 17:17 |
| | | * @param shopId |
| | | * @return Integer |
| | | */ |
| | | Integer countShopServicePerson(Long shopId); |
| | | } |
| | |
| | | GROUP BY activity_name |
| | | ORDER BY SUM(order_money) DESC LIMIT 15 |
| | | </select> |
| | | |
| | | <select id="getMerHomeShopTotalVo" resultType="com.ruoyi.system.api.domain.vo.MerHomeShopTotalVo"> |
| | | SELECT |
| | | SUM(CASE WHEN order_status = 2 THEN 1 ELSE 0 END) unHandleOrder, |
| | | SUM(pay_money) shopTurnover |
| | | FROM t.order |
| | | WHERE del_flag = 0 AND shopId = #{shopId} |
| | | </select> |
| | | </mapper> |
| | |
| | | GROUP BY tsrd.consumer_goods_id) AS temp |
| | | </select> |
| | | |
| | | <select id="countShopServicePerson" resultType="java.lang.Integer"> |
| | | SELECT COUNT(DISTINCT user_id) |
| | | FROM t_user_service_record |
| | | WHERE shop_id = #{shopId} AND DATE(create_time) = CURDATE() |
| | | </select> |
| | | </mapper> |
| | |
| | | private ShopCertificateService shopCertificateService; |
| | | |
| | | @RequestMapping(value = "/listMgtShopSimpleVo", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取商户列表") |
| | | @ApiOperation(value = "获取简易商户列表") |
| | | public R<List<MgtShopListSimpleVo>> listMgtShopSimpleVo(@RequestBody MgtShopListDto mgtShopListDto) { |
| | | List<MgtShopListSimpleVo> mgtShopListSimpleVoList = shopService.listMgtShopSimpleVo(mgtShopListDto); |
| | | return R.ok(mgtShopListSimpleVoList); |
| | |
| | | shopService.mgtShopAuth(mgtShopAuthDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getMgtShopAuth", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取商户进件信息") |
| | | public R<MgtShopAuthGetVo> getMgtShopAuth(@RequestBody MgtShopAuthGetDto mgtShopAuthGetDto) { |
| | | MgtShopAuthGetVo shopAuthGetVo = shopService.getMgtShopAuth(mgtShopAuthGetDto.getAuthId()); |
| | | return R.ok(shopAuthGetVo); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.shop.domain.dto; |
| | | |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName MgtShopAuthGetDto |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/25 10:42 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtShopAuthGetDto extends MgtBaseDto { |
| | | |
| | | @ApiModelProperty(value = "审核id") |
| | | private String authId; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.shop.domain.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | | * 商户统计 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-25 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_shop_total") |
| | | public class ShopTotal extends Model<ShopTotal> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 商户id |
| | | */ |
| | | @TableId("shop_id") |
| | | private Integer shopId; |
| | | /** |
| | | * 删除标记 |
| | | */ |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | /** |
| | | * 最后消费金额 |
| | | */ |
| | | @TableField("last_pay_money") |
| | | private BigDecimal lastPayMoney; |
| | | /** |
| | | * 总活动次数 |
| | | */ |
| | | @TableField("total_activity_count") |
| | | private String totalActivityCount; |
| | | /** |
| | | * 总订单数 |
| | | */ |
| | | @TableField("total_order") |
| | | private String totalOrder; |
| | | /** |
| | | * 总周期订单数 |
| | | */ |
| | | @TableField("total_cycle_order") |
| | | private Integer totalCycleOrder; |
| | | /** |
| | | * 总体验订单数 |
| | | */ |
| | | @TableField("tolta_experience_order") |
| | | private Integer toltaExperienceOrder; |
| | | /** |
| | | * 总服务订单数 |
| | | */ |
| | | @TableField("total_service_order") |
| | | private Integer totalServiceOrder; |
| | | /** |
| | | * 总单品订单数 |
| | | */ |
| | | @TableField("total_goods_order") |
| | | private Integer totalGoodsOrder; |
| | | /** |
| | | * 总服务次数 |
| | | */ |
| | | @TableField("total_service_count") |
| | | private Integer totalServiceCount; |
| | | /** |
| | | * 使用服务次数 |
| | | */ |
| | | @TableField("used_service_count") |
| | | private Integer usedServiceCount; |
| | | /** |
| | | * 可用服务次数 |
| | | */ |
| | | @TableField("useable_service_count") |
| | | private Integer useableServiceCount; |
| | | /** |
| | | * 总周期服务次数 |
| | | */ |
| | | @TableField("total_cycle_service") |
| | | private Integer totalCycleService; |
| | | /** |
| | | * 已用周期服务次数 |
| | | */ |
| | | @TableField("used_cycle_service") |
| | | private Integer usedCycleService; |
| | | /** |
| | | * 可用周期服务次数 |
| | | */ |
| | | @TableField("useable_cycle_service") |
| | | private Integer useableCycleService; |
| | | /** |
| | | * 总周期服务人数 |
| | | */ |
| | | @TableField("total_cycle_person") |
| | | private Integer totalCyclePerson; |
| | | /** |
| | | * 可用周期服务人数 |
| | | */ |
| | | @TableField("useable_cycle_person") |
| | | private Integer useableCyclePerson; |
| | | /** |
| | | * 总服务服务次数 |
| | | */ |
| | | @TableField("total_service_service") |
| | | private Integer totalServiceService; |
| | | /** |
| | | * 已用服务服务次数 |
| | | */ |
| | | @TableField("used_service_service") |
| | | private Integer usedServiceService; |
| | | /** |
| | | * 可用服务服务次数 |
| | | */ |
| | | @TableField("useable_service_service") |
| | | private Integer useableServiceService; |
| | | /** |
| | | * 总服务服务人数 |
| | | */ |
| | | @TableField("total_service_person") |
| | | private Integer totalServicePerson; |
| | | /** |
| | | * 可用服务服务人数 |
| | | */ |
| | | @TableField("useable_service_person") |
| | | private Integer useableServicePerson; |
| | | /** |
| | | * 总体验服务次数 |
| | | */ |
| | | @TableField("total_experience_service") |
| | | private Integer totalExperienceService; |
| | | /** |
| | | * 已用体验服务次数 |
| | | */ |
| | | @TableField("used_experience_service") |
| | | private Integer usedExperienceService; |
| | | /** |
| | | * 可用体验服务次数 |
| | | */ |
| | | @TableField("useable_experience_service") |
| | | private Integer useableExperienceService; |
| | | /** |
| | | * 总体体验服务人数 |
| | | */ |
| | | @TableField("total_experience_person") |
| | | private Integer totalExperiencePerson; |
| | | /** |
| | | * 可用体验服务次数 |
| | | */ |
| | | @TableField("useable_experience_person") |
| | | private Integer useableExperiencePerson; |
| | | /** |
| | | * 总订单金额 |
| | | */ |
| | | @TableField("total_order_ money") |
| | | private BigDecimal totalOrderMoney; |
| | | /** |
| | | * 周期订单金额 |
| | | */ |
| | | @TableField("total_cycle_money") |
| | | private BigDecimal totalCycleMoney; |
| | | /** |
| | | * 体验订单金额 |
| | | */ |
| | | @TableField("total_experience_money") |
| | | private BigDecimal totalExperienceMoney; |
| | | /** |
| | | * 服务订单金额 |
| | | */ |
| | | @TableField("total_service_money") |
| | | private BigDecimal totalServiceMoney; |
| | | /** |
| | | * 单品订单金额 |
| | | */ |
| | | @TableField("total_goods_money") |
| | | private BigDecimal totalGoodsMoney; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.shopId; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "审核id") |
| | | private String authId; |
| | | /** |
| | | * 商户id |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "商户id") |
| | | private Long shopId; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "补充说明") |
| | | private String baDesc; |
| | | |
| | | @ApiModelProperty(value = "拒绝理由") |
| | | private String adRejectReason; |
| | | } |
| | |
| | | @ApiModelProperty("商户标签") |
| | | private String shopTags; |
| | | |
| | | @Excel(name = "签约人", width = 30) |
| | | @ApiModelProperty("签约人") |
| | | @ApiModelProperty("签约人id") |
| | | private Long signUserId; |
| | | |
| | | @Excel(name = "签约员工", width = 30) |
| | | @ApiModelProperty("签约员工") |
| | | private String signUser; |
| | | |
| | | @Excel(name = "首提金额", width = 30) |
| | | @ApiModelProperty("首提金额") |
| | | private BigDecimal firstWithdraw; |
| | | |
| | | @ApiModelProperty("关联员工id") |
| | | private Long belongUserId; |
| | | |
| | | @Excel(name = "关联员工", width = 30) |
| | | @ApiModelProperty("关联员工") |
| | | private String belongUser; |
New file |
| | |
| | | package com.ruoyi.shop.mapper.shop; |
| | | |
| | | import com.ruoyi.shop.domain.pojo.ShopTotal; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 商户统计 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-25 |
| | | */ |
| | | public interface ShopTotalMapper extends BaseMapper<ShopTotal> { |
| | | |
| | | } |
| | |
| | | import com.ruoyi.shop.service.shop.*; |
| | | import com.ruoyi.shop.service.task.ShopFileService; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.domain.dto.AppMemberBindingDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtBasePlatformDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtShopIdByCodeDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtUserIdByDept; |
| | | import com.ruoyi.system.api.domain.dto.*; |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import com.ruoyi.system.api.domain.poji.member.Member; |
| | | import com.ruoyi.system.api.domain.poji.shop.Shop; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Resource |
| | | private ShopProportionService shopProportionService; |
| | | |
| | | |
| | | @Resource |
| | | private RemoteConfigService remoteConfigService; |
| | | |
| | | /** |
| | | * 获取商户详情 |
| | |
| | | */ |
| | | @Override |
| | | public List<MgtShopPageVo> pageMgtShop(Page page, MgtShopPageDto mgtShopPageDto){ |
| | | //处理标签为正则表达 |
| | | if(StringUtils.isNotBlank(mgtShopPageDto.getShopTags())){ |
| | | mgtShopPageDto.setShopTags(mgtShopPageDto.getShopTags().replace(",","|")); |
| | | if (StringUtils.isNotBlank(mgtShopPageDto.getShopTags())) { |
| | | mgtShopPageDto.setShopTags(mgtShopPageDto.getShopTags().replace(",", "|")); |
| | | } |
| | | // 分页查询商铺信息 |
| | | List<MgtShopPageVo> mgtShopPageVoList = shopMapper.pageMgtShop(page, mgtShopPageDto); |
| | | // 如果查询结果不为空 |
| | | if (!mgtShopPageVoList.isEmpty()) { |
| | | // 创建签约用户ID集合和所属用户ID集合 |
| | | HashSet<Long> signUserIdSet = new HashSet<>(); |
| | | HashSet<Long> belongUserIdSet = new HashSet<>(); |
| | | // 遍历查询结果,将签约用户和所属用户添加到对应的集合中 |
| | | for (MgtShopPageVo shopPageVo : mgtShopPageVoList) { |
| | | if (shopPageVo.getSignUserId() != null) { |
| | | signUserIdSet.add(shopPageVo.getSignUserId()); |
| | | } |
| | | if (shopPageVo.getBelongUserId() != null) { |
| | | belongUserIdSet.add(shopPageVo.getBelongUserId()); |
| | | } |
| | | } |
| | | MgtBaseBathDto mgtBaseBathDto; |
| | | Map<Long, MgtSysSimpleUserVo> signUserMap = null; |
| | | Map<Long, MgtSysSimpleUserVo> belongUserMap = null; |
| | | if(signUserIdSet!=null&&!signUserIdSet.isEmpty()){ |
| | | String signUserString = String.join(",", signUserIdSet.stream().map(Object::toString).collect(Collectors.toList())); |
| | | mgtBaseBathDto = new MgtBaseBathDto(); |
| | | mgtBaseBathDto.setIds(signUserString); |
| | | List<MgtSysSimpleUserVo> signUserVoList = remoteConfigService.listSimpleUserVo(mgtBaseBathDto).getData(); |
| | | signUserMap = signUserVoList.stream() |
| | | .collect(Collectors.toMap(MgtSysSimpleUserVo::getUserId, Function.identity())); |
| | | } |
| | | if(belongUserIdSet!=null&&!belongUserIdSet.isEmpty()){ |
| | | // 将签约用户ID集合和所属用户ID集合转为字符串 |
| | | String belongUserString = String.join(",", belongUserIdSet.stream().map(Object::toString).collect(Collectors.toList())); |
| | | // 查询签约用户和所属用户的详细信息 |
| | | mgtBaseBathDto = new MgtBaseBathDto(); |
| | | mgtBaseBathDto.setIds(belongUserString); |
| | | List<MgtSysSimpleUserVo> belongUserVoList = remoteConfigService.listSimpleUserVo(mgtBaseBathDto).getData(); |
| | | belongUserMap = belongUserVoList.stream() |
| | | .collect(Collectors.toMap(MgtSysSimpleUserVo::getUserId, Function.identity())); |
| | | } |
| | | // 遍历查询结果,将签约用户和所属用户的详细信息添加到商铺信息中 |
| | | for (MgtShopPageVo shopPageVo : mgtShopPageVoList) { |
| | | if (signUserMap!=null&&!signUserMap.isEmpty()&&shopPageVo.getSignUserId() != null) { |
| | | shopPageVo.setSignUser(signUserMap.get(shopPageVo.getSignUserId()).getNickName()); |
| | | } |
| | | if (belongUserMap!=null&&!belongUserMap.isEmpty()&&shopPageVo.getBelongUserId() != null) { |
| | | shopPageVo.setBelongUser(belongUserMap.get(shopPageVo.getBelongUserId()).getNickName()); |
| | | shopPageVo.setBelongDept(belongUserMap.get(shopPageVo.getBelongUserId()).getDeptName()); |
| | | } |
| | | } |
| | | } |
| | | // 返回商铺信息 |
| | | return mgtShopPageVoList; |
| | | } |
| | | |
| | |
| | | merHomeShopTotalVo.setShopId(shopId); |
| | | Shop shop = this.getById(shopId); |
| | | merHomeShopTotalVo.setShopType(shop.getShopType()); |
| | | Integer task = 0; |
| | | merHomeShopTotalVo.setTask(task); |
| | | merHomeShopTotalVo = remoteOrderService.getMerHomeTotal(merHomeShopTotalVo).getData(); |
| | | MerHomeShopTotalVo orderVo = remoteOrderService.getMerHomeTotal(merHomeShopTotalVo).getData(); |
| | | |
| | | return merHomeShopTotalVo; |
| | | } |
| | | |
| | |
| | | List<Long> shopIdList = shopMapper.listShopIdByPlTotal(mgtBasePlatformDto); |
| | | return shopIdList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @description 获取商户审核资料 |
| | | * @author jqs |
| | | * @date 2023/6/25 10:37 |
| | | * @param authId |
| | | * @return MgtShopAuthGetVo |
| | | */ |
| | | @Override |
| | | public MgtShopAuthGetVo getMgtShopAuth(String authId){ |
| | | MgtShopAuthGetVo shopAuthGetVo = new MgtShopAuthGetVo(); |
| | | ShopAuthentication shopAuthentication = shopAuthenticationService.getById(authId); |
| | | BeanUtils.copyProperties(shopAuthentication, shopAuthGetVo); |
| | | return shopAuthGetVo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.shop.service.impl.shop; |
| | | |
| | | import com.ruoyi.shop.domain.pojo.ShopTotal; |
| | | import com.ruoyi.shop.mapper.shop.ShopTotalMapper; |
| | | import com.ruoyi.shop.service.shop.ShopTotalService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 商户统计 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-25 |
| | | */ |
| | | @Service |
| | | public class ShopTotalServiceImpl extends ServiceImpl<ShopTotalMapper, ShopTotal> implements ShopTotalService { |
| | | |
| | | } |
| | |
| | | * @date 2023/6/23 14:13 |
| | | */ |
| | | List<Long> listShopIdByPlTotal(MgtBasePlatformDto mgtBasePlatformDto); |
| | | |
| | | /** |
| | | * @description 获取商户审核资料 |
| | | * @author jqs |
| | | * @date 2023/6/25 10:37 |
| | | * @param authId |
| | | * @return MgtShopAuthGetVo |
| | | */ |
| | | MgtShopAuthGetVo getMgtShopAuth(String authId); |
| | | } |
New file |
| | |
| | | package com.ruoyi.shop.service.shop; |
| | | |
| | | import com.ruoyi.shop.domain.pojo.ShopTotal; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 商户统计 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-25 |
| | | */ |
| | | public interface ShopTotalService extends IService<ShopTotal> { |
| | | |
| | | } |
| | |
| | | ts.shop_name shopName, |
| | | ts.shop_number shopNumber, |
| | | ts.shop_tags shopTags, |
| | | sus.nick_name signUser, |
| | | ts.sign_user_id signUserId, |
| | | null firstWithdraw, |
| | | sub.nick_name belongUser, |
| | | sd.dept_name belongDept, |
| | | ts.belong_user_id belongUserId, |
| | | ts.shop_source shopSource, |
| | | ts.sign_area_name signAreaName, |
| | | CONCAT(ts.cooperation_start_time,'-',ts.cooperation_end_time) cooperationTime, |
| | |
| | | tsm.shop_marketing_total shopActivityCount, |
| | | ts.shop_custom_status shopCustomStatus |
| | | FROM t_shop ts |
| | | LEFT JOIN sys_user sus ON sus.user_id = ts.sign_user_id |
| | | LEFT JOIN sys_user sub ON sub.user_id = ts.belong_user_id |
| | | LEFT JOIN sys_dept sd ON sub.dept_id = sd.dept_id |
| | | LEFT JOIN t_shop_marketing tsm ON tsm.shop_id = ts.shop_id |
| | | WHERE ts.del_flag = 0 |
| | | <if test="param.shopType!=null and param.shopType!=''"> |
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.ruoyi.shop.mapper.shop.ShopTotalMapper"> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | DataSourceConfig dataSourceConfig = new DataSourceConfig(); |
| | | dataSourceConfig.setDbType(DbType.MYSQL); |
| | | dataSourceConfig.setTypeConvert(new MySqlTypeConvert()); |
| | | dataSourceConfig.setUrl("jdbc:mysql://47.109.78.184:10010/hrt_member?tinyInt1isBit=false"); |
| | | dataSourceConfig.setUrl("jdbc:mysql://47.109.78.184:10010/hrt_shop?tinyInt1isBit=false"); |
| | | dataSourceConfig.setDriverName("com.mysql.cj.jdbc.Driver"); |
| | | dataSourceConfig.setUsername("root"); |
| | | dataSourceConfig.setPassword("hrt123456"); |
| | |
| | | // 包名配置 |
| | | PackageConfig packageConfig = new PackageConfig(); |
| | | // 父包和子包名分开处理 |
| | | packageConfig.setParent("com.ruoyi.member"); |
| | | packageConfig.setParent("com.ruoyi.shop"); |
| | | packageConfig.setController("app"); |
| | | packageConfig.setEntity("domain.pojo"); |
| | | packageConfig.setMapper("mapper"); |
| | |
| | | strategy.setControllerMappingHyphenStyle(true); |
| | | //表和前缀处理 |
| | | String[] table = { |
| | | "t_birthday_gift","t_birthday_card" |
| | | "t_shop_total" |
| | | }; |
| | | strategy.setInclude(table); |
| | | String[] tablePre = new String[]{"t_"}; |
| | |
| | | package com.ruoyi.system.controller.conslole; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseBathDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtUserIdByDept; |
| | | import com.ruoyi.system.api.domain.poji.config.Activeness; |
| | | import com.ruoyi.system.api.domain.poji.config.SysClassification; |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import com.ruoyi.system.api.domain.vo.MgtSysSimpleUserVo; |
| | | import com.ruoyi.system.service.config.ActivenessService; |
| | | import com.ruoyi.system.service.config.SysClassificationService; |
| | | import com.ruoyi.system.service.config.SysTagService; |
| | |
| | | return R.ok(userIdByDept); |
| | | } |
| | | |
| | | /** |
| | | * @description 通过id获取用户简易信息 |
| | | * @author jqs |
| | | * @date 2023/6/25 14:41 |
| | | * @param mgtBaseBathDto |
| | | * @return R<List<MgtSysSimpleUserVo>> |
| | | */ |
| | | @PostMapping("/listSimpleUserVo") |
| | | public R<List<MgtSysSimpleUserVo>> listSimpleUserVo(@RequestBody MgtBaseBathDto mgtBaseBathDto) |
| | | { |
| | | List<MgtSysSimpleUserVo> sysSimpleUserVoList = sysUserService.listSimpleUserVo(mgtBaseBathDto); |
| | | return R.ok(sysSimpleUserVoList); |
| | | } |
| | | |
| | | } |
| | |
| | | return R.ok(page.setRecords(mgtTagPageVoList)); |
| | | } |
| | | |
| | | @ApiOperation(value = "导入标签") |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file, Integer tagType) throws Exception |
| | | { |
| | |
| | | return success(message); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载标签模板") |
| | | @PostMapping("/importTemplate") |
| | | public void importTemplate(HttpServletResponse response) throws IOException |
| | | { |
| | |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; |
| | | import com.ruoyi.system.domain.dto.MgtReplayStaffSuggestDto; |
| | | import com.ruoyi.system.domain.dto.MgtStaffEditDto; |
| | | import com.ruoyi.system.domain.dto.MgtStaffSuggestPageDto; |
| | | import com.ruoyi.system.domain.dto.MgtTagStaffSuggestDto; |
| | | import com.ruoyi.system.domain.dto.*; |
| | | import com.ruoyi.system.domain.vo.MgtDeptStaffListVo; |
| | | import com.ruoyi.system.domain.vo.MgtStaffPageVo; |
| | | import com.ruoyi.system.domain.vo.MgtStaffSuggestPageVo; |
| | | import com.ruoyi.system.domain.vo.MgtStaffSuggestTagVo; |
| | | import com.ruoyi.system.service.config.StaffSuggestService; |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pageMgtStaff", method = RequestMethod.POST) |
| | | @ApiOperation(value = "平台获取员工列表") |
| | | public R<Page<MgtStaffPageVo>> pageMgtStaff(@RequestBody MgtStaffPageDto mgtStaffPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtStaffPageDto.setUserId(userId); |
| | | Page<MgtStaffPageVo> page = new Page<>(); |
| | | page.setSize(mgtStaffPageDto.getPageSize()); |
| | | page.setCurrent(mgtStaffPageDto.getPageNum()); |
| | | List<MgtStaffPageVo> staffPageVoList = sysStaffService.pageMgtStaff(page,mgtStaffPageDto); |
| | | return R.ok(page.setRecords(staffPageVoList)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mgtEditStaff", method = RequestMethod.POST) |
| | | @ApiOperation(value = "平台编辑员工") |
| | | public R mgtEditStaff(@RequestBody MgtStaffEditDto mgtStaffEditDto) { |
New file |
| | |
| | | package com.ruoyi.system.controller.sys; |
| | | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.domain.pojo.sys.SysMenu; |
| | | import com.ruoyi.system.service.sys.ISysMenuService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName StaffMenuController |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/25 16:19 |
| | | * @Version 1.0 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/staffMenu") |
| | | public class StaffMenuController { |
| | | |
| | | |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @ApiOperation(value = "加载对应部门员工菜单列表树") |
| | | @GetMapping(value = "/roleStaffMenuTreeselect/{deptId}") |
| | | public AjaxResult deptStaffMenuTreeselect(@PathVariable("deptId") Long deptId) |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectStaffMenuList(userId); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", menuService.selectStaffMenuListByDeptId(deptId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return ajax; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "加载对应部门用户员工菜单列表树") |
| | | @GetMapping(value = "/deptUserStaffMenuTreeselect/{deptUserId}") |
| | | public AjaxResult deptUserStaffMenuTreeselect(@PathVariable("deptUserId") Long deptUserId) |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectStaffMenuList(userId); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", menuService.selectStaffMenuListByDeptUserId(deptUserId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return ajax; |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| | | } |
| | | dept.setParentId(100L); |
| | | dept.setOrderNum(1); |
| | | dept.setCreateBy(SecurityUtils.getUsername()); |
| | | return toAjax(deptService.insertDept(dept)); |
| | | } |
| | |
| | | package com.ruoyi.system.controller.sys; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.dto.AppEditUserDto; |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysDept; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysRole; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.api.model.AppMiniLoginVo; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import com.ruoyi.system.api.model.QwH5LoginVo; |
| | | import com.ruoyi.system.api.model.QwUserDetailDto; |
| | | import com.ruoyi.system.service.config.SysTagService; |
| | | import com.ruoyi.system.domain.dto.UserMenuEditDto; |
| | | import com.ruoyi.system.service.sys.*; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/editUserMenu") |
| | | public R editUserMenu(@RequestBody UserMenuEditDto userMenuEditDto){ |
| | | userService.editUserMenu(userMenuEditDto); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.dto; |
| | | |
| | | import com.ruoyi.system.api.domain.dto.MgtPageDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName MgtStaffPageDto |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/25 17:46 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtStaffPageDto extends MgtPageDto { |
| | | |
| | | @ApiModelProperty(value = "部门id") |
| | | private Long deptId; |
| | | |
| | | @ApiModelProperty(value = "员工姓名") |
| | | private String staffName; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName UserMenuEditDto |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/25 16:35 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class UserMenuEditDto { |
| | | |
| | | private Long userId; |
| | | |
| | | /** 菜单组 */ |
| | | private Long[] menuIds; |
| | | |
| | | /** 菜单组 */ |
| | | private Long[] staffMenuIds; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | /** 菜单ID */ |
| | | private Long menuId; |
| | | |
| | | private Integer menuFrom; |
| | | |
| | | public Long getDeptId() |
| | | { |
| | | return deptId; |
| | |
| | | this.menuId = menuId; |
| | | } |
| | | |
| | | public Integer getMenuFrom() { |
| | | return menuFrom; |
| | | } |
| | | |
| | | public void setMenuFrom(Integer menuFrom) { |
| | | this.menuFrom = menuFrom; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | |
| | | package com.ruoyi.system.domain.pojo.sys; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import com.ruoyi.common.core.web.domain.BaseEntity; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.core.web.domain.BaseEntity; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 菜单权限表 sys_menu |
| | |
| | | |
| | | /** 菜单图标 */ |
| | | private String icon; |
| | | |
| | | /** 菜单来源1管理平台2员工端 */ |
| | | private Integer menuFrom; |
| | | |
| | | |
| | | /** 子菜单 */ |
| | | private List<SysMenu> children = new ArrayList<SysMenu>(); |
| | |
| | | { |
| | | this.children = children; |
| | | } |
| | | |
| | | |
| | | public Integer getMenuFrom() { |
| | | return menuFrom; |
| | | } |
| | | |
| | | public void setMenuFrom(Integer menuFrom) { |
| | | this.menuFrom = menuFrom; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .append("menuFrom", getMenuFrom()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | /** 菜单ID */ |
| | | private Long menuId; |
| | | |
| | | private Integer menuFrom; |
| | | |
| | | public Long getUserId() |
| | | { |
| | | return userId; |
| | |
| | | this.menuId = menuId; |
| | | } |
| | | |
| | | public Integer getMenuFrom() { |
| | | return menuFrom; |
| | | } |
| | | |
| | | public void setMenuFrom(Integer menuFrom) { |
| | | this.menuFrom = menuFrom; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
New file |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName MgtStaffPageVo |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/6/25 17:49 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtStaffPageVo { |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long userId; |
| | | /** |
| | | * 员工姓名 |
| | | */ |
| | | @ApiModelProperty(value = "员工姓名") |
| | | private String staffName; |
| | | /** |
| | | * 员工电话 |
| | | */ |
| | | @ApiModelProperty(value = "员工电话") |
| | | private String staffMobile; |
| | | /** |
| | | * 员工邮箱 |
| | | */ |
| | | @ApiModelProperty(value = "员工邮箱") |
| | | private String staffEmail; |
| | | /** |
| | | * 员工职位 |
| | | */ |
| | | @ApiModelProperty(value = "员工职位") |
| | | private String staffPost; |
| | | /** |
| | | * 员工头像 |
| | | */ |
| | | @ApiModelProperty(value = "员工头像") |
| | | private String staffAvatar; |
| | | /** |
| | | * 负责人标记 |
| | | */ |
| | | @ApiModelProperty(value = "负责人标记") |
| | | private String headFlag; |
| | | } |
| | |
| | | @Excel(name = "平台响应时间", width = 30) |
| | | @ApiModelProperty(value = "平台响应时间") |
| | | private String responseTime; |
| | | @Excel(name = "建议标签", width = 30) |
| | | @ApiModelProperty(value = "建议标签") |
| | | private String suggestTags; |
| | | } |
| | |
| | | package com.ruoyi.system.mapper.staff; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.system.domain.dto.MgtStaffPageDto; |
| | | import com.ruoyi.system.domain.pojo.staff.SysStaff; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.vo.MgtDeptStaffListVo; |
| | | import com.ruoyi.system.domain.vo.MgtStaffPageVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | List<MgtDeptStaffListVo> listMgtDeptStaffByDept(@Param("deptId") Long deptId,@Param("userId") Long userId); |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/6/25 17:52 |
| | | * @param page |
| | | * @param mgtStaffPageDto |
| | | * @return List<MgtStaffPageVo> |
| | | */ |
| | | List<MgtStaffPageVo> pageMgtStaff(Page page, @Param("param")MgtStaffPageDto mgtStaffPageDto); |
| | | } |
| | |
| | | public List<SysMenu> selectMenuList(SysMenu menu); |
| | | |
| | | /** |
| | | * 查询系统菜单列表 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 菜单列表 |
| | | */ |
| | | public List<SysMenu> selectStaffMenuList(SysMenu menu); |
| | | |
| | | /** |
| | | * 根据用户所有权限 |
| | | * |
| | | * @return 权限列表 |
| | |
| | | * @return 菜单列表 |
| | | */ |
| | | public List<SysMenu> selectMenuListByUserId(SysMenu menu); |
| | | |
| | | /** |
| | | * 根据用户查询系统菜单列表 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @return 菜单列表 |
| | | */ |
| | | public List<SysMenu> selectStaffMenuListByUserId(SysMenu menu); |
| | | |
| | | /** |
| | | * 根据角色ID查询权限 |
| | |
| | | public List<Long> selectMenuListByDeptId(@Param("deptId") Long deptId, @Param("menuCheckStrictly") boolean menuCheckStrictly); |
| | | |
| | | /** |
| | | * @description selectMenuListByDeptId |
| | | * @param deptId |
| | | * @return List<SysMenu> |
| | | * @author jqs34 |
| | | * @date 2023/6/18 19:13 |
| | | */ |
| | | public List<Long> selectStaffMenuListByDeptId(@Param("deptId") Long deptId, @Param("menuCheckStrictly") boolean menuCheckStrictly); |
| | | |
| | | /** |
| | | * @description selectMenuListByDeptUserId |
| | | * @param deptUserId |
| | | * @return List<SysMenu> |
| | |
| | | public List<Long> selectMenuListByDeptUserId(@Param("deptUserId") Long deptUserId, @Param("menuCheckStrictly") boolean menuCheckStrictly); |
| | | |
| | | /** |
| | | * @description selectMenuListByDeptUserId |
| | | * @param deptUserId |
| | | * @return List<SysMenu> |
| | | * @author jqs34 |
| | | * @date 2023/6/18 19:13 |
| | | */ |
| | | public List<Long> selectStaffMenuListByDeptUserId(@Param("deptUserId") Long deptUserId, @Param("menuCheckStrictly") boolean menuCheckStrictly); |
| | | |
| | | /** |
| | | * 根据菜单ID查询信息 |
| | | * |
| | | * @param menuId 菜单ID |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.domain.dto.MgtUserIdByDept; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.api.domain.vo.MgtSysSimpleUserVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return List<Long> |
| | | */ |
| | | List<Long> getUserIdByDept(@Param("param")MgtUserIdByDept userIdByDept); |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/6/25 14:35 |
| | | * @param userIds |
| | | * @return List<MgtSysSimpleUserVo> |
| | | */ |
| | | List<MgtSysSimpleUserVo> listSimpleUserVo(@Param("userIds")String userIds); |
| | | } |
| | |
| | | @Override |
| | | public void mgtReplayStaffSuggest(MgtReplayStaffSuggestDto mgtReplayStaffSuggestDto){ |
| | | Long userId = mgtReplayStaffSuggestDto.getUserId(); |
| | | SysUser sysUser = sysUserService.getById(userId); |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | StaffSuggest staffSuggest = this.getById(mgtReplayStaffSuggestDto.getSuggestId()); |
| | | staffSuggest.setReplayContent(mgtReplayStaffSuggestDto.getReplayContent()); |
| | | staffSuggest.setReplayTime(new Date()); |
| | |
| | | package com.ruoyi.system.service.impl.staff; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.domain.dto.MgtStaffEditDto; |
| | | import com.ruoyi.system.domain.dto.MgtStaffPageDto; |
| | | import com.ruoyi.system.domain.pojo.staff.SysStaff; |
| | | import com.ruoyi.system.domain.vo.MgtDeptStaffListVo; |
| | | import com.ruoyi.system.domain.vo.MgtStaffPageVo; |
| | | import com.ruoyi.system.mapper.staff.SysStaffMapper; |
| | | import com.ruoyi.system.service.staff.SysStaffService; |
| | | import com.ruoyi.system.service.sys.ISysUserService; |
| | |
| | | this.saveOrUpdate(sysStaff); |
| | | sysUserService.deleteUserById(mgtBaseGetDto.getUserId()); |
| | | } |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/6/25 17:52 |
| | | * @param page |
| | | * @param mgtStaffPageDto |
| | | * @return List<MgtStaffPageVo> |
| | | */ |
| | | @Override |
| | | public List<MgtStaffPageVo> pageMgtStaff(Page page, MgtStaffPageDto mgtStaffPageDto){ |
| | | return sysStaffMapper.pageMgtStaff(page, mgtStaffPageDto); |
| | | } |
| | | } |
| | |
| | | } |
| | | dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); |
| | | //新增部门 |
| | | deptMapper.insertDept(dept); |
| | | return insertDeptMenu(dept); |
| | | int i = deptMapper.insertDept(dept); |
| | | if(dept.getMenuIds()!=null||dept.getStaffMenuIds()!=null){ |
| | | return insertDeptMenu(dept); |
| | | }else{ |
| | | return i; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | SysDeptMenu rm = new SysDeptMenu(); |
| | | rm.setDeptId(dept.getDeptId()); |
| | | rm.setMenuId(menuId); |
| | | rm.setMenuFrom(1); |
| | | list.add(rm); |
| | | } |
| | | for(Long menuId : dept.getStaffMenuIds()){ |
| | | SysDeptMenu rm = new SysDeptMenu(); |
| | | rm.setDeptId(dept.getDeptId()); |
| | | rm.setMenuId(menuId); |
| | | rm.setMenuFrom(2); |
| | | list.add(rm); |
| | | } |
| | | if (list.size() > 0) |
| | |
| | | { |
| | | return selectMenuList(new SysMenu(), userId); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户查询系统菜单列表 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 菜单列表 |
| | | */ |
| | | @Override |
| | | public List<SysMenu> selectStaffMenuList(Long userId){ |
| | | return selectStaffMenuList(new SysMenu(), userId); |
| | | } |
| | | /** |
| | | * 查询系统菜单列表 |
| | | * |
| | |
| | | { |
| | | menu.getParams().put("userId", userId); |
| | | menuList = menuMapper.selectMenuListByUserId(menu); |
| | | } |
| | | return menuList; |
| | | } |
| | | |
| | | /** |
| | | * 根据用户查询系统菜单列表 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @param userId 用户ID |
| | | * @return 菜单列表 |
| | | */ |
| | | @Override |
| | | public List<SysMenu> selectStaffMenuList(SysMenu menu, Long userId){ |
| | | List<SysMenu> menuList = null; |
| | | // 管理员显示所有菜单信息 |
| | | if (SysUser.isAdmin(userId)) |
| | | { |
| | | menuList = menuMapper.selectStaffMenuList(menu); |
| | | } |
| | | else |
| | | { |
| | | menu.getParams().put("userId", userId); |
| | | menuList = menuMapper.selectStaffMenuListByUserId(menu); |
| | | } |
| | | return menuList; |
| | | } |
| | |
| | | |
| | | /** |
| | | * @description selectMenuListByDeptId |
| | | * @param deptId |
| | | * @return List<SysMenu> |
| | | * @author jqs34 |
| | | * @date 2023/6/18 19:13 |
| | | */ |
| | | @Override |
| | | public List<Long> selectStaffMenuListByDeptId(Long deptId){ |
| | | return menuMapper.selectStaffMenuListByDeptId(deptId, true); |
| | | } |
| | | |
| | | /** |
| | | * @description selectMenuListByDeptId |
| | | * @param deptUserId |
| | | * @return List<SysMenu> |
| | | * @author jqs34 |
| | | * @date 2023/6/18 19:13 |
| | | */ |
| | | @Override |
| | | public List<Long> selectMenuListByDeptUserId(Long deptUserId){ |
| | | return menuMapper.selectMenuListByDeptUserId(deptUserId, true); |
| | | } |
| | | |
| | | /** |
| | | * @description selectMenuListByDeptId |
| | | * @param deptUserId |
| | | * @return List<SysMenu> |
| | | * @author jqs34 |
| | | * @date 2023/6/18 19:13 |
| | | */ |
| | | @Override |
| | | public List<Long> selectStaffMenuListByDeptUserId(Long deptUserId){ |
| | | return menuMapper.selectStaffMenuListByDeptUserId(deptUserId, true); |
| | | } |
| | | |
| | | /** |
| | | * 构建前端路由所需要的菜单 |
| | | * |
| | | * @param menus 菜单列表 |
| | |
| | | import com.ruoyi.common.datascope.annotation.DataScope; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.dto.AppEditUserDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseBathDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtUserIdByDept; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysRole; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.api.domain.vo.MgtSysSimpleUserVo; |
| | | import com.ruoyi.system.domain.dto.UserMenuEditDto; |
| | | import com.ruoyi.system.domain.pojo.sys.SysPost; |
| | | import com.ruoyi.system.domain.pojo.sys.SysUserMenu; |
| | | import com.ruoyi.system.domain.pojo.sys.SysUserPost; |
| | | import com.ruoyi.system.domain.pojo.sys.SysUserRole; |
| | | import com.ruoyi.system.mapper.sys.*; |
| | |
| | | |
| | | @Resource |
| | | protected Validator validator; |
| | | |
| | | @Resource |
| | | protected SysUserMenuMapper userMenuMapper; |
| | | |
| | | /** |
| | | * 根据条件分页查询用户列表 |
| | |
| | | userIdByDept.setUserIdList(userIdList); |
| | | return userIdByDept; |
| | | } |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/6/25 14:35 |
| | | * @param mgtBaseBathDto |
| | | * @return List<MgtSysSimpleUserVo> |
| | | */ |
| | | @Override |
| | | public List<MgtSysSimpleUserVo> listSimpleUserVo(MgtBaseBathDto mgtBaseBathDto){ |
| | | return userMapper.listSimpleUserVo(mgtBaseBathDto.getIds()); |
| | | } |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/6/25 16:37 |
| | | * @param userMenuEditDto |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void editUserMenu(UserMenuEditDto userMenuEditDto){ |
| | | userMenuMapper.deleteUserMenuByUserId(userMenuEditDto.getUserId()); |
| | | int rows = 1; |
| | | // 新增用户与角色管理 |
| | | List<SysUserMenu> list = new ArrayList<SysUserMenu>(); |
| | | for (Long menuId : userMenuEditDto.getMenuIds()) |
| | | { |
| | | SysUserMenu rm = new SysUserMenu(); |
| | | rm.setUserId(userMenuEditDto.getUserId()); |
| | | rm.setMenuId(menuId); |
| | | rm.setMenuFrom(1); |
| | | list.add(rm); |
| | | } |
| | | for(Long menuId : userMenuEditDto.getStaffMenuIds()){ |
| | | SysUserMenu rm = new SysUserMenu(); |
| | | rm.setUserId(userMenuEditDto.getUserId()); |
| | | rm.setMenuId(menuId); |
| | | rm.setMenuFrom(2); |
| | | list.add(rm); |
| | | } |
| | | if (list.size() > 0) |
| | | { |
| | | rows = userMenuMapper.batchUserMenu(list); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.staff; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; |
| | | import com.ruoyi.system.domain.dto.MgtStaffEditDto; |
| | | import com.ruoyi.system.domain.dto.MgtStaffPageDto; |
| | | import com.ruoyi.system.domain.pojo.staff.SysStaff; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.domain.vo.MgtDeptStaffListVo; |
| | | import com.ruoyi.system.domain.vo.MgtStaffPageVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @date 2023/6/18 22:01 |
| | | */ |
| | | void mgtDeleteStaff(MgtBaseGetDto mgtBaseGetDto); |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/6/25 17:52 |
| | | * @param page |
| | | * @param mgtStaffPageDto |
| | | * @return List<MgtStaffPageVo> |
| | | */ |
| | | List<MgtStaffPageVo> pageMgtStaff(Page page, MgtStaffPageDto mgtStaffPageDto); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 根据用户查询系统菜单列表 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 菜单列表 |
| | | */ |
| | | public List<SysMenu> selectStaffMenuList(Long userId); |
| | | |
| | | /** |
| | | * 根据用户查询系统菜单列表 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @param userId 用户ID |
| | | * @return 菜单列表 |
| | | */ |
| | | public List<SysMenu> selectMenuList(SysMenu menu, Long userId); |
| | | |
| | | /** |
| | | * 根据用户查询系统菜单列表 |
| | | * |
| | | * @param menu 菜单信息 |
| | | * @param userId 用户ID |
| | | * @return 菜单列表 |
| | | */ |
| | | public List<SysMenu> selectStaffMenuList(SysMenu menu, Long userId); |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * @description selectMenuListByDeptId |
| | | * @param deptId |
| | | * @return List<SysMenu> |
| | | * @author jqs34 |
| | | * @date 2023/6/18 19:13 |
| | | */ |
| | | public List<Long> selectStaffMenuListByDeptId(Long deptId); |
| | | |
| | | /** |
| | | * @description selectMenuListByDeptId |
| | | * @param deptUserId |
| | | * @return List<SysMenu> |
| | | * @author jqs34 |
| | |
| | | public List<Long> selectMenuListByDeptUserId(Long deptUserId); |
| | | |
| | | /** |
| | | * @description selectMenuListByDeptId |
| | | * @param deptUserId |
| | | * @return List<SysMenu> |
| | | * @author jqs34 |
| | | * @date 2023/6/18 19:13 |
| | | */ |
| | | public List<Long> selectStaffMenuListByDeptUserId(Long deptUserId); |
| | | |
| | | /** |
| | | * 构建前端路由所需要的菜单 |
| | | * |
| | | * @param menus 菜单列表 |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.domain.dto.AppEditUserDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseBathDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtUserIdByDept; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.api.domain.vo.MgtSysSimpleUserVo; |
| | | import com.ruoyi.system.domain.dto.UserMenuEditDto; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return MgtUserIdByDept |
| | | */ |
| | | MgtUserIdByDept getUserIdByDept(MgtUserIdByDept userIdByDept); |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/6/25 14:36 |
| | | * @param mgtBaseBathDto |
| | | * @return List<MgtSysSimpleUserVo> |
| | | */ |
| | | List<MgtSysSimpleUserVo> listSimpleUserVo(MgtBaseBathDto mgtBaseBathDto); |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/6/25 16:37 |
| | | * @param userMenuEditDto |
| | | * @return void |
| | | */ |
| | | void editUserMenu(UserMenuEditDto userMenuEditDto); |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="pageMgtStaff" resultType="com.ruoyi.system.domain.vo.MgtStaffPageVo"> |
| | | SELECT |
| | | su.user_id userId, |
| | | tss.staff_name staffName, |
| | | tss.staff_mobile staffMobile, |
| | | tss.staff_email staffEmail, |
| | | tss.staff_post staffPost, |
| | | tss.staff_avatar staffAvatar, |
| | | tss.head_flag headFlag |
| | | FROM t_sys_staff tss |
| | | INNER JOIN sys_user su ON tss.user_id = su.user_id |
| | | WHERE su.del_flag = 0 |
| | | <if test="param.deptId!=null and param.deptId!=''"> |
| | | AND su.dept_id = #{param.deptId} |
| | | </if> |
| | | <if test="param.staffName!=null and param.staffName!=''"> |
| | | AND tss.staff_name LIKE CONCAT('%',#{param.staffName},'%') |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | <insert id="insertDept" parameterType="SysDept"> |
| | | <insert id="insertDept" parameterType="SysDept" useGeneratedKeys="true" keyProperty="deptId"> |
| | | insert into sys_dept( |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | | <if test="parentId != null and parentId != 0">parent_id,</if> |
| | |
| | | <select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult"> |
| | | <include refid="selectMenuVo"/> |
| | | <where> |
| | | AND menu_from = 1 |
| | | <if test="menuName != null and menuName != ''"> |
| | | AND menu_name like concat('%', #{menuName}, '%') |
| | | </if> |
| | | <if test="visible != null and visible != ''"> |
| | | AND visible = #{visible} |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND status = #{status} |
| | | </if> |
| | | </where> |
| | | order by parent_id, order_num |
| | | </select> |
| | | |
| | | <select id="selectStaffMenuList" parameterType="SysMenu" resultMap="SysMenuResult"> |
| | | <include refid="selectMenuVo"/> |
| | | <where> |
| | | AND menu_from = 2 |
| | | <if test="menuName != null and menuName != ''"> |
| | | AND menu_name like concat('%', #{menuName}, '%') |
| | | </if> |
| | |
| | | |
| | | <select id="selectMenuTreeAll" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 |
| | | from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 AND menu_from = 1 |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | |
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id |
| | | left join sys_user_role ur on rm.role_id = ur.role_id |
| | | left join sys_role ro on ur.role_id = ro.role_id |
| | | where ur.user_id = #{params.userId} |
| | | where ur.user_id = #{params.userId} AND m.menu_from = 1 |
| | | <if test="menuName != null and menuName != ''"> |
| | | AND m.menu_name like concat('%', #{menuName}, '%') |
| | | </if> |
| | |
| | | </if> |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | <select id="selectStaffMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | from sys_menu m |
| | | left join sys_user_menu rm on m.menu_id = rm.menu_id |
| | | where rm.user_id = #{params.userId} AND rm.menu_from = 2 |
| | | <if test="menuName != null and menuName != ''"> |
| | | AND m.menu_name like concat('%', #{menuName}, '%') |
| | | </if> |
| | | <if test="visible != null and visible != ''"> |
| | | AND m.visible = #{visible} |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND m.status = #{status} |
| | | </if> |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | |
| | | left join sys_user_role ur on rm.role_id = ur.role_id |
| | | left join sys_role ro on ur.role_id = ro.role_id |
| | | left join sys_user u on ur.user_id = u.user_id |
| | | where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0 |
| | | where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0 AND menu_from = 1 |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | |
| | | select m.menu_id |
| | | from sys_menu m |
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id |
| | | where rm.role_id = #{roleId} |
| | | where rm.role_id = #{roleId} AND m.menu_from = 1 |
| | | <if test="menuCheckStrictly"> |
| | | and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId}) |
| | | </if> |
| | |
| | | select m.menu_id |
| | | from sys_menu m |
| | | left join sys_dept_menu rm on m.menu_id = rm.menu_id |
| | | where rm.dept_id = #{deptId} |
| | | where rm.dept_id = #{deptId} AND m.menu_from = 1 AND rm.menu_from = 1 |
| | | <if test="menuCheckStrictly"> |
| | | and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_dept_menu rm on m.menu_id = rm.menu_id and rm.dept_id = #{deptId}) |
| | | </if> |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | <select id="selectStaffMenuListByDeptId" resultType="Long"> |
| | | select m.menu_id |
| | | from sys_menu m |
| | | left join sys_dept_menu rm on m.menu_id = rm.menu_id |
| | | where rm.dept_id = #{deptId} AND m.menu_from = 2 AND rm.menu_from = 2 |
| | | <if test="menuCheckStrictly"> |
| | | and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_dept_menu rm on m.menu_id = rm.menu_id and rm.dept_id = #{deptId}) |
| | | </if> |
| | |
| | | select m.menu_id |
| | | from sys_menu m |
| | | left join sys_user_menu rm on m.menu_id = rm.menu_id |
| | | where rm.user_id = #{deprUserId} |
| | | where rm.user_id = #{deptUserId} AND m.menu_from = 1 AND rm.menu_from = 1 |
| | | <if test="menuCheckStrictly"> |
| | | and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_user_menu rm on m.menu_id = rm.menu_id and rm.user_id = #{deptUserId}) |
| | | </if> |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | <select id="selectStaffMenuListByDeptUserId" resultType="Long"> |
| | | select m.menu_id |
| | | from sys_menu m |
| | | left join sys_user_menu rm on m.menu_id = rm.menu_id |
| | | where rm.user_id = #{deptUserId} AND m.menu_from = 2 AND rm.menu_from = 2 |
| | | <if test="menuCheckStrictly"> |
| | | and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_user_menu rm on m.menu_id = rm.menu_id and rm.user_id = #{deptUserId}) |
| | | </if> |
| | |
| | | from sys_menu m |
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id |
| | | left join sys_user_role ur on rm.role_id = ur.role_id |
| | | where m.menu_from = 1 |
| | | </select> |
| | | |
| | | <select id="selectMenuPermsByUserId" parameterType="Long" resultType="String"> |
| | |
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id |
| | | left join sys_user_role ur on rm.role_id = ur.role_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | where m.status = '0' and r.status = '0' and ur.user_id = #{userId} |
| | | where m.status = '0' and r.status = '0' and ur.user_id = #{userId} AND m.menu_from = 1 |
| | | </select> |
| | | |
| | | <select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String"> |
| | | select distinct m.perms |
| | | from sys_menu m |
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id |
| | | where m.status = '0' and rm.role_id = #{roleId} |
| | | where m.status = '0' and rm.role_id = #{roleId} AND m.menu_from = 1 |
| | | </select> |
| | | |
| | | <select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult"> |
| | | <include refid="selectMenuVo"/> |
| | | where menu_id = #{menuId} |
| | | where menu_id = #{menuId} AND m.menu_from = 1 |
| | | </select> |
| | | |
| | | <select id="hasChildByMenuId" resultType="Integer"> |
| | | select count(1) from sys_menu where parent_id = #{menuId} |
| | | select count(1) from sys_menu where parent_id = #{menuId} AND m.menu_from = 1 |
| | | </select> |
| | | |
| | | <select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult"> |
| | | <include refid="selectMenuVo"/> |
| | | where menu_name=#{menuName} and parent_id = #{parentId} limit 1 |
| | | where menu_name=#{menuName} and parent_id = #{parentId} limit 1 AND m.menu_from = 1 |
| | | </select> |
| | | |
| | | <update id="updateMenu" parameterType="SysMenu"> |
| | |
| | | <if test="icon !=null and icon != ''">icon = #{icon},</if> |
| | | <if test="remark != null and remark != ''">remark = #{remark},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="menuFrom != null and menuFrom != ''">menu_from = #{menuFrom},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where menu_id = #{menuId} |
| | |
| | | <if test="icon != null and icon != ''">icon,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="menuFrom != null and menuFrom != ''">menu_from,</if> |
| | | create_time |
| | | )values( |
| | | <if test="menuId != null and menuId != 0">#{menuId},</if> |
| | |
| | | <if test="icon != null and icon != ''">#{icon},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="menuFrom != null and menuFrom != ''">#{menuFrom},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="dataScope" column="user_data_scope" /> |
| | | <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, |
| | | 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, |
| | | 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 |
| | |
| | | FROM sys_user |
| | | WHERE del_flag = '0' |
| | | <if test="param.deptId != null and param.deptId != ''"> |
| | | dept_id = #{param.deptId} |
| | | AND dept_id = #{param.deptId} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="listSimpleUserVo" resultType="com.ruoyi.system.api.domain.vo.MgtSysSimpleUserVo"> |
| | | SELECT |
| | | su.user_id userId, |
| | | su.nick_name nickName, |
| | | sd.dept_id deptId, |
| | | sd.dept_name deptName |
| | | FROM sys_user su |
| | | LEFT JOIN sys_dept sd ON sd.dept_id = su.dept_id |
| | | WHERE su.del_flag = '0' |
| | | <if test="userIds != null and userIds != ''"> |
| | | AND FIND_IN_SET(#{userIds}, su.user_id) |
| | | </if> |
| | | </select> |
| | | </mapper> |