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. 29
      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.dto.ReagentConsumableInventoryDTO;
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial; 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.ReagentConsumableInventoryService;
import digital.laboratory.platform.reagent.service.ReferenceMaterialService; import digital.laboratory.platform.reagent.service.ReferenceMaterialService;
import digital.laboratory.platform.reagent.utils.QRCodeUtils;
import digital.laboratory.platform.reagent.vo.*; import digital.laboratory.platform.reagent.vo.*;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -24,10 +24,8 @@ import lombok.RequiredArgsConstructor;
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.*;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.IOException; import java.io.IOException;
import java.security.Principal; import java.security.Principal;
import java.util.List; import java.util.List;
@ -57,6 +55,8 @@ public class ReagentConsumableInventoryController {
private final OssFile ossFile; private final OssFile ossFile;
private final ReagentConsumableInventoryMapper reagentConsumableInventoryMapper;
/** /**
* 通过id查询试剂耗材库存 * 通过id查询试剂耗材库存
* *
@ -93,10 +93,10 @@ public class ReagentConsumableInventoryController {
referenceMaterialQueryWrapper referenceMaterialQueryWrapper
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName) .like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.ne(referenceMaterialStatus==null,"status",-4) .ne(referenceMaterialStatus == null, "status", -4)
.eq(referenceMaterialStatus != null, "status", referenceMaterialStatus) .eq(referenceMaterialStatus != null, "status", referenceMaterialStatus)
.or() .or()
.ne(referenceMaterialStatus==null,"status",-4) .ne(referenceMaterialStatus == null, "status", -4)
.like(StrUtil.isNotBlank(reagentConsumableName), "number", reagentConsumableName) .like(StrUtil.isNotBlank(reagentConsumableName), "number", reagentConsumableName)
.eq(referenceMaterialStatus != null, "status", referenceMaterialStatus); .eq(referenceMaterialStatus != null, "status", referenceMaterialStatus);
@ -214,15 +214,13 @@ public class ReagentConsumableInventoryController {
@ApiOperation(value = "试剂耗材/标准物质集合列表", notes = "试剂耗材/标准物质集合列表") @ApiOperation(value = "试剂耗材/标准物质集合列表", notes = "试剂耗材/标准物质集合列表")
@GetMapping("/full") @GetMapping("/full")
// @PreAuthorize("@pms.hasPermission(' ')") // @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(); Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
List<ReagentConsumableInventoryFullVO> reagentConsumableInventoryFull = reagentConsumableInventoryService.getReagentConsumableInventoryFull(Wrappers.<ReagentConsumableInventory>query() IPage fullVOPage = reagentConsumableInventoryMapper.getFullVOPage(page,name,category);
.eq((StrUtil.isNotBlank(category)), "category", category)
.like((StrUtil.isNotBlank(name)), "reagent_consumable_name", name));
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; package digital.laboratory.platform.reagent.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
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;
@ -89,6 +90,7 @@ public class BatchDetails extends BaseEntity {
private String roomNo; private String roomNo;
@ApiModelProperty(value="试剂耗材名称") @ApiModelProperty(value="试剂耗材名称")
@TableField(exist = false)
private String reagentConsumableName; private String reagentConsumableName;
@ApiModelProperty(value="试剂耗材仓库ID") @ApiModelProperty(value="试剂耗材仓库ID")

@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.core.toolkit.Constants;
import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory; import digital.laboratory.platform.reagent.entity.ReagentConsumableInventory;
import digital.laboratory.platform.reagent.entity.ReferenceMaterial; import digital.laboratory.platform.reagent.entity.ReferenceMaterial;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryFullVO; import digital.laboratory.platform.reagent.vo.*;
import digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO;
import digital.laboratory.platform.reagent.vo.ReferenceMaterialFullVO;
import digital.laboratory.platform.reagent.vo.UserVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; 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<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> 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<UserVO> getUserList();
List<OrgVO> getOrgList();
IPage<ReferenceMaterialFullVO> getReferenceMaterialPage (IPage<ReagentConsumableInventory>page, @Param (Constants.WRAPPER) QueryWrapper<ReferenceMaterial> qw); 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) //更新柜子系统方法,柜子ID、物品ID、入库OR出库 (opCode 1 or -1)
void updateCabinet(String latticeId, String itemId, int opCode); 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.entity.CellAndStoreSupplyData;
import digital.laboratory.platform.sys.feign.RemoteCabinetService; import digital.laboratory.platform.sys.feign.RemoteCabinetService;
import feign.Response; import feign.Response;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.commons.io.output.ByteArrayOutputStream;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -283,6 +282,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
ReferenceMaterial referenceMaterial = referenceMaterialService.getById(id); ReferenceMaterial referenceMaterial = referenceMaterialService.getById(id);
if (referenceMaterial == null) {
throw new RuntimeException(String.format("未能查询到该ID对应的标准物质"));
}
ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO(); ReagentConsumableInventoryFullVO reagentConsumableInventoryFullVO = new ReagentConsumableInventoryFullVO();
ReagentConsumableInventory byId = this.getById(referenceMaterial.getReagentConsumableInventoryId()); ReagentConsumableInventory byId = this.getById(referenceMaterial.getReagentConsumableInventoryId());
@ -558,9 +560,9 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query() ReagentConsumableInventory one = this.getOne(Wrappers.<ReagentConsumableInventory>query()
.eq("reagent_consumable_name", reagentConsumableInventoryDTO.getReagentConsumableName()) .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("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.getStandardValueOrPurity()), "standard_value_or_purity", reagentConsumableInventoryDTO.getStandardValueOrPurity())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getCasNumber()), "cas_number", reagentConsumableInventoryDTO.getCasNumber()) .eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getCasNumber()), "cas_number", reagentConsumableInventoryDTO.getCasNumber())
.eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecies()), "species", reagentConsumableInventoryDTO.getSpecies()) .eq(StrUtil.isNotBlank(reagentConsumableInventoryDTO.getSpecies()), "species", reagentConsumableInventoryDTO.getSpecies())
@ -669,7 +671,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
this.save(reagentConsumableInventory); this.save(reagentConsumableInventory);
this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1); this.updateCabinet(cabinetCell.getId(), reagentConsumables.getReagentConsumableId(), 1);
if (!reagentConsumableInventory.getCategory().equals("标准物质")){ if (!reagentConsumableInventory.getCategory().equals("标准物质")) {
ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query() ReagentConsumableStash reagentConsumableStash = reagentConsumableStashService.getOne(Wrappers.<ReagentConsumableStash>query()
.eq("room_no", reagentConsumableInventoryDTO.getRoomNo()) .eq("room_no", reagentConsumableInventoryDTO.getRoomNo())
.eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId())); .eq("reagent_consumable_id", reagentConsumables.getReagentConsumableId()));
@ -712,6 +714,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
batchDetailsService.save(batchDetails); batchDetailsService.save(batchDetails);
} }
} }
@Override @Override
//更新柜子系统方法,柜子ID、物品ID、入库OR出库 (opCode 1 or -1) //更新柜子系统方法,柜子ID、物品ID、入库OR出库 (opCode 1 or -1)
public void updateCabinet(String latticeId, String itemId, int opCode) { public void updateCabinet(String latticeId, String itemId, int opCode) {
@ -726,4 +729,25 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
cellAndStoreSupplyDataArrayList.add(cellAndStoreSupplyData); cellAndStoreSupplyDataArrayList.add(cellAndStoreSupplyData);
remoteCabinetService.takeOrSaveGoodsFromCabinet(cellAndStoreSupplyDataArrayList, opCode); 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 # 文件上传相关 支持阿里云、华为云、腾讯、minio
oss: oss:
endpoint: http://192.168.9.74:9000 endpoint: http://127.0.0.1:9000
accessKey: admin accessKey: dlp
secretKey: 87990016 secretKey: 87990016
bucket-name: dlpfiles bucket-name: dlpfiles

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

@ -50,11 +50,36 @@
from reagent_consumable_inventory ${ew.customSqlSegment} from reagent_consumable_inventory ${ew.customSqlSegment}
</select> </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" <select id="getReagentConsumableInventoryVOPage" resultMap="reagentConsumableInventoryVO"
resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO"> resultType="digital.laboratory.platform.reagent.vo.ReagentConsumableInventoryVO">
select * select *
from reagent_consumable_inventory from reagent_consumable_inventory ${ew.customSqlSegment}
${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>
<select id="getUserList" resultType="digital.laboratory.platform.reagent.vo.UserVO"> <select id="getUserList" resultType="digital.laboratory.platform.reagent.vo.UserVO">

Loading…
Cancel
Save