he2802 1 rok temu
rodzic
commit
dad90af520

+ 22 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java

@@ -18,10 +18,13 @@ import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
+import com.zhongzheng.modules.base.domain.ProfileTp;
 import com.zhongzheng.modules.base.domain.ShoppingCart;
 import com.zhongzheng.modules.base.domain.UserProfile;
+import com.zhongzheng.modules.base.service.IProfileTpService;
 import com.zhongzheng.modules.base.service.IShoppingCartService;
 import com.zhongzheng.modules.base.service.IUserProfileService;
+import com.zhongzheng.modules.base.vo.ProfileTpVo;
 import com.zhongzheng.modules.course.domain.Course;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.domain.CourseMenu;
@@ -186,6 +189,9 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
     @Autowired
     private IUserExamGoodsSupplementService iUserExamGoodsSupplementService;
 
+    @Autowired
+    private IProfileTpService iProfileTpService;
+
 
     @Override
     public OrderGoodsVo queryById(Long orderGoodsId) {
@@ -1041,6 +1047,22 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
         objectLambdaUpdateWrapper2.set(UserExamGoodsSupplement::getUpdateTime,DateUtils.getNowTime());
         iUserExamGoodsSupplementService.update(null, objectLambdaUpdateWrapper2);
 
+        ProfileTpVo profileTpVo = iProfileTpService.queryByGoodsId(bo.getGoodsId());
+        if(Validator.isNotEmpty(profileTpVo)){
+            if(Validator.isNotEmpty(profileTpVo.getGoodsIds())){
+                LambdaUpdateWrapper<ProfileTp> objectLambdaUpdateWrapper3 = Wrappers.lambdaUpdate();
+                objectLambdaUpdateWrapper3.eq(ProfileTp::getProfileTpId, profileTpVo.getProfileTpId());
+                objectLambdaUpdateWrapper3.set(ProfileTp::getGoodsIds, profileTpVo.getGoodsIds()+","+goodsNew.getGoodsId());
+                objectLambdaUpdateWrapper3.set(ProfileTp::getUpdateTime,DateUtils.getNowTime());
+                iProfileTpService.update(null, objectLambdaUpdateWrapper3);
+            }
+            LambdaUpdateWrapper<UserProfile> objectLambdaUpdateWrapper4 = Wrappers.lambdaUpdate();
+            objectLambdaUpdateWrapper4.eq(UserProfile::getOrderGoodsId, bo.getOrderGoodsId());
+            objectLambdaUpdateWrapper4.set(UserProfile::getGoodsId, goodsNew.getGoodsId());
+            objectLambdaUpdateWrapper4.set(UserProfile::getUpdateTime,DateUtils.getNowTime());
+            iUserProfileService.update(null, objectLambdaUpdateWrapper4);
+        }
+
       /*  LambdaUpdateWrapper<ClassGradeUser> objectLambdaUpdateWrapper3 = Wrappers.lambdaUpdate();
         objectLambdaUpdateWrapper3.eq(ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId());
         objectLambdaUpdateWrapper3.eq(ClassGradeUser::getUserId, bo.getUserId());