2022年8月31日19:40:36

pull/1/head
litao 4 years ago
parent f1ea91a902
commit 9a04f1c97e
  1. 6
      lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/Examine.java
  2. 1
      lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/ExamineItem.java
  3. 3
      lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/ExamineResult.java
  4. 10
      lab-service/lab-capital/src/main/java/org/springblade/lims/goods/controller/ApplyController.java
  5. 27
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/EntrustController.java
  6. 18
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineBasisController.java
  7. 31
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineController.java
  8. 18
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineItemController.java
  9. 12
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineResultController.java
  10. 16
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineWayController.java
  11. 11
      lab-service/lab-lims/src/main/java/org/springblade/lims/excel/PCR2Excel.java
  12. 6
      lab-service/lab-lims/src/main/java/org/springblade/lims/excel/PCRExcel.java
  13. 3
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/IExamineResultService.java
  14. 26
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/EntrustServiceImpl.java
  15. 83
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineResultServiceImpl.java
  16. 38
      lab-service/lab-user/src/main/java/org/springblade/system/user/controller/UserController.java

@ -212,4 +212,10 @@ public class Examine extends BaseEntity implements Serializable {
// 模板类型
private String templateType;
/**
* 输入方式
*/
@TableField(exist = false)
private String inputMode;
}

@ -86,5 +86,4 @@ public class ExamineItem extends BaseEntity implements Serializable {
* 使用次数
*/
private Integer useCount;
}

@ -154,4 +154,7 @@ public class ExamineResult extends BaseEntity implements Serializable {
// 图片路径
private String picturePath;
@TableField(exist = false)
private List<String> path;
}

@ -61,7 +61,15 @@ public class ApplyController extends BladeController {
apply.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
}
LambdaQueryWrapper<Apply> wrapper = new LambdaQueryWrapper<>(apply);
wrapper.eq(Apply::getStatus, 1).or().eq(Apply::getStatus, 3).or().eq(Apply::getStatus, 4);
// wrapper.eq(Apply::getStatus, 1).or()
// .eq(Apply::getStatus, 3).or()
// .eq(Apply::getStatus, 4);
if ("1".equals(apply.getIsGetAll())) {
if (apply.getStatus() == null) {
wrapper.in(Apply::getStatus, 1, 3, 4);
}
}
if (temp != null && !"".equals(temp)) {
wrapper.and(qw -> qw
.like(Apply::getApplyUser, temp).or()

@ -461,6 +461,7 @@ public class EntrustController extends BladeController {
@GetMapping("/getEntrust")
public R<Map<String, Object>> getEntrust(String id, String roleId, String deptId, String userId) {
HashMap<String, Object> map = new HashMap<>();
// TODO 查看详情需要改动
//科室主任
if ("1123598816738675203".equals(roleId)) {
//委托单
@ -1149,6 +1150,7 @@ public class EntrustController extends BladeController {
if (byId != null) {
examine.setExamineItemName(byId.getName());
}
examine.setInputMode(byId.getInputMode());
}
}
if (examine.getExamineWayId() != null) {
@ -1172,8 +1174,7 @@ public class EntrustController extends BladeController {
QueryWrapper<ExamineResult> resultQueryWrapper = new QueryWrapper<>();
resultQueryWrapper.eq("examine_id", examine.getId());
// resultQueryWrapper.eq("status", 1);
List<ExamineResult> examineResults = examineResultService.list(resultQueryWrapper);
for (ExamineResult examineResult : examineResults) {
ExamineResult examineResult = examineResultService.getOne(resultQueryWrapper);
if (examineResult != null) {
Long examineBasisId = examine.getExamineBasisId();
if (examineBasisId != null) {
@ -1199,8 +1200,16 @@ public class EntrustController extends BladeController {
examineResult.setInstrumentNo(instrument.getCode());
}
}
examine.setExamineResult(examineResult);
List<String> path = new ArrayList<>();
String picturePath = examineResult.getPicturePath();
if (picturePath != null && !"".equals(picturePath)) {
String[] split = picturePath.split(",");
for (String s : split) {
path.add(s);
}
examineResult.setPath(path);
}
examine.setExamineResult(examineResult);
}
}
return R.data(examine);
@ -1293,12 +1302,12 @@ public class EntrustController extends BladeController {
map.put("examineList", examineList);
//样品信息
QueryWrapper<Simple> wrapper = new QueryWrapper<>();
wrapper.eq("entrust_id", id);
wrapper.eq("is_distribution", 0);
wrapper.eq("status", 1);
List<Simple> simpleList = simpleService.list(wrapper);
map.put("simpleList", simpleList);
// QueryWrapper<Simple> wrapper = new QueryWrapper<>();
// wrapper.eq("entrust_id", id);
// wrapper.eq("is_distribution", 0);
// wrapper.eq("status", 1);
// List<Simple> simpleList = simpleService.list(wrapper);
// map.put("simpleList", simpleList);
return map;
}

@ -62,8 +62,22 @@ public class ExamineBasisController extends BladeController {
return R.data(page);
}
// TODO 加一个分页查接口
@GetMapping("/page")
public R<Object> page(ExamineBasis entry, Query query) {
LambdaQueryWrapper<ExamineBasis> wrapper = new LambdaQueryWrapper<>();
//根据name模糊查询
if (entry.getName() != null && !"".equals(entry.getName())) {
wrapper.like(ExamineBasis::getName, entry.getName()).or()
.like(ExamineBasis::getRemark, entry.getName());
}
wrapper.orderByDesc(ExamineBasis::getCreateTime);
IPage<ExamineBasis> page = service.page(Condition.getPage(query), wrapper);
return R.data(page);
}
/**
*
* 修改
*/
@PostMapping("/update")
@ApiOperation(value = "更改", notes = "更改")
@ -72,7 +86,7 @@ public class ExamineBasisController extends BladeController {
}
/**
*
* 新增
*/
@PostMapping("/insert")
@ApiOperation(value = "新增", notes = "新增")

@ -22,10 +22,7 @@ import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author swj
@ -124,6 +121,7 @@ public class ExamineController extends BladeController {
if (examineItem != null) {
//检验项目名称
examine.setExamineItemName(examineItem.getName());
examine.setInputMode(examineItem.getInputMode());
}
if (examineWay != null) {
@ -139,6 +137,7 @@ public class ExamineController extends BladeController {
//检验依据名称
examine.setExamineBasisName(examineBasis.getName());
}
}
LambdaQueryWrapper<ExamineResult> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ExamineResult::getExamineId, id);
@ -146,12 +145,36 @@ public class ExamineController extends BladeController {
// wrapper.eq(ExamineResult::getStatus, 0);
wrapper.isNull(ExamineResult::getInstrumentId);
ExamineResult examineResult = examineResultService.getOne(wrapper);
if (examineResult != null) {
String picturePath = examineResult.getPicturePath();
if (picturePath != null && !"".equals(picturePath)) {
List<String> path = new ArrayList<>();
String[] split = picturePath.split(",");
for (String s : split) {
path.add(s);
}
examineResult.setPath(path);
}
examine.setExamineResult(examineResult);
}
} else {
// wrapper.eq(ExamineResult::getStatus, 1);
// 获取批次号最大的数据
// wrapper.orderByDesc(ExamineResult::getBatch).last("limit 1");
List<ExamineResult> resultList = examineResultService.list(wrapper);
if (resultList != null && resultList.size() > 0) {
for (ExamineResult result : resultList) {
String picturePath = result.getPicturePath();
if (picturePath != null && !"".equals(picturePath)) {
List<String> path = new ArrayList<>();
String[] split = picturePath.split(",");
for (String s : split) {
path.add(s);
}
result.setPath(path);
}
}
}
map.put("resultList", resultList);
}
map.put("examine", examine);

@ -63,6 +63,20 @@ public class ExamineItemController extends BladeController {
return R.data(page);
}
// TODO 加一个分页查接口
@GetMapping("/page")
public R<Object> page(ExamineItem entry, Query query) {
LambdaQueryWrapper<ExamineItem> wrapper = new LambdaQueryWrapper<>();
//根据name模糊查询
if (entry.getName() != null && !"".equals(entry.getName())) {
wrapper.like(ExamineItem::getName, entry.getName()).or()
.like(ExamineItem::getRemark, entry.getName());
}
wrapper.orderByDesc(ExamineItem::getCreateTime);
IPage<ExamineItem> page = service.page(Condition.getPage(query), wrapper);
return R.data(page);
}
/**
* 更改
*/
@ -101,13 +115,15 @@ public class ExamineItemController extends BladeController {
@GetMapping("/getReagent")
public List<Reagent> getReagent(String id) {
ExamineItem examineItem = service.getById(id);
List<Reagent> reagentList = new ArrayList<>();
if (examineItem != null) {
String reagentId = examineItem.getReagentId();
String[] split = reagentId.split(",");
List<Reagent> reagentList = new ArrayList<>();
for (String s : split) {
Reagent reagent = reagentService.getById(s);
reagentList.add(reagent);
}
}
return reagentList;
}
}

@ -1364,9 +1364,9 @@ public class ExamineResultController extends BladeController {
* PCRExcel解析数据
*/
private R pcrExcel(MultipartFile file, String examineId) {
List<PCRExcel> read = ExcelUtil.read(file, PCRExcel.class);
List<PCR2Excel> read = ExcelUtil.read(file, PCR2Excel.class);
if (read != null && read.size() > 0) {
for (PCRExcel pcrExcel : read) {
for (PCR2Excel pcrExcel : read) {
if ("".equals(pcrExcel.getCtValue()) || pcrExcel.getCtValue() == null) {
pcrExcel.setCtValue("/");
pcrExcel.setValue("阴性");
@ -1374,12 +1374,12 @@ public class ExamineResultController extends BladeController {
pcrExcel.setValue("阳性");
}
}
PCRExcel pcrExcel1 = new PCRExcel();
PCR2Excel pcrExcel1 = new PCR2Excel();
pcrExcel1.setExperieNum("阴性 对照");
pcrExcel1.setCtValue("");
pcrExcel1.setValue("阴性");
read.add(pcrExcel1);
PCRExcel pcrExcel2 = new PCRExcel();
PCR2Excel pcrExcel2 = new PCR2Excel();
pcrExcel2.setExperieNum("阳性 对照");
pcrExcel2.setCtValue("");
pcrExcel2.setValue("阳性");
@ -1619,7 +1619,7 @@ public class ExamineResultController extends BladeController {
* 上传检测结果照片
*/
@PostMapping("/resultPicture")
public R<String> resultPicture(@RequestParam String picturePath) {
return R.data(service.resultPicture(picturePath));
public R<String> resultPicture(@RequestParam MultipartFile file) {
return R.data(service.resultPicture(file));
}
}

@ -66,6 +66,20 @@ public class ExamineWayController extends BladeController {
return R.data(page);
}
// TODO 加一个分页查接口
@GetMapping("/page")
public R<Object> page(ExamineWay entry, Query query) {
LambdaQueryWrapper<ExamineWay> wrapper = new LambdaQueryWrapper<>();
//根据name模糊查询
if (entry.getName() != null && !"".equals(entry.getName())) {
wrapper.like(ExamineWay::getName, entry.getName()).or()
.like(ExamineWay::getRemark, entry.getName());
}
wrapper.orderByDesc(ExamineWay::getCreateTime);
IPage<ExamineWay> page = service.page(Condition.getPage(query), wrapper);
return R.data(page);
}
/**
* 修改
*/
@ -87,8 +101,8 @@ public class ExamineWayController extends BladeController {
if (entry.getInstrumentId() != null) {
Instrument instrument = instrumentService.getById(entry.getInstrumentId());
entry.setInstrumentName(instrument.getName());
entry.setUseCount(0);
}
entry.setUseCount(0);
return service.save(entry);
}

@ -0,0 +1,11 @@
package org.springblade.lims.excel;
import lombok.Data;
@Data
public class PCR2Excel extends PCRExcel {
// 检测结果
private String value;
}

@ -19,8 +19,8 @@ public class PCRExcel implements Serializable {
@ExcelProperty("CT值")
private String ctValue;
@ColumnWidth(20)
@ExcelProperty("检测结果")
private String value;
// @ColumnWidth(20)
// @ExcelProperty("检测结果")
// private String value;
}

@ -5,6 +5,7 @@ package org.springblade.lims.service;
import org.springblade.core.mp.base.BaseService;
import org.springblade.lims.entry.Entrust;
import org.springblade.lims.entry.ExamineResult;
import org.springframework.web.multipart.MultipartFile;
/**
* 委托单表 服务类
@ -18,5 +19,5 @@ public interface IExamineResultService extends BaseService<ExamineResult> {
void resultCommit(ExamineResult examineResult) throws Exception;
String resultPicture(String picturePath);
String resultPicture(MultipartFile file);
}

@ -13,6 +13,7 @@ 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.PCR2Excel;
import org.springblade.lims.excel.PCRExcel;
import org.springblade.lims.mapper.EntrustMapper;
import org.springblade.lims.service.*;
@ -777,7 +778,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
// PCR检测
else if ("4".equals(byId.getInputMode())) {
List<PCRExcel> list = JSON.parseArray(examineResult.getExamineDataArr(), PCRExcel.class);
List<PCR2Excel> list = JSON.parseArray(examineResult.getExamineDataArr(), PCR2Excel.class);
if (list.size() > 0) {
if (list.size() % 2 == 0) {
for (int i = 0; i < list.size() / 2; i++) {
@ -805,13 +806,32 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
}
if (examineResult.getPicturePath() != null && !"".equals(examineResult.getPicturePath())) {
String[] sp = examineResult.getPicturePath().split(",");
for (String s2 : sp) {
Map<String, Object> map = new HashMap<>();
ImageEntity farView1 = new ImageEntity();
farView1.setHeight(400);//设置高度
farView1.setWidth(700);//设置宽度
farView1.setType(ImageEntity.Data);//类型
String s1 = path + s2;
FileInputStream fis = null;
try {
fis = new FileInputStream(new File(s1));
byte[] bytes = readInputStream(fis);
farView1.setData(bytes);
} catch (Exception e) {
e.printStackTrace();
}
map.put("picture", farView1);
resultList2.add(map);
}
}
}
result.put("list1", resultList2);
result.put("list", resultList1);
url = PCRreportPrint;
}
}
// 普通和口蹄疫检测
else {
DecimalFormat df = new DecimalFormat("#0.000");

@ -16,6 +16,7 @@ import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.util.*;
@ -164,61 +165,23 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe
}
@Override
public String resultPicture(String picturePath) {
public String resultPicture(MultipartFile file) {
String fileName = "";
if (!"".equals(picturePath) && picturePath != null) {
if (file != 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) {
FileOutputStream fout;
try {
os.close();
} catch (IOException e) {
// TODO Auto-generated catch block
fout = new FileOutputStream(path);
fout.write(file.getBytes());
fout.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
return fileName;
}
@Override
@ -305,10 +268,38 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe
// TODO 当有多个检测结果的时候,getOne报错
ExamineResult examineResult = this.getOne(wrapper);
entry.setId(examineResult.getId());
// 上传图片文件名
List<String> path = entry.getPath();
if (path != null && path.size() > 0) {
String picturePath = "";
if (path.size() > 1) {
for (String s : path) {
String s1 = s + ",";
picturePath += s1;
}
} else {
picturePath = path.get(0);
}
entry.setPicturePath(picturePath);
}
return this.updateById(entry);
}
// 提交修改实验结果
else {
// 上传图片文件名
List<String> path = entry.getPath();
if (path != null && path.size() > 0) {
String picturePath = "";
if (path.size() > 1) {
for (String s : path) {
String s1 = s + ",";
picturePath += s1;
}
} else {
picturePath = path.get(0);
}
entry.setPicturePath(picturePath);
}
return this.updateById(entry);
}
}

@ -140,18 +140,35 @@ public class UserController {
/**
* 自定义用户列表
*/
// @GetMapping("/page")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"),
// @ApiImplicitParam(name = "realName", value = "姓名", paramType = "query", dataType = "string")
// })
// @ApiOperationSupport(order = 3)
// @ApiOperation(value = "列表", notes = "传入account和realName")
// //@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
// public R<IPage<UserVO>> page(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) {
// IPage<User> pages = userService.selectUserPage(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId()));
// return R.data(UserWrapper.build().pageVO(pages));
// }
@GetMapping("/page")
@ApiImplicitParams({
@ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "realName", value = "姓名", paramType = "query", dataType = "string")
})
@ApiOperationSupport(order = 3)
@ApiOperation(value = "列表", notes = "传入account和realName")
//@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
public R<IPage<UserVO>> page(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) {
IPage<User> pages = userService.selectUserPage(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId()));
return R.data(UserWrapper.build().pageVO(pages));
public R<IPage<UserVO>> newPage(User user, Query query) {
LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
if (AuthUtil.getUserId() != 1530823299437965313L) {
wrapper.ne(User::getId, 1530823299437965313L);
}
if (user.getDeptId() != null && !"".equals(user.getDeptId())) {
wrapper.eq(User::getDeptId, user.getDeptId());
}
wrapper.eq(User::getTenantId, AuthUtil.getTenantId());
wrapper.orderByDesc(User::getCreateTime);
IPage<User> page = userService.page(Condition.getPage(query), wrapper);
return R.data(UserWrapper.build().pageVO(page));
// return R.data(userService.page(Condition.getPage(query), wrapper));
}
/**
* 新增或修改
@ -181,7 +198,6 @@ public class UserController {
}
/**
* 删除
*/

Loading…
Cancel
Save