|
|
|
|
@ -13,11 +13,14 @@ import org.checkerframework.checker.units.qual.A; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.lims.entry.*; |
|
|
|
|
import org.springblade.lims.excel.ExamineTemplate2Excel; |
|
|
|
|
import org.springblade.lims.excel.PCRExcel; |
|
|
|
|
import org.springblade.lims.mapper.EntrustMapper; |
|
|
|
|
import org.springblade.lims.service.*; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.resource.enums.SysTypeEnum; |
|
|
|
|
import org.springblade.resource.feign.IMessageClient; |
|
|
|
|
import org.springblade.system.cache.DictBizCache; |
|
|
|
|
import org.springblade.system.enums.DictBizEnum; |
|
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
|
@ -28,10 +31,7 @@ import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
|
import java.io.FileOutputStream; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.io.InputStream; |
|
|
|
|
import java.io.*; |
|
|
|
|
import java.net.HttpURLConnection; |
|
|
|
|
import java.net.URL; |
|
|
|
|
import java.text.DecimalFormat; |
|
|
|
|
@ -101,6 +101,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
@Value("${BLSreportPrint}") |
|
|
|
|
private String BLSreportPrint; |
|
|
|
|
|
|
|
|
|
@Value("${PCRreportPrint}") |
|
|
|
|
private String PCRreportPrint; |
|
|
|
|
|
|
|
|
|
@Value("${LDanreportPrint}") |
|
|
|
|
private String LDanreportPrint; |
|
|
|
|
|
|
|
|
|
@ -165,11 +168,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
List<SimpleRel> rels = new ArrayList<>(); |
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
int year = now.getYear(); |
|
|
|
|
String month1 = ""; |
|
|
|
|
String month1; |
|
|
|
|
int month = now.getMonthValue(); |
|
|
|
|
String day1 = ""; |
|
|
|
|
String day1; |
|
|
|
|
int day = now.getDayOfMonth(); |
|
|
|
|
String hour1 = ""; |
|
|
|
|
String hour1; |
|
|
|
|
int hour = now.getHour(); |
|
|
|
|
|
|
|
|
|
if (month < 10) { |
|
|
|
|
@ -363,16 +366,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
// position1
|
|
|
|
|
if ("1".equals(entrust.getInvestigativeType())) { |
|
|
|
|
result.put("investigativeType", "委托"); |
|
|
|
|
} |
|
|
|
|
if ("2".equals(entrust.getInvestigativeType())) { |
|
|
|
|
result.put("investigativeType", "监督"); |
|
|
|
|
} |
|
|
|
|
if ("3".equals(entrust.getInvestigativeType())) { |
|
|
|
|
result.put("investigativeType", "仲裁"); |
|
|
|
|
} |
|
|
|
|
String value = DictBizCache.getValue(DictBizEnum.ENTRUST_INVESTIGATIVE_TYPE, entrust.getInvestigativeType()); |
|
|
|
|
result.put("investigativeType", value); |
|
|
|
|
result.put("acceptanceNum", entrust.getAcceptanceNum()); |
|
|
|
|
result.put("entrustCustomerName", entrust.getEntrustCustomerName()); |
|
|
|
|
result.put("submittedBy", entrust.getSubmittedBy()); |
|
|
|
|
@ -381,19 +376,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
result.put("facsimile", entrust.getFacsimile()); |
|
|
|
|
result.put("phone", entrust.getPhone()); |
|
|
|
|
result.put("simpleSource", entrust.getSimpleSource()); |
|
|
|
|
// position1
|
|
|
|
|
if ("0".equals(entrust.getReportSendType())) { |
|
|
|
|
result.put("reportSendType", "自取"); |
|
|
|
|
} |
|
|
|
|
if ("1".equals(entrust.getReportSendType())) { |
|
|
|
|
result.put("reportSendType", "传真"); |
|
|
|
|
} |
|
|
|
|
if ("2".equals(entrust.getReportSendType())) { |
|
|
|
|
result.put("reportSendType", "邮寄"); |
|
|
|
|
} |
|
|
|
|
if ("3".equals(entrust.getReportSendType())) { |
|
|
|
|
result.put("reportSendType", "其它"); |
|
|
|
|
} |
|
|
|
|
String value1 = DictBizCache.getValue(DictBizEnum.ENTRUST_REPORT_SEND_TYPE, entrust.getReportSendType()); |
|
|
|
|
result.put("reportSendType", value1); |
|
|
|
|
result.put("simpleTransRequire", entrust.getSimpleTransRequire()); |
|
|
|
|
result.put("simpleState", entrust.getSimpleState()); |
|
|
|
|
result.put("simpleName", entrust.getSimpleName()); |
|
|
|
|
@ -585,19 +569,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
result.put("acceptanceNum", entrust.getAcceptanceNum()); |
|
|
|
|
result.put("simpleName", entrust.getSimpleName()); |
|
|
|
|
result.put("entrustCustomerName", entrust.getEntrustCustomerName()); |
|
|
|
|
// position1
|
|
|
|
|
if ("1".equals(entrust.getInvestigativeType())) { |
|
|
|
|
result.put("investigativeType", "委托"); |
|
|
|
|
} |
|
|
|
|
if ("2".equals(entrust.getInvestigativeType())) { |
|
|
|
|
result.put("investigativeType", "监督"); |
|
|
|
|
} |
|
|
|
|
if ("3".equals(entrust.getInvestigativeType())) { |
|
|
|
|
result.put("investigativeType", "仲裁"); |
|
|
|
|
} |
|
|
|
|
if ("4".equals(entrust.getInvestigativeType())) { |
|
|
|
|
result.put("investigativeType", "兽医门诊"); |
|
|
|
|
} |
|
|
|
|
String value = DictBizCache.getValue(DictBizEnum.ENTRUST_INVESTIGATIVE_TYPE, entrust.getInvestigativeType()); |
|
|
|
|
result.put("investigativeType", value); |
|
|
|
|
result.put("mailAddr", entrust.getMailAddr()); |
|
|
|
|
result.put("postalCode", entrust.getPostalCode()); |
|
|
|
|
result.put("phone", entrust.getPhone()); |
|
|
|
|
@ -719,16 +692,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
instrumentName += s2 + ","; |
|
|
|
|
} |
|
|
|
|
result.put("9", instrumentName); |
|
|
|
|
// position1
|
|
|
|
|
if ("0".equals(examineResult.getSimpleStatus())) { |
|
|
|
|
result.put("10", "状态一"); |
|
|
|
|
} |
|
|
|
|
if ("1".equals(examineResult.getSimpleStatus())) { |
|
|
|
|
result.put("10", "状态二"); |
|
|
|
|
} |
|
|
|
|
if ("2".equals(examineResult.getSimpleStatus())) { |
|
|
|
|
result.put("10", "状态三"); |
|
|
|
|
} |
|
|
|
|
String value = DictBizCache.getValue(DictBizEnum.SIMPLE_STATUS, examineResult.getSimpleStatus()); |
|
|
|
|
result.put("10", value); |
|
|
|
|
result.put("11", "温度" + examineResult.getTemperature() + "℃; " + "湿度" + examineResult.getHumidity() + "%RH"); |
|
|
|
|
result.put("12", examineWay.getOperation()); |
|
|
|
|
if (examineBasis != null) { |
|
|
|
|
@ -743,7 +708,16 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
farView.setWidth(90);//设置宽度
|
|
|
|
|
farView.setType(ImageEntity.Data);//类型
|
|
|
|
|
// farView.setData(getFileStream("http://192.168.1.5:81/static/jianming.PNG"));
|
|
|
|
|
farView.setData(getFileStream(path + user.getElectronicSignature())); |
|
|
|
|
String s1 = path + user.getElectronicSignature(); |
|
|
|
|
System.out.println(s1); |
|
|
|
|
FileInputStream fis = null; |
|
|
|
|
try { |
|
|
|
|
fis = new FileInputStream(new File(s1)); |
|
|
|
|
byte[] bytes = readInputStream(fis); |
|
|
|
|
farView.setData(bytes); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
result.put("14", farView); |
|
|
|
|
} |
|
|
|
|
// 校核人
|
|
|
|
|
@ -753,11 +727,20 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
farView1.setHeight(50);//设置高度
|
|
|
|
|
farView1.setWidth(90);//设置宽度
|
|
|
|
|
farView1.setType(ImageEntity.Data);//类型
|
|
|
|
|
farView1.setData(getFileStream(path + user1.getElectronicSignature())); |
|
|
|
|
|
|
|
|
|
String s1 = path + user1.getElectronicSignature(); |
|
|
|
|
System.out.println(s1); |
|
|
|
|
FileInputStream fis = null; |
|
|
|
|
try { |
|
|
|
|
fis = new FileInputStream(new File(s1)); |
|
|
|
|
byte[] bytes = readInputStream(fis); |
|
|
|
|
farView1.setData(bytes); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
result.put("15", farView1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果是布鲁氏检测
|
|
|
|
|
// position1
|
|
|
|
|
if ("2".equals(byId.getInputMode())) { |
|
|
|
|
@ -792,6 +775,43 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
url = BLSreportPrint; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// PCR检测
|
|
|
|
|
else if ("4".equals(byId.getInputMode())) { |
|
|
|
|
List<PCRExcel> list = JSON.parseArray(examineResult.getExamineDataArr(), PCRExcel.class); |
|
|
|
|
if (list.size() > 0) { |
|
|
|
|
if (list.size() % 2 == 0) { |
|
|
|
|
for (int i = 0; i < list.size() / 2; i++) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("num1", list.get(i).getExperieNum()); |
|
|
|
|
map.put("value1", list.get(i).getCtValue()); |
|
|
|
|
map.put("result1", list.get(i).getValue()); |
|
|
|
|
map.put("num2", list.get(list.size() / 2 + i).getExperieNum()); |
|
|
|
|
map.put("value2", list.get(list.size() / 2 + i).getCtValue()); |
|
|
|
|
map.put("result2", list.get(list.size() / 2 + i).getValue()); |
|
|
|
|
resultList1.add(map); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
for (int i = 0; i < list.size() / 2 + 1; i++) { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
map.put("num1", list.get(i).getExperieNum()); |
|
|
|
|
map.put("value1", list.get(i).getCtValue()); |
|
|
|
|
map.put("result1", list.get(i).getValue()); |
|
|
|
|
if (i < list.size() / 2) { |
|
|
|
|
map.put("num2", list.get(list.size() / 2 + i + 1).getExperieNum()); |
|
|
|
|
map.put("value2", list.get(list.size() / 2 + i + 1).getCtValue()); |
|
|
|
|
map.put("result2", list.get(list.size() / 2 + i + 1).getValue()); |
|
|
|
|
} |
|
|
|
|
resultList1.add(map); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (examineResult.getPicturePath() != null && !"".equals(examineResult.getPicturePath())) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
result.put("list", resultList1); |
|
|
|
|
url = PCRreportPrint; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 普通和口蹄疫检测
|
|
|
|
|
else { |
|
|
|
|
DecimalFormat df = new DecimalFormat("#0.000"); |
|
|
|
|
@ -1666,7 +1686,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
} else { |
|
|
|
|
result.put("isFlow", "□是 ☑否"); |
|
|
|
|
} |
|
|
|
|
if (!"".equals(eTask.getFlowTo()) && eTask.getFlowTo() != null) { |
|
|
|
|
if (eTask.getFlowTo() != null) { |
|
|
|
|
String flowTo = sysClient.getDeptName(eTask.getFlowTo()).getData(); |
|
|
|
|
result.put("flowTo", flowTo); |
|
|
|
|
} else { |
|
|
|
|
@ -1908,6 +1928,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 根据网络图片URL转成字节数组(弃用)
|
|
|
|
|
private static byte[] getFileStream(String url) { |
|
|
|
|
try { |
|
|
|
|
URL httpUrl = new URL(url); |
|
|
|
|
|