更新数据库

This commit is contained in:
2023-06-16 14:01:18 +08:00
parent c6d685399e
commit 002e48e312
22 changed files with 363 additions and 113 deletions
@@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.common.core.util.SpringContextHolder;
import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.dto.ApplicationForUseBatchDTO;
import digital.laboratory.platform.reagent.dto.ApplicationForUseDTO;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.entity.ApplicationForUse;
@@ -14,6 +16,7 @@ import digital.laboratory.platform.reagent.entity.ReagentConsumablesSet;
import digital.laboratory.platform.reagent.service.ApplicationForUseService;
import digital.laboratory.platform.reagent.service.ReagentConsumablesSetService;
import digital.laboratory.platform.reagent.vo.ApplicationForUseVO;
import digital.laboratory.platform.reagent.vo.ReagentConsumablesSetVO;
import org.springframework.beans.BeanUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api;
@@ -60,7 +63,7 @@ public class ApplicationForUseController {
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping()
@PreAuthorize("@pms.hasPermission('reagent_application_for_use_get')")
public R<ApplicationForUseVO> getById( String applicationForUseId, HttpServletRequest theHttpServletRequest) {
public R<ApplicationForUseVO> getById(String applicationForUseId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -92,6 +95,7 @@ public class ApplicationForUseController {
return R.ok(applicationForUseVOList);
}
/**
* 新增(试剂耗材领用申请表)
*
@@ -133,13 +137,14 @@ public class ApplicationForUseController {
ReagentConsumablesSet byId = reagentConsumablesSetService.getById(applicationForUseDTO.getReagentConsumableSetId());
BeanUtils.copyProperties(applicationForUseDTO,byId);
BeanUtils.copyProperties(applicationForUseDTO, byId);
if ( reagentConsumablesSetService.updateById(byId)){
if (reagentConsumablesSetService.updateById(byId)) {
return R.ok("修改成功");
}else {
} else {
return R.failed("修改失败");
}}
}
}
/**
@@ -152,7 +157,7 @@ public class ApplicationForUseController {
@SysLog("通过id删除(试剂耗材领用申请表)")
@DeleteMapping()
@PreAuthorize("@pms.hasPermission('reagent_application_for_use_del')")
public R<String> deleteById( String applicationForUseId, HttpServletRequest theHttpServletRequest) {
public R<String> deleteById(String applicationForUseId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -183,6 +188,7 @@ public class ApplicationForUseController {
return R.ok("删除成功");
} else return R.failed("删除失败");
}
/**
* 提交试剂耗材领用申请表
*
@@ -205,4 +211,50 @@ public class ApplicationForUseController {
return R.ok(applicationForUse, "提交成功");
} else return R.failed("提交失败");
}
/**
* 批量提交试剂耗材领用申请表
*
* @param applicationForUseBatchDTO (批量提交试剂耗材领用申请表)
* @return R
*/
@ApiOperation(value = "批量提交试剂耗材领用申请表", notes = "批量提交试剂耗材领用申请表")
@SysLog("批量提交试剂耗材领用申请表")
@PostMapping("/batch/commit")
@PreAuthorize("@pms.hasPermission('reagent_application_for_use_commit')")
public R<ApplicationForUseVO> batchCommit(ApplicationForUseBatchDTO applicationForUseBatchDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
ApplicationForUseVO applicationForUse = applicationForUseService.batchCommit(applicationForUseBatchDTO, dlpUser);
if (applicationForUse != null) {
return R.ok(applicationForUse, "提交成功");
} else return R.failed("提交失败");
}
/**
* 批量提交试剂耗材领用申请表
*
* @param id (批量提交试剂耗材领用申请表)
* @return R
*/
@ApiOperation(value = "通过实验模板ID查询领用情况", notes = "通过实验模板ID查询领用情况")
@SysLog("通过实验模板ID查询领用情况")
@GetMapping("/get/template")
@PreAuthorize("@pms.hasPermission('reagent_application_for_use_get')")
public R<List<ReagentConsumablesSetVO>> getReagentConsumablesSets(String id, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
List<ReagentConsumablesSetVO> reagentConsumablesSets = applicationForUseService.getReagentConsumablesSets(id);
if (reagentConsumablesSets != null) {
return R.ok(reagentConsumablesSets);
} else return R.failed("未能查询到相关信息");
}
}
@@ -143,7 +143,7 @@ public class InstructionBookController {
@ApiOperation(value = "预览(标准物质期间核查指导书)", notes = "预览(标准物质期间核查指导书)(标准物质期间核查指导书)")
@SysLog("预览(标准物质期间核查指导书)(标准物质期间核查指导书)")
@GetMapping("/download")
@PreAuthorize("@pms.hasPermission('reagent_instruction_book_download')" )
// @PreAuthorize("@pms.hasPermission('reagent_instruction_book_download')" )
public R<InstructionBook> download(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -180,7 +180,7 @@ public class InstructionBookController {
@ApiOperation(value = "查看(标准物质期间核查指导书)", notes = "查看(标准物质期间核查指导书)(标准物质期间核查指导书)")
@SysLog("查看(标准物质期间核查指导书)(标准物质期间核查指导书)")
@GetMapping()
@PreAuthorize("@pms.hasPermission('reagent_instruction_book_get')" )
// @PreAuthorize("@pms.hasPermission('reagent_instruction_book_get')" )
public R<InstructionBookVO> getVOById(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -311,7 +311,7 @@ public class ReagentConsumableInventoryController {
*/
@ApiOperation(value = "", notes = "通过id,获取标准物质所有信息")
@GetMapping("/getByCode")
@PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get')")
@PreAuthorize("@pms.hasPermission('reagent_reagent_consumable_inventory_get_by_code')")
public R<ReagentConsumableInventoryFullVO> getByCode(String id, String number, HttpServletResponse httpServletResponse) {
if (StrUtil.isNotBlank(number)) {
@@ -332,4 +332,18 @@ public class ReagentConsumableInventoryController {
return R.ok(byCode);
}
/**
* 获取用户列表
*/
@ApiOperation(value = "", notes = "获取用户列表")
@GetMapping("/userList")
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_add')")
public R<List<UserVO>> getUserList(HttpServletResponse httpServletResponse) {
return R.ok(reagentConsumableInventoryService.getUserList());
}
}
@@ -0,0 +1,12 @@
package digital.laboratory.platform.reagent.dto;
import lombok.Data;
import java.util.List;
@Data
public class ApplicationForUseBatchDTO {
List<ApplicationForUseDTO> applicationForUseDTOList;
String templateId;
}
@@ -40,4 +40,7 @@ public class ApplicationForUseDTO {
@ApiModelProperty(value = "(领用物品明细ID)")
private String reagentConsumableSetId;
}
@@ -71,9 +71,11 @@ public class ApplicationForUse extends BaseEntity {
@ApiModelProperty(value="领取码")
private String claimCode;
/**
* 实验模板ID
*/
@ApiModelProperty(value="实验模板ID")
private String templateId;
}
@@ -18,4 +18,5 @@ import java.util.List;
@Mapper
public interface DetailsOfCentralizedMapper extends BaseMapper<DetailsOfCentralized> {
List<DetailsOfCentralizedVO> getDetailsOfCentralizedVOList(String centralizedRequestId);
List<DetailsOfCentralizedVO> getDetailsOfCentralizedVOPlanList(String procurementContentId);
}
@@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.dto.ApplicationForUseBatchDTO;
import digital.laboratory.platform.reagent.dto.ApplicationForUseDTO;
import digital.laboratory.platform.reagent.entity.ApplicationForUse;
import digital.laboratory.platform.reagent.vo.ApplicationForUseVO;
import digital.laboratory.platform.reagent.vo.ReagentConsumablesSetVO;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@@ -30,4 +33,10 @@ public interface ApplicationForUseService extends IService<ApplicationForUse> {
ApplicationForUseVO commitApplication(String id, DLPUser dlpUser);
Boolean delApplication(String applicationForUseId);
//提交领用申请记录
@Transactional
ApplicationForUseVO batchCommit(ApplicationForUseBatchDTO applicationForUseBatchDTO, DLPUser dlpUser);
List<ReagentConsumablesSetVO> getReagentConsumablesSets(String id);
}
@@ -51,4 +51,6 @@ public interface ReagentConsumableInventoryService extends IService<ReagentConsu
String buildCodeLabelContent(String code);
String printSolutionTag(String id);
List<UserVO> getUserList();
}
@@ -4,10 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.dto.ApplicationForUseBatchDTO;
import digital.laboratory.platform.reagent.dto.ApplicationForUseDTO;
import digital.laboratory.platform.reagent.dto.ComplianceCheckDTO;
import digital.laboratory.platform.reagent.entity.*;
import digital.laboratory.platform.reagent.mapper.ApplicationForUseMapper;
import digital.laboratory.platform.reagent.service.*;
@@ -236,4 +237,79 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
}
return substring;
}
//提交领用申请记录
@Transactional
@Override
public ApplicationForUseVO batchCommit(ApplicationForUseBatchDTO applicationForUseBatchDTO, DLPUser dlpUser) {
ApplicationForUse applicationForUse = new ApplicationForUse();
applicationForUse.setId(IdWorker.get32UUID().toUpperCase());
applicationForUse.setStatus(0);
applicationForUse.setRecipientId(dlpUser.getId());
applicationForUse.setTemplateId(applicationForUseBatchDTO.getTemplateId());
List<ReagentConsumablesSet> reagentConsumablesSets = new ArrayList<>();
List<ApplicationForUseDTO> applicationForUseDTOList = applicationForUseBatchDTO.getApplicationForUseDTOList();
for (ApplicationForUseDTO applicationForUseDTO : applicationForUseDTOList) {
ReagentConsumablesSet reagentConsumablesSet = new ReagentConsumablesSet();
BeanUtils.copyProperties(applicationForUseDTO, reagentConsumablesSet);
reagentConsumablesSet.setId(IdWorker.get32UUID().toUpperCase());
reagentConsumablesSet.setApplicationForUseId(applicationForUse.getId());
if (applicationForUseDTO.getReferenceMaterialId() != null) {
reagentConsumablesSet.setReferenceMaterialId(applicationForUseDTO.getReferenceMaterialId());
}
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, applicationForUseDTO.getReagentConsumableId());
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper);
Integer totalQuantity = one.getTotalQuantity();
if (reagentConsumablesSet.getQuantity() > totalQuantity) {
throw new RuntimeException(String.format("领用数量不能大于库存量"));
}
reagentConsumablesSets.add(reagentConsumablesSet);
}
if (this.save(applicationForUse) & reagentConsumablesSetService.saveBatch(reagentConsumablesSets)
) {
this.commitApplication(applicationForUse.getId(), dlpUser);
ApplicationForUseVO applicationForUseVO = this.getApplicationForUseVO(applicationForUse.getId());
return applicationForUseVO;
} else return null;
}
/*
*通过实验模板ID查询领用的所有物品*/
@Override
public List<ReagentConsumablesSetVO> getReagentConsumablesSets(String id) {
List<ApplicationForUse> applicationForUseList = this.list(Wrappers.<ApplicationForUse>query().eq("template_id", id));
List<ReagentConsumablesSetVO> reagentConsumablesSetList = new ArrayList<>();
for (ApplicationForUse applicationForUse : applicationForUseList) {
List<ReagentConsumablesSetVO> list = reagentConsumablesSetService.getList(applicationForUse.getId());
reagentConsumablesSetList.addAll(list);
}
return reagentConsumablesSetList;
}
}
@@ -60,7 +60,6 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
@Autowired
private ReagentConsumablesService reagentConsumablesService;
@Override
public IPage<ComplianceCheckVO> getComplianceCheckVOPage(IPage<ComplianceCheck> page, QueryWrapper<ComplianceCheck> qw) {
@@ -151,7 +150,7 @@ public class ComplianceCheckServiceImpl extends ServiceImpl<ComplianceCheckMappe
ComplianceCheck byId = this.getById(complianceCheckId);
if (byId.getStatus()!=0){
if (byId.getStatus()>0){
throw new RuntimeException(String.format("当前状态无法删除"));
}
@@ -53,43 +53,43 @@ public class DetailsOfCentralizedServiceImpl extends ServiceImpl<DetailsOfCentra
}
@Override
public List<DetailsOfCentralizedVO> getDetailsOfCentralizedList(String purchasingPlanId) {
public List<DetailsOfCentralizedVO> getDetailsOfCentralizedList(String procurementContentId) {
LambdaQueryWrapper<DetailsOfCentralized> detailsOfCentralizedLambdaQueryWrapper = new LambdaQueryWrapper<>();
detailsOfCentralizedLambdaQueryWrapper.eq(DetailsOfCentralized::getProcurementContentId, purchasingPlanId);
List<DetailsOfCentralized> list = this.list(detailsOfCentralizedLambdaQueryWrapper);
List<DetailsOfCentralizedVO> detailsOfCentralizedVOS = new ArrayList<>();
for (DetailsOfCentralized detailsOfCentralized : list) {
CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(detailsOfCentralized.getCentralizedRequestId());
LambdaQueryWrapper<ReagentConsumables> reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>();
reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableId, detailsOfCentralized.getReagentConsumableId());
ReagentConsumables one = reagentConsumablesService.getOne(reagentConsumablesLambdaQueryWrapper);
DetailsOfCentralizedVO detailsOfCentralizedVO = new DetailsOfCentralizedVO();
BeanUtils.copyProperties(detailsOfCentralized, detailsOfCentralizedVO);
detailsOfCentralizedVO.setReplacementReagentConsumableName(one.getReagentConsumableName());
detailsOfCentralizedVO.setDepartment(centralizedRequestVO.getDepartment());
detailsOfCentralizedVO.setApplicantName(centralizedRequestVO.getApplicantName());
detailsOfCentralizedVOS.add(detailsOfCentralizedVO);
detailsOfCentralizedVO.setSpecies(one.getSpecies());
detailsOfCentralizedVO.setDeviationOrUncertainty(one.getDeviationOrUncertainty());
detailsOfCentralizedVO.setMinimumUnit(one.getMinimumUnit());
detailsOfCentralizedVO.setPackagedCopies(one.getPackagedCopies().toString());
detailsOfCentralizedVO.setStandardValueOrPurity(one.getStandardValueOrPurity());
}
return detailsOfCentralizedVOS;
// LambdaQueryWrapper<DetailsOfCentralized> detailsOfCentralizedLambdaQueryWrapper = new LambdaQueryWrapper<>();
//
// detailsOfCentralizedLambdaQueryWrapper.eq(DetailsOfCentralized::getProcurementContentId, purchasingPlanId);
//
// List<DetailsOfCentralized> list = this.list(detailsOfCentralizedLambdaQueryWrapper);
//
// List<DetailsOfCentralizedVO> detailsOfCentralizedVOS = new ArrayList<>();
//
// for (DetailsOfCentralized detailsOfCentralized : list) {
//
// CentralizedRequestVO centralizedRequestVO = centralizedRequestService.getCentralizedRequestVO(detailsOfCentralized.getCentralizedRequestId());
//
// LambdaQueryWrapper<ReagentConsumables> reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>();
//
// reagentConsumablesLambdaQueryWrapper.eq(ReagentConsumables::getReagentConsumableId, detailsOfCentralized.getReagentConsumableId());
//
// ReagentConsumables one = reagentConsumablesService.getOne(reagentConsumablesLambdaQueryWrapper);
//
// DetailsOfCentralizedVO detailsOfCentralizedVO = new DetailsOfCentralizedVO();
//
// BeanUtils.copyProperties(detailsOfCentralized, detailsOfCentralizedVO);
//
// detailsOfCentralizedVO.setReplacementReagentConsumableName(one.getReagentConsumableName());
//
// detailsOfCentralizedVO.setDepartment(centralizedRequestVO.getDepartment());
//
// detailsOfCentralizedVO.setApplicantName(centralizedRequestVO.getApplicantName());
//
// detailsOfCentralizedVOS.add(detailsOfCentralizedVO);
// detailsOfCentralizedVO.setSpecies(one.getSpecies());
// detailsOfCentralizedVO.setDeviationOrUncertainty(one.getDeviationOrUncertainty());
// detailsOfCentralizedVO.setMinimumUnit(one.getMinimumUnit());
// detailsOfCentralizedVO.setPackagedCopies(one.getPackagedCopies().toString());
// detailsOfCentralizedVO.setStandardValueOrPurity(one.getStandardValueOrPurity());
// }
return baseMapper.getDetailsOfCentralizedVOPlanList(procurementContentId);
}
}
@@ -259,6 +259,8 @@ public class PurchaseCatalogueServiceImpl extends ServiceImpl<PurchaseCatalogueM
.eq(StrUtil.isNotBlank(catalogueDetails.getEnglishName()), "english_name", catalogueDetails.getEnglishName())
.eq(StrUtil.isNotBlank(catalogueDetails.getPackagedCopies()), "packaged_copies", catalogueDetails.getPackagedCopies())
.eq(StrUtil.isNotBlank(catalogueDetails.getAlias()), "alias", catalogueDetails.getAlias())
.eq(StrUtil.isNotBlank(catalogueDetails.getPurityGrade()), "purity_grade", catalogueDetails.getPurityGrade())
.eq(StrUtil.isNotBlank(catalogueDetails.getDeviationOrUncertainty()), "deviation_or_uncertainty", catalogueDetails.getDeviationOrUncertainty())
);
if (one == null) {
@@ -143,7 +143,7 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
.eq("purchase_list_id", id));
PurchasingPlanVO purchasingPlanVO = purchasingPlanService.getPurchasingPlanVO(plan.getPurchasingPlanId());
List<CentralizedRequest> centralizedRequestList = centralizedRequestService.list(Wrappers.<CentralizedRequest>query().eq("purchasing_plan_id", plan.getPurchasingPlanId()));
List<CentralizedRequest> centralizedRequestList = centralizedRequestService.list(Wrappers.<CentralizedRequest>query().eq("purchasing_plan_id", plan.getPurchasingPlanId()));
for (CentralizedRequest centralizedRequest : centralizedRequestList) {
centralizedRequest.setStatus(4);
centralizedRequestService.updateById(centralizedRequest);
@@ -200,8 +200,8 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
warehousingContent.setPurchaseListDetailsId(purchaseListDetails.getId());
if (one!=null){
warehousingContent.setWarningValue(one.getWarningValue());
if (one != null) {
warehousingContent.setWarningValue(one.getWarningValue());
}
LambdaQueryWrapper<CatalogueDetails> catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -305,7 +305,7 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
//通过仓库类信息,查找对应的该类所有标准物质
for (ReagentConsumableInventory reagentConsumableInventory : list) {
if (reagentConsumableInventory.getTotalQuantity() > 0) {
if (reagentConsumableInventory.getTotalQuantity() >= 0) {
LambdaQueryWrapper<ReferenceMaterial> referenceMaterialLambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -643,4 +643,10 @@ public class ReagentConsumableInventoryServiceImpl extends ServiceImpl<ReagentCo
return remoteTemplate2htmlService.getHtml(templateFileName, data);
}
@Override
public List<UserVO> getUserList(){
return baseMapper.getUserList();
}
}
@@ -121,11 +121,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
//计算浓度
Double v = standardReserveSolution.getReferenceMaterialScale() / standardReserveSolution.getConstantVolume();
BigDecimal bigDecimal = new BigDecimal(v);
BigDecimal bigDecimal1 = bigDecimal.setScale(2);
standardReserveSolution.setConfigurationConcentration(bigDecimal1.toString());
standardReserveSolution.setConfigurationConcentration(String.format("%.02f", v));
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -33,7 +33,7 @@ public class MaturityCalculation {
private final ReferenceMaterialService referenceMaterialService;
@Scheduled(cron = "0 0 0 * * ? ")
@Scheduled(cron = "1 0 0 * * ? ")
public void calculate() {
//查找出有库存量的物品所有批次信息(状态为1)
List<BatchDetails> list1 = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("service_status", 1));
+9
View File
@@ -63,4 +63,13 @@ oss:
secretKey: 87990016
bucket-name: dlpfiles
config:
activemq:
brokerUrl: tcp://localhost:61616
user: admin
password: admin
#truetopic模式,falsequeue模式
pub-sub-domain: true
msgListener:
reagentTopicName: reagent
@@ -16,6 +16,7 @@
<result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="templateId" column="template_id"/>
</resultMap>
<resultMap id="applicationForUseVO" type="digital.laboratory.platform.reagent.vo.ApplicationForUseVO"
@@ -17,12 +17,27 @@
<result property="detailsRemark" column="details_remark"/>
<result property="replacementRemark" column="replacement_remark"/>
<result property="purpose" column="purpose"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="procurementContentId" column="procurement_content_id"/>
</resultMap>
<resultMap id="DetailsOfCentralizedVO" type="digital.laboratory.platform.reagent.vo.DetailsOfCentralizedVO"
extends="detailsOfCentralizedMap">
<result property="reagentConsumableName" column="reagent_consumable_name"/>
<result property="replacementReagentConsumableName" column="replacement_reagent_consumable_name"/>
<result property="brand" column="brand"/>
<result property="category" column="category"/>
<result property="specificationAndModel" column="specification_and_model"/>
<result property="standardValueOrPurity" column="standard_value_or_purity"/>
<result property="packagedCopies" column="packaged_copies"/>
<result property="minimumUnit" column="minimum_unit"/>
<result property="deviationOrUncertainty" column="deviation_or_uncertainty"/>
<result property="species" column="species"/>
<result property="department" column="department"/>
<result property="applicantName" column="applicant_name"/>
</resultMap>
@@ -41,5 +56,47 @@
order by create_time desc
</select>
<!-- 根据条件取 DetailsOfCentralizedVO 列表 -->
<select id="getDetailsOfCentralizedVOPlanList" resultMap="DetailsOfCentralizedVO"
resultType="digital.laboratory.platform.reagent.vo.DetailsOfCentralizedVO">
select dc.*,
(SELECT rc.reagent_consumable_name
FROM reagent_consumables rc
WHERE rc.reagent_consumable_id = dc.reagent_consumable_id) AS reagent_consumable_name,
(SELECT rc.reagent_consumable_name
FROM reagent_consumables rc
WHERE rc.reagent_consumable_id = dc.replacement_reagent_consumable_id) AS replacement_reagent_consumable_name,
(SELECT rc.brand
FROM reagent_consumables rc
WHERE rc.reagent_consumable_id = dc.replacement_reagent_consumable_id) AS brand,
(SELECT rc.category
FROM reagent_consumables rc
WHERE rc.reagent_consumable_id = dc.replacement_reagent_consumable_id) AS category,
(SELECT rc.specification_and_model
FROM reagent_consumables rc
WHERE rc.reagent_consumable_id = dc.replacement_reagent_consumable_id) AS specification_and_model,
(SELECT rc.standard_value_or_purity
FROM reagent_consumables rc
WHERE rc.reagent_consumable_id = dc.replacement_reagent_consumable_id) AS standard_value_or_purity,
(SELECT rc.packaged_copies
FROM reagent_consumables rc
WHERE rc.reagent_consumable_id = dc.replacement_reagent_consumable_id) AS packaged_copies,
(SELECT rc.minimum_unit
FROM reagent_consumables rc
WHERE rc.reagent_consumable_id = dc.replacement_reagent_consumable_id) AS minimum_unit,
(SELECT rc.deviation_or_uncertainty
FROM reagent_consumables rc
WHERE rc.reagent_consumable_id = dc.replacement_reagent_consumable_id) AS deviation_or_uncertainty,
(SELECT rc.species
FROM reagent_consumables rc
WHERE rc.reagent_consumable_id = dc.replacement_reagent_consumable_id) AS species,
(select department from dlp_base.sys_user where user_id = dc.create_by) AS department,
(SELECT user.name
FROM dlp_base.sys_user user
WHERE user.user_id=dc.create_by
) AS applicant_name
from details_of_centralized dc
where dc.procurement_content_id = #{procurementContentId}
order by create_time desc
</select>
</mapper>