常量修改
This commit is contained in:
@@ -52,7 +52,7 @@ public class OrganizationController {
|
||||
|
||||
// 基础采番
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.TEST.getPrefix());
|
||||
organization.setBus_no(code);
|
||||
organization.setBusNo(code);
|
||||
|
||||
boolean saveOrganizationSuccess = organizationService.save(organization);
|
||||
|
||||
@@ -86,6 +86,7 @@ public class OrganizationController {
|
||||
@DeleteMapping("/organization")
|
||||
public R<?> deleteSupplyRequest(@RequestParam Long orgId) {
|
||||
|
||||
// 在service层做业务校验
|
||||
boolean deleteSuccess = organizationService.removeById(orgId);
|
||||
|
||||
return deleteSuccess
|
||||
|
||||
@@ -10,8 +10,6 @@ import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.core.common.enums.AssignSeqEnum;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -19,7 +17,9 @@ import org.springframework.web.bind.annotation.*;
|
||||
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.enums.AssignSeqEnum;
|
||||
import com.core.common.enums.DefinitionTypeEnum;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.ChargeItemDefApp;
|
||||
@@ -51,12 +51,12 @@ public class ItemDefinitionController {
|
||||
private IChargeItemDefAppService chargeItemDefAppService;
|
||||
@Autowired(required = false)
|
||||
private ChargeItemDefSearchMapper chargeItemDefSearchMapper;
|
||||
// @Autowired(required = false)
|
||||
// private IMedicationDefinitionService medicationDefinitionService;
|
||||
// @Autowired(required = false)
|
||||
// private IDeviceDefinitionService deviceDefinitionService;
|
||||
// @Autowired(required = false)
|
||||
// private IActivityDefinitionService activityDefinitionService;
|
||||
// @Autowired(required = false)
|
||||
// private IMedicationDefinitionService medicationDefinitionService;
|
||||
// @Autowired(required = false)
|
||||
// private IDeviceDefinitionService deviceDefinitionService;
|
||||
// @Autowired(required = false)
|
||||
// private IActivityDefinitionService activityDefinitionService;
|
||||
@Autowired(required = false)
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@@ -133,10 +133,10 @@ public class ItemDefinitionController {
|
||||
}
|
||||
// 通过 DefinitionType 区分药品定价/器具定价/手术定价
|
||||
if (DefinitionTypeEnum.MEDICATION.getCode().equals(itemDefSearchParam.getDefinitionType())) {
|
||||
//获取定价列表
|
||||
// 获取定价列表
|
||||
chargeItemDefinitionList =
|
||||
chargeItemDefSearchMapper.getMedList(itemDefSearchParam, pageNo, pageSize, skipCount);
|
||||
//设置分页条件
|
||||
// 设置分页条件
|
||||
chargeItemDefinitionPage.setSize(pageSize);
|
||||
chargeItemDefinitionPage.setCurrent(pageNo);
|
||||
if (chargeItemDefinitionList.size() > 0) {
|
||||
@@ -146,13 +146,12 @@ public class ItemDefinitionController {
|
||||
chargeItemDefinitionPage.setTotal(0);
|
||||
chargeItemDefinitionPage.setRecords(new ArrayList<>());
|
||||
}
|
||||
return R.ok(chargeItemDefinitionPage,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, null));
|
||||
return R.ok(chargeItemDefinitionPage, MessageUtils.createMessage(PromptMsgConstant.Common.M00009, null));
|
||||
} else if (DefinitionTypeEnum.DEVICE.getCode().equals(itemDefSearchParam.getDefinitionType())) {
|
||||
//获取定价列表
|
||||
// 获取定价列表
|
||||
chargeItemDefinitionList =
|
||||
chargeItemDefSearchMapper.getDevList(itemDefSearchParam, pageNo, pageSize, skipCount);
|
||||
//设置分页条件
|
||||
// 设置分页条件
|
||||
chargeItemDefinitionPage.setSize(pageSize);
|
||||
chargeItemDefinitionPage.setCurrent(pageNo);
|
||||
if (chargeItemDefinitionList.size() > 0) {
|
||||
@@ -162,13 +161,12 @@ public class ItemDefinitionController {
|
||||
chargeItemDefinitionPage.setTotal(0);
|
||||
chargeItemDefinitionPage.setRecords(new ArrayList<>());
|
||||
}
|
||||
return R.ok(chargeItemDefinitionPage,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, null));
|
||||
return R.ok(chargeItemDefinitionPage, MessageUtils.createMessage(PromptMsgConstant.Common.M00009, null));
|
||||
} else if (DefinitionTypeEnum.ACTIVITY.getCode().equals(itemDefSearchParam.getDefinitionType())) {
|
||||
//获取定价列表
|
||||
// 获取定价列表
|
||||
chargeItemDefinitionList =
|
||||
chargeItemDefSearchMapper.getActList(itemDefSearchParam, pageNo, pageSize, skipCount);
|
||||
//设置分页条件
|
||||
// 设置分页条件
|
||||
chargeItemDefinitionPage.setSize(pageSize);
|
||||
chargeItemDefinitionPage.setCurrent(pageNo);
|
||||
if (chargeItemDefinitionList.size() > 0) {
|
||||
@@ -178,8 +176,7 @@ public class ItemDefinitionController {
|
||||
chargeItemDefinitionPage.setTotal(0);
|
||||
chargeItemDefinitionPage.setRecords(new ArrayList<>());
|
||||
}
|
||||
return R.ok(chargeItemDefinitionPage,
|
||||
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, null));
|
||||
return R.ok(chargeItemDefinitionPage, MessageUtils.createMessage(PromptMsgConstant.Common.M00009, null));
|
||||
} else {
|
||||
return R.ok(new Page<>(), MessageUtils.createMessage(PromptMsgConstant.Common.M00009, null));
|
||||
}
|
||||
@@ -220,34 +217,34 @@ public class ItemDefinitionController {
|
||||
// 基础采番
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.TEST.getPrefix());
|
||||
// 控制长度采番(seqLength: 总长度)
|
||||
String code1 = assignSeqUtil.getSeq(AssignSeqEnum.TEST.getPrefix(),8);
|
||||
String code1 = assignSeqUtil.getSeq(AssignSeqEnum.TEST.getPrefix(), 8);
|
||||
// 控制长度批量采番
|
||||
List<String> code2 = assignSeqUtil.getSeq(AssignSeqEnum.TEST.getPrefix(),8,3);
|
||||
List<String> code2 = assignSeqUtil.getSeq(AssignSeqEnum.TEST.getPrefix(), 8, 3);
|
||||
// 获取编号
|
||||
Integer code3 = assignSeqUtil.getSeqNo(AssignSeqEnum.TEST.getPrefix());
|
||||
// 批量获取编号
|
||||
List<Integer> code4 = assignSeqUtil.getSeqNo(AssignSeqEnum.TEST.getPrefix(),3);
|
||||
List<Integer> code4 = assignSeqUtil.getSeqNo(AssignSeqEnum.TEST.getPrefix(), 3);
|
||||
// 每日采番
|
||||
String code5 = assignSeqUtil.getSeqByDay(AssignSeqEnum.TEST.getPrefix());
|
||||
// 每日按长度采番(seqLength: 日期后的数字位数)
|
||||
String code6 = assignSeqUtil.getSeqByDay(AssignSeqEnum.TEST.getPrefix(),8);
|
||||
String code6 = assignSeqUtil.getSeqByDay(AssignSeqEnum.TEST.getPrefix(), 8);
|
||||
// 每日批量采番
|
||||
List<String> code7 = assignSeqUtil.getSeqByDay(AssignSeqEnum.TEST.getPrefix(),8,3);
|
||||
List<String> code7 = assignSeqUtil.getSeqByDay(AssignSeqEnum.TEST.getPrefix(), 8, 3);
|
||||
// 每日获取编号
|
||||
Integer code8 = assignSeqUtil.getSeqNoByDay(AssignSeqEnum.TEST.getPrefix());
|
||||
// 每日批量获取编号
|
||||
List<Integer> code9 = assignSeqUtil.getSeqNoByDay(AssignSeqEnum.TEST.getPrefix(),3);
|
||||
List<Integer> code9 = assignSeqUtil.getSeqNoByDay(AssignSeqEnum.TEST.getPrefix(), 3);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("code",code);
|
||||
map.put("code1",code1);
|
||||
map.put("code2",code2);
|
||||
map.put("code3",code3);
|
||||
map.put("code4",code4);
|
||||
map.put("code5",code5);
|
||||
map.put("code6",code6);
|
||||
map.put("code7",code7);
|
||||
map.put("code8",code8);
|
||||
map.put("code9",code9);
|
||||
map.put("code", code);
|
||||
map.put("code1", code1);
|
||||
map.put("code2", code2);
|
||||
map.put("code3", code3);
|
||||
map.put("code4", code4);
|
||||
map.put("code5", code5);
|
||||
map.put("code6", code6);
|
||||
map.put("code7", code7);
|
||||
map.put("code8", code8);
|
||||
map.put("code9", code9);
|
||||
return R.ok(map);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,17 +3,6 @@
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.assembler;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.web.inventorymanage.dto.InventoryReceiptDto;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
|
||||
/**
|
||||
* 采购入库相关dto转换器
|
||||
*
|
||||
@@ -30,36 +19,36 @@ public class PurchaseInventoryAssembler {
|
||||
* @param patientList【患者管理Entity实体】列表
|
||||
* @return 【入库单据分页列表DTO】分页
|
||||
*/
|
||||
public static Page<InventoryReceiptDto> assembleInventoryReceiptDto(Page<SupplyRequest> supplyRequestPage,
|
||||
List<Medication> medicationList, List<Patient> patientList) {
|
||||
|
||||
// 将查询到的【药品基本信息管理】列表,作成以ID为Key的Map
|
||||
Map<Long, Medication> medicationMap =
|
||||
medicationList.stream().collect(Collectors.toMap(Medication::getId, Function.identity()));
|
||||
|
||||
// 将查询到的【患者管理】列表,作成以ID为Key的Map
|
||||
Map<Long, Patient> patientMap =
|
||||
patientList.stream().collect(Collectors.toMap(Patient::getId, Function.identity()));
|
||||
|
||||
// 定义【入库单据分页列表DTO】的分页,传入【页码】、【行数】、及上面分页的【总数】
|
||||
Page<InventoryReceiptDto> returnPage =
|
||||
new Page<>(supplyRequestPage.getCurrent(), supplyRequestPage.getSize(), supplyRequestPage.getTotal());
|
||||
|
||||
// 将【供应申请管理】的分页转化为返回【入库单据分页列表DTO】的分页
|
||||
returnPage.setRecords(supplyRequestPage.getRecords().stream().map(entity -> {
|
||||
// 定义【入库单据分页列表DTO】
|
||||
InventoryReceiptDto dto = new InventoryReceiptDto();
|
||||
// 从主表COPY需要的字段
|
||||
dto.setId(entity.getId());
|
||||
dto.setCategoryEnum(1);
|
||||
// 从【药品基本信息管理】Map取值,设置【药品基本信息管理】返回实体
|
||||
dto.setMedication(medicationMap.getOrDefault(entity.getDispenseId(), null));
|
||||
// 从【患者管理】Map取值,设置【患者管理】返回实体
|
||||
dto.setPatient(patientMap.getOrDefault(entity.getPatientId(), null));
|
||||
return dto;
|
||||
}).collect(Collectors.toList()));
|
||||
|
||||
// 返回【入库单据分页列表DTO】分页
|
||||
return returnPage;
|
||||
}
|
||||
// public static Page<InventoryReceiptDto> assembleInventoryReceiptDto(Page<SupplyRequest> supplyRequestPage,
|
||||
// List<Medication> medicationList, List<Patient> patientList) {
|
||||
//
|
||||
// // 将查询到的【药品基本信息管理】列表,作成以ID为Key的Map
|
||||
// Map<Long, Medication> medicationMap =
|
||||
// medicationList.stream().collect(Collectors.toMap(Medication::getId, Function.identity()));
|
||||
//
|
||||
// // 将查询到的【患者管理】列表,作成以ID为Key的Map
|
||||
// Map<Long, Patient> patientMap =
|
||||
// patientList.stream().collect(Collectors.toMap(Patient::getId, Function.identity()));
|
||||
//
|
||||
// // 定义【入库单据分页列表DTO】的分页,传入【页码】、【行数】、及上面分页的【总数】
|
||||
// Page<InventoryReceiptDto> returnPage =
|
||||
// new Page<>(supplyRequestPage.getCurrent(), supplyRequestPage.getSize(), supplyRequestPage.getTotal());
|
||||
//
|
||||
// // 将【供应申请管理】的分页转化为返回【入库单据分页列表DTO】的分页
|
||||
// returnPage.setRecords(supplyRequestPage.getRecords().stream().map(entity -> {
|
||||
// // 定义【入库单据分页列表DTO】
|
||||
// InventoryReceiptDto dto = new InventoryReceiptDto();
|
||||
// // 从主表COPY需要的字段
|
||||
// dto.setId(entity.getId());
|
||||
// dto.setCategoryEnum(1);
|
||||
// // 从【药品基本信息管理】Map取值,设置【药品基本信息管理】返回实体
|
||||
// dto.setMedication(medicationMap.getOrDefault(entity.getDispenseId(), null));
|
||||
// // 从【患者管理】Map取值,设置【患者管理】返回实体
|
||||
// dto.setPatient(patientMap.getOrDefault(entity.getPatientId(), null));
|
||||
// return dto;
|
||||
// }).collect(Collectors.toList()));
|
||||
//
|
||||
// // 返回【入库单据分页列表DTO】分页
|
||||
// return returnPage;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
*/
|
||||
package com.openhis.web.inventorymanage.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.HashSet;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -13,27 +12,27 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
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.MessageUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.ChargeItem;
|
||||
import com.openhis.administration.domain.Location;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
import com.openhis.administration.service.IChargeItemService;
|
||||
import com.openhis.administration.service.ILocationService;
|
||||
import com.openhis.administration.service.IPatientService;
|
||||
import com.openhis.administration.service.ISupplierService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.medication.service.IMedicationService;
|
||||
import com.openhis.web.inventorymanage.assembler.PurchaseInventoryAssembler;
|
||||
import com.openhis.web.inventorymanage.dto.InventoryDto;
|
||||
import com.openhis.web.inventorymanage.dto.InventoryReceiptInitDto;
|
||||
import com.openhis.web.inventorymanage.dto.InventorySearchParam;
|
||||
import com.openhis.web.inventorymanage.dto.SaveInventoryReceiptDto;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
||||
import com.openhis.workflow.service.ISupplyRequestService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -61,6 +60,8 @@ public class PurchaseInventoryController {
|
||||
private ISupplierService supplierService;
|
||||
@Autowired
|
||||
private ILocationService locationService;
|
||||
@Autowired
|
||||
private SupplyRequestMapper supplyRequestMapper;
|
||||
|
||||
@GetMapping(value = "/init")
|
||||
public R<?> init() {
|
||||
@@ -81,14 +82,43 @@ public class PurchaseInventoryController {
|
||||
// 3.practitioner_role与practitioner联查获取对应location的管理员列表
|
||||
// 4.查询选定对应药品类型的药品信息列表
|
||||
|
||||
/**
|
||||
* 入库单据列表
|
||||
*
|
||||
* @param inventorySearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param request 请求数据
|
||||
* @return 入库单据分页列表
|
||||
*/
|
||||
@GetMapping(value = "/inventory-receipt-page")
|
||||
public R<?> getPage(InventorySearchParam inventorySearchParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||
|
||||
// 设置模糊查询的字段名
|
||||
HashSet<String> searchFields = new HashSet<>();
|
||||
searchFields.add(CommonConstants.FieldName.BusNo);
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<InventorySearchParam> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(inventorySearchParam, searchKey, searchFields, request);
|
||||
|
||||
// Page<InventoryReceiptDto> inventoryReceiptPage= supplyRequestService.page(new
|
||||
// Page<>(pageNo,pageSize),queryWrapper);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加入库单据(生成供应请求)
|
||||
*
|
||||
* @param inventoryDto 供应请求信息
|
||||
* @param inventoryDto 入库单据
|
||||
*/
|
||||
@PostMapping("/inventory-receipt")
|
||||
public R<?> addSupplyRequest(@Validated @RequestBody InventoryDto inventoryDto) {
|
||||
// 生成待发送的入库单据supply_request
|
||||
public R<?> addInventoryReceipt(@Validated @RequestBody InventoryDto inventoryDto) {
|
||||
// 生成待发送的入库单据
|
||||
SupplyRequest supplyRequest = new SupplyRequest();
|
||||
BeanUtils.copyProperties(inventoryDto, supplyRequest);
|
||||
// 如果业务上不需要其它处理 直接调用service的保存方法
|
||||
@@ -120,7 +150,7 @@ public class PurchaseInventoryController {
|
||||
* @param saveInventoryReceiptDto 供应请求信息
|
||||
*/
|
||||
@PutMapping("/inventory-receipt")
|
||||
public R<?> editSupplyRequest(@Validated @RequestBody SaveInventoryReceiptDto saveInventoryReceiptDto) {
|
||||
public R<?> editInventoryReceipt(@Validated @RequestBody SaveInventoryReceiptDto saveInventoryReceiptDto) {
|
||||
// 更新supply_request信息
|
||||
SupplyRequest saveRequest = new SupplyRequest();
|
||||
BeanUtils.copyProperties(saveInventoryReceiptDto, saveRequest);
|
||||
@@ -140,7 +170,7 @@ public class PurchaseInventoryController {
|
||||
* @param supplyRequestId 主表id
|
||||
*/
|
||||
@DeleteMapping("/inventory-receipt")
|
||||
public R<?> deleteSupplyRequest(@RequestParam Long supplyRequestId) {
|
||||
public R<?> deleteInventoryReceipt(@RequestParam Long supplyRequestId) {
|
||||
// 全都是逻辑删除
|
||||
|
||||
boolean deleteSuccess = supplyRequestService.removeById(supplyRequestId);
|
||||
@@ -155,48 +185,6 @@ public class PurchaseInventoryController {
|
||||
return deleteChargeItemSuccess ? R.ok() : R.fail();
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库单据详情列表
|
||||
*
|
||||
* @param inventorySearchParam 查询条件
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 入库单据分页列表
|
||||
*/
|
||||
@GetMapping(value = "/inventory-receipt-page")
|
||||
public R<?> getDetailPage(InventorySearchParam inventorySearchParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 查询条件初始化
|
||||
Medication medication = new Medication();
|
||||
BeanUtils.copyProperties(inventorySearchParam, medication);
|
||||
|
||||
SupplyRequest supplyRequest = new SupplyRequest();
|
||||
BeanUtils.copyProperties(inventorySearchParam, supplyRequest);
|
||||
|
||||
// 获取供应请求信息
|
||||
|
||||
// ====================================================================================
|
||||
|
||||
// 查询【供应申请管理】分页列表
|
||||
Page<SupplyRequest> supplyRequestPage = supplyRequestService.getPage(supplyRequest, pageNo, pageSize);
|
||||
|
||||
// 根据【发放id】查询【药品基本信息管理】列表
|
||||
List<Medication> medicationList = medicationService.listByIds(
|
||||
supplyRequestPage.getRecords().stream().map(SupplyRequest::getDispenseId).collect(Collectors.toList()));
|
||||
|
||||
// 根据【患者id】查询【患者管理】列表
|
||||
List<Patient> patientList = patientService.listByIds(
|
||||
supplyRequestPage.getRecords().stream().map(SupplyRequest::getPatientId).collect(Collectors.toList()));
|
||||
|
||||
// 装配并返回【入库单据分页列表DTO】分页
|
||||
return R
|
||||
.ok(PurchaseInventoryAssembler.assembleInventoryReceiptDto(supplyRequestPage, medicationList, patientList));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 单据提交申请
|
||||
*
|
||||
|
||||
@@ -6,10 +6,15 @@ package com.openhis.web.inventorymanage.dto;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 入库
|
||||
*
|
||||
* @author ZhangYC
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@@ -24,6 +29,7 @@ public class InventoryDto {
|
||||
private Integer itemQuantity;
|
||||
|
||||
/** 物品编码 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long code;
|
||||
|
||||
/** 物品计量单位 */
|
||||
|
||||
@@ -8,8 +8,8 @@ import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -24,68 +24,44 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class InventoryReceiptDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 单据号 */
|
||||
private String busNo;
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 意图 */
|
||||
private Integer intentEnum;
|
||||
|
||||
/** 分类 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 优先权 */
|
||||
private Integer priorityEnum;
|
||||
|
||||
/** 汇总编号 */
|
||||
private Long summaryId;
|
||||
|
||||
/** 交付 */
|
||||
private Long deliverId;
|
||||
|
||||
/** 患者id */
|
||||
private Long patientId;
|
||||
|
||||
/** 发放实体表名 */
|
||||
private String dispenseTable;
|
||||
|
||||
/** 发放id */
|
||||
private Long dispenseId;
|
||||
|
||||
/** 期望时间 */
|
||||
private Date occurrenceTime;
|
||||
|
||||
/** 供应人 */
|
||||
private Long practitionerId;
|
||||
|
||||
/** 供应商 */
|
||||
private Long supplierId;
|
||||
|
||||
/** 理由 */
|
||||
private String reason;
|
||||
|
||||
/** 源仓库类型 */
|
||||
private Integer sourceType;
|
||||
|
||||
/** 源仓库 */
|
||||
private Long sourceLocationId;
|
||||
|
||||
/** 源仓位 */
|
||||
private Long sourceLocationStoreId;
|
||||
/** 目的仓库 */
|
||||
private Long purposeLocationId;
|
||||
|
||||
/** 目的类型 */
|
||||
private Integer purposeType;
|
||||
/** 审批人 */
|
||||
private Long approverId;
|
||||
|
||||
/** 药品基本信息管理Entity实体 */
|
||||
private Medication medication;
|
||||
/** 审批时间 */
|
||||
private Date approvalTime;
|
||||
|
||||
/** 患者管理Entity实体 */
|
||||
private Patient patient;
|
||||
/** 申请人 */
|
||||
private Long applicantId;
|
||||
|
||||
/** 申请时间 */
|
||||
private Date applyTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
package com.openhis.web.inventorymanage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -18,4 +21,28 @@ import lombok.experimental.Accessors;
|
||||
@Accessors(chain = true)
|
||||
public class InventorySearchParam implements Serializable {
|
||||
|
||||
/** 单据号 */
|
||||
@Length(max = 255)
|
||||
private String busNo;
|
||||
|
||||
/** 状态 */
|
||||
private Integer statusEnum;
|
||||
|
||||
/** 分类 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
/** 供应商 */
|
||||
private Long supplierId;
|
||||
|
||||
/** 申请开始时间 */
|
||||
private Date applyTimeStart;
|
||||
|
||||
/** 申请结束时间 */
|
||||
private Date applyTimeEnd;
|
||||
|
||||
/** 目的仓库 */
|
||||
private Long purposeLocationId;
|
||||
|
||||
/** 申请人 */
|
||||
private Long applicantId;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,52 @@
|
||||
package com.openhis.common.constant;
|
||||
|
||||
/**
|
||||
* 共通常量
|
||||
* 常量
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public class CommonConstants {
|
||||
|
||||
/**
|
||||
* 租户ID字段名称
|
||||
* 共同常量
|
||||
*/
|
||||
public static final String TENANT_ID = "tenant_id";
|
||||
public interface Common {
|
||||
/**
|
||||
* 租户ID字段名称
|
||||
*/
|
||||
String TENANT_ID = "tenant_id";
|
||||
|
||||
public static final String S_TIME = "STime";
|
||||
/**
|
||||
* 开始时间(用于分页条件查询)
|
||||
*/
|
||||
String S_TIME = "STime";
|
||||
|
||||
public static final String E_TIME = "ETime";
|
||||
/**
|
||||
* 结束时间(用于分页条件查询)
|
||||
*/
|
||||
String E_TIME = "ETime";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表名常量
|
||||
*/
|
||||
public interface TableName {
|
||||
|
||||
/**
|
||||
* 服务管理
|
||||
*/
|
||||
String ADM_HEALTHCARE_SERVICE = "adm_healthcare_service";
|
||||
}
|
||||
|
||||
/**
|
||||
* 字段名常量
|
||||
*/
|
||||
public interface FieldName {
|
||||
|
||||
/**
|
||||
* 业务编码
|
||||
*/
|
||||
String BusNo = "bus_no";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.openhis.common.constant;
|
||||
|
||||
/**
|
||||
* APL消息ID常量类
|
||||
*/
|
||||
public interface PromptMsgConstant {
|
||||
|
||||
/**
|
||||
* 共用
|
||||
*/
|
||||
interface Common {
|
||||
/**
|
||||
* {0}添加成功
|
||||
*/
|
||||
String M00001 = "apl.common.M00001";
|
||||
/**
|
||||
* {0}保存成功
|
||||
*/
|
||||
String M00002 = "apl.common.M00002";
|
||||
/**
|
||||
* {0}已经存在
|
||||
*/
|
||||
String M00003 = "apl.common.M00003";
|
||||
/**
|
||||
* {0}操作成功
|
||||
*/
|
||||
String M00004 = "apl.common.M00004";
|
||||
/**
|
||||
* {0}删除成功
|
||||
*/
|
||||
String M00005 = "apl.common.M00005";
|
||||
/**
|
||||
* 操作失败,该数据已被他人删除,请刷新后重试
|
||||
*/
|
||||
String M00006 = "apl.common.M00006";
|
||||
/**
|
||||
* 操作失败,该数据已被他人更改,请刷新后重试
|
||||
*/
|
||||
String M00007 = "apl.common.M00007";
|
||||
/**
|
||||
* 请勿重复提交
|
||||
*/
|
||||
String M00008 = "apl.common.M00008";
|
||||
/**
|
||||
* 查询成功
|
||||
*/
|
||||
String M00009 = "apl.common.M00009";
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.openhis.common.constant;
|
||||
|
||||
/**
|
||||
* 表名常量
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public class TableNameConstants {
|
||||
/**
|
||||
* 服务管理
|
||||
*/
|
||||
public static final String ADM_HEALTHCARE_SERVICE = "adm_healthcare_service";
|
||||
|
||||
}
|
||||
@@ -1,11 +1,5 @@
|
||||
package com.openhis.common.utils;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -15,6 +9,13 @@ import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
|
||||
/**
|
||||
* His查询工具类
|
||||
*/
|
||||
@@ -23,16 +24,17 @@ public class HisQueryUtils {
|
||||
/**
|
||||
* 条件查询构造器
|
||||
*
|
||||
* @param entity 传参实体
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param entity 传参实体
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param searchFields 支持模糊查询的字段集合 ; 不需要模糊查询传 null 即可
|
||||
* @param request 请求
|
||||
* @param request 请求
|
||||
* @return 构造条件
|
||||
*/
|
||||
public static <T> QueryWrapper<T> buildQueryWrapper(T entity, String searchKey, HashSet<String> searchFields, HttpServletRequest request) {
|
||||
public static <T> QueryWrapper<T> buildQueryWrapper(T entity, String searchKey, HashSet<String> searchFields,
|
||||
HttpServletRequest request) {
|
||||
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
||||
// 添加租户id查询条件
|
||||
queryWrapper.eq(CommonConstants.TENANT_ID, getCurrentTenantId());
|
||||
queryWrapper.eq(CommonConstants.Common.TENANT_ID, getCurrentTenantId());
|
||||
if (entity == null) {
|
||||
return queryWrapper;
|
||||
}
|
||||
@@ -43,7 +45,7 @@ public class HisQueryUtils {
|
||||
try {
|
||||
Object value = field.get(entity);
|
||||
if (value != null && !value.toString().equals("")) {
|
||||
//String fieldName = field.getName();
|
||||
// String fieldName = field.getName();
|
||||
// 将驼峰命名的字段名转换为下划线命名的数据库字段名
|
||||
String fieldName = camelToUnderline(field.getName());
|
||||
// 处理等于条件
|
||||
@@ -68,14 +70,15 @@ public class HisQueryUtils {
|
||||
for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
|
||||
String paramName = entry.getKey();
|
||||
// 检查参数名是否以 "STime" 或 "ETime" 结尾
|
||||
if (paramName.endsWith(CommonConstants.S_TIME) || paramName.endsWith(CommonConstants.E_TIME)) {
|
||||
if (paramName.endsWith(CommonConstants.Common.S_TIME)
|
||||
|| paramName.endsWith(CommonConstants.Common.E_TIME)) {
|
||||
// 提取字段名(去掉 "STime" 或 "ETime" 后缀)
|
||||
String fieldName = paramName.substring(0, paramName.length() - 5);
|
||||
// 驼峰转下划线
|
||||
String dbFieldName = camelToUnderline(fieldName);
|
||||
// 获取对应的 STime 和 ETime 值
|
||||
String startValue = getParameterValue(request, fieldName + CommonConstants.S_TIME);
|
||||
String endValue = getParameterValue(request, fieldName + CommonConstants.E_TIME);
|
||||
String startValue = getParameterValue(request, fieldName + CommonConstants.Common.S_TIME);
|
||||
String endValue = getParameterValue(request, fieldName + CommonConstants.Common.E_TIME);
|
||||
// 如果 Start 和 End 都有值,则添加时间段查询条件
|
||||
if (startValue != null && endValue != null) {
|
||||
try {
|
||||
@@ -88,7 +91,7 @@ public class HisQueryUtils {
|
||||
Date startDate = dateFormat.parse(startValue);
|
||||
Date endDate = dateFormat.parse(endValue);
|
||||
queryWrapper.ge(dbFieldName, startDate); // 大于等于 STime
|
||||
queryWrapper.le(dbFieldName, endDate); // 小于等于 ETime
|
||||
queryWrapper.le(dbFieldName, endDate); // 小于等于 ETime
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -102,7 +105,7 @@ public class HisQueryUtils {
|
||||
* 检查时间字符串是否符合指定格式
|
||||
*
|
||||
* @param formatter 时间格式
|
||||
* @param dateStr 时间字符串
|
||||
* @param dateStr 时间字符串
|
||||
* @return 是否匹配
|
||||
*/
|
||||
private static boolean isValidFormat(DateTimeFormatter formatter, String dateStr) {
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package com.openhis.administration.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.openhis.common.enums.OrganizationClass;
|
||||
import com.openhis.common.enums.OrganizationType;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -60,5 +57,4 @@ public class Organization extends HisBaseEntity {
|
||||
/** 显示顺序 */
|
||||
private Integer displayOrder;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,8 +11,7 @@ import com.openhis.administration.domain.Organization;
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
public interface IOrganizationService extends IService<Organization> {
|
||||
Page<Organization> getOrganizationPage(Integer classEnum,Integer activeFlag, Integer pageNo, Integer pageSize);
|
||||
|
||||
Page<Organization> getOrganizationPage(Integer classEnum, Integer activeFlag, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 通过机构ID查询机构名称
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.mapper.OrganizationMapper;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
|
||||
/**
|
||||
* 机构管理(科室)Service业务层处理
|
||||
@@ -33,7 +32,8 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
|
||||
* @return 科室列表
|
||||
*/
|
||||
@Override
|
||||
public Page<Organization> getOrganizationPage(Integer classEnum,Integer activeFlag, Integer pageNo, Integer pageSize) {
|
||||
public Page<Organization> getOrganizationPage(Integer classEnum, Integer activeFlag, Integer pageNo,
|
||||
Integer pageSize) {
|
||||
|
||||
LambdaQueryWrapper<Organization> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
@@ -60,7 +60,7 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
|
||||
@Override
|
||||
public Organization getByCode(String code) {
|
||||
QueryWrapper<Organization> queryWrapper = new QueryWrapper<>();
|
||||
//设置查询条件为机构Id code
|
||||
// 设置查询条件为机构Id code
|
||||
queryWrapper.eq("code", code);
|
||||
return organizationMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package com.openhis.workflow.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -28,6 +27,9 @@ public class SupplyRequest extends HisBaseEntity {
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 单据号 */
|
||||
private String busNo;
|
||||
|
||||
/** 类型 */
|
||||
private Integer typeEnum;
|
||||
|
||||
@@ -118,5 +120,4 @@ public class SupplyRequest extends HisBaseEntity {
|
||||
/** 申请时间 */
|
||||
private Date applyTime;
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user