Commit c6dfb54a authored by 竹天卫's avatar 竹天卫

报告导出优化

parent 0f6d039f
......@@ -129,14 +129,18 @@ public class ReportController {
private String getFirstSet(Set<String> set) {
if(set != null && set.size()>0){
Iterator<String> iterator = set.iterator();
if (iterator.hasNext()) {
return iterator.next();
}
}
return "";
}
private static Set<String> moveFirst(Set<String> set) {
if(set != null && set.size()>0){
Set<String> newSet = new HashSet<>(set.size());
Iterator<String> iterator = set.iterator();
if (iterator.hasNext()) {
......@@ -145,6 +149,7 @@ public class ReportController {
newSet.remove(next);
return newSet;
}
}
return null;
}
......
......@@ -134,7 +134,7 @@ public class Sample implements Serializable {
*/
public static String weight2Kg(String weight,Integer weightType){
String result = "";
if(StringUtils.isNotBlank(weight)){
if(StringUtils.isNotBlank(weight) && weightType != null ){
if(weightType == 1){
result = new BigDecimal(weight).divide(new BigDecimal(1000000000)).toString();
}else if(weightType == 2){
......
......@@ -4961,6 +4961,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
List<Method> methods = JSON.parseArray(redisUtil.getString(methodKey) + "", Method.class);
list.forEach(arg -> {
String teamIds = arg.getTeamIds();
if(StringUtils.isNoneBlank(teamIds)){
String[] teamSplit = teamIds.split("、");
for (String idStr : teamSplit) {
int id = Integer.parseInt(idStr);
......@@ -4975,7 +4976,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
});
}
}
String methodNumbers = arg.getMethodNumbers();
if(StringUtils.isNoneBlank(methodNumbers)){
String[] methodSplit = methodNumbers.split("、");
for (String idStr : methodSplit) {
String id = Integer.parseInt(idStr) + "";
......@@ -4989,6 +4993,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
});
}
}
});
if (list.size() != 0) {
......@@ -5036,6 +5041,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
//将样品重量换算成kg
if(newList != null){
newList.stream().forEach(arg ->{
arg.setWeight(Sample.weight2Kg(arg.getWeight(), arg.getWeightType()));
});
}
......@@ -5655,7 +5661,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
rts.setTeamNames(new HashSet<>(source.size()));
Set<Integer> equipmentIds = new HashSet<>(source.size());
source.forEach(arg -> {
if(arg.getEquipmentId() != null){
equipmentIds.add(arg.getEquipmentId());
}
//获取使用的设备id view
//关联检测项目
if (StrUtil.isNotBlank(arg.getTeamName())) {
......@@ -5680,8 +5688,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
rts.setSampleNum(rts.getSampleNames().size());
//关联仪器名字 去重
if(equipmentIds != null && equipmentIds.size()>0){
List<String> equipmentNames = equipmentUseMapper.getEquipmentNamesByEquipmentIds(equipmentIds);
equipmentNames.forEach(arg -> rts.getEquipmentNames().add(arg));
}
//关联送样单位名字
String clientKey = "CACHE:CLIENT";
......
......@@ -1807,15 +1807,14 @@
<Borders>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
<Font ss:FontName="楷体" x:CharSet="134" x:Family="Modern" ss:Size="14"/>
<Font ss:FontName="Times New Roman" x:CharSet="134" x:Family="Modern" ss:Size="12" ss:Color="#FF0000"/>
</Style>
<Style ss:ID="s179">
<Alignment ss:Vertical="Bottom"/>
<Borders>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
<Font ss:FontName="Times New Roman" x:Family="Roman" ss:Size="12"
ss:Color="#FF0000"/>
<Font ss:FontName="Times New Roman" x:CharSet="134" x:Family="Modern" ss:Size="12" ss:Color="#FF0000"/>
</Style>
<Style ss:ID="s180">
<Alignment ss:Vertical="Bottom"/>
......@@ -3963,10 +3962,11 @@
<Row ss:AutoFitHeight="0" ss:Height="20">
<Cell ss:MergeDown="14" ss:StyleID="s166"><Data ss:Type="String">检测依据</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s167"><ss:Data ss:Type="String"
xmlns="http://www.w3.org/TR/REC-html40">
<Font html:Face="楷体" x:Family="Modern">${firstMethodName}</Font><Font> </Font></ss:Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s167">
<ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40">
<Font html:Face="楷体" x:Family="Modern">${firstMethodName}</Font>
<Font> </Font>
</ss:Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="4" ss:StyleID="s168"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="9" ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
......@@ -4052,9 +4052,16 @@
</Row>
</#if>
</#if>
<#--如果检测依据信息为空-->
<#--如果检测依据信息为空-->
<#if ! methodNames??>
<#list 1..(2-12) as i>
<Row ss:AutoFitHeight="0" ss:Height="20">
<Cell ss:Index="2" ss:MergeAcross="2" ss:StyleID="m2194692801716"><Data
ss:Type="String">以下空白</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="9" ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
</Row>
<#list 1..(2-14) as i>
<Row ss:AutoFitHeight="0" ss:Height="17.25">
<Cell ss:Index="2" ss:StyleID="s167"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s173"><NamedCell ss:Name="_FilterDatabase"/></Cell>
......@@ -4078,19 +4085,16 @@
</#if>
<#-- 仪器设备 9 -->
<#--插入第一个设备-->
<Row ss:AutoFitHeight="0" ss:Height="18" ss:StyleID="s173">
<Row ss:AutoFitHeight="0" ss:Height="18" >
<Cell ss:MergeDown="8" ss:StyleID="s187"><Data ss:Type="String">主要仪器设备(编号)</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s178">
<ss:Data ss:Type="String"
xmlns="http://www.w3.org/TR/REC-html40"> <Font html:Size="12">${firstEquipment}</Font><Font
html:Face="Times New Roman" x:Family="Roman" html:Size="12"> </Font></ss:Data>
<NamedCell
ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="4" ss:StyleID="s562"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="6" ss:StyleID="s185"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="8" ss:StyleID="s122"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s167">
<ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40">
<Font html:Face="楷体" x:Family="Modern">${firstEquipment}</Font>
<Font > </Font>
</ss:Data> <NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="4" ss:StyleID="s168"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="9" ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
</Row>
......@@ -4098,8 +4102,8 @@
<#--如果设备信息不为空-->
<#if equipmentNames??>
<#list equipmentNames as item>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:Index="2" ss:StyleID="s179">
<Row ss:AutoFitHeight="0" ss:Height="18" ss:StyleID="s173">
<Cell ss:Index="2" ss:StyleID="s167">
<ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40">
<Font html:Size="12">${item}</Font>
<Font html:Face="Times New Roman" x:Family="Roman" html:Size="12"> </Font>
......@@ -4142,11 +4146,29 @@
</#if>
<#--如果设备为空-->
<#if ! equipmentNames??>
<Row ss:AutoFitHeight="0" ss:Height="20">
<Cell ss:Index="2" ss:MergeAcross="2" ss:StyleID="m2194692801716"><Data
ss:Type="String">以下空白</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="9" ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
</Row>
<#list 1..(2-8) as i>
<Row ss:AutoFitHeight="0" ss:Height="18">
<Cell ss:Index="2" ss:StyleID="s179"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="4" ss:StyleID="s563"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="8" ss:StyleID="s122"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Row ss:AutoFitHeight="0" ss:Height="17.25">
<Cell ss:Index="2" ss:StyleID="s167"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s173"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s174"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s122"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s122"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s122"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s122"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="11" ss:StyleID="Default"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
<Cell ss:StyleID="s122"/>
......
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