上传代码

master
chen 4 years ago
parent 6b0365ea19
commit 0a96839b59
  1. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgLoanNoticeMapper.java
  2. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgPaymentConfirmationConsiderMapper.java
  3. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PaymentConfirmationUpdateRequest.java
  4. 33
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java
  5. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java
  6. 8
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgLoanNoticeMapper.xml
  7. 2
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml

@ -18,5 +18,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface DgLoanNoticeMapper extends BaseMapper<DgLoanNotice> { public interface DgLoanNoticeMapper extends BaseMapper<DgLoanNotice> {
IPage<LoanNoticeListResponse> pageByCondition(Page page, Integer roleId, Integer status, String customerNumberOrName); IPage<LoanNoticeListResponse> pageByCondition(Page page, String roleIds, Integer userId, Integer status, String customerNumberOrName);
} }

@ -20,6 +20,6 @@ import java.util.List;
@Mapper @Mapper
public interface DgPaymentConfirmationConsiderMapper extends BaseMapper<DgPaymentConfirmationConsider> { public interface DgPaymentConfirmationConsiderMapper extends BaseMapper<DgPaymentConfirmationConsider> {
IPage<PaymentConfirmationListResponse> pageByCondition(Page page, List<String> roleIdList, Integer status, String customerNumberOrName); IPage<PaymentConfirmationListResponse> pageByCondition(Page page, List<String> roleIdList , Integer userId , Integer status, String customerNumberOrName);
} }

@ -11,9 +11,6 @@ import lombok.Data;
@Data @Data
public class PaymentConfirmationUpdateRequest { public class PaymentConfirmationUpdateRequest {
@ApiModelProperty(value = "当前用户")
private Integer currentUser;
@ApiModelProperty(value = "业务id") @ApiModelProperty(value = "业务id")
private Integer businessId; private Integer businessId;

@ -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);
} }

@ -8,7 +8,6 @@ import com.daqing.financial.guarantee.mapper.DgLoanNoticeMapper;
import com.daqing.financial.guarantee.mapper.DgPaymentConfirmationConsiderMapper; import com.daqing.financial.guarantee.mapper.DgPaymentConfirmationConsiderMapper;
import com.daqing.financial.guarantee.model.request.PaymentConfirmationQueryRequest; import com.daqing.financial.guarantee.model.request.PaymentConfirmationQueryRequest;
import com.daqing.financial.guarantee.model.request.PaymentConfirmationUpdateRequest; 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.model.response.PaymentConfirmationListResponse;
import com.daqing.financial.guarantee.service.IDgPaymentConfirmationConsiderService; import com.daqing.financial.guarantee.service.IDgPaymentConfirmationConsiderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -74,7 +73,7 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl<DgPaym
String[] ids = roleIds.split(","); String[] ids = roleIds.split(",");
List<String> roleIdList = Arrays.asList(ids); List<String> 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); return new PageUtils(paymentConfirmationVO);
@ -85,7 +84,8 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl<DgPaym
// TODO 所有操作待添加业务流程数据 // TODO 所有操作待添加业务流程数据
//取出条件 //取出条件
Integer businessId = paymentConfirmationUpdateRequest.getBusinessId(); Integer businessId = paymentConfirmationUpdateRequest.getBusinessId();
Integer currentUser = paymentConfirmationUpdateRequest.getCurrentUser(); //获取当前登录用户id
Integer currentUser = Integer.parseInt(this.getUserId());
String auditOpinion = paymentConfirmationUpdateRequest.getAuditOpinion(); String auditOpinion = paymentConfirmationUpdateRequest.getAuditOpinion();
String imgFile = paymentConfirmationUpdateRequest.getImgFile(); String imgFile = paymentConfirmationUpdateRequest.getImgFile();
//状态为2表示通过,为4表示驳回 //状态为2表示通过,为4表示驳回

@ -39,7 +39,13 @@
left join dg_loan_committee_consider lcc on ln.business_id = lcc.business_id left join dg_loan_committee_consider lcc on ln.business_id = lcc.business_id
left join dg_business_process_status bps on ln.business_id = bps.business_id left join dg_business_process_status bps on ln.business_id = bps.business_id
<where> <where>
AND ln.role_id = #{roleId} ln.role_id in
<foreach collection="roleIdList" open="(" separator="," close=")" item="id">
#{id}
</foreach>
<if test="userId != null and userId != ''">
AND (ln.consider_id = #{userId} or ln.consider_id is null)
</if>
<if test="customerNumberOrName != null and customerNumberOrName != ''"> <if test="customerNumberOrName != null and customerNumberOrName != ''">
AND aai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%') AND aai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%')
</if> </if>

@ -47,7 +47,7 @@
#{id} #{id}
</foreach> </foreach>
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
AND (pcc.user_id = #{userId} or pcc.user_id is null) AND (pcc.consider_id = #{userId} or pcc.consider_id is null)
</if> </if>
<if test="customerNumberOrName != null and customerNumberOrName != ''"> <if test="customerNumberOrName != null and customerNumberOrName != ''">
AND aai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%') AND aai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%')

Loading…
Cancel
Save