Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -193,6 +193,13 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
DiagnosisTreatmentSelParam.setYbType(null); // 临时移除,防止HisQueryUtils处理
|
||||
}
|
||||
|
||||
// 临时保存inspectionTypeId值,手动添加带表别名的条件
|
||||
Long inspectionTypeIdValue = null;
|
||||
if (DiagnosisTreatmentSelParam != null && DiagnosisTreatmentSelParam.getInspectionTypeId() != null) {
|
||||
inspectionTypeIdValue = DiagnosisTreatmentSelParam.getInspectionTypeId();
|
||||
DiagnosisTreatmentSelParam.setInspectionTypeId(null); // 临时移除,防止HisQueryUtils处理
|
||||
}
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<DiagnosisTreatmentDto> queryWrapper = HisQueryUtils.buildQueryWrapper(DiagnosisTreatmentSelParam,
|
||||
searchKey, new HashSet<>(Arrays.asList("bus_no", "name", "py_str", "wb_str")), request);
|
||||
@@ -204,6 +211,13 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
DiagnosisTreatmentSelParam.setYbType(ybTypeValue);
|
||||
}
|
||||
|
||||
// 如果需要按检验类型过滤,添加带表别名的条件
|
||||
if (inspectionTypeIdValue != null) {
|
||||
queryWrapper.eq("T1.inspection_type_id", inspectionTypeIdValue);
|
||||
// 恢复参数对象中的值
|
||||
DiagnosisTreatmentSelParam.setInspectionTypeId(inspectionTypeIdValue);
|
||||
}
|
||||
|
||||
// 分页查询
|
||||
IPage<DiagnosisTreatmentDto> diseaseTreatmentPage
|
||||
= activityDefinitionManageMapper.getDiseaseTreatmentPage(new Page<DiagnosisTreatmentDto>(pageNo, pageSize), queryWrapper);
|
||||
@@ -336,6 +350,8 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
// 显式设置新增的字段
|
||||
activityDefinition.setSortOrder(diagnosisTreatmentUpDto.getSortOrder());
|
||||
activityDefinition.setServiceRange(diagnosisTreatmentUpDto.getServiceRange());
|
||||
// 显式设置检验类型ID
|
||||
activityDefinition.setInspectionTypeId(diagnosisTreatmentUpDto.getInspectionTypeId());
|
||||
// 显式设置划价标记(避免前端字段/类型差异导致 copyProperties 后仍为默认值)
|
||||
activityDefinition.setPricingFlag(diagnosisTreatmentUpDto.getPricingFlag());
|
||||
|
||||
@@ -479,11 +495,13 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
|
||||
ActivityDefinition activityDefinition = new ActivityDefinition();
|
||||
BeanUtils.copyProperties(diagnosisTreatmentUpDto, activityDefinition);
|
||||
|
||||
|
||||
// 显式设置新增的字段
|
||||
activityDefinition.setSortOrder(diagnosisTreatmentUpDto.getSortOrder());
|
||||
activityDefinition.setServiceRange(diagnosisTreatmentUpDto.getServiceRange());
|
||||
|
||||
// 显式设置检验类型ID
|
||||
activityDefinition.setInspectionTypeId(diagnosisTreatmentUpDto.getInspectionTypeId());
|
||||
|
||||
// 如果前端没有传入编码,则使用10位数基础采番
|
||||
if (StringUtils.isEmpty(activityDefinition.getBusNo())) {
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_DEFINITION_NUM.getPrefix(), 10);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.openhis.web.datadictionary.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.lab.domain.InspectionType;
|
||||
import com.openhis.lab.service.IInspectionTypeService;
|
||||
import com.openhis.web.datadictionary.appservice.IDiagTreatMAppService;
|
||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
|
||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentUpDto;
|
||||
@@ -30,6 +33,9 @@ public class DiagnosisTreatmentController {
|
||||
@Resource
|
||||
private IDiagTreatMAppService diagTreatMAppService;
|
||||
|
||||
@Resource
|
||||
private IInspectionTypeService inspectionTypeService;
|
||||
|
||||
/**
|
||||
* 诊疗目录初期查询
|
||||
*
|
||||
@@ -188,4 +194,17 @@ public class DiagnosisTreatmentController {
|
||||
public R<?> updatePricingFlag(@RequestBody List<Long> ids, @RequestParam Integer pricingFlag) {
|
||||
return diagTreatMAppService.updatePricingFlag(ids, pricingFlag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检验类型列表(用于下拉框)
|
||||
*
|
||||
* @return 检验类型列表
|
||||
*/
|
||||
@GetMapping("/inspection-types")
|
||||
public R<?> getInspectionTypes() {
|
||||
LambdaQueryWrapper<InspectionType> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(InspectionType::getValidFlag, 1)
|
||||
.orderByAsc(InspectionType::getSortOrder);
|
||||
return R.ok(inspectionTypeService.list(queryWrapper));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,4 +130,13 @@ public class DiagnosisTreatmentDto {
|
||||
|
||||
/** 服务范围 */
|
||||
private String serviceRange;
|
||||
|
||||
/** 检验类型ID */
|
||||
@Dict(dictTable = "inspection_type", dictCode = "id", dictText = "name", deleteFlag = "valid_flag")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long inspectionTypeId;
|
||||
private String inspectionTypeId_dictText;
|
||||
|
||||
/** 检验类型名称(用于前端 testType 字段) */
|
||||
private String testType;
|
||||
}
|
||||
|
||||
@@ -30,4 +30,7 @@ public class DiagnosisTreatmentSelParam {
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 检验类型ID */
|
||||
private Long inspectionTypeId;
|
||||
}
|
||||
|
||||
@@ -128,4 +128,8 @@ public class DiagnosisTreatmentUpDto {
|
||||
|
||||
/** 服务范围 */
|
||||
private String serviceRange;
|
||||
|
||||
/** 检验类型ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long inspectionTypeId;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.openhis.web.lab.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.core.common.core.controller.BaseController;
|
||||
import com.core.common.core.domain.AjaxResult;
|
||||
import com.openhis.lab.domain.InspectionType;
|
||||
@@ -29,7 +30,25 @@ public class InspectionTypeController extends BaseController {
|
||||
private final TransactionTemplate transactionTemplate;
|
||||
|
||||
/**
|
||||
* 获取检验类型列表
|
||||
* 分页获取检验类型列表
|
||||
*
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 每页数量
|
||||
* @param searchKey 搜索关键词
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public AjaxResult getPage(
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize,
|
||||
@RequestParam(value = "searchKey", required = false) String searchKey) {
|
||||
log.info("【检验类型】分页查询请求 - pageNo: {}, pageSize: {}, searchKey: {}", pageNo, pageSize, searchKey);
|
||||
IPage<InspectionType> result = inspectionTypeService.getPage(pageNo, pageSize, searchKey);
|
||||
log.info("【检验类型】分页查询完成 - 总记录数: {}, 当前页记录数: {}", result.getTotal(), result.getRecords().size());
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检验类型列表(不分页,兼容旧接口)
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(InspectionType inspectionType) {
|
||||
|
||||
@@ -30,16 +30,22 @@
|
||||
T1.pricing_flag,
|
||||
T1.sort_order,
|
||||
T1.service_range,
|
||||
T1.inspection_type_id,
|
||||
T2.type_code as item_type_code,
|
||||
T2.yb_type,
|
||||
T2.price_code,
|
||||
T2.price as retail_price,
|
||||
T4.amount as maximum_retail_price
|
||||
T4.amount as maximum_retail_price,
|
||||
T3.name as test_type
|
||||
FROM wor_activity_definition T1
|
||||
/* 只JOIN必要的价格表,使用INNER JOIN避免笛卡尔积 */
|
||||
INNER JOIN adm_charge_item_definition T2
|
||||
ON T1.id = T2.instance_id
|
||||
AND T2.instance_table = 'wor_activity_definition'
|
||||
/* 检验类型关联 */
|
||||
LEFT JOIN inspection_type T3
|
||||
ON T1.inspection_type_id = T3.id
|
||||
AND T3.valid_flag = 1
|
||||
/* 最高零售价使用LEFT JOIN,因为可能不存在 */
|
||||
LEFT JOIN adm_charge_item_def_detail T4
|
||||
ON T4.definition_id = T2.id
|
||||
@@ -97,9 +103,13 @@
|
||||
T1.children_json,
|
||||
T1.pricing_flag,
|
||||
T1.sort_order,
|
||||
T1.service_range
|
||||
T1.service_range,
|
||||
T1.inspection_type_id,
|
||||
T3.name as test_type
|
||||
FROM wor_activity_definition T1
|
||||
LEFT JOIN adm_charge_item_definition T2 ON T1.id = T2.instance_id
|
||||
/* 检验类型关联 */
|
||||
LEFT JOIN inspection_type T3 ON T1.inspection_type_id = T3.id AND T3.valid_flag = 1
|
||||
<where>
|
||||
T1.delete_flag = '0'
|
||||
AND T2.instance_table = 'wor_activity_definition'
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.openhis.lab.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.lab.domain.InspectionType;
|
||||
|
||||
@@ -11,4 +13,13 @@ import com.openhis.lab.domain.InspectionType;
|
||||
*/
|
||||
public interface IInspectionTypeService extends IService<InspectionType> {
|
||||
|
||||
/**
|
||||
* 分页查询检验类型列表
|
||||
*
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 每页数量
|
||||
* @param searchKey 搜索关键词(可选)
|
||||
* @return 分页结果
|
||||
*/
|
||||
IPage<InspectionType> getPage(Integer pageNo, Integer pageSize, String searchKey);
|
||||
}
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.openhis.lab.service.impl;
|
||||
|
||||
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.lab.domain.InspectionType;
|
||||
import com.openhis.lab.mapper.InspectionTypeMapper;
|
||||
import com.openhis.lab.service.IInspectionTypeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 检验类型Service实现类
|
||||
@@ -15,4 +19,22 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class InspectionTypeServiceImpl extends ServiceImpl<InspectionTypeMapper, InspectionType> implements IInspectionTypeService {
|
||||
|
||||
@Override
|
||||
public IPage<InspectionType> getPage(Integer pageNo, Integer pageSize, String searchKey) {
|
||||
Page<InspectionType> page = new Page<>(pageNo, pageSize);
|
||||
LambdaQueryWrapper<InspectionType> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 搜索关键词(按编码或名称模糊查询)
|
||||
if (StringUtils.hasText(searchKey)) {
|
||||
queryWrapper.and(wrapper -> wrapper
|
||||
.like(InspectionType::getCode, searchKey)
|
||||
.or()
|
||||
.like(InspectionType::getName, searchKey));
|
||||
}
|
||||
|
||||
// 按排序字段升序排列
|
||||
queryWrapper.orderByAsc(InspectionType::getSortOrder);
|
||||
|
||||
return this.page(page, queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -89,4 +89,7 @@ public class ActivityDefinition extends HisBaseEntity {
|
||||
|
||||
/** 服务范围 */
|
||||
private String serviceRange;
|
||||
|
||||
/** 检验类型ID(关联 inspection_type 表) */
|
||||
private Long inspectionTypeId;
|
||||
}
|
||||
Reference in New Issue
Block a user