Merge remote-tracking branch 'origin/master'
# Conflicts:
# ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/RefundPassController.java
1 文件已重命名
36个文件已修改
1个文件已添加
| | |
| | | |
| | | @ApiModelProperty(value = "用户当前消费积分") |
| | | @TableField("shop_point") |
| | | private BigDecimal shopPoint; |
| | | private Integer shopPoint; |
| | | |
| | | @ApiModelProperty(value = "用户当前分佣积分") |
| | | @TableField("share_point") |
| | | private BigDecimal sharePoint; |
| | | private Integer sharePoint; |
| | | |
| | | @ApiModelProperty(value = "直推用户已达钻石会员数") |
| | | @TableField("direct_vip_num") |
| | |
| | | @TableField(exist = false) |
| | | private Long count7; |
| | | |
| | | @ApiModelProperty("是否签到1是0否") |
| | | @TableField(exist = false) |
| | | private Integer isSign; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @TableField("red_amount") |
| | | private BigDecimal redAmount; |
| | | |
| | | @ApiModelProperty(value = "红包金额") |
| | | @TableField("point") |
| | | private BigDecimal point; |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | |
| | | @ApiModelProperty(value = "技师名称") |
| | | private String technicianName; |
| | | |
| | | @ApiModelProperty(value = "预约单id") |
| | | private String technicianSubscribeId; |
| | | |
| | | } |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "1:合伙人积分设置一 2:合伙人积分设置二 3:会员说明设置 4:活动管理-活动设置 1开0关 5:售后设置") |
| | | @ApiModelProperty(value = "1:合伙人积分设置一 2:合伙人积分设置二 3:会员说明设置 4:活动管理-活动设置 1开0关 5:售后设置 6:充值设置") |
| | | @TableId("id") |
| | | private Integer id; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "技师id") |
| | | @TableField("technician_id") |
| | | private Long technicianId; |
| | | private Integer technicianId; |
| | | |
| | | @ApiModelProperty(value = "预约时间") |
| | | @TableField("subscribe_time") |
| | |
| | | import com.ruoyi.other.api.feignClient.SystemConfigClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/11/29 15:58 |
| | |
| | | public R<SystemConfig> getSystemConfig(Integer type) { |
| | | return R.fail("根据类型获取系统配置失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<BigDecimal> redPackegeSet() { |
| | | return R.fail("根据红包配置失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.Technician; |
| | | import com.ruoyi.other.api.domain.TechnicianSubscribe; |
| | | import com.ruoyi.other.api.feignClient.TechnicianClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Void> updateStatus(Integer status, Integer subscribeId) { |
| | | public R<Void> updateStatus(Integer status, Long subscribeId) { |
| | | return R.fail("跟新技师预约状态失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<TechnicianSubscribe> getSubscribeByOrderId(Long orderId) { |
| | | return R.fail("根据订单id获取预约信息失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.VipGood; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.VipGoodClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | public R<List<VipGood>> getVipGoodsByVipId(Integer vipId) { |
| | | return R.fail("根据会员id获取会员购买商品失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<VipSetting> getVipSettingById(Integer id) { |
| | | return R.fail("根据会员id获取会员失败:" + cause.getMessage()); |
| | | |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/11/29 15:58 |
| | |
| | | @PostMapping("/system-config/getSystemConfig") |
| | | R<SystemConfig> getSystemConfig(@RequestParam("type") Integer type); |
| | | |
| | | @PostMapping("/red-packege-set/get") |
| | | R<BigDecimal> redPackegeSet(); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.Technician; |
| | | import com.ruoyi.other.api.domain.TechnicianSubscribe; |
| | | import com.ruoyi.other.api.factory.TechnicianClientFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | R<Technician> shopdetail(@RequestParam("id") Integer techId); |
| | | |
| | | @PutMapping("/technician-subscribe/updateStatus") |
| | | R<Void> updateStatus(@RequestParam("status") Integer status, @RequestParam("subscribeId") Integer subscribeId); |
| | | R<Void> updateStatus(@RequestParam("status") Integer status, @RequestParam("subscribeId") Long subscribeId); |
| | | |
| | | @GetMapping("/technician-subscribe/getSubscribeByOrderId") |
| | | R<TechnicianSubscribe> getSubscribeByOrderId(@RequestParam("orderId") Long orderId); |
| | | } |
| | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.VipGood; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.factory.VipGoodClientFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | |
| | | @GetMapping("/vip-good/getVipGoodsByVipId") |
| | | public R<List<VipGood>> getVipGoodsByVipId(@RequestParam("subscribeId") Integer vipId); |
| | | |
| | | @GetMapping("/vip-setting/getVipSettingById") |
| | | public R<VipSetting> getVipSettingById(@RequestParam("id") Integer id); |
| | | } |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.ruoyi.account.api.model.AgentApplication; |
| | | import com.ruoyi.account.service.AgentApplicationService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/agent-application") |
| | | public class AgentApplicationController { |
| | | public class AgentApplicationController extends BaseController { |
| | | @Resource |
| | | private AgentApplicationService agentApplicationService; |
| | | |
| | | @PostMapping("/apply") |
| | | @ApiOperation(value = "会员申请", tags = {"会员中心-小程序"}) |
| | | public R<Void> apply(@RequestBody AgentApplication agentApplication) { |
| | | agentApplicationService.apply(agentApplication); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserCancellationLog; |
| | | import com.ruoyi.account.api.model.UserCoupon; |
| | | import com.ruoyi.account.api.model.UserSignRecord; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.UserCancellationLogService; |
| | | import com.ruoyi.account.service.UserCouponService; |
| | | import com.ruoyi.account.service.UserSignRecordService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.account.vo.*; |
| | |
| | | private StoreClient storeClient; |
| | | @Resource |
| | | private UserCouponService userCouponService; |
| | | |
| | | @Resource |
| | | private UserSignRecordService userSignRecordService; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | public R<AppUser> info(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | | AppUser user = appUserService.getById(userId); |
| | | |
| | | List<UserSignRecord> list = userSignRecordService.lambdaQuery().eq(UserSignRecord::getSignDay, LocalDate.now()).list(); |
| | | if (!list.isEmpty()){ |
| | | user.setIsSign(1); |
| | | }else { |
| | | user.setIsSign(0); |
| | | } |
| | | |
| | | return R.ok(user); |
| | | } |
| | | @Resource |
| | |
| | | |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserSignRecord; |
| | | import com.ruoyi.account.dto.SignBackRDto; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.UserSignRecordService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.PointSetting; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.PointSettingClient; |
| | | import com.ruoyi.other.api.feignClient.SystemConfigClient; |
| | | import com.ruoyi.other.api.feignClient.VipGoodClient; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | @Resource |
| | | private UserSignRecordService userSignRecordService; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private PointSettingClient pointSettingClient; |
| | | @Resource |
| | | private SystemConfigClient systemConfigClient; |
| | | @ResponseBody |
| | | @GetMapping("/sign") |
| | | @ApiOperation(value = "签到", tags = {"小程序-签到"}) |
| | | public R<AppUser> change(){ |
| | | public R<SignBackRDto> sign(){ |
| | | Long userId1 = tokenService.getLoginUserApplet().getUserid(); |
| | | AppUser byId = appUserService.getById(userId1); |
| | | //获取当前用户的会员信息 |
| | | R<PointSetting> pointSetting = pointSettingClient.getPointSetting(byId.getVipId()); |
| | | UserSignRecord userSignRecord = new UserSignRecord(); |
| | | userSignRecord.setAppUserId(userId1); |
| | | userSignRecord.setCreateTime(LocalDateTime.now()); |
| | | userSignRecord.setRedAmount(new BigDecimal(0)); |
| | | if (pointSetting.getData() != null) { |
| | | userSignRecord.setPoint(pointSetting.getData().getSignPoint()); |
| | | }else { |
| | | userSignRecord.setPoint(BigDecimal.ZERO); |
| | | } |
| | | R<BigDecimal> bigDecimalR = systemConfigClient.redPackegeSet(); |
| | | userSignRecord.setRedAmount(bigDecimalR.getData()); |
| | | userSignRecord.setSignDay(LocalDate.now()); |
| | | return R.ok(); |
| | | |
| | | SignBackRDto signBackRDto = new SignBackRDto(); |
| | | signBackRDto.setPoint(userSignRecord.getPoint()); |
| | | signBackRDto.setRedAmount(userSignRecord.getRedAmount()); |
| | | return R.ok(signBackRDto); |
| | | } |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.log4j.Log4j2; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | private boolean checkSuccess(R<?> r) { |
| | | if (!R.isSuccess(r)) { |
| | | log.error("请求失败: " + r.getMsg()); |
New file |
| | |
| | | package com.ruoyi.account.dto; |
| | | |
| | | import lombok.Data; |
| | | import org.apache.poi.hpsf.Decimal; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class SignBackRDto { |
| | | private BigDecimal point; |
| | | private BigDecimal redAmount; |
| | | } |
| | |
| | | */ |
| | | public interface AgentApplicationService extends IService<AgentApplication> { |
| | | |
| | | void apply(AgentApplication agentApplication); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.model.AgentApplication; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.mapper.AgentApplicationMapper; |
| | | import com.ruoyi.account.service.AgentApplicationService; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.feignClient.ShopClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class AgentApplicationServiceImpl extends ServiceImpl<AgentApplicationMapper, AgentApplication> implements AgentApplicationService { |
| | | @Resource |
| | | private AgentApplicationMapper agentApplicationMapper; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | @Resource |
| | | private ShopClient shopClient; |
| | | |
| | | @Override |
| | | public void apply(AgentApplication agentApplication) { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | AppUser appUser = appUserService.getById(loginUserApplet.getUserid()); |
| | | |
| | | agentApplication.setAppUserId(loginUserApplet.getUserid()); |
| | | agentApplication.setApplicationTime(LocalDateTime.now()); |
| | | agentApplication.setShopPoint(appUser.getShopPoint()); |
| | | agentApplication.setSharePoint(appUser.getSharePoint()); |
| | | |
| | | // 直推用户已达钻石会员数量 |
| | | List<AppUser> directVipUserList = appUserService.list(new LambdaQueryWrapper<AppUser>() |
| | | .eq(AppUser::getInviteUserId, appUser.getId()) |
| | | .eq(AppUser::getVipId, 3)); |
| | | agentApplication.setDirectVipNum(directVipUserList.size()); |
| | | |
| | | // 直推用户已成为代理数量 |
| | | List<AppUser> directAgentUserList = appUserService.list(new LambdaQueryWrapper<AppUser>() |
| | | .eq(AppUser::getInviteUserId, appUser.getId()) |
| | | .eq(AppUser::getUserType, 4)); |
| | | agentApplication.setDirectAgentNum(directAgentUserList.size()); |
| | | |
| | | // 已绑定门店数量 |
| | | R<List<Shop>> R = shopClient.getShopByUserIds(Collections.singletonList(loginUserApplet.getUserid())); |
| | | List<Shop> shopList = R.getData(); |
| | | agentApplication.setBindShopNum(shopList.size()); |
| | | agentApplicationMapper.insert(agentApplication); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.enums.OrderStatus; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.service.CommissionService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.vo.OrderDetailVO; |
| | | import com.ruoyi.order.vo.OrderVO; |
| | | import com.ruoyi.other.api.domain.BaseSetting; |
| | | import com.ruoyi.other.api.feignClient.BaseSettingClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigInteger; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private UserAddressClient addressClient; |
| | | @Resource |
| | | private CommissionService commissionService; |
| | | @Resource |
| | | private BaseSettingClient baseSettingClient; |
| | | |
| | | |
| | | /** |
| | |
| | | }) |
| | | @GetMapping("/cancel/{orderId}") |
| | | public R<Void> cancel(@PathVariable("orderId") Long orderId){ |
| | | // TODO 待完善 |
| | | orderService.update(new LambdaUpdateWrapper<Order>() |
| | | .eq(Order::getId, orderId) |
| | | .set(Order::getOrderStatus, OrderStatus.CANCELLED.getCode())); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | }) |
| | | @GetMapping("/confirm/{orderId}") |
| | | public R<Void> confirm(@PathVariable("orderId") Long orderId){ |
| | | // TODO 待完善 |
| | | boolean update = orderService.update(new LambdaUpdateWrapper<Order>() |
| | | .eq(Order::getId, orderId) |
| | | .eq(Order::getOrderStatus, OrderStatus.PENDING_RECEIPT.getCode()) |
| | | .set(Order::getOrderStatus, OrderStatus.COMPLETED.getCode())); |
| | | if(!update){ |
| | | return R.fail("订单状态异常"); |
| | | } |
| | | R<BaseSetting> baseSettingR = baseSettingClient.getBaseSetting(5); |
| | | if (R.isError(baseSettingR)) { |
| | | return R.fail("售后设置获取失败"); |
| | | } |
| | | BaseSetting baseSetting = baseSettingR.getData(); |
| | | if (baseSetting == null) { |
| | | return R.fail("售后设置获取失败"); |
| | | } |
| | | String content = baseSetting.getContent(); |
| | | JSONObject jsonObject = JSONObject.parseObject(content); |
| | | Long days = jsonObject.getLong("days"); |
| | | commissionService.addToCommissionDelayQueue(orderId, LocalDateTime.now().plusDays(days)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.service.ShoppingCartService; |
| | | import com.ruoyi.order.vo.*; |
| | | import com.ruoyi.other.api.domain.GoodsShop; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.feignClient.GoodsShopClient; |
| | | import com.ruoyi.other.api.feignClient.ShopClient; |
| | | import com.ruoyi.other.api.vo.GetGoodsShopByGoodsIds; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @RequestMapping("/shopping-cart") |
| | |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | @Resource |
| | | private GoodsShopClient goodsShopClient; |
| | | @Resource |
| | | private ShopClient shopClient; |
| | | |
| | | |
| | | |
| | |
| | | public R<String> shoppingCartPayment(@RequestBody ShoppingCartPayment shoppingCartPayment){ |
| | | return shoppingCartService.shoppingCartPayment(shoppingCartPayment); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getVerifiableShop") |
| | | @ApiOperation(value = "获取可核销门店列表", tags = {"购物车-小程序"}) |
| | | public R<List<VerifiableShopVo>> getVerifiableShop(){ |
| | | LoginUser loginUser = tokenService.getLoginUserApplet(); |
| | | List<ShoppingCart> shoppingCarts = shoppingCartService.list(new LambdaQueryWrapper<ShoppingCart>() |
| | | .eq(ShoppingCart::getAppUserId, loginUser.getUserid())); |
| | | |
| | | List<Integer> goodsIds = shoppingCarts.stream().map(ShoppingCart::getGoodsId).collect(Collectors.toList()); |
| | | GetGoodsShopByGoodsIds goodsShopByGoodsIds = new GetGoodsShopByGoodsIds(); |
| | | goodsShopByGoodsIds.setGoodsIds(goodsIds); |
| | | R<List<GoodsShop>> r = goodsShopClient.getGoodsShopByGoodsIds(goodsShopByGoodsIds); |
| | | List<GoodsShop> goodsShops = r.getData(); |
| | | List<VerifiableShopVo> verifiableShopVoList = new ArrayList<>(); |
| | | if (CollectionUtil.isNotEmpty(goodsShops)){ |
| | | for (GoodsShop goodsShop : goodsShops) { |
| | | R<Shop> shopR = shopClient.getShopById(goodsShop.getShopId()); |
| | | if (R.isSuccess(shopR)){ |
| | | VerifiableShopVo verifiableShopVo = new VerifiableShopVo(); |
| | | verifiableShopVo.setId(shopR.getData().getId()); |
| | | verifiableShopVo.setName(shopR.getData().getName()); |
| | | verifiableShopVoList.add(verifiableShopVo); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(verifiableShopVoList); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | void writeOff(String code,Integer shopId); |
| | | |
| | | void commission(Long orderId); |
| | | } |
| | |
| | | import com.ruoyi.order.mapper.OrderMapper; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.model.OrderGood; |
| | | import com.ruoyi.order.service.CommissionService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.vo.OrderDetailVO; |
| | | import com.ruoyi.order.vo.OrderGoodsVO; |
| | | import com.ruoyi.order.vo.OrderVO; |
| | | import com.ruoyi.other.api.domain.*; |
| | | import com.ruoyi.other.api.feignClient.BaseSettingClient; |
| | | import com.ruoyi.other.api.feignClient.ShopClient; |
| | | import com.ruoyi.other.api.feignClient.TechnicianClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | private TechnicianClient technicianClient; |
| | | @Resource |
| | | private ShopClient shopClient; |
| | | @Resource |
| | | private CommissionService commissionService; |
| | | @Resource |
| | | private BaseSettingClient baseSettingClient; |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | technician = shopdetail.getData(); |
| | | } |
| | | R<TechnicianSubscribe> subscribeR = technicianClient.getSubscribeByOrderId(orderId); |
| | | if (!R.isSuccess(subscribeR)){ |
| | | throw new ServiceException("获取预约信息失败"); |
| | | } |
| | | TechnicianSubscribe subscribe = subscribeR.getData(); |
| | | |
| | | Shop shop = shopR.getData(); |
| | | orderDetailVO.setId(order.getId()); |
| | | orderDetailVO.setOrderStatus(order.getOrderStatus()); |
| | |
| | | orderDetailVO.setLatitude(shop.getLatitude()); |
| | | orderDetailVO.setShopId(shop.getId()); |
| | | orderDetailVO.setTechnicianName(technician.getName()); |
| | | orderDetailVO.setTechnicianSubscribeId(String.valueOf(subscribe.getId())); |
| | | return orderDetailVO; |
| | | } |
| | | |
| | |
| | | public void writeOff(String code,Integer shopId) { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | Order order = orderMapper.selectOne(new LambdaQueryWrapper<Order>() |
| | | .eq(Order::getOrderNumber, code)); |
| | | .eq(Order::getId, code)); |
| | | boolean check = check(order, shopId, loginUserApplet.getUserid()); |
| | | if (!check){ |
| | | throw new ServiceException("订单不存在"); |
| | |
| | | orderMapper.updateById(order); |
| | | Integer orderType = order.getOrderType(); |
| | | if (orderType.equals(OrderType.SERVICE.getCode())){ |
| | | R<Technician> shopdetail = technicianClient.shopdetail(order.getTechnicianId()); |
| | | if (shopdetail.getCode() != R.SUCCESS){ |
| | | throw new ServiceException("获取技师信息失败"); |
| | | R<TechnicianSubscribe> subscribeR = technicianClient.getSubscribeByOrderId(order.getId()); |
| | | if (R.isError(subscribeR)){ |
| | | throw new ServiceException("获取预约信息失败"); |
| | | } |
| | | Technician technician = shopdetail.getData(); |
| | | R<Void> r = technicianClient.updateStatus(2, technician.getId()); |
| | | if (r.getCode() != R.SUCCESS){ |
| | | throw new ServiceException("修改技师状态失败"); |
| | | TechnicianSubscribe subscribe = subscribeR.getData(); |
| | | subscribe.setStatus(2); |
| | | R<Void> r = technicianClient.updateStatus(subscribe.getStatus(), subscribe.getId()); |
| | | if (R.isError(r)){ |
| | | throw new ServiceException("更新预约状态失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void commission(Long orderId) { |
| | | |
| | | // 售后设置 |
| | | R<BaseSetting> baseSettingR = baseSettingClient.getBaseSetting(5); |
| | | if (R.isError(baseSettingR)) { |
| | | throw new ServiceException("售后设置获取失败"); |
| | | } |
| | | BaseSetting baseSetting = baseSettingR.getData(); |
| | | if (baseSetting == null) { |
| | | throw new ServiceException("售后设置获取失败"); |
| | | } |
| | | String content = baseSetting.getContent(); |
| | | JSONObject jsonObject = JSONObject.parseObject(content); |
| | | Long days = jsonObject.getLong("days"); |
| | | commissionService.addToCommissionDelayQueue(order.getId(), LocalDateTime.now().plusDays(days)); |
| | | } |
| | | } |
| | |
| | | order.setGoodName(goodName.substring(0, goodName.length() - 1)); |
| | | Goods goods = goodsClient.getGoodsById(goodsList.get(0).getGoodsId()).getData(); |
| | | order.setOrderType(goods.getType()); |
| | | order.setOrderStatus(1); |
| | | order.setOrderStatus(goods.getType() == 1 ? 3 : 1); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | order.setOrderNumber("QJS" + getNumber(3) + sdf.format(new Date())); |
| | | order.setTotalAmount(orderMoney.setScale(2, RoundingMode.HALF_EVEN)); |
File was renamed from ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/VerifiableShopVo.java |
| | |
| | | package com.ruoyi.other.vo; |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.other.api.domain.GoodsCategory; |
| | | import com.ruoyi.other.service.GoodsCategoryService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/goods-category") |
| | | @Api(tags = "商品分类") |
| | | public class GoodsCategoryController { |
| | | @Api("商品分类") |
| | | public class GoodsCategoryController extends BaseController { |
| | | @Resource |
| | | private GoodsCategoryService goodsCategoryService; |
| | | |
| | | |
| | | @PostMapping("/addGoodsCategory") |
| | | @ApiOperation(value = "添加商品分类", tags = {"管理后台-商品分类"}) |
| | | public R<Void> addGoodsCategory(@RequestBody GoodsCategory goodsCategory){ |
| | | goodsCategoryService.save(goodsCategory); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PutMapping("/updateGoodsCategory") |
| | | @ApiOperation(value = "修改商品分类", tags = {"管理后台-商品分类"}) |
| | | public R<Void> updateGoodsCategory(@RequestBody GoodsCategory goodsCategory){ |
| | | goodsCategoryService.updateById(goodsCategory); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/getGoodsCategoryById") |
| | | @ApiOperation(value = "商品分类详情", tags = {"管理后台-商品分类"}) |
| | | public R<GoodsCategory> getGoodsCategoryById(@RequestParam("id") Integer id){ |
| | | return R.ok(goodsCategoryService.getById(id)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getList") |
| | | @ApiOperation(value = "商品分类列表", tags = {"管理后台-商品分类"}) |
| | | public R<Page<GoodsCategory>> list(@ApiParam("页码") @RequestParam Integer PageNum,@ApiParam("每一页数据大小") Integer pageSize, GoodsCategory goodsCategory){ |
| | | Page<GoodsCategory> page = goodsCategoryService.lambdaQuery() |
| | | .like(StringUtils.isNotEmpty(goodsCategory.getName()),GoodsCategory::getName, goodsCategory.getName()) |
| | | .page(Page.of(PageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation(value = "删除商品分类", tags = {"管理后台-商品分类"}) |
| | | public R<Void> delete(@RequestParam("id") Integer id){ |
| | | goodsCategoryService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/index/list") |
| | | @ApiOperation(value = "商品分类", tags = {"小程序-首页"}) |
| | |
| | | List<GoodsCategory> indexlist = goodsCategoryService.lambdaQuery() |
| | | .orderByDesc(GoodsCategory::getCreateTime) |
| | | .last("limit 8") |
| | | .list() |
| | | ; |
| | | .list(); |
| | | return R.ok(indexlist); |
| | | } |
| | | @GetMapping("/list") |
| | |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | /** |
| | | * 添加商品 |
| | | */ |
| | | @PostMapping("/addGoods") |
| | | @ApiOperation(value = "添加商品", tags = {"管理后台-发布商品"}) |
| | | public R<Void> addGoods(@RequestBody Goods goods) { |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | @ResponseBody |
| | | @PostMapping("/getGoodsShopByGoodsIds") |
| | | public R<List<GoodsShop>> getGoodsShopByGoodsIds(@RequestBody GetGoodsShopByGoodsIds goodsIds) { |
| | | List<GoodsShop> list = goodsShopService.list(new LambdaQueryWrapper<GoodsShop>().eq(GoodsShop::getShopId, goodsIds.getShopId()).in(GoodsShop::getGoodsId, goodsIds.getGoodsIds())); |
| | | List<GoodsShop> list = goodsShopService.list(new LambdaQueryWrapper<GoodsShop>() |
| | | .eq(goodsIds.getShopId() != null,GoodsShop::getShopId, goodsIds.getShopId()) |
| | | .in(goodsIds.getGoodsIds() !=null ,GoodsShop::getGoodsId, goodsIds.getGoodsIds())); |
| | | return R.ok(list); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.RedPackegeSet; |
| | | import com.ruoyi.other.service.RedPackegeSetService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/red-packege-set") |
| | | public class RedPackegeSetController { |
| | | @Resource |
| | | private RedPackegeSetService redPackegeSetService; |
| | | //获取当前生效的红包设置 |
| | | @ResponseBody |
| | | @GetMapping("/get") |
| | | public R<BigDecimal> get(){ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | RedPackegeSet one = redPackegeSetService.lambdaQuery().le(RedPackegeSet::getStartTime, now).ge(RedPackegeSet::getEndTime, now).one(); |
| | | if (one!=null){ |
| | | return R.ok(one.getPackegeAmount()); |
| | | }else { |
| | | return R.ok(BigDecimal.ZERO); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "列表", tags = {"后台-分享管理"}) |
| | | @GetMapping("/manage/list") |
| | | public R<Page<Share>> managelist(String name,Integer addType,@RequestParam Integer PageNum,Integer pageSize){ |
| | | Page<Share> page = shareService.lambdaQuery().like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(PageNum, pageSize)); |
| | | Page<Share> page = shareService.lambdaQuery().eq(Share::getAuditStatus,1).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageSize, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "列表", tags = {"后台-分享管理-审核"}) |
| | | @GetMapping("/manage/auth/list") |
| | | public R<Page<Share>> authmanagelist(String name,Integer addType,@RequestParam Integer PageNum,Integer pageSize){ |
| | | Page<Share> page = shareService.lambdaQuery().ne(Share::getAuditStatus,1).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageSize, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | import com.ruoyi.other.service.TechnicianService; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | | import com.ruoyi.other.vo.VerifiableShopVo; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getVerifiableShop") |
| | | @ApiOperation(value = "获取可核销门店列表", tags = {"购物车-小程序"}) |
| | | public R<List<VerifiableShopVo>> getVerifiableShop(){ |
| | | // todo 待完善 pu |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id获取门店信息 |
| | | * @param id |
| | |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "预约列表", notes = "预约列表", tags = {"小程序-个人中心-门店管理-预约列表"}) |
| | | public TableDataInfo<TechnicianSubscribeVO> list(@ApiParam(value = "状态") @RequestParam Integer status, |
| | | public TableDataInfo<TechnicianSubscribeVO> list(@ApiParam(value = "状态") Integer status, |
| | | @ApiParam(value = "门店id") @RequestParam Long shopId) { |
| | | startPage(); |
| | | List<TechnicianSubscribeVO> list = technicianSubscribeService |
| | | .getTechnicianSubscribeByUserAndShop(SecurityUtils.getUserId(), shopId); |
| | | .getTechnicianSubscribeByUserAndShop(shopId,status); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | |
| | | return R.ok(technicianSubscribeService.getTechnicianSubscribeByUser(page, SecurityUtils.getUserId(), status)); |
| | | } |
| | | |
| | | @GetMapping("/getSubscribeByOrderId") |
| | | @ApiOperation(value = "根据订单id获取预约信息", notes = "根据订单id获取预约信息", tags = {"后台-技师预约管理-根据订单id获取预约信息"}) |
| | | public R<TechnicianSubscribe> getSubscribeByOrderId(@ApiParam(value = "订单id") @RequestParam Long orderId) { |
| | | return R.ok(technicianSubscribeService.getOne(new LambdaQueryWrapper<TechnicianSubscribe>() |
| | | .eq(TechnicianSubscribe::getOrderId, orderId))); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | @GetMapping("getVipSettingById") |
| | | @ApiOperation(value = "获取会员设置") |
| | | public R<VipSetting> getVipSettingById(@ApiParam(value = "会员id") @RequestParam Integer id) { |
| | | public R<VipSetting> getVipSettingById(@ApiParam(value = "会员id") @RequestParam("id") Integer id) { |
| | | return R.ok(vipSettingService.getById(id)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.other.api.domain.Technician; |
| | | import com.ruoyi.other.vo.TechnicianDetailVO; |
| | | import com.ruoyi.other.vo.TechnicianVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | public interface TechnicianMapper extends BaseMapper<Technician> { |
| | | |
| | | List<TechnicianVO> selectTechnicianListByShopId(Long shopId, String name); |
| | | List<TechnicianVO> selectTechnicianListByShopId(@Param("shopId") Long shopId,@Param("name") String name); |
| | | |
| | | TechnicianDetailVO selectTechnicianDetail(Long technicianId); |
| | | |
| | |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | public List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(@Param("userId") Long userId, |
| | | @Param("shopId") Long shopId); |
| | | List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop( |
| | | @Param("shopId") Long shopId, |
| | | @Param("status") Integer status); |
| | | IPage<TechnicianSubscribeVO> getTechnicianSubscribeByUser(@Param("page") Page<TechnicianSubscribe> page, @Param("userId") Long userId, |
| | | @Param("status") Integer status); |
| | | } |
| | |
| | | /** |
| | | * 查询用于指定门店的相关预约记录 |
| | | */ |
| | | List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long userId, Long shopId); |
| | | List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long shopId, Integer status); |
| | | |
| | | IPage<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Page<TechnicianSubscribe> page, Long userId, Integer status); |
| | | |
| | |
| | | private RemoteOrderGoodsClient orderGoodsClient; |
| | | |
| | | @Override |
| | | public List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long userId, Long shopId) { |
| | | return technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(userId, shopId); |
| | | public List<TechnicianSubscribeVO> getTechnicianSubscribeByUserAndShop(Long shopId, Integer status) { |
| | | return technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(shopId,status); |
| | | } |
| | | @Override |
| | | public IPage<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Page<TechnicianSubscribe> page, Long userId, Integer status) { |
| | |
| | | technicianSubscribeMapper.insert(subscribe); |
| | | } |
| | | if (subscribe.getTechnicianId() != null){ |
| | | orderGoodsClient.subscribe(subscribe.getOrderId(), Math.toIntExact(subscribe.getId())); |
| | | orderGoodsClient.subscribe(subscribe.getOrderId(), subscribe.getTechnicianId()); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | <select id="getTechnicianSubscribeByUserAndShop" resultType="com.ruoyi.other.vo.TechnicianSubscribeVO"> |
| | | SELECT |
| | | CAST(tts.id AS CHAR) id, |
| | | tts.user_address, |
| | | ts.`name` shopName, |
| | | ts.address shopAddress, |
| | | tt.name technicianName, |
| | | ts.longitude, |
| | | ts.latitude, |
| | | tts.subscribe_time, |
| | | tts.service_mode, |
| | | tts.status |
| | |
| | | LEFT JOIN t_technician tt ON tts.technician_id = tt.id AND tt.del_flag = 0 |
| | | LEFT JOIN t_shop ts ON tt.shop_id = ts.id AND ts.del_flag = 0 |
| | | WHERE |
| | | ( (ts.app_user_id = #{userId} AND ts.id = #{shopId}) |
| | | OR |
| | | (tt.app_user_id = #{userId} AND ts.id = #{shopId})) |
| | | ts.id = #{shopId} |
| | | AND tts.del_flag = 0 |
| | | <if test="status != null"> |
| | | AND tts.status = #{status} |
| | | </if> |
| | | ORDER BY tts.create_time DESC |
| | | </select> |
| | | |