main
杨海航 1 year ago
parent 7b3c2ff2da
commit 1e63df8c7e
  1. 27
      src/main/java/digital/laboratory/platform/reagent/controller/ReagentConsumableInventoryController.java
  2. 2
      src/main/java/digital/laboratory/platform/reagent/entity/BatchDetails.java
  3. 7
      src/main/java/digital/laboratory/platform/reagent/mapper/ReagentConsumableInventoryMapper.java
  4. 2
      src/main/java/digital/laboratory/platform/reagent/service/ReagentConsumableInventoryService.java
  5. 32
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReagentConsumableInventoryServiceImpl.java
  6. 4
      src/main/resources/bootstrap.yml
  7. 1
      src/main/resources/mapper/BatchDetailsMapper.xml
  8. 75
      src/main/resources/mapper/ReagentConsumableInventoryMapper.xml

@ -13,9 +13,9 @@ import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.ReagentConsumableInventoryDTO;
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.mapper.ReagentConsumableInventoryMapper;
import digital.laboratory.platform.reagent.service.ReagentConsumableInventoryService;
import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
import digital.laboratory.platform.reagent.utils.QRCodeUtils;
import digital.laboratory.platform.reagent.vo.*;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api;
@ -24,10 +24,8 @@ import lombok.RequiredArgsConstructor;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.web.bind.annotation.*;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.security.Principal;
import java.util.List;
@ -57,6 +55,8 @@ public class ReagentConsumableInventoryController {
private final OssFile ossFile;
private final ReagentConsumableInventoryMapper reagentConsumableInventoryMapper;
/**
* 通过id查询试剂耗材库存
*
@ -93,10 +93,10 @@ public class ReagentConsumableInventoryController {
referenceMaterialQueryWrapper
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.ne(referenceMaterialStatus==null,"status",-4)
.ne(referenceMaterialStatus == null, "status", -4)
.eq(referenceMaterialStatus != null, "status", referenceMaterialStatus)
.or()
.ne(referenceMaterialStatus==null,"status",-4)
.ne(referenceMaterialStatus == null, "status", -4)
.like(StrUtil.isNotBlank(reagentConsumableName), "number", reagentConsumableName)
.eq(referenceMaterialStatus != null, "status", referenceMaterialStatus);
@ -214,15 +214,13 @@ public class ReagentConsumableInventoryController {
@ApiOperation(value = "试剂耗材/标准物质集合列表", notes = "试剂耗材/标准物质集合列表")
@GetMapping("/full")
// @PreAuthorize("@pms.hasPermission(' ')")
public R<List<ReagentConsumableInventoryFullVO>> getReagentConsumableInventoryFull(String category, String name, HttpServletRequest theHttpServletRequest) {
public R<IPage<ReagentConsumableInventoryFullVO>> getReagentConsumableInventoryFull(Page page,String category, String name, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFull = reagentConsumableInventoryService.getReagentConsumableInventoryFull(Wrappers.<ReagentConsumableInventory>query()
.eq((StrUtil.isNotBlank(category)), "category", category)
.like((StrUtil.isNotBlank(name)), "reagent_consumable_name", name));
IPage fullVOPage = reagentConsumableInventoryMapper.getFullVOPage(page,name,category);
return R.ok(reagentConsumableInventoryFull);
return R.ok(fullVOPage);
}
@ -376,5 +374,14 @@ public class ReagentConsumableInventoryController {
}
// @PostMapping("org")
// public R<List<OrgFullVO>> getOrgList(HttpServletResponse httpServletResponse) {
//
// List<OrgFullVO> orgList = reagentConsumableInventoryService.getOrgList();
//
// return R.ok(orgList);
//
// }
}

@ -1,6 +1,7 @@
package digital.laboratory.platform.reagent.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import digital.laboratory.platform.common.mybatis.base.BaseEntity;
@ -89,6 +90,7 @@ public class BatchDetails extends BaseEntity {
private String roomNo;
@ApiModelProperty(value="试剂耗材名称")
@TableField(exist = false)
private String reagentConsumableName;
@ApiModelProperty(value="试剂耗材仓库ID")

@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO;
import digital.laboratory.platform.reagent.vo.ReferenceMaterialFullVO;
import digital.laboratory.platform.reagent.vo.UserVO;
import digital.laboratory.platform.reagent.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -26,8 +23,10 @@ public interface ReagentConsumableInventoryMapper extends BaseMapper<ReagentCons
IPage<ReagentConsumableInventoryVO> getReagentConsumableInventoryVOPage (IPage<ReagentConsumableInventory>page, @Param(Constants.WRAPPER) QueryWrapper<ReagentConsumableInventory> qw);
IPage<ReagentConsumableInventoryFullVO> getReagentConsumableInventoryFullVOPage (IPage<ReagentConsumableInventory>page, @Param(Constants.WRAPPER) QueryWrapper<ReagentConsumableInventory> qw);
IPage<ReagentConsumableInventoryFullVO> getFullVOPage (IPage<ReagentConsumableInventory>page, @Param("name") String name,@Param("category") String category);
List<UserVO> getUserList();
List<OrgVO> getOrgList();
IPage<ReferenceMaterialFullVO> getReferenceMaterialPage (IPage<ReagentConsumableInventory>page, @Param (Constants.WRAPPER) QueryWrapper<ReferenceMaterial> qw);

@ -59,4 +59,6 @@ public interface ReagentConsumableInventoryService extends IService<ReagentConsu
//更新柜子系统方法,柜子ID、物品ID、入库OR出库 (opCode 1 or -1)
void updateCabinet(String latticeId, String itemId, int opCode);
// List<OrgFullVO> getOrgList();
}

@ -27,7 +27,6 @@ import digital.laboratory.platform.sys.entity.CabinetCell;
import digital.laboratory.platform.sys.entity.CellAndStoreSupplyData;
import digital.laboratory.platform.sys.feign.RemoteCabinetService;
import feign.Response;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -283,6 +282,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(id);
if (referenceMaterial == null) {
throw new RuntimeException(String.format("未能查询到该ID对应的标准物质"));
}
ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO();
ReagentConsumableInventory byId = this.getById(referenceMaterial.getReagentConsumableInventoryId());
@ -558,9 +560,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query()
.eq("reagent_consumable_name", reagentConsumableInventoryDTO.getReagentConsumableName())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getBrand()),"brand", reagentConsumableInventoryDTO.getBrand())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getBrand()), "brand", reagentConsumableInventoryDTO.getBrand())
.eq("category", reagentConsumableInventoryDTO.getCategory())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecificationAndModel()),"specification_and_model", reagentConsumableInventoryDTO.getSpecificationAndModel())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecificationAndModel()), "specification_and_model", reagentConsumableInventoryDTO.getSpecificationAndModel())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getStandardValueOrPurity()), "standard_value_or_purity", reagentConsumableInventoryDTO.getStandardValueOrPurity())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getCasNumber()), "cas_number", reagentConsumableInventoryDTO.getCasNumber())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecies()), "species", reagentConsumableInventoryDTO.getSpecies())
@ -669,7 +671,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
this.save(reagentConsumableInventory);
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1);
if (!reagentConsumableInventory.getCategory().equals("标准物质")){
if (!reagentConsumableInventory.getCategory().equals("标准物质")) {
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query()
.eq("room_no", reagentConsumableInventoryDTO.getRoomNo())
.eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId()));
@ -712,6 +714,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
batchDetailsService.save(batchDetails);
}
}
@Override
//更新柜子系统方法,柜子ID、物品ID、入库OR出库 (opCode 1 or -1)
public void updateCabinet(String latticeId, String itemId, int opCode) {
@ -726,4 +729,25 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
cellAndStoreSupplyDataArrayList.add(cellAndStoreSupplyData);
remoteCabinetService.takeOrSaveGoodsFromCabinet(cellAndStoreSupplyDataArrayList, opCode);
}
// @Override
// public List<OrgFullVO> getOrgList() {
//
// List<OrgVO> orgList = baseMapper.getOrgList();
// ArrayList<OrgFullVO> orgFullVOS = new ArrayList<>();
// for (OrgVO orgVO : orgList) {
// if (orgVO.getOrgType() != null && orgVO.getOrgType().equals("county")) {
// OrgFullVO orgFullVO = new OrgFullVO();
// orgFullVO.setUsername("X" + orgVO.getAreaCode());
// String[] roles = {"10015", "10020"};
// orgFullVO.setRoleIds(roles);
// orgFullVO.setPassword("123456");
// orgFullVO.setOrgId(orgVO.getOrgId());
// orgFullVOS.add(orgFullVO);
// }
//
// }
// return orgFullVOS;
// }
}

@ -58,8 +58,8 @@ spring:
# 文件上传相关 支持阿里云、华为云、腾讯、minio
oss:
endpoint: http://192.168.9.74:9000
accessKey: admin
endpoint: http://127.0.0.1:9000
accessKey: dlp
secretKey: 87990016
bucket-name: dlpfiles

@ -32,7 +32,6 @@
<result property="warningInformation" column="warning_information"/>
<result property="warehousingBatchListId" column="warehousing_batch_list_id"/>
<result property="roomNo" column="room_no"/>
<result property="reagentConsumableName" column="reagent_consumable_name"/>
<result property="reagentConsumableStashId" column="reagent_consumable_stash_id"/>
</resultMap>
</mapper>

@ -50,11 +50,36 @@
from reagent_consumable_inventory ${ew.customSqlSegment}
</select>
<select id="getFullVOPage"
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO">
SELECT bd.*,
r1.*,
(SELECT s1.supplier_name FROM supplier_information s1 WHERE s1.id = bd.supplier_id) as supplier_name
FROM batch_details bd,
reagent_consumable_inventory r1
WHERE bd.reagent_consumable_inventory_id = r1.reagent_consumable_inventory_id
<if test="name != null">
AND r1.`reagent_consumable_name` = #{name}
</if>
<if test="category != null">
AND r1.`category` = #{category}
</if>
</select>
<select id="getReagentConsumableInventoryVOPage" resultMap="reagentConsumableInventoryVO"
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO">
select *
from reagent_consumable_inventory
${ew.customSqlSegment}
from reagent_consumable_inventory ${ew.customSqlSegment}
</select>
<select id="getUserList" resultType="digital.laboratory.platform.reagent.vo.UserVO">
SELECT *
FROM dlp_base.sys_user user
</select>
<select id="getOrgList" resultType="digital.laboratory.platform.reagent.vo.OrgVO">
SELECT *
FROM dlp_base.sys_org org
</select>
<select id="getUserList" resultType="digital.laboratory.platform.reagent.vo.UserVO">
@ -77,80 +102,80 @@
(select rci.specification_and_model
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as specification_and_model,
rmp.reagent_consumable_inventory_id) as specification_and_model,
(select rci.`code`
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as `code`,
rmp.reagent_consumable_inventory_id) as `code`,
(select rci.category
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as category,
rmp.reagent_consumable_inventory_id) as category,
(select rci.brand
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as brand,
rmp.reagent_consumable_inventory_id) as brand,
(select rci.deviation_or_uncertainty
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as deviation_or_uncertainty,
rmp.reagent_consumable_inventory_id) as deviation_or_uncertainty,
(select rci.instruction_book_id
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as instruction_book_id,
rmp.reagent_consumable_inventory_id) as instruction_book_id,
(select rci.species
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as species,
rmp.reagent_consumable_inventory_id) as species,
(select rci.alias
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as alias,
rmp.reagent_consumable_inventory_id) as alias,
(select rci.remark
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as remark,
rmp.reagent_consumable_inventory_id) as remark,
(select rci.configuration_concentration
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as configuration_concentration,
rmp.reagent_consumable_inventory_id) as configuration_concentration,
(select rci.storage_life
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as storage_life,
rmp.reagent_consumable_inventory_id) as storage_life,
(select rci.warning_information
from reagent_consumable_inventory rci
where rci.reagent_consumable_inventory_id =
rmp.reagent_consumable_inventory_id) as warning_information,
(select r1.`status` from reference_material r1 where r1.id = rmp.id) as reference_material_status,
(select r1.`id` from reference_material r1 where r1.id = rmp.id) as reference_material_id,
rmp.reagent_consumable_inventory_id) as warning_information,
(select r1.`status` from reference_material r1 where r1.id = rmp.id) as reference_material_status,
(select r1.`id` from reference_material r1 where r1.id = rmp.id) as reference_material_id,
(select bd.batch
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as batch,
where bd.batch_details_id = rmp.batch_details_id) as batch,
(select bd.fixed_result
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as fixed_result,
where bd.batch_details_id = rmp.batch_details_id) as fixed_result,
(select bd.purchase_time
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as purchase_time,
where bd.batch_details_id = rmp.batch_details_id) as purchase_time,
(select bd.batch_number
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as batch_number,
where bd.batch_details_id = rmp.batch_details_id) as batch_number,
(select bd.supplier_id
from batch_details bd
where bd.batch_details_id = rmp.batch_details_id) as manufacturer_id,
where bd.batch_details_id = rmp.batch_details_id) as manufacturer_id,
(select srs.configuration_concentration
from standard_reserve_solution srs
where srs.reference_id = rmp.id) as configuration_concentration,
where srs.reference_id = rmp.id) as configuration_concentration,
(select srs.configuration_date
from standard_reserve_solution srs
where srs.reference_id = rmp.id) as configuration_date,
where srs.reference_id = rmp.id) as configuration_date,
(select srs.solution_numbering
from standard_reserve_solution srs
where srs.reference_id = rmp.id) as solution_numbering,
where srs.reference_id = rmp.id) as solution_numbering,
(select srs.validity_period
from standard_reserve_solution srs
where srs.reference_id = rmp.id) as validity_period
where srs.reference_id = rmp.id) as validity_period
FROM reference_material rmp
${ew.customSqlSegment}
</select>

Loading…
Cancel
Save