master
shijie 4 years ago
parent 14003b8bd6
commit 9252dabe64
  1. 30
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  2. 9
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java
  3. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgApplyAmountInfoMapper.java
  4. 16
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterAssignUserMapper.java
  5. 18
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterConsiderMapper.java
  6. 15
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/BusinessApplicationListResponse.java
  7. 5
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgApplyAmountInfoService.java
  8. 16
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeLetterAssignUserService.java
  9. 16
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeLetterConsiderService.java
  10. 66
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java
  11. 20
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java
  12. 20
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterConsiderServiceImpl.java
  13. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/MyBatisPlusCodeGenerator.java
  14. 8
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountInfoMapper.xml
  15. 16
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeLetterAssignUserMapper.xml
  16. 10
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgApplyAmountInfo.java
  17. 22
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgGuaranteeLetterAssignUser.java

@ -26,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@ -149,9 +150,9 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
* @param
* @return
*/
@PostMapping("/businessApplicationList")
@GetMapping("/businessApplicationList")
@ApiOperation(value = "业务申请列表")
public ResponseResult businessApplicationList(@RequestParam("page") Integer page,@RequestParam("size") Integer size,
public ResponseResult businessApplicationList(@RequestParam(value="page",required=false) Integer page,@RequestParam(value="size",required=false) Integer size,
@RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName){
//获取当前登录用户id
String userId = null;
@ -215,4 +216,29 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
return result>0 ? ResponseResult.SUCCESS("撤销成功!"):ResponseResult.FAIL(40006,"撤销失败!");
}
/**
* 导出
*/
@GetMapping("/excelExport")
@ApiOperation(value = "导出业务申请内容")
public ResponseResult excelExport(HttpServletResponse response) {
Boolean result = applyAmountInfoService.excelExport(response);
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
}
/**
* 根据业务id审核业务申请内容
* @param id
* @return
*/
@PostMapping("/approvalBusinessApplication")
@ApiOperation(value = "根据业务id审核业务申请内容")
public ResponseResult approvalBusinessApplication(@RequestParam("id") Integer id,@RequestParam("status") Integer status,
@RequestParam(value = "remark", required = false) String remark){
int result = applyAmountInfoService.approvalBusinessApplication(id,status,remark);
return result>0 ? ResponseResult.SUCCESS("撤销成功!"):ResponseResult.FAIL(40006,"撤销失败!");
}
}

@ -3,18 +3,19 @@ package com.daqing.financial.guarantee.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 担保函确认 前端控制器
* 担保函记录 前端控制器
* </p>
*
* @author Qyq
* @since 2020-11-05
* @since 2020-11-12
*/
@RestController
@RequestMapping("/dg-guarantee-letter-consider")
public class DgGuaranteeLetterConsiderController {
@RequestMapping("/dg-guarantee-letter-assign-user")
public class DgGuaranteeLetterAssignUserController {
}

@ -23,4 +23,6 @@ public interface DgApplyAmountInfoMapper extends BaseMapper<DgApplyAmountInfo> {
IPage<BusinessApplicationListResponse> pageByCondition(Page page, @Param("CustomerNumberOrName")String CustomerNumberOrName);
List<BusinessApplicationListResponse> excelList();
}

@ -0,0 +1,16 @@
package com.daqing.financial.guarantee.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser;
/**
* <p>
* 担保函记录 Mapper 接口
* </p>
*
* @author Qyq
* @since 2020-11-12
*/
public interface DgGuaranteeLetterAssignUserMapper extends BaseMapper<DgGuaranteeLetterAssignUser> {
}

@ -1,18 +0,0 @@
package com.daqing.financial.guarantee.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.daqing.framework.domain.guarantee.DgGuaranteeLetterConsider;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 担保函确认 Mapper 接口
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
@Mapper
public interface DgGuaranteeLetterConsiderMapper extends BaseMapper<DgGuaranteeLetterConsider> {
}

@ -1,7 +1,10 @@
package com.daqing.financial.guarantee.model.response;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
@ -12,7 +15,7 @@ import java.util.Date;
@Data
@ToString
public class BusinessApplicationListResponse implements Serializable {
public class BusinessApplicationListResponse extends BaseRowModel implements Serializable {
/**
* 主键id
@ -36,54 +39,64 @@ public class BusinessApplicationListResponse implements Serializable {
/**
* 申请额度
*/
@ExcelProperty(value = "申请额度",index = 4)
@ApiModelProperty(value = "申请额度")
private BigDecimal applyAmount;
/**
* 申请期限
*/
@ExcelProperty(value = "申请期限",index = 5)
@ApiModelProperty(value = "申请期限")
private String applyTime;
/**
* 申请时间
*/
@ExcelProperty(value = "申请日期",index = 6)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty(value = "申请时间")
private Date createTime;
/**
* 业务类型
*/
@ExcelProperty(value = "业务类别",index = 3)
@ApiModelProperty(value = "业务类型")
private String businessType;
/**
* 业务编号
*/
@ExcelProperty(value = "业务编号",index = 0)
@ApiModelProperty(value = "业务编号")
private String businessCode;
/**
* 客户名称
*/
@ExcelProperty(value = "客户名称",index = 1)
@ApiModelProperty(value = "客户名称")
private String name;
/**
* 联系电话
*/
@ExcelProperty(value = "联系电话",index = 2)
@ApiModelProperty(value = "联系电话")
private String phone;
/**
* 提单人
*/
@ExcelProperty(value = "提单人",index = 7)
@ApiModelProperty(value = "提单人")
private String account;
/**
* 部门名称
*/
@ExcelProperty(value = "部门名称",index = 8)
@ApiModelProperty(value = "部门名称")
private String deptName;

@ -6,6 +6,7 @@ import com.daqing.financial.guarantee.model.response.BusinessApplicationDetailRe
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.utils.PageUtils;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -27,4 +28,8 @@ public interface IDgApplyAmountInfoService extends IService<DgApplyAmountInfo> {
int updateBusinessApplication(BusinessApplicationRequest id);
int revokeBusinessApplication(Integer id);
Boolean excelExport(HttpServletResponse response);
int approvalBusinessApplication(Integer id, Integer status, String remark);
}

@ -0,0 +1,16 @@
package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser;
/**
* <p>
* 担保函记录 服务类
* </p>
*
* @author Qyq
* @since 2020-11-12
*/
public interface IDgGuaranteeLetterAssignUserService extends IService<DgGuaranteeLetterAssignUser> {
}

@ -1,16 +0,0 @@
package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.framework.domain.guarantee.DgGuaranteeLetterConsider;
/**
* <p>
* 担保函确认 服务类
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
public interface IDgGuaranteeLetterConsiderService extends IService<DgGuaranteeLetterConsider> {
}

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

@ -0,0 +1,20 @@
package com.daqing.financial.guarantee.service.impl;
import com.daqing.financial.guarantee.mapper.DgGuaranteeLetterAssignUserMapper;
import com.daqing.financial.guarantee.service.IDgGuaranteeLetterAssignUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser;
import org.springframework.stereotype.Service;
/**
* <p>
* 担保函记录 服务实现类
* </p>
*
* @author Qyq
* @since 2020-11-12
*/
@Service
public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaranteeLetterAssignUserMapper, DgGuaranteeLetterAssignUser> implements IDgGuaranteeLetterAssignUserService {
}

@ -1,20 +0,0 @@
package com.daqing.financial.guarantee.service.impl;
import com.daqing.financial.guarantee.mapper.DgGuaranteeLetterConsiderMapper;
import com.daqing.financial.guarantee.service.IDgGuaranteeLetterConsiderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.framework.domain.guarantee.DgGuaranteeLetterConsider;
import org.springframework.stereotype.Service;
/**
* <p>
* 担保函确认 服务实现类
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
@Service
public class DgGuaranteeLetterConsiderServiceImpl extends ServiceImpl<DgGuaranteeLetterConsiderMapper, DgGuaranteeLetterConsider> implements IDgGuaranteeLetterConsiderService {
}

@ -25,7 +25,7 @@ public class MyBatisPlusCodeGenerator {
public static final String PACKAGE_NAME = "com.daqing.financial.guarantee";
public static void main(String[] args) {
String[] tables = new String[] {"dg_guarantee_assign_user","dg_guarantee_investigation","dg_guarantee_letter_consider","dg_legal_info","dg_loan_committee_consider","dg_loan_notice","dg_message_assign_user","dg_message_investigation","dg_payment_confirmation_consider","dg_process","dg_work_conference_consider"};//表名数组
String[] tables = new String[] {"dg_guarantee_letter_assign_user"};//表名数组
String[] tablePrefixs = new String[] {""};//去掉前缀
executeCode(PACKAGE_NAME,tables,tablePrefixs);
}

@ -30,4 +30,12 @@
</where>
</select>
<select id="excelList" resultType="com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse">
select ai.id,ai.company_id,ai.presenter_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
ai.status,cc.name,cc.phone
from dg_apply_amount_info ai
left join crms_company_customer ccl on ai.company_id = ccl.id
left join crms_customer cc on cc.id = ccl.customer_id
</select>
</mapper>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.guarantee.mapper.DgGuaranteeLetterAssignUserMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser">
<id column="id" property="id" />
<result column="business_id" property="businessId" />
<result column="company_id" property="companyId" />
<result column="approval_id" property="approvalId" />
<result column="status" property="status" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
</mapper>

@ -89,4 +89,14 @@ public class DgApplyAmountInfo implements Serializable {
*/
private Integer status;
/**
* 审批人Id
*/
private Integer approvalId;
/**
* 审批意见
*/
private String remark;
}

@ -10,36 +10,41 @@ import java.util.Date;
/**
* <p>
* 担保函确认
* 担保函记录
* </p>
*
* @author Qyq
* @since 2020-11-05
* @since 2020-11-12
*/
@Data
@TableName("dg_guarantee_letter_consider")
public class DgGuaranteeLetterConsider implements Serializable {
@TableName("dg_guarantee_letter_assign_user")
public class DgGuaranteeLetterAssignUser implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id", type = IdType.AUTO)
@TableId(value = "id", type = IdType.ID_WORKER)
private Integer id;
/**
* 业务id
*/
private Integer businessId;
/**
* 企业id
*/
private Integer companyId;
/**
* 担保函确认者id
* 审批人id
*/
private Integer empId;
private Integer approvalId;
/**
* 审核状态
* 状态1->审核中2->拒绝3->已审核
*/
private Integer status;
@ -52,4 +57,5 @@ public class DgGuaranteeLetterConsider implements Serializable {
* 修改时间
*/
private Date updateTime;
}
Loading…
Cancel
Save