Browse Source

基因定制附件申请人签名

陈长荣 3 tháng trước cách đây
mục cha
commit
036d1e036d

+ 10 - 0
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/flow/entity/FlowFileVersion.java

@@ -82,4 +82,14 @@ public class FlowFileVersion extends Model implements Serializable {
     private Date createTime;
 
     private static final long serialVersionUID = 1L;
+
+    /**
+     * 设置dataMap,替换图片Base64字符串
+     * @param dataMap
+     * @return
+     */
+    public FlowFileVersion setDataMapWithoutImg(String dataMap) {
+        this.dataMap = dataMap.replaceAll("\"iVBOR.*?\"", "\"[图片Base64]\"");
+        return this;
+    }
 }

+ 6 - 1
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/flow/service/impl/FlowInfoServiceImpl.java

@@ -18,6 +18,7 @@ import com.github.jfcloud.gene.cache.UserIdNameCache;
 import com.github.jfcloud.gene.common.constant.StrConstant;
 import com.github.jfcloud.gene.common.constant.WhetherEnum;
 import com.github.jfcloud.gene.common.util.CustomIdGenerator;
+import com.github.jfcloud.gene.common.util.UserUtil;
 import com.github.jfcloud.gene.constants.GeneStatusEnum;
 import com.github.jfcloud.gene.constants.GeneTargetEnum;
 import com.github.jfcloud.gene.file.service.FileInfoService;
@@ -217,6 +218,7 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
                     .setFlowStatus(flowInfo.getStatus())
                     .setAuditResult(vo.getAuditResult())
                     .setRemarks(vo.getRemarks())
+                    .setCreateSign(userIdNameCache.getSignPic(UserUtil.getUserId()))
                     .insert();
 
             new FlowInfo()
@@ -255,6 +257,7 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
                 .setFlowStatus(flowInfo.getStatus())
                 .setAuditResult(vo.getAuditResult())
                 .setRemarks(vo.getRemarks())
+                .setCreateSign(userIdNameCache.getSignPic(UserUtil.getUserId()))
                 .insert();
 
         flowInfo = new FlowInfo();
@@ -288,6 +291,8 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
 
         JSONObject dataMap = JSON.parseObject(JSON.toJSONString(detail));
         wordDataService.fillDocCreator(dataMap);
+        dataMap.put("createDateStr", createDate);
+        dataMap.put("createBySign", userIdNameCache.getSignBase64(Long.valueOf(flowInfo.getCreateBy())));
 
         String modelName = "geneCustom.ftl";
 
@@ -308,7 +313,7 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
                 new FlowFileVersion()
                         .setFlowId(flowInfo.getId())
                         .setFlowStatus(flowInfo.getStatus())
-                        .setDataMap(dataMap.toJSONString())
+                        .setDataMapWithoutImg(dataMap.toJSONString())
                         .setFileMd5(DigestUtil.md5Hex(byteArray))
                         .setFilename(fileVo.getName())
                         .setFilepath(fileVo.getUrl())

+ 27 - 46
jfcloud-gene-biz/src/main/resources/ftlTemplate/geneCustom.ftl

@@ -7473,69 +7473,42 @@
 										</w:rPr>
 										<w:t>申请人:</w:t>
 									</w:r>
-									<w:r>
-										<w:rPr>
-											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman" w:hint="eastAsia"/>
-											<w:b/>
-											<w:color w:val="000000"/>
-											<w:u w:val="single"/>
-										</w:rPr>
-										<w:t xml:space="preserve">    </w:t>
-									</w:r>
 									<w:r>
 										<w:rPr>
 											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman"/>
-											<w:b/>
-											<w:color w:val="000000"/>
+                                            <w:b/>
 											<w:u w:val="single"/>
 										</w:rPr>
-										<w:t xml:space="preserve">            </w:t>
-									</w:r>
-									<w:r>
-										<w:rPr>
-											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman" w:hint="eastAsia"/>
-											<w:b/>
-											<w:color w:val="000000"/>
-											<w:u w:val="single"/>
-										</w:rPr>
-										<w:t xml:space="preserve">          </w:t>
-									</w:r>
-									<w:r>
-										<w:rPr>
-											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman" w:hint="eastAsia"/>
-											<w:b/>
-										</w:rPr>
-										<w:t xml:space="preserve">   申请</w:t>
-									</w:r>
-									<w:r>
-										<w:rPr>
-											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman"/>
-											<w:b/>
-										</w:rPr>
-										<w:t>日期</w:t>
-									</w:r>
-									<w:r>
-										<w:rPr>
-											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman" w:hint="eastAsia"/>
-											<w:b/>
-										</w:rPr>
-										<w:t>:</w:t>
+                                        <#if createBySign??>
+                                            <w:t xml:space="preserve">  </w:t>
+                                            <w:pict>
+                                                <v:shape o:spt="75" alt="" type="#_x0000_t75" style="height:20pt; width:40pt;" filled="f" o:preferrelative="t" stroked="f" coordsize="21600,21600">
+                                                    <v:path/>
+                                                    <v:fill on="f" focussize="0,0"/>
+                                                    <v:stroke on="f"/>
+                                                    <v:imagedata r:id="rId21" o:title=""/>
+                                                    <o:lock v:ext="edit" aspectratio="t"/>
+                                                </v:shape>
+                                            </w:pict>
+                                            <w:t xml:space="preserve">  </w:t>
+                                            <#else >
+                                                <w:t xml:space="preserve">                          </w:t>
+                                        </#if>
 									</w:r>
 									<w:r>
 										<w:rPr>
 											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman" w:hint="eastAsia"/>
 											<w:b/>
-											<w:u w:val="single"/>
 										</w:rPr>
-										<w:t xml:space="preserve"> </w:t>
+										<w:t xml:space="preserve">   申请日期:</w:t>
 									</w:r>
 									<w:r>
 										<w:rPr>
-											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman"/>
+											<w:rFonts w:hint="default"/>
 											<w:b/>
 											<w:u w:val="single"/>
 										</w:rPr>
-										<w:t xml:space="preserve">                 </w:t>
+										<w:t xml:space="preserve">  ${createDateStr!'              '}  </w:t>
 									</w:r>
 								</w:p>
 								<w:p w14:paraId="2B8A74D5" w14:textId="77777777" w:rsidR="00B33B30" w:rsidRDefault="00000000">
@@ -7798,6 +7771,9 @@
 				<Relationship Id="rId10" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" Target="footer1.xml"/>
 				<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="settings.xml"/>
 				<Relationship Id="rId9" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" Target="header1.xml"/>
+                <#if createBySign??>
+                <Relationship Id="rId21" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/createBySign.png"/>
+                </#if>
 			</Relationships>
 		</pkg:xmlData>
 	</pkg:part>
@@ -22821,4 +22797,9 @@ AAAAAQAKAAAADAAA</pkg:binaryData>
 			</Relationships>
 		</pkg:xmlData>
 	</pkg:part>
+    <#if createBySign??>
+    <pkg:part pkg:name="/word/media/createBySign.png" pkg:contentType="image/png">
+        <pkg:binaryData>${createBySign}</pkg:binaryData>
+    </pkg:part>
+    </#if>
 </pkg:package>