新增内部简码标签打印数据查询
This commit is contained in:
@@ -90,6 +90,14 @@ public class BusinessSubSampleController implements BusinessControllerMarker {
|
|||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getPrintSubSample")
|
||||||
|
@Operation(summary = "获得打印子样业务")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
public CommonResult<BusinessSubSampleExtendRespVO> getPrintSubSample(@RequestParam("id") Long id) {
|
||||||
|
BusinessSubSampleExtendRespVO result = businessSubSampleService.getPrintSubSample(id);
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@Operation(summary = "获得子样业务列表")
|
@Operation(summary = "获得子样业务列表")
|
||||||
//@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')")
|
//@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')")
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
@@ -64,6 +70,21 @@ public class BusinessSubSampleExtendRespVO extends BusinessSubSampleRespVO {
|
|||||||
@Schema(description = "样品标签打印模版")
|
@Schema(description = "样品标签打印模版")
|
||||||
private String printTemplate;
|
private String printTemplate;
|
||||||
|
|
||||||
|
@Schema(description = "样品标签打印份数")
|
||||||
|
private Integer codePrintQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "收样人")
|
||||||
|
private String sampleReceiver;
|
||||||
|
|
||||||
|
@Schema(description = "分析项目")
|
||||||
|
private String assayProject;
|
||||||
|
|
||||||
|
@JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应)
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "收样时间")
|
||||||
|
private LocalDateTime sampleReceiveTime;
|
||||||
|
|
||||||
@Schema(description = "库位编码")
|
@Schema(description = "库位编码")
|
||||||
private String warehouseLocationCode;
|
private String warehouseLocationCode;
|
||||||
|
|
||||||
|
|||||||
@@ -218,6 +218,20 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
|||||||
.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId));
|
.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据子样及分析部门查询分析任务
|
||||||
|
* @param businessSubSampleId 子样id
|
||||||
|
* @param assayDepartmentId 分析部门id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
default List<BusinessAssayTaskDataDO> selectByBusinessSubSampleIdAndAssayDepartmentId(Long businessSubSampleId, Long assayDepartmentId) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>()
|
||||||
|
.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId)
|
||||||
|
.eq(BusinessAssayTaskDataDO::getAssayDepartmentId, assayDepartmentId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据子样查询分析任务
|
* 根据子样查询分析任务
|
||||||
* @param businessSubSampleId 子样id
|
* @param businessSubSampleId 子样id
|
||||||
|
|||||||
@@ -62,4 +62,10 @@ public interface BusinessSubSampleAnalysisGroupMapper extends BaseMapperX<Busine
|
|||||||
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, assayDepartmentId));
|
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, assayDepartmentId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default BusinessSubSampleAnalysisGroupDO selectByBusinessSubSampleIdAndAssayDepartmentId(Long businessSubSampleId, Long assayDepartmentId) {
|
||||||
|
return selectOne(new LambdaQueryWrapperX<BusinessSubSampleAnalysisGroupDO>()
|
||||||
|
.eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleId)
|
||||||
|
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, assayDepartmentId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -206,6 +206,7 @@ public interface BusinessSubSampleMapper extends BaseMapperX<BusinessSubSampleDO
|
|||||||
.selectAs(DictionaryBusinessDO::getName, BusinessSubSampleExtendRespVO::getDictionaryBusinessName)
|
.selectAs(DictionaryBusinessDO::getName, BusinessSubSampleExtendRespVO::getDictionaryBusinessName)
|
||||||
.selectAs(ConfigSubSampleDO::getIsPrint, BusinessSubSampleExtendRespVO::getIsPrint)
|
.selectAs(ConfigSubSampleDO::getIsPrint, BusinessSubSampleExtendRespVO::getIsPrint)
|
||||||
.selectAs(ConfigSubSampleDO::getPrintTemplate, BusinessSubSampleExtendRespVO::getPrintTemplate)
|
.selectAs(ConfigSubSampleDO::getPrintTemplate, BusinessSubSampleExtendRespVO::getPrintTemplate)
|
||||||
|
.selectAs(ConfigSubSampleDO::getCodePrintQuantity, BusinessSubSampleExtendRespVO::getCodePrintQuantity)
|
||||||
.eq(BusinessSubSampleDO::getId, id)
|
.eq(BusinessSubSampleDO::getId, id)
|
||||||
.eq(BusinessSubSampleDO::getSampleStatus, QmsCommonConstant.NORMAL)
|
.eq(BusinessSubSampleDO::getSampleStatus, QmsCommonConstant.NORMAL)
|
||||||
.eq(BusinessSubSampleDO::getIsEnabled, QmsCommonConstant.YES)
|
.eq(BusinessSubSampleDO::getIsEnabled, QmsCommonConstant.YES)
|
||||||
|
|||||||
@@ -57,6 +57,13 @@ public interface BusinessSubSampleService {
|
|||||||
*/
|
*/
|
||||||
BusinessSubSampleExtendRespVO getBusinessSubSample(Long id);
|
BusinessSubSampleExtendRespVO getBusinessSubSample(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取打印子样业务数据
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BusinessSubSampleExtendRespVO getPrintSubSample(Long id);
|
||||||
|
|
||||||
BusinessSubSampleDO getBySampleCode(String sampleCode);
|
BusinessSubSampleDO getBySampleCode(String sampleCode);
|
||||||
BusinessSubSampleDO getBySampleReturnCode(String sampleReturnCode);
|
BusinessSubSampleDO getBySampleReturnCode(String sampleReturnCode);
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.zt.plat.framework.security.core.LoginUser;
|
import com.zt.plat.framework.security.core.LoginUser;
|
||||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO;
|
||||||
@@ -37,6 +38,7 @@ import com.zt.plat.framework.common.exception.ServiceException;
|
|||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAnalysisGroupMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAnalysisGroupMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
||||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||||
@@ -62,6 +64,9 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
|||||||
@Resource
|
@Resource
|
||||||
private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper;
|
private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessAssayTaskDataMapper businessAssayTaskDataMapper;
|
||||||
|
|
||||||
@Resource private ConfigWarehouseLocationService configWarehouseLocationService;
|
@Resource private ConfigWarehouseLocationService configWarehouseLocationService;
|
||||||
@Resource private BusinessSampleHandoverService businessSampleHandoverService;
|
@Resource private BusinessSampleHandoverService businessSampleHandoverService;
|
||||||
@Resource private BusinessSampleHandoverDetailService businessSampleHandoverDetailService;
|
@Resource private BusinessSampleHandoverDetailService businessSampleHandoverDetailService;
|
||||||
@@ -135,6 +140,33 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
|||||||
return businessSubSampleMapper.selectExtendById(id);
|
return businessSubSampleMapper.selectExtendById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BusinessSubSampleExtendRespVO getPrintSubSample(Long id) {
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
BusinessSubSampleExtendRespVO businessSubSample = businessSubSampleMapper.selectExtendById(id);
|
||||||
|
BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleIdAndAssayDepartmentId(id, loginUser.getVisitDeptId());
|
||||||
|
businessSubSample.setAssayDepartmentId(businessSubSampleAnalysisGroupDO.getAssayDepartmentId());
|
||||||
|
businessSubSample.setAssayDepartmentName(businessSubSampleAnalysisGroupDO.getAssayDepartmentName());
|
||||||
|
businessSubSample.setSampleReceiver(businessSubSampleAnalysisGroupDO.getSampleReceiver());
|
||||||
|
businessSubSample.setSampleReceiveTime(businessSubSampleAnalysisGroupDO.getSampleReceiveTime());
|
||||||
|
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubSampleIdAndAssayDepartmentId(id, loginUser.getVisitDeptId());
|
||||||
|
Map<Long, List<BusinessAssayTaskDataDO>> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getConfigAssayMethodId));
|
||||||
|
List<String> assayProjectList = new ArrayList<>();
|
||||||
|
for (Map.Entry<Long, List<BusinessAssayTaskDataDO>> entry : businessAssayTaskDataDOMap.entrySet()) {
|
||||||
|
List<BusinessAssayTaskDataDO> val = entry.getValue();
|
||||||
|
BusinessAssayTaskDataDO businessAssayTaskDataDO = val.get(0);
|
||||||
|
String assayProject = businessAssayTaskDataDO.getAssayProject();
|
||||||
|
String[] split = assayProject.split(",");
|
||||||
|
for (String s : split) {
|
||||||
|
if (!assayProjectList.contains(s)) {
|
||||||
|
assayProjectList.add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
businessSubSample.setAssayProject(CollUtil.join(assayProjectList, ","));
|
||||||
|
return businessSubSample;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BusinessSubSampleDO getBySampleCode(String sampleCode) {
|
public BusinessSubSampleDO getBySampleCode(String sampleCode) {
|
||||||
LambdaQueryWrapper<BusinessSubSampleDO> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<BusinessSubSampleDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user