Commit 0b060689 by huangtao

physic

parent 0f5a6a8c
package com.jmai.physic.controller;
import com.jmai.physic.alihealth.AlihealthService;
import com.jmai.physic.dto.PhysicApplyCreateReq;
import com.jmai.physic.dto.PhysicInfoDTO;
import com.jmai.physic.dto.PhysicWarehouseCreateReq;
import com.jmai.physic.service.PhysicApplyService;
import com.jmai.physic.service.PhysicWarehouseService;
import com.jmai.physic.vo.PhysicApplyVO;
import com.jmai.physic.vo.PhysicWarehouseVO;
import com.jmai.sys.AbstractService;
import com.jmai.sys.dto.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
@Slf4j
//@Auth
@RestController
@RequestMapping("/physicApply")
@Api(tags = "药品入库单据")
@ApiImplicitParams({@ApiImplicitParam(paramType = "header", name = "Access-Token", value = "凭证", required = true, dataType = "string")})
public class PhysicApplyController extends AbstractService {
@Resource
private PhysicApplyService physicApplyService;
@PostMapping("/create")
@ApiOperation(value = "创建申请单据")
public ResponseData<PhysicApplyVO> createPhysicWarehouse(@RequestBody @Valid PhysicApplyCreateReq req) {
PhysicApplyVO physicApply = physicApplyService.createPhysicApply(req);
return ResponseData.ok(physicApply);
}
@PostMapping("/getInfo")
@ApiOperation(value = "获取申请单据信息")
public ResponseData<PhysicApplyVO> getInfo(@RequestParam Long physicApplyId) {
PhysicApplyVO physicApplyVO= physicApplyService.getInfo(physicApplyId);
return ResponseData.ok(physicApplyVO);
}
}
package com.jmai.physic.dto;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jmai.sys.entity.BaseVersionEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(description = "药品申请信息")
@TableName("physic_apply")
public class PhysicApplyCreateReq {
@ApiModelProperty(value = "药品名称")
private String physicName;
@ApiModelProperty(value = "药品类型")
private String physicType;
private String physicTypeDesc;
private String pkgSpecCrit;
private String prepnSpec;
private String prepnTypeDesc;
private Integer returnNum;
private Integer prescriptionNum;
private Integer requisitionNum;
private Integer actualNum;
@ApiModelProperty(value = "批号")
private String batchNo;
}
package com.jmai.physic.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jmai.sys.entity.BaseVersionEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(description = "药品申请信息")
@TableName("physic_apply")
public class PhysicApply extends BaseVersionEntity{
@ApiModelProperty(value = "药品名称")
private String physicName;
@ApiModelProperty(value = "药品类型")
private String physicType;
private String physicTypeDesc;
private String pkgSpecCrit;
private String prepnSpec;
private String prepnTypeDesc;
private Integer returnNum;
private Integer prescriptionNum;
private Integer requisitionNum;
private Integer actualNum;
@ApiModelProperty(value = "批号")
private String batchNo;
@ApiModelProperty(value = "发药部门")
private Long fyDeptId;
@ApiModelProperty(value = "领药部门")
private Long lyDeptId;
@ApiModelProperty(value = "状态 0 -待领药/待审核 1-待发药 2 -待复核 3 -完成")
private Integer status;
}
......@@ -25,7 +25,7 @@ public class PhysicWarehouse extends BaseVersionEntity{
private String prepnTypeDesc;
@ApiModelProperty(value = "失效时间")
private String exprieDate;
private String expireDate;
@ApiModelProperty(value = "凭证号")
private String voucherNo;
......@@ -39,6 +39,6 @@ public class PhysicWarehouse extends BaseVersionEntity{
@ApiModelProperty(value = "供应商")
private String supplyName;
@ApiModelProperty(value = "状态")
@ApiModelProperty(value = "状态 0 -待验收 1-待复核 2 -待保管 3 -完成")
private Integer status;
}
package com.jmai.physic.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jmai.physic.entity.PhysicApply;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PhysicApplyMapper extends BaseMapper<PhysicApply> {
}
package com.jmai.physic.service;
import com.jmai.physic.dto.PhysicApplyCreateReq;
import com.jmai.physic.dto.PhysicWarehouseCreateReq;
import com.jmai.physic.vo.PhysicApplyVO;
import com.jmai.physic.vo.PhysicWarehouseVO;
public interface PhysicApplyService {
PhysicApplyVO createPhysicApply(PhysicApplyCreateReq req);
PhysicApplyVO getInfo(Long physicApplyId);
}
package com.jmai.physic.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.jmai.physic.dto.PhysicApplyCreateReq;
import com.jmai.physic.dto.PhysicWarehouseCreateReq;
import com.jmai.physic.entity.PhysicApply;
import com.jmai.physic.entity.PhysicWarehouse;
import com.jmai.physic.mapper.PhysicApplyMapper;
import com.jmai.physic.mapper.PhysicWarehouseMapper;
import com.jmai.physic.service.PhysicApplyService;
import com.jmai.physic.service.PhysicWarehouseService;
import com.jmai.physic.vo.PhysicApplyVO;
import com.jmai.physic.vo.PhysicWarehouseVO;
import com.jmai.sys.AbstractService;
import com.jmai.sys.ctx.SpringContextUtils;
import com.jmai.sys.entity.SysDept;
import com.jmai.sys.entity.SysUser;
import com.jmai.sys.mapper.SysDeptMapper;
import com.jmai.sys.mapper.SysUserMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class PhysicApplyServiceImpl extends AbstractService implements PhysicApplyService {
@Resource
private PhysicApplyMapper physicApplyMapper;
@Resource
private SysUserMapper sysUserMapper;
@Resource
private SysDeptMapper sysDeptMapper;
@Override
public PhysicApplyVO createPhysicApply(PhysicApplyCreateReq req) {
PhysicApply apply =new PhysicApply();
BeanUtil.copyProperties(req,apply);
Long userId = SpringContextUtils.getUserId();
SysUser sysUser = sysUserMapper.selectById(userId);
Long deptId = sysUser.getDeptId();
SysDept sysDept = sysDeptMapper.selectById(deptId);
apply.setLyDeptId(deptId);
apply.setFyDeptId(sysDept.getParentId());
apply.setStatus(0);
physicApplyMapper.insert(apply);
PhysicApplyVO info = getInfo(apply.getId());
return info;
}
@Override
public PhysicApplyVO getInfo(Long physicApplyId) {
PhysicApply apply = physicApplyMapper.selectById(physicApplyId);
PhysicApplyVO vo = new PhysicApplyVO();
BeanUtil.copyProperties(apply,vo);
vo.setPhysicApplyId(physicApplyId);
return vo;
}
}
......@@ -21,6 +21,7 @@ public class PhysicWarehouseServiceImpl extends AbstractService implements Phys
public PhysicWarehouseVO createPhysicWarehouse(PhysicWarehouseCreateReq req) {
PhysicWarehouse physicWarehouse = new PhysicWarehouse();
BeanUtil.copyProperties(req,physicWarehouse);
physicWarehouse.setStatus(0);
physicWarehouseMapper.insert(physicWarehouse);
PhysicWarehouseVO info = getInfo(physicWarehouse.getId());
return info;
......@@ -31,6 +32,7 @@ public class PhysicWarehouseServiceImpl extends AbstractService implements Phys
PhysicWarehouse physicWarehouse = physicWarehouseMapper.selectById(physicWarehouseId);
PhysicWarehouseVO vo = new PhysicWarehouseVO();
BeanUtil.copyProperties(physicWarehouse,vo);
vo.setPhysicWarehouseId(physicWarehouseId);
return vo;
}
}
package com.jmai.physic.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class PhysicApplyVO {
private Long physicApplyId;
@ApiModelProperty(value = "药品名称")
private String physicName;
@ApiModelProperty(value = "药品类型")
private String physicType;
private String physicTypeDesc;
private String pkgSpecCrit;
private String prepnSpec;
private String prepnTypeDesc;
private Integer returnNum;
private Integer prescriptionNum;
private Integer requisitionNum;
private Integer actualNum;
@ApiModelProperty(value = "批号")
private String batchNo;
@ApiModelProperty(value = "状态 0 -待领药 1-待审核 2 -待发药 3 -待复核 4 -完成")
private Integer status;
}
......@@ -5,6 +5,10 @@ import lombok.Data;
@Data
public class PhysicWarehouseVO {
private Long physicWarehouseId;
@ApiModelProperty(value = "药品名称")
private String physicName;
......
......@@ -10,7 +10,6 @@ import com.jmai.sys.dto.DeptUpdateReq;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import static com.jmai.sys.exception.ErrorCode.DEPT_NOT_FOUND;
public interface DeptService {
......
......@@ -67,7 +67,7 @@ public class DeptServiceImpl extends AbstractService implements DeptService {
Optional<DeptDto> existed = getDeptByName(req.getDeptName());
if (existed.isPresent()) {
throw new ServiceException(DEPT_NAME_EXISTED, ":仓库名称=" + req.getDeptName());
throw new ServiceException(DEPT_NAME_EXISTED, ":部门名称=" + req.getDeptName());
}
SysDept dept = copyTo(req, new SysDept());
if(ObjectUtil.isNotEmpty(req.getParentId())){
......
......@@ -36395,3 +36395,29 @@ sun.misc.Launcher$AppClassLoader@255316f2
[jmai:38098::] 2025-09-19 01:40:34.133[DEBUG] 6180 [] [infy-main housekeeper:273458] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:41:04.146[DEBUG] 6180 [] [infy-main housekeeper:303471] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:41:04.147[DEBUG] 6180 [] [infy-main housekeeper:303472] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:41:34.161[DEBUG] 6180 [] [infy-main housekeeper:333486] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:41:34.161[DEBUG] 6180 [] [infy-main housekeeper:333486] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:42:04.161[DEBUG] 6180 [] [infy-main housekeeper:363486] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:42:04.162[DEBUG] 6180 [] [infy-main housekeeper:363487] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:42:34.173[DEBUG] 6180 [] [infy-main housekeeper:393498] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:42:34.174[DEBUG] 6180 [] [infy-main housekeeper:393499] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:43:04.186[DEBUG] 6180 [] [infy-main housekeeper:423511] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:43:04.186[DEBUG] 6180 [] [infy-main housekeeper:423511] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:43:34.190[DEBUG] 6180 [] [infy-main housekeeper:453515] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:43:34.190[DEBUG] 6180 [] [infy-main housekeeper:453515] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:44:04.202[DEBUG] 6180 [] [infy-main housekeeper:483527] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:44:04.202[DEBUG] 6180 [] [infy-main housekeeper:483527] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:44:34.204[DEBUG] 6180 [] [infy-main housekeeper:513529] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:44:34.204[DEBUG] 6180 [] [infy-main housekeeper:513529] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:45:04.207[DEBUG] 6180 [] [infy-main housekeeper:543532] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:45:04.207[DEBUG] 6180 [] [infy-main housekeeper:543532] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:45:34.215[DEBUG] 6180 [] [infy-main housekeeper:573540] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:45:34.215[DEBUG] 6180 [] [infy-main housekeeper:573540] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:46:04.224[DEBUG] 6180 [] [infy-main housekeeper:603549] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:46:04.224[DEBUG] 6180 [] [infy-main housekeeper:603549] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:46:34.231[DEBUG] 6180 [] [infy-main housekeeper:633556] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:46:34.231[DEBUG] 6180 [] [infy-main housekeeper:633556] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:47:04.244[DEBUG] 6180 [] [infy-main housekeeper:663569] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:47:04.244[DEBUG] 6180 [] [infy-main housekeeper:663569] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
[jmai:38098::] 2025-09-19 01:47:34.252[DEBUG] 6180 [] [infy-main housekeeper:693577] [com.zaxxer.hikari.pool.HikariPool.logPoolState:421] infy-main - Pool stats (total=10, active=0, idle=10, waiting=0)
[jmai:38098::] 2025-09-19 01:47:34.252[DEBUG] 6180 [] [infy-main housekeeper:693577] [com.zaxxer.hikari.pool.HikariPool.fillPool:517] infy-main - Fill pool skipped, pool is at sufficient level.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment