|
|
|
@ -3,21 +3,25 @@ package com.daqing.financial.guarantee.controller; |
|
|
|
|
|
|
|
|
|
import com.daqing.financial.guarantee.DgApplyAmountInfoControllerApi; |
|
|
|
|
import com.daqing.financial.guarantee.feign.CrmsFeignService; |
|
|
|
|
import com.daqing.financial.guarantee.feign.HrmsFeignService; |
|
|
|
|
import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest; |
|
|
|
|
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse; |
|
|
|
|
import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService; |
|
|
|
|
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; |
|
|
|
|
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo; |
|
|
|
|
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse; |
|
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
|
import com.daqing.framework.util.RedisUtil; |
|
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
import org.springframework.web.context.request.RequestContextHolder; |
|
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
import org.springframework.web.multipart.MultipartHttpServletRequest; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
@ -47,6 +51,9 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA |
|
|
|
|
@Autowired |
|
|
|
|
private IDgApplyAmountInfoService applyAmountInfoService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HrmsFeignService hrmsFeignService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据客户编号/客户名称获取企业信息 |
|
|
|
|
* @param applyAmountInfo |
|
|
|
@ -143,19 +150,40 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/businessApplicationList") |
|
|
|
|
@ApiOperation(value = "业务申请列表") |
|
|
|
|
public ResponseResult businessApplicationList(@RequestParam("page") Integer page,@RequestParam("size") Integer size |
|
|
|
|
/* @RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName*/){ |
|
|
|
|
PageUtils data = applyAmountInfoService.queryPage(page, size); |
|
|
|
|
public ResponseResult businessApplicationList(@RequestParam("page") Integer page,@RequestParam("size") Integer size, |
|
|
|
|
@RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName){ |
|
|
|
|
//获取当前登录用户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)); |
|
|
|
|
|
|
|
|
|
PageUtils data = applyAmountInfoService.queryPage(page, size,CustomerNumberOrName); |
|
|
|
|
//遍历data里面的数据提单人id,找出匹配id,将用户名以及部门名称赋值进去
|
|
|
|
|
List<BusinessApplicationListResponse> list = (List<BusinessApplicationListResponse>) data.getList(); |
|
|
|
|
for (BusinessApplicationListResponse response:list) { |
|
|
|
|
if(response.getPresenterId().equals(employeeMessage.getData().getId())){//如果userId相同情况下,就往对象里面赋值
|
|
|
|
|
response.setAccount(employeeMessage.getData().getAccount()); |
|
|
|
|
response.setDeptName(employeeMessage.getData().getDeptName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return new ResponseResult<PageUtils>().SUCCESS(data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 业务申请列表 |
|
|
|
|
* 业务申请列表测试 |
|
|
|
|
* @param |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/businessApplicationList2") |
|
|
|
|
@ApiOperation(value = "业务申请列表") |
|
|
|
|
public ResponseResult businessApplicationList2(){ |
|
|
|
|
List<DgApplyAmountInfo> data = applyAmountInfoService.selectList(); |
|
|
|
|
return new ResponseResult().SUCCESS(data); |
|
|
|
|