|
@@ -28,6 +28,7 @@ import com.ydtech.modules.order.dao.InsUploadFilesMapper;
|
|
|
import com.ydtech.modules.order.entity.api.zhongmei.constants.TimeConstants;
|
|
import com.ydtech.modules.order.entity.api.zhongmei.constants.TimeConstants;
|
|
|
import com.ydtech.modules.order.entity.po.InsUploadFiles;
|
|
import com.ydtech.modules.order.entity.po.InsUploadFiles;
|
|
|
import com.ydtech.modules.partner.CalculateCommissionUtils;
|
|
import com.ydtech.modules.partner.CalculateCommissionUtils;
|
|
|
|
|
+import com.ydtech.modules.partner.dao.PartnerLiftingRecordMapper;
|
|
|
import com.ydtech.modules.partner.dao.PartnerPartnerAccountMapper;
|
|
import com.ydtech.modules.partner.dao.PartnerPartnerAccountMapper;
|
|
|
import com.ydtech.modules.partner.dao.PartnerPremiumDetailsMapper;
|
|
import com.ydtech.modules.partner.dao.PartnerPremiumDetailsMapper;
|
|
|
import com.ydtech.modules.partner.dao.PartnerUserMapper;
|
|
import com.ydtech.modules.partner.dao.PartnerUserMapper;
|
|
@@ -71,6 +72,8 @@ public class PartnerUserServiceImpl extends ServiceImpl<PartnerUserMapper, Partn
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private PartnerPremiumDetailsMapper detailsMapper;
|
|
private PartnerPremiumDetailsMapper detailsMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private PartnerLiftingRecordMapper liftingRecordMapper;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public int insert(PartnerUser partnerUser) {
|
|
public int insert(PartnerUser partnerUser) {
|
|
@@ -151,12 +154,19 @@ public class PartnerUserServiceImpl extends ServiceImpl<PartnerUserMapper, Partn
|
|
|
return HttpResult.error("参数不能为空");
|
|
return HttpResult.error("参数不能为空");
|
|
|
}
|
|
}
|
|
|
String grade = userGradeParam.getGrade();
|
|
String grade = userGradeParam.getGrade();
|
|
|
-
|
|
|
|
|
|
|
+ if (StringUtils.equals("2",grade)){
|
|
|
|
|
+ return HttpResult.error("当前用户无法升级");
|
|
|
|
|
+ }
|
|
|
QueryWrapper<PartnerUser> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<PartnerUser> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("user_id",userGradeParam.getId());
|
|
queryWrapper.eq("user_id",userGradeParam.getId());
|
|
|
queryWrapper.eq("grade",Integer.valueOf(grade) - 1 );
|
|
queryWrapper.eq("grade",Integer.valueOf(grade) - 1 );
|
|
|
Long count = baseMapper.selectCount(queryWrapper);
|
|
Long count = baseMapper.selectCount(queryWrapper);
|
|
|
- if (count > 0){
|
|
|
|
|
|
|
+ QueryWrapper<PartnerLiftingRecord> wrapper = new QueryWrapper<>();
|
|
|
|
|
+ wrapper.eq("user_id",userGradeParam.getId());
|
|
|
|
|
+ wrapper.eq("audit_status",0);
|
|
|
|
|
+ Long aLong = liftingRecordMapper.selectCount(wrapper);
|
|
|
|
|
+
|
|
|
|
|
+ if (count > 0 || aLong > 0){
|
|
|
return HttpResult.error();
|
|
return HttpResult.error();
|
|
|
}
|
|
}
|
|
|
if (ruleService.verifyUpgradeConditions(userGradeParam.getId(),userGradeParam.getGrade())){
|
|
if (ruleService.verifyUpgradeConditions(userGradeParam.getId(),userGradeParam.getGrade())){
|