From bc158172f1e264de94d149981552059ba2dd68cf Mon Sep 17 00:00:00 2001 From: lidongdong <1459917685@qq.com> Date: 星期四, 31 八月 2023 16:35:42 +0800 Subject: [PATCH] 修改用户线下商家下单 商家积分增加问题 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCreditsExchangeServiceImpl.java | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCreditsExchangeServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCreditsExchangeServiceImpl.java index 10753e1..bb375fe 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCreditsExchangeServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCreditsExchangeServiceImpl.java @@ -7,15 +7,18 @@ import com.panzhihua.common.model.vos.community.VolunteerCreditsExchangeVO; import com.panzhihua.common.model.vos.community.VolunteerIntegralMerchantVO; import com.panzhihua.common.model.vos.community.VolunteerIntegralRecordVO; +import com.panzhihua.common.model.vos.community.VolunteerMerchantVO; import com.panzhihua.common.service.user.UserService; import com.panzhihua.common.utlis.Snowflake; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.dao.VolunteerCreditsExchangeDao; import com.panzhihua.service_community.entity.VolunteerCreditsExchange; import com.panzhihua.service_community.entity.VolunteerIntegralMerchant; +import com.panzhihua.service_community.entity.VolunteerMerchant; import com.panzhihua.service_community.service.VolunteerCreditsExchangeService; import com.panzhihua.service_community.service.VolunteerIntegralMerchantService; import com.panzhihua.service_community.service.VolunteerIntegralRecordService; +import com.panzhihua.service_community.service.VolunteerMerchantService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -35,6 +38,9 @@ @Resource private VolunteerIntegralRecordService virService; + + @Resource + private VolunteerMerchantService vmService; @Override @@ -195,11 +201,28 @@ virvo.setCommunityId(item.getCommunityId()); virService.insertVolunteer(virvo); - + //修改个人积分 int num1=integral-Integer.valueOf(item.getPalyIntegral()); loginUserInfoVOR.setLoveIntegral(num1+""); userService.putUser(loginUserInfoVOR); + + //修改商家积分 + R<VolunteerMerchant> vm= vmService.getById(item.getMerchantId()); + + int vmNum=0; + if(!StringUtils.isEmpty(vm.getData().getMerchantIntegral())) + { + vmNum=Integer.valueOf(vm.getData().getMerchantIntegral()); + } + + vmNum+=Integer.valueOf(item.getPalyIntegral()); + + VolunteerMerchantVO vmvo=new VolunteerMerchantVO(); + vmvo.setId(item.getMerchantId()); + vmvo.setMerchantIntegral(vmNum+""); + vmService.updateVolunteerMerchant(vmvo); + item.setCondition("3"); //设置订单号 item.setOrderNumber(Snowflake.getId()+""); -- Gitblit v1.7.1