版本更新
This commit is contained in:
@@ -5,10 +5,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.core.common.exception.UtilException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.BoundSetOperations;
|
||||
import org.springframework.data.redis.core.HashOperations;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.ValueOperations;
|
||||
import org.springframework.data.redis.core.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@@ -256,4 +253,28 @@ public class RedisCache {
|
||||
return this.redisTemplate.opsForValue().increment(key, delta);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 获取所有String类型的键值对(开发环境下使用)
|
||||
*/
|
||||
public Map<String, Object> getAllDictDataWithKeys(String pattern) {
|
||||
pattern+="*";
|
||||
Map<String, Object> allDict = new HashMap<>();
|
||||
// 1. 获取所有键("*"匹配所有键)
|
||||
Set<String> allKeys = redisTemplate.keys(pattern);
|
||||
if (allKeys == null || allKeys.isEmpty()) {
|
||||
return allDict;
|
||||
}
|
||||
// 2. 批量获取值(使用multiGet高效批量查询)
|
||||
ValueOperations<String, Object> valueOps = redisTemplate.opsForValue();
|
||||
List<Object> values = valueOps.multiGet(allKeys);
|
||||
// 3. 组装键值对
|
||||
Iterator<String> keyIter = allKeys.iterator();
|
||||
for (Object value : values) {
|
||||
if (keyIter.hasNext()) {
|
||||
allDict.put(keyIter.next(), value);
|
||||
}
|
||||
}
|
||||
return allDict;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -197,7 +197,39 @@ public enum TenantOptionDict {
|
||||
/**
|
||||
* PACSAppSecret
|
||||
*/
|
||||
FORWARD_SWITCH("forwardSwitch", "电子发票中转服务开关", 47);
|
||||
FORWARD_SWITCH("forwardSwitch", "电子发票中转服务开关", 47),
|
||||
/**
|
||||
* 食源性开关
|
||||
*/
|
||||
FOODBORNE_SWITCH("foodborneSwitch", "食源性开关", 48),
|
||||
/**
|
||||
* 食源性接口地址 ../goto(格式如下:http://172.16.7.247/infections/goto 需指定到/goto)
|
||||
*/
|
||||
FOODBORNE_API_URL("foodborneApiUrl", "食源性接口地址 ../goto", 49),
|
||||
/**
|
||||
* 食源性医疗机构
|
||||
*/
|
||||
FOODBORNE_HOSPITAL("foodborneHospital", "食源性医疗机构", 50),
|
||||
/**
|
||||
* 食源性登录账号
|
||||
*/
|
||||
FOODBORNE_USER_NAME("foodborneUserName", "食源性登录账号", 51),
|
||||
/**
|
||||
* BPC商户号
|
||||
*/
|
||||
BPC_MID("bpcMid", "BPC商户号", 52),
|
||||
/**
|
||||
* BPC终端号
|
||||
*/
|
||||
BPC_TID("bpcTid", "BPC终端号", 53),
|
||||
/**
|
||||
* BPCMD5签名密钥
|
||||
*/
|
||||
BPC_MD5_SHARED_SECRET("bpcMd5SharedSecret", "BPCMD5签名密钥", 54),
|
||||
/**
|
||||
* BPC请求URL
|
||||
*/
|
||||
BPC_REQUEST_URL("bpcRequestUrl", "BPC请求URL", 55);
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
@@ -273,7 +273,7 @@ public class SysLoginService {
|
||||
Optional<SysTenant> currentTenantOptional =
|
||||
bindTenantList.getData().stream().filter(e -> tenantId.equals(e.getId())).findFirst();
|
||||
if (currentTenantOptional.isEmpty()) {
|
||||
throw new ServiceException("所属医院非法");
|
||||
throw new ServiceException("所属医院无权限");
|
||||
}
|
||||
// 租户状态校验
|
||||
SysTenant currentTenant = currentTenantOptional.get();
|
||||
|
@@ -0,0 +1,22 @@
|
||||
package com.openhis.web.adjustprice.appservice;
|
||||
|
||||
import com.openhis.web.adjustprice.dto.SupplyListDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
* @Author raymond
|
||||
* @Date 16:09 2025/10/15
|
||||
* @return
|
||||
**/
|
||||
public interface ISupplyService {
|
||||
/**
|
||||
* Desc:
|
||||
* @param
|
||||
* @Author raymond
|
||||
* @Date 17:10 2025/10/15
|
||||
* @return java.util.List<com.openhis.web.paymentmanage.dto.SupplyListDto>
|
||||
**/
|
||||
List<SupplyListDto> searchAllSupplyList();
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package com.openhis.web.adjustprice.appservice.impl;
|
||||
|
||||
import com.openhis.web.adjustprice.appservice.ISupplyService;
|
||||
import com.openhis.web.adjustprice.dto.SupplyListDto;
|
||||
import com.openhis.web.adjustprice.mapper.SupplyMapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ChangePriceImpl
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/15 16:10
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Component
|
||||
public class SupplyServiceImpl implements ISupplyService {
|
||||
|
||||
@Resource
|
||||
private SupplyMapper supplyMapper;
|
||||
|
||||
@Override
|
||||
public List<SupplyListDto> searchAllSupplyList() {
|
||||
return this.supplyMapper.searchAllSupplyList();
|
||||
}
|
||||
}
|
@@ -0,0 +1,112 @@
|
||||
package com.openhis.web.adjustprice.controller;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.adjustprice.appservice.ISupplyService;
|
||||
import com.openhis.web.datadictionary.dto.MedicationSearchParam;
|
||||
|
||||
/**
|
||||
* @ClassName ChargePriceController
|
||||
* @Description 调价修改药品、耗材、诊疗、挂号接口类
|
||||
* @Author raymond
|
||||
* @Date 2025/10/14 16:56
|
||||
* @Version 1.0
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/change/price")
|
||||
public class ChangePriceController {
|
||||
@Resource
|
||||
private ISupplyService supplyService;
|
||||
|
||||
/**
|
||||
* Desc: 查询所有供应商集合
|
||||
*
|
||||
* @param
|
||||
* @Author raymond
|
||||
* @Date 16:55 2025/10/15
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@GetMapping(value = "searchAllSupply")
|
||||
public R<?> searchAllSupply() {
|
||||
return R.ok(this.supplyService.searchAllSupplyList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc: 根据供应商和药品名称加载要修改的药品数据
|
||||
*
|
||||
* @Author raymond
|
||||
* @Date 08:47 2025/10/15
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@PostMapping(value = "searchMedicineListToPage")
|
||||
public R<?> searchMedicineListToPage() {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*
|
||||
* @param medicationSearchParam
|
||||
* @param searchKey
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param request
|
||||
* @Author raymond
|
||||
* @Date 13:41 2025/10/15
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@PostMapping(value = "searchConsumablesListToPage")
|
||||
public R<?> searchConsumablesListToPage(MedicationSearchParam medicationSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*
|
||||
* @param medicationSearchParam
|
||||
* @param searchKey
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param request
|
||||
* @Author raymond
|
||||
* @Date 13:41 2025/10/15
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@PostMapping(value = "searchDiagnosisListToPage")
|
||||
public R<?> searchDiagnosisListToPage(MedicationSearchParam medicationSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
*
|
||||
* @param medicationSearchParam
|
||||
* @param searchKey
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param request
|
||||
* @Author raymond
|
||||
* @Date 13:41 2025/10/15
|
||||
* @return com.core.common.core.domain.R<?>
|
||||
**/
|
||||
@PostMapping(value = "searchHealthCareListToPage")
|
||||
public R<?> searchRegisterListToPage(MedicationSearchParam medicationSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.openhis.web.adjustprice.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName SupplyListDto
|
||||
* @Description TODO
|
||||
* @Author raymond
|
||||
* @Date 2025/10/15 16:56
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
public class SupplyListDto {
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
private Long supplyId;
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supplyName;
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package com.openhis.web.adjustprice.mapper;
|
||||
|
||||
import com.openhis.web.adjustprice.dto.SupplyListDto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Desc:
|
||||
* @Author raymond
|
||||
* @Date 14:37 2025/10/15
|
||||
* @return
|
||||
**/
|
||||
@Component
|
||||
public interface SupplyMapper {
|
||||
/**
|
||||
* Desc:
|
||||
* @param
|
||||
* @Author raymond
|
||||
* @Date 17:10 2025/10/15
|
||||
* @return java.util.List<com.openhis.web.paymentmanage.dto.SupplyListDto>
|
||||
**/
|
||||
List<SupplyListDto> searchAllSupplyList();
|
||||
|
||||
}
|
@@ -126,7 +126,6 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi
|
||||
});
|
||||
return prescriptionDtoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 医保转自费
|
||||
*
|
||||
|
@@ -387,7 +387,9 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi
|
||||
// 收费状态枚举
|
||||
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum()));
|
||||
// 计算年龄
|
||||
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
if (e.getBirthDate() != null) {
|
||||
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
|
||||
}
|
||||
});
|
||||
return R.ok(encounterPatientPage);
|
||||
}
|
||||
|
@@ -56,4 +56,5 @@ public interface OutpatientChargeAppMapper {
|
||||
@Param("register") Integer register, @Param("planned") Integer planned, @Param("billable") Integer billable,
|
||||
@Param("billed") Integer billed, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded,
|
||||
@Param("partRefund") Integer partRefund);
|
||||
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@ package com.openhis.web.common.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
@@ -30,6 +31,7 @@ public class PerformRecordDto {
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/** 执行时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date occurrenceTime;
|
||||
|
||||
/** 执行位置 */
|
||||
|
@@ -3,6 +3,9 @@ package com.openhis.web.datadictionary.appservice;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.datadictionary.dto.DiagnosisTreatmentSelParam;
|
||||
@@ -75,4 +78,18 @@ public interface IDiagTreatMAppService {
|
||||
*/
|
||||
R<?> addDiseaseTreatment(DiagnosisTreatmentUpDto diagnosisTreatmentUpDto);
|
||||
|
||||
/**
|
||||
* 导入诊疗目录
|
||||
*
|
||||
* @param file 文件
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> importData(MultipartFile file);
|
||||
|
||||
/**
|
||||
* 获取导入模板
|
||||
*
|
||||
* @param response 响应
|
||||
*/
|
||||
void importTemplate(HttpServletResponse response);
|
||||
}
|
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
package com.openhis.web.datadictionary.appservice.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -35,10 +35,14 @@ import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.DeviceDefinition;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
import com.openhis.administration.service.*;
|
||||
import com.openhis.administration.service.IChargeItemDefinitionService;
|
||||
import com.openhis.administration.service.IDeviceDefinitionService;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.ISupplierService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.CommonUtil;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.sys.service.IOperationRecordService;
|
||||
@@ -65,10 +69,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
private IDeviceDefinitionService deviceDefinitionService;
|
||||
|
||||
@Autowired
|
||||
IChargeItemDefinitionService chargeItemDefinitionService;
|
||||
|
||||
@Autowired
|
||||
IChargeItemDefDetailService chargeItemDefDetailService;
|
||||
private IChargeItemDefinitionService chargeItemDefinitionService;
|
||||
|
||||
@Autowired
|
||||
private ILocationService locationService;
|
||||
@@ -386,7 +387,7 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
@Override
|
||||
public R<?> importData(MultipartFile file) {
|
||||
// 读取文件
|
||||
R<List<DeviceImportDto>> readResult = readExcelFile(file);
|
||||
R<List<DeviceImportDto>> readResult = CommonUtil.readImportedExcelFile(file, DeviceImportDto.class);
|
||||
if (R.SUCCESS != readResult.getCode()) {
|
||||
return readResult;
|
||||
}
|
||||
@@ -396,9 +397,8 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
if (R.SUCCESS != validateResult.getCode()) {
|
||||
return validateResult;
|
||||
}
|
||||
// 查询机构ID、当前时间、位置信息供后续使用
|
||||
// 查询机构ID、位置信息供后续使用
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
Date now = DateUtils.getNowDate();
|
||||
List<Location> locationList = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()).orderByAsc(Location::getId));
|
||||
Long defaultLocationId = locationList.stream().findFirst().orElse(new Location()).getId();
|
||||
@@ -406,7 +406,15 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
// 创建表数据
|
||||
for (DeviceImportDto importDto : importDtoList) {
|
||||
|
||||
// 创建器材定义
|
||||
DeviceDefinition deviceDefinition =
|
||||
createDeviceDefinitionEntity(importDto, orgId, defaultLocationId, locationNameMap);
|
||||
deviceDefinitionService.save(deviceDefinition);
|
||||
// 创建费用定价和详情
|
||||
chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(),
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.ADM_DEVICE_DEFINITION, deviceDefinition.getId());
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
@@ -422,26 +430,6 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
util.importTemplateExcel(response, "器材目录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取Excel文件
|
||||
*
|
||||
* @param file 文件
|
||||
* @return 读取结果
|
||||
*/
|
||||
private R<List<DeviceImportDto>> readExcelFile(MultipartFile file) {
|
||||
ExcelUtil<DeviceImportDto> util = new ExcelUtil<>(DeviceImportDto.class);
|
||||
List<DeviceImportDto> importDtoList;
|
||||
try {
|
||||
importDtoList = util.importExcel(file.getInputStream());
|
||||
} catch (IOException e) {
|
||||
return R.fail("导入失败!文件读取异常");
|
||||
}
|
||||
if (importDtoList.isEmpty()) {
|
||||
return R.fail("导入失败!文件不能为空");
|
||||
}
|
||||
return R.ok(importDtoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入信息校验
|
||||
*
|
||||
@@ -449,11 +437,147 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
*/
|
||||
private R<?> validateImportDtoList(List<DeviceImportDto> importDtoList) {
|
||||
// 字段校验(必填及数值类型)
|
||||
|
||||
List<String> fieldValidateMsgList = new ArrayList<>();
|
||||
for (int i = 0; i < importDtoList.size(); i++) {
|
||||
DeviceImportDto importDto = importDtoList.get(i);
|
||||
importDto.setLineNumber(i + 2);
|
||||
List<String> lineValidateMsgList = new ArrayList<>();
|
||||
if (StringUtils.isEmpty(importDto.getName())) {
|
||||
lineValidateMsgList.add("器材名称必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getCategoryCode())) {
|
||||
lineValidateMsgList.add("器材分类必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getUnitCode())) {
|
||||
lineValidateMsgList.add("包装单位必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getSize())) {
|
||||
lineValidateMsgList.add("包装规格必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getItemMinQuantityStr())) {
|
||||
lineValidateMsgList.add("最小库存警戒数量(常规单位)必填");
|
||||
}
|
||||
BigDecimal itemMinQuantity;
|
||||
try {
|
||||
itemMinQuantity = new BigDecimal(importDto.getItemMinQuantityStr());
|
||||
importDto.setItemMinQuantity(itemMinQuantity);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("最小库存警戒数量(常规单位)应为数值类型");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getItemMaxQuantityStr())) {
|
||||
lineValidateMsgList.add("最大库存警戒数量(常规单位)必填");
|
||||
}
|
||||
BigDecimal itemMaxQuantity;
|
||||
try {
|
||||
itemMaxQuantity = new BigDecimal(importDto.getItemMaxQuantityStr());
|
||||
importDto.setItemMaxQuantity(itemMaxQuantity);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("最大库存警戒数量(常规单位)应为数值类型");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getPartPercentStr())) {
|
||||
lineValidateMsgList.add("拆零比必填");
|
||||
}
|
||||
BigDecimal partPercent;
|
||||
try {
|
||||
partPercent = new BigDecimal(importDto.getPartPercentStr());
|
||||
importDto.setPartPercent(partPercent);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("拆零比应为数值类型");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getLocationName())) {
|
||||
lineValidateMsgList.add("所在位置名称必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getHvcmFlag())) {
|
||||
lineValidateMsgList.add("高值器材标志必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getYbFlag())) {
|
||||
lineValidateMsgList.add("医保标记必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getYbMatchFlag())) {
|
||||
lineValidateMsgList.add("医保对码标记必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getYbMatchFlag()) && StringUtils.isEmpty(importDto.getYbNo())) {
|
||||
lineValidateMsgList.add("医保对码时,医保编码必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getAllergenFlag())) {
|
||||
lineValidateMsgList.add("过敏标记必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getRxFlag())) {
|
||||
lineValidateMsgList.add("处方标志必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getTypeCode())) {
|
||||
lineValidateMsgList.add("财务类别必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getYbType())) {
|
||||
lineValidateMsgList.add("医保费用类别必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getPurchasePriceStr())) {
|
||||
lineValidateMsgList.add("购入价必填");
|
||||
}
|
||||
BigDecimal purchasePrice;
|
||||
try {
|
||||
purchasePrice = new BigDecimal(importDto.getPurchasePriceStr());
|
||||
importDto.setPurchasePrice(purchasePrice);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("购入价应为数值类型");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getRetailPriceStr())) {
|
||||
lineValidateMsgList.add("零售价必填");
|
||||
}
|
||||
BigDecimal retailPrice;
|
||||
try {
|
||||
retailPrice = new BigDecimal(importDto.getRetailPriceStr());
|
||||
importDto.setRetailPrice(retailPrice);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("零售价应为数值类型");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getMaximumRetailPriceStr())) {
|
||||
lineValidateMsgList.add("最高零售价必填");
|
||||
}
|
||||
BigDecimal maximumRetailPrice;
|
||||
try {
|
||||
maximumRetailPrice = new BigDecimal(importDto.getMaximumRetailPriceStr());
|
||||
importDto.setMaximumRetailPrice(maximumRetailPrice);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("最高零售价应为数值类型");
|
||||
}
|
||||
if (!lineValidateMsgList.isEmpty()) {
|
||||
fieldValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
}
|
||||
}
|
||||
if (!fieldValidateMsgList.isEmpty()) {
|
||||
return R.fail("导入失败!器材信息填写有误:" + String.join(" ", fieldValidateMsgList));
|
||||
}
|
||||
// 重复校验(文件行重复)
|
||||
|
||||
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
|
||||
List<List<DeviceImportDto>> importDtoGroupList = new ArrayList<>(importDtoList.stream()
|
||||
.collect(Collectors.groupingBy(e -> e.getName() + e.getManufacturerText() + e.getSize())).values());
|
||||
for (List<DeviceImportDto> importDtoGroup : importDtoGroupList) {
|
||||
if (importDtoGroup.size() > 1) {
|
||||
lineRepeatedValidateMsgList.add(
|
||||
"■ 第" + importDtoGroup.stream().map(DeviceImportDto::getLineNumber).sorted().map(Object::toString)
|
||||
.collect(Collectors.joining(",")) + "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
}
|
||||
}
|
||||
if (!lineRepeatedValidateMsgList.isEmpty()) {
|
||||
return R.fail("导入失败!文件中存在重复器材:" + String.join(" ", lineRepeatedValidateMsgList));
|
||||
}
|
||||
// 重复校验(文件与数据库重复)
|
||||
|
||||
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
|
||||
for (DeviceImportDto importDto : importDtoList) {
|
||||
List<DeviceDefinition> deviceDefinitionList = deviceDefinitionService
|
||||
.list(new LambdaQueryWrapper<DeviceDefinition>().eq(DeviceDefinition::getName, importDto.getName())
|
||||
.eq(DeviceDefinition::getManufacturerText, importDto.getManufacturerText())
|
||||
.eq(DeviceDefinition::getSize, importDto.getSize()));
|
||||
if (!deviceDefinitionList.isEmpty()) {
|
||||
dbRepeatedValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
}
|
||||
}
|
||||
if (!dbRepeatedValidateMsgList.isEmpty()) {
|
||||
return R.fail("导入失败!系统中存在重复器材:" + String.join(" ", dbRepeatedValidateMsgList));
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@@ -461,11 +585,37 @@ public class DeviceManageAppServiceImpl implements IDeviceManageAppService {
|
||||
* 创建器材定义实体
|
||||
*
|
||||
* @param importDto 器材目录导入Dto
|
||||
* @param orgId 机构ID
|
||||
* @param defaultLocationId 默认位置ID
|
||||
* @param locationNameMap 位置名称匹配分组Map
|
||||
* @return 器材定义实体
|
||||
*/
|
||||
private DeviceDefinition createDeviceDefinitionEntity(DeviceImportDto importDto) {
|
||||
|
||||
return null;
|
||||
private DeviceDefinition createDeviceDefinitionEntity(DeviceImportDto importDto, Long orgId, Long defaultLocationId,
|
||||
Map<String, List<Location>> locationNameMap) {
|
||||
DeviceDefinition deviceDefinition = new DeviceDefinition();
|
||||
// 根据输入的所在位置名称获取位置ID
|
||||
List<Location> mapLocationList = locationNameMap.get(importDto.getLocationName());
|
||||
if (mapLocationList == null || mapLocationList.isEmpty()) {
|
||||
deviceDefinition.setLocationId(defaultLocationId);
|
||||
} else {
|
||||
deviceDefinition.setLocationId(mapLocationList.get(0).getId());
|
||||
}
|
||||
deviceDefinition.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_NUM.getPrefix(), 10))
|
||||
.setName(importDto.getName()).setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setCategoryCode(importDto.getCategoryCode()).setTypeCode(importDto.getTypeCode())
|
||||
.setUnitCode(importDto.getUnitCode()).setSize(importDto.getSize())
|
||||
.setItemMinQuantity(importDto.getItemMinQuantity()).setItemMaxQuantity(importDto.getItemMaxQuantity())
|
||||
.setPartPercent(importDto.getPartPercent()).setMinUnitCode(importDto.getMinUnitCode()).setOrgId(orgId)
|
||||
.setHvcmFlag(CommonUtil.tryParseInt(importDto.getHvcmFlag())).setSalesUnitCode(importDto.getSalesUnitCode())
|
||||
.setApprovalNumber(importDto.getApprovalNumber()).setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag()))
|
||||
.setYbNo(importDto.getYbNo()).setYbOrgNo(importDto.getYbOrgNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue()).setManufacturerText(importDto.getManufacturerText())
|
||||
.setAllergenFlag(CommonUtil.tryParseInt(importDto.getAllergenFlag()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag()));
|
||||
return deviceDefinition;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.openhis.web.datadictionary.appservice.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
@@ -10,10 +11,11 @@ import java.util.stream.Stream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.openhis.yb.service.YbManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -23,13 +25,16 @@ import com.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.entity.SysDictData;
|
||||
import com.core.common.utils.*;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.core.common.utils.poi.ExcelUtil;
|
||||
import com.core.system.service.ISysDictTypeService;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.service.IChargeItemDefinitionService;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.CommonUtil;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.sys.service.IOperationRecordService;
|
||||
@@ -41,6 +46,7 @@ import com.openhis.web.datadictionary.mapper.ActivityDefinitionManageMapper;
|
||||
import com.openhis.workflow.domain.ActivityDefinition;
|
||||
import com.openhis.workflow.mapper.ActivityDefinitionMapper;
|
||||
import com.openhis.workflow.service.IActivityDefinitionService;
|
||||
import com.openhis.yb.service.YbManager;
|
||||
|
||||
/**
|
||||
* 诊疗实现类
|
||||
@@ -52,7 +58,9 @@ import com.openhis.workflow.service.IActivityDefinitionService;
|
||||
public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
|
||||
@Autowired
|
||||
private IActivityDefinitionService iActivityDefinitionService;
|
||||
private IActivityDefinitionService activityDefinitionService;
|
||||
@Autowired
|
||||
private IChargeItemDefinitionService chargeItemDefinitionService;
|
||||
@Autowired
|
||||
private ActivityDefinitionMapper activityDefinitionMapper;
|
||||
@Autowired
|
||||
@@ -110,15 +118,15 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
.collect(Collectors.toList());
|
||||
diagnosisTreatmentInitDto.setDiagnosisCategoryOptions(diagnosisCategories);
|
||||
|
||||
// // 查询医疗服务项类型
|
||||
// List<SysDictData> medical_service_items =
|
||||
// iSysDictTypeService.selectDictDataByType(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getCode());
|
||||
// // 获取医疗服务项List
|
||||
// List<DiagnosisTreatmentInitDto.diseaseTreatmentType> diseaseTreatmentCategoryList = medical_service_items
|
||||
// .stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(),
|
||||
// status.getDictLabel()))
|
||||
// .toList();
|
||||
// List<DiagnosisTreatmentInitDto.diseaseTreatmentCategory> diseaseTreatmentCategories = new ArrayList<>();
|
||||
// // 查询医疗服务项类型
|
||||
// List<SysDictData> medical_service_items =
|
||||
// iSysDictTypeService.selectDictDataByType(ActivityDefCategory.MEDICAL_SERVICE_ITEM.getCode());
|
||||
// // 获取医疗服务项List
|
||||
// List<DiagnosisTreatmentInitDto.diseaseTreatmentType> diseaseTreatmentCategoryList = medical_service_items
|
||||
// .stream().map(status -> new DiagnosisTreatmentInitDto.diseaseTreatmentType(status.getDictValue(),
|
||||
// status.getDictLabel()))
|
||||
// .toList();
|
||||
// List<DiagnosisTreatmentInitDto.diseaseTreatmentCategory> diseaseTreatmentCategories = new ArrayList<>();
|
||||
//
|
||||
// //获取目录分类
|
||||
// DiagnosisTreatmentInitDto.diseaseTreatmentCategory diseaseTreatmentCategory =
|
||||
@@ -233,10 +241,10 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
activityDefinition.setWbStr(ChineseConvertUtils.toWBFirstLetter(activityDefinition.getName()));
|
||||
|
||||
// 更新诊疗信息
|
||||
if (iActivityDefinitionService.updateById(activityDefinition)) {
|
||||
if (activityDefinitionService.updateById(activityDefinition)) {
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo()) ) {
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
@@ -294,7 +302,7 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
iOperationRecordService.addIdsOperationRecord(DbOpType.STOP.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
// 更新诊疗信息
|
||||
return iActivityDefinitionService.updateBatchById(ActivityDefinitionList)
|
||||
return activityDefinitionService.updateBatchById(ActivityDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
@@ -322,7 +330,7 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
iOperationRecordService.addIdsOperationRecord(DbOpType.START.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
// 更新诊疗信息
|
||||
return iActivityDefinitionService.updateBatchById(ActivityDefinitionList)
|
||||
return activityDefinitionService.updateBatchById(ActivityDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"诊疗目录"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
@@ -355,10 +363,10 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
|
||||
// 新增外来诊疗目录
|
||||
activityDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue());
|
||||
if (iActivityDefinitionService.addDiagnosisTreatment(activityDefinition)) {
|
||||
if (activityDefinitionService.addDiagnosisTreatment(activityDefinition)) {
|
||||
// 调用医保目录对照接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo()) ) {
|
||||
if (Whether.YES.getCode().equals(ybSwitch) && StringUtils.isNotEmpty(activityDefinition.getYbNo())) {
|
||||
R<?> r = ybService.directoryCheck(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
if (200 != r.getCode()) {
|
||||
@@ -387,4 +395,169 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入诊疗目录
|
||||
*
|
||||
* @param file 文件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> importData(MultipartFile file) {
|
||||
// 读取文件
|
||||
R<List<DiagnosisTreatmentImportDto>> readResult =
|
||||
CommonUtil.readImportedExcelFile(file, DiagnosisTreatmentImportDto.class);
|
||||
if (R.SUCCESS != readResult.getCode()) {
|
||||
return readResult;
|
||||
}
|
||||
List<DiagnosisTreatmentImportDto> importDtoList = readResult.getData();
|
||||
// 导入信息校验
|
||||
R<?> validateResult = validateImportDtoList(importDtoList);
|
||||
if (R.SUCCESS != validateResult.getCode()) {
|
||||
return validateResult;
|
||||
}
|
||||
// 查询机构ID供后续使用
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
// 创建表数据
|
||||
for (DiagnosisTreatmentImportDto importDto : importDtoList) {
|
||||
// 创建诊疗定义
|
||||
ActivityDefinition activityDefinition = createActivityDefinitionEntity(importDto, orgId);
|
||||
activityDefinitionService.save(activityDefinition);
|
||||
// 创建费用定价和详情
|
||||
chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(),
|
||||
importDto.getYbType(), importDto.getPermittedUnitCode(), null, importDto.getRetailPrice(),
|
||||
importDto.getMaximumRetailPrice(), orgId, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION,
|
||||
activityDefinition.getId());
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导入模板
|
||||
*
|
||||
* @param response 响应
|
||||
*/
|
||||
@Override
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<DiagnosisTreatmentImportDto> util = new ExcelUtil<>(DiagnosisTreatmentImportDto.class);
|
||||
util.importTemplateExcel(response, "诊疗目录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入信息校验
|
||||
*
|
||||
* @param importDtoList 器材目录导入数据列表
|
||||
*/
|
||||
private R<?> validateImportDtoList(List<DiagnosisTreatmentImportDto> importDtoList) {
|
||||
// 字段校验(必填及数值类型)
|
||||
List<String> fieldValidateMsgList = new ArrayList<>();
|
||||
for (int i = 0; i < importDtoList.size(); i++) {
|
||||
DiagnosisTreatmentImportDto importDto = importDtoList.get(i);
|
||||
importDto.setLineNumber(i + 2);
|
||||
List<String> lineValidateMsgList = new ArrayList<>();
|
||||
if (StringUtils.isEmpty(importDto.getName())) {
|
||||
lineValidateMsgList.add("诊疗名称必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getCategoryCode())) {
|
||||
lineValidateMsgList.add("目录类别必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getPermittedUnitCode())) {
|
||||
lineValidateMsgList.add("使用单位必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getYbFlag())) {
|
||||
lineValidateMsgList.add("医保标记必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getYbMatchFlag())) {
|
||||
lineValidateMsgList.add("医保对码标记必填");
|
||||
}
|
||||
if (Whether.YES.getCode().equals(importDto.getYbMatchFlag()) && StringUtils.isEmpty(importDto.getYbNo())) {
|
||||
lineValidateMsgList.add("医保对码时,医保编码必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getChrgitmLv())) {
|
||||
lineValidateMsgList.add("医保等级必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getTypeCode())) {
|
||||
lineValidateMsgList.add("财务类别必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getYbType())) {
|
||||
lineValidateMsgList.add("医保费用类别必填");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getRetailPriceStr())) {
|
||||
lineValidateMsgList.add("零售价必填");
|
||||
}
|
||||
BigDecimal retailPrice;
|
||||
try {
|
||||
retailPrice = new BigDecimal(importDto.getRetailPriceStr());
|
||||
importDto.setRetailPrice(retailPrice);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("零售价应为数值类型");
|
||||
}
|
||||
if (StringUtils.isEmpty(importDto.getMaximumRetailPriceStr())) {
|
||||
lineValidateMsgList.add("最高零售价必填");
|
||||
}
|
||||
BigDecimal maximumRetailPrice;
|
||||
try {
|
||||
maximumRetailPrice = new BigDecimal(importDto.getMaximumRetailPriceStr());
|
||||
importDto.setMaximumRetailPrice(maximumRetailPrice);
|
||||
} catch (Exception e) {
|
||||
lineValidateMsgList.add("最高零售价应为数值类型");
|
||||
}
|
||||
if (!lineValidateMsgList.isEmpty()) {
|
||||
fieldValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行:" + String.join(",", lineValidateMsgList) + ";");
|
||||
}
|
||||
}
|
||||
if (!fieldValidateMsgList.isEmpty()) {
|
||||
return R.fail("导入失败!诊疗信息填写有误:" + String.join(" ", fieldValidateMsgList));
|
||||
}
|
||||
// 重复校验(文件行重复)
|
||||
List<String> lineRepeatedValidateMsgList = new ArrayList<>();
|
||||
List<List<DiagnosisTreatmentImportDto>> importDtoGroupList = new ArrayList<>(
|
||||
importDtoList.stream().collect(Collectors.groupingBy(DiagnosisTreatmentImportDto::getName)).values());
|
||||
for (List<DiagnosisTreatmentImportDto> importDtoGroup : importDtoGroupList) {
|
||||
if (importDtoGroup.size() > 1) {
|
||||
lineRepeatedValidateMsgList.add("■ 第"
|
||||
+ importDtoGroup.stream().map(DiagnosisTreatmentImportDto::getLineNumber).sorted()
|
||||
.map(Object::toString).collect(Collectors.joining(","))
|
||||
+ "行的【" + importDtoGroup.get(0).getName() + "】重复;");
|
||||
}
|
||||
}
|
||||
if (!lineRepeatedValidateMsgList.isEmpty()) {
|
||||
return R.fail("导入失败!文件中存在重复诊疗:" + String.join(" ", lineRepeatedValidateMsgList));
|
||||
}
|
||||
// 重复校验(文件与数据库重复)
|
||||
List<String> dbRepeatedValidateMsgList = new ArrayList<>();
|
||||
for (DiagnosisTreatmentImportDto importDto : importDtoList) {
|
||||
List<ActivityDefinition> deviceDefinitionList = activityDefinitionService.list(
|
||||
new LambdaQueryWrapper<ActivityDefinition>().eq(ActivityDefinition::getName, importDto.getName()));
|
||||
if (!deviceDefinitionList.isEmpty()) {
|
||||
dbRepeatedValidateMsgList
|
||||
.add("■ 第" + importDto.getLineNumber() + "行的【" + importDto.getName() + "】在系统中已存在;");
|
||||
}
|
||||
}
|
||||
if (!dbRepeatedValidateMsgList.isEmpty()) {
|
||||
return R.fail("导入失败!系统中存在重复诊疗:" + String.join(" ", dbRepeatedValidateMsgList));
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建诊疗定义实体
|
||||
*
|
||||
* @param importDto 器材目录导入Dto
|
||||
* @param orgId 机构ID
|
||||
* @return 诊疗定义实体
|
||||
*/
|
||||
private ActivityDefinition createActivityDefinitionEntity(DiagnosisTreatmentImportDto importDto, Long orgId) {
|
||||
ActivityDefinition activityDefinition = new ActivityDefinition();
|
||||
activityDefinition.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.ACTIVITY_DEFINITION_NUM.getPrefix(), 10))
|
||||
.setName(importDto.getName()).setCategoryCode(importDto.getCategoryCode())
|
||||
.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getName()))
|
||||
.setWbStr(ChineseConvertUtils.toWBFirstLetter(importDto.getName()))
|
||||
.setPermittedUnitCode(importDto.getPermittedUnitCode()).setOrgId(orgId)
|
||||
.setYbFlag(CommonUtil.tryParseInt(importDto.getYbFlag())).setYbNo(importDto.getYbNo())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()));
|
||||
return activityDefinition;
|
||||
}
|
||||
}
|
||||
|
@@ -3,7 +3,6 @@
|
||||
*/
|
||||
package com.openhis.web.datadictionary.appservice.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -30,17 +29,16 @@ import com.core.common.utils.*;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.core.common.utils.poi.ExcelUtil;
|
||||
import com.core.system.service.ISysDictTypeService;
|
||||
import com.openhis.administration.domain.ChargeItemDefDetail;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
import com.openhis.administration.service.IChargeItemDefDetailService;
|
||||
import com.openhis.administration.service.IChargeItemDefinitionService;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.ISupplierService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.CommonUtil;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
@@ -73,10 +71,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
private IMedicationDefinitionService medicationDefinitionService;
|
||||
|
||||
@Autowired
|
||||
IChargeItemDefinitionService chargeItemDefinitionService;
|
||||
|
||||
@Autowired
|
||||
IChargeItemDefDetailService chargeItemDefDetailService;
|
||||
private IChargeItemDefinitionService chargeItemDefinitionService;
|
||||
|
||||
@Autowired
|
||||
private ILocationService locationService;
|
||||
@@ -474,7 +469,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
@Override
|
||||
public R<?> importData(MultipartFile file) {
|
||||
// 读取文件
|
||||
R<List<MedicationImportDto>> readResult = readExcelFile(file);
|
||||
R<List<MedicationImportDto>> readResult = CommonUtil.readImportedExcelFile(file, MedicationImportDto.class);
|
||||
if (R.SUCCESS != readResult.getCode()) {
|
||||
return readResult;
|
||||
}
|
||||
@@ -484,9 +479,8 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
if (R.SUCCESS != validateResult.getCode()) {
|
||||
return validateResult;
|
||||
}
|
||||
// 查询机构ID、当前时间、位置信息供后续使用
|
||||
// 查询机构ID、位置信息供后续使用
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
Date now = DateUtils.getNowDate();
|
||||
List<Location> locationList = locationService.list(new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getDeleteFlag, DeleteFlag.NOT_DELETED.getCode()).orderByAsc(Location::getId));
|
||||
Long defaultLocationId = locationList.stream().findFirst().orElse(new Location()).getId();
|
||||
@@ -494,21 +488,18 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
locationList.stream().collect(Collectors.groupingBy(Location::getName));
|
||||
// 创建表数据
|
||||
for (MedicationImportDto importDto : importDtoList) {
|
||||
// 药品定义表
|
||||
// 创建药品定义
|
||||
MedicationDefinition medicationDefinition = createMedicationDefinitionEntity(importDto);
|
||||
medicationDefinitionService.save(medicationDefinition);
|
||||
// 药品表
|
||||
// 创建药品
|
||||
Medication medication =
|
||||
createMedicationEntity(importDto, medicationDefinition.getId(), defaultLocationId, locationNameMap);
|
||||
medicationService.save(medication);
|
||||
// 费用定价表
|
||||
ChargeItemDefinition chargeItemDefinition =
|
||||
createChargeItemDefinition(importDto, orgId, medicationDefinition.getId(), now);
|
||||
chargeItemDefinitionService.save(chargeItemDefinition);
|
||||
// 费用定价子表
|
||||
List<ChargeItemDefDetail> chargeItemDefDetailList =
|
||||
createChargeItemDefDetailList(importDto, chargeItemDefinition.getId());
|
||||
chargeItemDefDetailService.saveBatch(chargeItemDefDetailList);
|
||||
// 创建费用定价和详情
|
||||
chargeItemDefinitionService.addChargeItemDefinitionAndDetail(importDto.getName(), importDto.getTypeCode(),
|
||||
importDto.getYbType(), importDto.getUnitCode(), importDto.getPurchasePrice(),
|
||||
importDto.getRetailPrice(), importDto.getMaximumRetailPrice(), orgId,
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, medicationDefinition.getId());
|
||||
}
|
||||
return R.ok(null, "导入成功!");
|
||||
}
|
||||
@@ -524,26 +515,6 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
util.importTemplateExcel(response, "药品目录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取Excel文件
|
||||
*
|
||||
* @param file 文件
|
||||
* @return 读取结果
|
||||
*/
|
||||
private R<List<MedicationImportDto>> readExcelFile(MultipartFile file) {
|
||||
ExcelUtil<MedicationImportDto> util = new ExcelUtil<>(MedicationImportDto.class);
|
||||
List<MedicationImportDto> importDtoList;
|
||||
try {
|
||||
importDtoList = util.importExcel(file.getInputStream());
|
||||
} catch (IOException e) {
|
||||
return R.fail("导入失败!文件读取异常");
|
||||
}
|
||||
if (importDtoList.isEmpty()) {
|
||||
return R.fail("导入失败!文件不能为空");
|
||||
}
|
||||
return R.ok(importDtoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入信息校验
|
||||
*
|
||||
@@ -797,23 +768,26 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
.setMerchandisePyStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName()))
|
||||
.setMerchandiseWbStr(ChineseConvertUtils.toPinyinFirstLetter(importDto.getMerchandiseName()))
|
||||
.setUnitCode(importDto.getUnitCode()).setMinUnitCode(importDto.getMinUnitCode())
|
||||
.setPartPercent(importDto.getPartPercent()).setDoseFrom(tryParseInt(importDto.getDoseFrom()))
|
||||
.setApprovalNumber(importDto.getApprovalNumber()).setYbMatchFlag(tryParseInt(importDto.getYbMatchFlag()))
|
||||
.setYbNo(importDto.getYbNo()).setPharmacologyCategoryCode("1")
|
||||
.setSkinTestFlag(tryParseInt(importDto.getSkinTestFlag()))
|
||||
.setInjectFlag(tryParseInt(importDto.getInjectFlag())).setManufacturerText(importDto.getManufacturerText())
|
||||
.setRestrictedFlag(tryParseInt(importDto.getRestrictedFlag()))
|
||||
.setPartPercent(importDto.getPartPercent()).setDoseFrom(CommonUtil.tryParseInt(importDto.getDoseFrom()))
|
||||
.setApprovalNumber(importDto.getApprovalNumber())
|
||||
.setYbMatchFlag(CommonUtil.tryParseInt(importDto.getYbMatchFlag())).setYbNo(importDto.getYbNo())
|
||||
.setPharmacologyCategoryCode("1").setSkinTestFlag(CommonUtil.tryParseInt(importDto.getSkinTestFlag()))
|
||||
.setInjectFlag(CommonUtil.tryParseInt(importDto.getInjectFlag()))
|
||||
.setManufacturerText(importDto.getManufacturerText())
|
||||
.setRestrictedFlag(CommonUtil.tryParseInt(importDto.getRestrictedFlag()))
|
||||
.setRestrictedScope(importDto.getRestrictedScope()).setActiveFlag(Whether.YES.getValue())
|
||||
.setChildrenFlag(tryParseInt(importDto.getChildrenFlag()))
|
||||
.setChildrenFlag(CommonUtil.tryParseInt(importDto.getChildrenFlag()))
|
||||
.setNationalDrugCode(importDto.getNationalDrugCode())
|
||||
.setPartAttributeEnum(tryParseInt(importDto.getPartAttributeEnum()))
|
||||
.setAntibioticCode(importDto.getAntibioticCode()).setSelfFlag(tryParseInt(importDto.getSelfFlag()))
|
||||
.setAntibioticFlag(tryParseInt(importDto.getAntibioticFlag()))
|
||||
.setBasicFlag(tryParseInt(importDto.getBasicFlag()))
|
||||
.setThoPartAttributeEnum(tryParseInt(importDto.getThoPartAttributeEnum()))
|
||||
.setPartAttributeEnum(CommonUtil.tryParseInt(importDto.getPartAttributeEnum()))
|
||||
.setAntibioticCode(importDto.getAntibioticCode())
|
||||
.setSelfFlag(CommonUtil.tryParseInt(importDto.getSelfFlag()))
|
||||
.setAntibioticFlag(CommonUtil.tryParseInt(importDto.getAntibioticFlag()))
|
||||
.setBasicFlag(CommonUtil.tryParseInt(importDto.getBasicFlag()))
|
||||
.setThoPartAttributeEnum(CommonUtil.tryParseInt(importDto.getThoPartAttributeEnum()))
|
||||
.setUnitConversionRatio(importDto.getUnitConversionRatio())
|
||||
.setChrgitmLv(tryParseInt(importDto.getChrgitmLv())).setRxFlag(tryParseInt(importDto.getRxFlag()))
|
||||
.setItemMinQuantity(importDto.getItemMinQuantity()).setItemMaxQuantity(importDto.getItemMaxQuantity());
|
||||
.setChrgitmLv(CommonUtil.tryParseInt(importDto.getChrgitmLv()))
|
||||
.setRxFlag(CommonUtil.tryParseInt(importDto.getRxFlag())).setItemMinQuantity(importDto.getItemMinQuantity())
|
||||
.setItemMaxQuantity(importDto.getItemMaxQuantity());
|
||||
return medicationDefinition;
|
||||
}
|
||||
|
||||
@@ -844,53 +818,4 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
return medication;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建费用定价实体
|
||||
*
|
||||
* @param importDto 药品目录导入Dto
|
||||
* @return 药品基本实体
|
||||
*/
|
||||
private ChargeItemDefinition createChargeItemDefinition(MedicationImportDto importDto, Long orgId,
|
||||
Long medicationDefId, Date effectiveStart) {
|
||||
ChargeItemDefinition chargeItemDefinition = new ChargeItemDefinition();
|
||||
chargeItemDefinition.setChargeName(importDto.getName()).setStatusEnum(PublicationStatus.ACTIVE.getValue())
|
||||
.setOrgId(orgId).setInstanceTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION)
|
||||
.setInstanceId(medicationDefId).setEffectiveStart(effectiveStart).setTypeCode(importDto.getTypeCode())
|
||||
.setYbType(importDto.getYbType()).setConditionFlag(Whether.YES.getValue())
|
||||
.setPrice(importDto.getRetailPrice());
|
||||
return chargeItemDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建费用定价子实体列表
|
||||
*
|
||||
* @param importDto 药品目录导入Dto
|
||||
* @param chargeItemDefId 费用定价ID
|
||||
* @return 费用定价子实体列表
|
||||
*/
|
||||
private List<ChargeItemDefDetail> createChargeItemDefDetailList(MedicationImportDto importDto,
|
||||
Long chargeItemDefId) {
|
||||
ChargeItemDefDetail defDetailPurchase = new ChargeItemDefDetail().setDefinitionId(chargeItemDefId)
|
||||
.setConditionCode(ConditionCode.PURCHASE.getCode()).setAmount(importDto.getPurchasePrice());
|
||||
ChargeItemDefDetail defDetailRetail =
|
||||
new ChargeItemDefDetail().setDefinitionId(chargeItemDefId).setConditionCode(ConditionCode.UNIT.getCode())
|
||||
.setConditionValue(importDto.getUnitCode()).setAmount(importDto.getRetailPrice());
|
||||
ChargeItemDefDetail defDetailMaximumRetail = new ChargeItemDefDetail().setDefinitionId(chargeItemDefId)
|
||||
.setConditionCode(ConditionCode.LIMIT.getCode()).setAmount(importDto.getMaximumRetailPrice());
|
||||
return Arrays.asList(defDetailPurchase, defDetailRetail, defDetailMaximumRetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 尝试转化为int
|
||||
*
|
||||
* @param intStr int字符串
|
||||
* @return int值
|
||||
*/
|
||||
private Integer tryParseInt(String intStr) {
|
||||
try {
|
||||
return Integer.parseInt(intStr);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,10 +3,12 @@ package com.openhis.web.datadictionary.controller;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.datadictionary.appservice.IDiagTreatMAppService;
|
||||
@@ -56,8 +58,8 @@ public class DiagnosisTreatmentController {
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return diagTreatMAppService.getDiseaseTreatmentPage(DiagnosisTreatmentSelParam, searchKey, pageNo,
|
||||
pageSize, request);
|
||||
return diagTreatMAppService.getDiseaseTreatmentPage(DiagnosisTreatmentSelParam, searchKey, pageNo, pageSize,
|
||||
request);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,4 +138,25 @@ public class DiagnosisTreatmentController {
|
||||
public R<?> exportDiseaseTreatment(@RequestBody DiagnosisTreatmentDto diagnosisTreatmentDto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入诊疗目录
|
||||
*
|
||||
* @param file 文件
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/import-data")
|
||||
public R<?> importData(MultipartFile file) {
|
||||
return diagTreatMAppService.importData(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导入模板
|
||||
*
|
||||
* @param response 响应
|
||||
*/
|
||||
@PostMapping("/import-template")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
diagTreatMAppService.importTemplate(response);
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* TODO:病种目录
|
||||
* 病种目录
|
||||
*
|
||||
* @author lpt
|
||||
* @date 2025-02-20
|
||||
|
@@ -57,10 +57,6 @@ public class DeviceImportDto {
|
||||
@Excel(name = "最小使用单位", prompt = "必填", dictType = "unit_code", comboReadDict = true)
|
||||
private String minUnitCode;
|
||||
|
||||
/** 所属科室名称(orgId) */
|
||||
@Excel(name = "所属科室名称", prompt = "必填")
|
||||
private String orgName;
|
||||
|
||||
/** 所在位置名称(locationId) */
|
||||
@Excel(name = "所在位置名称", prompt = "必填")
|
||||
private String locationName;
|
||||
@@ -70,7 +66,7 @@ public class DeviceImportDto {
|
||||
private String hvcmFlag;
|
||||
|
||||
/** 销售单位 */
|
||||
@Excel(name = "最小使用单位", prompt = "必填", dictType = "unit_code", comboReadDict = true)
|
||||
@Excel(name = "销售单位", prompt = "必填", dictType = "unit_code", comboReadDict = true)
|
||||
private String salesUnitCode;
|
||||
|
||||
/** 批准文号 */
|
||||
@@ -78,49 +74,61 @@ public class DeviceImportDto {
|
||||
private String approvalNumber;
|
||||
|
||||
/** 医保标记 */
|
||||
@Excel(name = "医保标记", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String ybFlag;
|
||||
|
||||
/** 医保对码标记 */
|
||||
@Excel(name = "医保对码标记", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String ybMatchFlag;
|
||||
|
||||
/** 医保编码 */
|
||||
@Excel(name = "医保编码", prompt = "医保对码时必填")
|
||||
private String ybNo;
|
||||
|
||||
/** 医药机构目录编码 */
|
||||
@Excel(name = "医药机构目录编码")
|
||||
private String ybOrgNo;
|
||||
|
||||
/** 医保对码标记 */
|
||||
private Integer ybMatchFlag;
|
||||
|
||||
/** 医保等级 */
|
||||
private Integer chrgitmLv;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 生产厂家 */
|
||||
private Long manufacturerId;
|
||||
@Excel(name = "医保等级", prompt = "必填", dictType = "chrgitm_lv", comboReadDict = true)
|
||||
private String chrgitmLv;
|
||||
|
||||
/** 生产厂家 */
|
||||
@Excel(name = "生产厂家文本", prompt = "必填")
|
||||
private String manufacturerText;
|
||||
|
||||
/** 供应商 */
|
||||
private Long supplyId;
|
||||
|
||||
/** 说明 */
|
||||
private String description;
|
||||
|
||||
/** 适用范围 */
|
||||
private String jurisdiction;
|
||||
|
||||
/** 器材版本 */
|
||||
private String version;
|
||||
|
||||
/** 主要成分 */
|
||||
private String substanceText;
|
||||
|
||||
/** 过敏标记 */
|
||||
private Integer allergenFlag;
|
||||
@Excel(name = "过敏标记", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String allergenFlag;
|
||||
|
||||
/** 处方标志 */
|
||||
private Integer rxFlag;
|
||||
@Excel(name = "处方标志", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String rxFlag;
|
||||
|
||||
// ---------------------- 费用定价 adm_charge_item_definition ----------------------------------------------
|
||||
|
||||
/** 财务类别 */
|
||||
@Excel(name = "财务类别", prompt = "必填", dictType = "fin_type_code", comboReadDict = true)
|
||||
private String typeCode;
|
||||
|
||||
/** 医保费用类别 */
|
||||
@Excel(name = "医保费用类别", prompt = "必填", dictType = "med_chrgitm_type", comboReadDict = true)
|
||||
private String ybType;
|
||||
|
||||
// ---------------------- 费用定价子表 adm_charge_item_def_detail ----------------------------------------------
|
||||
|
||||
/** 购入价 */
|
||||
@Excel(name = "购入价", prompt = "必填,数值类型")
|
||||
private String purchasePriceStr;
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
/** 零售价 */
|
||||
@Excel(name = "零售价", prompt = "必填,数值类型")
|
||||
private String retailPriceStr;
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/** 最高零售价 */
|
||||
@Excel(name = "最高零售价", prompt = "必填,数值类型")
|
||||
private String maximumRetailPriceStr;
|
||||
private BigDecimal maximumRetailPrice;
|
||||
}
|
||||
|
@@ -0,0 +1,75 @@
|
||||
package com.openhis.web.datadictionary.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.core.common.annotation.Excel;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 诊疗目录导入Dto
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-09-29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DiagnosisTreatmentImportDto {
|
||||
|
||||
/** 行号 */
|
||||
private Integer lineNumber;
|
||||
|
||||
// ---------------------- 诊疗定义 wor_activity_definition -------------------------------------
|
||||
|
||||
/** 诊疗名称 */
|
||||
@Excel(name = "诊疗名称", prompt = "必填")
|
||||
private String name;
|
||||
|
||||
/** 目录类别 */
|
||||
@Excel(name = "目录类别", prompt = "必填", dictType = "activity_category_code", comboReadDict = true)
|
||||
private String categoryCode;
|
||||
|
||||
/** 使用单位 */
|
||||
@Excel(name = "使用单位", prompt = "必填", dictType = "unit_code", comboReadDict = true)
|
||||
private String permittedUnitCode;
|
||||
|
||||
/** 医保标记 */
|
||||
@Excel(name = "医保标记", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String ybFlag;
|
||||
|
||||
/** 医保对码标记 */
|
||||
@Excel(name = "医保对码标记", prompt = "必填", readConverterExp = "0=否,1=是", combo = "否,是")
|
||||
private String ybMatchFlag;
|
||||
|
||||
/** 医保编码 */
|
||||
@Excel(name = "医保编码", prompt = "医保对码时必填")
|
||||
private String ybNo;
|
||||
|
||||
/** 医保等级 */
|
||||
@Excel(name = "医保等级", prompt = "必填", dictType = "chrgitm_lv", comboReadDict = true)
|
||||
private String chrgitmLv;
|
||||
|
||||
// ---------------------- 费用定价 adm_charge_item_definition ----------------------------------------------
|
||||
|
||||
/** 财务类别 */
|
||||
@Excel(name = "财务类别", prompt = "必填", dictType = "fin_type_code", comboReadDict = true)
|
||||
private String typeCode;
|
||||
|
||||
/** 医保费用类别 */
|
||||
@Excel(name = "医保费用类别", prompt = "必填", dictType = "med_chrgitm_type", comboReadDict = true)
|
||||
private String ybType;
|
||||
|
||||
// ---------------------- 费用定价子表 adm_charge_item_def_detail ----------------------------------------------
|
||||
|
||||
/** 零售价 */
|
||||
@Excel(name = "零售价", prompt = "必填,数值类型")
|
||||
private String retailPriceStr;
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/** 最高零售价 */
|
||||
@Excel(name = "最高零售价", prompt = "必填,数值类型")
|
||||
private String maximumRetailPriceStr;
|
||||
private BigDecimal maximumRetailPrice;
|
||||
|
||||
}
|
@@ -1,5 +1,7 @@
|
||||
package com.openhis.web.doctorstation.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.doctorstation.dto.ConditionDefinitionMetadata;
|
||||
@@ -91,4 +93,12 @@ public interface IDoctorStationDiagnosisAppService {
|
||||
*/
|
||||
R<?> delEncounterDiagnosis(Long conditionId);
|
||||
|
||||
/**
|
||||
* 查询诊断信息
|
||||
*
|
||||
* @param searchKey 目标字符
|
||||
* @param request 请求
|
||||
* @return 查询结果
|
||||
*/
|
||||
R<?> getDiagnosisList(String searchKey, HttpServletRequest request);
|
||||
}
|
||||
|
@@ -253,7 +253,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
if (deviceId != null) {
|
||||
AdviceBaseDto matchedAdvice = adviceMap.get(deviceId);
|
||||
if (matchedAdvice != null) {
|
||||
activityBindDeviceInfo.setDeviceDetailInfos(matchedAdvice);
|
||||
activityBindDeviceInfo.setOrderDetailInfos(matchedAdvice);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -23,6 +24,7 @@ import com.openhis.clinical.domain.Condition;
|
||||
import com.openhis.clinical.domain.ConditionDefinition;
|
||||
import com.openhis.clinical.domain.DiagnosisBelongBinding;
|
||||
import com.openhis.clinical.mapper.ConditionDefinitionMapper;
|
||||
import com.openhis.clinical.service.IConditionDefinitionService;
|
||||
import com.openhis.clinical.service.IConditionService;
|
||||
import com.openhis.clinical.service.IDiagnosisBelongBindingService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
@@ -56,6 +58,9 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
||||
@Resource
|
||||
IEncounterDiagnosisService iEncounterDiagnosisService;
|
||||
|
||||
@Resource
|
||||
IConditionDefinitionService conditionDefinitionService;
|
||||
|
||||
/**
|
||||
* 新增诊断归属绑定
|
||||
*
|
||||
@@ -167,7 +172,7 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
||||
conditionDefinition.setStatusEnum(PublicationStatus.ACTIVE.getValue());
|
||||
QueryWrapper<ConditionDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(conditionDefinition, searchKey,
|
||||
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
|
||||
queryWrapper.eq("status_enum",PublicationStatus.ACTIVE.getValue());
|
||||
queryWrapper.eq("status_enum", PublicationStatus.ACTIVE.getValue());
|
||||
// 设置排序
|
||||
queryWrapper.orderByDesc("update_time");
|
||||
// 拼接 用于区分 西医诊断 [1] 中医诊断 [2] 的查询条件
|
||||
@@ -338,4 +343,19 @@ public class DoctorStationDiagnosisAppServiceImpl implements IDoctorStationDiagn
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询诊断信息
|
||||
*
|
||||
* @param searchKey 目标字符
|
||||
* @param request 请求
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDiagnosisList(String searchKey, HttpServletRequest request) {
|
||||
|
||||
List<ConditionDefinition> conditionDefinitionListBySearchKey =
|
||||
conditionDefinitionService.getConditionDefinitionListBySearchKey(searchKey, request);
|
||||
|
||||
return R.ok(conditionDefinitionListBySearchKey);
|
||||
}
|
||||
}
|
||||
|
@@ -6,52 +6,46 @@ import java.util.stream.Stream;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
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.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.administration.domain.Practitioner;
|
||||
import com.openhis.administration.service.IPractitionerService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.YbCommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AssignSeqEnum;
|
||||
import com.openhis.common.enums.PrescriptionType;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
import com.openhis.common.enums.ybenums.YbRxItemTypeCode;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.financial.domain.Contract;
|
||||
import com.openhis.web.doctorstation.appservice.IDoctorStationElepPrescriptionService;
|
||||
import com.openhis.web.doctorstation.dto.*;
|
||||
import com.openhis.web.doctorstation.mapper.DoctorStationElepPrescriptionMapper;
|
||||
import com.openhis.web.inventorymanage.dto.ProductStocktakingInitDto;
|
||||
import com.openhis.web.reportmanage.dto.ChargeReportSearchParam;
|
||||
import com.openhis.workflow.domain.ElepMedicationRequest;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.mapper.InventoryItemMapper;
|
||||
import com.openhis.workflow.service.IElepMedicationRequestService;
|
||||
import com.openhis.ybcatalog.domain.CatalogDrugInfo;
|
||||
import com.openhis.ybcatalog.domain.CatalogDrugInfoUsual;
|
||||
import com.openhis.ybcatalog.mapper.CatalogDrugInfoUsualMapper;
|
||||
import com.openhis.ybcatalog.service.ICatalogDrugInfoService;
|
||||
import com.openhis.ybcatalog.service.ICatalogDrugInfoUsualService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.web.doctorstation.dto.*;
|
||||
|
||||
/**
|
||||
* 医生站-电子处方 应用实现类
|
||||
*/
|
||||
@Service
|
||||
public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<CatalogDrugInfoUsualMapper, CatalogDrugInfoUsual>
|
||||
implements IDoctorStationElepPrescriptionService {
|
||||
public class DoctorStationElepPrescriptionServiceImpl extends
|
||||
ServiceImpl<CatalogDrugInfoUsualMapper, CatalogDrugInfoUsual> implements IDoctorStationElepPrescriptionService {
|
||||
@Autowired
|
||||
ICatalogDrugInfoUsualService catalogDrugInfoUsualService;
|
||||
@Autowired
|
||||
@@ -75,15 +69,17 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
|
||||
// 处方类别
|
||||
List<ElepPrescriptionInitDto.commonStatusOption> rxTypeCodeListOptions = Stream.of(YbRxItemTypeCode.values())
|
||||
.map(prescriptionType -> new ElepPrescriptionInitDto.commonStatusOption(prescriptionType.getValue(),
|
||||
prescriptionType.getDescription()))
|
||||
.collect(Collectors.toList());
|
||||
// //获取诊断信息
|
||||
// List<ElepPrescriptionInitConditionDto> conditionInfoList = elepPrescriptionMapper.selectConditionInfo(encounterId);
|
||||
// // 诊断列表
|
||||
// List<ElepPrescriptionInitDto.conditionStatusOption> conditionListOptions = conditionInfoList.stream()
|
||||
// .map(conditionInfo -> new ElepPrescriptionInitDto.conditionStatusOption(conditionInfo.getConditionId(), conditionInfo.getConditionName()))
|
||||
// .collect(Collectors.toList());
|
||||
.map(prescriptionType -> new ElepPrescriptionInitDto.commonStatusOption(prescriptionType.getValue(),
|
||||
prescriptionType.getDescription()))
|
||||
.collect(Collectors.toList());
|
||||
// //获取诊断信息
|
||||
// List<ElepPrescriptionInitConditionDto> conditionInfoList =
|
||||
// elepPrescriptionMapper.selectConditionInfo(encounterId);
|
||||
// // 诊断列表
|
||||
// List<ElepPrescriptionInitDto.conditionStatusOption> conditionListOptions = conditionInfoList.stream()
|
||||
// .map(conditionInfo -> new ElepPrescriptionInitDto.conditionStatusOption(conditionInfo.getConditionId(),
|
||||
// conditionInfo.getConditionName()))
|
||||
// .collect(Collectors.toList());
|
||||
|
||||
initDto.setRxTypeCodeListOptions(rxTypeCodeListOptions);
|
||||
return R.ok(initDto);
|
||||
@@ -92,35 +88,37 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
/**
|
||||
* 获取药品信息
|
||||
*
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @return 药品信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getAllMedicationUsualInfo(String searchKey, Integer pageNo, Integer pageSize) {
|
||||
//从yb_catalog_drug_info_usual表中取数据
|
||||
IPage<CatalogDrugInfoUsual> medicationUsualInfo = catalogDrugInfoUsualService.selectCatalogDrugInfoUsual(pageNo, pageSize, searchKey);
|
||||
// 从yb_catalog_drug_info_usual表中取数据
|
||||
IPage<CatalogDrugInfoUsual> medicationUsualInfo =
|
||||
catalogDrugInfoUsualService.selectCatalogDrugInfoUsual(pageNo, pageSize, searchKey);
|
||||
return R.ok(medicationUsualInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取药品信息
|
||||
*
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @return 药品信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getAllMedicationInfo(String searchKey, Integer pageNo, Integer pageSize) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<String> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||
new HashSet<>(Arrays.asList("registered_name", "pinyin_code", "wubi_code", "approval_no","manufacturer_name")),
|
||||
null);
|
||||
//从yb_catalog_drug_info表中取数据
|
||||
IPage<CatalogDrugInfo> medicationInfo = elepPrescriptionMapper.selectCatalogDrugInfo(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
QueryWrapper<String> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||
new HashSet<>(
|
||||
Arrays.asList("registered_name", "pinyin_code", "wubi_code", "approval_no", "manufacturer_name")),
|
||||
null);
|
||||
// 从yb_catalog_drug_info表中取数据
|
||||
IPage<CatalogDrugInfo> medicationInfo =
|
||||
elepPrescriptionMapper.selectCatalogDrugInfo(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
return R.ok(medicationInfo);
|
||||
}
|
||||
|
||||
@@ -128,15 +126,15 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
* 获取处方信息
|
||||
*
|
||||
* @param patientId 患者id
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 药品信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPrescriptionInfo(Long patientId, Integer pageNo, Integer pageSize) {
|
||||
// 处方信息查询
|
||||
IPage<ElepPrescriptionInfoDto> prescriptionInfo =
|
||||
elepPrescriptionMapper.selectElepPrescriptionInfo(new Page<>(pageNo, pageSize), patientId);
|
||||
elepPrescriptionMapper.selectElepPrescriptionInfo(new Page<>(pageNo, pageSize), patientId);
|
||||
// 状态转换
|
||||
prescriptionInfo.getRecords().forEach(infoDto -> {
|
||||
infoDto.setStatusEnum_enumText(EnumUtils.getInfoByValue(RequestStatus.class, infoDto.getStatusEnum()));
|
||||
@@ -149,15 +147,15 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
* 获取药品信息
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页多少条
|
||||
* @return 药品详细信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> getMedicationInfo(String prescriptionNo, Integer pageNo, Integer pageSize) {
|
||||
// 药品详细查询
|
||||
IPage<ElepMedicationInfoDto> medicationInfo =
|
||||
elepPrescriptionMapper.selectMedicationInfo(new Page<>(pageNo, pageSize), prescriptionNo);
|
||||
elepPrescriptionMapper.selectMedicationInfo(new Page<>(pageNo, pageSize), prescriptionNo);
|
||||
return R.ok(medicationInfo);
|
||||
}
|
||||
|
||||
@@ -189,7 +187,8 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
Date now = DateUtils.getNowDate();
|
||||
|
||||
// 根据处方号查询处方信息
|
||||
List<ElepMedicationRequest> requestList = elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNo(prescriptionInfo.getPrescriptionNo());
|
||||
List<ElepMedicationRequest> requestList = elepMedicationRequestService
|
||||
.selectElepMedicationRequestByPrescriptionNo(prescriptionInfo.getPrescriptionNo());
|
||||
if (!requestList.isEmpty()) {
|
||||
List<Long> idList = requestList.stream().map(ElepMedicationRequest::getId).collect(Collectors.toList());
|
||||
// 处方信息删除
|
||||
@@ -205,68 +204,72 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
for (ElepMedicationInfoDto item : prescriptionInfo.getMedicationInfoList()) {
|
||||
elepMedicationRequest = new ElepMedicationRequest();
|
||||
elepMedicationRequest
|
||||
// ID
|
||||
.setId(null)
|
||||
// 医院内部处方编号
|
||||
.setPrescriptionNo(prescriptionInfo.getPrescriptionNo())
|
||||
// 医院id
|
||||
.setOrganizationId(info.getOrganizationId())
|
||||
// 门诊/住院病历号
|
||||
.setIptOtpNo(info.getIptOtpNo())
|
||||
// 科室病区
|
||||
.setDepartmentWard(info.getDepartmentWard())
|
||||
// 医保类型
|
||||
.setInsuranceEnum(info.getInsuranceEnum())
|
||||
// 开具日期
|
||||
.setIssueTime(now)
|
||||
// 开具科室
|
||||
.setOrgId(user.getOrgId())
|
||||
// 患者
|
||||
.setPatientId(prescriptionInfo.getPatientId())
|
||||
// 就诊id
|
||||
.setEncounterId(prescriptionInfo.getEncounterId())
|
||||
// 诊断id
|
||||
.setConditionId(prescriptionInfo.getConditionId())
|
||||
// 有效天数
|
||||
.setValidityDays(prescriptionInfo.getValidityDays())
|
||||
// 药品定义id
|
||||
.setMedicationId(item.getMedicationId())
|
||||
// 药品剂量
|
||||
.setMedDosage(item.getMedDosage())
|
||||
// 药品剂量单位
|
||||
.setMedDosageUnitCode(item.getMedDosageUnitCode())
|
||||
// 药品频率
|
||||
.setMedFrequency(item.getMedFrequency())
|
||||
// 药品途径
|
||||
.setMedRoute(item.getMedRoute())
|
||||
// 请求数量
|
||||
.setQuantity(item.getQuantity())
|
||||
// 请求单位
|
||||
.setUnitCode(item.getUnitCode())
|
||||
// 开方医师
|
||||
.setPrescribingDrId(user.getId())
|
||||
// 处方状态
|
||||
.setStatusEnum(RequestStatus.DRAFT.getValue())
|
||||
// 延长原因
|
||||
.setExtensionReason(prescriptionInfo.getExtensionReason())
|
||||
// 处方类别
|
||||
.setRxTypeCode(item.getRxTypeCode())
|
||||
// 处方详细类别
|
||||
.setRxItemTypeCode(item.getRxItemTypeCode())
|
||||
// 支持用药信息
|
||||
.setSupportInfo(item.getSupportInfo())
|
||||
// 服药时间(开始)
|
||||
.setEffectiveDoseStart(item.getEffectiveDoseStart())
|
||||
// 服药时间(结束)
|
||||
.setEffectiveDoseEnd(item.getEffectiveDoseEnd())
|
||||
// 给药间隔
|
||||
.setDispenseInterval(item.getDispenseInterval())
|
||||
// 单次发药数
|
||||
.setDispensePerQuantity(item.getDispensePerQuantity())
|
||||
// 每次发药供应天数
|
||||
.setDispensePerDuration(item.getDispensePerDuration())
|
||||
// 药品版本号
|
||||
.setVersion(item.getVersion());
|
||||
// ID
|
||||
.setId(null)
|
||||
// 医院内部处方编号
|
||||
.setPrescriptionNo(prescriptionInfo.getPrescriptionNo())
|
||||
// 医院id
|
||||
.setOrganizationId(info.getOrganizationId())
|
||||
// 门诊/住院病历号
|
||||
.setIptOtpNo(info.getIptOtpNo())
|
||||
// 科室病区
|
||||
.setDepartmentWard(info.getDepartmentWard())
|
||||
// 医保类型
|
||||
.setInsuranceEnum(info.getInsuranceEnum())
|
||||
// 开具日期
|
||||
.setIssueTime(now)
|
||||
// 开具科室
|
||||
.setOrgId(user.getOrgId())
|
||||
// 患者
|
||||
.setPatientId(prescriptionInfo.getPatientId())
|
||||
// 就诊id
|
||||
.setEncounterId(prescriptionInfo.getEncounterId())
|
||||
// 诊断id
|
||||
.setConditionId(prescriptionInfo.getConditionId())
|
||||
// 诊断定义id
|
||||
.setConditionDefId(prescriptionInfo.getConditionDefId())
|
||||
// 慢病字段 普通门诊存空串,慢病存MXXXX
|
||||
.setOpspDiseCode(prescriptionInfo.getOpspDiseCode())
|
||||
// 有效天数
|
||||
.setValidityDays(prescriptionInfo.getValidityDays())
|
||||
// 药品定义id
|
||||
.setMedicationId(item.getMedicationId())
|
||||
// 药品剂量
|
||||
.setMedDosage(item.getMedDosage())
|
||||
// 药品剂量单位
|
||||
.setMedDosageUnitCode(item.getMedDosageUnitCode())
|
||||
// 药品频率
|
||||
.setMedFrequency(item.getMedFrequency())
|
||||
// 药品途径
|
||||
.setMedRoute(item.getMedRoute())
|
||||
// 请求数量
|
||||
.setQuantity(item.getQuantity())
|
||||
// 请求单位
|
||||
.setUnitCode(item.getUnitCode())
|
||||
// 开方医师
|
||||
.setPrescribingDrId(user.getId())
|
||||
// 处方状态
|
||||
.setStatusEnum(RequestStatus.DRAFT.getValue())
|
||||
// 延长原因
|
||||
.setExtensionReason(prescriptionInfo.getExtensionReason())
|
||||
// 处方类别
|
||||
.setRxTypeCode(item.getRxTypeCode())
|
||||
// 处方详细类别
|
||||
.setRxItemTypeCode(item.getRxItemTypeCode())
|
||||
// 支持用药信息
|
||||
.setSupportInfo(item.getSupportInfo())
|
||||
// 服药时间(开始)
|
||||
.setEffectiveDoseStart(item.getEffectiveDoseStart())
|
||||
// 服药时间(结束)
|
||||
.setEffectiveDoseEnd(item.getEffectiveDoseEnd())
|
||||
// 给药间隔
|
||||
.setDispenseInterval(item.getDispenseInterval())
|
||||
// 单次发药数
|
||||
.setDispensePerQuantity(item.getDispensePerQuantity())
|
||||
// 每次发药供应天数
|
||||
.setDispensePerDuration(item.getDispensePerDuration())
|
||||
// 药品版本号
|
||||
.setVersion(item.getVersion());
|
||||
elepMedicationRequestList.add(elepMedicationRequest);
|
||||
}
|
||||
|
||||
@@ -281,7 +284,8 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
CatalogDrugInfo drugInfo;
|
||||
for (ElepMedicationInfoDto item : prescriptionInfo.getMedicationInfoList()) {
|
||||
// 保存常用药品
|
||||
usualInfo = baseMapper.selectOne(new LambdaUpdateWrapper<CatalogDrugInfoUsual>().eq(CatalogDrugInfoUsual::getMedicalCatalogCode, item.getMedicationId()));
|
||||
usualInfo = baseMapper.selectOne(new LambdaUpdateWrapper<CatalogDrugInfoUsual>()
|
||||
.eq(CatalogDrugInfoUsual::getMedicalCatalogCode, item.getMedicationId()));
|
||||
if (usualInfo == null) {
|
||||
drugInfo = elepPrescriptionMapper.selectCatalogDrugInfoByNo(item.getMedicationId(), item.getVersion());
|
||||
BeanUtils.copyProperties(drugInfo, usualInfoInsert);
|
||||
@@ -292,7 +296,7 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"电子处方"}));
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"电子处方"}));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -316,25 +320,25 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
// 修改处方信息
|
||||
if (prescriptionInfo.getId() == null) {
|
||||
elepMedicationRequestList = elepMedicationRequestService
|
||||
.selectElepMedicationRequestByPrescriptionNo(prescriptionInfo.getPrescriptionNo());
|
||||
.selectElepMedicationRequestByPrescriptionNo(prescriptionInfo.getPrescriptionNo());
|
||||
// 判断信息是否存在
|
||||
if (elepMedicationRequestList == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||
}
|
||||
for (ElepMedicationRequest item : elepMedicationRequestList) {
|
||||
item
|
||||
// 开具日期
|
||||
.setIssueTime(now)
|
||||
// 开具科室
|
||||
.setOrgId(user.getOrgId())
|
||||
// 开方医师
|
||||
.setPrescribingDrId(user.getId())
|
||||
// 有效天数
|
||||
.setValidityDays(prescriptionInfo.getValidityDays())
|
||||
// 延长原因
|
||||
.setExtensionReason(prescriptionInfo.getExtensionReason())
|
||||
// 处方类别
|
||||
.setRxTypeCode(prescriptionInfo.getRxTypeCode());
|
||||
// 开具日期
|
||||
.setIssueTime(now)
|
||||
// 开具科室
|
||||
.setOrgId(user.getOrgId())
|
||||
// 开方医师
|
||||
.setPrescribingDrId(user.getId())
|
||||
// 有效天数
|
||||
.setValidityDays(prescriptionInfo.getValidityDays())
|
||||
// 延长原因
|
||||
.setExtensionReason(prescriptionInfo.getExtensionReason())
|
||||
// 处方类别
|
||||
.setRxTypeCode(prescriptionInfo.getRxTypeCode());
|
||||
}
|
||||
// 修改处方
|
||||
boolean flg = elepMedicationRequestService.updateBatchById(elepMedicationRequestList);
|
||||
@@ -350,44 +354,48 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||
}
|
||||
elepMedicationRequest
|
||||
// 开具日期
|
||||
.setIssueTime(now)
|
||||
// 开具科室
|
||||
.setOrgId(user.getOrgId())
|
||||
// 开方医师
|
||||
.setPrescribingDrId(user.getId())
|
||||
// 药品定义id
|
||||
.setMedicationId(prescriptionInfo.getMedicationId())
|
||||
// 诊断id
|
||||
.setConditionId(prescriptionInfo.getConditionId())
|
||||
// 药品剂量
|
||||
.setMedDosage(prescriptionInfo.getMedDosage())
|
||||
// 药品剂量单位
|
||||
.setMedDosageUnitCode(prescriptionInfo.getMedDosageUnitCode())
|
||||
// 药品频率
|
||||
.setMedFrequency(prescriptionInfo.getMedFrequency())
|
||||
// 药品途径
|
||||
.setMedRoute(prescriptionInfo.getMedRoute())
|
||||
// 请求数量
|
||||
.setQuantity(prescriptionInfo.getQuantity())
|
||||
// 请求单位
|
||||
.setUnitCode(prescriptionInfo.getUnitCode())
|
||||
// 支持用药信息
|
||||
.setSupportInfo(prescriptionInfo.getSupportInfo())
|
||||
// 服药时间(开始)
|
||||
.setEffectiveDoseStart(prescriptionInfo.getEffectiveDoseStart())
|
||||
// 服药时间(结束)
|
||||
.setEffectiveDoseEnd(prescriptionInfo.getEffectiveDoseEnd())
|
||||
// 给药间隔
|
||||
.setDispenseInterval(prescriptionInfo.getDispenseInterval())
|
||||
// 单次发药数
|
||||
.setDispensePerQuantity(prescriptionInfo.getDispensePerQuantity())
|
||||
// 处方详细类别
|
||||
.setRxItemTypeCode(prescriptionInfo.getRxItemTypeCode())
|
||||
// 每次发药供应天数
|
||||
.setDispensePerDuration(prescriptionInfo.getDispensePerDuration())
|
||||
// 药品版本号
|
||||
.setVersion(prescriptionInfo.getVersion());
|
||||
// 开具日期
|
||||
.setIssueTime(now)
|
||||
// 开具科室
|
||||
.setOrgId(user.getOrgId())
|
||||
// 开方医师
|
||||
.setPrescribingDrId(user.getId())
|
||||
// 药品定义id
|
||||
.setMedicationId(prescriptionInfo.getMedicationId())
|
||||
// 诊断id
|
||||
.setConditionId(prescriptionInfo.getConditionId())
|
||||
// 诊断定义id
|
||||
.setConditionDefId(prescriptionInfo.getConditionDefId())
|
||||
// 慢病字段 普通门诊存空串,慢病存MXXXX
|
||||
.setOpspDiseCode(prescriptionInfo.getOpspDiseCode())
|
||||
// 药品剂量
|
||||
.setMedDosage(prescriptionInfo.getMedDosage())
|
||||
// 药品剂量单位
|
||||
.setMedDosageUnitCode(prescriptionInfo.getMedDosageUnitCode())
|
||||
// 药品频率
|
||||
.setMedFrequency(prescriptionInfo.getMedFrequency())
|
||||
// 药品途径
|
||||
.setMedRoute(prescriptionInfo.getMedRoute())
|
||||
// 请求数量
|
||||
.setQuantity(prescriptionInfo.getQuantity())
|
||||
// 请求单位
|
||||
.setUnitCode(prescriptionInfo.getUnitCode())
|
||||
// 支持用药信息
|
||||
.setSupportInfo(prescriptionInfo.getSupportInfo())
|
||||
// 服药时间(开始)
|
||||
.setEffectiveDoseStart(prescriptionInfo.getEffectiveDoseStart())
|
||||
// 服药时间(结束)
|
||||
.setEffectiveDoseEnd(prescriptionInfo.getEffectiveDoseEnd())
|
||||
// 给药间隔
|
||||
.setDispenseInterval(prescriptionInfo.getDispenseInterval())
|
||||
// 单次发药数
|
||||
.setDispensePerQuantity(prescriptionInfo.getDispensePerQuantity())
|
||||
// 处方详细类别
|
||||
.setRxItemTypeCode(prescriptionInfo.getRxItemTypeCode())
|
||||
// 每次发药供应天数
|
||||
.setDispensePerDuration(prescriptionInfo.getDispensePerDuration())
|
||||
// 药品版本号
|
||||
.setVersion(prescriptionInfo.getVersion());
|
||||
|
||||
// 修改处方
|
||||
boolean flg = elepMedicationRequestService.updateById(elepMedicationRequest);
|
||||
@@ -396,7 +404,7 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"电子处方"}));
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"电子处方"}));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -413,20 +421,20 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
|
||||
if (deletePrescriptionInfoParam.getIdList().isEmpty()) {
|
||||
elepMedicationRequestList = elepMedicationRequestService
|
||||
.selectElepMedicationRequestByPrescriptionNoList(deletePrescriptionInfoParam.getPrescriptionNoList());
|
||||
.selectElepMedicationRequestByPrescriptionNoList(deletePrescriptionInfoParam.getPrescriptionNoList());
|
||||
// 判断信息是否存在
|
||||
if (elepMedicationRequestList == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||
}
|
||||
// 删除处方
|
||||
boolean flg = elepMedicationRequestService
|
||||
.deleteElepMedicationRequestByPrescriptionNo(deletePrescriptionInfoParam.getPrescriptionNoList());
|
||||
.deleteElepMedicationRequestByPrescriptionNo(deletePrescriptionInfoParam.getPrescriptionNoList());
|
||||
if (!flg) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, null));
|
||||
}
|
||||
} else {
|
||||
elepMedicationRequestList =
|
||||
elepMedicationRequestService.selectElepMedicationRequestById(deletePrescriptionInfoParam.getIdList());
|
||||
elepMedicationRequestService.selectElepMedicationRequestById(deletePrescriptionInfoParam.getIdList());
|
||||
// 判断信息是否存在
|
||||
if (elepMedicationRequestList == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||
@@ -437,7 +445,7 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, null));
|
||||
}
|
||||
}
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[]{"电子处方"}));
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"电子处方"}));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -450,16 +458,17 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
public R<?> issuancePrescription(List<String> prescriptionNoList) {
|
||||
// 搜索处方信息
|
||||
List<ElepMedicationRequest> elepMedicationRequestList =
|
||||
elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNoList(prescriptionNoList);
|
||||
elepMedicationRequestService.selectElepMedicationRequestByPrescriptionNoList(prescriptionNoList);
|
||||
// 判断处方是否存在
|
||||
if (elepMedicationRequestList == null) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||
}
|
||||
for (ElepMedicationRequest item : elepMedicationRequestList) {
|
||||
if(Objects.equals(item.getStatusEnum(), RequestStatus.DRAFT.getValue())|| Objects.equals(item.getStatusEnum(), RequestStatus.ENDED.getValue())){
|
||||
if (Objects.equals(item.getStatusEnum(), RequestStatus.DRAFT.getValue())
|
||||
|| Objects.equals(item.getStatusEnum(), RequestStatus.ENDED.getValue())) {
|
||||
// 处方状态
|
||||
item.setStatusEnum(RequestStatus.ACTIVE.getValue());
|
||||
}else{
|
||||
} else {
|
||||
return R.fail("选择了不能签发的处方");
|
||||
}
|
||||
}
|
||||
@@ -469,6 +478,6 @@ public class DoctorStationElepPrescriptionServiceImpl extends ServiceImpl<Catalo
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, null));
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"电子处方"}));
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"电子处方"}));
|
||||
}
|
||||
}
|
||||
|
@@ -7,6 +7,8 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -160,6 +162,18 @@ public class DoctorStationDiagnosisController {
|
||||
return iDoctorStationDiagnosisAppService.getEncounterDiagnosis(encounterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询就诊诊断信息
|
||||
*
|
||||
* @param searchKey 目标字符
|
||||
* @return 就诊诊断信息
|
||||
*/
|
||||
@GetMapping(value = "/get-diagnosis-list")
|
||||
public R<?> getDiagnosisList(@RequestParam(value = "searchKey", required = false) String searchKey,
|
||||
HttpServletRequest request) {
|
||||
return iDoctorStationDiagnosisAppService.getDiagnosisList(searchKey, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除就诊诊断信息
|
||||
*
|
||||
|
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -15,6 +16,13 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class ActivityBindDeviceDetailDto {
|
||||
|
||||
/**
|
||||
* 用于搭配Dict切面,无实际业务意义
|
||||
*/
|
||||
@Dict(dictCode = "test_field")
|
||||
private String testField;
|
||||
private String testField_dictText;
|
||||
|
||||
/**
|
||||
* 诊疗id
|
||||
*/
|
||||
@@ -38,6 +46,6 @@ public class ActivityBindDeviceDetailDto {
|
||||
/**
|
||||
* 耗材详细信息
|
||||
*/
|
||||
private AdviceBaseDto deviceDetailInfos;
|
||||
private AdviceBaseDto orderDetailInfos;
|
||||
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ package com.openhis.web.doctorstation.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -12,6 +13,13 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class ActivityBindDeviceDto {
|
||||
|
||||
/**
|
||||
* 用于搭配Dict切面,无实际业务意义
|
||||
*/
|
||||
@Dict(dictCode = "test_field")
|
||||
private String testField;
|
||||
private String testField_dictText;
|
||||
|
||||
/**
|
||||
* 诊疗绑定耗材详情
|
||||
*/
|
||||
|
@@ -133,6 +133,10 @@ public class AdviceBaseDto {
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/** 供应商ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 生产厂家
|
||||
*/
|
||||
|
@@ -4,19 +4,13 @@ import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Positive;
|
||||
|
||||
/**
|
||||
* 电子处方 dto
|
||||
*/
|
||||
@@ -24,104 +18,82 @@ import javax.validation.constraints.Positive;
|
||||
@Accessors(chain = true)
|
||||
public class ElepPrescriptionInfoParam {
|
||||
|
||||
/** 药品信息 */
|
||||
List<ElepMedicationInfoDto> medicationInfoList;
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Integer id;
|
||||
|
||||
/** 医院内部处方编号 */
|
||||
private String prescriptionNo;
|
||||
|
||||
/** 医院id (前台不传) */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long organizationId;
|
||||
|
||||
/** 门诊/住院病历号 (前台不传) */
|
||||
private String iptOtpNo;
|
||||
|
||||
/** 科室病区 (前台不传) */
|
||||
private String departmentWard;
|
||||
|
||||
/** 医保类型 (前台不传) */
|
||||
private Integer insuranceEnum;
|
||||
|
||||
/** 开具日期 (前台不传) */
|
||||
private Date issueTime;
|
||||
|
||||
/** 开具科室 (前台不传) */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long orgId;
|
||||
|
||||
/** 患者 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 就诊id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 诊断id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long conditionId;
|
||||
|
||||
/** 诊断id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long conditionDefId;
|
||||
/** 慢病字段 */
|
||||
private String opspDiseCode;
|
||||
/** 有效天数 */
|
||||
private Integer validityDays;
|
||||
|
||||
/** 药品定义id */
|
||||
private String medicationId;
|
||||
|
||||
/** 药品剂量 */
|
||||
private BigDecimal medDosage;
|
||||
/** 药品剂量单位 */
|
||||
private String medDosageUnitCode;
|
||||
|
||||
/** 药品频率 */
|
||||
private String medFrequency;
|
||||
|
||||
/** 药品途径 */
|
||||
private String medRoute;
|
||||
|
||||
/** 开方医师 (前台不传) */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long prescribingDrId;
|
||||
|
||||
/** 延长原因 */
|
||||
private String extensionReason;
|
||||
|
||||
/** 处方状态 (前台不传) */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 请求数量 */
|
||||
private Integer quantity;
|
||||
|
||||
/** 请求单位 */
|
||||
private String unitCode;
|
||||
|
||||
/** 处方类别 */
|
||||
private Integer rxTypeCode;
|
||||
/** 处方类别 */
|
||||
private Integer rxItemTypeCode;
|
||||
|
||||
/** 支持用药信息 */
|
||||
private String supportInfo;
|
||||
/** 服药时间(开始) */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date effectiveDoseStart;
|
||||
|
||||
/** 服药时间(结束) */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date effectiveDoseEnd;
|
||||
/** 给药间隔 */
|
||||
private String dispenseInterval;
|
||||
|
||||
/** 单次发药数 */
|
||||
private Integer dispensePerQuantity;
|
||||
|
||||
/** 每次发药供应天数 */
|
||||
private Integer dispensePerDuration;
|
||||
|
||||
/** 药品版本号 */
|
||||
private String version;
|
||||
|
||||
/** 药品信息 */
|
||||
List<ElepMedicationInfoDto> medicationInfoList;
|
||||
}
|
||||
|
@@ -2,10 +2,7 @@ package com.openhis.web.doctorstation.utils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -28,6 +25,7 @@ import com.openhis.web.datadictionary.dto.ActivityChildJsonDto;
|
||||
import com.openhis.web.doctorstation.appservice.IDoctorStationAdviceAppService;
|
||||
import com.openhis.web.doctorstation.dto.*;
|
||||
import com.openhis.web.doctorstation.mapper.DoctorStationAdviceAppMapper;
|
||||
import com.openhis.web.inhospitalnursestation.dto.MedicationRequestUseExe;
|
||||
import com.openhis.web.personalization.dto.ActivityDeviceDto;
|
||||
import com.openhis.workflow.domain.DeviceRequest;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
@@ -121,6 +119,56 @@ public class AdviceUtils {
|
||||
return null; // 校验通过
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行住院医嘱,校验药品库存
|
||||
*
|
||||
* @param medUseExeList 药品请求信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkExeMedInventory(List<MedicationRequestUseExe> medUseExeList) {
|
||||
// 医嘱定义id集合
|
||||
List<Long> adviceDefinitionIdList =
|
||||
medUseExeList.stream().map(MedicationRequestUseExe::getMedicationId).collect(Collectors.toList());
|
||||
// 医嘱库存集合
|
||||
List<AdviceInventoryDto> adviceInventoryList =
|
||||
doctorStationAdviceAppMapper.getAdviceInventory(null, adviceDefinitionIdList,
|
||||
CommonConstants.SqlCondition.ABOUT_INVENTORY_TABLE_STR, PublicationStatus.ACTIVE.getValue());
|
||||
// 待发放个数信息
|
||||
List<AdviceInventoryDto> adviceDraftInventoryList = doctorStationAdviceAppMapper.getAdviceDraftInventory(
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
DispenseStatus.DRAFT.getValue(), DispenseStatus.PREPARATION.getValue());
|
||||
// 预减库存
|
||||
List<AdviceInventoryDto> adviceInventory =
|
||||
this.subtractInventory(adviceInventoryList, adviceDraftInventoryList);
|
||||
// 生命提示信息集合
|
||||
List<String> tipsList = new ArrayList<>();
|
||||
for (MedicationRequestUseExe medicationRequestUseExe : medUseExeList) {
|
||||
Optional<AdviceInventoryDto> matchedInventory = adviceInventory.stream()
|
||||
.filter(inventoryDto -> medicationRequestUseExe.getMedicationId().equals(inventoryDto.getItemId())
|
||||
&& CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(inventoryDto.getItemTable())
|
||||
&& medicationRequestUseExe.getPerformLocation().equals(inventoryDto.getLocationId())
|
||||
&& medicationRequestUseExe.getLotNumber().equals(inventoryDto.getLotNumber()))
|
||||
.findFirst();
|
||||
// 匹配到库存信息
|
||||
if (matchedInventory.isPresent()) {
|
||||
AdviceInventoryDto inventoryDto = matchedInventory.get();
|
||||
if ((medicationRequestUseExe.getExecuteTimesNum()
|
||||
.multiply(medicationRequestUseExe.getMinUnitQuantity()))
|
||||
.compareTo(inventoryDto.getQuantity()) > 0) {
|
||||
tipsList
|
||||
.add("【" + medicationRequestUseExe.getBusNo() + "】在" + inventoryDto.getLocationName() + "库存不足");
|
||||
}
|
||||
} else {
|
||||
tipsList.add("【" + medicationRequestUseExe.getBusNo() + "】未匹配到库存信息");
|
||||
}
|
||||
}
|
||||
if (!tipsList.isEmpty()) {
|
||||
// 返回库存不足提示信息
|
||||
return String.join(";", tipsList);
|
||||
}
|
||||
return null; // 校验通过
|
||||
}
|
||||
|
||||
/**
|
||||
* 预减库存
|
||||
*
|
||||
|
@@ -15,7 +15,7 @@ import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.administration.service.IPatientService;
|
||||
import com.openhis.administration.service.IPractitionerService;
|
||||
import com.openhis.common.enums.ActivityDefCategory;
|
||||
import com.openhis.common.enums.ybenums.YbGender;
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.crosssystem.dto.LisApplyDto;
|
||||
import com.openhis.crosssystem.dto.LisApplyGroupDto;
|
||||
import com.openhis.crosssystem.dto.PacsApplyDto;
|
||||
@@ -99,9 +99,9 @@ public class DoctorStationSendApplyUtil {
|
||||
if (patient.getGenderEnum() == null) {
|
||||
lisPatientSex = LisPatientSex.UNKNOWN;
|
||||
} else {
|
||||
if (YbGender.MALE.getValue().equals(patient.getGenderEnum().toString())) {
|
||||
if (AdministrativeGender.MALE.getValue().equals(patient.getGenderEnum())) {
|
||||
lisPatientSex = LisPatientSex.MALE;
|
||||
} else if (YbGender.FEMALE.getValue().equals(patient.getGenderEnum().toString())) {
|
||||
} else if (AdministrativeGender.FEMALE.getValue().equals(patient.getGenderEnum())) {
|
||||
lisPatientSex = LisPatientSex.FEMALE;
|
||||
} else {
|
||||
lisPatientSex = LisPatientSex.UNKNOWN;
|
||||
@@ -128,9 +128,9 @@ public class DoctorStationSendApplyUtil {
|
||||
if (patient.getGenderEnum() == null) {
|
||||
pacsPatientSex = PacsPatientSex.UNKNOWN;
|
||||
} else {
|
||||
if (YbGender.MALE.getValue().equals(patient.getGenderEnum().toString())) {
|
||||
if (AdministrativeGender.MALE.getValue().equals(patient.getGenderEnum())) {
|
||||
pacsPatientSex = PacsPatientSex.MALE;
|
||||
} else if (YbGender.FEMALE.getValue().equals(patient.getGenderEnum().toString())) {
|
||||
} else if (AdministrativeGender.FEMALE.getValue().equals(patient.getGenderEnum())) {
|
||||
pacsPatientSex = PacsPatientSex.FEMALE;
|
||||
} else {
|
||||
pacsPatientSex = PacsPatientSex.UNKNOWN;
|
||||
|
@@ -38,8 +38,9 @@ public interface IDocStatisticsDefinitionAppService {
|
||||
*/
|
||||
public List<DocStatisticsDefinitionDto> getList(Integer isStatistics);
|
||||
|
||||
List<DocStatisticsDefinitionDto> getListWithOptionList(Integer isStatistics);
|
||||
/**
|
||||
* 获取文档统计定义选项列表并按指定格式返回
|
||||
* 过时obsolete 获取文档统计定义选项列表并按指定格式返回 (key-value)
|
||||
*
|
||||
* @return 封装了处理结果的响应对象
|
||||
*/
|
||||
@@ -53,22 +54,4 @@ public interface IDocStatisticsDefinitionAppService {
|
||||
|
||||
public R<?> deleteDocStatisticsDefinition(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 根据id获取文档统计定义
|
||||
*
|
||||
* @param id
|
||||
* @return 封装了处理结果的响应对象
|
||||
*/
|
||||
public R<?> getDocStatisticsDefinitionById(Long id);
|
||||
|
||||
/**
|
||||
* 根据code获取文档统计定义
|
||||
*
|
||||
* @param code
|
||||
* @return 封装了处理结果的响应对象
|
||||
*/
|
||||
public R<?> getDocStatisticsDefinitionByCode(String code);
|
||||
|
||||
|
||||
}
|
@@ -1,36 +0,0 @@
|
||||
package com.openhis.web.document.appservice;
|
||||
|
||||
|
||||
import com.core.common.core.domain.AjaxResult;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.document.dto.DocStatisticsDefinitionOptionDto;
|
||||
import com.openhis.web.document.dto.DocStatisticsDefinitionOptionList;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文档模板 业务接口
|
||||
*/
|
||||
public interface IDocStatisticsDefinitionOptionAppService {
|
||||
|
||||
|
||||
/**
|
||||
* 新增、修改文档模板 统计项选项
|
||||
*
|
||||
* @param docStatisticsDefinitionOptionList
|
||||
*/
|
||||
public R<?> add(DocStatisticsDefinitionOptionList docStatisticsDefinitionOptionList);
|
||||
|
||||
public R<?> createOrEdit(DocStatisticsDefinitionOptionList docStatisticsDefinitionOptionList);
|
||||
|
||||
public R<?> deleteDocStatisticsDefinitionOptionById(Long id);
|
||||
|
||||
public DocStatisticsDefinitionOptionList getDocStatisticsDefinitionOptionByDefinitionId(Long docStatisticsDefinitionId);
|
||||
|
||||
/**
|
||||
* 获取文档模板 统计项选项列表
|
||||
*/
|
||||
public AjaxResult getDocStatisticsDefinitionOptionList();
|
||||
|
||||
|
||||
}
|
@@ -3,7 +3,10 @@ package com.openhis.web.document.appservice.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.constant.CacheConstants;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.core.domain.entity.SysDictData;
|
||||
import com.core.common.core.redis.RedisCache;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.common.utils.HisPageUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
@@ -11,13 +14,11 @@ import com.openhis.document.domain.DocStatisticsDefinition;
|
||||
import com.openhis.document.mapper.DocStatisticsDefinitionMapper;
|
||||
import com.openhis.document.service.IDocStatisticsDefinitionService;
|
||||
import com.openhis.web.document.appservice.IDocStatisticsDefinitionAppService;
|
||||
import com.openhis.web.document.appservice.IDocStatisticsDefinitionOptionAppService;
|
||||
import com.openhis.web.document.dto.DocDefinitionOrganizationDto;
|
||||
import com.openhis.web.document.dto.DocStatisticsDefinitionDto;
|
||||
import com.openhis.web.document.dto.DocStatisticsDefinitionOptionList;
|
||||
import com.openhis.web.document.dto.OptionDto;
|
||||
import com.openhis.web.document.mapper.DocStatisticsDefinitionAppMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -35,12 +36,11 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi
|
||||
@Resource
|
||||
private IDocStatisticsDefinitionService iDocStatisticsDefinitionService;
|
||||
@Resource
|
||||
private IDocStatisticsDefinitionOptionAppService iDocStaticsDefinitionOptionAppService;
|
||||
@Resource
|
||||
private DocStatisticsDefinitionMapper docStatisticsDefinitionMapper;
|
||||
@Resource
|
||||
private DocStatisticsDefinitionAppMapper docStatisticsDefinitionAppMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
@Override
|
||||
public R<?> createOrEdit(DocStatisticsDefinitionDto docStatisticsDefinitionDto) {
|
||||
if (docStatisticsDefinitionDto == null) {
|
||||
@@ -95,15 +95,10 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi
|
||||
docStatisticsDefinition.setIsStatistics(docStatisticsDefinitionDto.getIsStatistics());
|
||||
docStatisticsDefinition.setDisplayOrder(docStatisticsDefinitionDto.getDisplayOrder());
|
||||
docStatisticsDefinition.setUnit(docStatisticsDefinitionDto.getUnit());
|
||||
|
||||
|
||||
docStatisticsDefinition.setDictType(docStatisticsDefinitionDto.getDictType());
|
||||
docStatisticsDefinition.setDictName(docStatisticsDefinitionDto.getDictName());
|
||||
boolean saveResult = iDocStatisticsDefinitionService.save(docStatisticsDefinition);
|
||||
if (saveResult) {
|
||||
// 同步保存选项列表(如有)
|
||||
if (docStatisticsDefinitionDto.getOptionList() != null && !docStatisticsDefinitionDto.getOptionList().getOptions().isEmpty()) {
|
||||
docStatisticsDefinitionDto.getOptionList().setDocStatisticsDefinitionId(docStatisticsDefinition.getId());
|
||||
return iDocStaticsDefinitionOptionAppService.add(docStatisticsDefinitionDto.getOptionList());
|
||||
}
|
||||
return R.ok("文档统计定义新增成功");
|
||||
} else {
|
||||
return R.fail("文档统计定义新增失败");
|
||||
@@ -131,10 +126,12 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi
|
||||
existingData.setIsStatistics(docStatisticsDefinitionDto.getIsStatistics());
|
||||
existingData.setDisplayOrder(docStatisticsDefinitionDto.getDisplayOrder());
|
||||
existingData.setUnit(docStatisticsDefinitionDto.getUnit());
|
||||
existingData.setDictType(docStatisticsDefinitionDto.getDictType());
|
||||
existingData.setDictName(docStatisticsDefinitionDto.getDictName());
|
||||
boolean updateResult = iDocStatisticsDefinitionService.updateById(existingData);
|
||||
if (updateResult) {
|
||||
// 同步更新选项列表
|
||||
return iDocStaticsDefinitionOptionAppService.createOrEdit(docStatisticsDefinitionDto.getOptionList());
|
||||
return R.ok("文档统计定义更新成功");
|
||||
} else {
|
||||
return R.fail("文档统计定义更新失败");
|
||||
}
|
||||
@@ -168,12 +165,12 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPageList(Integer pageNo, Integer pageSize, String searchKey, HttpServletRequest request) {
|
||||
// Map<String, Object> keyMap = redisCache.getAllDictDataWithKeys(CacheConstants.SYS_DICT_KEY);
|
||||
// 构建查询条件(支持多字段搜索)
|
||||
QueryWrapper<DocStatisticsDefinition> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
null, searchKey, new HashSet<>(Arrays.asList("name", "code")), request);
|
||||
// 按记录时间倒序(最新记录在前)
|
||||
queryWrapper.lambda().orderByDesc(DocStatisticsDefinition::getDisplayOrder);
|
||||
|
||||
Page<DocStatisticsDefinitionDto> recordPage = HisPageUtils.selectPage(
|
||||
docStatisticsDefinitionMapper, queryWrapper, pageNo, pageSize, DocStatisticsDefinitionDto.class);
|
||||
// 转换为分页结果
|
||||
@@ -181,13 +178,14 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文档统计定义列表(不分页)
|
||||
* 获取文档统计定义列表(不分页,不包含options)
|
||||
*
|
||||
* @param isStatistics 是否统计
|
||||
* @return 文档统计定义列表
|
||||
*/
|
||||
@Override
|
||||
public List<DocStatisticsDefinitionDto> getList(Integer isStatistics) {
|
||||
Map<String, Object> keyMap = redisCache.getAllDictDataWithKeys(CacheConstants.SYS_DICT_KEY);
|
||||
LambdaQueryWrapper<DocStatisticsDefinition> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (isStatistics != null) {
|
||||
queryWrapper.eq(DocStatisticsDefinition::getIsStatistics, isStatistics);
|
||||
@@ -201,7 +199,28 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DocStatisticsDefinitionDto> getListWithOptionList(Integer isStatistics) {
|
||||
//从redis中获取所有字典数据
|
||||
Map<String, Object> keyMap = redisCache.getAllDictDataWithKeys(CacheConstants.SYS_DICT_KEY);
|
||||
LambdaQueryWrapper<DocStatisticsDefinition> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (isStatistics != null) {
|
||||
queryWrapper.eq(DocStatisticsDefinition::getIsStatistics, isStatistics);
|
||||
}
|
||||
List<DocStatisticsDefinition> dataList = iDocStatisticsDefinitionService.list(queryWrapper);
|
||||
List<DocStatisticsDefinitionDto> resultList = new ArrayList<>();
|
||||
for (DocStatisticsDefinition data : dataList) {
|
||||
DocStatisticsDefinitionDto dto = new DocStatisticsDefinitionDto();
|
||||
BeanUtils.copyProperties(data, dto);
|
||||
if(keyMap.containsKey(CacheConstants.SYS_DICT_KEY+data.getDictType()))
|
||||
{
|
||||
List<SysDictData> dictData = (List<SysDictData>) keyMap.get(CacheConstants.SYS_DICT_KEY+data.getDictType());
|
||||
dto.setOptionList(dictData);
|
||||
}
|
||||
resultList.add(dto);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
/**
|
||||
* 获取文档统计定义选项列表并按指定格式返回
|
||||
*
|
||||
@@ -276,62 +295,12 @@ public class DocStatisticsDefinitionAppServiceImpl implements IDocStatisticsDefi
|
||||
}
|
||||
boolean deleteResult = iDocStatisticsDefinitionService.removeById(id);
|
||||
if (deleteResult) {
|
||||
// 同步删除选项列表
|
||||
iDocStaticsDefinitionOptionAppService.deleteDocStatisticsDefinitionOptionById(id);
|
||||
return R.ok("文档统计定义删除成功");
|
||||
} else {
|
||||
return R.fail("文档统计定义删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文档统计定义详情
|
||||
*
|
||||
* @param id 文档统计定义ID
|
||||
* @return 封装了处理结果的响应对象
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDocStatisticsDefinitionById(Long id) {
|
||||
if (id == null) {
|
||||
return R.fail("获取文档统计定义,参数ID不能为空");
|
||||
}
|
||||
DocStatisticsDefinition data = iDocStatisticsDefinitionService.getById(id);
|
||||
if (data == null) {
|
||||
return R.fail("获取文档统计定义失败,目标数据不存在");
|
||||
}
|
||||
// 转换为DTO返回
|
||||
DocStatisticsDefinitionDto dto = new DocStatisticsDefinitionDto();
|
||||
BeanUtils.copyProperties(data, dto);
|
||||
DocStatisticsDefinitionOptionList optionList = iDocStaticsDefinitionOptionAppService.getDocStatisticsDefinitionOptionByDefinitionId(id);
|
||||
dto.setOptionList(optionList);
|
||||
return R.ok(dto, "文档统计定义获取成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据代码获取文档统计定义详情
|
||||
*
|
||||
* @param code 文档统计定义代码
|
||||
* @return 封装了处理结果的响应对象
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDocStatisticsDefinitionByCode(String code) {
|
||||
if (code == null || code.trim().isEmpty()) {
|
||||
return R.fail("获取文档统计定义,参数代码不能为空");
|
||||
}
|
||||
// 按代码查询
|
||||
LambdaQueryWrapper<DocStatisticsDefinition> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(DocStatisticsDefinition::getCode, code);
|
||||
DocStatisticsDefinition data = iDocStatisticsDefinitionService.getOne(queryWrapper);
|
||||
if (data == null) {
|
||||
return R.fail("获取文档统计定义失败,目标数据不存在");
|
||||
}
|
||||
DocStatisticsDefinitionDto dto = new DocStatisticsDefinitionDto();
|
||||
if (data != null) {
|
||||
BeanUtils.copyProperties(data, dto);
|
||||
}
|
||||
DocStatisticsDefinitionOptionList optionList = iDocStaticsDefinitionOptionAppService.getDocStatisticsDefinitionOptionByDefinitionId(data.getId());
|
||||
dto.setOptionList(optionList);
|
||||
return R.ok(dto, "文档统计定义获取成功");
|
||||
}
|
||||
|
||||
}
|
@@ -1,229 +0,0 @@
|
||||
package com.openhis.web.document.appservice.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.core.common.core.domain.AjaxResult;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.document.domain.DocStatisticsDefinitionOption;
|
||||
import com.openhis.document.mapper.DocStatisticsDefinitionOptionMapper;
|
||||
import com.openhis.document.service.IDocStatisticsDefinitionOptionService;
|
||||
import com.openhis.web.document.appservice.IDocStatisticsDefinitionOptionAppService;
|
||||
import com.openhis.web.document.dto.DocStatisticsDefinitionOptionDto;
|
||||
import com.openhis.web.document.dto.DocStatisticsDefinitionOptionList;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 文档统计定义选项 业务实现类
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class DocStatisticsDefinitionOptionAppServiceImpl implements IDocStatisticsDefinitionOptionAppService {
|
||||
|
||||
@Resource
|
||||
private DocStatisticsDefinitionOptionMapper docStatisticsDefinitonOptionMapper;
|
||||
@Resource
|
||||
private IDocStatisticsDefinitionOptionService docStatisticsDefinitionOptionService;
|
||||
|
||||
/**
|
||||
* 新增文档统计定义选项
|
||||
*
|
||||
* @param docStatisticsDefinitionOptionList 选项列表DTO
|
||||
*/
|
||||
@Override
|
||||
public R<?> add(DocStatisticsDefinitionOptionList docStatisticsDefinitionOptionList) {
|
||||
// 参数校验
|
||||
if (docStatisticsDefinitionOptionList == null) {
|
||||
return R.fail("统计项选项列表为空,请选择统计项选项");
|
||||
}
|
||||
if (docStatisticsDefinitionOptionList.getOptions() == null || docStatisticsDefinitionOptionList.getOptions().isEmpty()) {
|
||||
return R.fail("统计项选项不允许为空,请正确填写统计项选项");
|
||||
}
|
||||
if (docStatisticsDefinitionOptionList.getDocStatisticsDefinitionId() == null) {
|
||||
return R.fail("统计项定义ID为空,请选择统计项定义ID");
|
||||
}
|
||||
|
||||
// DTO转实体
|
||||
List<DocStatisticsDefinitionOption> optionList = new ArrayList<>();
|
||||
for (DocStatisticsDefinitionOptionDto dto : docStatisticsDefinitionOptionList.getOptions()) {
|
||||
DocStatisticsDefinitionOption option = new DocStatisticsDefinitionOption();
|
||||
option.setDocStatisticsDefinitionId(docStatisticsDefinitionOptionList.getDocStatisticsDefinitionId());
|
||||
option.setOption(dto.getOption());
|
||||
option.setDisplayOrder(dto.getDisplayOrder());
|
||||
optionList.add(option);
|
||||
}
|
||||
|
||||
// 批量新增
|
||||
boolean saveSuccess = docStatisticsDefinitionOptionService.saveBatch(optionList);
|
||||
if (saveSuccess) {
|
||||
return R.ok(optionList, "统计项选项保存成功");
|
||||
} else {
|
||||
return R.fail("统计项选项保存失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/编辑文档统计定义选项(区分增删改)
|
||||
*
|
||||
* @param docStatisticsDefinitionOptionList 选项列表DTO
|
||||
*/
|
||||
@Override
|
||||
public R<?> createOrEdit(DocStatisticsDefinitionOptionList docStatisticsDefinitionOptionList) {
|
||||
// 参数校验
|
||||
if (docStatisticsDefinitionOptionList == null) {
|
||||
return R.fail("统计项选项列表为空,请选择统计项选项");
|
||||
}
|
||||
Long definitionId = docStatisticsDefinitionOptionList.getDocStatisticsDefinitionId();
|
||||
if (definitionId == null) {
|
||||
return R.fail("统计项定义ID为空,请选择统计项定义ID");
|
||||
}
|
||||
|
||||
// 1. 查询原数据列表(按统计定义ID关联)
|
||||
List<DocStatisticsDefinitionOption> oldList = docStatisticsDefinitonOptionMapper.selectList(
|
||||
new LambdaQueryWrapper<DocStatisticsDefinitionOption>()
|
||||
.eq(DocStatisticsDefinitionOption::getDocStatisticsDefinitionId, definitionId));
|
||||
oldList = oldList == null ? Collections.emptyList() : oldList;
|
||||
|
||||
// 2. 处理新数据列表(DTO转实体,避免空指针)
|
||||
List<DocStatisticsDefinitionOption> newList = new ArrayList<>();
|
||||
if (docStatisticsDefinitionOptionList.getOptions() != null && !docStatisticsDefinitionOptionList.getOptions().isEmpty()) {
|
||||
for (DocStatisticsDefinitionOptionDto dto : docStatisticsDefinitionOptionList.getOptions()) {
|
||||
DocStatisticsDefinitionOption option = new DocStatisticsDefinitionOption();
|
||||
BeanUtils.copyProperties(dto, option); // 改用BeanUtils简化赋值
|
||||
option.setDocStatisticsDefinitionId(definitionId); // 强制关联父ID,确保数据一致性
|
||||
newList.add(option);
|
||||
}
|
||||
}
|
||||
newList = newList == null ? Collections.emptyList() : newList;
|
||||
|
||||
// 3. 构建原数据ID映射(快速查找)
|
||||
Map<Long, DocStatisticsDefinitionOption> oldIdMap = oldList.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(item -> item.getId() != null)
|
||||
.collect(Collectors.toMap(DocStatisticsDefinitionOption::getId, item -> item));
|
||||
|
||||
// 4. 提取新数据中的有效ID集合
|
||||
Set<Long> newIds = newList.stream()
|
||||
.map(DocStatisticsDefinitionOption::getId)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
// 5. 确定需要删除的项(原数据存在但新数据不存在)
|
||||
List<Long> deleteIds = oldList.stream()
|
||||
.map(DocStatisticsDefinitionOption::getId)
|
||||
.filter(id -> !newIds.contains(id))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 6. 区分新增和修改的项
|
||||
List<DocStatisticsDefinitionOption> addList = new ArrayList<>();
|
||||
List<DocStatisticsDefinitionOption> updateList = new ArrayList<>();
|
||||
for (DocStatisticsDefinitionOption newItem : newList) {
|
||||
Long newItemId = newItem.getId();
|
||||
if (newItemId != null && oldIdMap.containsKey(newItemId)) {
|
||||
// 有ID且原数据存在 → 修改
|
||||
updateList.add(newItem);
|
||||
} else {
|
||||
// 无ID或原数据不存在 → 新增
|
||||
addList.add(newItem);
|
||||
}
|
||||
}
|
||||
|
||||
// 7. 执行删除操作
|
||||
if (!deleteIds.isEmpty()) {
|
||||
boolean deleteSuccess = docStatisticsDefinitionOptionService.removeByIds(deleteIds);
|
||||
if (!deleteSuccess) {
|
||||
return R.fail("统计项选项删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
// 8. 执行修改操作
|
||||
if (!updateList.isEmpty()) {
|
||||
boolean updateSuccess = docStatisticsDefinitionOptionService.updateBatchById(updateList);
|
||||
if (!updateSuccess) {
|
||||
return R.fail("统计项选项更新失败");
|
||||
}
|
||||
}
|
||||
|
||||
// 9. 执行新增操作
|
||||
if (!addList.isEmpty()) {
|
||||
boolean addSuccess = docStatisticsDefinitionOptionService.saveBatch(addList);
|
||||
if (!addSuccess) {
|
||||
return R.fail("统计项选项新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok("统计项选项更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单个统计项选项
|
||||
*
|
||||
* @param id 选项ID
|
||||
*/
|
||||
@Override
|
||||
public R<?> deleteDocStatisticsDefinitionOptionById(Long id) {
|
||||
if (id == null) {
|
||||
return R.fail("统计项选项ID为空,请选择要删除的统计项选项");
|
||||
}
|
||||
|
||||
// 先校验数据是否存在
|
||||
DocStatisticsDefinitionOption existingOption = docStatisticsDefinitionOptionService.getById(id);
|
||||
if (existingOption == null) {
|
||||
return R.fail("统计项选项不存在,删除失败");
|
||||
}
|
||||
// 执行删除
|
||||
boolean deleteSuccess = docStatisticsDefinitionOptionService.removeById(id);
|
||||
if (deleteSuccess) {
|
||||
return R.ok("统计项选项删除成功");
|
||||
} else {
|
||||
return R.fail("统计项选项删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据统计定义ID查询选项列表
|
||||
*
|
||||
* @param docStatisticsDefinitionId 统计定义ID
|
||||
*/
|
||||
@Override
|
||||
public DocStatisticsDefinitionOptionList getDocStatisticsDefinitionOptionByDefinitionId(Long docStatisticsDefinitionId) {
|
||||
|
||||
// 修复原查询条件错误:原逻辑用ID查ID,改为用统计定义ID查关联选项
|
||||
LambdaQueryWrapper<DocStatisticsDefinitionOption> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(DocStatisticsDefinitionOption::getDocStatisticsDefinitionId, docStatisticsDefinitionId)
|
||||
.orderByAsc(DocStatisticsDefinitionOption::getDisplayOrder); // 按显示顺序排序
|
||||
|
||||
List<DocStatisticsDefinitionOption> optionList = docStatisticsDefinitonOptionMapper.selectList(queryWrapper);
|
||||
if (optionList == null || optionList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
// 实体转DTO
|
||||
List<DocStatisticsDefinitionOptionDto> dtoList = new ArrayList<>();
|
||||
for (DocStatisticsDefinitionOption option : optionList) {
|
||||
DocStatisticsDefinitionOptionDto dto = new DocStatisticsDefinitionOptionDto();
|
||||
dto.setId(option.getId());
|
||||
dto.setOption(option.getOption());
|
||||
dto.setDisplayOrder(option.getDisplayOrder());
|
||||
dtoList.add(dto);
|
||||
}
|
||||
|
||||
// 封装返回结果
|
||||
DocStatisticsDefinitionOptionList resultList = new DocStatisticsDefinitionOptionList();
|
||||
resultList.setDocStatisticsDefinitionId(docStatisticsDefinitionId);
|
||||
resultList.setOptions(dtoList);
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文档模板 统计项选项列表
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getDocStatisticsDefinitionOptionList() {
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -78,29 +79,6 @@ public class DocStatisticsDefinitionController {
|
||||
public R<?> deleteDocStatisticsDefinition(Long id) {
|
||||
return docStatisticsDefinitionAppService.deleteDocStatisticsDefinition(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取统计定义详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDocStatisticsDefinitionById")
|
||||
public R<?> getDocStatisticsDefinitionById(Long id) {
|
||||
return docStatisticsDefinitionAppService.getDocStatisticsDefinitionById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取统计定义详情
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDocStatisticsDefinitionByCode")
|
||||
public R<?> getDocStatisticsDefinitionByCode(String code) {
|
||||
return docStatisticsDefinitionAppService.getDocStatisticsDefinitionByCode(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询列表-不包含options
|
||||
*
|
||||
@@ -116,9 +94,30 @@ public class DocStatisticsDefinitionController {
|
||||
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||
return docStatisticsDefinitionAppService.getPageList(pageNo, pageSize, searchKey, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文档统计定义选项列表并按指定格式返回
|
||||
* 获取文档统计定义列表-不包含options,即字典数据
|
||||
*
|
||||
* @param isStatistics 文档统计定义是否启用 0:不统计 1:统计 可不传
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getList")
|
||||
public R<?> getList(Integer isStatistics){
|
||||
List<DocStatisticsDefinitionDto> list = docStatisticsDefinitionAppService.getList(isStatistics);
|
||||
return R.ok(list);
|
||||
}
|
||||
/**
|
||||
* 获取文档统计定义列表(包含options,即字典数据)
|
||||
*
|
||||
* @param isStatistics 文档统计定义是否启用 0:不统计 1:统计 可不传
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getListWithOptionList")
|
||||
public R<?>getListWithOptionList(Integer isStatistics){
|
||||
List<DocStatisticsDefinitionDto> list = docStatisticsDefinitionAppService.getListWithOptionList(isStatistics);
|
||||
return R.ok(list);
|
||||
}
|
||||
/**
|
||||
* 获取文档统计定义选项列表并按指定格式返回-已作废
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
@@ -1,25 +0,0 @@
|
||||
package com.openhis.web.document.controller;
|
||||
|
||||
import com.openhis.web.document.appservice.IDocRecordAppService;
|
||||
import com.openhis.web.document.appservice.IDocStatisticsDefinitionOptionAppService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 文文统计选项 controller
|
||||
*
|
||||
* @author wanghaiming
|
||||
* @date 2025-08-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/document/statisticsOption")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class DocStatisticsOptionController {
|
||||
|
||||
private final IDocStatisticsDefinitionOptionAppService docStatisticsDefinitionOptionAppService;
|
||||
|
||||
|
||||
}
|
@@ -1,5 +1,7 @@
|
||||
package com.openhis.web.document.dto;
|
||||
|
||||
import com.core.common.annotation.Excel;
|
||||
import com.core.common.core.domain.entity.SysDictData;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
@@ -48,9 +50,16 @@ public class DocStatisticsDefinitionDto {
|
||||
*/
|
||||
private Integer displayOrder;
|
||||
|
||||
/*
|
||||
统计类型定义选项值
|
||||
*/
|
||||
private DocStatisticsDefinitionOptionList optionList;
|
||||
private String defaultValue;
|
||||
|
||||
// /*
|
||||
// 统计类型定义选项值
|
||||
// */
|
||||
private List<SysDictData> optionList;
|
||||
/** 字典名称 */
|
||||
private String dictName;
|
||||
|
||||
/** 字典类型 */
|
||||
private String dictType;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,11 @@
|
||||
package com.openhis.web.externalintegration.appservice;
|
||||
|
||||
/**
|
||||
* BPC商户接口Service接口
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
public interface IBankPosCloudAppService {
|
||||
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.openhis.web.externalintegration.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
|
||||
/**
|
||||
* 食源性疾病病例数据智能采集Service接口
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
public interface IFoodborneAcquisitionAppService {
|
||||
|
||||
/**
|
||||
* 是否是食源性诊断
|
||||
*
|
||||
* @param encounterId 就诊ID
|
||||
* @return 是否
|
||||
*/
|
||||
R<?> isFoodDiseasesNew(Long encounterId);
|
||||
}
|
@@ -0,0 +1,418 @@
|
||||
package com.openhis.web.externalintegration.appservice.impl;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.enums.TenantOptionDict;
|
||||
import com.core.web.util.TenantOptionUtil;
|
||||
import com.openhis.web.externalintegration.appservice.IBankPosCloudAppService;
|
||||
import com.openhis.web.externalintegration.dto.BpcTransactionRequestDto;
|
||||
import com.openhis.web.externalintegration.dto.BpcTransactionResponseDto;
|
||||
import com.openhis.web.externalintegration.enums.BpcPayType;
|
||||
import com.openhis.web.externalintegration.enums.BpcTranType;
|
||||
import com.openhis.web.externalintegration.utils.BpcHttpUtil;
|
||||
import com.openhis.web.externalintegration.utils.BpcTraceNoGenerator;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* BPC商户接口Service业务层处理
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class BankPosCloudAppServiceImpl implements IBankPosCloudAppService {
|
||||
|
||||
/**
|
||||
* 被扫消费
|
||||
*
|
||||
* @param txnAmt 交易金额
|
||||
* @param merTradeNo 商户系统订单号
|
||||
* @param scanCode 二维码信息
|
||||
* @param posNo 设备终端编号
|
||||
* @return 结果
|
||||
*/
|
||||
public R<?> processConsumerScan(String txnAmt, String merTradeNo, String scanCode, String posNo) {
|
||||
// 参数验证
|
||||
if (StringUtils.isEmpty(txnAmt)) {
|
||||
return R.fail("交易金额不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(merTradeNo)) {
|
||||
return R.fail("商户系统订单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(scanCode)) {
|
||||
return R.fail("二维码信息不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(posNo)) {
|
||||
return R.fail("设备终端编号不能为空");
|
||||
}
|
||||
// 作成请求参数
|
||||
BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto()
|
||||
// 交易类型,被扫消费
|
||||
.setTranType(BpcTranType.C.getValue())
|
||||
// 交易金额
|
||||
.setTxnAmt(txnAmt)
|
||||
// 商户系统订单号
|
||||
.setMerTradeNo(merTradeNo)
|
||||
// 二维码信息
|
||||
.setScanCode(scanCode)
|
||||
// 设备终端编号
|
||||
.setPosNo(posNo);
|
||||
log.info("【BPC被扫消费】,交易金额:{},商户系统订单号:{},二维码信息:{},设备终端编号:{}", txnAmt, merTradeNo, scanCode, posNo);
|
||||
// 发起交易请求
|
||||
return submitTransactionRequest(requestDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 主扫下单
|
||||
*
|
||||
* @param txnAmt 交易金额
|
||||
* @param merTradeNo 商户系统订单号
|
||||
* @param posNo 设备终端编号
|
||||
* @return 结果
|
||||
*/
|
||||
public R<?> createMerchantScanOrder(String txnAmt, String merTradeNo, String posNo) {
|
||||
// 参数验证
|
||||
if (StringUtils.isEmpty(txnAmt)) {
|
||||
return R.fail("交易金额不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(merTradeNo)) {
|
||||
return R.fail("商户系统订单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(posNo)) {
|
||||
return R.fail("设备终端编号不能为空");
|
||||
}
|
||||
// 作成请求参数
|
||||
BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto()
|
||||
// 交易类型,主扫下单
|
||||
.setTranType(BpcTranType.F.getValue())
|
||||
// 交易金额
|
||||
.setTxnAmt(txnAmt)
|
||||
// 商户系统订单号
|
||||
.setMerTradeNo(merTradeNo)
|
||||
// 设备终端编号
|
||||
.setPosNo(posNo);
|
||||
log.info("【BPC主扫下单】,交易金额:{},商户系统订单号:{},设备终端编号:{}", txnAmt, merTradeNo, posNo);
|
||||
// 发起交易请求
|
||||
return submitTransactionRequest(requestDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 消费订单查询
|
||||
*
|
||||
* @param merTradeNo 商户系统订单号
|
||||
* @param tradeNo 原交易订单号
|
||||
* @param posNo 设备终端编号
|
||||
* @return 结果
|
||||
*/
|
||||
public R<?> queryPaymentOrder(String merTradeNo, String tradeNo, String posNo) {
|
||||
// 参数验证
|
||||
if (StringUtils.isEmpty(merTradeNo)) {
|
||||
return R.fail("商户系统订单号不能为空");
|
||||
}
|
||||
// if (StringUtils.isEmpty(tradeNo)) {
|
||||
// return R.fail("原交易订单号不能为空");
|
||||
// }
|
||||
if (StringUtils.isEmpty(posNo)) {
|
||||
return R.fail("设备终端编号不能为空");
|
||||
}
|
||||
// 作成请求参数
|
||||
BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto()
|
||||
// 交易类型,支付结果查询
|
||||
.setTranType(BpcTranType.G.getValue())
|
||||
// 商户系统订单号
|
||||
.setMerTradeNo(merTradeNo)
|
||||
// 原交易订单号
|
||||
.setTradeNo(tradeNo)
|
||||
// 设备终端编号
|
||||
.setPosNo(posNo);
|
||||
log.info("【BPC消费订单查询】,商户系统订单号:{},原交易订单号:{},设备终端编号:{}", merTradeNo, tradeNo, posNo);
|
||||
// 发起交易请求
|
||||
return submitTransactionRequest(requestDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭订单
|
||||
*
|
||||
* @param merTradeNo 商户系统订单号
|
||||
* @param tradeNo 原交易订单号
|
||||
* @param posNo 设备终端编号
|
||||
* @return 结果
|
||||
*/
|
||||
public R<?> closeOrder(String merTradeNo, String tradeNo, String posNo) {
|
||||
// 参数验证
|
||||
if (StringUtils.isEmpty(merTradeNo)) {
|
||||
return R.fail("商户系统订单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(tradeNo)) {
|
||||
return R.fail("原交易订单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(posNo)) {
|
||||
return R.fail("设备终端编号不能为空");
|
||||
}
|
||||
// 作成请求参数
|
||||
BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto()
|
||||
// 交易类型,关闭订单
|
||||
.setTranType(BpcTranType.S.getValue())
|
||||
// 商户系统订单号
|
||||
.setMerTradeNo(merTradeNo)
|
||||
// 原交易订单号
|
||||
.setTradeNo(tradeNo)
|
||||
// 设备终端编号
|
||||
.setPosNo(posNo);
|
||||
log.info("【BPC关闭订单】,商户系统订单号:{},原交易订单号:{},设备终端编号:{}", merTradeNo, tradeNo, posNo);
|
||||
// 发起交易请求
|
||||
return submitTransactionRequest(requestDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请退货
|
||||
*
|
||||
* @param txnAmt 交易金额
|
||||
* @param vfTradeNo 退款退订定金单号
|
||||
* @param merTradeNo 商户系统订单号
|
||||
* @param tradeNo 原交易订单号
|
||||
* @param posNo 设备终端编号
|
||||
* @return 结果
|
||||
*/
|
||||
public R<?> applyForRefund(String txnAmt, String vfTradeNo, String merTradeNo, String tradeNo, String posNo) {
|
||||
// 参数验证
|
||||
if (StringUtils.isEmpty(txnAmt)) {
|
||||
return R.fail("交易金额不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(vfTradeNo)) {
|
||||
return R.fail("退款退订定金单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(merTradeNo)) {
|
||||
return R.fail("商户系统订单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(tradeNo)) {
|
||||
return R.fail("原交易订单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(posNo)) {
|
||||
return R.fail("设备终端编号不能为空");
|
||||
}
|
||||
// 作成请求参数
|
||||
BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto()
|
||||
// 交易类型,退货
|
||||
.setTranType(BpcTranType.R.getValue())
|
||||
// 交易金额
|
||||
.setTxnAmt(txnAmt)
|
||||
// 退款退订定金单号
|
||||
.setVfTradeNo(vfTradeNo)
|
||||
// 商户系统订单号
|
||||
.setMerTradeNo(merTradeNo)
|
||||
// 原交易订单号
|
||||
.setTradeNo(tradeNo)
|
||||
// 设备终端编号
|
||||
.setPosNo(posNo);
|
||||
log.info("【BPC申请退货】,交易金额:{},退款退订定金单号:{},商户系统订单号:{},原交易订单号:{},设备终端编号:{}", txnAmt, vfTradeNo, merTradeNo, tradeNo,
|
||||
posNo);
|
||||
// 发起交易请求
|
||||
return submitTransactionRequest(requestDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退货订单
|
||||
*
|
||||
* @param vfTradeNo 退款退订定金单号
|
||||
* @param posNo 设备终端编号
|
||||
* @return 结果
|
||||
*/
|
||||
public R<?> queryRefundOrder(String vfTradeNo, String posNo) {
|
||||
// 参数验证
|
||||
if (StringUtils.isEmpty(vfTradeNo)) {
|
||||
return R.fail("退款退订定金单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(posNo)) {
|
||||
return R.fail("设备终端编号不能为空");
|
||||
}
|
||||
// 作成请求参数
|
||||
BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto()
|
||||
// 交易类型,退款结果查询
|
||||
.setTranType(BpcTranType.J.getValue())
|
||||
// 退款退订定金单号
|
||||
.setVfTradeNo(vfTradeNo)
|
||||
// 设备终端编号
|
||||
.setPosNo(posNo);
|
||||
log.info("【BPC查询退货订单】,退款退订定金单号:{}", vfTradeNo);
|
||||
// 发起交易请求
|
||||
return submitTransactionRequest(requestDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 消费撤销
|
||||
*
|
||||
* @param txnAmt 交易金额
|
||||
* @param vfTradeNo 退款退订定金单号
|
||||
* @param merTradeNo 商户系统订单号
|
||||
* @param tradeNo 原交易订单号
|
||||
* @param posNo 设备终端编号
|
||||
* @return 结果
|
||||
*/
|
||||
public R<?> reversePayment(String txnAmt, String vfTradeNo, String merTradeNo, String tradeNo, String posNo) {
|
||||
// 参数验证
|
||||
if (StringUtils.isEmpty(txnAmt)) {
|
||||
return R.fail("交易金额不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(vfTradeNo)) {
|
||||
return R.fail("退款退订定金单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(merTradeNo)) {
|
||||
return R.fail("商户系统订单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(tradeNo)) {
|
||||
return R.fail("原交易订单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(posNo)) {
|
||||
return R.fail("设备终端编号不能为空");
|
||||
}
|
||||
// 作成请求参数
|
||||
BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto()
|
||||
// 交易类型,消费撤销
|
||||
.setTranType(BpcTranType.D.getValue())
|
||||
// 交易金额
|
||||
.setTxnAmt(txnAmt)
|
||||
// 退款退订定金单号
|
||||
.setVfTradeNo(vfTradeNo)
|
||||
// 商户系统订单号
|
||||
.setMerTradeNo(merTradeNo)
|
||||
// 原交易订单号
|
||||
.setTradeNo(tradeNo)
|
||||
// 设备终端编号
|
||||
.setPosNo(posNo);
|
||||
log.info("【BPC消费撤销】,交易金额:{},退款退订定金单号:{},商户系统订单号:{},原交易订单号:{},设备终端编号:{}", txnAmt, vfTradeNo, merTradeNo, tradeNo,
|
||||
posNo);
|
||||
// 发起交易请求
|
||||
return submitTransactionRequest(requestDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询撤销订单
|
||||
*
|
||||
* @param merTradeNo 商户系统订单号
|
||||
* @param posNo 设备终端编号
|
||||
* @return 结果
|
||||
*/
|
||||
public R<?> queryReversalOrder(String merTradeNo, String posNo) {
|
||||
// 参数验证
|
||||
if (StringUtils.isEmpty(merTradeNo)) {
|
||||
return R.fail("商户系统订单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(posNo)) {
|
||||
return R.fail("设备终端编号不能为空");
|
||||
}
|
||||
// 作成请求参数
|
||||
BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto()
|
||||
// 交易类型,撤销结果查询
|
||||
.setTranType(BpcTranType.Z.getValue())
|
||||
// 商户系统订单号
|
||||
.setMerTradeNo(merTradeNo)
|
||||
// 设备终端编号
|
||||
.setPosNo(posNo);
|
||||
log.info("【BPC查询撤销订单】,商户系统订单号:{},设备终端编号:{}", merTradeNo, posNo);
|
||||
// 发起交易请求
|
||||
return submitTransactionRequest(requestDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 银行卡退货功能
|
||||
*
|
||||
* @param txnAmt 交易金额
|
||||
* @param pan 银行卡号
|
||||
* @param vfTradeNo 退款退订定金单号
|
||||
* @param posNo 设备终端编号
|
||||
* @return 结果
|
||||
*/
|
||||
public R<?> processCardRefund(String txnAmt, String pan, String vfTradeNo, String posNo) {
|
||||
// 参数验证
|
||||
if (StringUtils.isEmpty(txnAmt)) {
|
||||
return R.fail("交易金额不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(pan)) {
|
||||
return R.fail("银行卡号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(vfTradeNo)) {
|
||||
return R.fail("退款退订定金单号不能为空");
|
||||
}
|
||||
if (StringUtils.isEmpty(posNo)) {
|
||||
return R.fail("设备终端编号不能为空");
|
||||
}
|
||||
// 作成请求参数
|
||||
BpcTransactionRequestDto requestDto = new BpcTransactionRequestDto()
|
||||
// 交易类型,退货
|
||||
.setTranType(BpcTranType.R.getValue())
|
||||
// 交易金额
|
||||
.setTxnAmt(txnAmt)
|
||||
// 终端流水号
|
||||
.setPayType(BpcPayType.BANK_CARD.getValue())
|
||||
// 银行卡号
|
||||
.setPan(pan)
|
||||
// 退款退订定金单号
|
||||
.setVfTradeNo(vfTradeNo)
|
||||
// 设备终端编号
|
||||
.setPosNo(posNo);
|
||||
log.info("【BPC银行卡退货功能】,交易金额:{},银行卡号:{},退款退订定金单号:{},设备终端编号:{}", txnAmt, pan, vfTradeNo, posNo);
|
||||
// 发起交易请求
|
||||
return submitTransactionRequest(requestDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送交易请求
|
||||
*
|
||||
* @param requestDto 请求参数
|
||||
* @return 结果
|
||||
*/
|
||||
private R<?> submitTransactionRequest(BpcTransactionRequestDto requestDto) {
|
||||
// 验证租户配置
|
||||
String mid = TenantOptionUtil.getOptionContent(TenantOptionDict.BPC_MID);
|
||||
if (StringUtils.isEmpty(mid)) {
|
||||
return R.fail("BPC商户号未配置");
|
||||
}
|
||||
String tid = TenantOptionUtil.getOptionContent(TenantOptionDict.BPC_TID);
|
||||
if (StringUtils.isEmpty(tid)) {
|
||||
return R.fail("BPC终端号未配置");
|
||||
}
|
||||
String md5SharedSecret = TenantOptionUtil.getOptionContent(TenantOptionDict.BPC_MD5_SHARED_SECRET);
|
||||
if (StringUtils.isEmpty(md5SharedSecret)) {
|
||||
return R.fail("BPCMD5签名密钥未配置");
|
||||
}
|
||||
String requestUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.BPC_REQUEST_URL);
|
||||
if (StringUtils.isEmpty(requestUrl)) {
|
||||
return R.fail("BPC请求URL未配置");
|
||||
}
|
||||
// 生成终端流水号
|
||||
String traceNo = BpcTraceNoGenerator.nextTraceNo();
|
||||
// 设置请求终端流水号
|
||||
requestDto.setTraceNo(traceNo);
|
||||
// 设置其他固定参数
|
||||
requestDto.setMid(mid).setTid(tid);
|
||||
// 将参数转化为json字符串
|
||||
String jsonStr = JSON.toJSONString(requestDto);
|
||||
log.info("【BPC请求报文】:{}", jsonStr);
|
||||
// 发起post请求
|
||||
String postResponse;
|
||||
try {
|
||||
postResponse = BpcHttpUtil.httpPost(jsonStr, md5SharedSecret, requestUrl);
|
||||
} catch (Exception e) {
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
log.info("【BPC响应报文】:{}", postResponse);
|
||||
// 解析响应报文
|
||||
BpcTransactionResponseDto responseDto;
|
||||
try {
|
||||
responseDto = JSON.parseObject(postResponse, BpcTransactionResponseDto.class);
|
||||
if (StringUtils.isNotEmpty(responseDto.getTraceNo()) && !traceNo.equals(responseDto.getTraceNo())) {
|
||||
return R.fail("终端流水号不一致,交易失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return R.fail("报文解析失败");
|
||||
}
|
||||
// 返回响应结果
|
||||
return R.ok(responseDto);
|
||||
}
|
||||
}
|
@@ -0,0 +1,176 @@
|
||||
package com.openhis.web.externalintegration.appservice.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.enums.TenantOptionDict;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.web.util.TenantOptionUtil;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.CommonUtil;
|
||||
import com.openhis.web.externalintegration.appservice.IFoodborneAcquisitionAppService;
|
||||
import com.openhis.web.externalintegration.dto.FaSimplediseaseAddNopwParam;
|
||||
import com.openhis.web.externalintegration.mapper.FoodborneAcquisitionAppMapper;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 食源性疾病病例数据智能采集Service业务层处理
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class FoodborneAcquisitionAppServiceImpl implements IFoodborneAcquisitionAppService {
|
||||
@Autowired
|
||||
private FoodborneAcquisitionAppMapper foodborneAcquisitionAppMapper;
|
||||
|
||||
/**
|
||||
* 是否是食源性诊断
|
||||
*
|
||||
* @param encounterId 就诊ID
|
||||
* @return 是否
|
||||
*/
|
||||
@Override
|
||||
public R<?> isFoodDiseasesNew(Long encounterId) {
|
||||
// 判断食源性开关状态
|
||||
String foodborneSwitch = TenantOptionUtil.getOptionContent(TenantOptionDict.FOODBORNE_SWITCH);
|
||||
if (!Whether.YES.getCode().equals(foodborneSwitch)) {
|
||||
// 开关未开启时,返回空OK结果,跳过处理
|
||||
return R.ok();
|
||||
}
|
||||
// 判断食源性接口地址是否为空
|
||||
String foodborneApiUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.FOODBORNE_API_URL);
|
||||
if (StringUtils.isEmpty(foodborneApiUrl)) {
|
||||
return R.fail("【食源性判断接口】租户配置项「食源性接口地址」未配置");
|
||||
}
|
||||
// 判断食源性医疗机构是否为空
|
||||
String foodborneHospital = TenantOptionUtil.getOptionContent(TenantOptionDict.FOODBORNE_HOSPITAL);
|
||||
if (StringUtils.isEmpty(foodborneHospital)) {
|
||||
return R.fail("【食源性判断接口】租户配置项「食源性医疗机构」未配置");
|
||||
}
|
||||
// 判断食源性登录账号是否为空
|
||||
String foodborneUserName = TenantOptionUtil.getOptionContent(TenantOptionDict.FOODBORNE_USER_NAME);
|
||||
if (StringUtils.isEmpty(foodborneUserName)) {
|
||||
return R.fail("【食源性判断接口】租户配置项「食源性登录账号」未配置");
|
||||
}
|
||||
// 定义诊断列表参数
|
||||
List<String> diagnosisNameList = new ArrayList<>();
|
||||
|
||||
// TODO:郭睿 等待从doc_statistics表取主诉诊断
|
||||
|
||||
// 查询就诊诊断内容列表
|
||||
List<String> encounterDiagnosisConditionNameList =
|
||||
foodborneAcquisitionAppMapper.selectEncounterDiagnosisConditionNameList(encounterId);
|
||||
diagnosisNameList.addAll(encounterDiagnosisConditionNameList);
|
||||
// 判断诊断是否为空
|
||||
if (diagnosisNameList.isEmpty()) {
|
||||
return R.fail("【食源性判断接口】未找到有效诊断");
|
||||
}
|
||||
// 设置超时时间
|
||||
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(5000).setConnectionRequestTimeout(3000)
|
||||
.setSocketTimeout(30000).build();
|
||||
// 创建无视SSL验证的HttpClient
|
||||
CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig)
|
||||
.setSSLSocketFactory(CommonUtil.createIgnoreSslSocketFactory()).build();
|
||||
CloseableHttpResponse response = null;
|
||||
// 发起HTTP请求
|
||||
try {
|
||||
// 对参数值进行URL编码
|
||||
String encodedDiagnosisName =
|
||||
URLEncoder.encode(String.join(",", diagnosisNameList), StandardCharsets.UTF_8.toString());
|
||||
// 拼接完整的请求URL
|
||||
String requestUrl = foodborneApiUrl + "/isFoodDiseasesNew?diagnosisName=" + encodedDiagnosisName;
|
||||
// 创建HttpGet对象并设置URL
|
||||
HttpGet httpGet = new HttpGet(requestUrl);
|
||||
// 执行请求
|
||||
response = httpClient.execute(httpGet);
|
||||
// 获取响应
|
||||
JSONObject object =
|
||||
JSON.parseObject(EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8.toString()));
|
||||
log.info("【食源性判断接口】入参encounterId:{}返回值:{}", encounterId, object.toString());
|
||||
// 判断返回的result字段
|
||||
String result = String.valueOf(object.getInnerMap().get("result"));
|
||||
if (!"true".equals(result)) {
|
||||
// 返回不是true时,返回空OK结果,跳过处理
|
||||
return R.ok();
|
||||
}
|
||||
// 查询食源性疾病病例数据智能采集上报跳转页面所需参数
|
||||
FaSimplediseaseAddNopwParam simplediseaseAddNopwParam = foodborneAcquisitionAppMapper
|
||||
.selectSimplediseaseAddNopwParam(encounterId, AdministrativeGender.MALE.getValue(),
|
||||
AdministrativeGender.FEMALE.getValue(), EncounterType.FOLLOW_UP.getValue(),
|
||||
EncounterClass.IMP.getValue(), ParticipantType.ADMITTER.getCode());
|
||||
if (simplediseaseAddNopwParam == null) {
|
||||
return R.fail("【食源性判断接口】跳转参数查询失败");
|
||||
}
|
||||
// 返回的标识字段 fillGuid
|
||||
String fillGuid = String.valueOf(object.getInnerMap().get("fillGuid"));
|
||||
// 拼装参数,作成跳转URL
|
||||
String jumpUrl = foodborneApiUrl + "/SimplediseaseAddNopw" + "?diseaseDate="
|
||||
+ simplediseaseAddNopwParam.getDiseaseDate() + "&diseaseTreattime="
|
||||
+ simplediseaseAddNopwParam.getDiseaseTreattime() + "&outPatientNumber="
|
||||
+ URLEncoder.encode(simplediseaseAddNopwParam.getOutPatientNumber(), StandardCharsets.UTF_8.toString())
|
||||
+ "&patientName="
|
||||
+ URLEncoder.encode(simplediseaseAddNopwParam.getPatientName(), StandardCharsets.UTF_8.toString())
|
||||
+ "&diseaseSex=" + simplediseaseAddNopwParam.getDiseaseSex() + "&guarderName="
|
||||
+ URLEncoder.encode(simplediseaseAddNopwParam.getGuarderName(), StandardCharsets.UTF_8.toString())
|
||||
+ "&diseaseIsreexam=" + simplediseaseAddNopwParam.getDiseaseIsreexam() + "&diseaseIspaint="
|
||||
+ simplediseaseAddNopwParam.getDiseaseIspaint() + "&diseaseHospitalno="
|
||||
+ simplediseaseAddNopwParam.getDiseaseHospitalno() + "&identityCard="
|
||||
+ Optional.ofNullable(simplediseaseAddNopwParam.getIdentityCard()).orElse("") + "&diseaseBirthday="
|
||||
+ Optional.ofNullable(simplediseaseAddNopwParam.getDiseaseBirthday()).orElse("") + "&phoneNumber="
|
||||
+ Optional.ofNullable(simplediseaseAddNopwParam.getPhoneNumber()).orElse("") + "&workUnit="
|
||||
+ URLEncoder.encode(Optional.ofNullable(simplediseaseAddNopwParam.getWorkUnit()).orElse(""),
|
||||
StandardCharsets.UTF_8.toString())
|
||||
+ "&deathDate=" + Optional.ofNullable(simplediseaseAddNopwParam.getDeathDate()).orElse("")
|
||||
+ "&fillingDoctorName="
|
||||
+ URLEncoder.encode(Optional.ofNullable(simplediseaseAddNopwParam.getFillingDoctorName()).orElse(""),
|
||||
StandardCharsets.UTF_8.toString())
|
||||
+ "&medicalInstiSeHospital=" + foodborneHospital + "&diseaseHometown=" + "&diseaseProvince="
|
||||
+ URLEncoder.encode(Optional.ofNullable(simplediseaseAddNopwParam.getDiseaseProvince()).orElse(""),
|
||||
StandardCharsets.UTF_8.toString())
|
||||
+ "&diseaseCity="
|
||||
+ URLEncoder.encode(Optional.ofNullable(simplediseaseAddNopwParam.getDiseaseCity()).orElse(""),
|
||||
StandardCharsets.UTF_8.toString())
|
||||
+ "&diseaseDistrict="
|
||||
+ URLEncoder.encode(Optional.ofNullable(simplediseaseAddNopwParam.getDiseaseDistrict()).orElse(""),
|
||||
StandardCharsets.UTF_8.toString())
|
||||
+ "&diseaseAddress="
|
||||
+ URLEncoder.encode(Optional.ofNullable(simplediseaseAddNopwParam.getDiseaseAddress()).orElse(""),
|
||||
StandardCharsets.UTF_8.toString())
|
||||
+ "&diseaseOccupation=23009012" + "&uName=" + foodborneUserName + "&fillGuid=" + fillGuid;
|
||||
// 返回非空OK结果,并携带跳转URL
|
||||
return R.ok(jumpUrl);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return R.fail("【食源性判断接口】发生异常:" + e.getMessage());
|
||||
} finally {
|
||||
if (response != null) {
|
||||
try {
|
||||
response.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,35 @@
|
||||
package com.openhis.web.externalintegration.controller;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.externalintegration.appservice.IFoodborneAcquisitionAppService;
|
||||
|
||||
/**
|
||||
* 食源性疾病病例数据智能采集Controller
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/external-integration/foodborne-acquisition")
|
||||
public class FoodborneAcquisitionAppController {
|
||||
|
||||
@Autowired
|
||||
private IFoodborneAcquisitionAppService foodborneAcquisitionAppService;
|
||||
|
||||
/**
|
||||
* 是否是食源性诊断
|
||||
*
|
||||
* @param encounterId 就诊ID
|
||||
* @return 是否
|
||||
*/
|
||||
@GetMapping("/is-food-diseases-new")
|
||||
R<?> isFoodDiseasesNew(@RequestParam("encounterId") Long encounterId) {
|
||||
return foodborneAcquisitionAppService.isFoodDiseasesNew(encounterId);
|
||||
}
|
||||
}
|
@@ -0,0 +1,179 @@
|
||||
package com.openhis.web.externalintegration.dto;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 【BPC】数据元
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
@Data
|
||||
public class BpcDataElementDto {
|
||||
|
||||
/**
|
||||
* 设备终端编号:设备的唯一编号
|
||||
*/
|
||||
@Length(max = 10)
|
||||
@JSONField(name = "posNo")
|
||||
private String posNo;
|
||||
|
||||
/**
|
||||
* 终端实时经纬度信息:格式为为纬度/经度,+表示北纬、东经,-表示南纬、西 经。例:+37.12/-121.213。例:+37.12/-121.213
|
||||
*/
|
||||
@Length(max = 30)
|
||||
@JSONField(name = "posGa")
|
||||
private String posGa;
|
||||
|
||||
/**
|
||||
* 交易类型:(枚举TranType)
|
||||
*/
|
||||
@Length(max = 1)
|
||||
@JSONField(name = "tranType")
|
||||
private String tranType;
|
||||
|
||||
/**
|
||||
* 交易金额:以分为单位的交易金额
|
||||
*/
|
||||
@Length(max = 12)
|
||||
@JSONField(name = "txnAmt")
|
||||
private String txnAmt;
|
||||
|
||||
/**
|
||||
* 支付方式:(枚举PayType)
|
||||
*/
|
||||
@Length(max = 4)
|
||||
@JSONField(name = "payType")
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 交易流水号
|
||||
*/
|
||||
@Length(max = 32)
|
||||
@JSONField(name = "sysTrace")
|
||||
private String sysTrace;
|
||||
|
||||
/**
|
||||
* 原交易流水号:支付结果查询、退货、退货结果查询交易需要传入
|
||||
*/
|
||||
@Length(max = 32)
|
||||
@JSONField(name = "orgSysTrace")
|
||||
private String orgSysTrace;
|
||||
|
||||
/**
|
||||
* 原交易时间:(yyyyMMddHHmmss)该字段为消费成功后返回的日期时间,在做退货、退货结果查询时,需要传入原消费交易的日期时间
|
||||
*/
|
||||
@Length(max = 14)
|
||||
@JSONField(name = "orgTxnTime")
|
||||
private String orgTxnTime;
|
||||
|
||||
/**
|
||||
* 二维码信息:支付二维码,扫码消费订单查询时传入
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "scanCode")
|
||||
private String scanCode;
|
||||
|
||||
/**
|
||||
* 支付订单号:扫码支付交易订单号,扫码支付退货时传入
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "tradeNo")
|
||||
private String tradeNo;
|
||||
|
||||
/**
|
||||
* 通知URL:交易延时响应时的交易结果通知URL
|
||||
*/
|
||||
@Length(max = 256)
|
||||
@JSONField(name = "retUrl")
|
||||
private String retUrl;
|
||||
|
||||
/**
|
||||
* 清算商户号
|
||||
*/
|
||||
@Length(max = 15)
|
||||
@JSONField(name = "mid")
|
||||
private String mid;
|
||||
|
||||
/**
|
||||
* 商户名称
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "merName")
|
||||
private String merName;
|
||||
|
||||
/**
|
||||
* 终端号
|
||||
*/
|
||||
@Length(max = 8)
|
||||
@JSONField(name = "tid")
|
||||
private String tid;
|
||||
|
||||
/**
|
||||
* 商户系统订单号:由商户系统产生
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "merTradeNo")
|
||||
private String merTradeNo;
|
||||
|
||||
/**
|
||||
* 银行优惠金额
|
||||
*/
|
||||
@Length(max = 12)
|
||||
@JSONField(name = "discountAmt")
|
||||
private String discountAmt;
|
||||
|
||||
/**
|
||||
* 收款方备注
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "txtRemarks")
|
||||
private String txtRemarks;
|
||||
|
||||
/**
|
||||
* 实名认证标志:(枚举RealNameAuthFlag)
|
||||
*/
|
||||
@Length(max = 1)
|
||||
@JSONField(name = "realNameAuth")
|
||||
private String realNameAuth;
|
||||
|
||||
/**
|
||||
* 付款人姓名:当realNameAuth为1时必填
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "payerName")
|
||||
private String payerName;
|
||||
|
||||
/**
|
||||
* 付款人身份证件类型:(枚举PayerIdType)当realNameAuth为1时必填
|
||||
*/
|
||||
@Length(max = 2)
|
||||
@JSONField(name = "payerIDType")
|
||||
private String payerIdType;
|
||||
|
||||
/**
|
||||
* 付款人身份证件号码:当realNameAuth为1时必填
|
||||
*/
|
||||
@Length(max = 20)
|
||||
@JSONField(name = "payerID")
|
||||
private String payerId;
|
||||
|
||||
/**
|
||||
* 发起方IP地址:支持IPv6格式
|
||||
*/
|
||||
@Length(max = 40)
|
||||
@JSONField(name = "IP")
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 终端设备类型:(枚举DeviceType)
|
||||
*/
|
||||
@Length(max = 2)
|
||||
@JSONField(name = "deviceType")
|
||||
private String deviceType;
|
||||
|
||||
}
|
@@ -0,0 +1,113 @@
|
||||
package com.openhis.web.externalintegration.dto;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 【BPC】主扫支付结果通知
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
@Data
|
||||
public class BpcPaymentScanNotifyDto {
|
||||
|
||||
/**
|
||||
* 商户系统订单号:申码交易商户系统订单号
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "merTradeNo")
|
||||
private String merTradeNo;
|
||||
|
||||
/**
|
||||
* 原交易订单号:银行订单号
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "orgSysTrace")
|
||||
private String orgSysTrace;
|
||||
|
||||
/**
|
||||
* 银行交易日期
|
||||
*/
|
||||
@JSONField(name = "bankDate")
|
||||
private String bankDate;
|
||||
|
||||
/**
|
||||
* 银行交易时间
|
||||
*/
|
||||
@JSONField(name = "bankTime")
|
||||
private String bankTime;
|
||||
|
||||
/**
|
||||
* 原申码订单号
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "oldQrOrderNo")
|
||||
private String oldQrOrderNo;
|
||||
|
||||
/**
|
||||
* 原商户号
|
||||
*/
|
||||
@JSONField(name = "oldTermId")
|
||||
private String oldTermId;
|
||||
|
||||
/**
|
||||
* 原支付方式
|
||||
*/
|
||||
@JSONField(name = "oldPayType")
|
||||
private String oldPayType;
|
||||
|
||||
/**
|
||||
* 原银行交易日期
|
||||
*/
|
||||
@JSONField(name = "oldBankDate")
|
||||
private String oldBankDate;
|
||||
|
||||
/**
|
||||
* 原银行交易时间
|
||||
*/
|
||||
@JSONField(name = "oldBankTime")
|
||||
private String oldBankTime;
|
||||
|
||||
/**
|
||||
* 原交易返回码
|
||||
*/
|
||||
@JSONField(name = "oldRespCode")
|
||||
private String oldRespCode;
|
||||
|
||||
/**
|
||||
* 原交易返回信息
|
||||
*/
|
||||
@JSONField(name = "oldRespMsg")
|
||||
private String oldRespMsg;
|
||||
|
||||
/**
|
||||
* 微信交易单号:仅OldPayType=WEIX 时此域有值
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "oldTradeId")
|
||||
private String oldTradeId;
|
||||
|
||||
/**
|
||||
* 支付宝交易单号:仅OldPayType=ZFBA 时此域有值
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "oldTradeNo")
|
||||
private String oldTradeNo;
|
||||
|
||||
/**
|
||||
* 响应码:00 表示成功,其它表示失败
|
||||
*/
|
||||
@JSONField(name = "respCode")
|
||||
private String respCode;
|
||||
|
||||
/**
|
||||
* 响应码解释信息
|
||||
*/
|
||||
@JSONField(name = "respMsg")
|
||||
private String respMsg;
|
||||
|
||||
}
|
@@ -0,0 +1,224 @@
|
||||
package com.openhis.web.externalintegration.dto;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 【BPC】交易请求
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BpcTransactionRequestDto {
|
||||
|
||||
/**
|
||||
* 设备终端编号:设备的唯一编号(必填)
|
||||
*/
|
||||
@Length(max = 10)
|
||||
@JSONField(name = "posNo")
|
||||
private String posNo;
|
||||
|
||||
/**
|
||||
* 终端实时经纬度信息:(最新,甲方确认可以不传)tranType为C时必填,格式为为纬度/经度,+表示北纬、东经,-表示南纬、西 经。例:+37.12/-121.213。例:+37.12/-121.213
|
||||
*/
|
||||
@Length(max = 30)
|
||||
@JSONField(name = "posGa")
|
||||
private String posGa;
|
||||
|
||||
/**
|
||||
* 交易类型:(枚举TranType)
|
||||
*/
|
||||
@Length(max = 1)
|
||||
@JSONField(name = "tranType")
|
||||
private String tranType;
|
||||
|
||||
/**
|
||||
* 交易金额:以分为单位的交易金额
|
||||
*/
|
||||
@Length(max = 12)
|
||||
@JSONField(name = "txnAmt")
|
||||
private String txnAmt;
|
||||
|
||||
/**
|
||||
* 银行优惠金额:撤销、退货交易时填写原消费交易的优惠金额,可以不填
|
||||
*/
|
||||
@Length(max = 12)
|
||||
@JSONField(name = "discountAmt")
|
||||
private String discountAmt;
|
||||
|
||||
/**
|
||||
* 支付方式:(枚举PayType)当tranType为F时,payType不填写返回聚合码scanCode填写则返回订单数据payData(部分收单行支持)
|
||||
*/
|
||||
@Length(max = 4)
|
||||
@JSONField(name = "payType")
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 二维码信息:被扫交易,采集到的手机支付二维码信息,主扫交易该字段为空
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "scanCode")
|
||||
private String scanCode;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
@Length(max = 15)
|
||||
@JSONField(name = "mid")
|
||||
private String mid;
|
||||
|
||||
/**
|
||||
* 终端编号(可以不填)
|
||||
*/
|
||||
@Length(max = 8)
|
||||
@JSONField(name = "tid")
|
||||
private String tid;
|
||||
|
||||
/**
|
||||
* 终端流水号:终端号系统跟踪号,从 000001 开始到 999999 循环,应答报文原值返回,客户端收到应答报文需要验证traceNo字段值,如果不一致则丢包交易失败
|
||||
*/
|
||||
@Length(max = 6)
|
||||
@JSONField(name = "traceNo")
|
||||
private String traceNo;
|
||||
|
||||
/**
|
||||
* 商品名称:自定义商品名称(可以不填,默认为“商品”)
|
||||
*/
|
||||
@Length(max = 200)
|
||||
@JSONField(name = "goodsName")
|
||||
private String goodsName;
|
||||
|
||||
/**
|
||||
* 原交易订单号:银行订单号(可以不填)
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "tradeNo")
|
||||
private String tradeNo;
|
||||
|
||||
/**
|
||||
* 原交易日期时间:(yyyyMMddHHmmss)撤销、退货时填写原消费交易返回的时间日期
|
||||
*/
|
||||
@Length(max = 14)
|
||||
@JSONField(name = "orgTxnTime")
|
||||
private String orgTxnTime;
|
||||
|
||||
/**
|
||||
* 商户系统订单号:商户系统订单号,消费交易、定金交易,商户生成唯一订单号(如果不能生成,可以向扫码平台申请商户系统订单号);支付结果查询、定金支付结果查询、消费撤销、
|
||||
* 消费撤销结果查询、退货交易需要传入原消费或定金交易商户系统订单号;退订、定金确认,填写原定金交易订单号;定金确认撤销、定金确认撤销结果查询,填写定金确认订单号
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "merTradeNo")
|
||||
private String merTradeNo;
|
||||
|
||||
/**
|
||||
* 退款退订定金单号:商户系统退货、退订、定金确认订单号(如果不能生成,可以向扫码平台申请商户系统订单号);退货结果查询、退订结果查询、定金确认查询,需要传入原商户系统退货单号
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "vfTradeNo")
|
||||
private String vfTradeNo;
|
||||
|
||||
/**
|
||||
* 有效时间:主扫二维码有效时间(可以不填,部分收单行不支持)
|
||||
*/
|
||||
@Length(max = 6)
|
||||
@JSONField(name = "qrValidTime")
|
||||
private String qrValidTime;
|
||||
|
||||
/**
|
||||
* 通知URL:主扫交易延时响应时的交易结果通知URL(可以不填)
|
||||
*/
|
||||
@Length(max = 256)
|
||||
@JSONField(name = "retUrl")
|
||||
private String retUrl;
|
||||
|
||||
/**
|
||||
* 支付成功回调地址:主扫交易当使用微信和支付宝支付成功后,前端可通过此地址回调到商户提供的地址。注意:地址必须以 HTTP 或 HTTPS 开头,且 HTTPS 必须为颁发的有效证书。
|
||||
* 回调地址不支持换行符等不可见字符以及特殊字符(可以不填,部分收单行不支持)微信需要对接微信点金计划,详情请参考微信相关文档
|
||||
*/
|
||||
@Length(max = 128)
|
||||
@JSONField(name = "callBackUrl")
|
||||
private String callBackUrl;
|
||||
|
||||
/**
|
||||
* 商户应用ID:当tranType为F时,payType 值为ZFBA或WEIX时需填写
|
||||
*/
|
||||
@Length(max = 32)
|
||||
@JSONField(name = "subAppId")
|
||||
private String subAppId;
|
||||
|
||||
/**
|
||||
* 商户用户openId:当tranType为F时,payType 值为ZFBA或WEIX时需填写。当上送wxApiType字段时,可以不用填写。
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "subOpenId")
|
||||
private String subOpenId;
|
||||
|
||||
/**
|
||||
* 微信API类型:当业务场景为微信APP支付时,填写固定值APP,其余交易不送该字段
|
||||
*/
|
||||
@Length(max = 10)
|
||||
@JSONField(name = "wxApiType")
|
||||
private String wxApiType;
|
||||
|
||||
/**
|
||||
* 收款方备注
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "txtRemarks")
|
||||
private String txtRemarks;
|
||||
|
||||
/**
|
||||
* 实名标志:(枚举RealNameAuthFlag)
|
||||
*/
|
||||
@Length(max = 1)
|
||||
@JSONField(name = "realNameAuth")
|
||||
private String realNameAuth;
|
||||
|
||||
/**
|
||||
* 付款人姓名:当realNameAuth为1时必填
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "payerName")
|
||||
private String payerName;
|
||||
|
||||
/**
|
||||
* 付款人身份证件类型:当realNameAuth为1时必填
|
||||
*/
|
||||
@Length(max = 2)
|
||||
@JSONField(name = "payerIDType")
|
||||
private String payerIdType;
|
||||
|
||||
/**
|
||||
* 付款人身份证件号码:当realNameAuth为1时必填
|
||||
*/
|
||||
@Length(max = 20)
|
||||
@JSONField(name = "payerID")
|
||||
private String payerId;
|
||||
|
||||
/**
|
||||
* 发起方IP地址:支持IPv6格式
|
||||
*/
|
||||
@Length(max = 40)
|
||||
@JSONField(name = "IP")
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 终端类型:(枚举DeviceType)
|
||||
*/
|
||||
@Length(max = 2)
|
||||
@JSONField(name = "deviceType")
|
||||
private String deviceType;
|
||||
|
||||
/**
|
||||
* 银行卡号
|
||||
*/
|
||||
@JSONField(name = "pan")
|
||||
private String pan;
|
||||
|
||||
}
|
@@ -0,0 +1,158 @@
|
||||
package com.openhis.web.externalintegration.dto;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 【BPC】交易回应
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
@Data
|
||||
public class BpcTransactionResponseDto {
|
||||
|
||||
/**
|
||||
* 响应码:(枚举RespCode)00 表示成功,其它表示失败
|
||||
*/
|
||||
@Length(max = 2)
|
||||
@JSONField(name = "respCode")
|
||||
private String respCode;
|
||||
|
||||
/**
|
||||
* 响应码解释信息(需要Base64解密)
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "respMsg")
|
||||
private String respMsg;
|
||||
|
||||
/**
|
||||
* 交易类型:(枚举TranType)
|
||||
*/
|
||||
@Length(max = 1)
|
||||
@JSONField(name = "tranType")
|
||||
private String tranType;
|
||||
|
||||
/**
|
||||
* 交易金额:以分为单位的交易金额(订单总金额,同请求金额一致)
|
||||
*/
|
||||
@Length(max = 12)
|
||||
@JSONField(name = "txnAmt")
|
||||
private String txnAmt;
|
||||
|
||||
/**
|
||||
* 支付方式:(枚举PayType)
|
||||
*/
|
||||
@Length(max = 4)
|
||||
@JSONField(name = "payType")
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 终端流水号:终端号系统跟踪号,同请求报文原值返回,客户端收到应答报文需要验证traceNo字段值,需与请求报文值一致,如果不一致则丢包交易失败
|
||||
*/
|
||||
@Length(max = 6)
|
||||
@JSONField(name = "traceNo")
|
||||
private String traceNo;
|
||||
|
||||
/**
|
||||
* 交易时间:(yyyyMMddHHmmss)
|
||||
*/
|
||||
@Length(max = 14)
|
||||
@JSONField(name = "txnTime")
|
||||
private String txnTime;
|
||||
|
||||
/**
|
||||
* 支付订单号:银行返回系统订单号,需要保存该支付交易订单号
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "tradeNo")
|
||||
private String tradeNo;
|
||||
|
||||
/**
|
||||
* 第三方支付订单号
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "transNo")
|
||||
private String transNo;
|
||||
|
||||
/**
|
||||
* 商户号
|
||||
*/
|
||||
@Length(max = 15)
|
||||
@JSONField(name = "mid")
|
||||
private String mid;
|
||||
|
||||
/**
|
||||
* 商户名称
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "merName")
|
||||
private String merName;
|
||||
|
||||
/**
|
||||
* 终端号
|
||||
*/
|
||||
@Length(max = 8)
|
||||
@JSONField(name = "tid")
|
||||
private String tid;
|
||||
|
||||
/**
|
||||
* 商户系统订单号:同请求一致
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "merTradeNo")
|
||||
private String merTradeNo;
|
||||
|
||||
/**
|
||||
* 商户系统退款授权单号:同请求一致
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "vfTradeNo")
|
||||
private String vfTradeNo;
|
||||
|
||||
/**
|
||||
* 优惠金额
|
||||
*/
|
||||
@Length(max = 12)
|
||||
@JSONField(name = "discountAmt")
|
||||
private String discountAmt;
|
||||
|
||||
/**
|
||||
* 有效时间:二维码本身的有效时间,是相对时间,单位为秒,以接收方收到报文时间为起始点计时。不同类型的订单以及不同的订单状况会对应不同的默认有效时间和最大有效时间(可以为空)
|
||||
*/
|
||||
@Length(max = 8)
|
||||
@JSONField(name = "qrValidTime")
|
||||
private String qrValidTime;
|
||||
|
||||
/**
|
||||
* 二维码信息:主扫支付二维码,以二维码形式显示,手机APP扫二维码码消费
|
||||
*/
|
||||
@Length(max = 128)
|
||||
@JSONField(name = "scanCode")
|
||||
private String scanCode;
|
||||
|
||||
/**
|
||||
* 原交易类型:1、订单查询类交易填写原交易类型(被扫交易必填)2、非订单查询填写交易类型与tranType一致(可以为空)
|
||||
*/
|
||||
@Length(max = 1)
|
||||
@JSONField(name = "orgTranType")
|
||||
private String orgTranType;
|
||||
|
||||
/**
|
||||
* 原交易名称:订单查询类交易填写原交易名称,非订单查询填写交易名称(被扫交易必填)
|
||||
*/
|
||||
@Length(max = 30)
|
||||
@JSONField(name = "orgTxnName")
|
||||
private String orgTxnName;
|
||||
|
||||
/**
|
||||
* 订单数据:当tranType为F时,payType 值为ZFBA或WEIX时支付宝返回的tradeNo 或者微信返回的prepayId
|
||||
*/
|
||||
@Length(max = 64)
|
||||
@JSONField(name = "payData")
|
||||
private String payData;
|
||||
|
||||
}
|
@@ -0,0 +1,113 @@
|
||||
package com.openhis.web.externalintegration.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 【食源性】跳转页面所需参数
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Data
|
||||
public class FaSimplediseaseAddNopwParam {
|
||||
|
||||
/**
|
||||
* 【必填】发病时间:YYYY-MM-DD HH:mm
|
||||
*/
|
||||
private String diseaseDate;
|
||||
|
||||
/**
|
||||
* 【必填】就诊时间:YYYY-MM-DD HH:mm
|
||||
*/
|
||||
private String diseaseTreattime;
|
||||
|
||||
/**
|
||||
* 门诊ID号
|
||||
*/
|
||||
private String outPatientNumber;
|
||||
|
||||
/**
|
||||
* 【必填】患者姓名
|
||||
*/
|
||||
private String patientName;
|
||||
|
||||
/**
|
||||
* 【必填】患者性别:0 女 1 男
|
||||
*/
|
||||
private String diseaseSex;
|
||||
|
||||
/**
|
||||
* 监护人姓名
|
||||
*/
|
||||
private String guarderName;
|
||||
|
||||
/**
|
||||
* 【必填】是否复诊:0否 1是
|
||||
*/
|
||||
private String diseaseIsreexam;
|
||||
|
||||
/**
|
||||
* 【必填】是否住院:0否 1是
|
||||
*/
|
||||
private String diseaseIspaint;
|
||||
|
||||
/**
|
||||
* 住院号:是否住院为是时必填
|
||||
*/
|
||||
private String diseaseHospitalno;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
private String identityCard;
|
||||
|
||||
/**
|
||||
* 【必填】出生日期:YYYY-MM-DD
|
||||
*/
|
||||
private String diseaseBirthday;
|
||||
|
||||
/**
|
||||
* 【必填】联系电话
|
||||
*/
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 工作单位
|
||||
*/
|
||||
private String workUnit;
|
||||
|
||||
/**
|
||||
* 死亡时间:YYYY-MM-DD HH:mm
|
||||
*/
|
||||
private String deathDate;
|
||||
|
||||
/**
|
||||
* 接诊医生
|
||||
*/
|
||||
private String fillingDoctorName;
|
||||
|
||||
/**
|
||||
* 【必填】现住地址省
|
||||
*/
|
||||
private String diseaseProvince;
|
||||
|
||||
/**
|
||||
* 【必填】现住地址市
|
||||
*/
|
||||
private String diseaseCity;
|
||||
|
||||
/**
|
||||
* 【必填】现住地址区
|
||||
*/
|
||||
private String diseaseDistrict;
|
||||
|
||||
/**
|
||||
* 【必填】现住地址具体
|
||||
*/
|
||||
private String diseaseAddress;
|
||||
|
||||
/**
|
||||
* 【必填】职业:与国家平台编码保持一致
|
||||
*/
|
||||
private Integer diseaseOccupation;
|
||||
}
|
@@ -0,0 +1,59 @@
|
||||
package com.openhis.web.externalintegration.enums;
|
||||
|
||||
/**
|
||||
* 【BPC】支付方式
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
public enum BpcPayType {
|
||||
|
||||
/**
|
||||
* 支付宝
|
||||
*/
|
||||
ALIPAY("ZFBA", "支付宝"),
|
||||
/**
|
||||
* 微信
|
||||
*/
|
||||
WECHAT("WEIX", "微信"),
|
||||
/**
|
||||
* 银联二维码
|
||||
*/
|
||||
UNION_QR("UPAY", "银联二维码"),
|
||||
/**
|
||||
* 数字人民币
|
||||
*/
|
||||
DIGITAL_RMB("DCEP", "数字人民币"),
|
||||
/**
|
||||
* 银行卡
|
||||
*/
|
||||
BANK_CARD("0001", "银行卡");
|
||||
|
||||
private final String value;
|
||||
private final String description;
|
||||
|
||||
BpcPayType(String value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static BpcPayType getByValue(String value) {
|
||||
if (value == null || "".equals(value.trim())) {
|
||||
return null;
|
||||
}
|
||||
for (BpcPayType val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,83 @@
|
||||
package com.openhis.web.externalintegration.enums;
|
||||
|
||||
/**
|
||||
* 【BPC】付款人身份证件类型
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
public enum BpcPayerIdType {
|
||||
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
ID_CARD("0", "身份证"),
|
||||
/**
|
||||
* 护照
|
||||
*/
|
||||
PASSPORT("1", "护照"),
|
||||
/**
|
||||
* 军官证
|
||||
*/
|
||||
MILITARY_OFFICER_CERT("2", "军官证"),
|
||||
/**
|
||||
* 士兵证
|
||||
*/
|
||||
SOLDIER_CERT("3", "士兵证"),
|
||||
/**
|
||||
* 港澳居民来往内地通行证(原名回乡证)
|
||||
*/
|
||||
HOME_RETURN_PERMIT("4", "回乡证"),
|
||||
/**
|
||||
* 临时身份证
|
||||
*/
|
||||
TEMP_ID_CARD("5", "临时身份证"),
|
||||
/**
|
||||
* 户口本
|
||||
*/
|
||||
HOUSEHOLD_REGISTER("6", "户口本"),
|
||||
/**
|
||||
* 其他
|
||||
*/
|
||||
OTHER("7", "其他"),
|
||||
/**
|
||||
* 警官证
|
||||
*/
|
||||
POLICE_OFFICER_CERT("9", "警官证"),
|
||||
/**
|
||||
* 识别证
|
||||
*/
|
||||
IDENTIFICATION_CERT("10", "识别证"),
|
||||
/**
|
||||
* 驾驶执照
|
||||
*/
|
||||
DRIVING_LICENSE("11", "驾驶执照");
|
||||
|
||||
private final String value;
|
||||
private final String description;
|
||||
|
||||
BpcPayerIdType(String value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static BpcPayerIdType getByValue(String value) {
|
||||
if (value == null || "".equals(value.trim())) {
|
||||
return null;
|
||||
}
|
||||
for (BpcPayerIdType val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
package com.openhis.web.externalintegration.enums;
|
||||
|
||||
/**
|
||||
* 【BPC】实名认证标志
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
public enum BpcRealNameAuthFlag {
|
||||
|
||||
/**
|
||||
* 或不存在:无需实名认证
|
||||
*/
|
||||
NO_NEED("0", "无需实名认证"),
|
||||
/**
|
||||
* 实名支付,支付通道需验证支付账户所有人和以下payerName/payerID/payerIDType信息一致
|
||||
*/
|
||||
NEED("1", "实名支付");
|
||||
|
||||
private final String value;
|
||||
private final String description;
|
||||
|
||||
BpcRealNameAuthFlag(String value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static BpcRealNameAuthFlag getByValue(String value) {
|
||||
if (value == null || "".equals(value.trim())) {
|
||||
return null;
|
||||
}
|
||||
for (BpcRealNameAuthFlag val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
package com.openhis.web.externalintegration.enums;
|
||||
|
||||
/**
|
||||
* 【BPC】交易返回应答码
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
public enum BpcRespType {
|
||||
|
||||
/**
|
||||
* 交易成功(终态)
|
||||
*/
|
||||
SUCCESS("00", "交易成功"),
|
||||
/**
|
||||
* 订单失败(终态)
|
||||
*/
|
||||
FAILED("77", "订单失败,无需继续订单查询"),
|
||||
/**
|
||||
* 等待付款(需重试查询)
|
||||
*/
|
||||
WAITING_PAYMENT("88", "等待付款(输密码),应再次发起订单查询"),
|
||||
/**
|
||||
* 交易状态未明(需重试查询)
|
||||
*/
|
||||
UNKNOWN("99", "交易状态未明,应再次发起订单查询");
|
||||
|
||||
private final String value;
|
||||
private final String description;
|
||||
|
||||
BpcRespType(String value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static BpcRespType getByValue(String value) {
|
||||
if (value == null || "".equals(value.trim())) {
|
||||
return null;
|
||||
}
|
||||
for (BpcRespType val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,91 @@
|
||||
package com.openhis.web.externalintegration.enums;
|
||||
|
||||
/**
|
||||
* 【BPC】交易类型
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
public enum BpcTranType {
|
||||
|
||||
/**
|
||||
* 被扫消费
|
||||
*/
|
||||
C("C", "被扫消费"),
|
||||
/**
|
||||
* 退货
|
||||
*/
|
||||
R("R", "退货"),
|
||||
/**
|
||||
* 数字人民币主扫下单
|
||||
*/
|
||||
E("E", "数字人民币主扫下单"),
|
||||
/**
|
||||
* 主扫下单(微信/支付宝/云闪付)
|
||||
*/
|
||||
F("F", "主扫下单"),
|
||||
/**
|
||||
* 关闭订单(部分收单行不支持)
|
||||
*/
|
||||
S("S", "关闭订单"),
|
||||
/**
|
||||
* 消费撤销(部分收单行不支持)
|
||||
*/
|
||||
D("D", "消费撤销"),
|
||||
/**
|
||||
* 定金支付(微信、支付宝,部分收单行不支持)
|
||||
*/
|
||||
A("A", "定金支付"),
|
||||
/**
|
||||
* 退定(微信、支付宝,部分收单行不支持)
|
||||
*/
|
||||
V("V", "退定"),
|
||||
/**
|
||||
* 定金确认(微信、支付宝,部分收单行不支持)
|
||||
*/
|
||||
B("B", "定金确认"),
|
||||
/**
|
||||
* 定金确认撤销(微信、支付宝,部分收单行不支持)
|
||||
*/
|
||||
W("W", "定金确认撤销"),
|
||||
/**
|
||||
* 表示订单支付结果查询、定金支付结果查询
|
||||
*/
|
||||
G("G", "支付结果查询"),
|
||||
/**
|
||||
* 表示消费撤销订单查询、定金确认撤销结果查询
|
||||
*/
|
||||
Z("Z", "撤销结果查询"),
|
||||
/**
|
||||
* 表示退货结果查询、退定结果查询、定金确认结果查询
|
||||
*/
|
||||
J("J", "退款结果查询");
|
||||
|
||||
private final String value;
|
||||
private final String description;
|
||||
|
||||
BpcTranType(String value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static BpcTranType getByValue(String value) {
|
||||
if (value == null || "".equals(value.trim())) {
|
||||
return null;
|
||||
}
|
||||
for (BpcTranType val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
package com.openhis.web.externalintegration.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.openhis.web.externalintegration.dto.FaSimplediseaseAddNopwParam;
|
||||
|
||||
/**
|
||||
* 食源性疾病病例数据智能采集Mapper
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-10
|
||||
*/
|
||||
@Repository
|
||||
public interface FoodborneAcquisitionAppMapper {
|
||||
|
||||
/**
|
||||
* 查询就诊诊断内容列表
|
||||
*
|
||||
* @param encounterId 就诊ID
|
||||
* @return 就诊诊断内容列表
|
||||
*/
|
||||
List<String> selectEncounterDiagnosisConditionNameList(@Param("encounterId") Long encounterId);
|
||||
|
||||
/**
|
||||
* 查询食源性疾病病例数据智能采集上报跳转页面所需参数
|
||||
*
|
||||
* @param encounterId 就诊ID
|
||||
* @param genderEnumMale 性别枚举-男
|
||||
* @param genderEnumFemale 性别枚举-女
|
||||
* @param firstEnumFollowUp 初复诊标识-复诊
|
||||
* @param encounterClassEnumImp 就诊类型-住院
|
||||
* @param participantTypeAdmitter 参与者类型-接诊医生
|
||||
* @return 所需参数
|
||||
*/
|
||||
FaSimplediseaseAddNopwParam selectSimplediseaseAddNopwParam(@Param("encounterId") Long encounterId,
|
||||
@Param("genderEnumMale") Integer genderEnumMale, @Param("genderEnumFemale") Integer genderEnumFemale,
|
||||
@Param("firstEnumFollowUp") Integer firstEnumFollowUp,
|
||||
@Param("encounterClassEnumImp") Integer encounterClassEnumImp,
|
||||
@Param("participantTypeAdmitter") String participantTypeAdmitter);
|
||||
}
|
@@ -0,0 +1,105 @@
|
||||
package com.openhis.web.externalintegration.utils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 【BPC】HTTP请求共通方法
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class BpcHttpUtil {
|
||||
|
||||
/**
|
||||
* 发起post请求
|
||||
*
|
||||
* @param jsonData JSON数据
|
||||
* @param md5SharedSecret MD5签名密钥
|
||||
* @param requestUrl 请求URL
|
||||
* @return 请求结果
|
||||
*/
|
||||
public static String httpPost(String jsonData, String md5SharedSecret, String requestUrl) throws Exception {
|
||||
HttpsURLConnection conn = null;
|
||||
try {
|
||||
// 生成MD5签名
|
||||
String rawData = jsonData + "&" + md5SharedSecret;
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
byte[] digestBytes = md.digest(rawData.getBytes());
|
||||
StringBuilder hexString = new StringBuilder();
|
||||
for (byte b : digestBytes) {
|
||||
hexString.append(String.format("%02x", b & 0xff));
|
||||
}
|
||||
String md5Sign = hexString.toString();
|
||||
// 发起请求
|
||||
URL obj = new URL(requestUrl);
|
||||
conn = (HttpsURLConnection)obj.openConnection();
|
||||
TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() {
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] certs, String authType) {}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] certs, String authType) {}
|
||||
}};
|
||||
SSLContext sslContext = SSLContext.getInstance("TLS");
|
||||
sslContext.init(null, trustAllCerts, new SecureRandom());
|
||||
conn.setSSLSocketFactory(sslContext.getSocketFactory());
|
||||
conn.setHostnameVerifier((hostname, session) -> true);
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setConnectTimeout(30_000);
|
||||
conn.setReadTimeout(60_000);
|
||||
conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
|
||||
conn.setRequestProperty("sign", md5Sign);
|
||||
conn.setDoOutput(true);
|
||||
try (OutputStream os = conn.getOutputStream()) {
|
||||
byte[] input = jsonData.getBytes(StandardCharsets.UTF_8);
|
||||
os.write(input, 0, input.length);
|
||||
}
|
||||
int responseCode = conn.getResponseCode();
|
||||
if (responseCode == HttpURLConnection.HTTP_OK) {
|
||||
try (BufferedReader br =
|
||||
new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) {
|
||||
StringBuilder response = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
response.append(line);
|
||||
}
|
||||
return response.toString();
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("HTTP请求失败,返回" + responseCode);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new Exception("HTTP请求发生未知异常");
|
||||
} finally {
|
||||
if (conn != null) {
|
||||
conn.disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.openhis.web.externalintegration.utils;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* 【BPC】终端流水号生成器
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-10-16
|
||||
*/
|
||||
public class BpcTraceNoGenerator {
|
||||
private static final AtomicInteger COUNTER = new AtomicInteger(1);
|
||||
private static final int MAX_VALUE = 999999;
|
||||
|
||||
public static String nextTraceNo() {
|
||||
int nextValue = COUNTER.getAndUpdate(current -> current >= MAX_VALUE ? 1 : current + 1);
|
||||
// 补零至6位
|
||||
return String.format("%06d", nextValue);
|
||||
}
|
||||
}
|
@@ -71,16 +71,16 @@ public interface IAdviceProcessAppService {
|
||||
/**
|
||||
* 医嘱取消执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @param adviceExecuteParam 取消执行参数
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> adviceCancel(List<PerformInfoDto> performInfoList);
|
||||
R<?> adviceCancel(AdviceExecuteParam adviceExecuteParam);
|
||||
|
||||
/**
|
||||
* 医嘱不执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @param adviceExecuteParam 不执行参数
|
||||
* @return 操作结果
|
||||
*/
|
||||
R<?> adviceVoid(List<PerformInfoDto> performInfoList);
|
||||
R<?> adviceVoid(AdviceExecuteParam adviceExecuteParam);
|
||||
}
|
||||
|
@@ -7,7 +7,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientMedicinePrescriptionInfoDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientMedicineSearchParam;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
|
||||
/**
|
||||
* 住院领药 应用实现接口
|
||||
@@ -15,7 +14,7 @@ import com.openhis.workflow.domain.InventoryItem;
|
||||
* @author yuxj
|
||||
* @date 2025/8/18
|
||||
*/
|
||||
public interface IInpatientMedicineCollectionAppService {
|
||||
public interface IMedicineSummaryAppService {
|
||||
|
||||
/**
|
||||
* 分页查询在科病人列表
|
@@ -4,6 +4,10 @@
|
||||
package com.openhis.web.inhospitalnursestation.appservice.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -14,13 +18,17 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AgeCalculatorUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.administration.service.IEncounterService;
|
||||
import com.openhis.clinical.domain.Procedure;
|
||||
import com.openhis.clinical.service.IProcedureService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
@@ -28,17 +36,24 @@ import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.medication.domain.MedicationDefinition;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
import com.openhis.medication.service.IMedicationDefinitionService;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
import com.openhis.medication.service.IMedicationRequestService;
|
||||
import com.openhis.web.common.dto.PerformInfoDto;
|
||||
import com.openhis.web.common.dto.PerformRecordDto;
|
||||
import com.openhis.web.doctorstation.appservice.IDoctorStationAdviceAppService;
|
||||
import com.openhis.web.doctorstation.dto.AdviceBaseDto;
|
||||
import com.openhis.web.doctorstation.dto.AdvicePriceDto;
|
||||
import com.openhis.web.doctorstation.utils.AdviceUtils;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IAdviceProcessAppService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.*;
|
||||
import com.openhis.web.inhospitalnursestation.mapper.AdviceProcessAppMapper;
|
||||
import com.openhis.web.outpatientmanage.mapper.OutpatientTreatmentAppMapper;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
|
||||
/**
|
||||
@@ -68,12 +83,24 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
@Resource
|
||||
private IMedicationDispenseService medicationDispenseService;
|
||||
|
||||
@Resource
|
||||
private IDeviceDispenseService deviceDispenseService;
|
||||
|
||||
@Resource
|
||||
private IEncounterService encounterService;
|
||||
|
||||
@Resource
|
||||
private IMedicationDefinitionService medicationDefinitionService;
|
||||
|
||||
@Resource
|
||||
private IChargeItemService chargeItemService;
|
||||
|
||||
@Resource
|
||||
private AdviceUtils adviceUtils;
|
||||
|
||||
@Resource
|
||||
private IDoctorStationAdviceAppService iDoctorStationAdviceAppService;
|
||||
|
||||
/**
|
||||
* 住院患者分页列表
|
||||
*
|
||||
@@ -140,7 +167,6 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
Arrays.stream(encounterIds.split(CommonConstants.Common.COMMA)).map(Long::parseLong).toList();
|
||||
queryWrapper.in(CommonConstants.FieldName.EncounterId, encounterIdList);
|
||||
}
|
||||
|
||||
// 入院患者分页列表
|
||||
Page<InpatientAdviceDto> inpatientAdvicePage =
|
||||
adviceProcessAppMapper.selectInpatientAdvicePage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
@@ -339,65 +365,27 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
// 诊疗
|
||||
List<AdviceExecuteDetailParam> activityList = adviceExecuteDetailList.stream()
|
||||
.filter(e -> CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(e.getAdviceTable())).toList();
|
||||
// -------------------------------------------整体校验药品库存
|
||||
// -------------------------------------------药品
|
||||
if (!medicineList.isEmpty()) {
|
||||
// 药品请求id集合
|
||||
List<Long> medicineRequestIdList =
|
||||
medicineList.stream().map(AdviceExecuteDetailParam::getRequestId).collect(Collectors.toList());
|
||||
// 药品请求集合
|
||||
List<MedicationRequest> MedicationRequestList = medicationRequestService
|
||||
.list(new LambdaQueryWrapper<MedicationRequest>().in(MedicationRequest::getId, medicineRequestIdList));
|
||||
// 药品定义id集合
|
||||
List<Long> medicationDefinitionIdList =
|
||||
MedicationRequestList.stream().map(MedicationRequest::getMedicationId).collect(Collectors.toList());
|
||||
// 药品定义集合
|
||||
List<MedicationDefinition> medicationDefinitionList =
|
||||
medicationDefinitionService.list(new LambdaQueryWrapper<MedicationDefinition>()
|
||||
.in(MedicationDefinition::getId, medicationDefinitionIdList));
|
||||
// 组装MedicationRequestUseExe数据结构
|
||||
List<MedicationRequestUseExe> MedUseExeList = MedicationRequestList.stream().map(medicationRequest -> {
|
||||
// 创建 MedicationRequestUseExe 对象,并复制 MedicationRequest 的属性
|
||||
MedicationRequestUseExe useExe = new MedicationRequestUseExe();
|
||||
BeanUtils.copyProperties(medicationRequest, useExe);
|
||||
// 匹配 executeTimes:根据 medicationRequest 的 id 在 medicineList 中查找匹配的 executeTimes
|
||||
List<String> matchedExecuteTimes =
|
||||
medicineList.stream().filter(medicine -> medicine.getRequestId().equals(medicationRequest.getId()))
|
||||
.findFirst().map(AdviceExecuteDetailParam::getExecuteTimes).orElse(null);
|
||||
useExe.setExecuteTimes(matchedExecuteTimes);
|
||||
// 计算 executeTimesNum:executeTimes 的集合大小,转换为 BigDecimal
|
||||
if (matchedExecuteTimes != null) {
|
||||
useExe.setExecuteTimesNum(BigDecimal.valueOf(matchedExecuteTimes.size()));
|
||||
} else {
|
||||
useExe.setExecuteTimesNum(BigDecimal.ZERO);
|
||||
// 组装药品请求用于执行的数据结构
|
||||
List<MedicationRequestUseExe> medUseExeList = this.assemblyMedication(medicineList);
|
||||
// 校验药品库存
|
||||
if (!medUseExeList.isEmpty()) {
|
||||
String tipRes = adviceUtils.checkExeMedInventory(medUseExeList);
|
||||
if (tipRes != null) {
|
||||
return R.fail(null, tipRes);
|
||||
}
|
||||
// 匹配 minUnitQuantity:根据 medicationId 在 medicationDefinitionList 中查找匹配的药品定义
|
||||
MedicationDefinition matchedDefinition = medicationDefinitionList.stream()
|
||||
.filter(definition -> definition.getId().equals(medicationRequest.getMedicationId())).findFirst()
|
||||
.orElse(null);
|
||||
if (matchedDefinition != null) {
|
||||
// 判断 minUnitCode 是否等于 unitCode
|
||||
if (matchedDefinition.getMinUnitCode().equals(medicationRequest.getUnitCode())) {
|
||||
useExe.setMinUnitQuantity(medicationRequest.getQuantity());
|
||||
} else {
|
||||
// 若不相等,则计算 quantity * partPercent
|
||||
BigDecimal partPercent = matchedDefinition.getPartPercent();
|
||||
if (partPercent == null) {
|
||||
partPercent = BigDecimal.ONE; // 避免空指针,默认设为1
|
||||
}
|
||||
useExe.setMinUnitQuantity(medicationRequest.getQuantity().multiply(partPercent));
|
||||
}
|
||||
} else {
|
||||
// 若未找到匹配的药品定义,设为 null 或默认值
|
||||
useExe.setMinUnitQuantity(null);
|
||||
}
|
||||
return useExe;
|
||||
}).toList();
|
||||
|
||||
// -------------------------------------------处理药品执行
|
||||
|
||||
}
|
||||
// 处理药品执行
|
||||
this.exeMedication(medUseExeList);
|
||||
}
|
||||
// -------------------------------------------诊疗
|
||||
if (!activityList.isEmpty()) {
|
||||
// 组装诊疗请求用于执行的数据结构
|
||||
List<ServiceRequestUseExe> actUseExeList = this.assemblyActivity(activityList);
|
||||
// 处理诊疗执行
|
||||
this.exeActivity(actUseExeList);
|
||||
}
|
||||
|
||||
// -------------------------------------------处理诊疗执行
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"医嘱执行"}));
|
||||
}
|
||||
@@ -405,22 +393,135 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
/**
|
||||
* 医嘱取消执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @param adviceExecuteParam 取消执行参数
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> adviceCancel(List<PerformInfoDto> performInfoList) {
|
||||
return null;
|
||||
public R<?> adviceCancel(AdviceExecuteParam adviceExecuteParam) {
|
||||
|
||||
// 长期医嘱执行id
|
||||
List<Long> longProcIdList = adviceExecuteParam.getAdviceExecuteDetailList().stream()
|
||||
.filter(x -> x.getTherapyEnum().equals(TherapyTimeType.LONG_TERM.getValue()))
|
||||
.map(AdviceExecuteDetailParam::getProcedureId).distinct().toList();
|
||||
// 药品临时医嘱执行id
|
||||
List<Long> tempProcIdList = adviceExecuteParam.getAdviceExecuteDetailList().stream()
|
||||
.filter(x -> x.getTherapyEnum().equals(TherapyTimeType.TEMPORARY.getValue()))
|
||||
.map(AdviceExecuteDetailParam::getProcedureId).distinct().toList();
|
||||
|
||||
// 分别处理长期和临时的医嘱
|
||||
// 长期已发放药品
|
||||
List<MedicationDispense> longMedDispensedList = new ArrayList<>();
|
||||
// 长期未发放药品
|
||||
List<MedicationDispense> longMedUndispenseList = new ArrayList<>();
|
||||
// 长期已发放耗材
|
||||
List<DeviceDispense> longDevDispensedList = new ArrayList<>();
|
||||
// 长期未发放耗材
|
||||
List<DeviceDispense> longDevUndispenseList = new ArrayList<>();
|
||||
// 处理长期医嘱
|
||||
if (!longProcIdList.isEmpty()) {
|
||||
// 长期药品
|
||||
List<MedicationDispense> longMedDispenseList =
|
||||
medicationDispenseService.getMedDispenseByProcedureId(longProcIdList);
|
||||
// 长期耗材
|
||||
List<DeviceDispense> longDevDispenseList =
|
||||
deviceDispenseService.getDevDispenseByProcedureId(longProcIdList);
|
||||
// 分离已发药发药单和未发药发药单
|
||||
for (MedicationDispense medicationDispense : longMedDispenseList) {
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(medicationDispense.getDispenseEnum())) {
|
||||
longMedDispensedList.add(medicationDispense);
|
||||
} else if (DispenseStatus.PREPARATION.getValue().equals(medicationDispense.getDispenseEnum())) {
|
||||
longMedUndispenseList.add(medicationDispense);
|
||||
}
|
||||
}
|
||||
// 分离已发耗材单和未发耗材单
|
||||
for (DeviceDispense deviceDispense : longDevDispenseList) {
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(deviceDispense.getStatusEnum())) {
|
||||
longDevDispensedList.add(deviceDispense);
|
||||
} else if (DispenseStatus.PREPARATION.getValue().equals(deviceDispense.getStatusEnum())) {
|
||||
longDevUndispenseList.add(deviceDispense);
|
||||
}
|
||||
}
|
||||
// 查询账单
|
||||
List<ChargeItem> chargeItemList = chargeItemService.getChargeItemByProcedureId(longProcIdList);
|
||||
if (chargeItemList != null && !chargeItemList.isEmpty()) {
|
||||
for (ChargeItem chargeItem : chargeItemList) {
|
||||
// 因执行医嘱时创建了账单,取消执行时需要软删除账单
|
||||
chargeItemService.removeById(chargeItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 临时已发放药品
|
||||
List<MedicationDispense> tempMedDispensedList = new ArrayList<>();
|
||||
// 临时未发放药品
|
||||
List<MedicationDispense> tempMedUndispenseList = new ArrayList<>();
|
||||
// 临时已发放耗材
|
||||
List<DeviceDispense> tempDevDispensedList = new ArrayList<>();
|
||||
// 临时未发放耗材
|
||||
List<DeviceDispense> tempDevUndispenseList = new ArrayList<>();
|
||||
// 处理临时医嘱
|
||||
if (!tempProcIdList.isEmpty()) {
|
||||
// 长期药品
|
||||
List<MedicationDispense> tempMedDispenseList =
|
||||
medicationDispenseService.getMedDispenseByProcedureId(tempProcIdList);
|
||||
// 长期耗材
|
||||
List<DeviceDispense> tempDevDispenseList =
|
||||
deviceDispenseService.getDevDispenseByProcedureId(tempProcIdList);
|
||||
// 分离已发药发药单和未发药发药单
|
||||
for (MedicationDispense medicationDispense : tempMedDispenseList) {
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(medicationDispense.getDispenseEnum())) {
|
||||
tempMedDispensedList.add(medicationDispense);
|
||||
} else if (DispenseStatus.PREPARATION.getValue().equals(medicationDispense.getDispenseEnum())) {
|
||||
tempMedUndispenseList.add(medicationDispense);
|
||||
}
|
||||
}
|
||||
// 分离已发耗材单和未发耗材单
|
||||
for (DeviceDispense deviceDispense : tempDevDispenseList) {
|
||||
if (DispenseStatus.COMPLETED.getValue().equals(deviceDispense.getStatusEnum())) {
|
||||
tempDevDispensedList.add(deviceDispense);
|
||||
} else if (DispenseStatus.PREPARATION.getValue().equals(deviceDispense.getStatusEnum())) {
|
||||
tempDevUndispenseList.add(deviceDispense);
|
||||
}
|
||||
}
|
||||
// 查询账单
|
||||
List<ChargeItem> chargeItemList = chargeItemService.getChargeItemByProcedureId(tempProcIdList);
|
||||
if (chargeItemList != null && !chargeItemList.isEmpty()) {
|
||||
// 临时医嘱取消执行时,将临时医嘱的收费项目状态改为待收费
|
||||
chargeItemService
|
||||
.updatePlannedChargeStatus(chargeItemList.stream().map(ChargeItem::getProcedureId).toList());
|
||||
}
|
||||
}
|
||||
// 统一处理已发放药品或耗材
|
||||
List<MedicationDispense> medDispensedList = new ArrayList<>(tempMedDispensedList);
|
||||
medDispensedList.addAll(longMedDispensedList);
|
||||
// 统一处理已发放药品或耗材
|
||||
List<DeviceDispense> devDispensedList = new ArrayList<>(tempDevDispensedList);
|
||||
devDispensedList.addAll(longDevDispensedList);
|
||||
// 合并长期和临时的执行记录
|
||||
List<Long> procedureIdList = new ArrayList<>(longProcIdList);
|
||||
procedureIdList.addAll(tempProcIdList);
|
||||
// 查询执行记录
|
||||
List<Procedure> procedureList = procedureService.listByIds(procedureIdList);
|
||||
if (procedureList != null && !procedureList.isEmpty()) {
|
||||
for (Procedure procedure : procedureList) {
|
||||
// 根据执行记录新增取消执行记录
|
||||
procedureService.addProcedureRecord(procedure.getEncounterId(), procedure.getPatientId(),
|
||||
procedure.getRequestId(), procedure.getRequestTable(), EventStatus.CANCEL,
|
||||
ProcedureCategory.INPATIENT_ADVICE, null, procedure.getOccurrenceTime(), procedure.getGroupId(),
|
||||
procedure.getId());
|
||||
}
|
||||
}
|
||||
return R.ok("取消执行成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱不执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @param adviceExecuteParam 不执行参数
|
||||
* @return 操作结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> adviceVoid(List<PerformInfoDto> performInfoList) {
|
||||
public R<?> adviceVoid(AdviceExecuteParam adviceExecuteParam) {
|
||||
// 长期临时都可以不执行,长期不执行的是某一时间点,也可以不执行这一整个医嘱(更新serviceRequest状态为7)
|
||||
// 已执行的时间点不能不执行,需要先取消
|
||||
// 增加不执行记录
|
||||
@@ -428,4 +529,375 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行药品医嘱
|
||||
*
|
||||
* @param medUseExeList 药品医嘱
|
||||
*/
|
||||
private void exeMedication(List<MedicationRequestUseExe> medUseExeList) {
|
||||
// 长期医嘱
|
||||
List<MedicationRequestUseExe> longMedication = medUseExeList.stream()
|
||||
.filter(e -> TherapyTimeType.LONG_TERM.getValue().equals(e.getTherapyEnum())).collect(Collectors.toList());
|
||||
// 临时医嘱
|
||||
List<MedicationRequestUseExe> tempMedication = medUseExeList.stream()
|
||||
.filter(e -> TherapyTimeType.TEMPORARY.getValue().equals(e.getTherapyEnum())).collect(Collectors.toList());
|
||||
// 药品定义id集合
|
||||
List<Long> medicationDefinitionIdList =
|
||||
medUseExeList.stream().map(MedicationRequestUseExe::getMedicationId).collect(Collectors.toList());
|
||||
// 医嘱详细信息
|
||||
List<AdviceBaseDto> medicationInfos = iDoctorStationAdviceAppService.getAdviceBaseInfo(null, null, null,
|
||||
medicationDefinitionIdList, 0L, 1, 500, Whether.NO.getValue(), List.of(1)).getRecords();
|
||||
|
||||
// 当前时间
|
||||
Date curDate = new Date();
|
||||
// 参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 当前登录账号的科室id
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
|
||||
// 长期
|
||||
MedicationRequest longMedicationRequest;
|
||||
ChargeItem chargeItem;
|
||||
for (MedicationRequestUseExe medicationRequestUseExe : longMedication) {
|
||||
for (String executeTime : medicationRequestUseExe.getExecuteTimes()) {
|
||||
longMedicationRequest = new MedicationRequest();
|
||||
BeanUtils.copyProperties(medicationRequestUseExe, longMedicationRequest);
|
||||
|
||||
// 生成执行记录
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
// 转换为 LocalDateTime
|
||||
LocalDateTime localDateTime = LocalDateTime.parse(executeTime, formatter);
|
||||
// 转换为 Date
|
||||
Date exeDate = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
// 执行记录id
|
||||
Long procedureId = procedureService.addProcedureRecord(longMedicationRequest.getEncounterId(),
|
||||
longMedicationRequest.getPatientId(), longMedicationRequest.getId(),
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, EventStatus.COMPLETED,
|
||||
ProcedureCategory.INPATIENT_ADVICE, null, exeDate, longMedicationRequest.getGroupId(), null);
|
||||
|
||||
// 生成药品发放
|
||||
medicationDispenseService.generateMedicationDispense(longMedicationRequest, procedureId);
|
||||
|
||||
// 生成账单
|
||||
chargeItem = new ChargeItem();
|
||||
chargeItem.setStatusEnum(ChargeItemStatus.BILLABLE.getValue()); // 收费状态
|
||||
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(longMedicationRequest.getBusNo()));
|
||||
chargeItem.setPrescriptionNo(longMedicationRequest.getPrescriptionNo()); // 处方号
|
||||
chargeItem.setPatientId(longMedicationRequest.getPatientId()); // 患者
|
||||
chargeItem.setContextEnum(ChargeItemContext.MEDICATION.getValue()); // 类型
|
||||
chargeItem.setEncounterId(longMedicationRequest.getEncounterId()); // 就诊id
|
||||
chargeItem.setEntererId(practitionerId);// 开立人ID
|
||||
chargeItem.setRequestingOrgId(orgId); // 开立科室
|
||||
chargeItem.setEnteredDate(curDate); // 开立时间
|
||||
chargeItem.setServiceTable(CommonConstants.TableName.MED_MEDICATION_REQUEST);// 医疗服务类型
|
||||
chargeItem.setServiceId(longMedicationRequest.getId()); // 医疗服务ID
|
||||
chargeItem.setProductTable(CommonConstants.TableName.MED_MEDICATION_DEFINITION);// 产品所在表
|
||||
chargeItem.setProductId(longMedicationRequest.getMedicationId());// 收费项id
|
||||
chargeItem.setAccountId(medicationRequestUseExe.getAccountId());// 关联账户ID
|
||||
chargeItem.setConditionId(longMedicationRequest.getConditionId()); // 诊断id
|
||||
chargeItem.setEncounterDiagnosisId(longMedicationRequest.getEncounterDiagnosisId()); // 就诊诊断id
|
||||
chargeItem.setProcedureId(procedureId);
|
||||
// ------------------------------ 匹配定价信息
|
||||
// 根据 medicationId 查找对应的医嘱信息
|
||||
MedicationRequest finalLongMedicationRequest = longMedicationRequest;
|
||||
Optional<AdviceBaseDto> matchedAdvice = medicationInfos.stream()
|
||||
.filter(
|
||||
advice -> finalLongMedicationRequest.getMedicationId().equals(advice.getAdviceDefinitionId()))
|
||||
.findFirst();
|
||||
if (!matchedAdvice.isPresent()) {
|
||||
throw new RuntimeException(
|
||||
"未找到对应的医嘱信息,medicationId: " + finalLongMedicationRequest.getMedicationId());
|
||||
}
|
||||
AdviceBaseDto advice = matchedAdvice.get();
|
||||
// 获取拆零比
|
||||
BigDecimal partPercent = advice.getPartPercent();
|
||||
|
||||
// 在 priceList 中查找匹配的定价信息
|
||||
Optional<AdvicePriceDto> matchedPrice = advice.getPriceList().stream()
|
||||
.filter(price -> finalLongMedicationRequest.getLotNumber().equals(price.getConditionValue()))
|
||||
.findFirst();
|
||||
if (!matchedPrice.isPresent()) {
|
||||
throw new RuntimeException("未找到匹配的定价信息,lotNumber: " + finalLongMedicationRequest.getLotNumber());
|
||||
}
|
||||
AdvicePriceDto priceDto = matchedPrice.get();
|
||||
// 计算价格
|
||||
BigDecimal price;
|
||||
if (finalLongMedicationRequest.getUnitCode().equals(priceDto.getUnitCode())) {
|
||||
// unitCode 匹配,直接取 price
|
||||
price = priceDto.getPrice();
|
||||
} else {
|
||||
// unitCode 不匹配,计算 price / partPercent
|
||||
price = priceDto.getPrice().divide(partPercent, RoundingMode.HALF_UP);
|
||||
}
|
||||
chargeItem.setDefinitionId(priceDto.getDefinitionId()); // 费用定价ID
|
||||
chargeItem.setDefDetailId(priceDto.getDefinitionDetailId()); // 定价子表主键
|
||||
chargeItem.setQuantityValue(longMedicationRequest.getQuantity()); // 数量
|
||||
chargeItem.setQuantityUnit(longMedicationRequest.getUnitCode()); // 单位
|
||||
chargeItem.setUnitPrice(price); // 单价
|
||||
chargeItem.setTotalPrice(
|
||||
longMedicationRequest.getQuantity().multiply(price).setScale(4, RoundingMode.HALF_UP)); // 总价
|
||||
|
||||
chargeItemService.saveOrUpdate(chargeItem);
|
||||
}
|
||||
}
|
||||
|
||||
// 临时
|
||||
MedicationRequest tempMedicationRequest;
|
||||
for (MedicationRequestUseExe medicationRequestUseExe : tempMedication) {
|
||||
for (String executeTime : medicationRequestUseExe.getExecuteTimes()) {
|
||||
tempMedicationRequest = new MedicationRequest();
|
||||
BeanUtils.copyProperties(medicationRequestUseExe, tempMedicationRequest);
|
||||
|
||||
// 生成执行记录
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
// 转换为 LocalDateTime
|
||||
LocalDateTime localDateTime = LocalDateTime.parse(executeTime, formatter);
|
||||
// 转换为 Date
|
||||
Date exeDate = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
// 执行记录id
|
||||
Long procedureId = procedureService.addProcedureRecord(tempMedicationRequest.getEncounterId(),
|
||||
tempMedicationRequest.getPatientId(), tempMedicationRequest.getId(),
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, EventStatus.COMPLETED,
|
||||
ProcedureCategory.INPATIENT_ADVICE, null, exeDate, tempMedicationRequest.getGroupId(), null);
|
||||
|
||||
// 更新药品放发状态
|
||||
medicationDispenseService.update(new LambdaUpdateWrapper<MedicationDispense>()
|
||||
.eq(MedicationDispense::getMedReqId, tempMedicationRequest.getId())
|
||||
.set(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue()));
|
||||
|
||||
// 更新账单状态
|
||||
chargeItemService.update(
|
||||
new LambdaUpdateWrapper<ChargeItem>().eq(ChargeItem::getServiceId, tempMedicationRequest.getId())
|
||||
.set(ChargeItem::getProcedureId, procedureId)
|
||||
.set(ChargeItem::getStatusEnum, ChargeItemStatus.BILLABLE.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行诊疗医嘱
|
||||
*
|
||||
* @param actUseExeList 诊疗医嘱
|
||||
*/
|
||||
private void exeActivity(List<ServiceRequestUseExe> actUseExeList) {
|
||||
// 长期医嘱
|
||||
List<ServiceRequestUseExe> longActivity = actUseExeList.stream()
|
||||
.filter(e -> TherapyTimeType.LONG_TERM.getValue().equals(e.getTherapyEnum())).collect(Collectors.toList());
|
||||
// 临时医嘱
|
||||
List<ServiceRequestUseExe> tempActivity = actUseExeList.stream()
|
||||
.filter(e -> TherapyTimeType.TEMPORARY.getValue().equals(e.getTherapyEnum())).collect(Collectors.toList());
|
||||
// 诊疗定义id集合
|
||||
List<Long> activityDefinitionIdList =
|
||||
actUseExeList.stream().map(ServiceRequestUseExe::getActivityId).collect(Collectors.toList());
|
||||
// 医嘱详细信息
|
||||
List<AdviceBaseDto> activityInfos = iDoctorStationAdviceAppService.getAdviceBaseInfo(null, null, null,
|
||||
activityDefinitionIdList, 0L, 1, 500, Whether.NO.getValue(), List.of(3)).getRecords();
|
||||
|
||||
// 当前时间
|
||||
Date curDate = new Date();
|
||||
// 参与者id
|
||||
Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId();
|
||||
// 当前登录账号的科室id
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
|
||||
// 长期
|
||||
ServiceRequest longServiceRequest;
|
||||
ChargeItem chargeItem;
|
||||
for (ServiceRequestUseExe serviceRequestUseExe : longActivity) {
|
||||
for (String executeTime : serviceRequestUseExe.getExecuteTimes()) {
|
||||
longServiceRequest = new ServiceRequest();
|
||||
BeanUtils.copyProperties(serviceRequestUseExe, longServiceRequest);
|
||||
|
||||
// 生成执行记录
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
// 转换为 LocalDateTime
|
||||
LocalDateTime localDateTime = LocalDateTime.parse(executeTime, formatter);
|
||||
// 转换为 Date
|
||||
Date exeDate = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
// 执行记录id
|
||||
Long procedureId = procedureService.addProcedureRecord(longServiceRequest.getEncounterId(),
|
||||
longServiceRequest.getPatientId(), longServiceRequest.getId(),
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, EventStatus.COMPLETED,
|
||||
ProcedureCategory.INPATIENT_ADVICE, null, exeDate, null, null);
|
||||
|
||||
// 生成账单
|
||||
chargeItem = new ChargeItem();
|
||||
chargeItem.setStatusEnum(ChargeItemStatus.BILLABLE.getValue()); // 收费状态
|
||||
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(longServiceRequest.getBusNo()));
|
||||
chargeItem.setPatientId(longServiceRequest.getPatientId()); // 患者
|
||||
chargeItem.setContextEnum(ChargeItemContext.ACTIVITY.getValue()); // 类型
|
||||
chargeItem.setEncounterId(longServiceRequest.getEncounterId()); // 就诊id
|
||||
chargeItem.setEntererId(practitionerId);// 开立人ID
|
||||
chargeItem.setRequestingOrgId(orgId); // 开立科室
|
||||
chargeItem.setEnteredDate(curDate); // 开立时间
|
||||
chargeItem.setServiceTable(CommonConstants.TableName.WOR_SERVICE_REQUEST);// 医疗服务类型
|
||||
chargeItem.setServiceId(longServiceRequest.getId()); // 医疗服务ID
|
||||
chargeItem.setProductTable(CommonConstants.TableName.WOR_ACTIVITY_DEFINITION);// 产品所在表
|
||||
chargeItem.setProductId(longServiceRequest.getActivityId());// 收费项id
|
||||
chargeItem.setAccountId(serviceRequestUseExe.getAccountId());// 关联账户ID
|
||||
chargeItem.setConditionId(longServiceRequest.getConditionId()); // 诊断id
|
||||
chargeItem.setEncounterDiagnosisId(longServiceRequest.getEncounterDiagnosisId()); // 就诊诊断id
|
||||
chargeItem.setProcedureId(procedureId);
|
||||
// ------------------------------ 匹配定价信息
|
||||
// 根据 activityId 查找对应的医嘱信息
|
||||
ServiceRequest finalLongServiceRequest = longServiceRequest;
|
||||
Optional<AdviceBaseDto> matchedAdvice = activityInfos.stream()
|
||||
.filter(advice -> finalLongServiceRequest.getActivityId().equals(advice.getAdviceDefinitionId()))
|
||||
.findFirst();
|
||||
if (!matchedAdvice.isPresent()) {
|
||||
throw new RuntimeException("未找到对应的医嘱信息,activityId: " + finalLongServiceRequest.getActivityId());
|
||||
}
|
||||
// 医嘱信息
|
||||
AdviceBaseDto advice = matchedAdvice.get();
|
||||
// 定价信息
|
||||
AdvicePriceDto priceDto = advice.getPriceList().get(0);
|
||||
// 计算价格
|
||||
BigDecimal price = priceDto.getPrice();
|
||||
|
||||
chargeItem.setDefinitionId(priceDto.getDefinitionId()); // 费用定价ID
|
||||
chargeItem.setQuantityValue(longServiceRequest.getQuantity()); // 数量
|
||||
chargeItem.setQuantityUnit(longServiceRequest.getUnitCode()); // 单位
|
||||
chargeItem.setUnitPrice(price); // 单价
|
||||
chargeItem
|
||||
.setTotalPrice(longServiceRequest.getQuantity().multiply(price).setScale(4, RoundingMode.HALF_UP)); // 总价
|
||||
chargeItemService.saveOrUpdate(chargeItem);
|
||||
}
|
||||
}
|
||||
|
||||
// 临时
|
||||
ServiceRequest tempServiceRequest;
|
||||
for (ServiceRequestUseExe serviceRequestUseExe : tempActivity) {
|
||||
for (String executeTime : serviceRequestUseExe.getExecuteTimes()) {
|
||||
tempServiceRequest = new ServiceRequest();
|
||||
BeanUtils.copyProperties(serviceRequestUseExe, tempServiceRequest);
|
||||
|
||||
// 生成执行记录
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
// 转换为 LocalDateTime
|
||||
LocalDateTime localDateTime = LocalDateTime.parse(executeTime, formatter);
|
||||
// 转换为 Date
|
||||
Date exeDate = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
|
||||
// 执行记录id
|
||||
Long procedureId = procedureService.addProcedureRecord(tempServiceRequest.getEncounterId(),
|
||||
tempServiceRequest.getPatientId(), tempServiceRequest.getId(),
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, EventStatus.COMPLETED,
|
||||
ProcedureCategory.INPATIENT_ADVICE, null, exeDate, null, null);
|
||||
|
||||
// 更新账单状态
|
||||
chargeItemService.update(
|
||||
new LambdaUpdateWrapper<ChargeItem>().eq(ChargeItem::getServiceId, tempServiceRequest.getId())
|
||||
.set(ChargeItem::getProcedureId, procedureId)
|
||||
.set(ChargeItem::getStatusEnum, ChargeItemStatus.BILLABLE.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装药品请求用于执行的数据结构
|
||||
*
|
||||
* @param medicineList 药品执行参数
|
||||
* @return 用于执行的药品请求
|
||||
*/
|
||||
private List<MedicationRequestUseExe> assemblyMedication(List<AdviceExecuteDetailParam> medicineList) {
|
||||
// 药品请求id集合
|
||||
List<Long> medicineRequestIdList =
|
||||
medicineList.stream().map(AdviceExecuteDetailParam::getRequestId).collect(Collectors.toList());
|
||||
// 药品请求集合
|
||||
List<MedicationRequest> medicationRequestList = medicationRequestService
|
||||
.list(new LambdaQueryWrapper<MedicationRequest>().in(MedicationRequest::getId, medicineRequestIdList));
|
||||
// 药品定义id集合
|
||||
List<Long> medicationDefinitionIdList =
|
||||
medicationRequestList.stream().map(MedicationRequest::getMedicationId).collect(Collectors.toList());
|
||||
// 药品定义集合
|
||||
List<MedicationDefinition> medicationDefinitionList = medicationDefinitionService.list(
|
||||
new LambdaQueryWrapper<MedicationDefinition>().in(MedicationDefinition::getId, medicationDefinitionIdList));
|
||||
// 组装MedicationRequestUseExe数据结构
|
||||
List<MedicationRequestUseExe> medUseExeList = medicationRequestList.stream().map(medicationRequest -> {
|
||||
// 创建 MedicationRequestUseExe 对象,并复制 MedicationRequest 的属性
|
||||
MedicationRequestUseExe useExe = new MedicationRequestUseExe();
|
||||
// 账号id赋值
|
||||
AdviceExecuteDetailParam adviceExecuteDetailParam = medicineList.stream()
|
||||
.filter(param -> medicationRequest.getId().equals(param.getRequestId())).findFirst().orElse(null);
|
||||
if (adviceExecuteDetailParam != null) {
|
||||
useExe.setAccountId(adviceExecuteDetailParam.getAccountId());
|
||||
}
|
||||
BeanUtils.copyProperties(medicationRequest, useExe);
|
||||
// 匹配 executeTimes:根据 medicationRequest 的 id 在 medicineList 中查找匹配的 executeTimes
|
||||
List<String> matchedExecuteTimes =
|
||||
medicineList.stream().filter(medicine -> medicine.getRequestId().equals(medicationRequest.getId()))
|
||||
.findFirst().map(AdviceExecuteDetailParam::getExecuteTimes).orElse(null);
|
||||
useExe.setExecuteTimes(matchedExecuteTimes);
|
||||
// 计算 executeTimesNum:executeTimes 的集合大小,转换为 BigDecimal
|
||||
if (matchedExecuteTimes != null) {
|
||||
useExe.setExecuteTimesNum(BigDecimal.valueOf(matchedExecuteTimes.size()));
|
||||
} else {
|
||||
useExe.setExecuteTimesNum(BigDecimal.ZERO);
|
||||
}
|
||||
// 匹配 minUnitQuantity:根据 medicationId 在 medicationDefinitionList 中查找匹配的药品定义
|
||||
MedicationDefinition matchedDefinition = medicationDefinitionList.stream()
|
||||
.filter(definition -> definition.getId().equals(medicationRequest.getMedicationId())).findFirst()
|
||||
.orElse(null);
|
||||
if (matchedDefinition != null) {
|
||||
// 判断 minUnitCode 是否等于 unitCode
|
||||
if (matchedDefinition.getMinUnitCode().equals(medicationRequest.getUnitCode())) {
|
||||
useExe.setMinUnitQuantity(medicationRequest.getQuantity());
|
||||
} else {
|
||||
// 若不相等,则计算 quantity * partPercent
|
||||
BigDecimal partPercent = matchedDefinition.getPartPercent();
|
||||
if (partPercent == null) {
|
||||
partPercent = BigDecimal.ONE; // 避免空指针,默认设为1
|
||||
}
|
||||
useExe.setMinUnitQuantity(medicationRequest.getQuantity().multiply(partPercent));
|
||||
}
|
||||
} else {
|
||||
// 若未找到匹配的药品定义,设为 null 或默认值
|
||||
useExe.setMinUnitQuantity(null);
|
||||
}
|
||||
return useExe;
|
||||
}).toList();
|
||||
return medUseExeList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装诊疗请求用于执行的数据结构
|
||||
*
|
||||
* @param activityList 诊疗执行参数
|
||||
* @return 用于执行的诊疗请求
|
||||
*/
|
||||
private List<ServiceRequestUseExe> assemblyActivity(List<AdviceExecuteDetailParam> activityList) {
|
||||
// 诊疗请求id集合
|
||||
List<Long> activityRequestIdList =
|
||||
activityList.stream().map(AdviceExecuteDetailParam::getRequestId).collect(Collectors.toList());
|
||||
// 诊疗请求集合
|
||||
List<ServiceRequest> activityRequestList = serviceRequestService
|
||||
.list(new LambdaQueryWrapper<ServiceRequest>().in(ServiceRequest::getId, activityRequestIdList));
|
||||
// 组装ServiceRequestUseExe数据结构
|
||||
List<ServiceRequestUseExe> actUseExeList = activityRequestList.stream().map(serviceRequest -> {
|
||||
// 创建 ServiceRequestUseExe 对象,并复制 ServiceRequest 的属性
|
||||
ServiceRequestUseExe useExe = new ServiceRequestUseExe();
|
||||
// 账号id赋值
|
||||
AdviceExecuteDetailParam adviceExecuteDetailParam = activityList.stream()
|
||||
.filter(param -> serviceRequest.getId().equals(param.getRequestId())).findFirst().orElse(null);
|
||||
if (adviceExecuteDetailParam != null) {
|
||||
useExe.setAccountId(adviceExecuteDetailParam.getAccountId());
|
||||
}
|
||||
BeanUtils.copyProperties(serviceRequest, useExe);
|
||||
// 匹配 executeTimes:根据 serviceRequest 的 id 在 activityList 中查找匹配的 executeTimes
|
||||
List<String> matchedExecuteTimes =
|
||||
activityList.stream().filter(activity -> activity.getRequestId().equals(serviceRequest.getId()))
|
||||
.findFirst().map(AdviceExecuteDetailParam::getExecuteTimes).orElse(null);
|
||||
useExe.setExecuteTimes(matchedExecuteTimes);
|
||||
// 计算 executeTimesNum:executeTimes 的集合大小,转换为 BigDecimal
|
||||
if (matchedExecuteTimes != null) {
|
||||
useExe.setExecuteTimesNum(BigDecimal.valueOf(matchedExecuteTimes.size()));
|
||||
} else {
|
||||
useExe.setExecuteTimesNum(BigDecimal.ZERO);
|
||||
}
|
||||
return useExe;
|
||||
}).toList();
|
||||
return actUseExeList;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -7,20 +7,15 @@ import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.constant.HttpStatus;
|
||||
import com.core.common.utils.*;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IInpatientMedicineCollectionAppService;
|
||||
import com.openhis.web.pharmacymanage.dto.InventoryDto;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.constant.HttpStatus;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.exception.ServiceException;
|
||||
import com.core.common.utils.*;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
@@ -28,10 +23,17 @@ import com.openhis.common.enums.ybenums.YbDrordType;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.*;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IMedicineSummaryAppService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientMedicineEncounterInfoDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientMedicinePrescriptionInfoDto;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientMedicineSearchParam;
|
||||
import com.openhis.web.inhospitalnursestation.mapper.InpatientMedicineCollectionMapper;
|
||||
import com.openhis.web.pharmacymanage.dto.InventoryDto;
|
||||
import com.openhis.web.pharmacymanage.mapper.ReturnMedicineMapper;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
import com.openhis.workflow.service.ISupplyDeliveryService;
|
||||
import com.openhis.workflow.service.ISupplyRequestService;
|
||||
|
||||
@@ -42,7 +44,7 @@ import com.openhis.workflow.service.ISupplyRequestService;
|
||||
* @date 2025/8/18
|
||||
*/
|
||||
@Service
|
||||
public class InpatientMedicineCollectionAppServiceImpl implements IInpatientMedicineCollectionAppService {
|
||||
public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService {
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
@@ -75,7 +75,7 @@ public class AdviceProcessController {
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping(value = "/advice-verify")
|
||||
public R<?> adviceVerify(List<PerformInfoDto> performInfoList) {
|
||||
public R<?> adviceVerify(@RequestBody List<PerformInfoDto> performInfoList) {
|
||||
return adviceProcessAppService.adviceVerify(performInfoList);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class AdviceProcessController {
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping(value = "/advice-reject")
|
||||
public R<?> adviceReject(List<PerformInfoDto> performInfoList) {
|
||||
public R<?> adviceReject(@RequestBody List<PerformInfoDto> performInfoList) {
|
||||
return adviceProcessAppService.adviceReject(performInfoList);
|
||||
}
|
||||
|
||||
@@ -104,22 +104,22 @@ public class AdviceProcessController {
|
||||
/**
|
||||
* 医嘱取消执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @param adviceExecuteParam 取消执行参数
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping(value = "/advice-cancel")
|
||||
public R<?> adviceCancel(List<PerformInfoDto> performInfoList) {
|
||||
return adviceProcessAppService.adviceCancel(performInfoList);
|
||||
public R<?> adviceCancel(@RequestBody AdviceExecuteParam adviceExecuteParam) {
|
||||
return adviceProcessAppService.adviceCancel(adviceExecuteParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医嘱不执行
|
||||
*
|
||||
* @param performInfoList 医嘱信息集合
|
||||
* @param adviceExecuteParam 不执行参数
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping(value = "/advice-void")
|
||||
public R<?> adviceVoid(List<PerformInfoDto> performInfoList) {
|
||||
return adviceProcessAppService.adviceVoid(performInfoList);
|
||||
public R<?> adviceVoid(AdviceExecuteParam adviceExecuteParam) {
|
||||
return adviceProcessAppService.adviceVoid(adviceExecuteParam);
|
||||
}
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IInpatientMedicineCollectionAppService;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IMedicineSummaryAppService;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientMedicinePrescriptionInfoDto;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -22,13 +22,13 @@ import lombok.extern.slf4j.Slf4j;
|
||||
* @date 2025/8/18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/nurse-station/inpatient-medicine-collection")
|
||||
@RequestMapping("/nurse-station/medicine-summary")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class InpatientMedicineCollectionController {
|
||||
public class MedicineSummaryController {
|
||||
|
||||
@Resource
|
||||
public IInpatientMedicineCollectionAppService medicineCollectionService;
|
||||
public IMedicineSummaryAppService medicineCollectionService;
|
||||
|
||||
/**
|
||||
* 分页查询在科病人列表
|
||||
@@ -56,7 +56,7 @@ public class InpatientMedicineCollectionController {
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
*/
|
||||
@GetMapping("/prescription-list")
|
||||
@GetMapping("/advice-list")
|
||||
public R<?> getPatientInfoList(InpatientMedicineSearchParam searchParam, String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
@@ -25,6 +25,17 @@ public class AdviceExecuteDetailParam {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long requestId;
|
||||
|
||||
/** 账号id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/** 执行id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long procedureId;
|
||||
|
||||
/** 医嘱类型 */
|
||||
private Integer therapyEnum;
|
||||
|
||||
/** 医嘱请求所在表 */
|
||||
private String adviceTable;
|
||||
|
||||
|
@@ -30,6 +30,10 @@ public class InpatientAdviceDto {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long encounterId;
|
||||
|
||||
/** 患者id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patientId;
|
||||
|
||||
/** 医嘱所在表 */
|
||||
private String adviceTable; // 1:药品 , 2: 耗材 , 3:项目
|
||||
/**
|
||||
@@ -199,7 +203,7 @@ public class InpatientAdviceDto {
|
||||
private String patientName;
|
||||
|
||||
/** 床位名称 */
|
||||
private String badName;
|
||||
private String bedName;
|
||||
|
||||
/** 性别 */
|
||||
private Integer genderEnum;
|
||||
@@ -226,4 +230,16 @@ public class InpatientAdviceDto {
|
||||
|
||||
/** 余额 */
|
||||
private BigDecimal balanceAmount;
|
||||
|
||||
/**
|
||||
* 账号id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/**
|
||||
* 校对人id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long performerCheckId;
|
||||
}
|
||||
|
@@ -3,6 +3,8 @@
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
@@ -6,6 +6,8 @@ package com.openhis.web.inhospitalnursestation.dto;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.medication.domain.MedicationRequest;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -21,6 +23,12 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class MedicationRequestUseExe extends MedicationRequest {
|
||||
|
||||
/**
|
||||
* 账号id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/** 执行时间点集合 */
|
||||
private List<String> executeTimes;
|
||||
|
||||
|
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.inhospitalnursestation.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.workflow.domain.ServiceRequest;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 诊疗请求用于执行
|
||||
*
|
||||
* @author zwh
|
||||
* @date 2025-07-28
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ServiceRequestUseExe extends ServiceRequest {
|
||||
|
||||
/**
|
||||
* 账号id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long accountId;
|
||||
|
||||
/** 执行时间点集合 */
|
||||
private List<String> executeTimes;
|
||||
|
||||
/**
|
||||
* 执行时间点集合数量
|
||||
*/
|
||||
private BigDecimal executeTimesNum;
|
||||
|
||||
}
|
@@ -157,8 +157,8 @@ public class LossReportFormAppServiceImpl implements ILossReportFormAppService {
|
||||
*/
|
||||
private List<LocationDto> buildTree(List<Location> records) {
|
||||
// 按b_no的层级排序,确保父节点先处理
|
||||
List<Location> sortedRecords = records.stream()
|
||||
.sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList());
|
||||
List<Location> sortedRecords =
|
||||
records.stream().sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).toList();
|
||||
|
||||
Map<String, LocationDto> nodeMap = new HashMap<>();
|
||||
List<LocationDto> tree = new ArrayList<>();
|
||||
@@ -228,8 +228,7 @@ public class LossReportFormAppServiceImpl implements ILossReportFormAppService {
|
||||
List<String> idList = new ArrayList<>();
|
||||
|
||||
// 单据号取得
|
||||
List<String> busNoList =
|
||||
lossReportFormDtoList.stream().map(LossReportFormDto::getBusNo).collect(Collectors.toList());
|
||||
List<String> busNoList = lossReportFormDtoList.stream().map(LossReportFormDto::getBusNo).toList();
|
||||
// 请求数据取得
|
||||
List<SupplyRequest> requestList = supplyRequestService.getSupplyByBusNo(busNoList.get(0));
|
||||
if (!requestList.isEmpty()) {
|
||||
@@ -245,20 +244,20 @@ public class LossReportFormAppServiceImpl implements ILossReportFormAppService {
|
||||
SupplyRequest supplyRequest = new SupplyRequest();
|
||||
BeanUtils.copyProperties(lossReportFormDto, supplyRequest);
|
||||
supplyRequest.setPurposeLocationId(lossReportFormDto.getLossLocationId())
|
||||
.setPurposeLocationStoreId(lossReportFormDto.getLossLocationStoreId())
|
||||
.setPurposeTypeEnum(lossReportFormDto.getLossTypeEnum()).setReason(lossReportFormDto.getLossReason());
|
||||
.setPurposeLocationStoreId(lossReportFormDto.getLossLocationStoreId())
|
||||
.setPurposeTypeEnum(lossReportFormDto.getLossTypeEnum()).setReason(lossReportFormDto.getLossReason());
|
||||
// 生成待发送的报损单据
|
||||
supplyRequest
|
||||
// id
|
||||
.setId(null)
|
||||
// 单据分类:库存供应
|
||||
.setCategoryEnum(SupplyCategory.STOCK_SUPPLY.getValue())
|
||||
// 单据类型:报损单
|
||||
.setTypeEnum(SupplyType.LOSS_REPORT_FORM.getValue())
|
||||
// 制单人
|
||||
.setApplicantId(SecurityUtils.getLoginUser().getPractitionerId())
|
||||
// 制单日期
|
||||
.setApplyTime(DateUtils.getNowDate());
|
||||
// id
|
||||
.setId(null)
|
||||
// 单据分类:库存供应
|
||||
.setCategoryEnum(SupplyCategory.STOCK_SUPPLY.getValue())
|
||||
// 单据类型:报损单
|
||||
.setTypeEnum(SupplyType.LOSS_REPORT_FORM.getValue())
|
||||
// 制单人
|
||||
.setApplicantId(SecurityUtils.getLoginUser().getPractitionerId())
|
||||
// 制单日期
|
||||
.setApplyTime(DateUtils.getNowDate());
|
||||
supplyRequestList.add(supplyRequest);
|
||||
|
||||
}
|
||||
@@ -269,8 +268,7 @@ public class LossReportFormAppServiceImpl implements ILossReportFormAppService {
|
||||
// 请求id取得
|
||||
List<SupplyRequest> supplyRequestIdList = supplyRequestService.getSupplyByBusNo(busNoList.get(0));
|
||||
// 返回请求id列表
|
||||
List<Long> requestIdList =
|
||||
supplyRequestIdList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
|
||||
List<Long> requestIdList = supplyRequestIdList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
|
||||
for (Long list : requestIdList) {
|
||||
idList.add(list.toString());
|
||||
}
|
||||
@@ -320,6 +318,7 @@ public class LossReportFormAppServiceImpl implements ILossReportFormAppService {
|
||||
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 报损单据详情
|
||||
*
|
||||
@@ -331,12 +330,14 @@ public class LossReportFormAppServiceImpl implements ILossReportFormAppService {
|
||||
* @return 单据详情
|
||||
*/
|
||||
@Override
|
||||
public R<?> getMonthlySettlementDetail(Long locationId, String startTime, String endTime,Integer pageNo, Integer pageSize){
|
||||
public R<?> getMonthlySettlementDetail(Long locationId, String startTime, String endTime, Integer pageNo,
|
||||
Integer pageSize) {
|
||||
|
||||
Page<ReceiptDetailDto> receiptDetailList = lossReportFormMapper.getMonthlySettlementDetail(new Page<>(pageNo, pageSize),
|
||||
locationId,startTime, endTime,ItemType.MEDICINE.getValue(), ItemType.DEVICE.getValue(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,SupplyType.LOSS_REPORT_FORM.getValue(),
|
||||
SupplyStatus.AGREE.getValue());
|
||||
Page<ReceiptDetailDto> receiptDetailList =
|
||||
lossReportFormMapper.getMonthlySettlementDetail(new Page<>(pageNo, pageSize), locationId, startTime,
|
||||
endTime, ItemType.MEDICINE.getValue(), ItemType.DEVICE.getValue(),
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
SupplyType.LOSS_REPORT_FORM.getValue(), SupplyStatus.AGREE.getValue());
|
||||
|
||||
return R.ok(receiptDetailList);
|
||||
}
|
||||
|
@@ -251,7 +251,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
inventoryItemService.updateInventoryQuantity(inventoryItemPurpose.getId(), minQuantity, now);
|
||||
|
||||
if (!aBoolean) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
throw new ServiceException("系统异常,请稍后重试");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -296,6 +296,14 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
if (agreedList.isEmpty()) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
// 获取审批通过后的供应请求id列表
|
||||
List<Long> supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
|
||||
|
||||
// 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过)
|
||||
boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList);
|
||||
if (validation) {
|
||||
throw new ServiceException("请勿重复审批");
|
||||
}
|
||||
// 根据单据,生成供应发放单
|
||||
List<SupplyDelivery> deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now);
|
||||
if (deliveredList.isEmpty()) {
|
||||
@@ -340,7 +348,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
Boolean aBoolean =
|
||||
inventoryItemService.updateInventoryQuantity(inventoryItem.getId(), minQuantity, now);
|
||||
if (!aBoolean) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
throw new ServiceException("系统异常,请稍后重试");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -385,6 +393,14 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
if (agreedList.isEmpty()) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
// 获取审批通过后的供应请求id列表
|
||||
List<Long> supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
|
||||
|
||||
// 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过)
|
||||
boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList);
|
||||
if (validation) {
|
||||
throw new ServiceException("请勿重复审批");
|
||||
}
|
||||
// 根据单据,发放物品
|
||||
List<SupplyDelivery> deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now);
|
||||
if (deliveredList.isEmpty()) {
|
||||
@@ -418,7 +434,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) {
|
||||
if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Inventory.M00002, null));
|
||||
throw new ServiceException("操作失败,库存数量不足");
|
||||
} else {
|
||||
// 源仓库库存-(调拨数量*拆零比)
|
||||
minQuantity = minQuantity.subtract(
|
||||
@@ -427,7 +443,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
} else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) {
|
||||
if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Inventory.M00002, null));
|
||||
throw new ServiceException("操作失败,库存数量不足");
|
||||
} else {
|
||||
// 供应申请的物品计量单位与最小单位相同
|
||||
// 源仓库库存-调拨数量
|
||||
@@ -438,7 +454,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
Boolean aBoolean =
|
||||
inventoryItemService.updateInventoryQuantity(inventoryItemSource.getId(), minQuantity, now);
|
||||
if (!aBoolean) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
throw new ServiceException("系统异常,请稍后重试");
|
||||
}
|
||||
|
||||
// 添加到出库列表
|
||||
@@ -459,6 +475,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
if (inventoryItemPurpose == null) {
|
||||
// 供应申请的物品计量单位与最小单位相同
|
||||
if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) {
|
||||
//todo:不理解的代码,可能会因为四舍五入影响总价值
|
||||
// 采购单价=单价*拆零比
|
||||
supplyItemDetailDto
|
||||
.setPrice(supplyItemDetailDto.getPrice().multiply(supplyItemDetailDto.getPartPercent()));
|
||||
@@ -485,7 +502,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
inventoryItemService.updateInventoryQuantity(inventoryItemPurpose.getId(), minQuantity, now);
|
||||
|
||||
if (!bBoolean) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
throw new ServiceException("系统异常,请稍后重试");
|
||||
}
|
||||
}
|
||||
// 添加到入库列表
|
||||
@@ -526,7 +543,14 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
if (agreedList.isEmpty()) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
// 获取审批通过后的供应请求id列表
|
||||
List<Long> supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
|
||||
|
||||
// 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过)
|
||||
boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList);
|
||||
if (validation) {
|
||||
throw new ServiceException("请勿重复审批");
|
||||
}
|
||||
// 根据单据,发放物品
|
||||
List<SupplyDelivery> deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now);
|
||||
if (deliveredList.isEmpty()) {
|
||||
@@ -555,7 +579,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) {
|
||||
if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Inventory.M00002, null));
|
||||
throw new ServiceException("操作失败,库存数量不足");
|
||||
} else {
|
||||
// 仓库库存-(退货数量*拆零比)
|
||||
minQuantity = minQuantity.subtract(
|
||||
@@ -564,7 +588,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
} else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) {
|
||||
if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Inventory.M00002, null));
|
||||
throw new ServiceException("操作失败,库存数量不足");
|
||||
} else {
|
||||
// 供应申请的物品计量单位与最小单位相同
|
||||
// 仓库库存-退货数量
|
||||
@@ -577,7 +601,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
inventoryItemService.updateInventoryQuantity(inventoryItemSource.getId(), minQuantity, now);
|
||||
|
||||
if (!aBoolean) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
throw new ServiceException("系统异常,请稍后重试");
|
||||
}
|
||||
|
||||
// 退货数量等于库存数量时,删除库存数据
|
||||
@@ -617,6 +641,14 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
if (agreedList.isEmpty()) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
// 获取审批通过后的供应请求id列表
|
||||
List<Long> supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
|
||||
|
||||
// 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过)
|
||||
boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList);
|
||||
if (validation) {
|
||||
throw new ServiceException("请勿重复审批");
|
||||
}
|
||||
// 根据单据,生成供应发放单
|
||||
List<SupplyDelivery> deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now);
|
||||
if (deliveredList.isEmpty()) {
|
||||
@@ -644,7 +676,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) {
|
||||
if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail("操作失败,库存数量不足");
|
||||
throw new ServiceException("操作失败,库存数量不足");
|
||||
} else {
|
||||
// 目的仓库库存-(报损数量*拆零比)
|
||||
minQuantity = minQuantity.subtract(
|
||||
@@ -653,7 +685,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
} else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) {
|
||||
if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail("操作失败,库存数量不足");
|
||||
throw new ServiceException("操作失败,库存数量不足");
|
||||
} else {
|
||||
// 供应申请的物品计量单位与最小单位相同
|
||||
// 目的仓库库存-报损数量
|
||||
@@ -664,7 +696,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
Boolean aBoolean =
|
||||
inventoryItemService.updateInventoryQuantity(inventoryItem.getId(), minQuantity, now);
|
||||
if (!aBoolean) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
throw new ServiceException("系统异常,请稍后重试");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -701,6 +733,14 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
if (agreedList.isEmpty()) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
// 获取审批通过后的供应请求id列表
|
||||
List<Long> supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
|
||||
|
||||
// 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过)
|
||||
boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList);
|
||||
if (validation) {
|
||||
throw new ServiceException("请勿重复审批");
|
||||
}
|
||||
// 根据单据,发放物品
|
||||
List<SupplyDelivery> deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now);
|
||||
if (deliveredList.isEmpty()) {
|
||||
@@ -727,7 +767,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) {
|
||||
if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Inventory.M00002, null));
|
||||
throw new ServiceException("操作失败,库存数量不足");
|
||||
} else {
|
||||
// 源仓库库存-(领用数量*拆零比)
|
||||
minQuantity = minQuantity.subtract(
|
||||
@@ -736,7 +776,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
} else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) {
|
||||
if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) {
|
||||
// 库存数量不足
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Inventory.M00002, null));
|
||||
throw new ServiceException("操作失败,库存数量不足");
|
||||
} else {
|
||||
// 供应申请的物品计量单位与最小单位相同
|
||||
// 源仓库库存-领用数量
|
||||
@@ -786,6 +826,14 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
if (agreedList.isEmpty()) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
// 获取审批通过后的供应请求id列表
|
||||
List<Long> supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList());
|
||||
|
||||
// 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过)
|
||||
boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList);
|
||||
if (validation) {
|
||||
throw new ServiceException("请勿重复审批");
|
||||
}
|
||||
// 根据单据,发放物品
|
||||
List<SupplyDelivery> deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now);
|
||||
if (deliveredList.isEmpty()) {
|
||||
@@ -831,7 +879,7 @@ public class ReceiptApprovalAppServiceImpl implements IReceiptApprovalAppService
|
||||
Boolean bBoolean =
|
||||
inventoryItemService.updateInventoryQuantity(inventoryItemPurpose.getId(), minQuantity, now);
|
||||
if (!bBoolean) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
throw new ServiceException("系统异常,请稍后重试");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,6 @@ package com.openhis.web.inventorymanage.dto;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
@@ -43,6 +42,10 @@ public class LossReportFormDto {
|
||||
@NotNull
|
||||
private BigDecimal itemQuantity;
|
||||
|
||||
/** 合计数量 */
|
||||
@NotNull
|
||||
private BigDecimal totalQuantity;
|
||||
|
||||
/** 物品编码 */
|
||||
@NotNull
|
||||
private Long itemId;
|
||||
@@ -78,7 +81,7 @@ public class LossReportFormDto {
|
||||
private Date applyTime;
|
||||
|
||||
/** 审批人 */
|
||||
//@NotNull
|
||||
// @NotNull
|
||||
private Long approverId;
|
||||
|
||||
/** 审批日期 */
|
||||
|
@@ -12,8 +12,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import com.openhis.web.common.dto.UnitDto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -38,6 +38,9 @@ public class ReceiptDetailDto {
|
||||
/** 当前库存总数/实盘数量 */
|
||||
private BigDecimal totalQuantity;
|
||||
|
||||
/** 报损前数量 */
|
||||
private BigDecimal oldQuantity;
|
||||
|
||||
/** 数量 */
|
||||
private BigDecimal itemQuantity;
|
||||
|
||||
|
@@ -16,4 +16,20 @@ public interface IReviewPrescriptionRecordsAppService {
|
||||
*/
|
||||
R<?> reviewPrescription(ReviewPrescriptionRecordsDto reviewPrescriptionRecordsDto);
|
||||
|
||||
/**
|
||||
* 通过处方号查询审方记录
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
* @return 审方记录
|
||||
*/
|
||||
R<?> getReviewByPrescriptionNo(String prescriptionNo);
|
||||
|
||||
/**
|
||||
* 通过就诊id查询审方记录
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 审方记录
|
||||
*/
|
||||
R<?> getReviewByEncounterId(Long encounterId);
|
||||
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.ChargeItemStatus;
|
||||
import com.openhis.common.enums.Whether;
|
||||
import com.openhis.jlau.domain.ReviewPrescriptionRecords;
|
||||
import com.openhis.jlau.service.IReviewPrescriptionRecordsService;
|
||||
import com.openhis.web.jlau.appservice.IReviewPrescriptionRecordsAppService;
|
||||
@@ -92,4 +93,30 @@ public class ReviewPrescriptionRecordsAppServiceImpl implements IReviewPrescript
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"审核处方"}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过处方号查询审方记录
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
* @return 审方记录
|
||||
*/
|
||||
@Override
|
||||
public R<?> getReviewByPrescriptionNo(String prescriptionNo) {
|
||||
List<ReviewPrescriptionRecordsDto> reviewPrescriptionRecords =
|
||||
reviewPrescriptionRecordsAppMapper.getReviewPrescriptionRecords(prescriptionNo, null, null);
|
||||
return R.ok(reviewPrescriptionRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过就诊id查询审方记录
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 审方记录
|
||||
*/
|
||||
@Override
|
||||
public R<?> getReviewByEncounterId(Long encounterId) {
|
||||
List<ReviewPrescriptionRecordsDto> reviewPrescriptionRecords =
|
||||
reviewPrescriptionRecordsAppMapper.getReviewPrescriptionRecords(null, encounterId, Whether.YES.getValue());
|
||||
return R.ok(reviewPrescriptionRecords);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -3,15 +3,11 @@
|
||||
*/
|
||||
package com.openhis.web.jlau.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.jlau.dto.ReviewPrescriptionRecordsDto;
|
||||
import com.openhis.web.regdoctorstation.dto.NursingOrdersSaveDto;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.jlau.appservice.IReviewPrescriptionRecordsAppService;
|
||||
import com.openhis.web.jlau.dto.ReviewPrescriptionRecordsDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -38,4 +34,26 @@ public class ReviewPrescriptionRecordsController {
|
||||
return iReviewPrescriptionRecordsAppService.reviewPrescription(reviewPrescriptionRecordsDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过处方号查询审方记录
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
* @return 审方记录
|
||||
*/
|
||||
@GetMapping(value = "/review-by-prescription-no")
|
||||
public R<?> getReviewByPrescriptionNo(@RequestParam(value = "prescriptionNo") String prescriptionNo) {
|
||||
return iReviewPrescriptionRecordsAppService.getReviewByPrescriptionNo(prescriptionNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过就诊id查询审方记录
|
||||
*
|
||||
* @param encounterId 就诊id
|
||||
* @return 审方记录
|
||||
*/
|
||||
@GetMapping(value = "/review-by-encounter")
|
||||
public R<?> getReviewByEncounterId(@RequestParam(value = "encounterId") Long encounterId) {
|
||||
return iReviewPrescriptionRecordsAppService.getReviewByEncounterId(encounterId);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -47,4 +47,9 @@ public class ReviewPrescriptionRecordsDto {
|
||||
*/
|
||||
private String reasonText;
|
||||
|
||||
/**
|
||||
* 审方人
|
||||
*/
|
||||
private String practitionerName;
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,27 @@
|
||||
package com.openhis.web.jlau.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.openhis.web.jlau.dto.ReviewPrescriptionRecordsDto;
|
||||
|
||||
/**
|
||||
* 农大审方记录 应用Mapper
|
||||
*/
|
||||
@Repository
|
||||
public interface ReviewPrescriptionRecordsAppMapper {
|
||||
|
||||
/**
|
||||
* 查询农大审方记录
|
||||
*
|
||||
* @param prescriptionNo 处方号
|
||||
* @param encounterId 就诊id
|
||||
* @param passFlag 通过标识
|
||||
* @return 农大审方记录
|
||||
*/
|
||||
List<ReviewPrescriptionRecordsDto> getReviewPrescriptionRecords(@Param("prescriptionNo") String prescriptionNo,
|
||||
@Param("encounterId") Long encounterId, @Param("passFlag") Integer passFlag);
|
||||
|
||||
}
|
||||
|
@@ -306,19 +306,19 @@ public class OutpatientTreatmentAppServiceImpl implements IOutpatientTreatmentAp
|
||||
// 判断该项目是否已经执行了
|
||||
if (performCount - cancelCount < exeCount) {
|
||||
// 未执行则新增执行记录
|
||||
boolean result = procedureService.addProcedureRecord(encounterId, patientId, requestId,
|
||||
Long procedureId = procedureService.addProcedureRecord(encounterId, patientId, requestId,
|
||||
performInfoDto.getRequestTable(), EventStatus.COMPLETED,
|
||||
ProcedureCategory.OUTPATIENT_ADVICE, null, groupId, null);
|
||||
if (!result) {
|
||||
ProcedureCategory.OUTPATIENT_ADVICE, null, DateUtils.getNowDate(), groupId, null);
|
||||
if (procedureId == null) {
|
||||
throw new ServiceException("执行失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 新增执行记录
|
||||
boolean result = procedureService.addProcedureRecord(encounterId, patientId, requestId,
|
||||
Long procedureId = procedureService.addProcedureRecord(encounterId, patientId, requestId,
|
||||
performInfoDto.getRequestTable(), EventStatus.COMPLETED, ProcedureCategory.OUTPATIENT_ADVICE,
|
||||
null, groupId, null);
|
||||
if (!result) {
|
||||
null, DateUtils.getNowDate(), groupId, null);
|
||||
if (procedureId == null) {
|
||||
throw new ServiceException("执行失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
@@ -469,11 +469,11 @@ public class OutpatientTreatmentAppServiceImpl implements IOutpatientTreatmentAp
|
||||
// 判断该项目是否已经执行了
|
||||
if (performCount - cancelCount > 0) {
|
||||
// 已执行则新增取消执行记录
|
||||
boolean result = procedureService.addProcedureRecord(procedure.getEncounterId(),
|
||||
Long procedureId = procedureService.addProcedureRecord(procedure.getEncounterId(),
|
||||
procedure.getPatientId(), procedure.getRequestId(), procedure.getRequestTable(),
|
||||
EventStatus.CANCEL, ProcedureCategory.OUTPATIENT_ADVICE, performInfoDto.getLocationId(),
|
||||
performInfoDto.getGroupId(), null);
|
||||
if (!result) {
|
||||
DateUtils.getNowDate(), performInfoDto.getGroupId(), null);
|
||||
if (procedureId == null) {
|
||||
throw new ServiceException("取消执行失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
@@ -166,22 +166,13 @@ public class PatientInformationServiceImpl implements IPatientInformationService
|
||||
public R<?> editPatient(PatientInformationDto patientInformationDto) {
|
||||
// 如果患者没有输入身份证号则根据年龄自动生成
|
||||
String idCard = patientInformationDto.getIdCard();
|
||||
Date birthday = null;
|
||||
// if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) {
|
||||
// idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge());
|
||||
// Date birthday = IdCardUtil.extractBirthdayFromIdCard(idCard);
|
||||
// patientInformationDto.setIdCard(idCard).setBirthDate(birthday);
|
||||
// }
|
||||
if (idCard != null && !idCard.isEmpty()) {
|
||||
birthday = IdCardUtil.extractBirthdayFromIdCard(idCard);
|
||||
patientInformationDto.setIdCard(idCard).setBirthDate(birthday);
|
||||
if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) {
|
||||
if (patientInformationDto.getAge() != null) {
|
||||
idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge());
|
||||
Date birthday = IdCardUtil.extractBirthdayFromIdCard(idCard);
|
||||
patientInformationDto.setIdCard(idCard).setBirthDate(birthday);
|
||||
}
|
||||
}
|
||||
// if(idCard==null&&patientInformationDto.getAge() != null)
|
||||
// {
|
||||
// idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge());
|
||||
// birthday = IdCardUtil.extractBirthdayFromIdCard(idCard);
|
||||
// patientInformationDto.setIdCard(idCard).setBirthDate(birthday);
|
||||
// }
|
||||
Patient patient = new Patient();
|
||||
BeanUtils.copyProperties(patientInformationDto, patient);
|
||||
|
||||
@@ -232,22 +223,13 @@ public class PatientInformationServiceImpl implements IPatientInformationService
|
||||
public R<?> addPatient(PatientInformationDto patientInformationDto) {
|
||||
// 如果患者没有输入身份证号则根据年龄自动生成
|
||||
String idCard = patientInformationDto.getIdCard();
|
||||
Date birthday = null;
|
||||
// if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) {
|
||||
// idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge());
|
||||
// Date birthday = IdCardUtil.extractBirthdayFromIdCard(idCard);
|
||||
// patientInformationDto.setIdCard(idCard).setBirthDate(birthday);
|
||||
// }
|
||||
if (idCard != null && !idCard.isEmpty()) {
|
||||
birthday = IdCardUtil.extractBirthdayFromIdCard(idCard);
|
||||
patientInformationDto.setIdCard(idCard).setBirthDate(birthday);
|
||||
if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) {
|
||||
if (patientInformationDto.getAge() != null) {
|
||||
idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge());
|
||||
Date birthday = IdCardUtil.extractBirthdayFromIdCard(idCard);
|
||||
patientInformationDto.setIdCard(idCard).setBirthDate(birthday);
|
||||
}
|
||||
}
|
||||
// if(idCard==null&&patientInformationDto.getAge() != null)
|
||||
// {
|
||||
// idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge());
|
||||
// birthday = IdCardUtil.extractBirthdayFromIdCard(idCard);
|
||||
// patientInformationDto.setIdCard(idCard).setBirthDate(birthday);
|
||||
// }
|
||||
Patient patient = new Patient();
|
||||
BeanUtils.copyProperties(patientInformationDto, patient);
|
||||
patient.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.PATIENT_NUM.getPrefix(), 10));
|
||||
@@ -269,9 +251,8 @@ public class PatientInformationServiceImpl implements IPatientInformationService
|
||||
.setIdentifierNo(patientInformationDto.getIdentifierNo())
|
||||
// 标识状态默认:常规
|
||||
.setStateEnum(IdentifierStatusEnum.USUAL.getValue());
|
||||
boolean resPatId = patientIdentifierService.save(patientIdentifier);
|
||||
|
||||
return resPatient && resPatId
|
||||
boolean result = patientIdentifierService.save(patientIdentifier);
|
||||
return result
|
||||
? R.ok(patient, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"病人信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"病人信息"}));
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ public interface IPaymentRecService {
|
||||
* @param request 请求参数
|
||||
* @return 结果
|
||||
*/
|
||||
IPage<PaymentVO> getPage(String searchKey, Integer kingEnum, Integer pageNo, Integer pageSize,
|
||||
IPage<PaymentVO> getPage(String searchKey, Integer kingEnum,String invoiceNo, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request);
|
||||
|
||||
/**
|
||||
|
@@ -749,16 +749,15 @@ public class PaymentRecServiceImpl implements IPaymentRecService {
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public IPage<PaymentVO> getPage(String searchKey, Integer kingEnum, Integer pageNo, Integer pageSize,
|
||||
public IPage<PaymentVO> getPage(String searchKey, Integer kingEnum, String invoiceNo,Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<PaymentVO> queryWrapper = HisQueryUtils.buildQueryWrapper(new PaymentVO(), searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.EncounterId, CommonConstants.FieldName.ContractNo,
|
||||
CommonConstants.FieldName.paymentNo)),
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientName, CommonConstants.FieldName.paymentNo)),
|
||||
request);
|
||||
// queryWrapper.eq(PaymentVO::getStatusEnum,PaymentStatus.SUCCESS.getValue()).or().eq(PaymentVO::getStatusEnum,PaymentStatus.REFUND_ALL.getValue());
|
||||
queryWrapper.in("status_enum", PaymentStatus.SUCCESS.getValue(), PaymentStatus.REFUND_ALL.getValue());
|
||||
IPage<PaymentVO> paymentDtoIPage = paymentMapper.getPage(new Page<>(pageNo, pageSize), kingEnum, queryWrapper);
|
||||
IPage<PaymentVO> paymentDtoIPage = paymentMapper.getPage(new Page<>(pageNo, pageSize), kingEnum, invoiceNo,queryWrapper);
|
||||
|
||||
for (PaymentVO record : paymentDtoIPage.getRecords()) {
|
||||
record.setPaymentId(record.getId().toString());
|
||||
|
@@ -3,11 +3,13 @@
|
||||
*/
|
||||
package com.openhis.web.paymentmanage.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.web.paymentmanage.dto.CancelPaymentInpatientDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -84,14 +86,18 @@ public class PaymentReconciliationController {
|
||||
if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) {
|
||||
paymentRecon = (PaymentReconciliation)result.getData();
|
||||
}
|
||||
R<?> eleResult = eleInvoiceService.invoiceMZMake(paymentRecon.getId(), paymentDto.getEncounterId());
|
||||
Map detail = iChargeBillService.getDetail(paymentRecon.getId());
|
||||
if (eleResult.getCode() != 200) {
|
||||
// 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
||||
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
|
||||
Map detail=iChargeBillService.getDetail(paymentRecon.getId());
|
||||
if("0".equals(SecurityUtils.getLoginUser().getOptionJson().getString("forwardSwitch"))) {
|
||||
return R.ok(detail);
|
||||
}else {
|
||||
R<?> eleResult = eleInvoiceService.invoiceMZMake(paymentRecon.getId(), paymentDto.getEncounterId());
|
||||
if (eleResult.getCode() != 200) {
|
||||
// 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
||||
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
// Map detail = iChargeBillService.getDetail(paymentRecon.getId());
|
||||
return R.ok(detail);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -110,12 +116,15 @@ public class PaymentReconciliationController {
|
||||
if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) {
|
||||
paymentRecon = (PaymentReconciliation)result.getData();
|
||||
}
|
||||
R<?> eleResult =
|
||||
eleInvoiceService.invoiceWriteoff(paymentRecon.getRelationId(), cancelPaymentDto.getReason());
|
||||
if (eleResult.getCode() != 200) {
|
||||
// 因取消付款成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
||||
return R.ok(null, " 取消付款成功,电子发票开具失败 :" + eleResult.getMsg());
|
||||
if(!"0".equals(SecurityUtils.getLoginUser().getOptionJson().getString("forwardSwitch"))) {
|
||||
R<?> eleResult =
|
||||
eleInvoiceService.invoiceWriteoff(paymentRecon.getRelationId(), cancelPaymentDto.getReason());
|
||||
if (eleResult.getCode() != 200) {
|
||||
// 因取消付款成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
||||
return R.ok(null, " 取消付款成功,电子发票开具失败 :" + eleResult.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -132,9 +141,10 @@ public class PaymentReconciliationController {
|
||||
@GetMapping("/page")
|
||||
public R<?> paymentPage(@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "kinsEnum", defaultValue = "") Integer kinsEnum,
|
||||
@RequestParam(value = "invoiceNo", defaultValue = "") String invoiceNo,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return R.ok(paymentReconciliationService.getPage(searchKey, kinsEnum, pageNo, pageSize, request));
|
||||
return R.ok(paymentReconciliationService.getPage(searchKey, kinsEnum, invoiceNo,pageNo, pageSize, request));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,21 +178,24 @@ public class PaymentReconciliationController {
|
||||
@PostMapping("/reg-pay")
|
||||
public R<?> regPay(@Valid @RequestBody OutpatientRegistrationSettleParam outpatientRegistrationAddParam) {
|
||||
R<?> result = paymentReconciliationService.regPay(outpatientRegistrationAddParam,
|
||||
outpatientRegistrationAddParam.getChrgBchno(), outpatientRegistrationAddParam.getPaymentDetails());
|
||||
outpatientRegistrationAddParam.getChrgBchno(), outpatientRegistrationAddParam.getPaymentDetails());
|
||||
// 付款成功后,开具发票
|
||||
if (result.getCode() == 200) {
|
||||
PaymentReconciliation paymentRecon = null;
|
||||
if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) {
|
||||
paymentRecon = (PaymentReconciliation)result.getData();
|
||||
}
|
||||
Long encounterId = paymentRecon.getEncounterId();
|
||||
R<?> eleResult = eleInvoiceService.invoiceRegMake(paymentRecon.getId(), encounterId);
|
||||
Map detail = iChargeBillService.getDetail(paymentRecon.getId());
|
||||
if (eleResult.getCode() != 200) {
|
||||
// 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
||||
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
|
||||
Long encounterId = paymentRecon.getEncounterId();
|
||||
if("0".equals(SecurityUtils.getLoginUser().getOptionJson().getString("forwardSwitch"))) {
|
||||
return R.ok(detail);
|
||||
}else {
|
||||
R<?> eleResult = eleInvoiceService.invoiceRegMake(paymentRecon.getId(), encounterId);
|
||||
if (eleResult.getCode() != 200) {
|
||||
// 因收费成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok
|
||||
return R.ok(detail, " 收费成功,电子发票开具失败 :" + eleResult.getMsg());
|
||||
}
|
||||
}
|
||||
return R.ok(detail);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ public interface PaymentMapper {
|
||||
* @param queryWrapper
|
||||
* @return
|
||||
*/
|
||||
IPage<PaymentVO> getPage(@Param("page") Page<Object> page, @Param("kindEnum") Integer kindEnum,
|
||||
IPage<PaymentVO> getPage(@Param("page") Page<Object> page, @Param("kindEnum") Integer kindEnum, @Param("invoiceNo") String invoiceNo,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<PaymentVO> queryWrapper);
|
||||
|
||||
/**
|
||||
|
@@ -1,11 +1,11 @@
|
||||
package com.openhis.web.pharmacymanage.appservice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.pharmacymanage.dto.InpatientMedicineSearchParam;
|
||||
|
||||
import java.util.List;
|
||||
import com.openhis.web.pharmacymanage.dto.MedicineSummarySearchParam;
|
||||
|
||||
/**
|
||||
* 住院汇总发药 应用实现接口
|
||||
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
* @author yuxj
|
||||
* @date 2025/6/3
|
||||
*/
|
||||
public interface IInpatientMedicineSummaryDispenseAppService {
|
||||
public interface ISummaryDispenseMedicineAppService {
|
||||
|
||||
/**
|
||||
* 页面初始化
|
||||
@@ -31,7 +31,7 @@ public interface IInpatientMedicineSummaryDispenseAppService {
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
*/
|
||||
R<?> getMedicationSummaryInfo(InpatientMedicineSearchParam searchParam, String searchKey, Integer pageNo,
|
||||
R<?> getMedicationSummaryInfo(MedicineSummarySearchParam searchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,7 @@ public interface IInpatientMedicineSummaryDispenseAppService {
|
||||
* @param searchParam 条件
|
||||
* @return 处理结果
|
||||
*/
|
||||
R<?> medicineDispense(List<InpatientMedicineSearchParam> searchParam);
|
||||
R<?> SummaryDispenseMedicine(List<MedicineSummarySearchParam> searchParam);
|
||||
|
||||
/**
|
||||
* 作废
|
||||
@@ -49,5 +49,5 @@ public interface IInpatientMedicineSummaryDispenseAppService {
|
||||
* @param notPerformedReasonEnum 未发原因
|
||||
* @return 处理结果
|
||||
*/
|
||||
R<?> medicineCancel(List<Long> deliveryIdList, Integer notPerformedReasonEnum);
|
||||
R<?> dispenseCancel(List<Long> deliveryIdList, Integer notPerformedReasonEnum);
|
||||
}
|
@@ -8,6 +8,9 @@ import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.yb.dto.MedicalInventory3511Output;
|
||||
import com.openhis.yb.dto.MedicalInventory3511Param;
|
||||
import com.openhis.yb.service.YbHttpUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -117,6 +120,9 @@ public class ReturnMedicineAppServiceImpl implements IReturnMedicineAppService {
|
||||
@Resource
|
||||
private ReceiptApprovalAppServiceImpl receiptApprovalAppService;
|
||||
|
||||
@Resource
|
||||
private YbHttpUtils ybHttpUtils;
|
||||
|
||||
/**
|
||||
* 获取页面初始化信息
|
||||
*
|
||||
@@ -421,31 +427,43 @@ public class ReturnMedicineAppServiceImpl implements IReturnMedicineAppService {
|
||||
// 调用医保商品销售退货接口
|
||||
String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关
|
||||
if (Whether.YES.getCode().equals(ybSwitch)) {
|
||||
if (!medicationRefundList.isEmpty() || !devRefundList.isEmpty()) {
|
||||
List<DeviceDefinition> deviceDefinitions = new ArrayList<>();
|
||||
List<MedicationDefinition> medicationDefinitions = new ArrayList<>();
|
||||
if (!medicationRefundList.isEmpty()) {
|
||||
// 设置进销存参数
|
||||
List<MedicationDefinition> medicationDefinitions =
|
||||
medicationDefinitionService.listByIds(supplyItemDetailList.stream()
|
||||
.filter(x -> x.getItemTable().equals(CommonConstants.TableName.MED_MEDICATION_DEFINITION))
|
||||
.map(SupplyItemDetailDto::getItemId).collect(Collectors.toList()));
|
||||
List<DeviceDefinition> deviceDefinitions = deviceDefinitionService.listByIds(supplyItemDetailList
|
||||
.stream().filter(x -> x.getItemTable().equals(CommonConstants.TableName.ADM_DEVICE_DEFINITION))
|
||||
medicationDefinitions = medicationDefinitionService.listByIds(supplyItemDetailList.stream()
|
||||
.filter(x -> x.getItemTable().equals(CommonConstants.TableName.MED_MEDICATION_DEFINITION))
|
||||
.map(SupplyItemDetailDto::getItemId).collect(Collectors.toList()));
|
||||
}
|
||||
if (!devRefundList.isEmpty()) {
|
||||
deviceDefinitions = deviceDefinitionService.listByIds(supplyItemDetailList.stream()
|
||||
.filter(x -> x.getItemTable().equals(CommonConstants.TableName.ADM_DEVICE_DEFINITION))
|
||||
.map(SupplyItemDetailDto::getItemId).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
// 用itemId分组
|
||||
Map<Long, MedicationDefinition> medicationMap = medicationDefinitions.stream()
|
||||
.collect(Collectors.toMap(MedicationDefinition::getId, Function.identity()));
|
||||
Map<Long, DeviceDefinition> deviceMap =
|
||||
deviceDefinitions.stream().collect(Collectors.toMap(DeviceDefinition::getId, Function.identity()));
|
||||
// 创建映射表,添加空集合保护
|
||||
Map<Long, MedicationDefinition> medicationMap =
|
||||
medicationDefinitions != null ? medicationDefinitions.stream().filter(Objects::nonNull)
|
||||
.collect(Collectors.toMap(MedicationDefinition::getId, Function.identity())) : new HashMap<>();
|
||||
|
||||
// 设置库存变更参数
|
||||
for (SupplyItemDetailDto dto : supplyItemDetailList) {
|
||||
if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(dto.getItemTable())) {
|
||||
Map<Long, DeviceDefinition> deviceMap =
|
||||
deviceDefinitions != null ? deviceDefinitions.stream().filter(Objects::nonNull)
|
||||
.collect(Collectors.toMap(DeviceDefinition::getId, Function.identity())) : new HashMap<>();
|
||||
|
||||
// 设置库存变更参数,添加完整判空
|
||||
for (SupplyItemDetailDto dto : supplyItemDetailList) {
|
||||
if (dto == null)
|
||||
continue;
|
||||
if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(dto.getItemTable())) {
|
||||
if (dto.getItemId() != null) {
|
||||
MedicationDefinition med = medicationMap.get(dto.getItemId());
|
||||
if (med != null) {
|
||||
dto.setItemBusNo(med.getBusNo()).setPartPercent(med.getPartPercent())
|
||||
.setRxFlag(med.getRxFlag()).setYbNo(med.getYbNo());
|
||||
}
|
||||
} else if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(dto.getItemTable())) {
|
||||
}
|
||||
} else if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(dto.getItemTable())) {
|
||||
if (dto.getItemId() != null) {
|
||||
DeviceDefinition dev = deviceMap.get(dto.getItemId());
|
||||
if (dev != null) {
|
||||
dto.setItemBusNo(dev.getBusNo()).setPartPercent(dev.getPartPercent())
|
||||
@@ -453,14 +471,14 @@ public class ReturnMedicineAppServiceImpl implements IReturnMedicineAppService {
|
||||
}
|
||||
}
|
||||
}
|
||||
uploadFailedNoList = this.ybReturnIntegrated(medDispenseIdList, devDispenseIdList);
|
||||
uploadFailedNoList = receiptApprovalAppService.ybInventoryIntegrated(supplyItemDetailList,
|
||||
YbInvChgType.OTHER_OUT, DateUtils.getNowDate());
|
||||
if (uploadFailedNoList != null) {
|
||||
returnMsg = "3506商品销售退货上传错误,错误项目编码" + uploadFailedNoList;
|
||||
} else {
|
||||
returnMsg = "3506商品销售退货上传成功";
|
||||
}
|
||||
}
|
||||
uploadFailedNoList = this.ybReturnIntegrated(medDispenseIdList, devDispenseIdList);
|
||||
uploadFailedNoList = receiptApprovalAppService.ybInventoryIntegrated(supplyItemDetailList,
|
||||
YbInvChgType.OTHER_OUT, DateUtils.getNowDate());
|
||||
if (uploadFailedNoList != null) {
|
||||
returnMsg = "3506商品销售退货上传错误,错误项目编码" + uploadFailedNoList;
|
||||
} else {
|
||||
returnMsg = "3506商品销售退货上传成功";
|
||||
}
|
||||
}
|
||||
// 返回退药成功信息
|
||||
@@ -618,6 +636,21 @@ public class ReturnMedicineAppServiceImpl implements IReturnMedicineAppService {
|
||||
} else if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(dispenseInventoryDto.getItemTable())) {
|
||||
medical3506Param.setFixmedinsHilistName(CommonConstants.TableName.ADM_DEVICE_DEFINITION);
|
||||
}
|
||||
MedicalInventory3511Output medicalInventory3511Output =
|
||||
ybHttpUtils.querySalesInfo(getMedical3511Param(dispenseInventoryDto));
|
||||
medical3506Param.setMedinsProdSelNo(medicalInventory3511Output.getMedinsProdSelNo());
|
||||
return medical3506Param;
|
||||
}
|
||||
|
||||
private MedicalInventory3511Param getMedical3511Param(DispenseInventoryDto dispenseInventoryDto) {
|
||||
MedicalInventory3511Param medicalInventory3511Param = new MedicalInventory3511Param();
|
||||
|
||||
String fixmedinsCode =
|
||||
SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.FIXMEDINS_CODE);
|
||||
// TODO
|
||||
medicalInventory3511Param.setFixmedinsCode(fixmedinsCode).setMedinsListCodg(dispenseInventoryDto.getYbNo())
|
||||
.setFixmedinsBchno(dispenseInventoryDto.getLotNumber()).setBegndate(dispenseInventoryDto.getDispenseTime()).setEnddate(dispenseInventoryDto.getDispenseTime());
|
||||
|
||||
return medicalInventory3511Param;
|
||||
}
|
||||
}
|
||||
|
@@ -7,7 +7,6 @@ import java.util.stream.Stream;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.web.pharmacymanage.dto.InpatientMedicineSummaryDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -32,12 +31,13 @@ import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.medication.domain.MedicationDispense;
|
||||
import com.openhis.medication.service.IMedicationDispenseService;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IInpatientMedicineCollectionAppService;
|
||||
import com.openhis.web.pharmacymanage.appservice.IInpatientMedicineSummaryDispenseAppService;
|
||||
import com.openhis.web.pharmacymanage.dto.InpatientMedicineInitDto;
|
||||
import com.openhis.web.pharmacymanage.dto.InpatientMedicineSearchParam;
|
||||
import com.openhis.web.pharmacymanage.mapper.InpatientMedicineSummaryDispenseMapper;
|
||||
import com.openhis.web.inhospitalnursestation.appservice.IMedicineSummaryAppService;
|
||||
import com.openhis.web.pharmacymanage.appservice.ISummaryDispenseMedicineAppService;
|
||||
import com.openhis.web.pharmacymanage.dto.MedicineSummaryDto;
|
||||
import com.openhis.web.pharmacymanage.dto.MedicineSummaryInitDto;
|
||||
import com.openhis.web.pharmacymanage.dto.MedicineSummarySearchParam;
|
||||
import com.openhis.web.pharmacymanage.mapper.ReturnMedicineMapper;
|
||||
import com.openhis.web.pharmacymanage.mapper.SummaryDispenseMedicineMapper;
|
||||
import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.domain.SupplyDelivery;
|
||||
@@ -54,7 +54,7 @@ import com.openhis.workflow.service.ISupplyRequestService;
|
||||
* @date 2025/6/3
|
||||
*/
|
||||
@Service
|
||||
public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatientMedicineSummaryDispenseAppService {
|
||||
public class SummaryDispenseMedicineAppServiceImpl implements ISummaryDispenseMedicineAppService {
|
||||
|
||||
@Autowired
|
||||
private IMedicationDispenseService medicationDispenseService;
|
||||
@@ -66,7 +66,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien
|
||||
private IInventoryItemService iInventoryItemService;
|
||||
|
||||
@Autowired
|
||||
private InpatientMedicineSummaryDispenseMapper inpatientMedicineDispenseMapper;
|
||||
private SummaryDispenseMedicineMapper inpatientMedicineDispenseMapper;
|
||||
|
||||
@Autowired
|
||||
private ReturnMedicineMapper returnMedicineMapper;
|
||||
@@ -85,7 +85,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien
|
||||
private WesternMedicineDispenseAppServiceImpl westernMedicineDispenseAppServiceImpl;
|
||||
|
||||
@Autowired
|
||||
private IInpatientMedicineCollectionAppService inpatientMedicineCollectionAppService;
|
||||
private IMedicineSummaryAppService inpatientMedicineCollectionAppService;
|
||||
|
||||
/**
|
||||
* 获取页面初始化信息
|
||||
@@ -95,7 +95,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien
|
||||
@Override
|
||||
public R<?> init() {
|
||||
|
||||
InpatientMedicineInitDto initDto = new InpatientMedicineInitDto();
|
||||
MedicineSummaryInitDto initDto = new MedicineSummaryInitDto();
|
||||
|
||||
// // 获取科室下拉选列表 todo 前台直接调用共通方法
|
||||
// List<Organization> organizationList = organizationService.getList(OrganizationType.DEPARTMENT.getValue(),
|
||||
@@ -105,9 +105,9 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien
|
||||
// organization.getName())).collect(Collectors.toList());
|
||||
|
||||
// 未发药原因下拉选列表
|
||||
List<InpatientMedicineInitDto.IntegerOptions> notPerformedReasonOptions =
|
||||
List<MedicineSummaryInitDto.IntegerOptions> notPerformedReasonOptions =
|
||||
Stream.of(NotPerformedReasonEnum.values())
|
||||
.map(notPerformedReason -> new InpatientMedicineInitDto.IntegerOptions(notPerformedReason.getValue(),
|
||||
.map(notPerformedReason -> new MedicineSummaryInitDto.IntegerOptions(notPerformedReason.getValue(),
|
||||
notPerformedReason.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@@ -115,12 +115,12 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien
|
||||
List<Practitioner> applicantList = practitionerService.getList();
|
||||
|
||||
// 发药状态
|
||||
List<InpatientMedicineInitDto.IntegerOptions> dispenseStatusOptions = new ArrayList<>();
|
||||
dispenseStatusOptions.add(new InpatientMedicineInitDto.IntegerOptions(DispenseStatus.SUMMARIZED.getValue(),
|
||||
List<MedicineSummaryInitDto.IntegerOptions> dispenseStatusOptions = new ArrayList<>();
|
||||
dispenseStatusOptions.add(new MedicineSummaryInitDto.IntegerOptions(DispenseStatus.SUMMARIZED.getValue(),
|
||||
DispenseStatus.SUMMARIZED.getInfo()));
|
||||
dispenseStatusOptions.add(new InpatientMedicineInitDto.IntegerOptions(DispenseStatus.COMPLETED.getValue(),
|
||||
dispenseStatusOptions.add(new MedicineSummaryInitDto.IntegerOptions(DispenseStatus.COMPLETED.getValue(),
|
||||
DispenseStatus.COMPLETED.getInfo()));
|
||||
dispenseStatusOptions.add(new InpatientMedicineInitDto.IntegerOptions(DispenseStatus.DECLINED.getValue(),
|
||||
dispenseStatusOptions.add(new MedicineSummaryInitDto.IntegerOptions(DispenseStatus.DECLINED.getValue(),
|
||||
DispenseStatus.DECLINED.getInfo()));
|
||||
|
||||
initDto// .setDepartmentOptions(organizationOptions)
|
||||
@@ -139,37 +139,35 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien
|
||||
* @param request 请求数据
|
||||
*/
|
||||
@Override
|
||||
public R<?> getMedicationSummaryInfo(InpatientMedicineSearchParam searchParam, String searchKey, Integer pageNo,
|
||||
public R<?> getMedicationSummaryInfo(MedicineSummarySearchParam searchParam, String searchKey, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<InpatientMedicineSearchParam> queryWrapper =
|
||||
QueryWrapper<MedicineSummarySearchParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(searchParam, searchKey, null, request);
|
||||
queryWrapper.orderByDesc(CommonConstants.FieldName.applyTime);
|
||||
|
||||
// 查询医嘱详细信息
|
||||
Page<InpatientMedicineSummaryDto> prescriptionItemInfoPageDto =
|
||||
Page<MedicineSummaryDto> prescriptionItemInfoPageDto =
|
||||
inpatientMedicineDispenseMapper.selectMedicationSummaryInfo(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION,
|
||||
SupplyType.DISPENSING_ORDER.getValue(), SupplyCategory.INPATIENT_PATIENT_SUMMARY_DISPENSING.getValue());
|
||||
|
||||
List<InpatientMedicineSummaryDto.Option> unitList;
|
||||
List<MedicineSummaryDto.Option> unitList;
|
||||
// 个别项目设定
|
||||
for (InpatientMedicineSummaryDto prescriptionInfoDto : prescriptionItemInfoPageDto
|
||||
.getRecords()) {
|
||||
for (MedicineSummaryDto prescriptionInfoDto : prescriptionItemInfoPageDto.getRecords()) {
|
||||
// 状态
|
||||
prescriptionInfoDto.setStatusEnum_enumText(
|
||||
EnumUtils.getInfoByValue(DispenseStatus.class, prescriptionInfoDto.getStatusEnum()));
|
||||
// 追溯码单位列表
|
||||
unitList = new ArrayList<>();
|
||||
unitList.add(new InpatientMedicineSummaryDto.Option(prescriptionInfoDto.getMaxUnitCode(),
|
||||
unitList.add(new MedicineSummaryDto.Option(prescriptionInfoDto.getMaxUnitCode(),
|
||||
prescriptionInfoDto.getMaxUnitCode_dictText()));
|
||||
unitList.add(new InpatientMedicineSummaryDto.Option(prescriptionInfoDto.getMinUnitCode(),
|
||||
unitList.add(new MedicineSummaryDto.Option(prescriptionInfoDto.getMinUnitCode(),
|
||||
prescriptionInfoDto.getMinUnitCode_dictText()));
|
||||
|
||||
prescriptionInfoDto.setUnitList(unitList);
|
||||
} ;
|
||||
|
||||
return R.ok(prescriptionItemInfoPageDto);
|
||||
}
|
||||
|
||||
@@ -180,10 +178,10 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien
|
||||
* @return 处理结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> medicineDispense(List<InpatientMedicineSearchParam> searchParam) {
|
||||
public R<?> SummaryDispenseMedicine(List<MedicineSummarySearchParam> searchParam) {
|
||||
// 构建供应发放Id到追溯码的映射
|
||||
Map<Long, String> traceNoMap = new HashMap<>();
|
||||
for (InpatientMedicineSearchParam param : searchParam) {
|
||||
for (MedicineSummarySearchParam param : searchParam) {
|
||||
if (param != null && param.getDeliveryId() != null) {
|
||||
traceNoMap.put(param.getDeliveryId(), param.getTraceNo());
|
||||
}
|
||||
@@ -191,7 +189,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien
|
||||
|
||||
// 供应发放idList
|
||||
List<Long> deliveryIdList =
|
||||
searchParam.stream().map(InpatientMedicineSearchParam::getDeliveryId).collect(Collectors.toList());
|
||||
searchParam.stream().map(MedicineSummarySearchParam::getDeliveryId).collect(Collectors.toList());
|
||||
// 获取供应发放信息列表
|
||||
List<SupplyDelivery> supplyDeliveryInfoList = supplyDeliveryService.selectByIdList(deliveryIdList);
|
||||
// 供应申请idList
|
||||
@@ -214,7 +212,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien
|
||||
idList = Arrays.stream(idArray).map(String::trim) // 去除每个元素前后的空格
|
||||
.filter(str -> !str.isEmpty()) // 过滤空字符串(如连续逗号导致的空值)
|
||||
.map(Long::parseLong) // 转换为Long类型
|
||||
.collect(Collectors.toList()); // 收集为List<Long>
|
||||
.toList(); // 收集为List<Long>
|
||||
// 设置发放ID列表,追溯码映射
|
||||
if (item.getBasedOnTable().equals(CommonConstants.TableName.MED_MEDICATION_DISPENSE)) {
|
||||
// 耗材发放ID列表
|
||||
@@ -426,7 +424,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien
|
||||
* @return 处理结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> medicineCancel(List<Long> deliveryIdList, Integer notPerformedReasonEnum) {
|
||||
public R<?> dispenseCancel(List<Long> deliveryIdList, Integer notPerformedReasonEnum) {
|
||||
// 获取供应发放信息列表
|
||||
List<SupplyDelivery> supplyDeliveryInfoList = supplyDeliveryService.selectByIdList(deliveryIdList);
|
||||
List<SupplyRequest> supplyRequestInfoList;
|
||||
@@ -448,7 +446,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien
|
||||
idList = Arrays.stream(idArray).map(String::trim) // 去除每个元素前后的空格
|
||||
.filter(str -> !str.isEmpty()) // 过滤空字符串(如连续逗号导致的空值)
|
||||
.map(Long::parseLong) // 转换为Long类型
|
||||
.collect(Collectors.toList()); // 收集为List<Long>
|
||||
.toList(); // 收集为List<Long>
|
||||
// 设置发放ID列表,追溯码映射
|
||||
if (item.getBasedOnTable().equals(CommonConstants.TableName.MED_MEDICATION_DISPENSE)) {
|
||||
// 耗材发放ID列表
|
||||
@@ -482,7 +480,7 @@ public class InpatientMedicineSummaryDispenseAppServiceImpl implements IInpatien
|
||||
}
|
||||
|
||||
// 获取发耗材单id列表
|
||||
List<DeviceDispense> devDispenseInfoList = deviceDispenseService.selectByIdList(devDispenseIdList);
|
||||
List<DeviceDispense> devDispenseInfoList = deviceDispenseService.listByIds(devDispenseIdList);
|
||||
if (devDispenseInfoList != null) {
|
||||
for (DeviceDispense deviceDispense : devDispenseInfoList) {
|
||||
// 耗材发放状态
|
@@ -1,19 +1,19 @@
|
||||
package com.openhis.web.pharmacymanage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.pharmacymanage.appservice.IInpatientMedicineSummaryDispenseAppService;
|
||||
import com.openhis.web.pharmacymanage.dto.InpatientMedicineSearchParam;
|
||||
import com.openhis.web.pharmacymanage.appservice.ISummaryDispenseMedicineAppService;
|
||||
import com.openhis.web.pharmacymanage.dto.MedicineSummarySearchParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 住院汇总发药
|
||||
*
|
||||
@@ -21,13 +21,13 @@ import java.util.List;
|
||||
* @date 2025/6/3
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pharmacy-manage/inpatient-medicine-summary-dispense")
|
||||
@RequestMapping("/pharmacy-manage/summary-dispense-medicine")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class InpatientMedicineSummaryDispenseController {
|
||||
public class SummaryDispenseMedicineController {
|
||||
|
||||
@Resource
|
||||
public IInpatientMedicineSummaryDispenseAppService medicineSummaryDispenseService;
|
||||
public ISummaryDispenseMedicineAppService medicineSummaryDispenseService;
|
||||
|
||||
/**
|
||||
* 获取页面初始化信息
|
||||
@@ -48,8 +48,8 @@ public class InpatientMedicineSummaryDispenseController {
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
*/
|
||||
@GetMapping("/medicationSummary-list")
|
||||
public R<?> getMedicationSummaryInfo(InpatientMedicineSearchParam searchParam, String searchKey,
|
||||
@GetMapping("/medication_summary-list")
|
||||
public R<?> getMedicationSummaryInfo(MedicineSummarySearchParam searchParam, String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return medicineSummaryDispenseService.getMedicationSummaryInfo(searchParam, searchKey, pageNo, pageSize,
|
||||
@@ -57,14 +57,14 @@ public class InpatientMedicineSummaryDispenseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 核对发药
|
||||
* 汇总发药
|
||||
*
|
||||
* @param searchParam 条件
|
||||
* @return 处理结果
|
||||
*/
|
||||
@PutMapping("/medicine-dispense")
|
||||
public R<?> medicineDispense(@RequestBody List<InpatientMedicineSearchParam> searchParam) {
|
||||
return medicineSummaryDispenseService.medicineDispense(searchParam);
|
||||
@PutMapping("/summary-dispense-medicine")
|
||||
public R<?> SummaryDispenseMedicine(@RequestBody List<MedicineSummarySearchParam> searchParam) {
|
||||
return medicineSummaryDispenseService.SummaryDispenseMedicine(searchParam);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,9 +74,9 @@ public class InpatientMedicineSummaryDispenseController {
|
||||
* @param notPerformedReasonEnum 未发原因
|
||||
* @return 处理结果
|
||||
*/
|
||||
@PutMapping("/medicine-cancel")
|
||||
public R<?> medicineCancel(@RequestBody List<Long> deliveryIdList, Integer notPerformedReasonEnum) {
|
||||
return medicineSummaryDispenseService.medicineCancel(deliveryIdList, notPerformedReasonEnum);
|
||||
@PutMapping("/dispense-cancel")
|
||||
public R<?> dispenseCancel(@RequestBody List<Long> deliveryIdList, Integer notPerformedReasonEnum) {
|
||||
return medicineSummaryDispenseService.dispenseCancel(deliveryIdList, notPerformedReasonEnum);
|
||||
}
|
||||
|
||||
}
|
@@ -21,7 +21,7 @@ import lombok.experimental.Accessors;
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InpatientMedicineSummaryDto {
|
||||
public class MedicineSummaryDto {
|
||||
|
||||
/**
|
||||
* 单据号
|
||||
@@ -110,7 +110,7 @@ public class InpatientMedicineSummaryDto {
|
||||
/**
|
||||
* 单位列表
|
||||
*/
|
||||
private List<InpatientMedicineSummaryDto.Option> unitList;
|
||||
private List<MedicineSummaryDto.Option> unitList;
|
||||
|
||||
@Data
|
||||
public static class Option {
|
@@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InpatientMedicineInitDto {
|
||||
public class MedicineSummaryInitDto {
|
||||
|
||||
/** 科室列表 */
|
||||
private List<LongOptions> departmentOptions;
|
@@ -4,12 +4,10 @@
|
||||
package com.openhis.web.pharmacymanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -21,7 +19,7 @@ import lombok.experimental.Accessors;
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class InpatientMedicineSearchParam implements Serializable {
|
||||
public class MedicineSummarySearchParam implements Serializable {
|
||||
|
||||
/** 科室 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.pharmacymanage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.openhis.web.inhospitalnursestation.dto.InpatientMedicinePrescriptionInfoDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.openhis.web.pharmacymanage.dto.*;
|
||||
|
||||
@Repository
|
||||
public interface InpatientMedicineSummaryDispenseMapper {
|
||||
|
||||
/**
|
||||
* 医嘱列表查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @param medicationDefinition 药品定义
|
||||
* @param deviceDefinition 耗材定义
|
||||
* @return 医嘱信息
|
||||
*/
|
||||
Page<InpatientMedicineSummaryDto> selectMedicationSummaryInfo(
|
||||
@Param("page") Page<InpatientMedicinePrescriptionInfoDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<InpatientMedicineSearchParam> queryWrapper,
|
||||
@Param("medicationDefinition") String medicationDefinition,
|
||||
@Param("deviceDefinition") String deviceDefinition, @Param("typeEnum") Integer typeEnum,@Param("categoryEnum") Integer categoryEnum
|
||||
);
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.pharmacymanage.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.pharmacymanage.dto.MedicineSummaryDto;
|
||||
import com.openhis.web.pharmacymanage.dto.MedicineSummarySearchParam;
|
||||
|
||||
@Repository
|
||||
public interface SummaryDispenseMedicineMapper {
|
||||
|
||||
/**
|
||||
* 汇总药品信息列表查询
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 查询条件
|
||||
* @param medicationDefinition 药品定义
|
||||
* @param deviceDefinition 耗材定义
|
||||
* @return 汇总药品信息
|
||||
*/
|
||||
Page<MedicineSummaryDto> selectMedicationSummaryInfo(@Param("page") Page<MedicineSummaryDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<MedicineSummarySearchParam> queryWrapper,
|
||||
@Param("medicationDefinition") String medicationDefinition, @Param("deviceDefinition") String deviceDefinition,
|
||||
@Param("typeEnum") Integer typeEnum, @Param("categoryEnum") Integer categoryEnum);
|
||||
}
|
@@ -260,9 +260,9 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
longMedicationRequest.setEffectiveDoseStart(startTime); // 医嘱开始时间
|
||||
longMedicationRequest
|
||||
.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4));
|
||||
longMedicationRequest.setQuantity(regAdviceSaveDto.getDose()); // 请求数量 | 长期医嘱保持和单次剂量一致
|
||||
longMedicationRequest.setQuantity(regAdviceSaveDto.getQuantity()); // 请求数量
|
||||
longMedicationRequest.setExecuteNum(regAdviceSaveDto.getExecuteNum()); // 执行次数
|
||||
longMedicationRequest.setUnitCode(regAdviceSaveDto.getDoseUnitCode()); // 请求单位编码 | 长期医嘱保持和单次剂量一致
|
||||
longMedicationRequest.setUnitCode(regAdviceSaveDto.getUnitCode()); // 请求单位编码
|
||||
longMedicationRequest.setLotNumber(regAdviceSaveDto.getLotNumber()); // 产品批号
|
||||
longMedicationRequest.setCategoryEnum(regAdviceSaveDto.getCategoryEnum()); // 请求类型
|
||||
longMedicationRequest.setMedicationId(regAdviceSaveDto.getAdviceDefinitionId());// 医嘱定义id
|
||||
@@ -553,7 +553,12 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
List<RegRequestBaseDto> regRequestBaseInfo = adviceManageAppMapper.getRegRequestBaseInfo(encounterId, null,
|
||||
CommonConstants.TableName.MED_MEDICATION_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST,
|
||||
CommonConstants.TableName.WOR_SERVICE_REQUEST, practitionerId, Whether.NO.getCode());
|
||||
for (RegRequestBaseDto regRequestBaseDto : regRequestBaseInfo) {
|
||||
// 根据 requestId 过滤重复医嘱信息
|
||||
List<RegRequestBaseDto> distinctList = regRequestBaseInfo.stream()
|
||||
.collect(Collectors.toMap(RegRequestBaseDto::getRequestId, dto -> dto, (existing, replacement) -> existing // 如果key冲突,保留已存在的(第一条)
|
||||
)).values().stream().collect(Collectors.toList());
|
||||
|
||||
for (RegRequestBaseDto regRequestBaseDto : distinctList) {
|
||||
// 请求状态
|
||||
regRequestBaseDto.setStatusEnum_enumText(
|
||||
EnumUtils.getInfoByValue(RequestStatus.class, regRequestBaseDto.getStatusEnum()));
|
||||
@@ -570,7 +575,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
regRequestBaseDto.setTherapyEnum_enumText(
|
||||
EnumUtils.getInfoByValue(TherapyTimeType.class, regRequestBaseDto.getTherapyEnum()));
|
||||
}
|
||||
return R.ok(regRequestBaseInfo);
|
||||
return R.ok(distinctList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.reportmanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.reportmanage.dto.DrugDosageSettlementSearchParam;
|
||||
|
||||
/**
|
||||
* 科室收入统计 controller
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025-09-23
|
||||
*/
|
||||
public interface IDepartmentRevenueStatisticsAppService {
|
||||
|
||||
/**
|
||||
* 药品用量明细列表
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求数据
|
||||
* @return
|
||||
*/
|
||||
R<?> getPage( Integer pageNo, Integer pageSize,
|
||||
String searchKey, HttpServletRequest request);
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.reportmanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 报表统计 controller
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025-09-23
|
||||
*/
|
||||
public interface IReportStatisticsAppService {
|
||||
|
||||
/**
|
||||
* 月报明细列表
|
||||
*
|
||||
* @param startTime 开始日期
|
||||
* @param endTime 结束日期
|
||||
* @return
|
||||
*/
|
||||
R<?> getDailyReport(String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 年报明细列表
|
||||
*
|
||||
* @param startTime 开始日期
|
||||
* @param endTime 结束日期
|
||||
* @return
|
||||
*/
|
||||
R<?> getAnnualRreport(String startTime, String endTime);
|
||||
}
|
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.reportmanage.appservice.impl;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.web.reportmanage.appservice.IDepartmentRevenueStatisticsAppService;
|
||||
import com.openhis.web.reportmanage.dto.DepartmentRevenueStatisticsPageDto;
|
||||
import com.openhis.web.reportmanage.mapper.DepartmentRevenueStatisticsMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.common.enums.DispenseStatus;
|
||||
import com.openhis.common.enums.RequestStatus;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.reportmanage.appservice.IDrugDosageSettlementAppService;
|
||||
import com.openhis.web.reportmanage.dto.DrugDosageSettlementPageDto;
|
||||
import com.openhis.web.reportmanage.dto.DrugDosageSettlementSearchParam;
|
||||
import com.openhis.web.reportmanage.mapper.DrugDosageSettlementMapper;
|
||||
|
||||
/**
|
||||
* 科室收入统计 controller
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025-09-23
|
||||
*/
|
||||
@Service
|
||||
public class DepartmentRevenueStatisticsAppServiceImpl implements IDepartmentRevenueStatisticsAppService {
|
||||
|
||||
@Autowired
|
||||
private DepartmentRevenueStatisticsMapper departmentRevenueStatisticsMapper;
|
||||
|
||||
/**
|
||||
* 科室收入统计
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求数据
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R<?> getPage(Integer pageNo, Integer pageSize,
|
||||
String searchKey, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<DrugDosageSettlementSearchParam> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
null, searchKey, null, request);
|
||||
|
||||
Page<DepartmentRevenueStatisticsPageDto> drugDosageReportPage =
|
||||
departmentRevenueStatisticsMapper.selectPage(new Page<>(pageNo, pageSize), queryWrapper,
|
||||
DispenseStatus.COMPLETED.getValue(), RequestStatus.COMPLETED.getValue());
|
||||
|
||||
return R.ok(drugDosageReportPage);
|
||||
}
|
||||
}
|
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.reportmanage.appservice.impl;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.enums.ybenums.YbMedChrgItmType;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.reportmanage.dto.AnnualReportStatisticsPageDto;
|
||||
import com.openhis.web.reportmanage.dto.DailyReportStatisticsPageDto;
|
||||
import com.openhis.web.reportmanage.dto.DrugDosageSettlementSearchParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.reportmanage.appservice.IReportStatisticsAppService;
|
||||
import com.openhis.web.reportmanage.mapper.ReportStatisticsMapper;
|
||||
|
||||
/**
|
||||
* 科室收入统计 controller
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025-09-23
|
||||
*/
|
||||
@Service
|
||||
public class ReportStatisticsAppServiceImpl implements IReportStatisticsAppService {
|
||||
|
||||
@Autowired
|
||||
private ReportStatisticsMapper reportStatisticsMapper;
|
||||
|
||||
/**
|
||||
* 月报明细列表
|
||||
*
|
||||
* @param startTime 开始日期
|
||||
* @param endTime 结束日期
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R<?> getDailyReport(String startTime, String endTime) {
|
||||
|
||||
DailyReportStatisticsPageDto dailyReport = new DailyReportStatisticsPageDto();
|
||||
// -------------------------- 1. 卫生技术人员统计 --------------------------
|
||||
// todo 中医执业(助理)医师数 没查询 人员没有添加时间条件,查询的都是当前的状态
|
||||
DailyReportStatisticsPageDto.StaffStatDTO staffStat =
|
||||
reportStatisticsMapper.getStaffStat(PractitionerRoles.DOCTOR.getCode(), PractitionerRoles.NURSE.getCode());
|
||||
dailyReport.setStaffStat(staffStat);
|
||||
// -------------------------- 2. 床位与床日统计 --------------------------
|
||||
// TODO 实际开放总床日数、实际占用总床日数、出院者占用总床日数 没查询 床位没有添加时间条件,查询的都是当前的状态
|
||||
DailyReportStatisticsPageDto.BedStatDTO bedStat =
|
||||
reportStatisticsMapper.getBedStat(LocationForm.BED.getValue());
|
||||
dailyReport.setBedStat(bedStat);
|
||||
// -------------------------- 3. 收入统计(单位:千元) --------------------------
|
||||
// todo 疫苗收入给0 、结算差额给0 时间筛选用的update_time,不确定对不对
|
||||
DailyReportStatisticsPageDto.RevenueStatDTO revenueStat = this.getRevenueStat(startTime,endTime);
|
||||
dailyReport.setRevenueStat(revenueStat);
|
||||
// -------------------------- 4. 费用统计(单位:千元) --------------------------
|
||||
// todo 费用的查询没写
|
||||
// DailyReportStatisticsPageDto.ExpenseStatDTO expenseStat=reportStatisticsMapper
|
||||
// dailyReport.setExpenseStat(expenseStat);
|
||||
// -------------------------- 5. 诊疗与服务量统计 --------------------------
|
||||
// todo 只查了门诊人次数,系统里应该不存在急诊
|
||||
DailyReportStatisticsPageDto.TreatmentStatDTO treatmentStat =
|
||||
reportStatisticsMapper.getTreatmentStat(EncounterClass.AMB.getValue(), startTime, endTime);
|
||||
dailyReport.setTreatmentStat(treatmentStat);
|
||||
// -------------------------- 6. 死亡人数统计 --------------------------
|
||||
// todo 死亡人数没写
|
||||
// DailyReportStatisticsPageDto.DeathStatDTO deathStat=reportStatisticsMapper
|
||||
// dailyReport.setDeathStat(deathStat);
|
||||
// -------------------------- 7. 健康检查统计 --------------------------
|
||||
// todo 健康检查统计的查询没写,给0了
|
||||
// Integer healthCheckCount=reportStatisticsMapper
|
||||
dailyReport.setHealthCheckCount(0);
|
||||
|
||||
return R.ok(dailyReport);
|
||||
}
|
||||
|
||||
/**
|
||||
* 年报明细列表
|
||||
*
|
||||
* @param startTime 开始日期
|
||||
* @param endTime 结束日期
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public R<?> getAnnualRreport(String startTime, String endTime) {
|
||||
AnnualReportStatisticsPageDto annualReportStatistics = new AnnualReportStatisticsPageDto();
|
||||
// 6.1 总收入相关字段
|
||||
// 6.1.2 事业收入
|
||||
// 6.1.2.1 医疗收入
|
||||
//todo 只写了 总收入相关字段>事业收入>医疗收入
|
||||
AnnualReportStatisticsPageDto.MedicalIncomeDTO medicalIncome =
|
||||
new AnnualReportStatisticsPageDto.MedicalIncomeDTO();
|
||||
DailyReportStatisticsPageDto.RevenueStatDTO revenueStat = this.getRevenueStat(startTime,endTime);
|
||||
BeanUtils.copyProperties(revenueStat, medicalIncome);
|
||||
annualReportStatistics.getTotalIncome().getUndertakingIncome().setMedicalIncome(medicalIncome);
|
||||
// 6.2 总费用相关字段
|
||||
// todo 费用的查询没写
|
||||
// 8 诊疗人次数相关字段
|
||||
// todo 人次的查询没写
|
||||
|
||||
|
||||
return R.ok(annualReportStatistics);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医疗收入
|
||||
*
|
||||
* @param startTime 开始日期
|
||||
* @param endTime 结束日期
|
||||
* @return
|
||||
*/
|
||||
public DailyReportStatisticsPageDto.RevenueStatDTO getRevenueStat(String startTime, String endTime) {
|
||||
|
||||
DailyReportStatisticsPageDto.RevenueStatDTO revenueStat =
|
||||
reportStatisticsMapper.getRevenueStat(ChargeItemStatus.BILLED.getValue(), EncounterClass.IMP.getValue(),
|
||||
EncounterClass.AMB.getValue(), YbMedChrgItmType.REGISTRATION_FEE.getValue(),
|
||||
YbMedChrgItmType.DIAGNOSTIC_FEE.getValue(), YbMedChrgItmType.CHECK_FEE.getValue(),
|
||||
YbMedChrgItmType.DIAGNOSTIC_TEST_FEE.getValue(), YbMedChrgItmType.MEDICAL_EXPENSE_FEE.getValue(),
|
||||
YbMedChrgItmType.OPERATION_FEE.getValue(), YbMedChrgItmType.SANITARY_MATERIALS_FEE.getValue(),
|
||||
YbMedChrgItmType.WEST_MEDICINE.getValue(), YbMedChrgItmType.CHINESE_MEDICINE_FEE.getValue(),
|
||||
YbMedChrgItmType.CHINESE_MEDICINE_SLICES_FEE.getValue(), YbMedChrgItmType.OTHER_FEE.getValue(),
|
||||
YbMedChrgItmType.BED_FEE.getValue(), YbMedChrgItmType.NURSING_FEE.getValue(), startTime, endTime);
|
||||
// ----总收入 = 医疗收入 = 门急诊收入 + 住院收入 + 结算差额
|
||||
// ----药品收入合计 = 西药收入 + 中成药收入 + 中药饮片收入
|
||||
// 药品收入合计
|
||||
revenueStat.setOutpatientTotalDrugRevenue(
|
||||
revenueStat.getOutpatientTotalWesternDrugRevenue().add(revenueStat.getOutpatientChinesePatentDrugRevenue())
|
||||
.add(revenueStat.getOutpatientChineseHerbRevenue()));
|
||||
// 门急诊收入合计
|
||||
revenueStat.setTotalOutpatientRevenue(revenueStat.getOutpatientRegistrationRevenue()
|
||||
.add(revenueStat.getOutpatientConsultationRevenue()).add(revenueStat.getOutpatientInspectionRevenue())
|
||||
.add(revenueStat.getOutpatientLabTestRevenue()).add(revenueStat.getOutpatientTreatmentRevenue())
|
||||
.add(revenueStat.getOutpatientSurgeryRevenue()).add(revenueStat.getOutpatientMedicalMaterialRevenue())
|
||||
.add(revenueStat.getOutpatientTotalDrugRevenue()).add(revenueStat.getOtherOutpatientRevenue()));
|
||||
// 药品收入合计
|
||||
revenueStat.setInpatientTotalDrugRevenue(revenueStat.getInpatientTotalWesternDrugRevenue()
|
||||
.add(revenueStat.getInpatientChinesePatentDrugRevenue()).add(revenueStat.getInpatientChineseHerbRevenue()));
|
||||
// 住院收入合计
|
||||
revenueStat.setTotalInpatientRevenue(
|
||||
revenueStat.getInpatientBedRevenue().add(revenueStat.getInpatientConsultationRevenue())
|
||||
.add(revenueStat.getInpatientInspectionRevenue()).add(revenueStat.getInpatientLabTestRevenue())
|
||||
.add(revenueStat.getInpatientTreatmentRevenue()).add(revenueStat.getInpatientSurgeryRevenue())
|
||||
.add(revenueStat.getInpatientNursingRevenue()).add(revenueStat.getInpatientMedicalMaterialRevenue())
|
||||
.add(revenueStat.getInpatientTotalDrugRevenue()).add(revenueStat.getOtherInpatientRevenue()));
|
||||
// 医疗收入合计
|
||||
revenueStat.setTotalMedicalRevenue(
|
||||
revenueStat.getTotalOutpatientRevenue().add(revenueStat.getTotalInpatientRevenue()));
|
||||
// 总收入
|
||||
revenueStat.setTotalRevenue(revenueStat.getTotalMedicalRevenue());
|
||||
return revenueStat;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.reportmanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.openhis.web.reportmanage.appservice.IDepartmentRevenueStatisticsAppService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.reportmanage.appservice.IDrugDosageSettlementAppService;
|
||||
import com.openhis.web.reportmanage.dto.DrugDosageSettlementSearchParam;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 科室收入统计 controller
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025-09-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/report-manage/department-revenue-statistics")
|
||||
@Slf4j
|
||||
public class DepartmentRevenueStatisticsController {
|
||||
|
||||
@Autowired
|
||||
private IDepartmentRevenueStatisticsAppService departmentRevenueStatisticsAppService;
|
||||
|
||||
/**
|
||||
* 收入明细明细列表 todo 还没写
|
||||
*
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求数据
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/page")
|
||||
public R<?> getPage(
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "searchKey", required = false) String searchKey,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return departmentRevenueStatisticsAppService.getPage(pageNo, pageSize, searchKey, request);
|
||||
}
|
||||
}
|
@@ -3,6 +3,8 @@
|
||||
*/
|
||||
package com.openhis.web.reportmanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -14,9 +16,6 @@ import com.openhis.web.reportmanage.appservice.IMedicationDeviceReportAppService
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 药品耗材统计查询用 controller
|
||||
*
|
||||
@@ -60,8 +59,8 @@ public class MedicationDeviceReportController {
|
||||
@RequestParam String dispenseDateETime, @RequestParam(name = "name", required = false) String name,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return R
|
||||
.ok(medicationDeviceReportAppService.selectMedDdevInfo(orgId, name, dispenseDateSTime, dispenseDateETime,pageNo,pageSize));
|
||||
return R.ok(medicationDeviceReportAppService.selectMedDdevInfo(orgId, name, dispenseDateSTime,
|
||||
dispenseDateETime, pageNo, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,11 +78,9 @@ public class MedicationDeviceReportController {
|
||||
public void makeExcelFile(@RequestParam Long orgId, @RequestParam String dispenseDateSTime,
|
||||
@RequestParam String dispenseDateETime, @RequestParam(name = "name", required = false) String name,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletResponse response) {
|
||||
medicationDeviceReportAppService.makeExcelFile(orgId, name, dispenseDateSTime, dispenseDateETime,pageNo,pageSize,
|
||||
response);
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletResponse response) {
|
||||
medicationDeviceReportAppService.makeExcelFile(orgId, name, dispenseDateSTime, dispenseDateETime, pageNo,
|
||||
pageSize, response);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.reportmanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.reportmanage.appservice.IReportStatisticsAppService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 报表统计 controller
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025-09-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/report-manage/report-statistics")
|
||||
@Slf4j
|
||||
public class ReportStatisticsController {
|
||||
|
||||
@Autowired
|
||||
private IReportStatisticsAppService reportStatisticsAppService;
|
||||
|
||||
/**
|
||||
* 月报明细列表
|
||||
*
|
||||
* @param startTime 开始日期
|
||||
* @param endTime 结束日期
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/daily-report")
|
||||
public R<?> getDailyReport(@RequestParam String startTime, @RequestParam String endTime) {
|
||||
return reportStatisticsAppService.getDailyReport(startTime,endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 年报明细列表
|
||||
*
|
||||
* @param startTime 开始日期
|
||||
* @param endTime 结束日期
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/annual-report")
|
||||
public R<?> getAnnualRreport(@RequestParam String startTime, @RequestParam String endTime) {
|
||||
return reportStatisticsAppService.getAnnualRreport(startTime,endTime);
|
||||
}
|
||||
}
|
@@ -0,0 +1,625 @@
|
||||
/*
|
||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.reportmanage.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 报表统计 dto
|
||||
*
|
||||
* @author yuxj
|
||||
* @date 2025-09-23
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AnnualReportStatisticsPageDto {
|
||||
// 6.1 总收入相关字段
|
||||
private TotalIncomeDTO totalIncome;
|
||||
|
||||
// 6.2 总费用相关字段
|
||||
private TotalExpenseDTO totalExpense;
|
||||
|
||||
// 8 诊疗人次数相关字段
|
||||
private MedicalTreatmentDTO medicalTreatment;
|
||||
/**
|
||||
* 6.1 总收入DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class TotalIncomeDTO {
|
||||
private BigDecimal total; // 总收入合计
|
||||
|
||||
// 6.1.1 财政拨款收入
|
||||
private FinancialAppropriationIncomeDTO financialAppropriationIncome;
|
||||
|
||||
// 6.1.2 事业收入
|
||||
private UndertakingIncomeDTO undertakingIncome;
|
||||
|
||||
// 6.1.3 上级补助收入
|
||||
private BigDecimal superiorSubsidyIncome;
|
||||
|
||||
// 6.1.4 附属单位上缴收入
|
||||
private BigDecimal affiliatedUnitTurnoverIncome;
|
||||
|
||||
// 6.1.5 经营收入
|
||||
private BigDecimal operatingIncome;
|
||||
|
||||
// 6.1.6 非同级财政拨款收入
|
||||
private BigDecimal nonSameLevelFinancialAppropriationIncome;
|
||||
|
||||
// 6.1.7 投资收益
|
||||
private BigDecimal investmentIncome;
|
||||
|
||||
// 6.1.8 捐赠收入
|
||||
private BigDecimal donationIncome;
|
||||
|
||||
// 6.1.9 利息收入
|
||||
private BigDecimal interestIncome;
|
||||
|
||||
// 6.1.10 租金收入
|
||||
private BigDecimal rentIncome;
|
||||
|
||||
// 6.1.11 其他收入
|
||||
private BigDecimal otherIncome;
|
||||
|
||||
// 6.1.12 总收入中:来源于职工基本医疗保险基金的收入
|
||||
private BigDecimal employeeMedicalInsuranceFundIncome;
|
||||
|
||||
// 6.1.13 来源于城乡居民基本医疗保险基金的收入
|
||||
private BigDecimal residentMedicalInsuranceFundIncome;
|
||||
|
||||
// 6.1.14 来源于其他医疗保险的收入
|
||||
private BigDecimal otherMedicalInsuranceIncome;
|
||||
}
|
||||
|
||||
/**
|
||||
* 6.1.1 财政拨款收入DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class FinancialAppropriationIncomeDTO {
|
||||
private BigDecimal total; // 财政拨款收入合计
|
||||
|
||||
// 6.1.1.1 其中:财政基本拨款收入
|
||||
private BigDecimal basicFinancialAppropriationIncome;
|
||||
|
||||
// 6.1.1.2 财政项目拨款收入
|
||||
private BigDecimal projectFinancialAppropriationIncome;
|
||||
}
|
||||
|
||||
/**
|
||||
* 6.1.2 事业收入DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class UndertakingIncomeDTO {
|
||||
private BigDecimal total; // 事业收入合计
|
||||
|
||||
// 6.1.2.1 医疗收入
|
||||
private MedicalIncomeDTO medicalIncome;
|
||||
|
||||
// 6.1.2.2 科教收入
|
||||
private BigDecimal scienceEducationIncome;
|
||||
|
||||
// 6.1.2.3 非同级财政拨款收入
|
||||
private BigDecimal nonSameLevelFinancialAppropriationIncome;
|
||||
|
||||
// 6.1.2.9 门诊和住院药品收入中:基本药物收入
|
||||
private BigDecimal essentialDrugsIncome;
|
||||
}
|
||||
|
||||
/**
|
||||
* 6.1.2.1 医疗收入DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class MedicalIncomeDTO {
|
||||
/** 医疗收入合计 */
|
||||
private BigDecimal totalMedicalRevenue;
|
||||
|
||||
// 门急诊收入细分
|
||||
/** 门急诊收入合计 */
|
||||
private BigDecimal totalOutpatientRevenue;
|
||||
/** 挂号收入 */
|
||||
private BigDecimal outpatientRegistrationRevenue;
|
||||
/** 诊察收入(门急诊) */
|
||||
private BigDecimal outpatientConsultationRevenue;
|
||||
/** 检查收入(门急诊) */
|
||||
private BigDecimal outpatientInspectionRevenue;
|
||||
/** 化验收入(门急诊) */
|
||||
private BigDecimal outpatientLabTestRevenue;
|
||||
/** 治疗收入(门急诊) */
|
||||
private BigDecimal outpatientTreatmentRevenue;
|
||||
/** 手术收入(门急诊) */
|
||||
private BigDecimal outpatientSurgeryRevenue;
|
||||
/** 卫生材料收入(门急诊) */
|
||||
private BigDecimal outpatientMedicalMaterialRevenue;
|
||||
// 药品收入细分
|
||||
/** 药品收入合计 */
|
||||
private BigDecimal outpatientTotalDrugRevenue;
|
||||
/** 西药收入合计 */
|
||||
private BigDecimal outpatientTotalWesternDrugRevenue;
|
||||
/** 疫苗收入(西药下) */
|
||||
private BigDecimal outpatientVaccineRevenue;
|
||||
/** 中成药收入 */
|
||||
private BigDecimal outpatientChinesePatentDrugRevenue;
|
||||
/** 中药饮片收入 */
|
||||
private BigDecimal outpatientChineseHerbRevenue;
|
||||
/** 其他门诊收入 */
|
||||
private BigDecimal otherOutpatientRevenue;
|
||||
// 住院收入细分
|
||||
/** 住院收入合计 */
|
||||
private BigDecimal totalInpatientRevenue;
|
||||
/** 床位收入(住院) */
|
||||
private BigDecimal inpatientBedRevenue;
|
||||
/** 诊察收入(住院) */
|
||||
private BigDecimal inpatientConsultationRevenue;
|
||||
/** 检查收入(住院) */
|
||||
private BigDecimal inpatientInspectionRevenue;
|
||||
/** 化验收入(住院) */
|
||||
private BigDecimal inpatientLabTestRevenue;
|
||||
/** 治疗收入(住院) */
|
||||
private BigDecimal inpatientTreatmentRevenue;
|
||||
/** 手术收入(住院) */
|
||||
private BigDecimal inpatientSurgeryRevenue;
|
||||
/** 护理收入(住院) */
|
||||
private BigDecimal inpatientNursingRevenue;
|
||||
/** 卫生材料收入(住院) */
|
||||
private BigDecimal inpatientMedicalMaterialRevenue;
|
||||
// 药品收入细分(门急诊+住院共用统计维度,无单独区分则合并)
|
||||
/** 药品收入合计 */
|
||||
private BigDecimal inpatientTotalDrugRevenue;
|
||||
/** 西药收入合计 */
|
||||
private BigDecimal inpatientTotalWesternDrugRevenue;
|
||||
/** 疫苗收入(西药下) */
|
||||
private BigDecimal inpatientVaccineRevenue;
|
||||
/** 中成药收入 */
|
||||
private BigDecimal inpatientChinesePatentDrugRevenue;
|
||||
/** 中药饮片收入 */
|
||||
private BigDecimal inpatientChineseHerbRevenue;
|
||||
/** 其他住院收入 */
|
||||
private BigDecimal otherInpatientRevenue;
|
||||
/** 结算差额 */
|
||||
private BigDecimal settlementDifference;
|
||||
}
|
||||
|
||||
/**
|
||||
* 6.2 总费用DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class TotalExpenseDTO {
|
||||
private BigDecimal total; // 总费用合计
|
||||
|
||||
// 6.2.1 业务活动费用
|
||||
private BusinessActivityExpenseDTO businessActivityExpense;
|
||||
|
||||
// 6.2.2 单位管理费用
|
||||
private UnitManagementExpenseDTO unitManagementExpense;
|
||||
|
||||
// 6.2.3 经营费用
|
||||
private BigDecimal operatingExpense;
|
||||
|
||||
// 6.2.4 资产处置费用
|
||||
private BigDecimal assetDisposalExpense;
|
||||
|
||||
// 6.2.5 上缴上级费用
|
||||
private BigDecimal paymentToSuperiorExpense;
|
||||
|
||||
// 6.2.6 对附属单位补助费用
|
||||
private BigDecimal subsidyToAffiliatedUnitsExpense;
|
||||
|
||||
// 6.2.7 所得税费用
|
||||
private BigDecimal incomeTaxExpense;
|
||||
|
||||
// 6.2.8 其他费用
|
||||
private BigDecimal otherExpense;
|
||||
}
|
||||
|
||||
/**
|
||||
* 6.2.1 业务活动费用DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class BusinessActivityExpenseDTO {
|
||||
private BigDecimal total; // 业务活动费用合计
|
||||
|
||||
// 6.2.1.1 财政基本拨款经费
|
||||
private BigDecimal basicFinancialAppropriationFund;
|
||||
|
||||
// 6.2.1.2 财政项目拨款经费
|
||||
private BigDecimal projectFinancialAppropriationFund;
|
||||
|
||||
// 6.2.1.3 科教经费
|
||||
private BigDecimal scienceEducationFund;
|
||||
|
||||
// 6.2.1.4 其他经费
|
||||
private BigDecimal otherFund;
|
||||
|
||||
// 6.2.1.5 业务活动费用中:人员经费
|
||||
private PersonnelExpenseDTO personnelExpense;
|
||||
|
||||
// 6.2.1.6 固定资产折旧费
|
||||
private BigDecimal fixedAssetDepreciation;
|
||||
|
||||
// 6.2.1.7 卫生材料费
|
||||
private BigDecimal healthMaterialsExpense;
|
||||
|
||||
// 6.2.1.8 药品费
|
||||
// 药品费合计
|
||||
private BigDecimal totalDrugExpense;
|
||||
|
||||
// 其中:基本药物费用
|
||||
private BigDecimal essentialDrugsExpense;
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员经费DTO(包含业务活动和单位管理)
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class PersonnelExpenseDTO {
|
||||
private BigDecimal total; // 人员经费合计
|
||||
|
||||
// 工资福利费用
|
||||
// 工资福利费用合计
|
||||
private BigDecimal totalSalaryWelfareExpense;
|
||||
|
||||
// 其中:卫生技术人员人均工资性收入
|
||||
private HealthTechnicalPersonnelSalaryDTO healthTechnicalPersonnelSalary;
|
||||
|
||||
// 对个人和家庭的补助费用
|
||||
private BigDecimal subsidyToIndividualsAndFamilies;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 卫生技术人员工资DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class HealthTechnicalPersonnelSalaryDTO {
|
||||
private BigDecimal average; // 平均工资
|
||||
|
||||
// 其中:执业(助理)医师
|
||||
private PracticingPhysicianSalaryDTO practicingPhysicianSalary;
|
||||
|
||||
// 注册护士
|
||||
private RegisteredNurseSalaryDTO registeredNurseSalary;
|
||||
|
||||
// 药师(士)
|
||||
private BigDecimal pharmacistSalary;
|
||||
|
||||
// 技师(士)
|
||||
private BigDecimal technicianSalary;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执业(助理)医师工资DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class PracticingPhysicianSalaryDTO {
|
||||
private BigDecimal total; // 合计
|
||||
|
||||
// 其中:主任医师
|
||||
private BigDecimal chiefPhysician;
|
||||
|
||||
// 副主任医师
|
||||
private BigDecimal associateChiefPhysician;
|
||||
|
||||
// 主治医师
|
||||
private BigDecimal attendingPhysician;
|
||||
|
||||
// 医师(士)
|
||||
private BigDecimal physician;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册护士工资DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class RegisteredNurseSalaryDTO {
|
||||
private BigDecimal total; // 合计
|
||||
|
||||
// 其中:主任护师
|
||||
private BigDecimal chiefNurse;
|
||||
|
||||
// 副主任护师
|
||||
private BigDecimal associateChiefNurse;
|
||||
|
||||
// 主管护师
|
||||
private BigDecimal chargeNurse;
|
||||
|
||||
// 护师(士)
|
||||
private BigDecimal nurse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 6.2.2 单位管理费用DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class UnitManagementExpenseDTO {
|
||||
private BigDecimal total; // 单位管理费用合计
|
||||
|
||||
// 6.2.2.1 财政基本拨款经费
|
||||
private BigDecimal basicFinancialAppropriationFund;
|
||||
|
||||
// 6.2.2.2 财政项目拨款经费
|
||||
private BigDecimal projectFinancialAppropriationFund;
|
||||
|
||||
// 6.2.2.3 科教经费
|
||||
private BigDecimal scienceEducationFund;
|
||||
|
||||
// 6.2.2.4 其他经费
|
||||
private BigDecimal otherFund;
|
||||
|
||||
// 6.2.2.5 单位管理费用中:人员经费
|
||||
private PersonnelExpenseDTO personnelExpense;
|
||||
|
||||
// 6.2.2.6 固定资产折旧费
|
||||
private BigDecimal fixedAssetDepreciation;
|
||||
|
||||
// 6.2.2.7 卫生材料费
|
||||
private BigDecimal healthMaterialsExpense;
|
||||
|
||||
// 6.2.2.8 药品费
|
||||
// 药品费合计
|
||||
private BigDecimal totalDrugExpense;
|
||||
|
||||
// 其中:基本药物费用
|
||||
private BigDecimal essentialDrugsExpense;
|
||||
}
|
||||
|
||||
/**
|
||||
* 8 诊疗人次数相关DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class MedicalTreatmentDTO {
|
||||
// 8.1 总诊疗人次数
|
||||
private TotalDiagnosisTreatmentsDTO totalDiagnosisTreatments;
|
||||
|
||||
// 8.2 X线电子计算机断层扫描装置检查人次数
|
||||
private Long ctScanCount;
|
||||
|
||||
// 8.3 医用磁共振成像设备(核磁)检查人次数
|
||||
private Long mriScanCount;
|
||||
|
||||
// 8.4 X线正电子发射断层扫描仪(PET/CT)检查人次数
|
||||
private Long petCtScanCount;
|
||||
|
||||
// 8.5 心理咨询人次数
|
||||
// 心理咨询人次数合计
|
||||
private Long totalPsychologicalConsultation;
|
||||
|
||||
// 8.5.1 其中:门诊人次数
|
||||
private Long outpatientPsychologicalConsultationCount;
|
||||
|
||||
// 8.6 体重管理咨询人次数
|
||||
// 体重管理咨询人次数合计
|
||||
private Long totalWeightManagementConsultation;
|
||||
|
||||
// 8.6.1 其中:门诊人次数
|
||||
private Long outpatientWeightManagementConsultationCount;
|
||||
|
||||
// 8.7 多学科会诊(MDT)人次数
|
||||
private Long mdtConsultationCount;
|
||||
|
||||
// 8.8 互联网诊疗服务人次数
|
||||
private Long internetDiagnosisCount;
|
||||
|
||||
// 8.9 远程医疗服务人次数
|
||||
private Long telemedicineServiceCount;
|
||||
|
||||
// 8.10 观察室留观病例数
|
||||
// 观察室留观病例数合计
|
||||
private Long totalObservationCase;
|
||||
|
||||
// 8.10.1 其中: 死亡人数
|
||||
private Long deathCount;
|
||||
|
||||
// 8.11 健康检查人次数
|
||||
private Long healthExaminationCount;
|
||||
|
||||
// 8.12 入院人次数
|
||||
private Long admissionCount;
|
||||
|
||||
// 8.13 出院人次数
|
||||
private DischargeCountDTO dischargeCount;
|
||||
|
||||
// 8.14 住院病人手术人次数
|
||||
private InpatientSurgeryCountDTO inpatientSurgeryCount;
|
||||
|
||||
// 8.15 门诊处方总数
|
||||
private OutpatientPrescriptionDTO outpatientPrescription;
|
||||
|
||||
// 8.16 医疗纠纷例数
|
||||
private Long medicalDisputeCount;
|
||||
|
||||
// 8.17 参与家庭医生签约服务的执业(助理)医师数
|
||||
private Long familyDoctorCount;
|
||||
|
||||
// 8.18 家庭医生团队签约人数
|
||||
private Long familyDoctorContractCount;
|
||||
|
||||
// 8.19 家庭医生团队服务人次数
|
||||
private Long familyDoctorServiceCount;
|
||||
|
||||
// 8.20 当年门诊诊疗过程中开具健康教育处方人次数
|
||||
private Long healthEducationPrescriptionCount;
|
||||
|
||||
// 8.21 当年开展住院患者健康教育干预人次数
|
||||
private Long inpatientHealthEducationCount;
|
||||
|
||||
// 8.22 举办健康教育讲座次数
|
||||
private Long healthLectureCount;
|
||||
|
||||
// 8.23 健康教育讲座参加人数
|
||||
private Long healthLectureParticipantCount;
|
||||
|
||||
// 8.24 举办健康教育咨询活动次数
|
||||
private Long healthConsultationActivityCount;
|
||||
|
||||
// 8.25 健康教育咨询活动参加人数
|
||||
private Long healthConsultationParticipantCount;
|
||||
|
||||
// 8.26 年内举办各类健康主题宣传活动次数
|
||||
private Long healthPromotionActivityCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 8.1 总诊疗人次数DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class TotalDiagnosisTreatmentsDTO {
|
||||
private Long total; // 总诊疗人次数合计
|
||||
|
||||
// 8.1.1 其中:门诊人次数
|
||||
private OutpatientVisitDTO outpatientVisit;
|
||||
|
||||
// 8.1.2 急诊人次数
|
||||
private EmergencyVisitDTO emergencyVisit;
|
||||
|
||||
// 8.1.3 家庭医疗服务人次数
|
||||
private Long homeMedicalServiceCount;
|
||||
|
||||
// 8.1.4 其中:预约诊疗人次数
|
||||
private Long appointmentDiagnosisCount;
|
||||
|
||||
// 8.1.5 港澳台居民诊疗人次数
|
||||
private Long hongKongTaiwanMacaoPatientCount;
|
||||
|
||||
// 8.1.6 外籍患者诊疗人次数
|
||||
private Long foreignPatientCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 8.1.1 门诊人次数DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class OutpatientVisitDTO {
|
||||
private Long totalL; // 门诊人次数合计
|
||||
|
||||
// 8.1.1.1 其中:普通门诊人次数
|
||||
private Long generalOutpatientCountL;
|
||||
|
||||
// 8.1.1.2 专家门诊人次数
|
||||
// 专家门诊人次数合计
|
||||
private Long totalExpertOutpatientL;
|
||||
|
||||
// 8.1.1.2.1 其中:知名专家门诊人次数
|
||||
private Long renownedExpertOutpatientCountL;
|
||||
|
||||
// 8.1.1.3 其中:外请专家门诊人次数
|
||||
private Long externalExpertOutpatientCountL;
|
||||
|
||||
// 8.1.1.4 其中:应用中药饮片人次数
|
||||
private Long chineseHerbalMedicineUsageCountL;
|
||||
|
||||
// 8.1.1.5 使用中医非药物疗法总人次数
|
||||
private Long tcmNonDrugTherapyCountL;
|
||||
|
||||
// 8.1.1.6 应用中成药人次数
|
||||
private Long chinesePatentMedicineUsageCountL;
|
||||
|
||||
// 8.1.1.7 药学门诊人次数
|
||||
private Long pharmacyClinicCountL;
|
||||
}
|
||||
|
||||
/**
|
||||
* 8.1.2 急诊人次数DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class EmergencyVisitDTO {
|
||||
private Long total; // 急诊人次数合计
|
||||
|
||||
// 8.1.2.1 其中:急危患者(Ⅰ级)人次数
|
||||
private Long emergencyLevel1Count;
|
||||
|
||||
// 8.1.2.2 急重患者(Ⅱ级)人次数
|
||||
private Long emergencyLevel2Count;
|
||||
|
||||
// 8.1.2.3 急症患者(Ⅲ级)人次数
|
||||
private Long emergencyLevel3Count;
|
||||
|
||||
// 8.1.2.4 亚急症或非亚急症患者(Ⅳ级)人次数
|
||||
private Long emergencyLevel4Count;
|
||||
|
||||
// 8.1.2.5 其中:急诊人次中死亡人数
|
||||
private Long emergencyDeathCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 8.13 出院人次数DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class DischargeCountDTO {
|
||||
private Long total; // 出院人次数合计
|
||||
|
||||
// 8.13.1 其中:转往基层医疗卫生机构人次数
|
||||
private Long transferredToPrimaryCareCount;
|
||||
|
||||
// 8.13.2 日间手术人次数
|
||||
private Long daySurgeryCount;
|
||||
|
||||
// 8.13.3 住院分娩人次数
|
||||
private Long inpatientDeliveryCount;
|
||||
|
||||
// 8.13.4 死亡人数
|
||||
private Long deathCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 8.14 住院病人手术人次数DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class InpatientSurgeryCountDTO {
|
||||
private Long total; // 住院病人手术人次数合计
|
||||
|
||||
// 8.14.1 其中:手术室手术人次数
|
||||
private Long operatingRoomSurgeryCount;
|
||||
|
||||
// 8.14.2 介入室手术人次数
|
||||
private Long interventionalSurgeryCount;
|
||||
|
||||
// 8.14.3 内镜室手术人次数
|
||||
private Long endoscopySurgeryCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 8.15 门诊处方总数DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class OutpatientPrescriptionDTO {
|
||||
private Long total; // 门诊处方总数合计
|
||||
|
||||
// 8.15.1 其中:使用抗菌药物的处方数
|
||||
private Long antibioticPrescriptionCount;
|
||||
|
||||
// 8.15.2 中医处方数
|
||||
// 中医处方数合计
|
||||
private Long totalTcmPrescription;
|
||||
|
||||
// 8.15.2.1 中药饮片处方数
|
||||
private Long chineseHerbalPrescriptionCount;
|
||||
|
||||
// 8.15.2.2 中成药处方数
|
||||
private Long chinesePatentMedicinePrescriptionCount;
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user