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

1111

parent 8afae9c0
......@@ -7,7 +7,9 @@ import cn.wise.sc.cement.business.entity.EntityEnclosure;
import cn.wise.sc.cement.business.model.*;
import cn.wise.sc.cement.business.enumation.FileExt;
import cn.wise.sc.cement.business.model.query.SampleHandleEnclosureQuery;
import cn.wise.sc.cement.business.model.vo.CraftReport;
import cn.wise.sc.cement.business.model.vo.EntrustVo;
import cn.wise.sc.cement.business.model.vo.IndustrialReport;
import cn.wise.sc.cement.business.model.vo.TenElementReport;
import cn.wise.sc.cement.business.service.IEntityEnclosureService;
import cn.wise.sc.cement.business.service.IEntrustService;
......@@ -104,19 +106,26 @@ public class ReportController {
//十元素1导出
List<TenElementReport> list1 = iEntrustService.getTen1List(entrustId);
beanParams.put("list1", list1);
//工艺性能
//物理性能
//颗粒分析
//十元素2导出
List<TenElementReport> list2 = iEntrustService.getTen2List(entrustId);
beanParams.put("list2", list2);
//煤的工业分析
List<IndustrialReport> list3 = iEntrustService.getIndustrialList(entrustId);
beanParams.put("list3", list3);
//工艺性能
List<CraftReport> list4 = iEntrustService.getCraftList(entrustId);
beanParams.put("list4", list4);
//物理性能
//颗粒分析
//事项-----不用处理
//十元素2导出
List<TenElementReport> list2 = iEntrustService.getTen2List(entrustId);
beanParams.put("list2", list2);
//品质-----不用处理
WordUtil.writeWordReport(rts.getProjectName() + "(报告)", "report_new.ftl",
......
package cn.wise.sc.cement.business.mapper;
import cn.wise.sc.cement.business.entity.SampleCheck;
import cn.wise.sc.cement.business.model.IndustrialReport;
import cn.wise.sc.cement.business.model.vo.IndustrialReport;
import cn.wise.sc.cement.business.model.ElementReport;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
......
......@@ -18,7 +18,7 @@
group by s.id, sdc.id,t.name
</select>
<select id="getSampleIndustrialCheck" resultType="cn.wise.sc.cement.business.model.IndustrialReport">
<select id="getSampleIndustrialCheck" resultType="cn.wise.sc.cement.business.model.vo.IndustrialReport">
SELECT * FROM (SELECT count_results,entrust_id,team_group_name,sct.sample_id FROM sample_check sc
LEFT JOIN
(SELECT check_id,sample_id FROM sample_check_team) sct
......
......@@ -7,7 +7,7 @@ package cn.wise.sc.cement.business.model;
**/
public enum ElementKey {
//十元素key
//十元素1&十元素2 key
LOI("L.O.I"),
SiO2("SiO<sub>2</sub>"),
Al2O3AndTiO2("Al<sub>2</sub>O<sub>3</sub>+TiO<sub>2</sub>"),
......@@ -26,7 +26,19 @@ public enum ElementKey {
//煤的工业分析key
Gyfx("工业分析"),
Stad("St,ad"),
Km("可磨")
Km("可磨"), //煤的工业分析&工艺性能 共用key
//工艺性能key
Ymx("易磨性"),
Fsx("磨蚀性"),
Gm("辊磨"),
//易烧性 直接取游离钙的结果
FCaO1350("fCaO 1350"),
FCaO1400("fCaO 1400"),
FCaO1450("fCaO 1450")
;
private String key;
......
package cn.wise.sc.cement.business.model;
/**
* @description: 工业特性key
* @author: qh
* @create: 2020-10-16 14:33
**/
public enum IndustrialElementKey {
//工业特性
Mad("Mad"),
Aad("Aad"),
Vad("Vad"),
QnetAdMJkg("Qnet,ad(MJ/kg)"),
JZ("焦渣"),
StAd("St,ad");
private String key;
IndustrialElementKey(String key) {
this.key = key;
}
public String getKey() {
return key;
}
}
package cn.wise.sc.cement.business.model.vo;
import cn.wise.sc.cement.business.model.ElementReport;
import lombok.Data;
import java.io.Serializable;
/**
* @description: 工艺性能报告
* @author: ztw
* @create: 2021-3-19
**/
@Data
public class CraftReport extends ElementReport implements Serializable {
private static final long serialVersionUID = 42L;
//下面是工艺性能析检测项
private String mjt ="";
private String kwht ="";
private String ai ="";
private String hgi ="";
private String cyl ="";
private String tmf ="";
private String twf ="";
private String fcao1350 ="";
private String fcao1400 ="";
private String fcao1450 ="";
}
package cn.wise.sc.cement.business.model;
package cn.wise.sc.cement.business.model.vo;
import cn.wise.sc.cement.business.model.ElementReport;
import lombok.Data;
import java.io.Serializable;
/**
* @description: 煤的工业分析报告
* @author: qh
* @author: ztw
* @create: 2021-3-19
**/
@Data
......
......@@ -144,6 +144,8 @@ public interface IEntrustService extends IService<Entrust> {
List<IndustrialReport> getIndustrialList(Integer entrustId);
List<CraftReport> getCraftList(Integer entrustId);
//质量管理
BaseResponse<IPage<EntrustVo>> getQualityPage(PageQuery pageQuery,
......
......@@ -3,7 +3,6 @@ package cn.wise.sc.cement.business.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.wise.sc.cement.business.entity.*;
import cn.wise.sc.cement.business.mapper.*;
import cn.wise.sc.cement.business.model.*;
......@@ -5069,9 +5068,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
IndustrialReport report = new IndustrialReport();
BeanUtils.copyProperties(first, report);
Map<String,ElementReport> reportMap = entry.getValue().stream().collect(Collectors.toMap(ElementReport::getTeamName, item -> item));
//工业分析结果拆分
String gyfxLastResult = reportMap.get(ElementKey.Gyfx.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Gyfx.getKey()).getLastResult())?"":reportMap.get(ElementKey.Gyfx.getKey()).getLastResult();
if(StringUtils.isNotBlank(gyfxLastResult)){
Map<String,String> gyfxMap = getGyfxLastResult(gyfxLastResult);
Map<String,String> gyfxMap = splitLastResult(gyfxLastResult);
report.setMad(gyfxMap==null || org.springframework.util.StringUtils.isEmpty(gyfxMap.get("Mad")) ?"—":gyfxMap.get("Mad"));
report.setAad(gyfxMap==null || org.springframework.util.StringUtils.isEmpty(gyfxMap.get("Aad")) ?"—":gyfxMap.get("Aad"));
report.setVad(gyfxMap==null || org.springframework.util.StringUtils.isEmpty(gyfxMap.get("Vad")) ?"—":gyfxMap.get("Vad"));
......@@ -5086,8 +5086,18 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
report.setStad(reportMap.get(ElementKey.Stad.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Stad.getKey()).getLastResult()) ?"—":reportMap.get(ElementKey.Stad.getKey()).getLastResult());
report.setClad("—");
//可磨性结果拆分
String kmLastResult = reportMap.get(ElementKey.Km.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Km.getKey()).getLastResult())?"":reportMap.get(ElementKey.Km.getKey()).getLastResult();
if(StringUtils.isNotBlank(kmLastResult)){
Map<String,String> kmMap = splitLastResult(kmLastResult);
report.setHgi(kmMap==null || org.springframework.util.StringUtils.isEmpty(kmMap.get("HGI")) ?"—":kmMap.get("HGI"));
report.setCyl(kmMap==null || org.springframework.util.StringUtils.isEmpty(kmMap.get("出样率(%)")) ?"—":kmMap.get("出样率(%)"));
}else{
report.setHgi("—");
report.setCyl("—");
}
newList.add(report);
}
//将样品重量换算成kg
......@@ -5107,8 +5117,110 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
list.add("可磨");
return sampleCheckMapper.getSampleElementCheck(entrustId, list);
}
//工业分析检测项最终结果拆分显示
private Map<String,String> getGyfxLastResult(String lastResult){
/**
* 获取煤的工艺性能的检测信息
* @param entrustId 委托id
* @return
*/
@Override
public List<CraftReport> getCraftList(Integer entrustId) {
List<CraftReport> newList = null;
List<ElementReport> list = getSampleCraftElementCheck(entrustId);
if(list != null && list.size() > 0){
newList = new ArrayList<>();
}
Map<Integer, List<ElementReport>> groupBySample = list.stream().collect(Collectors.groupingBy(ElementReport::getId, Collectors.toList()));
for(Map.Entry<Integer,List<ElementReport>> entry : groupBySample.entrySet()){
ElementReport first = entry.getValue().get(0);
CraftReport report = new CraftReport();
BeanUtils.copyProperties(first, report);
Map<String,ElementReport> reportMap = entry.getValue().stream().collect(Collectors.toMap(ElementReport::getTeamName, item -> item));
//易磨性结果拆分
String ymxLastResult = reportMap.get(ElementKey.Ymx.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Ymx.getKey()).getLastResult())?"":reportMap.get(ElementKey.Ymx.getKey()).getLastResult();
if(StringUtils.isNotBlank(ymxLastResult)){
Map<String,String> ymxMap = splitLastResult(ymxLastResult);
report.setMjt(ymxMap==null || org.springframework.util.StringUtils.isEmpty(ymxMap.get("易磨性(MJ/t)")) ?"—":ymxMap.get("易磨性(MJ/t)"));
report.setKwht(ymxMap==null || org.springframework.util.StringUtils.isEmpty(ymxMap.get("易磨性值")) ?"—":ymxMap.get("易磨性值"));
}else{
report.setMjt("—");
report.setKwht("—");
}
//磨蚀性结果拆分
String fsxLastResult = reportMap.get(ElementKey.Fsx.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Fsx.getKey()).getLastResult())?"":reportMap.get(ElementKey.Fsx.getKey()).getLastResult();
if(StringUtils.isNotBlank(fsxLastResult)){
Map<String,String> fsxMap = splitLastResult(fsxLastResult);
report.setAi(fsxMap==null || org.springframework.util.StringUtils.isEmpty(fsxMap.get("Ai(g)")) ?"—":fsxMap.get("Ai(g)"));
}else{
report.setAi("—");
}
//可磨性结果拆分
String kmLastResult = reportMap.get(ElementKey.Km.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Km.getKey()).getLastResult())?"":reportMap.get(ElementKey.Km.getKey()).getLastResult();
if(StringUtils.isNotBlank(kmLastResult)){
Map<String,String> kmMap = splitLastResult(kmLastResult);
report.setHgi(kmMap==null || org.springframework.util.StringUtils.isEmpty(kmMap.get("HGI")) ?"—":kmMap.get("HGI"));
report.setCyl(kmMap==null || org.springframework.util.StringUtils.isEmpty(kmMap.get("出样率(%)")) ?"—":kmMap.get("出样率(%)"));
}else{
report.setHgi("—");
report.setCyl("—");
}
//辊磨结果拆分
String gmLastResult = reportMap.get(ElementKey.Gm.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Gm.getKey()).getLastResult())?"":reportMap.get(ElementKey.Gm.getKey()).getLastResult();
if(StringUtils.isNotBlank(gmLastResult)){
Map<String,String> gmMap = splitLastResult(gmLastResult);
report.setTmf(gmMap==null || org.springframework.util.StringUtils.isEmpty(gmMap.get("TMF")) ?"—":gmMap.get("TMF"));
report.setTwf(gmMap==null || org.springframework.util.StringUtils.isEmpty(gmMap.get("TWF(kg/t)")) ?"—":gmMap.get("TWF(kg/t)"));
}else{
report.setTmf("—");
report.setTwf("—");
}
//易烧性结果 不用拆分 直接取游离钙结果
report.setFcao1350(reportMap.get(ElementKey.FCaO1350.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.FCaO1350.getKey()).getLastResult()) ?"—":reportMap.get(ElementKey.FCaO1350.getKey()).getLastResult());
report.setFcao1400(reportMap.get(ElementKey.FCaO1400.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.FCaO1400.getKey()).getLastResult()) ?"—":reportMap.get(ElementKey.FCaO1400.getKey()).getLastResult());
report.setFcao1450(reportMap.get(ElementKey.FCaO1450.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.FCaO1450.getKey()).getLastResult()) ?"—":reportMap.get(ElementKey.FCaO1450.getKey()).getLastResult());
newList.add(report);
}
//将样品重量换算成kg
if(newList != null){
newList.stream().forEach(arg ->{
arg.setWeight(Sample.weight2Kg(arg.getWeight(), arg.getWeightType()));
});
}
return newList;
}
//获取工艺性能的检测项检测信息
private List<ElementReport> getSampleCraftElementCheck(Integer entrustId) {
Set<String> list = new HashSet<>(7);
list.add("易磨性");
list.add("磨蚀性");
list.add("可磨");
list.add("辊磨");
list.add("fCaO 1350");
list.add("fCaO 1400");
list.add("fCaO 1450");
return sampleCheckMapper.getSampleElementCheck(entrustId, list);
}
/**
* 特殊处理的检测项最终结果拆分显示
* @param lastResult
* @return
*/
private Map<String,String> splitLastResult(String lastResult){
Map<String,String> map = new HashMap<>();
if(StringUtils.isNotBlank(lastResult)){
String[] str = lastResult.split("\n");
......@@ -5127,6 +5239,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
//***********************************质量控制************************************
/**
* 质量检测分页列表
......
server:
port: 7005
port: 7007
#-Dspring.config.location=D:\idea_workspases\tianjin-cement\cement-business\src\main\resources\application.yml
spring:
......
......@@ -4416,8 +4416,7 @@
ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s259"/>
</Row>
<!-- 别表结束 -->
</#list>
<!-- </#list> -->
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s223">
<Cell ss:MergeAcross="15" ss:StyleID="m1898254380784"><Data ss:Type="String">以下空白</Data><NamedCell
......@@ -4729,7 +4728,7 @@
<Cell ss:StyleID="s289"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s289"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s290" ss:Formula="=首页!R[-2]C[-11]"><Data ss:Type="String">2</Data><NamedCell
<Cell ss:StyleID="s290" ss:Formula="=首页!R[-2]C[-11]"><Data ss:Type="String">9</Data><NamedCell
ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s291"><Data ss:Type="String">第3页 </Data><NamedCell
ss:Name="Print_Area"/></Cell>
......@@ -6019,7 +6018,7 @@
</Row>
<!-- 煤工业分析 13行 -->
<#--如果list1不为空-->
<#--如果list3不为空-->
<#if list3??>
<!-- <#list list3 as item3> -->
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s400">
......@@ -6417,34 +6416,70 @@
<Cell ss:StyleID="s234"><Data ss:Type="String">MnO</Data><NamedCell
ss:Name="Print_Area"/></Cell>
</Row>
<!-- 十元素2 14 -->
<#list list2 as item>
<!-- 十元素2 14行 -->
<#--如果list2不为空-->
<#if list2??>
<!--<#list list2 as item2>-->
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s225">
<Cell ss:StyleID="s263"><Data ss:Type="String">${item2.sampleName}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item2.sampleForm}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item2.sampleCode}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item2.weight}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item2.cementCode}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.loi}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.sio2}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.al2o3}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.fe2o3}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.cao}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.mgo}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.tio2}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.k2o}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.na2o}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.so3}</Data></Cell>
<Cell ss:StyleID="s265"><Data ss:Type="String">${item2.cl}</Data></Cell>
<Cell ss:StyleID="s248"><Data ss:Type="String">${item2.mno}</Data></Cell>
</Row>
<!-- </#list> -->
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s223">
<Cell ss:MergeAcross="16" ss:StyleID="m1896304848688"><Data ss:Type="String">以下空白</Data><NamedCell
ss:Name="Print_Area"/></Cell>
</Row>
<#if list2?size lte 13>
<#list 1..(list2?size+1 - 13) as i>
<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.sampleForm}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.sampleCode}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.weight}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.cementCode}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.loi}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.sio2}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.al2o3}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.fe2o3}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.cao}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.mgo}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.tio2}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.k2o}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.na2o}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.so3}</Data></Cell>
<Cell ss:StyleID="s265"><Data ss:Type="String">${item.cl}</Data></Cell>
<Cell ss:StyleID="s248"><Data ss:Type="String">${item.mno}</Data></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s265"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s248"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s256"/>
</Row>
</#list>
</#if>
</#if>
<#--如果list2空-->
<#if ! list2??>
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s223">
<Cell ss:MergeAcross="16" ss:StyleID="m1896304848688"><Data ss:Type="String">以下空白</Data><NamedCell
ss:Name="Print_Area"/></Cell>
</Row>
<!-- 六元素2end -->
<#if list2??>
<#list 1..13 as i>
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s225">
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
......
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