| | |
| | | import com.deepoove.poi.render.RenderContext; |
| | | import com.deepoove.poi.xwpf.BodyContainer; |
| | | import com.deepoove.poi.xwpf.BodyContainerFactory; |
| | | import com.product.admin.service.OrganizationCacheService; |
| | | import com.product.common.lang.StringUtils; |
| | | import com.product.core.entity.FieldSetEntity; |
| | | import org.apache.poi.util.Units; |
| | | import org.apache.poi.xwpf.usermodel.*; |
| | | |
| | |
| | | XWPFRun run = context.getRun(); |
| | | //标签名称 |
| | | String tagName = context.getEleTemplate().getTagName(); |
| | | JSONObject opinion=null; |
| | | JSONObject opinion = null; |
| | | //支持多个标签名称,用|分隔 例如:{{@var1|var2|var3...}} 按照顺序查找意见列表 |
| | | for (String name : tagName.split("\\|")) { |
| | | opinion = getOpinion(name); |
| | | if(opinion!=null){ |
| | | if (opinion != null) { |
| | | break; |
| | | } |
| | | } |
| | |
| | | //插入图片 |
| | | newRun.addPicture(byteArrayInputStream, XWPFDocument.PICTURE_TYPE_PNG, "sign.png", Units.toEMU(50), Units.toEMU(20)); |
| | | byteArrayInputStream.close(); |
| | | newRun.setText("", 0); |
| | | } else { |
| | | |
| | | //流程节点实际处理人 |
| | | String actualPerson = opinion.getString("actual_person"); |
| | | newRun.setText(actualPerson); |
| | | } |
| | | newRun.addBreak(); |
| | | newRun.setText(opinion.getString("deal_time").substring(0, 16)); |
| | | XWPFParagraph paragraph = createParagraph(newRun); |
| | | //段落样式与原始段落一致 |
| | | paragraph.getCTP().setPPr(parent.getCTP().getPPr()); |