he2802 2 years ago
parent
commit
518f667187

+ 10 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java

@@ -33,6 +33,7 @@ import com.zhongzheng.modules.base.vo.UserProfileExportVo;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
+import com.zhongzheng.modules.grade.domain.ClassGradeUser;
 import com.zhongzheng.modules.inform.bo.InformUserAddBo;
 import com.zhongzheng.modules.inform.service.IInformRemindService;
 import com.zhongzheng.modules.inform.service.IInformUserService;
@@ -172,10 +173,17 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
                 throw new CustomException("图片地址错误");
             }
         }
-        if(Validator.isEmpty(bo.getOrderGoodsId())||bo.getOrderGoodsId()==0L){
+        if(Validator.isEmpty(bo.getTypeStatus())||Validator.isEmpty(bo.getOrderGoodsId())||bo.getOrderGoodsId()==0L){
             throw new CustomException("参数错误");
         }
-
+        UserProfile old = getOne(new LambdaQueryWrapper<UserProfile>().eq(UserProfile::getOrderGoodsId, bo.getOrderGoodsId())
+                .eq(UserProfile::getCurrentStatus, 1L)
+                .eq(UserProfile::getChangeStatus, 1L)
+                .eq(UserProfile::getTypeStatus, bo.getTypeStatus())
+                .last("limit 1"));
+        if(Validator.isNotEmpty(old)){
+            throw new CustomException("存在未处理的数据,无法操作");
+        }
         UserProfile add = BeanUtil.toBean(bo, UserProfile.class);
         validEntityBeforeSave(add);
         add.setCreateTime(DateUtils.getNowTime());