| | |
| | | package com.ruoyi.goods.controller; |
| | | import java.util.Date; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.ruoyi.goods.vo.TOrderVO; |
| | | import com.ruoyi.study.api.domain.TUser; |
| | | import com.ruoyi.study.api.feignClient.StudyClient; |
| | | import com.ruoyi.study.api.vo.UserPersonalCenterVO; |
| | | import com.ruoyi.system.api.model.LoginUserParent; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | 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) { |
| | |
| | | if (null == loginUserStudy) { |
| | | return R.tokenError("登录失效!"); |
| | | } |
| | | return R.ok(goodsService.goodRecommend(loginUserStudy.getUserid())); |
| | | UserPersonalCenterVO data = studyClient.userInfo().getData(); |
| | | List<TGoodsVO> tGoodsVOS = goodsService.goodRecommend(loginUserStudy.getUserid()); |
| | | List<TGoodsVO> res = new ArrayList<>(); |
| | | int temp = 0; |
| | | for (TGoodsVO re : tGoodsVOS) { |
| | | if (temp>=3){ |
| | | break; |
| | | } |
| | | if (data.getUser().getIntegral()>=re.getIntegral()){ |
| | | res.add(re); |
| | | temp++; |
| | | } |
| | | } |
| | | return R.ok(res); |
| | | } |
| | | |
| | | /** |