|
|
|
@ -22,18 +22,23 @@ import digital.laboratory.platform.common.mybatis.security.service.DLPUser; |
|
|
|
|
import digital.laboratory.platform.common.oss.service.OssFile; |
|
|
|
|
import digital.laboratory.platform.entrustment.dto.PrintDTO; |
|
|
|
|
import digital.laboratory.platform.entrustment.dto.SampleBoxDTO; |
|
|
|
|
import digital.laboratory.platform.entrustment.entity.*; |
|
|
|
|
import digital.laboratory.platform.entrustment.entity.CaseEvent; |
|
|
|
|
import digital.laboratory.platform.entrustment.entity.CaseEvidence; |
|
|
|
|
import digital.laboratory.platform.entrustment.entity.Entrustment; |
|
|
|
|
import digital.laboratory.platform.entrustment.entity.EntrustmentIdentificationMaterial; |
|
|
|
|
import digital.laboratory.platform.entrustment.enums.EntrustmentStatusConstants; |
|
|
|
|
import digital.laboratory.platform.entrustment.handler.AppStartupRunner; |
|
|
|
|
import digital.laboratory.platform.entrustment.service.*; |
|
|
|
|
import digital.laboratory.platform.sys.feign.RemoteEquipmentService; |
|
|
|
|
import io.seata.spring.annotation.GlobalTransactional; |
|
|
|
|
import digital.laboratory.platform.entrustment.service.CaseEventService; |
|
|
|
|
import digital.laboratory.platform.entrustment.service.CaseEvidenceService; |
|
|
|
|
import digital.laboratory.platform.entrustment.service.EntrustmentIdentificationMaterialService; |
|
|
|
|
import digital.laboratory.platform.entrustment.service.EntrustmentService; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.codec.binary.Base64; |
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
|
import org.springframework.security.oauth2.provider.OAuth2Authentication; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
@ -44,9 +49,13 @@ import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
|
import java.io.InputStream; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.security.Principal; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -63,16 +72,16 @@ import java.util.*; |
|
|
|
|
public class EntrustmentIdentificationMaterialController { |
|
|
|
|
|
|
|
|
|
private final CaseEventService caseEventService; |
|
|
|
|
|
|
|
|
|
private final EntrustmentService entrustmentService; |
|
|
|
|
|
|
|
|
|
private final EntrustmentIdentificationMaterialService entrustmentIdentificationMaterialService; |
|
|
|
|
private final SampleService sampleService; |
|
|
|
|
|
|
|
|
|
private final CaseEvidenceService caseEvidenceService; |
|
|
|
|
|
|
|
|
|
private final OssFile ossFile; |
|
|
|
|
private final SampleBoxService sampleBoxService; |
|
|
|
|
private final TakerService takerService; |
|
|
|
|
|
|
|
|
|
private final RemoteTemplate2htmlService remoteTemplate2htmlService; |
|
|
|
|
private final RemoteEquipmentService remoteEquipmentService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id查询检材信息 |
|
|
|
@ -157,6 +166,17 @@ public class EntrustmentIdentificationMaterialController { |
|
|
|
|
.in(entrustmentIds != null && entrustmentIds.size() > 0, "entrustment_id", entrustmentIds) |
|
|
|
|
.orderByAsc("order_no") |
|
|
|
|
); |
|
|
|
|
// 处理返回给前端的重量值
|
|
|
|
|
list.forEach(entity -> { |
|
|
|
|
BigDecimal quantity = entity.getQuantity(); |
|
|
|
|
if (quantity.compareTo(new BigDecimal(100)) >= 0) { |
|
|
|
|
// 如果 totalSampleMass 大于 100,保留 1 位小数
|
|
|
|
|
entity.setQuantity(quantity.setScale(1, BigDecimal.ROUND_HALF_UP)); |
|
|
|
|
} else { |
|
|
|
|
// 否则保留 2 位小数
|
|
|
|
|
entity.setQuantity(quantity.setScale(2, BigDecimal.ROUND_HALF_UP)); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return R.ok(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -210,7 +230,7 @@ public class EntrustmentIdentificationMaterialController { |
|
|
|
|
* sample2Quantity |
|
|
|
|
* sample2BoxId |
|
|
|
|
* |
|
|
|
|
* @param List<EntrustmentIdentificationMaterial> |
|
|
|
|
* @param materialList |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
@ -506,7 +526,7 @@ public class EntrustmentIdentificationMaterialController { |
|
|
|
|
|
|
|
|
|
//去掉头信息
|
|
|
|
|
String imgBase64 = image.substring(image.indexOf(",") + 1); |
|
|
|
|
byte[] decoded = org.apache.commons.codec.binary.Base64.decodeBase64(imgBase64); |
|
|
|
|
byte[] decoded = Base64.decodeBase64(imgBase64); |
|
|
|
|
InputStream is = new ByteArrayInputStream(decoded); |
|
|
|
|
|
|
|
|
|
String path = OSSDirectoryConstants.ENTRUSTMENT_DIRECTORY + "/" + im.getEntrustmentId() + "/" + identificationMaterialId; |
|
|
|
@ -709,7 +729,7 @@ public class EntrustmentIdentificationMaterialController { |
|
|
|
|
|
|
|
|
|
//去掉头信息
|
|
|
|
|
String imgBase64 = image.substring(image.indexOf(",") + 1); |
|
|
|
|
byte[] decoded = org.apache.commons.codec.binary.Base64.decodeBase64(imgBase64); |
|
|
|
|
byte[] decoded = Base64.decodeBase64(imgBase64); |
|
|
|
|
InputStream is = new ByteArrayInputStream(decoded); |
|
|
|
|
|
|
|
|
|
String path = OSSDirectoryConstants.ACCEPT_DIRECTORY + "/" + im.getEntrustmentId() + "/" + identificationMaterialId; |
|
|
|
|