|
@@ -1,15 +1,19 @@
|
|
|
package cn.com.ty.lift.ud.userAgreement.service.impl;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
-import cn.com.ty.lift.ud.userAgreement.controller.query.UserAgreementQuery;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
|
+import cn.com.ty.lift.ud.userAccount.mapper.entity.UserAccount;
|
|
|
+import cn.com.ty.lift.ud.userAccount.service.IUserAccountService;
|
|
|
+import cn.com.ty.lift.ud.userAgreement.controller.query.UserAgreementQuery;
|
|
|
import cn.com.ty.lift.ud.userAgreement.mapper.UserAgreementMapper;
|
|
|
import cn.com.ty.lift.ud.userAgreement.mapper.entity.UserAgreement;
|
|
|
import cn.com.ty.lift.ud.userAgreement.service.IUserAgreementService;
|
|
@@ -28,6 +32,9 @@ public class UserAgreementServiceImpl extends ServiceImpl<UserAgreementMapper, U
|
|
|
|
|
|
@Autowired
|
|
|
private UserAgreementMapper userAgreementMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IUserAccountService iUserAccountService;
|
|
|
|
|
|
@Override
|
|
|
public void updateByIds(List<Long> ids, Integer status) {
|
|
@@ -55,4 +62,15 @@ public class UserAgreementServiceImpl extends ServiceImpl<UserAgreementMapper, U
|
|
|
return RestResponse.success(queryListCharge, "请求成功");
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public RestResponse getAgreementByUser(Long userId) {
|
|
|
+ List<UserAgreement> resultList = new ArrayList<>();
|
|
|
+ UserAccount byId = iUserAccountService.getById(userId);
|
|
|
+ if(byId.getExpertFlag() == 1) {
|
|
|
+ resultList = userAgreementMapper.selectList(new QueryWrapper<UserAgreement>().eq("statuz", 1));
|
|
|
+ }else {
|
|
|
+ resultList = userAgreementMapper.selectList(new QueryWrapper<UserAgreement>().eq("statuz", 1).eq("type", 1));
|
|
|
+ }
|
|
|
+ return RestResponse.success(resultList,"请求成功");
|
|
|
+ }
|
|
|
}
|