Commit 8053c30b authored by 竹天卫's avatar 竹天卫

物化检测平台问题反馈带修改意见 2021.5.11反馈问题 已解决

检测报告中的  “以下空白” 艺术字 插入未解决
parent 30a90fb2
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId> <artifactId>spring-boot-starter-data-redis</artifactId>
...@@ -48,10 +49,6 @@ ...@@ -48,10 +49,6 @@
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok --> <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
......
...@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -748,7 +749,12 @@ public class EntrustController { ...@@ -748,7 +749,12 @@ public class EntrustController {
beanParams.put("userFax", entrustVo.getUserFax()==null?"":entrustVo.getUserFax()); beanParams.put("userFax", entrustVo.getUserFax()==null?"":entrustVo.getUserFax());
beanParams.put("projectName", entrustVo.getProjectName()==null?"":entrustVo.getProjectName()); beanParams.put("projectName", entrustVo.getProjectName()==null?"":entrustVo.getProjectName());
beanParams.put("sampleNum", entrustVo.getSampleNum()==null?"":entrustVo.getSampleNum()); beanParams.put("sampleNum", entrustVo.getSampleNum()==null?"":entrustVo.getSampleNum());
LocalDate entrustDate = entrustVo.getEntrustDate();
if(entrustVo.getEntrustDate() != null){
beanParams.put("year", String.valueOf(entrustVo.getEntrustDate().getYear()));
beanParams.put("month", String.valueOf(entrustVo.getEntrustDate().getMonthValue()));
beanParams.put("day", String.valueOf(entrustVo.getEntrustDate().getDayOfMonth()));
}
//获取委托单样品列表(不包含平行样) //获取委托单样品列表(不包含平行样)
List<SampleVo> sampleList = new ArrayList<>(entrustVo.getSampleList().size()); List<SampleVo> sampleList = new ArrayList<>(entrustVo.getSampleList().size());
entrustVo.getSampleList() entrustVo.getSampleList()
......
...@@ -18,6 +18,7 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -18,6 +18,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.csource.fastdfs.ClientGlobal;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
...@@ -27,9 +28,13 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -27,9 +28,13 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import sun.misc.BASE64Encoder;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
...@@ -121,6 +126,11 @@ public class ReportController { ...@@ -121,6 +126,11 @@ public class ReportController {
List<GrainReport> list6 = iEntrustService.getGrainList(entrustId); List<GrainReport> list6 = iEntrustService.getGrainList(entrustId);
beanParams.put("list6", list6); beanParams.put("list6", list6);
//todo 以下空白 显示excel艺术字形式
File file=new File("以下空白.jpg");
String headStr = "data:image/jpg;base64,";
beanParams.put("img1",headStr + getImageStr(file.getAbsolutePath()));
//事项-----不用处理 //事项-----不用处理
//品质-----不用处理 //品质-----不用处理
...@@ -129,6 +139,23 @@ public class ReportController { ...@@ -129,6 +139,23 @@ public class ReportController {
} }
//getImageStr方法如下(可以封装成单独的工具类)
private String getImageStr(String imgFile){
InputStream in = null;
byte[] data = null;
try {
in = new FileInputStream(imgFile);
data = new byte[in.available()];
in.read(data);
in.close();
} catch (IOException e) {
e.printStackTrace();
}
BASE64Encoder encoder = new BASE64Encoder();
return encoder.encode(data);
}
//检测依据 第一条记录 //检测依据 第一条记录
private String getFirstList(List<String> list) { private String getFirstList(List<String> list) {
if(list != null && list.size()>0){ if(list != null && list.size()>0){
......
...@@ -2,7 +2,9 @@ package cn.wise.sc.cement.business.entity; ...@@ -2,7 +2,9 @@ package cn.wise.sc.cement.business.entity;
import lombok.Data; import lombok.Data;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @description: 委托报告 * @description: 委托报告
...@@ -64,6 +66,8 @@ public class EntrustReport { ...@@ -64,6 +66,8 @@ public class EntrustReport {
*/ */
private String teamName; private String teamName;
private List<Team> teamList = new ArrayList<>();
/** /**
* 检测依据 ids * 检测依据 ids
*/ */
......
...@@ -365,7 +365,7 @@ public class CommonServiceImpl { ...@@ -365,7 +365,7 @@ public class CommonServiceImpl {
} }
//拼接的值的保留位数数据库 retain字段必须为null //拼接的值的保留位数数据库 retain字段必须为null
// 焦渣 塑性指数 辊磨 可磨 易磨性 工业分析 易烧性 // 焦渣 塑性指数 辊磨 可磨 易磨性 工业分析 易烧性 磨蚀性
/*else if(name.equals("St,ad")){ /*else if(name.equals("St,ad")){
......
...@@ -5115,7 +5115,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -5115,7 +5115,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
//缓存 60s //缓存 60s
if (!redisUtil.existsKey(teamKey)) { if (!redisUtil.existsKey(teamKey)) {
List<Team> teams = teamMapper.selectList(new QueryWrapper<>()); QueryWrapper<Team> teamQW = new QueryWrapper<>();
teamQW.eq("qualifications", 1 );
teamQW.orderByAsc("group_id","sort_no");
List<Team> teams = teamMapper.selectList(teamQW);
String value = JSON.toJSONString(teams); String value = JSON.toJSONString(teams);
redisUtil.setString(teamKey, value, 60); redisUtil.setString(teamKey, value, 60);
} }
...@@ -5127,31 +5130,55 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -5127,31 +5130,55 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
List<Team> teams = JSON.parseArray(redisUtil.getString(teamKey) + "", Team.class); List<Team> teams = JSON.parseArray(redisUtil.getString(teamKey) + "", Team.class);
List<Method> methods = JSON.parseArray(redisUtil.getString(methodKey) + "", Method.class); List<Method> methods = JSON.parseArray(redisUtil.getString(methodKey) + "", Method.class);
list.forEach(arg -> { list.forEach(arg -> {
// 检测项目应该与委托单对应 按照检测项本身顺序来
/*teams.forEach(opt -> {
String teamIds = arg.getTeamIds();
if(StringUtils.isNoneBlank(teamIds)){
String[] teamSplit = teamIds.split("、");
for (String idStr : teamSplit) {
int id = Integer.parseInt(idStr);
if (opt.getId() == id && 1 == opt.getQualifications()) {
String teamName = replaceSub(opt.getName());
if (StrUtil.isBlank(arg.getTeamName())) {
arg.setTeamName(teamName);
} else {
arg.setTeamName(arg.getTeamName() + "、" + teamName);
}
}
}
}
});*/
List<Team> teamList = new ArrayList<>();
String teamIds = arg.getTeamIds(); String teamIds = arg.getTeamIds();
if(StringUtils.isNoneBlank(teamIds)){ if(StringUtils.isNoneBlank(teamIds)){
String[] teamSplit = teamIds.split("、"); String[] teamSplit = teamIds.split("、");
// 检测项目应该与委托单对应 按照检测项本身顺序来
for (String idStr : teamSplit) { for (String idStr : teamSplit) {
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()); teamList.add(opt);
/*String teamName = replaceSub(opt.getName());
if (StrUtil.isBlank(arg.getTeamName())) { if (StrUtil.isBlank(arg.getTeamName())) {
arg.setTeamName(teamName); arg.setTeamName(teamName);
} else { } else {
arg.setTeamName(arg.getTeamName() + "、" + teamName); arg.setTeamName(arg.getTeamName() + "、" + teamName);
} }*/
} }
}); });
} }
} }
arg.setTeamList(teamList);
String methodNumbers = arg.getMethodNumbers(); String methodNumbers = arg.getMethodNumbers();
if(StringUtils.isNoneBlank(methodNumbers)){ if(StringUtils.isNoneBlank(methodNumbers)){
String[] methodSplit = methodNumbers.split("、"); String[] methodSplit = methodNumbers.split("、");
for (String idStr : methodSplit) { for (String idStr : methodSplit) {
// String id = Integer.parseInt(idStr) + ""; // String id = Integer.parseInt(idStr) + "";
//检测依据 如果标准号为空 不进行报告展示
methods.forEach(opt -> { methods.forEach(opt -> {
if (idStr.equals(opt.getNumber())) { if (idStr.equals(opt.getNumber()) && StrUtil.isNotBlank(opt.getStandard())) {
String standard = StringUtils.isNoneBlank(opt.getStandard())?opt.getStandard():""; String standard = StringUtils.isNoneBlank(opt.getStandard())?opt.getStandard():"";
if (StrUtil.isBlank(arg.getMethodName())) { if (StrUtil.isBlank(arg.getMethodName())) {
arg.setMethodName(standard+" " + opt.getName()); arg.setMethodName(standard+" " + opt.getName());
...@@ -5209,20 +5236,31 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -5209,20 +5236,31 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
List<String> JCList= new ArrayList<>(); List<String> JCList= new ArrayList<>();
List<String> TRList= new ArrayList<>(); List<String> TRList= new ArrayList<>();
List<String> ELSEList= new ArrayList<>(); List<String> ELSEList= new ArrayList<>();
List<Integer> teamIdList = new ArrayList<>();
List<Team> teamList = new ArrayList<>();
source.forEach(arg -> { source.forEach(arg -> {
if(arg.getEquipmentId() != null){ if(arg.getEquipmentId() != null){
equipmentIds.add(arg.getEquipmentId()); equipmentIds.add(arg.getEquipmentId());
} }
//获取使用的设备id view //获取使用的设备id view
//关联检测项目 //关联检测项目
if (StrUtil.isNotBlank(arg.getTeamName())) { if(arg.getTeamList() != null && arg.getTeamList().size()>0){
for(Team tt : arg.getTeamList()){
if(!teamIdList.contains(tt.getId())){
teamList.add(tt);
teamIdList.add(tt.getId());
}
}
}
/*if (StrUtil.isNotBlank(arg.getTeamName())) {
String[] teamSplits = arg.getTeamName().split("、"); String[] teamSplits = arg.getTeamName().split("、");
for (String teamName : teamSplits) { for (String teamName : teamSplits) {
if(!rts.getTeamNames().contains(teamName)){ if(!rts.getTeamNames().contains(teamName)){
rts.getTeamNames().add(teamName); rts.getTeamNames().add(teamName);
} }
} }
} }*/
//关联检测依据 //关联检测依据
if (StrUtil.isNotBlank(arg.getMethodName())) { if (StrUtil.isNotBlank(arg.getMethodName())) {
String[] methodSplits = arg.getMethodName().split("~~~、"); String[] methodSplits = arg.getMethodName().split("~~~、");
...@@ -5249,6 +5287,17 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -5249,6 +5287,17 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
} }
}); });
//检测项顺序
List<Team> teamListAsc = teamList.stream().sorted(Comparator.comparing(Team::getGroupId).thenComparing(Team::getSortNo)).collect(Collectors.toList());
teamListAsc.forEach(opt -> {
String teamName = replaceSub(opt.getName());
if(!rts.getTeamNames().contains(teamName)){
rts.getTeamNames().add(teamName);
}
});
//检测依据顺序
GBList.addAll(JCList); GBList.addAll(JCList);
GBList.addAll(TRList); GBList.addAll(TRList);
GBList.addAll(ELSEList); GBList.addAll(ELSEList);
...@@ -5516,9 +5565,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -5516,9 +5565,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
//磨蚀性结果拆分 //磨蚀性结果拆分
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(); 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) && fsxLastResult.contains("=")){ if(StringUtils.isNotBlank(fsxLastResult)){
Map<String,String> fsxMap = splitLastResult(fsxLastResult); if(fsxLastResult.contains("=")){
report.setAi(fsxMap==null || org.springframework.util.StringUtils.isEmpty(fsxMap.get("Ai(g)")) ?"—":fsxMap.get("Ai(g)")); 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(fsxLastResult);
}
}else{ }else{
report.setAi("—"); report.setAi("—");
} }
......
...@@ -2776,7 +2776,7 @@ ...@@ -2776,7 +2776,7 @@
<w:sz-cs <w:sz-cs
w:val="21"/> w:val="21"/>
</w:rPr> </w:rPr>
<w:t></w:t> <w:t>${year}</w:t>
</w:r> </w:r>
<w:r wsp:rsidRPr="003B3488"> <w:r wsp:rsidRPr="003B3488">
<w:rPr> <w:rPr>
...@@ -2806,7 +2806,7 @@ ...@@ -2806,7 +2806,7 @@
<w:sz-cs <w:sz-cs
w:val="21"/> w:val="21"/>
</w:rPr> </w:rPr>
<w:t></w:t> <w:t>${month}</w:t>
</w:r> </w:r>
<w:r wsp:rsidR="00FF4A3A"> <w:r wsp:rsidR="00FF4A3A">
<w:rPr> <w:rPr>
...@@ -2829,7 +2829,7 @@ ...@@ -2829,7 +2829,7 @@
<w:sz-cs <w:sz-cs
w:val="21"/> w:val="21"/>
</w:rPr> </w:rPr>
<w:t></w:t> <w:t>${day}</w:t>
</w:r> </w:r>
</w:p> </w:p>
</w:tc> </w:tc>
...@@ -2972,7 +2972,7 @@ ...@@ -2972,7 +2972,7 @@
<w:sz-cs <w:sz-cs
w:val="21"/> w:val="21"/>
</w:rPr> </w:rPr>
<w:t></w:t> <w:t>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</w:t>
</w:r> </w:r>
<w:r wsp:rsidRPr="003B3488"> <w:r wsp:rsidRPr="003B3488">
<w:rPr> <w:rPr>
...@@ -2995,7 +2995,7 @@ ...@@ -2995,7 +2995,7 @@
<w:sz-cs <w:sz-cs
w:val="21"/> w:val="21"/>
</w:rPr> </w:rPr>
<w:t></w:t> <w:t>&#160;&#160;&#160;&#160;</w:t>
</w:r> </w:r>
<w:r wsp:rsidRPr="003B3488"> <w:r wsp:rsidRPr="003B3488">
<w:rPr> <w:rPr>
...@@ -3025,7 +3025,7 @@ ...@@ -3025,7 +3025,7 @@
<w:sz-cs <w:sz-cs
w:val="21"/> w:val="21"/>
</w:rPr> </w:rPr>
<w:t></w:t> <w:t>&#160;&#160;&#160;&#160;</w:t>
</w:r> </w:r>
</w:p> </w:p>
</w:tc> </w:tc>
......
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