c提交代码

master
chen 4 years ago
parent d101f6ecd3
commit 41335b5423
  1. 45
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java
  2. 8
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java
  3. 8
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java
  4. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeLetterAssignUserMapper.java
  5. 25
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeLetterRequest.java
  6. 56
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeLetterResponse.java
  7. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeLetterAssignUserService.java
  8. 18
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeLetterAssignUserServiceImpl.java
  9. 12
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeLetterAssignUserMapper.xml
  10. 4
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgGuaranteeLetterAssignUser.java
  11. 2
      dq-framework-utils/pom.xml
  12. 21
      dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/EasyExcelUtil.java
  13. 72
      dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/StatusConverter.java

@ -1,10 +1,18 @@
package com.daqing.financial.guarantee.controller; 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 javax.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.RestController; ;
/** /**
* <p> * <p>
@ -14,8 +22,39 @@ import org.springframework.web.bind.annotation.RestController;
* @author Qyq * @author Qyq
* @since 2020-11-12 * @since 2020-11-12
*/ */
@Api(tags = {"担保函记录"})
@RestController @RestController
@RequestMapping("/dg-guarantee-letter-assign-user") @RequestMapping("/dg-guarantee-letter-assign-user")
public class DgGuaranteeLetterAssignUserController { 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<PageUtils>().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();
// }
}
} }

@ -1,6 +1,10 @@
package com.daqing.financial.guarantee.controller; 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.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -13,8 +17,12 @@ import org.springframework.web.bind.annotation.RestController;
* @author Qyq * @author Qyq
* @since 2020-11-05 * @since 2020-11-05
*/ */
@Api(tags = {"放款通知"})
@RestController @RestController
@RequestMapping("/dg-loan-notice") @RequestMapping("/dg-loan-notice")
public class DgLoanNoticeController { public class DgLoanNoticeController {
@Autowired
private IDgLoanNoticeService iDgLoanNoticeService;
} }

@ -1,6 +1,9 @@
package com.daqing.financial.guarantee.controller; 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.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -13,8 +16,13 @@ import org.springframework.web.bind.annotation.RestController;
* @author Qyq * @author Qyq
* @since 2020-11-05 * @since 2020-11-05
*/ */
@Api(tags = {"回款确认"})
@RestController @RestController
@RequestMapping("/dg-payment-confirmation-consider") @RequestMapping("/dg-payment-confirmation-consider")
public class DgPaymentConfirmationConsiderController { public class DgPaymentConfirmationConsiderController {
@Autowired
private IDgPaymentConfirmationConsiderService iDgPaymentConfirmationConsiderService;
} }

@ -1,8 +1,13 @@
package com.daqing.financial.guarantee.mapper; package com.daqing.financial.guarantee.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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 com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* <p> * <p>
@ -15,4 +20,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface DgGuaranteeLetterAssignUserMapper extends BaseMapper<DgGuaranteeLetterAssignUser> { public interface DgGuaranteeLetterAssignUserMapper extends BaseMapper<DgGuaranteeLetterAssignUser> {
IPage<GuaranteeLetterResponse> pageByCondition(Page page, @Param("customerNumberOrName")String customerNumberOrName,@Param("status")Integer status);
} }

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

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

@ -1,7 +1,9 @@
package com.daqing.financial.guarantee.service; package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService; 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.domain.guarantee.DgGuaranteeLetterAssignUser;
import com.daqing.framework.utils.PageUtils;
/** /**
* <p> * <p>
@ -13,4 +15,5 @@ import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser;
*/ */
public interface IDgGuaranteeLetterAssignUserService extends IService<DgGuaranteeLetterAssignUser> { public interface IDgGuaranteeLetterAssignUserService extends IService<DgGuaranteeLetterAssignUser> {
PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, Integer status);
} }

@ -1,9 +1,15 @@
package com.daqing.financial.guarantee.service.impl; 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.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.daqing.financial.guarantee.service.IDgGuaranteeLetterAssignUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser; import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser;
import com.daqing.framework.utils.PageUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
@ -16,5 +22,15 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaranteeLetterAssignUserMapper, DgGuaranteeLetterAssignUser> implements IDgGuaranteeLetterAssignUserService { public class DgGuaranteeLetterAssignUserServiceImpl extends ServiceImpl<DgGuaranteeLetterAssignUserMapper, DgGuaranteeLetterAssignUser> 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<GuaranteeLetterResponse> guaranteeLetterVO = baseMapper.pageByCondition(new Page(page, size), customerNumberOrName, status);
return new PageUtils(guaranteeLetterVO);
}
} }

@ -12,5 +12,17 @@
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
</resultMap> </resultMap>
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.GuaranteeLetterResponse">
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
<where>
<if test="CustomerNumberOrName != null and CustomerNumberOrName != ''">
AND ai.business_code LIKE CONCAT('%',#{CustomerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{CustomerNumberOrName},'%')
</if>
</where>
</select>
</mapper> </mapper>

@ -37,6 +37,10 @@ public class DgGuaranteeLetterAssignUser implements Serializable {
*/ */
private Integer companyId; private Integer companyId;
@ApiModelProperty(value = "类型(1:A角确认 2:B角确认 3:经理确认)")
private Integer type;
/** /**
* 审批人id * 审批人id
*/ */

@ -45,7 +45,7 @@
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId> <artifactId>easyexcel</artifactId>
<version>1.1.2-beta4</version> <version>2.1.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.tomcat.embed</groupId> <groupId>org.apache.tomcat.embed</groupId>

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

@ -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<Integer> {
@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));
}
}
}
Loading…
Cancel
Save