| | |
| | | import com.deepoove.poi.data.TextRenderData; |
| | | import com.deepoove.poi.data.style.Style; |
| | | import com.deepoove.poi.render.RenderContext; |
| | | import com.deepoove.poi.util.RegexUtils; |
| | | import com.product.common.lang.StringUtils; |
| | | import com.product.core.cache.DataPoolCacheImpl; |
| | | import com.product.core.config.Global; |
| | |
| | | import com.product.print.config.CmnCode; |
| | | import com.product.print.config.CmnConst; |
| | | import com.product.print.service.ide.IPrintRealizeService; |
| | | import com.product.print.util.CustomPictureRenderPolicy; |
| | | import com.product.print.util.DynamicTableRenderPolicy; |
| | | import com.product.print.util.FlowOpinionRenderPolicy; |
| | | import com.product.print.util.TableEmptyHandler; |
| | | import com.product.tool.flow.service.FlowDetailService; |
| | | import com.product.util.BaseUtil; |
| | | |
| | | import com.product.util.SystemParamReplace; |
| | | import org.apache.poi.xwpf.usermodel.XWPFTable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.io.File; |
| | | import java.io.OutputStream; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.UUID; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | |
| | | Object tempKey = UUID.randomUUID(); |
| | | // 替换后的word临时路径 |
| | | String localTempPathWord = Global.getSystemConfig("temp.dir", "") + File.separator + "temp_print_" + tempKey + ".docx"; |
| | | |
| | | replaceWord(localTempPathWord, file.getPath(), fse); |
| | | file.delete(); |
| | | |
| | |
| | | Map<String, Object> cloneValues = new HashMap(dataFse.getValues()); |
| | | //获取子表数据 |
| | | Map<String, DataTableEntity> subDataMap = dataFse.getSubData(); |
| | | ConfigureBuilder config = Configure.createDefault().builder(); |
| | | ConfigureBuilder config = Configure.builder(); |
| | | config.addPlugin('@', new FlowOpinionRenderPolicy(flowOpinion)); |
| | | config.addPlugin('$', new com.deepoove.poi.policy.DynamicTableRenderPolicy() { |
| | | @Override |
| | |
| | | return; |
| | | } |
| | | }); |
| | | |
| | | config.addPlugin('&', new CustomPictureRenderPolicy()); |
| | | config.buildGrammerRegex("(#)?([\\w\\u4e00-\\u9fa5]+)(\\.?[\\w\\u4e00-\\u9fa5\\|]*)*(#)?"); |
| | | TableEmptyHandler tableEmptyHandler = new TableEmptyHandler(); |
| | | if (!CollectionUtil.isEmpty(subDataMap)) { |