Commit 6c727004 authored by qinhu's avatar qinhu

报告模板修改

parent faefeaf7
...@@ -39,6 +39,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -39,6 +39,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
...@@ -121,9 +122,9 @@ public class ReportController { ...@@ -121,9 +122,9 @@ public class ReportController {
beanParams.put("projectName", rts.getProjectName()); beanParams.put("projectName", rts.getProjectName());
beanParams.put("printDate", rts.getPrintDate()); beanParams.put("printDate", rts.getPrintDate());
beanParams.put("year", DateUtil.year(DateUtil.date())); beanParams.put("year", DateUtil.year(DateUtil.date()) + "");
beanParams.put("month", DateUtil.month(DateUtil.date())); beanParams.put("month", DateUtil.month(DateUtil.date()) + 1);
beanParams.put("day", DateUtil.today()); beanParams.put("day", DateUtil.dayOfMonth(DateUtil.date()));
beanParams.put("reportNo", StrUtil.isEmpty(rts.getReportNo()) ? "" : rts.getReportNo()); beanParams.put("reportNo", StrUtil.isEmpty(rts.getReportNo()) ? "" : rts.getReportNo());
beanParams.put("firstMethodName", getFirstSet(rts.getMethodNames())); beanParams.put("firstMethodName", getFirstSet(rts.getMethodNames()));
......
...@@ -2782,10 +2782,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -2782,10 +2782,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
int id = Integer.parseInt(idStr); int id = Integer.parseInt(idStr);
teams.forEach(opt -> { teams.forEach(opt -> {
if (opt.getId() == id && 1 == opt.getQualifications()) { if (opt.getId() == id && 1 == opt.getQualifications()) {
String teamName = replaceSub(opt.getName());
if (StrUtil.isBlank(arg.getTeamName())) { if (StrUtil.isBlank(arg.getTeamName())) {
arg.setTeamName(opt.getName()); arg.setTeamName(teamName);
} else { } else {
arg.setTeamName(arg.getTeamName() + "、" + opt.getName()); arg.setTeamName(arg.getTeamName() + "、" + teamName);
} }
} }
}); });
...@@ -2988,6 +2989,59 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -2988,6 +2989,59 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
} }
/**
* 替换特殊角标
*
* @param teamName 待替换元素名
* @return 新元素名
*/
private String replaceSub(String teamName) {
String[] subs = {"₀", "₁", "₂", "₃", "₄", "₅", "₆", "₇", "₈", "₉", "₊", "₋"};
String[] sups = {"⁰", "¹", "²", "³", "⁴", "⁵", "⁶", "⁷", "⁸", "⁹", "⁺", "⁻", "⁼", "⁽", "⁾", "ⁿ"};
String rts = teamName;
if (StringUtils.isEmpty(teamName)) {
return rts;
}
if (teamName.contains("<sub>1</sub>")){
rts = rts.replace("<sub>1</sub>","₁");
}
if (teamName.contains("<sub>2</sub>")){
rts = rts.replace("<sub>2</sub>","₂");
}
if (teamName.contains("<sub>3</sub>")){
rts = rts.replace("<sub>3</sub>","₃");
}
if (teamName.contains("<sub>4</sub>")){
rts = rts.replace("<sub>4</sub>","₄");
}
if (teamName.contains("<sub>5</sub>")){
rts = rts.replace("<sub>5</sub>","₅");
}
if (teamName.contains("<sub>6</sub>")){
rts = rts.replace("<sub>6</sub>","₆");
}
if (teamName.contains("<sub>7</sub>")){
rts = rts.replace("<sub>7</sub>","₇");
}
if (teamName.contains("<sub>8</sub>")){
rts = rts.replace("<sub>8</sub>","₈");
}
if (teamName.contains("<sub>9</sub>")){
rts = rts.replace("<sub>9</sub>","₉");
}
if (teamName.contains("<sup>-</sup>")){
rts = rts.replace("<sup>-</sup>","⁻");
}
if (teamName.contains("<sup>+</sup>")){
rts = rts.replace("<sup>+</sup>","⁺");
}
return rts;
}
/** /**
* 根据样品检测列表获取报告管理首页 * 根据样品检测列表获取报告管理首页
...@@ -3008,6 +3062,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -3008,6 +3062,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
rts.setSender(firstReportDetail.getSendName()); rts.setSender(firstReportDetail.getSendName());
rts.setSendDate(DateUtil.format(firstReportDetail.getSendTime(), "yyyy年MM月dd日")); rts.setSendDate(DateUtil.format(firstReportDetail.getSendTime(), "yyyy年MM月dd日"));
rts.setProjectName(firstReportDetail.getProjectName()); rts.setProjectName(firstReportDetail.getProjectName());
rts.setReportNo(firstReportDetail.getEntrustCode());
rts.setSendName("\\"); rts.setSendName("\\");
//获取检测项目、检测仪器、检测依据 //获取检测项目、检测仪器、检测依据
rts.setEquipmentNames(new HashSet<>(source.size())); rts.setEquipmentNames(new HashSet<>(source.size()));
......
package cn.wise.sc.cement.business.util; package cn.wise.sc.cement.business.util;
import cn.hutool.core.date.DateTime;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.temporal.WeekFields; import java.time.temporal.WeekFields;
import java.util.Date; import java.util.Date;
......
...@@ -1664,7 +1664,7 @@ ...@@ -1664,7 +1664,7 @@
</Style> </Style>
<Style ss:ID="s128"> <Style ss:ID="s128">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
<Font ss:FontName="楷体" x:CharSet="134" x:Family="Modern" ss:Size="12"/> <Font ss:FontName="楷体" x:CharSet="134" x:Family="Modern" ss:Size="12" ss:Color="#FF0000"/>
</Style> </Style>
<Style ss:ID="s129"> <Style ss:ID="s129">
<Alignment ss:Vertical="Center"/> <Alignment ss:Vertical="Center"/>
...@@ -3667,7 +3667,7 @@ ...@@ -3667,7 +3667,7 @@
<Cell ss:Index="13" ss:StyleID="s79"/> <Cell ss:Index="13" ss:StyleID="s79"/>
</Row> </Row>
<Row ss:AutoFitHeight="0" ss:Height="25"> <Row ss:AutoFitHeight="0" ss:Height="25">
<Cell ss:MergeAcross="5" ss:StyleID="s105"><Data ss:Type="String"> (承担法律责任机构:中材装备集团有限公司)</Data><NamedCell <Cell ss:MergeAcross="5" ss:StyleID="s105"><Data ss:Type="String"> (承担法律责任机构:天津水泥工业设计研究院有限公司)</Data><NamedCell
ss:Name="Print_Area"/></Cell> ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s106"/> <Cell ss:StyleID="s106"/>
<Cell ss:StyleID="s107"/> <Cell ss:StyleID="s107"/>
...@@ -3829,7 +3829,7 @@ ...@@ -3829,7 +3829,7 @@
ss:Name="_FilterDatabase"/></Cell> ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s127"><ss:Data ss:Type="String" <Cell ss:StyleID="s127"><ss:Data ss:Type="String"
xmlns="http://www.w3.org/TR/REC-html40"><Font html:Color="#FF0000"></Font><Font xmlns="http://www.w3.org/TR/REC-html40"><Font html:Color="#FF0000"></Font><Font
html:Face="宋体" x:CharSet="134" html:Color="#FF0000">2</Font><Font html:Face="宋体" x:CharSet="134" html:Color="#FF0000">3</Font><Font
html:Color="#FF0000"></Font></ss:Data><NamedCell ss:Name="_FilterDatabase"/></Cell> html:Color="#FF0000"></Font></ss:Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s128"><ss:Data ss:Type="String" <Cell ss:StyleID="s128"><ss:Data ss:Type="String"
xmlns="http://www.w3.org/TR/REC-html40"><Font html:Face="宋体" xmlns="http://www.w3.org/TR/REC-html40"><Font html:Face="宋体"
...@@ -4246,52 +4246,36 @@ ...@@ -4246,52 +4246,36 @@
</Row> </Row>
<Row ss:AutoFitHeight="0" ss:Height="15"> <Row ss:AutoFitHeight="0" ss:Height="15">
<Cell ss:MergeAcross="15" ss:StyleID="s223"><NamedCell ss:Name="Print_Area"/></Cell> <Cell ss:MergeAcross="15" ss:StyleID="s223"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s225"/>
<Cell ss:StyleID="s225"/>
<Cell ss:StyleID="s225"/>
<Cell ss:StyleID="s225"/>
</Row> </Row>
<Row ss:AutoFitHeight="0" ss:Height="31.5"> <Row ss:AutoFitHeight="0" ss:Height="43.5">
<Cell ss:MergeAcross="15" ss:StyleID="s227"><Data ss:Type="String">检 测 报 告 </Data><NamedCell <Cell ss:MergeAcross="15" ss:StyleID="s227"><Data ss:Type="String">检 测 报 告1</Data><NamedCell
ss:Name="Print_Area"/></Cell> ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s225"/>
<Cell ss:StyleID="s225"/>
<Cell ss:StyleID="s225"/>
<Cell ss:StyleID="s225"/>
</Row> </Row>
<Row ss:AutoFitHeight="0" ss:Height="15"> <Row ss:AutoFitHeight="0" ss:Height="15">
<Cell ss:MergeAcross="15" ss:StyleID="s228"><NamedCell ss:Name="Print_Area"/></Cell> <Cell ss:MergeAcross="16" ss:StyleID="s228"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s225"/>
<Cell ss:StyleID="s225"/>
<Cell ss:StyleID="s225"/>
<Cell ss:StyleID="s225"/>
</Row> </Row>
<Row ss:AutoFitHeight="0"> <Row ss:AutoFitHeight="0">
<Cell ss:StyleID="s230"><Data ss:Type="String">报告编号:</Data><NamedCell <Cell ss:StyleID="s329"><Data ss:Type="String">报告编号:</Data><NamedCell
ss:Name="Print_Area"/></Cell> ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s231" ss:Formula="=封面!R[2]C[2]"><Data ss:Type="String">${reportNo}</Data><NamedCell <Cell ss:StyleID="s126" ss:Formula="=封面!R[2]C[2]"><Data ss:Type="String">${reportNo}</Data><NamedCell
ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s232"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s232"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s232"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s232"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s232"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s232"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s232"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s232"><Data ss:Type="String"> </Data><NamedCell
ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s232"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s232"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s233"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s72"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s76" ss:Formula="=首页!R[-2]C[-12]"><Data ss:Type="String">共2页 </Data><NamedCell
ss:Name="Print_Area"/></Cell> ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s76"><Data ss:Type="String">第2页 </Data><NamedCell <Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><Data ss:Type="String"> </Data><NamedCell
ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s290" ss:Formula=""><Data ss:Type="String">共3页 </Data><NamedCell
ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s291"><Data ss:Type="String">第2页 </Data><NamedCell
ss:Name="Print_Area"/></Cell> ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s225"/>
<Cell ss:StyleID="s225"/>
<Cell ss:StyleID="s225"/>
<Cell ss:StyleID="s225"/>
</Row> </Row>
<Row ss:AutoFitHeight="0" ss:Height="25.5"> <Row ss:AutoFitHeight="0" ss:Height="25.5">
<Cell ss:MergeDown="1" ss:StyleID="m2194692797824"><Data ss:Type="String">样品名称</Data><NamedCell <Cell ss:MergeDown="1" ss:StyleID="m2194692797824"><Data ss:Type="String">样品名称</Data><NamedCell
...@@ -6237,8 +6221,8 @@ ...@@ -6237,8 +6221,8 @@
<Row ss:AutoFitHeight="0" ss:Height="15"> <Row ss:AutoFitHeight="0" ss:Height="15">
<Cell ss:MergeAcross="16" ss:StyleID="s223"><NamedCell ss:Name="Print_Area"/></Cell> <Cell ss:MergeAcross="16" ss:StyleID="s223"><NamedCell ss:Name="Print_Area"/></Cell>
</Row> </Row>
<Row ss:AutoFitHeight="0" ss:Height="31.5"> <Row ss:AutoFitHeight="0" ss:Height="43.5">
<Cell ss:MergeAcross="16" ss:StyleID="s227"><Data ss:Type="String">检 测 报 告 </Data><NamedCell <Cell ss:MergeAcross="15" ss:StyleID="s227"><Data ss:Type="String">检 测 报 告1</Data><NamedCell
ss:Name="Print_Area"/></Cell> ss:Name="Print_Area"/></Cell>
</Row> </Row>
<Row ss:AutoFitHeight="0" ss:Height="15"> <Row ss:AutoFitHeight="0" ss:Height="15">
...@@ -6320,22 +6304,22 @@ ...@@ -6320,22 +6304,22 @@
<#list list2 as item> <#list list2 as item>
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s225"> <Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s225">
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s263"><Data ss:Type="String">${item.sampleName}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s263"><Data ss:Type="String">${item.sampleForm}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s263"><Data ss:Type="String">${item.sampleCode}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s263"><Data ss:Type="String">${item.weight}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s263"><Data ss:Type="String">${item.cementCode}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s264"><Data ss:Type="String">${item.loi}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s264"><Data ss:Type="String">${item.sio2}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s264"><Data ss:Type="String">${item.al2o3}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s264"><Data ss:Type="String">${item.fe2o3}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s264"><Data ss:Type="String">${item.cao}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s264"><Data ss:Type="String">${item.mgo}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s264"><Data ss:Type="String">${item.tio2}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s264"><Data ss:Type="String">-</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s264"><Data ss:Type="String">-</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s264"><Data ss:Type="String">${item.so3}</Data></Cell>
<Cell ss:StyleID="s265"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s265"><Data ss:Type="String">${item.cl}</Data></Cell>
<Cell ss:StyleID="s248"><Data ss:Type="String">${item.sampleName}</Data></Cell> <Cell ss:StyleID="s248"><Data ss:Type="String">-</Data></Cell>
</Row> </Row>
</#list> </#list>
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s223"> <Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s223">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment