Merge remote-tracking branch 'origin/master'

master
shijie 4 years ago
commit f92415db66
  1. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgAssetsInvestigationController.java
  2. 1
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgProcessController.java
  3. 4
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterAssignUserMapper.java
  4. 5
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgPaymentConfirmationConsiderMapper.java
  5. 7
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterQueryRequest.java
  6. 12
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterUpdateStatusRequest.java
  7. 5
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/LoanNoticeQueryRequest.java
  8. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PaymentConfirmationQueryRequest.java
  9. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeLetterListResponse.java
  10. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/LoanNoticeListResponse.java
  11. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PaymentConfirmationListResponse.java
  12. 136
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java
  13. 32
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java
  14. 19
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeLetterAssignUserMapper.xml
  15. 7
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgLoanNoticeMapper.xml
  16. 18
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml

@ -46,7 +46,7 @@ public class DgAssetsInvestigationController {
String CustomerNumberOrName=assetsInvestigationRequest.getCustomerNumberOrName(); String CustomerNumberOrName=assetsInvestigationRequest.getCustomerNumberOrName();
Integer status=assetsInvestigationRequest.getStatus(); Integer status=assetsInvestigationRequest.getStatus();
//获取当前登录用户userId //获取当前登录用户userId
//String userId = dgApplyAmountInfoController.getUserId(); // String userId = dgApplyAmountInfoController.getUserId();
String userId = "5"; String userId = "5";
//根据角色查询资产部调查列表 //根据角色查询资产部调查列表
String roleIds = RedisUtil.get("dq:userRole:" + userId); String roleIds = RedisUtil.get("dq:userRole:" + userId);

@ -17,4 +17,5 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/dg-process") @RequestMapping("/dg-process")
public class DgProcessController { public class DgProcessController {
} }

@ -8,6 +8,8 @@ import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* <p> * <p>
* 担保函记录 Mapper 接口 * 担保函记录 Mapper 接口
@ -19,6 +21,6 @@ import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface DgGuaranteeLetterAssignUserMapper extends BaseMapper<DgGuaranteeLetterAssignUser> { public interface DgGuaranteeLetterAssignUserMapper extends BaseMapper<DgGuaranteeLetterAssignUser> {
IPage<GuaranteeLetterListResponse> pageByCondition(Page page, @Param("userId") Integer userId, @Param("roleId") Integer roleId, @Param("status") Integer status, @Param("customerNumberOrName") String customerNumberOrName); IPage<GuaranteeLetterListResponse> pageByCondition(Page page, Integer userId, List<String> roleIdList, Integer status, String customerNumberOrName);
} }

@ -7,6 +7,8 @@ import com.daqing.financial.guarantee.model.response.PaymentConfirmationListResp
import com.daqing.framework.domain.guarantee.DgPaymentConfirmationConsider; import com.daqing.framework.domain.guarantee.DgPaymentConfirmationConsider;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* <p> * <p>
* 回款确认 Mapper 接口 * 回款确认 Mapper 接口
@ -18,5 +20,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface DgPaymentConfirmationConsiderMapper extends BaseMapper<DgPaymentConfirmationConsider> { public interface DgPaymentConfirmationConsiderMapper extends BaseMapper<DgPaymentConfirmationConsider> {
IPage<PaymentConfirmationListResponse> pageByCondition(Page page, Integer roleId, Integer status, String customerNumberOrName); IPage<PaymentConfirmationListResponse> pageByCondition(Page page, List<String> roleIdList, Integer status, String customerNumberOrName);
} }

@ -18,15 +18,10 @@ public class GuaranteeLetterQueryRequest {
@ApiModelProperty(value = "每页记录数,默认显示10条") @ApiModelProperty(value = "每页记录数,默认显示10条")
private Integer size = 10; private Integer size = 10;
@ApiModelProperty(value = "流程状态:1->审核中、2->拒绝、3->已审核") @ApiModelProperty(value = "审核状态:(1审核中 、2已审核、4已驳回)")
private Integer status; private Integer status;
@ApiModelProperty(value = "业务编号/客户名称") @ApiModelProperty(value = "业务编号/客户名称")
private String CustomerNumberOrName; private String CustomerNumberOrName;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "角色ID")
private Integer roleId;
} }

@ -12,18 +12,6 @@ import lombok.Data;
@Data @Data
public class GuaranteeLetterUpdateStatusRequest { public class GuaranteeLetterUpdateStatusRequest {
@ApiModelProperty(value = "当前用户")
private Integer currentUser;
@ApiModelProperty(value = "当前用户角色")
private Integer currentUserRole;
@ApiModelProperty(value = "a角用户")
private Integer aUser;
@ApiModelProperty(value = "b角用户")
private Integer bUser;
@ApiModelProperty(value = "业务id") @ApiModelProperty(value = "业务id")
private Integer businessId; private Integer businessId;

@ -20,13 +20,10 @@ public class LoanNoticeQueryRequest {
@ApiModelProperty(value = "每页记录数,默认显示10条") @ApiModelProperty(value = "每页记录数,默认显示10条")
private Integer size = 10; private Integer size = 10;
@ApiModelProperty(value = "流程状态:1->审核中、2->拒绝、3->已审核") @ApiModelProperty(value = "审核状态:(1审核中 、2已审核、4已驳回)")
private Integer status; private Integer status;
@ApiModelProperty(value = "业务编号/客户名称") @ApiModelProperty(value = "业务编号/客户名称")
private String CustomerNumberOrName; private String CustomerNumberOrName;
@NotNull
@ApiModelProperty(value = "角色ID")
private Integer roleId;
} }

@ -20,14 +20,10 @@ public class PaymentConfirmationQueryRequest {
@ApiModelProperty(value = "每页记录数,默认显示10条") @ApiModelProperty(value = "每页记录数,默认显示10条")
private Integer size = 10; private Integer size = 10;
@ApiModelProperty(value = "流程状态:1->审核中、2->拒绝、3->已审核") @ApiModelProperty(value = "审核状态:(1审核中 、2已审核、4已驳回)")
private Integer status; private Integer status;
@ApiModelProperty(value = "业务编号/客户名称") @ApiModelProperty(value = "业务编号/客户名称")
private String CustomerNumberOrName; private String CustomerNumberOrName;
@NotNull
@ApiModelProperty(value = "角色ID")
private Integer roleId;
} }

@ -30,7 +30,7 @@ public class GuaranteeLetterListResponse {
@ApiModelProperty("贷审会同意时间") @ApiModelProperty("贷审会同意时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date updateTime; private Date passingTime;
@ApiModelProperty("附件(会议记录)") @ApiModelProperty("附件(会议记录)")
private String file; private String file;
@ -53,11 +53,11 @@ public class GuaranteeLetterListResponse {
@ApiModelProperty("金额") @ApiModelProperty("金额")
@ExcelProperty(value = "金额",index = 4) @ExcelProperty(value = "金额",index = 4)
private Double applyAmount; private Double loanMoney;
@ApiModelProperty("期限") @ApiModelProperty("期限")
@ExcelProperty(value = "期数",index = 5) @ExcelProperty(value = "期数",index = 5)
private String applyTime; private String loanTern;
@ApiModelProperty("申请日期") @ApiModelProperty("申请日期")
@ExcelProperty(value = "申请日期",index = 6) @ExcelProperty(value = "申请日期",index = 6)

@ -46,11 +46,11 @@ public class LoanNoticeListResponse {
@ApiModelProperty("金额") @ApiModelProperty("金额")
@ExcelProperty(value = "金额",index = 4) @ExcelProperty(value = "金额",index = 4)
private Double applyAmount; private Double loanMoney;
@ApiModelProperty("期") @ApiModelProperty("期")
@ExcelProperty(value = "期数",index = 5) @ExcelProperty(value = "期数",index = 5)
private String applyTime; private String loanTern;
@ApiModelProperty("申请日期") @ApiModelProperty("申请日期")
@ExcelProperty(value = "申请日期",index = 6) @ExcelProperty(value = "申请日期",index = 6)

@ -30,7 +30,7 @@ public class PaymentConfirmationListResponse {
@ApiModelProperty("贷审会同意时间") @ApiModelProperty("贷审会同意时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date updateTime; private Date passingTime;
@ApiModelProperty("附件(会议记录)") @ApiModelProperty("附件(会议记录)")
private String file; private String file;
@ -53,11 +53,11 @@ public class PaymentConfirmationListResponse {
@ApiModelProperty("金额") @ApiModelProperty("金额")
@ExcelProperty(value = "金额",index = 4) @ExcelProperty(value = "金额",index = 4)
private Double applyAmount; private Double loanMoney;
@ApiModelProperty("期限") @ApiModelProperty("期限")
@ExcelProperty(value = "期数",index = 5) @ExcelProperty(value = "期数",index = 5)
private String applyTime; private String loanTern;
@ApiModelProperty("申请日期") @ApiModelProperty("申请日期")
@ExcelProperty(value = "申请日期",index = 6) @ExcelProperty(value = "申请日期",index = 6)

@ -16,12 +16,19 @@ import com.daqing.framework.domain.guarantee.DgLoanCommitteeConsider;
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 com.sun.xml.internal.bind.v2.TODO;
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.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
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;
import java.util.spi.CurrencyNameProvider;
/** /**
* <p> * <p>
@ -41,18 +48,35 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
@Autowired @Autowired
private DgLoanCommitteeConsiderMapper dgLoanCommitteeConsiderMapper; private DgLoanCommitteeConsiderMapper dgLoanCommitteeConsiderMapper;
/**
* 获取当前登录用户信息
*/
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(GuaranteeLetterQueryRequest guaranteeLetterQueryRequest) { public PageUtils queryPage(GuaranteeLetterQueryRequest guaranteeLetterQueryRequest) {
//取出条件 //取出条件
Integer page = guaranteeLetterQueryRequest.getPage(); Integer page = guaranteeLetterQueryRequest.getPage();
Integer size = guaranteeLetterQueryRequest.getSize(); Integer size = guaranteeLetterQueryRequest.getSize();
Integer status = guaranteeLetterQueryRequest.getStatus(); Integer status = guaranteeLetterQueryRequest.getStatus();
//a角和b角根据用户id查询,经理根据角色id查询
Integer userId = guaranteeLetterQueryRequest.getUserId();
Integer roleId = guaranteeLetterQueryRequest.getRoleId();
String customerNumberOrName = guaranteeLetterQueryRequest.getCustomerNumberOrName(); String customerNumberOrName = guaranteeLetterQueryRequest.getCustomerNumberOrName();
//获取当前登录用户id
Integer userId = Integer.parseInt(this.getUserId());
//获取当前用户拥有的角色ids
String roleIds = RedisUtil.get("dq:userRole:" + userId);
IPage<GuaranteeLetterListResponse> guaranteeLetterVO = null;
if(roleIds != null) {
String[] ids = roleIds.split(",");
List<String> roleIdList = Arrays.asList(ids);
//分页条件查询 //分页条件查询
IPage<GuaranteeLetterListResponse> guaranteeLetterVO = baseMapper.pageByCondition(new Page(page,size),userId,roleId,status,customerNumberOrName); guaranteeLetterVO = baseMapper.pageByCondition(new Page(page,size),userId,roleIdList,status,customerNumberOrName);
}
return new PageUtils(guaranteeLetterVO); return new PageUtils(guaranteeLetterVO);
} }
@ -75,20 +99,26 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
Integer status = guaranteeLetterUpdateStatusRequest.getStatus(); Integer status = guaranteeLetterUpdateStatusRequest.getStatus();
String auditOpinion = guaranteeLetterUpdateStatusRequest.getAuditOpinion(); String auditOpinion = guaranteeLetterUpdateStatusRequest.getAuditOpinion();
Integer aUser = guaranteeLetterUpdateStatusRequest.getAUser(); //获取当前登录用户id
Integer bUser = guaranteeLetterUpdateStatusRequest.getBUser(); Integer currentUser = Integer.parseInt(this.getUserId());
Integer currentUser = guaranteeLetterUpdateStatusRequest.getCurrentUser(); //获取当前用户拥有的角色ids
Integer currentUserRole = guaranteeLetterUpdateStatusRequest.getCurrentUserRole(); String roleIds = RedisUtil.get("dq:userRole:" + currentUser);
List<String> roleIdList = null;
if(roleIds != null) {
String[] ids = roleIds.split(",");
roleIdList = Arrays.asList(ids);
}
//*************************************************根据角色更新数据************************************************ //*************************************************根据角色更新数据************************************************
//角色不为空 //角色不为空
if (currentUserRole!=null){ if (roleIdList!=null){
//角色为法规部经理则生成担保函操作和驳回操作 //角色为法规部经理则生成担保函操作和驳回操作
if (PromptSuccess.FG_JL_ID.equals(currentUserRole)){ if (roleIdList.contains(PromptSuccess.FG_JL_ID)){
//更新之前,获取此数据的审批状态,如果审批状态为驳回,则更新ab角用户数据,如果审批状态为审批中,则添加ab角用户数据 //更新之前,获取此数据的审批状态,如果审批状态为驳回,则更新ab角用户数据,如果审批状态为审批中,则添加ab角用户数据
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperTemp = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperTemp = new QueryWrapper<>();
queryWrapperTemp.eq("business_id",businessId).eq("role_id",currentUserRole); queryWrapperTemp.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp); DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp);
Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus(); Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus();
@ -96,7 +126,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){ if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){
//根据角色及业务id查询需要更新数据 //根据角色及业务id查询需要更新数据
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("business_id",businessId).eq("role_id",currentUserRole); queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper);
//操作用户为当前用户 //操作用户为当前用户
guaranteeLetterAssignUser.setUserId(currentUser); guaranteeLetterAssignUser.setUserId(currentUser);
@ -111,12 +141,12 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
if (i > 0){ if (i > 0){
//添加a角 //添加a角
DgGuaranteeLetterAssignUser guaranteeLetterUser = new DgGuaranteeLetterAssignUser(); DgGuaranteeLetterAssignUser guaranteeLetterUser = new DgGuaranteeLetterAssignUser();
guaranteeLetterUser.setUserId(aUser); guaranteeLetterUser.setRoleId(PromptSuccess.DB_A_ID);
guaranteeLetterUser.setBusinessId(businessId); guaranteeLetterUser.setBusinessId(businessId);
guaranteeLetterUser.setCompanyId(companyId); guaranteeLetterUser.setCompanyId(companyId);
baseMapper.insert(guaranteeLetterUser); baseMapper.insert(guaranteeLetterUser);
//添加b角 //添加b角
guaranteeLetterUser.setUserId(bUser); guaranteeLetterUser.setRoleId(PromptSuccess.DB_B_ID);
int insert = baseMapper.insert(guaranteeLetterUser); int insert = baseMapper.insert(guaranteeLetterUser);
//更新成功,返回操作结果 //更新成功,返回操作结果
log.info(insert > 0 ? "法规部经理成功生成担保函" : "法规部经理生成担保函失败"); log.info(insert > 0 ? "法规部经理成功生成担保函" : "法规部经理生成担保函失败");
@ -128,7 +158,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){ if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){
//根据角色及业务id查询需要更新数据 //根据角色及业务id查询需要更新数据
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("business_id",businessId).eq("role_id",currentUserRole); queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper);
//操作用户为当前用户 //操作用户为当前用户
guaranteeLetterAssignUser.setUserId(currentUser); guaranteeLetterAssignUser.setUserId(currentUser);
@ -142,7 +172,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
//更新a角 //更新a角
//根据业务id查询A用户数据 //根据业务id查询A用户数据
QueryWrapper<DgGuaranteeLetterAssignUser> guaranteeLetterAssignUserQueryWrapperA = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> guaranteeLetterAssignUserQueryWrapperA = new QueryWrapper<>();
guaranteeLetterAssignUserQueryWrapperA.eq("business_id",businessId).eq("user_id",aUser); guaranteeLetterAssignUserQueryWrapperA.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID);
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperA); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperA);
dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_IN_REVIEW); dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_IN_REVIEW);
dgGuaranteeLetterAssignUserA.setOperatingStatus(StatusCode.CZ_ON_HAND); dgGuaranteeLetterAssignUserA.setOperatingStatus(StatusCode.CZ_ON_HAND);
@ -153,7 +183,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
//更新b角 //更新b角
//根据业务id查询B用户数据 //根据业务id查询B用户数据
QueryWrapper<DgGuaranteeLetterAssignUser> guaranteeLetterAssignUserQueryWrapperB = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> guaranteeLetterAssignUserQueryWrapperB = new QueryWrapper<>();
guaranteeLetterAssignUserQueryWrapperB.eq("business_id",businessId).eq("user_id",bUser); guaranteeLetterAssignUserQueryWrapperB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID);
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperB); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperB);
dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_IN_REVIEW); dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_IN_REVIEW);
dgGuaranteeLetterAssignUserB.setOperatingStatus(StatusCode.CZ_ON_HAND); dgGuaranteeLetterAssignUserB.setOperatingStatus(StatusCode.CZ_ON_HAND);
@ -170,7 +200,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
if (StatusCode.SP_REJECT.equals(status)){ if (StatusCode.SP_REJECT.equals(status)){
//根据角色及业务id查询需要更新数据 //根据角色及业务id查询需要更新数据
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("business_id",businessId).eq("role_id",currentUserRole); queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper);
//操作用户为当前用户 //操作用户为当前用户
guaranteeLetterAssignUser.setUserId(currentUser); guaranteeLetterAssignUser.setUserId(currentUser);
@ -196,10 +226,10 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
} }
//角色为资产部经理则确认担保函操作和驳回操作 //角色为资产部经理则确认担保函操作和驳回操作
if (PromptSuccess.ZC_JL_ID.equals(currentUserRole)){ if (roleIdList.contains(PromptSuccess.ZC_JL_ID)){
//更新之前,获取此数据的审批状态,如果审批状态为驳回,则更新回款确认数据,如果审批状态为审批中,则添加回款确认数据 //更新之前,获取此数据的审批状态,如果审批状态为驳回,则更新回款确认数据,如果审批状态为审批中,则添加回款确认数据
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperTemp = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperTemp = new QueryWrapper<>();
queryWrapperTemp.eq("business_id",businessId).eq("role_id",currentUserRole); queryWrapperTemp.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp); DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp);
Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus(); Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus();
@ -207,7 +237,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){ if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){
//根据角色及业务id查询需要更新数据 //根据角色及业务id查询需要更新数据
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("business_id",businessId).eq("role_id",currentUserRole); queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper);
//操作用户为当前用户 //操作用户为当前用户
guaranteeLetterAssignUser.setUserId(currentUser); guaranteeLetterAssignUser.setUserId(currentUser);
@ -236,7 +266,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){ if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){
//根据角色及业务id查询需要更新数据 //根据角色及业务id查询需要更新数据
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("business_id",businessId).eq("role_id",currentUserRole); queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper);
//操作用户为当前用户 //操作用户为当前用户
guaranteeLetterAssignUser.setUserId(currentUser); guaranteeLetterAssignUser.setUserId(currentUser);
@ -263,12 +293,11 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
} }
} }
//驳回操作,更新数据及更新AB用户数据 //驳回操作,更新数据及更新AB用户数据
if (StatusCode.SP_REJECT.equals(status)){ if (StatusCode.SP_REJECT.equals(status)){
//根据角色及业务id查询需要更新数据 //根据角色及业务id查询需要更新数据
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("business_id",businessId).eq("role_id",currentUserRole); queryWrapper.eq("business_id",businessId).eq("role_id",PromptSuccess.ZC_JL_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapper);
//操作用户为当前用户 //操作用户为当前用户
guaranteeLetterAssignUser.setUserId(currentUser); guaranteeLetterAssignUser.setUserId(currentUser);
@ -277,21 +306,21 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); guaranteeLetterAssignUser.setAuditOpinion(auditOpinion);
//根据当前用户更新审核状态和操作状态及审核意见 //根据当前用户更新审核状态和操作状态及审核意见
int i = baseMapper.updateById(guaranteeLetterAssignUser); int i = baseMapper.updateById(guaranteeLetterAssignUser);
//更新成功,更新AB用户数据 //更新成功,更新AB数据
if (i > 0){ if (i > 0){
//根据业务id查询A用户数据 //根据业务id查询A数据
QueryWrapper<DgGuaranteeLetterAssignUser> guaranteeLetterAssignUserQueryWrapperA = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> guaranteeLetterAssignUserQueryWrapperA = new QueryWrapper<>();
guaranteeLetterAssignUserQueryWrapperA.eq("business_id",businessId).eq("user_id",aUser); guaranteeLetterAssignUserQueryWrapperA.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID);
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperA); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperA);
//审批状态为已驳回,操作状态为待处理 //审批状态为已驳回,操作状态为待处理
dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_REJECT); dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_REJECT);
dgGuaranteeLetterAssignUserA.setOperatingStatus(StatusCode.CZ_ON_HAND); dgGuaranteeLetterAssignUserA.setOperatingStatus(StatusCode.CZ_ON_HAND);
//更新a用户操作业务数据 //更新a操作业务数据
baseMapper.updateById(dgGuaranteeLetterAssignUserA); baseMapper.updateById(dgGuaranteeLetterAssignUserA);
//根据业务id查询B用户数据 //根据业务id查询B数据
QueryWrapper<DgGuaranteeLetterAssignUser> guaranteeLetterAssignUserQueryWrapperB = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> guaranteeLetterAssignUserQueryWrapperB = new QueryWrapper<>();
guaranteeLetterAssignUserQueryWrapperB.eq("business_id",businessId).eq("user_id",bUser); guaranteeLetterAssignUserQueryWrapperB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID);
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperB); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = baseMapper.selectOne(guaranteeLetterAssignUserQueryWrapperB);
//审批状态为已驳回,操作状态为待处理 //审批状态为已驳回,操作状态为待处理
dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_REJECT); dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_REJECT);
@ -304,23 +333,22 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
} }
} }
} }
}
//*********************************************角色为空根据用户更新数据*********************************************
//当前用户为a角用户 //角色为a角确认担保函操作和驳回操作
if (currentUser.equals(aUser)){ if (roleIdList.contains(PromptSuccess.DB_A_ID)){
//更新之前,获取此用户数据的审批状态,如果审批状态为驳回,则更新资产部经理数据,如果审批状态为审批中,则添加资产部经理数据 //更新之前,获取此用户数据的审批状态,如果审批状态为驳回,则更新资产部经理数据,如果审批状态为审批中,则添加资产部经理数据
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperTemp = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperTemp = new QueryWrapper<>();
queryWrapperTemp.eq("business_id",businessId).eq("user_id",aUser); queryWrapperTemp.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp); DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp);
Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus(); Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus();
//首次a角用户确认担保函,检查b角用户是否确认担保函 //首次a角用户确认担保函,检查b角用户是否确认担保函
if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){ if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperUser = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperUser = new QueryWrapper<>();
queryWrapperUser.eq("business_id",businessId).eq("user_id",aUser); queryWrapperUser.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser);
guaranteeLetterAssignUser.setUserId(currentUser);
guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED); guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED);
guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);
guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); guaranteeLetterAssignUser.setAuditOpinion(auditOpinion);
@ -333,7 +361,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
if (i > 0){ if (i > 0){
QueryWrapper<DgGuaranteeLetterAssignUser> tempB = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> tempB = new QueryWrapper<>();
//查询b用户的审核状态 //查询b用户的审核状态
tempB.eq("business_id",businessId).eq("user_id",bUser).select("status"); tempB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID).select("status");
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB);
Integer bStatus = dgGuaranteeLetterAssignUser.getStatus(); Integer bStatus = dgGuaranteeLetterAssignUser.getStatus();
//b用户审核通过,添加资产部经理数据 //b用户审核通过,添加资产部经理数据
@ -353,7 +381,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
//驳回后a角用户再次确认担保函,检查b角用户是否确认担保函 //驳回后a角用户再次确认担保函,检查b角用户是否确认担保函
if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){ if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperUser = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperUser = new QueryWrapper<>();
queryWrapperUser.eq("business_id",businessId).eq("user_id",aUser); queryWrapperUser.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser);
guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED); guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED);
guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);
@ -365,7 +393,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
if (i > 0){ if (i > 0){
QueryWrapper<DgGuaranteeLetterAssignUser> tempB = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> tempB = new QueryWrapper<>();
//查询b用户的审核状态 //查询b用户的审核状态
tempB.eq("business_id",businessId).eq("user_id",bUser).select("status"); tempB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID).select("status");
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB);
Integer bStatus = dgGuaranteeLetterAssignUser.getStatus(); Integer bStatus = dgGuaranteeLetterAssignUser.getStatus();
//b用户审核通过,更新资产部经理数据 //b用户审核通过,更新资产部经理数据
@ -388,8 +416,9 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
//a角驳回操作,更新a角数据及b角数据及返回上一流程 //a角驳回操作,更新a角数据及b角数据及返回上一流程
if (StatusCode.SP_REJECT.equals(status)){ if (StatusCode.SP_REJECT.equals(status)){
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperUser = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperUser = new QueryWrapper<>();
queryWrapperUser.eq("business_id",businessId).eq("user_id",aUser); queryWrapperUser.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser);
guaranteeLetterAssignUser.setUserId(currentUser);
guaranteeLetterAssignUser.setStatus(StatusCode.SP_REJECT); guaranteeLetterAssignUser.setStatus(StatusCode.SP_REJECT);
guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);
guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); guaranteeLetterAssignUser.setAuditOpinion(auditOpinion);
@ -400,7 +429,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
if (i > 0){ if (i > 0){
//更新b用户的审核状态为驳回 //更新b用户的审核状态为驳回
QueryWrapper<DgGuaranteeLetterAssignUser> tempB = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> tempB = new QueryWrapper<>();
tempB.eq("business_id",businessId).eq("user_id",bUser); tempB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID);
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = baseMapper.selectOne(tempB); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = baseMapper.selectOne(tempB);
dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_REJECT); dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_REJECT);
baseMapper.updateById(dgGuaranteeLetterAssignUserB); baseMapper.updateById(dgGuaranteeLetterAssignUserB);
@ -419,19 +448,21 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
} }
} }
//当前用户为b角用户
if (currentUser.equals(bUser)){ //角色为b角确认担保函操作和驳回操作
if (roleIdList.contains(PromptSuccess.DB_B_ID)){
//更新之前,获取此用户数据的审批状态,如果审批状态为驳回,则更新资产部经理数据,如果审批状态为审批中,则添加资产部经理数据 //更新之前,获取此用户数据的审批状态,如果审批状态为驳回,则更新资产部经理数据,如果审批状态为审批中,则添加资产部经理数据
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperTemp = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperTemp = new QueryWrapper<>();
queryWrapperTemp.eq("business_id",businessId).eq("user_id",bUser); queryWrapperTemp.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp); DgGuaranteeLetterAssignUser guaranteeLetterAssignUserTemp = baseMapper.selectOne(queryWrapperTemp);
Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus(); Integer approveStatus = guaranteeLetterAssignUserTemp.getStatus();
//首次b角用户确认担保函,检查a角用户是否确认担保函 //首次b角用户确认担保函,检查a角用户是否确认担保函
if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){ if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperUser = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperUser = new QueryWrapper<>();
queryWrapperUser.eq("business_id",businessId).eq("user_id",bUser); queryWrapperUser.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser);
guaranteeLetterAssignUser.setUserId(currentUser);
guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED); guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED);
guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);
guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); guaranteeLetterAssignUser.setAuditOpinion(auditOpinion);
@ -444,7 +475,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
if (i > 0){ if (i > 0){
QueryWrapper<DgGuaranteeLetterAssignUser> tempB = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> tempB = new QueryWrapper<>();
//查询a用户的审核状态 //查询a用户的审核状态
tempB.eq("business_id",businessId).eq("user_id",aUser).select("status"); tempB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID).select("status");
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB);
Integer aStatus = dgGuaranteeLetterAssignUser.getStatus(); Integer aStatus = dgGuaranteeLetterAssignUser.getStatus();
//a用户审核通过,添加资产部经理数据 //a用户审核通过,添加资产部经理数据
@ -464,7 +495,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
//驳回后b角用户再次确认担保函,检查a角用户是否确认担保函 //驳回后b角用户再次确认担保函,检查a角用户是否确认担保函
if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){ if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperUser = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperUser = new QueryWrapper<>();
queryWrapperUser.eq("business_id",businessId).eq("user_id",bUser); queryWrapperUser.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser);
guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED); guaranteeLetterAssignUser.setStatus(StatusCode.SP_REVIEWED);
guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);
@ -477,7 +508,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
if (i > 0){ if (i > 0){
QueryWrapper<DgGuaranteeLetterAssignUser> tempB = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> tempB = new QueryWrapper<>();
//查询a用户的审核状态 //查询a用户的审核状态
tempB.eq("business_id",businessId).eq("user_id",aUser).select("status"); tempB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID).select("status");
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = baseMapper.selectOne(tempB);
Integer aStatus = dgGuaranteeLetterAssignUser.getStatus(); Integer aStatus = dgGuaranteeLetterAssignUser.getStatus();
//a用户审核通过,更新资产部经理数据 //a用户审核通过,更新资产部经理数据
@ -500,8 +531,9 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
//b角驳回操作,更新b角数据及a角数据及返回上一流程 //b角驳回操作,更新b角数据及a角数据及返回上一流程
if (StatusCode.SP_REJECT.equals(status)){ if (StatusCode.SP_REJECT.equals(status)){
QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperUser = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> queryWrapperUser = new QueryWrapper<>();
queryWrapperUser.eq("business_id",businessId).eq("user_id",bUser); queryWrapperUser.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID);
DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser); DgGuaranteeLetterAssignUser guaranteeLetterAssignUser = baseMapper.selectOne(queryWrapperUser);
guaranteeLetterAssignUser.setUserId(currentUser);
guaranteeLetterAssignUser.setStatus(StatusCode.SP_REJECT); guaranteeLetterAssignUser.setStatus(StatusCode.SP_REJECT);
guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED); guaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);
guaranteeLetterAssignUser.setAuditOpinion(auditOpinion); guaranteeLetterAssignUser.setAuditOpinion(auditOpinion);
@ -512,7 +544,7 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
if (i > 0){ if (i > 0){
//更新a用户的审核状态为驳回 //更新a用户的审核状态为驳回
QueryWrapper<DgGuaranteeLetterAssignUser> tempA = new QueryWrapper<>(); QueryWrapper<DgGuaranteeLetterAssignUser> tempA = new QueryWrapper<>();
tempA.eq("business_id",businessId).eq("user_id",aUser); tempA.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID);
DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = baseMapper.selectOne(tempA); DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = baseMapper.selectOne(tempA);
dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_REJECT); dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_REJECT);
baseMapper.updateById(dgGuaranteeLetterAssignUserA); baseMapper.updateById(dgGuaranteeLetterAssignUserA);
@ -530,6 +562,8 @@ public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaran
} }
} }
} }
}
//一个判断都不走,直接返回false //一个判断都不走,直接返回false
log.info("《《《《《数据更新失败,请确保数据完整》》》》》"); log.info("《《《《《数据更新失败,请确保数据完整》》》》》");
return false; return false;

@ -8,6 +8,7 @@ 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;
@ -16,10 +17,17 @@ 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 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>
@ -39,17 +47,35 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl<DgPaym
@Autowired @Autowired
private DgGuaranteeLetterAssignUserMapper guaranteeLetterAssignUserMapper; private DgGuaranteeLetterAssignUserMapper guaranteeLetterAssignUserMapper;
/**
* 获取当前登录用户信息
*/
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(PaymentConfirmationQueryRequest paymentConfirmationQueryRequest) { public PageUtils queryPage(PaymentConfirmationQueryRequest paymentConfirmationQueryRequest) {
//取出条件 //取出条件
Integer page = paymentConfirmationQueryRequest.getPage(); Integer page = paymentConfirmationQueryRequest.getPage();
Integer size = paymentConfirmationQueryRequest.getSize(); Integer size = paymentConfirmationQueryRequest.getSize();
Integer status = paymentConfirmationQueryRequest.getStatus(); Integer status = paymentConfirmationQueryRequest.getStatus();
//a根据角色id查询
Integer roleId = paymentConfirmationQueryRequest.getRoleId();
String customerNumberOrName = paymentConfirmationQueryRequest.getCustomerNumberOrName(); String customerNumberOrName = paymentConfirmationQueryRequest.getCustomerNumberOrName();
//获取当前登录用户id
Integer userId = Integer.parseInt(this.getUserId());
//获取当前用户拥有的角色ids
String roleIds = RedisUtil.get("dq:userRole:" + userId);
IPage<PaymentConfirmationListResponse> paymentConfirmationVO = null;
if(roleIds != null) {
String[] ids = roleIds.split(",");
List<String> roleIdList = Arrays.asList(ids);
//分页条件查询 //分页条件查询
IPage<PaymentConfirmationListResponse> paymentConfirmationVO = baseMapper.pageByCondition(new Page(page,size),roleId,status,customerNumberOrName); paymentConfirmationVO = baseMapper.pageByCondition(new Page(page,size),roleIdList,status,customerNumberOrName);
}
return new PageUtils(paymentConfirmationVO); return new PageUtils(paymentConfirmationVO);
} }

@ -17,14 +17,14 @@
<id column="id" property="id" /> <id column="id" property="id" />
<result column="business_code" property="businessCode" /> <result column="business_code" property="businessCode" />
<result column="bank" property="bank" /> <result column="bank" property="bank" />
<result column="update_time" property="updateTime" /> <result column="passing_time" property="passingTime" />
<result column="file" property="file" /> <result column="file" property="file" />
<result column="name" property="name" /> <result column="name" property="name" />
<result column="phone" property="phone" /> <result column="phone" property="phone" />
<result column="status" property="status" /> <result column="status" property="status" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="apply_time" property="applyTime" /> <result column="loan_tern" property="loanTern" />
<result column="apply_amount" property="applyAmount" /> <result column="loan_money" property="loanMoney" />
<result column="business_type" property="businessType" /> <result column="business_type" property="businessType" />
<result column="audit_opinion" property="auditOpinion" /> <result column="audit_opinion" property="auditOpinion" />
<result column="operating_status" property="operatingStatus" /> <result column="operating_status" property="operatingStatus" />
@ -32,8 +32,8 @@
</resultMap> </resultMap>
<select id="pageByCondition" resultMap="GuaranteeLetterListResponseMap"> <select id="pageByCondition" resultMap="GuaranteeLetterListResponseMap">
select lau.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_money as apply_amount,lcc.loan_tern as apply_time, select lau.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_money,lcc.loan_tern,aai.create_time,
aai.create_time,lau.status,aai.bank,lcc.update_time,lcc.file,lau.audit_opinion,lau.operating_status,bps.business_status lau.status,aai.bank,lcc.passing_time,lcc.file,lau.audit_opinion,lau.operating_status,bps.business_status
from dg_guarantee_letter_assign_user lau from dg_guarantee_letter_assign_user lau
left join dg_apply_amount_info aai on lau.business_id = aai.id left join dg_apply_amount_info aai on lau.business_id = aai.id
left join crms_company_customer ccc on lau.company_id = ccc.id left join crms_company_customer ccc on lau.company_id = ccc.id
@ -41,11 +41,12 @@
left join dg_loan_committee_consider lcc on lau.business_id = lcc.business_id left join dg_loan_committee_consider lcc on lau.business_id = lcc.business_id
left join dg_business_process_status bps on lau.business_id = bps.business_id left join dg_business_process_status bps on lau.business_id = bps.business_id
<where> <where>
<if test="roleId != null and roleId != ''"> lau.role_id in
AND lau.role_id = #{roleId} <foreach collection="roleIdList" open="(" separator="," close=")" item="id">
</if> #{id}
</foreach>
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and lau.user_id = #{userId} AND (lau.user_id = #{userId} or lau.user_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},'%')

@ -21,8 +21,8 @@
<result column="phone" property="phone" /> <result column="phone" property="phone" />
<result column="status" property="status" /> <result column="status" property="status" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="apply_time" property="applyTime" /> <result column="loan_tern" property="loanTern" />
<result column="apply_amount" property="applyAmount" /> <result column="loan_money" property="loanMoney" />
<result column="business_type" property="businessType" /> <result column="business_type" property="businessType" />
<result column="audit_opinion" property="auditOpinion" /> <result column="audit_opinion" property="auditOpinion" />
<result column="operating_status" property="operatingStatus" /> <result column="operating_status" property="operatingStatus" />
@ -30,12 +30,13 @@
</resultMap> </resultMap>
<select id="pageByCondition" resultMap="LoanNoticeListResponseMap"> <select id="pageByCondition" resultMap="LoanNoticeListResponseMap">
select ln.id,aai.business_code,cc.name,cc.phone,aai.business_type,aai.apply_amount,aai.apply_time, select ln.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_tern,lcc.loan_money,
aai.create_time,ln.status,aai.bank,ln.audit_opinion,ln.operating_status,bps.business_status aai.create_time,ln.status,aai.bank,ln.audit_opinion,ln.operating_status,bps.business_status
from dg_loan_notice ln from dg_loan_notice ln
left join dg_apply_amount_info aai on ln.business_id = aai.id left join dg_apply_amount_info aai on ln.business_id = aai.id
left join crms_company_customer ccc on ln.company_id = ccc.id left join crms_company_customer ccc on ln.company_id = ccc.id
left join crms_customer cc on ccc.customer_id = cc.id left join crms_customer cc on ccc.customer_id = cc.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} AND ln.role_id = #{roleId}

@ -18,14 +18,14 @@
<id column="id" property="id" /> <id column="id" property="id" />
<result column="business_code" property="businessCode" /> <result column="business_code" property="businessCode" />
<result column="bank" property="bank" /> <result column="bank" property="bank" />
<result column="update_time" property="updateTime" /> <result column="passing_time" property="passingTime" />
<result column="file" property="file" /> <result column="file" property="file" />
<result column="name" property="name" /> <result column="name" property="name" />
<result column="phone" property="phone" /> <result column="phone" property="phone" />
<result column="status" property="status" /> <result column="status" property="status" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="apply_time" property="applyTime" /> <result column="loan_tern" property="loanTern" />
<result column="apply_amount" property="applyAmount" /> <result column="loan_money" property="loanMoney" />
<result column="business_type" property="businessType" /> <result column="business_type" property="businessType" />
<result column="audit_opinion" property="auditOpinion" /> <result column="audit_opinion" property="auditOpinion" />
<result column="operating_status" property="operatingStatus" /> <result column="operating_status" property="operatingStatus" />
@ -33,8 +33,8 @@
</resultMap> </resultMap>
<select id="pageByCondition" resultMap="PaymentConfirmationListResponseMap"> <select id="pageByCondition" resultMap="PaymentConfirmationListResponseMap">
select pcc.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_money as apply_amount,lcc.loan_tern as apply_time, select pcc.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_money,lcc.loan_tern,aai.create_time,
aai.create_time,pcc.status,aai.bank,lcc.update_time,lcc.file,pcc.audit_opinion,pcc.operating_status,bps.business_status pcc.status,aai.bank,lcc.passing_time,lcc.file,pcc.audit_opinion,pcc.operating_status,bps.business_status
from dg_payment_confirmation_consider pcc from dg_payment_confirmation_consider pcc
left join dg_apply_amount_info aai on pcc.business_id = aai.id left join dg_apply_amount_info aai on pcc.business_id = aai.id
left join crms_company_customer ccc on pcc.company_id = ccc.id left join crms_company_customer ccc on pcc.company_id = ccc.id
@ -42,7 +42,13 @@
left join dg_loan_committee_consider lcc on pcc.business_id = lcc.business_id left join dg_loan_committee_consider lcc on pcc.business_id = lcc.business_id
left join dg_business_process_status bps on pcc.business_id = bps.business_id left join dg_business_process_status bps on pcc.business_id = bps.business_id
<where> <where>
AND pcc.role_id = #{roleId} pcc.role_id in
<foreach collection="roleIdList" open="(" separator="," close=")" item="id">
#{id}
</foreach>
<if test="userId != null and userId != ''">
AND (pcc.user_id = #{userId} or pcc.user_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>

Loading…
Cancel
Save