| | |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | private String id; |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | @TableField("name") |
| | | private String name; |
| | |
| | | @ApiModelProperty(value = "要赠送的优惠卷") |
| | | @TableField("coupon_ids") |
| | | private String couponIds; |
| | | @TableField(exist = false) |
| | | private String vipName; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "发票类型(1=增值税普通发票,2=增值税专用发票)") |
| | | @TableField("invoice_type") |
| | | private Integer invoiceType; |
| | | private String invoiceType; |
| | | |
| | | @ApiModelProperty(value = "发票类型(1=增值税普通发票,2=增值税专用发票)") |
| | | @TableField("invoice_type_id") |
| | | private Integer invoiceTypeId; |
| | | |
| | | @ApiModelProperty(value = "抬头类型(1=个人,2=企业)") |
| | | @TableField("invoicing_object_type") |
| | |
| | | com.ruoyi.integration.api.factory.IntegrationFallbackFactory |
| | | com.ruoyi.integration.api.factory.UploadRealTimeMonitoringDataFallbackFactory |
| | | com.ruoyi.integration.api.factory.ChargingHandshakeFallbackFactory |
| | | com.ruoyi.integration.api.factory.ChargingHandshakeFallbackFactory |
| | | com.ruoyi.integration.api.factory.SendMessageFallbackFactory |
| | |
| | | TCoupon coupon = JSON.toJavaObject(JSON.parseObject(tAppCoupon.getCouponJson()), TCoupon.class); |
| | | InfoCouponDto infoCouponDto = new InfoCouponDto(); |
| | | BeanUtils.copyProperties(coupon, infoCouponDto); |
| | | infoCouponDto.setId(tAppCoupon.getId()); |
| | | infoCouponDto.setId(tAppCoupon.getId().toString()); |
| | | infoCouponDto.setEndTime(tAppCoupon.getEndTime()); |
| | | couponDtos1.add(infoCouponDto); |
| | | |
| | |
| | | TCoupon coupon = JSON.toJavaObject(JSON.parseObject(tAppCoupon.getCouponJson()), TCoupon.class); |
| | | InfoCouponDto infoCouponDto = new InfoCouponDto(); |
| | | BeanUtils.copyProperties(coupon, infoCouponDto); |
| | | infoCouponDto.setId(tAppCoupon.getId()); |
| | | infoCouponDto.setId(tAppCoupon.getId().toString()); |
| | | infoCouponDto.setEndTime(tAppCoupon.getEndTime()); |
| | | couponDtos2.add(infoCouponDto); |
| | | } |
| | |
| | | TCoupon coupon = JSON.toJavaObject(JSON.parseObject(tAppCoupon.getCouponJson()), TCoupon.class); |
| | | InfoCouponDto infoCouponDto = new InfoCouponDto(); |
| | | BeanUtils.copyProperties(coupon, infoCouponDto); |
| | | infoCouponDto.setId(tAppCoupon.getId()); |
| | | infoCouponDto.setId(tAppCoupon.getId().toString()); |
| | | infoCouponDto.setEndTime(tAppCoupon.getEndTime()); |
| | | couponDtos2.add(infoCouponDto); |
| | | } |
| | |
| | | |
| | | |
| | | @ApiOperation(value = "优惠卷详情(1可使用2不可用)", tags = {"小程序-个人中心"}) |
| | | @PostMapping(value = "/user/coupon/getById") |
| | | @GetMapping(value = "/user/coupon/getById") |
| | | public R<TAppCoupon> couponGetById(@RequestParam("id")Long id) { |
| | | TAppCoupon appCoupon = appCouponService.getById(id); |
| | | return R.ok(appCoupon); |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "已赠送列表", tags = {"小程序-个人中心-邀请好友"}) |
| | | @PostMapping(value = "/user/invite/info") |
| | | @GetMapping(value = "/user/invite/info") |
| | | public R<InviteInfoDto> inviteInfo() { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | Integer point = 0; |
| | |
| | | import com.ruoyi.account.service.TAppUserVipDetailService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.feignClient.VipClient; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | return R.ok(one); |
| | | } |
| | | |
| | | @Resource |
| | | private VipClient vipClient; |
| | | |
| | | @GetMapping("/getVipUseDetail") |
| | | @ApiOperation(value = "生效会员列表", tags = {"小程序-个人中心"}) |
| | | public R<List<TAppUserVipDetail>> getVipUseDetail(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | List<TAppUserVipDetail> list = appUserVipDetailService.lambdaQuery().eq(TAppUserVipDetail::getAppUserId, userId).last(" and now() between start_time and end_time order by start_time desc").list(); |
| | | |
| | | for (TAppUserVipDetail tAppUserVipDetail : list) { |
| | | TVip data = vipClient.getInfo1(tAppUserVipDetail.getVipId()).getData(); |
| | | tAppUserVipDetail.setVipName(data.getName()); |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.api.model.TInvoiceInformation; |
| | | import com.ruoyi.account.api.vo.InvoiceInformationVo; |
| | | import com.ruoyi.account.service.TInvoiceInformationService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @ResponseBody |
| | | @GetMapping(value = "/getInvoiceInformationList") |
| | | @ApiOperation(value = "获取开票抬头数据列表", tags = {"小程序-充电发票"}) |
| | | public AjaxResult<List<TInvoiceInformation>> getInvoiceInformationList(){ |
| | | public AjaxResult<List<InvoiceInformationVo>> getInvoiceInformationList(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | List<TInvoiceInformation> list = invoiceInformationService.list(new LambdaQueryWrapper<TInvoiceInformation>().eq(TInvoiceInformation::getAppUserId, userId).eq(TInvoiceInformation::getDelFlag, 0)); |
| | | return AjaxResult.success(list); |
| | | List<InvoiceInformationVo> lists = new ArrayList<>(); |
| | | for (TInvoiceInformation tInvoiceInformation : list) { |
| | | InvoiceInformationVo vo = new InvoiceInformationVo(); |
| | | BeanUtils.copyProperties(tInvoiceInformation, vo); |
| | | vo.setId(tInvoiceInformation.getId().toString()); |
| | | lists.add(vo); |
| | | } |
| | | return AjaxResult.success(lists); |
| | | } |
| | | |
| | | |
| | |
| | | public AjaxResult addInvoiceInformation(@RequestBody TInvoiceInformation invoiceInformation){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | //如果当前是默认抬头,则需要去除其他的默认配置 |
| | | if(1 == invoiceInformation.getIsDefault()){ |
| | | if(null != invoiceInformation.getIsDefault() && 1 == invoiceInformation.getIsDefault()){ |
| | | TInvoiceInformation one = invoiceInformationService.getOne(new LambdaQueryWrapper<TInvoiceInformation>().eq(TInvoiceInformation::getDelFlag, 0) |
| | | .eq(TInvoiceInformation::getIsDefault, 1).eq(TInvoiceInformation::getAppUserId, userId)); |
| | | if(null != one){ |
| | |
| | | throw new ServiceException("未查询到计费策略"); |
| | | } |
| | | List<TAccountingStrategyDetailVO> list = this.queryAccountingStrategyDetailByStrategyId(accountingStrategy.getId()); |
| | | list.stream().filter(item -> "24:00".equals(item.getEndTime())).forEach(item -> item.setEndTime("23:59:59")); |
| | | list.stream().filter(item -> "00:00".equals(item.getEndTime())).forEach(item -> item.setEndTime("23:59:59")); |
| | | // 获取当前登录用户id |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | // 根据id查询用户信息 |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | tExchangeOrder.setPoints(exchangeDto.getPoint()); |
| | | tExchangeOrder.setRemark(""); |
| | | if (exchangeDto.getGoodType()==1){ |
| | | tExchangeOrder.setStatus(0); |
| | | tExchangeOrder.setStatus(1); |
| | | }else { |
| | | tExchangeOrder.setStatus(3); |
| | | } |
| | |
| | | |
| | | @GetMapping("/getMyExchangeOrder") |
| | | @ApiOperation(value = "获取兑换记录列表", tags = {"小程序-兑换记录"}) |
| | | public AjaxResult<List<MyExchangeOrderList>> getMyExchangeOrder(GetMyExchangeOrder query){ |
| | | List<MyExchangeOrderList> list = exchangeOrderService.getMyExchangeOrder(query); |
| | | public AjaxResult<Map<String, Object>> getMyExchangeOrder(GetMyExchangeOrder query){ |
| | | Map<String, Object> list = exchangeOrderService.getMyExchangeOrder(query); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | |
| | | @ApiOperation(tags = {"小程序-订单申诉"},value = "查询订单申诉分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TOrderAppealVO>> pageList(@RequestBody TOrderAppealQuery query) { |
| | | // TODO 用户id 获取小程序当前登录用户id |
| | | Long userId = tokenService.getLoginUser().getUserid(); |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | query.setAppUserId(userId); |
| | | return AjaxResult.ok(orderAppealService.pageList(query)); |
| | | } |
| | |
| | | import java.time.LocalDateTime; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.ruoyi.account.api.feignClient.AppCouponClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.TAppUserAddress; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | @GetMapping("/getMyShoppingOrderList") |
| | | @ApiOperation(value = "获取购买订单列表", tags = {"小程序-商城购买订单"}) |
| | | public AjaxResult<List<MyShoppingOrderList>> getMyShoppingOrderList(GetMyShoppingOrderList query){ |
| | | List<MyShoppingOrderList> list = shoppingOrderService.getMyShoppingOrderList(query); |
| | | public AjaxResult<Map<String, Object>> getMyShoppingOrderList(GetMyShoppingOrderList query){ |
| | | Map<String, Object> list = shoppingOrderService.getMyShoppingOrderList(query); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getMyShoppingOrderListNum") |
| | | @ApiOperation(value = "获取购买订单列表数量", tags = {"小程序-商城购买订单"}) |
| | | public AjaxResult<Map<String, Object>> getMyShoppingOrderListNum(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | long dfh = shoppingOrderService.count(new LambdaQueryWrapper<TShoppingOrder>().eq(TShoppingOrder::getDelFlag, 0) |
| | | .eq(TShoppingOrder::getStatus, 1).eq(TShoppingOrder::getAppUserId, userId)); |
| | | long dsh = shoppingOrderService.count(new LambdaQueryWrapper<TShoppingOrder>().eq(TShoppingOrder::getDelFlag, 0) |
| | | .eq(TShoppingOrder::getStatus, 2).eq(TShoppingOrder::getAppUserId, userId)); |
| | | long ywc = shoppingOrderService.count(new LambdaQueryWrapper<TShoppingOrder>().eq(TShoppingOrder::getDelFlag, 0) |
| | | .eq(TShoppingOrder::getStatus, 3).eq(TShoppingOrder::getAppUserId, userId)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("dfh", dfh); |
| | | map.put("dsh", dsh); |
| | | map.put("ywc", ywc); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/getMyShoppingOrderInfo/{id}") |
| | |
| | | import com.ruoyi.order.dto.MyExchangeOrderList; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<MyExchangeOrderList> getMyExchangeOrder(GetMyExchangeOrder query); |
| | | Map<String, Object> getMyExchangeOrder(GetMyExchangeOrder query); |
| | | |
| | | |
| | | /** |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<MyShoppingOrderList> getMyShoppingOrderList(GetMyShoppingOrderList query); |
| | | Map<String, Object> getMyShoppingOrderList(GetMyShoppingOrderList query); |
| | | |
| | | |
| | | /** |
| | |
| | | import javax.annotation.Resource; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MyExchangeOrderList> getMyExchangeOrder(GetMyExchangeOrder query) { |
| | | public Map<String, Object> getMyExchangeOrder(GetMyExchangeOrder query) { |
| | | Long userid = tokenService.getLoginUserApplet().getUserId(); |
| | | LambdaQueryWrapper<TExchangeOrder> wrapper = new LambdaQueryWrapper<TExchangeOrder>().eq(TExchangeOrder::getDelFlag, 0).eq(TExchangeOrder::getAppUserId, userid); |
| | | if(query.getStatus() == 0){ |
| | |
| | | }else{ |
| | | wrapper.eq(TExchangeOrder::getStatus, query.getStatus()); |
| | | } |
| | | List<TExchangeOrder> list = this.list(wrapper.orderByDesc(TExchangeOrder::getCreateTime).last(" limit " + query.getPageCurr() + "," + query.getPageSize())); |
| | | long count = this.count(wrapper); |
| | | Integer pageCurr = (query.getPageCurr() - 1) * query.getPageSize(); |
| | | List<TExchangeOrder> list = this.list(wrapper.orderByDesc(TExchangeOrder::getCreateTime).last(" limit " + pageCurr + "," + query.getPageSize())); |
| | | List<MyExchangeOrderList> pageList = new ArrayList<>(); |
| | | for (TExchangeOrder tExchangeOrder : list) { |
| | | MyExchangeOrderList exchangeOrderList = new MyExchangeOrderList(); |
| | |
| | | exchangeOrderList.setImgUrl(imgUrl); |
| | | pageList.add(exchangeOrderList); |
| | | } |
| | | return pageList; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("list", pageList); |
| | | map.put("total", count); |
| | | return map; |
| | | } |
| | | |
| | | |
| | |
| | | ExchangeOrderGoodsInfo info = new ExchangeOrderGoodsInfo(); |
| | | info.setId(id); |
| | | info.setStatus(exchangeOrder.getStatus()); |
| | | TAppUserAddress userAddress = appUserAddressClient.getAppUserAddressById(exchangeOrder.getAppUserAddressId()).getData(); |
| | | info.setConsignee(userAddress.getName()); |
| | | info.setPhone(userAddress.getPhone()); |
| | | info.setAddress(userAddress.getAddress()); |
| | | if(null != exchangeOrder.getAppUserAddressId()){ |
| | | TAppUserAddress userAddress = appUserAddressClient.getAppUserAddressById(exchangeOrder.getAppUserAddressId()).getData(); |
| | | info.setConsignee(userAddress.getName()); |
| | | info.setPhone(userAddress.getPhone()); |
| | | info.setAddress(userAddress.getAddress()); |
| | | } |
| | | info.setExpressCompany(exchangeOrder.getExpressCompany()); |
| | | info.setExpressNumber(exchangeOrder.getExpressNumber()); |
| | | String name = ""; |
| | |
| | | info.setCreateTime(exchangeOrder.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | info.setPoints(exchangeOrder.getPoints()); |
| | | info.setRemark(exchangeOrder.getRemark()); |
| | | info.setDeliveryTime(exchangeOrder.getConsignerTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | info.setFinishTime(exchangeOrder.getReceivingTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | if(null != exchangeOrder.getConsignerTime()){ |
| | | info.setDeliveryTime(exchangeOrder.getConsignerTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | } |
| | | if(null != exchangeOrder.getReceivingTime()){ |
| | | info.setFinishTime(exchangeOrder.getReceivingTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | } |
| | | return info; |
| | | } |
| | | |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MyShoppingOrderList> getMyShoppingOrderList(GetMyShoppingOrderList query) { |
| | | public Map<String, Object> getMyShoppingOrderList(GetMyShoppingOrderList query) { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | LambdaQueryWrapper<TShoppingOrder> wrapper = new LambdaQueryWrapper<TShoppingOrder>().eq(TShoppingOrder::getDelFlag, 0) |
| | | .eq(TShoppingOrder::getAppUserId, userId); |
| | | if(query.getStatus() != 0){ |
| | | wrapper.eq(TShoppingOrder::getStatus, query.getStatus()); |
| | | } |
| | | List<TShoppingOrder> list = this.list(wrapper.orderByDesc(TShoppingOrder::getCreateTime).last(" limit " + query.getPageCurr() + ", " + query.getPageSize())); |
| | | long count = this.count(wrapper); |
| | | Integer pageCurr = (query.getPageCurr() - 1) * query.getPageSize(); |
| | | List<TShoppingOrder> list = this.list(wrapper.orderByDesc(TShoppingOrder::getCreateTime).last(" limit " + pageCurr + ", " + query.getPageSize())); |
| | | List<MyShoppingOrderList> pageList = new ArrayList<>(); |
| | | for (TShoppingOrder tShoppingOrder : list) { |
| | | MyShoppingOrderList myShoppingOrderList = new MyShoppingOrderList(); |
| | |
| | | myShoppingOrderList.setOrderType(tShoppingOrder.getOrderType()); |
| | | pageList.add(myShoppingOrderList); |
| | | } |
| | | return pageList; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("list", pageList); |
| | | map.put("total", count); |
| | | return map; |
| | | } |
| | | |
| | | |
| | |
| | | @ResponseBody |
| | | @GetMapping("/getRandomEvaluationTag") |
| | | @ApiOperation(value = "获取随机的4个评价标签", tags = {"小程序-充电记录"}) |
| | | public AjaxResult<List<TEvaluationTag>> getRandomEvaluationTag(){ |
| | | List<TEvaluationTag> list = evaluationTagService.list(new LambdaQueryWrapper<TEvaluationTag>().last(" order by RAND() limit 0, 4")); |
| | | public AjaxResult<List<TEvaluationTag>> getRandomEvaluationTag(Integer type){ |
| | | List<TEvaluationTag> list = evaluationTagService.list(new LambdaQueryWrapper<TEvaluationTag>().eq(TEvaluationTag::getType, type) |
| | | .last(" order by RAND() limit 0, 4")); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/getInvoiceTypeList") |
| | | @GetMapping("/getInvoiceTypeList") |
| | | @ApiOperation(value = "获取开票类型", tags = {"小程序-充电发票"}) |
| | | public AjaxResult<List<TInvoiceType>> getInvoiceTypeList(){ |
| | | List<TInvoiceType> list = invoiceTypeService.list(new LambdaQueryWrapper<TInvoiceType>() |