Merge branch 'master' of https://codeup.aliyun.com/61c0318acd8b75daa5a125f7/medical/openhis
This commit is contained in:
@@ -5,6 +5,9 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import com.openhis.common.enums.LocationBedStatus;
|
||||||
|
import com.openhis.common.enums.LocationMode;
|
||||||
|
import com.openhis.common.enums.LocationStatus;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -42,6 +45,12 @@ public class ILocationAppServiceImpl implements ILocationAppService {
|
|||||||
locationQueryDtoPage.getRecords().forEach(e -> {
|
locationQueryDtoPage.getRecords().forEach(e -> {
|
||||||
// 物理形式枚举回显赋值
|
// 物理形式枚举回显赋值
|
||||||
e.setFormEnum_enumText(EnumUtils.getInfoByValue(LocationForm.class, e.getFormEnum()));
|
e.setFormEnum_enumText(EnumUtils.getInfoByValue(LocationForm.class, e.getFormEnum()));
|
||||||
|
// 状态编码回显赋值
|
||||||
|
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(LocationStatus.class, e.getStatusEnum()));
|
||||||
|
// 操作状态回显赋值
|
||||||
|
e.setOperationalEnum_enumText(EnumUtils.getInfoByValue(LocationBedStatus.class, e.getOperationalEnum()));
|
||||||
|
// 模式编码回显赋值
|
||||||
|
e.setModeEnum_enumText(EnumUtils.getInfoByValue(LocationMode.class, e.getModeEnum()));
|
||||||
});
|
});
|
||||||
|
|
||||||
return locationQueryDtoPage;
|
return locationQueryDtoPage;
|
||||||
|
|||||||
@@ -72,10 +72,10 @@ public class CabinetLocationController {
|
|||||||
// locationQueryDto.setFormEnum(LocationForm.CABINET);
|
// locationQueryDto.setFormEnum(LocationForm.CABINET);
|
||||||
// BeanUtils.copyProperties(locationQueryDto, location);
|
// BeanUtils.copyProperties(locationQueryDto, location);
|
||||||
Location location = new Location(locationQueryDto.getId(), locationQueryDto.getBusNo(),
|
Location location = new Location(locationQueryDto.getId(), locationQueryDto.getBusNo(),
|
||||||
locationQueryDto.getName(), LocationStatus.ACTIVE, LocationBedStatus.U, LocationMode.INSTANCE,
|
locationQueryDto.getName(), LocationStatus.ACTIVE.getValue(), LocationBedStatus.U.getValue(),
|
||||||
locationQueryDto.getTypeCode(), locationQueryDto.getTypeJson(), locationQueryDto.getPyStr(),
|
LocationMode.INSTANCE.getValue(), locationQueryDto.getTypeCode(), locationQueryDto.getTypeJson(),
|
||||||
locationQueryDto.getWbStr(), LocationForm.CABINET.getValue(), locationQueryDto.getOrganizationId(),
|
locationQueryDto.getPyStr(), locationQueryDto.getWbStr(), LocationForm.CABINET.getValue(),
|
||||||
locationQueryDto.getDisplayOrder());
|
locationQueryDto.getOrganizationId(), locationQueryDto.getDisplayOrder());
|
||||||
|
|
||||||
boolean saveLocationSuccess = locationService.save(location);
|
boolean saveLocationSuccess = locationService.save(location);
|
||||||
return saveLocationSuccess
|
return saveLocationSuccess
|
||||||
@@ -104,10 +104,10 @@ public class CabinetLocationController {
|
|||||||
public R<?> editLocation(@Validated @RequestBody LocationQueryDto locationQueryDto) {
|
public R<?> editLocation(@Validated @RequestBody LocationQueryDto locationQueryDto) {
|
||||||
|
|
||||||
Location location = new Location(locationQueryDto.getId(), locationQueryDto.getBusNo(),
|
Location location = new Location(locationQueryDto.getId(), locationQueryDto.getBusNo(),
|
||||||
locationQueryDto.getName(), LocationStatus.ACTIVE, LocationBedStatus.U, LocationMode.INSTANCE,
|
locationQueryDto.getName(), LocationStatus.ACTIVE.getValue(), LocationBedStatus.U.getValue(),
|
||||||
locationQueryDto.getTypeCode(), locationQueryDto.getTypeJson(), locationQueryDto.getPyStr(),
|
LocationMode.INSTANCE.getValue(), locationQueryDto.getTypeCode(), locationQueryDto.getTypeJson(),
|
||||||
locationQueryDto.getWbStr(), LocationForm.CABINET.getValue(), locationQueryDto.getOrganizationId(),
|
locationQueryDto.getPyStr(), locationQueryDto.getWbStr(), LocationForm.CABINET.getValue(),
|
||||||
locationQueryDto.getDisplayOrder());
|
locationQueryDto.getOrganizationId(), locationQueryDto.getDisplayOrder());
|
||||||
|
|
||||||
boolean updateLocationSuccess = locationService.updateById(location);
|
boolean updateLocationSuccess = locationService.updateById(location);
|
||||||
return updateLocationSuccess
|
return updateLocationSuccess
|
||||||
|
|||||||
@@ -0,0 +1,175 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.basedatamanage.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
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.core.common.utils.MessageUtils;
|
||||||
|
import com.openhis.administration.domain.Practitioner;
|
||||||
|
import com.openhis.administration.domain.PractitionerRole;
|
||||||
|
import com.openhis.administration.mapper.PractitionerMapper;
|
||||||
|
import com.openhis.administration.mapper.PractitionerRoleMapper;
|
||||||
|
import com.openhis.administration.service.IPractitionerService;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.openhis.common.enums.AccountStatus;
|
||||||
|
import com.openhis.common.enums.AdministrativeGender;
|
||||||
|
import com.openhis.common.utils.EnumUtils;
|
||||||
|
import com.openhis.common.utils.HisPageUtils;
|
||||||
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
|
import com.openhis.web.basedatamanage.dto.PractSearchParam;
|
||||||
|
import com.openhis.web.basedatamanage.dto.PractitionerDto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工管理Controller业务层处理
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/basedatamanage/practitioner")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PractitionerController {
|
||||||
|
|
||||||
|
private final IPractitionerService practitionerService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PractitionerMapper practitionerMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PractitionerRoleMapper practitionerRoleMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工分页列表
|
||||||
|
*
|
||||||
|
* @param practSearchParam 查询条件
|
||||||
|
* @param pageNo 当前页码
|
||||||
|
* @param pageSize 查询条数
|
||||||
|
* @param request 请求数据
|
||||||
|
* @return 员工分页列表
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/practitioner")
|
||||||
|
public R<?> getPractitionerPage(PractSearchParam practSearchParam,
|
||||||
|
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||||
|
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||||
|
|
||||||
|
// 构建查询条件
|
||||||
|
QueryWrapper<Practitioner> queryWrapper = HisQueryUtils.buildQueryWrapper(practSearchParam, searchKey,
|
||||||
|
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), request);
|
||||||
|
|
||||||
|
// 设置排序
|
||||||
|
queryWrapper.orderByDesc("name");
|
||||||
|
|
||||||
|
// 执行分页查询并转换为 practitionerDtoPage
|
||||||
|
Page<PractitionerDto> practitionerDtoPage =
|
||||||
|
HisPageUtils.selectPage(practitionerMapper, queryWrapper, pageNo, pageSize, PractitionerDto.class);
|
||||||
|
|
||||||
|
practitionerDtoPage.getRecords().forEach(e -> {
|
||||||
|
// 性别回显赋值
|
||||||
|
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||||
|
});
|
||||||
|
|
||||||
|
return R.ok(practitionerDtoPage,
|
||||||
|
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"员工信息"}));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加员工信息
|
||||||
|
*
|
||||||
|
* @param practitionerDto 员工信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/practitioner")
|
||||||
|
public R<?> addPractitioner(@Validated @RequestBody PractitionerDto practitionerDto) {
|
||||||
|
|
||||||
|
// 新增practitioner信息
|
||||||
|
Practitioner practitioner = new Practitioner();
|
||||||
|
BeanUtils.copyProperties(practitionerDto, practitioner);
|
||||||
|
practitioner.setActiveFlag(AccountStatus.ACTIVE.getValue());
|
||||||
|
|
||||||
|
boolean savePractitionerSuccess = practitionerService.save(practitioner);
|
||||||
|
|
||||||
|
PractitionerRole practitionerRole = new PractitionerRole();
|
||||||
|
practitionerRole.setPractitionerId(practitioner.getId());
|
||||||
|
practitionerRole.setName(practitioner.getName());
|
||||||
|
Integer saveProleSuccess = practitionerRoleMapper.insert(practitionerRole);
|
||||||
|
|
||||||
|
boolean saveFlag;
|
||||||
|
if (savePractitionerSuccess && saveProleSuccess == 1) {
|
||||||
|
saveFlag = true;
|
||||||
|
} else {
|
||||||
|
saveFlag = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return saveFlag ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"员工信息"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"员工信息"}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取员工需要编辑的信息
|
||||||
|
*
|
||||||
|
* @param practitionerId 员工信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/practitioner-getById")
|
||||||
|
public R<?> getPractitionerById(@Validated @RequestParam Long practitionerId) {
|
||||||
|
|
||||||
|
Practitioner practitioner = practitionerService.getById(practitionerId);
|
||||||
|
if (practitioner != null) {
|
||||||
|
return R.ok(practitioner,
|
||||||
|
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"员工信息"}));
|
||||||
|
} else {
|
||||||
|
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"员工信息查新失败"}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑员工信息
|
||||||
|
*
|
||||||
|
* @param practitionerDto 员工信息
|
||||||
|
*/
|
||||||
|
@PutMapping("/practitioner")
|
||||||
|
public R<?> editPractitioner(@Validated @RequestBody PractitionerDto practitionerDto) {
|
||||||
|
|
||||||
|
// 编辑practitioner信息
|
||||||
|
Practitioner practitioner = new Practitioner();
|
||||||
|
BeanUtils.copyProperties(practitionerDto, practitioner);
|
||||||
|
|
||||||
|
boolean editPractitionerSuccess = practitionerService.updateById(practitioner);
|
||||||
|
|
||||||
|
return editPractitionerSuccess
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"员工信息"}))
|
||||||
|
: R.fail(PromptMsgConstant.Common.M00007, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除员工信息
|
||||||
|
*
|
||||||
|
* @param practitionerId 主表id
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/practitioner")
|
||||||
|
public R<?> deletePractitioner(@RequestParam Long practitionerId) {
|
||||||
|
|
||||||
|
boolean delPractitionerSuccess = practitionerService.removeById(practitionerId);
|
||||||
|
|
||||||
|
return delPractitionerSuccess
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"员工信息"}))
|
||||||
|
: R.fail(PromptMsgConstant.Common.M00006, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,7 +8,6 @@ import java.util.HashSet;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import com.openhis.administration.domain.Organization;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -78,24 +77,24 @@ public class PractitionerRoleController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 添加岗位信息
|
// * 添加岗位信息
|
||||||
*
|
// *
|
||||||
* @param practitionerRoleDto 岗位信息
|
// * @param practitionerRoleDto 岗位信息
|
||||||
*/
|
// */
|
||||||
@PostMapping("/practitioner-role")
|
// @PostMapping("/practitioner-role")
|
||||||
public R<?> addPractitionerRole(@Validated @RequestBody PractitionerRoleDto practitionerRoleDto) {
|
// public R<?> addPractitionerRole(@Validated @RequestBody CreatePractitionerRoleDto practitionerRoleDto) {
|
||||||
|
//
|
||||||
// 新增practitionerRole信息
|
// // 新增practitionerRole信息
|
||||||
PractitionerRole practitionerRole = new PractitionerRole();
|
// PractitionerRole practitionerRole = new PractitionerRole();
|
||||||
BeanUtils.copyProperties(practitionerRoleDto, practitionerRole);
|
// BeanUtils.copyProperties(practitionerRoleDto, practitionerRole);
|
||||||
|
//
|
||||||
boolean savePractitionerRoleSuccess = practitionerRoleService.save(practitionerRole);
|
// boolean savePractitionerRoleSuccess = practitionerRoleService.save(practitionerRole);
|
||||||
|
//
|
||||||
return savePractitionerRoleSuccess
|
// return savePractitionerRoleSuccess
|
||||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"岗位信息"}))
|
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"岗位信息"}))
|
||||||
: R.fail(PromptMsgConstant.Common.M00007, null);
|
// : R.fail(PromptMsgConstant.Common.M00007, null);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取岗位需要编辑的信息
|
* 获取岗位需要编辑的信息
|
||||||
@@ -106,7 +105,8 @@ public class PractitionerRoleController {
|
|||||||
public R<?> getPractitionerRoleById(@Validated @RequestParam Long proleId) {
|
public R<?> getPractitionerRoleById(@Validated @RequestParam Long proleId) {
|
||||||
|
|
||||||
PractitionerRole practitionerRole = practitionerRoleService.getById(proleId);
|
PractitionerRole practitionerRole = practitionerRoleService.getById(proleId);
|
||||||
return R.ok(practitionerRole, MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"岗位信息"}));
|
return R.ok(practitionerRole,
|
||||||
|
MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"岗位信息"}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -120,6 +120,15 @@ public class PractitionerRoleController {
|
|||||||
// 编辑practitionerRole信息
|
// 编辑practitionerRole信息
|
||||||
PractitionerRole practitionerRole = new PractitionerRole();
|
PractitionerRole practitionerRole = new PractitionerRole();
|
||||||
BeanUtils.copyProperties(practitionerRoleDto, practitionerRole);
|
BeanUtils.copyProperties(practitionerRoleDto, practitionerRole);
|
||||||
|
if (practitionerRole.getRole_code() == null) {
|
||||||
|
return R.fail(PromptMsgConstant.Common.M00007, "角色编码不能为空");
|
||||||
|
}
|
||||||
|
if (practitionerRole.getOrgId() == null) {
|
||||||
|
return R.fail(PromptMsgConstant.Common.M00007, "科室不能为空");
|
||||||
|
}
|
||||||
|
if (practitionerRole.getLocationId() == null) {
|
||||||
|
return R.fail(PromptMsgConstant.Common.M00007, "位置不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
boolean editPractitionerRoleSuccess = practitionerRoleService.updateById(practitionerRole);
|
boolean editPractitionerRoleSuccess = practitionerRoleService.updateById(practitionerRole);
|
||||||
|
|
||||||
|
|||||||
@@ -39,15 +39,21 @@ public class LocationQueryDto {
|
|||||||
|
|
||||||
/** 状态编码 */
|
/** 状态编码 */
|
||||||
@NotNull(message = "状态编码不能为空")
|
@NotNull(message = "状态编码不能为空")
|
||||||
private LocationStatus statusEnum;
|
// private LocationStatus statusEnum;
|
||||||
|
private Integer statusEnum;
|
||||||
|
private String statusEnum_enumText;
|
||||||
|
|
||||||
/** 操作状态 */
|
/** 操作状态 */
|
||||||
@NotNull(message = "操作状态不能为空")
|
@NotNull(message = "操作状态不能为空")
|
||||||
private LocationBedStatus operationalEnum;
|
// private LocationBedStatus operationalEnum;
|
||||||
|
private Integer operationalEnum;
|
||||||
|
private String operationalEnum_enumText;
|
||||||
|
|
||||||
/** 模式编码 */
|
/** 模式编码 */
|
||||||
@NotNull(message = "模式编码不能为空")
|
@NotNull(message = "模式编码不能为空")
|
||||||
private LocationMode modeEnum;
|
// private LocationMode modeEnum;
|
||||||
|
private Integer modeEnum;
|
||||||
|
private String modeEnum_enumText;
|
||||||
|
|
||||||
/** 模式编码 */
|
/** 模式编码 */
|
||||||
private String typeCode;
|
private String typeCode;
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ import lombok.experimental.Accessors;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class PractRoleSearchParam implements Serializable {
|
public class PractRoleSearchParam implements Serializable {
|
||||||
|
|
||||||
/** 名称 */
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/** 专业编码枚举 */
|
/** 专业编码枚举 */
|
||||||
private Integer specialtyEnum;
|
private Integer specialtyEnum;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.basedatamanage.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工分页查询条件
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class PractSearchParam implements Serializable {
|
||||||
|
|
||||||
|
/** 活动标记 */
|
||||||
|
private Integer activeFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.basedatamanage.dto;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class PractitionerDto {
|
||||||
|
|
||||||
|
/** 姓名 */
|
||||||
|
@NotBlank(message = "姓名不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 其他名称 */
|
||||||
|
private String nameJson;
|
||||||
|
|
||||||
|
/** 性别编码 */
|
||||||
|
// @NotBlank(message = "性别不能为空")
|
||||||
|
// private AdministrativeGender genderEnum;
|
||||||
|
private Integer genderEnum;
|
||||||
|
private String genderEnum_enumText;
|
||||||
|
|
||||||
|
/** 生日 */
|
||||||
|
private Date birthDate;
|
||||||
|
|
||||||
|
/** 死亡时间 */
|
||||||
|
private Date deceasedDate;
|
||||||
|
|
||||||
|
/** 电话 */
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/** 地址 */
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/** 地址省 */
|
||||||
|
private String addressProvince;
|
||||||
|
|
||||||
|
/** 地址市 */
|
||||||
|
private String addressCity;
|
||||||
|
|
||||||
|
/** 地址区 */
|
||||||
|
private String addressDistrict;
|
||||||
|
|
||||||
|
/** 地址街道 */
|
||||||
|
private String addressStreet;
|
||||||
|
|
||||||
|
/** 患者其他地址 */
|
||||||
|
private String addressJson;
|
||||||
|
|
||||||
|
/** 拼音码 */
|
||||||
|
private String pyStr;
|
||||||
|
|
||||||
|
/** 五笔码 */
|
||||||
|
private String wbStr;
|
||||||
|
|
||||||
|
/** 患者院内编码/病历号 */
|
||||||
|
private String busNo;
|
||||||
|
|
||||||
|
/** 医保码 */
|
||||||
|
private String ybNo;
|
||||||
|
|
||||||
|
/** 系统用户id */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long userId;
|
||||||
|
}
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
|
||||||
*/
|
|
||||||
package com.openhis.web.basedatamanage.dto;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author
|
|
||||||
* @date 2025-02-21
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class PractitionerRoleDto {
|
|
||||||
|
|
||||||
/** ID */
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/** 名称 */
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/** 角色编码 */
|
|
||||||
private String role_code;
|
|
||||||
|
|
||||||
/** 活动标识 */
|
|
||||||
private Integer activeFlag;
|
|
||||||
|
|
||||||
/** 参与者Id */
|
|
||||||
private Long practitionerId;
|
|
||||||
|
|
||||||
/** 机构 */
|
|
||||||
private Long orgId;
|
|
||||||
|
|
||||||
/** 位置ID */
|
|
||||||
private Long locationId;
|
|
||||||
|
|
||||||
/** 服务id */
|
|
||||||
private Long healthcareServiceId;
|
|
||||||
|
|
||||||
/** 专业编码枚举 */
|
|
||||||
private Integer specialtyEnum;
|
|
||||||
|
|
||||||
/** 岗位类型 */
|
|
||||||
private String typeCode;
|
|
||||||
|
|
||||||
/** 有效时间 */
|
|
||||||
private String availabilityJson;
|
|
||||||
}
|
|
||||||
@@ -15,6 +15,7 @@ import javax.validation.constraints.NotBlank;
|
|||||||
* @author lpt
|
* @author lpt
|
||||||
* @date 2025-02-25
|
* @date 2025-02-25
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class DiseaseManageUpDto {
|
public class DiseaseManageUpDto {
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.inventorymanage.appservice;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.administration.domain.ChargeItemDefApp;
|
||||||
|
import com.openhis.web.inventorymanage.dto.ItemChargeDetailDto;
|
||||||
|
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
||||||
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购入库 service
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-05
|
||||||
|
*/
|
||||||
|
public interface IInventoryManageService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验单据是否正确
|
||||||
|
*
|
||||||
|
* @param supplyRequest 单据信息
|
||||||
|
* @return 校验结果
|
||||||
|
*/
|
||||||
|
R<?> verifyInventoryReceipt(SupplyRequest supplyRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据单据号获取供应单据及供应项相关详细信息
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @param itemTable 供应项所在表名
|
||||||
|
* @return 供应单据及供应项相关详细信息
|
||||||
|
*/
|
||||||
|
List<SupplyItemDetailDto> getSupplyItemDetail(String busNo, String itemTable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取物品的价格信息
|
||||||
|
*
|
||||||
|
* @param itemIdList 物品id
|
||||||
|
* @return 价格信息
|
||||||
|
*/
|
||||||
|
List<ItemChargeDetailDto> getItemChargeDetail(List<Long> itemIdList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库项价格验证
|
||||||
|
*
|
||||||
|
* @param agreedList 供应单据
|
||||||
|
* @param chargeDetailList 项目价格
|
||||||
|
* @return 价格定义子表数据
|
||||||
|
*/
|
||||||
|
List<ChargeItemDefApp> verifyItemCharge(List<SupplyRequest> agreedList, List<ItemChargeDetailDto> chargeDetailList);
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.inventorymanage.appservice.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
|
import com.openhis.administration.domain.ChargeItemDefApp;
|
||||||
|
import com.openhis.common.constant.CommonConstants;
|
||||||
|
import com.openhis.common.enums.EventStatus;
|
||||||
|
import com.openhis.web.inventorymanage.appservice.IInventoryManageService;
|
||||||
|
import com.openhis.web.inventorymanage.dto.ItemChargeDetailDto;
|
||||||
|
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
||||||
|
import com.openhis.web.inventorymanage.mapper.InventoryManageMapper;
|
||||||
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购入库 impl
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class InventoryManageServiceImpl implements IInventoryManageService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InventoryManageMapper inventoryManageMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验单据是否正确
|
||||||
|
*
|
||||||
|
* @param supplyRequest 单据信息
|
||||||
|
* @return 校验结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public R<?> verifyInventoryReceipt(SupplyRequest supplyRequest) {
|
||||||
|
|
||||||
|
// // 判断同一物品的批次号是否重复
|
||||||
|
// boolean result = supplyRequestMapper
|
||||||
|
// .exists(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getItemId, supplyRequest.getItemId())
|
||||||
|
// .eq(SupplyRequest::getLotNumber, supplyRequest.getLotNumber())
|
||||||
|
// .ne(supplyRequest.getId() != null, SupplyRequest::getId, supplyRequest.getId()));
|
||||||
|
// if (result) {
|
||||||
|
// return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"批次号"}));
|
||||||
|
// }
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据单据号获取供应单据及供应项相关详细信息
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @param itemTable 供应项所在表名
|
||||||
|
* @return 供应单据及供应项相关详细信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SupplyItemDetailDto> getSupplyItemDetail(String busNo, String itemTable) {
|
||||||
|
|
||||||
|
List<SupplyItemDetailDto> supplyItemDetailList;
|
||||||
|
// 判断供应项是药品还是耗材
|
||||||
|
if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(itemTable)) {
|
||||||
|
supplyItemDetailList = inventoryManageMapper.selectSupplyMedDetail(busNo, EventStatus.COMPLETED.getValue());
|
||||||
|
} else if (CommonConstants.TableName.ADM_DEVICE.equals(itemTable)) {
|
||||||
|
supplyItemDetailList = inventoryManageMapper.selectSupplyDevDetail(busNo, EventStatus.COMPLETED.getValue());
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return supplyItemDetailList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取物品的价格信息
|
||||||
|
*
|
||||||
|
* @param itemIdList 物品id
|
||||||
|
* @return 价格信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ItemChargeDetailDto> getItemChargeDetail(List<Long> itemIdList) {
|
||||||
|
// todo:未来会移到charge相关的service中
|
||||||
|
if (!itemIdList.isEmpty()) {
|
||||||
|
return inventoryManageMapper.selectChargeDetail(itemIdList);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库项价格验证
|
||||||
|
*
|
||||||
|
* @param agreedList 供应单据
|
||||||
|
* @param chargeDetailList 项目价格
|
||||||
|
* @return 价格定义子表数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ChargeItemDefApp> verifyItemCharge(List<SupplyRequest> agreedList,
|
||||||
|
List<ItemChargeDetailDto> chargeDetailList) {
|
||||||
|
|
||||||
|
// todo:价格换算的事情后续补上
|
||||||
|
List<ChargeItemDefApp> resultList = new ArrayList<>();
|
||||||
|
// 创建以项目id为key的map用于匹配对应的供应项目
|
||||||
|
Map<Long, ItemChargeDetailDto> chargeDetailMap =
|
||||||
|
chargeDetailList.stream().collect(Collectors.toMap(ItemChargeDetailDto::getInstanceId, dto -> dto));
|
||||||
|
|
||||||
|
for (SupplyRequest supplyRequest : agreedList) {
|
||||||
|
Long itemId = supplyRequest.getItemId();
|
||||||
|
ItemChargeDetailDto chargeDetail = chargeDetailMap.get(itemId);
|
||||||
|
|
||||||
|
if (chargeDetail == null) {
|
||||||
|
// 未找到匹配的价格项则跳过
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 比较批号是否一致
|
||||||
|
if (!chargeDetail.getConditionLotnumber().equals(supplyRequest.getLotNumber())) {
|
||||||
|
// todo:此时之加入了一条单位价格,需不需要进行大单位小单位的换算,增加两条价格
|
||||||
|
resultList.add(this.addChargeItemDefApp(supplyRequest, chargeDetail));
|
||||||
|
} else {
|
||||||
|
// 检查单位是否匹配
|
||||||
|
if (chargeDetail.getConditionUnitCode().equals(supplyRequest.getUnitCode())) {
|
||||||
|
// 比较价格是否一致
|
||||||
|
if (chargeDetail.getUnitPrice().compareTo(supplyRequest.getPrice()) != 0) {
|
||||||
|
// todo:此时需不需要增加两条价格,进行单位换算
|
||||||
|
resultList.add(this.addChargeItemDefApp(supplyRequest, chargeDetail));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// todo:如果以上换算加入了两条则不存在这种情况,否则需要添加一条批次号相同,单位不同的两条记录(理论上不存在)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加项目定价子表信息
|
||||||
|
*
|
||||||
|
* @param supplyRequest 供应申请单
|
||||||
|
* @param itemChargeDetail 项目价格信息
|
||||||
|
* @return 项目定价子表
|
||||||
|
*/
|
||||||
|
private ChargeItemDefApp addChargeItemDefApp(SupplyRequest supplyRequest, ItemChargeDetailDto itemChargeDetail) {
|
||||||
|
ChargeItemDefApp app = new ChargeItemDefApp();
|
||||||
|
app.setAmount(supplyRequest.getPrice()).setConditionLotnumber(supplyRequest.getLotNumber())
|
||||||
|
.setDefinitionId(itemChargeDetail.getDefinitionId()).setConditionUnitCode(supplyRequest.getUnitCode());
|
||||||
|
return app;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.inventorymanage.assembler;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
|
import com.openhis.administration.domain.ChargeItem;
|
||||||
|
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
||||||
|
import com.openhis.workflow.domain.InventoryItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库管理dto转换器
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-05
|
||||||
|
*/
|
||||||
|
public class InventoryManageAssembler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将供应项目的详细信息装配为库存项目和采购账单
|
||||||
|
*
|
||||||
|
* @param supplyItemDetailList 供应项目的详细信息
|
||||||
|
* @param now 当前时间
|
||||||
|
* @return 库存项目和采购账单
|
||||||
|
*/
|
||||||
|
public static Pair<List<ChargeItem>, List<InventoryItem>>
|
||||||
|
assembleChargeAndInventory(List<SupplyItemDetailDto> supplyItemDetailList, Date now) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
|
||||||
*/
|
|
||||||
package com.openhis.web.inventorymanage.assembler;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 采购入库相关dto转换器
|
|
||||||
*
|
|
||||||
* @author zwh
|
|
||||||
* @date 2025-02-20
|
|
||||||
*/
|
|
||||||
public class PurchaseInventoryAssembler {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装配【入库单据分页列表DTO】分页
|
|
||||||
*
|
|
||||||
* @param supplyRequestPage 【供应申请管理Entity实体】分页
|
|
||||||
* @param medicationList 【药品基本信息管理Entity实体】列表
|
|
||||||
* @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;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
@@ -3,9 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.openhis.web.inventorymanage.controller;
|
package com.openhis.web.inventorymanage.controller;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
@@ -13,25 +11,22 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
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.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.core.common.core.domain.R;
|
import com.core.common.core.domain.R;
|
||||||
|
import com.core.common.utils.DateUtils;
|
||||||
import com.core.common.utils.MessageUtils;
|
import com.core.common.utils.MessageUtils;
|
||||||
import com.core.common.utils.bean.BeanUtils;
|
import com.core.common.utils.bean.BeanUtils;
|
||||||
import com.openhis.administration.domain.ChargeItem;
|
|
||||||
import com.openhis.administration.domain.Location;
|
|
||||||
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.CommonConstants;
|
||||||
import com.openhis.common.constant.PromptMsgConstant;
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.openhis.common.enums.SupplyCategory;
|
||||||
|
import com.openhis.common.enums.SupplyType;
|
||||||
import com.openhis.common.utils.HisPageUtils;
|
import com.openhis.common.utils.HisPageUtils;
|
||||||
import com.openhis.common.utils.HisQueryUtils;
|
import com.openhis.common.utils.HisQueryUtils;
|
||||||
import com.openhis.medication.service.IMedicationService;
|
import com.openhis.web.inventorymanage.appservice.IInventoryManageService;
|
||||||
import com.openhis.web.inventorymanage.dto.*;
|
import com.openhis.web.inventorymanage.dto.InventoryReceiptDto;
|
||||||
|
import com.openhis.web.inventorymanage.dto.InventoryReceiptPageDto;
|
||||||
|
import com.openhis.web.inventorymanage.dto.InventorySearchParam;
|
||||||
import com.openhis.workflow.domain.SupplyRequest;
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
||||||
import com.openhis.workflow.service.ISupplyRequestService;
|
import com.openhis.workflow.service.ISupplyRequestService;
|
||||||
@@ -45,37 +40,30 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
* @date 2025-02-18
|
* @date 2025-02-18
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/inventory-manage-purchase")
|
@RequestMapping("/inventory-manage/purchase")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class PurchaseInventoryController {
|
public class PurchaseInventoryController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISupplyRequestService supplyRequestService;
|
private ISupplyRequestService supplyRequestService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMedicationService medicationService;
|
private IInventoryManageService inventoryManageService;
|
||||||
@Autowired
|
|
||||||
private IPatientService patientService;
|
|
||||||
@Autowired
|
|
||||||
private IChargeItemService chargeItemService;
|
|
||||||
@Autowired
|
|
||||||
private ISupplierService supplierService;
|
|
||||||
@Autowired
|
|
||||||
private ILocationService locationService;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SupplyRequestMapper supplyRequestMapper;
|
private SupplyRequestMapper supplyRequestMapper;
|
||||||
|
|
||||||
@GetMapping(value = "/init")
|
// @GetMapping(value = "/init")
|
||||||
public R<?> init() {
|
// public R<?> init() {
|
||||||
|
// // 采番
|
||||||
InventoryReceiptInitDto initDto = new InventoryReceiptInitDto();
|
//
|
||||||
// 设置供应商列表
|
// InventoryReceiptInitDto initDto = new InventoryReceiptInitDto();
|
||||||
initDto.setSupplier(supplierService.list())
|
// // 设置供应商列表
|
||||||
// 设置药房列表
|
// initDto.setSupplier(supplierService.list())
|
||||||
.setLocation(locationService.list(new LambdaQueryWrapper<Location>().in(Location::getFormEnum, 1)))
|
// // 设置药房列表
|
||||||
// 药品详细
|
// .setLocation(locationService.list(new LambdaQueryWrapper<Location>().in(Location::getFormEnum, 1)))
|
||||||
.setMedicationDetail(medicationService.getDetailList());
|
// // 药品详细
|
||||||
return R.ok(initDto);
|
// .setMedicationDetail(medicationService.getDetailList());
|
||||||
}
|
// return R.ok(initDto);
|
||||||
|
// }
|
||||||
|
|
||||||
// 添加入库单据之前需要
|
// 添加入库单据之前需要
|
||||||
// 1.supplier供应商信息列表
|
// 1.supplier供应商信息列表
|
||||||
@@ -99,6 +87,7 @@ public class PurchaseInventoryController {
|
|||||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
@RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) {
|
||||||
|
|
||||||
|
// 按照单据号groupBy
|
||||||
// 设置模糊查询的字段名
|
// 设置模糊查询的字段名
|
||||||
HashSet<String> searchFields = new HashSet<>();
|
HashSet<String> searchFields = new HashSet<>();
|
||||||
searchFields.add(CommonConstants.FieldName.BusNo);
|
searchFields.add(CommonConstants.FieldName.BusNo);
|
||||||
@@ -107,95 +96,99 @@ public class PurchaseInventoryController {
|
|||||||
QueryWrapper<SupplyRequest> queryWrapper =
|
QueryWrapper<SupplyRequest> queryWrapper =
|
||||||
HisQueryUtils.buildQueryWrapper(inventorySearchParam, searchKey, searchFields, request);
|
HisQueryUtils.buildQueryWrapper(inventorySearchParam, searchKey, searchFields, request);
|
||||||
// 查询入库单据分页列表
|
// 查询入库单据分页列表
|
||||||
Page<InventoryReceiptDto> inventoryReceiptPage =
|
Page<InventoryReceiptPageDto> inventoryReceiptPage =
|
||||||
HisPageUtils.selectPage(supplyRequestMapper, queryWrapper, pageNo, pageSize, InventoryReceiptDto.class);
|
HisPageUtils.selectPage(supplyRequestMapper, queryWrapper, pageNo, pageSize, InventoryReceiptPageDto.class);
|
||||||
|
|
||||||
return R.ok(inventoryReceiptPage);
|
return R.ok(inventoryReceiptPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加入库单据(生成供应请求)
|
* 入库单据详情
|
||||||
*
|
*
|
||||||
* @param inventoryDto 入库单据
|
* @param busNo 单据号
|
||||||
|
* @return 入库单据详情
|
||||||
*/
|
*/
|
||||||
@PostMapping("/inventory-receipt")
|
public R<?> getDetail(@RequestParam String busNo) {
|
||||||
public R<?> addInventoryReceipt(@Validated @RequestBody InventoryDto inventoryDto) {
|
|
||||||
// 生成待发送的入库单据
|
|
||||||
SupplyRequest supplyRequest = new SupplyRequest();
|
|
||||||
BeanUtils.copyProperties(inventoryDto, supplyRequest);
|
|
||||||
// 如果业务上不需要其它处理 直接调用service的保存方法
|
|
||||||
boolean saveSupplyRequestSuccess = supplyRequestService.save(supplyRequest);
|
|
||||||
|
|
||||||
if (!saveSupplyRequestSuccess) {
|
//
|
||||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
return R.ok();
|
||||||
}
|
|
||||||
// 生成收费项目charge_item
|
|
||||||
ChargeItem chargeItem = new ChargeItem();
|
|
||||||
// 如果字段很少建议手动set赋值
|
|
||||||
chargeItem.setUnitPrice(inventoryDto.getUnitPrice());
|
|
||||||
boolean saveChargeItemSuccess = chargeItemService.saveChargeItem(chargeItem);
|
|
||||||
// 如果采购单价被修改了,需要根据批次号更新采购单价子表价格、
|
|
||||||
|
|
||||||
// if (saveChargeItemSuccess) {
|
|
||||||
// return R.ok();
|
|
||||||
// } else {
|
|
||||||
// return R.fail();
|
|
||||||
// }
|
|
||||||
return saveChargeItemSuccess
|
|
||||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"采购入库单据"}))
|
|
||||||
: R.fail(PromptMsgConstant.Common.M00007, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑入库单据
|
* 添加/编辑入库单据
|
||||||
*
|
*
|
||||||
* @param saveInventoryReceiptDto 供应请求信息
|
* @param inventoryReceiptDto 入库单据
|
||||||
|
* @return 操作结果
|
||||||
*/
|
*/
|
||||||
@PutMapping("/inventory-receipt")
|
@PostMapping("/inventory-receipt")
|
||||||
public R<?> editInventoryReceipt(@Validated @RequestBody SaveInventoryReceiptDto saveInventoryReceiptDto) {
|
public R<?> addOrEditInventoryReceipt(@Validated @RequestBody InventoryReceiptDto inventoryReceiptDto) {
|
||||||
// 更新supply_request信息
|
|
||||||
SupplyRequest saveRequest = new SupplyRequest();
|
// 初始化单据信息
|
||||||
BeanUtils.copyProperties(saveInventoryReceiptDto, saveRequest);
|
SupplyRequest supplyRequest = new SupplyRequest();
|
||||||
if (!supplyRequestService.updateById(saveRequest)) {
|
BeanUtils.copyProperties(inventoryReceiptDto, supplyRequest);
|
||||||
return R.fail();
|
|
||||||
|
// // 业务校验
|
||||||
|
// R<?> result = purchaseInventoryService.verifyInventoryReceipt(supplyRequest);
|
||||||
|
// // 校验失败返回提示信息
|
||||||
|
// if (result.getCode() == HttpStatus.ERROR) {
|
||||||
|
// return result;
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (inventoryReceiptDto.getId() != null) {
|
||||||
|
// 更新单据信息
|
||||||
|
supplyRequestService.updateById(supplyRequest);
|
||||||
|
} else {
|
||||||
|
// 生成待发送的入库单据
|
||||||
|
supplyRequest
|
||||||
|
// 单据分类:非库存供应
|
||||||
|
.setCategoryEnum(SupplyCategory.NON_STOCK.getValue())
|
||||||
|
// 单据类型:采购入库
|
||||||
|
.setTypeEnum(SupplyType.PURCHASE_INVENTORY.getValue())
|
||||||
|
// 申请时间
|
||||||
|
.setApplyTime(DateUtils.getNowDate());
|
||||||
|
supplyRequestService.save(supplyRequest);
|
||||||
}
|
}
|
||||||
// 更新收费项目charge_item
|
// 返回单据id
|
||||||
ChargeItem chargeItem = new ChargeItem();
|
return R.ok(supplyRequest.getId(), null);
|
||||||
BeanUtils.copyProperties(saveInventoryReceiptDto, chargeItem);
|
|
||||||
chargeItem.setId(saveInventoryReceiptDto.getChargeItemId());
|
|
||||||
return chargeItemService.updateChargeItem(chargeItem) ? R.ok() : R.fail();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除方法
|
* 删除方法
|
||||||
*
|
*
|
||||||
* @param supplyRequestId 主表id
|
* @param supplyRequestId 主表id
|
||||||
|
* @return 操作结果
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("/inventory-receipt")
|
@DeleteMapping("/inventory-receipt")
|
||||||
public R<?> deleteInventoryReceipt(@RequestParam Long supplyRequestId) {
|
public R<?> deleteInventoryReceipt(@RequestParam Long supplyRequestId) {
|
||||||
// 全都是逻辑删除
|
// 删除单据
|
||||||
|
boolean result = supplyRequestService.removeById(supplyRequestId);
|
||||||
boolean deleteSuccess = supplyRequestService.removeById(supplyRequestId);
|
return result ? R.ok() : R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
|
||||||
if (!deleteSuccess) {
|
|
||||||
return R.fail();
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean deleteChargeItemSuccess = chargeItemService
|
|
||||||
.remove(new LambdaUpdateWrapper<ChargeItem>().eq(ChargeItem::getServiceId, supplyRequestId));
|
|
||||||
|
|
||||||
return deleteChargeItemSuccess ? R.ok() : R.fail();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单据提交申请
|
* 提交审批
|
||||||
*
|
*
|
||||||
* @param supplyRequest 供应请求信息
|
* @param busNo 单据号
|
||||||
*/
|
*/
|
||||||
@PutMapping("/submit-examine")
|
@PutMapping("/submit-approval")
|
||||||
public void submitExamine(SupplyRequest supplyRequest) {
|
public R<?> submitApproval(@RequestParam String busNo) {
|
||||||
|
// 单据提交审核
|
||||||
|
boolean result = supplyRequestService.submitApproval(busNo);
|
||||||
|
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null))
|
||||||
|
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
|
||||||
// 更改供应请求单据状态
|
/**
|
||||||
// 生成供应分发supply_delivery
|
* 撤回审批
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PutMapping("/withdraw-approval")
|
||||||
|
public R<?> withdrawApproval(@RequestParam String busNo) {
|
||||||
|
// 撤回审核
|
||||||
|
boolean result = supplyRequestService.withdrawApproval(busNo);
|
||||||
|
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null))
|
||||||
|
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,143 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.inventorymanage.controller;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
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.core.common.core.domain.model.LoginUser;
|
||||||
|
import com.core.common.utils.DateUtils;
|
||||||
|
import com.core.common.utils.MessageUtils;
|
||||||
|
import com.core.framework.web.service.TokenService;
|
||||||
|
import com.openhis.administration.domain.ChargeItem;
|
||||||
|
import com.openhis.administration.domain.ChargeItemDefApp;
|
||||||
|
import com.openhis.administration.service.IChargeItemDefAppService;
|
||||||
|
import com.openhis.administration.service.IChargeItemService;
|
||||||
|
import com.openhis.common.constant.PromptMsgConstant;
|
||||||
|
import com.openhis.web.inventorymanage.appservice.IInventoryManageService;
|
||||||
|
import com.openhis.web.inventorymanage.assembler.InventoryManageAssembler;
|
||||||
|
import com.openhis.web.inventorymanage.dto.ItemChargeDetailDto;
|
||||||
|
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
||||||
|
import com.openhis.workflow.domain.InventoryItem;
|
||||||
|
import com.openhis.workflow.domain.SupplyDelivery;
|
||||||
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
|
import com.openhis.workflow.service.IInventoryItemService;
|
||||||
|
import com.openhis.workflow.service.ISupplyDeliveryService;
|
||||||
|
import com.openhis.workflow.service.ISupplyRequestService;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据审批 controller
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-04
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inventory-manage/receipt")
|
||||||
|
@Slf4j
|
||||||
|
public class ReceiptApprovalController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISupplyRequestService supplyRequestService;
|
||||||
|
@Autowired
|
||||||
|
private ISupplyDeliveryService supplyDeliveryService;
|
||||||
|
@Autowired
|
||||||
|
private IChargeItemDefAppService chargeItemDefAppService;
|
||||||
|
@Autowired
|
||||||
|
private IInventoryItemService inventoryItemService;
|
||||||
|
@Autowired
|
||||||
|
private IChargeItemService chargeItemService;
|
||||||
|
@Autowired
|
||||||
|
private IInventoryManageService inventoryManageService;
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批通过
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/approved")
|
||||||
|
public R<?> approved(@RequestParam String busNo, HttpServletRequest request) {
|
||||||
|
// 获取登录者的信息
|
||||||
|
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||||
|
// 获取当前时间
|
||||||
|
Date now = DateUtils.getNowDate();
|
||||||
|
|
||||||
|
// 审批单据并返回单据详情
|
||||||
|
List<SupplyRequest> agreedList = supplyRequestService.agreeRequest(busNo, loginUser, now);
|
||||||
|
if (agreedList.isEmpty()) {
|
||||||
|
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
// 根据单据,发放物品
|
||||||
|
List<SupplyDelivery> deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now);
|
||||||
|
if (deliveredList.isEmpty()) {
|
||||||
|
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取供应项目所在表
|
||||||
|
String itemTable = supplyRequestService.getItemTable(agreedList);
|
||||||
|
// 获取供应的物品
|
||||||
|
List<Long> itemIdList = supplyRequestService.getItem(agreedList);
|
||||||
|
// 获取项目价格相关信息
|
||||||
|
List<ItemChargeDetailDto> chargeDetailList = inventoryManageService.getItemChargeDetail(itemIdList);
|
||||||
|
List<ChargeItemDefApp> chargeItemDefAppList = new ArrayList<>();
|
||||||
|
if (!chargeDetailList.isEmpty()) {
|
||||||
|
// 入库项价格验证(验证项:单位价格,批次号)
|
||||||
|
chargeItemDefAppList = inventoryManageService.verifyItemCharge(agreedList, chargeDetailList);
|
||||||
|
}
|
||||||
|
if (!chargeItemDefAppList.isEmpty()) {
|
||||||
|
for (ChargeItemDefApp chargeItemDefApp : chargeItemDefAppList) {
|
||||||
|
// 增加项目定价子表数据
|
||||||
|
chargeItemDefAppService.addChargeItemDefApp(chargeItemDefApp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询供应项目的详细信息
|
||||||
|
List<SupplyItemDetailDto> supplyItemDetailList = inventoryManageService.getSupplyItemDetail(busNo, itemTable);
|
||||||
|
if (!supplyItemDetailList.isEmpty()) {
|
||||||
|
// 将供应项目的详细信息装配为库存项目和采购账单
|
||||||
|
Pair<List<ChargeItem>, List<InventoryItem>> listPair =
|
||||||
|
InventoryManageAssembler.assembleChargeAndInventory(supplyItemDetailList, now);
|
||||||
|
if (listPair != null) {
|
||||||
|
// 创建已结算的采购财务流水
|
||||||
|
chargeItemService.createBilledPurchaseCharge(listPair.getLeft());
|
||||||
|
// 入库
|
||||||
|
inventoryItemService.stockIn(listPair.getRight());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批驳回
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/reject")
|
||||||
|
public R<?> reject(@RequestParam String busNo, HttpServletRequest request) {
|
||||||
|
// 获取当前时间
|
||||||
|
Date now = DateUtils.getNowDate();
|
||||||
|
// 获取登录者的信息
|
||||||
|
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||||
|
// 驳回单据
|
||||||
|
boolean result = supplyRequestService.rejectRequest(busNo, loginUser, now);
|
||||||
|
return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null))
|
||||||
|
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
|
||||||
*/
|
|
||||||
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
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class InventoryDto {
|
|
||||||
|
|
||||||
/** 项目 */
|
|
||||||
private String itemTable;
|
|
||||||
|
|
||||||
/** 数量 */
|
|
||||||
private Integer itemQuantity;
|
|
||||||
|
|
||||||
/** 物品编码 */
|
|
||||||
@JsonSerialize(using = ToStringSerializer.class)
|
|
||||||
private Long code;
|
|
||||||
|
|
||||||
/** 物品计量单位 */
|
|
||||||
private String unitIdCode;
|
|
||||||
|
|
||||||
/** 物品数量 */
|
|
||||||
private Integer unitQuantity;
|
|
||||||
|
|
||||||
/** 请求细节 */
|
|
||||||
private String detailJson;
|
|
||||||
|
|
||||||
/** 期望时间 */
|
|
||||||
private Date occurrenceTime;
|
|
||||||
|
|
||||||
/** 供应人 */
|
|
||||||
private Long practitionerId;
|
|
||||||
|
|
||||||
/** 供应商 */
|
|
||||||
private Long supplierId;
|
|
||||||
|
|
||||||
/** 单位 */
|
|
||||||
private Long quantityUnit;
|
|
||||||
|
|
||||||
/** 单价 */
|
|
||||||
private BigDecimal unitPrice;
|
|
||||||
|
|
||||||
/** 总价 */
|
|
||||||
private BigDecimal totalPrice;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
package com.openhis.web.inventorymanage.dto;
|
package com.openhis.web.inventorymanage.dto;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
@@ -14,11 +15,14 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入库单据分页列表 dto
|
* 入库单据
|
||||||
*
|
*
|
||||||
* @author zwh
|
* @author ZhangYC
|
||||||
* @date 2025-02-18
|
* @date 2025-02-20
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@@ -31,37 +35,85 @@ public class InventoryReceiptDto implements Serializable {
|
|||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 单据号 */
|
/** 项目 */
|
||||||
private String busNo;
|
private String itemTable;
|
||||||
|
|
||||||
/** 类型 */
|
/** 数量 */
|
||||||
private Integer typeEnum;
|
@NotNull
|
||||||
|
@Min(1)
|
||||||
|
private Integer itemQuantity;
|
||||||
|
|
||||||
/** 状态 */
|
/** 物品编码 */
|
||||||
private Integer statusEnum;
|
@NotNull
|
||||||
|
private Long itemId;
|
||||||
|
|
||||||
/** 分类 */
|
/** 物品计量单位 */
|
||||||
private Integer categoryEnum;
|
@NotNull
|
||||||
|
private String unitCode;
|
||||||
|
|
||||||
|
/** 请求细节 */
|
||||||
|
private String detailJson;
|
||||||
|
|
||||||
/** 供应商 */
|
/** 供应商 */
|
||||||
|
@NotNull
|
||||||
private Long supplierId;
|
private Long supplierId;
|
||||||
|
|
||||||
|
/** 源仓库类型 */
|
||||||
|
@NotNull
|
||||||
|
private Integer sourceTypeEnum;
|
||||||
|
|
||||||
/** 源仓库 */
|
/** 源仓库 */
|
||||||
|
@NotNull
|
||||||
private Long sourceLocationId;
|
private Long sourceLocationId;
|
||||||
|
|
||||||
|
/** 源仓位 */
|
||||||
|
@NotNull
|
||||||
|
private Long sourceLocationStoreId;
|
||||||
|
|
||||||
|
/** 目的仓库类型 */
|
||||||
|
@NotNull
|
||||||
|
private Integer purposeTypeEnum;
|
||||||
|
|
||||||
/** 目的仓库 */
|
/** 目的仓库 */
|
||||||
|
@NotNull
|
||||||
private Long purposeLocationId;
|
private Long purposeLocationId;
|
||||||
|
|
||||||
/** 审批人 */
|
/** 目的仓位 */
|
||||||
private Long approverId;
|
@NotNull
|
||||||
|
private Long purposeLocationStoreId;
|
||||||
/** 审批时间 */
|
|
||||||
private Date approvalTime;
|
|
||||||
|
|
||||||
/** 申请人 */
|
/** 申请人 */
|
||||||
|
@NotNull
|
||||||
private Long applicantId;
|
private Long applicantId;
|
||||||
|
|
||||||
/** 申请时间 */
|
/** 申请时间 */
|
||||||
private Date applyTime;
|
private Date applyTime;
|
||||||
|
|
||||||
|
/** 产品批号 */
|
||||||
|
@NotNull
|
||||||
|
private String lotNumber;
|
||||||
|
|
||||||
|
/** 追溯码 */
|
||||||
|
@NotNull
|
||||||
|
private String traceNo;
|
||||||
|
|
||||||
|
/** 发票号 */
|
||||||
|
private String invoiceNo;
|
||||||
|
|
||||||
|
/** 开始时间 */
|
||||||
|
@NotNull
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
@NotNull
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/** 单价 */
|
||||||
|
@NotNull
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
/** 总价 */
|
||||||
|
@NotNull
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.inventorymanage.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单据分页列表 dto
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-02-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class InventoryReceiptPageDto 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 categoryEnum;
|
||||||
|
|
||||||
|
/** 供应商 */
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
/** 源仓库 */
|
||||||
|
private Long sourceLocationId;
|
||||||
|
|
||||||
|
/** 目的仓库 */
|
||||||
|
private Long purposeLocationId;
|
||||||
|
|
||||||
|
/** 审批人 */
|
||||||
|
private Long approverId;
|
||||||
|
|
||||||
|
/** 审批时间 */
|
||||||
|
private Date approvalTime;
|
||||||
|
|
||||||
|
/** 申请人 */
|
||||||
|
private Long applicantId;
|
||||||
|
|
||||||
|
/** 申请时间 */
|
||||||
|
private Date applyTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ package com.openhis.web.inventorymanage.dto;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.openhis.common.annotation.Dict;
|
||||||
import org.hibernate.validator.constraints.Length;
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.inventorymanage.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目价格详情
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class ItemChargeDetailDto implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 费用定价主键ID */
|
||||||
|
private Long definitionId;
|
||||||
|
|
||||||
|
/** 名称 */
|
||||||
|
private String chargeName;
|
||||||
|
|
||||||
|
/** 批次号 */
|
||||||
|
private String conditionLotnumber;
|
||||||
|
|
||||||
|
/** 条件类型 */
|
||||||
|
private String conditionUnitCode;
|
||||||
|
|
||||||
|
/** 单位价格 */
|
||||||
|
private BigDecimal unitPrice;
|
||||||
|
|
||||||
|
/** 关联项目 */
|
||||||
|
private Long instanceId;
|
||||||
|
|
||||||
|
/** 基础价格 */
|
||||||
|
private BigDecimal sellPrice;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.inventorymanage.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据详情
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class ReceiptDetailDto implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
@@ -1,190 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
|
||||||
*/
|
|
||||||
package com.openhis.web.inventorymanage.dto;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新dto
|
|
||||||
*
|
|
||||||
* @author zxy
|
|
||||||
* @date 2025-02-20
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class SaveInventoryReceiptDto {
|
|
||||||
/** ID */
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/** 类型 */
|
|
||||||
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 String itemTable;
|
|
||||||
|
|
||||||
/** 数量 */
|
|
||||||
private Integer itemQuantity;
|
|
||||||
|
|
||||||
/** 物品编码 */
|
|
||||||
private Long code;
|
|
||||||
|
|
||||||
/** 物品计量单位 */
|
|
||||||
private String unitIdCode;
|
|
||||||
|
|
||||||
/** 物品数量 */
|
|
||||||
private Integer unitQuantity;
|
|
||||||
|
|
||||||
/** 请求细节 */
|
|
||||||
private String detailJson;
|
|
||||||
|
|
||||||
/** 期望时间 */
|
|
||||||
private Date occurrenceTime;
|
|
||||||
|
|
||||||
/** 供应人 */
|
|
||||||
private Long practitionerId;
|
|
||||||
|
|
||||||
/** 供应商 */
|
|
||||||
private Long supplierId;
|
|
||||||
|
|
||||||
/** 理由 */
|
|
||||||
private String reason;
|
|
||||||
|
|
||||||
/** 源仓库类型 */
|
|
||||||
private Integer sourceType;
|
|
||||||
|
|
||||||
/** 源仓库 */
|
|
||||||
private Long sourceLocationId;
|
|
||||||
|
|
||||||
/** 源仓位 */
|
|
||||||
private Long sourceLocationStoreId;
|
|
||||||
|
|
||||||
/** 目的类型 */
|
|
||||||
private Integer purposeType;
|
|
||||||
|
|
||||||
/** 目的仓库 */
|
|
||||||
private Long purposeLocationId;
|
|
||||||
|
|
||||||
/** 目的仓位 */
|
|
||||||
private Long purposeLocationStoreId;
|
|
||||||
|
|
||||||
/** 审批人 */
|
|
||||||
private Long approverId;
|
|
||||||
|
|
||||||
/** 审批时间 */
|
|
||||||
private Date approvalTime;
|
|
||||||
|
|
||||||
/** 申请人 */
|
|
||||||
private Long applicantId;
|
|
||||||
|
|
||||||
/** 申请时间 */
|
|
||||||
private Date applyTime;
|
|
||||||
|
|
||||||
// =======chargeItem实体============
|
|
||||||
|
|
||||||
/** ID */
|
|
||||||
private Long chargeItemId;
|
|
||||||
|
|
||||||
/** 类别 */
|
|
||||||
private Integer context;
|
|
||||||
|
|
||||||
/** 就诊ID */
|
|
||||||
private Long encounterId;
|
|
||||||
|
|
||||||
/** 执行人Id */
|
|
||||||
private Long performer;
|
|
||||||
|
|
||||||
/** 执行科室 */
|
|
||||||
private Long performingOrgId;
|
|
||||||
|
|
||||||
/** 开立科室 */
|
|
||||||
private Long requestingOrgId;
|
|
||||||
|
|
||||||
/** 成本科室 */
|
|
||||||
private Long costOrgId;
|
|
||||||
|
|
||||||
/** 数量 */
|
|
||||||
private Long quantityValue;
|
|
||||||
|
|
||||||
/** 单位 */
|
|
||||||
private Long quantityUnit;
|
|
||||||
|
|
||||||
/** 单价 */
|
|
||||||
private BigDecimal unitPrice;
|
|
||||||
|
|
||||||
/** 总价 */
|
|
||||||
private BigDecimal totalPrice;
|
|
||||||
|
|
||||||
/** 费用定价ID */
|
|
||||||
private Long definitionId;
|
|
||||||
|
|
||||||
/** applicability表主键 */
|
|
||||||
private Long applicabilityId;
|
|
||||||
|
|
||||||
/** 原价 */
|
|
||||||
private BigDecimal baseAmount;
|
|
||||||
|
|
||||||
/** 折后价格 */
|
|
||||||
private BigDecimal discountAmount;
|
|
||||||
|
|
||||||
/** 附加价格 */
|
|
||||||
private BigDecimal surchargeAmount;
|
|
||||||
|
|
||||||
/** 改价原因 */
|
|
||||||
private String overrideReasonCode;
|
|
||||||
|
|
||||||
/** 改价原因文本 */
|
|
||||||
private String overrideReasonText;
|
|
||||||
|
|
||||||
/** 开立人ID */
|
|
||||||
private Long entererId;
|
|
||||||
|
|
||||||
/** 开立时间 */
|
|
||||||
private Date enteredDate;
|
|
||||||
|
|
||||||
/** 医疗服务类型 */
|
|
||||||
private String serviceTable;
|
|
||||||
|
|
||||||
/** 医疗服务ID */
|
|
||||||
private Long serviceId;
|
|
||||||
|
|
||||||
/** 索赔结果 */
|
|
||||||
private Integer claimStateEnum;
|
|
||||||
|
|
||||||
/** 关联账户ID */
|
|
||||||
private Long accountId;
|
|
||||||
|
|
||||||
/** 机构 */
|
|
||||||
private String orgCode;
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.web.inventorymanage.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应单据及供应项相关详细信息 dto
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SupplyItemDetailDto implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 项目 */
|
||||||
|
private String itemTable;
|
||||||
|
|
||||||
|
/** 物品编码 */
|
||||||
|
private Long itemId;
|
||||||
|
|
||||||
|
/** 数量 */
|
||||||
|
private BigDecimal itemQuantity;
|
||||||
|
|
||||||
|
/** 项目单位 */
|
||||||
|
private String itemUnit;
|
||||||
|
|
||||||
|
/** 单价 */
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
/** 总价 */
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
/** 审批人 */
|
||||||
|
private Long approverId;
|
||||||
|
|
||||||
|
/** 目的仓库 */
|
||||||
|
private Long purposeLocationId;
|
||||||
|
|
||||||
|
/** 目的仓位 */
|
||||||
|
private Long purposeLocationStoreId;
|
||||||
|
|
||||||
|
/** 供应商id */
|
||||||
|
private Long supplierId;
|
||||||
|
|
||||||
|
/** 产品批号 */
|
||||||
|
private String lotNumber;
|
||||||
|
|
||||||
|
/** 追溯码 */
|
||||||
|
private String traceNo;
|
||||||
|
|
||||||
|
/** 单据号 */
|
||||||
|
private String busNo;
|
||||||
|
|
||||||
|
/** 开始时间 */
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/** 服务id */
|
||||||
|
private Long serviceId;
|
||||||
|
|
||||||
|
/** 名称 */
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 拼音码 */
|
||||||
|
private String pyStr;
|
||||||
|
|
||||||
|
/** 五笔码 */
|
||||||
|
private String wbStr;
|
||||||
|
|
||||||
|
/** 常规单位 */
|
||||||
|
private String unitCode;
|
||||||
|
|
||||||
|
/** 最小单位 */
|
||||||
|
private String minUnitCode;
|
||||||
|
|
||||||
|
/** 费用定价ID */
|
||||||
|
private Long definitionId;
|
||||||
|
|
||||||
|
/** 原价 */
|
||||||
|
private BigDecimal baseAmount;
|
||||||
|
|
||||||
|
/** 费用定价子表ID */
|
||||||
|
private Long applicabilityId;
|
||||||
|
}
|
||||||
@@ -3,9 +3,14 @@
|
|||||||
*/
|
*/
|
||||||
package com.openhis.web.inventorymanage.mapper;
|
package com.openhis.web.inventorymanage.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.openhis.web.inventorymanage.dto.ItemChargeDetailDto;
|
||||||
|
import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto;
|
||||||
import com.openhis.workflow.domain.SupplyRequest;
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,4 +20,33 @@ import com.openhis.workflow.domain.SupplyRequest;
|
|||||||
* @date 2025-02-25
|
* @date 2025-02-25
|
||||||
*/
|
*/
|
||||||
@Repository
|
@Repository
|
||||||
public interface InventoryManageMapper extends BaseMapper<SupplyRequest> {}
|
public interface InventoryManageMapper extends BaseMapper<SupplyRequest> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取药品供应单据详细信息
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @param completed 发放状态:已完成
|
||||||
|
* @return 药品供应单据详细信息
|
||||||
|
*/
|
||||||
|
List<SupplyItemDetailDto> selectSupplyMedDetail(@Param("busNo") String busNo,
|
||||||
|
@Param("completed") Integer completed);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取耗材供应单据详细信息
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @param completed 发放状态:已完成
|
||||||
|
* @return 耗材供应单据详细信息
|
||||||
|
*/
|
||||||
|
List<SupplyItemDetailDto> selectSupplyDevDetail(@Param("busNo") String busNo,
|
||||||
|
@Param("completed") Integer completed);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据物品id获取物品的价格信息
|
||||||
|
*
|
||||||
|
* @param itemIdList 物品id
|
||||||
|
* @return 价格信息
|
||||||
|
*/
|
||||||
|
List<ItemChargeDetailDto> selectChargeDetail(@Param("itemIdList") List<Long> itemIdList);
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,4 +2,99 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.openhis.web.inventorymanage.mapper.InventoryManageMapper">
|
<mapper namespace="com.openhis.web.inventorymanage.mapper.InventoryManageMapper">
|
||||||
|
|
||||||
|
<select id="selectSupplyMedDetail" resultType="com.openhis.web.inventorymanage.dto.SupplyItemDetailDto">
|
||||||
|
SELECT T1.item_table,
|
||||||
|
T1.item_id,
|
||||||
|
T1.item_quantity,
|
||||||
|
T1.unit_code AS item_unit,
|
||||||
|
T1.price,
|
||||||
|
T1.total_price,
|
||||||
|
T1.approver_id,
|
||||||
|
T1.purpose_location_id,
|
||||||
|
T1.purpose_location_store_id,
|
||||||
|
T1.supplier_id,
|
||||||
|
T1.lot_number,
|
||||||
|
T1.trace_no,
|
||||||
|
T1.bus_no,
|
||||||
|
T1.start_time,
|
||||||
|
T1.end_time,
|
||||||
|
T1.id AS service_id,
|
||||||
|
T2."name",
|
||||||
|
T2.py_str,
|
||||||
|
T2.wb_str,
|
||||||
|
T2.unit_code,
|
||||||
|
T2.min_unit_code,
|
||||||
|
T3.id AS definition_id,
|
||||||
|
T4.amount AS base_amount,
|
||||||
|
T4.id AS applicability_id
|
||||||
|
FROM wor_supply_request AS T1
|
||||||
|
LEFT JOIN wor_supply_delivery AS T5
|
||||||
|
ON T1.id = T5.request_id
|
||||||
|
LEFT JOIN med_medication_definition AS T2
|
||||||
|
ON T2.id = T1.item_id
|
||||||
|
LEFT JOIN adm_charge_item_definition T3
|
||||||
|
ON T2.id = T3.instance_id
|
||||||
|
LEFT JOIN adm_charge_item_def_app T4
|
||||||
|
ON T3.id = T4.definition_id
|
||||||
|
AND T1.unit_code = T4.condition_unit_code
|
||||||
|
WHERE T1.bus_no = #{busNo}
|
||||||
|
AND T5.status_enum = #{completed}
|
||||||
|
AND T1.delete_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSupplyDevDetail" resultType="com.openhis.web.inventorymanage.dto.SupplyItemDetailDto">
|
||||||
|
SELECT T1.item_table,
|
||||||
|
T1.item_id,
|
||||||
|
T1.item_quantity,
|
||||||
|
T1.unit_code AS item_unit,
|
||||||
|
T1.price,
|
||||||
|
T1.total_price,
|
||||||
|
T1.approver_id,
|
||||||
|
T1.purpose_location_id,
|
||||||
|
T1.purpose_location_store_id,
|
||||||
|
T1.supplier_id,
|
||||||
|
T1.lot_number,
|
||||||
|
T1.trace_no,
|
||||||
|
T1.bus_no,
|
||||||
|
T1.start_time,
|
||||||
|
T1.end_time,
|
||||||
|
T1.id AS service_id,
|
||||||
|
T2."name",
|
||||||
|
T2.py_str,
|
||||||
|
T2.wb_str,
|
||||||
|
T2.unit_code,
|
||||||
|
T2.min_unit_code,
|
||||||
|
T3.id AS definition_id,
|
||||||
|
T4.amount AS base_amount,
|
||||||
|
T4.id AS applicability_id
|
||||||
|
FROM wor_supply_request AS T1
|
||||||
|
LEFT JOIN wor_supply_delivery AS T5
|
||||||
|
ON T1.id = T5.request_id
|
||||||
|
LEFT JOIN med_medication_definition AS T2
|
||||||
|
ON T2.id = T1.item_id
|
||||||
|
LEFT JOIN adm_charge_item_definition T3
|
||||||
|
ON T2.id = T3.instance_id
|
||||||
|
LEFT JOIN adm_charge_item_def_app T4
|
||||||
|
ON T3.id = T4.definition_id
|
||||||
|
AND T1.unit_code = T4.condition_unit_code
|
||||||
|
WHERE T1.bus_no = #{busNo}
|
||||||
|
AND T5.status_enum = #{completed}
|
||||||
|
AND T1.delete_flag = 0
|
||||||
|
</select>
|
||||||
|
<select id="selectChargeDetail" resultType="com.openhis.web.inventorymanage.dto.ItemChargeDetailDto">
|
||||||
|
SELECT T1.id AS definition_id,
|
||||||
|
T1.instance_id,
|
||||||
|
T1.charge_name,
|
||||||
|
T1.price AS sell_price,
|
||||||
|
T2.condition_lotnumber,
|
||||||
|
T2.condition_unit_code,
|
||||||
|
T2.amount AS unit_price
|
||||||
|
FROM adm_charge_item_definition AS T1
|
||||||
|
LEFT JOIN adm_charge_item_def_app AS T2
|
||||||
|
ON T1.id = T2.definition_id
|
||||||
|
WHERE T1.instance_id IN
|
||||||
|
<foreach collection="itemIdList" item="itemId" separator="," open="(" close=")">
|
||||||
|
#{itemId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -42,11 +42,21 @@ public class CommonConstants {
|
|||||||
*/
|
*/
|
||||||
String MED_MEDICATION_DEFINITION = "med_medication_definition";
|
String MED_MEDICATION_DEFINITION = "med_medication_definition";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 药品信息
|
||||||
|
*/
|
||||||
|
String MED_MEDICATION = "med_medication";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 器材定义
|
* 器材定义
|
||||||
*/
|
*/
|
||||||
String ADM_DEVICE_DEFINITION = "adm_device_definition";
|
String ADM_DEVICE_DEFINITION = "adm_device_definition";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 器材信息
|
||||||
|
*/
|
||||||
|
String ADM_DEVICE = "adm_device";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 活动定义
|
* 活动定义
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -59,5 +59,15 @@ public class PromptMsgConstant {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存
|
||||||
|
*/
|
||||||
|
public interface Inventory {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {0}添加成功
|
||||||
|
*/
|
||||||
|
String M00001 = "apl.inventory.M00001";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,24 +1,71 @@
|
|||||||
package com.openhis.common.enums;
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 事件状态
|
||||||
|
*
|
||||||
|
* @author lyx
|
||||||
|
* @date 2025-03-05
|
||||||
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum EventStatus {
|
public enum EventStatus {
|
||||||
|
|
||||||
PREPARATION(1, "PREP", "Preparation stage, gathering resources and planning."),
|
/**
|
||||||
IN_PROGRESS(2, "IP", "Task is currently being worked on."),
|
* 草稿
|
||||||
NOT_DONE(3, "ND", "Task has not been completed."),
|
*/
|
||||||
ON_HOLD(4, "OH", "Task is temporarily paused."),
|
PREPARATION(1, "PREP", "草稿"),
|
||||||
STOPPED(5, "ST", "Task has been stopped."),
|
|
||||||
COMPLETED(6, "CMP", "Task has been completed."),
|
|
||||||
ENTERED_IN_ERROR(7, "EIE", "Task status was entered in error."),
|
|
||||||
UNKNOWN(8, "UNK", "Task status is unknown.");
|
|
||||||
|
|
||||||
@EnumValue
|
/**
|
||||||
private final Integer value;
|
* 进行中
|
||||||
private final String code;
|
*/
|
||||||
private final String info;
|
IN_PROGRESS(2, "IP", "进行中"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未完成
|
||||||
|
*/
|
||||||
|
NOT_DONE(3, "ND", "未完成"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停
|
||||||
|
*/
|
||||||
|
ON_HOLD(4, "OH", "暂停"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止
|
||||||
|
*/
|
||||||
|
STOPPED(5, "ST", "停止"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已完成
|
||||||
|
*/
|
||||||
|
COMPLETED(6, "CMP", "已完成"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 录入错误
|
||||||
|
*/
|
||||||
|
ENTERED_IN_ERROR(7, "EIE", "录入错误"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未知
|
||||||
|
*/
|
||||||
|
UNKNOWN(8, "UNK", "未知");
|
||||||
|
|
||||||
|
private Integer value;
|
||||||
|
private String code;
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
public static EventStatus getByValue(Integer value) {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (EventStatus val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
package com.openhis.common.enums;
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum LocationBedStatus {
|
public enum LocationBedStatus implements HisEnumInterface {
|
||||||
C(1, "C", "关闭"),
|
C(1, "C", "关闭"),
|
||||||
H(2, "H", "整理"),
|
H(2, "H", "整理"),
|
||||||
O(3, "O", "占用"),
|
O(3, "O", "占用"),
|
||||||
U(4, "U", "空闲"),
|
U(4, "U", "空闲"),
|
||||||
K(5, "K", "污染"),
|
K(5, "K", "污染"),
|
||||||
I(6, "I", "隔离");
|
I(6, "I", "隔离");
|
||||||
|
|
||||||
@EnumValue
|
@EnumValue
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
package com.openhis.common.enums;
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum LocationMode {
|
public enum LocationMode implements HisEnumInterface {
|
||||||
INSTANCE(1, "instance", "具体"),
|
INSTANCE(1, "instance", "具体"),
|
||||||
|
|
||||||
KIND(2, "Kind", "种类");
|
KIND(2, "Kind", "种类");
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
package com.openhis.common.enums;
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum LocationStatus {
|
public enum LocationStatus implements HisEnumInterface {
|
||||||
ACTIVE(1, "active", "有效"),
|
ACTIVE(1, "active", "有效"),
|
||||||
|
|
||||||
INACTIVE(2, "inactive", "无效"),
|
INACTIVE(2, "inactive", "无效"),
|
||||||
|
|
||||||
SUSPENDED(3, "suspended", "临时关闭");
|
SUSPENDED(3, "suspended", "临时关闭");
|
||||||
|
|
||||||
@EnumValue
|
@EnumValue
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据类别
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-05
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum SupplyCategory {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存供应
|
||||||
|
*/
|
||||||
|
STOCK_SUPPLY(1, "库存供应"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 非库存供应
|
||||||
|
*/
|
||||||
|
NON_STOCK(2, "非库存供应");
|
||||||
|
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
public static SupplyCategory getByValue(Integer value) {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (SupplyCategory val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据状态
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-05
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum SupplyStatus {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待审核
|
||||||
|
*/
|
||||||
|
PENDING_APPROVAL(1, "待审核"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核中
|
||||||
|
*/
|
||||||
|
APPROVAL(2, "审核中"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同意
|
||||||
|
*/
|
||||||
|
AGREE(3, "同意"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驳回
|
||||||
|
*/
|
||||||
|
REJECT(4, "驳回"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已撤回
|
||||||
|
*/
|
||||||
|
WITHDRAW(9, "已撤回");
|
||||||
|
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
public static SupplyStatus getByValue(Integer value) {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (SupplyStatus val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据类型
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-05
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum SupplyType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购入库
|
||||||
|
*/
|
||||||
|
PURCHASE_INVENTORY(1, "采购入库"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品调拨
|
||||||
|
*/
|
||||||
|
PRODUCT_ALLOCATION(2, "商品调拨"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 汇总发药
|
||||||
|
*/
|
||||||
|
DISPENSING_AGGREGATION(3, "汇总发药");
|
||||||
|
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
public static SupplyType getByValue(Integer value) {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (SupplyType val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* Copyright ©2023 CJB-CNIT Team. All rights reserved
|
||||||
|
*/
|
||||||
|
package com.openhis.common.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否标识
|
||||||
|
*
|
||||||
|
* @author zwh
|
||||||
|
* @date 2025-03-05
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum Whether {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 否
|
||||||
|
*/
|
||||||
|
NO(0, "否"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是
|
||||||
|
*/
|
||||||
|
YES(1, "是");
|
||||||
|
|
||||||
|
private Integer value;
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
public static Whether getByValue(Integer value) {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (Whether val : values()) {
|
||||||
|
if (val.getValue().equals(value)) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -74,7 +74,7 @@ public class ChargeItem extends HisBaseEntity {
|
|||||||
/** 费用定价ID */
|
/** 费用定价ID */
|
||||||
private Long definitionId;
|
private Long definitionId;
|
||||||
|
|
||||||
/** applicability表主键 */
|
/** 定价子表主键 */
|
||||||
private Long applicabilityId;
|
private Long applicabilityId;
|
||||||
|
|
||||||
/** 原价 */
|
/** 原价 */
|
||||||
@@ -98,12 +98,18 @@ public class ChargeItem extends HisBaseEntity {
|
|||||||
/** 开立时间 */
|
/** 开立时间 */
|
||||||
private Date enteredDate;
|
private Date enteredDate;
|
||||||
|
|
||||||
/** 医疗服务类型 */
|
/** 医疗服务所在表 */
|
||||||
private String serviceTable;
|
private String serviceTable;
|
||||||
|
|
||||||
/** 医疗服务ID */
|
/** 医疗服务ID */
|
||||||
private Long serviceId;
|
private Long serviceId;
|
||||||
|
|
||||||
|
/** 产品所在表 */
|
||||||
|
private String productTable;
|
||||||
|
|
||||||
|
/** 产品ID */
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
/** 索赔结果 */
|
/** 索赔结果 */
|
||||||
private Integer claimStateEnum;
|
private Integer claimStateEnum;
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.openhis.administration.domain;
|
package com.openhis.administration.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
import com.core.common.core.domain.HisBaseEntity;
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
import com.openhis.common.enums.ActPriority;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
@@ -55,5 +55,8 @@ public class ChargeItemDefApp extends HisBaseEntity {
|
|||||||
/** 价格 */
|
/** 价格 */
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
public ChargeItemDefApp() {
|
||||||
|
// 默认优先级:常规
|
||||||
|
this.priority = ActPriority.ROUTINE.getValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -35,13 +35,16 @@ public class Location extends HisBaseEntity {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/** 状态编码 */
|
/** 状态编码 */
|
||||||
private LocationStatus statusEnum;
|
// private LocationStatus statusEnum;
|
||||||
|
private Integer statusEnum;
|
||||||
|
|
||||||
/** 操作状态 */
|
/** 操作状态 */
|
||||||
private LocationBedStatus operationalEnum;
|
// private LocationBedStatus operationalEnum;
|
||||||
|
private Integer operationalEnum;
|
||||||
|
|
||||||
/** 模式编码 */
|
/** 模式编码 */
|
||||||
private LocationMode modeEnum;
|
// private LocationMode modeEnum;
|
||||||
|
private Integer modeEnum;
|
||||||
|
|
||||||
/** 模式编码 */
|
/** 模式编码 */
|
||||||
private String typeCode;
|
private String typeCode;
|
||||||
@@ -65,8 +68,8 @@ public class Location extends HisBaseEntity {
|
|||||||
/** 显示顺序 */
|
/** 显示顺序 */
|
||||||
private Integer displayOrder;
|
private Integer displayOrder;
|
||||||
|
|
||||||
public Location(Long id, String busNo, String name, LocationStatus statusEnum, LocationBedStatus operationalEnum,
|
public Location(Long id, String busNo, String name, Integer statusEnum, Integer operationalEnum,
|
||||||
LocationMode modeEnum, String typeCode, String typeJson, String pyStr, String wbStr, Integer formEnum,
|
Integer modeEnum, String typeCode, String typeJson, String pyStr, String wbStr, Integer formEnum,
|
||||||
Long organizationId, Integer displayOrder) {
|
Long organizationId, Integer displayOrder) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.busNo = busNo;
|
this.busNo = busNo;
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
package com.openhis.administration.domain;
|
package com.openhis.administration.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
import com.core.common.core.domain.HisBaseEntity;
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
@@ -58,5 +55,4 @@ public class PractitionerRole extends HisBaseEntity {
|
|||||||
/** 有效时间 */
|
/** 有效时间 */
|
||||||
private String availabilityJson;
|
private String availabilityJson;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.openhis.administration.service;
|
package com.openhis.administration.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.openhis.administration.domain.ChargeItem;
|
import com.openhis.administration.domain.ChargeItem;
|
||||||
|
|
||||||
@@ -12,19 +14,11 @@ import com.openhis.administration.domain.ChargeItem;
|
|||||||
public interface IChargeItemService extends IService<ChargeItem> {
|
public interface IChargeItemService extends IService<ChargeItem> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存chargeItem相关信息
|
* 创建已计费的采购账单
|
||||||
*
|
*
|
||||||
* @return 保存结果
|
* @param chargeItemList 采购账单
|
||||||
*/
|
*/
|
||||||
boolean saveChargeItem(ChargeItem chargeItem);
|
void createBilledPurchaseCharge(List<ChargeItem> chargeItemList);
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新收费项目
|
|
||||||
*
|
|
||||||
* @param chargeItem 更新内容
|
|
||||||
* @return 更新结果
|
|
||||||
*/
|
|
||||||
boolean updateChargeItem(ChargeItem chargeItem);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 门诊挂号时保存 费用项
|
* 门诊挂号时保存 费用项
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
package com.openhis.administration.service.impl;
|
package com.openhis.administration.service.impl;
|
||||||
|
|
||||||
import com.openhis.administration.domain.HealthcareService;
|
|
||||||
import com.openhis.common.constant.CommonConstants;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||||
|
import com.openhis.administration.domain.HealthcareService;
|
||||||
import com.openhis.administration.mapper.ChargeItemDefinitionMapper;
|
import com.openhis.administration.mapper.ChargeItemDefinitionMapper;
|
||||||
import com.openhis.administration.service.IChargeItemDefinitionService;
|
import com.openhis.administration.service.IChargeItemDefinitionService;
|
||||||
|
import com.openhis.common.constant.CommonConstants;
|
||||||
import com.openhis.common.enums.DelFlag;
|
import com.openhis.common.enums.DelFlag;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 费用定价管理Service业务层处理
|
* 费用定价管理Service业务层处理
|
||||||
@@ -77,7 +76,6 @@ public class ChargeItemDefinitionServiceImpl extends ServiceImpl<ChargeItemDefin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过服务管理新增费用定价
|
* 通过服务管理新增费用定价
|
||||||
*
|
*
|
||||||
@@ -86,7 +84,8 @@ public class ChargeItemDefinitionServiceImpl extends ServiceImpl<ChargeItemDefin
|
|||||||
* @return 新增结果
|
* @return 新增结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean addChargeItemDefinitionByHealthcareService(HealthcareService healthcareService, ChargeItemDefinition chargeItemDefinition) {
|
public boolean addChargeItemDefinitionByHealthcareService(HealthcareService healthcareService,
|
||||||
|
ChargeItemDefinition chargeItemDefinition) {
|
||||||
// 服务管理主键id
|
// 服务管理主键id
|
||||||
if (healthcareService.getId() != null) {
|
if (healthcareService.getId() != null) {
|
||||||
chargeItemDefinition.setInstanceTable(CommonConstants.TableName.ADM_HEALTHCARE_SERVICE);
|
chargeItemDefinition.setInstanceTable(CommonConstants.TableName.ADM_HEALTHCARE_SERVICE);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.openhis.administration.service.impl;
|
package com.openhis.administration.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -22,38 +24,13 @@ public class ChargeItemServiceImpl extends ServiceImpl<ChargeItemMapper, ChargeI
|
|||||||
private final ChargeItemMapper chargeItemMapper;
|
private final ChargeItemMapper chargeItemMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存chargeItem相关信息
|
* 创建已计费的采购账单
|
||||||
*
|
*
|
||||||
* @return 保存结果
|
* @param chargeItemList 采购账单
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean saveChargeItem(ChargeItem chargeItem) {
|
public void createBilledPurchaseCharge(List<ChargeItem> chargeItemList) {
|
||||||
// 假设此处有业务相关处理
|
|
||||||
if (chargeItem.getBusNo() == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return chargeItemMapper.insert(chargeItem) > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新收费项目
|
|
||||||
*
|
|
||||||
* @param chargeItem 更新内容
|
|
||||||
* @return 更新结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean updateChargeItem(ChargeItem chargeItem) {
|
|
||||||
// 更新样例 一切以实际为主
|
|
||||||
if (chargeItem.getId() != null) {
|
|
||||||
// 获取更新前收费项目,避免更新导致数据库崩溃
|
|
||||||
if (chargeItemMapper.selectById(chargeItem.getId()) == null) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return chargeItemMapper.updateById(chargeItem) > 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -31,8 +31,11 @@ public class InventoryItem extends HisBaseEntity {
|
|||||||
/** 物品类别 */
|
/** 物品类别 */
|
||||||
private Integer categoryEnum;
|
private Integer categoryEnum;
|
||||||
|
|
||||||
/** 编码 */
|
/** 项目 */
|
||||||
private String busNo;
|
private String itemTable;
|
||||||
|
|
||||||
|
/** 物品编码 */
|
||||||
|
private Long itemId;
|
||||||
|
|
||||||
/** 名称 */
|
/** 名称 */
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ import java.util.Date;
|
|||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
|
||||||
import com.core.common.core.domain.HisBaseEntity;
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
import com.openhis.common.enums.EventStatus;
|
||||||
|
import com.openhis.common.enums.SupplyType;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
@@ -73,10 +75,10 @@ public class SupplyDelivery extends HisBaseEntity {
|
|||||||
/** 发放时间 */
|
/** 发放时间 */
|
||||||
private Date occurrenceTime;
|
private Date occurrenceTime;
|
||||||
|
|
||||||
/** 发放开始时间 */
|
/** 开始时间 */
|
||||||
private Date occurrenceStartTime;
|
private Date occurrenceStartTime;
|
||||||
|
|
||||||
/** 发放结束时间 */
|
/** 结束时间 */
|
||||||
private Date occurrenceEndTime;
|
private Date occurrenceEndTime;
|
||||||
|
|
||||||
/** 发放周期时间 */
|
/** 发放周期时间 */
|
||||||
@@ -86,7 +88,12 @@ public class SupplyDelivery extends HisBaseEntity {
|
|||||||
private Long receiverId;
|
private Long receiverId;
|
||||||
|
|
||||||
/** 接收时间 */
|
/** 接收时间 */
|
||||||
private Date receiveDateTime;
|
private Date receiveTime;
|
||||||
|
|
||||||
|
|
||||||
|
public SupplyDelivery() {
|
||||||
|
// 默认发放状态:进行中
|
||||||
|
this.statusEnum = EventStatus.IN_PROGRESS.getValue();
|
||||||
|
// 默认发放类型:
|
||||||
|
this.typeEnum = SupplyType.PRODUCT_ALLOCATION.getValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,16 @@
|
|||||||
package com.openhis.workflow.domain;
|
package com.openhis.workflow.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.core.common.core.domain.HisBaseEntity;
|
import com.core.common.core.domain.HisBaseEntity;
|
||||||
|
import com.openhis.common.enums.ActPriority;
|
||||||
|
import com.openhis.common.enums.SupplyCategory;
|
||||||
|
import com.openhis.common.enums.SupplyStatus;
|
||||||
|
import com.openhis.common.enums.SupplyType;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -54,26 +59,17 @@ public class SupplyRequest extends HisBaseEntity {
|
|||||||
/** 患者id */
|
/** 患者id */
|
||||||
private Long patientId;
|
private Long patientId;
|
||||||
|
|
||||||
/** 发放实体表名 */
|
|
||||||
private String dispenseTable;
|
|
||||||
|
|
||||||
/** 发放id */
|
|
||||||
private Long dispenseId;
|
|
||||||
|
|
||||||
/** 项目 */
|
/** 项目 */
|
||||||
private String itemTable;
|
private String itemTable;
|
||||||
|
|
||||||
/** 数量 */
|
/** 数量 */
|
||||||
private Integer itemQuantity;
|
private BigDecimal itemQuantity;
|
||||||
|
|
||||||
/** 物品编码 */
|
/** 物品编码 */
|
||||||
private Long itemId;
|
private Long itemId;
|
||||||
|
|
||||||
/** 物品计量单位 */
|
/** 物品计量单位 */
|
||||||
private String unitIdCode;
|
private String unitCode;
|
||||||
|
|
||||||
/** 物品数量 */
|
|
||||||
private Integer unitQuantity;
|
|
||||||
|
|
||||||
/** 请求细节 */
|
/** 请求细节 */
|
||||||
private String detailJson;
|
private String detailJson;
|
||||||
@@ -120,4 +116,35 @@ public class SupplyRequest extends HisBaseEntity {
|
|||||||
/** 申请时间 */
|
/** 申请时间 */
|
||||||
private Date applyTime;
|
private Date applyTime;
|
||||||
|
|
||||||
|
/** 产品批号 */
|
||||||
|
private String lotNumber;
|
||||||
|
|
||||||
|
/** 追溯码 */
|
||||||
|
private String traceNo;
|
||||||
|
|
||||||
|
/** 发票号 */
|
||||||
|
private String invoiceNo;
|
||||||
|
|
||||||
|
/** 开始时间 */
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/** 单价 */
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
/** 总价 */
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
public SupplyRequest() {
|
||||||
|
// 默认单据类型:商品调拨
|
||||||
|
this.typeEnum = SupplyType.PRODUCT_ALLOCATION.getValue();
|
||||||
|
// 默认单据状态:待审核
|
||||||
|
this.statusEnum = SupplyStatus.PENDING_APPROVAL.getValue();
|
||||||
|
// 默认单据分类:库存供应
|
||||||
|
this.categoryEnum = SupplyCategory.STOCK_SUPPLY.getValue();
|
||||||
|
// 默认优先级:常规
|
||||||
|
this.priorityEnum = ActPriority.ROUTINE.getValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,9 @@ package com.openhis.workflow.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.openhis.workflow.domain.InventoryItem;
|
import com.openhis.workflow.domain.InventoryItem;
|
||||||
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存项目管理Service接口
|
* 库存项目管理Service接口
|
||||||
@@ -11,4 +14,10 @@ import com.openhis.workflow.domain.InventoryItem;
|
|||||||
*/
|
*/
|
||||||
public interface IInventoryItemService extends IService<InventoryItem> {
|
public interface IInventoryItemService extends IService<InventoryItem> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库
|
||||||
|
*
|
||||||
|
* @param InventoryItemList 入库项目
|
||||||
|
*/
|
||||||
|
void stockIn(List<InventoryItem> InventoryItemList);
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,12 @@
|
|||||||
package com.openhis.workflow.service;
|
package com.openhis.workflow.service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.core.common.core.domain.R;
|
||||||
import com.openhis.workflow.domain.SupplyDelivery;
|
import com.openhis.workflow.domain.SupplyDelivery;
|
||||||
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应发放管理Service接口
|
* 供应发放管理Service接口
|
||||||
@@ -11,4 +16,11 @@ import com.openhis.workflow.domain.SupplyDelivery;
|
|||||||
*/
|
*/
|
||||||
public interface ISupplyDeliveryService extends IService<SupplyDelivery> {
|
public interface ISupplyDeliveryService extends IService<SupplyDelivery> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据单据,发放物品
|
||||||
|
*
|
||||||
|
* @param supplyRequestList 单据信息
|
||||||
|
* @param supplyRequestList 单据信息
|
||||||
|
*/
|
||||||
|
List<SupplyDelivery> createCompletedSupplyDelivery(List<SupplyRequest> supplyRequestList, Date now);
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.openhis.workflow.service;
|
package com.openhis.workflow.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.core.common.core.domain.model.LoginUser;
|
||||||
import com.openhis.workflow.domain.SupplyRequest;
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,12 +16,61 @@ import com.openhis.workflow.domain.SupplyRequest;
|
|||||||
public interface ISupplyRequestService extends IService<SupplyRequest> {
|
public interface ISupplyRequestService extends IService<SupplyRequest> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询供应申请分页列表
|
* 通过单据号查询单据信息
|
||||||
*
|
*
|
||||||
* @param supplyRequest 查询条件
|
* @param busNo 单据号
|
||||||
* @return 供应申请列表
|
* @return 单据信息
|
||||||
*/
|
*/
|
||||||
Page<SupplyRequest> getPage(SupplyRequest supplyRequest, Integer pageNo, Integer pageSize);
|
List<SupplyRequest> getSupplyByBusNo(String busNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同意申请
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @param loginUser 登录用户信息
|
||||||
|
* @param now 当前时间
|
||||||
|
* @return 单据详情
|
||||||
|
*/
|
||||||
|
List<SupplyRequest> agreeRequest(String busNo, LoginUser loginUser, Date now);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交审批
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
boolean submitApproval(String busNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤回
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
boolean withdrawApproval(String busNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驳回申请
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @param loginUser 登录用户信息
|
||||||
|
* @param now 当前时间
|
||||||
|
*/
|
||||||
|
boolean rejectRequest(String busNo, LoginUser loginUser, Date now);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取供应项目所在表
|
||||||
|
*
|
||||||
|
* @param agreedList 供应单据信息
|
||||||
|
* @return 供应项目所在表
|
||||||
|
*/
|
||||||
|
String getItemTable(List<SupplyRequest> agreedList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取供应的物品
|
||||||
|
*
|
||||||
|
* @param agreedList 供应单据
|
||||||
|
* @return 物品id
|
||||||
|
*/
|
||||||
|
List<Long> getItem(List<SupplyRequest> agreedList);
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.openhis.workflow.service.impl;
|
package com.openhis.workflow.service.impl;
|
||||||
|
|
||||||
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -7,6 +8,8 @@ import com.openhis.workflow.domain.InventoryItem;
|
|||||||
import com.openhis.workflow.mapper.InventoryItemMapper;
|
import com.openhis.workflow.mapper.InventoryItemMapper;
|
||||||
import com.openhis.workflow.service.IInventoryItemService;
|
import com.openhis.workflow.service.IInventoryItemService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存项目管理Service业务层处理
|
* 库存项目管理Service业务层处理
|
||||||
*
|
*
|
||||||
@@ -16,4 +19,13 @@ import com.openhis.workflow.service.IInventoryItemService;
|
|||||||
@Service
|
@Service
|
||||||
public class InventoryItemServiceImpl extends ServiceImpl<InventoryItemMapper, InventoryItem> implements IInventoryItemService {
|
public class InventoryItemServiceImpl extends ServiceImpl<InventoryItemMapper, InventoryItem> implements IInventoryItemService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库
|
||||||
|
*
|
||||||
|
* @param inventoryItemList 入库项目
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void stockIn(List<InventoryItem> inventoryItemList) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,16 @@
|
|||||||
package com.openhis.workflow.service.impl;
|
package com.openhis.workflow.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.openhis.common.enums.EventStatus;
|
||||||
|
import com.openhis.common.enums.SupplyType;
|
||||||
import com.openhis.workflow.domain.SupplyDelivery;
|
import com.openhis.workflow.domain.SupplyDelivery;
|
||||||
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
import com.openhis.workflow.mapper.SupplyDeliveryMapper;
|
import com.openhis.workflow.mapper.SupplyDeliveryMapper;
|
||||||
import com.openhis.workflow.service.ISupplyDeliveryService;
|
import com.openhis.workflow.service.ISupplyDeliveryService;
|
||||||
|
|
||||||
@@ -14,6 +21,60 @@ import com.openhis.workflow.service.ISupplyDeliveryService;
|
|||||||
* @date 2025-02-20
|
* @date 2025-02-20
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SupplyDeliveryServiceImpl extends ServiceImpl<SupplyDeliveryMapper, SupplyDelivery> implements ISupplyDeliveryService {
|
public class SupplyDeliveryServiceImpl extends ServiceImpl<SupplyDeliveryMapper, SupplyDelivery>
|
||||||
|
implements ISupplyDeliveryService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据单据,发放物品
|
||||||
|
*
|
||||||
|
* @param supplyRequestList 单据信息
|
||||||
|
* @param now 当前时间
|
||||||
|
* @return 发放详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SupplyDelivery> createCompletedSupplyDelivery(List<SupplyRequest> supplyRequestList, Date now) {
|
||||||
|
|
||||||
|
List<SupplyDelivery> deliveryList = new ArrayList<>();
|
||||||
|
// 根据申请单据生成发放单据
|
||||||
|
for (SupplyRequest supplyRequest : supplyRequestList) {
|
||||||
|
SupplyDelivery supplyDelivery = new SupplyDelivery();
|
||||||
|
supplyDelivery
|
||||||
|
// 请求id
|
||||||
|
.setRequestId(supplyRequest.getId())
|
||||||
|
// 发放状态:已完成
|
||||||
|
.setStatusEnum(EventStatus.COMPLETED.getValue())
|
||||||
|
// 单据类型:采购入库
|
||||||
|
.setTypeEnum(SupplyType.PURCHASE_INVENTORY.getValue())
|
||||||
|
// 发放项目所在表
|
||||||
|
.setItemTable(supplyRequest.getItemTable())
|
||||||
|
// 发放物品id
|
||||||
|
.setItemId(supplyRequest.getItemId())
|
||||||
|
// 物品单位
|
||||||
|
.setUnitIdCode(supplyRequest.getUnitCode())
|
||||||
|
// 发放数量
|
||||||
|
.setQuantity(supplyRequest.getItemQuantity())
|
||||||
|
// 批次号
|
||||||
|
.setLotNumber(supplyRequest.getLotNumber())
|
||||||
|
// 追溯码
|
||||||
|
.setTraceNo(supplyRequest.getTraceNo())
|
||||||
|
// 供应商id
|
||||||
|
.setSupplierId(supplyRequest.getSupplierId())
|
||||||
|
// 审批人
|
||||||
|
.setPractitionerId(supplyRequest.getApplicantId())
|
||||||
|
// 发放时间
|
||||||
|
.setOccurrenceTime(now)
|
||||||
|
// 接收位置
|
||||||
|
.setReceiverId(supplyRequest.getPurposeLocationId())
|
||||||
|
// 接收时间
|
||||||
|
.setReceiveTime(now)
|
||||||
|
// 生产日期
|
||||||
|
.setOccurrenceStartTime(supplyRequest.getStartTime())
|
||||||
|
// 失效日期
|
||||||
|
.setOccurrenceEndTime(supplyRequest.getEndTime());
|
||||||
|
deliveryList.add(supplyDelivery);
|
||||||
|
// 新增发放单据
|
||||||
|
baseMapper.insert(supplyDelivery);
|
||||||
|
}
|
||||||
|
return deliveryList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,16 @@
|
|||||||
package com.openhis.workflow.service.impl;
|
package com.openhis.workflow.service.impl;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.openhis.common.enums.DelFlag;
|
import com.core.common.core.domain.model.LoginUser;
|
||||||
|
import com.openhis.common.enums.SupplyStatus;
|
||||||
import com.openhis.workflow.domain.SupplyRequest;
|
import com.openhis.workflow.domain.SupplyRequest;
|
||||||
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
import com.openhis.workflow.mapper.SupplyRequestMapper;
|
||||||
import com.openhis.workflow.service.ISupplyRequestService;
|
import com.openhis.workflow.service.ISupplyRequestService;
|
||||||
@@ -28,24 +33,98 @@ public class SupplyRequestServiceImpl extends ServiceImpl<SupplyRequestMapper, S
|
|||||||
private final SupplyRequestMapper supplyRequestMapper;
|
private final SupplyRequestMapper supplyRequestMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询供应申请列表
|
* 通过单据号查询单据信息
|
||||||
*
|
*
|
||||||
* @param supplyRequest 查询条件
|
* @param busNo 单据号
|
||||||
* @return 供应申请列表
|
* @return 单据信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Page<SupplyRequest> getPage(SupplyRequest supplyRequest, Integer pageNo, Integer pageSize) {
|
public List<SupplyRequest> getSupplyByBusNo(String busNo) {
|
||||||
|
return supplyRequestMapper
|
||||||
|
.selectList(new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo));
|
||||||
|
}
|
||||||
|
|
||||||
Page<SupplyRequest> supplyRequestList;
|
/**
|
||||||
// 判断入库数量
|
* 同意申请
|
||||||
if (supplyRequest.getItemQuantity() != 0) {
|
*
|
||||||
// 查询供应申请信息列表
|
* @param busNo 单据号
|
||||||
supplyRequestList = supplyRequestMapper.selectPage(new Page<>(pageNo, pageSize),
|
* @param loginUser 登录用户信息
|
||||||
new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getValue()));
|
* @param now 当前时间
|
||||||
} else {
|
* @return 单据详情
|
||||||
return null;
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SupplyRequest> agreeRequest(String busNo, LoginUser loginUser, Date now) {
|
||||||
|
// 更新单据状态
|
||||||
|
baseMapper.update(null,
|
||||||
|
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||||
|
.set(SupplyRequest::getApprovalTime, now).set(SupplyRequest::getApproverId, loginUser.getUserId())
|
||||||
|
.set(SupplyRequest::getStatusEnum, SupplyStatus.AGREE.getValue()));
|
||||||
|
// 返回单据详情
|
||||||
|
return this.getSupplyByBusNo(busNo);
|
||||||
}
|
}
|
||||||
// 返回入库信息列表
|
|
||||||
return supplyRequestList;
|
/**
|
||||||
|
* 提交审批
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean submitApproval(String busNo) {
|
||||||
|
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>()
|
||||||
|
.eq(SupplyRequest::getBusNo, busNo).set(SupplyRequest::getStatusEnum, SupplyStatus.APPROVAL.getValue()));
|
||||||
|
return updateCount > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤回
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean withdrawApproval(String busNo) {
|
||||||
|
int updateCount = baseMapper.update(null, new LambdaUpdateWrapper<SupplyRequest>()
|
||||||
|
.eq(SupplyRequest::getBusNo, busNo).set(SupplyRequest::getStatusEnum, SupplyStatus.WITHDRAW.getValue()));
|
||||||
|
return updateCount > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驳回申请
|
||||||
|
*
|
||||||
|
* @param busNo 单据号
|
||||||
|
* @param loginUser 登录用户信息
|
||||||
|
* @param now 当前时间
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean rejectRequest(String busNo, LoginUser loginUser, Date now) {
|
||||||
|
// 更新单据状态
|
||||||
|
int updateCount = baseMapper.update(null,
|
||||||
|
new LambdaUpdateWrapper<SupplyRequest>().eq(SupplyRequest::getBusNo, busNo)
|
||||||
|
.set(SupplyRequest::getApprovalTime, now).set(SupplyRequest::getApproverId, loginUser.getUserId())
|
||||||
|
.set(SupplyRequest::getStatusEnum, SupplyStatus.REJECT.getValue()));
|
||||||
|
return updateCount > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取供应项目所在表
|
||||||
|
*
|
||||||
|
* @param agreedList 供应单据信息
|
||||||
|
* @return 供应项目所在表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getItemTable(List<SupplyRequest> agreedList) {
|
||||||
|
return agreedList.stream().map(SupplyRequest::getItemTable).findFirst().orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取供应的物品
|
||||||
|
*
|
||||||
|
* @param agreedList 供应单据
|
||||||
|
* @return 物品id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Long> getItem(List<SupplyRequest> agreedList) {
|
||||||
|
return agreedList.stream().map(SupplyRequest::getItemId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user