Merge remote-tracking branch 'origin/master'
# Conflicts:
# ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
| | |
| | | public R editUserCoupon(UserCoupon userCoupon) { |
| | | return R.fail("编辑用户优惠券失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R editReturnUse(UserCoupon userCoupon) { |
| | | return R.fail("编辑用户优惠券使用时间失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/user-coupon/editUserCoupon") |
| | | R editUserCoupon(@RequestBody UserCoupon userCoupon); |
| | | |
| | | |
| | | /** |
| | | * 编辑用户优惠券使用时间 |
| | | * @param userCoupon |
| | | * @return |
| | | */ |
| | | @PostMapping("/user-coupon/editReturnUse") |
| | | R editReturnUse(@RequestBody UserCoupon userCoupon); |
| | | } |
| | |
| | | @ApiModelProperty(value = "收件人电话") |
| | | @TableField("recieve_phone") |
| | | private String recievePhone; |
| | | |
| | | @ApiModelProperty(value = "省") |
| | | @TableField("province") |
| | | private String province; |
| | | |
| | | @ApiModelProperty(value = "省编号") |
| | | @TableField("province_code") |
| | | private String provinceCode; |
| | | |
| | | @ApiModelProperty(value = "市") |
| | | @TableField("city") |
| | | private String city; |
| | | |
| | | @ApiModelProperty(value = "市编号") |
| | | @TableField("city_code") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty(value = "区") |
| | | @TableField("district") |
| | | private String district; |
| | | |
| | | @ApiModelProperty(value = "区编号") |
| | | @TableField("district_code") |
| | | private String districtCode; |
| | | |
| | | @ApiModelProperty(value = "收件人地址") |
| | | @TableField("recieve_address") |
| | |
| | | @TableField("order_status") |
| | | private Integer orderStatus; |
| | | |
| | | @ApiModelProperty(value = "1待发货2待收货3待使用4已完成5已取消6已退款7售后中8已评价") |
| | | @TableField("old_order_status") |
| | | private Integer oldOrderStatus; |
| | | |
| | | @ApiModelProperty(value = "是否已分佣: 0-否 1-是") |
| | | @TableField("is_commission") |
| | | private Integer isCommission; |
| | |
| | | @TableField("express_result") |
| | | private String expressResult; |
| | | |
| | | @ApiModelProperty(value = "发货省") |
| | | @TableField("deliver_province") |
| | | private String deliverProvince; |
| | | |
| | | @ApiModelProperty(value = "发货省编号") |
| | | @TableField("deliver_province_code") |
| | | private String deliverProvinceCode; |
| | | |
| | | @ApiModelProperty(value = "发货市") |
| | | @TableField("deliver_city") |
| | | private String deliverCity; |
| | | |
| | | @ApiModelProperty(value = "发货市编号") |
| | | @TableField("deliver_city_code") |
| | | private String deliverCityCode; |
| | | |
| | | @ApiModelProperty(value = "发货区") |
| | | @TableField("deliver_district") |
| | | private String deliverDistrict; |
| | | |
| | | @ApiModelProperty(value = "发货区编号") |
| | | @TableField("deliver_district_code") |
| | | private String deliverDistrictCode; |
| | | |
| | | @ApiModelProperty(value = "收货地址信息") |
| | | @TableField("address_json") |
| | | private String addressJson; |
| | |
| | | } |
| | | //门店员工添加数据,需要判断账号是否存在,共用同一个账号 |
| | | if(2 == sysUser1.getRoleType()){ |
| | | SysUser one = userService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, user.getPhonenumber()) |
| | | .eq(SysUser::getDelFlag, "0").eq(SysUser::getStatus, "0").eq(SysUser::getRoleType, 2)); |
| | | if(null == one){ |
| | | AppUser appUser = appUserClient.getAppUserByPhone1(user.getPhonenumber()).getData(); |
| | | if(null == appUser){ |
| | | return error("请先注册小程序账号"); |
| | | } |
| | | SysUser one = userService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, user.getPhonenumber()) |
| | | .eq(SysUser::getDelFlag, "0").eq(SysUser::getStatus, "0").eq(SysUser::getRoleType, 2)); |
| | | if(null == one){ |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword("a123456")); |
| | | user.setRoleType(sysUser1.getRoleType()); |
| | |
| | | sysUserRole.setRoleId(user.getRoleId()); |
| | | sysUserRole.setUserId(user.getUserId()); |
| | | userRoleService.insertSysUserRole(sysUserRole); |
| | | |
| | | } |
| | | //添加小程序店员关系数据 |
| | | if(null != appUser){ |
| | | List<AppUserShop> data = appUserShopClient.getAppUserShop(appUser.getId()).getData(); |
| | | Optional<AppUserShop> first = data.stream().filter(s -> s.getShopId().equals(sysUser1.getObjectId())).findFirst(); |
| | | if(!first.isPresent()){ |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShop.setShopId(sysUser1.getObjectId()); |
| | |
| | | appUserClient.editAppUserById(appUser); |
| | | } |
| | | } |
| | | |
| | | //添加门店员工关系数据 |
| | | UserShop userShop = new UserShop(); |
| | | userShop.setUserId(one.getUserId()); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserShopClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.AppUserShop; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.SpringUtils; |
| | |
| | | |
| | | @Resource |
| | | private UserShopService userShopService; |
| | | |
| | | @Resource |
| | | private AppUserShopClient appUserShopClient; |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | /** |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int deleteUserByIds(Long[] userIds) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = this.getById(userid); |
| | | for (Long userId : userIds) { |
| | | checkUserAllowed(new SysUser(userId)); |
| | | // checkUserDataScope(userId); |
| | |
| | | // userRoleMapper.deleteUserRole(userIds); |
| | | // // 删除用户与岗位关联 |
| | | // userPostMapper.deleteUserPost(userIds); |
| | | int i = userMapper.deleteUserByIds(userIds); |
| | | // int i = userMapper.deleteUserByIds(userIds); |
| | | List<SysUser> sysUsers = this.listByIds(Arrays.asList(userIds)); |
| | | for (SysUser user : sysUsers) { |
| | | if(2 == user.getRoleType()){ |
| | | userShopService.remove(new LambdaQueryWrapper<UserShop>().eq(UserShop::getUserId, user.getUserId()).eq(UserShop::getShopId, user.getObjectId())); |
| | | userShopService.remove(new LambdaQueryWrapper<UserShop>().eq(UserShop::getUserId, user.getUserId()).eq(UserShop::getShopId, sysUser.getObjectId())); |
| | | AppUser appUser = appUserClient.getAppUserByPhone1(user.getPhonenumber()).getData(); |
| | | if(null != appUser){ |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShop.setShopId(sysUser.getObjectId()); |
| | | appUserShopClient.delAppUserShop(appUserShop); |
| | | int size = appUserShopClient.getAppUserShop(appUser.getId()).getData().size(); |
| | | if(size == 0){ |
| | | appUser.setUserType(1); |
| | | appUserClient.editAppUserById(appUser); |
| | | } |
| | | } |
| | | return i; |
| | | long count = userShopService.count(new LambdaQueryWrapper<UserShop>().eq(UserShop::getUserId, user.getUserId())); |
| | | if(0 == count){ |
| | | user.setDelFlag("2"); |
| | | this.updateById(user); |
| | | } |
| | | }else{ |
| | | user.setDelFlag("2"); |
| | | this.updateById(user); |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private ShopBalanceStatementClient shopBalanceStatementClient; |
| | | @Resource |
| | | private UserCancellationLogService userCancellationLogService; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | return R.ok(user); |
| | | } |
| | | |
| | | @Resource |
| | | private UserCancellationLogService userCancellationLogService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/unregis") |
| | |
| | | if (user.getShopId() != null) { |
| | | R<Shop> storeById = shopClient.getShopById(user.getShopId()); |
| | | if (storeById.getData() != null) { |
| | | user.setShopName(storeById.getData().getName()); |
| | | Shop shop = storeById.getData(); |
| | | user.setShopName(shop.getName()); |
| | | } |
| | | } |
| | | Long count1 = appUserService.lambdaQuery().eq(AppUser::getVipId, 1).eq(AppUser::getInviteUserId, userId).or().eq(AppUser::getTopInviteId,userId).count(); |
| | |
| | | .merge(vipId, distributionAmount, BigDecimal::add); |
| | | } |
| | | } |
| | | |
| | | // 门店分佣计算 |
| | | List<Shop> data = shopClient.getAllShop().getData(); |
| | | if(sysUser.getRoleType() == 2){ |
| | | data = Arrays.asList(shopClient.getShopById(sysUser.getObjectId()).getData()); |
| | |
| | | return commissionDate; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | |
| | | |
| | | |
| | | |
| | | commissionDetail.setCommissionDateList(commissionDateList); |
| | | return R.ok(commissionDetail); |
| | |
| | | goodNames.add(datum.getName()); |
| | | } |
| | | } |
| | | vo.setGoodNames(goodNames); |
| | | } |
| | | vo.setGoodNames(goodNames); |
| | | } |
| | | |
| | | record.setCouponInfoVo(vo); |
| | |
| | | userCouponService.updateById(userCoupon); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑用户优惠券使用时间 |
| | | * @param userCoupon |
| | | * @return |
| | | */ |
| | | @PostMapping("/editReturnUse") |
| | | public R editReturnUse(@RequestBody UserCoupon userCoupon){ |
| | | userCouponService.update(new LambdaUpdateWrapper<UserCoupon>().eq(UserCoupon::getId, userCoupon.getId()) |
| | | .set(UserCoupon::getUseTime, userCoupon.getUseTime())); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | |
| | | |
| | | private Map<Integer, R<GoodsVip>> getGoodsVips(List<Integer> vipIds) { |
| | | Map<Integer, R<GoodsVip>> result = new HashMap<>(); |
| | | for (Integer vipId : vipIds) { |
| | | R<GoodsVip> goodsVipR = goodsVipClient.getGoodsVip(null, vipId); |
| | | result.put(vipId, goodsVipR); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private Map<Integer, R<List<VipGood>>> getVipGoods(List<Integer> vipIds) { |
| | | Map<Integer, R<List<VipGood>>> result = new HashMap<>(); |
| | | for (Integer vipId : vipIds) { |
| | |
| | | return result; |
| | | } |
| | | |
| | | private boolean isValidJson(String json) { |
| | | try { |
| | | JSONObject.parseObject(json); |
| | | return true; |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | public void apply(AgentApplication agentApplication) { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | AppUser appUser = appUserService.getById(loginUserApplet.getUserid()); |
| | | |
| | | Long aLong = agentApplicationMapper.selectCount(new QueryWrapper<AgentApplication>().eq("app_user_id", appUser.getId()) |
| | | .eq("application_vip_id", agentApplication.getApplicationVipId()).eq("status", 1).eq("del_flag", 0)); |
| | | if(0 != aLong){ |
| | | throw new RuntimeException("已发起申请,请等待平台工作人员与您联系"); |
| | | } |
| | | agentApplication.setAppUserId(loginUserApplet.getUserid()); |
| | | agentApplication.setStatus(1); |
| | | agentApplication.setApplicationTime(LocalDateTime.now()); |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | |
| | | @Override |
| | | public List<PaymentUserCouponVo> getUserCoupon(Long userId, Integer type) { |
| | | List<UserCoupon> list = this.list(new LambdaQueryWrapper<UserCoupon>().eq(UserCoupon::getAppUserId, userId).eq(UserCoupon::getDelFlag, 0) |
| | | .last(" and now() between start_time and end_time")); |
| | | .isNull(UserCoupon::getUseTime).gt(UserCoupon::getEndTime, LocalDateTime.now()).last(" and now() between start_time and end_time")); |
| | | List<Integer> couponIds = list.stream().map(UserCoupon::getCouponId).collect(Collectors.toList()); |
| | | if(couponIds.size() == 0){ |
| | | return null; |
| | | } |
| | | List<CouponInfo> couponInfoList = couponInfoClient.getCouponInfoList(couponIds).getData(); |
| | | //构建返回数据 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | List<PaymentUserCouponVo> infoVoList = new ArrayList<>(); |
| | | for (UserCoupon userCoupon : list) { |
| | | CouponInfo couponInfo = couponInfoList.stream().filter(s -> s.getId().equals(userCoupon.getCouponId())).findFirst().get(); |
| | |
| | | public R<Void> updateOrderStatus(@RequestBody Order order){ |
| | | Order order1 = orderService.getById(order.getId()); |
| | | order1.setOrderStatus(order.getOrderStatus()); |
| | | order1.setOldOrderStatus(order.getOldOrderStatus()); |
| | | orderService.updateById(order1); |
| | | return R.ok(); |
| | | } |
| | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | @Resource |
| | | private GoodsShopClient goodsShopClient; |
| | | @Resource |
| | | private ShopClient shopClient; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.feignClient.BalanceChangeRecordClient; |
| | | import com.ruoyi.account.api.feignClient.UserCouponClient; |
| | | import com.ruoyi.account.api.feignClient.UserPointClient; |
| | | import com.ruoyi.account.api.model.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | @Resource |
| | | private SystemConfigClient systemConfigClient; |
| | | |
| | | @Resource |
| | | private UserCouponClient userCouponClient; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | orderDetailVO.setAddressId(userAddress.getId()); |
| | | orderDetailVO.setRecieveName(userAddress.getRecieveName()); |
| | | orderDetailVO.setRecievePhone(userAddress.getRecievePhone()); |
| | | userAddress.setRecieveAddress(userAddress.getProvince() + userAddress.getCity() + userAddress.getDistrict() + userAddress.getRecieveAddress()); |
| | | orderDetailVO.setRecieveAddress(userAddress.getRecieveAddress()); |
| | | orderDetailVO.setOrderNumber(order.getOrderNumber()); |
| | | orderDetailVO.setCreateTime(order.getCreateTime()); |
| | |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | appUserClient.editAppUserById(appUser); |
| | | //回退优惠券状态 |
| | | if(null != order.getUserCouponId()){ |
| | | UserCoupon userCoupon = userCouponClient.getUserCoupon(order.getUserCouponId()).getData(); |
| | | userCoupon.setUseTime(null); |
| | | userCouponClient.editReturnUse(userCoupon); |
| | | } |
| | | } |
| | | if(3 == payMethod){ |
| | | //开始运费退款,积分支付,运费是单独进行支付的,所以需要单独退款 |
| | |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | appUserClient.editAppUserById(appUser); |
| | | |
| | | //回退优惠券状态 |
| | | if(null != order.getUserCouponId()){ |
| | | UserCoupon userCoupon = userCouponClient.getUserCoupon(order.getUserCouponId()).getData(); |
| | | userCoupon.setUseTime(null); |
| | | userCouponClient.editReturnUse(userCoupon); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if(StringUtils.isNotEmpty(order.getAddressJson())){ |
| | | UserAddress userAddress = JSON.parseObject(order.getAddressJson(), UserAddress.class); |
| | | orderInfo.setRecipient(userAddress.getRecieveName() + "-" + userAddress.getRecievePhone()); |
| | | userAddress.setRecieveAddress(userAddress.getProvince() + userAddress.getCity() + userAddress.getDistrict() + userAddress.getRecieveAddress()); |
| | | orderInfo.setAddress(userAddress.getRecieveAddress()); |
| | | } |
| | | if(StringUtils.isNotEmpty(order.getExpressJson()) && !"NULL".equals(order.getExpressJson())){ |
| | |
| | | String com = jsonObject.getString("com"); |
| | | String num = jsonObject.getString("num"); |
| | | UserAddress userAddress = JSON.parseObject(order.getAddressJson(), UserAddress.class); |
| | | MapTrackKD100Vo mapTrackKD100Vo = ExpressDeliveryUtil.kd100MapTrack(com, num, "", userAddress.getRecieveAddress()); |
| | | MapTrackKD100Vo mapTrackKD100Vo = ExpressDeliveryUtil.kd100MapTrack(com, num, order.getDeliverProvince() + order.getDeliverCity(), |
| | | userAddress.getProvince() + userAddress.getCity()); |
| | | order.setExpressResult(JSON.toJSONString(mapTrackKD100Vo)); |
| | | this.updateById(order); |
| | | //延长时间x小时 |
| | |
| | | UserAddress userAddress = userAddressClient.getDefaultUserAddress(userid).getData(); |
| | | if(null != userAddress){ |
| | | userAddress.setIdStr(userAddress.getId().toString()); |
| | | userAddress.setRecieveAddress(userAddress.getProvince() + userAddress.getCity() + userAddress.getDistrict() + userAddress.getRecieveAddress()); |
| | | confirmOrderVo.setUserAddress(userAddress); |
| | | } |
| | | confirmOrderVo.setPaymentType(confirmOrder.getPaymentType()); |
| | |
| | | * 快递100查询带有地图轨迹数据的快递详情 |
| | | * @param com 快递公司代码 |
| | | * @param num 快递单号 |
| | | * @param from 触发城市名称 |
| | | * @param from 出发城市名称 |
| | | * @param to 到达城市名称 |
| | | * @return |
| | | */ |
| | |
| | | private BigDecimal point; |
| | | @ApiModelProperty("订单状态(1待发货2待收货3待使用4已完成5已取消6已退款7售后中8已评价)") |
| | | private Integer status; |
| | | @ApiModelProperty("物流类型(1=自提,2=快递)") |
| | | private Integer expressType; |
| | | /** |
| | | * 用户id |
| | | */ |
| | |
| | | pay_method as paymentType, |
| | | total_amount as orderMoney, |
| | | point, |
| | | order_status as status |
| | | order_status as status, |
| | | if(express_json is not null and express_json != 'NULL' and express_json != '', 2, 1) as expressType |
| | | from t_order where del_flag = 0 and pay_status = 2 |
| | | <if test="null != item.code and '' != item.code"> |
| | | and order_number like CONCAT('%', #{item.code}, '%') |
| | |
| | | List<GoodsEvaluate> list = goodsEvaluateService.list(new LambdaQueryWrapper<GoodsEvaluate>() |
| | | .eq(GoodsEvaluate::getStatus, 2) |
| | | .eq(GoodsEvaluate::getAppUserId,loginUserApplet.getUserid()) |
| | | .eq(GoodsEvaluate::getDelFlag, 0) |
| | | .eq(GoodsEvaluate::getOrderId, orderId)); |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | Goods goods = goodsService.getById(goodsEvaluate.getGoodsId()); |
| | |
| | | goodsEvaluateService.updateById(goodsEvaluate); |
| | | //修改订单为待评价 |
| | | Order data = orderClient.getOrderById(goodsEvaluate.getOrderId()).getData(); |
| | | data.setOrderStatus(4); |
| | | data.setOrderStatus(data.getOldOrderStatus()); |
| | | orderClient.editOrder(data); |
| | | return R.ok(); |
| | | } |
| | |
| | | .in(!goodsIds.isEmpty(), GoodsEvaluate::getGoodsId, goodsIds) |
| | | .in(!usersNameList.isEmpty(), GoodsEvaluate::getAppUserId, usersNameList) |
| | | .eq(goodsEvaluate.getStatus() != null, GoodsEvaluate::getStatus, goodsEvaluate.getStatus()) |
| | | .eq(GoodsEvaluate::getDelFlag, 0) |
| | | .orderByDesc(GoodsEvaluate::getCreateTime)); |
| | | |
| | | |
| | |
| | | item.setUserName(appUser.getName()); |
| | | } |
| | | Goods goods = goodsService.getById(item.getGoodsId()); |
| | | if(null != goods){ |
| | | item.setGoodsName(goods.getName()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 评论详情 |
| | |
| | | } |
| | | } |
| | | String city = TencentMapUtil.inverseGeographicalAnalysis(shop.getLongitude(), shop.getLatitude(), false); |
| | | if(!StringUtils.hasLength(city)){ |
| | | city = "510100"; |
| | | } |
| | | shop.setProvinceCode(city.substring(0, 2) + "0000"); |
| | | shop.setCityCode(city.substring(0, 4) + "00"); |
| | | shop.setDistrictCode(city); |
| | |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | List<Integer> shopIds = appUserShopList.stream().map(AppUserShop::getShopId).collect(Collectors.toList()); |
| | | List<Shop> shopList = shopService.list(new LambdaQueryWrapper<Shop>().in(Shop::getId, shopIds).eq(Shop::getDelFlag, 0).eq(Shop::getStatus, 1)); |
| | | List<Shop> shopList = shopService.list(new LambdaQueryWrapper<Shop>().in(Shop::getId, shopIds).eq(Shop::getDelFlag, 0)); |
| | | long count = shopList.stream().filter(s -> s.getStatus() == 1).count(); |
| | | if(shopList.size() > 0 && count == 0){ |
| | | return R.fail("操作失败,当前门店已冻结"); |
| | | } |
| | | shopList = shopList.stream().filter(s -> s.getStatus() == 1).collect(Collectors.toList()); |
| | | if(null != appUser.getShopId()){ |
| | | Optional<Shop> first = shopList.stream().filter(s -> s.getId().equals(appUser.getShopId())).findFirst(); |
| | | if(first.isPresent()){ |
| | |
| | | if(first.isPresent()){ |
| | | item.setShopName(first.get().getName()); |
| | | } |
| | | item.setIdStr(item.getId().toString()); |
| | | } |
| | | return R.ok(page); |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.feignClient.OrderClient; |
| | | import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.other.mapper.GoodsEvaluateMapper; |
| | |
| | | private RemoteOrderGoodsClient remoteOrderGoodsClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | } |
| | | } |
| | | if (CollectionUtil.isNotEmpty(evaluates)){ |
| | | Long orderId = goodsEvaluateVO.getEvaluates().get(0).getOrderId(); |
| | | Order data = orderClient.getOrderById(orderId).getData(); |
| | | Order order = new Order(); |
| | | order.setId(goodsEvaluateVO.getEvaluates().get(0).getOrderId()); |
| | | order.setId(data.getId()); |
| | | order.setOldOrderStatus(data.getOrderStatus()); |
| | | order.setOrderStatus(8); |
| | | R<Void> r = remoteOrderGoodsClient.updateOrderStatus(order); |
| | | if (R.isError(r)){ |
| | |
| | | tg.original_price as originalPrice, |
| | | tg.integral as integral, |
| | | tg.sale_num as saleNum, |
| | | tg.home_page_picture as homePagePicture |
| | | tg.home_page_picture as homePagePicture, |
| | | tg.sort |
| | | FROM t_goods tg |
| | | where tg.del_flag = 0 and tg.status = 2 and (tg.appoint_store = 2 or (tg.appoint_store = 1 and tg.id in (select goods_id from t_goods_shop where shop_id = #{shopId}))) |
| | | and tg.type = 1 |
| | | <if test="vip != null"> |
| | | and (tg.commodity_authority like '%-1%' or tg.commodity_authority like CONCAT('%', #{vip}, '%')) |
| | | </if> |
| | | ORDER BY tg.sale_num DESC |
| | | ORDER BY ifnull(tg.sort, -1) DESC |
| | | </select> |
| | | <select id="selectManageGoodsList" resultType="com.ruoyi.other.api.domain.Goods"> |
| | | SELECT |