| File was renamed from ruoyi-service/ruoyi-goods/src/main/java/com/ruoyi/goods/dto/OrderQuery.java |
| | |
| | | package com.ruoyi.goods.dto; |
| | | package com.ruoyi.study.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("订单管理Query") |
| | |
| | | private Date endTime1; |
| | | @ApiModelProperty(value = "状态1待发货 2已发货 3已完成") |
| | | private Integer state; |
| | | @ApiModelProperty(value = "用户ids") |
| | | private List<Integer> userIds; |
| | | @ApiModelProperty(value = "页码,首页1", required = true) |
| | | private Integer pageNumber; |
| | | @ApiModelProperty(value = "页条数", required = true) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<TUser>> listAll(OrderQuery query) { |
| | | return R.fail("查询用户列表失败" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R vipBack(Integer id) { |
| | | return R.fail("用户购买会员退款失败" + cause.getMessage()); |
| | | } |
| | |
| | | |
| | | @PostMapping("/base/user/getUserById/{id}") |
| | | R<TUser> getUserById(@PathVariable("id") Integer id); |
| | | @PostMapping("/base/user/listAll") |
| | | R<List<TUser>> listAll(@RequestBody OrderQuery query); |
| | | @PostMapping("/base/user/vipBack/{id}") |
| | | R vipBack(@PathVariable("id") Integer id); |
| | | |
| | |
| | | public RedissonClient redissonClient() { |
| | | Config config = new Config(); |
| | | //线上redis |
| | | // config.useSingleServer().setAddress("redis://127.0.0.1:6379").setPassword("Xiwang2024!"); |
| | | config.useSingleServer().setAddress("redis://127.0.0.1:6379").setPassword("Xiwang2024!"); |
| | | // // 本地redis |
| | | config.useSingleServer().setAddress("redis://127.0.0.1:6379").setPassword("123456"); |
| | | // config.useSingleServer().setAddress("redis://127.0.0.1:6379").setPassword("123456"); |
| | | return Redisson.create(config); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.goods.vo.TGoodsVO; |
| | | import com.ruoyi.goods.vo.TOrderVO; |
| | | import com.ruoyi.study.api.domain.TUser; |
| | | import com.ruoyi.study.api.dto.OrderQuery; |
| | | import com.ruoyi.study.api.feignClient.StudyClient; |
| | | import com.ruoyi.study.api.vo.UserPersonalCenterVO; |
| | | import com.ruoyi.system.api.model.LoginUserParent; |
| | |
| | | private IRegionService regionService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @PostMapping("/testAddData") |
| | | @ApiOperation(value = "测试分片", tags = {"测试分片"}) |
| | | public R<Object> testAddData() { |
| | | TOrder tOrder = new TOrder(); |
| | | tOrder.setOrderNumber(""); |
| | | tOrder.setUserId(63); |
| | | tOrder.setInsertTime(new Date()); |
| | | tOrder.setGoodsId(0); |
| | | tOrder.setCount(0); |
| | | tOrder.setState(0); |
| | | tOrder.setExpress(""); |
| | | tOrder.setExpressNumber(""); |
| | | tOrder.setExpressTime(new Date()); |
| | | tOrder.setIntegral(0); |
| | | tOrder.setCompleteTime(new Date()); |
| | | tOrder.setConsigneeName(""); |
| | | tOrder.setImg(""); |
| | | tOrder.setName(""); |
| | | tOrder.setType(""); |
| | | tOrder.setConsigneePhone(""); |
| | | tOrder.setConsigneeAddress(""); |
| | | tOrder.setProvince(""); |
| | | tOrder.setCity(""); |
| | | tOrder.setRemark(""); |
| | | tOrder.setDisabled(false); |
| | | tOrder.setCreateBy(""); |
| | | tOrder.setCreateTime(new Date()); |
| | | tOrder.setUpdateBy(""); |
| | | tOrder.setUpdateTime(new Date()); |
| | | orderService.save(tOrder); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/listType") |
| | | @ApiOperation(value = "列表查询", tags = {"后台-商品类型管理"}) |
| | | public R<PageInfo<TGoodsType>> listType(@RequestBody GoodsTypeQuery query) { |
| | | QueryWrapper<TGoodsType> wrapper = new QueryWrapper<>(); |
| | | if (StringUtils.hasLength(query.getName())) { |
| | | wrapper.like("name", query.getName()); |
| | | } |
| | | // wrapper.ne("isDelete",1); |
| | | wrapper.orderByDesc("id"); |
| | | List<TGoodsType> list = goodsTypeService.list(wrapper); |
| | | |
| | | PageInfo<TGoodsType> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | List<TGoodsType> list = goodsTypeService.listType(query, res); |
| | | res.setRecords(list); |
| | | return R.ok(res); |
| | | } |
| | |
| | | wrapper.like("name", query.getName()); |
| | | } |
| | | wrapper.orderByDesc("id"); |
| | | List<TGoods> list = goodsService.list(wrapper); |
| | | PageInfo<TGoods> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | |
| | | List<TGoods> list = goodsService.listAll(query, res); |
| | | for (TGoods tGoods : list) { |
| | | Long temp = 0L; |
| | | List<TOrder> list1 = orderService.list(new QueryWrapper<TOrder>().eq("goodsId", tGoods.getId())); |
| | |
| | | } |
| | | } |
| | | |
| | | PageInfo<TGoods> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | res.setRecords(list); |
| | | return R.ok(res); |
| | | } |
| | |
| | | query.setStartTime1(parse); |
| | | query.setEndTime1(parse1); |
| | | } |
| | | List<TOrderVO> list = orderService.listAll(query); |
| | | List<TOrderVO> list1 = new ArrayList<>(); |
| | | PageInfo<TOrderVO> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | |
| | | List<TUser> data = studyClient.listAll(query).getData(); |
| | | List<Integer> userIds = data.stream().map(TUser::getId).collect(Collectors.toList()); |
| | | query.setUserIds(userIds); |
| | | List<TOrderVO> list = orderService.listAll(query,res); |
| | | for (TOrderVO tOrderVO : list) { |
| | | TUser data = studyClient.getUserById(tOrderVO.getUserId()).getData(); |
| | | if (data != null) { |
| | | tOrderVO.setUserName(data.getName()); |
| | | tOrderVO.setPhone(data.getPhone()); |
| | | } |
| | | if (!StringUtils.hasLength(query.getPhone()) && !StringUtils.hasLength(query.getUserName())) { |
| | | list1.add(tOrderVO); |
| | | continue; |
| | | } |
| | | // 如果筛选条件输入了电话或者姓名那么需要过滤掉不符合条件的数据 |
| | | if (StringUtils.hasLength(query.getPhone()) && StringUtils.hasLength(query.getUserName())) { |
| | | if (tOrderVO.getPhone().contains(query.getPhone()) && tOrderVO.getUserName().contains(query.getUserName())) { |
| | | list1.add(tOrderVO); |
| | | } |
| | | } else if (StringUtils.hasLength(query.getPhone())) { |
| | | if (tOrderVO.getPhone().contains(query.getPhone())) { |
| | | list1.add(tOrderVO); |
| | | } |
| | | } else if (StringUtils.hasLength(query.getUserName())) { |
| | | if (tOrderVO.getUserName().contains(query.getUserName())) { |
| | | list1.add(tOrderVO); |
| | | } |
| | | TUser user = data.stream().filter(e -> Objects.equals(e.getId(), tOrderVO.getUserId())).findFirst() |
| | | .orElse(null); |
| | | if (user != null){ |
| | | tOrderVO.setUserName(user.getName()); |
| | | tOrderVO.setPhone(user.getPhone()); |
| | | } |
| | | } |
| | | PageInfo<TOrderVO> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | res.setRecords(list1); |
| | | res.setRecords(list); |
| | | return R.ok(res); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.goods.domain.TGoods; |
| | | import com.ruoyi.goods.dto.GoodsTypeQuery; |
| | | import com.ruoyi.goods.vo.TGoodsVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | void updateOne(@Param("req") TGoods dto); |
| | | |
| | | TGoods getById1(@Param("id") Integer goodsId); |
| | | |
| | | List<TGoods> listAll(@Param("query") GoodsTypeQuery query,@Param("res") PageInfo<TGoods> res); |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.goods.domain.TGoodsType; |
| | | import com.ruoyi.goods.dto.GoodsTypeQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TGoodsTypeMapper extends BaseMapper<TGoodsType> { |
| | | |
| | | List<TGoodsType> pageList(@Param("query") GoodsTypeQuery query, @Param("pageInfo") PageInfo<TGoodsType> pageInfo); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.goods.domain.TOrder; |
| | | import com.ruoyi.goods.dto.OrderQuery; |
| | | import com.ruoyi.study.api.dto.OrderQuery; |
| | | import com.ruoyi.goods.vo.ExchangeRecordVO; |
| | | import com.ruoyi.goods.vo.TOrderVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | */ |
| | | public interface TOrderMapper extends BaseMapper<TOrder> { |
| | | |
| | | List<TOrderVO> listAll(@Param("req") OrderQuery query); |
| | | List<TOrderVO> listAll(@Param("req") OrderQuery query, @Param("res")PageInfo<TOrderVO> res); |
| | | |
| | | /** |
| | | * 获取商品购买数量 |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.goods.domain.Recipient; |
| | | import com.ruoyi.goods.domain.TGoods; |
| | | import com.ruoyi.goods.dto.GoodExchangeDTO; |
| | | import com.ruoyi.goods.dto.GoodsTypeQuery; |
| | | import com.ruoyi.goods.vo.GoodDetailVO; |
| | | import com.ruoyi.goods.vo.TGoodsVO; |
| | | |
| | |
| | | |
| | | void updateOne(TGoods dto); |
| | | |
| | | List<TGoods> listAll(GoodsTypeQuery query, PageInfo<TGoods> res); |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.goods.domain.TGoodsType; |
| | | import com.ruoyi.goods.dto.GoodsTypeQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ITGoodsTypeService extends IService<TGoodsType> { |
| | | |
| | | List<TGoodsType> listType(GoodsTypeQuery query, PageInfo<TGoodsType> res); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.goods.domain.TOrder; |
| | | import com.ruoyi.goods.dto.OrderQuery; |
| | | import com.ruoyi.study.api.dto.OrderQuery; |
| | | import com.ruoyi.goods.vo.ExchangeRecordVO; |
| | | import com.ruoyi.goods.vo.TOrderVO; |
| | | |
| | |
| | | */ |
| | | public interface ITOrderService extends IService<TOrder> { |
| | | |
| | | List<TOrderVO> listAll(OrderQuery query); |
| | | List<TOrderVO> listAll(OrderQuery query,PageInfo<TOrderVO> res); |
| | | |
| | | /** |
| | | * 获取商品购买数量 |
| | |
| | | import com.ruoyi.common.core.constant.RedisConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.goods.domain.Recipient; |
| | | import com.ruoyi.goods.domain.TGoods; |
| | | import com.ruoyi.goods.domain.TOrder; |
| | | import com.ruoyi.goods.dto.GoodExchangeDTO; |
| | | import com.ruoyi.goods.dto.GoodsTypeQuery; |
| | | import com.ruoyi.goods.mapper.TGoodsMapper; |
| | | import com.ruoyi.goods.service.ITGoodsService; |
| | | import com.ruoyi.goods.service.ITOrderService; |
| | |
| | | this.baseMapper.updateOne(dto); |
| | | } |
| | | |
| | | @Override |
| | | public List<TGoods> listAll(GoodsTypeQuery query, PageInfo<TGoods> res) { |
| | | List<TGoods> list = this.baseMapper.listAll(query,res); |
| | | return list; |
| | | } |
| | | |
| | | private TOrder orderInfo(GoodExchangeDTO goodExchange, Recipient recipient, Integer number, Integer goodId, int needIntegral) { |
| | | TOrder order = new TOrder(); |
| | | order.setOrderNumber(goodExchange.getOrderNumber()); |
| | |
| | | package com.ruoyi.goods.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.goods.domain.TGoodsType; |
| | | import com.ruoyi.goods.dto.GoodsTypeQuery; |
| | | import com.ruoyi.goods.mapper.TGoodsTypeMapper; |
| | | import com.ruoyi.goods.service.ITGoodsTypeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TGoodsTypeServiceImpl extends ServiceImpl<TGoodsTypeMapper, TGoodsType> implements ITGoodsTypeService { |
| | | |
| | | @Override |
| | | public List<TGoodsType> listType(GoodsTypeQuery query, PageInfo<TGoodsType> res) { |
| | | List<TGoodsType> list = this.baseMapper.pageList(query,res); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.goods.domain.TOrder; |
| | | import com.ruoyi.goods.dto.OrderQuery; |
| | | import com.ruoyi.study.api.dto.OrderQuery; |
| | | import com.ruoyi.goods.mapper.TOrderMapper; |
| | | import com.ruoyi.goods.service.ITOrderService; |
| | | import com.ruoyi.goods.vo.ExchangeRecordVO; |
| | |
| | | public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> implements ITOrderService { |
| | | |
| | | @Override |
| | | public List<TOrderVO> listAll(OrderQuery query) { |
| | | return this.baseMapper.listAll(query); |
| | | public List<TOrderVO> listAll(OrderQuery query,PageInfo<TOrderVO> res) { |
| | | return this.baseMapper.listAll(query,res); |
| | | } |
| | | |
| | | @Override |
| | |
| | | select * from t_goods |
| | | where id = #{id} |
| | | </select> |
| | | <select id="listAll" resultType="com.ruoyi.goods.domain.TGoods"> |
| | | select * from t_goods |
| | | where disabled = 0 |
| | | <if test="query.name != null and query.name!=''"> |
| | | and name like concat('%',#{query.name},'%') |
| | | </if> |
| | | order by createTime desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, name, isDelete |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.goods.domain.TGoodsType"> |
| | | select * from t_goods_type |
| | | where 1=1 |
| | | <if test="query.name != null and query.name != ''"> |
| | | and name like concat('%',#{query.name},'%') |
| | | </if> |
| | | and disabled = 0 |
| | | order by createTime desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | from t_order |
| | | left join t_goods on t_order.goodsId = t_goods.id |
| | | where 1 = 1 |
| | | <if test="req.userIds != null and req.userIds.size()>0"> |
| | | AND t_order.userId IN |
| | | <foreach collection="req.userIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != req.state"> |
| | | and t_order.state = #{req.state} |
| | | </if> |
| | |
| | | and t_order.orderNumber like CONCAT('%', #{req.orderNumber}, '%') |
| | | </if> |
| | | |
| | | <if test="null != req.startTime"> |
| | | <if test="null != req.startTime1"> |
| | | and t_order.insertTime between #{req.startTime1} and #{req.endTime1} |
| | | </if> |
| | | order by t_order.state asc, t_order.insertTime desc |
| | |
| | | @PostMapping("/listAll") |
| | | @ApiOperation(value = "列表查询", tags = {"反馈管理"}) |
| | | public AjaxResult<PageInfo<FeedbackVO>> listAll(FeedbackQuery query){ |
| | | // if (query.getEndTime()!=null){ |
| | | // query.getEndTime().setHours(23); |
| | | // query.getEndTime().setMinutes(59); |
| | | // query.getEndTime().setSeconds(59); |
| | | // } |
| | | List<FeedbackVO> list = feedbackService.listAll(query); |
| | | List<FeedbackVO> result = new ArrayList<>(); |
| | | for (FeedbackVO feedbackVO : list) { |
| | | TUser data = studyClient.getUserById(feedbackVO.getUserId()).getData(); |
| | | if (data == null )continue; |
| | | |
| | | feedbackVO.setName(data.getName()); |
| | | feedbackVO.setPhone(data.getPhone()); |
| | | if (!StringUtils.hasLength(query.getPhone()) && !StringUtils.hasLength(query.getUserName())) { |
| | | result.add(feedbackVO); |
| | | continue; |
| | | } |
| | | // 如果筛选条件输入了电话或者姓名那么需要过滤掉不符合条件的数据 |
| | | if (StringUtils.hasLength(query.getPhone()) && StringUtils.hasLength(query.getUserName())) { |
| | | if (feedbackVO.getPhone().contains(query.getPhone()) && feedbackVO.getName().contains(query.getUserName())) { |
| | | result.add(feedbackVO); |
| | | } |
| | | } else if (StringUtils.hasLength(query.getPhone())) { |
| | | if (feedbackVO.getPhone().contains(query.getPhone())) { |
| | | result.add(feedbackVO); |
| | | } |
| | | } else if (StringUtils.hasLength(query.getUserName())) { |
| | | if (feedbackVO.getName().contains(query.getUserName())) { |
| | | result.add(feedbackVO); |
| | | } |
| | | } |
| | | } |
| | | PageInfo<FeedbackVO> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | res.setTotal(result.size()); |
| | | res.setRecords(result); |
| | | List<FeedbackVO> list = feedbackService.listAll(query,res); |
| | | res.setRecords(list); |
| | | return AjaxResult.success(res); |
| | | } |
| | | |
| | |
| | | List<String> strings = new ArrayList<>(); |
| | | strings.add("insertTime"); |
| | | wrapper.orderByDesc(strings); |
| | | List<TUseGuide> useGuides = useGuideService.list(wrapper); |
| | | PageInfo<TUseGuide> res = new PageInfo<>(pageNumber, pageSize); |
| | | List<TUseGuide> useGuides = useGuideService.pageList(title,res,pageNumber,pageSize); |
| | | res.setRecords(useGuides); |
| | | res.setTotal(useGuides.size()); |
| | | return AjaxResult.success(res); |
| | | } |
| | | |
| | |
| | | List<String> strings = new ArrayList<>(); |
| | | strings.add("insertTime"); |
| | | wrapper.orderByDesc(strings); |
| | | PageInfo<TUseGuide> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | List<TUseGuide> useGuides = useGuideService.list(wrapper); |
| | | List<TUseGuide> useGuides2 = useGuideService.listAll(query); |
| | | res.setRecords(useGuides2); |
| | | res.setTotal(useGuides.size()); |
| | | |
| | | PageInfo<TUseGuide> res = new PageInfo<>(query.getPageNumber(),query.getPageSize()); |
| | | List<TUseGuide> useGuides = useGuideService.pageList(query.getTitle(),res,query.getPageNumber(),query.getPageSize()); |
| | | res.setRecords(useGuides); |
| | | return R.ok(res); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.management.mapper; |
| | | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.management.domain.TFeedback; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.management.dto.FeedbackQuery; |
| | |
| | | */ |
| | | public interface TFeedbackMapper extends BaseMapper<TFeedback> { |
| | | |
| | | List<FeedbackVO> listAll(@Param("req") FeedbackQuery query); |
| | | List<FeedbackVO> listAll(@Param("req") FeedbackQuery query,@Param("pageInfo") PageInfo<FeedbackVO> pageInfo); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.management.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.management.domain.TUseGuide; |
| | | import com.ruoyi.management.query.UseGuideQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | List<TUseGuide> listAll(@Param("req") UseGuideQuery query); |
| | | List<TUseGuide> listAllCount(@Param("req") UseGuideQuery query); |
| | | |
| | | List<TUseGuide> pageList(@Param("title")String title,@Param("pageInfo") PageInfo<TUseGuide> pageInfo); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.management.service; |
| | | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.management.domain.TFeedback; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.management.dto.FeedbackQuery; |
| | |
| | | */ |
| | | public interface ITFeedbackService extends IService<TFeedback> { |
| | | |
| | | List<FeedbackVO> listAll(FeedbackQuery query); |
| | | List<FeedbackVO> listAll(FeedbackQuery query, PageInfo<FeedbackVO> pageInfo); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.management.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.management.domain.TUseGuide; |
| | | import com.ruoyi.management.query.UseGuideQuery; |
| | | |
| | |
| | | List<TUseGuide> listAll(UseGuideQuery query); |
| | | List<TUseGuide> listAllCount(UseGuideQuery query); |
| | | |
| | | List<TUseGuide> pageList(String title, PageInfo<TUseGuide> res, Integer pageNumber, Integer pageSize); |
| | | } |
| | |
| | | package com.ruoyi.management.service.impl; |
| | | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.management.domain.TFeedback; |
| | | import com.ruoyi.management.dto.FeedbackQuery; |
| | | import com.ruoyi.management.mapper.TFeedbackMapper; |
| | |
| | | public class TFeedbackServiceImpl extends ServiceImpl<TFeedbackMapper, TFeedback> implements ITFeedbackService { |
| | | |
| | | @Override |
| | | public List<FeedbackVO> listAll(FeedbackQuery query) { |
| | | public List<FeedbackVO> listAll(FeedbackQuery query, PageInfo<FeedbackVO> pageInfo) { |
| | | |
| | | return this.baseMapper.listAll(query); |
| | | return this.baseMapper.listAll(query,pageInfo); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.management.service.impl; |
| | | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.management.domain.TUseGuide; |
| | | import com.ruoyi.management.mapper.TUseGuideMapper; |
| | | import com.ruoyi.management.query.UseGuideQuery; |
| | |
| | | public List<TUseGuide> listAllCount(UseGuideQuery query) { |
| | | return this.baseMapper.listAllCount(query); |
| | | } |
| | | |
| | | @Override |
| | | public List<TUseGuide> pageList(String title, PageInfo<TUseGuide> res, Integer pageNumber, Integer pageSize) { |
| | | List<TUseGuide> list = this.baseMapper.pageList(title,res); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | id, userId, img, content, state |
| | | </sql> |
| | | <select id="listAll" resultType="com.ruoyi.management.vo.FeedbackVO"> |
| | | select t1.*,t1.createTime as insertTime |
| | | select t1.*,t2.name,t2.phone,t1.createTime as insertTime |
| | | from t_feedback t1 |
| | | left join dolphin_study.t_user t2 on t1.userId = t2.id |
| | | where 1=1 |
| | | and t1.disabled = 0 |
| | | <if test="null != req.phone and req.phone !=''"> |
| | | and t2.phone like concat('%',#{req.phone},'%') |
| | | </if> |
| | | <if test="null != req.userName and req.userName !=''"> |
| | | and t2.name like concat('%',#{req.userName},'%') |
| | | </if> |
| | | <if test="null != req.startTime and req.startTime !=''"> |
| | | and t1.createTime between #{req.startTime} and #{req.endTime} |
| | | </if> |
| | | |
| | | <if test="null != req.state"> |
| | | and t1.state = #{req.state} |
| | |
| | | order by insertTtime desc |
| | | |
| | | </select> |
| | | <select id="pageList" resultType="com.ruoyi.management.domain.TUseGuide"> |
| | | select * from t_use_guide |
| | | where 1=1 |
| | | <if test="null != title and '' != title"> |
| | | and title like CONCAT('%', #{title}, '%') |
| | | </if> |
| | | AND disabled = 0 |
| | | order by createTime |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | categoryVO.setSecondList(list1); |
| | | } |
| | | res.setRecords(list); |
| | | res.setTotal(list.size()); |
| | | return R.ok(res); |
| | | } |
| | | @PostMapping("/add") |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | query.setIds(integers); |
| | | List<SubjectVO> list = service.listAll(query); |
| | | List<SubjectVO> list = service.listAll(query,res); |
| | | Map<Integer, String> categoryMap = categoryService.list(null).stream() |
| | | .collect(Collectors.toMap(TCategory::getId, TCategory::getName)); |
| | | for (SubjectVO subjectVO : list) { |
| | | if (subjectVO.getFirstCategory()!=null&&subjectVO.getSecondCategory()!=null){ |
| | | TCategory byId1 = categoryService.getById(subjectVO.getFirstCategory()); |
| | | TCategory byId2 = categoryService.getById(subjectVO.getSecondCategory()); |
| | | String byId1 = categoryMap.get(subjectVO.getFirstCategory()); |
| | | String byId2 = categoryMap.get(subjectVO.getSecondCategory()); |
| | | if (byId1!=null&& byId2!=null){ |
| | | subjectVO.setCategoryName(byId1.getName()+"-"+byId2.getName()); |
| | | subjectVO.setCategoryName(byId1+"-"+byId2); |
| | | } |
| | | } |
| | | // StringBuilder stringBuilder = new StringBuilder(""); |
| | |
| | | // subjectVO.setType(substring); |
| | | } |
| | | res.setRecords(list); |
| | | res.setTotal(list.size()); |
| | | return R.ok(res); |
| | | } |
| | | @PostMapping("/add") |
| | |
| | | |
| | | @PostMapping("/subjectList") |
| | | // @ApiOperation(value = "配置学习类型选择题目", tags = {"题目管理"}) |
| | | public R<PageInfo<TSubject>> subjectList(@RequestBody ChoiceSubject query) { |
| | | PageInfo<TSubject> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | QueryWrapper<TSubject> wrapper = new QueryWrapper<>(); |
| | | public R<IPage<TSubject>> subjectList(@RequestBody ChoiceSubject query) { |
| | | // 创建分页对象,传入当前页和每页显示条数 |
| | | IPage<TSubject> page = new Page<>(query.getPageNumber(), query.getPageSize()); QueryWrapper<TSubject> wrapper = new QueryWrapper<>(); |
| | | if (StringUtils.hasLength(query.getName())) { |
| | | wrapper.like("name", query.getName()); |
| | | } |
| | |
| | | } |
| | | List<TCategory> list5 = categoryService.list(); |
| | | wrapper.eq("state", 1); |
| | | List<TSubject> list = subjectService.list(wrapper); |
| | | // 执行分页查询 |
| | | IPage<TSubject> res = subjectService.page(page, wrapper); |
| | | List<TSubject> list = res.getRecords(); |
| | | |
| | | switch (query.getStudyType()) { |
| | | case 1: |
| | |
| | | } |
| | | } |
| | | res.setRecords(list); |
| | | res.setTotal(list.size()); |
| | | return R.ok(res); |
| | | case 2: |
| | | // 查询出error字段不为空的数据 |
| | |
| | | } |
| | | } |
| | | res.setRecords(tSubjects); |
| | | res.setTotal(tSubjects.size()); |
| | | return R.ok(res); |
| | | case 3: |
| | | List<TSubject> list2 = subjectService.list(wrapper); |
| | |
| | | } |
| | | } |
| | | res.setRecords(list2); |
| | | res.setTotal(list2.size()); |
| | | return R.ok(res); |
| | | case 4: |
| | | // 查询出error字段不为空的数据 |
| | |
| | | } |
| | | } |
| | | res.setRecords(tSubjects3); |
| | | res.setTotal(tSubjects3.size()); |
| | | return R.ok(res); |
| | | case 5: |
| | | List<TSubject> list4 = subjectService.list(wrapper); |
| | |
| | | } |
| | | } |
| | | res.setRecords(list4); |
| | | res.setTotal(list4.size()); |
| | | return R.ok(res); |
| | | } |
| | | List<TSubject> objects = new ArrayList<>(); |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | query.setIds(integers); |
| | | List<SubjectVO> list = subjectService.listAll(query,type); |
| | | List<SubjectVO> list = subjectService.listAll(query,type,res); |
| | | Map<Integer, String> categoryMap = categoryService.list(null).stream() |
| | | .collect(Collectors.toMap(TCategory::getId, TCategory::getName)); |
| | | for (SubjectVO subjectVO : list) { |
| | | if (subjectVO.getFirstCategory()!=null&&subjectVO.getSecondCategory()!=null){ |
| | | TCategory byId1 = categoryService.getById(subjectVO.getFirstCategory()); |
| | | TCategory byId2 = categoryService.getById(subjectVO.getSecondCategory()); |
| | | String byId1 = categoryMap.get(subjectVO.getFirstCategory()); |
| | | String byId2 = categoryMap.get(subjectVO.getSecondCategory()); |
| | | if (byId1!=null&& byId2!=null){ |
| | | subjectVO.setCategoryName(byId1.getName()+"-"+byId2.getName()); |
| | | subjectVO.setCategoryName(byId1+"-"+byId2); |
| | | } |
| | | } |
| | | // StringBuilder stringBuilder = new StringBuilder(""); |
| | |
| | | subjectVO.setType(subjectVO.getType()); |
| | | } |
| | | res.setRecords(list); |
| | | res.setTotal(list.size()); |
| | | return R.ok(res); |
| | | } |
| | | @PostMapping("/add") |
| | |
| | | import com.ruoyi.common.security.auth.AuthUtil; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.goods.api.model.OrderQuery; |
| | | import com.ruoyi.management.api.feignClient.ManagementClient; |
| | | import com.ruoyi.management.api.model.*; |
| | | import com.ruoyi.management.api.query.UseGuideQuery; |
| | |
| | | TUser byId = userService.getById(id); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | @PostMapping("/listAll") |
| | | public R<List<TUser>> listAll(@RequestBody OrderQuery query){ |
| | | List<TUser> list = userService.lambdaQuery() |
| | | .like(StringUtils.hasLength(query.getUserName()), TUser::getName, query.getUserName()) |
| | | .like(StringUtils.hasLength(query.getPhone()), TUser::getPhone, query.getPhone()).list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/vipInfoStudy") |
| | | @ApiOperation(value = "会员中心-获取会员说明、当前登录用户是否为会员、会员购买规格", tags = {"学习端-个人中心"}) |
| | |
| | | @ApiOperation(value = "用户列表", tags = {"管理后台-用户管理"}) |
| | | public R<PageInfo<AppUserVO>> couponReceive(@RequestBody AppUserQuery query) { |
| | | PageInfo<AppUserVO> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | List<AppUserVO> list = userService.listAll(query); |
| | | List<AppUserVO> list = userService.listAll(query,res); |
| | | for (AppUserVO appUserVO : list) { |
| | | if (appUserVO.getVipEndTime() == null) { |
| | | appUserVO.setIsVip(0); |
| | |
| | | } |
| | | } |
| | | res.setRecords(list); |
| | | res.setTotal(list.size()); |
| | | return R.ok(res); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "列表查询", tags = {"管理后台-会员管理"}) |
| | | public R<PageInfo<VipOrderVO>> vipOrderList(@RequestBody AppUserQuery query) { |
| | | PageInfo<VipOrderVO> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | List<VipOrderVO> list = vipOrderService.listAll(query); |
| | | List<VipOrderVO> list = vipOrderService.listAll(query,res); |
| | | res.setRecords(list); |
| | | res.setTotal(list.size()); |
| | | return R.ok(res); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.study.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.study.domain.TStory; |
| | | import com.ruoyi.study.dto.SubjectQuery; |
| | | import com.ruoyi.study.vo.SubjectVO; |
| | |
| | | */ |
| | | public interface TStoryMapper extends BaseMapper<TStory> { |
| | | |
| | | List<SubjectVO> listAll(@Param("req") SubjectQuery query); |
| | | List<SubjectVO> listAll(@Param("req") SubjectQuery query, @Param("res") PageInfo<SubjectVO> res); |
| | | } |
| | |
| | | package com.ruoyi.study.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.study.domain.TSubject; |
| | | import com.ruoyi.study.dto.SubjectQuery; |
| | | import com.ruoyi.study.vo.SubjectVO; |
| | |
| | | */ |
| | | public interface TSubjectMapper extends BaseMapper<TSubject> { |
| | | |
| | | List<SubjectVO> listAll(@Param("req") SubjectQuery query, @Param("type") int type); |
| | | List<SubjectVO> listAll(@Param("req") SubjectQuery query, @Param("type") int type, @Param("pageInfo") PageInfo<SubjectVO> pageInfo); |
| | | } |
| | |
| | | package com.ruoyi.study.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.study.domain.TUser; |
| | | import com.ruoyi.study.dto.AppUserQuery; |
| | | import com.ruoyi.study.vo.AppUserVO; |
| | |
| | | */ |
| | | public interface TUserMapper extends BaseMapper<TUser> { |
| | | |
| | | List<AppUserVO> listAll(@Param("req") AppUserQuery query); |
| | | List<AppUserVO> listAll(@Param("req") AppUserQuery query,@Param("pageInfo") PageInfo<AppUserVO> pageInfo); |
| | | |
| | | void updateOne(@Param("id") Integer id,@Param("vipEndTime") Date vipEndTime,@Param("vipPayTime") Date vipPayTime); |
| | | } |
| | |
| | | package com.ruoyi.study.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.study.domain.TVipOrder; |
| | | import com.ruoyi.study.dto.AppUserQuery; |
| | | import com.ruoyi.study.vo.AppUserVO; |
| | | import com.ruoyi.study.vo.VipOrderVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @since 2024-04-26 |
| | | */ |
| | | public interface VipOrderMapper extends BaseMapper<TVipOrder> { |
| | | List<VipOrderVO> listAll(@Param("req") AppUserQuery query); |
| | | List<VipOrderVO> listAll(@Param("req") AppUserQuery query, @Param("pageInfo") PageInfo<VipOrderVO> pageInfo); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.study.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.study.domain.TStory; |
| | | import com.ruoyi.study.domain.TStoryListen; |
| | | import com.ruoyi.study.dto.SubjectQuery; |
| | |
| | | */ |
| | | public interface ITStoryService extends IService<TStory> { |
| | | |
| | | List<SubjectVO> listAll(SubjectQuery query); |
| | | List<SubjectVO> listAll(SubjectQuery query, PageInfo<SubjectVO> res); |
| | | |
| | | /** |
| | | * 自主故事,获取图片及语音 |
| | |
| | | package com.ruoyi.study.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.study.domain.TSubject; |
| | | import com.ruoyi.study.dto.SubjectQuery; |
| | | import com.ruoyi.study.vo.SubjectVO; |
| | |
| | | */ |
| | | public interface ITSubjectService extends IService<TSubject> { |
| | | |
| | | List<SubjectVO> listAll(SubjectQuery query,int type); |
| | | List<SubjectVO> listAll(SubjectQuery query, int type, PageInfo<SubjectVO> pageInfo); |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.study.domain.TUser; |
| | | import com.ruoyi.study.dto.AppUserQuery; |
| | | import com.ruoyi.study.vo.AppUserVO; |
| | |
| | | */ |
| | | public interface ITUserService extends IService<TUser> { |
| | | |
| | | List<AppUserVO> listAll(AppUserQuery query); |
| | | List<AppUserVO> listAll(AppUserQuery query, PageInfo<AppUserVO> pageInfo); |
| | | |
| | | /** |
| | | * 发送手机验证码 |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.study.domain.TVipOrder; |
| | | import com.ruoyi.study.dto.AppUserQuery; |
| | | import com.ruoyi.study.vo.AppUserVO; |
| | | import com.ruoyi.study.vo.VipOrderVO; |
| | | |
| | | import java.util.List; |
| | |
| | | * @since 2024-04-26 |
| | | */ |
| | | public interface IVipOrderService extends IService<TVipOrder> { |
| | | List<VipOrderVO> listAll(AppUserQuery query); |
| | | List<VipOrderVO> listAll(AppUserQuery query, PageInfo<VipOrderVO> pageInfo); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.study.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.study.domain.TStory; |
| | | import com.ruoyi.study.domain.TStoryListen; |
| | | import com.ruoyi.study.dto.SubjectQuery; |
| | |
| | | public class TStoryServiceImpl extends ServiceImpl<TStoryMapper, TStory> implements ITStoryService { |
| | | |
| | | @Override |
| | | public List<SubjectVO> listAll(SubjectQuery query) { |
| | | return this.baseMapper.listAll(query); |
| | | public List<SubjectVO> listAll(SubjectQuery query, PageInfo<SubjectVO> res) { |
| | | return this.baseMapper.listAll(query,res); |
| | | } |
| | | |
| | | @Override |
| | |
| | | .divide(new BigDecimal(tSubjectRecordDetails.size()), 2, RoundingMode.HALF_UP)); |
| | | } |
| | | studyListenResultVO.setSubjectList(subjectList); |
| | | System.err.println("归纳排除题目"+subjectList); |
| | | return R.ok(studyListenResultVO); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.study.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.study.domain.TSubject; |
| | | import com.ruoyi.study.dto.SubjectQuery; |
| | | import com.ruoyi.study.vo.SubjectVO; |
| | |
| | | public class TSubjectServiceImpl extends ServiceImpl<TSubjectMapper, TSubject> implements ITSubjectService { |
| | | |
| | | @Override |
| | | public List<SubjectVO> listAll(SubjectQuery query,int type) { |
| | | return this.baseMapper.listAll(query,type); |
| | | public List<SubjectVO> listAll(SubjectQuery query, int type, PageInfo<SubjectVO> pageInfo) { |
| | | return this.baseMapper.listAll(query,type,pageInfo); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.RedisConstants; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.study.domain.TUser; |
| | | import com.ruoyi.study.dto.AppUserQuery; |
| | |
| | | private TokenService tokenService; |
| | | |
| | | @Override |
| | | public List<AppUserVO> listAll(AppUserQuery query) { |
| | | return this.baseMapper.listAll(query); |
| | | public List<AppUserVO> listAll(AppUserQuery query, PageInfo<AppUserVO> pageInfo) { |
| | | return this.baseMapper.listAll(query, pageInfo); |
| | | } |
| | | |
| | | @Autowired |
| | |
| | | package com.ruoyi.study.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.study.domain.TVipOrder; |
| | | import com.ruoyi.study.dto.AppUserQuery; |
| | | import com.ruoyi.study.mapper.VipOrderMapper; |
| | | import com.ruoyi.study.service.IVipOrderService; |
| | | import com.ruoyi.study.vo.AppUserVO; |
| | | import com.ruoyi.study.vo.VipOrderVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | public class VipOrderServiceImpl extends ServiceImpl<VipOrderMapper, TVipOrder> implements IVipOrderService { |
| | | |
| | | @Override |
| | | public List<VipOrderVO> listAll(AppUserQuery query) { |
| | | return this.baseMapper.listAll(query); |
| | | public List<VipOrderVO> listAll(AppUserQuery query, PageInfo<VipOrderVO> pageInfo) { |
| | | return this.baseMapper.listAll(query, pageInfo); |
| | | } |
| | | } |