From 11e61cc9f438225d778c3b688e55caa8a4989cfa Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期五, 10 一月 2025 20:11:38 +0800
Subject: [PATCH] 修改bug
---
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java | 30 ++++++---------
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/RefundPassInfo.java | 4 ++
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java | 8 ++-
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/SeckillActivityInfoMapper.xml | 9 ++--
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/RefundPassServiceImpl.java | 8 ++++
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java | 7 +++
6 files changed, 40 insertions(+), 26 deletions(-)
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
index 4d94860..f7f700e 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -777,9 +777,11 @@
}
if(order.getOrderType() == 1){
List<TechnicianSubscribe> technicianSubscribes = technicianSubscribeClient.getTechnicianSubscribeList(order.getId()).getData();
- Set<Integer> collect = technicianSubscribes.stream().map(TechnicianSubscribe::getTechnicianId).collect(Collectors.toSet());
- List<Technician> data = technicianClient.getTechnicianByIds(collect).getData();
- orderInfo.setTechnicianName(data.stream().map(Technician::getName).collect(Collectors.joining(",")));
+ if(technicianSubscribes.size() > 0){
+ Set<Integer> collect = technicianSubscribes.stream().map(TechnicianSubscribe::getTechnicianId).collect(Collectors.toSet());
+ List<Technician> data = technicianClient.getTechnicianByIds(collect).getData();
+ orderInfo.setTechnicianName(data.stream().map(Technician::getName).collect(Collectors.joining(",")));
+ }
}
List<ShopBalanceStatement> data = shopBalanceStatementClient.getShopBalanceStatementList(Arrays.asList(1, 2, 3), order.getId()).getData();
BigDecimal reduce = data.stream().map(ShopBalanceStatement::getVariableAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/RefundPassServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/RefundPassServiceImpl.java
index 67f7867..2dce3ef 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/RefundPassServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/RefundPassServiceImpl.java
@@ -4,6 +4,7 @@
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.kuaidi100.sdk.contant.CompanyConstant;
import com.ruoyi.account.api.feignClient.AppUserClient;
import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.common.core.domain.R;
@@ -234,6 +235,13 @@
refundPassInfo.setPassStatus(refundPass.getPassStatus());
refundPassInfo.setPassRemark(refundPass.getPassRemark());
refundPassInfo.setStatus(refundPass.getStatus());
+ String code = refundPass.getCode();
+ if(StringUtils.isNotEmpty(code)){
+ JSONObject jsonObject = JSON.parseObject(code);
+ refundPassInfo.setExpressCode(jsonObject.getString("num"));
+ String com = jsonObject.getString("com");
+ refundPassInfo.setExpressName(com);
+ }
return refundPassInfo;
}
}
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/RefundPassInfo.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/RefundPassInfo.java
index 29d822f..4f20269 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/RefundPassInfo.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/RefundPassInfo.java
@@ -66,4 +66,8 @@
private String activityName;
@ApiModelProperty("1待审核2已完成3已拒绝4待退货5待平台收货")
private Integer status;
+ @ApiModelProperty("快递单号")
+ private String expressCode;
+ @ApiModelProperty("快递公司名称")
+ private String expressName;
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
index 099cb27..9140c0b 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
@@ -13,6 +13,7 @@
import com.ruoyi.other.api.domain.VipSetting;
import com.ruoyi.other.api.feignClient.VipSettingClient;
import com.ruoyi.other.service.GoodsService;
+import com.ruoyi.other.service.VipSettingService;
import com.ruoyi.other.vo.GoodsVO;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;
@@ -36,6 +37,8 @@
private GoodsService goodsService;
@Resource
private VipSettingClient settingClient;
+ @Resource
+ private VipSettingService vipSettingService;
/**
* 添加商品
@@ -112,6 +115,10 @@
@DeleteMapping("/manageGoodsDelete/{goodsId}")
@ApiOperation(value = "商品删除", tags = {"管理后台-商品管理"})
public R<Void> manageGoodsDelete(@PathVariable("goodsId") Long goodsId){
+ long count = vipSettingService.count(new LambdaQueryWrapper<VipSetting>().last(" where FIND_IN_SET(" + goodsId + ", good_ids)"));
+ if(0 < count){
+ return R.fail("商品已被会员配置使用,不能删除");
+ }
goodsService.removeById(goodsId);
return R.ok();
}
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
index 1a01bec..963c924 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -363,20 +363,6 @@
return R.ok();
}
- /**
- * 获取手机号的后六位。
- *
- * @param phoneNumber 以字符串形式提供的手机号
- * @return 手机号的后六位
- * @throws IllegalArgumentException 如果手机号长度不足六位
- */
- public String getLastSixDigits(String phoneNumber) {
- if (phoneNumber == null || phoneNumber.length() < 6) {
- throw new IllegalArgumentException("手机号长度不足六位");
- }
- // 取字符串的最后六位
- return phoneNumber.substring(phoneNumber.length() - 6);
- }
/**
@@ -413,7 +399,7 @@
return R.ok(new ArrayList<>());
}
List<Integer> shopIds = appUserShopList.stream().map(AppUserShop::getShopId).collect(Collectors.toList());
- List<Shop> shopList = shopService.listByIds(shopIds);
+ List<Shop> shopList = shopService.list(new LambdaQueryWrapper<Shop>().in(Shop::getId, shopIds).eq(Shop::getDelFlag, 0).eq(Shop::getStatus, 1));
if(null != appUser.getShopId()){
Optional<Shop> first = shopList.stream().filter(s -> s.getId().equals(appUser.getShopId())).findFirst();
if(first.isPresent()){
@@ -451,6 +437,13 @@
@GetMapping("/bindShop")
@ApiOperation(value = "绑定门店", tags = {"小程序-个人中心"})
public R<Void> bindShop(@ApiParam("门店id") @RequestParam Integer shopId) {
+ Shop shop = shopService.getById(shopId);
+ if(null == shop || shop.getDelFlag() == 1){
+ return R.fail("绑定店铺不存在");
+ }
+ if(2 == shop.getStatus()){
+ return R.fail("绑定店铺已被冻结");
+ }
AppUser appUser = appUserClient.getAppUserById(SecurityUtils.getUserId());
appUser.setShopId(shopId);
return appUserClient.editAppUserById(appUser);
@@ -557,7 +550,7 @@
city = "510100";
}
city = city.substring(0, 4) + "00";
- LambdaQueryWrapper<Shop> wrapper = new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag, 0).eq(Shop::getCityCode, city);
+ LambdaQueryWrapper<Shop> wrapper = new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag, 0).eq(Shop::getStatus, 1).eq(Shop::getCityCode, city);
if(null != goodsId){
Goods goods = goodsService.getById(goodsId);
if(1 == goods.getType() && 1 == goods.getAppointStore()){
@@ -600,7 +593,7 @@
userShop.setUserId(userid);
List<UserShop> data = userShopClient.getUserShop(userShop).getData();
List<Integer> collect = data.stream().map(UserShop::getShopId).collect(Collectors.toList());
- List<Shop> shops = shopService.listByIds(collect);
+ List<Shop> shops = shopService.list(new LambdaQueryWrapper<Shop>().eq(Shop::getId, collect).eq(Shop::getDelFlag, 0).eq(Shop::getStatus, 1));
List<VerifiableShopVo> list = new ArrayList<>();
for (Shop shop : shops) {
VerifiableShopVo vo = new VerifiableShopVo();
@@ -650,7 +643,8 @@
@GetMapping("/getBankSerialNumber")
@ApiOperation(value = "获取行联号", tags = {"门店后台-财务管理-提现明细"})
public R<List<ReceiverBankChannel>> getBankSerialNumber(String name){
- List<ReceiverBankChannel> list = receiverBankChannelService.list(new LambdaQueryWrapper<ReceiverBankChannel>().like(ReceiverBankChannel::getName, name));
+ List<ReceiverBankChannel> list = receiverBankChannelService.list(new LambdaQueryWrapper<ReceiverBankChannel>()
+ .like(ReceiverBankChannel::getName, name));
return R.ok(list);
}
diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/SeckillActivityInfoMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/SeckillActivityInfoMapper.xml
index 53e8d84..73ff077 100644
--- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/SeckillActivityInfoMapper.xml
+++ b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/SeckillActivityInfoMapper.xml
@@ -76,6 +76,9 @@
LEFT JOIN t_goods tg ON tsai.good_id = tg.id
LEFT JOIN t_goods_category tgc ON tgc.id = tg.goods_category_id
WHERE tsai.del_flag = 0
+ <if test="goods.id != null">
+ AND tsai.id = #{goods.id}
+ </if>
<if test="goods.name != null and goods.name != ''">
AND tg.`name` LIKE concat('%',#{goods.name},'%')
</if>
@@ -88,25 +91,21 @@
<if test="goods.showStatus != null">
AND tsai.is_shelves = #{goods.showStatus}
</if>
-
<if test="goods.type != null">
AND tg.type = #{goods.type}
</if>
-
<if test="goods.status != null and goods.status ==1">
AND tsai.start_time <![CDATA[>]]> NOW()
</if>
-
<if test="goods.status != null and goods.status ==2">
AND tsai.start_time <![CDATA[<=]]> NOW() AND tsai.end_time <![CDATA[>]]> NOW()
</if>
-
<if test="goods.status != null and goods.status ==3">
AND tsai.end_time <![CDATA[<]]> NOW()
</if>
-
<if test="goods.vipId != null">
AND find_in_set(#{goods.vipId},tgs.vip) > 0
</if>
+ order by tsai.create_time desc
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.7.1