master
陈江保 4 days ago
parent 90af39d012
commit 862808752f
  1. 13
      src/main/java/digital/laboratory/platform/imr/controller/DrugDepotsController.java
  2. 9
      src/main/java/digital/laboratory/platform/imr/controller/ReviewApprovalController.java
  3. 4
      src/main/java/digital/laboratory/platform/imr/controller/SampleOutWarehouseController.java
  4. 2
      src/main/java/digital/laboratory/platform/imr/convert/DrugCaseInfoConvert.java
  5. 3
      src/main/java/digital/laboratory/platform/imr/dto/DrugDepotsDTO.java
  6. 2
      src/main/java/digital/laboratory/platform/imr/dto/ReviewApprovalDTO.java
  7. 3
      src/main/java/digital/laboratory/platform/imr/entity/DestructionPublicity.java
  8. 5
      src/main/java/digital/laboratory/platform/imr/entity/DrugCaseInfo.java
  9. 2
      src/main/java/digital/laboratory/platform/imr/entity/DrugMaterialInfo.java
  10. 4
      src/main/java/digital/laboratory/platform/imr/entity/SampleApply.java
  11. 4
      src/main/java/digital/laboratory/platform/imr/entity/SampleOutWarehouseApply.java
  12. 4
      src/main/java/digital/laboratory/platform/imr/entity/SampleOutboundRecord.java
  13. 2
      src/main/java/digital/laboratory/platform/imr/enums/ApplyStatus.java
  14. 30
      src/main/java/digital/laboratory/platform/imr/enums/DrugMaterialStatus.java
  15. 2
      src/main/java/digital/laboratory/platform/imr/enums/OutApplyStatus.java
  16. 2
      src/main/java/digital/laboratory/platform/imr/enums/OutboundType.java
  17. 2
      src/main/java/digital/laboratory/platform/imr/enums/ReleaseStatus.java
  18. 2
      src/main/java/digital/laboratory/platform/imr/enums/WarehouseMark.java
  19. 8
      src/main/java/digital/laboratory/platform/imr/mapper/DrugCaseInfoMapper.java
  20. 4
      src/main/java/digital/laboratory/platform/imr/service/DrugCaseInfoService.java
  21. 7
      src/main/java/digital/laboratory/platform/imr/service/DrugMaterialInfoService.java
  22. 7
      src/main/java/digital/laboratory/platform/imr/service/impl/CabinetOpeningRecordServiceImpl.java
  23. 4
      src/main/java/digital/laboratory/platform/imr/service/impl/DestructionPublicityServiceImpl.java
  24. 11
      src/main/java/digital/laboratory/platform/imr/service/impl/DrugCaseInfoServiceImpl.java
  25. 164
      src/main/java/digital/laboratory/platform/imr/service/impl/DrugMaterialInfoServiceImpl.java
  26. 5
      src/main/java/digital/laboratory/platform/imr/service/impl/ReviewApprovalServiceImpl.java
  27. 6
      src/main/java/digital/laboratory/platform/imr/service/impl/SampleApplyServiceImpl.java
  28. 7
      src/main/java/digital/laboratory/platform/imr/service/impl/SampleOutWarehouseApplyServiceImpl.java
  29. 4
      src/main/java/digital/laboratory/platform/imr/service/impl/SampleOutWarehouseServiceImpl.java
  30. 4
      src/main/java/digital/laboratory/platform/imr/service/impl/SamplePutInStorageServiceImpl.java
  31. 9
      src/main/java/digital/laboratory/platform/imr/vo/DrugCaseInfoVO.java
  32. 10
      src/main/java/digital/laboratory/platform/imr/vo/DrugMaterialInfoVO.java
  33. 20
      src/main/resources/mapper/DrugCaseInfoMapper.xml
  34. 3
      src/main/resources/mapper/DrugMaterialInfoMapper.xml

@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.ValidationException;
import java.security.Principal; import java.security.Principal;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -79,15 +80,21 @@ public class DrugDepotsController {
@ApiOperation(value = "毒品案件信息分页接口") @ApiOperation(value = "毒品案件信息分页接口")
@PostMapping("/drugCase/page") @PostMapping("/drugCase/page")
public R<IPage<DrugCaseInfoVO>> drugCasePage(@RequestBody DrugDepotsQuery query) { public R<IPage<DrugCaseInfoVO>> drugCasePage(@RequestBody DrugDepotsQuery query) {
Page<DrugCaseInfoVO> drugCaseInfoVOPage = drugCaseInfoService.getDrugCaseInfoVOPage(query); IPage<DrugCaseInfoVO> drugCaseInfoVOPage = drugCaseInfoService.getDrugCaseInfoVOPage(query);
return R.ok(drugCaseInfoVOPage); return R.ok(drugCaseInfoVOPage);
} }
@ApiOperation("删除毒品检材信息") @ApiOperation("删除毒品检材信息")
@PostMapping("/delete/drugMaterial") @PostMapping("/delete/drugMaterial")
public R deleteDrugMaterial(@RequestBody List<String> ids) { public R deleteDrugMaterial(@RequestBody List<String> ids) {
boolean removeBatchByIds = drugMaterialInfoService.removeBatchByIds(ids); boolean success = false;
return removeBatchByIds ? R.ok(true, "删除成功!") : R.failed(false, "删除失败!"); try {
success = drugMaterialInfoService.delete(ids);
} catch (ValidationException e) {
e.printStackTrace();
return R.failed(e.getMessage());
}
return success ? R.ok(true, "删除成功!") : R.failed(false, "删除失败!");
} }
@ApiOperation(value = "根据模板生成样本标签的 html, 供 qz 打印使用", notes = "根据模板生成样本标签的 html, 供 qz 打印使用") @ApiOperation(value = "根据模板生成样本标签的 html, 供 qz 打印使用", notes = "根据模板生成样本标签的 html, 供 qz 打印使用")

@ -3,27 +3,19 @@ package digital.laboratory.platform.imr.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import digital.laboratory.platform.common.core.util.R; import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.log.annotation.SysLog; import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.imr.dto.QueryApplyDTO; import digital.laboratory.platform.imr.dto.QueryApplyDTO;
import digital.laboratory.platform.imr.dto.ReviewApprovalDTO; import digital.laboratory.platform.imr.dto.ReviewApprovalDTO;
import digital.laboratory.platform.imr.dto.ReviewSampleDetail;
import digital.laboratory.platform.imr.dto.SampleApplyQueryDTO;
import digital.laboratory.platform.imr.entity.SampleApply; import digital.laboratory.platform.imr.entity.SampleApply;
import digital.laboratory.platform.imr.entity.enums.ApplyStatus;
import digital.laboratory.platform.imr.mapper.SampleApplyDetailedMapper;
import digital.laboratory.platform.imr.mapper.SampleApplyMapper;
import digital.laboratory.platform.imr.service.ReviewApprovalService; import digital.laboratory.platform.imr.service.ReviewApprovalService;
import digital.laboratory.platform.imr.service.SampleApplyService; import digital.laboratory.platform.imr.service.SampleApplyService;
import digital.laboratory.platform.imr.vo.ApplySampleVO;
import digital.laboratory.platform.imr.vo.SampleApplyVO; import digital.laboratory.platform.imr.vo.SampleApplyVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -31,7 +23,6 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.security.Principal; import java.security.Principal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import java.util.Set; import java.util.Set;
/** /**

@ -2,7 +2,6 @@ package digital.laboratory.platform.imr.controller;
import cn.hutool.core.io.IoUtil; import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@ -18,7 +17,7 @@ import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile; import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.imr.dto.*; import digital.laboratory.platform.imr.dto.*;
import digital.laboratory.platform.imr.entity.*; import digital.laboratory.platform.imr.entity.*;
import digital.laboratory.platform.imr.entity.enums.OutboundType; import digital.laboratory.platform.imr.enums.OutboundType;
import digital.laboratory.platform.imr.mapper.DestructionDetailMapper; import digital.laboratory.platform.imr.mapper.DestructionDetailMapper;
import digital.laboratory.platform.imr.mapper.SampleOutWarehouseApplyMapper; import digital.laboratory.platform.imr.mapper.SampleOutWarehouseApplyMapper;
import digital.laboratory.platform.imr.mapper.SampleOutboundRecordMapper; import digital.laboratory.platform.imr.mapper.SampleOutboundRecordMapper;
@ -42,7 +41,6 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.security.Principal; import java.security.Principal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 自定义出库controller * 自定义出库controller

@ -24,6 +24,7 @@ public class DrugCaseInfoConvert {
drugCaseInfo.setCaseNo(dto.getCaseNo()); drugCaseInfo.setCaseNo(dto.getCaseNo());
drugCaseInfo.setHandingOverOrg(dto.getHandingOverOrg()); drugCaseInfo.setHandingOverOrg(dto.getHandingOverOrg());
drugCaseInfo.setHandingOverDate(dto.getHandingOverDate()); drugCaseInfo.setHandingOverDate(dto.getHandingOverDate());
drugCaseInfo.setFrontOrgIds(dto.getFrontOrgIds());
return drugCaseInfo; return drugCaseInfo;
} }
@ -38,6 +39,7 @@ public class DrugCaseInfoConvert {
drugCaseInfoVO.setCaseNo(entity.getCaseNo()); drugCaseInfoVO.setCaseNo(entity.getCaseNo());
drugCaseInfoVO.setHandingOverOrg(entity.getHandingOverOrg()); drugCaseInfoVO.setHandingOverOrg(entity.getHandingOverOrg());
drugCaseInfoVO.setHandingOverDate(entity.getHandingOverDate()); drugCaseInfoVO.setHandingOverDate(entity.getHandingOverDate());
drugCaseInfoVO.setFrontOrgIds(entity.getFrontOrgIds());
return drugCaseInfoVO; return drugCaseInfoVO;
} }

@ -42,6 +42,9 @@ public class DrugDepotsDTO {
@NotBlank(message = "送缴单位不能为空!") @NotBlank(message = "送缴单位不能为空!")
private String handingOverOrg; private String handingOverOrg;
@ApiModelProperty("前端需要展示的机构组件,保存了送缴单位的父级机构id和自己机构id")
private String frontOrgIds;
/** /**
* 送缴日期 * 送缴日期
*/ */

@ -1,10 +1,8 @@
package digital.laboratory.platform.imr.dto; package digital.laboratory.platform.imr.dto;
import digital.laboratory.platform.imr.entity.enums.ApplyStatus;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.w3c.dom.stylesheets.LinkStyle;
import java.util.List; import java.util.List;

@ -4,10 +4,9 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import digital.laboratory.platform.common.mybatis.base.BaseEntity; import digital.laboratory.platform.common.mybatis.base.BaseEntity;
import digital.laboratory.platform.imr.entity.enums.ReleaseStatus;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Data; import lombok.Data;

@ -45,6 +45,11 @@ public class DrugCaseInfo extends BaseEntity{
*/ */
private LocalDate handingOverDate; private LocalDate handingOverDate;
/**
* 前端需要展示的机构组件保存了送缴单位的父级机构id和自己机构id
*/
private String frontOrgIds;
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

@ -53,7 +53,7 @@ public class DrugMaterialInfo extends BaseEntity {
private Boolean packageComplete; private Boolean packageComplete;
/** /**
* 毒品检材状态 0 未入库 | 1 已入库 * 毒品检材状态 0 录入信息 | 3 待入库 | 5 已入库
*/ */
private Integer status; private Integer status;

@ -4,10 +4,10 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import digital.laboratory.platform.common.mybatis.base.BaseEntity; import digital.laboratory.platform.common.mybatis.base.BaseEntity;
import digital.laboratory.platform.imr.entity.enums.ApplyStatus; import digital.laboratory.platform.imr.enums.ApplyStatus;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

@ -6,10 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import digital.laboratory.platform.common.mybatis.base.BaseEntity; import digital.laboratory.platform.common.mybatis.base.BaseEntity;
import digital.laboratory.platform.imr.entity.enums.OutApplyStatus; import digital.laboratory.platform.imr.enums.OutApplyStatus;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Data; import lombok.Data;

@ -4,10 +4,10 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import digital.laboratory.platform.common.mybatis.base.BaseEntity; import digital.laboratory.platform.common.mybatis.base.BaseEntity;
import digital.laboratory.platform.imr.entity.enums.OutboundType; import digital.laboratory.platform.imr.enums.OutboundType;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

@ -1,4 +1,4 @@
package digital.laboratory.platform.imr.entity.enums; package digital.laboratory.platform.imr.enums;
import com.baomidou.mybatisplus.annotation.EnumValue; import com.baomidou.mybatisplus.annotation.EnumValue;

@ -0,0 +1,30 @@
package digital.laboratory.platform.imr.enums;
import lombok.Getter;
@Getter
public enum DrugMaterialStatus {
ENTER_DRUG_INFO(0, "录入信息中"),
WAIT_INBOUND(3, "待入库"),
FINISH_INBOUND(5, "已入库"),
;
private final Integer status;
private final String desc;
DrugMaterialStatus(Integer status, String desc) {
this.status = status;
this.desc = desc;
}
public static DrugMaterialStatus fromStatus(Integer status) {
for (DrugMaterialStatus drugMaterialStatus : values()) {
if (drugMaterialStatus.getStatus().equals(status)) {
return drugMaterialStatus;
}
}
throw new IllegalArgumentException("No enum constant with code: " + status);
}
}

@ -1,4 +1,4 @@
package digital.laboratory.platform.imr.entity.enums; package digital.laboratory.platform.imr.enums;
import com.baomidou.mybatisplus.annotation.EnumValue; import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;

@ -1,4 +1,4 @@
package digital.laboratory.platform.imr.entity.enums; package digital.laboratory.platform.imr.enums;
import com.baomidou.mybatisplus.annotation.EnumValue; import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;

@ -1,4 +1,4 @@
package digital.laboratory.platform.imr.entity.enums; package digital.laboratory.platform.imr.enums;
import com.baomidou.mybatisplus.annotation.EnumValue; import com.baomidou.mybatisplus.annotation.EnumValue;

@ -1,4 +1,4 @@
package digital.laboratory.platform.imr.entity.enums; package digital.laboratory.platform.imr.enums;
import com.baomidou.mybatisplus.annotation.EnumValue; import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;

@ -1,8 +1,14 @@
package digital.laboratory.platform.imr.mapper; package digital.laboratory.platform.imr.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import digital.laboratory.platform.imr.entity.DrugCaseInfo; import digital.laboratory.platform.imr.entity.DrugCaseInfo;
import digital.laboratory.platform.imr.entity.DrugMaterialInfo;
import digital.laboratory.platform.imr.vo.DrugCaseInfoVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* @author ChenJiangBao * @author ChenJiangBao
@ -13,6 +19,8 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface DrugCaseInfoMapper extends BaseMapper<DrugCaseInfo> { public interface DrugCaseInfoMapper extends BaseMapper<DrugCaseInfo> {
IPage<DrugCaseInfoVO> queryDrugCaseInfoVOPage(IPage<DrugCaseInfoVO> page, @Param(Constants.WRAPPER) Wrapper<DrugCaseInfo> wrapper);
} }

@ -1,6 +1,6 @@
package digital.laboratory.platform.imr.service; package digital.laboratory.platform.imr.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.imr.dto.DrugDepotsDTO; import digital.laboratory.platform.imr.dto.DrugDepotsDTO;
import digital.laboratory.platform.imr.entity.DrugCaseInfo; import digital.laboratory.platform.imr.entity.DrugCaseInfo;
@ -30,7 +30,7 @@ public interface DrugCaseInfoService extends IService<DrugCaseInfo> {
* @param query * @param query
* @return * @return
*/ */
Page<DrugCaseInfoVO> getDrugCaseInfoVOPage(DrugDepotsQuery query); IPage<DrugCaseInfoVO> getDrugCaseInfoVOPage(DrugDepotsQuery query);
DrugCaseInfo drugCaseSave(DrugDepotsDTO dto); DrugCaseInfo drugCaseSave(DrugDepotsDTO dto);
} }

@ -69,4 +69,11 @@ public interface DrugMaterialInfoService extends IService<DrugMaterialInfo> {
* @return * @return
*/ */
OutSampleVO drugMaterialToOutSampleVO(SampleStorage sampleStorage, String drugId); OutSampleVO drugMaterialToOutSampleVO(SampleStorage sampleStorage, String drugId);
/**
* 批量删除毒品检材
* @param ids
* @return
*/
boolean delete(List<String> ids);
} }

@ -11,13 +11,12 @@ import digital.laboratory.platform.imr.dto.DepositToDTO;
import digital.laboratory.platform.imr.dto.SampleInfo; import digital.laboratory.platform.imr.dto.SampleInfo;
import digital.laboratory.platform.imr.dto.UseOutboundDTO; import digital.laboratory.platform.imr.dto.UseOutboundDTO;
import digital.laboratory.platform.imr.entity.*; import digital.laboratory.platform.imr.entity.*;
import digital.laboratory.platform.imr.entity.enums.OutApplyStatus; import digital.laboratory.platform.imr.enums.OutApplyStatus;
import digital.laboratory.platform.imr.entity.enums.OutboundType; import digital.laboratory.platform.imr.enums.OutboundType;
import digital.laboratory.platform.imr.feign.TransferFeignService; import digital.laboratory.platform.imr.feign.TransferFeignService;
import digital.laboratory.platform.imr.feign.dto.UpdateHolderDTO; import digital.laboratory.platform.imr.feign.dto.UpdateHolderDTO;
import digital.laboratory.platform.imr.mapper.*; import digital.laboratory.platform.imr.mapper.*;
import digital.laboratory.platform.imr.service.CabinetOpeningRecordService; import digital.laboratory.platform.imr.service.CabinetOpeningRecordService;
import digital.laboratory.platform.imr.vo.BaseSampleDetail;
import digital.laboratory.platform.imr.vo.CabinetSampleVO; import digital.laboratory.platform.imr.vo.CabinetSampleVO;
import digital.laboratory.platform.imr.vo.OutSampleVO; import digital.laboratory.platform.imr.vo.OutSampleVO;
import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData; import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData;
@ -26,14 +25,12 @@ import io.seata.spring.annotation.GlobalTransactional;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Service @Service

@ -9,10 +9,7 @@ import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.imr.dto.DestructionPublicityDTO; import digital.laboratory.platform.imr.dto.DestructionPublicityDTO;
import digital.laboratory.platform.imr.entity.DestructionDetail; import digital.laboratory.platform.imr.entity.DestructionDetail;
import digital.laboratory.platform.imr.entity.DestructionPublicity; import digital.laboratory.platform.imr.entity.DestructionPublicity;
import digital.laboratory.platform.imr.entity.SampleApplyDetailed;
import digital.laboratory.platform.imr.entity.enums.ReleaseStatus;
import digital.laboratory.platform.imr.feign.TransferFeignService; import digital.laboratory.platform.imr.feign.TransferFeignService;
import digital.laboratory.platform.imr.feign.dto.UpdateHolderDTO;
import digital.laboratory.platform.imr.mapper.DestructionDetailMapper; import digital.laboratory.platform.imr.mapper.DestructionDetailMapper;
import digital.laboratory.platform.imr.mapper.DestructionPublicityMapper; import digital.laboratory.platform.imr.mapper.DestructionPublicityMapper;
import digital.laboratory.platform.imr.mapper.SampleApplyMapper; import digital.laboratory.platform.imr.mapper.SampleApplyMapper;
@ -21,7 +18,6 @@ import digital.laboratory.platform.imr.vo.DestructionPublicityVO;
import digital.laboratory.platform.imr.vo.OutSampleVO; import digital.laboratory.platform.imr.vo.OutSampleVO;
import digital.laboratory.platform.imr.vo.StatusSampleVO; import digital.laboratory.platform.imr.vo.StatusSampleVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;

@ -80,9 +80,9 @@ public class DrugCaseInfoServiceImpl extends ServiceImpl<DrugCaseInfoMapper, Dru
} }
@Override @Override
public Page<DrugCaseInfoVO> getDrugCaseInfoVOPage(DrugDepotsQuery query) { public IPage<DrugCaseInfoVO> getDrugCaseInfoVOPage(DrugDepotsQuery query) {
String keywords = query.getKeywords(); String keywords = query.getKeywords();
IPage<DrugCaseInfo> page = super.page( IPage<DrugCaseInfoVO> page = baseMapper.queryDrugCaseInfoVOPage(
new Page<>(query.getCurrent(), query.getSize()), new Page<>(query.getCurrent(), query.getSize()),
Wrappers.<DrugCaseInfo>lambdaQuery().and( Wrappers.<DrugCaseInfo>lambdaQuery().and(
StrUtil.isNotBlank(keywords), StrUtil.isNotBlank(keywords),
@ -91,12 +91,9 @@ public class DrugCaseInfoServiceImpl extends ServiceImpl<DrugCaseInfoMapper, Dru
.or() .or()
.like(DrugCaseInfo::getCaseName, keywords)) .like(DrugCaseInfo::getCaseName, keywords))
.orderByDesc(DrugCaseInfo::getUpdateTime)); .orderByDesc(DrugCaseInfo::getUpdateTime));
Page<DrugCaseInfoVO> drugCaseInfoVOPage = new Page<>(); List<DrugCaseInfoVO> drugCaseInfoVOS = page.getRecords();
BeanUtils.copyProperties(page, drugCaseInfoVOPage, "records");
List<DrugCaseInfoVO> drugCaseInfoVOS = DrugCaseInfoConvert.entityToVOList(page.getRecords());
drugCaseInfoVOS.parallelStream().forEach(item -> item.setHandingOverOrgName(commonFeignService.remoteGetSysOrg(item.getHandingOverOrg()).getName())); drugCaseInfoVOS.parallelStream().forEach(item -> item.setHandingOverOrgName(commonFeignService.remoteGetSysOrg(item.getHandingOverOrg()).getName()));
drugCaseInfoVOPage.setRecords(drugCaseInfoVOS); return page;
return drugCaseInfoVOPage;
} }
@Override @Override

@ -13,15 +13,14 @@ import digital.laboratory.platform.common.feign.RemoteTemplate2htmlService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.imr.dto.InRepositoryDTO; import digital.laboratory.platform.imr.dto.InRepositoryDTO;
import digital.laboratory.platform.imr.entity.*; import digital.laboratory.platform.imr.entity.*;
import digital.laboratory.platform.imr.enums.DrugMaterialStatus;
import digital.laboratory.platform.imr.mapper.DrugMaterialInfoMapper; import digital.laboratory.platform.imr.mapper.DrugMaterialInfoMapper;
import digital.laboratory.platform.imr.mapper.SampleStorageMapper; import digital.laboratory.platform.imr.mapper.SampleStorageMapper;
import digital.laboratory.platform.imr.query.DrugDepotsQuery; import digital.laboratory.platform.imr.query.DrugDepotsQuery;
import digital.laboratory.platform.imr.service.DrugMaterialInfoService; import digital.laboratory.platform.imr.service.*;
import digital.laboratory.platform.imr.service.SampleInboundAndOutboundTableService;
import digital.laboratory.platform.imr.service.SampleInboundRecordService;
import digital.laboratory.platform.imr.service.SampleStorageService;
import digital.laboratory.platform.imr.vo.DrugMaterialInfoVO; import digital.laboratory.platform.imr.vo.DrugMaterialInfoVO;
import digital.laboratory.platform.imr.vo.OutSampleVO; import digital.laboratory.platform.imr.vo.OutSampleVO;
import digital.laboratory.platform.sys.entity.Drug;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -55,7 +54,8 @@ public class DrugMaterialInfoServiceImpl extends ServiceImpl<DrugMaterialInfoMap
@Resource @Resource
private SampleInboundRecordService sampleInboundRecordService; private SampleInboundRecordService sampleInboundRecordService;
@Resource
private CommonFeignService commonFeignService;
/** /**
* 批量生成毒品检材编号 * 批量生成毒品检材编号
* JC5201010020240001 * JC5201010020240001
@ -114,7 +114,13 @@ public class DrugMaterialInfoServiceImpl extends ServiceImpl<DrugMaterialInfoMap
*/ */
@Override @Override
public IPage<DrugMaterialInfoVO> page(DrugDepotsQuery query) { public IPage<DrugMaterialInfoVO> page(DrugDepotsQuery query) {
return baseMapper.getDrugMaterialVOPage(new Page<>(query.getCurrent(), query.getSize()), query); IPage<DrugMaterialInfoVO> drugMaterialVOPage = baseMapper.getDrugMaterialVOPage(new Page<>(query.getCurrent(), query.getSize()), query);
List<DrugMaterialInfoVO> records = drugMaterialVOPage.getRecords();
records.parallelStream().forEach(record -> {
record.setHandingOverOrgName(commonFeignService.remoteGetSysOrg(record.getHandingOverOrg()).getName());
record.setStatusName(DrugMaterialStatus.fromStatus(record.getStatus()).getDesc());
});
return drugMaterialVOPage;
} }
@Override @Override
@ -123,9 +129,10 @@ public class DrugMaterialInfoServiceImpl extends ServiceImpl<DrugMaterialInfoMap
if (CollUtil.isEmpty(drugMaterialInfoVOList)) { if (CollUtil.isEmpty(drugMaterialInfoVOList)) {
throw new RuntimeException(String.format("没有找到 id 为 %s 的毒品检材", id)); throw new RuntimeException(String.format("没有找到 id 为 %s 的毒品检材", id));
} }
DrugMaterialInfoVO drugMaterialInfoVO = drugMaterialInfoVOList.get(0);
drugMaterialInfoVO.setHandingOverOrgName(commonFeignService.remoteGetSysOrg(drugMaterialInfoVO.getHandingOverOrg()).getName());
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
data.put("drugInfo", drugMaterialInfoVOList.get(0)); data.put("drugInfo", drugMaterialInfoVO);
String templateFileName = "毒品库毒品检材条码模板.vm"; String templateFileName = "毒品库毒品检材条码模板.vm";
return remoteTemplate2htmlService.getHtml(templateFileName, data); return remoteTemplate2htmlService.getHtml(templateFileName, data);
@ -144,14 +151,16 @@ public class DrugMaterialInfoServiceImpl extends ServiceImpl<DrugMaterialInfoMap
List<DrugMaterialInfoVO> drugMaterialInfoVOS = baseMapper List<DrugMaterialInfoVO> drugMaterialInfoVOS = baseMapper
.getDrugMaterialVO(Wrappers.<DrugMaterialInfo>query() .getDrugMaterialVO(Wrappers.<DrugMaterialInfo>query()
.in("drug_no", .in("drug_no",
sample.stream().map(InRepositoryDTO::getSampleNo).collect(Collectors.toList()))); sample.stream().map(InRepositoryDTO::getSampleNo).collect(Collectors.toList()))
.eq("dm.status", DrugMaterialStatus.ENTER_DRUG_INFO.getStatus())); // 状态为为未入库的
Map<String, DrugMaterialInfoVO> drugMaterialInfoVOMap = drugMaterialInfoVOS.stream() Map<String, DrugMaterialInfoVO> drugMaterialInfoVOMap = drugMaterialInfoVOS.stream()
.collect(Collectors.toMap(DrugMaterialInfoVO::getDrugNo, Function.identity())); .collect(Collectors.toMap(DrugMaterialInfoVO::getDrugNo, Function.identity()));
// 待操作的毒品检材id列表
List<String> waitOpDrugIds = drugMaterialInfoVOS.stream().map(DrugMaterialInfoVO::getId).collect(Collectors.toList());
Map<String, SampleStorage> sampleStorageMap = sampleStorageMapper Map<String, SampleStorage> sampleStorageMap = sampleStorageMapper
.selectList(Wrappers.<SampleStorage>lambdaQuery() .selectList(Wrappers.<SampleStorage>lambdaQuery()
.in(SampleStorage::getSampleId, .in(SampleStorage::getSampleId,
drugMaterialInfoVOS.stream().map(DrugMaterialInfoVO::getId).collect(Collectors.toList()))) waitOpDrugIds))
.stream().collect(Collectors.toMap(SampleStorage::getSampleId, Function.identity())); .stream().collect(Collectors.toMap(SampleStorage::getSampleId, Function.identity()));
// 存储需要批量保存的实体信息 // 存储需要批量保存的实体信息
List<SampleStorage> updateSampleStorageList = new ArrayList<>(); List<SampleStorage> updateSampleStorageList = new ArrayList<>();
@ -163,7 +172,8 @@ public class DrugMaterialInfoServiceImpl extends ServiceImpl<DrugMaterialInfoMap
//先通过样本编号查询出这个样本的基本信息(重点是获取到id) //先通过样本编号查询出这个样本的基本信息(重点是获取到id)
DrugMaterialInfoVO drugMaterialInfoVO = drugMaterialInfoVOMap.get(dto.getSampleNo()); DrugMaterialInfoVO drugMaterialInfoVO = drugMaterialInfoVOMap.get(dto.getSampleNo());
if (drugMaterialInfoVO == null) { if (drugMaterialInfoVO == null) {
throw new ValidateCodeException(String.format("毒品检材编号为 %s 的毒品信息不存在请重试!", dto.getSampleNo())); // throw new ValidateCodeException(String.format("毒品检材编号为 %s 的毒品信息不存在请重试!", dto.getSampleNo()));
continue;
} }
if (drugMaterialInfoVO.getStatus() != 0) {// 判断检材是否是未入库状态 if (drugMaterialInfoVO.getStatus() != 0) {// 判断检材是否是未入库状态
throw new ValidateCodeException(String.format("编号为 %s 的样本当前状态不是入库状态!", dto.getSampleNo())); throw new ValidateCodeException(String.format("编号为 %s 的样本当前状态不是入库状态!", dto.getSampleNo()));
@ -186,48 +196,20 @@ public class DrugMaterialInfoServiceImpl extends ServiceImpl<DrugMaterialInfoMap
} }
} else { } else {
//新录入仓库样本(添加操作) //新录入仓库样本(添加操作)
sampleStorage = new SampleStorage(); sampleStorage = getSampleStorage(dlpUser, dto, drugMaterialInfoVO);
sampleStorage.setId(IdWorker.get32UUID().toUpperCase());
sampleStorage.setStatus(1);//入库待存放
sampleStorage.setDepositorId(dlpUser.getId());//当前持有人变成入库人
sampleStorage.setInRepositoryDate(LocalDateTime.now());//入库时间
//毒品和其他存储时间为长期(100年)
sampleStorage.setStorageDate(LocalDateTime.now().plusYears(100));
sampleStorage.setSampleId(drugMaterialInfoVO.getId()); //毒品检材id
sampleStorage.setEarlyWarning(0);//创建默认未到"销毁"
sampleStorage.setUnit(dto.getUnit());//单位
sampleStorage.setQuality(dto.getQuality());//入库时的质量
sampleStorage.setName(drugMaterialInfoVO.getDrugName());
sampleStorage.setSampleType("A");//样本类型
//数据存储 //数据存储
// sampleStorageMapper.insert(sampleStorage); // sampleStorageMapper.insert(sampleStorage);
saveSampleStorageList.add(sampleStorage); saveSampleStorageList.add(sampleStorage);
} }
//更新出入库登记表(这里因为只有入库,所以就创建部分数据;入库一定是添加数据) //更新出入库登记表(这里因为只有入库,所以就创建部分数据;入库一定是添加数据)
SampleInboundAndOutboundTable table = new SampleInboundAndOutboundTable(); SampleInboundAndOutboundTable table = getSampleInboundAndOutboundTable(dlpUser, dto, drugMaterialInfoVO);
table.setId(IdWorker.get32UUID().toUpperCase());
table.setImAdministrators(dlpUser.getId());
table.setRecipient(dlpUser.getId());//持有人变入库人
table.setRemarks("检材入库");
table.setWarehousingDate(LocalDateTime.now());//入库时间
table.setSampleId(drugMaterialInfoVO.getId());
table.setInboundSupervisor(dto.getSupervisor());//入库监督人
// tableMapper.insert(table); // tableMapper.insert(table);
saveSampleInboundAndOutboundTableList.add(table); saveSampleInboundAndOutboundTableList.add(table);
//新出入库登记表 //新出入库登记表
//入库记录 //入库记录
SampleInboundRecord record = new SampleInboundRecord(); SampleInboundRecord record = getSampleInboundRecord(dlpUser, drugMaterialInfoVO);
record.setId(IdWorker.get32UUID().toUpperCase());
record.setWarehousingPersonId(dlpUser.getId());//入库人
record.setWarehousingDate(LocalDateTime.now());
record.setImAdministrators(dlpUser.getId());
record.setSampleId(drugMaterialInfoVO.getId());
record.setName(drugMaterialInfoVO.getDrugName());
record.setRemarks("检材入库");
// recordMapper.insert(record); // recordMapper.insert(record);
saveSampleInboundRecordList.add(record); saveSampleInboundRecordList.add(record);
@ -239,9 +221,12 @@ public class DrugMaterialInfoServiceImpl extends ServiceImpl<DrugMaterialInfoMap
sampleStorageService.saveBatch(saveSampleStorageList); sampleStorageService.saveBatch(saveSampleStorageList);
sampleInboundAndOutboundTableService.saveBatch(saveSampleInboundAndOutboundTableList); sampleInboundAndOutboundTableService.saveBatch(saveSampleInboundAndOutboundTableList);
sampleInboundRecordService.saveBatch(saveSampleInboundRecordList); sampleInboundRecordService.saveBatch(saveSampleInboundRecordList);
// 修改当前修改过的毒品状态为待入库
super.update(Wrappers.<DrugMaterialInfo>lambdaUpdate().in(DrugMaterialInfo::getId, waitOpDrugIds).set(DrugMaterialInfo::getStatus, DrugMaterialStatus.WAIT_INBOUND.getStatus()));
return sampleVOS; return sampleVOS;
} }
/** /**
* 毒品检材封装 * 毒品检材封装
* @param sampleStorage * @param sampleStorage
@ -257,6 +242,32 @@ public class DrugMaterialInfoServiceImpl extends ServiceImpl<DrugMaterialInfoMap
return getOutSampleVO(sampleStorage, drugMaterialVOs.get(0)); return getOutSampleVO(sampleStorage, drugMaterialVOs.get(0));
} }
/**
* 删除毒品检材
* @param ids
* @return
*/
@Override
public boolean delete(List<String> ids) {
if (CollUtil.isEmpty(ids)) {
throw new ValidateCodeException("未选择删除的检材!");
}
List<DrugMaterialInfo> drugMaterialInfos = super.list(Wrappers.<DrugMaterialInfo>lambdaQuery().in(DrugMaterialInfo::getId, ids));
for (DrugMaterialInfo drugMaterialInfo : drugMaterialInfos) {
if (!drugMaterialInfo.getStatus().equals(DrugMaterialStatus.ENTER_DRUG_INFO.getStatus())) {
throw new ValidateCodeException(String.format("检材编号为 %s 的检材不在可删除状态,不能删除!", drugMaterialInfo.getDrugNo()));
}
}
return super.remove(Wrappers.<DrugMaterialInfo>lambdaQuery().in(DrugMaterialInfo::getId, ids));
}
/**
* 根据样本存储信息和药物材料信息生成出库样本对象
*
* @param sampleStorage 样本存储信息
* @param drugMaterialInfoVO 药物材料信息对象
* @return 出库样本对象
*/
private OutSampleVO getOutSampleVO(SampleStorage sampleStorage, DrugMaterialInfoVO drugMaterialInfoVO) { private OutSampleVO getOutSampleVO(SampleStorage sampleStorage, DrugMaterialInfoVO drugMaterialInfoVO) {
OutSampleVO outSampleVO = new OutSampleVO(); OutSampleVO outSampleVO = new OutSampleVO();
outSampleVO.setId(sampleStorage.getId()); outSampleVO.setId(sampleStorage.getId());
@ -269,6 +280,73 @@ public class DrugMaterialInfoServiceImpl extends ServiceImpl<DrugMaterialInfoMap
outSampleVO.setSampleStatus(1); outSampleVO.setSampleStatus(1);
return outSampleVO; return outSampleVO;
} }
/**
* 根据提供的用户信息入库DTO和药物材料信息对象获取样本存储对象
*
* @param dlpUser 用户信息对象
* @param dto 入库DTO
* @param drugMaterialInfoVO 药物材料信息对象
* @return 样本存储对象
*/
private SampleStorage getSampleStorage(DLPUser dlpUser, InRepositoryDTO dto, DrugMaterialInfoVO drugMaterialInfoVO) {
SampleStorage sampleStorage;
sampleStorage = new SampleStorage();
sampleStorage.setId(IdWorker.get32UUID().toUpperCase());
sampleStorage.setStatus(1);//入库待存放
sampleStorage.setDepositorId(dlpUser.getId());//当前持有人变成入库人
sampleStorage.setInRepositoryDate(LocalDateTime.now());//入库时间
//毒品和其他存储时间为长期(100年)
sampleStorage.setStorageDate(LocalDateTime.now().plusYears(100));
sampleStorage.setSampleId(drugMaterialInfoVO.getId()); //毒品检材id
sampleStorage.setEarlyWarning(0);//创建默认未到"销毁"
sampleStorage.setUnit(dto.getUnit());//单位
sampleStorage.setQuality(dto.getQuality());//入库时的质量
sampleStorage.setName(drugMaterialInfoVO.getDrugName());
sampleStorage.setSampleType("A");//样本类型
return sampleStorage;
}
/**
* 根据提供的用户信息入库DTO和药物材料信息对象获取样本入库出库表对象
*
* @param dlpUser 用户信息对象
* @param dto 入库DTO
* @param drugMaterialInfoVO 药物材料信息对象
* @return 样本入库出库表对象
*/
private SampleInboundAndOutboundTable getSampleInboundAndOutboundTable(DLPUser dlpUser, InRepositoryDTO dto, DrugMaterialInfoVO drugMaterialInfoVO) {
SampleInboundAndOutboundTable table = new SampleInboundAndOutboundTable();
table.setId(IdWorker.get32UUID().toUpperCase());
table.setImAdministrators(dlpUser.getId());
table.setRecipient(dlpUser.getId());//持有人变入库人
table.setRemarks("检材入库");
table.setWarehousingDate(LocalDateTime.now());//入库时间
table.setSampleId(drugMaterialInfoVO.getId());
table.setInboundSupervisor(dto.getSupervisor());//入库监督人
return table;
}
/**
* 根据提供的用户信息和药物材料信息对象获取样本入库记录对象
*
* @param dlpUser 用户信息对象
* @param drugMaterialInfoVO 药物材料信息对象
* @return 样本入库记录对象
*/
private SampleInboundRecord getSampleInboundRecord(DLPUser dlpUser, DrugMaterialInfoVO drugMaterialInfoVO) {
SampleInboundRecord record = new SampleInboundRecord();
record.setId(IdWorker.get32UUID().toUpperCase());
record.setWarehousingPersonId(dlpUser.getId());//入库人
record.setWarehousingDate(LocalDateTime.now());
record.setImAdministrators(dlpUser.getId());
record.setSampleId(drugMaterialInfoVO.getId());
record.setName(drugMaterialInfoVO.getDrugName());
record.setRemarks("检材入库");
return record;
}
} }

@ -3,15 +3,13 @@ package digital.laboratory.platform.imr.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.imr.dto.ReviewApprovalDTO; import digital.laboratory.platform.imr.dto.ReviewApprovalDTO;
import digital.laboratory.platform.imr.dto.ReviewSampleDetail; import digital.laboratory.platform.imr.dto.ReviewSampleDetail;
import digital.laboratory.platform.imr.entity.SampleApply; import digital.laboratory.platform.imr.entity.SampleApply;
import digital.laboratory.platform.imr.entity.SampleApplyDetailed; import digital.laboratory.platform.imr.entity.SampleApplyDetailed;
import digital.laboratory.platform.imr.entity.SampleStorage; import digital.laboratory.platform.imr.entity.SampleStorage;
import digital.laboratory.platform.imr.entity.enums.ApplyStatus; import digital.laboratory.platform.imr.enums.ApplyStatus;
//import digital.laboratory.platform.imr.entity.enums.SampleStatus; //import digital.laboratory.platform.imr.entity.enums.SampleStatus;
import digital.laboratory.platform.imr.feign.TransferFeignService; import digital.laboratory.platform.imr.feign.TransferFeignService;
import digital.laboratory.platform.imr.mapper.SampleApplyDetailedMapper; import digital.laboratory.platform.imr.mapper.SampleApplyDetailedMapper;
@ -19,7 +17,6 @@ import digital.laboratory.platform.imr.mapper.SampleApplyMapper;
import digital.laboratory.platform.imr.mapper.SampleStorageMapper; import digital.laboratory.platform.imr.mapper.SampleStorageMapper;
import digital.laboratory.platform.imr.service.ReviewApprovalService; import digital.laboratory.platform.imr.service.ReviewApprovalService;
import digital.laboratory.platform.imr.service.SampleApplyService; import digital.laboratory.platform.imr.service.SampleApplyService;
import digital.laboratory.platform.imr.vo.ApplySampleVO;
import digital.laboratory.platform.imr.vo.SampleApplyVO; import digital.laboratory.platform.imr.vo.SampleApplyVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

@ -1,24 +1,21 @@
package digital.laboratory.platform.imr.service.impl; package digital.laboratory.platform.imr.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.imr.dto.ApplyDTO; import digital.laboratory.platform.imr.dto.ApplyDTO;
import digital.laboratory.platform.imr.entity.SampleApply; import digital.laboratory.platform.imr.entity.SampleApply;
import digital.laboratory.platform.imr.entity.SampleApplyDetailed; import digital.laboratory.platform.imr.entity.SampleApplyDetailed;
import digital.laboratory.platform.imr.entity.enums.ApplyStatus; import digital.laboratory.platform.imr.enums.ApplyStatus;
import digital.laboratory.platform.imr.feign.TransferFeignService; import digital.laboratory.platform.imr.feign.TransferFeignService;
import digital.laboratory.platform.imr.mapper.SampleApplyDetailedMapper; import digital.laboratory.platform.imr.mapper.SampleApplyDetailedMapper;
import digital.laboratory.platform.imr.mapper.SampleApplyMapper; import digital.laboratory.platform.imr.mapper.SampleApplyMapper;
import digital.laboratory.platform.imr.service.SampleApplyService; import digital.laboratory.platform.imr.service.SampleApplyService;
import digital.laboratory.platform.imr.vo.ApplySampleVO; import digital.laboratory.platform.imr.vo.ApplySampleVO;
import digital.laboratory.platform.imr.vo.BaseSampleVO;
import digital.laboratory.platform.imr.vo.SampleApplyVO; import digital.laboratory.platform.imr.vo.SampleApplyVO;
import digital.laboratory.platform.imr.vo.StatusSampleVO; import digital.laboratory.platform.imr.vo.StatusSampleVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -26,7 +23,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**

@ -12,23 +12,20 @@ import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.imr.dto.OutWarehouseApplyDTO; import digital.laboratory.platform.imr.dto.OutWarehouseApplyDTO;
import digital.laboratory.platform.imr.dto.VerificationCode; import digital.laboratory.platform.imr.dto.VerificationCode;
import digital.laboratory.platform.imr.entity.*; import digital.laboratory.platform.imr.entity.*;
import digital.laboratory.platform.imr.entity.enums.OutApplyStatus; import digital.laboratory.platform.imr.enums.OutApplyStatus;
import digital.laboratory.platform.imr.entity.enums.OutboundType; import digital.laboratory.platform.imr.enums.OutboundType;
import digital.laboratory.platform.imr.feign.TransferFeignService; import digital.laboratory.platform.imr.feign.TransferFeignService;
import digital.laboratory.platform.imr.feign.dto.UpdateHolderDTO; import digital.laboratory.platform.imr.feign.dto.UpdateHolderDTO;
import digital.laboratory.platform.imr.mapper.*; import digital.laboratory.platform.imr.mapper.*;
import digital.laboratory.platform.imr.service.SampleApplyService;
import digital.laboratory.platform.imr.service.SampleOutWarehouseApplyService; import digital.laboratory.platform.imr.service.SampleOutWarehouseApplyService;
import digital.laboratory.platform.imr.vo.BaseSampleDetail; import digital.laboratory.platform.imr.vo.BaseSampleDetail;
import digital.laboratory.platform.imr.vo.CellVO; import digital.laboratory.platform.imr.vo.CellVO;
import digital.laboratory.platform.imr.vo.OutSampleVO; import digital.laboratory.platform.imr.vo.OutSampleVO;
import digital.laboratory.platform.imr.vo.SampleOutWarehouseApplyVO; import digital.laboratory.platform.imr.vo.SampleOutWarehouseApplyVO;
import digital.laboratory.platform.common.feign.annotation.*;
import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData; import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData;
import digital.laboratory.platform.sys.feign.RemoteCabinetService; import digital.laboratory.platform.sys.feign.RemoteCabinetService;
import io.seata.spring.annotation.GlobalTransactional; import io.seata.spring.annotation.GlobalTransactional;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;

@ -1,13 +1,12 @@
package digital.laboratory.platform.imr.service.impl; package digital.laboratory.platform.imr.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.imr.dto.DestroyOutboundDTO; import digital.laboratory.platform.imr.dto.DestroyOutboundDTO;
import digital.laboratory.platform.imr.dto.ReturnOutboundDTO; import digital.laboratory.platform.imr.dto.ReturnOutboundDTO;
import digital.laboratory.platform.imr.entity.*; import digital.laboratory.platform.imr.entity.*;
import digital.laboratory.platform.imr.entity.enums.OutboundType; import digital.laboratory.platform.imr.enums.OutboundType;
import digital.laboratory.platform.imr.feign.TransferFeignService; import digital.laboratory.platform.imr.feign.TransferFeignService;
import digital.laboratory.platform.imr.feign.dto.UpdateHolderDTO; import digital.laboratory.platform.imr.feign.dto.UpdateHolderDTO;
import digital.laboratory.platform.imr.mapper.*; import digital.laboratory.platform.imr.mapper.*;
@ -23,7 +22,6 @@ import org.springframework.stereotype.Service;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Service @Service

@ -13,6 +13,7 @@ import digital.laboratory.platform.imr.dto.DepositDTO;
import digital.laboratory.platform.imr.dto.IconDTO; import digital.laboratory.platform.imr.dto.IconDTO;
import digital.laboratory.platform.imr.dto.InRepositoryDTO; import digital.laboratory.platform.imr.dto.InRepositoryDTO;
import digital.laboratory.platform.imr.entity.*; import digital.laboratory.platform.imr.entity.*;
import digital.laboratory.platform.imr.enums.DrugMaterialStatus;
import digital.laboratory.platform.imr.feign.TransferFeignService; import digital.laboratory.platform.imr.feign.TransferFeignService;
import digital.laboratory.platform.imr.feign.dto.UpdateHolderDTO; import digital.laboratory.platform.imr.feign.dto.UpdateHolderDTO;
import digital.laboratory.platform.imr.mapper.*; import digital.laboratory.platform.imr.mapper.*;
@ -477,7 +478,8 @@ public class SamplePutInStorageServiceImpl implements SamplePutInStorageService
} else { } else {
sampleVO = drugMaterialInfoService.drugMaterialToOutSampleVO(sampleStorage, sampleStorage.getSampleId()); sampleVO = drugMaterialInfoService.drugMaterialToOutSampleVO(sampleStorage, sampleStorage.getSampleId());
//3.毒品库中的毒品检材信息样本状态为已入库 //3.毒品库中的毒品检材信息样本状态为已入库
drugMaterialInfoService.update(Wrappers.<DrugMaterialInfo>lambdaUpdate().eq(DrugMaterialInfo::getId, sampleStorage.getSampleId()).set(DrugMaterialInfo::getStatus, 1)); drugMaterialInfoService.update(Wrappers.<DrugMaterialInfo>lambdaUpdate().eq(DrugMaterialInfo::getId, sampleStorage.getSampleId())
.set(DrugMaterialInfo::getStatus, DrugMaterialStatus.FINISH_INBOUND.getStatus()));
} }
sampleVO.setStorageLocation(dto.getStorageLocation()); sampleVO.setStorageLocation(dto.getStorageLocation());
outSampleVOS.add(sampleVO); outSampleVOS.add(sampleVO);

@ -52,4 +52,13 @@ public class DrugCaseInfoVO{
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate handingOverDate; private LocalDate handingOverDate;
@ApiModelProperty("送缴检材数量")
private Integer handingOverCount;
/**
* 前端需要展示的机构组件保存了送缴单位的父级机构id和自己机构id
*/
@ApiModelProperty("前端需要展示的机构组件,保存了送缴单位的父级机构id和自己机构id")
private String frontOrgIds;
} }

@ -67,11 +67,17 @@ public class DrugMaterialInfoVO {
private Boolean packageComplete; private Boolean packageComplete;
/** /**
* 毒品检材状态 0 未入库 | 1 已入库 * 毒品检材状态 0 录入信息中 | 3 待入库 | 5 已入库
*/ */
@ApiModelProperty("毒品检材状态, 0 未入库 | 1 已入库") @ApiModelProperty("毒品检材状态, 0 录入信息中 | 3 待入库 | 5 已入库")
private Integer status; private Integer status;
/**
* 毒品检材状态 0 录入信息中 | 3 待入库 | 5 已入库
*/
@ApiModelProperty("毒品检材状态, 0 录入信息中 | 3 待入库 | 5 已入库")
private String statusName;
/** /**
* 案事件名称 * 案事件名称
*/ */

@ -10,6 +10,7 @@
<result property="caseNo" column="case_no" jdbcType="VARCHAR"/> <result property="caseNo" column="case_no" jdbcType="VARCHAR"/>
<result property="handingOverOrg" column="handing_over_org" jdbcType="VARCHAR"/> <result property="handingOverOrg" column="handing_over_org" jdbcType="VARCHAR"/>
<result property="handingOverDate" column="handing_over_date" jdbcType="TIMESTAMP"/> <result property="handingOverDate" column="handing_over_date" jdbcType="TIMESTAMP"/>
<result property="frontOrgIds" column="front_org_ids" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/> <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
@ -18,7 +19,24 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,case_name,case_no, id,case_name,case_no,
handing_over_org,handing_over_date,create_time, handing_over_org,handing_over_date,front_org_ids,create_time,
update_time,create_by,update_by update_time,create_by,update_by
</sql> </sql>
<sql id="queryDrugCaseInfoVOSql">
SELECT
<include refid="Base_Column_List"/>, handingOverCount
FROM b_drug_case_info
LEFT JOIN (
SELECT COUNT(*) AS handingOverCount , case_id
FROM b_drug_material_info GROUP BY case_id
) AS t
ON b_drug_case_info.id = t.case_id
</sql>
<select id="queryDrugCaseInfoVOPage"
resultType="digital.laboratory.platform.imr.vo.DrugCaseInfoVO">
<include refid="queryDrugCaseInfoVOSql"/>
${ew.customSqlSegment}
</select>
</mapper> </mapper>

@ -12,6 +12,7 @@
<result property="massVolume" column="mass_volume" jdbcType="VARCHAR"/> <result property="massVolume" column="mass_volume" jdbcType="VARCHAR"/>
<result property="unit" column="unit" jdbcType="VARCHAR"/> <result property="unit" column="unit" jdbcType="VARCHAR"/>
<result property="packageComplete" column="package_complete" jdbcType="TINYINT"/> <result property="packageComplete" column="package_complete" jdbcType="TINYINT"/>
<result property="status" column="status" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/> <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
@ -20,7 +21,7 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,case_id,drug_no, id,case_id,drug_no,
drug_name,mass_volume,unit,package_complete, drug_name,mass_volume,unit,package_complete,status,
create_time,update_time,create_by, create_time,update_time,create_by,
update_by update_by
</sql> </sql>

Loading…
Cancel
Save