diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java index fac2a636..3e72b47f 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java @@ -1,10 +1,18 @@ package com.daqing.financial.guarantee.controller; -import org.springframework.web.bind.annotation.RequestMapping; +import com.daqing.financial.guarantee.model.request.GuaranteeLetterRequest; +import com.daqing.financial.guarantee.service.IDgGuaranteeLetterAssignUserService; +import com.daqing.framework.model.response.ResponseResult; +import com.daqing.framework.utils.PageUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletResponse; +; /** *

@@ -14,8 +22,39 @@ import org.springframework.web.bind.annotation.RestController; * @author Qyq * @since 2020-11-12 */ +@Api(tags = {"担保函记录"}) @RestController @RequestMapping("/dg-guarantee-letter-assign-user") public class DgGuaranteeLetterAssignUserController { + @Autowired + private IDgGuaranteeLetterAssignUserService guaranteeLetterAssignUserService; + + @ApiOperation(value = "担保函记录列表") + @GetMapping("/guaranteeLetterList") + public ResponseResult guaranteeLetterList( + @ApiParam(name = "page", value = "当前页码,默认为第一页", required = false) + @RequestParam(value="page",required=false) Integer page, + @ApiParam(name = "size", value = "每页记录数,默认显示10条", required = false) + @RequestParam(value="size",required=false) Integer size, + @ApiParam(name = "customerNumberOrName", value = "业务编号/客户名称", required = false) + @RequestParam(value = "customerNumberOrName", required = false) String customerNumberOrName, + @ApiParam(name = "status", value = "流程状态:1->审核中、2->拒绝、3->已审核", required = false) + @RequestParam(value = "status", required = false) Integer status){ + PageUtils data = guaranteeLetterAssignUserService.queryPage(page,size,customerNumberOrName,status); + return new ResponseResult().SUCCESS(data); + } + + + @ApiOperation(value = "导出全部数据") + @GetMapping("/excelExport") + public void excelExport( + @ApiParam(name = "", value = "", required = true) + HttpServletResponse response){ + // try { + // guaranteeLetterAssignUserService.export(response,contestId); + // } catch (IOException e) { + // e.printStackTrace(); + // } + } } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java index 6a80c0a0..3945c2c2 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java @@ -1,6 +1,10 @@ package com.daqing.financial.guarantee.controller; +import com.daqing.financial.guarantee.service.IDgLoanNoticeService; +import com.daqing.financial.guarantee.service.impl.DgLoanNoticeServiceImpl; +import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -13,8 +17,12 @@ import org.springframework.web.bind.annotation.RestController; * @author Qyq * @since 2020-11-05 */ +@Api(tags = {"放款通知"}) @RestController @RequestMapping("/dg-loan-notice") public class DgLoanNoticeController { + @Autowired + private IDgLoanNoticeService iDgLoanNoticeService; + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java index 3f863a80..4965d766 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java @@ -1,6 +1,9 @@ package com.daqing.financial.guarantee.controller; +import com.daqing.financial.guarantee.service.IDgPaymentConfirmationConsiderService; +import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -13,8 +16,13 @@ import org.springframework.web.bind.annotation.RestController; * @author Qyq * @since 2020-11-05 */ +@Api(tags = {"回款确认"}) @RestController @RequestMapping("/dg-payment-confirmation-consider") public class DgPaymentConfirmationConsiderController { + @Autowired + private IDgPaymentConfirmationConsiderService iDgPaymentConfirmationConsiderService; + + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterAssignUserMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterAssignUserMapper.java index 1ee73d42..bdb37712 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterAssignUserMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterAssignUserMapper.java @@ -1,8 +1,13 @@ package com.daqing.financial.guarantee.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse; +import com.daqing.financial.guarantee.model.response.GuaranteeLetterResponse; import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** *

@@ -15,4 +20,5 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface DgGuaranteeLetterAssignUserMapper extends BaseMapper { + IPage pageByCondition(Page page, @Param("customerNumberOrName")String customerNumberOrName,@Param("status")Integer status); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterRequest.java new file mode 100644 index 00000000..6df50d4e --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterRequest.java @@ -0,0 +1,25 @@ +package com.daqing.financial.guarantee.model.request; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author chen + * @DATE 2020/11/12 17:14 + * @Version 1.0 + */ +@Data +public class GuaranteeLetterRequest { + + @ApiModelProperty(value = "当前页码,默认为第一页") + private Integer page = 1; + + @ApiModelProperty(value = "每页记录数,默认显示10条") + private Integer size = 10; + + @ApiModelProperty(value = "流程状态:1->审核中、2->拒绝、3->已审核") + private Integer status; + + @ApiModelProperty(value = "业务编号/客户名称") + private String CustomerNumberOrName; +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeLetterResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeLetterResponse.java new file mode 100644 index 00000000..3ce35309 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeLetterResponse.java @@ -0,0 +1,56 @@ +package com.daqing.financial.guarantee.model.response; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.daqing.framework.utils.excel.StatusConverter; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @Author chen + * @DATE 2020/11/12 17:36 + * @Version 1.0 + */ +@Data +public class GuaranteeLetterResponse { + + @ApiModelProperty("业务编号") + @ExcelProperty(value = "业务编号",index = 0) + private String businessCode; + + @ApiModelProperty("客户名称") + @ExcelProperty(value = "客户名称",index = 1) + private String name; + + @ApiModelProperty("联系电话") + @ExcelProperty(value = "联系电话",index = 2) + private String phone; + + @ApiModelProperty("业务类别") + @ExcelProperty(value = "业务类别",index = 3) + private String businessType; + + @ApiModelProperty("金额") + @ExcelProperty(value = "金额",index = 4) + private Double applyAmount; + + @ApiModelProperty("期限") + @ExcelProperty(value = "期数",index = 5) + private String applyTime; + + @ApiModelProperty("申请日期") + @ExcelProperty(value = "申请日期",index = 6) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date createTime; + + @ApiModelProperty("当前审批人") + @ExcelProperty(value = "当前审批人",index = 7) + private String empName; + + @ApiModelProperty("状态") + @ExcelProperty(value = "状态",index = 8,converter = StatusConverter.class) + private Integer status; + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeLetterAssignUserService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeLetterAssignUserService.java index 14c1974c..1f8f1796 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeLetterAssignUserService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeLetterAssignUserService.java @@ -1,7 +1,9 @@ package com.daqing.financial.guarantee.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.daqing.financial.guarantee.model.request.GuaranteeLetterRequest; import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser; +import com.daqing.framework.utils.PageUtils; /** *

@@ -13,4 +15,5 @@ import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser; */ public interface IDgGuaranteeLetterAssignUserService extends IService { + PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, Integer status); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java index a55dd1d3..044338e1 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java @@ -1,9 +1,15 @@ package com.daqing.financial.guarantee.service.impl; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.daqing.financial.guarantee.mapper.DgGuaranteeLetterAssignUserMapper; +import com.daqing.financial.guarantee.model.request.GuaranteeLetterRequest; +import com.daqing.financial.guarantee.model.response.GuaranteeLetterResponse; import com.daqing.financial.guarantee.service.IDgGuaranteeLetterAssignUserService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser; +import com.daqing.framework.utils.PageUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; /** @@ -16,5 +22,15 @@ import org.springframework.stereotype.Service; */ @Service public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl implements IDgGuaranteeLetterAssignUserService { - + @Override + public PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, Integer status) { + if (page==null){ + page=1; + } + if (size==null){ + size=10; + } + IPage guaranteeLetterVO = baseMapper.pageByCondition(new Page(page, size), customerNumberOrName, status); + return new PageUtils(guaranteeLetterVO); + } } diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeLetterAssignUserMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeLetterAssignUserMapper.xml index 4a52a78f..1e081503 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeLetterAssignUserMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeLetterAssignUserMapper.xml @@ -12,5 +12,17 @@ + diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgGuaranteeLetterAssignUser.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgGuaranteeLetterAssignUser.java index 006c2a42..87e59346 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgGuaranteeLetterAssignUser.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgGuaranteeLetterAssignUser.java @@ -37,6 +37,10 @@ public class DgGuaranteeLetterAssignUser implements Serializable { */ private Integer companyId; + + @ApiModelProperty(value = "类型(1:A角确认 2:B角确认 3:经理确认)") + private Integer type; + /** * 审批人id */ diff --git a/dq-framework-utils/pom.xml b/dq-framework-utils/pom.xml index 3eb91834..2261cab7 100644 --- a/dq-framework-utils/pom.xml +++ b/dq-framework-utils/pom.xml @@ -45,7 +45,7 @@ com.alibaba easyexcel - 1.1.2-beta4 + 2.1.1 org.apache.tomcat.embed diff --git a/dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/EasyExcelUtil.java b/dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/EasyExcelUtil.java new file mode 100644 index 00000000..a9c5740f --- /dev/null +++ b/dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/EasyExcelUtil.java @@ -0,0 +1,21 @@ +package com.daqing.framework.utils.excel; + +import com.alibaba.excel.EasyExcel; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +/** + * @Author chen + * @DATE 2020/10/19 14:45 + * @Version 1.0 + */ +public class EasyExcelUtil { + public static void download(HttpServletResponse response, Class head, List list, String fileName, String sheetName) throws IOException { + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + response.setHeader("Content-disposition", "attachment;filename="+fileName+""); + EasyExcel.write(response.getOutputStream(), head).sheet(sheetName).doWrite(list); + } +} diff --git a/dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/StatusConverter.java b/dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/StatusConverter.java new file mode 100644 index 00000000..c8df93d9 --- /dev/null +++ b/dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/StatusConverter.java @@ -0,0 +1,72 @@ +package com.daqing.framework.utils.excel; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.CellData; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.property.ExcelContentProperty; + +/** + * @Author chen + * @DATE 2020/10/19 15:44 + * @Version 1.0 + * 状态转换器 + */ +public class StatusConverter implements Converter { + + @Override + public Class supportJavaTypeKey() { + return Integer.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + /** + * 这里读的时候会调用 + * + * @param cellData + * NotNull + * @param contentProperty + * Nullable + * @param globalConfiguration + * NotNull + * @return + */ + @Override + public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, + GlobalConfiguration globalConfiguration) { + return 0; + } + + /** + * 这里是写的时候会调用 + * + * @param value + * NotNull + * @param contentProperty + * Nullable + * @param globalConfiguration + * NotNull + * @return + */ + @Override + public CellData convertToExcelData(Integer value, ExcelContentProperty contentProperty, + GlobalConfiguration globalConfiguration) { + + switch (value){ + case 1: + return new CellData("审核中"); + case 2: + return new CellData("拒绝"); + case 3: + return new CellData("已审核"); + default: + return new CellData(String.valueOf(value)); + } + + } + +}