2022年8月29日22:31:59

dev
litao 3 years ago
parent 3bbea6b234
commit f1ea91a902
  1. 99
      lab-ops-api/lab-resource-api/src/main/java/org/springblade/resource/entity/MessageTemplate.java
  2. 21
      lab-ops/lab-resource/src/main/java/org/springblade/resource/controller/MessageTemplateController.java
  3. 21
      lab-ops/lab-resource/src/main/java/org/springblade/resource/mapper/MessageTemplateMapper.java
  4. 20
      lab-ops/lab-resource/src/main/java/org/springblade/resource/service/IMessageTemplateService.java
  5. 31
      lab-ops/lab-resource/src/main/java/org/springblade/resource/service/impl/MessageTemplateServiceImpl.java
  6. 46
      lab-service-api/lab-dict-api/src/main/java/org/springblade/system/enums/DictBizEnum.java
  7. 3
      lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/ExamineResult.java
  8. 10
      lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/ExamineWay.java
  9. 1
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/EntrustController.java
  10. 110
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineResultController.java
  11. 26
      lab-service/lab-lims/src/main/java/org/springblade/lims/excel/PCRExcel.java
  12. 1
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/IEntrtrustService.java
  13. 2
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/IExamineResultService.java
  14. 135
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/EntrustServiceImpl.java
  15. 67
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineResultServiceImpl.java
  16. 49
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/TaskBlueprintServiceImpl.java

@ -0,0 +1,99 @@
package org.springblade.resource.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* 消息表实体类
*/
@Data
@TableName("blade_message_template")
@ApiModel(value = "Message对象", description = "消息表")
public class MessageTemplate implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 系统类型
*/
@ApiModelProperty(value = "系统类型:1:系统预警 2:通知 3弹窗")
private Integer systemType;
/**
* 系统类型
*/
@ApiModelProperty(value = "系统类型:1:系统预警 2:通知 3弹窗")
private String tenantId;
/**
* 消息标题
*/
@ApiModelProperty(value = "消息标题")
private String title;
/**
* 内容
*/
@ApiModelProperty(value = "内容")
private String content;
/**
* 等级
*/
@ApiModelProperty(value = "等级 1:一般,2紧急")
private Integer level;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
private Date createTime;
/**
* 消息发布人
*/
@ApiModelProperty(value = "消息发布人")
private Long createUser;
/**
* 是否已读01
*/
@ApiModelProperty(value = "是否已读(0:否,1:是)")
private Integer isRead;
/**
* 执行方法(com.***.method)
*/
@ApiModelProperty(value = "1弹窗 2消息")
private Integer method;
/**
* 消息类型(1:保修单 2维修单3保养计划4资产管理5lims)
*/
@ApiModelProperty(value = "消息类型(1:保修单 ,2:维修单,3保养计划,4:资产管理,5:lims ,6:通知)")
private Integer mesageType;
/**
* 消息通知人
*/
@ApiModelProperty(value = "消息通知人")
private String massageUser;
// 跳转路径
private String routerPath;
}

@ -0,0 +1,21 @@
package org.springblade.resource.controller;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springframework.web.bind.annotation.*;
/**
* 消息表 控制器
* @author bladeX
* @since 2021-10-19
*/
@RestController
@AllArgsConstructor
@RequestMapping("/message")
@Api(value = "消息表", tags = "消息表接口")
public class MessageTemplateController extends BladeController {
}

@ -0,0 +1,21 @@
package org.springblade.resource.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.resource.entity.Message;
import org.springblade.resource.entity.MessageTemplate;
import org.springblade.resource.vo.MessageVO;
import java.util.List;
/**
* 消息表 Mapper 接口
*
* @author bladeX
* @since 2021-10-19
*/
public interface MessageTemplateMapper extends BaseMapper<MessageTemplate> {
}

@ -0,0 +1,20 @@
package org.springblade.resource.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.resource.entity.Message;
import org.springblade.resource.entity.MessageTemplate;
import org.springblade.resource.vo.MessageVO;
import java.util.Map;
/**
* 消息表 服务类
* @author bladeX
* @since 2021-10-19
*/
public interface IMessageTemplateService extends IService<MessageTemplate> {
}

@ -0,0 +1,31 @@
package org.springblade.resource.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.resource.entity.Message;
import org.springblade.resource.entity.MessageTemplate;
import org.springblade.resource.enums.SysTypeEnum;
import org.springblade.resource.mapper.MessageMapper;
import org.springblade.resource.mapper.MessageTemplateMapper;
import org.springblade.resource.service.IMessageService;
import org.springblade.resource.service.IMessageTemplateService;
import org.springblade.resource.vo.MessageVO;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 消息表 服务实现类
* @author bladeX
* @since 2021-10-19
*/
@Service
public class MessageTemplateServiceImpl extends ServiceImpl<MessageTemplateMapper, MessageTemplate> implements IMessageTemplateService {
}

@ -17,6 +17,52 @@ public enum DictBizEnum {
* 单位
*/
UNIT("unit"),
/**
* 是否完成
*/
EXAMINE_IS_FINISHED("examine_is_finished"),
/**
* 监测类别
*/
ENTRUST_INVESTIGATIVE_TYPE("entrust_investigative_type"),
/**
* 报告发送方式
*/
ENTRUST_REPORT_SEND_TYPE("entrust_report_send_type"),
/**
* 输入方式
*/
INPUT_MODE("input_mode"),
/**
* 模板类型
*/
TEMPLATE_TYPE("template_type"),
/**
* 样品类别
*/
TASK_SIMPLE_TYPE("task_simple_type"),
/**
* 样品状态
*/
TASK_SIMPLE_STATUS("task_simple_status"),
/**
* 检测顺序
*/
TASK_SIMPLE_ORDER("task_testing_order"),
/**
* 是否流转
*/
TASK_IS_FLOW("task_is_flow"),
/**
* 是否留样
*/
IS_REAGENT("is_reagent"),
/**
* 是否留样
*/
SIMPLE_STATUS("simple_status"),
;
final String name;

@ -151,4 +151,7 @@ public class ExamineResult extends BaseEntity implements Serializable {
@TableField(exist = false)
private Integer isUpdate;
// 图片路径
private String picturePath;
}

@ -26,16 +26,6 @@ public class ExamineWay extends BaseEntity implements Serializable {
*/
private String name;
/**
* 标准编号
*/
private String standardCode;
/**
* 标准类型
*/
private String standardType;
/**
* 主要操作程序
*/

@ -1613,7 +1613,6 @@ public class EntrustController extends BladeController {
@GetMapping("/simpleHandlePrint")
public void simpleHandlePrint(String id, HttpServletResponse response) throws IOException {
service.simpleHandlePrint(id, response);
}

@ -15,14 +15,9 @@ import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.lims.entry.*;
import org.springblade.lims.excel.ExamineExcel;
import org.springblade.lims.excel.ExamineOutExcel;
import org.springblade.lims.excel.ExamineTemplate2Excel;
import org.springblade.lims.excel.ExamineTemplateExcel;
import org.springblade.lims.service.IExamineResultService;
import org.springblade.lims.service.IExamineService;
import org.springblade.lims.service.ISimpleDoExamineLogService;
import org.springblade.lims.service.ISimpleService;
import org.springblade.lims.excel.*;
import org.springblade.lims.service.*;
import org.springblade.system.feign.ISysClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -46,6 +41,10 @@ public class ExamineResultController extends BladeController {
private final ISimpleDoExamineLogService simpleDoExamineLogService;
private final IExamineItemService examineItemService;
private final ISysClient sysClient;
private final ISimpleService simpleService;
/**
@ -89,10 +88,13 @@ public class ExamineResultController extends BladeController {
@PostMapping("/excel")
public R excel(MultipartFile file, String examineId) {
Examine examine = examineService.getById(examineId);
if (examine.getExamineItemId() == 1544979879090921474L || examine.getExamineItemId() == 1549665733973581825L) {
ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId());
if ("2".equals(examineItem.getInputMode())) {
return blsExcel(file, examineId);
} else if (examine.getExamineItemId() == 1551466021168562177L) {
} else if ("3".equals(examineItem.getInputMode())) {
return ktyExcel(file, examineId);
} else if ("4".equals(examineItem.getInputMode())) {
return pcrExcel(file, examineId);
} else {
return ptExcel(file, examineId);
}
@ -1358,6 +1360,51 @@ public class ExamineResultController extends BladeController {
}
}
/**
* PCRExcel解析数据
*/
private R pcrExcel(MultipartFile file, String examineId) {
List<PCRExcel> read = ExcelUtil.read(file, PCRExcel.class);
if (read != null && read.size() > 0) {
for (PCRExcel pcrExcel : read) {
if ("".equals(pcrExcel.getCtValue()) || pcrExcel.getCtValue() == null) {
pcrExcel.setCtValue("/");
pcrExcel.setValue("阴性");
} else {
pcrExcel.setValue("阳性");
}
}
PCRExcel pcrExcel1 = new PCRExcel();
pcrExcel1.setExperieNum("阴性 对照");
pcrExcel1.setCtValue("");
pcrExcel1.setValue("阴性");
read.add(pcrExcel1);
PCRExcel pcrExcel2 = new PCRExcel();
pcrExcel2.setExperieNum("阳性 对照");
pcrExcel2.setCtValue("");
pcrExcel2.setValue("阳性");
read.add(pcrExcel2);
LambdaQueryWrapper<ExamineResult> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ExamineResult::getExamineId, examineId);
ExamineResult result = service.getOne(wrapper);
if (result != null) {
result.setOriginRecordData(JSON.toJSONString(read));
result.setOriginRecordResult(JSON.toJSONString(read));
result.setExamineDataArr(JSON.toJSONString(read));
service.updateById(result);
} else {
ExamineResult examineResult = new ExamineResult();
examineResult.setExamineId(Long.valueOf(examineId));
examineResult.setOriginRecordData(JSON.toJSONString(read));
examineResult.setOriginRecordResult(JSON.toJSONString(read));
examineResult.setExamineDataArr(JSON.toJSONString(read));
service.save(examineResult);
}
}
return R.data(read);
}
/**
* 组装每一个实验数据及结果map
*/
@ -1476,8 +1523,10 @@ public class ExamineResultController extends BladeController {
@ApiOperation(value = "结果模板")
public void exportCurrExamineTemplate(HttpServletResponse response, String id) {
Examine examine = examineService.getById(id);
ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId());
// 如果是布鲁氏杆菌抗体检测
if (examine.getExamineItemId() == 1544979879090921474L || examine.getExamineItemId() == 1549665733973581825L) {
if ("2".equals(examineItem.getInputMode())) {
LambdaQueryWrapper<SimpleDoExamineLog> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SimpleDoExamineLog::getExamineId, id);
wrapper.eq(SimpleDoExamineLog::getIsFinished, 0);
@ -1489,27 +1538,26 @@ public class ExamineResultController extends BladeController {
}
List<ExamineTemplateExcel> list = new ArrayList<>();
// List<ExamineTemplate2Excel> list1 = new ArrayList<>();
String[] split = experieNum.split(",");
// 布鲁氏杆菌抗体检测(平板凝集)
// if (examine.getExamineItemId() == 1544979879090921474L) {
for (String s : split) {
ExamineTemplateExcel excel = new ExamineTemplateExcel();
excel.setExperieNum(s);
list.add(excel);
}
ExcelUtil.export(response, "结果模板", "结果模板", list, ExamineTemplateExcel.class);
// }
// 布鲁氏杆菌抗体检测(试管凝集微量法)
// if (examine.getExamineItemId() == 1549665733973581825L) {
// for (String s : split) {
// ExamineTemplate2Excel excel = new ExamineTemplate2Excel();
// excel.setExperieNum(s);
// list1.add(excel);
// }
// ExcelUtil.export(response, "结果模板", "结果模板", list1, ExamineTemplate2Excel.class);
// }
}
// PCR检测
else if ("4".equals(examineItem.getInputMode())) {
String experieNum = examine.getExperieNum();
List<PCRExcel> list = new ArrayList<>();
String[] split = experieNum.split(",");
for (String s : split) {
PCRExcel pcrExcel = new PCRExcel();
pcrExcel.setExperieNum(s);
list.add(pcrExcel);
}
ExcelUtil.export(response, "结果模板", "结果模板", list, PCRExcel.class);
}
// 普通检测
else {
@ -1568,14 +1616,10 @@ public class ExamineResultController extends BladeController {
}
/**
* 上传实验数据异常关闭
* 上传检测结果照片
*/
// @GetMapping("/getExamineResult")
// public ExamineResult getExamineResult(String id) {
// LambdaQueryWrapper<ExamineResult> wrapper = new LambdaQueryWrapper<>();
// wrapper.eq(ExamineResult::getExamineId, id);
// wrapper.eq(ExamineResult::getStatus, 0);
// wrapper.isNull(ExamineResult::getInstrumentId);
// return service.getOne(wrapper);
// }
@PostMapping("/resultPicture")
public R<String> resultPicture(@RequestParam String picturePath) {
return R.data(service.resultPicture(picturePath));
}
}

@ -0,0 +1,26 @@
package org.springblade.lims.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
@Data
public class PCRExcel implements Serializable {
private static final long serialVersionUID = 1L;
@ColumnWidth(20)
@ExcelProperty("样品编号")
private String experieNum;
@ColumnWidth(20)
@ExcelProperty("CT值")
private String ctValue;
@ColumnWidth(20)
@ExcelProperty("检测结果")
private String value;
}

@ -35,4 +35,5 @@ public interface IEntrtrustService extends BaseService<Entrust> {
void simpleHandlePrint(String id, HttpServletResponse response);
void simpleReceivePrint(String id, HttpServletResponse response);
}

@ -17,4 +17,6 @@ public interface IExamineResultService extends BaseService<ExamineResult> {
boolean doExamine(ExamineResult entry) throws Exception;
void resultCommit(ExamineResult examineResult) throws Exception;
String resultPicture(String picturePath);
}

@ -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);

@ -17,9 +17,8 @@ import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.io.*;
import java.util.*;
/**
* @author wanghua
@ -69,7 +68,7 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe
boolean isAllFinish = true;
for (Examine examine : examines) {
// position1
if (examine.getIsFinished().equals("0")) {
if ("0".equals(examine.getIsFinished())) {
isAllFinish = false;
break;
}
@ -164,6 +163,64 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe
}
}
@Override
public String resultPicture(String picturePath) {
String fileName = "";
if (!"".equals(picturePath) && picturePath != null) {
Random random = new Random();
fileName = random.nextLong() + ".png";
String path = sysClient.getParamValue("electronic_signature_real_path").getData() + fileName;
// byte[] bytes = Base64Utils.decodeFromString(user.getElectronicSignature());
// byte[] decode = Base64.getMimeDecoder().decode(user.getElectronicSignature());
// String tempStr = user.getElectronicSignature();
if (picturePath.contains("data:")) {
int start = picturePath.indexOf(",");
picturePath = picturePath.substring(start + 1);
}
final Base64.Decoder decoder = Base64.getDecoder();
picturePath = picturePath.replaceAll("\r|\n", "");
picturePath = picturePath.trim();
byte[] decode = decoder.decode(picturePath);
byteArrayToFile(decode, path);
// String s = sysClient.getParamValue("electronic_signature").getData();
// user.setElectronicSignature(fileName);
}
return fileName;
}
public static void byteArrayToFile(byte[] src, String filePath) {
//1.创建源
File file = new File(filePath);
//选择流
InputStream writing = null;
OutputStream os = null;
try {
writing = new ByteArrayInputStream(src);
os = new FileOutputStream(file);
byte[] frush = new byte[5];//3表示0个字节为一段
int len = -1;
while ((len = writing.read(frush)) != -1) {
os.write(frush, 0, len);
}
os.flush();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
if (os != null) {
try {
os.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean doExamine(ExamineResult entry) throws Exception {
@ -178,7 +235,7 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe
boolean isAllFinish = true;
for (Examine examine : list) {
// position1
if (examine.getIsFinished().equals("0")) {
if ("0".equals(examine.getIsFinished())) {
isAllFinish = false;
break;
}

@ -28,31 +28,33 @@ import java.util.*;
public class TaskBlueprintServiceImpl extends BaseServiceImpl<TaskBlueprintMapper, TaskBlueprint> implements ITaskBlueprintService {
@Autowired
private IETaskService ieTaskService;
private IETaskService ieTaskService;
@Autowired
private IExamineService examineService;
private IExamineService examineService;
@Autowired
private IEntrtrustService entrtrustService;
private IEntrtrustService entrtrustService;
@Lazy
@Autowired
private ISimpleService simpleService;
private ISimpleService simpleService;
public TaskBlueprintServiceImpl(ISimpleService simpleService) {
this.simpleService= simpleService;
this.simpleService = simpleService;
}
@Autowired
private IExamineItemService examineItemService;
private IExamineItemService examineItemService;
@Autowired
private IExamineWayService examineWayService;
private IExamineWayService examineWayService;
@Autowired
private IExamineBasisService examineBasisService;
private IExamineBasisService examineBasisService;
@Autowired
private ISimpleDoExamineLogService simpleDoExamineLogService;
private ISimpleDoExamineLogService simpleDoExamineLogService;
@Autowired
private ISysClient sysClient;
private ISysClient sysClient;
@Autowired
private IUserClient userClient;
private IUserClient userClient;
@Autowired
private IMessageClient messageClient;
private IMessageClient messageClient;
@Override
@Transactional(rollbackFor = Exception.class)
@ -71,13 +73,13 @@ public class TaskBlueprintServiceImpl extends BaseServiceImpl<TaskBlueprintMappe
List<User> userList = userClient.listDeptUserByCurrentUser(eTask.getDeptId().toString()).getData();
if (userList != null) {
for (User user : userList) {
// position1
// position1
if ("1432876315142520834".equals(user.getRoleId())) {
messageClient.event(SysTypeEnum.INFORM.getValue(), "新的检验",
"你有新的检验待领取,请及时处理", 1, 5, user.getId().toString(),"/plugin/workflow/process/experimentcrew");
"你有新的检验待领取,请及时处理", 1, 5, user.getId().toString(), "/plugin/workflow/process/experimentcrew");
} else {
messageClient.event(SysTypeEnum.INFORM.getValue(), "新的检验",
"你有新的检验待分配,请及时处理", 1, 5, user.getId().toString(),"/plugin/workflow/process/experimentcrew");
"你有新的检验待分配,请及时处理", 1, 5, user.getId().toString(), "/plugin/workflow/process/experimentcrew");
}
}
}
@ -134,23 +136,14 @@ public class TaskBlueprintServiceImpl extends BaseServiceImpl<TaskBlueprintMappe
if (userList != null) {
for (User user : userList) {
messageClient.event(SysTypeEnum.INFORM.getValue(), "检测",
"你有新的检验待领取,请及时查看", 1, 5, user.getId().toString(),"/plugin/workflow/process/experimentcrew");
"你有新的检验待领取,请及时查看", 1, 5, user.getId().toString(), "/plugin/workflow/process/experimentcrew");
}
}
eTask.setTaskBlueprintId(taskBlueprintId);
long taskId = random.nextLong();
// 科室一
// position1
if (eTask.getDeptId() == 1536303217085018114L) {
eTask.setWeight(1);
}
// 科室二
if (eTask.getDeptId() == 1536303261238456322L) {
eTask.setWeight(2);
}
// 科室三
if (eTask.getDeptId() == 1536303317815422978L) {
eTask.setWeight(3);
if (eTask.getDeptId() != null) {
Integer sort = sysClient.getDept(eTask.getDeptId()).getData().getSort();
eTask.setWeight(sort);
}
eTask.setId(taskId);
eTask.setDemandCompletionTime(taskBlueprint.getDemandCompletionTime());

Loading…
Cancel
Save