|
|
@ -15,11 +15,18 @@ import com.daqing.framework.domain.guarantee.DgLoanNotice; |
|
|
|
import com.daqing.framework.domain.guarantee.DgPaymentConfirmationConsider; |
|
|
|
import com.daqing.framework.domain.guarantee.DgPaymentConfirmationConsider; |
|
|
|
import com.daqing.framework.model.StatusCode; |
|
|
|
import com.daqing.framework.model.StatusCode; |
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
|
|
|
|
import com.daqing.framework.util.RedisUtil; |
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
import jdk.nashorn.internal.ir.IfNode; |
|
|
|
import jdk.nashorn.internal.ir.IfNode; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import org.springframework.web.context.request.RequestContextHolder; |
|
|
|
|
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
@ -36,17 +43,35 @@ public class DgLoanNoticeServiceImpl extends ServiceImpl<DgLoanNoticeMapper, DgL |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private DgPaymentConfirmationConsiderMapper paymentConfirmationConsiderMapper; |
|
|
|
private DgPaymentConfirmationConsiderMapper paymentConfirmationConsiderMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取当前登录用户信息 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private String getUserId(){ |
|
|
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
|
|
|
|
String token = request.getHeader("token"); |
|
|
|
|
|
|
|
return RedisUtil.get("dq:token:"+token); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public PageUtils queryPage(LoanNoticeQueryRequest loanNoticeQueryRequest) { |
|
|
|
public PageUtils queryPage(LoanNoticeQueryRequest loanNoticeQueryRequest) { |
|
|
|
//取出条件
|
|
|
|
//取出条件
|
|
|
|
Integer page = loanNoticeQueryRequest.getPage(); |
|
|
|
Integer page = loanNoticeQueryRequest.getPage(); |
|
|
|
Integer size = loanNoticeQueryRequest.getSize(); |
|
|
|
Integer size = loanNoticeQueryRequest.getSize(); |
|
|
|
Integer status = loanNoticeQueryRequest.getStatus(); |
|
|
|
Integer status = loanNoticeQueryRequest.getStatus(); |
|
|
|
//a根据角色id查询
|
|
|
|
|
|
|
|
Integer roleId = loanNoticeQueryRequest.getRoleId(); |
|
|
|
|
|
|
|
String customerNumberOrName = loanNoticeQueryRequest.getCustomerNumberOrName(); |
|
|
|
String customerNumberOrName = loanNoticeQueryRequest.getCustomerNumberOrName(); |
|
|
|
//分页条件查询
|
|
|
|
|
|
|
|
IPage<LoanNoticeListResponse> loanNoticeVO = baseMapper.pageByCondition(new Page(page,size),roleId,status,customerNumberOrName); |
|
|
|
//获取当前登录用户id
|
|
|
|
|
|
|
|
Integer userId = Integer.parseInt(this.getUserId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取当前用户拥有的角色ids
|
|
|
|
|
|
|
|
String roleIds = RedisUtil.get("dq:userRole:" + userId); |
|
|
|
|
|
|
|
IPage<LoanNoticeListResponse> loanNoticeVO = null; |
|
|
|
|
|
|
|
if(roleIds != null) { |
|
|
|
|
|
|
|
String[] ids = roleIds.split(","); |
|
|
|
|
|
|
|
List<String> roleIdList = Arrays.asList(ids); |
|
|
|
|
|
|
|
//分页条件查询
|
|
|
|
|
|
|
|
loanNoticeVO = baseMapper.pageByCondition(new Page(page,size),roleIds,userId,status,customerNumberOrName); |
|
|
|
|
|
|
|
} |
|
|
|
return new PageUtils(loanNoticeVO); |
|
|
|
return new PageUtils(loanNoticeVO); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|