修改记录问题

dev
litao 3 years ago
parent 33f2786c74
commit 28f9f81d5b
  1. 3
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/EntrustController.java
  2. 6
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineController.java
  3. 144
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineResultController.java
  4. 37
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/SimpleRelController.java
  5. 2
      lab-service/lab-lims/src/main/java/org/springblade/lims/excel/PCR2Excel.java
  6. 2
      lab-service/lab-lims/src/main/java/org/springblade/lims/excel/XN2Excel.java
  7. 143
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/EntrustServiceImpl.java

@ -1234,8 +1234,7 @@ public class EntrustController extends BladeController {
TaskBlueprint one = taskBlueprintService.getOne(queryWrapper1);
Long entrustId = entrust.getId();
ETask eTask = new ETask();
eTask.setId(examine.getId());
ETask eTask = eTaskService.getById(examine.getETaskId());
eTask.setTaskIssuedBy(one.getTaskIssuedBy());
eTask.setBackCrossTime(new Date());
eTask.setBackCrossRecipientBy(one.getTaskIssuedBy());

@ -124,10 +124,10 @@ public class ExamineController extends BladeController {
Map<String, Object> map = new HashMap<>();
//检验数据
Examine examine = examineService.getById(id);
// Entrust entrust = service.getById(examine.getEntrustId());
Entrust entrust = service.getById(examine.getEntrustId());
// 字典获取样品状态
String simpleStatus = DictBizCache.getValue(DictBizEnum.SIMPLE_STATUS, examine.getSimpleName().split("-")[1]);
examine.setSimpleStatus(simpleStatus);
// String simpleStatus = DictBizCache.getValue(DictBizEnum.SIMPLE_STATUS, examine.getSimpleName().split("-")[1]);
examine.setSimpleStatus(entrust.getSimpleState());
if (examine != null) {
//实验项目

@ -404,7 +404,7 @@ public class ExamineResultController extends BladeController {
// 不同试剂计算公式不同
// 猪繁殖与呼吸综合征病毒抗体ELISA检测试剂盒
if ("1564971031138115586".equals(reagentId)) {
if ("1580030700969861121".equals(reagentId)) {
for (int i = 0; i < group; i++) {
DecimalFormat df = new DecimalFormat("#0.000");
List<Map<String, Map<String, Object>>> mapList = new ArrayList<>();
@ -498,7 +498,7 @@ public class ExamineResultController extends BladeController {
}
}
// 伪狂犬病毒gE蛋白lgG抗体ELISA检测试剂盒
else if ("1564971031138115586".equals(reagentId)) {
else if ("1580733683995009026".equals(reagentId)) {
for (int i = 0; i < group; i++) {
List<Map<String, Map<String, Object>>> mapList = new ArrayList<>();
List<ExamineExcel> excels = map.get(i + 1 + "");
@ -594,7 +594,7 @@ public class ExamineResultController extends BladeController {
}
}
// 非洲猪瘟病毒抗体检测试剂盒
else if ("1564971031138115586".equals(reagentId)) {
else if ("1580730163250188290".equals(reagentId)) {
for (int i = 0; i < group; i++) {
List<Map<String, Map<String, Object>>> mapList = new ArrayList<>();
List<ExamineExcel> excels = map.get(i + 1 + "");
@ -693,7 +693,7 @@ public class ExamineResultController extends BladeController {
}
}
// 小反刍兽疫病毒阻断ELISA抗体检测试剂盒
else if ("1564971031138115586".equals(reagentId)) {
else if ("1570666183341043714".equals(reagentId)) {
for (int i = 0; i < group; i++) {
List<Map<String, Map<String, Object>>> mapList = new ArrayList<>();
List<ExamineExcel> excels = map.get(i + 1 + "");
@ -783,8 +783,8 @@ public class ExamineResultController extends BladeController {
map1.put("g" + (i + 1), mapList);
}
}
//
else if ("1564971031138115586".equals(reagentId)) {
// 非洲猪瘟病毒cELISA抗体检测试剂盒
else if ("1580815808211578882".equals(reagentId)) {
for (int i = 0; i < group; i++) {
List<Map<String, Map<String, Object>>> mapList = new ArrayList<>();
List<ExamineExcel> excels = map.get(i + 1 + "");
@ -2138,7 +2138,6 @@ public class ExamineResultController extends BladeController {
Map<String, Map<String, Object>> layer1 = allDataInCurrGroup1.get(i);
Map<String, Map<String, Object>> layer2 = allDataInCurrGroup2.get(i);
Set<String> set1 = layer1.keySet();
Set<String> set2 = layer2.keySet();
for (String key : set1) {
Map<String, Object> data1 = layer1.get(key);
Map<String, Object> data2 = layer2.get(key);
@ -2171,6 +2170,65 @@ public class ExamineResultController extends BladeController {
}
}
// 排序
Collections.sort(allData, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
Integer id1 = (Integer) o1.get("order");
Integer id2 = (Integer) o2.get("order");
// 升序
return id1.compareTo(id2);
}
});
Collections.sort(allDatas, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
Integer id1 = (Integer) o1.get("order");
Integer id2 = (Integer) o2.get("order");
// 升序
return id1.compareTo(id2);
}
});
// 检测编号计数器
int numIndex = 0;
int numIndex2 = 0;
int numIndex3 = 0;
// 循环
for (int i = 0; i < groupCount / 2; i++) {
// 参照组
for (int j = 0; j < 96; j++) {
Map<String, Object> map = allData.get((i * 192) + j);
String num = (String) map.get("num");
if (num != null && !"".equals(num)) {
num = experieNum[numIndex];
map.put("num", num);
numIndex++;
}
}
// 对照组
for (int j = 96; j < 192; j++) {
Map<String, Object> map = allData.get((i * 192) + j);
String num = (String) map.get("num");
if (num != null && !"".equals(num)) {
num = experieNum[numIndex2];
map.put("num", num);
numIndex2++;
}
}
// 最终结果组
for (int j = 0; j < 96; j++) {
Map<String, Object> map = allDatas.get((i * 96) + j);
String num = (String) map.get("num");
if (num != null && !"".equals(num)) {
num = experieNum[numIndex3];
map.put("num", num);
numIndex3++;
}
}
}
// 判断应实验样品数量和实际样品数量是否相等
if (experieNum.length != simpleCount) {
throw new Exception("分配样品数量与检测样品数量不一致!");
@ -2315,6 +2373,64 @@ public class ExamineResultController extends BladeController {
}
}
// 排序
Collections.sort(allData, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
Integer id1 = (Integer) o1.get("order");
Integer id2 = (Integer) o2.get("order");
// 升序
return id1.compareTo(id2);
}
});
Collections.sort(allDatas, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
Integer id1 = (Integer) o1.get("order");
Integer id2 = (Integer) o2.get("order");
// 升序
return id1.compareTo(id2);
}
});
// 检测编号计数器
int numIndex = 0;
int numIndex2 = 0;
int numIndex3 = 0;
// 循环
for (int i = 0; i < groupCount / 2; i++) {
// 参照组
for (int j = 0; j < 96; j++) {
Map<String, Object> map = allData.get((i * 192) + j);
String num = (String) map.get("num");
if (num != null && !"".equals(num)) {
num = experieNum[numIndex];
map.put("num", num);
numIndex++;
}
}
// 对照组
for (int j = 96; j < 192; j++) {
Map<String, Object> map = allData.get((i * 192) + j);
String num = (String) map.get("num");
if (num != null && !"".equals(num)) {
num = experieNum[numIndex2];
map.put("num", num);
numIndex2++;
}
}
// 最终结果组
for (int j = 0; j < 96; j++) {
Map<String, Object> map = allDatas.get((i * 96) + j);
String num = (String) map.get("num");
if (num != null && !"".equals(num)) {
num = experieNum[numIndex3];
map.put("num", num);
numIndex3++;
}
}
}
Map<String, Object> realResultMap = new HashMap<>();
realResultMap.put("data", resultMap);
realResultMap.put("yinCount", yinCount);
@ -2801,7 +2917,9 @@ public class ExamineResultController extends BladeController {
// cPosData.put("order", b + 1 + 96);
cPosData.put("order", order + 1 + 96);
}
cPosData.put("num", experieNum[b - ((group + 1) * 6 + (group * 16))]);
// cPosData.put("num", experieNum[b - ((group + 1) * 6 + (group * 16))]);
// cPosData.put("num", experieNum[b - (group + (group * 8))]);
cPosData.put("num", "1");
cPosData.put("result", Double.parseDouble(value) > avg ? "阴性" : "阳性");
return cPosData;
}
@ -2905,14 +3023,14 @@ public class ExamineResultController extends BladeController {
if (i == (read.size() - 1)) {
read.get(i).setCtValue(length + ctValue);
read.get(i).setValue(" 阳性");
read.get(i).setResult(" 阳性");
} else {
if ("".equals(read.get(i).getCtValue()) || read.get(i).getCtValue() == null) {
read.get(i).setCtValue("/");
read.get(i).setValue("阴性");
read.get(i).setResult("阴性");
} else {
read.get(i).setCtValue(length + ctValue);
read.get(i).setValue(" 阳性");
read.get(i).setResult(" 阳性");
}
}
}
@ -2946,9 +3064,9 @@ public class ExamineResultController extends BladeController {
List<String> list2 = Arrays.asList("4", "5", "6", "≥6", "7", "8", "9", "≥10", ">=6", ">=10");
for (XN2Excel excel : read) {
if (list.contains(excel.getCtValue())) {
excel.setValue("阴性");
excel.setResult("阴性");
} else if (list2.contains(excel.getCtValue())) {
excel.setValue("阳性");
excel.setResult("阳性");
} else {
throw new Exception("请输入正确格式的滴度Log2值,并重新上传!");
}

@ -231,4 +231,41 @@ public class SimpleRelController extends BladeController {
return R.status(simpleRelService.updateBatchById(simpleRelList));
}
/**
* 重置原始编号
*/
@PostMapping("/resetOriginalNum")
public R resetOriginalNum(@RequestBody SimpleRel simpleRel) {
LambdaQueryWrapper<SimpleRel> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SimpleRel::getEntrustId, simpleRel.getEntrustId());
List<SimpleRel> rels = simpleRelService.list(wrapper);
if (CollectionUtils.isNotEmpty(rels)) {
for (SimpleRel rel : rels) {
String[] split = rel.getOriginalNum().split("-");
rel.setOriginalNum(split[split.length - 1]);
}
}
return R.status(simpleRelService.updateBatchById(rels));
}
/**
* 重置检测编号
*/
@PostMapping("/resetExperieNum")
public R resetExperieNum(@RequestBody SimpleRel simpleRel) {
LambdaQueryWrapper<SimpleRel> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SimpleRel::getEntrustId, simpleRel.getEntrustId());
List<SimpleRel> rels = simpleRelService.list(wrapper);
if (CollectionUtils.isNotEmpty(rels)) {
for (SimpleRel rel : rels) {
// 实验样品编号
String[] split1 = rel.getExamineExperieNum().split("-");
rel.setExamineExperieNum(split1[split1.length - 1]);
// 留样样品编号
String[] split2 = rel.getReagentExperieNum().split("-");
rel.setReagentExperieNum(split2[split2.length - 1]);
}
}
return R.status(simpleRelService.updateBatchById(rels));
}
}

@ -6,6 +6,6 @@ import lombok.Data;
public class PCR2Excel extends PCRExcel {
// 检测结果
private String value;
private String result;
}

@ -6,5 +6,5 @@ import lombok.Data;
public class XN2Excel extends XNExcel {
// 结果
private String value;
private String result;
}

@ -412,7 +412,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
default:
currTemplate = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "print10");
}
List<ExamineResultVo> resultList = new ArrayList<>();
// 根据检验判断有几个name
for (int i = 1; i <= examineList.size(); i++) {
@ -465,7 +464,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
resultVo.setNum(simple.getExperieNum());
resultVo.setIndex(i);
resultVo.setValue(excel.getCtValue());
resultVo.setResult(excel.getValue());
resultVo.setResult(excel.getResult());
resultVo.setRecessiveNum(simple.getRecessiveNum());
resultList.add(resultVo);
}
@ -488,7 +487,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
resultVo.setNum(simple.getExperieNum());
resultVo.setIndex(i);
resultVo.setValue(excel.getCtValue());
resultVo.setResult(excel.getValue());
resultVo.setResult(excel.getResult());
resultList.add(resultVo);
}
}
@ -673,15 +672,14 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
}
//给检测结果赋值 start
ItemAndAllList.forEach(item ->{
if (StringUtils.isNoneBlank(item.get("examineItem").toString()) && StringUtils.equals(examineItem.getName(),item.get("examineItem").toString())){
//遍历resultList 获取阴阳结果的数量
long yangNum = resultList.stream().filter(re -> StringUtils.equals("阳性" , re.getResult())).count();
long yinNum = resultList.stream().filter(re -> StringUtils.equals("阴性" , re.getResult())).count();
item.put("yangNum",yangNum);
item.put("yinNum", yinNum);
}
});
// ItemAndAllList.forEach(item ->{
// if (StringUtils.isNoneBlank(item.get("examineItem").toString()) && StringUtils.equals(examineItem.getName(),item.get("examineItem").toString())){
// //遍历resultList 获取阴阳结果的数量
// long yangNum = resultList.stream().filter(re -> StringUtils.equals("阳性" , re.getResult())).count();
// long yinNum = resultList.stream().filter(re -> StringUtils.equals("阴性" , re.getResult())).count();
// item.put("examineResult", yangNum + "份为阳性," + yinNum + "份为阴性");
// }
// });
//给检验结果赋值 end
reportMainBody.put("list", resultList);
}
@ -1009,7 +1007,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
// 获取该仪器对象
Instrument instrument = instrumentService.getById(s);
// 拼接仪器编号及名称
instrumentName += instrument.getCode() + " " + instrument.getName() + "," + "\\r";
instrumentName += instrument.getCode() + " " + instrument.getName() + "\r";
}
result1.put("code", instrumentName);
result1.put("experieDate", format3.format(taskBlueprint.getCreateTime()));
@ -1115,7 +1113,31 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
map.put("examineBasis", byId2.getName());
}
}
map.put("examineResult", "符合标准");
// 检测结果
LambdaQueryWrapper<ExamineResult> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ExamineResult::getExamineId, examine.getId());
ExamineResult examineResult = examineResultService.getOne(wrapper);
// json原始数据
List<ExamineResultVo> list = JSON.parseArray(examineResult.getExamineDataArr(), ExamineResultVo.class);
int yangNum = 0;
int yinNum = 0;
int keyiNum = 0;
for (ExamineResultVo vo : list) {
if (vo.getResult() != null && !"".equals(vo.getResult())) {
if (vo.getResult().contains("阳性")) {
yangNum++;
} else if ("阴性".equals(vo.getResult())) {
yinNum++;
} else if ("可疑".equals(vo.getResult())) {
keyiNum++;
}
}
}
String s = yangNum + "份为阳性," + yinNum + "份为阴性";
if (keyiNum > 0) {
s += "," + keyiNum + "份为可疑";
}
map.put("examineResult", s);
ItemAndAllList.add(map);
}
return ItemAndAllList;
@ -1233,7 +1255,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
if (i == (split2.length - 1)) {
instrumentName += s2;
} else {
instrumentName += s2 + "," + "\\r";
instrumentName += s2 + "\r";
}
}
result.put("9", instrumentName);
@ -1444,10 +1466,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
Map<String, Object> map = new HashMap<>();
map.put("num1", arrVOList.get(i).getExperieNum());
map.put("value1", replaceNullBySpace(arrVOList.get(i).getCtValue()));
map.put("result1", arrVOList.get(i).getValue());
map.put("result1", arrVOList.get(i).getResult());
map.put("num2", arrVOList.get(arrVOList.size() / 2 + i).getExperieNum());
map.put("value2", replaceNullBySpace(arrVOList.get(arrVOList.size() / 2 + i).getCtValue()));
map.put("result2", arrVOList.get(arrVOList.size() / 2 + i).getValue());
map.put("result2", arrVOList.get(arrVOList.size() / 2 + i).getResult());
resultList1.add(map);
}
} else {
@ -1455,11 +1477,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
Map<String, Object> map = new HashMap<>();
map.put("num1", arrVOList.get(i).getExperieNum());
map.put("value1", replaceNullBySpace(arrVOList.get(i).getCtValue()));
map.put("result1", arrVOList.get(i).getValue());
map.put("result1", arrVOList.get(i).getResult());
if (i < arrVOList.size() / 2) {
map.put("num2", arrVOList.get(arrVOList.size() / 2 + i + 1).getExperieNum());
map.put("value2", replaceNullBySpace(arrVOList.get(arrVOList.size() / 2 + i + 1).getCtValue()));
map.put("result2", arrVOList.get(arrVOList.size() / 2 + i + 1).getValue());
map.put("result2", arrVOList.get(arrVOList.size() / 2 + i + 1).getResult());
}
resultList1.add(map);
}
@ -1574,13 +1596,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
Map<String, Object> map = new HashMap<>();
map.put("num1", arrVOList.get(i).getExperieNum());
map.put("value1", arrVOList.get(i).getCtValue());
map.put("result1", arrVOList.get(i).getValue());
map.put("result1", arrVOList.get(i).getResult());
map.put("num2", arrVOList.get(arrVOList.size() / 3 + i).getExperieNum());
map.put("value2", arrVOList.get(arrVOList.size() / 3 + i).getCtValue());
map.put("result2", arrVOList.get(arrVOList.size() / 3 + i).getValue());
map.put("result2", arrVOList.get(arrVOList.size() / 3 + i).getResult());
map.put("num3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getExperieNum());
map.put("value3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getCtValue());
map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getValue());
map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getResult());
resultList1.add(map);
}
} else {
@ -1589,28 +1611,28 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
Map<String, Object> map = new HashMap<>();
map.put("num1", arrVOList.get(i).getExperieNum());
map.put("value1", arrVOList.get(i).getCtValue());
map.put("result1", arrVOList.get(i).getValue());
map.put("result1", arrVOList.get(i).getResult());
if (i < arrVOList.size() / 3) {
map.put("num2", arrVOList.get(arrVOList.size() / 3 + i + 1).getExperieNum());
map.put("value2", arrVOList.get(arrVOList.size() / 3 + i + 1).getCtValue());
map.put("result2", arrVOList.get(arrVOList.size() / 3 + i + 1).getValue());
map.put("result2", arrVOList.get(arrVOList.size() / 3 + i + 1).getResult());
map.put("num3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getExperieNum());
map.put("value3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getCtValue());
map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getValue());
map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getResult());
}
resultList1.add(map);
} else if (arrVOList.size() % 3 == 2) {
Map<String, Object> map = new HashMap<>();
map.put("num1", arrVOList.get(i).getExperieNum());
map.put("value1", arrVOList.get(i).getCtValue());
map.put("result1", arrVOList.get(i).getValue());
map.put("result1", arrVOList.get(i).getResult());
map.put("num2", arrVOList.get(arrVOList.size() / 3 + i + 1).getExperieNum());
map.put("value2", arrVOList.get(arrVOList.size() / 3 + i + 1).getCtValue());
map.put("result2", arrVOList.get(arrVOList.size() / 3 + i + 1).getValue());
map.put("result2", arrVOList.get(arrVOList.size() / 3 + i + 1).getResult());
if (i < arrVOList.size() / 3) {
map.put("num3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getExperieNum());
map.put("value3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getCtValue());
map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getValue());
map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getResult());
}
resultList1.add(map);
}
@ -1874,6 +1896,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
Map<String, Object> map = new HashMap<>();
if (j == 0) {
map.put("1", s + "(" + startNum + "-" + endNum + ")");
map.put("0", "布板图");
} else if (j == 1) {
map.put("0", " ");
map.put("1", "1");
@ -2158,6 +2181,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
Map<String, Object> map = new HashMap<>();
if (j == 0) {
map.put("1", s + "(" + startNum + "-" + endNum + ")");
map.put("0", "布板图");
} else if (j == 1) {
map.put("0", " ");
map.put("1", "1");
@ -2442,6 +2466,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
Map<String, Object> map = new HashMap<>();
if (j == 0) {
map.put("1", s + "(" + startNum + "-" + endNum + ")");
map.put("0", "布板图");
} else if (j == 1) {
map.put("0", " ");
map.put("1", "1");
@ -2846,6 +2871,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
Map<String, Object> map = new HashMap<>();
if (j == 0) {
map.put("1", s + "(" + startNum + "-" + endNum + ")");
map.put("0", "布板图");
} else if (j == 1) {
map.put("0", " ");
map.put("1", "1");
@ -2940,24 +2966,24 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
try {
doc = WordExportUtil.exportWord07(url, result);
/** ------------------尝试修改对齐方式 start ----------------------------**/
XWPFTable xwpfTable = doc.getTables().get(1);//获取第几个表格,从0开始
XWPFTableRow row = xwpfTable.getRow(2);//获取表格的数据行
XWPFTableCell cell11 = row.getCell(1);
XWPFTableCell cell1 = row.getCell(2);
XWPFTableCell cell22 = row.getCell(4);
XWPFTableCell cell2 = row.getCell(5);
XWPFParagraph sourcePara1 = cell1.getParagraphs().get(0);//获取每一行
XWPFParagraph sourcePara11 = cell11.getParagraphs().get(0);
sourcePara11.setAlignment(StringUtils.equals("阳性",sourcePara1.getText()) ? ParagraphAlignment.LEFT : ParagraphAlignment.RIGHT );
sourcePara1.setAlignment(StringUtils.equals("阳性",sourcePara1.getText()) ? ParagraphAlignment.LEFT : ParagraphAlignment.RIGHT );
XWPFParagraph sourcePara2 = cell2.getParagraphs().get(0);//获取每一行
XWPFParagraph sourcePara22 = cell22.getParagraphs().get(0);
sourcePara2.setAlignment(StringUtils.equals("阳性",sourcePara2.getText()) ? ParagraphAlignment.LEFT : ParagraphAlignment.RIGHT );
sourcePara22.setAlignment(StringUtils.equals("阳性",sourcePara2.getText()) ? ParagraphAlignment.LEFT : ParagraphAlignment.RIGHT );
// XWPFTable xwpfTable = doc.getTables().get(1);//获取第几个表格,从0开始
// XWPFTableRow row = xwpfTable.getRow(2);//获取表格的数据行
//
// XWPFTableCell cell11 = row.getCell(1);
// XWPFTableCell cell1 = row.getCell(2);
//
// XWPFTableCell cell22 = row.getCell(4);
// XWPFTableCell cell2 = row.getCell(5);
//
// XWPFParagraph sourcePara1 = cell1.getParagraphs().get(0);//获取每一行
// XWPFParagraph sourcePara11 = cell11.getParagraphs().get(0);
// sourcePara11.setAlignment(StringUtils.equals("阳性",sourcePara1.getText()) ? ParagraphAlignment.LEFT : ParagraphAlignment.RIGHT );
// sourcePara1.setAlignment(StringUtils.equals("阳性",sourcePara1.getText()) ? ParagraphAlignment.LEFT : ParagraphAlignment.RIGHT );
//
// XWPFParagraph sourcePara2 = cell2.getParagraphs().get(0);//获取每一行
// XWPFParagraph sourcePara22 = cell22.getParagraphs().get(0);
// sourcePara2.setAlignment(StringUtils.equals("阳性",sourcePara2.getText()) ? ParagraphAlignment.LEFT : ParagraphAlignment.RIGHT );
// sourcePara22.setAlignment(StringUtils.equals("阳性",sourcePara2.getText()) ? ParagraphAlignment.LEFT : ParagraphAlignment.RIGHT );
/** ------------------尝试修改对齐方式 end ------------------------------**/
// fos = new FileOutputStream("C://Users//AAA//Desktop//shuojin//dayin//检测报告2.docx");
@ -3004,7 +3030,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
for (int i = 0; i < split.length - 1; i++) {
result += split[i] + "-";
}
result = result.substring(0, result.length()-1);
result = result.substring(0, result.length() - 1);
}
return result;
}
@ -3253,14 +3279,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
String deptName = sysClient.getDeptName(eTask.getDeptId()).getData();
result.put("deptName", deptName);
result.put("acceptanceNum", entrust.getAcceptanceNum());
/** *通过主表id到f_entruest_simple子表中获取experie_num的前缀作为检验编号 start **/
QueryWrapper<Simple> simpleWrapper = new QueryWrapper<>();
simpleWrapper.eq("entrustId" ,Long.valueOf(id));
Simple simple = simpleService.getOne(simpleWrapper);
result.put("experieNo", simple.getExperieNum().split("-")[0]);
/** *通过主表id到f_entruest_simple子表中获取experie_num的前缀作为检验编号 end **/
// result.put("acceptanceNum", entrust.getAcceptanceNum());
if (eTask != null) {
// position1
@ -3312,10 +3331,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
result.put("flowTime", "/");
}
//检测任务书交回日期
// result.put("backCrossTime", format.format(eTask.getBackCrossTime()));
// String name1 = userClient.userInfoById(Long.parseLong(eTask.getBackCrossRecipientBy())).getData().getName();
result.put("backCrossTime", format.format(eTask.getBackCrossTime()));
String name1 = userClient.userInfoById(Long.parseLong(eTask.getBackCrossRecipientBy())).getData().getName();
//接收人
// result.put("backCrossRecipient", name1);
result.put("backCrossRecipient", name1);
}
}
@ -3328,7 +3347,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
if (CollectionUtils.isNotEmpty(examineList)) {
for (Examine examine : examineList) {
Map<String, Object> map = new HashMap<>();
map.put("simpleName", examine.getSimpleName());
map.put("simpleName", StringUtils.remove(examine.getSimpleName(), "-"));
map.put("simpleCount", examine.getSimpleCount());
// 获取当前检测对应的检测编号
String[] split = examine.getExperieNum().split(",");
@ -3357,6 +3376,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
resultList.add(map);
}
String s = examineList.get(0).getExperieNum().split(",")[0];
result.put("acceptanceNum", getExperieNumPrefix(s));
}
result.put("resultList", resultList);
@ -3594,7 +3615,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
map.put("originalNum", simple.getOriginalNum());
map.put("num", excel.getExperieNum());
map.put("value", excel.getCtValue());
map.put("result", excel.getValue());
map.put("result", excel.getResult());
resultList.add(map);
}
}
@ -3615,7 +3636,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
map.put("originalNum", simple.getOriginalNum());
map.put("num", excel.getExperieNum());
map.put("value", excel.getCtValue());
map.put("result", excel.getValue());
map.put("result", excel.getResult());
resultList.add(map);
}
}

Loading…
Cancel
Save