Jelajahi Sumber

流程审批生成附件

陈长荣 3 bulan lalu
induk
melakukan
c87b6b6831

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

@@ -30,6 +30,7 @@ import com.github.jfcloud.gene.flow.entity.FlowAudit;
 import com.github.jfcloud.gene.flow.entity.FlowFileVersion;
 import com.github.jfcloud.gene.flow.entity.FlowInfo;
 import com.github.jfcloud.gene.flow.mapper.FlowInfoMapper;
+import com.github.jfcloud.gene.flow.service.FlowAuditService;
 import com.github.jfcloud.gene.flow.service.FlowFileVersionService;
 import com.github.jfcloud.gene.flow.service.FlowInfoService;
 import com.github.jfcloud.gene.flow.service.NotifyService;
@@ -76,6 +77,7 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
     private final FileInfoService fileInfoService;
     private final FlowFileVersionService fileVersionService;
     private final RemoteProjectService remoteProjectService;
+    private final FlowAuditService flowAuditService;
 
     @Override
     public Page<FlowPageDto> getPage(FlowPageVo vo) {
@@ -265,6 +267,8 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
                     .setStatus(GeneStatusEnum.REJECTED.getStatus())
                     .updateById();
 
+            geneWord(id);
+
             notifyService.notify(id);
             return;
         }
@@ -281,6 +285,8 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
                 .setStatus(nextStatus)
                 .updateById();
 
+        geneWord(id);
+
         notifyService.notify(id);
     }
 
@@ -334,6 +340,42 @@ public class FlowInfoServiceImpl extends ServiceImpl<FlowInfoMapper, FlowInfo> i
         dataMap.put("createDateStr", createDate);
         dataMap.put("createBySign", userIdNameCache.getSignBase64(Long.valueOf(flowInfo.getCreateBy())));
 
+        //查询审核记录
+        List<FlowAudit> flowAudits = flowAuditService.list(new LambdaQueryWrapper<>(FlowAudit.class)
+                .eq(FlowAudit::getFlowId, flowId)
+                .eq(FlowAudit::getDeleted, WhetherEnum.NO.getCode())
+                .orderByDesc(FlowAudit::getCreateTime));
+        //项目管理部审核
+        flowAudits.stream()
+                .filter(audit -> GeneStatusEnum.PROJECT_MANAGEMENT.getStatus().equals(audit.getFlowStatus()) && StrConstant.YES.equals(audit.getAuditResult()))
+                .findFirst()
+                .ifPresent(audit -> {
+                    dataMap.put("projectManagementDateStr", DateUtil.format(audit.getCreateTime(), DatePattern.CHINESE_DATE_PATTERN));
+                    dataMap.put("projectManagementSign", wordDataService.getBase64(audit.getCreateSign()));
+                });
+        //项目负责人审核
+        flowAudits.stream()
+                .filter(audit -> GeneStatusEnum.PROJECT_LEADER.getStatus().equals(audit.getFlowStatus()))
+                .findFirst()
+                .ifPresent(audit -> {
+                    dataMap.put("projectLeaderDateStr", DateUtil.format(audit.getCreateTime(), DatePattern.CHINESE_DATE_PATTERN));
+                    dataMap.put("projectLeaderSign", wordDataService.getBase64(audit.getCreateSign()));
+                    dataMap.put("leaderResult", false);
+                    if (StrUtil.isNotBlank(audit.getAdditionalData())) {
+                        JSONObject additionObj = JSON.parseObject(audit.getAdditionalData());
+                        dataMap.put("leaderResult", additionObj.getOrDefault("leaderResult", false));
+                    }
+                });
+        //基因编辑部门审核
+        flowAudits.stream()
+                .filter(audit -> GeneStatusEnum.GENE_EDITING.getStatus().equals(audit.getFlowStatus()))
+                .findFirst()
+                .ifPresent(audit -> {
+                    dataMap.put("geneEditingResult", StrConstant.YES.equals(audit.getAuditResult()));
+                    dataMap.put("geneEditingRemarks", audit.getRemarks());
+                });
+
+
         String modelName = "geneCustom.ftl";
 
         try (InputStream inputStream = WordUtil.exportWord(modelName, dataMap);

+ 76 - 169
jfcloud-gene-biz/src/main/resources/ftlTemplate/geneCustom.ftl

@@ -7295,31 +7295,11 @@
 										</w:rPr>
 										<w:t>基因编辑部门审核:</w:t>
 									</w:r>
-									<w:sdt>
-										<w:sdtPr>
-											<w:rPr>
-												<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="宋体"/>
-												<w:color w:val="000000"/>
-												<w:kern w:val="0"/>
-											</w:rPr>
-											<w:id w:val="267899336"/>
-											<w14:checkbox>
-												<w14:checked w14:val="0"/>
-												<w14:checkedState w14:val="0052" w14:font="Wingdings 2"/>
-												<w14:uncheckedState w14:val="2610" w14:font="MS Gothic"/>
-											</w14:checkbox>
-										</w:sdtPr>
-										<w:sdtContent>
-											<w:r>
-												<w:rPr>
-													<w:rFonts w:ascii="Segoe UI Symbol" w:hAnsi="Segoe UI Symbol" w:cs="Segoe UI Symbol"/>
-													<w:color w:val="000000"/>
-													<w:kern w:val="0"/>
-												</w:rPr>
-												<w:t>☐</w:t>
-											</w:r>
-										</w:sdtContent>
-									</w:sdt>
+                                    <#if geneEditingResult?? && geneEditingResult>
+                                        <w:sym w:font="Wingdings 2" w:char="F052"/>
+                                    <#else >
+                                        <w:sym w:font="Wingdings 2" w:char="F0A3"/>
+                                    </#if>
 									<w:r>
 										<w:rPr>
 											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="宋体" w:hint="eastAsia"/>
@@ -7335,64 +7315,19 @@
 										</w:rPr>
 										<w:t xml:space="preserve">     </w:t>
 									</w:r>
-									<w:sdt>
-										<w:sdtPr>
-											<w:rPr>
-												<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="宋体"/>
-												<w:color w:val="000000"/>
-												<w:kern w:val="0"/>
-											</w:rPr>
-											<w:id w:val="103910971"/>
-											<w14:checkbox>
-												<w14:checked w14:val="0"/>
-												<w14:checkedState w14:val="0052" w14:font="Wingdings 2"/>
-												<w14:uncheckedState w14:val="2610" w14:font="MS Gothic"/>
-											</w14:checkbox>
-										</w:sdtPr>
-										<w:sdtContent>
-											<w:r>
-												<w:rPr>
-													<w:rFonts w:ascii="Segoe UI Symbol" w:hAnsi="Segoe UI Symbol" w:cs="Segoe UI Symbol"/>
-													<w:color w:val="000000"/>
-													<w:kern w:val="0"/>
-												</w:rPr>
-												<w:t>☐</w:t>
-											</w:r>
-										</w:sdtContent>
-									</w:sdt>
+                                    <#if leaderResult?? && !leaderResult>
+                                        <w:sym w:font="Wingdings 2" w:char="F052"/>
+                                    <#else >
+                                        <w:sym w:font="Wingdings 2" w:char="F0A3"/>
+                                    </#if>
 									<w:r>
 										<w:rPr>
 											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="宋体" w:hint="eastAsia"/>
 											<w:color w:val="000000"/>
 											<w:kern w:val="0"/>
 										</w:rPr>
-										<w:t xml:space="preserve">驳回     </w:t>
+										<w:t xml:space="preserve">驳回  </w:t>
 									</w:r>
-									<w:sdt>
-										<w:sdtPr>
-											<w:rPr>
-												<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="宋体"/>
-												<w:color w:val="000000"/>
-												<w:kern w:val="0"/>
-											</w:rPr>
-											<w:id w:val="527484586"/>
-											<w14:checkbox>
-												<w14:checked w14:val="0"/>
-												<w14:checkedState w14:val="0052" w14:font="Wingdings 2"/>
-												<w14:uncheckedState w14:val="2610" w14:font="MS Gothic"/>
-											</w14:checkbox>
-										</w:sdtPr>
-										<w:sdtContent>
-											<w:r>
-												<w:rPr>
-													<w:rFonts w:ascii="MS Gothic" w:hAnsi="MS Gothic" w:cs="Segoe UI Symbol"/>
-													<w:color w:val="000000"/>
-													<w:kern w:val="0"/>
-												</w:rPr>
-												<w:t>☐</w:t>
-											</w:r>
-										</w:sdtContent>
-									</w:sdt>
 									<w:r>
 										<w:rPr>
 											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="宋体" w:hint="eastAsia"/>
@@ -7401,21 +7336,17 @@
 										</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: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:u w:val="single"/>
 										</w:rPr>
-										<w:t xml:space="preserve">        </w:t>
+                                        <#if geneEditingResult?? && !geneEditingResult>
+										<w:t xml:space="preserve">  ${geneEditingRemarks!'         '}  </w:t>
+                                        <#else >
+										<w:t xml:space="preserve">             </w:t>
+                                        </#if>
 									</w:r>
 								</w:p>
 								<w:p w14:paraId="4783EB6B" w14:textId="77777777" w:rsidR="00B33B30" w:rsidRDefault="00B33B30">
@@ -7536,25 +7467,21 @@
 											<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: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>
+                                        <#if projectLeaderSign??>
+                                            <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="rId22" 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>
@@ -7579,19 +7506,11 @@
 									</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: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">  ${projectLeaderDateStr!'              '}  </w:t>
 									</w:r>
 								</w:p>
 								<w:p w14:paraId="79B0E17F" w14:textId="77777777" w:rsidR="00B33B30" w:rsidRDefault="00000000">
@@ -7612,28 +7531,11 @@
 										</w:rPr>
 										<w:t>分管领导是否已同意:</w:t>
 									</w:r>
-									<w:sdt>
-										<w:sdtPr>
-											<w:rPr>
-												<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman" w:hint="eastAsia"/>
-												<w:b/>
-												<w:bCs/>
-												<w:color w:val="000000"/>
-											</w:rPr>
-											<w:id w:val="620942086"/>
-										</w:sdtPr>
-										<w:sdtContent>
-											<w:r>
-												<w:rPr>
-													<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman" w:hint="eastAsia"/>
-													<w:b/>
-													<w:bCs/>
-													<w:color w:val="000000"/>
-												</w:rPr>
-												<w:t>□</w:t>
-											</w:r>
-										</w:sdtContent>
-									</w:sdt>
+                                    <#if leaderResult?? && leaderResult>
+                                        <w:sym w:font="Wingdings 2" w:char="F052"/>
+                                    <#else >
+                                        <w:sym w:font="Wingdings 2" w:char="F0A3"/>
+                                    </#if>
 									<w:r>
 										<w:rPr>
 											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman" w:hint="eastAsia"/>
@@ -7643,28 +7545,11 @@
 										</w:rPr>
 										<w:t xml:space="preserve">是   </w:t>
 									</w:r>
-									<w:sdt>
-										<w:sdtPr>
-											<w:rPr>
-												<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman" w:hint="eastAsia"/>
-												<w:b/>
-												<w:bCs/>
-												<w:color w:val="000000"/>
-											</w:rPr>
-											<w:id w:val="550598629"/>
-										</w:sdtPr>
-										<w:sdtContent>
-											<w:r>
-												<w:rPr>
-													<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman" w:hint="eastAsia"/>
-													<w:b/>
-													<w:bCs/>
-													<w:color w:val="000000"/>
-												</w:rPr>
-												<w:t>□</w:t>
-											</w:r>
-										</w:sdtContent>
-									</w:sdt>
+                                    <#if leaderResult?? && !leaderResult>
+                                        <w:sym w:font="Wingdings 2" w:char="F052"/>
+                                    <#else >
+                                        <w:sym w:font="Wingdings 2" w:char="F0A3"/>
+                                    </#if>
 									<w:r>
 										<w:rPr>
 											<w:rFonts w:ascii="宋体" w:hAnsi="宋体" w:cs="Times New Roman" w:hint="eastAsia"/>
@@ -7698,7 +7583,21 @@
 											<w:b/>
 											<w:u w:val="single"/>
 										</w:rPr>
-										<w:t xml:space="preserve">                  </w:t>
+                                        <#if projectManagementSign??>
+                                            <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="rId23" 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>
@@ -7723,19 +7622,11 @@
 									</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: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">  ${projectManagementDateStr!'              '}  </w:t>
 									</w:r>
 								</w:p>
 							</w:tc>
@@ -7773,6 +7664,12 @@
 				<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>
+                <#if projectLeaderSign??>
+                <Relationship Id="rId22" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/projectLeaderSign.png"/>
+                </#if>
+                <#if projectManagementSign??>
+                <Relationship Id="rId23" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/projectManagementSign.png"/>
                 </#if>
 			</Relationships>
 		</pkg:xmlData>
@@ -22802,4 +22699,14 @@ AAAAAQAKAAAADAAA</pkg:binaryData>
         <pkg:binaryData>${createBySign}</pkg:binaryData>
     </pkg:part>
     </#if>
+    <#if projectLeaderSign??>
+    <pkg:part pkg:name="/word/media/projectLeaderSign.png" pkg:contentType="image/png">
+        <pkg:binaryData>${projectLeaderSign}</pkg:binaryData>
+    </pkg:part>
+    </#if>
+    <#if projectManagementSign??>
+    <pkg:part pkg:name="/word/media/projectManagementSign.png" pkg:contentType="image/png">
+        <pkg:binaryData>${projectManagementSign}</pkg:binaryData>
+    </pkg:part>
+    </#if>
 </pkg:package>