|
|
|
|
@ -8,7 +8,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import lombok.NoArgsConstructor; |
|
|
|
|
import org.apache.commons.lang3.RandomUtils; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument; |
|
|
|
|
import org.springblade.common.utils.ZipCompressUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.lims.entry.*; |
|
|
|
|
import org.springblade.lims.excel.ExamineTemplate2Excel; |
|
|
|
|
@ -29,6 +31,7 @@ import org.springframework.context.annotation.Lazy; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import javax.servlet.ServletOutputStream; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.io.*; |
|
|
|
|
import java.net.HttpURLConnection; |
|
|
|
|
@ -88,6 +91,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
private EntrustCustomerServiceImpl customerService; |
|
|
|
|
@Autowired |
|
|
|
|
private IContractService contractService; |
|
|
|
|
@Autowired |
|
|
|
|
private IRepairApplicationService repairApplicationService; |
|
|
|
|
|
|
|
|
|
@Value("${handleUrl}") |
|
|
|
|
private String handleUrl; |
|
|
|
|
@ -158,22 +163,34 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
@Value("${simpleReceivePrint}") |
|
|
|
|
private String simpleReceivePrint; |
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> resultList2 = new ArrayList<>(); |
|
|
|
|
@Value("${repairPrint}") |
|
|
|
|
private String repairPrint; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public Entrust addEntrust(Entrust entrust) { |
|
|
|
|
// 如果是追加检测项目
|
|
|
|
|
if (entrust.getOperatType() != null && "1".equals(entrust.getOperatType())) { |
|
|
|
|
entrust.setEntrustStatus("2.1"); |
|
|
|
|
this.updateById(entrust); |
|
|
|
|
return entrust; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
long id = RandomUtils.nextLong(); |
|
|
|
|
|
|
|
|
|
// 送检单位、采样单位之类的,如果没有就新增
|
|
|
|
|
addIfNull(entrust); |
|
|
|
|
|
|
|
|
|
// 新增或修改 检测集合
|
|
|
|
|
addOrUpdateExamines(entrust.getExamines(), entrust, id); |
|
|
|
|
|
|
|
|
|
// 如果是修改
|
|
|
|
|
if (entrust.getOperatType() != null && "1".equals(entrust.getOperatType())) { |
|
|
|
|
LambdaQueryWrapper<Examine> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.eq(Examine::getEntrustId, entrust.getId()); |
|
|
|
|
List<Examine> examines = examineService.list(wrapper); |
|
|
|
|
if (examines.size() < entrust.getExamines().size()) { |
|
|
|
|
entrust.setEntrustStatus("2.1"); |
|
|
|
|
} |
|
|
|
|
this.updateById(entrust); |
|
|
|
|
return entrust; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 样品关联数据入库
|
|
|
|
|
entrust = addSimpleRel(entrust, id); |
|
|
|
|
|
|
|
|
|
@ -183,8 +200,6 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
// 委托单入库/修改
|
|
|
|
|
addOrUpdateEntrust(entrust, id); |
|
|
|
|
|
|
|
|
|
// 新增或修改 检测集合
|
|
|
|
|
addOrUpdateExamines(entrust.getExamines(), entrust); |
|
|
|
|
return entrust; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -348,17 +363,38 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
|
|
|
|
|
// 根据检测的数量判断用按个模板
|
|
|
|
|
switch (examineCount) { |
|
|
|
|
case 1: currTemplate = print1; break; |
|
|
|
|
case 2: currTemplate = print2; break; |
|
|
|
|
case 3: currTemplate = print3; break; |
|
|
|
|
case 4: currTemplate = print4; break; |
|
|
|
|
case 5: currTemplate = print5; break; |
|
|
|
|
case 6: currTemplate = print6; break; |
|
|
|
|
case 7: currTemplate = print7; break; |
|
|
|
|
case 8: currTemplate = print8; break; |
|
|
|
|
case 9: currTemplate = print9; break; |
|
|
|
|
case 10: currTemplate = print10; break; |
|
|
|
|
default: currTemplate = print10; |
|
|
|
|
case 1: |
|
|
|
|
currTemplate = print1; |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
currTemplate = print2; |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
currTemplate = print3; |
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
|
currTemplate = print4; |
|
|
|
|
break; |
|
|
|
|
case 5: |
|
|
|
|
currTemplate = print5; |
|
|
|
|
break; |
|
|
|
|
case 6: |
|
|
|
|
currTemplate = print6; |
|
|
|
|
break; |
|
|
|
|
case 7: |
|
|
|
|
currTemplate = print7; |
|
|
|
|
break; |
|
|
|
|
case 8: |
|
|
|
|
currTemplate = print8; |
|
|
|
|
break; |
|
|
|
|
case 9: |
|
|
|
|
currTemplate = print9; |
|
|
|
|
break; |
|
|
|
|
case 10: |
|
|
|
|
currTemplate = print10; |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
currTemplate = print10; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<ExamineResultVo> resultList = new ArrayList<>(); |
|
|
|
|
@ -423,7 +459,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
List<XN2Excel> list = JSON.parseArray(examineResult.getExamineDataArr(), XN2Excel.class); |
|
|
|
|
if (list != null && list.size() > 0) { |
|
|
|
|
for (XN2Excel excel : list) { |
|
|
|
|
ExamineResultVo resultVo = new ExamineResultVo(); LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
ExamineResultVo resultVo = new ExamineResultVo(); |
|
|
|
|
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper1.eq(Simple::getEntrustId, id); |
|
|
|
|
wrapper1.eq(Simple::getExperieNum, excel.getExperieNum()); |
|
|
|
|
Simple simple = simpleService.getOne(wrapper1); |
|
|
|
|
@ -915,7 +952,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
public void reportPrint(String examineId, HttpServletResponse response) { |
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
List<Map<String, Object>> resultList1 = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> resultList2 = new ArrayList<>(); |
|
|
|
|
String url = ""; |
|
|
|
|
// 检测数据
|
|
|
|
|
Examine examine = examineService.getById(examineId); |
|
|
|
|
@ -972,19 +1009,19 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
String batchNos = examineResult.getBatchNos(); |
|
|
|
|
String[] split3 = batchNos.split(","); |
|
|
|
|
Map<String, List<String>> tempListMap = new HashMap(); |
|
|
|
|
for (String batch : split3) { |
|
|
|
|
for (String batch : split3) { |
|
|
|
|
String reagentId = batch.split("-")[0]; |
|
|
|
|
String realBatch = batch.split("-")[1]; |
|
|
|
|
List<String> list = tempListMap.get(reagentId); |
|
|
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
|
|
list.add(realBatch); |
|
|
|
|
} else { |
|
|
|
|
List<String> temp = new ArrayList<>(); |
|
|
|
|
temp.add(realBatch); |
|
|
|
|
tempListMap.put(reagentId, temp); |
|
|
|
|
} |
|
|
|
|
String realBatch = batch.split("-")[1]; |
|
|
|
|
List<String> list = tempListMap.get(reagentId); |
|
|
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
|
|
list.add(realBatch); |
|
|
|
|
} else { |
|
|
|
|
List<String> temp = new ArrayList<>(); |
|
|
|
|
temp.add(realBatch); |
|
|
|
|
tempListMap.put(reagentId, temp); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
String resultBatchStr = ""; |
|
|
|
|
String resultBatchStr = ""; |
|
|
|
|
// 遍历处理批号
|
|
|
|
|
Set<String> strings = tempListMap.keySet(); |
|
|
|
|
for (String reagentId : strings) { |
|
|
|
|
@ -1351,8 +1388,19 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
map.put("10", "10"); |
|
|
|
|
map.put("11", "11"); |
|
|
|
|
map.put("12", "12"); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
map.put("13", "1"); |
|
|
|
|
map.put("14", "2"); |
|
|
|
|
map.put("15", "3"); |
|
|
|
|
map.put("16", "4"); |
|
|
|
|
map.put("17", "5"); |
|
|
|
|
map.put("18", "6"); |
|
|
|
|
map.put("19", "7"); |
|
|
|
|
map.put("20", "8"); |
|
|
|
|
map.put("21", "9"); |
|
|
|
|
map.put("22", "10"); |
|
|
|
|
map.put("23", "11"); |
|
|
|
|
map.put("24", "12"); |
|
|
|
|
} else { |
|
|
|
|
if (j == 1) { |
|
|
|
|
map.put("0", "A"); |
|
|
|
|
} |
|
|
|
|
@ -1377,29 +1425,39 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
if (j == 8) { |
|
|
|
|
map.put("0", "H"); |
|
|
|
|
} |
|
|
|
|
map.put("1", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("2", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("3", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("4", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("5", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("6", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("7", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("8", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("9", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("10", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("11", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("12", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
for (int k = 1; k <= 12; k++) { |
|
|
|
|
map.put(k + "", list.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
String num = list.get(start + (8 * x + j) - 1).getNum(); |
|
|
|
|
if (num != null && !"".equals(num) && num.split("-").length == 3) { |
|
|
|
|
map.put((k + 12) + "", num.split("-")[2]); |
|
|
|
|
} else { |
|
|
|
|
map.put((k + 12) + "", " "); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
} |
|
|
|
|
// map.put("1", list.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("2", list.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("3", list.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("4", list.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("5", list.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("6", list.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("7", list.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("8", list.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("9", list.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("10", list.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("11", list.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("12", list.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
} |
|
|
|
|
resultList2.add(map); |
|
|
|
|
} |
|
|
|
|
@ -1517,8 +1575,19 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
map.put("10", "10"); |
|
|
|
|
map.put("11", "11"); |
|
|
|
|
map.put("12", "12"); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
map.put("13", "1"); |
|
|
|
|
map.put("14", "2"); |
|
|
|
|
map.put("15", "3"); |
|
|
|
|
map.put("16", "4"); |
|
|
|
|
map.put("17", "5"); |
|
|
|
|
map.put("18", "6"); |
|
|
|
|
map.put("19", "7"); |
|
|
|
|
map.put("20", "8"); |
|
|
|
|
map.put("21", "9"); |
|
|
|
|
map.put("22", "10"); |
|
|
|
|
map.put("23", "11"); |
|
|
|
|
map.put("24", "12"); |
|
|
|
|
} else { |
|
|
|
|
if (j == 1) { |
|
|
|
|
map.put("0", "A"); |
|
|
|
|
} |
|
|
|
|
@ -1543,29 +1612,39 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
if (j == 8) { |
|
|
|
|
map.put("0", "H"); |
|
|
|
|
} |
|
|
|
|
map.put("1", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("2", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("3", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("4", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("5", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("6", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("7", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("8", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("9", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("10", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("11", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("12", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
for (int k = 1; k <= 12; k++) { |
|
|
|
|
map.put(k + "", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
String num = arrVOList.get(start + (8 * x + j) - 1).getNum(); |
|
|
|
|
if (num != null && !"".equals(num) && num.split("-").length == 3) { |
|
|
|
|
map.put((k + 12) + "", num.split("-")[2]); |
|
|
|
|
} else { |
|
|
|
|
map.put((k + 12) + "", " "); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
} |
|
|
|
|
// map.put("1", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("2", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("3", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("4", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("5", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("6", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("7", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("8", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("9", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("10", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("11", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("12", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
} |
|
|
|
|
resultList2.add(map); |
|
|
|
|
} |
|
|
|
|
@ -1683,8 +1762,19 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
map.put("10", "10"); |
|
|
|
|
map.put("11", "11"); |
|
|
|
|
map.put("12", "12"); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
map.put("13", "1"); |
|
|
|
|
map.put("14", "2"); |
|
|
|
|
map.put("15", "3"); |
|
|
|
|
map.put("16", "4"); |
|
|
|
|
map.put("17", "5"); |
|
|
|
|
map.put("18", "6"); |
|
|
|
|
map.put("19", "7"); |
|
|
|
|
map.put("20", "8"); |
|
|
|
|
map.put("21", "9"); |
|
|
|
|
map.put("22", "10"); |
|
|
|
|
map.put("23", "11"); |
|
|
|
|
map.put("24", "12"); |
|
|
|
|
} else { |
|
|
|
|
if (j == 1) { |
|
|
|
|
map.put("0", "A"); |
|
|
|
|
} |
|
|
|
|
@ -1709,29 +1799,39 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
if (j == 8) { |
|
|
|
|
map.put("0", "H"); |
|
|
|
|
} |
|
|
|
|
map.put("1", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("2", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("3", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("4", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("5", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("6", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("7", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("8", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("9", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("10", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("11", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
x++; |
|
|
|
|
map.put("12", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
for (int k = 1; k <= 12; k++) { |
|
|
|
|
map.put(k + "", arrVOList.get(start + (8 * x + j) - 1).getValue()); |
|
|
|
|
String num = arrVOList.get(start + (8 * x + j) - 1).getNum(); |
|
|
|
|
if (num != null && !"".equals(num) && num.split("-").length == 3) { |
|
|
|
|
map.put((k + 12) + "", num.split("-")[2]); |
|
|
|
|
} else { |
|
|
|
|
map.put((k + 12) + "", " "); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
} |
|
|
|
|
// map.put("1", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("2", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("3", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("4", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("5", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("6", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("7", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("8", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("9", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("10", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("11", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("12", arrVOList.get(start + (8 * x + j) - 1).getValue());
|
|
|
|
|
} |
|
|
|
|
resultList2.add(map); |
|
|
|
|
} |
|
|
|
|
@ -1747,21 +1847,24 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
double a1 = Double.parseDouble(list.get(i * 96).getOriginResult()); |
|
|
|
|
double b1 = Double.parseDouble(list.get((i * 96) + 1).getOriginResult()); |
|
|
|
|
String format = df.format((a1 + b1) / 2); |
|
|
|
|
list.get(i * 96).setNum("阴性对照平均OD值"); |
|
|
|
|
list.get(i * 96).setValue(format); |
|
|
|
|
list.get(i * 96).setResult(" "); |
|
|
|
|
list1.add(list.get(i * 96)); |
|
|
|
|
ExamineDataArrVO arrVO = new ExamineDataArrVO(); |
|
|
|
|
arrVO.setNum("阴性对照平均OD值"); |
|
|
|
|
arrVO.setValue(format); |
|
|
|
|
arrVO.setResult(" "); |
|
|
|
|
list1.add(arrVO); |
|
|
|
|
double a2 = Double.parseDouble(list.get((i * 96) + 2).getOriginResult()); |
|
|
|
|
double b2 = Double.parseDouble(list.get((i * 96) + 3).getOriginResult()); |
|
|
|
|
String format1 = df.format((a2 + b2) / 2); |
|
|
|
|
list.get((i * 96) + 1).setNum("阳性对照平均OD值"); |
|
|
|
|
list.get((i * 96) + 1).setValue(format1); |
|
|
|
|
list.get((i * 96) + 1).setResult(" "); |
|
|
|
|
list1.add(list.get((i * 96) + 1)); |
|
|
|
|
ExamineDataArrVO arrVO1 = new ExamineDataArrVO(); |
|
|
|
|
arrVO1.setNum("阳性对照平均OD值"); |
|
|
|
|
arrVO1.setValue(format1); |
|
|
|
|
arrVO1.setResult(" "); |
|
|
|
|
list1.add(arrVO1); |
|
|
|
|
|
|
|
|
|
for (int j = 0; j < 96; j++) { |
|
|
|
|
if (j > 5) { |
|
|
|
|
list1.add(list.get((i * 96) + j)); |
|
|
|
|
ExamineDataArrVO vo = list.get((i * 96) + j); |
|
|
|
|
if (vo.getNum() != null && !"".equals(vo.getNum())) { |
|
|
|
|
list1.add(vo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -1770,24 +1873,27 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
double a1 = Double.parseDouble(list.get(i * 96).getOriginResult()); |
|
|
|
|
double b1 = Double.parseDouble(list.get((i * 96) + 1).getOriginResult()); |
|
|
|
|
String format = df.format((a1 + b1) / 2); |
|
|
|
|
list.get(i * 96).setNum("阴性对照平均OD值"); |
|
|
|
|
list.get(i * 96).setValue(format); |
|
|
|
|
list.get(i * 96).setResult(" "); |
|
|
|
|
list1.add(list.get(i * 96)); |
|
|
|
|
ExamineDataArrVO arrVO = new ExamineDataArrVO(); |
|
|
|
|
arrVO.setNum("阴性对照平均OD值"); |
|
|
|
|
arrVO.setValue(format); |
|
|
|
|
arrVO.setResult(" "); |
|
|
|
|
list1.add(arrVO); |
|
|
|
|
double a2 = Double.parseDouble(list.get((i * 96) + 2).getOriginResult()); |
|
|
|
|
double b2 = Double.parseDouble(list.get((i * 96) + 3).getOriginResult()); |
|
|
|
|
String format1 = df.format((a2 + b2) / 2); |
|
|
|
|
list.get((i * 96) + 1).setNum("阳性对照平均OD值"); |
|
|
|
|
list.get((i * 96) + 1).setValue(format1); |
|
|
|
|
list.get((i * 96) + 1).setResult(" "); |
|
|
|
|
list1.add(list.get((i * 96) + 1)); |
|
|
|
|
ExamineDataArrVO arrVO1 = new ExamineDataArrVO(); |
|
|
|
|
arrVO1.setNum("阳性对照平均OD值"); |
|
|
|
|
arrVO1.setValue(format1); |
|
|
|
|
arrVO1.setResult(" "); |
|
|
|
|
list1.add(arrVO1); |
|
|
|
|
|
|
|
|
|
for (int j = 0; j < 96; j++) { |
|
|
|
|
if ((i * 96) + j > list.size() - 1) { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
if (j > 5) { |
|
|
|
|
list1.add(list.get((i * 96) + j)); |
|
|
|
|
ExamineDataArrVO vo = list.get((i * 96) + j); |
|
|
|
|
if (vo.getNum() != null && !"".equals(vo.getNum())) { |
|
|
|
|
list1.add(vo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -1810,7 +1916,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
map.put("result3", list1.get(list1.size() / 3 * 2 + i).getResult()); |
|
|
|
|
resultList1.add(map); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
for (int i = 0; i < list1.size() / 3 + 1; i++) { |
|
|
|
|
if (list1.size() % 3 == 1) { |
|
|
|
|
|
|
|
|
|
@ -1847,7 +1954,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
result.put("list1", resultList1); |
|
|
|
|
} |
|
|
|
|
url = reportPrint; |
|
|
|
|
|
|
|
|
|
// 原始酶标板数据
|
|
|
|
|
if (list.size() % 96 != 0) { |
|
|
|
|
for (int i = 0; i < (list.size() / 96 + 1); i++) { |
|
|
|
|
int start = i * 96; |
|
|
|
|
@ -1871,6 +1978,18 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
map.put("10", "10"); |
|
|
|
|
map.put("11", "11"); |
|
|
|
|
map.put("12", "12"); |
|
|
|
|
map.put("13", "1"); |
|
|
|
|
map.put("14", "2"); |
|
|
|
|
map.put("15", "3"); |
|
|
|
|
map.put("16", "4"); |
|
|
|
|
map.put("17", "5"); |
|
|
|
|
map.put("18", "6"); |
|
|
|
|
map.put("19", "7"); |
|
|
|
|
map.put("20", "8"); |
|
|
|
|
map.put("21", "9"); |
|
|
|
|
map.put("22", "10"); |
|
|
|
|
map.put("23", "11"); |
|
|
|
|
map.put("24", "12"); |
|
|
|
|
} else { |
|
|
|
|
if (j == 1) { |
|
|
|
|
map.put("0", "A"); |
|
|
|
|
@ -1896,53 +2015,71 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
if (j == 8) { |
|
|
|
|
map.put("0", "H"); |
|
|
|
|
} |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put("1", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put("2", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put("3", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put("4", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put("5", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put("6", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put("7", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put("8", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put("9", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put("10", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put("11", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put("12", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
} |
|
|
|
|
for (int k = 1; k <= 12; k++) { |
|
|
|
|
if (list.size() - 1 >= start + (8 * x + j) - 1) { |
|
|
|
|
map.put(k + "", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
String num = list.get(start + (8 * x + j) - 1).getNum(); |
|
|
|
|
if (num != null && !"".equals(num) && num.split("-").length == 3) { |
|
|
|
|
map.put((k + 12) + "", num.split("-")[2]); |
|
|
|
|
} else { |
|
|
|
|
map.put((k + 12) + "", " "); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
} |
|
|
|
|
// if (list.size() - 1 >= start + (8 * x + j) - 1) {
|
|
|
|
|
// map.put("1", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// String num = list.get(start + (8 * x + j) - 1).getNum();
|
|
|
|
|
// if (num != null && !"".equals(num) && num.split("-").length == 3) {
|
|
|
|
|
// map.put("13", num.split("-")[2]);
|
|
|
|
|
// } else {
|
|
|
|
|
// map.put("13", " ");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// x++;
|
|
|
|
|
// if (list.size() - 1 >= start + (8 * x + j) - 1) {
|
|
|
|
|
// map.put("2", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// }
|
|
|
|
|
// x++;
|
|
|
|
|
// if (list.size() - 1 >= start + (8 * x + j) - 1) {
|
|
|
|
|
// map.put("3", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// }
|
|
|
|
|
// x++;
|
|
|
|
|
// if (list.size() - 1 >= start + (8 * x + j) - 1) {
|
|
|
|
|
// map.put("4", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// }
|
|
|
|
|
// x++;
|
|
|
|
|
// if (list.size() - 1 >= start + (8 * x + j) - 1) {
|
|
|
|
|
// map.put("5", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// }
|
|
|
|
|
// x++;
|
|
|
|
|
// if (list.size() - 1 >= start + (8 * x + j) - 1) {
|
|
|
|
|
// map.put("6", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// }
|
|
|
|
|
// x++;
|
|
|
|
|
// if (list.size() - 1 >= start + (8 * x + j) - 1) {
|
|
|
|
|
// map.put("7", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// }
|
|
|
|
|
// x++;
|
|
|
|
|
// if (list.size() - 1 >= start + (8 * x + j) - 1) {
|
|
|
|
|
// map.put("8", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// }
|
|
|
|
|
// x++;
|
|
|
|
|
// if (list.size() - 1 >= start + (8 * x + j) - 1) {
|
|
|
|
|
// map.put("9", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// }
|
|
|
|
|
// x++;
|
|
|
|
|
// if (list.size() - 1 >= start + (8 * x + j) - 1) {
|
|
|
|
|
// map.put("10", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// }
|
|
|
|
|
// x++;
|
|
|
|
|
// if (list.size() - 1 >= start + (8 * x + j) - 1) {
|
|
|
|
|
// map.put("11", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// }
|
|
|
|
|
// x++;
|
|
|
|
|
// if (list.size() - 1 >= start + (8 * x + j) - 1) {
|
|
|
|
|
// map.put("12", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
resultList2.add(map); |
|
|
|
|
} |
|
|
|
|
@ -1970,6 +2107,18 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
map.put("10", "10"); |
|
|
|
|
map.put("11", "11"); |
|
|
|
|
map.put("12", "12"); |
|
|
|
|
map.put("13", "1"); |
|
|
|
|
map.put("14", "2"); |
|
|
|
|
map.put("15", "3"); |
|
|
|
|
map.put("16", "4"); |
|
|
|
|
map.put("17", "5"); |
|
|
|
|
map.put("18", "6"); |
|
|
|
|
map.put("19", "7"); |
|
|
|
|
map.put("20", "8"); |
|
|
|
|
map.put("21", "9"); |
|
|
|
|
map.put("22", "10"); |
|
|
|
|
map.put("23", "11"); |
|
|
|
|
map.put("24", "12"); |
|
|
|
|
} else { |
|
|
|
|
if (j == 1) { |
|
|
|
|
map.put("0", "A"); |
|
|
|
|
@ -1995,29 +2144,39 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
if (j == 8) { |
|
|
|
|
map.put("0", "H"); |
|
|
|
|
} |
|
|
|
|
map.put("1", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
x++; |
|
|
|
|
map.put("2", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
x++; |
|
|
|
|
map.put("3", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
x++; |
|
|
|
|
map.put("4", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
x++; |
|
|
|
|
map.put("5", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
x++; |
|
|
|
|
map.put("6", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
x++; |
|
|
|
|
map.put("7", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
x++; |
|
|
|
|
map.put("8", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
x++; |
|
|
|
|
map.put("9", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
x++; |
|
|
|
|
map.put("10", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
x++; |
|
|
|
|
map.put("11", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
x++; |
|
|
|
|
map.put("12", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
for (int k = 1; k <= 12; k++) { |
|
|
|
|
map.put(k + "", list.get(start + (8 * x + j) - 1).getOriginResult()); |
|
|
|
|
String num = list.get(start + (8 * x + j) - 1).getNum(); |
|
|
|
|
if (num != null && !"".equals(num) && num.split("-").length == 3) { |
|
|
|
|
map.put((k + 12) + "", num.split("-")[2]); |
|
|
|
|
} else { |
|
|
|
|
map.put((k + 12) + "", " "); |
|
|
|
|
} |
|
|
|
|
x++; |
|
|
|
|
} |
|
|
|
|
// map.put("1", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("2", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("3", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("4", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("5", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("6", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("7", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("8", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("9", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("10", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("11", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
// x++;
|
|
|
|
|
// map.put("12", list.get(start + (8 * x + j) - 1).getOriginResult());
|
|
|
|
|
} |
|
|
|
|
resultList2.add(map); |
|
|
|
|
} |
|
|
|
|
@ -2778,8 +2937,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
} else { |
|
|
|
|
for (int i = 0; i < list.size() / 96 + 1; i++) { |
|
|
|
|
double a1 = Double.parseDouble(list.get(i * 96).getOriginResult()); |
|
|
|
|
double b1 = Double.parseDouble(list.get((i * 96) + 1).getOriginResult()); |
|
|
|
|
@ -2873,6 +3031,108 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void repairPrint(String id, HttpServletResponse response) { |
|
|
|
|
String dateStamp = new java.text.SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); |
|
|
|
|
String srcPathName = "C://Users//AAA//Desktop//shuojin//" + dateStamp; |
|
|
|
|
String outputFile = "C://Users//AAA//Desktop//shuojin//" + dateStamp + ".zip"; |
|
|
|
|
File file = new File(srcPathName); |
|
|
|
|
//如果文件夹不存在,创建文件夹
|
|
|
|
|
if(!file.exists()){ |
|
|
|
|
file.mkdir(); |
|
|
|
|
} |
|
|
|
|
XWPFDocument doc = null; |
|
|
|
|
FileOutputStream fos = null; |
|
|
|
|
String[] repairIds = id.split(","); |
|
|
|
|
for (String repairId : repairIds) { |
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日"); |
|
|
|
|
RepairApplication repair = repairApplicationService.getById(repairId); |
|
|
|
|
result.put("1", repair.getCode()); |
|
|
|
|
result.put("2", repair.getApplyRepairDept()); |
|
|
|
|
result.put("3", repair.getName()); |
|
|
|
|
result.put("4", repair.getCode()); |
|
|
|
|
result.put("5", repair.getManufacturer()); |
|
|
|
|
result.put("6", repair.getVersion()); |
|
|
|
|
result.put("7", format.format(repair.getProductionDate())); |
|
|
|
|
result.put("8", format.format(repair.getEnableDate())); |
|
|
|
|
result.put("9", repair.getFaultPhenomenon()); |
|
|
|
|
result.put("10", repair.getApplyUserName()); |
|
|
|
|
result.put("11", repair.getApplyDeptUserName()); |
|
|
|
|
result.put("12", format.format(repair.getApplyDate())); |
|
|
|
|
result.put("13", repair.getReviewComments()); |
|
|
|
|
result.put("14", repair.getBusinessOfficeName()); |
|
|
|
|
result.put("15", format.format(repair.getReviewDate())); |
|
|
|
|
result.put("16", repair.getApprovalComments()); |
|
|
|
|
result.put("17", repair.getCenterDirectorName()); |
|
|
|
|
result.put("18", format.format(repair.getApplyDate())); |
|
|
|
|
result.put("19", repair.getMaintenanceRecord()); |
|
|
|
|
result.put("20", repair.getMaintainer()); |
|
|
|
|
result.put("21", format.format(repair.getMaintainerDate())); |
|
|
|
|
result.put("22", repair.getWorkingHours()); |
|
|
|
|
result.put("23", repair.getLaborCost()); |
|
|
|
|
result.put("24", repair.getMaterialCost()); |
|
|
|
|
result.put("25", repair.getTotalCost()); |
|
|
|
|
result.put("26", repair.getAcceptedName()); |
|
|
|
|
result.put("27", format.format(repair.getAcceptedDate())); |
|
|
|
|
result.put("28", repair.getRemark()); |
|
|
|
|
result.put("29", repair.getUserComments()); |
|
|
|
|
try { |
|
|
|
|
doc = WordExportUtil.exportWord07(repairPrint, result); |
|
|
|
|
fos = new FileOutputStream(srcPathName + "//" + repair.getName() + "报修申请表.docx"); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} finally { |
|
|
|
|
if (null != doc) { |
|
|
|
|
try { |
|
|
|
|
doc.write(fos); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (null != fos) { |
|
|
|
|
try { |
|
|
|
|
fos.close(); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (null != doc) { |
|
|
|
|
try { |
|
|
|
|
doc.close(); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
ZipCompressUtil.compress(srcPathName, outputFile); |
|
|
|
|
|
|
|
|
|
// 返回文件流给前端
|
|
|
|
|
response.setContentType("application/x-msdownload;"); |
|
|
|
|
response.setHeader("Content-disposition", "attachment;filename=" + dateStamp + ".zip"); |
|
|
|
|
//注:如果返回content-length的时候,先复制一下输入流,此时记录文件长度,返回复制之后的文件流
|
|
|
|
|
File file1 = new File(outputFile); |
|
|
|
|
try { |
|
|
|
|
InputStream stream = new FileInputStream(file1); |
|
|
|
|
|
|
|
|
|
ServletOutputStream out = response.getOutputStream(); |
|
|
|
|
|
|
|
|
|
byte buff[] = new byte[1024]; |
|
|
|
|
|
|
|
|
|
int length = 0; |
|
|
|
|
|
|
|
|
|
while ((length = stream.read(buff)) > 0) { |
|
|
|
|
out.write(buff,0,length); |
|
|
|
|
} |
|
|
|
|
stream.close(); |
|
|
|
|
out.close(); |
|
|
|
|
out.flush(); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据网络图片URL转成字节数组(弃用) |
|
|
|
|
*/ |
|
|
|
|
@ -2993,7 +3253,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
// 委托单内容补充
|
|
|
|
|
entrust.setSimpleName(simpleName.toString()); |
|
|
|
|
entrust.setSimpleCount(simpleCount); |
|
|
|
|
String originalNum = "01-" + fullByZero(simpleCount); |
|
|
|
|
String originalNum = "01-" + fullByZero(simpleCount); |
|
|
|
|
|
|
|
|
|
entrust.setIsDeleted(0); |
|
|
|
|
entrust.setCreateUser(null); |
|
|
|
|
@ -3053,7 +3313,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
/** |
|
|
|
|
* 新增或修改检验集合 |
|
|
|
|
*/ |
|
|
|
|
private void addOrUpdateExamines(List<Examine> examines, Entrust entrust) { |
|
|
|
|
private void addOrUpdateExamines(List<Examine> examines, Entrust entrust, Long id) { |
|
|
|
|
if (CollectionUtils.isNotEmpty(examines)) { |
|
|
|
|
List<Examine> saveList = new ArrayList<>(); |
|
|
|
|
List<Examine> updateList = new ArrayList<>(); |
|
|
|
|
@ -3067,7 +3327,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
examine.setSimpleCount(0); |
|
|
|
|
examine.setExperieNum(""); |
|
|
|
|
examine.setExamineOrder(i + 1); |
|
|
|
|
examine.setEntrustId(entrust.getId()); |
|
|
|
|
if (entrust.getId() != null) { |
|
|
|
|
examine.setEntrustId(entrust.getId()); |
|
|
|
|
} else { |
|
|
|
|
examine.setEntrustId(id); |
|
|
|
|
} |
|
|
|
|
examine.setAcceptanceNum(entrust.getAcceptanceNum()); |
|
|
|
|
examine.setCreateTime(new Date()); |
|
|
|
|
examine.setUpdateTime(new Date()); |
|
|
|
|
@ -3086,11 +3350,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> |
|
|
|
|
private void addUseCount(int type, Long elementId) { |
|
|
|
|
System.out.println("type:" + type); |
|
|
|
|
System.out.println("elementId: " + elementId); |
|
|
|
|
if (elementId == null) { return; } |
|
|
|
|
if (elementId == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (type == 1) { |
|
|
|
|
ExamineItem examineItem = examineItemService.getById(elementId); |
|
|
|
|
Integer useCount = examineItem.getUseCount(); |
|
|
|
|
examineItem.setUseCount(++ useCount); |
|
|
|
|
examineItem.setUseCount(++useCount); |
|
|
|
|
examineItemService.updateById(examineItem); |
|
|
|
|
} |
|
|
|
|
if (type == 2) { |
|
|
|
|
|