diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgLoanNoticeMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgLoanNoticeMapper.java index 793f3beb..41539eda 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgLoanNoticeMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgLoanNoticeMapper.java @@ -18,5 +18,6 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface DgLoanNoticeMapper extends BaseMapper { - IPage pageByCondition(Page page, Integer roleId, Integer status, String customerNumberOrName); + IPage pageByCondition(Page page, String roleIds, Integer userId, Integer status, String customerNumberOrName); + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgPaymentConfirmationConsiderMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgPaymentConfirmationConsiderMapper.java index 8e5ced50..5f6df78f 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgPaymentConfirmationConsiderMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgPaymentConfirmationConsiderMapper.java @@ -20,6 +20,6 @@ import java.util.List; @Mapper public interface DgPaymentConfirmationConsiderMapper extends BaseMapper { - IPage pageByCondition(Page page, List roleIdList, Integer status, String customerNumberOrName); + IPage pageByCondition(Page page, List roleIdList , Integer userId , Integer status, String customerNumberOrName); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PaymentConfirmationUpdateRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PaymentConfirmationUpdateRequest.java index 0f75c9bd..4986ebac 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PaymentConfirmationUpdateRequest.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PaymentConfirmationUpdateRequest.java @@ -11,9 +11,6 @@ import lombok.Data; @Data public class PaymentConfirmationUpdateRequest { - @ApiModelProperty(value = "当前用户") - private Integer currentUser; - @ApiModelProperty(value = "业务id") private Integer businessId; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java index f9985852..abee90d1 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java @@ -15,11 +15,18 @@ import com.daqing.framework.domain.guarantee.DgLoanNotice; import com.daqing.framework.domain.guarantee.DgPaymentConfirmationConsider; import com.daqing.framework.model.StatusCode; import com.daqing.framework.model.response.PromptSuccess; +import com.daqing.framework.util.RedisUtil; import com.daqing.framework.utils.PageUtils; import jdk.nashorn.internal.ir.IfNode; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; 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; /** *

@@ -36,17 +43,35 @@ public class DgLoanNoticeServiceImpl extends ServiceImpl 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 loanNoticeVO = null; + if(roleIds != null) { + String[] ids = roleIds.split(","); + List roleIdList = Arrays.asList(ids); + //分页条件查询 + loanNoticeVO = baseMapper.pageByCondition(new Page(page,size),roleIds,userId,status,customerNumberOrName); + } return new PageUtils(loanNoticeVO); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java index 9b7b4037..6eda8d38 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java @@ -8,7 +8,6 @@ import com.daqing.financial.guarantee.mapper.DgLoanNoticeMapper; import com.daqing.financial.guarantee.mapper.DgPaymentConfirmationConsiderMapper; import com.daqing.financial.guarantee.model.request.PaymentConfirmationQueryRequest; import com.daqing.financial.guarantee.model.request.PaymentConfirmationUpdateRequest; -import com.daqing.financial.guarantee.model.response.GuaranteeLetterListResponse; import com.daqing.financial.guarantee.model.response.PaymentConfirmationListResponse; import com.daqing.financial.guarantee.service.IDgPaymentConfirmationConsiderService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -74,7 +73,7 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl roleIdList = Arrays.asList(ids); //分页条件查询 - paymentConfirmationVO = baseMapper.pageByCondition(new Page(page,size),roleIdList,status,customerNumberOrName); + paymentConfirmationVO = baseMapper.pageByCondition(new Page(page,size),roleIdList,userId,status,customerNumberOrName); } return new PageUtils(paymentConfirmationVO); @@ -85,7 +84,8 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl - AND ln.role_id = #{roleId} + ln.role_id in + + #{id} + + + AND (ln.consider_id = #{userId} or ln.consider_id is null) + AND aai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%') diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml index 6112e43f..6bad26fb 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml @@ -47,7 +47,7 @@ #{id} - AND (pcc.user_id = #{userId} or pcc.user_id is null) + AND (pcc.consider_id = #{userId} or pcc.consider_id is null) AND aai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%')