|
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.daqing.financial.guarantee.feign.CrmsFeignService; |
|
|
|
|
import com.daqing.financial.guarantee.feign.HrmsFeignService; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgApplyAmountInfoMapper; |
|
|
|
|
import com.daqing.financial.guarantee.mapper.DgEnclosureInfoMapper; |
|
|
|
|
import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest; |
|
|
|
@ -13,12 +14,17 @@ import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; |
|
|
|
|
import com.daqing.framework.domain.crms.response.CompanyCustomerResponse; |
|
|
|
|
import com.daqing.framework.domain.crms.response.CrmsCode; |
|
|
|
|
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo; |
|
|
|
|
import com.daqing.framework.domain.guarantee.DgEnclosureInfo; |
|
|
|
|
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse; |
|
|
|
|
import com.daqing.framework.domain.hrms.DeptEntity; |
|
|
|
|
import com.daqing.framework.domain.hrms.ext.EmployeeListVO; |
|
|
|
|
import com.daqing.framework.exception.ExceptionCast; |
|
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
|
import com.daqing.framework.util.RedisUtil; |
|
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
|
import com.daqing.framework.utils.excel.ExcelUtil; |
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference; |
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
@ -30,6 +36,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.LinkedHashMap; |
|
|
|
|
import java.util.List; |
|
|
|
@ -57,6 +64,9 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
@Resource |
|
|
|
|
private CrmsFeignService crmsFeignService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HrmsFeignService hrmsFeignService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
@ -76,7 +86,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
//申请贷款相关信息
|
|
|
|
|
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo(); |
|
|
|
|
dgApplyAmountInfo.setCompanyId(dgApplyAmountInfo.getCompanyId()); |
|
|
|
|
dgApplyAmountInfo.setPresenterId(5);//Integer.parseInt(userId)
|
|
|
|
|
dgApplyAmountInfo.setPresenterId(Integer.parseInt(userId)); |
|
|
|
|
dgApplyAmountInfo.setApplyAmount(businessApplication.getApplyAmount());//申请额度
|
|
|
|
|
dgApplyAmountInfo.setApplyTime(businessApplication.getApplyTime());//申请期限
|
|
|
|
|
dgApplyAmountInfo.setBank(businessApplication.getBank());//贷款银行
|
|
|
|
@ -207,5 +217,59 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM |
|
|
|
|
return this.baseMapper.update(dgApplyAmountInfo, new QueryWrapper<DgApplyAmountInfo>().eq("id", id)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
@Override |
|
|
|
|
public Boolean excelExport(HttpServletResponse response) { |
|
|
|
|
//获取当前登录用户id
|
|
|
|
|
String userId = null; |
|
|
|
|
try{ |
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
|
String token = request.getHeader("token"); |
|
|
|
|
userId = RedisUtil.get("dq:token:"+token); |
|
|
|
|
System.out.println(userId); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
//根据userId获取用户名以及部门名称
|
|
|
|
|
ResponseResult<EmployeeMessageResponse> employeeMessage = hrmsFeignService.getAccountAndDeptNameById(Long.valueOf(userId)); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
List<BusinessApplicationListResponse> list = this.getBaseMapper().excelList(); |
|
|
|
|
for (BusinessApplicationListResponse businessList:list) { |
|
|
|
|
if(businessList.getPresenterId().equals(employeeMessage.getData().getId())){//如果userId相同情况下,就往对象里面赋值
|
|
|
|
|
businessList.setAccount(employeeMessage.getData().getAccount()); |
|
|
|
|
businessList.setDeptName(employeeMessage.getData().getDeptName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
ExcelUtil.writeExcelWithSheets(response, list, "业务贷款一览表", "businessApplication", new BusinessApplicationListResponse()) |
|
|
|
|
.finish(); |
|
|
|
|
return true; |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public int approvalBusinessApplication(Integer id, Integer status, String remark) { |
|
|
|
|
//获取当前登录用户(审批人)id
|
|
|
|
|
String userId = null; |
|
|
|
|
try{ |
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
|
String token = request.getHeader("token"); |
|
|
|
|
userId = RedisUtil.get("dq:token:"+token); |
|
|
|
|
System.out.println(userId); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
//根据id修改当前业务状态
|
|
|
|
|
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo(); |
|
|
|
|
dgApplyAmountInfo.setStatus(status); |
|
|
|
|
dgApplyAmountInfo.setRemark(remark); |
|
|
|
|
dgApplyAmountInfo.setApprovalId(Integer.parseInt(userId)); |
|
|
|
|
dgApplyAmountInfo.setUpdateTime(new Date()); |
|
|
|
|
return dgApplyAmountInfoMapper.update(dgApplyAmountInfo,new QueryWrapper<DgApplyAmountInfo>().eq("id",id)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|