|
|
@@ -3,13 +3,10 @@ package com.zksy.property.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.zksy.property.domain.ARentalContent;
|
|
|
import com.zksy.property.domain.ARentalContract;
|
|
|
+import com.zksy.property.mapper.ARentalContractMapper;
|
|
|
import com.zksy.property.service.ARentalContentService;
|
|
|
import com.zksy.property.service.ARentalContractService;
|
|
|
-import com.zksy.property.mapper.ARentalContractMapper;
|
|
|
-import org.apache.poi.hwpf.HWPFDocument;
|
|
|
-import org.apache.poi.hwpf.usermodel.Bookmarks;
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFRun;
|
|
|
@@ -17,11 +14,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.io.*;
|
|
|
+import java.io.FileOutputStream;
|
|
|
+import java.io.InputStream;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
@@ -60,11 +57,18 @@ public class ARentalContractServiceImpl extends ServiceImpl<ARentalContractMappe
|
|
|
|
|
|
@Override
|
|
|
public String generatorRental(String mark) {
|
|
|
- switch ( mark){
|
|
|
+ switch (mark){
|
|
|
case "1":{
|
|
|
HashMap<String, String> contentMap = new HashMap<>();
|
|
|
contentMap.put("a1", "张三");
|
|
|
- contentMap.put("a2", "123456789");
|
|
|
+ contentMap.put("a2", "11111111");
|
|
|
+ contentMap.put("a3", "2222222222");
|
|
|
+ contentMap.put("a4", "3333333");
|
|
|
+ contentMap.put("a5", "555555");
|
|
|
+ contentMap.put("a6", "6666666");
|
|
|
+ contentMap.put("a7", "777777");
|
|
|
+ contentMap.put("a8", "8888888");
|
|
|
+ contentMap.put("a9", "111100099999");
|
|
|
|
|
|
try (InputStream inputStream = new ClassPathResource("templates/1.docx").getInputStream()) {
|
|
|
XWPFDocument document = new XWPFDocument(inputStream);
|