Merge branch 'test' of https://git.will-way.cn/zgty/zt-qms into test

This commit is contained in:
2025-11-25 09:17:53 +08:00
17 changed files with 195 additions and 35 deletions

View File

@@ -71,12 +71,12 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
return success(true);
}
@PostMapping("/addBySampleCode")
@Operation(summary = "增加或移除样品")
public CommonResult<Boolean> addBySampleCode(@RequestBody JSONObject param) {
@PostMapping("/addBySampleReturnCode")
@Operation(summary = "按归库码增加样品")
public CommonResult<Boolean> addBySampleReturnCode(@RequestBody JSONObject param) {
String id = param.getString("id");
String sampleCode = param.getString("sampleCode");
BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleCode(sampleCode);
String sampleReturnCode = param.getString("sampleReturnCode");
BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleReturnCode(sampleReturnCode);
if(businessSubSampleDO == null)
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到此样品!");
//判断样品状态

View File

@@ -50,11 +50,11 @@ public class BusinessSampleDispatchDetailController implements BusinessControlle
@GetMapping("/searchBySampleCode")
@Operation(summary = "扫码查询待归还样品")
public CommonResult<BusinessSampleDispatchDetailExtendRespVO> searchBySampleCode(HttpServletRequest request) {
String sampleCode = request.getParameter("sampleCode");
if(ObjectUtils.isEmpty(sampleCode))
String sampleReturnCode = request.getParameter("sampleReturnCode");
if(ObjectUtils.isEmpty(sampleReturnCode))
return CommonResult.error(BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS.getCode(), "请输入样品编号!");
BusinessSampleDispatchDetailPageReqVO reqVO = new BusinessSampleDispatchDetailPageReqVO();
reqVO.setSampleCode(sampleCode);
reqVO.setSampleReturnCode(sampleReturnCode);
reqVO.setBorrowStatus("1");
reqVO.setGivebackStatus("0");

View File

@@ -121,6 +121,13 @@ public class BusinessSubSampleController implements BusinessControllerMarker {
return success(pageResult);
}
@GetMapping("/selectPageForDispatch")
@Operation(summary = "查询可申请调拨子样")
public CommonResult<PageResult<BusinessSubSampleExtendRespVO>> selectPageForDispatch(@Valid BusinessSubSamplePageReqVO pageReqVO) {
PageResult<BusinessSubSampleExtendRespVO> pageResult = businessSubSampleService.selectPageForDispatch(pageReqVO);
return success(pageResult);
}
@GetMapping("/page-task")
@Operation(summary = "获得子样业务分页")
//@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')")

View File

@@ -60,8 +60,8 @@ public class BusinessSampleDispatchDetailPageReqVO extends PageParam {
//================================扩展字段=============================================
@Schema(description = "样品")
private String sampleCode;
@Schema(description = "样品归库码")
private String sampleReturnCode;
@Schema(description = "idsList")
private List<Long> idList;

View File

@@ -64,6 +64,12 @@ public class BusinessSampleDispatchPageReqVO extends PageParam {
@Schema(description = "备注")
private String remark;
@Schema(description = "仓库名称")
private String warehouseName;
@Schema(description = "仓库编码")
private String warehouseCode;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;

View File

@@ -83,6 +83,14 @@ public class BusinessSampleDispatchRespVO {
@ExcelProperty("备注")
private String remark;
@Schema(description = "仓库名称")
@ExcelProperty("仓库名称")
private String warehouseName;
@Schema(description = "仓库编码")
@ExcelProperty("仓库编码")
private String warehouseCode;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;

View File

@@ -64,6 +64,12 @@ public class BusinessSampleDispatchSaveReqVO {
@Schema(description = "备注")
private String remark;
@Schema(description = "仓库名称")
private String warehouseName;
@Schema(description = "仓库编码")
private String warehouseCode;
//=========================扩展字段=======================================
@Schema(description = "新增子样id")
List<Long> addSubSampleIds;

View File

@@ -142,8 +142,15 @@ public class BusinessSubSamplePageReqVO extends PageParam {
@Schema(description = "分析部门状态")
private String assayDepartmentStatus;
//扩展字段
//=======================================扩展字段=======================================
@Schema(description = "库位编码")
private String warehouseLocationCode;
@Schema(description = "仓库编码")
private String warehouseCode;
//是否过滤已申请调拨的数据: 1-是, 其他值:否
@Schema(description = "是否过滤已申请调拨的数据")
private String hideDispatchData;
}

View File

@@ -134,4 +134,6 @@ public class BusinessSubSampleReqVO {
@Schema(description = "备注")
private String remark;
}

View File

@@ -119,4 +119,11 @@ public class BusinessSampleDispatchDO extends BusinessBaseDO {
@TableField("RMK")
private String remark;
//仓库编码
@TableField("WRH_CD")
private String warehouseCode;
//仓库名称
@TableField("WRH_NAME")
private String warehouseName;
}

View File

@@ -44,7 +44,7 @@ public interface BusinessSampleDispatchDetailMapper extends BaseMapperX<Business
.inIfPresent(BusinessSampleDispatchDetailDO::getId, reqVO.getIdList())
.eqIfPresent(BusinessSampleDispatchDetailDO::getParentId, reqVO.getParentId())
.eqIfPresent(BusinessSampleDispatchDetailDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
.eqIfPresent(BusinessSubSampleDO::getSampleCode, reqVO.getSampleCode())
.eqIfPresent(BusinessSubSampleDO::getSampleReturnCode, reqVO.getSampleReturnCode())
.eqIfPresent(BusinessSampleDispatchDetailDO::getBorrowUser, reqVO.getBorrowUser())
.eqIfPresent(BusinessSampleDispatchDetailDO::getBorrowUserId, reqVO.getBorrowUserId())
.betweenIfPresent(BusinessSampleDispatchDetailDO::getBorrowTime, reqVO.getBorrowTime())

View File

@@ -20,6 +20,9 @@ import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant;
import jakarta.validation.Valid;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
/**
* 子样业务 Mapper
@@ -235,4 +238,7 @@ public interface BusinessSubSampleMapper extends BaseMapperX<BusinessSubSampleDO
.orderByDesc(BusinessSubSampleDO::getId));
}
Page<BusinessSubSampleExtendRespVO> selectPageForDispatch(IPage<?> page, @Param("param") BusinessSubSamplePageReqVO reqVO);
}

View File

@@ -69,7 +69,7 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch
businessSampleDispatchDetailService.deleteBusinessSampleDispatchDetailListByIds(removeDetailIds);
}
//处理新增
if(!addSubSampleIds.isEmpty()){
if(addSubSampleIds != null && !addSubSampleIds.isEmpty()){
List<BusinessSampleDispatchDetailDO> detailList = businessSampleDispatchDetailService.listByParID(id);
//去除已添加过的
List<Long> hasIds = detailList.stream().map(BusinessSampleDispatchDetailDO::getBusinessSubSampleId).toList();
@@ -160,6 +160,7 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch
BusinessHandoverRecordSubDO handoverRecord = new BusinessHandoverRecordSubDO();
handoverRecord.setBusinessSubSampleId(detail.getBusinessSubSampleId());
handoverRecord.setSampleCode(detail.getSampleCode());
handoverRecord.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE);
handoverRecord.setOperationTime(borrowTime);
handoverRecord.setOperator(warehouseUser);
handoverRecord.setOperatorId(warehouseUserId);

View File

@@ -68,6 +68,8 @@ public interface BusinessSubSampleService {
*/
PageResult<BusinessSubSampleExtendRespVO> getBusinessSubSamplePage(BusinessSubSamplePageReqVO pageReqVO);
PageResult<BusinessSubSampleExtendRespVO> selectPageForDispatch(BusinessSubSamplePageReqVO pageReqVO);
/**
* 获取子样分析班组分页
* @param pageReqVO

View File

@@ -3,11 +3,12 @@ package com.zt.plat.module.qms.business.bus.service;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zt.plat.framework.security.core.LoginUser;
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.dal.dataobject.BusinessHandoverRecordSubDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO;
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.config.dal.dataobject.ConfigSubSampleDO;
@@ -159,7 +160,15 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
return page;
}
@Override
@Override
public PageResult<BusinessSubSampleExtendRespVO> selectPageForDispatch(BusinessSubSamplePageReqVO pageReqVO) {
IPage<BusinessSubSampleExtendRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
Page<BusinessSubSampleExtendRespVO> pageList = businessSubSampleMapper.selectPageForDispatch(page, pageReqVO);
PageResult<BusinessSubSampleExtendRespVO> ret = new PageResult<>(pageList.getRecords(), pageList.getTotal());
return ret;
}
@Override
public PageResult<BusinessSubSampleExtendRespVO> getAnalysisGroupPage(BusinessSubSamplePageReqVO pageReqVO) {
PageResult<BusinessSubSampleExtendRespVO> page = businessSubSampleMapper.selectAnalysisGroupPage(pageReqVO);
List<BusinessSubSampleExtendRespVO> list = page.getList();
@@ -213,9 +222,9 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
public BusinessSubSampleRespVO execReturnToStock(BusinessSubSampleSaveReqVO reqVo) {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
String loginUserName = SecurityFrameworkUtils.getLoginUserNickname();
BusinessSubSampleDO businessSubSampleDO = this.getBySampleReturnCode(reqVo.getSampleCode());
BusinessSubSampleDO businessSubSampleDO = this.getBySampleReturnCode(reqVo.getSampleReturnCode());
if(businessSubSampleDO == null)
throw exception(BUSINESS_SUB_SAMPLE_NOT_EXISTS);
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到子样数据,请检查:样品所处环节和是否已归库!");
//检查样品状态
if(!QmsCommonConstant.FLOW_SAMPLE_STORAGE.equals(businessSubSampleDO.getSampleFlowNodeKey()))
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "子样任务不在“归库”环节,请检查前置任务是否已完成!");
@@ -225,6 +234,16 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
//判断仓库位置
Long configSubSampleId = businessSubSampleDO.getConfigSubSampleId();
ConfigSubSampleDO configSubSampleDO = configSubSampleService.getConfigSubSample(configSubSampleId);
String cfgLocationCode = configSubSampleDO.getConfigWarehouseLocationCode(); //子样配置表的仓库编码
ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(reqVo.getWarehouseLocationCode(), QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
if(locationDO == null)
throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS);
ConfigWarehouseLocationDO warehouseDO = configWarehouseLocationService.getConfigWarehouseLocation(locationDO.getParentId());
if(warehouseDO == null)
throw exception0(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS.getCode(), "库位编码对应的仓库不存在,请联系管理员处理!");
if(!warehouseDO.getCode().equals(cfgLocationCode))
throw exception0(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS.getCode(), "您归库的样品不该进入此库,请检查后再重新归库。应归入仓库(编码):" + cfgLocationCode);
//判断归库码
Integer isGenerateSimpleCode = configSubSampleDO.getIsGenerateSimpleCode();
Integer printFlag = 0;
if(1 == isGenerateSimpleCode){
@@ -238,9 +257,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
}
}
ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(reqVo.getWarehouseLocationCode(), QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
if(locationDO == null)
throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS);
//更新入库状态
businessSubSampleDO.setReturnStatus(QmsCommonConstant.COMPLETED);
@@ -276,7 +293,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
public Integer execTakeOff(JSONObject reqVo) {
String actionWay = reqVo.getString("actionWay");
String warehouseLocationCode = reqVo.getString("warehouseLocationCode");
String sampleCode = reqVo.getString("sampleCode");
String sampleReturnCode = reqVo.getString("sampleReturnCodes");
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
String loginUserName = SecurityFrameworkUtils.getLoginUserNickname();
//查询要操作的样品
@@ -285,10 +302,10 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
queryWrapper.eq(BusinessSubSampleDO::getReturnStatus, QmsCommonConstant.COMPLETED);
if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_SAMPLE.equals(actionWay)){
//按编号查询样品
if(ObjectUtils.isEmpty(sampleCode))
if(ObjectUtils.isEmpty(sampleReturnCode))
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少样品编号参数!");
List<String> sampleCodes = Arrays.asList(sampleCode.split( ","));
queryWrapper.in(BusinessSubSampleDO::getSampleCode, sampleCodes);
List<String> sampleReturnCodes = Arrays.asList(sampleReturnCode.split( ","));
queryWrapper.in(BusinessSubSampleDO::getSampleReturnCode, sampleReturnCodes);
}
else if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_LOCATION.equals(actionWay)){
//按库位查询样品
@@ -358,7 +375,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
String actionWay = reqVo.getString("actionWay");
String targetLocation = reqVo.getString("targetLocation");
String warehouseLocationCode = reqVo.getString("warehouseLocationCode");
String sampleCode = reqVo.getString("sampleCode");
String sampleReturnCode = reqVo.getString("sampleReturnCode");
if(ObjectUtils.isEmpty(targetLocation))
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少目标库位参数!");
ConfigWarehouseLocationDO targetLocationDO = configWarehouseLocationService.getLocationByCode(targetLocation, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
@@ -368,10 +385,10 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
queryWrapper.eq(BusinessSubSampleDO::getReturnStatus, QmsCommonConstant.COMPLETED);
if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_SAMPLE.equals(actionWay)){
//按编号查询样品
if(ObjectUtils.isEmpty(sampleCode))
if(ObjectUtils.isEmpty(sampleReturnCode))
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少样品编号参数!");
List<String> sampleCodes = Arrays.asList(sampleCode.split( ","));
queryWrapper.in(BusinessSubSampleDO::getSampleCode, sampleCodes);
List<String> sampleReturnCodes = Arrays.asList(sampleReturnCode.split( ","));
queryWrapper.in(BusinessSubSampleDO::getSampleReturnCode, sampleReturnCodes);
}
else if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_LOCATION.equals(actionWay)){
//按库位查询样品
@@ -380,7 +397,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(warehouseLocationCode, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
if(locationDO == null)
throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS);
queryWrapper.eq(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, warehouseLocationCode);
queryWrapper.eq(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, locationDO.getId());
}else{
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "actionWay参数错误");
}

View File

@@ -123,10 +123,10 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
String hasRange = jsonObject.getString("hasRange"); //是否有检出限
String verticalFlag = jsonObject.getString("verticalFlag"); //vertical-纵表, 否则为横表
String fixedFields = jsonObject.getString("fixedFields"); //固定检测项。如果固定检测项则以检测项作为数据Key
if("1".equals(verticalFlag)){
if("1".equals(verticalFlag)){ //纵表
return assembleVerticalData(fieldList, dataList, customConfig);
}
if(!ObjectUtils.isEmpty(fixedFields)){
if(!ObjectUtils.isEmpty(fixedFields)){ //固定列
return assembleFixedFieldsData(fieldList, dataList, customConfig);
}
if(!ObjectUtils.isEmpty(dynamicColCountStr)) dynamicColCount = Integer.parseInt(dynamicColCountStr);
@@ -152,7 +152,13 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
if(rowCountOneSample > 1){
allRowCount = (1 + dataLength + emptyRowCount + 9) * rowCountOneSample + emptyRowCount; //(标题 + 样品数 + 空行) * 但样品行数 + 末尾行
}
List<JSONObject> rowList = new ArrayList<>(Arrays.asList(new JSONObject[allRowCount + 1]));
List<JSONObject> rowList = new ArrayList<>();
for(int i = 0; i < maxRowCount; i++){
JSONObject row = new JSONObject();
row.put("col01", " ");
rowList.add( row);
}
//=============处理表头============
JSONObject t = new JSONObject();
@@ -393,6 +399,13 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr);
List<JSONObject> rowList = new ArrayList<>();
for(int i = 0; i < maxRowCount; i++){
JSONObject row = new JSONObject();
row.put("sampleNameCode", " ");
row.put("sampleName", " ");
row.put("sampleCode", " ");
rowList.add( row);
}
for(ReportDocumentDataDO dataDO : dataList) {
JSONObject t = new JSONObject();
String documentContent = dataDO.getDocumentContent();
@@ -524,7 +537,6 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
return rowList;
}
@Override
public CommonResult<List<ReportDocumentDataDO>> listByMainDataId(Long mainDataId) {
QueryWrapper<ReportDocumentDataDO> queryWrapper = new QueryWrapper<>();

View File

@@ -9,4 +9,83 @@
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="selectPageForDispatch" resultType="com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleExtendRespVO">
select
smp.ID,
smp.TENANT_ID as tenantId,
smp.BSN_BSE_SMP_ID as businessBaseSampleId,
smp.BSN_SB_PRN_SMP_ID as businessSubParentSampleId,
smp.CFG_SB_SMP_ID as configSubSampleId,
smp.DIC_BSN_ID as dictionaryBusinessId,
smp.CFG_WRH_LOC_INF_ID as configWarehouseLocationInfomationId,
smp.SMP_ID as sampleId,
smp.GRP_ID as groupId,
smp.SMP_NAME as sampleName,
smp.SMP_CD as sampleCode,
smp.SMP_ASY_CD as sampleAssayCode,
smp.SMP_RTN_CD as sampleReturnCode,
smp.IS_GEN_RTN_CD as isGenerateReturnCode,
smp.IS_WG as isWeighing,
smp.LST_SMP_WGT as lastSampleWeight,
smp.LST_BAL_CD as lastBalanceCode,
smp.CFG_SMP_FLW_ID as configSampleFlowId,
smp.SMP_FLW_NDE_KY as sampleFlowNodeKey,
smp.SMP_FLW_NDE_TM as sampleFlowNodeTime,
smp.NXT_SMP_FLW_NDE as nextSampleFlowNode,
smp.SMP_STS as sampleStatus,
smp.ASY_OPTR as sampleOperator,
smp.IS_ASN_TSKD as isAssignTasked,
smp.ASN_TSK_TM as assignTaskTime,
smp.IS_RPOD as isReported,
smp.RPTR as reporter,
smp.RPT_TM as reportTime,
smp.RTN_TM as returnTime,
smp.RTN_STS as returnStatus,
smp.DST_STS as dispatchStatus,
smp.RTN_CD_PRNT_CNT as returnCodePrintCount,
smp.PRNT_LST_TM as printLastTime,
smp.UP_SMP_RCD_ID as upSampleRecordId,
smp.ANL_RMK as analysisRemark,
smp.IS_ENBD as isEnabled,
smp.SYS_DEPT_CD as systemDepartmentCode,
smp.UPD_CNT as updateCount,
smp.RMK as remark,
loc.CD as warehouseLocationCode,
wrh.CD as warehouseCode
from t_bsn_sb_smp smp
left join t_cfg_wrh_loc loc on smp.CFG_WRH_LOC_INF_ID = loc.id
left join t_cfg_wrh_loc wrh on loc.PRN_ID = wrh.id
<where>
<if test="param.sampleFlowNodeKey != null and param.sampleFlowNodeKey != ''">
and smp.SMP_FLW_NDE_KY = #{param.sampleFlowNodeKey}
</if>
<if test="param.sampleReturnCode != null and param.sampleReturnCode != ''">
and smp.SMP_RTN_CD = #{param.sampleReturnCode}
</if>
<if test="param.returnStatus != null and param.returnStatus != ''">
and smp.RTN_STS = #{param.returnStatus}
</if>
<if test="param.dispatchStatus != null and param.dispatchStatus != ''">
and smp.DST_STS = #{param.dispatchStatus}
</if>
<if test="param.warehouseLocationCode != null and param.warehouseLocationCode != ''">
and loc.CD = #{param.warehouseLocationCode}
</if>
<if test="param.warehouseCode != null and param.warehouseCode != ''">
and wrh.CD = #{param.warehouseCode}
</if>
<if test="param.hideDispatchData != null and param.hideDispatchData == '1'">
and not exists(
select 1 from T_BSN_SMP_DST_DTL d left join T_BSN_SMP_DST m on d.PRN_ID = m.ID
where d.BSN_SB_SMP_ID = smp.ID
and d.deleted = 0
and m.FIN_STS in ('0', 'pending')
and m.CNL_STS = 0
and m.deleted = 0
)
</if>
</where>
</select>
</mapper>