|
|
@ -7,7 +7,9 @@ import com.daqing.financial.guarantee.model.response.GuaranteeLetterListResponse |
|
|
|
import com.daqing.financial.guarantee.service.IDgGuaranteeLetterAssignUserService; |
|
|
|
import com.daqing.financial.guarantee.service.IDgGuaranteeLetterAssignUserService; |
|
|
|
import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser; |
|
|
|
import com.daqing.framework.domain.guarantee.DgGuaranteeLetterAssignUser; |
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
import com.daqing.framework.model.response.ResponseResult; |
|
|
|
|
|
|
|
import com.daqing.framework.utils.DateUtil; |
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
|
|
|
|
import com.deepoove.poi.XWPFTemplate; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
@ -16,7 +18,8 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
@ -48,7 +51,7 @@ public class DgGuaranteeLetterAssignUserController { |
|
|
|
@GetMapping("/guaranteeLetterListExport") |
|
|
|
@GetMapping("/guaranteeLetterListExport") |
|
|
|
public void guaranteeLetterListExport( |
|
|
|
public void guaranteeLetterListExport( |
|
|
|
@ApiParam(name = "ids", value = "多个id", required = true) |
|
|
|
@ApiParam(name = "ids", value = "多个id", required = true) |
|
|
|
@RequestParam("ids") List<String> ids,HttpServletResponse response){ |
|
|
|
@RequestParam("ids") String ids,HttpServletResponse response){ |
|
|
|
try { |
|
|
|
try { |
|
|
|
guaranteeLetterAssignUserService.batchExport(response,ids); |
|
|
|
guaranteeLetterAssignUserService.batchExport(response,ids); |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
@ -74,4 +77,34 @@ public class DgGuaranteeLetterAssignUserController { |
|
|
|
return result ? ResponseResult.SUCCESS("确认成功!"):ResponseResult.FAIL(40005,"确认失败!"); |
|
|
|
return result ? ResponseResult.SUCCESS("确认成功!"):ResponseResult.FAIL(40005,"确认失败!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "导出担保函") |
|
|
|
|
|
|
|
@GetMapping("/exportGuaranteeLetter") |
|
|
|
|
|
|
|
public void guaranteeLetterList( |
|
|
|
|
|
|
|
@ApiParam(name = "businessId", value = "业务id", required = true) |
|
|
|
|
|
|
|
@RequestParam String businessId,HttpServletResponse httpServletResponse){ |
|
|
|
|
|
|
|
GuaranteeLetterListResponse response = guaranteeLetterAssignUserService.selectGuaranteeLetter(businessId); |
|
|
|
|
|
|
|
String bank = response.getBank(); |
|
|
|
|
|
|
|
String name = response.getName(); |
|
|
|
|
|
|
|
Double loanMoney = response.getLoanMoney(); |
|
|
|
|
|
|
|
String loanTern = response.getLoanTern(); |
|
|
|
|
|
|
|
Date passingTime = response.getPassingTime(); |
|
|
|
|
|
|
|
String time = DateUtil.dateFormat(passingTime); |
|
|
|
|
|
|
|
XWPFTemplate template = XWPFTemplate.compile("D:\\template\\template.docx").render( |
|
|
|
|
|
|
|
new HashMap<String, Object>(){{ |
|
|
|
|
|
|
|
put("bankName", bank); |
|
|
|
|
|
|
|
put("clientName", name); |
|
|
|
|
|
|
|
put("passTime", time); |
|
|
|
|
|
|
|
put("loanMoney", loanMoney); |
|
|
|
|
|
|
|
put("loanTerm", loanTern); |
|
|
|
|
|
|
|
}}); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
httpServletResponse.setContentType("application/msword"); |
|
|
|
|
|
|
|
httpServletResponse.setCharacterEncoding("utf-8"); |
|
|
|
|
|
|
|
httpServletResponse.setHeader("Content-disposition", "attachment;filename=GuaranteeLetter.docx"); |
|
|
|
|
|
|
|
template.write(httpServletResponse.getOutputStream()); |
|
|
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|